Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:1 to 7 of 7
$posts = $rows['CountDiscussions'] + $rows['CountComments'];
// begin jimw 20061113
//if ($Context->Session->UserID > 0) //un-comment if you only want to show for logged in users
//{
if (!@$UserManager) $UserManager = $Context->ObjectFactory->NewContextObject($Context, "UserManager");
$AccountUserID = ForceIncomingInt("u", $Comment->AuthUserID);
if (!@$AccountUser)
{
$AccountUser = $UserManager->GetUserById($AccountUserID);
$DispFName = $AccountUser->FirstName;
$DispLName = $AccountUser->LastName;
$DispName = $DispFName . " " . $DispLName;
}
//} else {
// $DispName = "xxx";
//}
// end jimw 20061113
$RowNumber++;
if ($Context->Configuration['DISPLAY_ONLY_COMMENT_COUNT']) {
$CommentList .= ' '.$CommentGrid->Context->GetDefinition("Comments").': '.$posts.' ';
//$CommentList = str_replace('<li id="Comment_'.$Comment->CommentID, $CommentGrid->Context->GetDefinition("Comments").': '.$rows['CountComments'].'<li id="Comment_'.$Comment->CommentID, $CommentList);
} else {
$CommentList .= ' '.$DispName.' '.$CommentGrid->Context->GetDefinition("Comments").': '.$posts.' '.$CommentGrid->Context->GetDefinition("AccountCreatedShort").': '.TimeDiff($CommentGrid->Context, UnixTimestamp($rows['DateFirstVisit'])).' ('.$Comment->CommentID.')';
}
// $CommentList .= '<ul class="AuthorInformation"><li>'.$CommentGrid->Context->GetDefinition("Comments").': '.$posts.'</li><li>'.$CommentGrid->Context->GetDefinition("AccountCreatedShort").': '.TimeDiff($CommentGrid->Context, UnixTimestamp($rows['DateFirstVisit'])).'</li>';
if (in_array($Context->SelfUrl, array("index.php"))) {
//First Add Fields
function addExtraDiscussionFields(&$DiscussionGrid){
$s = &$DiscussionGrid->DelegateParameters['SqlBuilder'];
// Get author data
$s->AddSelect('FirstName', 'u', 'AuthFN'); //Author FirstName
$s->AddSelect('LastName', 'u', 'AuthLN'); //Author LastName
// Get last poster data
$s->AddSelect('FirstName', 'lu', 'LastFN'); //LastUser FirstName
$s->AddSelect('LastName', 'lu', 'LastLN'); //LastUser LastName
}
$Context->AddToDelegate("DiscussionManager", "PostGetDiscussionBuilder", "addExtraDiscussionFields"); //Add that function to Delegate
//Then Get Properties From DataSet
function getPropertiesFromDataSet(&$Discussion){
$DataSet = &$Discussion->DelegateParameters['DataSet'];
// Get author data MINE
$Discussion->AuthUsername = @$DataSet['AuthFN'].' '.@$DataSet['AuthLN']; //Basically overwrite AuthUsername with what we pulled out in the previous function
$Discussion->LastUsername = @$DataSet['LastFN'].' '.@$DataSet['LastLN']; //Basically overwrite AuthUsername with what we pulled out in the previous function
}
$Context->AddToDelegate("Discussion", "PostGetPropertiesFromDataSet", "getPropertiesFromDataSet");
}
if (in_array($Context->SelfUrl, array("index.php"))) {
//First Add Fields
function addExtraDiscussionFields(&$DiscussionGrid){
$s = &$DiscussionGrid->DelegateParameters['SqlBuilder'];
// Get author data
$s->AddSelect('FirstName', 'u', 'AuthFN'); //Author FirstName
$s->AddSelect('LastName', 'u', 'AuthLN'); //Author LastName
// Get last poster data
$s->AddSelect('FirstName', 'lu', 'LastFN'); //LastUser FirstName
$s->AddSelect('LastName', 'lu', 'LastLN'); //LastUser LastName
}
$Context->AddToDelegate("DiscussionManager", "PostGetDiscussionBuilder", "addExtraDiscussionFields"); //Add that function to Delegate
//Then Get Properties From DataSet
function getPropertiesFromDataSet(&$Discussion){
$DataSet = &$Discussion->DelegateParameters['DataSet'];
// Get author data MINE
$Discussion->AuthUsername = @$DataSet['AuthFN'].' '.@$DataSet['AuthLN']; //Basically overwrite AuthUsername with what we pulled out in the previous function
$Discussion->LastUsername = @$DataSet['LastFN'].' '.@$DataSet['LastLN']; //Basically overwrite AuthUsername with what we pulled out in the previous function
}
$Context->AddToDelegate("Discussion", "PostGetPropertiesFromDataSet", "getPropertiesFromDataSet");
}
if (in_array($Context->SelfUrl, array("comments.php"))) {
//First Add Fields
function addExtraCommentFields(&$CommentGrid){
$s = &$CommentGrid->DelegateParameters['SqlBuilder'];
// Get author data
$s->AddSelect('FirstName', 'a', 'AuthFN'); //Author FirstName
$s->AddSelect('LastName', 'a', 'AuthLN'); //Author LastName
}
$Context->AddToDelegate("CommentManager", "CommentBuilder_PreWhere", "addExtraCommentFields"); //Add that function to Delegate
//Then Get Properties From DataSet
function getPropertiesFromDataSet(&$Comment){
$DataSet = &$Comment->DelegateParameters['DataSet'];
$Comment->AuthUsername = @$DataSet['AuthFN'].' '.@$DataSet['AuthLN']; //Basically overwrite AuthUsername with what we pulled out in the previous function
}
$Context->AddToDelegate("Comment", "PostGetPropertiesFromDataSet", "getPropertiesFromDataSet");
}
1 to 7 of 7