便宜vps推荐!

帝国CMS灵活调用个性化的多图片集插件

时间:|浏览:| 评论 ()

帝国CMS论坛受管制,强制关闭了,很多技术贴内容无法搜到,之前没养成随手记的习惯,导致现在诸多的不便...
ECMS的图集效果不太理想,一直在用的一个可以灵活调用的多图集功能插件。

1、功能代码

将下面的代码,复制到你的userfun.php中(文件位置:/e/class/userfun.php)

function user_PhotoMorepic($tempid){
    global $navinfor,$public_r;
    $morepic=$navinfor['morepic'];
    $rexp="\r\n";
    $fexp="::::::";
    $rstr="";
    $sdh="";
    $w_morepic="";
    $rr=explode($rexp,$morepic);
    $count=count($rr);
    $num=$count;
    
    //取得模板
    $tr=sys_ReturnBqTemp($tempid);
    if(empty($tr['tempid']))
    {return "";}
    $listtemp=str_replace('[!--news.url--]',$public_r[newsurl],$tr[temptext]);
    $subnews=$tr[subnews];
    $listvar=str_replace('[!--news.url--]',$public_r[newsurl],$tr[listvar]);
    $rownum=$tr[rownum];
    $formatdate=$tr[showdate];
    if(empty($rownum))
    {$rownum=1;}
    
    //列表
    $list_exp="[!--empirenews.listtemp--]";
    $list_r=explode($list_exp,$listtemp);
    $listtext=$list_r[1];
    $no=1;
    $changerow=1;
    
    for($i=0;$i<$count;$i++)
    {
        $fr=explode($fexp,$rr[$i]);
        $smallpic=$fr[0]?$fr[0]:$public_r[newsurl]."e/data/images/notimg.gif";    //小图
        $bigpic=$fr[1]?$fr[1]:$public_r[newsurl]."e/data/images/notimg.gif";    //大图
        if(empty($bigpic))
        {
            $bigpic=$smallpic;
        }
        $picname=htmlspecialchars($fr[2]);    //名称
        $val[picname]=$picname;
        $val[bigpic]=$bigpic;
        $val[smallpic]=$smallpic;
        /////////////////
        $strF=",picname,bigpic,smallpic,";
        $repvar=user_ReplaceShowpicsVars($listvar,$strF,$val,$no);
        $listtext=str_replace("<!--list.var".$changerow."-->",$repvar,$listtext);
        $changerow+=1;
        //超过行数
        if($changerow>$rownum)
        {
        $changerow=1;
        $string.=$listtext;
        $listtext=$list_r[1];
        }
        $no++;
    }
   $string=$list_r[0].$string.$list_r[2];
    echo $string;
}

function user_ReplaceShowpicsVars($listtemp,$strF,$val,$no){
$fr=explode(',',$strF);
$fcount=count($fr)-1;;
for($i=1;$i<$fcount;$i++)
{
$f=$fr[$i];
$value=$val[$f];
$listtemp=str_replace('[!--'.$f.'--]',$value,$listtemp);
}
$listtemp=str_replace('[!--no.num--]',$no,$listtemp);

return $listtemp;
}

2、添加标签

标签名:图集
标签符号:pichd
函数名:user_PhotoMorepic
标签格式:[pichd]tempid[/pichd]
(tempid为模板标签id)

3、标签模板

页面模板内容:
列表头[!--empirenews.listtemp--]列表内容[!--empirenews.listtemp--]列表尾

列表内容模板(list.var)
[!--picname--] 图片说明(标题)
[!--smallpic--] 小图
[!--bigpic--] 大图
[!--no.num--] 序号

内容模板
[pichd]标签模板id[/pichd]

声明:VPSNO仅为VPS服务器信息分享,任何IDC都有倒闭和跑路可能,本站无法作任何保障,请网友购买前自行斟酌,衡量评估风险,自负责任。数据勤备份是最佳选择。本文由VPSNO网站发布,转载请保留链接:《帝国CMS灵活调用个性化的多图片集插件》站长联系QQ:22⑧2六8⑦肆8,邮箱为QQ邮箱。
网友评价
评论列表
共有 条评论

精选便宜VPS - VPS排行

  • No.1 最便宜的大厂云服务器
    UCloud云服务器

    UCloud云服务器

    UCloud(优刻得)是国内最大的中立公有云服务商,全球包含香港、台湾共25个数据中心,52元/年起

  • No.2 国内用户最多的云服务器
    阿里云服务器

    阿里云服务器

    阿里云是国内云服务器第一梯队头部商家,目前国内用户选择最多的云服务器商。

  • No.3 号称“良心云”的云服务器
    腾讯云服务器

    腾讯云服务器

    和阿里云规模相当的国内云服务器商,套路少,给100%CPU资源,拥有更好的性价比。

  • 热度飙升最快的国外VPS
    RackNerd

    RackNerd

    RackNerd是2019年成立的主机商,以提供便宜VPS、大带宽VPS闻名,近年来在国内用户中知名度颇高。

  • 最受国人欢迎的国外VPS
    bandwagonhost搬瓦工

    bandwagonhost搬瓦工

    搬瓦工VPS可能是中国用户数量最多的服务商,专为大陆用户定制了大量功能,线路有特别优化,快而稳定。

  • 实力雄厚的老牌国外VPS
    vultr

    vultr

    Vultr是成立于2014年的老牌IDC,全球16个机房,硬件配置极高,新用户注册赠送100美元余额。