📄 inc_arcspec_view.php
字号:
$colWidth = $colWidth."%";
$innertext = trim($innertext);
if($innertext=="") $innertext = GetSysTemplets("spec_list.htm");
//按不同情况设定SQL条件
$orwhere = " arcs.arcrank > -1 And arcs.channel = -1 ";
if($this->StartTime>0) $orwhere .= " And arcs.senddate>'".$this->StartTime."'";
//排序方式
$ordersql = "";
if($orderby=="senddate") $ordersql=" order by arcs.senddate desc";
else if($orderby=="pubdate") $ordersql=" order by arcs.pubdate desc";
else if($orderby=="id") $ordersql=" order by arcs.ID desc";
else $ordersql=" order by arcs.sortrank desc";
//
//----------------------------
$query = "Select arcs.ID,arcs.title,arcs.typeid,arcs.ismake,
arcs.description,arcs.pubdate,arcs.senddate,arcs.arcrank,
arcs.click,arcs.postnum,arcs.lastpost,arcs.money,arcs.litpic,t.typedir,t.typename,t.isdefault,
t.defaultname,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl
from `#@__archivesspec` arcs
left join #@__arctype t on arcs.typeid=t.ID
where $orwhere $ordersql limit $limitstart,$row";
$this->dsql->SetQuery($query);
$this->dsql->Execute("al");
$artlist = "";
if($col>1) $artlist = "<table width='$tablewidth' border='0' cellspacing='0' cellpadding='0'>\r\n";
$this->dtp2->LoadSource($innertext);
for($i=0;$i<$row;$i++)
{
if($col>1) $artlist .= "<tr>\r\n";
for($j=0;$j<$col;$j++)
{
if($col>1) $artlist .= "<td width='$colWidth'>\r\n";
if($row = $this->dsql->GetArray("al"))
{
//处理一些特殊字段
$row["description"] = cnw_left($row["description"],$infolen);
$row["title"] = cnw_left($row["title"],$titlelen);
$row["id"] = $row["ID"];
if($row["litpic"]=="") $row["litpic"] = $GLOBALS["cfg_plus_dir"]."/img/dfpic.gif";
$row["picname"] = $row["litpic"];
$row["arcurl"] = GetFileUrl($row["ID"],$row["typeid"],$row["senddate"],$row["title"],
$row["ismake"],$row["arcrank"],$row["namerule"],$row["typedir"],$row["money"],true,$row["siteurl"]);
$row["typeurl"] = $this->GetListUrl($row["typeid"],$row["typedir"],$row["isdefault"],$row["defaultname"],$row["ispart"],$row["namerule2"],$row["siteurl"]);
$row["info"] = $row["description"];
$row["filename"] = $row["arcurl"];
$row["stime"] = GetDateMK($row["pubdate"]);
$row["textlink"] = "<a href='".$row["filename"]."'>".$row["title"]."</a>";
$row["typelink"] = "[<a href='".$row["typeurl"]."'>".$row["typename"]."</a>]";
$row["imglink"] = "<a href='".$row["filename"]."'><img src='".$row["picname"]."' border='0' width='$imgwidth' height='$imgheight'></a>";
$row["image"] = "<img src='".$row["picname"]."' border='0' width='$imgwidth' height='$imgheight'>";
$row["phpurl"] = $GLOBALS["cfg_plus_dir"];
$row["templeturl"] = $GLOBALS["cfg_templets_dir"];
$row["memberurl"] = $GLOBALS["cfg_member_dir"];
//编译附加表里的数据
foreach($this->ChannelUnit->ChannelFields as $k=>$arr){
if(isset($row[$k])) $row[$k] = $this->ChannelUnit->MakeField($k,$row[$k]);
}
//---------------------------
if(is_array($this->dtp2->CTags)){
foreach($this->dtp2->CTags as $k=>$ctag){
if(isset($row[$ctag->GetName()])) $this->dtp2->Assign($k,$row[$ctag->GetName()]);
else $this->dtp2->Assign($k,"");
}
}
$artlist .= $this->dtp2->GetResult();
}//if hasRow
else{
$artlist .= "";
}
if($col>1) $artlist .= "</td>\r\n";
}//Loop Col
if($col>1) $artlist .= "</tr>\r\n";
}//Loop Line
if($col>1) $artlist .= "</table>\r\n";
$this->dsql->FreeResult("al");
return $artlist;
}
//---------------------------------
//获取静态的分页列表
//---------------------------------
function GetPageListST($list_len)
{
$prepage="";
$nextpage="";
$prepagenum = $this->PageNo-1;
$nextpagenum = $this->PageNo+1;
if($list_len==""||ereg("[^0-9]",$list_len)) $list_len=3;
$totalpage = ceil($this->TotalResult/$this->PageSize);
if($totalpage<=1 && $this->TotalResult>0) return "共1页/".$this->TotalResult."条记录";
if($this->TotalResult == 0) return "共0页/".$this->TotalResult."条记录";
$purl = $this->GetCurUrl();
$tnamerule = "spec_";
//获得上一页和下一页的链接
if($this->PageNo != 1){
$prepage.="<a href='".$tnamerule."_$prepagenum".$GLOBALS['art_shortname']."'>上一页</a>\r\n";
$indexpage="<a href='".$tnamerule."_1".$GLOBALS['art_shortname']."'>首页</a>\r\n";
}
else{
$indexpage="首页\r\n";
}
//
if($this->PageNo!=$totalpage && $totalpage>1){
$nextpage.="<a href='".$tnamerule."_$nextpagenum".$GLOBALS['art_shortname']."'>下一页</a>\r\n";
$endpage="<a href='".$tnamerule."_$totalpage".$GLOBALS['art_shortname']."'>末页</a>\r\n";
}
else{
$endpage="末页\r\n";
}
//获得数字链接
$listdd="";
$total_list = $list_len * 2 + 1;
if($this->PageNo >= $total_list) {
$j = $this->PageNo-$list_len;
$total_list = $this->PageNo+$list_len;
if($total_list>$totalpage) $total_list=$totalpage;
}
else{
$j=1;
if($total_list>$totalpage) $total_list=$totalpage;
}
for($j;$j<=$total_list;$j++)
{
if($j==$this->PageNo) $listdd.= "$j\r\n";
else $listdd.="".$tnamerule."_$j".$GLOBALS['art_shortname']."'>[".$j."]</a>\r\n";
}
$plist = $indexpage.$prepage.$listdd.$nextpage.$endpage;
return $plist;
}
//---------------------------------
//获取动态的分页列表
//---------------------------------
function GetPageListDM($list_len)
{
$prepage="";
$nextpage="";
$prepagenum = $this->PageNo-1;
$nextpagenum = $this->PageNo+1;
if($list_len==""||ereg("[^0-9]",$list_len)) $list_len=3;
$totalpage = ceil($this->TotalResult/$this->PageSize);
if($totalpage<=1 && $this->TotalResult>0) return "共1页/".$this->TotalResult."条记录";
if($this->TotalResult == 0) return "共0页/".$this->TotalResult."条记录";
$purl = $this->GetCurUrl();
$geturl = "typeid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
$hidenform = "<input type='hidden' name='typeid' value='".$this->TypeID."'>\r\n";
$hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>\r\n";
$purl .= "?".$geturl;
//获得上一页和下一页的链接
if($this->PageNo != 1){
$prepage.="<td width='50'><a href='".$purl."PageNo=$prepagenum'>上一页</a></td>\r\n";
$indexpage="<td width='30'><a href='".$purl."PageNo=1'>首页</a></td>\r\n";
}
else{
$indexpage="<td width='30'>首页</td>\r\n";
}
if($this->PageNo!=$totalpage && $totalpage>1){
$nextpage.="<td width='50'><a href='".$purl."PageNo=$nextpagenum'>下一页</a></td>\r\n";
$endpage="<td width='30'><a href='".$purl."PageNo=$totalpage'>末页</a></td>\r\n";
}
else{
$endpage="<td width='30'>末页</td>\r\n";
}
//获得数字链接
$listdd="";
$total_list = $list_len * 2 + 1;
if($this->PageNo >= $total_list) {
$j = $this->PageNo-$list_len;
$total_list = $this->PageNo+$list_len;
if($total_list>$totalpage) $total_list=$totalpage;
}
else{
$j=1;
if($total_list>$totalpage) $total_list=$totalpage;
}
for($j;$j<=$total_list;$j++)
{
if($j==$this->PageNo) $listdd.= "<td>$j </td>\r\n";
else $listdd.="<td><a href='".$purl."PageNo=$j'>[".$j."]</a> </td>\r\n";
}
$plist = "<table border='0' cellpadding='0' cellspacing='0'>\r\n";
$plist .= "<tr align='center' style='font-size:10pt'>\r\n";
$plist .= "<form name='pagelist' action='".$this->GetCurUrl()."'>$hidenform";
$plist .= $indexpage;
$plist .= $prepage;
$plist .= $listdd;
$plist .= $nextpage;
$plist .= $endpage;
if($totalpage>$total_list){
$plist.="<td width='36'><input type='text' name='PageNo' style='width:30;height:18' value='".$this->PageNo."'></td>\r\n";
$plist.="<td width='30'><input type='submit' name='plistgo' value='GO' style='width:24;height:18;font-size:9pt'></td>\r\n";
}
$plist .= "</form>\r\n</tr>\r\n</table>\r\n";
return $plist;
}
//--------------------------
//获得一个指定的频道的链接
//--------------------------
function GetListUrl($typeid,$typedir,$isdefault,$defaultname,$ispart,$namerule2)
{
return GetTypeUrl($typeid,MfTypedir($typedir),$isdefault,$defaultname,$ispart,$namerule2);
}
//---------------
//获得当前的页面文件的url
//----------------
function GetCurUrl()
{
if(!empty($_SERVER["REQUEST_URI"])){
$nowurl = $_SERVER["REQUEST_URI"];
$nowurls = explode("?",$nowurl);
$nowurl = $nowurls[0];
}
else
{ $nowurl = $_SERVER["PHP_SELF"]; }
return $nowurl;
}
}//End Class
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -