View Full Version : vRewrite - SEOed URLs for vBulletin
Good stuff :) Just didn't want you wasting your time looking in the wrong spot ;) The sooner it's fixed the sooner it's on my boards hehe.
Jaks
Oh damn, I thought you had VBadvanced on your site. :( Guess there is no chance this will work with it is there? :S
Immortal
01-16-2006, 03:16 AM
Not currently. I 'posse I need to get off my arse and download it and then hack it :p
ryuji
01-16-2006, 12:59 PM
does anybody else have issues with the 'view first unread' breaking (as long as the thread is one page long, works fine with multipage threads) with this hack... i cant run it until it works and i want to know if its just me before i go get vbseo licence :ermm:
cybermomcafe
01-17-2006, 01:54 AM
nevermind... I figured it out LOL
AshokForums.com
01-17-2006, 11:35 AM
Is this plugin compatible with "vBSEO Google/Yahoo Sitemap Generator for vBulletin 3.5.x & vBulletin 3.0.x"??
successful
01-17-2006, 03:22 PM
http://www.hosting-talk.com/memberlist.php
How did you get this working in the member list ? I followed teh instructions included with the download and memberlist does not get rewritten ?
Immortal
01-17-2006, 07:43 PM
How did you get this working in the member list ? I followed teh instructions included with the download and memberlist does not get rewritten ?
There is a known issue with some of the URLs not rewriting 100% of the time, I just haven't had the time to figure/fix it yet.
Is this plugin compatible with "vBSEO Google/Yahoo Sitemap Generator for vBulletin 3.5.x & vBulletin 3.0.x"??
Not currently, sorry.
Immortal
01-18-2006, 02:02 AM
I don't know if you noticed this or if it has been mentioned before but when I goto your site and look at the links they are not rewritten unless I refresh the page. Is this a bug with the hack or your server? This happens in both IE and Firefox.
For example Windows XP forum shows as this below
http://www.techhelpforum.com/forumdisplay.php?f=11 ( This gets shortened when posted lol. You get the idea though. end with not )
and this below after refreshing
http://www.techhelpforum.com/f-windows-xp-11.html
Jaks
Seems I fixed the issue, do to an IF OR in THIS_SCRIPT. I'll upload an updated fix once I am positive this is the solution.
Brandon Sheley
01-18-2006, 05:56 AM
good to see another seo mod out,,
and with it still in beta I'll continue with dean c mod for now, cuz i don't see what this does that his doesn't.
when you able to make all threads/post seo, it'll be prefect :)
right now if i click a thread from the index on your live sites,, and mine as well with dean's mod,, ill get the showthread=232 w/e
but if i follow the forums down to the thread, i get thread-name-we.html
anyways good to see another mod in development :) I'll click install to follow this
Snake
01-18-2006, 12:44 PM
There is a known issue with some of the URLs not rewriting 100% of the time, I just haven't had the time to figure/fix it yet.
Not currently, sorry.
Ha I knew that! :p
allstar55
01-19-2006, 07:21 AM
Bad Extension:
http://www.techhelpforum.com/f-windows-nt2000server-editions-13.html
http://www.techhelpforum.com/forumdisplay.php?f=13
PHP-URL must forward to HTML URL
Double content, Google hate double content.
Immortal
01-19-2006, 06:12 PM
Bad Extension:
http://www.techhelpforum.com/f-windows-nt2000server-editions-13.html
http://www.techhelpforum.com/forumdisplay.php?f=13
PHP-URL must forward to HTML URL
Double content, Google hate double content.
Please read the first post, I am aware of the issue.
...however I do try and tinker with the latest release on my live board before releasing it to y'all...
I am hoping to get that issue fixed on Saturday, and then release an update. Put simply, I don't have the time this week with clients.
On your board in every forum, for example this one: http://www.techhelpforum.com/f-windows-xp-11.html only the first showthread link is being replaced. The second stay in original state.
1st http://www.techhelpforum.com/windows-xp/t-how-to-do-a-repair-install-of-xp-439.html
2nd http://www.techhelpforum.com/showthread.php?t=1147
Haven't read all the posts in this topic so don't know if you are already aware of that problem.
Immortal
01-19-2006, 11:18 PM
https://vborg.vbsupport.ru/showpost.php?p=877212&postcount=262 :)
Just haven't had the time to fix it yet.
Immortal
01-20-2006, 07:35 PM
I cannot duplicate any issues on my dev board. So I am assuming it is my live board, as another forum is running it perfectly fine. I'll upgrade to 3.5.3 later this evening to see if that fixes it.
Smiry Kin's
01-21-2006, 02:20 AM
could ya make is so profile are e.g /admin.html and not /u-admin-1.html ?
please??? or where/how do i change?
rlamego
01-21-2006, 03:12 AM
Smiry, the id needs to be there otherwise it won't work.
Immortal, remember this post (https://vborg.vbsupport.ru/showpost.php?p=874286&postcount=245) on the 15th?
I know you have been busy, this is just a friendly reminder! =)
ConqSoft
01-21-2006, 03:15 AM
Smiry, the id needs to be there otherwise it won't work.
Not really. It can be done without the ID:
http://www.fireblades.org/forums/members/conqsoft.html
rlamego
01-21-2006, 03:21 AM
Not really. It can be done without the ID:
http://www.fireblades.org/forums/members/conqsoft.html
Yes it can, if you are using vBSEO. But we're talking about vRewrite, right? =)
Aren't you tired of promoting vBSEO? ;)
ConqSoft
01-21-2006, 03:23 AM
I'm just showing proof that it CAN be done. If one product can do it, then another can? No? The previous statement that the ID *needs* to be in the URL is incorrect.
rlamego
01-21-2006, 01:04 PM
Incorrect? Please! =) Incorrect is misleading other people with answers that don't relate to their questions while promoting a commercial product on the thread of a free alternative version.
If you really want to prove it can be done, although that wasn't the question of Smiry, and add some useful info while you're at it, you should have said:
"Not really. It can be done without the ID only if you use vBSEO which is a commercial product with encrypted source and costs a lot more than your vB license. Here's my URL to prove it."
This thread is about vRewrite and in that context and until further change, it is not possible to remove the id from that URL!
Immortal
01-21-2006, 02:10 PM
The way vRewrite currently handles all the URLs is done by ID searching. The way vBSEO is done (to my understanding as I've never used it) is done by one file which everything goes through. vRewrite 1.5 (if I ever get to it) is done by many entries in the mod_rewrite to handle all the rewrites, not done by one file. Which is why vBSEO can handle it without IDs, and vRewrite currently can't.
Immortal
01-21-2006, 02:30 PM
Tutorial on custom rewrites/changing rewrtires
The first thing is first, back up all files!
The next thing you want to decide if you are doing a new rewrite or modifying an existing one. Either way, we will need to modify the .htaccess mod_rewrite rules. If you are modifying an already existing one, try and find which rule it is (it is pretty self-explanatory, the (.*) and $# represent variables in the rewrite). If you are creating a new one, copy off of one and use it as a template.
RewriteRule ^f-(.*)-(.*).html forumdisplay.php?f=$2 [L]
What this is telling us, is anything that starts with an f and then has two variables - separated by a hyphen applies to this rewrite. Since we don't care about the name of the forum, we only want the $2 aka the ID of the forum. Let's say we want it to be forumid.html. We will need to rewrite the rule to be:
RewriteRule ^forum(.*).html forumdisplay.php?f=$1 [L]
It really is that simple! Before we continue, you want to make sure you have the rule correct. Just go to yourforum.com/forum(some real id here).html. Does it work? If it does, then you did it correctly (and if you used that example) otherwise don't go on until you perfected that rewrite rule.
Now this is where the fun begins at. We will need to modify the plugin, but for member/showthread/forumdisplay there are an if statement to decide if we are on that. So if you are modifying any of these three, go to vB Options->vRewrite and choose the first rewrite option. We do not want the second!
Now go to ACP->Plugin Manager->vRewrite under global_complete. Edit it. This is where it gets messy so I would suggest playing with it on a test vB first, and then just copy and paste the code over. It's very easy to make a small mistake and cause a white page (aka a parse error).
Each rewrite rule is commented out like so:
#------------------------------
# Replace Forums
#------------------------------
But first we see
if($vbulletin->options['vRewrite_forumrewrite'] == "2") {
This is what I was talking about earlier. If you are using any of the 3 discussed above, skip down until you see the second one (in this case the second replace forums). There are only two for forumdisplay/showthread/member.
Here is what mine says now.
#------------------------------
# Replace Forums
#------------------------------
$found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
$fid = $matches[1][$i];
if(!array_key_exists($fid, $vbulletin->forumcache))
continue;
$f = $vbulletin->forumcache[$fid];
$fid = $f['forumid'];
$title = urlize($f['title']);
$output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"f-$title-$fid.html\"", $output);
}
}
Now we don't worry about anything besides the str_replace. The first part of the str_replace stays the same. However, the second part you see:
"<a href=\"f-$title-$fid.html\""
Using our example from above, we would change this to:
"<a href=\"forum$id\""
It really is that simple! You just got to be very careful when you upgrade vRewrite. Any questions, please keep 'em in the thread as I "technically" don't support this, but I may not notice ;)
rlamego
01-21-2006, 05:05 PM
Thanks for the tutorial! =) Very nice!
Made my edits without any problem, except that the pull-down menus on vboptions still reflect the previous (default) values.
How can I change these?
Immortal
01-21-2006, 05:49 PM
You will need to turn your vB into debug mode, and then edit those settings. Or do I need step-by-step instructions? hehe
rlamego
01-21-2006, 05:51 PM
A quick question, looking at the global_complete code, I see a lot of db queries that I assume are used to get some extra info not available on vb's forumcache like forum names, etc.
If we were going back to basics, using just the numeric ids, and having urls like: /f$id/, /t$id/, etc, would those queries still be needed?
rlamego
01-21-2006, 05:59 PM
You will need to turn your vB into debug mode, and then edit those settings. Or do I need step-by-step instructions? hehe
No thanks! =) Wicked! First time I turn on debug mode so never saw that before! Thanks again! =)
Immortal
01-21-2006, 05:59 PM
Sure don't :)
rlamego
01-21-2006, 06:31 PM
Don't? Cool! Might seem odd but I'll try to mod it down to bare basics.
My host is sponsoring my site, charging me nothing for all that I use so I'm always extra careful not to waste their resources on unnecessary stuff!
Just to be sure I'm not making it worse, would you say that this is enough?
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
$output = str_replace("member.php?u=$uid", "member/$uid/", $output);
}
Immortal
01-22-2006, 02:25 AM
You'll need it put it in a while loop, I'll try and get you the code tomorrow. :)
Dreamchaser
01-22-2006, 05:48 AM
Installed without errors, but only first post of every forum has seo url others are just static, did i go wrong somewhere :( ?
Thanks,
DC
Snake
01-22-2006, 09:08 AM
That's a known bug already. Immortal will intend to fix it in the next release of the hack. ;)
Immortal
01-22-2006, 02:37 PM
Weird...it doesn't work on my board, works fine on my test board, and another forum..I can't reproduce it enough to figure it out :?
Brandon Sheley
01-22-2006, 11:34 PM
* Brandon Sheley clicks install
with a little playing, I've gotten this to work on my forums.. thx :)
i love the forum discription :D
thx for the mod
locoforum.com/forums/the-band-rocking-out-or-the-basturd-bluegrass/t-new-from-the-road-622.html
hmm no love characters? :(
can we replace our special characters to => x ?
example:
? => a
? => e
? => o
? => n
etc. what modification needs for do it?
Snake
01-24-2006, 12:10 PM
Any updates?
Immortal
01-24-2006, 06:14 PM
hmm no love characters? :(
can we replace our special characters to => x ?
example:
? => a
? => e
? => o
? => n
etc. what modification needs for do it?
No. For each character like that you would need a seperate str_replace and that can be very troublesome.
Any updates?
I'm dumbfounded why it isn't working on some boards and works great on others. As far as releasing 1.0 - not yet, no one has replied to my hack thread...
Snake
01-24-2006, 06:34 PM
No. For each character like that you would need a seperate str_replace and that can be very troublesome.
I'm dumbfounded why it isn't working on some boards and works great on others. As far as releasing 1.0 - not yet, no one has replied to my hack thread...
Oh I see. Well can't you get a little help from Dean C or something?
Immortal
01-24-2006, 10:10 PM
Oh I see. Well can't you get a little help from Dean C or something?
Dean never did it himself either he didn't want to or didn't know how.
Snake
01-24-2006, 10:31 PM
Well then you need to do something. I wish if I'd some PHP & mySQL knowledge otherwise I could help you with it and probably make the best SEO product ever! :p
Dean C
01-25-2006, 10:06 AM
Dean never did it himself either he didn't want to or didn't know how.
There were far too many ascii characters to write a replacement.
El_Muerte
01-26-2006, 07:48 AM
This gets a long way:
$string= strtr($string, "?????????????????????????????????????????????????? ???", "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuu ynn");
Don't know about performance.
Snake
01-26-2006, 12:11 PM
You must be using a foreign language. Note that this hack will work on English boards only.
Brandon Sheley
01-26-2006, 06:33 PM
has anyone had this issue I posted here ??
http://www.forumuniversity.com/campus/showpost.php?p=3690&postcount=49
ChuanSE
01-27-2006, 01:27 AM
i get a 403 error as soon as the .htaccess file is in place :/
You don't have permission to access /forums/index.php on this server.
Fender963
01-27-2006, 04:24 AM
Excellent hack Immortal, one problem though. It's not rewriting my thread urls or my member profile urls. It rewrites the forum ones fine.
www.plantedtank.net/forums/ is my link.
EDIT: After further inspection I noticed the following:
1. It rewrites the url in any forum, for the most recent post.
2. Any post that is not rewritten will give an incorrect url for page 2 of posts. It only does it for page 2, not 3,4,5,32 .... you get the point.
This is very odd behavior.
Brandon Sheley
01-27-2006, 05:28 AM
i get a 403 error as soon as the .htaccess file is in place :/
You don't have permission to access /forums/index.php on this server.
make sure you edit the htaccess to show /forums ;)
btw,, has anyone else had the issue I'm having ? I'll have to uninstall this untill this is fixed.. :(
10sion
01-28-2006, 11:42 PM
Hey Immortal, I must say thanks for this great hack, it seams to be running great except for one minor thing.
It only SEOs the first thread in every forum... Have any idea why?
Example:
General Forum
>whoa new post! -thread
>who likes cheese? -thread
>sweet! -thread
It only rewrites the first thread (whoa new post!) and not the others. Any quick fix? Thanks a lot.
in'dira
01-29-2006, 12:54 AM
Hello, Can you explain more precisely how and what to make at the time of the 3rd stage of the installation with $headinclude and < bases href="$vboptions[bburl ]/"/> please ?
Thx lot :)
Immortal
01-29-2006, 01:44 AM
Hey Immortal, I must say thanks for this great hack, it seams to be running great except for one minor thing.
It only SEOs the first thread in every forum... Have any idea why?
Example:
General Forum
>whoa new post! -thread
>who likes cheese? -thread
>sweet! -thread
It only rewrites the first thread (whoa new post!) and not the others. Any quick fix? Thanks a lot.
It's weird..Try overwritting your code in Plugin Manager->vRewrite under global_complete with this:
if($vbulletin->options['vRewrite_on'])
{
if($vbulletin->options['vRewrite_forumrewrite'] == "2") {
#------------------------------
# Replace Forums
#------------------------------
$found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$title = str_replace("-","",$title);
$output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"siteforums/$title-$fid.html\"", $output);
}
}
}
#------------------------------
# Replace Forums
#------------------------------
$found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"f-$title-$fid.html\"", $output);
}
}
if($vbulletin->options['vRewrite_memberrewrite'] == "2") {
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN($ids)");
while($u = $vbulletin->db->fetch_array($res))
{
$username = urlize($u['username']);
$uid = $u['userid'];
$output = str_replace("member.php?u=$uid", "members/$username-$uid.html", $output);
}
}
}
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN($ids)");
while($u = $vbulletin->db->fetch_array($res))
{
$username = urlize($u['username']);
$uid = $u['userid'];
$output = str_replace("member.php?u=$uid", "u-$username-$uid.html", $output);
}
}
#------------------------------
# Replace showthread.php?goto=newpost
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?goto=newpost&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($n = $vbulletin->db->fetch_array($res))
{
$title = urlize($n['title']);
$tid = $n['threadid'];
$fid = $n['forumid'];
$output = str_replace("<a href=\"showthread.php?goto=newpost&t=$tid\"", "<a href=\"$title-$tid-newpost.html\"", $output);
}
}
#------------------------------
# Replace Last Post User (Forum)
#------------------------------
$found = preg_match_all('#<a href="member\.php\?find=lastposter&f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT lastposter, forumid FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$lp = $f['lastposter'];
$lpidinfo = $vbulletin->db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE username='$lp'");
$lp = urlize($lpidinfo['username']);
$lpid = $lpidinfo['userid'];
$fid = $f['forumid'];
$output = str_replace("<a href=\"member.php?find=lastposter&f=$fid\"", "<a href=\"u-$lp-$lpid.html\"", $output);
}
}
#------------------------------
# Replace Last Post User (Thread)
#------------------------------
$found = preg_match_all('#<a href="member\.php\?find=lastposter&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT lastposter, threadid FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$lp = $f['lastposter'];
$lpidinfo = $vbulletin->db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE username='$lp'");
$lp = urlize($lpidinfo['username']);
$lpid = $lpidinfo['userid'];
$tid = $f['threadid'];
$output = str_replace("<a href=\"member.php?find=lastposter&t=$tid\"", "<a href=\"u-$lp-$lpid.html\"", $output);
}
}
#-----------------------------------
# DO NOT REMOVE OTHERWISE YOU
# WILL BE SENT A DMCA FOR COPYRIGHT
# INFRINGEMENT YOU MAY NOT USE THIS
# PLUGIN WITHOUT THIS LINE OF CODE
# IF YOU WISE TO REMOVE THIS AND
# ADD IT TO YOUR STYLE, FEEL FREE
# AS LONG AS THE COPYRIGHT REMAINS
#-----------------------------------
$output .= '<div align="center" class="smallfont">SEOed URLs completed by <a href="http://www.techhelpforum.com">Tech Help Forum</a>.</div>';
if($vbulletin->options['vRewrite_showthreadrewrite'] == "2") {
#------------------------------
# SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$fname = str_replace("-","",$fname);
$title = str_replace("-"," ",$title);
$output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/$title-$tid.html\"", $output);
}
}
}
#------------------------------
# SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/t-$title-$tid.html\"", $output);
}
}
#------------------------------
# SHOWTHREAD and page
#------------------------------
$found = preg_match_all('#showthread\.php\?t=([0-9]+)&page=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
// Keep track of page nums that go with tid's
$temp = array();
for($i = 0; $i < $found; $i++)
{
// $temp[<threadid>] = <page>
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$page = $temp[$tid];
$output = str_replace("showthread.php?t=$tid&page=$page", "$fname/t-$title-$tid-page-$page.html", $output);
}
}
#------------------------------
# showpost
#------------------------------
$found = preg_match_all('#<a href="showpost\.php\?p=([0-9]+)&postcount=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT postid, title FROM " . TABLE_PREFIX . "post WHERE postid IN($ids)");
while($p = $vbulletin->db->fetch_array($res))
{
$pid = $p['postid'];
$postcount = $temp[$pid];
$output = str_replace("<a href=\"showpost.php?p=$pid&postcount=$postcount\"", "<a href=\"p-$pid.html\"", $output); }
}
#------------------------------
# Print SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="printthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$output = str_replace("<a href=\"printthread.php?t=$tid\"", "<a href=\"print-$title-$tid.html\"", $output);
}
}
#------------------------------
# Email SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="sendmessage\.php\?do=sendtofriend&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$output = str_replace("<a href=\"sendmessage.php?do=sendtofriend&t=$tid\"", "<a href=\"sendtofriend-$title-$tid.html\"", $output);
}
}
#------------------------------
# New Thread
#------------------------------
$found = preg_match_all('#<a href="newthread\.php\?do=newthread&f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$output = str_replace("<a href=\"newthread.php?do=newthread&f=$fid\"", "<a href=\"$title-$fid/newthread.php\"", $output);
}
}
#------------------------------
# New Post
#------------------------------
$found = preg_match_all('#<a href="newreply\.php\?do=newreply&noquote=1&p=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, postid FROM " . TABLE_PREFIX . "post WHERE postid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$pid = $t['postid'];
$threadinfo = $vbulletin->db->query_first("SELECT title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='$tid'");
$title = urlize($threadinfo['title']);
$fid = $threadinfo['forumid'];
$f = fetch_foruminfo($fid);
$fname = urlize($f['title']);
$output = str_replace("<a href=\"newreply.php?do=newreply&noquote=1&p=$pid\"", "<a href=\"$fname/newpostnoquote-$pid.php\"", $output);
}
}
#------------------------------
# New Post
#------------------------------
$found = preg_match_all('#<a href="newreply\.php\?do=newreply&p=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, postid FROM " . TABLE_PREFIX . "post WHERE postid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$pid = $t['postid'];
$threadinfo = $vbulletin->db->query_first("SELECT title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='$tid'");
$title = urlize($threadinfo['title']);
$fid = $threadinfo['forumid'];
$f = fetch_foruminfo($fid);
$fname = urlize($f['title']);
$output = str_replace("<a href=\"newreply.php?do=newreply&p=$pid\"", "<a href=\"$fname/newpost-$pid.php\"", $output);
}
}
#------------------------------
# Search
#------------------------------
$found = preg_match_all('#<a href="search\.php\?searchid=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, searchid FROM " . TABLE_PREFIX . "search WHERE searchid IN($ids)");
while($s = $vbulletin->db->fetch_array($res))
{
$userid = $s['userid'];
$searchid = $s['searchid'];
$output = str_replace("search.php?searchid=$searchid", "search-$userid-$searchid.html", $output);
}
}
#------------------------------
# misc pages
#------------------------------
$output = str_replace("search.php?do=getnew","search-getnew.html",$output);
$output = str_replace("search.php?do=getdaily","search-getdaily.html",$output);
$output = str_replace("forumdisplay.php?do=markread","markread.html",$output);
}
/**
* Turn a string into a URL friendly string
*
* @param string $txt The string to work on
* @return string The new string
*/
function urlize($txt)
{
$txt = unaccent($txt);
$txt = html_entity_decode($txt);
$txt = str_replace(' ', '-', $txt);
$txt = preg_replace('#[^a-zA-Z0-9_\-]+#', '', $txt);
$txt = preg_replace('#[\-]+#', '-', $txt);
return strtolower($txt);
}
/**
* Turn accented characters into normal characters
*
* @param string $txt The string to remove the accents from
* @return string Your new clean string
*/
function unaccent($txt)
{
$trans = get_html_translation_table(HTML_ENTITIES);
foreach($trans as $literal => $entity)
{
if(ord($literal) >= 192)
{
$search[] = $literal;
$replace[] = substr($entity, 1, 1);
}
}
return str_replace($search, $replace, $txt);
}
Let me know if that works for you :)
Hello, Can you explain more precisely how and what to make at the time of the 3rd stage of the installation with $headinclude and < bases href="$vboptions[bburl ]/"/> please ?
Thx lot
You want to add the base href after the $headinclude in the templates it mentions. Does that help?
ChuanSE
01-29-2006, 05:00 AM
make sure you edit the htaccess to show /forums ;)
btw,, has anyone else had the issue I'm having ? I'll have to uninstall this untill this is fixed.. :(
well, that was set in the .htaccess :s
Brandon Sheley
01-29-2006, 05:01 AM
well, that was set in the .htaccess :s
the first few lines of the htaccess looks like this
RewriteEngine On
RewriteBase /
# Default
edit to to be like
RewriteEngine On
RewriteBase /forums
# Default
You want to add the base href after the $headinclude in the templates it mentions. Does that help?
does it matter if it's pasted above or below the $headinclude ?
3) In the following templates: showthread, newreply, newthread, forumdisplay, memberinfo find $headinclude and add above that:
in'dira
01-29-2006, 05:50 AM
it is what is required in the file of installation. I already placed the htaccess in the vB's directory, and added the xml module, there remains to me only part 3 to make. Thus if I see well, I must replace :
$headinclude
by
$headinclude
<bases href="$vboptions[bburl ]/"/>
eveywhere I see $headinclude in the template ?
Sorry I'm not an expert :)
Brandon Sheley
01-29-2006, 05:56 AM
it is what is required in the file of installation. I already placed the htaccess in the vB's directory, and added the xml module, there remains to me only part 3 to make. Thus if I see well, I must replace :
$headinclude
by
$headinclude
< bases href="$vboptions[bburl ]/"/>
eveywhere I see $headinclude in the template ?
Sorry I'm not an expert :)
yes
but in these templates
showthread, newreply, newthread, forumdisplay, memberinfo
only 5 unless you've added more hacks
ps mines working good now, I had missed a template :o
in'dira
01-29-2006, 11:47 AM
edit : Yes ! good job very thx !!!! :squareeyed:
for threads it's not work, except stiky ! :disappointed:
Immortal
01-29-2006, 01:25 PM
does it matter if it's pasted above or below the $headinclude ?
Sorry hah, you're correct. Although it doesn't make much of a difference.
for threads it's not work, except stiky !
Can you describe or link to what's happening?
Brandon Sheley
01-29-2006, 03:31 PM
Immortal
now this is working pretty well as u see, and I've talked to you on forum university but this is a problem I have now, do u know how I correct it ? maybe update counters or something but something like this thread
http://www.locoforum.com/forums/thread-games/t-more-games--609.html
has 17 pages..
sometimes If i click on like page 6 it'll take me to a different thread..
any thoughts ?
Immortal
01-29-2006, 04:15 PM
Immortal
now this is working pretty well as u see, and I've talked to you on forum university but this is a problem I have now, do u know how I correct it ? maybe update counters or something but something like this thread
http://www.locoforum.com/forums/thread-games/t-more-games--609.html
has 17 pages..
sometimes If i click on like page 6 it'll take me to a different thread..
any thoughts ?
I could take a look at it if you still had it installed ;)
Brandon Sheley
01-29-2006, 06:59 PM
if your going to be on please post in the guest forums
http://locoforum.com/forums/forumdisplay.php?f=63
I'll be at the house the rest of the day now,, just cooking and cleaning..
but I'll re-enable the mod if you can check it out..
I'll see your post in the guest area and will turn the rewrite on for you to see
vrdesigner
01-29-2006, 08:20 PM
Hi,
I have installed this hack on a german vb3.5.3 and got the 404 error.
Immortal
01-29-2006, 08:21 PM
Ah okay I see it now. I'll try and work on it. If you'd like do you want me to tell you how to turn that part of vRewrite off?
Hi,
I have installed this hack on a german vb3.5.3 and got the 404 error.
Could you post your .htaccess along with your URL?
vrdesigner
01-29-2006, 08:31 PM
Well, my .htaccess file that of the zip:
RewriteEngine On
RewriteBase /
# Default
RewriteRule ^f-(.*)-page-(.*)-(.*).html forumdisplay.php?f=$1&page=$2&order=$3
RewriteRule ^f-(.*)-(.*).html forumdisplay.php?f=$2 [L]
RewriteRule ^u-(.*)-(.*).html member.php?u=$2 [L]
RewriteRule ^memberlist-(.*)-(.*)-(.*)-(.*).html memberlist.php?ltr=$1&pp=$2&sort=$3&order=$4 [L]
RewriteRule ^(.*)/t-(.*)-(.*).html showthread.php?t=$3&is_vrewrite [L]
RewriteRule ^(.*)-(.*)-lastpost.html showthread.php?goto=lastpost&t=$2 [L]
RewriteRule ^(.*)-(.*)-newpost.html showthread.php?goto=newpost&t=$2 [L]
RewriteRule ^(.*)-(.*)-lastpost.html showthread.php?goto=lastpost&t=$2 [L]
RewriteRule ^(.*)-(.*)-(.*).html showthread.php?goto=$3&t=$2 [L]
RewriteRule ^(.*)/t-(.*)-(.*)-page-(.*).html showthread.php?t=$3&page=$4 [L]
RewriteRule ^markread.html forumdisplay.php?do=markread [L]
RewriteRule ^(.*)/p-(.*)-(.*).html showthread.php?p=$3 [L]
RewriteRule ^print-(.*)-(.*).html printthread.php?t=$2 [L]
RewriteRule ^sendtofriend-(.*)-(.*).html sendmessage.php?do=sendtofriend&t=$2 [L]
RewriteRule ^search-(.*).html search.php?do=$1 [L]
RewriteRule ^(.*)-(.*)/newthread.php newthread.php?do=newthread&f=$2[L]
RewriteRule ^(.*)/newpostnoquote-(.*).php newreply.php?do=newreply&noquote=1&p=$2[L]
RewriteRule ^(.*)/newpost-(.*).php newreply.php?do=newreply&p=$2[L]
RewriteRule ^p-(.*).html showpost.php?p=$1&postcount=$1 [L]
# Other options
RewriteRule ^siteforums/(.*)-(.*).html forumdisplay.php?f=$2 [L]
RewriteRule ^members/(.*)-(.*).html member.php?u=$2 [L]
RewriteRule ^(.*)/(.*)-(.*).html showthread.php?t=$3 [L]
# Sitemap
RewriteRule ^(sitemap.*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
My URL is: http://www.politikarena.de
at the moment, the vrewrite hack is disabled in the admincp.
Immortal
01-29-2006, 08:42 PM
Weird, and mod_rewrite is enabled?
Brandon Sheley
01-29-2006, 09:26 PM
Ah okay I see it now. I'll try and work on it. If you'd like do you want me to tell you how to turn that part of vRewrite off?
thats fine, if you can tell how to turn that part off..
right now I have it disabled again
thats fine, if you can tell how to turn that part off..
right now I have it disabled again
I have this installed on my test box. I use IIS so I had to modify the rules which I did. When I use the xml file from the zip everything works except it only rewrites the first thread in each forum like a few other have noted in the thread.
When I apply the fix here https://vborg.vbsupport.ru/showpost.php?p=884882&postcount=300
the thread urls all get rewritten, but, then the only things that gets rewritten is the forums and threads. Everything else is back to vbulletin default. The one thing it breaks completely is viewing the user profile.
I haven't looked at the code to chase down the problem. I will when I get a chance. If I find the fix I'll post it.
Immortal
01-29-2006, 10:20 PM
Weird AWS, I'll try and take time to fix it. :)
Loco.M:
Try this:
if($vbulletin->options['vRewrite_on'])
{
if($vbulletin->options['vRewrite_forumrewrite'] == "2") {
#------------------------------
# Replace Forums
#------------------------------
$found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$title = str_replace("-","",$title);
$output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"siteforums/$title-$fid.html\"", $output);
}
}
}
#------------------------------
# Replace Forums
#------------------------------
$found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"f-$title-$fid.html\"", $output);
}
}
if($vbulletin->options['vRewrite_memberrewrite'] == "2") {
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN($ids)");
while($u = $vbulletin->db->fetch_array($res))
{
$username = urlize($u['username']);
$uid = $u['userid'];
$output = str_replace("member.php?u=$uid", "members/$username-$uid.html", $output);
}
}
}
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN($ids)");
while($u = $vbulletin->db->fetch_array($res))
{
$username = urlize($u['username']);
$uid = $u['userid'];
$output = str_replace("member.php?u=$uid", "u-$username-$uid.html", $output);
}
}
#------------------------------
# Replace showthread.php?goto=newpost
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?goto=newpost&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($n = $vbulletin->db->fetch_array($res))
{
$title = urlize($n['title']);
$tid = $n['threadid'];
$fid = $n['forumid'];
$output = str_replace("<a href=\"showthread.php?goto=newpost&t=$tid\"", "<a href=\"$title-$tid-newpost.html\"", $output);
}
}
#------------------------------
# Replace Last Post User (Forum)
#------------------------------
$found = preg_match_all('#<a href="member\.php\?find=lastposter&f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT lastposter, forumid FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$lp = $f['lastposter'];
$lpidinfo = $vbulletin->db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE username='$lp'");
$lp = urlize($lpidinfo['username']);
$lpid = $lpidinfo['userid'];
$fid = $f['forumid'];
$output = str_replace("<a href=\"member.php?find=lastposter&f=$fid\"", "<a href=\"u-$lp-$lpid.html\"", $output);
}
}
#------------------------------
# Replace Last Post User (Thread)
#------------------------------
$found = preg_match_all('#<a href="member\.php\?find=lastposter&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT lastposter, threadid FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$lp = $f['lastposter'];
$lpidinfo = $vbulletin->db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE username='$lp'");
$lp = urlize($lpidinfo['username']);
$lpid = $lpidinfo['userid'];
$tid = $f['threadid'];
$output = str_replace("<a href=\"member.php?find=lastposter&t=$tid\"", "<a href=\"u-$lp-$lpid.html\"", $output);
}
}
#-----------------------------------
# DO NOT REMOVE OTHERWISE YOU
# WILL BE SENT A DMCA FOR COPYRIGHT
# INFRINGEMENT YOU MAY NOT USE THIS
# PLUGIN WITHOUT THIS LINE OF CODE
# IF YOU WISE TO REMOVE THIS AND
# ADD IT TO YOUR STYLE, FEEL FREE
# AS LONG AS THE COPYRIGHT REMAINS
#-----------------------------------
$output .= '<div align="center" class="smallfont">SEOed URLs completed by <a href="http://www.techhelpforum.com">Tech Help Forum</a>.</div>';
if($vbulletin->options['vRewrite_showthreadrewrite'] == "2") {
#------------------------------
# SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$fname = str_replace("-","",$fname);
$title = str_replace("-"," ",$title);
$output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/$title-$tid.html\"", $output);
}
}
}
#------------------------------
# SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/t-$title-$tid.html\"", $output);
}
}
/*
#------------------------------
# SHOWTHREAD and page
#------------------------------
$found = preg_match_all('#showthread\.php\?t=([0-9]+)&page=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
// Keep track of page nums that go with tid's
$temp = array();
for($i = 0; $i < $found; $i++)
{
// $temp[<threadid>] = <page>
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$page = $temp[$tid];
$output = str_replace("showthread.php?t=$tid&page=$page", "$fname/t-$title-$tid-page-$page.html", $output);
}
*/
}
#------------------------------
# showpost
#------------------------------
$found = preg_match_all('#<a href="showpost\.php\?p=([0-9]+)&postcount=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT postid, title FROM " . TABLE_PREFIX . "post WHERE postid IN($ids)");
while($p = $vbulletin->db->fetch_array($res))
{
$pid = $p['postid'];
$postcount = $temp[$pid];
$output = str_replace("<a href=\"showpost.php?p=$pid&postcount=$postcount\"", "<a href=\"p-$pid.html\"", $output); }
}
#------------------------------
# Print SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="printthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$output = str_replace("<a href=\"printthread.php?t=$tid\"", "<a href=\"print-$title-$tid.html\"", $output);
}
}
#------------------------------
# Email SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="sendmessage\.php\?do=sendtofriend&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$output = str_replace("<a href=\"sendmessage.php?do=sendtofriend&t=$tid\"", "<a href=\"sendtofriend-$title-$tid.html\"", $output);
}
}
#------------------------------
# New Thread
#------------------------------
$found = preg_match_all('#<a href="newthread\.php\?do=newthread&f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$output = str_replace("<a href=\"newthread.php?do=newthread&f=$fid\"", "<a href=\"$title-$fid/newthread.php\"", $output);
}
}
#------------------------------
# New Post
#------------------------------
$found = preg_match_all('#<a href="newreply\.php\?do=newreply&noquote=1&p=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, postid FROM " . TABLE_PREFIX . "post WHERE postid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$pid = $t['postid'];
$threadinfo = $vbulletin->db->query_first("SELECT title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='$tid'");
$title = urlize($threadinfo['title']);
$fid = $threadinfo['forumid'];
$f = fetch_foruminfo($fid);
$fname = urlize($f['title']);
$output = str_replace("<a href=\"newreply.php?do=newreply&noquote=1&p=$pid\"", "<a href=\"$fname/newpostnoquote-$pid.php\"", $output);
}
}
#------------------------------
# New Post
#------------------------------
$found = preg_match_all('#<a href="newreply\.php\?do=newreply&p=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, postid FROM " . TABLE_PREFIX . "post WHERE postid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$pid = $t['postid'];
$threadinfo = $vbulletin->db->query_first("SELECT title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='$tid'");
$title = urlize($threadinfo['title']);
$fid = $threadinfo['forumid'];
$f = fetch_foruminfo($fid);
$fname = urlize($f['title']);
$output = str_replace("<a href=\"newreply.php?do=newreply&p=$pid\"", "<a href=\"$fname/newpost-$pid.php\"", $output);
}
}
#------------------------------
# Search
#------------------------------
$found = preg_match_all('#<a href="search\.php\?searchid=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, searchid FROM " . TABLE_PREFIX . "search WHERE searchid IN($ids)");
while($s = $vbulletin->db->fetch_array($res))
{
$userid = $s['userid'];
$searchid = $s['searchid'];
$output = str_replace("search.php?searchid=$searchid", "search-$userid-$searchid.html", $output);
}
}
#------------------------------
# misc pages
#------------------------------
$output = str_replace("search.php?do=getnew","search-getnew.html",$output);
$output = str_replace("search.php?do=getdaily","search-getdaily.html",$output);
$output = str_replace("forumdisplay.php?do=markread","markread.html",$output);
}
/**
* Turn a string into a URL friendly string
*
* @param string $txt The string to work on
* @return string The new string
*/
function urlize($txt)
{
$txt = unaccent($txt);
$txt = html_entity_decode($txt);
$txt = str_replace(' ', '-', $txt);
$txt = preg_replace('#[^a-zA-Z0-9_\-]+#', '', $txt);
$txt = preg_replace('#[\-]+#', '-', $txt);
return strtolower($txt);
}
/**
* Turn accented characters into normal characters
*
* @param string $txt The string to remove the accents from
* @return string Your new clean string
*/
function unaccent($txt)
{
$trans = get_html_translation_table(HTML_ENTITIES);
foreach($trans as $literal => $entity)
{
if(ord($literal) >= 192)
{
$search[] = $literal;
$replace[] = substr($entity, 1, 1);
}
}
return str_replace($search, $replace, $txt);
}
Weird AWS, I'll try and take time to fix it. :)
Loco.M:
Try this:
if($vbulletin->options['vRewrite_on'])
{
if($vbulletin->options['vRewrite_forumrewrite'] == "2") {
#------------------------------
# Replace Forums
#------------------------------
$found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$title = str_replace("-","",$title);
$output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"siteforums/$title-$fid.html\"", $output);
}
}
}
#------------------------------
# Replace Forums
#------------------------------
$found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"f-$title-$fid.html\"", $output);
}
}
if($vbulletin->options['vRewrite_memberrewrite'] == "2") {
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN($ids)");
while($u = $vbulletin->db->fetch_array($res))
{
$username = urlize($u['username']);
$uid = $u['userid'];
$output = str_replace("member.php?u=$uid", "members/$username-$uid.html", $output);
}
}
}
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN($ids)");
while($u = $vbulletin->db->fetch_array($res))
{
$username = urlize($u['username']);
$uid = $u['userid'];
$output = str_replace("member.php?u=$uid", "u-$username-$uid.html", $output);
}
}
#------------------------------
# Replace showthread.php?goto=newpost
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?goto=newpost&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($n = $vbulletin->db->fetch_array($res))
{
$title = urlize($n['title']);
$tid = $n['threadid'];
$fid = $n['forumid'];
$output = str_replace("<a href=\"showthread.php?goto=newpost&t=$tid\"", "<a href=\"$title-$tid-newpost.html\"", $output);
}
}
#------------------------------
# Replace Last Post User (Forum)
#------------------------------
$found = preg_match_all('#<a href="member\.php\?find=lastposter&f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT lastposter, forumid FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$lp = $f['lastposter'];
$lpidinfo = $vbulletin->db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE username='$lp'");
$lp = urlize($lpidinfo['username']);
$lpid = $lpidinfo['userid'];
$fid = $f['forumid'];
$output = str_replace("<a href=\"member.php?find=lastposter&f=$fid\"", "<a href=\"u-$lp-$lpid.html\"", $output);
}
}
#------------------------------
# Replace Last Post User (Thread)
#------------------------------
$found = preg_match_all('#<a href="member\.php\?find=lastposter&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT lastposter, threadid FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$lp = $f['lastposter'];
$lpidinfo = $vbulletin->db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE username='$lp'");
$lp = urlize($lpidinfo['username']);
$lpid = $lpidinfo['userid'];
$tid = $f['threadid'];
$output = str_replace("<a href=\"member.php?find=lastposter&t=$tid\"", "<a href=\"u-$lp-$lpid.html\"", $output);
}
}
#-----------------------------------
# DO NOT REMOVE OTHERWISE YOU
# WILL BE SENT A DMCA FOR COPYRIGHT
# INFRINGEMENT YOU MAY NOT USE THIS
# PLUGIN WITHOUT THIS LINE OF CODE
# IF YOU WISE TO REMOVE THIS AND
# ADD IT TO YOUR STYLE, FEEL FREE
# AS LONG AS THE COPYRIGHT REMAINS
#-----------------------------------
//$output .= '<div align="center" class="smallfont">SEOed URLs completed by <a href="http://www.techhelpforum.com">Tech Help Forum</a>.</div>';
if($vbulletin->options['vRewrite_showthreadrewrite'] == "2") {
#------------------------------
# SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$fname = str_replace("-","",$fname);
$title = str_replace("-"," ",$title);
$output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/$title-$tid.html\"", $output);
}
}
}
#------------------------------
# SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/t-$title-$tid.html\"", $output);
}
}
/*
#------------------------------
# SHOWTHREAD and page
#------------------------------
$found = preg_match_all('#showthread\.php\?t=([0-9]+)&page=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
// Keep track of page nums that go with tid's
$temp = array();
for($i = 0; $i < $found; $i++)
{
// $temp[<threadid>] = <page>
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$page = $temp[$tid];
$output = str_replace("showthread.php?t=$tid&page=$page", "$fname/t-$title-$tid-page-$page.html", $output);
}
*/
}
#------------------------------
# showpost
#------------------------------
$found = preg_match_all('#<a href="showpost\.php\?p=([0-9]+)&postcount=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT postid, title FROM " . TABLE_PREFIX . "post WHERE postid IN($ids)");
while($p = $vbulletin->db->fetch_array($res))
{
$pid = $p['postid'];
$postcount = $temp[$pid];
$output = str_replace("<a href=\"showpost.php?p=$pid&postcount=$postcount\"", "<a href=\"p-$pid.html\"", $output); }
}
#------------------------------
# Print SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="printthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$output = str_replace("<a href=\"printthread.php?t=$tid\"", "<a href=\"print-$title-$tid.html\"", $output);
}
}
#------------------------------
# Email SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="sendmessage\.php\?do=sendtofriend&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$output = str_replace("<a href=\"sendmessage.php?do=sendtofriend&t=$tid\"", "<a href=\"sendtofriend-$title-$tid.html\"", $output);
}
}
#------------------------------
# New Thread
#------------------------------
$found = preg_match_all('#<a href="newthread\.php\?do=newthread&f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$output = str_replace("<a href=\"newthread.php?do=newthread&f=$fid\"", "<a href=\"$title-$fid/newthread.php\"", $output);
}
}
#------------------------------
# New Post
#------------------------------
$found = preg_match_all('#<a href="newreply\.php\?do=newreply&noquote=1&p=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, postid FROM " . TABLE_PREFIX . "post WHERE postid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$pid = $t['postid'];
$threadinfo = $vbulletin->db->query_first("SELECT title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='$tid'");
$title = urlize($threadinfo['title']);
$fid = $threadinfo['forumid'];
$f = fetch_foruminfo($fid);
$fname = urlize($f['title']);
$output = str_replace("<a href=\"newreply.php?do=newreply&noquote=1&p=$pid\"", "<a href=\"$fname/newpostnoquote-$pid.php\"", $output);
}
}
#------------------------------
# New Post
#------------------------------
$found = preg_match_all('#<a href="newreply\.php\?do=newreply&p=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, postid FROM " . TABLE_PREFIX . "post WHERE postid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$pid = $t['postid'];
$threadinfo = $vbulletin->db->query_first("SELECT title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='$tid'");
$title = urlize($threadinfo['title']);
$fid = $threadinfo['forumid'];
$f = fetch_foruminfo($fid);
$fname = urlize($f['title']);
$output = str_replace("<a href=\"newreply.php?do=newreply&p=$pid\"", "<a href=\"$fname/newpost-$pid.php\"", $output);
}
}
#------------------------------
# Search
#------------------------------
$found = preg_match_all('#<a href="search\.php\?searchid=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, searchid FROM " . TABLE_PREFIX . "search WHERE searchid IN($ids)");
while($s = $vbulletin->db->fetch_array($res))
{
$userid = $s['userid'];
$searchid = $s['searchid'];
$output = str_replace("search.php?searchid=$searchid", "search-$userid-$searchid.html", $output);
}
}
#------------------------------
# misc pages
#------------------------------
$output = str_replace("search.php?do=getnew","search-getnew.html",$output);
$output = str_replace("search.php?do=getdaily","search-getdaily.html",$output);
$output = str_replace("forumdisplay.php?do=markread","markread.html",$output);
}
/**
* Turn a string into a URL friendly string
*
* @param string $txt The string to work on
* @return string The new string
*/
function urlize($txt)
{
$txt = unaccent($txt);
$txt = html_entity_decode($txt);
$txt = str_replace(' ', '-', $txt);
$txt = preg_replace('#[^a-zA-Z0-9_\-]+#', '', $txt);
$txt = preg_replace('#[\-]+#', '-', $txt);
return strtolower($txt);
}
/**
* Turn accented characters into normal characters
*
* @param string $txt The string to remove the accents from
* @return string Your new clean string
*/
function unaccent($txt)
{
$trans = get_html_translation_table(HTML_ENTITIES);
foreach($trans as $literal => $entity)
{
if(ord($literal) >= 192)
{
$search[] = $literal;
$replace[] = substr($entity, 1, 1);
}
}
return str_replace($search, $replace, $txt);
}
Nothing works with this one. Everything is vbulletin default.
Immortal
01-29-2006, 10:43 PM
AWS, the only difference between that and the one posted earlier is that the SHOWTHREAD's pages is commented out. So the issue will still be there for you, I'll try and ponder on a solution for you.
T2DMan
01-30-2006, 04:41 AM
Getting the vBulletin url's corrected is certainly not a small task, and you have certainly done well getting this far. Yes, I happen to support the one rewrite that I consider does a 110% job at rewrites, but you are getting there.
I like the nextthread/prevthread per hosting talk (http://www.hosting-talk.com/us-and-world/t-world-thousands-mourn-salvador-ex-rebel-chief-handal-2033.html) but the archive seems to be broken there.
I have now read through all the posts here and it looks like you have got many things covered. But can I suggest that you add the following:
That you recommend the use of the vbulletin option to have the archive linking directly to the actual threads. This gets the most Google PR/link value etc to the actual threads - this was an option I was able to get added to vBulletin 3.5.
or - that your rewrite does the direct to url rewrite on the archive/sitemap.
And that the thread url on the archive is rewritten.
when the root forum url is linked, that instead of it being "/index.php", that it be just "/". Matt Cutts says Google is working on determining what url should be the correct url, but better that each site do it for themselves.
You are working on the newpost/latest post? - in the pre 3.5 vBulletin, my rewrite kept the initial url, but then when it searched for the url in the php, it then did a 301 redirect to the proper url - correctly paginated. That general logic should be able to be coded for your plugins. Rather similar to what you have done for the nextthread/previous thread
there will be other issues, but those are the ones I see at the moment.
Google SiteMap
Should be an easy job to either mod my vbgsitemap, or the vbseo one for your url's.
On page SEO
No mention of seo'ing of vBulletin is complete without talking about onpage SEO.
If the first words of the title are the words that you are optimizing for, then this phrase should also be in the meta description twice, in an h1, and then repeated in sentence/paragraph form immediately following the h1. Most people posting threads do not repeat the title in the text they write, so repeating it via a formula makes sense. In looking around the forums mentioned on this thread I have seen a few using my formula. In general, with a proper url rewrite (almost achieved here), plus great onpage SEO I have been able to get many vBulletin sites so that their forums and threads are all showing high on the SERP's.
And with good search phrase selection, those pages are then able to get good traffic for the forums.
The onpage hints are just the same as needed for any site, and can be found on most SEO pages, but I have some specific template changes mentioned on my Search Engine Optimize vBulletin 3.5 (http://forum.time2dine.co.nz/seo-vbulletin/search-engine-optimize-vbulletin-3-5-a-2460.html) thread.
trilljester
01-30-2006, 05:09 PM
Excellent job! I missed all of my rewritten URLs when I converted from IPB to VBulletin. I know that Google can handle dynamic URLs to a degree, but I think this will improve my rankings out there.
Couple of bugs:
1. Send thread to a friend does not work. I commented it out for the plugin code, and now it's fine. It kept reporting a thread not found error, or something to that effect. The URL looked good, not sure where the problem was.
2. Viewing public profile of users has some issues. This is somewhat complicated, so I'll try my best to explain:
My user ID is #1. I have another frequent poster who's ID is 14. When we both post in a thread, her profile comes up as mine.
To see this in action, visit this thread:
http://www.trilliummud.com/holos/visitor-reception/t-another-newbie-my-oh-my-1086.html
To see the bad behavior, hover over the first poster's url, and it reads:
http://www.trilliummud.com/holos/members/bluffho-631.html
The second post down was posted by Earthrooster. her user ID is 14. The URL for her profile is messed up. it reads:
http://www.trilliummud.com/holos/members/jester-1.html4
My profile works great though, as evidenced later in the thread:
http://www.trilliummud.com/holos/members/jester-1.html
It appears the regular expression is a little too general, and probably needs to be refined.
Other than that, everything else appears to be working great! I'll probably add some custom rewrites for my arcade, and can post them here, unless you have someplace else that we can post our custom rewrites for the next version?
Thanks!
trilljester
01-30-2006, 06:22 PM
Another bug:
When posting, none of the WYSIWYG editor functions work correctly. All functions that refer to another file (i.e. misc.php for displaying the smiley list), return 404 errors.
I'm not sure where it's coming from either. I can't see the full URL it's trying to access.
yayvb
01-31-2006, 12:49 AM
Hi everyone.
I didn't see this answered anywhere already so I'm posting it now. I believe that I previously installed Deans hack and had the same problem so I uninstalled and installed this one and if I remember correctly the same thing happened.
In my forumhome everything is rewritten properly except only the first LAST TOPIC title and author are rewritten. All others below are not. Please see example below. Any advice or pointers please let me know.
https://vborg.vbsupport.ru/
yayvb
01-31-2006, 06:56 PM
Hmmm, I had installed this lastnight and woke to find my users complaining that when they clicked page 2 of a thread they would be brought to a completely different thread!! I checked and sure enough that's what was happening.
So even if I fix the fact that on the main page only the first threads are rewritten, apparently if there is more than 1 page of posts in a thread, there is a bug making it so you get transported to the wrong thread instead of page 2 of the right thread.
Anyone else have this problem? I didn't see this in here already.
trilljester
01-31-2006, 09:47 PM
Hmmm, I had installed this lastnight and woke to find my users complaining that when they clicked page 2 of a thread they would be brought to a completely different thread!! I checked and sure enough that's what was happening.
So even if I fix the fact that on the main page only the first threads are rewritten, apparently if there is more than 1 page of posts in a thread, there is a bug making it so you get transported to the wrong thread instead of page 2 of the right thread.
Anyone else have this problem? I didn't see this in here already.
It's happening to me too. I might have to turn this promising extension off. It appears to be way too unstable to be released in a non-test environment. I think the problem in the logic for gathering the URL to rewrite is flawed, and with no way to debug the output, it makes it that much harder to figure out where the problem is coming from.
EDIT: Here's a function I used a long time ago to strip characters that could cause problems when I was scanning a URL. It might be useful for this extension.
function make_url_safe($text) {
// Characters must be in ASCII and certain ones are not allowed.
$text = html_entity_decode ($text);
$text = str_replace(" / ","-",$text);
$text = str_replace("/","-",$text);
$text = str_replace("'","-",$text);
$text = str_replace(" - ","-",$text);
$text = str_replace("_","-",$text);
$text = str_replace(" ","-",$text);
$text = str_replace( "?", "ae", $text);
$text = str_replace( "?", "oe", $text);
$text = str_replace( "?", "ue", $text);
$text = str_replace( "?", "Ae", $text);
$text = str_replace( "?", "Oe", $text);
$text = str_replace( "?", "Ue", $text);
$text = str_replace( "?", "ss", $text);
$text = str_replace( "&", "and", $text);
$text = str_replace( "%", "Percent", $text);
$text = ereg_replace("[^A-Za-z0-9-]", "", $text);
$text = str_replace("----","-",$text);
$text = str_replace("---","-",$text);
$text = str_replace("--","-",$text);
return $text;
}
So pass the preg_replace'd URLs through this filter to help. I don't know, it's worth a shot.
Immortal
01-31-2006, 10:46 PM
Getting the vBulletin url's corrected is certainly not a small task, and you have certainly done well getting this far. Yes, I happen to support the one rewrite that I consider does a 110% job at rewrites, but you are getting there.
Yup, I agree. There are still some quirks that I am working on ironing out. But with client work these past few weeks, it really has put me on a limited time budget.
I like the nextthread/prevthread per hosting talk (http://www.hosting-talk.com/us-and-world/t-world-thousands-mourn-salvador-ex-rebel-chief-handal-2033.html) but the archive seems to be broken there.
The archive I cannot reproduce on my own site. So he may be using an outdated version that I have fixed by mistake (this was never reported as a bug before).
That you recommend the use of the vbulletin option to have the archive linking directly to the actual threads. This gets the most Google PR/link value etc to the actual threads - this was an option I was able to get added to vBulletin 3.5.
I haven't had time to figure out how to do 301 redirects. I had a failed attempt, which I posted in my support thread, but sadly never got answered. I'll take another stab once I get all the known bugs ironed out.
And that the thread url on the archive is rewritten.
What would you like to see them to get rewitten to? The same format vRewrite does it to?
when the root forum url is linked, that instead of it being "/index.php", that it be just "/". Matt Cutts says Google is working on determining what url should be the correct url, but better that each site do it for themselves.
Never heard of that one, but I'm not quite sure on how I would go about doing that. May be just a simple str_replace, I'll take a stab at that one.
You are working on the newpost/latest post? - in the pre 3.5 vBulletin, my rewrite kept the initial url, but then when it searched for the url in the php, it then did a 301 redirect to the proper url - correctly paginated. That general logic should be able to be coded for your plugins. Rather similar to what you have done for the nextthread/previous thread
It rewrites the actual newpost/latest post, but I cannot figure out how to fix the redirect for the life of me. May have to add that as a code mod. I'm clueless at that one as is Cole and Chroder (Thanks again guys for all the help and assistance!)
there will be other issues, but those are the ones I see at the moment.
[/list]Google SiteMap
Should be an easy job to either mod my vbgsitemap, or the vbseo one for your url's.
Plans is it get all bugs fixed first, and then I'll try and work on something. That is, unless you want to do it :)
No mention of seo'ing of vBulletin is complete without talking about onpage SEO.
If the first words of the title are the words that you are optimizing for, then this phrase should also be in the meta description twice, in an h1, and then repeated in sentence/paragraph form immediately following the h1. Most people posting threads do not repeat the title in the text they write, so repeating it via a formula makes sense. In looking around the forums mentioned on this thread I have seen a few using my formula. In general, with a proper url rewrite (almost achieved here), plus great onpage SEO I have been able to get many vBulletin sites so that their forums and threads are all showing high on the SERP's.
And with good search phrase selection, those pages are then able to get good traffic for the forums.
The onpage hints are just the same as needed for any site, and can be found on most SEO pages, but I have some specific template changes mentioned on my Search Engine Optimize vBulletin 3.5 (http://forum.time2dine.co.nz/seo-vbulletin/search-engine-optimize-vbulletin-3-5-a-2460.html) thread.
I'll try and read up on more vB SEO, but currently it just rewrites URLs. A small step, but it's still a step :)
Immortal
01-31-2006, 10:53 PM
Excellent job! I missed all of my rewritten URLs when I converted from IPB to VBulletin. I know that Google can handle dynamic URLs to a degree, but I think this will improve my rankings out there.
Great to hear, always happy to help anyone who converted from IPB :) I feel bad for you that you had to use that :nervous:
1. Send thread to a friend does not work. I commented it out for the plugin code, and now it's fine. It kept reporting a thread not found error, or something to that effect. The URL looked good, not sure where the problem was.
Would you mind uncommenting that line out and posting the error? My URL is:
endtofriend-arcade-release-2738.html
And it's working just fine for me.
2. Viewing public profile of users has some issues. This is somewhat complicated, so I'll try my best to explain:
My user ID is #1. I have another frequent poster who's ID is 14. When we both post in a thread, her profile comes up as mine.
To see this in action, visit this thread:
http://www.trilliummud.com/holos/visitor-reception/t-another-newbie-my-oh-my-1086.html
To see the bad behavior, hover over the first poster's url, and it reads:
http://www.trilliummud.com/holos/members/bluffho-631.html
The second post down was posted by Earthrooster. her user ID is 14. The URL for her profile is messed up. it reads:
http://www.trilliummud.com/holos/members/jester-1.html4
My profile works great though, as evidenced later in the thread:
http://www.trilliummud.com/holos/members/jester-1.html
It appears the regular expression is a little too general, and probably needs to be refined.
This is another weird issue. It works on some boards, and doesn't on others. I'm not too sure on how I can fix my preg on that one. I'll try and take a look into it but I'm in doubt that I'll fix it.
Other than that, everything else appears to be working great! I'll probably add some custom rewrites for my arcade, and can post them here, unless you have someplace else that we can post our custom rewrites for the next version?
Please do. And I'll add them to the hack description :)
Another bug:
When posting, none of the WYSIWYG editor functions work correctly. All functions that refer to another file (i.e. misc.php for displaying the smiley list), return 404 errors.
I'm not sure where it's coming from either. I can't see the full URL it's trying to access.
Hm, weird. Can you give me a link on that one? I'm not a fan of the WYSIWYG editor and never really thought to test it...
Immortal
01-31-2006, 10:58 PM
Hi everyone.
I didn't see this answered anywhere already so I'm posting it now. I believe that I previously installed Deans hack and had the same problem so I uninstalled and installed this one and if I remember correctly the same thing happened.
In my forumhome everything is rewritten properly except only the first LAST TOPIC title and author are rewritten. All others below are not. Please see example below. Any advice or pointers please let me know.
https://vborg.vbsupport.ru/
Was reported and fixed (https://vborg.vbsupport.ru/showpost.php?p=884882&postcount=300).
Hmmm, I had installed this lastnight and woke to find my users complaining that when they clicked page 2 of a thread they would be brought to a completely different thread!! I checked and sure enough that's what was happening.
So even if I fix the fact that on the main page only the first threads are rewritten, apparently if there is more than 1 page of posts in a thread, there is a bug making it so you get transported to the wrong thread instead of page 2 of the right thread.
Anyone else have this problem? I didn't see this in here already.
Was reported and issued a temporary fix (https://vborg.vbsupport.ru/showpost.php?p=885524&postcount=316).
It's happening to me too. I might have to turn this promising extension off. It appears to be way too unstable to be released in a non-test environment. I think the problem in the logic for gathering the URL to rewrite is flawed, and with no way to debug the output, it makes it that much harder to figure out where the problem is coming from.
EDIT: Here's a function I used a long time ago to strip characters that could cause problems when I was scanning a URL. It might be useful for this extension.
There's a function already to replace bad characters ;) please see the above for fixes.
T2DMan
01-31-2006, 11:39 PM
And that the thread url on the archive is rewritten.
What would you like to see them to get rewitten to? The same format vRewrite does it to?
The sitemap should be linking direct to the threads, and the thread url should be your rewritten url. This means there is no extra copy of the thread, it gives the thread another text link with its search phrase, and means that there are not too many clicks from any one page to get to any other thread. All things that are important for SEO.
GamerJunk.net
02-01-2006, 01:28 AM
Anyone else having problems where it starts to randomly make the URL's bad?
Such as http://www.gsnforce.com/forum/comments-suggestions/newreply.php
Obviously that URL wouldn't exist...any explaination?
Snake
02-01-2006, 11:33 AM
Was reported and fixed (https://vborg.vbsupport.ru/showpost.php?p=884882&postcount=300).
Was reported and issued a temporary fix (https://vborg.vbsupport.ru/showpost.php?p=885524&postcount=316).
There's a function already to replace bad characters ;) please see the above for fixes.
Have you updated the pack with the new bug fixes yet?
GamerJunk.net
02-01-2006, 04:46 PM
Was that directed towards me aftermath?
Ericsson
02-01-2006, 04:49 PM
http://www.supercarforums.org/f-ferreri-13.html works but when you click on a thread in a subfolder, http://www.supercarforums.org/ferreri/t-ferreri-f60-4.html it doesnt work.
Any idea?
GamerJunk.net
02-01-2006, 05:37 PM
Have you updated the pack with the new bug fixes yet?
Was that directed to me Aftermath?
Snake
02-01-2006, 05:39 PM
Was that directed towards me aftermath?
Uh no, it was directed to Immortal...
Immortal
02-01-2006, 05:59 PM
Anyone else having problems where it starts to randomly make the URL's bad?
Such as http://www.gsnforce.com/forum/comments-suggestions/newreply.php
Obviously that URL wouldn't exist...any explaination?
Where did you get that URL from? It rewrites nothing like that if I can remember correctly.
Have you updated the pack with the new bug fixes yet?
Not yet, hoping to release something new this weekend along with all bug fixes plus merging actually working.
http://www.supercarforums.org/f-ferreri-13.html works but when you click on a thread in a subfolder, http://www.supercarforums.org/ferre...reri-f60-4.html it doesnt work.
Any idea?
Huh? Just by looking at:
http://www.supercarforums.org/ferreri-13/newthread.php
I can tell you did not apply all necessary template changes...
GamerJunk.net
02-01-2006, 06:41 PM
Immortal, I'm on my sidekick right now, so I can't enable the rewrite, but yes it does write like that. It even makes it so that when I click to go to my forum index it rewrites it so it looks like this
www.gsnforce.com/forum/comments-suggesstions/index.php
Andreas
02-01-2006, 08:11 PM
Not bad, but most certaily could get better :)
- Fix only first rhread/etc. being rewritten
- queries to get titles seems BAD
The data is already avialable in Hooks threadbit_process, etc. - use it there
- searches are not covered
- could avoid the template edits by doing $headinclude = '<base href="' . $vbulletin->options['bburl'] . "\" />\n$headinclude";
Immortal
02-01-2006, 09:15 PM
Immortal, I'm on my sidekick right now, so I can't enable the rewrite, but yes it does write like that. It even makes it so that when I click to go to my forum index it rewrites it so it looks like this
www.gsnforce.com/forum/comments-suggesstions/index.php
Hm weird, not quite sure why it's doing that.
- Fix only first rhread/etc. being rewritten
I did a temporary fix a few pages back, just waiting to get all fixes together before I release an updated packaged :)
- queries to get titles seems BAD
The data is already avialable in Hooks threadbit_process, etc. - use it there
Sorry I'm ignorant when it comes to vB coding. Could you explain a bit more please?
- searches are not covered
Well, SEs can't search so I really didn't find this necessary to rewrite.
- could avoid the template edits by doing $headinclude = '<base href="' . $vbulletin->options['bburl'] . "\" />\n$headinclude";
Ooh, I'll take note of this. Will be very nice for future installs.
Andreas
02-01-2006, 09:32 PM
Sorry I'm ignorant when it comes to vB coding. Could you explain a bit more please?
For example on forumdisplay.php, you are issuing a query to get the titles for all threadids found.
But, those are all the threads being displayed, so this information already has been queried before, which makes this unnecessary overhead.
The threadids, titless and forumids are available in Hoo0k threadbit_process for example (could also use threadbit_display if it's just for forumdisplay.php).
So you could build an array there, and use this to lookup the titles in global_complete to save the query.
Same goes for showthread.php, abd probably other pages as well.
Especially querying the forum table from forum titles is wasteful, as the forumcache does contain this information - and is available on every page.
Well, SEs can't search so I really didn't find this necessary to rewrite.
True. But it might help AdSense :)
trilljester
02-01-2006, 09:45 PM
Great to hear, always happy to help anyone who converted from IPB :) I feel bad for you that you had to use that :nervous:
Well, when I first put up my site, IPB was free, and I wanted something free and easy, which IPB *was*. Not to derail this thread, but when they released their 2.0, and started to charge for it, and giving a crappy trial version to all those who HELPED them build 2.0...well, it felt like a slap in the face. I'm glad I'm using VB now. It's a far better product. I see the light now!
Would you mind uncommenting that line out and posting the error? My URL is:
endtofriend-arcade-release-2738.html
Done. Try doing it from this thread:
http://www.trilliummud.com/holos/general-conversation/t-foods-that-gross-you-out-1150.html
I click on Thread Tools, Email this Page, and it fouls up.
This is another weird issue. It works on some boards, and doesn't on others. I'm not too sure on how I can fix my preg on that one. I'll try and take a look into it but I'm in doubt that I'll fix it.
I can throw the condition over to a Regular Expression master here at my work. I'm sure he can offer some more advice than I can. I hate regular expressions, but I know they're necessary. :-)
Hm, weird. Can you give me a link on that one? I'm not a fan of the WYSIWYG editor and never really thought to test it...
OK, more info about this:
It gives me 404 errors when I start a new thread. Probably because something is wrong with this URL:
http://www.trilliummud.com/holos/the-outer-rims-12/newthread.php
Guest posting is allowed at the above URL, try it for yourself with the WYSIWYG editor.
It does NOT have issues when replying in a thread. The reply URL is not rewritten, thus it works fine.
Immortal
02-01-2006, 10:10 PM
Add this line of code to your .htaccess if it doesn't already exist:
RewriteRule ^sendtofriend-(.*)-(.*).html sendmessage.php?do=sendtofriend&t=$2 [L]
The newthread link you posted and if I manually go to it myself works just dandy?
* Immortal thinks he must be going mad
Ericsson
02-02-2006, 02:45 PM
Huh? Just by looking at:
http://www.supercarforums.org/ferreri-13/newthread.php
I can tell you did not apply all necessary template changes...
I did all the template changes, you just had to add:
<base href="$vboptions[bburl]/" />
to showthread, newreply, newthread, forumdisplay, memberinfo, right?
trilljester
02-02-2006, 04:53 PM
Immortal: I think I know what's causing these problems. It's the order of the rewriterules in the .htaccess file.
I turned on rewrite logging for my Apache server, and saw this entry when i tried to send a thread to a friend:
rewrite sendtofriend-trillium-clothing-shop-1090.html -> showthread.php?goto=1090&t=shop
So I looked at the rules in the .htaccess and saw this rule about midway through:
RewriteRule ^(.*)-(.*)-(.*).html showthread.php?goto=$3&t=$2 [L]
That should be the LAST Rewriterule in the .htaccess file, so it catches anything that falls through the other rules.
I moved it to the bottom of my .htaccess and it fixed the problem with sending email to a friend. So that problem is resolved. Now to figure out the WYSIWYG problem.
Edit: I found proof that the editor problem might be related to Internet Explorer. I loaded Firefox, and tried a New Topic, and everything worked (smilies popup, attachment manager, etc..)
In IE, the smilie popup and attachment manager does NOT work. I did some research and I'm guessing it has something to do with the <base> tag. Maybe because IE6 is not fully XHTML compliant? Firefox understands it and is fine. Is there a workaround?
caislander
02-02-2006, 06:20 PM
Excellent hack Immortal, one problem though. It's not rewriting my thread urls or my member profile urls. It rewrites the forum ones fine.
www.plantedtank.net/forums/ is my link.
EDIT: After further inspection I noticed the following:
1. It rewrites the url in any forum, for the most recent post.
2. Any post that is not rewritten will give an incorrect url for page 2 of posts. It only does it for page 2, not 3,4,5,32 .... you get the point.
This is very odd behavior.First off Great hack.. Thanks
BUT (ya you knew there had to be one :D ) I am having this very same issue, is there some kind of solution? or trouble shooting process or.. or..
Thanks for the hack and your time :cool:
trilljester
02-02-2006, 08:22 PM
First off Great hack.. Thanks
BUT (ya you knew there had to be one :D ) I am having this very same issue, is there some kind of solution? or trouble shooting process or.. or..
Thanks for the hack and your time :cool:
Previous page has a solution.
https://vborg.vbsupport.ru/showpost.php?p=885524&postcount=316
Replace the plugin with that code he posted, it should resolve the multiple page problem and the not rewriting past the first forum issue.
Immortal
02-02-2006, 09:37 PM
Immortal: I think I know what's causing these problems. It's the order of the rewriterules in the .htaccess file.
I turned on rewrite logging for my Apache server, and saw this entry when i tried to send a thread to a friend:
rewrite sendtofriend-trillium-clothing-shop-1090.html -> showthread.php?goto=1090&t=shop
So I looked at the rules in the .htaccess and saw this rule about midway through:
RewriteRule ^(.*)-(.*)-(.*).html showthread.php?goto=$3&t=$2 [L]
That should be the LAST Rewriterule in the .htaccess file, so it catches anything that falls through the other rules.
I moved it to the bottom of my .htaccess and it fixed the problem with sending email to a friend. So that problem is resolved. Now to figure out the WYSIWYG problem.
Edit: I found proof that the editor problem might be related to Internet Explorer. I loaded Firefox, and tried a New Topic, and everything worked (smilies popup, attachment manager, etc..)
In IE, the smilie popup and attachment manager does NOT work. I did some research and I'm guessing it has something to do with the <base> tag. Maybe because IE6 is not fully XHTML compliant? Firefox understands it and is fine. Is there a workaround?
Uh, I cannot believe that I used a rule like that, hah. I'll try and see about the IE problem. But leave it up to IE :tired:
caislander
02-03-2006, 03:52 AM
Uh, I cannot believe that I used a rule like that, hah. I'll try and see about the IE problem. But leave it up to IE :tired:
trilljester,
Thanks for that, the problem of only the first url being rewitten seem to be gone However, I still am having the issue of the 2nd page of a thread being sent off to some other thread, And another issue if I am on the main index page (forum home) and click the latest post link for any forum the url is not rewritten?
Thanks
xtreme-mobile
02-03-2006, 05:55 PM
hi guys
ive used this hack onnmy old forum with no problems but on my new forum this plugin is making i threads go to ~"page cannot be displayed" yet as soon as i disable the plugin it works fine
any ideas?
Immortal
02-03-2006, 06:42 PM
trilljester,
Thanks for that, the problem of only the first url being rewitten seem to be gone However, I still am having the issue of the 2nd page of a thread being sent off to some other thread, And another issue if I am on the main index page (forum home) and click the latest post link for any forum the url is not rewritten?
Thanks
https://vborg.vbsupport.ru/showpost.php?p=887227&postcount=327
hi guys
ive used this hack onnmy old forum with no problems but on my new forum this plugin is making i threads go to ~"page cannot be displayed" yet as soon as i disable the plugin it works fine
any ideas?
Could you please post your .htaccess along with your forum URL? :)
xtreme-mobile
02-03-2006, 09:00 PM
http://www.extreme-mobile.com
and file attached :D
Immortal
02-03-2006, 10:03 PM
And you're sure mod_rewrite is enabled?
xtreme-mobile
02-03-2006, 10:06 PM
yes ive used your hack before with no problems, just seems to be playing up now
xtreme-mobile
02-03-2006, 10:07 PM
ill enable your hack now and try going directly to a thread
Immortal
02-03-2006, 10:08 PM
<a href="http://www.extreme-mobile.com/introductions/t-here-we-go-again-14.html" target="_blank">http://www.extreme-mobile.com/introd...-again-14.html</a> Works just fine?
xtreme-mobile
02-03-2006, 10:10 PM
<a href="http://www.extreme-mobile.com/showthread.php?goto=newpost&t=10" target="_blank">http://www.extreme-mobile.com/showth...o=newpost&t=10</a>
this say page can not be displayed yet as soon as i disable the product it goes to the post fine
xtreme-mobile
02-03-2006, 10:14 PM
ok ive just worked out taht if you go in to the post by clicking the forum main title then selecting the post it works how ever if you click the post from forum display directly it hangs and wont show
Immortal
02-03-2006, 10:30 PM
Whoa, I think you enabled something that shouldn't be enabled. Make sure you are only enabling vRewrite in global_complete and vRewrite WOL in the who's online hook (I forget and I'm too lazy to look).
xtreme-mobile
02-03-2006, 10:34 PM
Whoa, I think you enabled something that shouldn't be enabled. Make sure you are only enabling vRewrite in global_complete and vRewrite WOL in the who's online hook (I forget and I'm too lazy to look).
you lost me now :( lol
Immortal
02-03-2006, 10:41 PM
vBulletin ACP->Plugin Manager
There should be 3 plugins that concern vRewrite. Make sure only vRewrite (it is under the global_complete hook), and the vRewrite WOL (under online_preprocess or something like that). Then there is a 3rd one, disable this. This should not be enabled as it does not work correctly currently.
caislander
02-04-2006, 03:54 AM
[Immortal,
Thanks for the response but when i apply the code change as is outlined in post 300 (https://vborg.vbsupport.ru/showpost.php?p=884882&postcount=300) it fixes everything except the page 2 of a thread being sent to some other thread. So I over wrote that with the chance in post 316 (https://vborg.vbsupport.ru/showpost.php?p=884882&postcount=300) and that gives me an error of Parse error: parse error, unexpected '}' in..../www/html/forums/includes/functions.php(4320) : eval()'d code on line 606 What have I done wrong?
logical.angel
02-04-2006, 05:44 AM
[Immortal,
Thanks for the response but when i apply the code change as is outlined in post 300 (https://vborg.vbsupport.ru/showpost.php?p=884882&postcount=300) it fixes everything except the page 2 of a thread being sent to some other thread. So I over wrote that with the chance in post 316 (https://vborg.vbsupport.ru/showpost.php?p=884882&postcount=300) and that gives me an error of Parse error: parse error, unexpected '}' in..../www/html/forums/includes/functions.php(4320) : eval()'d code on line 606 What have I done wrong?
Uhmm, it's a parse error, maybe you've wrongly paste the codes, maybe lack a single quotes somewhere or needs an additional ) added or remove, try posting the codes around line 606.
Heh Immortal, I must say a great thanks to you, i've not used vRewrite yet, just heard of it today, but i've followed this thread, you really must be having a great patience to keep up working with vRewrite and additionally help with support issues.
Anyways, i'll try to get my whole hackers.mu crew to work with that bug in vRewrite maybe someone might figure out what's wrong.
Anywayz, great job.
+[logical.angel]out
logical [AT] hackers.mu
sysop2
02-04-2006, 08:20 AM
Hello all, i'm new here. ;)
what am i doing wrong?
I took a clean vbulletin and installed that product.
Forum rewriting works.
Thread rewriting doesnt:
Only the 1st Thread in a forum hast se-friendly urls.
Only the 1st and the last page of threads with more than one page are rewritten:
example(3 pages) :
.../forumname/t-threadtitle-28.html
.../showthread.php?t=28&page=2
.../forumname/t-threadtitle-28-page-3.html
--
Immortal, i really appreciate your work and would say THX thousand times, but this thing is unuseable and doesnt work correctly(if I didnt do an error... but where?!).
Greetz - sysop2
Immortal
02-04-2006, 01:05 PM
[Immortal,
Thanks for the response but when i apply the code change as is outlined in post 300 (https://vborg.vbsupport.ru/showpost.php?p=884882&postcount=300) it fixes everything except the page 2 of a thread being sent to some other thread. So I over wrote that with the chance in post 316 (https://vborg.vbsupport.ru/showpost.php?p=884882&postcount=300) and that gives me an error of Parse error: parse error, unexpected '}' in..../www/html/forums/includes/functions.php(4320) : eval()'d code on line 606 What have I done wrong?
Double check that make sure you did it correctly. If you can wait until later today, I'll have a new release with these fixes builtin plus the merge fix.
Heh Immortal, I must say a great thanks to you, i've not used vRewrite yet, just heard of it today, but i've followed this thread, you really must be having a great patience to keep up working with vRewrite and additionally help with support issues.
Anyways, i'll try to get my whole hackers.mu crew to work with that bug in vRewrite maybe someone might figure out what's wrong.
Anywayz, great job.
Thanks, that's very kind of you :)
Hello all, i'm new here.
what am i doing wrong?
I took a clean vbulletin and installed that product.
Forum rewriting works.
Thread rewriting doesnt:
Only the 1st Thread in a forum hast se-friendly urls.
Only the 1st and the last page of threads with more than one page are rewritten:
example(3 pages) :
.../forumname/t-threadtitle-28.html
.../showthread.php?t=28&page=2
.../forumname/t-threadtitle-28-page-3.html
--
Immortal, i really appreciate your work and would say THX thousand times, but this thing is unuseable and doesnt work correctly(if I didnt do an error... but where?!).
Greetz - sysop2
The fix (https://vborg.vbsupport.ru/showpost.php?p=887227&postcount=327) was issued a bit ago. A new release should be released today with this fix builtin.
Snake
02-04-2006, 05:25 PM
Oooo I can't wait... :D
Immortal
02-04-2006, 06:18 PM
I have fixed all known errors. We are currently testing it out on my live board before I release to y'all :)
sysop2
02-04-2006, 09:22 PM
:surprised: great news mate, keep up the good work
hope you release it soon :)
caislander
02-04-2006, 11:33 PM
I have fixed all known errors. We are currently testing it out on my live board before I release to y'all :)Awesome :)
Immortal
02-05-2006, 12:10 AM
vRewrite - v3arcade Rewrite
Just something I just whipped up.
Styles & Templates->v3 arcade->arcade_game_bit
Find:
<div style="padding-bottom: 4px"><a href="arcade.php?do=play&gameid=$game[gameid]"><strong>$game[title]</strong></a></div>
Replace with:
<div style="padding-bottom: 4px"><a href="arcade/games/$game[gameid].html"><strong>$game[title]</strong></a></div>
Find:
<a href="arcade.php?do=play&gameid=$game[gameid]">$vbphrase[play_now]</a> </td>
Replace with:
<a href="arcade/games/$game[gameid].html">$vbphrase[play_now]</a>
Open up v3 arcade->arcade_headinclude at to the very end:
[code]
<base href="$vboptions[bburl]/" />
Add this to your .htaccess with the other RewriteRules:
RewriteRule ^arcade/games/(.*) arcade.php?do=play&gameid=$1 [L]
I may add other rules if I get unlazy in the future ;)
Immortal
02-05-2006, 01:43 AM
Just an update..no way am I going to get done with this tonight.
1) Merge is still not working. Thanks preg_match.
2) Forumdisplay pages is not working. Thanks preg_match_all.
3) Showthread pages is not working. Thanks preg_match_all.
4) Archive links are not redirected yet.
Urgghh...
sysop2
02-05-2006, 09:18 AM
awww :(
ok i see theres no reason to be euphoric... i'll check this thread later in a few days... awww again.
Greetz
sysop2
02-06-2006, 04:09 PM
Hi mate, any news on this? :smoke:
Anyone have a quick fix to make all instances of /forum/index.php to just /forum/ ?
I edited the breadcrmb nav but the rest of the URL are still index.php in there.
Thanks
xtreme-mobile
02-06-2006, 04:36 PM
vBulletin ACP->Plugin Manager
There should be 3 plugins that concern vRewrite. Make sure only vRewrite (it is under the global_complete hook), and the vRewrite WOL (under online_preprocess or something like that). Then there is a 3rd one, disable this. This should not be enabled as it does not work correctly currently.
yeh thats better, ive disabled the redirects one :D
cheers
Immortal
02-06-2006, 06:13 PM
Hi mate, any news on this? :smoke:
We're playing the waiting game again on another thread....
Anyone have a quick fix to make all instances of /forum/index.php to just /forum/ ?
I edited the breadcrmb nav but the rest of the URL are still index.php in there.
Thanks
Sadly, it can't easily be done AFAIK.
yeh thats better, ive disabled the redirects one
cheers
In 1.0 that plugin actually works! :D
xtreme-mobile
02-06-2006, 06:29 PM
ive had to uninstall it altogether now for the moment, for some reason when the product it active i cant use the attachements button, it always says page can not be displayed
yet when i disable it the forum attachmenst work fine, strange!!!1
gonna test the attachemenst for an hour or so and try and re-install see if its definatly this product
Immortal
02-06-2006, 06:43 PM
There has been a confirmed IE bug that causes this. But since, this is beyond my jurisdiction, I can't do anything sadly until IE fixes it...
Now that I think about it...I may have fixed it in 1.0 - not sure.
I had to uninstall this as well because the posting interface wasn't clickable, like the smilies, link button, img button, etc. Just the text area was clickable.
Immortal
02-07-2006, 06:12 PM
I had to uninstall this as well because the posting interface wasn't clickable, like the smilies, link button, img button, etc. Just the text area was clickable.
https://vborg.vbsupport.ru/showpost.php?p=892518&postcount=376 ;)
Hanif
02-08-2006, 08:23 PM
Immortal,
Any updates ma man???
Kind regards,
Hanif
Immortal
02-08-2006, 09:14 PM
Still waiting...seems a lot of vB.orgers doesn't have the time nor can they try and find some time to help others, heh. :(
Brandon Sheley
02-09-2006, 04:01 AM
I wish I could help you man..
i have a test board setup when i was trying the new shop out..
I'd be more then happy to try and help you.. :)
Hanif
02-09-2006, 06:18 AM
Hi Immortal,
I'm not a coder but I'm sure I can help you out in other ways. Got a tet board and some time to help you. Let me know dude.
Kind regards,
Hanif
Immortal
02-11-2006, 01:24 AM
I'm almost there folks! :)
SoftWareRevue
02-11-2006, 02:08 AM
Go Tyler, go!
Brandon Sheley
02-11-2006, 02:14 AM
don't forget to test see that it works with the eShop ;)
seems vbseo had some issues with it, not sure
let us know if we can do anything to help
Immortal
02-11-2006, 02:23 AM
Well, I just want to get 1.0 released. Then I'll worry about any hack conflicts. :)
Brandon Sheley
02-11-2006, 03:35 AM
sounds good, anyway i can help ?
adhari_com
02-11-2006, 04:59 AM
does it function properly with apache 1.3 installed as CGI?
MamboCube
02-11-2006, 08:58 AM
where is the htaccess file? im abit new to all this so it mght be a dumb question. Ive done everything else and it is rewriting the directories, but it cant access the page. The install guide keeps reffering to a .htaccess file, but there isnt one included in the the downloaded folder.
Hope you guys can help me out!!
redlabour
02-11-2006, 09:32 AM
@MamboCube - in the Download in First Posting.
I like to see the Templateedits done by the Plugin.
MamboCube
02-11-2006, 09:42 AM
found it now, because im on a Mac, it doesn't show the .htaccess file. Although most mac owners probably know this it may be an idea to put this down in the install guide or in the first post incase newbies (like myself) think there is a problem with the download.
Also is there anyway i can remove the copyright? through donation etc?
Immortal
02-11-2006, 03:32 PM
sounds good, anyway i can help ?
Not currently, thanks for the offer.
does it function properly with apache 1.3 installed as CGI?
Should as long at mod_rewrite is enabled.
Also is there anyway i can remove the copyright? through donation etc?
Yup, just PM me with how much you think is right, and I'll let ya know :)
Impreza04
02-12-2006, 09:16 PM
Some of my member looks look like this
http://www.friendcodes.com/forums/m.../corey-1.html05
That person's user name is not "corey". THat is actually my user name.
I've seen this a few times. However, I cannot reproduce this on a unhacked forum.
Im getting this too, Every user up userid 9 works fine, then user id 10's link becomes u-impreza04-1.html1 for userid 11, u-impreza04-1.html0 for user 10 etc etc
King Internet
02-13-2006, 08:34 PM
I've looked at the various free SEO stuff for vBulletin, and have wondered this: why do the rewrite urls have .html on them? It looks ugly. It'd be awesome to have no extentions so vBulletin matches the rest of my site.
Immortal
02-13-2006, 09:19 PM
I've looked at the various free SEO stuff for vBulletin, and have wondered this: why do the rewrite urls have .html on them? It looks ugly. It'd be awesome to have no extentions so vBulletin matches the rest of my site.
.html or any extension helps mod_rewrite find the correct ID. IMHO, I think .html is the best, and what I use on my personal site. But then again, that's just my opinion :)
rootnik
02-14-2006, 01:08 AM
Does anybody have a working htaccess.ini for the isapi_rewrite module(ISS)?
Immortal
02-14-2006, 02:08 AM
AWS said (https://vborg.vbsupport.ru/showthread.php?p=885512#post885512) he had to modify it a bit for IIS. You may want to PM him :)
Does anybody have a working htaccess.ini for the isapi_rewrite module(ISS)?
Use the rules from the .htaccess file in the zip. Take out the rerrite engine on line and change the ^ at the beginning of each line to a /.
MamboCube
02-14-2006, 02:58 PM
not quite sure if this is working for anybody else but i cant seem to use any of the thread tools, i just get an error message saying it cant find the url, anyone know about this?
yayvb
02-14-2006, 06:00 PM
Hi, I think that I have made a lot of progress with the problems that I was having earlier (ie. only the first 'last thread' on forum page would be rewritten and also if multi page thread, page 1 worked but others directed to wrong threads).
What I did was use the updated code from Immortal found here:
https://vborg.vbsupport.ru/showpost.php?p=885524&postcount=316
I updated the code but also received the parse error that another member had mentioned. I saw that it looks like a previous } was no longer needed.
So I found:
#------------------------------
# misc pages
#------------------------------
$output = str_replace("search.php?do=getnew","search-getnew.html",$output);
$output = str_replace("search.php?do=getdaily","search-getdaily.html",$output);
$output = str_replace("forumdisplay.php?do=markread","markread.html",$output);
}
and just removed the } and that got rid of the parse error.
------------------------------------------------
Now everything is rewritten appropriately except multi pages aren't working. If you click on a page 2 link I get a page cannot be displayed message. I think it has something to do with my .htaccess file although I DO see the line that should take care of this.
Here are the links to a 1st and 2nd page of a multi page thread.
Before using vRewrite:
Page 1 link:
http://www.420boards.com/showthread.php?t=385
Page 2 link:
http://www.420boards.com/showthread.php?t=385&page=2
After vRewrite (multi page thread)
Page1 link:
http://www.420boards.com/smokers-lounge/t-who-do-you-want-to-win-the-superbowl-385.html
Page2 link: (page cannot be displayed but same link as before rewrite)
http://www.420boards.com/showthread.php?t=385&page=2
Here is the htaccess file that I am using
RewriteEngine On
RewriteBase /
# Default
RewriteRule ^f-(.*)-page-(.*)-(.*).html forumdisplay.php?f=$1&page=$2&order=$3
RewriteRule ^f-(.*)-(.*).html forumdisplay.php?f=$2 [L]
RewriteRule ^u-(.*)-(.*).html member.php?u=$2 [L]
RewriteRule ^memberlist-(.*)-(.*)-(.*)-(.*).html memberlist.php?ltr=$1&pp=$2&sort=$3&order=$4 [L]
RewriteRule ^(.*)/t-(.*)-(.*).html showthread.php?t=$3&is_vrewrite [L]
RewriteRule ^(.*)-(.*)-lastpost.html showthread.php?goto=lastpost&t=$2 [L]
RewriteRule ^(.*)-(.*)-newpost.html showthread.php?goto=newpost&t=$2 [L]
RewriteRule ^(.*)-(.*)-lastpost.html showthread.php?goto=lastpost&t=$2 [L]
RewriteRule ^(.*)-(.*)-(.*).html showthread.php?goto=$3&t=$2 [L]
RewriteRule ^(.*)/t-(.*)-(.*)-page-(.*).html showthread.php?t=$3&page=$4 [L]
RewriteRule ^markread.html forumdisplay.php?do=markread [L]
RewriteRule ^(.*)/p-(.*)-(.*).html showthread.php?p=$3 [L]
RewriteRule ^print-(.*)-(.*).html printthread.php?t=$2 [L]
RewriteRule ^sendtofriend-(.*)-(.*).html sendmessage.php?do=sendtofriend&t=$2 [L]
RewriteRule ^search-(.*).html search.php?do=$1 [L]
RewriteRule ^(.*)-(.*)/newthread.php newthread.php?do=newthread&f=$2[L]
RewriteRule ^(.*)/newpostnoquote-(.*).php newreply.php?do=newreply&noquote=1&p=$2[L]
RewriteRule ^(.*)/newpost-(.*).php newreply.php?do=newreply&p=$2[L]
RewriteRule ^p-(.*).html showpost.php?p=$1&postcount=$1 [L]
# Other options
RewriteRule ^siteforums/(.*)-(.*).html forumdisplay.php?f=$2 [L]
RewriteRule ^members/(.*)-(.*).html member.php?u=$2 [L]
RewriteRule ^(.*)/(.*)-(.*).html showthread.php?t=$3 [L]
# Sitemap
RewriteRule ^(sitemap.*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
Immortal
02-14-2006, 06:20 PM
The fix should've worked. If you wait just a wee bit longer, 1.0 stable will be released.
trilljester
02-14-2006, 06:26 PM
yayvb: Try moving this rule:
RewriteRule ^(.*)-(.*)-(.*).html showthread.php?goto=$3&t=$2 [L]
to the bottom (before the vbseo stuff), and see what happens.
yayvb
02-14-2006, 07:56 PM
I tried a bunch of things. I guess it's not the .hataccess file, I believe the problem lies in this code:
/*
#------------------------------
# SHOWTHREAD and page
#------------------------------
$found = preg_match_all('#showthread\.php\?t=([0-9]+)&page=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
// Keep track of page nums that go with tid's
$temp = array();
for($i = 0; $i < $found; $i++)
{
// $temp[<threadid>] = <page>
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid IN($ids)");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "forum WHERE forumid='$fid'");
$fname = urlize($foruminfo['title']);
$page = $temp[$tid];
$output = str_replace("showthread.php?t=$tid&page=$page", "$fname/t-$title-$tid-page-$page.html", $output);
}
*/
}
I tried making small changes and retrying thinking that'll help, but no matter what I do page number links aren't being changed. It's a simple program I imagine, something looks for the URL and rewrites it. Then when you click on the rewritten URLS the .htaccess file redirects you to the RIGHT place if I'm not mistaken.
So if my urls aren't being rewritten then that must mean it's not the .htaccess file right? I will definitely wait for the stable version, I hope it's soon!!! Thanks again.
*EDIT*
I think I found the reason for the problem. It appears that the above code that is in question has comment tags before and after basically commenting all of this code!!! If I take out the 2 comment codes around this code I posted then I get a parse error grrr. The parse error I get after removing the comments codes is: Parse error: parse error, unexpected $ in /home/youradul/public_html/420boards/includes/functions.php(4314) : eval()'d code on line 646
Line 4314 of functions.php appears to be the global_complete hook, so obviously the code that was commented out that I pasted above is erroneous?
robertorg
02-16-2006, 10:45 PM
It's possible to apply that modification to VBAdvanced??
Is recomended any robots.txt?
Good Work!!!! (It's installed, the only issue is VBAdvanced support)
Immortal
02-16-2006, 11:15 PM
I posted a tutorial wayyyy back when. You may want to search the thread for "tutorial" and see if anything bites. It was for custom written rules, I haven't had a chance to play with vBA to see how it does it however. May require some plugin/file changes.
As far as robots.txt is concerned, I'm by far no SEO expert.
/me pokes T2DMan
DavidWilson
02-17-2006, 12:56 AM
Hi, I've looked at the examples and downloaded the code; very easy install compared to Dan's.
One question I have in the installation is the follow:
As per step #3, I can't find the variable $headinclude in the following files:
showthread.php, newreply.php, newthread.php, forumdisplay.php, memberinfo.php
Smiry Kin's
02-17-2006, 01:00 AM
Hi, I've looked at the examples and downloaded the code; very easy install compared to Dan's.
One question I have in the installation is the follow:
As per step #3, I can't find the variable $headinclude in the following files:
showthread.php, newreply.php, newthread.php, forumdisplay.php, memberinfo.php
i think it means the templates?
Immortal
02-17-2006, 01:07 AM
Yup, Styles & Templates, no file modifications needed :)
DavidWilson
02-17-2006, 03:12 AM
Yes, for those of you that don't know, the default template file is located here: /install/vbulletin-style.xml
Custom template files are also *.xml and can be uploaded and imported over existing templates.
Immortal, why not just invoke <base href="$vboptions[bburl]/" /> into the top of the headinclude tempate? IMHO, it's more easier and faster? Am I right?
Brandon Sheley
02-17-2006, 07:19 AM
The fix should've worked. If you wait just a wee bit longer, 1.0 stable will be released.
yeah ! :D
btw, just updated and the problem i was having with long thread and pages appear to be gone, will be running it for the weekend :)
DavidWilson
02-17-2006, 01:04 PM
I installed the script without any issues at first, but I did run into some linking problems on sub forum pages; the breadcrumb links didn't link far enough back in the directory tree structure, usually falling 1 directory shy, therefor there were quite a few broken links through the forum.
I've removed the extension for now, but I'm definitely looking forward to the final version!
ah..long thread...tried to read every single post here..
i had a bitter xeperince
we tried vbranking..we gave up due to probs...it automergerd post..AUTOMATICALLY after a new post or thread.
we droped dean c's re-writer..
yet not use it....found lots using it..n all pobs been solved..
i m curious about Googe/Yahoo sitemap gen....that sitemap generator geneate sitemap ...
hence thie re-writer re-write url to html? does that creates any conflicts?
:S here lots of modicication....
does the current one is complete package?
icare
02-18-2006, 06:26 PM
1) Import product-vrewrite.xml as a product using the plugin system.
2) Upload the .htaccess file to your vB's directory.
Can i just over rite the existing .htaccess file in root with the one you provided with zip file or what should i do. i am bit scared at this part coz i have heard that if you lose your .htaccess file you are hooped. please help a newbie
Immortal
02-19-2006, 12:08 AM
Immortal, why not just invoke <base href="$vboptions[bburl]/" /> into the top of the headinclude tempate? IMHO, it's more easier and faster? Am I right?
Good thinking, never even dawned on me, heh.
I installed the script without any issues at first, but I did run into some linking problems on sub forum pages; the breadcrumb links didn't link far enough back in the directory tree structure, usually falling 1 directory shy, therefor there were quite a few broken links through the forum.
I've removed the extension for now, but I'm definitely looking forward to the final version!
Sounds like you didnt' apply all template changes.
ah..long thread...tried to read every single post here..
i had a bitter xeperince
we tried vbranking..we gave up due to probs...it automergerd post..AUTOMATICALLY after a new post or thread.
we droped dean c's re-writer..
yet not use it....found lots using it..n all pobs been solved..
i m curious about Googe/Yahoo sitemap gen....that sitemap generator geneate sitemap ...
hence thie re-writer re-write url to html? does that creates any conflicts?
:S here lots of modicication....
does the current one is complete package?
A sitemap for vRewrite will be released shortly. You must apply all fixes yourself, until I can be arsed to release 1.0.
Can i just over rite the existing .htaccess file in root with the one you provided with zip file or what should i do. i am bit scared at this part coz i have heard that if you lose your .htaccess file you are hooped. please help a newbie
Could you please post your current .htaccess?
A sitemap for vRewrite will be released shortly. You must apply all fixes yourself, until I can be arsed to release 1.0.
Its nice.Better we wait few days..coz that lotta modification in all this long thread..might messed up..
Regarding Sitemap:
1. Google/Yahoo Sitemap :it creates .xml sitemap that exclusively for Google.
We are using it right now. & it points to *.php Url.
2. RoR Sitemap:It generate .xml sitemap ,its for some common search engine that usually used by www.addme.com 's SE. & Sitemap www.rorweb.com .
here no relation with Google sitemap & ror sitemap.
3.vRewrite[future plan] : Site Map also generate .xml sitemap ,maybe not for google. But as a common
Actaully want to know does the sitemaps(.php) url & re-written (.html)url ,any possibility to conflict like : spider looks for *.php (porbably) urls ,but its find *.html(static) url ?
as we are pissed of on deanc/vbranking...so b4 using it we are a bit in tense.
Hope This vRe-write & Sitemap would be a complete package..for most of the SE.
immortal..in the vb there are no release with a complete system for SEO.
i hope this sitemap will support cornjob.
And Plz Relaese It as early as possible.
sysop2
02-19-2006, 10:12 AM
Hi, its me again.
I saw "last update: 17. February 2006", so i downloaded it again.
But its all the same as at the point i tried it the 1st time. Also the last update on the files in the .zip is 13th of January 2006.
Do i need to read every single post in this thread and apply additional changes which arent in the readme-file to let it work as it should? Or should it work if I simply follow the steps in the readme?
Greetz - ~sysop2~
Immortal
02-19-2006, 01:55 PM
Its nice.Better we wait few days..coz that lotta modification in all this long thread..might messed up..
Regarding Sitemap:
1. Google/Yahoo Sitemap :it creates .xml sitemap that exclusively for Google.
We are using it right now. & it points to *.php Url.
2. RoR Sitemap:It generate .xml sitemap ,its for some common search engine that usually used by www.addme.com 's SE. & Sitemap www.rorweb.com .
here no relation with Google sitemap & ror sitemap.
3.vRewrite[future plan] : Site Map also generate .xml sitemap ,maybe not for google. But as a common
Actaully want to know does the sitemaps(.php) url & re-written (.html)url ,any possibility to conflict like : spider looks for *.php (porbably) urls ,but its find *.html(static) url ?
as we are pissed of on deanc/vbranking...so b4 using it we are a bit in tense.
Hope This vRe-write & Sitemap would be a complete package..for most of the SE.
immortal..in the vb there are no release with a complete system for SEO.
i hope this sitemap will support cornjob.
And Plz Relaese It as early as possible.
I am not releasing the sitemap, someone is releasing it as an extension to their current one.
Hi, its me again.
I saw "last update: 17. February 2006", so i downloaded it again.
But its all the same as at the point i tried it the 1st time. Also the last update on the files in the .zip is 13th of January 2006.
Do i need to read every single post in this thread and apply additional changes which arent in the readme-file to let it work as it should? Or should it work if I simply follow the steps in the readme?
Follow the steps in the readme, and if you look a few pages back, there are two changes you need to apply. vRewrite 1.0 will be released this evening.
As far as the "update" is, there was none. I simply added some legal text to the bottom to prevent users from disturbing vRewrite.
sysop2
02-19-2006, 03:06 PM
As far as the "update" is, there was none. I simply added some legal text to the bottom to prevent users from disturbing vRewrite.Ah, thanks for the Info :)
Looking forward to try out the full 1.0-Release later. But Im not euphoric this time. ;-D
Thank you for all the effort.
Greetz - ~sysop2~
Shoemoney
02-19-2006, 03:14 PM
Great job thanks for taking the time.
xtreme-mobile
02-19-2006, 04:41 PM
ive just tried to install this for the 3rd time but i still get the page can not be displayed message when trying to upload attachments
still no fix for this?
Immortal
02-19-2006, 05:36 PM
It works just fine in every other browser but IE. I cannot fix IE's faults. Just not humanly possible, so no.
thediablo
02-19-2006, 06:58 PM
inmy forum only the first post's are rewrite everything below that is the same.
any suggestions?
xtreme-mobile
02-19-2006, 07:01 PM
It works just fine in every other browser but IE. I cannot fix IE's faults. Just not humanly possible, so no.
ive used older versions of this hack before using IE and never had any problems
Immortal
02-19-2006, 08:03 PM
inmy forum only the first post's are rewrite everything below that is the same.
any suggestions?
Either wait a few more hours for 1.0, or scroll back a few pages where I posted the fix.
ive used older versions of this hack before using IE and never had any problems
Not sure why, it's always done it for a forum I moderate for IE users.
Immortal
02-19-2006, 10:47 PM
Update - 1.0
Instead of taking all that time to type up all the changes, let's just say you should upgrade.
All known bugs were fixed (that I said was going to be fixed). And you now have the option to turn on 301 redirects. This means that all old threads, like showthread.php?t= will redirect to your new vRewritten one.
This hack is now stable. All users that have been waiting to install it, should now be safe to install.
If you find a bug, please let me know so I can fix in the next version.
Upgrade Instructions
Reimport the product, allowing overwrite.
Reupload .htaccess.
That's it! :)
Happy SEOed URLs!
Bhuwan
02-19-2006, 11:17 PM
Update - 1.0
Instead of taking all that time to type up all the changes, let's just say you should upgrade.
All known bugs were fixed (that I said was going to be fixed). And you now have the option to turn on 301 redirects. This means that all old threads, like showthread.php?t= will redirect to your new vRewritten one.
This hack is now stable. All users that have been waiting to install it, should now be safe to install.
If you find a bug, please let me know so I can fix in the next version.
Upgrade Instructions
Reimport the product, allowing overwrite.
Reupload .htaccess.
That's it! :)
Happy SEOed URLs!
Great hack! When trying to view a thread, I get "is_ie" javascript errors.
Immortal
02-19-2006, 11:21 PM
Great hack! When trying to view a thread, I get "is_ie" javascript errors.
Whoa, never heard of that before. Do you have a link?
yayvb
02-19-2006, 11:32 PM
Hi Immortal, I'm really glad to see you have 1.0 out woohoo!!!
After overwriting the .htaccess file and overwriting the old product with the new, I once again have this problem:
http://www.420boards.com/example.gif
I was going to follow the workaround that you had posted here:
https://vborg.vbsupport.ru/showpost.php?p=885524&postcount=316
but it seems like that's giving me an error message if I use that code.
Any ideas? I'm desperate!! :)
ps. Before the 1.0 stable came out, the last one I was using I was able to use the above fix to get everything rewritten properly, the only problem was that only the first page of a multi page thread was being rewritten or working properly. Which was different from the previous bug where my users were reaching incorrect threads. :)
But now the above code fix will not work it appears.
Thanks in advance for any help, this hack is awesome and much needed, but it has to work properly, for now I'll uninstall so that my users don't get confused :)
Immortal
02-19-2006, 11:34 PM
Can you post your global_complete -> vRewrite code?
yayvb
02-19-2006, 11:40 PM
Yeah right now I reverted to what was installed with the latest (ie. no error messages but not rewriting) stable version, but here it is:
Global_Complete
if($vbulletin->options['vRewrite_on'])
{
if($vbulletin->options['vRewrite_forumrewrite'] == "2") {
#------------------------------
# Replace Forums
#------------------------------
$found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
$fid = $matches[1][$i];
if(!array_key_exists($fid, $vbulletin->forumcache))
continue;
$f = $vbulletin->forumcache[$fid];
$fid = $f['forumid'];
$title = urlize($f['title']);
$output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"siteforums/$title-$fid.html\"", $output);
}
}
}
#------------------------------
# Replace Forums
#------------------------------
$found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
$fid = $matches[1][$i];
if(!array_key_exists($fid, $vbulletin->forumcache))
continue;
$f = $vbulletin->forumcache[$fid];
$fid = $f['forumid'];
$title = urlize($f['title']);
$output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"f-$title-$fid.html\"", $output);
}
}
if($vbulletin->options['vRewrite_memberrewrite'] == "2") {
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid='".$vbulletin->db->escape_string($ids)."'");
while($u = $vbulletin->db->fetch_array($res))
{
$username = urlize($u['username']);
$uid = $u['userid'];
$output = str_replace("member.php?u=$uid", "members/$username-$uid.html", $output);
}
}
}
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid='".$vbulletin->db->escape_string($ids)."'");
while($u = $vbulletin->db->fetch_array($res))
{
$username = urlize($u['username']);
$uid = $u['userid'];
$output = str_replace("member.php?u=$uid", "u-$username-$uid.html", $output);
}
}
if(THIS_SCRIPT == 'index') {
#------------------------------
# Replace showthread.php?goto=newpost
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?goto=newpost&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'");
while($n = $vbulletin->db->fetch_array($res))
{
$title = urlize($n['title']);
$tid = $n['threadid'];
$output = str_replace("<a href=\"showthread.php?goto=newpost&t=$tid\"", "<a href=\"$title-$tid-newpost.html\"", $output);
}
}
#------------------------------
# Replace showthread.php?goto=lastpost
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?goto=lastpost&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'");
while($n = $vbulletin->db->fetch_array($res))
{
$title = urlize($n['title']);
$tid = $n['threadid'];
$output = str_replace("<a href=\"showthread.php?goto=lastpost&t=$tid\"", "<a href=\"$title-$tid-lastpost.html\"", $output);
}
}
}
if(THIS_SCRIPT == 'forumdisplay' OR 'index') {
#------------------------------
# Replace Last Post User (Forum)
#------------------------------
$found = preg_match_all('#<a href="member\.php\?find=lastposter&f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT
f.forumid,
u.userid, u.username
FROM
" . TABLE_PREFIX . "forum f,
" . TABLE_PREFIX . "user u
WHERE
forumid='".$vbulletin->db->escape_string($ids)."'
AND u.username = f.lastposter");
while($f = $vbulletin->db->fetch_array($res))
{
$lp = urlize($f['username']);
$lpid = $f['userid'];
$fid = $f['forumid'];
$output = str_replace("<a href=\"member.php?find=lastposter&f=$fid\"", "<a href=\"u-$lp-$lpid.html\"", $output);
}
}
}
if(THIS_SCRIPT == 'forumdisplay') {
#------------------------------
# Replace Last Post User (Thread)
#------------------------------
$found = preg_match_all('#<a href="member\.php\?find=lastposter&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT
f.forumid,
u.userid, u.username
FROM
" . TABLE_PREFIX . "forum f,
" . TABLE_PREFIX . "user u
WHERE
forumid='".$vbulletin->db->escape_string($ids)."'
AND u.username = f.lastposter");
while($f = $vbulletin->db->fetch_array($res))
{
$lp = $f['lastposter'];
$lp = urlize($f['username']);
$lpid = $f['userid'];
$tid = $f['threadid'];
$output = str_replace("<a href=\"member.php?find=lastposter&t=$tid\"", "<a href=\"u-$lp-$lpid.html\"", $output);
}
}
}
#-----------------------------------
# DO NOT REMOVE OTHERWISE YOU
# WILL BE SENT A DMCA FOR COPYRIGHT
# INFRINGEMENT YOU MAY NOT USE THIS
# PLUGIN WITHOUT THIS LINE OF CODE
# IF YOU WISE TO REMOVE THIS AND
# ADD IT TO YOUR STYLE, FEEL FREE
# AS LONG AS THE COPYRIGHT REMAINS
#-----------------------------------
$output = str_replace("</body>",'<div align="center" class="smallfont">SEOed URLs completed by <a href="http://www.techhelpforum.com">Tech Help Forum</a>.</div></body>',$output);
if($vbulletin->options['vRewrite_showthreadrewrite'] == "2") {
#------------------------------
# SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->forumcache[$fid];
$fname = urlize($foruminfo['title']);
$fname = str_replace("-","",$fname);
$title = str_replace("-"," ",$title);
$output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/$title-$tid.html\"", $output);
}
}
}
#------------------------------
# SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->forumcache[$fid];
$fname = urlize($foruminfo['title']);
$output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/t-$title-$tid.html\"", $output);
}
}
#------------------------------
# SHOWTHREAD and page
#------------------------------
$found = preg_match_all('#showthread\.php\?t=([0-9]+)&page=([0-9]+)#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
// Keep track of page nums that go with tid's
$temp = array();
for($i = 0; $i < $found; $i++)
{
// $temp[<threadid>] = <page>
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$fid = $t['forumid'];
$foruminfo = $vbulletin->forumcache[$fid];
$fname = urlize($foruminfo['title']);
$page = $temp[$tid];
$output = str_replace("showthread.php?t=$tid&page=$page", "$fname/t-$title-$tid-page-$page.html", $output);
}
}
if(THIS_SCRIPT == 'showthread') {
#------------------------------
# showpost
#------------------------------
$found = preg_match_all('#<a href="showpost\.php\?p=([0-9]+)&postcount=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT postid, title FROM " . TABLE_PREFIX . "post WHERE postid='".$vbulletin->db->escape_string($ids)."'");
while($p = $vbulletin->db->fetch_array($res))
{
$pid = $p['postid'];
$postcount = $temp[$pid];
$output = str_replace("<a href=\"showpost.php?p=$pid&postcount=$postcount\"", "<a href=\"p-$pid.html\"", $output);
}
}
#------------------------------
# Print SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="printthread\.php\?t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$output = str_replace("<a href=\"printthread.php?t=$tid\"", "<a href=\"print-$title-$tid.html\"", $output);
}
}
#------------------------------
# Email SHOWTHREAD
#------------------------------
$found = preg_match_all('#<a href="sendmessage\.php\?do=sendtofriend&t=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'");
while($t = $vbulletin->db->fetch_array($res))
{
$title = urlize($t['title']);
$tid = $t['threadid'];
$output = str_replace("<a href=\"sendmessage.php?do=sendtofriend&t=$tid\"", "<a href=\"sendtofriend-$title-$tid.html\"", $output);
}
}
#------------------------------
# Prev/Next Threads
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)&goto=nextnewest"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$title = urlize($t['title']);
$fid = $t['forumid'];
$f = $vbulletin->forumcache[$fid];
$fname = urlize($f['title']);
$output = str_replace("<a href=\"showthread.php?t=$tid&goto=nextnewest\"", "<a href=\"$fname/$title-$tid-nextnewest.html\"", $output);
}
}
#------------------------------
# Prev/Next Threads
#------------------------------
$found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)&goto=nextoldest"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT threadid, title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$title = urlize($t['title']);
$fid = $t['forumid'];
$f = $vbulletin->forumcache[$fid];
$fname = urlize($f['title']);
$output = str_replace("<a href=\"showthread.php?t=$tid&goto=nextoldest\"", "<a href=\"$fname/$title-$tid-nextoldest.html\"", $output);
}
}
}
#------------------------------
# New Thread
#------------------------------
$found = preg_match_all('#<a href="newthread\.php\?do=newthread&f=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid='".$vbulletin->db->escape_string($ids)."'");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$output = str_replace("<a href=\"newthread.php?do=newthread&f=$fid\"", "<a href=\"$title-$fid/newthread.php\"", $output);
}
}
#------------------------------
# New Post
#------------------------------
$found = preg_match_all('#<a href="newreply\.php\?do=newreply&noquote=1&p=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT p.threadid, p.postid, t.title, t.forumid FROM " . TABLE_PREFIX . "post p, " . TABLE_PREFIX . "thread t WHERE p.postid='".$vbulletin->db->escape_string($ids)."' AND t.threadid = p.threadid");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$pid = $t['postid'];
$title = urlize($t['title']);
$fid = $t['forumid'];
$f = $vbulletin->forumcache[$fid];
$fname = urlize($f['title']);
$output = str_replace("<a href=\"newreply.php?do=newreply&noquote=1&p=$pid\"", "<a href=\"$fname/newpostnoquote-$pid.php\"", $output);
}
}
#------------------------------
# New Post
#------------------------------
$found = preg_match_all('#<a href="newreply\.php\?do=newreply&p=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT p.threadid, p.postid, t.title, t.forumid FROM " . TABLE_PREFIX . "post p, " . TABLE_PREFIX . "thread t WHERE p.postid='".$vbulletin->db->escape_string($ids)."' AND t.threadid = p.threadid");
while($t = $vbulletin->db->fetch_array($res))
{
$tid = $t['threadid'];
$pid = $t['postid'];
$title = urlize($t['title']);
$fid = $t['forumid'];
$f = $vbulletin->forumcache[$fid];
$fname = urlize($f['title']);
$output = str_replace("<a href=\"newreply.php?do=newreply&p=$pid\"", "<a href=\"$fname/newpost-$pid.php\"", $output);
}
}
#------------------------------
# Search
#------------------------------
$found = preg_match_all('#<a href="search\.php\?searchid=([0-9]+)"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT userid, searchid FROM " . TABLE_PREFIX . "search WHERE searchid='".$vbulletin->db->escape_string($ids)."'");
while($s = $vbulletin->db->fetch_array($res))
{
$userid = $s['userid'];
$searchid = $s['searchid'];
$output = str_replace("search.php?searchid=$searchid", "search-$userid-$searchid.html", $output);
}
}
if(THIS_SCRIPT == 'memberlist') {
#------------------------------
# Memberlist
#------------------------------
$found = preg_match_all('#<a href="memberlist\.php\?ltr=([A-Z]+)&pp=0&sort=username&order=asc"#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
for($i = 0; $i < $found; $i++)
{
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
$ltr = $matches[1][$i];
$output = str_replace("<a href=\"memberlist.php?ltr=$ltr&pp=0&sort=username&order=a sc\"", "<a href=\"memberlist-$ltr-0-username-asc.html\"", $output);
}
$ids = implode(',', $ids);
}
}
if(THIS_SCRIPT == 'forumdisplay') {
#------------------------------
# Forum Pages
#------------------------------
$found = preg_match_all('#forumdisplay\.php\?f=([0-9]+)&page=([0-9]+)&order=desc#i', $output, $matches);
if($found)
{
// Build an array of ID's
$ids = array();
// Keep track of page nums that go with fid's
$temp = array();
for($i = 0; $i < $found; $i++)
{
// $temp[<forumid>] = <page>
$temp[ $matches[1][$i] ] = $matches[2][$i];
if(is_numeric($matches[1][$i]))
$ids[] = $matches[1][$i];
}
$ids = implode(',', $ids);
// Go through each
$res = $vbulletin->db->query_read("SELECT title, forumid FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)");
while($f = $vbulletin->db->fetch_array($res))
{
$title = urlize($f['title']);
$fid = $f['forumid'];
$page = $temp[$fid];
$output = str_replace("forumdisplay.php?f=$fid&page=$page&order=desc", "f-$title-desc-$page.html", $output);
}
}
}
#------------------------------
# misc pages
#------------------------------
$output = str_replace("search.php?do=getnew","search-getnew.html",$output);
$output = str_replace("search.php?do=getdaily","search-getdaily.html",$output);
$output = str_replace("forumdisplay.php?do=markread","markread.html",$output);
}
/**
* Turn a string into a URL friendly string
*
* @param string $txt The string to work on
* @return string The new string
*/
function urlize($txt)
{
$txt = unaccent($txt);
$txt = html_entity_decode($txt);
$txt = str_replace(' ', '-', $txt);
$txt = preg_replace('#[^a-zA-Z0-9_\-]+#', '', $txt);
$txt = preg_replace('#[\-]+#', '-', $txt);
return strtolower($txt);
}
/**
* Turn accented characters into normal characters
*
* @param string $txt The string to remove the accents from
* @return string Your new clean string
*/
function unaccent($txt)
{
$trans = get_html_translation_table(HTML_ENTITIES);
foreach($trans as $literal => $entity)
{
if(ord($literal) >= 192)
{
$search[] = $literal;
$replace[] = substr($entity, 1, 1);
}
}
return str_replace($search, $replace, $txt);
}
I'll leave it running on my board right now. It's just like the picture shows. :)
Bhuwan
02-20-2006, 12:02 AM
The problem is i can't add the following code to my styles :-(
<if THIS_SCRIPT != 'index'>
<base href="$vboptions[bburl]/" />
</if>
it freezes attempting to add this and the server load jumps through the roof!
, load average: 11.67, 9.81, 8.45
Immortal
02-20-2006, 12:13 AM
yayvb -> I'll look into it...it should work.
bchawla -> Let me double check, but I thought that was right :S
Bhuwan
02-20-2006, 12:27 AM
yayvb -> I'll look into it...it should work.
bchawla -> Let me double check, but I thought that was right :S
Thanks!
its wierd -- if I attempt to add that code to a a style from vbDesigns.de, it adds the code fine
HOwever, if I add the code to a vb default style, it freezes
My serv er loads are really high now, not dropping- i dont want to reboot the server - I am hopng Rackspace can fix the issue (w/o reboot)
Immortal
02-20-2006, 12:32 AM
Ah, got it.
<if condition="THIS_SCRIPT != 'index'">
<base href="$vboptions[bburl]/" />
</if>
I'm updating install.html now. Thanks :)
Bhuwan
02-20-2006, 12:49 AM
Ah, got it.
<if condition="THIS_SCRIPT != 'index'">
<base href="$vboptions[bburl]/" />
</if>
I'm updating install.html now. Thanks :)
thanks for your help! :) early results from my side show that was a tad bit b etter :)
Immortal
02-20-2006, 12:59 AM
Thanks for that...I thought I had it correct, but apprently not. :)
Updated ZIP as well.
yayvb
02-20-2006, 01:02 AM
Eek, let me get back to you in a few minutes. Apparently this time I saved the files into a directory called newvrewrite and last time I saved them into a directory called vrewrite-new so this time when I saw that my .htaccess anx .xml was the same, it was because I am importing everything from before!!! :)
Let me give the "New" LMAO files a whirl and I'll let you know what I find!! lol
But I am having trouble with adding the above little code snipet to the headinclude template. It times out or whatever and then I see no change.
yayvb
02-20-2006, 01:14 AM
Everything on the front page looked good, but I just noticed the links on the front are being rewritten properly, but when you click on them you don't go to where it says you should go, you end up at a different random topic altogether. I just disabled so don't go for a reference, but when you hover a link it shows a valid rewritten .html url, but when you click it it brings you to different ones, but not the right one.
*EDIT* I am very excited that it looks like it will be working for me soon!! I have a feeling it's not just me or my server where the links are going to the wrong places. It looks like maybe only the the thread links on forumhome
Immortal
02-20-2006, 01:37 AM
But I am having trouble with adding the above little code snipet to the headinclude template. It times out or whatever and then I see no change.
Make sure you are using the new one.
Everything on the front page looked good, but I just noticed the links on the front are being rewritten properly, but when you click on them you don't go to where it says you should go, you end up at a different random topic altogether. I just disabled so don't go for a reference, but when you hover a link it shows a valid rewritten .html url, but when you click it it brings you to different ones, but not the right one.
*EDIT* I am very excited that it looks like it will be working for me soon!! I have a feeling it's not just me or my server where the links are going to the wrong places. It looks like maybe only the the thread links on forumhome
Weird, can you reproduce it on my forums? And provide a link, please?
yayvb
02-20-2006, 02:06 AM
I was able to get the code snipet to work, it seemed I posted the message right after you posted or something. :) So I was able to add those 3 lines to my headinclude.
Regarding the links bringing you to somewhere you aren't expecting to go, you said I can try to reproduce it? All I have to do is hover my mouse on the urls on the front to see that they work and then click to see that I go somewhere else.
(It may just be the ones that have NEWPOST on the front - clicking them brings me to the wrong post on my board.)
*EDIT*
I tried your board techhelpforum I see a link that goes to a 404 (http://www.techhelpforum.com/jlcndcs-hjt-log-2910-newpost.html) the rest go to the wrong location just like I was saying with mine!!!! ;)
More examples on your site having my problem:
http://www.techhelpforum.com/the-old-desktop-background-trick-2788-newpost.html (brings you to http://www.techhelpforum.com/resolved-hjt-logs/t-hijackthis-log-please-advise-help-651.html)
http://www.techhelpforum.com/site-rules-168-newpost.html (brings you to http://www.techhelpforum.com/site-rules/t--.html) you may want to check these out... just click on any link on your forumhome page, the very top one may work, but try the bottomish ones.
yayvb
02-20-2006, 03:44 AM
Immortal,
Your site is experiencing the same thing as mine, hopefully you can fix the problem. It doesn't just look that way for me or something right?
The forums that have the newpost in the URL on the front page go to the wrong place.
yayvb
02-20-2006, 05:02 AM
I think I found something interesting:
If vrewrite is enabled then when I click on the links I am brought to other rewritten forums (but like I said I only see this problem happening with the newpost links on the forumhome front page).
If I enable it, refresh the main page so that all the links are rewritten, but instead of clicking a link and going to the wrong place, I disable the hack in another browser, then when I click the same rewritten link, I am actually brought to the right place. I tested this several times. So this tells me that the .htaccess file is working properly and the problem lies within the hack itself.
:) Hope I helped atleast a little.
*Edit*
Another interesting finding is that if while enabled on your site (and I'm sure mine too) if you have take a rewritten (NEWPOST) url like this one: http://www.techhelpforum.com/google-working-on-desktop-linux-2860-newpost.html
and for instance just change the number to a number lower, you go to a different (but still wrong) forum. Does that help?
nintendo
02-20-2006, 07:27 AM
If you find a bug, please let me know so I can fix in the next version.
Creating a reply generated a 404 error page.
forumpostersunion.com/test-board/t-test-92-page.html#post623
RewriteRule ^([^.]+)/t\-([^.]+)\-([^.]+)\-page\.html$ showthread.php?t=$3&page=$4&is_vrewrite=yes [L]
fixed it. (For older apache versions, not having a \ before - or a period in the code for the new URL can generate an Internel Server Error message, a $ should be at the end of the code for the new URL, and security wise, ([^.]+) is better.)
RewriteEngine On
RewriteBase /
RewriteRule ^([^.]+)/t\-([^.]+)\-([^.]+)/go=([^.]+)$ showthread\.php?t=$3&goto=$4&is_vrewrite=yes [L]
RewriteRule ^([^.]+)/p\-([^.]+)\-([^.]+).html$ showthread\.php?p=$3&is_vrewrite=yes [L]
RewriteRule ^f\-([^.]+)\-([^.]+)\-page([^.]+).html$ forumdisplay\.php?f=$2&page=$3&order=desc&is_vrewrite=yes [L]
RewriteRule ^f\-([^.]+)\-([^.]+).html/page([^.]+)daysprune([^.]+)\-order([^.]+)\-sort([^.]+)$ forumdisplay.php?f=$2&page=$3daysprune=$4&order=$5&sort=$6&is_vrewrite=yes [L]
RewriteRule ^f\-([^.]+)\-([^.]+).html/daysprune([^.]+)\-order([^.]+)\-sort([^.]+)$ forumdisplay\.php?f=$2&daysprune=$3&order=$4&sort=$5&is_vrewrite=yes [L]
RewriteRule ^f\-([^.]+)\-([^.]+).html$ forumdisplay\.php?f=$2&is_vrewrite=yes [L]
RewriteRule ^u\-([^.]+)\-([^.]+).html$ member\.php?u=$2&is_vrewrite=yes [L]
RewriteRule ^([^.]+)\-([^.]+)\-newpost\.html$ showthread.php?goto=newpost&t=$2 [L]
RewriteRule ^([^.]+)/t\-([^.]+)\-([^.]+)\-page([^.]+)\.html$ showthread.php?t=$3&page=$4&is_vrewrite=yes [L]
RewriteRule ^([^.]+)/t\-([^.]+)\-([^.]+)\-page\.html$ showthread.php?t=$3&page=$4&is_vrewrite=yes [L]
RewriteRule ^([^.]+)/t\-([^.]+)\-([^.]+)\.html$ showthread.php?t=$3&is_vrewrite=yes [L]
RewriteRule ^markread.html$ forumdisplay\.php?do=markread [L]
RewriteRule ^([^.]+)/p\-([^.]+)\-([^.]+)\.html#([^.]+)$ showthread.php?p=$3#post$4 [L]
RewriteRule ^print\-([^.]+)\-([^.]+)\.html$ printthread.php?t=$2 [L]
RewriteRule ^sendtofriend\-([^.]+)\-([^.]+)\.html$ sendmessage.php?do=sendtofriend&t=$2 [L]
RewriteRule ^search\-([^.]+)\.html$ search.php?do=$1 [L]
RewriteRule ^([^.]+)\-([^.]+)/newthread\.php$ newthread.php?do=newthread&f=$2 [L]
RewriteRule ^([^.]+)/newpostnoquote\-([^.]+)\.php$ newreply.php?do=newreply&noquote=1&p=$2 [L]
RewriteRule ^([^.]+)/newpost\-([^.]+)\.php$ newreply.php?do=newreply&p=$2 [L]
RewriteRule ^p\-([^.]+)\.html$ showpost.php?p=$1&postcount=$1 [L]
nintendo
02-20-2006, 11:14 AM
Two other bugs....
php-duplicate-content-removal-80-newpost.html
goes to
scripts-and-coding/t--.html
(All most all boards with only one thread go to that type of URL.)
If you have a forum linking to a URL on the same domain that is a mod to vBulletin, like the directory hack, it links to
.com/browselinks.php?c=5
instead of
.com/links/browselinks.php?c=5
The cause of that error is
<if condition="THIS_SCRIPT != 'index'"> <base href="$vboptions[bburl]/" /> </if>
trilljester
02-20-2006, 02:27 PM
Confirming your bug reports, nintendo. I'm having the same newpost error as mentioned.
I've had to temporarily disable this, I've gotten 3 emails from users already complaining about wrong links. I've got faith in ya Immortal, though, you'll get it fixed!
Immortal
02-20-2006, 03:03 PM
Thanks, I'll take a look at it. Not sure why it's doing that either.
hbalagh1
02-20-2006, 03:56 PM
this is agreat, how ever i have an error with one of my user names
Nicole'sLilPetites is the username and when clicked on to view profile it comes up with a not registered user ....the url comes up as http://www.mydomain.com/u--.html
yayvb
02-20-2006, 04:47 PM
Immortal don't forget to take a look at your own site to see that the newpost url's on the front page are bringing users to everywhere but their intended destination.
Immortal
02-20-2006, 05:02 PM
I didn't forget (https://vborg.vbsupport.ru/showpost.php?p=905572&postcount=447) ;)
yayvb
02-20-2006, 05:15 PM
ok and I probably don't have to 2nd this, but I just logged into my site to see that people messaged me about the gallery not working. Reason being, the headinclude if statement: <if condition="THIS_SCRIPT != 'index'"> <base href="$vboptions[bburl]/" /> </if> was making it so that the gallery files are trying to be found in the root directory, but they're in the gallery directory.
I removed the if statement. Thanks for working so hard on this Immortal, I wish your big release was completely bug free so that you didn't have to do this figuring out the problem again. :) But I'm sure we all appreciate your hard work on this project.
Immortal
02-20-2006, 05:39 PM
Ugh, heh. Now I see why I shouldn't of used headerinclude. I guess I'll change the if around to something more appropriate or just have it stuck back in those templates.
Brandon Sheley
02-20-2006, 06:17 PM
hows this coming along ?
Bhuwan
02-20-2006, 07:05 PM
"Mark Forums Read" doesn't work
Invalid Forum specified. If you followed a valid link, please notify the administrator
MortysTW
02-20-2006, 07:34 PM
You guys rule! I've been watching this thread but waiting for the stable release. And here it is and I installed it.
Only suggestion I'd give is in the instructions you say
3) In headerinclude, find:
<meta http-equiv="Content-Type" content="text/html; charset=$stylevar[charset]" />
Add below that:
<if condition="THIS_SCRIPT != 'index'"> <base href="$vboptions[bburl]/" /> </if>
I recommend adding the note that HEADERINCLUDE is a TEMPLATE. Not everyone using vB knows what they are doing. The newbies will be running back here asking what to do.
Also you have
Note: If you run your vB on a directory from a subdomain or root ex: http:///www.yoursite.com/forum or http://subdomain.site.com/forum you will need to open up the .htacess file and change Rewrite Base / to Rewrite Base /yourdir
I'd slip that in as part of Step 2 with the installation. Especially for those people doing this to a live board. Their site is crashed if they are like me and not good at reading ALL instructions and notes before installing something. I didn't see that NOTE until after I went running back to the instructions wondering why my site is crashed.
No biggie since I have a testing server that I tried this on.
Again, thank you a million times. I shall name my first born child vRewrite :surprised:
Immortal
02-20-2006, 07:40 PM
"Mark Forums Read" doesn't work
Invalid Forum specified. If you followed a valid link, please notify the administrator
Workin' just fine for me? :ninja:
Immortal
02-20-2006, 07:42 PM
You guys rule! I've been watching this thread but waiting for the stable release. And here it is and I installed it.
Only suggestion I'd give is in the instructions you say
3) In headerinclude, find:
<meta http-equiv="Content-Type" content="text/html; charset=$stylevar[charset]" />
Add below that:
<if condition="THIS_SCRIPT != 'index'"> <base href="$vboptions[bburl]/" /> </if>
I recommend adding the note that HEADERINCLUDE is a TEMPLATE. Not everyone using vB knows what they are doing. The newbies will be running back here asking what to do.
Also you have
I'd slip that in as part of Step 2 with the installation. Especially for those people doing this to a live board. Their site is crashed if they are like me and not good at reading ALL instructions and notes before installing something. I didn't see that NOTE until after I went running back to the instructions wondering why my site is crashed.
No biggie since I have a testing server that I tried this on.
Again, thank you a million times. I shall name my first born child vRewrite :surprised:
Glad you got it working. I've updated the install.html for the next version to say that. Just be watchful for 1.0.1 being released. May be today, or sometime later in this week :)
MortysTW
02-20-2006, 08:14 PM
He's right about that Mark Forums read thing. If you use the QUICK LINKS on the forum index, it results to a page called /f--.html Which is a non existent page.
Immortal
02-20-2006, 08:57 PM
It's markread.html for me? :?
ZippySLC
02-20-2006, 09:32 PM
Has anybody had their users complain that the SEO'd links go to wrong threads?
I enabled the mod and had no problems with it personally. I had two users complain to me that if they clicked links to threads that occasionally they would be directed to wrong threads.
SouthernTn
02-20-2006, 09:46 PM
I wonder if the url problem only results in boards that are already active.. for an example, Im thinking about installing this on a board that is brand new and no posts at all.
MortysTW
02-20-2006, 09:48 PM
It's markread.html for me? :?
When I drop the Quick Links dropdown menu, then hover over the Mark Forums Read link, I see that it says the link is /markread.html.
But after I click it and it runs through its process and the page reloads, it goes to /f--.html
I tested WITH new posts that could be marked as READ and also tried it when there were NO NEW posts to see if clicking MARKED READ when everything was read would result different. But they do the same.
I get the /f--.html
Immortal, let me know if you want access to my test forum to witness this
MortysTW
02-20-2006, 09:50 PM
I wonder if the url problem only results in boards that are already active.. for an example, Im thinking about installing this on a board that is brand new and no posts at all.
Yes, its happening on a brand new forum. I created a brand new test forum on my test server specifically to try this mod.
Quite honestly, as beneficial as this is, a little error like this is no big deal. haha Cuz even though it has a nasty vbmessage after clicking, its still marking those threads as READ.
Immortal
02-20-2006, 10:06 PM
Please, Morty if you wouldn't mind. I cannot duplicate it at all, with new posts on THF. Using the Quick Links or the one close to the footer.
As far as the new posts are concerned...it only does it every so often. Which is why I have not noticed it on my board. I have been running this version for a few weeks now, so it is still safe even with a minor bug. I'll try and get a new release fixing this sometime this week.
MortysTW
02-20-2006, 11:09 PM
Check your PM's. I created an account for ya!
when members click on the next page you either get redirection limit for this URL exceeded or they get a completly different post that the one they were on?
trilljester
02-21-2006, 01:31 PM
Immortal: Maybe you should release this to the pirated VB sites, it'll mess their users up so much, maybe they'll buy VB!
Immortal
02-21-2006, 06:03 PM
Immortal: Maybe you should release this to the pirated VB sites, it'll mess their users up so much, maybe they'll buy VB!
What in the world are you talking about?
I am getting a problem when you click on the little arrow next to a members name to take you to the last post it takes you to the last thread in the forum instead of the last post in the thread
Immortal
02-21-2006, 06:09 PM
That is related to the new post error :)
Is that something your working on?
trilljester
02-21-2006, 07:09 PM
What in the world are you talking about?
In your first post:
I do not want this spread to pirated users. Please stop piracy and do not share the source outside of this thread and vB.org/com. Thanks.
I'm saying release this to them with the messed up links, it'll screw their site up, and it'll force them to buy VB!
Immortal
02-21-2006, 09:09 PM
In your first post:
I'm saying release this to them with the messed up links, it'll screw their site up, and it'll force them to buy VB!
And how and why would it "screw their site up"? I've been running it perfectly fine for weeks...
trilljester
02-21-2006, 09:23 PM
And how and why would it "screw their site up"? I've been running it perfectly fine for weeks...
I had to disable this mod because users were complaining about clicking links to threads and being taken to the wrong thread. Several others have mentioned this bug. It's a crippler.
Immortal
02-21-2006, 09:26 PM
I had to disable this mod because users were complaining about clicking links to threads and being taken to the wrong thread. Several others have mentioned this bug. It's a crippler.
And I've been working on it? So why are you coming to the thread and +++++ing about it? Yah, that'll help speed things up, +++++ and +++++ until the developer gets fed up with it!
I do not get charge for this, I have my own client work that I must complete, my own day job, and my own life. "Chairty" and "freebie" work goes at bottom of the pile, so don't like it, don't use vRewrite and don't freaking +++++ about it. Because, honestly, I do not care a single thing about what you think or others. Bug reports, and support reports, fine. Just skim the thread first. But when you +++++ about something free, then I got a problem.
My suggestion? Suck it up, or don't use it. I really don't want to listen to you.
trilljester
02-22-2006, 02:09 AM
Whoa dude, take a chill pill, I was just making a joke. Didn't realize you took your "charity" work so personal.
Unexplained.tv
02-22-2006, 02:16 AM
Your comments were un-called for, Immortal and very un-professional. It was easy to see that the other member was merely Joking, take a chill pill.
And I've been working on it? So why are you coming to the thread and +++++ing about it? Yah, that'll help speed things up, +++++ and +++++ until the developer gets fed up with it!
I do not get charge for this, I have my own client work that I must complete, my own day job, and my own life. "Chairty" and "freebie" work goes at bottom of the pile, so don't like it, don't use vRewrite and don't freaking +++++ about it. Because, honestly, I do not care a single thing about what you think or others. Bug reports, and support reports, fine. Just skim the thread first. But when you +++++ about something free, then I got a problem.
My suggestion? Suck it up, or don't use it. I really don't want to listen to you.
MortysTW
02-22-2006, 03:03 AM
Okay everyone. Group hug. This needs to be dropped and ended. No need for this thread to go to waist.
Let me know if there is anything I can do to help Immortal with this issue. I'm not very good with code but alright with the templates. Let me know if you need anything on my test server. I believe I gave you plenty of admin options.
Bhuwan
02-22-2006, 05:31 PM
I haven't seen any of "complainers" say thank you once to Immortal for the work this person has done.
Like the last poster siad, group hug -- lets move on and enjoy this great hack!
@Immortal@
Sorry about my last post, it wasn;t very imformative, as I was too lazy haha.ANyways,
I am logged in as a guest on your forum and when attempting to click on "Mark Forums read" at the bottom of page, i get this error
Invalid Forum specified. If you followed a valid link, please notify the administrator
Iv'e tried to take the extact same steps on vBulletin.com, and it does what its supposed to then redireects me back to the main page (where I originally started)
Next I attempted this feature as a real user on your forum
I get the same error when trying to hit Mark Forums Read
Invalid Forum specified. If you followed a valid link, please notify the administrator
Iv;e attached an image so you can see which option I am clicking.
MortysTW
02-22-2006, 09:53 PM
I haven't seen any of "complainers" say thank you once to Immortal for the work this person has done.
Like the last poster siad, group hug -- lets move on and enjoy this great hack!
@Immortal@
Sorry about my last post, it wasn;t very imformative, as I was too lazy haha.ANyways,
I am logged in as a guest on your forum and when attempting to click on "Mark Forums read" at the bottom of page, i get this error
Invalid Forum specified. If you followed a valid link, please notify the administrator
Iv'e tried to take the extact same steps on vBulletin.com, and it does what its supposed to then redireects me back to the main page (where I originally started)
Next I attempted this feature as a real user on your forum
I get the same error when trying to hit Mark Forums Read
Invalid Forum specified. If you followed a valid link, please notify the administrator
Iv;e attached an image so you can see which option I am clicking.
Immortal is already aware of this and is currently trying to sort it out. I have the same thing occur on my TEST vb installation and have given Immortal an account on this test vb and he's troubleshooting it.
Maybe even as you are reading this. :nervous:
Hanif
02-22-2006, 10:04 PM
GO Immortal GO !!!
Will donate once I have a few pennies in the bank account. Look forward to the revised and complete version.
Kind regards,
Hanif
Bhuwan
02-23-2006, 01:36 AM
Immortal is already aware of this and is currently trying to sort it out. I have the same thing occur on my TEST vb installation and have given Immortal an account on this test vb and he's troubleshooting it.
Maybe even as you are reading this. :nervous:
Thanks for the update! I just wanted to b e sure he had all the information :)
redlabour
02-23-2006, 06:54 AM
After i installed this Hack every Link gets me to a wrong thread - anyone else have this Problem ? I use 3.5.4 .
Update :
Well i see - is there a chance to fix this ?
Bhuwan
02-23-2006, 12:11 PM
After i installed this Hack every Link gets me to a wrong thread - anyone else have this Problem ? I use 3.5.4 .
Update :
Well i see - is there a chance to fix this ?
I am sure Immortal is working on this - we just have to be patient :)
Immortal
02-23-2006, 06:13 PM
Whoa dude, take a chill pill, I was just making a joke. Didn't realize you took your "charity" work so personal.
Yes. When you get less then 4 hours of sleep a day, work over 3 jobs just to support yourself, and do this on the side, you don't have much "free" time. I take what I do seriously, as I do with everything.
Your comments were un-called for, Immortal and very un-professional. It was easy to see that the other member was merely Joking, take a chill pill.
No it was not easy. He did not use any signs of showing a joke, such as a smilie. Or even an attempt at one. All it was, was text. It was very hard, if it was, to tell it was a joke. For the people who know me, I'm not the joking type person.
If you're mean to me, I'll be mean back. If you be sarcastic, I'll be one right back at ya. I don't have time for people who waste my time. I do not represent any company here, so I honestly do not care what you think of me. You are entitled to your own opinion, I just don't care what your opinion is.
Let me know if there is anything I can do to help Immortal with this issue. I'm not very good with code but alright with the templates. Let me know if you need anything on my test server. I believe I gave you plenty of admin options.
I thank you for the kind offer. :)
I am currently working on the issue. As far as "Mark Read" is concerned, that is only for IE it seems. Fx is just doing it fine for me, however, I'll try and work on a fix for it.
Bhuwan
02-24-2006, 01:07 AM
Quote:
Is this plugin compatible with "vBSEO Google/Yahoo Sitemap Generator for vBulletin 3.5.x & vBulletin 3.0.x"??
Not currently, sorry.
Do you think this will be compatible in the future? :))
Immortal
02-24-2006, 01:17 AM
Do you think this will be compatible in the future? :))
Someone converted their sitemap generator to be compatible with vRewrite, no idea when/if he'll release it.
But with the latest release, it redirects all the old URLs, so you should be fine.
Bhuwan
02-24-2006, 01:18 AM
Someone converted their sitemap generator to be compatible with vRewrite, no idea when/if he'll release it.
But with the latest release, it redirects all the old URLs, so you should be fine.
Sweet, thanks a lot man!
I hope this person releases the generator compatible with vRewrite :)
redlabour
02-24-2006, 05:10 AM
Are both ways working then ?
Bhuwan
02-24-2006, 05:02 PM
:o :o :o Is this hack safe to install?? :o :o
Bhuwan
02-24-2006, 06:42 PM
Immortal-
I think you've already addresses this known issue, but i'll give some additional details in case you don't have this already:
if your using INTERNET EXPLORER and you directly click on a THREAD from index.php (forum home), you are led to the wrong thread.
What is more awkward about this behaviour is that it happens only in IE -- if I use firefox or Nutscrape, it works just fine.
I've repreoduced this on your site as well.
Thanks!
Immortal
02-24-2006, 06:47 PM
It only happens a few times with Firefox.
As I've said, I've been using it for weeks on my site. It's just a minor nuisance to me, so I do believe it is safe to install, but it's up to you.
Bhuwan
02-24-2006, 06:50 PM
It only happens a few times with Firefox.
As I've said, I've been using it for weeks on my site. It's just a minor nuisance to me, so I do believe it is safe to install, but it's up to you.
I've taken the plunge
I noticed in the htaccess file you dont have the "&vrewrite=yes" in the "-newpost.html" -> showthread. portion. Could this be a possible cause? I've added this to my site and now the only problem I have is if the thread is closed to the public - other threads go to the correct topic.
Bhuwan
02-24-2006, 06:51 PM
I've taken the plunge
I noticed in the htaccess file you dont have the "&vrewrite=yes" in the "-newpost.html" -> showthread. portion. Could this be a possible cause? I've added this to my site and now the only problem I have is if the thread is closed to the public - other threads go to the correct topic.
RewriteRule ^(.*)-(.*)-newpost.html showthread.php?goto=newpost&t=$2 [L]
you dont have the &is_rewrite=yes
Could this be causing the prob?
Immortal
02-24-2006, 07:00 PM
Shouldn't be since newpost is only a redirect of showthread.php?p=...
Bhuwan
02-24-2006, 07:08 PM
Shouldn't be since newpost is only a redirect of showthread.php?p=...
OK..
Sorry to be a pain in the butt, but...
For some odd reason, all of my mods are showing links to me
its doing
u-bhuwan-1.html0
instead of
u-mod-2.html
I wonder y:(
Immortal
02-24-2006, 07:11 PM
Hm, that was fixed in 1.0. I wonder why it's doing it for you...
Bhuwan
02-24-2006, 07:13 PM
Hm, that was fixed in 1.0. I wonder why it's doing it for you...
Not sure... Want me to give you alink?
If I am logged in as a regular user, the link is okay
if I am logged in as an admin, it shows a link to my own profile.hmm.
Bhuwan
02-24-2006, 07:18 PM
Another possible bug I think:
Let's use vBulletin.org as an example
when you click on a FORUM, in the nav area, you see something like
vBulletin.org Forum > vB3.5 Mods
Normally, if you click on "vBulletin.org Forum", it will take you back to the forum index. (vBulletin.org/forum/index.php).
HOWEVER, if you have the hack enabled, for some odd reason it takes me back to vBulletin.org
Bhuwan
02-24-2006, 07:20 PM
Another possible bug I think:
Let's use vBulletin.org as an example
when you click on a FORUM, in the nav area, you see something like
vBulletin.org Forum > vB3.5 Mods
Normally, if you click on "vBulletin.org Forum", it will take you back to the forum index. (vBulletin.org/forum/index.php).
HOWEVER, if you have the hack enabled, for some odd reason it takes me back to vBulletin.org
this might be the problem
$output = str_replace('<a href="index.php"', '<a href="../"', $output);
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.