Comments() as $Comment)
{
Blog_PrintComment($Comment);
}
}
/**
* Print a comment.
* @param Message $Comment Comment to print.
*/
function Blog_PrintComment(Message $Comment)
{
$Blog = $GLOBALS["G_PluginManager"]->GetPluginForCurrentPage();
$Author = new CWUser(intval($Comment->PosterId()));
$CanEditComment = $Blog->UserCanEditComment($GLOBALS["G_User"], $Comment);
$CanDeleteComment = $Blog->UserCanDeleteComment($GLOBALS["G_User"], $Comment);
$CanEditUsers = $Blog->UserCanEditUsers($GLOBALS["G_User"]);
# encode values for HTML output
$SafeCommentId = defaulthtmlentities($Comment->MessageId());
$SafeBody = nl2br(defaulthtmlentities($Comment->Body()));
$SafeEntryId = defaulthtmlentities($Comment->ParentId());
$SafePosterId = defaulthtmlentities($Author->Id());
$SafePosterName = defaulthtmlentities($Author->GetBestName());
$SafePostedDate = defaulthtmlentities(Blog_FormatTimestampForDisplay($Comment->DatePosted()));
$SafePostedDateForParsing = defaulthtmlentities(Blog_FormatTimestampForParsing($Comment->DatePosted()));
?>
Id());
$Data = $GLOBALS["AF"]->SignalEvent("EVENT_APPEND_HTML_TO_FORM",
array("PageName" => "AddResourceComment",
"FormName"=>"CommentForm",
"Labels" => array(),
"InputElements" => array(),
"Notes" => array()));
# Extract the results.
$Labels = $Data["Labels"];
$InputElements = $Data["InputElements"];
$Notes = $Data["Notes"];
?>
';
$ImageInsert .= '

';
# add the caption if not the default value
if ($Entry->HasCaption($Image))
{
$ImageInsert .= '
'.$SafeImageAlt.'
';
}
$ImageInsert .= '
';
# determine at which insertion point to insert this images
$InsertionPointIndex = floor($ImagesInserted/$ImagesPerPoint);
$ImageInsertionPoint = $ImageInsertionPoints[$InsertionPointIndex];
# insert the image into the body, offsetting by earlier insertions
$Body = substr_replace(
$Body,
$ImageInsert,
$ImageInsertionPoint+$InsertionOffset,
0);
# increment the variables used to determine where to insert the next
# image
$InsertionOffset += strlen($ImageInsert);
$ImagesInserted += 1;
}
# remove the image insertion point
$Body = preg_replace(
'/'.Blog_Entry::BLANK_LINE_REGEX.'{5,}/',
"\n\n", $Body);
# return the body with the images inserted
return $Body;
}
/**
* Print some blog entry metrics.
* @param array $Metrics Array of blog entry metrics.
*/
function Blog_PrintEntryMetrics(array $Metrics)
{
$SafeNumViews = defaulthtmlentities(count($Metrics["Views"]));
$SafeNumEmail = defaulthtmlentities(count($Metrics["Shares/Email"]));
$SafeNumFacebook = defaulthtmlentities(count($Metrics["Shares/Facebook"]));
$SafeNumTwitter = defaulthtmlentities(count($Metrics["Shares/Twitter"]));
$SafeNumLinkedIn = defaulthtmlentities(count($Metrics["Shares/LinkedIn"]));
$SafeNumGooglePlus = defaulthtmlentities(count($Metrics["Shares/Google+"]));
?>
UserCanPostComment($GLOBALS["G_User"]);
$CanViewMetrics = $H_Blog->UserCanViewMetrics($GLOBALS["G_User"]);
$IsLoggedIn = $GLOBALS["G_User"]->IsLoggedIn();
if ($H_State == "OK")
{
$SafeId = defaulthtmlentities($H_Entry->Id());
$SafeUrl = defaulthtmlentities($H_Entry->EntryUrl());
$SafeTitle = $H_Entry->TitleForDisplay();
$SafeAuthor = defaulthtmlentities($H_Entry->AuthorForDisplay());
$SafeEditor = defaulthtmlentities($H_Entry->EditorForDisplay());
$SafeCreationDate = defaulthtmlentities($H_Entry->CreationDateForDisplay());
$SafeModificationDate = defaulthtmlentities($H_Entry->ModificationDateForDisplay());
$SafePublicationDate = defaulthtmlentities($H_Entry->PublicationDateForDisplay());
$SafePublicationDatePrefix = defaulthtmlentities($H_Entry->PublicationDateDisplayPrefix());
$SafePublicationDateForParsing = defaulthtmlentities($H_Entry->PublicationDateForParsing());
$Body = Blog_GetEntryBody($H_Entry);
$Categories = $H_Entry->CategoriesForDisplay();
$NotificationsEnabled = $H_Blog->NotificationsCouldBeSent();
$UserIsLoggedIn = $GLOBALS["G_User"]->IsLoggedIn();
$UserIsSubscribed =
$H_Blog->UserIsSubscribedToNotifications($GLOBALS["G_User"]);
$DisplayNotificationButton = $H_Blog->NotificationsCouldBeSent(NULL, $GLOBALS["G_User"]);
$NotificationButtonEnabled = $H_Blog->NotificationsCouldBeSent($H_Entry, $GLOBALS["G_User"]);
PageTitle(strip_tags($H_Entry->TitleForDisplay()));
}
else
{
PageTitle("Blog Entry Not Found");
}
?>
Comments
NumberOfComments() > 0) { ?> Log in to post a comment.There are no comments yet for this entry. Please Log In to post one.