国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > Discuz > 正文

discuz x2.5 sitemap每頁調取100條最新帖子文章

2024-09-11 09:03:19
字體:
來源:轉載
供稿:網友

本文章來給各位同學介紹關于discuz x2.5 sitemap每頁調取100條最新帖子文章 程序實例,各位有需要了解決朋友可參考.

應用中心有不少sitemap之類的插件,有點小貴,嫌麻煩,也許沒深刻體會那些插件的用處吧(*^__^*) 嘻嘻.

參考網上的方法 discuz x2.5 sitemap每頁調取100條最新帖子文章,希望對seo搜索引擎SEO有點幫助咯.

具體實現代碼如下:

  1. <?php  
  2. define('APPTYPEID', 4); 
  3. define('CURSCRIPT''sitemap'); 
  4. require './source/class/class_core.php'
  5. $discuz = & discuz_core::instance(); 
  6. $discuz->cachelist = $cachelist;$discuz->init(); 
  7. $navtitle='淘貨源-您身邊的貨源專家';    //淘貨源-您身邊的貨源專家 
  8. $metakeywords='淘貨源,網店推廣,網店貨源,網店代理,網店代銷,淘寶貨源,拍拍貨源,貨源,開店經驗,網店交流學習,直通車,淘寶客,經驗交流,找貨源,女裝貨源,男裝貨源,包包貨源,化妝品貨源,家紡貨源,貨源論壇,貨源批發,淘我所愛';  //網站關鍵詞 
  9. $metadescription='淘貨源是專業的網店貨源網站,為尋找網店代理、網店代銷、一件代發的網友提供專業的貨源服務,并提供優質的貨源信息;分享網店推廣,開店經驗交流,就上淘貨源'//網站描述 
  10. include template('common/header'); 
  11.  
  12. echo ' 
  13. <style type="text/css"
  14. a:link {color: #333; text-decoration: none;} 
  15. a:visited {text-decoration: none; color: #666;} 
  16. a:hover {text-decoration: none; color: #F90;} 
  17. a:active {text-decoration: none; color: #F90;} 
  18. .newtid{width:99.7%;float:left; margin-top:10px; border: 1px dotted #F90; margin-bottom:10px;} 
  19. .newtid li{padding-left:2%;font-size: 12px;width:48%; float:left;line-height: 25px;} 
  20. .newtid li a{color: #333;} 
  21. .newtit strong a{position: absolute;bottom: 98765px;} 
  22. .newtid h2{font-size: 16px;line-height: 45px;} 
  23. </style>    
  24. <ul class="newtid">'; 
  25. $site_num  = DB::result(DB::query("SELECT COUNT(`tid`) FROM ".DB::table('forum_thread')." as a inner join ".DB::table('forum_forum')." as b on a.fid=b.fid where a.displayorder=0 ORDER BY a.tid DESC")); 
  26. $site_num = $site_num ? $site_num :0; 
  27. $site_listnum = 100; 
  28. $site_page = intval($_G['gp_page']) ? intval($_G['gp_page']) :1; 
  29. $site_max = $site_page > 0 ? $site_listnum * ($site_page-1) : 0; 
  30. $site_max2 =   $site_max2 + 100; 
  31. $querys = DB::query("SELECT a.tid,a.subject,a.fid,b.name FROM ".DB::table('forum_thread')." as a inner join ".DB::table('forum_forum')." as b on a.fid=b.fid where a.displayorder=0 ORDER BY a.tid DESC LIMIT ".$site_max.",".$site_max2); 
  32. $multipage = multi($site_num$site_listnum,$site_page"sitemap.php");  //開源軟件:Vevb.com 
  33. $i=1;while($threadfid = DB::fetch($querys)){echo '<li>'.$i.'、<em>[<a href="forum.php?mod=forumdisplay&fid='.$threadfid['fid'].'">'.$threadfid['name'].'</a>]</em> <a href="forum.php?mod=viewthread&tid='.$threadfid['tid'].'" target="_blank">'.$threadfid['subject'].'</a></li>';$i++;}  
  34. echo $multipage;  
  35. echo '</ul>'
  36. include template('common/footer');?> 

保存sitemap.php,并上傳到你空間的根目錄下.

進入你網站的后臺-界面-導航設置-底部導航,添加一個底部鏈接,鏈接地址為http://你的地址/sitemap.php,別忘了勾選“可用”.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 唐山市| 南康市| 余干县| 织金县| 阿城市| 揭东县| 辽宁省| 全州县| 扬中市| 巍山| 芦山县| 高淳县| 长汀县| 大方县| 剑河县| 万源市| 工布江达县| 文昌市| 石渠县| 综艺| 伊春市| 满城县| 兰州市| 四平市| 梨树县| 同心县| 沁阳市| 焉耆| 建始县| 六安市| 明光市| 仁布县| 长宁区| 筠连县| 浦城县| 东兰县| 淄博市| 襄汾县| 清远市| 灵丘县| 威海市|