無需修改任何源碼,直接用php代碼在任何頁面(靜態或者動態)都可以調用全站評論(所有數據表的評論)。
輸出:評論者,評論者頭像,被評論文章欄目名稱、文章標題、文章鏈接、評論詳細內容,評論時間,按照評論時間排序。
代碼如下:
<ul>
[e:loop={"select?*?from?{$dbtbpre}enewspl_1?order?by?saytime?limit?5",0,24,0}]
<?php
$myid=$bqr['userid'];
$myid2=$bqr['id'];
$member=$empire->fetch1("select?userpic?from?phome_enewsmemberadd?where?userid='$myid'");
$mytitle=$empire->fetch1("select?titleurl,title?from?phome_ecms_news?where?id='$myid2'");
?>
?????<li?class="clr">
???????????<div?class="top">
??????????????????<div?class="img">
??????????????????????????<a??href="<?=$bqr['newsurl']?>e/space/?userid=<?=$bqr[userid]?>"?target="_blank">
??????????????????????????<img?src="<?=$member['userpic']?$member['userpic']:'/style/images/nopic.gif'??>"?width="46"?height="46"?/>
??????????????????????????</a>
??????????????????</div>
??????????????????<div?class="word">
??????????????????????????<div?class="name">
??????????????????????????<?=$bqr['username']?> 在 <a??href="<?=$bqsr[classurl]?>"??target="_blank"><?=$bqsr[classname]?></a> ?欄目 <span>評論文章:</span>
??????????????????????????</div>
??????????????????????????<div?class="title">
??????????????????????????<a?href="<?=$mytitle['titleurl']?>"?target="_blank"><?=$mytitle['title']?></a>
??????????????????????????</div>
??????????????????</div>
?????????</div>
?????????<div?class="btm">
?????????????????<i?class="pre"></i><?=$bqr['saytext']?><i?class="nxt"></i>
?????????</div>
???</li>
[/e:loop]