?? commentquery.php
字號:
<?php
/*
[插件名稱] 評論檢索 - 替換模版的{#modCommentQuery#}
[適用范圍] 評論檢索頁
[文 件 名] CommentQuery.php
[更新時間] 2006/8/11
*/
function CommentQuery(){
global $fsql,$tsql,$charset,$tbl_comment,$PagesInfo,$ShowPages,$MenuInfo;
$PSET=PlusSet("modCommentQuery");
$shownums=PlusDef($PSET["shownums"],"20");
$ord=PlusDef($PSET["ord"],"uptime");
$sc=PlusDef($PSET["sc"],"desc");
$showtime=PlusDef($PSET["showtime"],"m-d H:i");
$cutword=PlusDef($PSET["cutword"],"0");
$target=PlusDef($PSET["target"],"_self");
$tempname=PlusDef($PSET["tempname"],"tpl_comment_query.htm");
$coltype=$_GET["coltype"];
$nowmenuid=$_GET["nowmenuid"];
$rid=$_GET["rid"];
$page=$_GET["page"];
//模版解釋
$Temp=LoadTemp(ROOTPATH."templates/".$MenuInfo["skin"]."/".$tempname);
$TempArr=SplitTblTemp($Temp);
$str=$TempArr["start"];
$scl=" fabu='1' and pid='0' ";
if($coltype!="0" && $coltype!=""){
$scl.=" and coltype='$coltype' ";
}
if($nowmenuid!="" && $nowmenuid!="0"){
$scl.=" and menuid='$nowmenuid' ";
}
if($rid!="" && $rid!="0"){
$scl.=" and rid='$rid' ";
}
include(ROOTPATH."includes/func/memberpages.inc.php");
$pages=new pages;
$totalnums=TblCount($tbl_comment,"id",$scl);
$pages->setvar(array("nowmenuid" => $nowmenuid,"rid" => $rid,"coltype" => $coltype));
$pages->set($shownums,$totalnums);
$pagelimit=$pages->limit();
$fsql->query("select * from $tbl_comment where $scl order by $ord $sc limit $pagelimit");
while($fsql->next_record()){
$id=$fsql->f('id');
$rid=$fsql->f('rid');
$title=$fsql->f('title');
$menuid=$fsql->f('menuid');
$dtime=$fsql->f('uptime');
$author=$fsql->f('name');
$cl=$fsql->f('cl');
$lastname=$fsql->f('lastname');
$face=$fsql->f("face");
$tsql->query("select count(id) from $tbl_comment where pid='$id' and fabu='1'");
if($tsql->next_record()){
$count=$tsql->f('count(id)');
}
$face=ROOTPATH."face/".$face.".gif";
$dtime=date($showtime,$dtime);
if($cutword!="0"){$title=csubstr($title,0,$cutword,$charset);}
$link=ROOTPATH."comment_detail.php?commentid=$id";
$var=array (
'title' => $title,
'dtime' => $dtime,
'author' => $author,
'count' => $count,
'cl' => $cl,
'link' => $link,
'lastname' => $lastname,
'face' => $face,
'target' => $target
);
$str.=$TempArr["rowstart"];
$str.=ShowTplTemp($TempArr["list"],$var);
$str.=$TempArr["rowend"];
}
$str.=$TempArr["end"];
$PagesInfo=$pages->ShowNow();
$ShowPages=$pages->output(1);
return $str;
}
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -