\r\n";
}
- for($j=0; $j<$col; $j++)
- {
- if($row = $this->dsql->GetArray("al"))
- {
+ for ($j = 0; $j < $col; $j++) {
+ if ($row = $this->dsql->GetArray("al")) {
$GLOBALS['autoindex']++;
$ids[$row['id']] = $row['id'];
//处理一些特殊字段
- $row['infos'] = cn_substr($row['description'],$infolen);
+ $row['infos'] = cn_substr($row['description'], $infolen);
$row['id'] = $row['id'];
- $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],
- $row['ismake'],
- $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],
- $row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
- $row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],
- $row['ispart'],$row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
- if($row['litpic'] == '-' || $row['litpic'] == '')
- {
- $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/defaultpic.gif';
+ $row['arcurl'] = GetFileUrl(
+ $row['id'],
+ $row['typeid'],
+ $row['senddate'],
+ $row['title'],
+ $row['ismake'],
+ $row['arcrank'],
+ $row['namerule'],
+ $row['typedir'],
+ $row['money'],
+ $row['filename'],
+ $row['moresite'],
+ $row['siteurl'],
+ $row['sitepath']
+ );
+ $row['typeurl'] = GetTypeUrl(
+ $row['typeid'],
+ MfTypedir($row['typedir']),
+ $row['isdefault'],
+ $row['defaultname'],
+ $row['ispart'],
+ $row['namerule2'],
+ $row['moresite'],
+ $row['siteurl'],
+ $row['sitepath']
+ );
+ if ($row['litpic'] == '-' || $row['litpic'] == '') {
+ $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/static/defaultpic.gif';
}
- if(!preg_match("/^http:\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y')
- {
- $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic'];
+ if (!preg_match("/^http:\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
+ $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
}
$row['picname'] = $row['litpic'];
$row['stime'] = GetDateMK($row['pubdate']);
- $row['typelink'] = "
".$row['typename']."";
- $row['image'] = "

<]/", "", $row['title'])."'>";
- $row['imglink'] = "
".$row['image']."";
+ $row['typelink'] = "
" . $row['typename'] . "";
+ $row['image'] = "

<]/", "", $row['title']) . "'>";
+ $row['imglink'] = "
" . $row['image'] . "";
$row['fulltitle'] = $row['title'];
- $row['title'] = cn_substr($row['title'],$titlelen);
- if($row['color']!='')
- {
- $row['title'] = "
".$row['title']."";
+ $row['title'] = cn_substr($row['title'], $titlelen);
+ if ($row['color'] != '') {
+ $row['title'] = "
" . $row['title'] . "";
}
- if(preg_match('/c/', $row['flag']))
- {
- $row['title'] = "
".$row['title']."";
+ if (preg_match('/c/', $row['flag'])) {
+ $row['title'] = "
" . $row['title'] . "";
}
- $row['textlink'] = "
".$row['title']."";
+ $row['textlink'] = "
" . $row['title'] . "";
$row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
$row['memberurl'] = $GLOBALS['cfg_memberurl'];
$row['templeturl'] = $GLOBALS['cfg_templeturl'];
- if(is_array($this->dtp2->CTags))
- {
- foreach($this->dtp2->CTags as $k=>$ctag)
- {
- if($ctag->GetName()=='array')
- {
+ if (is_array($this->dtp2->CTags)) {
+ foreach ($this->dtp2->CTags as $k => $ctag) {
+ if ($ctag->GetName() == 'array') {
//传递整个数组,在runphp模式中有特殊作用
- $this->dtp2->Assign($k,$row);
- }
- else
- {
- if(isset($row[$ctag->GetName()]))
- {
- $this->dtp2->Assign($k,$row[$ctag->GetName()]);
- }
- else
- {
- $this->dtp2->Assign($k,'');
+ $this->dtp2->Assign($k, $row);
+ } else {
+ if (isset($row[$ctag->GetName()])) {
+ $this->dtp2->Assign($k, $row[$ctag->GetName()]);
+ } else {
+ $this->dtp2->Assign($k, '');
}
}
}
}
$artlist .= $this->dtp2->GetResult();
- }//if hasRow
+ } //if hasRow
- }//Loop Col
+ } //Loop Col
- if($col>1)
- {
+ if ($col > 1) {
$i += $col - 1;
$artlist .= "
\r\n";
}
- }//Loop Line
+ } //Loop Line
$this->dsql->FreeResult('al');
return $artlist;
@@ -434,108 +429,215 @@ class TagList
* @param string $listitem 列表样式
* @return string
*/
- function GetPageListDM($list_len,$listitem="info,index,end,pre,next,pageno")
+ function GetPageListDM($list_len, $listitem = "info,index,end,pre,next,pageno")
{
- $prepage="";
- $nextpage="";
+ $prepage = "";
+ $nextpage = "";
$prepagenum = $this->PageNo - 1;
$nextpagenum = $this->PageNo + 1;
- if($list_len == "" || preg_match("/[^0-9]/", $list_len))
- {
+ if ($list_len == "" || preg_match("/[^0-9]/", $list_len)) {
$list_len = 3;
}
$totalpage = $this->TotalPage;
- if($totalpage <= 1 && $this->TotalResult > 0)
- {
- return "