{dede:type}
[field:id runphp=yes]
$tsql1 = new DedeSql(false);
$stypeid = '';
$typelink1 = '';
$strSql1 = "SELECT id FROM dede_arctype WHERE reid='@me' ";
$tsql1->SetQuery($strSql1);
$tsql1->Execute('t1');
while($row1 = $tsql1->GetArray('t1',MYSQL_ASSOC))
{
$stypeid .= 'l.typeid='.$row1['id'].'||';
$stypeid .= typeall($row1['id']);
}
if ($stypeid != ""){
@me = cn_substr($stypeid,strrpos($stypeid,'||'),0);
}else{
@me = 'l.typeid='.@me;
}
$numi = 0;
$strSql = "SELECT DISTINCT t.tag FROM dede_tagindex t,dede_taglist l WHERE t.id = l.tid AND ('@me') ORDER BY t.count DESC,t.addtime DESC LIMIT 0,40";
$tsql1->SetQuery($strSql);
$tsql1->Execute('t');
while($row2 = $tsql1->GetArray('t',MYSQL_ASSOC))
{
if ($numi == 0){
$typelink1 .= "<li>";
$typelink1 .= "<a class='rmbq_a' href='/tags.php?/".$row2[' data-cke-saved-href='/tags.php?/".$row2[' data-cke-saved-href='/tags.php?/".$row2['tag']."' target=_blank>".cn_substr($row2['tag'],6,0)."</a>";
}else if($numi%5 == 0){
$typelink1 .= "</li>";
$typelink1 .= "<li>";
$typelink1 .= "<a class='rmbq_a' href='/tags.php?/".$row2['tag']."' target=_blank>".cn_substr($row2['tag'],6,0)."</a>";
}else{
$typelink1 .= "<a href='/tags.php?/".$row2['tag']."' target=_blank>".cn_substr($row2['tag'],5,0)."</a>";
}
$numi = $numi + 1;
}
function typeall($reid=0){
$dbobj2 = new DedeSql(false);
$strSql1 = "SELECT id FROM xingfu.yuer_arctype WHERE reid = $reid || topid=$reid";
$dbobj2->SetQuery($strSql1);
$dbobj2->Execute('f');
while($row = $dbobj2->GetArray('f',MYSQL_ASSOC))
{
$stypeid .= 'l.typeid='.$row['id'].'||';
//结果赋值
typeall($row['id']);
}
return $stypeid;
}
@me = $typelink1;
[/field:id]
{/dede:type}
|