showpost.inc 971 B

1234567891011121314151617181920212223
  1. <?php
  2. //Generic .post file loader
  3. if ($nav == 5 && file_exists($post)) {
  4. $statz = stat($post);
  5. $uid = $statz['uid'];
  6. $udata = posix_getpwuid($uid);
  7. $user = $udata['name'];
  8. $date = date("F d Y H:i:s", filemtime($post));
  9. if (stristr($post,'.') != ".post") {
  10. $title = basename($post);
  11. } else {
  12. $title = strstr(basename($post),'.', true);
  13. }
  14. echo "<h3 class=\"blogtitles\"><a title=permalink href=\"index.php?nav=5&post=$post\">$title</a></h3>\n";
  15. echo "<em class=\"blogdetail\">Last modified on $date UTC by $user</em><br /><hr />\n";
  16. include "$post";
  17. $parent = dirname($post);
  18. echo "<hr /><a style=\"padding-left: auto; padding-right: auto;\" title=back href=\"index.php?nav=1&dir=$parent\"><img alt=back src=img/mime/tsfolder-up.gif /></a>$parent";
  19. }
  20. //404 Loader for files specified in GET param that don't actually exist
  21. elseif ($nav == 5 && !file_exists($post)) {echo "<h1 style=\"padding-left: auto; padding-right: auto;\">404 - Not Found</h1>";}
  22. ?>