16
2020
11

帝国cms自定义分页(列表分页,内容分页)样式步骤


下面说下列表页分页样式自定义的方法,内容分页同理

第一步:进入帝国cms后台,点击系统设置->系统参数设置->信息设置:里面有个"列表分页函数(列表)"选项,将里面的函数名修改为user_ShowListMorePage

第二部:到 e/class/userfun.php <?php   ?>  之间插入下面代码

function user_ShowListMorePage($num,$page,$dolink,$type,$totalpage,$line,$ok,$search=""){
    global $fun_r,$public_r;
    if($num<=$line)
    {
        $pager['showpage']='';
        return $pager;
    }
    $page_line=$public_r['listpagelistnum'];
    $snum=2;
 
    //上一页
    if($page<>1)
    {
        $toppage='<a href="'.$dolink.'index'.$type.'" class="disabled">'.$fun_r['startpage'].'</a>';    //首页
        $pagepr=$page-1;
        if($pagepr==1)
        {
            $prido="index".$type;
        }
        else
        {
            $prido="index_".$pagepr.$type;
        }
        $prepage='<a href="'.$dolink.$prido.'" class="disabled">'.$fun_r['pripage'].'</a>';     //上一页
    }
    //下一页
    if($page!=$totalpage)
    {
        $pagenex=$page+1;
        $nextpage='<a href="'.$dolink.'index_'.$pagenex.$type.'" class="disabled">'.$fun_r['nextpage'].'</a>';   //下一页
        $lastpage='<a href="'.$dolink.'index_'.$totalpage.$type.'" class="disabled">'.$fun_r['lastpage'].'</a>';    //最后一页
    }
    $starti=$page-$snum<1?1:$page-$snum;
    $no=0;
    for($i=$starti;$i<=$totalpage&&$no<$page_line;$i++)    //详细页码信息
    {
        $no++;
        if($page==$i)
        {
            $is_1="<a class='cur'>";    //当前
            $is_2="</a>";
        }
        elseif($i==1)
        {
            $is_1='<a href="'.$dolink.'index'.$type.'">';   //第一页
            $is_2="</a>";
        }
        else
        {
            $is_1='<a href="'.$dolink.'index_'.$i.$type.'">';    //其他页
            $is_2="</a>";
        }
        $returnstr.=$is_1.$i.$is_2;
    }
    $returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage; 
    $pager['showpage']=$returnstr;
    return $pager;
}

