当前位置:首页 > 文章 > 帝国CMS > 正文内容

帝国cms结合项显示数量方法

3年前 (2022-10-22)帝国CMS5295

效果如下:

帝国cms结合项显示数量方法

 

修改步骤:

一:结合项调用函数声明处加上:,$emod_r,$class_r,$empire,$dbtbpre;

帝国cms结合项显示数量方法

二:增加统计方法代码

帝国cms结合项显示数量方法

帝国cms结合项显示数量方法

 

以下为用到的代码:

//修改开始
$andval=$vtr[1];
$total=0;
$mclassid=$classid;
if(!is_numeric($classid)){
$classid = explode(',', $classid);
$classidArr=array();
foreach ($classid as $key1 => $val1) {
$intclassid = (int)$val1;
if($intclassid){
array_push($classidArr,$intclassid);
}
}
$mclassid=$classidArr[0];
$classid = join(',',$classidArr);
}
$mid = $class_r[$mclassid][modid];
$tbname = $class_r[$mclassid][tbname];
if(!empty($andval))
{
$andval=RepPostVar2($andval);
if(strstr($andval,'__'))
{
$andbtr=explode('__',$andval);
$andbtr[0]=(float)$andbtr[0];
$andbtr[1]=(float)$andbtr[1];
if($andbtr[0]&&$andbtr[1])
{
$listandf=$field." BETWEEN '".$andbtr[0]."' and '".$andbtr[1]."'";
}
}
elseif(empty($emod_r[$mid]['setandf']))
{
$listandf=$field."='".$andval."'";
}
else
{
$listandf=$field." like '%".$andval."%'";
}
 
 
 
$val = $vtr[1];
$total=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_{$tbname} where classid in ($classid) and $listandf");
 
}else{
 
$total=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_{$tbname} where classid in ($classid)");
 
}
 
//修改结束

扫描二维码推送至手机访问。

版权声明:本文由蓝博发布,如需转载请注明出处。

本文链接:https://www.blueboss.cn/p/858.shtml

标签: 结合项

“帝国cms结合项显示数量方法” 的相关文章

帝国cms内容页显示标题加粗颜色等属性

帝国cms内容页显示标题加粗颜色等属性

每条信息的标题设置了不同的颜色,这些在列表页自动能显示出来了。 但是,在内容页用[!--title--]只能显示出标题文字,用什么代码能让内容页也能显示出设置好的标题的颜色? 在内容页模板找到[!--title--]替换为 <?=DoTitleFont($navinfor[titlefont...

帝国CMS动态页支持栏目导航标签循环子栏目数据标签万能标签的调用

帝国CMS动态页支持栏目导航标签循环子栏目数据标签万能标签的调用

分享一种利用JS来实现支持栏目导航标签,万能标签,循环子栏目数据标签的方法。   第一步:在【模板】下面增加标签模板,标签模板内容如下:   页面模板内容(*): [!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.list...

帝国cms内容页正文附件下载的调用代码

帝国cms内容页正文附件下载的调用代码

帝国cms内容页正文附件下载的调用代码 [e:loop={"select * from phome_enewsfile_1 where classid='$navinfor[classid]' and id='$navinfor[id]' order by id desc",0,24,0,'','...

帝国cms灵动标签实现循环子栏目数据

帝国cms灵动标签实现循环子栏目数据

帝国cms灵动标签实现循环子栏目数据 <?php $bclassid=$GLOBALS[navclassid];//取得本栏目id //取得本栏目下的子栏目 ?> [e:loop={"select classid, classname, classpath from `[!db.pre...

帝国CMS使用esub/substr截取前面(或后面)两个字符(或多个字符)

帝国CMS使用esub/substr截取前面(或后面)两个字符(或多个字符)

帝国CMS怎么用灵动标签使用esub/substr截取前面,或者截取后面两个字符或者多个字符呢? ①、帝国网站 显示是"帝国" (这是灵动标签默认的截取标签字段“esub”), [e:loop={'select * from phome_enewsclass where bclassid=0 or...

帝国CMS更新内容提示Table#039;www_**_com.***_ecms_news_data_#039;doesn#039;texist...

帝国CMS更新内容提示Table#039;www_**_com.***_ecms_news_data_#039;doesn#039;texist...

帝国CMS更新整站内容提示:Table 'www_123_com.***_ecms_news_data_' doesn't exist...的解决办法! 相信很多使用帝国cms模板建站的朋友,都有遇到过类似的问题,那么这个是什么问题呢?其实这个是我们后台:871 文章id为871的文章删除了,但是表...