vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Spider friendly URLs (https://vborg.vbsupport.ru/showthread.php?t=18035)

cyc 02-05-2003 08:42 AM

Quote:

Originally posted by lierduh


No worries, mate. :) (some downunder talking there)
Glad it is working for you.

Don't forget the last hack (RewriteCond) regarding the memberlist. Otherwise your member list navigation will not work. Fortunately this is a simple one, only need to add two lines to your rewriterules.

Waiting for more things to break, I am sure there is. :) eg. Merge Thread does not work anymore due to the new URL. Do I care to fix this is another question.:)

Yep done that now thanks for the tip!

I'm thinking I might as well kill my archive now :smoke:

cheers mate!

Haakon 02-06-2003 08:27 AM

Hi lierduh, sorry to bother you about this. But I need some help concerning the approvements you`ve done to the spider friendly hack. I`ve gone through all the steps in your hack, it works great in every area except one, the forumdisplay part.
The first problem is with multipage threads, in forumdisplay it will only show a error page if I click the page buttons. I`ve disabled that hack but the url shows something like "f123--2" which is strange. Any theories about this one? What should I check?

The second problem is that the pagenumber buttons are a bit funky, test this one http://www.radiomute.com/f112-3.html. Click on different pages, unexplainable :)

I`m completely aware that this is not your problem, as I can see you`re hack works perfect for everyone else, but I don`t understand this though I`ve looked into it.

Cheers,
Haakon

lierduh 02-06-2003 09:24 AM

1.

I presume you mean the multiple page thread links displayed under a forumdisplay.

It should be something like t3593-15-5.html

If you had it as: f123--2
then your template is not done properly. The template you need to change is:

================
For forumdisplay_multipagenav_pagenumber

Replace
<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]&perpage=$pperpage&pagenumber=$acurpage">$acurpage </a>

with
<a href="t$thread[threadid]-$pperpage-$acurpage.html">$acurpage</a>
======================

2.

My original rewriterule set the "daysprune=30" (the second rewriterule). Your default setting for "Default view age" is "Last Day". You need to make them the same.

My own forums setting at the moment is "the beginning" for the "Default view age" and the rewriterule is "daysprune=1000"
That will show all the threads, making them all ready to feed the Googlebots.

You can set "Default view age" for each forum through Admin panel, click Modify forums and then "setting". As the side note says, 1000 means from the beginning.

Haakon 02-06-2003 10:13 PM

Hi, changed the rewrite rule to my settings and it works with no funky behavior..... thanks!

The 1st problem didn`t get solved though. It`s like it dosn`t recognize the $pperpage variable. The pages will get spidered from the showthread templates though, so it`s no krisis.

Thanks again,
Haakon

cobradude 02-09-2003 09:45 PM

Is there a way to NOT monkey with the links for multiple pages for memberlist or search? I block the bots for those anyway, and the more rules I have, the easier it will be to break down the road. Any solutions?

lierduh 02-09-2003 10:12 PM

Quote:

Originally posted by cobradude
Is there a way to NOT monkey with the links for multiple pages for memberlist or search? I block the bots for those anyway, and the more rules I have, the easier it will be to break down the road. Any solutions?
Unfortunately the navigation link templates are used for all the multiple pages. So the additional rules for memberlist and search are necessary. Fortunately they are only rules to add without the need to muck around with templates or scripts. I think the additional rules are pretty safe.

If you do not want the robots to index your memberlist or search results (I don't think they will go and fill your search terms anyway). Just create a robots.txt file and they won't bother.

The Piper 02-11-2003 01:47 PM

First, I'd like to thank lierduh for reworking the original hack. It's finally working like a charm on my site.

I'm having one bit of a problem, though. I've noticed, by looking at Who's Online, that some users have unknown locations such as those:

/t2094-3.html ? s = xxxxxxxxxxxxxxxxxxx
/f8 ? s = xxxxxxxxxxxxxxxxxxx
/f13 ? s = xxxxxxxxxxxxxxxxxxx

Note: Extra spaces added, because vB.org removes the session part, when posted as it is. xxxxxx in place of session as well to avoid problems. :)

I was using the original version of the hack, so I used to have URLs like http://www.pinkfloydfan.net/f8, instead of http://www.pinkfloydfan.net/f8.html, so the second and third unknown locations might be because of old references that users posted. (Any clue on how to update old references in posts?), but I have no clue of why the first location (/t2094-3.html ? s = xxxxx) is showing up like that.

Any ideas on this? Thanks a lot again!

lierduh 02-12-2003 09:18 AM

Not sure why the session id is added.

Perhaps you could check the web log, see extractly what URL was accessed, ie. with or without the session id. It may also help you to find out where the link was originated, ie. know as the referrer.

007 03-08-2003 11:14 PM

This is probably a stupid question... but where would I find httpd.conf??? I can't find it in anywhere...

dstruct2k 03-13-2003 03:36 AM

httpd.conf is part of the Apache installation... this mod assumes that you're running your own server....

Too bad it isn't working for me anyways. (Latest version of Apache)

The Piper 03-24-2003 03:12 AM

I'm having some issues with forumdisplay. Please check http://www.pinkfloydfan.net/f20.html and look at the page navigation. Click on any of them, say, page 2. I'm taken to an URL such as http://www.pinkfloydfan.net/forumdis...age=50-2.html, which does not work (that is, I'm shown the first page of the forum as well).

I'd really appreciate any input on this, please. I've changed everything according to this post, and have already doublechecked it.

Thanks a lot,
Paulo

The Piper 03-25-2003 03:31 AM

Ok, since the issues I brought up on my last post were also happening in other parts of the site (for instance, in the Control Panel, while choosing an avatar, users could not choose any page other than 2 - we've got lots of avatars), he would get an URL such as the one described on the past post.

I've just uninstalled all the parts of this hack that deal with page navigation and, of course, everything is working fine again. Of course search engines won't be indexing any pages other than page 1 of all of my threads, but at least everything is working.

If anyone got these problems and/or wants to try to fix them, I'll try to help.

Just thought I'd post my experiences here. :)

slinky 03-25-2003 03:44 AM

There has to be an easy way of doing this... all my pages are html using the mod rewrite and I've made the mod a long, long time ago....

PurpleCow 03-25-2003 01:41 PM

Hii all,

This is a TOP most important hack for vBulletin that was ever done and will be ever done ( might be ), if someone can get it to work with every aspect/page of vbulletin (incase it is yet to be done ?? ) !

I would want to use this hack on my yet to be launched forums and i'd like to know, if the attachment in the first post of this thread is a workiable version for this hack ?? If not kindly attach a file with instructions to get it to work !

I do have a suggestion for fastforward and all other lead developers, contributing developers and behind the scene developers :

Kindly contact Brett_tbake of WebMasterWorld, who has successfully implemented this kind of hack for his forums. however, we should keep in mind that his forums are custom coded and not using vBulletin. but what i mean to say is that, he can sure give you some inputs to make this hack easy to use and get it to work.

I request one of you developers get in touch with him there at webmasterworld.com.

I do have another question :

My forums are installed in a subdomain, meaning.... http://xyz.mydomain.com and not /forums/ type of directory, if i have to get this to work, what if any changes should i make ??

Also, kindly some one give me a link to the thread for Overgorw's hack on this , none of the previously potsed url's work for me !

As a sidenote, i'd like to mention that i am using version 2.3.0, and i hope this hack works for this latest version ??

Thank you very much for working on this hack.

Cheers

slinky 03-25-2003 02:01 PM

My hack seems to work. It's simple but I have no idea if they are being properly indexed. Search engines change their search methods over time and it is tough to track. I've been keeping my forums as is (my pages end in .html files) since it works and little hassle.

But hacks are hacks. A writer is under no obligation to provide support whatsoever so we have to live with it.

cyc 03-25-2003 06:50 PM

Quote:

Today at 02:01 AM slinky said this in Post #255
My hack seems to work. It's simple but I have no idea if they are being properly indexed. Search engines change their search methods over time and it is tough to track.
It looks like you have to register before you can browse your forums. This will also stop search engines from spidering your threads, in other words you may as well not have this hack installed :laugh:

cheers!

lierduh 03-25-2003 09:45 PM

Quote:

03-24-03 at 03:12 PM The Piper said this in Post #251
I'm having some issues with forumdisplay. Please check http://www.pinkfloydfan.net/f20.html and look at the page navigation. Click on any of them, say, page 2. I'm taken to an URL such as http://www.pinkfloydfan.net/forumdis...age=50-2.html, which does not work (that is, I'm shown the first page of the forum as well).

I'd really appreciate any input on this, please. I've changed everything according to this post, and have already doublechecked it.

Thanks a lot,
Paulo

That means the templates have not been changed properly. You should see f20-15-2.html or something like that when it is done properly.

amk35 03-31-2003 07:01 AM

just curious....should the forumdisplay links look like:
forumdisplay.php?s=&forumid=14&daysprune=30&sortor der=&sortfield=lastpost&perpag e=40-3.html

?

All the other links are now short with no "?" symbols etc.

Thanks. Great work btw, much appreciated!

amk35 04-01-2003 12:13 AM

Hi Lierduh

I'm having one problem with the hack. Clicking on any of the links at the bottom of forumdisplay (2,3,4 etc) brings up the same page, page 1. I saw someone else had this problem and I changed the rewrite rule as you suggested, but the problem still exists. Any ideas? Thanks.

lierduh 04-07-2003 04:16 AM

Quote:

04-01-03 at 01:13 PM amk35 said this in Post #259
Hi Lierduh

I'm having one problem with the hack. Clicking on any of the links at the bottom of forumdisplay (2,3,4 etc) brings up the same page, page 1. I saw someone else had this problem and I changed the rewrite rule as you suggested, but the problem still exists. Any ideas? Thanks.


Please provide the problem URLs, you can remove the domain part if you do not want to reveal that. Please also provide the related rewrite rules.

(PS: Don't pay anyone until you do this, it could just be a simply fix.

https://vborg.vbsupport.ru/showthrea...090#post377090

)

amk35 04-07-2003 02:51 PM

Lierduh,

Thanks for the response :)

At
http://domain.com/forums/f1.html

The links on the bottom to view older threads are as follows:

2 - http://domain.com/forums/forumdispla...page=40-2.html

3 - http://domain.com/forums/forumdispla...page=40-3.html

etc. All bring up the same initial forum page when clicked

My rewrite rules are:

RewriteEngine on
RewriteRule ^/forums/f([0-9]+)/?$ /forums/forumdisplay.php?forumid=$1 [L]
RewriteRule ^/forums/f([0-9]+)\.html$ /forums/forumdisplay.php?forumid=$1 [L]
RewriteRule ^/forums/f([0-9]+)-([0-9]+)\.html$ /forums/forumdisplay.php?forumid=$1&daysprune=1000&sortord er=&sortfield=lastpost&perpage=25&pagenumber=$2 [L]
RewriteRule ^/forums/t([0-9]+)\.html$ /forums/showthread.php?threadid=$1 [L]
RewriteRule ^/forums/t([0-9]+)-([0-9]+)-([0-9]+)\.html$ /forums/showthread.php?threadid=$1&perpage=$2&pagenumber=$ 3 [L]
RewriteRule ^/forums/t([0-9]+)-([0-9]+)--(.*)--([0-9]+)\.html$ /forums/showthread.php?threadid=$1&perpage=$2&highlight=$3 &pagenumber=$4 [L]

RewriteCond %{QUERY_STRING} ^(.*)-([0-9]+)\.html$
RewriteRule ^/forums/memberlist.php$ /forums/memberlist.php?%1&pagenumber=%2? [L]
RewriteCond %{QUERY_STRING} ^(.*)-([0-9]+)\.html$
RewriteRule ^/forums/search.php$ /forums/search.php?%1&pagenumber=%2? [L]



Thanks for any help. BTW, I have no problem paying you for fixing it either :) I just need to get it working quickly. Thanks.

Allen

lierduh 04-09-2003 11:16 AM

Looks like you have not edited the php file.

==== >8
open forumdisplay.php

Find
$pagenav =
getpagenav($totalthreads,"forumdisplay.php?s=$sess ion[sessionhash]&forumid=$forumid&daysprune=$daysprune&sortorder=$ sortorder&sortfield=$sortfield&perpage=$perpage");

replace it with:
$pagenav = getpagenav($totalthreads,"f$forumid");
====== >8

You need to find the php file (forumdisplay.php) and edit it according to my original post. You can put "//" without the quote in front of that line to comment out the old code and add the line of new code next line to it.

I will try to come back to this forum soon to see if you have fixed it. Thanks but no, I will not accept payment for something like this. :)

tpearl5 04-11-2003 01:59 AM

I changed servers again and unfortunately I can't get this hack working. The server has ensim on the backend running redhat. In the .htaccess I have:

PHP Code:

RewriteEngine on 
RewriteRule 
^f([0-9]+)/?$ /forumdisplay.php?forumid=$1&s=$[L
RewriteRule ^t([0-9]+).html$ /showthread.php?threadid=$[L]
RewriteRule ^t([0-9]+)-([0-9]+).html$ /showthread.php?threadid=$1&perpage=15&pagenumber=$[L]
RewriteRule ^f([0-9]+)-([0-9]+)/$ /forumdisplay.php?forumid=$1&daysprune=1000&sortorder=&sortfield=lastpost&perpage=40&pagenumber=$[L]
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$[L

However this causes a forbidden message on all directory pages. It does not however effect http://board.midibuddy.net .. (the page still loads)

The board pages are at http://board.midibuddy.net

Please help! What could I possibly be doing wrong?

amk35 04-13-2003 01:19 PM

lierduh,

Thanks very much. such a stupid oversight....works great now.

MarkG 04-30-2003 04:15 PM

i've moved to a new server and this code doesnt work anymore for some reason

if it you can get it working either here's another way:

1) set a 404.php as your 404 handler in your .htacess or httpd.conf
Code:

ErrorDocument 404 /404.php
and put this in
Code:

<?
ob_start();
if ($ref=="") $ref=$REQUEST_URI;
if (preg_match ("#/forums/t\d*-s.html#",$ref)) {
        $ref=str_replace("/forums/t","",$ref);
        $ref=str_replace("-s.html","",$ref);
        Header("Location: http://domain.com/forums/showthread.php?threadid=".$ref );
}
if (preg_match ("#/forums/f\d*-s.html#",$ref)) {
        $ref=str_replace("/forums/f","",$ref);
        $ref=str_replace("-s.html","",$ref);
        Header("Location: http://domain.com/forums/forumdisplay.php?forumid=".$ref );     
}
ob_end_clean();
?>

important: my forums are under /forums and i have my links like t4444-s.html not t4444/s555555.html (with a - not / and without the session number). change the code according to your situation

if anyone uses it, let me know if it works for you

ps. there one issue with this sollution: you still get a line in your error log about a missing file...

Slynderdale 06-25-2003 08:09 AM

Is there a .htaccess version of this? I tried the rewrite rule in the first post and got a 500 internal error.

MrNase 07-13-2003 01:15 PM

I don't get behind that mod_rewrite stuff :(

Could someone try to explaine what i should add to my .htaccess when i want to redirect:

http://www.mydomain.com/pages/index?firma=john borne
or
http://www.mydomain.com/pages/index?firma=iwonttellyou

to

http://www.mydomain.com/pages/john borne
or
http://www.mydomain.com/pages/iwonttellyou

??

thx in advance ;)

buro9 07-16-2003 05:31 PM

I'm using Google AdSense to pay for my forum, and the side effect of having the ads on the site is that they send thousands of spiders to try and figure out what is going on and what contextual adverts to place.

So... to this thread I came.

Big thanks to fastforward and lierduh for all their work.

But... I have found a couple of small bugs... most of them I've ironed out (unfortunately they were painful to find so it took a while and I can't recall every little thing I've done)... but there is one that is lingering:

In forumdisplay.php, when I'm viewing a forum:
http://www.bowlie.com/forum/f2.html

If I sort the forum by the number of thread replies. It's fine.
But then if I page onto the second page of the results... it's forgotten that I wanted it sorted.

A user pointed this out to me... but in essence... forum sorting doesn't work under this system.

I'll try and figure it out myself, but I feel I'm not as versed in mod-rewrite and the subtleties as others here... so anyone who can help, please do :)

buro9 07-16-2003 06:19 PM

OK, got it working again...

Here's the modification I made:

In forumdisplay.php lierduh changed:
PHP Code:

$pagenav getpagenav($totalthreads,"forumdisplay.php?s=$session[sessionhash]&forumid=$forumid&daysprune=$daysprune&sortorder=$sortorder&sortfield=$sortfield&perpage=$perpage 

To:
PHP Code:

$pagenav getpagenav($totalthreads,"f$forumid"); 

And I've now changed it to:
PHP Code:

$pagenav getpagenav($totalthreads,"f$forumid--$daysprune--$sortfield--$sortorder"); 

Now... none of that is going to work without the rewrite rules... so I've added two more... but here are all the ones I have that relate to the forumdisplay.php file. Note that the first one is lierduh's original one:

Code:

  #
  # forumdisplay.php rewriting
  #
  # f2.html = forumid
RewriteRule ^f([0-9]+)\.html$ forumdisplay.php?forumid=$1 [L]
  #
  # f2--25--lastpost---2.html = forumid + daysprune + sortfield + sortorder + pagenumber
RewriteRule ^f([0-9]+)--([0-9]+)--([a-z]+)---([0-9]+)\.html$ forumdisplay.php?forumid=$1&daysprune=$2&sortorder=&sortfield=$3&perpage=25&pagenumber=$4 [L]
  #
  # f2--25--lastpost--asc-2.html = forumid + daysprune + sortfield + sortorder + pagenumber
RewriteRule ^f([0-9]+)--([0-9]+)--([a-z]+)--([a-z]+)-([0-9]+)\.html$ forumdisplay.php?forumid=$1&daysprune=$2&sortorder=$4&sortfield=$3&perpage=25&pagenumber=$5 [L]

Now all of the ordering stuff works on the page spanning, and the page spanning is easy to spider :)

buro9 07-16-2003 06:27 PM

Just checked, and lierduh you also suffer from this bug... so I'll assume that everyone who has done this also suffers from it.

The change I've made isn't aesthetically pleasing, but it does work and stays true to the spider friendly purpose.

To summarise to those joining the end of this thread and wondering where to begin:

First, follow fastforward's instructions on the first page of this thread... you need to do this before anything else to be familiar with what is going on before it gets scarier:

https://vborg.vbsupport.ru/showthrea...threadid=18035

Then follow lierduh's instructions within his post... there are several major improvements over the initial code.

https://vborg.vbsupport.ru/showthrea...137#post348137

If you're confident at this point and everything is working, then go through the whole codebase and replacing the relevant forumdisplay and showthread parts with the new format... stripping out sessionhashes as you go along (I've disabled the option in user prefs to not use cookies and made cookies compulsory).

Finally... to resolve the nagging bug about sorting and page spanning, do the stuff in my post above:

https://vborg.vbsupport.ru/showthrea...256#post418256

It's a lot of work, and certainly daunting. Would I attempt it if I were seriously unsure about this stuff? Nope. But if you are comfortable working with the template system and editing the php files... then the benefits of being spidered are considerable and can do a lot for your forum (increase members or increase advert revenue).

buro9 07-17-2003 08:13 PM

I'm getting a bit carried away by this now, and someone needs to stop me :)

I've applied the same idea to assist with reducing bandwidth :)

In my .htaccess file I've added this:

Code:

  #
  # avatar.php rewriting
  #
  # av1-1053412959.gif = userid + dateline
RewriteRule ^av([0-9]+)-([0-9]+).gif$ avatar.php?userid=$1&dateline=$2 [L]

  #
  # attachment.php rewriting
  #
  # atp157156.gif = postid + extension
RewriteRule ^atp([0-9]+).([a-z]+)$ attachment.php?postid=$1 [L]
  # att157156.gif = attachmentid + extension
RewriteRule ^att([0-9]+).([a-z]+)$ attachment.php?attachmentid=$1 [L]

And you should be able to figure the rest out ;)

Simply change all references of avatar.php?userid=$post[userid]&$post[dateline]... and variations, for av$post[userid]-$post[dateline].gif

Don't worry about the extension, the correct mime-type will be returned by the php... and that's whats important.

Then change template postbit_attachment so that the URL for attachments is this : atp$post[postid].$post[attachmentextension]

Note that this also sidesteps a bug in Mozilla whereby downloading a zip file from a php page would prompt a php file extension rather than zip.

I've been hacking for sure, and again I don't recall clearly every change I made. But if you got the gist of everything else in this thread then I've no doubt you can do this.

Essentially the point is that a lack of querystring allows the browser and proxies/caches to cache the avatars and attachments.

This obviously reduces bandwidth... and also reduces database load.

I have high hopes for this little addition to this very fine hack ;)

buro9 07-20-2003 08:33 PM

One last bug fix.

If you use lots of standard avatars... then the page navigation over pages of avatars from member.php will be broken (you'll only ever get the first page)... so you will also need to insert this:

Code:

RewriteCond %{QUERY_STRING} ^(.*)-([0-9]+)\.html$
RewriteRule ^member.php$ member.php?%1&pagenumber=%2? [L]

That will be after lierduh's other corrective rewrites.

Erwin 07-21-2003 02:14 AM

Btw, I am doing something similar in vB3 - it's a lot easier, since sessionhash is coded by itself now. :)

Ogmuk 07-22-2003 12:58 AM

Thanks for the terrific job on the great hack guys. I'm one of the few who doesn't need to have their forums added to search engines, but it's great for everyone who uses Google AdSense to gain some revenue. I have a question, does anyone know how to get the sessionhashes removed from the navbits? i.e.:
My_vbulletin_board > Some_Forum > This_is_my_post
Listed near the top in each forum or post level page. This same problem affects the Forum Jump menu on the bottom left and no doubt many other pages, but from personal experience, these are most commonly used ones.

This is not interesting for those who use this hack purely to get their pages Googled but for those who're using this for AdSense sessionhashes nearly always means that you'll be getting charity placeholders for banners instead (since the crawler thinks that it hasn't cached the page to generate an appropriate banner).

It also looks like that if a link on the forum sends you back to the index any different from http://www.mywebsite.com/forums/index.php (i.e. http://www.mywebsite.com/forums/index.php?s= or just http://www.mywebsite.com/forums/) that it will generate placeholder banners too. Perhaps this can be avoided as well?

buro9 07-23-2003 04:56 AM

My reason for all of this is AdSense... I'm not bothered about spidering at all.

I manually removed all mentions of 'sessionhash' as appropriate throughout the whole codebase (php & templates).

There's a few subtle ones that linger... for example in the replacement variables for the styles... modify the header to remove the sessionhash from the main image and core navigation.

The page nav bit is buried in admin/functions.php and you can remove the sessionhash from there.

I also then adjusted all of my user options and registration forms to remove the option to not use cookies. And modified the FAQ to say that cookies are compulsory.

buro9 07-23-2003 04:59 AM

One thing to point out is that even when you successfully remove all sessionhashes... Google spiders still visit with one!

I think their software has learnt vb and just compensates and discards. But this didn't bother me because the lack of sessionhashes and querystrings does help with being cached by proxies (the particularly dumb ones that AOL seem to use). So there is a benefit to it... but not as much as you think there will be.

Erwin 07-23-2003 10:04 AM

Quote:

Today at 03:59 PM buro9 said this in Post #276
One thing to point out is that even when you successfully remove all sessionhashes... Google spiders still visit with one!
What do you mean?

buro9 07-23-2003 11:21 AM

Oh no, my mistake :)

In my online.php there was still a place where a sessionhash was being echoed and I incorrectly thought that the spiders were using a hash... but they're not... it's just the display to me of where the spider is that inserted the hash.

Ignore that last bit :)

Which is good... as now it clearly is working better than I thought.

Ogmuk 07-23-2003 11:38 AM

Thanks for the reply Buro9. I wonder if it's possible to get a step-by-step guide how to remove all the sessionhashes on every page where it is needed. If you or anyone has that amount of spare time of course ;)

filburt1's beta script looks like something that could work with AdSense too, this might be interesting to look into. Did anyone try anything like this out for AdSense?

EDIT: VB3 works like a charm with AdSense. I can't wait for RC1 (just like nearly everyone else here).

buro9 07-23-2003 03:35 PM

Found another bug:

The admin function to merge threads did not work, because your thread URL's are now of a different format.

postings.php and the action 'domergethread' expected a URL with 'threadid=' in it. But if you've followed all instructions (!) your formats are more similar to:

http://www.bowlie.com/forum/t5249.html
and
http://www.bowlie.com/forum/t5249-15-3.html

So, to fix this, do this:

FIND (in postings.php):
Code:

$getthreadid=intval(substr($mergethreadurl,strpos($mergethreadurl,"threadid=")+9));
And replace with:
Code:

  // HACK : START : SPIDER FRIENDLY URLS
  //$getthreadid=intval(substr($mergethreadurl,strpos($mergethreadurl,"threadid=")+9));
  $getthreadid = intval(preg_replace("/(^.*\/t)|(-[\d]+-[\d]+)|(\.html)/", "", $mergethreadurl));
  // HACK : END : SPIDER FRIENDLY URLS

If your format is slightly different, modify the regexp pattern slightly ;)

All it's doing is stripping out the threadid from the new format URL and putting that in the variable in the same way the old code did.

As you'll note, I always leave old-code lying around commented out in case I ever want to roll-back... it's just my style... but if you trust my work you can delete that line.

I also always leave those START and END blocks in, so I can see what the hell I changed and why :)



Ogmuk, simply put... I started by using the template search to find all templates with 'sessionhash' in them. Then I edited each and every template (nigh on all of them) and removed the applicable code... which usually boils down to:

Code:

s=$session[sessionhash]
And that is buried in nearly all URL's and also in some hidden form fields.

Once removed from all templates, I then searched through all .php files in the root of the forum directories, and similarly replaced all sessionhashes. EXCEPT where I found $dbsession[sessionhash] as this was usually being written TO the cookie and wasn't being echoed.

You will have to read through each instance, but it's obvious that if it's appearing in a URL you can strip it out... but if it's in code then you'll probably want to keep it there.


And lastly... I have AdSense running on my site, and thought I'd share this last tip for you:

AdSense advises you not to place adverts on pages that you have to be logged on to view, or on search results pages. The former is because they'll never correctly spider it and serve relevant adverts (I bet you see ones for password cracking and security!), and the second is because the pages changes too frequently and by the time it's spidered it's useless. Both in effect will show inappropriate or public service adverts which do nothing for your revenue... and lower your click-throughs by increasing impressions... and also generate server load by sending too many spiders your way.

So... I've written some JavaScript to only put adverts on pages that I know I WANT to show AdSense adverts on... here it is for you :)

Code:

<script type="text/javascript">
var adPages = new Array(
  'forumdisplay.php',
  'index.php',
  'announcement.php',
  'showthread.php',
  'calendar.php',
  'donate.php',
  'misc.php',
  'memberlist.php',
  'vbstats.php',
  'member.php',
  'forum/f',
  'forum/t'
);
var returnAdvert = false;
var pageString = new String();
pageString = document.location.href;
for (var ii = 0; ii < adPages.length; ii++) {
  if (pageString.indexOf(adPages[ii]) >= 0) {
    returnAdvert = true;
    break;
  }
}
if (returnAdvert == false && document.location.href == "http://www.bowlie.com/forum/") {
  returnAdvert = true;
}
if (returnAdvert == true) {
  var google_ad_client='pub-9576666925012421';
  var google_ad_width=468;
  var google_ad_height=60;
  var google_ad_format='468x60_as';
  document.write('<scr'+'ipt type="text/javascr'+'ipt" language="JavaScr'+'ipt" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></scr'+'ipt>');
}
</script>

All you need to do is change my forum path to your full forum path and put in your ad_client code (otherwise I get your money!).

Hope all of that info helps everyone.

Cheers

David K


All times are GMT. The time now is 12:49 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.03030 seconds
  • Memory Usage 1,927KB
  • 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
  • (9)bbcode_code_printable
  • (4)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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