if($row = $dsql->GetArray("al")) {
$ids[] = $row['id'];
//处理一些特殊字段
$row['info'] = $row['infos'] = cn_substr($row['description'],$infolen);
$row['id'] = $row['id'];
if($row['corank'] > 0 && $row['arcrank']==0)
{
$row['arcrank'] = $row['corank'];
}
$row['filename'] = $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'],$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'].'/images/defaultpic.gif';
}
if(!preg_match("#^http:\/\/#i", $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'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
$row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".preg_replace("#['><]#", "", $row['title'])."'>";
$row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>";
$row['fulltitle'] = $row['title'];
$row['title'] = cn_substr($row['title'], $titlelen);
if($row['color']!='') $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>";
if(preg_match('#b#', $row['flag'])) $row['title'] = "<strong>".$row['title']."</strong>";
//$row['title'] = "<b>".$row['title']."</b>";
$row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
$row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
$row['memberurl'] = $GLOBALS['cfg_memberurl'];
$row['templeturl'] = $GLOBALS['cfg_templeturl'];
if(is_array($dtp2->CTags))
{
foreach($dtp2->CTags as $k=>$ctag)
{
if($ctag->GetName()=='array')
{
//传递整个数组,在runphp模式中有特殊作用
$dtp2->Assign($k, $row);
} else {
if(isset($row[$ctag->GetName()])) $dtp2->Assign($k,$row[$ctag->GetName()]);
else $dtp2->Assign($k, '');
}
}
$GLOBALS['autoindex']++;
}
if($pagesize > 0)
{
if($GLOBALS['autoindex'] <= $pagesize)
{
$liststr = $dtp2->GetResult();
$artlist .= $liststr."\r\n";
} else {
$artlist .= "";
$orderWeight[] = array(
'weight' => $row['weight'],
'arclist' => ''
);
}
} else {
$liststr = $dtp2->GetResult();
$artlist .= $liststr."\r\n";
}
$orderWeight[] = array(
'weight' => $row['weight'],
'arclist' => $liststr
);
}//if hasRow
else{
$artlist .= '';
}
// 进行判断,如果启用排序则内容输出为重新排序后的内容
// var_dump($isweight=='y' && count($orderWeight) == $line);
$isweight = strtolower($isweight);
if ( $isweight=='y' )
{
$artlist = '';
$orderWeight = list_sort_by($orderWeight, 'weight', 'asc');
foreach ($orderWeight as $vv) {
$artlist .= $vv['arclist'];
}
}
if($col>1) $artlist .= " </td>\r\n";
}//Loop Col
if($col>1) $i += $col - 1;
if($col>1) $artlist .= " </tr>\r\n";
}//loop line