PDA

View Full Version : Miscellaneous Hacks - Use vBulletin Archive as Sitemap for the Forum


shabbirbhimani
12-14-2008, 10:00 PM
What does this product do?

It uses the existing vBulletin Archive feature to be used for Sitemap for the forum like in vbSEO / TfSEO product.

How to install?


Enable the Archive Feature in
AdminCP > vBulletin Options > Search Engine Friendly Archive

Forum Archive Enabled <Yes>
Display Simple View of Threads <No> ( Optional but its not good to have different page for the content )

Add the following line to your .htacces file

RewriteRule ^sitemap(.*)$ forums/archive/index.php$1 [QSA,L]

Import the product XML

Change the Footer Template to point the Archive to Sitemap Location.

Find :

<if condition="$vboptions['archiveenabled']"><a href="archive/index.php">$vbphrase[archive]</a> -</if>

Replace with :
<if condition="$vboptions['archiveenabled']"><a href="$vboptions[homeurl]sitemap/">$vbphrase[archive]</a> -</if>

You may need to add a trailing slash after $vboptions[homeurl] if it does not already end with /
Optionally change the Phrase Archive to Sitemap


How to uninstall?

Remove the content of .htaccess
Revert the template / phrases
Just un-install product.


Samples

See the working example on my forum http://www.go4expert.com/

Note: I changed some bburl to homeurls and if you find something wrong in it do let me know and I would be more than happy to help.

Alfa1
12-15-2008, 10:35 AM
Something is wrong: It redirects to http://www.mysite.com/index.phpsitemap/
Note that I do have vbSEO sitemap installed. i.e. htaccess does already have these rewrites:
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

shabbirbhimani
12-15-2008, 10:42 AM
If you have vbSEO it already have this feature for you and so you don't need to use this Hack.

Alfa1
12-15-2008, 10:47 AM
I dont have the vbSEO product. I only have the vbSEO Google sitemap mod(submits an xml sitemap to sitemaps.org), that is available here on vb.org.

$vboptions[homeurl] gives mysite.com/index.php
When I hardcode this so that my footer shows mysite.com/sitemap/ or to mysite.com/sitemap/index.php then I still get a blank page.

shabbirbhimani
12-15-2008, 11:01 AM
in this bburl's are replaced by homeurls and so do let me know your bburls/homeurls.

if you would like that to be changed

Edit the

archive_complete plugin

With the following

$searchArray=array(
'<a href="' . $vbulletin->options['homeurl'] . '/archive/index.php">' . $vbulletin->options['bbtitle'] . '</a>',
$vbulletin->options['homeurl'] . '/archive/index.php',
"<a href=\"" . $vbulletin->options['home'] . '/' . $vbulletin->options['forumhome'] . '.php">' . $vbulletin->options['bbtitle'] . "</a>"
);

$replaceArray=array(
'<a href="' . $vbulletin->options['bburl'] . 'sitemap/">' . $vbulletin->options['bbtitle'] . ' Sitemap</a>',
$vbulletin->options['bburl'] . 'sitemap',
"<a href=\"" . $vbulletin->options['bburl'] . '">' . $vbulletin->options['hometitle'] . "</a>"
);
$output = str_replace($searchArray, $replaceArray,$output);

abdobasha2004
12-15-2008, 11:21 AM
is this better or vbseo sitemap generator?

shabbirbhimani
12-15-2008, 11:43 AM
is this better or vbseo sitemap generator?
vbseo sitemap generator generates only xml file for robots to be submitted but this one has the sitemap on your forum for users / bots to browse it.

abdobasha2004
12-15-2008, 02:21 PM
Server not found


Firefox can't find the server at 100fm6.comsitemap.

shabbirbhimani
12-16-2008, 01:48 AM
Server not found


Firefox can't find the server at 100fm6.comsitemap.
How do you get to that? If you can tell me more about it I can help you in this.

Stefanus
12-16-2008, 08:42 PM
How do you get to that? If you can tell me more about it I can help you in this.

Had to do the following edits to get this to link to the sitemap:

Place a "/" between: $vboptions[homeurl] and sitemap/
<if condition="$vboptions['archiveenabled']"><a href="$vboptions[homeurl]/sitemap/">$vbphrase[archive]</a> -</if>

Changed the following in the .htacces file:
RewriteRule ^sitemap(.*)$ "My Forum"/archive/index.php$1 [QSA,L]

On the Sitemap the links stil point to www.mysite.comsitemap and the threads to:
http://www.mysite.comsitemap/f-21.html
http://www.mysite.comsitemap/f-23.html

Any help on this?
Thanks

shabbirbhimani
12-17-2008, 02:01 AM
You would need to edit the replaceArray

'<a href="' . $vbulletin->options['homeurl'] . 'sitemap/">' . $vbulletin->options['bbtitle'] . ' Sitemap</a>',
$vbulletin->options['homeurl'] . 'sitemap',
to
'<a href="' . $vbulletin->options['homeurl'] . '/sitemap/">' . $vbulletin->options['bbtitle'] . ' Sitemap</a>',
$vbulletin->options['homeurl'] . '/sitemap',
In the future version I would check if homeurl ends with / and then add accordingly.

Stefanus
12-17-2008, 12:19 PM
You would need to edit the replaceArray


Without the Complete Idiot's Guide to being a VB coder, the "replaceArray" does sound very strange to me and at this moment I don't have the foggiest idea of any "replaceArray".
Any help in directing me to this "replaceArray" would be appreciated :o

After some time trying to find the "archive_complete plugin " I have to admit that this bugger has eluded me completely and is still at large on my forum, any idea where this fella could be hiding?

Thanks.

shabbirbhimani
12-17-2008, 12:24 PM
AdminCP > Products > plugins

Or if you want I can give you a seperate XML file or let me know your forum url and can edit it for you.

shabbirbhimani
12-17-2008, 01:34 PM
Here is the updated product with the support of / in home url

Stefanus
12-24-2008, 08:14 AM
Hello shabbirbhimani,

Thanks for the help but the best I could get out of this was a working sitemap with the following error:

Parse error: syntax error, unexpected ',' in /usr/www/users/wendag/forum/archive/index.php(475) : eval()'d code on line 12

shabbirbhimani
12-24-2008, 10:44 AM
I downloaded the XML and imported once again and could not get that error.

Check if your archive works without the plugin?

Keesa
12-30-2008, 03:25 AM
MEH! This does not work.

The requested URL /forum/forums/archive/index.php/ was not found on this server.

Why is it forcing in the subdirectory /forums/. Not all of us use that.

shabbirbhimani
12-30-2008, 04:23 AM
You would need to change the .htaccess url to match your url

RewriteRule ^sitemap(.*)$ forums/archive/index.php$1 [QSA,L]

Businesss
04-10-2009, 01:31 AM
I got the sitemap up at http://www.businesss-forum.com/archive/index.php but none of the links are valid.

How can I fix this so bots can read valid info?

shabbirbhimani
04-10-2009, 03:19 AM
You already have a blank sitemap folder under your home directory,

http://www.businesss-forum.com/sitemap/

Remove that first and then get the .htaccess correctly setup. Remember to remove the "forums/"