Comments() as $Comment) { Blog_PrintComment($Comment); } } /** * Print a comment. * @param Message $Comment Comment to print. * @throws Exception */ function Blog_PrintComment(Message $Comment): void { $AF = ApplicationFramework::getInstance(); # retrieve user currently logged in $User = User::getCurrentUser(); $Blog = Blog::getInstance(); $Author = new User(intval($Comment->PosterId())); $CanEditComment = $Blog->UserCanEditComment($User, $Comment); $CanDeleteComment = $Blog->UserCanDeleteComment($User, $Comment); $CanEditUsers = $Blog->UserCanEditUsers($User); # encode values for HTML output $SafeCommentId = defaulthtmlentities($Comment->MessageId()); $SafeBody = nl2br(trim(defaulthtmlentities($Comment->Body()))); $SafeEntryId = defaulthtmlentities($Comment->ParentId()); $SafePosterId = defaulthtmlentities($Author->Id()); $SafePosterName = defaulthtmlentities($Author->GetBestName()); $SafePostedDate = preg_replace( "/at /", "
at ", defaulthtmlentities(StdLib::getPrettyTimestamp($Comment->DatePosted(), true)) ); $SafePostedDateForParsing = defaulthtmlentities( Blog_FormatTimestampForParsing($Comment->DatePosted()) ); $EditCommentButton = new HtmlButton("Edit"); $EditCommentButton->setSize(HtmlButton::SIZE_SMALL); $EditCommentButton->setIcon("Pencil.svg"); $EditCommentButton->setLink("index.php?P=P_Blog_Comment&ID=$SafeEntryId" . "&CommentId=$SafeCommentId"); $DeleteCommentButton = new HtmlButton("Delete"); $DeleteCommentButton->setSize(HtmlButton::SIZE_SMALL); $DeleteCommentButton->setIcon("Delete.svg"); $DeleteCommentButton->setName("F_Action"); ?>

Id()); $PostCommentButton = new HtmlButton("Post Comment"); $PostCommentButton->setIcon("Check.svg"); $PostCommentButton->setName("F_Action"); ?> Add a Comment
getHtml(); ?>

Views |
Shared via E-mail |
Shared to Facebook |
Shared to Twitter |
Shared to LinkedIn |

UserCanPostComment($User); $CanViewMetrics = $H_Blog->UserCanViewMetrics($User); $IsLoggedIn = $User->IsLoggedIn(); $Blog = Blog::getInstance(); if ($BlogEntryFound) { $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 = $H_Entry->get(Blog::BODY_FIELD_NAME); $Categories = $H_Entry->CategoriesForDisplay(); $BlogName = $H_Entry->BlogName(); $NotificationsEnabled = $H_Blog->NotificationsCouldBeSent(); $UserIsLoggedIn = $User->IsLoggedIn(); $UserIsSubscribed = $H_Blog->UserIsSubscribedToNotifications($User); $DisplayNotificationButton = $H_Blog->NotificationsCouldBeSent(null, $User); $NotificationButtonEnabled = $H_Blog->NotificationsCouldBeSent($H_Entry, $User); $EntryFromEmailBlog = ($H_Entry->GetBlogId() == $H_Blog->getConfigSetting( "EmailNotificationBlog" )); if ($NotificationButtonEnabled) { $NotificationButtonHovertext = "Send e-mail notifications to subscribers " ."about this blog entry"; } else { $NotificationButtonHovertext = $H_Entry->userCanView(User::getAnonymousUser()) ? "E-mail notifications have already been sent for this blog entry" : "Cannot send notifications for unpublished entries."; } # if there were no images present in the body but the post has images, # automatically prepend the first image if (!preg_match('%
]*>%', $Body)) { $Images = $H_Entry->images(); if (count($Images) > 0) { $Image = reset($Images); $ImageUrl = $Image->url("mv-image-preview"); $SafeAltText = htmlspecialchars( $Image->AltText(), ENT_QUOTES | ENT_HTML5 ); $Html = '
' .'' .'
'; $Body = $Html.$Body; } } $UnsubscribeButton = new HtmlButton("Unsubscribe"); $UnsubscribeButton->setIcon("BellMinus.svg"); $UnsubscribeButton->setTitle("Unsubscribe from new blog entry e-mail"); $UnsubscribeButton->setLink("index.php?P=P_Blog_Unsubscribe"); $SubscribeButton = new HtmlButton("Subscribe"); $SubscribeButton->setIcon("BellPlus.svg"); $SubscribeButton->setTitle("Subscribe to receive e-mail when new blog entries are posted"); $SubscribeButton->setLink("index.php?P=P_Blog_Subscribe"); $TestEmailButton = new HtmlButton("Test Email"); $TestEmailButton->setIcon("NotifyEmail.svg"); $TestEmailButton->setTitle("Send test e-mail for this blog entry"); $TestEmailButton->setLink("index.php?P=P_Blog_SendTestNotification&ID=$SafeId"); $NotifySubscribersButton = new HtmlButton("Notify Subscribers"); $NotifySubscribersButton->setIcon("NotifyEmail.svg"); $NotifySubscribersButton->setTitle($NotificationButtonHovertext); $SubscribeLink = "index.php?P=P_Blog_ConfirmNotifySubscribers&ID=$SafeId"; $EditBlogEntryButton = new HtmlButton("Edit"); $EditBlogEntryButton->setIcon("Pencil.svg"); $EditBlogEntryButton->setTitle("Edit blog entry"); $EditBlogEntryButton->setLink(str_replace( '$ID', $SafeId, $H_Entry->getSchema()->getEditPage() )); $SeeMoreButton = new HtmlButton("See More $BlogName"); $SeeMoreButton->setIcon("Other.svg"); $SeeMoreButton->setSize(HtmlButton::SIZE_SMALL); $SeeMoreButton->setLink($Blog->BlogUrl()); $AF->setPageTitle(strip_tags($H_Entry->TitleForDisplay())); } else { $AF->setPageTitle("Blog Entry Not Found"); } # ----- DISPLAY -------------------------------------------------------------- ?>

- Cannot send notifications for this blog entry because it is not the configured Email Blog

#

getHtml(); ?> getHtml(); ?> UserCanEdit($User)) { ?> getHtml(); ?> setLink($SubscribeLink); ?> getHtml(); ?> addClass("mv-button-disabled"); ?> getHtml(); ?> getHtml(); ?> SignalEvent( "EVENT_HTML_INSERTION_POINT", [ $AF->GetPageName(), "Resource Display Buttons", ["Resource" => $H_Entry] ] ); ?>

Posted ShowAuthor()) { ?> by .

Categories:

From:

ModificationDate()) > (strtotime($H_Entry->PublicationDate()) + 3600)) { ?>

Last Edited: ModificationDate(), true) ); if ($H_Blog->ShowAuthor()) { ?> by AuthorForDisplay()).""; } print "

"; } ?>
DisplayShareButtons($H_Entry); ?>
getHtml(); ?>

# Metrics

EnableComments()) { ?>

# Comments

NumberOfComments() > 0) { ?> Log in to post a comment.

There are no comments yet for this entry. Please Log In to post one.

# Blog Entry Not Found

The blog entry could not be found. Please contact the administrator if you believe this is an error.