帝国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<$count;$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."<a href='#ecms' onclick='GotoPhPage(".$j.");' title='".$pic|
name."'><img src='".$smallpic."' alt='".$picname."' border=0".$gs."></a>";
if($i==0)
{
$firstpic=$showpic;
}
$rstr.="photosr[".$j."]="".addslashes($showpic)."";
";
$optionstr.="<option value=".$j.">第 ".$j." 页</option>";
$titleoption.="<option value=".$j.">".$j."、".$picname."</option>";
$listpage.=$nbsp."<a href='#ecms' onclick='GotoPhPage(".$j.");' t
itle='".$picname."'>".$j."</a>";
$nbsp="&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,$select,$titleselect,$showpic,

$listpage,$rstrb){
$temp=str_replace("[!--photor--]",$temp);
$temp=str_replace("[!--smalldh--]",$temp);
$temp=str_replace("[!--select--]",$temp);
$temp=str_replace("[!--titleselect--]",$temp);
$temp=str_replace("[!--listpage--]",$listpage,$temp);
$temp=str_replace("<!--list.var1-->",$showpic,$temp);

//自加
$temp=str_replace("[!--pictitleabout--]",$temp);
$temp=str_replace("[!--UrlName--]",$rstrb,$temp);
//



return $temp;
}

2.到后台模板管理-标签模板里添加一个标签模板

页面模板内容(*)

<script language="javascript" type="text/javascript" src="/JS/Common.js"></script>


<style>
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}
</style>

<div class="showpic_ex">
<dl class="photo_bar">
<dd><a href="javascript:SlidePlay();" id="play_pic"><img src="/Skin/Tag

s/img2/photo_play.gif"


