您的位置: 牛手技术网 >> 论坛 >> [dedecms区] >> 查看帖子
字体: 小 中 大 | 打印 发表于: 2008-4-26 20:01 作者: netman 来源: 牛手技术网
CODE:
function GetTotalArc($typeid){ $dsql = new DedeSql(false); if(!empty($typeid)) { $reids = explode(",",$typeid); $ridnum = count($reids); if($ridnum>1){ $tpsql = ""; for($i=0;$i<$ridnum;$i++){ if($tpsql=="") $tpsql .= " And (".TypeGetSunID($reids[$i],$dsql,''); else $tpsql .= " Or ".TypeGetSunID($reids[$i],$dsql,''); } $tpsql .= ") "; $orwhere .= $tpsql; unset($tpsql); }else{ $orwhere .= " And ".TypeGetSunID($typeid,$dsql,''); } unset($reids); } $row = $dsql->GetOne("Select count(ID) as dd From #@__archives where typeid>0 $orwhere"); return $row['dd']; }
最新回复
netman (2008-4-26 20:02:01)
*** Hidden to visitors ***
比较适合采集时发现内容中有很多html标签,利用这个函数删除。
[ 本帖最后由 netman 于 2008-4-26 20:03 编辑 ]
netman (2008-4-26 20:04:14)
[field:listnum/]返回的是12234,我希望是半角数字12234,可以这样使用函数:
*** Hidden to visitors ***
netman (2008-4-26 20:08:14)
*** Hidden to visitors ***
netman (2008-4-26 20:27:23)
*** Hidden to visitors ***
大小可以修改\include\inc_channel_unit_functions.php
里面的 <img src='".$imgsrc."' width=80 align=left>
其中80就是宽度。
netman (2008-4-26 20:34:38)
///
以下放到 inc_functions.php 中
//-------------------------------------
function MyChannel($f,$t)
{
if($f==$t) return "class=on";
else return "";
}
维护者 (2008-4-27 00:25:43)
netman (2008-4-27 19:04:03)
[field:id function='GetTotalArc(@me)'/]
修改inc_functions.php
下边加
CODE:
function GetTotalArc($typeid){$dsql = new DedeSql(false);
if(!empty($typeid))
{
$reids = explode(",",$typeid);
$ridnum = count($reids);
if($ridnum>1){
$tpsql = "";
for($i=0;$i<$ridnum;$i++){
if($tpsql=="") $tpsql .= " And (".TypeGetSunID($reids[$i],$dsql,'');
else $tpsql .= " Or ".TypeGetSunID($reids[$i],$dsql,'');
}
$tpsql .= ") ";
$orwhere .= $tpsql;
unset($tpsql);
}else{
$orwhere .= " And ".TypeGetSunID($typeid,$dsql,'');
}
unset($reids);
}
$row = $dsql->GetOne("Select count(ID) as dd From #@__archives where typeid>0 $orwhere");
return $row['dd'];
}