您现在的位置:首页 > CMS教程 > 帝国CMS

帝国CMS添加腾讯图片展示功能

来源:网络收集  作者:佚名  更新时间:2009-11-30   点击:

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='".$picname."'><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.");' title='".$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,$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("<!--list.var1-->",$showpic,$temp);

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



return $temp;
}

相关链接:
最新评论:
正在载入评论数据中...
发表评论:
不能超过500字节,请自觉遵守互联网相关政策法规.
用户名:验证码:点击更换验证码 匿名评论

站长推荐