2025年3月29日 星期六 甲辰(龙)年 月廿八 设为首页 加入收藏
rss
您当前的位置:首页 > 计算机 > 服务器 > 万维网络 > 帝国cms

帝国cms相关信息模板 [!--other.link--]显示信息栏目 栏目地址 classname

时间:07-11来源:作者:点击数:108

修改文件e/admin/functions.php

搜索查找 GetKeyboard

原来代码

  • //取得相关链接
  • function GetKeyboard($keyboard,$keyid,$classid,$id,$link_num){
  • global $empire,$public_r,$class_r,$fun_r,$dbtbpre;
  • if($keyid&&$link_num)
  • {
  • $add="id in (".$keyid.")";
  • $tr=$empire->fetch1("select otherlinktemp,otherlinktempsub,otherlinktempdate from ".GetTemptb("enewspubtemp")." limit 1");//取得相关链接模板
  • $temp_r=explode("[!--empirenews.listtemp--]",$tr[otherlinktemp]);
  • $key_sql=$empire->query("select id,newstime,title,isurl,titleurl,classid,titlepic from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where ".$add." order by newstime desc limit $link_num");
  • while($link_r=$empire->fetch($key_sql))
  • {
  • $keyboardtext.=RepOtherTemp($temp_r[1],$link_r,$tr);
  • }
  • $keyboardtext=$temp_r[0].$keyboardtext.$temp_r[2];
  • }
  • else
  • {
  • $keyboardtext=$fun_r['NotLinkNews'];
  • }
  • return $keyboardtext;
  • }

修改为

  • //取得相关链接
  • function GetKeyboard($keyboard,$keyid,$classid,$id,$link_num){
  • global $empire,$public_r,$class_r,$fun_r,$dbtbpre;
  • if($keyid&&$link_num)
  • {
  • $add="a.id in (".$keyid.")";//修改处
  • $tr=$empire->fetch1("select otherlinktemp,otherlinktempsub,otherlinktempdate from ".GetTemptb("enewspubtemp")." limit 1");//取得相关链接模板
  • $temp_r=explode("[!--empirenews.listtemp--]",$tr[otherlinktemp]);
  • $key_sql=$empire->query("select a.id,a.newstime,a.title,a.isurl,a.titleurl,a.classid,a.titlepic,b.classname,b.classpath from {$dbtbpre}ecms_".$class_r[$classid][tbname]." as a left join {$dbtbpre}enewsclass as b on a.classid=b.classid where ".$add." order by a.newstime desc limit $link_num");//修改处
  • while($link_r=$empire->fetch($key_sql))
  • {
  • $text=RepOtherTemp($temp_r[1],$link_r,$tr);//修改处
  • $text=str_replace('[!--add_murl--]',$public_r['add_murl'],$text);//修改处
  • $text=str_replace('[!--classname--]',$link_r[classname],$text);//修改处
  • $text=str_replace('[!--classpath--]',$link_r[classpath],$text);//修改处
  • $keyboardtext.=$text;//修改处
  • }
  • $keyboardtext=$temp_r[0].$keyboardtext.$temp_r[2];
  • }
  • else
  • {
  • $keyboardtext=$fun_r['NotLinkNews'];
  • }
  • return $keyboardtext;
  • }

模板 add_murl 是扩展变量

  • <div class="list">
  • <h3><i></i>相关资讯</h3>
  • <ul>
  • [!--empirenews.listtemp--]
  • <li> <a href="[!--add_murl--][!--titleurl--]" title="[!--oldtitle--]"><img src="[!--titlepic--]"/></a>
  • <div>
  • <h2><a href="[!--add_murl--][!--titleurl--]" title="[!--oldtitle--]">[!--oldtitle--]</a></h2>
  • <span><time>[!--newstime--]</time><a href="[!--add_murl--]/[!--classpath--]/">[[!--classname--]]</a></span> </div>
  • </li>
  • [!--empirenews.listtemp--]
  • </ul>
  • </div>

 

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门