VIP福利
主页 > 建站问题 > 故障问题 > 织梦网站留言板统计留言数量的方法

织梦网站留言板统计留言数量的方法

查找 guestbook.php 73行左右 //显示所有留言 01 else 02 { 03 setcookie(GUEST_BOOK_POS,GetCurUrl(), time ()+3600,/); 04 05 if ($g_isadmin) $sql = select * from `dede_guestbook` order by id desc; 06 else $sql = select * from `dede_gu […]



查找 guestbook.php 73行左右 
//显示所有留言 
01 else
02 {
03 setcookie(‘GUEST_BOOK_POS’,GetCurUrl(),time()+3600,’/');
04  
05 if($g_isadmin) $sql = ‘select * from `dede_guestbook` order by id desc’;
06 else $sql = ‘select * from `dede_guestbook` where ischeck=1 order by iddesc’;
07  
08 $dlist = new DataListCP();
09 $dlist->pageSize = 10;
10 $dlist->SetParameter(‘gotopagerank’,$gotopagerank);
11 $dlist->SetTemplate(DEDETEMPLATE.’/plus/guestbook.htm’);
12 $dlist->SetSource($sql);
13 $dlist->Display();
14 }
15 ?>


改成 
//显示所有留言 
01 else
02 {
03 setcookie(‘GUEST_BOOK_POS’,GetCurUrl(),time()+3600,’/');
04  
05 if($g_isadmin) $sql = ‘select * from `dede_guestbook` order by id desc’;
06 else $sql = ‘select * from `dede_guestbook` where ischeck=1 order by iddesc’;
07 $dsql->Execute(‘cs’,$sql);
08 $totalgb=$dsql->GetTotalRow(‘cs’);//留言数量
09 $dlist = new DataListCP();
10 $dlist->pageSize = 10;
11 $dlist->SetParameter(‘gotopagerank’,$gotopagerank);
12 $dlist->SetTemplate(DEDETEMPLATE.’/plus/guestbook.htm’);
13 $dlist->SetSource($sql);
14 $dlist->Display();
15 }
16 ?>


————————————————————————–然后在模板文件用 

<?php echo $GLOBALS[totalgb];?> 

来显示
说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!