Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Create sitemap for your site Details »»
Create sitemap for your site
Version: 1.00, by Thangvip9x Thangvip9x is offline
Developer Last Online: Nov 2022 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.2.x Rating:
Released: 02-21-2014 Last Update: Never Installs: 6
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-03-2014, 03:53 PM
bosanci28's Avatar
bosanci28 bosanci28 is offline
 
Join Date: Feb 2008
Location: USA - West Coast
Posts: 271
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A new folder "sitemap" must be created in main vb root files, before you running the sitemap.php.
Reply With Quote
  #13  
Old 09-03-2014, 08:39 AM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 09-03-2014, 09:45 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Black Snow View Post
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.
Reply With Quote
  #15  
Old 02-08-2017, 01:44 AM
letipro letipro is offline
 
Join Date: Jun 2012
Location: Ở đ?u c?n l?u
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

like pro, i like it
Thả tim
Reply With Quote
  #16  
Old 05-05-2020, 07:14 PM
bestone96 bestone96 is offline
 
Join Date: Sep 2011
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does not work
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:49 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04497 seconds
  • Memory Usage 2,291KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete