Discuz x2.5 Sitemap 100 new Post articles per page

Source: Internet
Author: User
Tags join php and

Application Center has a number of Sitemap and other plug-ins, a little expensive, too troublesome, perhaps not deeply understand the usefulness of those plug-ins it (*^__^*) Xi Hee
Refer to the methods on the Internet Discuz x2.5 sitemap Each page to 100 new Post article, hope to seo/seo.html "target=" _blank "> Search engine seo a little help slightly

Specific implementation code

The code is as follows Copy Code

<?php
Define (' Apptypeid ', 4);
Define (' Curscript ', ' sitemap ');
Require './source/class/class_core.php ';
$discuz = & Discuz_core::instance ();
$discuz->cachelist = $cachelist; $discuz->init ();
$navtitle = ' Amoy sourcing-the source of expertise around you '; Amoy Sourcing-sourcing experts around you
$metakeywords = ' Amoy sourcing, shop promotion, shop sourcing, shop agents, shop sales, Taobao sourcing, tap sourcing, sourcing, shop experience, shop Exchange learning, through train, Taobao Guest, exchange of experience, sourcing, women's supply, men's supply, bag sourcing, cosmetics sourcing, home textile sourcing,  Sourcing forum, Sourcing wholesale, Amoy I love '; Site keywords
$metadescription = ' Amoy sourcing is a professional shop sourcing site, for the search shop agent, online shop, a generation of users to provide professional sourcing services, and provide quality sourcing information, share shop promotion, open shop experience Exchange, on the Amoy sourcing '; Website description
Include template (' Common/header ');

Echo '
<style type= "Text/css" >
a:link {color: #333; text-decoration:none;}
a:visited {text-decoration:none; color: #666;}
a:hover {text-decoration:none; color: #F90;}
a:active {text-decoration:none; color: #F90;}
. newtid{width:99.7%;float:left margin-top:10px; border:1px dotted #F90; margin-bottom:10px;
. newtid li{padding-left:2%;font-size:12px;width:48%; float:left;line-height:25px;}
. Newtid Li A{color: #333;}
. newtit strong a{position:absolute;bottom:98765px;
. Newtid h2{font-size:16px;line-height:45px;}
</style>
<ul class= "Newtid" >;
$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");
$site _num = $site _num? $site _num:0;
$site _listnum = 100;
$site _page = intval ($_g[' gp_page '))? Intval ($_g[' Gp_page '): 1;
$site _max = $site _page > 0? $site _listnum * ($site _page-1): 0;
$site _max2 = $site _max2 + 100;
$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 );
$multipage = multi ($site _num, $site _listnum, $site _page, "sitemap.php");
$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 + +;}
Echo $multipage;
Echo ' </ul> ';
Include template (' Common/footer ');? >

Save the sitemap.php and upload it to the root directory of your space

Enter your site's background-interface-navigation settings-bottom navigation, add a bottom link, link address for http://your address/sitemap.php, don't forget to check "available"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.