- $querylast = $_SGLOBAL['db_bbs']->query('SELECT tid FROM '.tname('threads', 1).' WHERE tid<'.$tid.' and fid='.$fid.' order by tid desc limit 0,1');
- $querylast = $_SGLOBAL['db_bbs']->query('SELECT tid FROM '.tname('threads', 1).' WHERE fid='.$fid.' and lastpost>'.$thread['lastpost'].' order by lastpost limit 0,1');
- $threadlast = $_SGLOBAL['db_bbs']->fetch_array($querylast);
- $threadlast[tid]="viewthread-".$threadlast[tid].".html";
- //$querynext = $_SGLOBAL['db_bbs']->query('SELECT tid FROM '.tname('threads', 1).' WHERE tid>'.$tid.' and fid='.$fid.' order by tid limit 0,1');
- $querynext = $_SGLOBAL['db_bbs']->query('SELECT tid FROM '.tname('threads', 1).' WHERE fid='.$fid.' and lastpost<'.$thread['lastpost'].' order by lastpost desc limit 0,1');
- $threadnext = $_SGLOBAL['db_bbs']->fetch_array($querynext);
- $threadnext[tid]="viewthread-".$threadnext[tid].".html";
复制代码
这段代码是supesite 调用论坛帖子,上一篇,下一篇的代码。其中有一点问题。
这段代码当点到最后一页的时候显示viewthread-.html的错误页,有什么办法,当上一篇没有或者下一篇没有数据的时候(也就是说本来就是第一篇,没有再上一篇),自动隐藏或显示#号。 |