The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vBSEO-style friendly urls using vB_Friendly_Url mechanism Details »» | |||||||||||||||||||||||||||||
vBSEO-style friendly urls using vB_Friendly_Url mechanism
Developer Last Online: Aug 2014
This plugin enables the following url scheme:
vbulletin/forum-name/ vbulletin/forum-name/index10.html vbulletin/forum-name/thread-title-145.html vbulletin/forum-name/thread-title-145-7.html vbulletin/members/admin.html This is close to what vBSEO 3.5.2 generates in its default configuration. he original goal of this plugin was to allow ditching vBSEO during vB3-vB4 upgrade without suffering a massive link rot. At this moment, this plugin may be used as a starting point to implement some specific link scheme, but it's hardly useful by itself unless you have that particual vBSEO version; vBSEO 3.6.0 uses different link scheme not compatible with this one. The plugin hooks to the built-in url generation/parsing mechanism of vB4, overriding vB_Friendly_Url_* classes, unlike vBSEO which does whole-page preg replacements even in vB4. It works within the normal vB data flow, so it's small, simple, and quite fast. It's also very likely to play well along with other plugins like Cerberus. The links generated by this plugin do not always match those of vBSEO. There are slight differences in handling non-alphanumeric characters, and probably other issues too. However, it should accept all vBSEO thread links, in the worst case (CANON_STRICT) issuing some 301 redirects. Most of vBSEO configuration options are not supported. In particular, link structure is hard-coded. If you need something unusual, you may use this as a template, but you'll need to tweak it to get urls you want. Blog urls are not implemented; the site I wrote this for does not use vB blogs. Calendar urls and anything else not handled by vB_Friendly_Url is not supported. Configuration resides on the standard Friendly Urls page. The plugin can work in modes other than FRIENDLY_URL_REWRITE. It's not really indented to do it, it's more of a fallback option, but it's implemented. In FRIENDLY_URL_ADVANCED mode urls look like this: vbulletin/forumdisplay.php/forum-name.html vbulletin/forumdisplay.php/forum-name-10.html vbulletin/showthread.php/thread-title-145.html vbulletin/showthread.php/thread-title-145-7.html vbulletin/member.php/admin.html The plugin allows custom forum slugs, i.e. replacing forum-name with something else without changing the forum title. It's not pretty, but it works. Sample .htaccess rules for FRIENDLY_URL_REWRITE: Code:
RewriteBase /url/path/to/vbulletin RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^ - [L] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] # Use these two only if you have friendlyurl_acceptvb4 enabled RewriteRule ^threads/(.*) showthread.php [L] RewriteRule ^forums/(.*) forumdisplay.php [L] RewriteRule ^members/([^/]+).html$ member.php [L] RewriteRule ^[^/]+/index\d*.html$ forumdisplay.php [L] RewriteRule ^[^/]+/[^/]+.html$ showthread.php [L] RewriteRule ^[^/]+/?$ forumdisplay.php [L] Tested on vB 4.0.3 PL8 and vB 4.2.0. Should work on most 4.x.x versions. Feel free to post bug reports, suggestions etc. in this thread. Download Now
Show Your Support
|
Comments |
#32
|
|||
|
|||
You never got a parse error like the one I got above? Thanks.
|
#33
|
|||
|
|||
Thank you for this awesome plugin. I noticed that after installing this plugin, it takes a lot longer to go back to the home page on my site. I understand that there is a very small performance hit, but it shouldn't take more than 5 seconds longer to load the homepage. In addition, the site does an ajax request and that request takes about 10 seconds to complete. Without the plugin, it completes almost instantly when page loads.
I simply installed your plugin, and modified the .htaccess file with your sample .htaccess code. The only thing different is that I took out the RewriteBase line. In addition, I added in three extra lines for security: RewriteRule ^includes/(.*) index.php RewriteRule ^vb/(.*) index.php RewriteRule ^packages/(.*) index.php Does this shed any clue as to why my site hit a decrease in performance? Thank you in advance. |
#34
|
|||
|
|||
The issue that I was having was that it took a long time to load up the home page. After troubleshooting, it was apparent that the algorithm to test for forum conflict names was causing a delay. I'm posting this as my solution just in case it helps anyone down the road.
If you have a huge forum, are experiencing slow page load, and have confirmed that you have no forum name conflicts, then remove this piece of code from the friendly url classes file. Code:
else foreach($this->registry->forumcache as $fid => $finfo) if(self::clean_fragment($finfo['title']) == $slug && $fid != $forumid) { $clash = true; break; } |
#35
|
|||
|
|||
Quote:
Another user was having a problem like mine too. https://vborg.vbsupport.ru/showpost....3&postcount=22 |
#36
|
|||
|
|||
Hey dreamygirl,
Sorry, I just came across your question for help in this thread. I am actually running into the same issue right now on a different server. I'm looking into it and will post back with a resolution once I figure it out. Hang in there! -S |
#37
|
|||
|
|||
Dreamygirl,
For troubleshooting purposes, what version of PHP are you running? Thanks, -S |
#38
|
|||
|
|||
5.2.17 (There's a possibilty it was lower a few months ago.)
|
#39
|
|||
|
|||
Dreamygirl,
I think I have the solution. In the friendly Url Classes plugin, on line 26, the author uses an anonymous function (closure). Code:
$stopwords = trim(implode('|', array_map( function($x) { return preg_quote($x, "/"); }, preg_split('/(,\s*|\s+)/', $vbulletin->options['friendlyurl_stopwords']) ))); I would advise you to test the plugin on a test server running PHP 5.3 to see if it solves your problem. If so, you may want to look into upgrading the current server from PHP 5.2.x to PHP 5.3 provided that it doesn't break anything else. If it does, then you will need to modify the code in the plugin to be 5.2 compatible. This plugin works fine on our test server, which is running PHP 5.3.3. I'm almost certain this is the case, but I encourage that you test it for yourself before taking my word for it. I hope this helps. -S |
#40
|
|||
|
|||
Thanks, I'll upgrade when I can. If I get an error on PHP 5.3 or up, my errors are probably from another installed mod.
|
#41
|
|||
|
|||
Why not simply fix the code instead?
Code:
$pregquote_chars = array_fill(0, count($vbulletin->options['friendlyurl_stopwords']), '/'); $stopwords = trim(implode('|', array_map("preg_quote", preg_split('/(,\s*|\s+)/', $vbulletin->options['friendlyurl_stopwords']), $pregquote_chars))); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|