命令: {dede:field.id function=’get_lianlun_dq(@me)’/}
function get_lianlun_dq($aid){
global $dsql;
$row = $dsql->GetOne("select relid from dede_link where aid = $aid and fenlei = 'dq' and xmlx = 'rm' and pos = 'all'");
$ids = str_replace('|', ',', $row['relid']);
$sql = "select typename,typedir from dede_arctype where id in ($ids)";
$dsql->Execute('me', $sql);
$str = '';
while ($row = $dsql->GetArray()) {
$str .= '<li class="fl t-c"> <a href="'.$GLOBALS['cfg_basehost'].''.$row['typedir'].'/" title="'.$row['typename'].'一点点官网" target="_blank">'.$row['typename'].'一点点官网</a></li>';
}
if($str == ''){
$typenames = "'重庆'";
$sql = "select typename,typedir from dede_arctype where reid = 17 and typename not in ($typenames) order by rand() limit 20";
$dsql->Execute('me',$sql);
while ($row = $dsql->GetArray()) {
$str .= '<li class="fl t-c"> <a href="'.$GLOBALS['cfg_basehost'].''.$row['typedir'].'/" title="'.$row['typename'].'一点点官网" target="_blank">'.$row['typename'].'一点点官网</a></li>';
}
}
return $str;
}