帝國cms相關(guān)鏈接無內(nèi)容時調(diào)用當(dāng)前欄目最熱信息的方法
帝國cms相關(guān)鏈接,這里以帝國cms 7.0為例具體代碼 在/e/class/functions.php
$keyboardtext='<?=GetKeyboard($ecms_gr[keyboard],$ecms_gr[keyid],$ecms_gr[classid],$ecms_gr[id],$class_r[$ecms_gr[classid]][link_num])?>';可以看到相關(guān)鏈接的信息是通過GetKeyboard得到,找到 GetKeyboard修改一下就可以了,也是在/e/class/functions.php
//取得相關(guān)鏈接
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");//取得相關(guān)鏈接模板
$temp_r=explode("[!--empirenews.listtemp--]",$tr[otherlinktemp]);
$key_sql=$empire->query("select id,newstime,title,isurl,titleurl,classid,titlepic,lastvolume from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where ".$add." order by newstime desc limit $link_num");
while($link_r=$empire->fetch($key_sql))
{
//=========================================================2012-12-25 4usky.com
$text=RepOtherTemp($temp_r[1],$link_r,$tr);
$text=str_replace('[!--no--]',$i,$text);
$text=str_replace('[!--state--]',$link_r[state],$text);
$text=str_replace('[!--lastvolume--]',$link_r[lastvolume],$text);
$keyboardtext.=$text;
//$keyboardtext.=RepOtherTemp($temp_r[1],$link_r,$tr);
}
$keyboardtext=$temp_r[0].$keyboardtext.$temp_r[2];
}
else
{
//-------------生成的時候加載一次keyid zhuxianfei.com 2013/5/17 星期五
$keyid=GetKeyid($keyboard,$classid,0,$link_num);
if($keyid)
{
$fsql=$empire->query("update {$dbtbpre}ecms_".$class_r[$classid][tbname]."_data_1 set keyid='$keyid' where id='$id'");
$add="id in (".$keyid.")";
$tr=$empire->fetch1("select otherlinktemp,otherlinktempsub,otherlinktempdate from ".GetTemptb("enewspubtemp")." limit 1");//取得相關(guān)鏈接模板
$temp_r=explode("[!--empirenews.listtemp--]",$tr[otherlinktemp]);
$key_sql=$empire->query("select id,newstime,title,isurl,titleurl,classid,titlepic,lastvolume from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where ".$add." order by newstime desc limit $link_num");
while($link_r=$empire->fetch($key_sql))
{
//=========================================================2012-12-25 4usky.com
$text=RepOtherTemp($temp_r[1],$link_r,$tr);
$text=str_replace('[!--no--]',$i,$text);
$text=str_replace('[!--state--]',$link_r[state],$text);
$text=str_replace('[!--lastvolume--]',$link_r[lastvolume],$text);
$keyboardtext.=$text;
//$keyboardtext.=RepOtherTemp($temp_r[1],$link_r,$tr);
}
$keyboardtext=$temp_r[0].$keyboardtext.$temp_r[2];
}
else //沒有關(guān)鍵字的時候讀取人氣最高的幾條信息 2013/5/17 星期五 zhuxianfei.com
{
$add="";
$tr=$empire->fetch1("select otherlinktemp,otherlinktempsub,otherlinktempdate from ".GetTemptb("enewspubtemp")." limit 1");//取得相關(guān)鏈接模板
$temp_r=explode("[!--empirenews.listtemp--]",$tr[otherlinktemp]);
$key_sql=$empire->query("select id,newstime,title,isurl,titleurl,classid,titlepic,lastvolume from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where order by onclick desc limit $link_num");
while($link_r=$empire->fetch($key_sql))
{
//=========================================================2012-12-25 4usky.com
$text=RepOtherTemp($temp_r[1],$link_r,$tr);
$text=str_replace('[!--no--]',$i,$text);
$text=str_replace('[!--state--]',$link_r[state],$text);
$text=str_replace('[!--lastvolume--]',$link_r[lastvolume],$text);
$keyboardtext.=$text;
//$keyboardtext.=RepOtherTemp($temp_r[1],$link_r,$tr);
}
$keyboardtext=$temp_r[0].$keyboardtext.$temp_r[2];
}
//----------------------------------------------------------------------------------------------
//$keyboardtext=$fun_r['NotLinkNews'];
}
return $keyboardtext;
}
原來的官方代碼
在沒有關(guān)鍵字的時候直接就給出
$keyboardtext=$fun_r['NotLinkNews'];
這顯示無相關(guān)信息
我做了一個無keyid的時候再去獲取一次keyid,
$keyid=GetKeyid($keyboard,$classid,0,$link_num);
確實(shí)沒有關(guān)鍵字的時候讀取人氣最高的幾條信息
$key_sql=$empire->query("select id,newstime,title,isurl,titleurl,classid,titlepic,lastvolume from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where order by onclick desc limit $link_num");
上一篇:帝國cms安裝在二級目錄步驟
欄 目:帝國cms
下一篇:使用phpmyadmin如何修改帝國CMS的管理員密碼
本文標(biāo)題:帝國cms相關(guān)鏈接無內(nèi)容時調(diào)用當(dāng)前欄目最熱信息的方法
本文地址:http://mengdiqiu.com.cn/a1/diguocms/12523.html
您可能感興趣的文章
- 05-31帝國CMS調(diào)用欄目自定義字段方法
- 05-31php獲取帝國CMS各種路徑的幾種方法
- 05-31帝國CMS靈動標(biāo)簽無限嵌套方法
- 05-31帝國CMS會員地址 收藏夾地址 錯誤舉報地址整理
- 01-11帝國CMS調(diào)用自定義列表名稱的方法(簡單二次開發(fā)實(shí)現(xiàn))
- 01-11帝國CMS 功能解密 網(wǎng)站安全防火墻使用說明
- 01-11帝國CMS在自定義列表中獲取當(dāng)前列表ID的方法
- 01-11帝國cms 頂踩 百分比 數(shù)字 完美顯示解決
- 01-11帝國下載系統(tǒng)2.5添加迅雷快車專用鏈的方法
- 01-11帝國CMS擴(kuò)展SQL程序編寫介紹


