PDA

View Full Version : Mini Mods - Create sitemap for your site


Thangvip9x
02-21-2014, 11:00 PM
When you run sitemap.php, your sitemap will create
Please login host and create a file name sitemap.php and paste 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
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 $baseurl="http://yourdomain/"; with your domain
Please Mark as Installed

final kaoss
02-22-2014, 03:50 PM
There's no need for this mod, we can do it with 2 other free products from vbseo & dbseo.

ozzy47
02-22-2014, 03:52 PM
There is also plenty of online sitemap generators as well, but some may find this useful.

puertoblack2003
02-22-2014, 06:06 PM
very useful :up:

Thangvip9x
02-22-2014, 09:24 PM
very useful :up:

Thank you very much

Thangvip9x
02-22-2014, 10:26 PM
There's no need for this mod, we can do it with 2 other free products from vbseo & dbseo.
This mod will create sitemap for your site, please read thread

final kaoss
02-23-2014, 12:50 AM
I have read the thread just fine. Would you like me to point you to the vbseo sitemap mod and the details in the dbseo thread detailing it's sitemap feature? It seems that it's you who needs to re-read.

ahobilam
03-09-2014, 12:48 AM
I could not understand the instructions given.
I tried adding this sitemap.php file to site root and as well as forum root
no luck.
Also, many other ways are discussed but no link given?!

ozzy47
03-09-2014, 12:55 AM
I could not understand the instructions given.
I tried adding this sitemap.php file to site root and as well as forum root
no luck.
Also, many other ways are discussed but no link given?!

Google search, https://www.google.com/search?q=sitemap+generator&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=sb

DBSEO, https://vborg.vbsupport.ru/showthread.php?t=308615

VBSEO Sitemap, https://vborg.vbsupport.ru/showthread.php?t=253516

RichieBoy67
04-02-2014, 03:54 PM
Vbulletin also has a built in generator that works just fine.

bosanci28
04-03-2014, 03:53 PM
A new folder "sitemap" must be created in main vb root files, before you running the sitemap.php.

Black Snow
09-03-2014, 08:39 AM
What happens when you have forums that shouldn't be included in a sitemap? I don't want Staff Only forums to show up in a sitemap if I have set it to only allow staff to see them.

Dave
09-03-2014, 09:45 AM
What happens when you have forums that shouldn't be included in a sitemap? I don't want Staff Only forums to show up in a sitemap if I have set it to only allow staff to see them.

You should look for an other sitemap generation tool. If I know the location of this script, I could request it many times in a row and it will cause a huge load on the server.

letipro
02-08-2017, 01:44 AM
like pro, i like it
Thả tim :D :D :D

bestone96
05-05-2020, 07:14 PM
does not work