@@ -16,13 +16,21 @@ $this->opengraph->attach(new Pair("type", "article"));
1616
1717$ url = Common::relativeUrlToAbsolute ("/document/ " . urlencode ($ object_id ));
1818if ($ object ) {
19+
1920 $ url .= "/ " . Common::sanitizeForUrl ($ object ->getTitle (), true );
2021 $ this ->opengraph ->attach (new Pair ("url " , "/document/ " . urlencode ($ object_id )
2122 . "/ " . Common::sanitizeForUrl ($ object ->getTitle (), true )));
22- $ title = htmlspecialchars ($ object ->getTitle (), ENT_HTML5 , "UTF-8 " );
23+
24+ $ title = htmlspecialchars ($ object ->getTitle (), ENT_HTML5 , "UTF-8 " );
2325 $ description = Common::stripUpTo (trim (filter_var (
2426 $ object ->getContent (true ), FILTER_SANITIZE_STRING
2527 )), "\n" , 300 );
28+
29+ $ user_name = $ object ->getUser ()->getName ();
30+ $ user_id = $ object ->getUserId ();
31+ $ user_url = Common::relativeUrlToAbsolute ("/user/ " . $ user_id . "/ " . Common::sanitizeForUrl ($ user_name , true ));
32+ $ user_avatar = "https: " . (new Gravatar ($ object ->getUser ()->getEmail ()))->getUrl (22 , "identicon " );
33+
2634} else {
2735 $ this ->opengraph ->attach (new Pair ("url " , "/document/ " . urlencode ($ object_id )));
2836}
@@ -40,6 +48,14 @@ require("./header.inc.phtml");
4048 <section>
4149<?php echo $ object ->getContent (true ); ?>
4250 </section>
51+ <footer>
52+ <span class="float-left"><a href="<?php echo $ user_url ; ?> "><img class="avatar" src="<?php echo $ user_avatar ; ?> "/> <?php echo htmlspecialchars ($ user_name , ENT_HTML5 , "UTF-8 " ); ?> </a></span>
53+ <?php if ($ object ->getEditedDateTime () !== null ) { ?>
54+ <span class="float-right"><?php echo $ object ->getCreatedDateTime ()->format ("l, F j, Y " ); ?> | Edited: <?php echo $ object ->getEditedDateTime ()->format ("l, F j, Y " ); ?> </span>
55+ <?php } else { ?>
56+ <span class="float-right"><?php echo $ object ->getCreatedDateTime ()->format ("l, F j, Y " ); ?> </span>
57+ <?php } ?>
58+ </footer>
4359 </article>
4460 <article>
4561 <header>Comments</header>
0 commit comments