閱讀排行
本欄相關(guān)
- 05-31帝國CMS調(diào)用欄目自定義字段方法
- 05-31php獲取帝國CMS各種路徑的幾種方法
- 05-31帝國CMS靈動標(biāo)簽無限嵌套方法
- 05-31帝國CMS會員地址 收藏夾地址 錯誤舉報
- 01-11帝國CMS調(diào)用自定義列表名稱的方法(簡
- 01-11帝國CMS在自定義列表中獲取當(dāng)前列表
- 01-11帝國CMS 功能解密 網(wǎng)站安全防火墻使用
- 01-11帝國cms 頂踩 百分比 數(shù)字 完美顯示解
- 01-11帝國下載系統(tǒng)2.5添加迅雷快車專用鏈
- 01-11下載內(nèi)容頁顯示迅雷,快車加密地址標(biāo)
隨機(jī)閱讀
- 01-11Mac OSX 打開原生自帶讀寫NTFS功能(圖文
- 01-10delphi制作wav文件的方法
- 08-05DEDE織夢data目錄下的sessions文件夾有什
- 08-05織夢dedecms什么時候用欄目交叉功能?
- 01-11ajax實(shí)現(xiàn)頁面的局部加載
- 08-05dedecms(織夢)副欄目數(shù)量限制代碼修改
- 01-10使用C語言求解撲克牌的順子及n個骰子
- 04-02jquery與jsp,用jquery
- 01-10C#中split用法實(shí)例總結(jié)
- 01-10SublimeText編譯C開發(fā)環(huán)境設(shè)置