第三步:在你的列表页中写上分页就好了【[!--show.listpage--]】(中英文不同样式还可以用[!--show.page--]这个分页函数调用记得在“系统参数设置”里写对应调用自定义标签函数即可

15
2020
11

帝国CMS替换当前位置导航[!---newsnav--]标签,实现样式自定义

如何解决[!---newsnav--]标签的样式死板,不改官方源码,避免升级时会痛苦不堪。

15
2020
11

帝国CMS内容页自定义样式调用上一篇和下一篇的方法

帝国CMS用传统的方法调用上一篇和下一篇,无法用css控制会出现乱位。

15
2020
09

用frp实现无公网ip的内网穿透

最近公司搞了一套erp系统,需要远程访问,但是园区的宽带没有公网ip,一开始想用花生壳,但是免费版只有1g的流量,网上搜索一番,发现了frp这款软件,试了一下还可以。

内网穿透工具有很多,其中 Frp (Fast Reverse Proxy) 是比较流行的一款。FRP 是一个免费开源的用于内网穿透的反向代理应用,它支持 TCP、UDP 协议, 也为 http 和 https 协议提供了额外的支持。你可以粗略理解它是一个中转站,帮你实现 公网 ←→ FRP(服务器) ←→ 家庭内网 的连接,让内网里的设备也可以被公网访问到。

25
2017
07

判断PC端跳转手机端教程 手机访问自动跳转

1、新建一个js  如 wap.js 内容如下


function browserRedirect(url) {

var sUserAgent = navigator.userAgent.toLowerCase();

var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";

var bIsMidp = sUserAgent.match(/midp/i) == "midp"; 

05
2017
05

帝国cms调用广告系统图片做幻灯

帝国cms调用广告系统图片做幻灯


classid=3 是指


[e:loop={"select picurl,url,target from {$dbtbpre}enewsad where classid=3 order by adid asc limit 3",0,24,0}]

<div class="item" style="background:url(<?=$bqr[picurl]?>)"><a target="_blank" href="<?=$bqr[url]?>"><img src="/Public/images/banner-height.gif" class="center-block"  /></a></div>

28
2017
04

帝国cms调用指定栏目及子栏目缩略图

调用指定栏目缩略图

 [e:loop={"select classid,classname,classimg,intro from phome_enewsclass where classid=栏目id",1,24,0}] 
<li><a href="<?=$bqsr[classurl]?>" target="_blank"><span><img src="<?=$bqr[classimg]?>" alt="<?=$bqr[classname]?>"></span><?=$bqr[classname]?></a></li>
 [/e:loop]


28
2017
04

帝国cms栏目导航实现既高亮也有下拉菜单方法

<?php
   $ecms_bq_sql=sys_ReturnEcmsLoopBq('select classid,classname,classpath from [!db.pre!]enewsclass where bclassid=0 and showclass=0 order by myorder limit 8',20,24,0);    $bqno=0;
    while($bqr=$empire->fetch($ecms_bq_sql))
    {
    $bqsr=sys_ReturnEcmsLoopStext($bqr);
    $bqno++;
?>

<?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
$bgcolor="";
if($GLOBALS[navclassid])
{
$fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID
if($bqr[classid]==$topbclassid)
{
$bgcolor="改成高亮css的class值";
}
}
?>

         <li class="<?=$bgcolor?>"><a href="<?=$public_r[newsurl]?><?=$bqr[classpath]?>/"><span class="nav-title"><?=$bqr[classname]?></span></a><ul class="dropdown-box"></ul></li>
         
         <li class="dropdown <?=$bgcolor?>"><a href="<?=$public_r[newsurl]?><?=$bqr[classpath]?>/"><span class="nav-title"><?=$bqr[classname]?></span></a>
          <ul class="dropdown-box">
          <?php
        $ecms_bq_sql2=sys_ReturnEcmsLoopBq("select classid,classname,classpath from [!db.pre!]enewsclass where bclassid='$bqr[classid]' order by myorder limit 9",20,24,0);
        $bqno2=0;
        while($bqr2=$empire->fetch($ecms_bq_sql2))
        {
        $bqsr2=sys_ReturnEcmsLoopStext($bqr2);
        $bqno2++;
        ?>
           <li><a href="<?=$public_r[newsurl]?><?=$bqr2[classpath]?>/"><?=$bqr2[classname]?></a></li>
         <?php
        }
?>
          </ul>
         </li>
         
<?php
}
?>


26
2016
04

微信分享链接时,怎样才能带上带缩略图?

如图,上面的分享链接是有图片有简介,还有下标

22
2016
04

pc端点击弹窗代码

pc端点击弹窗代码

function Cookie(a,c,b,f,d,e){this.$document=a;this.$name=c;if(b){this.$expiration=new Date((new Date()).getTime()+b*60*1000)}else{this.$expiration=null}if(f){this.$path=f}else{this.$path=null}if(d){this.$domain=d}else{this.$domain=null}if(e){this.$secure=true}else{this.$secure=false}}Cookie.prototype.store=function(c){var b="";if(c&&c!=""){b=c}else{for(var d in this){if((d.charAt(0)=="$")||((typeof this[d])=="function")){continue}if(b!=""){b+="&"}b+=d+":"+escape(this[d])}}if(b.indexOf('"')!=0){b='"'+b+'"'}var a=this.$name+"="+b;if(this.$expiration){a+="; expires="+this.$expiration.toGMTString()}if(this.$path){a+="; path="+this.$path}if(this.$domain){a+="; domain="+this.$domain}if(this.$secure){a+="; secure"}this.$document.cookie=a};Cookie.prototype.load=function(){var e=this.$document.cookie;if(e==""){return false}var g=e.indexOf(this.$name+"=");if(g==-1){return false}g+=this.$name.length+1;var c=e.indexOf(";",g);if(c==-1){c=e.length}var f=e.substring(g,c);if(f.indexOf('"')==0){f=f.substring(1,f.length-1)}var b=f.split("&");for(var d=0;d<b.length;d++){b[d]=b[d].split(":")}for(var d=0;d<b.length;d++){this[b[d][0]]=unescape(b[d][1])}return true};Cookie.prototype.remove=function(){var a;a=this.$name+"=";if(this.$path){a+="; path="+this.$path}if(this.$domain){a+="; domain="+this.$domain}a+="; expires=Fri, 02-Jan-1970 00:00:00 GMT";this.$document.cookie=a};var c=new Cookie(document,"AD_Time_480",60,"/");c.load();var idx=0;if(c.idx){idx=parseInt(c.idx)+1}c.idx=idx;c.store();
var ClickSuccess = false;
var opened = false;
function myclick() {
    if (!opened && !ClickSuccess&&c.idx==0){
        if (window.Event)
        {
            top.document.captureEvents(Event.CLICK);
            document.captureEvents(Event.CLICK);
        }
        top.document.onclick = goto;
        document.onclick = goto;
        self.focus();
        ClickSuccess=true;
    }
}
function goto() {
    if (!opened) {
        popwin = window.open("http://www.baidu.com/");//此处就是要弹出页面的广告地址,自己加上吧。
        if (popwin) {
            opened = true;
        }
        //self.focus();
    }
}
myclick();