帝國CMS調用發布者所有文章列表的兩種方法!包含高級應用!
發布時間:2019-10-12 來源:未知 瀏覽: 關鍵詞:
調用查看作者的所有文章
帝國CMS實現查看作者的所有文章一共2種方法
一、鏈接到搜索頁
注意:因為一般搜索字節為2個字節,而最先注冊的前9位會員會員id為個位數(即;1個字節),所以要先把搜索字節設置為1個字節
后臺--系統--系統設置--系統參數設置--搜索設置--搜索關鍵字(這里把默認的“2到20”中的2修改為1
格式:/e/search/?searchget=1&keyboard=會員ID&show=userid&member=1
列表內容模板(list.var) 調用:
<a href="e/search/?searchget=1&keyboard=[!--userid--]&show=userid&member=1">[!--username--]</a>
內容頁:
方法1、調用作者多種信息
<?php
$userr=sys_ShowMemberInfo(0,'');
?>
<span>會員頭像:<img src="<?=$userr[userpic]?$userr[userpic]:$public_r[newsurl].'e/data/images/doimg.gif'?>"></span> <br>
<span>會員:<?=$userr[username]?></span> <br>
<span>會員ID:<?=$userr[userid]?></span> <br>
<span>注冊時間:<?=$userr[registertime]==null?"":date('y-m-d',$userr[registertime])?></span> <br>
<span>會員積分:<?=$userr[userfen]?>分</span> <br>
<span>發布新聞:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_news where userid='$navinfor[userid]' and ismember=1")?>條</span> <br>
<span>會員組:<?=$userr[groupname]?></span><br>
<span>作者文章列表2:<a href="<?=$public_r[newsurl]?>e/search/?searchget=1&keyboard=<?=$userr[userid]?>&show=userid&member=1">文章列表</a></span><br>
方法2、直接用鏈接(不好使,在沒有作者的文章中鏈接會鏈到會員ID為1的會員,但名稱卻是管理員的)
<a href="[!--news.url--]e/search/?searchget=1&keyboard=[!--userid--]&show=userid&member=1">[!--username--]</a>
方法3、靈動標簽調用
[e:loop={'selfinfo',1,0,0,"userid='$navinfor[userid]' and classid='$navinfor[classid]' and id=$navinfor[id] and ismember=1"}]
<a href="<?=$public_r[newsurl]?>e/search/?searchget=1&keyboard=<?=$bqr['userid']?>&show=userid&member=1" target="_blank"><?=$bqr['username']?></a>
[/e:loop]
注釋:<?=$public_r[newsurl]?>網站根目錄 <?=$bqr['userid']?>會員id mid=1數據模型id tempid=6列表模板ID
==============================================================================================================
二、鏈接到作者空間(PHP文件本文章最后提供)
使用說明:使用時可用list.php或list2.php,
①、list.php鏈接到會員空間的文章列表,
格式: e/space/list.php?mid=1&userid=2
②list2.php自定義的作者文章列表,可用自己制作的
格式:e/space/list2.php?mid=1&tempid=9&userid=2
注釋:mid=1數據模型id tempid=9列表模板ID(和數據模型關聯) userid=2作者id
注意:list2.php可選擇模板(tempid=模板ID),而list.php不可選,即list.php選擇了模板也還會自動鏈接到會員空間的文章列表
----------------------------------------------------------------------------------------------------------------
列表內容模板(list.var) 調用
<a href="[!--news.url--]e/space/list2.php?mid=1&tempid=9&userid=[!--userid--]">[!--username--]</a>
例子:下列將鏈接到作者空間文章列表
<a >王偉</a>
<a href="[!--news.url--]e/space/list.php?mid=3&tempid=1&userid=[!--userid--]">[!--username--]</a>
------------------------------------------------------------------------------------------------
內容頁調用
方法1、調用作者多種信息
<?php
$userr=sys_ShowMemberInfo(0,'');
?>
<span>會員頭像:<img src="<?=$userr[userpic]?$userr[userpic]:$public_r[newsurl].'e/data/images/doimg.gif'?>"></span> <br>
<span>會員:<?=$userr[username]?></span> <br>
<span>會員ID:<?=$userr[userid]?></span> <br>
<span>注冊時間:<?=$userr[registertime]==null?"":date('y-m-d',$userr[registertime])?></span> <br>
<span>會員積分:<?=$userr[userfen]?>分</span> <br>
<span>發布新聞:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_news where userid='$navinfor[userid]' and ismember=1")?>條</span> <br>
<span>會員組:<?=$userr[groupname]?></span><br>
<span>作者文章列表:<a href="<?=$public_r[newsurl]?>e/space/list.php?userid=<?=$userr[userid]?>&mid=1">文章列表</a></span><br>
方法2、直接用鏈接(不好使,在沒有作者的文章中鏈接會鏈到會員ID為1的會員,但名稱卻是管理員的)
<a href="[!--news.url--]e/space/list.php?mid=1&tempid=1&userid=[!--userid--]">[!--username--]</a>
方法3、靈動標簽調用
[e:loop={'selfinfo',1,0,0,"userid='$navinfor[userid]' and classid='$navinfor[classid]' and id=$navinfor[id] and ismember=1"}]
作者文章列表:<a href="<?=$public_r[newsurl]?>e/space/list.php?userid=<?=$bqr['userid']?>&mid=1" target="_blank"><?=$bqr['username']?></a>
<br>
[/e:loop]
注釋:<?=$public_r[newsurl]?>網站根目錄 <?=$bqr['userid']?>會員id mid=1數據模型id tempid=6列表模板ID
帝國CMS實現查看作者的所有文章一共2種方法
一、鏈接到搜索頁
注意:因為一般搜索字節為2個字節,而最先注冊的前9位會員會員id為個位數(即;1個字節),所以要先把搜索字節設置為1個字節
后臺--系統--系統設置--系統參數設置--搜索設置--搜索關鍵字(這里把默認的“2到20”中的2修改為1
格式:/e/search/?searchget=1&keyboard=會員ID&show=userid&member=1
列表內容模板(list.var) 調用:
<a href="e/search/?searchget=1&keyboard=[!--userid--]&show=userid&member=1">[!--username--]</a>
內容頁:
方法1、調用作者多種信息
<?php
$userr=sys_ShowMemberInfo(0,'');
?>
<span>會員頭像:<img src="<?=$userr[userpic]?$userr[userpic]:$public_r[newsurl].'e/data/images/doimg.gif'?>"></span> <br>
<span>會員:<?=$userr[username]?></span> <br>
<span>會員ID:<?=$userr[userid]?></span> <br>
<span>注冊時間:<?=$userr[registertime]==null?"":date('y-m-d',$userr[registertime])?></span> <br>
<span>會員積分:<?=$userr[userfen]?>分</span> <br>
<span>發布新聞:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_news where userid='$navinfor[userid]' and ismember=1")?>條</span> <br>
<span>會員組:<?=$userr[groupname]?></span><br>
<span>作者文章列表2:<a href="<?=$public_r[newsurl]?>e/search/?searchget=1&keyboard=<?=$userr[userid]?>&show=userid&member=1">文章列表</a></span><br>
方法2、直接用鏈接(不好使,在沒有作者的文章中鏈接會鏈到會員ID為1的會員,但名稱卻是管理員的)
<a href="[!--news.url--]e/search/?searchget=1&keyboard=[!--userid--]&show=userid&member=1">[!--username--]</a>
方法3、靈動標簽調用
[e:loop={'selfinfo',1,0,0,"userid='$navinfor[userid]' and classid='$navinfor[classid]' and id=$navinfor[id] and ismember=1"}]
<a href="<?=$public_r[newsurl]?>e/search/?searchget=1&keyboard=<?=$bqr['userid']?>&show=userid&member=1" target="_blank"><?=$bqr['username']?></a>
[/e:loop]
注釋:<?=$public_r[newsurl]?>網站根目錄 <?=$bqr['userid']?>會員id mid=1數據模型id tempid=6列表模板ID
==============================================================================================================
二、鏈接到作者空間(PHP文件本文章最后提供)
使用說明:使用時可用list.php或list2.php,
①、list.php鏈接到會員空間的文章列表,
格式: e/space/list.php?mid=1&userid=2
②list2.php自定義的作者文章列表,可用自己制作的
格式:e/space/list2.php?mid=1&tempid=9&userid=2
注釋:mid=1數據模型id tempid=9列表模板ID(和數據模型關聯) userid=2作者id
注意:list2.php可選擇模板(tempid=模板ID),而list.php不可選,即list.php選擇了模板也還會自動鏈接到會員空間的文章列表
----------------------------------------------------------------------------------------------------------------
列表內容模板(list.var) 調用
<a href="[!--news.url--]e/space/list2.php?mid=1&tempid=9&userid=[!--userid--]">[!--username--]</a>
例子:下列將鏈接到作者空間文章列表
<a >王偉</a>
<a href="[!--news.url--]e/space/list.php?mid=3&tempid=1&userid=[!--userid--]">[!--username--]</a>
------------------------------------------------------------------------------------------------
內容頁調用
方法1、調用作者多種信息
<?php
$userr=sys_ShowMemberInfo(0,'');
?>
<span>會員頭像:<img src="<?=$userr[userpic]?$userr[userpic]:$public_r[newsurl].'e/data/images/doimg.gif'?>"></span> <br>
<span>會員:<?=$userr[username]?></span> <br>
<span>會員ID:<?=$userr[userid]?></span> <br>
<span>注冊時間:<?=$userr[registertime]==null?"":date('y-m-d',$userr[registertime])?></span> <br>
<span>會員積分:<?=$userr[userfen]?>分</span> <br>
<span>發布新聞:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_news where userid='$navinfor[userid]' and ismember=1")?>條</span> <br>
<span>會員組:<?=$userr[groupname]?></span><br>
<span>作者文章列表:<a href="<?=$public_r[newsurl]?>e/space/list.php?userid=<?=$userr[userid]?>&mid=1">文章列表</a></span><br>
方法2、直接用鏈接(不好使,在沒有作者的文章中鏈接會鏈到會員ID為1的會員,但名稱卻是管理員的)
<a href="[!--news.url--]e/space/list.php?mid=1&tempid=1&userid=[!--userid--]">[!--username--]</a>
方法3、靈動標簽調用
[e:loop={'selfinfo',1,0,0,"userid='$navinfor[userid]' and classid='$navinfor[classid]' and id=$navinfor[id] and ismember=1"}]
作者文章列表:<a href="<?=$public_r[newsurl]?>e/space/list.php?userid=<?=$bqr['userid']?>&mid=1" target="_blank"><?=$bqr['username']?></a>
<br>
[/e:loop]
注釋:<?=$public_r[newsurl]?>網站根目錄 <?=$bqr['userid']?>會員id mid=1數據模型id tempid=6列表模板ID
list2.php下載
責任編輯:實速科技