id="SlideButton" align="absmiddle" /></a><input id="interval" type="hidden" v
alue="5" name="interval"></dd>
<dd><a href="javascript:;" id="prev_pic"><img src="/Skin/Tags/
img2/photo_prev.gif" align="absmiddle" /></a></dd>
<dd><a href="jaascript:;" id="next_pic"><img src="/Skin/Tags/i
mg2/photo_next.gif" align="absmiddle" /></a></dd>
<dd><select id="photo_select" onChange="changePic(this)">
</select></dd>
<dt><a href="/pic/"><img src="/Skin/Tags/img2/photo_enter.gi
f" align="abs
middle" /></a></dt>
<dt><a href="javascript:;" id="show_pic" target="_blank"><i
mg src="/Skin/
Tags/img2/photo_showpic.gif"
align="absmiddle" /></a></dt>
</dl>
<div id="imgBox"></div>
<div id="photolist">
<div class="kz float_left">
<a href="javascript:;" id="prev_page"><img src="/Skin/Tags/img2
/photo_left.gif" /></a>
</div>
<ul class="list" id="PhotoUrlList"></ul>
<div class="kz float_right">
<a href="javascript:;" id="next_page"><img src="/Skin/T
ags/img2/ph
oto_right.gif" /></a>
</div>
</div>
</div>
<script type="text/javascript">
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<arrUrl.length;i++){
$("photo_select").options[$("photo_select").length]=n
ew Option((i+1) +"/"
+arrUrl.length+ "张",i);
}
ViewPhoto('<!--list.var1-->',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="<a href='javascript:nextpic("+num+");'><img s
rc='"+PhotoUr
l+"' onload='if(this.width>500) t
his.width=500'></a>";
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="<object classid='clsid:D27CDB6E-AE6D-11cf-9
6B8-44455354
0000' width='550' height='400' codebase='http://download.m
acromedia.com}
pub/shockwave/cabs/flash/sw
flash.cab#version=5,0'><param n
ame='movie' value='"+PhotoUrl+"'><param name='quality' v
alue='high'><embe
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
'></embed></object>";
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<arrUrl.length){
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<arrUrl.length;i++){
if(num==i) ViewPhoto(arrUrl[i],(i+2));
} //13 14
if(num<arrUrl.length&&num>0)$("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<arrUrl.length&&i<page*MaxP
erPage;i++){
//if(!changePage){
// strPage+="<li class='thispic'><a href='javascript:;' onclick=V
iewPhot
o('"+arrUrl[i]+"','"+(i+2)+"')><img src='"+arrUrl[i]+"' border='0' width
='70' heig
ht='70' /></a></li>";
// ViewPhoto(arrUrl[i],i+2);
// changePage=true;
/


版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


http://shang.qq.com/widget/group.php
[e:loop={91,5,0,0}] <liclass="bj_<?=$bqno?>"><ahref="<?=$bqsr['titleurl']?>"target="_blank"><?=esub($bqr[title],30)?></a></li> [/e:loop] 其中91表示&nbs…
原文地址:帝国cms修改编辑器的预览功能作者:白头豕帝国CMS的投稿和录入界面没有专门的"预览"功能。fckeditor编辑器里倒是有一个预览,只是功能比较简陋,得到的预览页面没有特别的样式,与网站本身内容页的效果相差甚远。 解决这个问题其实很简单,只要修改fckeditor的两个js文件:fckeditor…
增加后台自定义编辑界面 当值后台界面的地址:D:EmpireServerwebeadminadminstyle 复制1变成3,然后更改页面 把不想客户用到的隐藏掉即可 然后回到后台新建立一个后台样式。 …
原文地址:帝国cms调用当前栏目下所有栏目名称和链接顶级栏目下的栏目调用作者:缘若秋风 这里要用要一个标签了,叫做循环栏目导航标签 [listshowclass]'selfinfo',9,0,0[/listshowclass] 上面的意思是: 'selfinfo'为当前栏目 使用编辑为9的标签模板 下面贴…
解决方法:http://bbs.phome.net/showthread-13-148886-0.html
灵动标签应用之“调用最新DIGG顶的最多的文章” [e:loop={'select*from[!db.pre!]ecms_newswherechecked=1orderbydiggtopdesc,iddesclimit8',10,24,0}] <li><ahr…
更新所有栏目的内容文章页 问题? 如果你把网站迁移成功,打开列表页,单击文章,缺打不开页面的话,怎么解决? 第一种解决方法: 第一步:登陆后台页面,打开【信息】页面,选中栏目名,单击【修改】,然后再点击保存。即可 备注:这样的方法比较麻烦,因为需要每条信息都重复这…
修改帝国默认的列表分页样式和伪静态页面留言版的分页样式。本来想在默认的模板标签上修改,看了看代码,和标签前后都多了空格,如果在现在的基础上改,简单改改也行,不过实在是受不了那么多空格符,而且如果用display:block的话,会出现一个阶梯状的样式,所以修改分页的样式势在必行…
在帝国CMS的模板数据调用里面,直接调用友情链接的是 [phomelink]每行显示数,显示总数,操作类型,分类id,是否显示原链接[/phomelink] 然而这种调用方式在页面生成以后是使用TABLE标签直接显示的,既不能很好的掌握其美观程度,也不符合标准。但是这个[phomelink]标签又没提供标签模…
更改后台登陆次数? 登陆ftp文件,打开E/CLASS/config.php文件,'loginnum'=>100,这个是更改登陆次数的单词。 查看后台登陆认证码? //后台安全设置 登陆ftp文件,打开E/CLASS/config.php文件,$do_loginauth=''; //登录认证码,…
灵动标签应用之“调用信息当天信息加New标志” 本功能实现调用信息时候如果是当天发布的最新信息显示New标志图片。 代码: <ul> [e:loop={栏目ID,显示条数,操作类型,只显示有标题图片}] <? $newimg=""; if(date("m-d",$bqr[truetime])==date("m…
http://jingyan.baidu.com/article/5d6edee228a88899eadeeca7.html
首先我们需要做的就是新建一个地图模板,模板-增加自定义页面模板。 我这里已经填写好了模板内容,代码我写出来: <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transi…
登陆数据库,http://losthost/phpmyadmin,找到phome_enewsuser数据表, 输入SELECT*FROM`phome_enewsuser` phome_enewsuser数据表的信息查询点击执行按钮,会查询出来用户名和密码是多少,由于密码是被md5加密…
==============判断新闻的样式【前面加图标【紧====热】】================== [e:loop={'7,39,46,50',10,0,0,'','onclickDESC'}] <? //print_r($bqr);die(); //echo$bqr; $good=""; &nb…
这个js模版不能使搜索引擎搜到,所以尽量不要用。 第一步:建立js模版。 点击【模版】―【js模版】―【管理js模版】,打开,新建【js模版】,按照列表模版的方式建立。 第二步:打开【栏目】_[管理自定义】新建【自定义js】, 第三步:调用js模版。打开公共模版,动态头…
在【系统】――【安全参数配置】――【后台登陆认证码】输入你想输入的认证码即可。
题描述: 如何更改 当前位置导航中的 【首页 】两字和【首页后面的大于号】 您当前的位置:首页 > 人才频道 > 招聘 如何搞成: 您当前的位置:沛县在线 > 人才频道 > 招聘 解决办法: 1,更改 首页 两个字 e/class/connect.php 搜索:$fun_r['in…
第一步:登陆后台页面,打开【系统】―【数据表与系统模版】―【管理系统模版】,然后点击【修改】按钮。 第二步:去掉你想不显示的一项,在他的后面把对勾去掉即可 第三步:分别选中(录入表单模板)和(前台投稿表单模板)两项,然后点击【提交】按钮。 …