943,847 Members | Top Members by Rank

Ad:
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Nov 17th, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

That makes clear sense. Thank you.
Reputation Points: 10
Solved Threads: 0
Light Poster
Kwak is offline Offline
34 posts
since Dec 2004
Nov 18th, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

Found a new bug, the LastPage multi-page link sends to a 404 error on my board


http://www.daniweb.com/techtalkforum...hread1780.html (I've replaced my board URL with daniweb)


I double checked the .htaccess. Which template must I check to resolve this bug?

Thanks for your help thus far.
Reputation Points: 10
Solved Threads: 0
Light Poster
Kwak is offline Offline
34 posts
since Dec 2004
Nov 18th, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

It's supposed to be lastpostinthread, not lastposttothread. DaniWeb doesn't seem to be experiencing this problem? Can you confirm that DaniWeb has the same bug? I'm not sure why it's doing what it's doing, but this should eliminate the problem:

To fix it, in functions.php:

Replace
[php]
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;goto="). '([a-z]+)"#',[/php]
with
[php]
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;goto=next"). '([a-z]+)"#',[/php]

Also, replace
[php]'<a \1href="\3tothread\2.html"', [/php]
with
[php]'<a \1href="next\3tothread\2.html"', [/php]

I have edited the first post to reflect this change.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is online now Online
13,645 posts
since Feb 2002
Nov 19th, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

Great thread. Has 3.5.1 been confirmed to work with this? (vs. 3.5)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
WebDressing is offline Offline
5 posts
since Nov 2005
Nov 21st, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

The hack works fine, yet would it be possible to change to ‘forum1 and post1’ into ‘forum title and post title’?

Thanks.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Christoph is offline Offline
1 posts
since Nov 2005
Nov 22nd, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

We wanted to make sure that we understand how to correctly install this hack in 3.5.1 before we blow something up :mrgreen:

First we make the .htaccess file, and then we find this code in the includes/functions.php file:

function print_output($vartext, $sendheader = true)
{
global $pagestarttime, $querytime, $vbulletin;
global $vbphrase, $stylevar;

and then we add this below it:

// do Dani's SEO optimization
global $session;

$search_array = array(
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)' . preg_quote("&amp;sort=") . '([a-z]*)' . preg_quote("&amp;order="). '([a-z]*)' . preg_quote("&amp;pp=") . '([0-9]*)' . preg_quote("&amp;daysprune="). '([^"]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;daysprune=") . '([^"^&]*)' . preg_quote("&amp;order=") . '([a-z]*)' . preg_quote("&amp;sort=") . '([a-z]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;daysprune="). '([^"^&]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]*)' . preg_quote("&amp;pp=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]goto=lastpost&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]goto=newpost&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"printthread.php?$session[sessionurl]t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"sendmessage.php?$session[sessionurl]do=sendtofriend&amp;t=") . '([0-9]+)"#', 
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;goto=next"). '([a-z]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)' . preg_quote("&amp;pp=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showpost.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&amp;postcount=") . '([0-9]+)"#', 
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]mode=") . '([a-z]+)' . preg_quote("&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&amp;mode=") . '([a-z]+)\##', 

'#<a ([^>]*)href' . preg_quote("=\"announcement.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;announcementid=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"announcement.php?$session[sessionurl]f=") . '([0-9]+)"#',

// sanitizing
'#<a ([^>]*)href\=\"([^"]*)&amp;page=([^"]*).html"#',
'#<a ([^>]*)href\=\"([^"]*)&amp;highlight=([^"]*).html"#',

// other
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=getdaily&amp;f=") . '([0-9]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=getdaily") . '"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=process&amp;replyless=1&amp;replylimit=0&amp;dontcache=1&amp;forumchoice=&amp;childforums=1") . '"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=process&amp;replyless=1&amp;replylimit=0&amp;dontcache=1&amp;forumchoice=") . '([0-9]+)' . preg_quote("&amp;childforums=1") . '"#'

);
$replace_array = array(
'<a \1href="forum\2-\3-\4-\5-\6-\7.html"',
'<a \1href="forum\2-\3-\4-\5.html"',
'<a \1href="forum\2-\3.html"',
'<a \1href="forum\2-\3.html"',
'<a \1href="forum\2.html"',
'<a \1href="thread\2-\3.html"',
'<a \1href="thread\2-\3.html"',
'<a \1href="thread\2.html"',
'<a \1href="lastpostinthread\2.html"',
'<a \1href="newpostinthread\2.html"',
'<a \1href="printthread\2.html"',
'<a \1href="sendthread\2.html"',
'<a \1href="next\3tothread\2.html"', 
'<a \1href="post\2.html"', 
'<a \1href="post\2-\3-\4.html"', 
'<a \1href="post\2-\3.html"', 
'<a \1href="thread\3-\2.html"', 
'<a \1href="post\2-\3.html#', 

'<a \1href="announcement\2-\3.html"',
'<a \1href="announcement\2.html"',

// sanitizing
'<a \1href="\2-\3.html"',
'<a \1href="\2-\3.html"',

// other
'<a \1href="getdaily\2.html"',
'<a \1href="getdaily.html"',
'<a \1href="unanswered.html"',
'<a \1href="unanswered\2.html"'

);
$vartext = preg_replace($search_array, $replace_array, $vartext);

Is that correct

Thank you.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
WebDressing is offline Offline
5 posts
since Nov 2005
Nov 24th, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

Yes. Doing is that way is guaranteed to work.

The second way is to use hooks, but no one has yet confirmed that my hooks method works.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is online now Online
13,645 posts
since Feb 2002
Nov 24th, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

DaniWeb website works smoothly. The code you've provided, I could not find it on functions.php file for version 3.0.3.

Hmm...
Quote originally posted by cscgal ...
It's supposed to be lastpostinthread, not lastposttothread. DaniWeb doesn't seem to be experiencing this problem? Can you confirm that DaniWeb has the same bug?
Reputation Points: 10
Solved Threads: 0
Light Poster
Kwak is offline Offline
34 posts
since Dec 2004
Nov 24th, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

Kwak,

The lines that I asked you to replace (in post #13) to fix the lastpostinthread bug are located within the code that you were supposed to add to functions.php in the original tutorial. They aren't naturally in functions.php
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is online now Online
13,645 posts
since Feb 2002
Nov 24th, 2005
0

Re: The quick 'n' dirty ultra simple vBulletin SEO hack

Thanks once again. The last page link works (not in .html) perfectly.
Reputation Points: 10
Solved Threads: 0
Light Poster
Kwak is offline Offline
34 posts
since Dec 2004
Message:
Previous Thread in Configuring Readymade Scripts Forum Timeline: Setting Up ColorBox(jQuery Modal window) In Blogger
Next Thread in Configuring Readymade Scripts Forum Timeline: how to create a custom category on opencart





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC