•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Existing Scripts section within the Web Development category of DaniWeb, a massive community of 426,338 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,340 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Existing Scripts advertiser: Web Code Converter
Views: 52187 | Replies: 135
![]() |
•
•
Join Date: Dec 2004
Posts: 34
Reputation:
Rep Power: 4
Solved Threads: 0
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.
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.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,905
Reputation:
Rep Power: 32
Solved Threads: 117
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("&goto="). '([a-z]+)"#',[/php]
with
[php]
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&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.
To fix it, in functions.php:
Replace
[php]
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&goto="). '([a-z]+)"#',[/php]
with
[php]
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&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.
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
Join Date: Nov 2005
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
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:
and then we add this below it:
Is that correct
Thank you.
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("&page=") . '([0-9]+)' . preg_quote("&sort=") . '([a-z]*)' . preg_quote("&order="). '([a-z]*)' . preg_quote("&pp=") . '([0-9]*)' . preg_quote("&daysprune="). '([^"]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&daysprune=") . '([^"^&]*)' . preg_quote("&order=") . '([a-z]*)' . preg_quote("&sort=") . '([a-z]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&daysprune="). '([^"^&]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&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("&page=") . '([0-9]*)' . preg_quote("&pp=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&page=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]goto=lastpost&t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]goto=newpost&t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"printthread.php?$session[sessionurl]t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"sendmessage.php?$session[sessionurl]do=sendtofriend&t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&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("&page=") . '([0-9]+)' . preg_quote("&pp=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showpost.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&postcount=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]mode=") . '([a-z]+)' . preg_quote("&t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&mode=") . '([a-z]+)\##',
'#<a ([^>]*)href' . preg_quote("=\"announcement.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&announcementid=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"announcement.php?$session[sessionurl]f=") . '([0-9]+)"#',
// sanitizing
'#<a ([^>]*)href\=\"([^"]*)&page=([^"]*).html"#',
'#<a ([^>]*)href\=\"([^"]*)&highlight=([^"]*).html"#',
// other
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=getdaily&f=") . '([0-9]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=getdaily") . '"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=process&replyless=1&replylimit=0&dontcache=1&forumchoice=&childforums=1") . '"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=process&replyless=1&replylimit=0&dontcache=1&forumchoice=") . '([0-9]+)' . preg_quote("&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.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,905
Reputation:
Rep Power: 32
Solved Threads: 117
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.
The second way is to use hooks, but no one has yet confirmed that my hooks method works.
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
Join Date: Dec 2004
Posts: 34
Reputation:
Rep Power: 4
Solved Threads: 0
DaniWeb website works smoothly. The code you've provided, I could not find it on functions.php file for version 3.0.3.
Hmm...
Hmm...
•
•
•
•
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?
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,905
Reputation:
Rep Power: 32
Solved Threads: 117
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
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
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
![]() |
•
•
•
•
•
•
•
•
DaniWeb Existing Scripts Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
apple complaint crack cracked development dmca downtime editor forum gates google hack hacking identity theft investigation ipod itunes key keywords kms linux management marketing melinda microsoft news registration search security seo seo tools serps service upgrade vbulletin vista web white hat hacker wysiwyg yahoo
- vBulletin + SEO hack + vBadvanced CMPS (Existing Scripts)
Other Threads in the Existing Scripts Forum
- Previous Thread: looking for a real estate marketplace script
- Next Thread: Installing Invision Blog on IPB 2.3.1



Linear Mode