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

网站建设 2022-07-27 09:12www.1681989.com免费网站
查找 guestbook.php 73行左右 //显示所有留言 01 else 02 { 03 setcookie(GUEST_BOOK_POS,GetCurUrl(), time ()+3600,/); 04 05 if ($g_isadm) $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_isadm) $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(‘goagerank’,$goagerank);
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_isadm) $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(‘goagerank’,$goagerank);
12 $dlist->SetTemplate(DEDETEMPLATE.’/plus/guestbook.htm’);
13 $dlist->SetSource($sql);
14 $dlist->Display();
15 }
16 ?>


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

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

来显示

Copyright © 2016-2025 www.1681989.com 推火网 版权所有 Power by