vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - Create sitemap for your site (https://vborg.vbsupport.ru/showthread.php?t=308769)

Thangvip9x 02-21-2014 11:00 PM

Create sitemap for your site
 
1 Attachment(s)
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

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

Quote:

Originally Posted by puertoblack2003 (Post 2483105)
very useful :up:

Thank you very much

Thangvip9x 02-22-2014 10:26 PM

Quote:

Originally Posted by final kaoss (Post 2483087)
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

Quote:

Originally Posted by ahobilam (Post 2485989)
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=site...x-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

Quote:

Originally Posted by Black Snow (Post 2513600)
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


All times are GMT. The time now is 06:13 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01614 seconds
  • Memory Usage 1,769KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete