viewthread.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. if(!defined('IN_DISCUZ')) {
  3. exit('Access Denied');
  4. }
  5. include loadarchiver('common/header');
  6. ?>
  7. <div id="nav">
  8. <a href="./"><?php echo $_G['setting']['navs']['2']['navname']; ?></a> &rsaquo; <a href="?fid-<?php echo $_G['fid']; ?>.html"><?php echo $_G['forum']['name']; ?></a> &rsaquo; <?php echo $_G['forum_thread']['subject']; ?>
  9. </div>
  10. <div id="content">
  11. <?php foreach($postlist as $post): ?>
  12. <?php if($hiddenreplies && !$post['first']) break; ?>
  13. <p class="author">
  14. <?php if(!$post['anonymous']): ?>
  15. <strong><?php echo $post['author']; ?></strong>
  16. <?php else: ?>
  17. <strong><i>Anonymous</i></strong>
  18. <?php endif; ?>
  19. <?php echo lang('forum/archiver', 'post_time') . ' ' . $post['dateline']; ?>
  20. </p>
  21. <?php if($_G['forum_threadpay']): include template('forum/viewthread_pay'); ?>
  22. <?php elseif(!$_G['forum']['ismoderator'] && $_G['setting']['bannedmessages'] & 1 && (($post['authorid'] && !$post['username']) || ($_G['thread']['digest'] == 0 && ($post['groupid'] == 4 || $post['groupid'] == 5 || $post['memberstatus'] == '-1')))): ?>
  23. <?php elseif($post['status'] & 1): ?>
  24. <?php else: ?>
  25. <h3><?php echo $post['subject']; ?></h3>
  26. <?php echo archivermessage($post['message']); ?>
  27. <?php endif; ?>
  28. <?php endforeach; ?>
  29. <div class="page">
  30. <?php echo arch_multi($_G['forum_thread']['replies'] + 1, $_G['ppp'], $page, "?tid-{$_G['tid']}.html"); ?>
  31. </div>
  32. </div>
  33. <div id="end">
  34. <?php echo lang('forum/archiver', 'full_version'); ?>:
  35. <a href="../<?php echo in_array('forum_viewthread', $_G['setting']['rewritestatus']) ? rewriteoutput('forum_viewthread', 1, '', $_G['tid'], $page) : 'forum.php?mod=viewthread&tid='.$_G['tid'].'&page='.$page; ?>" target="_blank"><strong><?php echo $_G['forum_thread']['subject']; ?></strong></a>
  36. </div>
  37. <?php include loadarchiver('common/footer');
  38. function archivermessage($message) {
  39. if(strpos($message, '[/password]') !== FALSE) {
  40. return '';
  41. }
  42. return nl2br(preg_replace(
  43. array('/&amp;(#\d{3,5};)/', "/\[hide=?\d*\](.*?)\[\/hide\]/is", "/\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]/is", "/\[\/?\w+=?.*?\]/"),
  44. array('&\\1','<b>**** Hidden Message *****</b>',''),
  45. str_replace(
  46. array('&', '"', '<', '>', "\t", ' ', '', ' '),
  47. array('&amp;', '&quot;', '&lt;', '&gt;', '&nbsp; &nbsp; &nbsp; &nbsp; ', '&nbsp; &nbsp;', '&nbsp;&nbsp;'),
  48. $message)));
  49. }
  50. ?>