vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Miscellaneous Hacks - TFSEO Google Sitemap Generator (URL rewriting support) (https://vborg.vbsupport.ru/showthread.php?t=198369)

paketeto 12-07-2008 10:00 PM

TFSEO Google Sitemap Generator (URL rewriting support)
 
Google's sitemap with the URL rewriting of TFSEO.

If you dont know TFSEO look at: https://vborg.vbsupport.ru/showthread.php?t=173738

All credit goes to Superjeff, TFSEO'S creator, and i hope he can include and improve this code to merge it seamlessly into TFSEO.

READ CAREFULLY:
ONLY WORKS WITH METHOD 2 OF TFSEO (MEDIUM), with URL STRUCTURE SET TO DIRECTORY (THE FIRST ONE)

---------------------------------------


1. Add this line to your htaccess rules:

RewriteRule (.*)\.xml(.*) $1.php$2 [nocase]


2. Open sitemap.php and fill the required data.


3. Upload sitemap.php to the root of your forum.


4. Write in browser www.yourfoum.com/sitemap.php to generate the xml google sitemap.


About the rewrite rule:
What this does is it turns on the rewrite rule (allowing you to modify how URLs are handled, essentially) and adds the logic that allows a file.php to be intepreted as file.xml.

This now means that if you put sitemap.xml into your browser you'll be viewing the output from sitemap.php and that's crucial because now when Google looks for sitemap.xml it's viewing live data from your PHP script. This means that your sitemap.xml file will never be inaccurate.

So now you only must go to

http://www.google.com/webmasters/too...um/sitemap.xml

each you time you want to tell google to index the changes of your sitemap. The xml is generated by the php code on the fly so is always correct :)


limitations: Writes only home, forums and threads urls (i think is enough for most uses).

-----------------------------------
v1.1: Added parameters for Home, improved defaults value for frequency and priority.

Bombowiec89 12-09-2008 05:13 AM

thanks installed :)

Q-v-n-s-Q 12-09-2008 06:33 AM

very nice, so i need to install TFSEO as well.

LoRdGd 12-09-2008 01:46 PM

Can you explain me why the info about database is nesesary in this modyfication? Maybe im supersensitive, but this is a firs mod where i found sth like this.

yahsuah 12-09-2008 02:40 PM

Thanks!!!

I was searching this...

paketeto 12-09-2008 04:42 PM

Quote:

Originally Posted by LoRdGd (Post 1681652)
Can you explain me why the info about database is nesesary in this modyfication? Maybe im supersensitive, but this is a firs mod where i found sth like this.

Of course. Im not a programmer, and i dont know how to merge this with vbulletin, so i had to make this "dirty" solution, but it works. I hope Superjeff, the tfseo creator, will include and integrate this without the need of fill duplicated data. Sorry.

Anyway, although being a dirty code, is safe to use and works fine.

NAZIA 12-09-2008 07:51 PM

Whats about this error|

Code:

XML Parsing Error: junk after document element
Location: http://bzupages.com/sitemap.php
Line Number 2, Column 1:<b>Warning</b>:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/mounted-storage/home108c/sub001/sc62900-HIDD/bzupages/sitemap.php</b> on line <b>47</b><br />
^


paketeto 12-09-2008 10:18 PM

Quote:

Originally Posted by NAZIA (Post 1681873)
Whats about this error|

Code:

XML Parsing Error: junk after document element
Location: http://bzupages.com/sitemap.php
Line Number 2, Column 1:<b>Warning</b>:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/mounted-storage/home108c/sub001/sc62900-HIDD/bzupages/sitemap.php</b> on line <b>47</b><br />
^


Did you fill all required data in sitemap.php correctly and the database connection was successful?

xuanhuy238 12-11-2008 12:33 AM

Quote:

XML Parsing Error: syntax error
Location: http://www.pes.vn/sitemap.php
Line Number 1, Column 1:Query failed
^
how to fix it???

paketeto 12-11-2008 07:19 AM

Quote:

Originally Posted by xuanhuy238 (Post 1682814)
how to fix it???

The php is not connecting with your database, be sure you fill correctly all required data inside sitemap.php.


All times are GMT. The time now is 09:57 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.01051 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete