Back to vBulletin 4.x Add-ons

Create sitemap for your site
Mod Version: 1.00, by Thangvip9x

vB Version: 4.2.x Rating: (1 vote - 1.00 average) Installs: 6
Released: 22 Feb 2014 Last Update: Never Downloads: 0
Not Supported  

When you run sitemap.php, your sitemap will create
Please login host and create a file name sitemap.php and paste code
PHP Code:
<?php
include('global.php');
$baseurl="http://yourdomain/";
$xml_thread    fopen("sitemap/sitemap_thread.xml""w+");
$xml_forum    fopen("sitemap/sitemap_forum.xml""w+");
$xml_user    fopen("sitemap/sitemap_user.xml""w+");
$header_xml "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
fwrite($xml_thread$header_xml);
fwrite($xml_forum$header_xml);
fwrite($xml_user$header_xml);
// Create sitemap thread
$query=$db->query_read_slave("SELECT threadid,title,dateline FROM thread");
while(
$rows $db->fetch_array($query)) {
fwrite($xml_thread"<url>\n<loc>".$baseurl.fetch_seo_url('thread',array('threadid'=>$rows['threadid'], 'title'=>$rows['title']))."</loc>\n<lastmod>".date('c',$rows['dateline'])."</lastmod>\n<changefreq>yearly</changefreq>\n<priority>0.5</priority>\n</url>\n");
}
// Create sitemap forum
$query=$db->query_read_slave("SELECT forumid,title FROM forum");
while(
$rows $db->fetch_array($query)) {
fwrite($xml_forum"<url>\n<loc>".$baseurl.fetch_seo_url('forum',array('forumid'=>$rows['forumid'], 'title'=>$rows['title']))."</loc>\n<changefreq>yearly</changefreq>\n<priority>0.5</priority>\n</url>\n");
}
// Create sitemap user
$query=$db->query_read_slave("SELECT userid,username,joindate FROM user");
while(
$rows $db->fetch_array($query)) {
fwrite($xml_user"<url>\n<loc>".$baseurl.fetch_seo_url('member',array('userid'=>$rows['userid'], 'username'=>$rows['username']))."</loc>\n<lastmod>".date('c',$rows['joindate'])."</lastmod>\n<changefreq>yearly</changefreq>\n<priority>0.5</priority>\n</url>\n");
}
$footer_xml "</urlset>";
fwrite($xml_thread,$footer_xml);
fwrite($xml_forum,$footer_xml);
fwrite($xml_user,$footer_xml);
fclose($xml_thread);
fclose($xml_forum);
fclose($xml_user);
?>
Create sitemap success<br>
Thread: <a href='sitemap/sitemap_thread.xml'>sitemap_thread.xml</a>
<br>
Forum: <a href='sitemap/sitemap_forum.xml'>sitemap_forum.xml</a>
<br>
User: <a href='sitemap/sitemap_user.xml'>sitemap_user.xml</a>
You can see sitemaps after run sitemap.php
Code:
yourdomain/sitemap/sitemap_thread.xml
yourdomain/sitemap/sitemap_forum.xml
yourdomain/sitemap/sitemap_user.xml
I don't like default sitemap from vbulletin
If you want auto create, you can add Cronjobs in host
Replace
PHP Code:
$baseurl="http://yourdomain/"
with your domain
Please Mark as Installed

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2024