帝国cms报错 t_functions.php,帝国CMS添加腾讯图片展示功能

1.修改eclasst_functions.php 添加以下红色代码//图库模型分页标签

function sys_PhotoMorepage($tempid,$spicwidth=0,$spicheight=0){

global $navinfor;

$morepic=$navinfor['morepic'];

if(empty($morepic))

{

return "";

}

//取得标签

$tempr=sys_ReturnBqTemp($tempid);

if(empty($tempr['tempid']))

{return "";}

$rexp="rn";

$fexp="::::::";

$gs="";

if($spicwidth)

{$gs=" width='".$spicwidth."'";}

if($spicheight)

{$gs.=" height='".$spicheight."'";}

$rstr="";

$sdh="";

$firstpic="";

$optionstr="";

$titleoption="";

$listpage="";

$nbsp="";

$rr=explode($rexp,$morepic);

$count=count($rr);

//自加

$pictitleabout="";

$rstrb="";

//

for($i=0;$i

{

$j=$i+1;

$fr=explode($fexp,$rr[$i]);

$smallpic=$fr[0]; //小图

$bigpic=$fr[1]; //大图

if(empty($bigpic))

{

$bigpic=$smallpic;

}

$picname=htmlspecialchars($fr[2]); //名称

$showpic=ReplaceMorePagelistvar($tempr['listvar'],$picname,$bigpic);

$sdh.=$nbsp."".$picname."";

if($i==0)

{

$firstpic=$showpic;

}

$rstr.="photosr[".$j."]="".addslashes($showpic)."";

";

$optionstr.="第 ".$j." 页";

$titleoption.="".$j."、".$picname."";

$listpage.=$nbsp."

itle='".$picname."'>".$j."

";

$nbsp=" ";

//自加

$pictitleabout.="arrUrlName[".$i."]="".addslashes($picname)."";";

$rstrb.="arrUrl[".$i."]="".addslashes($showpic)."";";

//

}

echo ReplaceMorePagetemp($tempr['temptext'],$rstr,$sdh,$optionstr,$titleoption,$firstpic,$listpage,$pictitleabout,$rstrb);

}

//替换图片集分页模板

function ReplaceMorePagetemp($temp,$rstr,$sdh,$select,$titleselect,$showpic,

$listpage,$pictitleabout,$rstrb){

$temp=str_replace("[!--photor--]",$rstr,$temp);

$temp=str_replace("[!--smalldh--]",$sdh,$temp);

$temp=str_replace("[!--select--]",$select,$temp);

$temp=str_replace("[!--titleselect--]",$titleselect,$temp);

$temp=str_replace("[!--listpage--]",$listpage,$temp);

$temp=str_replace("",$showpic,$temp);

//自加

$temp=str_replace("[!--pictitleabout--]",$pictitleabout,$temp);

$temp=str_replace("[!--UrlName--]",$rstrb,$temp);

//

return $temp;

}

2.到后台模板管理-标签模板里添加一个标签模板页面模板内容(*)

img{ border:0; display:inline-block; }

.float_left{float:left}

.float_right{float:right}

.showpic_ex{width:580px; background:#F4F4F4;}

.photo_bar{padding:0 10px;height:35px;background:#EBEBEB}

.photo_bar dd{float:left;margin:5px}

.photo_bar dt{float:right;margin:5px}

#imgBox{text-align:center;padding:15px 0}

#photolist{height:80px;clear:both;background:#EBEBEB}

#photolist .kz{margin:10px 0;}

#photolist .list li{margin:5px 10px;float:left;height:70px;width:70px}

photo_play.gif

id="SlideButton" align="absmiddle" />

alue="5" name="interval">

photo_prev.gif
photo_next.gif
p><p>f

mg src="/Skin/

Tags/img2/photo_showpic.gif"

align="absmiddle" />

photo_left.gif

p><p>oto_right.gif

var Bof=1;

var iplay=1;

var IsPlaying=false;

var PhotoIndex=1;

var arrUrlName=new Array();

var arrUrl=new Array();

var idomain="/";

[!--UrlName--]

[!--pictitleabout--]

var selectList="";

for(var i=0;i

$("photo_select").options[$("photo_select").length]=n

ew Option((i+1) +"/"

+arrUrl.length+ "张",i);

}

ViewPhoto('',2);

ShowUrlList(Bof);

function changePic(id){

var j = parseInt(id.options[id.selectedIndex].value);

ViewPhoto(arrUrl[j],j+2);

}

function ViewPhoto(PhotoUrl,num){

var strHtml;

var FileExt=PhotoUrl.substr(PhotoUrl.lastIndexOf('.')+1).to

LowerCase();

if(FileExt=='gif'||FileExt=='jpg'||FileExt=='png'||FileExt=='bm

p'||FileExt=='jpeg'){

strHtml="

rc='"+PhotoUr

l+"' οnlοad='if(this.width>500) t

his.width=500'>

";

document.getElementById('show_pic').href=PhotoUrl;

document.getElementById('prev_pic').href="javascript:ne

xtpic("+(num-2)+");";

document.getElementById('next_pic').href="javascript:n

extpic("+num+");";

}else if(FileExt=='swf'){

strHtml="

ame='movie' value='"+PhotoUrl+"'>

alue='high'>

d src='"+PhotoUrl+"' plugins

page='http://www.macromedia.com/shockwave/download/

index.cgi?P1_Prod_

Version=ShockwaveFlash' t

ype='application/x-shockwave-flash' width='550' height='400

'>

";

document.getElementById('show_pic').href=PhotoUrl;

document.getElementById('prev_pic').href="javascript:next

pic("+(num-2)+");";

document.getElementById('next_pic').href="javascript:nextp

ic("+num+");";

}else{

strHtml=PhotoUrl;

}

var inum = num-1;

iplay=num;

if(inum<=6){

ShowUrlList(1);

}else if(inum<=12){

ShowUrlList(2);

}else if(inum<=18){

ShowUrlList(3);

}else if(inum<=24){

ShowUrlList(4);

}

document.getElementById('imgBox').innerHTML=strHtml;

}

function SlidePlay(){

var sTimer,url;

if(IsPlaying==false){

IsPlaying=true;

document.getElementById('SlideButton').src=idomain

+'Skin/Tags/im

g2/photo_play1.gif';

sTimer=setTimeout("ViewNext("+(iplay+1)+")",2000);

}else{

clearTimeout(sTimer);

IsPlaying=false;

document.getElementById('SlideButton').src=idomain+'S

kin/Tags/img2

/photo_play.gif';

}

}

function ViewNext(i){

if(IsPlaying==false){return false;}

if(PhotoIndex

ViewPhoto(arrUrl[PhotoIndex],i);

PhotoIndex+=1;

iplay+=1

}

if(PhotoIndex>=arrUrl.length){

PhotoIndex=0;

iplay=2;

}

var iTimeout=parseInt(document.getElementById('interv

al').value * 1000);

if (isNaN(iTimeout)){

iTimeout = 3000;

}

if(iTimeout<1000){iTimeout=5000;}

sTimer=setTimeout("ViewNext("+iplay+")",iTimeout);

$("photo_select").selectedIndex = i-2;

}

function nextpic(ix){

var num = ix-1;

for(var i=0;i

if(num==i) ViewPhoto(arrUrl[i],(i+2));

} //13 14

if(num0)$("photo_select").selected

Index = num;

}

function ShowUrlList(page){

if(arrUrl.length<=1) return '';

var dTotalPage=arrUrl.length/6;

var TotalPage;

var MaxPerPage=6;

var changePage=false;

if(arrUrl.length%MaxPerPage==0){TotalPage=Math.floor(

dTotalPage);}

else{TotalPage=Math.floor(dTotalPage)+1;}

if(page<1) page=1;

if(page>TotalPage) page=TotalPage;

var strPage="";

for(var i=(page-1)*MaxPerPage;i

erPage;i++){

//if(!changePage){

//   strPage+="

iewPhot

o('"+arrUrl[i]+"','"+(i+2)+"')>%22+arrUrl%5Bi%5D+%22

='70' heig

ht='70' />

";

// ViewPhoto(arrUrl[i],i+2);

// changePage=true;

//}else{

strPage+="

arrUrl[i]+"','"

+(i+2)+"')>%22+arrUrl%5Bi%5D+%22

'70' />

";

//}

}

document.getElementById("prev_page").href="javascript:S

howUrlList(

"+(page-1)+")";

document.getElementById("next_page").href="javascript:S

howUrlList

("+(page+1)+")";

document.getElementById("PhotoUrlList").innerHTML=strPage;

}

列表内容模板(list.var) (*)

[!--picurl--]

3.在图片集展示的模板里调用:[eshowphoto]13,0,0[/eshowphoto]    13为刚才添加的标签模板ID

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值