dedecms按栏目名首字母/数字排序输出的实现方法
function getfristword( $tid )
{
$str ='';
$tid = intval( $tid );
$dsql = new Dedesql(false);
$sql ="select `first_word` from dede_arctype where topid='$tid' group by first_word";
$dsql->SetQuery($sql);
$dsql->Execute('hw');
while($row=$dsql->GetArray('hw'))
{
if($row['first_word'])
{
$wd =$row['first_word'];
$sql = "select * from dede_arctype where topid=$tid and first_word= '$wd' ";
$dsql->SetQuery($sql);
$dsql->Execute('wd');
$str .='
'.strtoupper($wd).'开头
';
while( $rs = $dsql->GetArray('wd') )
{
$str .=''.$rs['typename'].'';
}
}
}
return $str;
本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!