推荐使用Bandwagon建站

过滤了置顶帖,也未写权限隐藏,需要可自行添加

 <?php foreach($forumlist_show as $_forum) { ?>
    <a href="<?php echo url("forum-$_forum[fid]");?>">
      <?php echo $_forum['name'];?>
    </a>
 <?php
  $_threadlist = thread__find_by_fid($_forum['fid'], 1, 6);
  //6表示每个列表显示6个帖子。
  thread_list_access_filter($_threadlist, $gid);
 ?>
  <ul>
   <?php foreach($_threadlist as $_thread) { ?>
    <li>
     <a href="<?php echo url("thread-$_thread[tid]");?>">
      <?php echo $_thread['subject'];?>
     </a>
    </li>
      <?php } ?>
   </ul>
 <?php } ?>

参考自ok0816.com

我遇到此问题是因为在viewhtm/footer.inc.htm把下面这段删掉了



<?php $browser = get__browser();?>
    <?php if($browser['name'] == 'ie') { ?>
    <script src="<?php echo $conf['view_url'];?>js/es6-shim.js<?php echo $static_version;?>"></script>
    <?php } ?>
    <script src="lang/<?php echo $conf['lang'];?>/bbs.js<?php echo $static_version;?>"></script>
    <script src="<?php echo $conf['view_url'];?>js/jquery-3.1.0.js<?php echo $static_version;?>"></script>
    <script src="<?php echo $conf['view_url'];?>js/popper.js<?php echo $static_version;?>"></script>
    <script src="<?php echo $conf['view_url'];?>js/bootstrap.js<?php echo $static_version;?>"></script>
    <script src="<?php echo $conf['view_url'];?>js/xiuno.js<?php echo $static_version;?>"></script>
    <script src="<?php echo $conf['view_url'];?>js/bootstrap-plugin.js<?php echo $static_version;?>"></script>
    <script src="<?php echo $conf['view_url'];?>js/async.js<?php echo $static_version;?>"></script>
    <script src="<?php echo $conf['view_url'];?>js/form.js<?php echo $static_version;?>"></script>
    <script>
    var debug = DEBUG = <?php echo DEBUG; ?>;
    var url_rewrite_on = <?php echo $conf['url_rewrite_on'];?>;
    var forumarr = <?php echo xn_json_encode($forumarr);?>;
    var fid = <?php echo $fid;?>;
    var uid = <?php echo intval($uid);?>;
    var gid = <?php echo intval($gid);?>;
    xn.options.water_image_url = '<?php echo $conf['logo_water_url'];?>';    // 水印图片 / watermark image
    </script>
    <script src="<?php echo $conf['view_url'];?>js/bbs.js<?php echo $static_version;?>"></script>

据说还有种原因就是js/jq冲突,这就要排除插件了

函数模板:/xiunophp/misc.func.php

function pagination

简单的上一页,下一页,比较省资源,不用count(), 推荐使用。

function pagination($url, $totalnum, $page, $pagesize = 20) {
    $totalpage = ceil($totalnum / $pagesize);
    if($totalpage < 2) return '';
    $page = min($totalpage, $page);

    $s = '';
    $page > 1 AND $s .= '<a href="'.str_replace('{page}', $page-1, $url).'">上一页</a>';
    $s .= " $page / $totalpage ";
    $totalnum >= $pagesize AND $page != $totalpage AND $s .= '<a href="'.str_replace('{page}', $page+1, $url).'">下一页</a>';
    return $s;
}