vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - vBSEO-style friendly urls using vB_Friendly_Url mechanism (https://vborg.vbsupport.ru/showthread.php?t=295358)

dreamygirl 11-02-2013 11:57 PM

Quote:

Originally Posted by ShortBuss (Post 2457865)
Sure nuff, adding a couple more lines to htaccess gets things rolling right along

You never got a parse error like the one I got above? Thanks.

schan 12-04-2013 12:40 AM

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.

schan 12-07-2013 01:35 AM

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;
      }

Only do this if you can ensure that there are no forum name conflicts.

dreamygirl 12-07-2013 06:44 PM

Quote:

Originally Posted by schan (Post 2465555)
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.

I wondered if you could shed light on my problem at all? It's unrelated but since you have familiarity with this mod and some coding knowledge. I posted about my problem at https://vborg.vbsupport.ru/showpost....3&postcount=25

Another user was having a problem like mine too. https://vborg.vbsupport.ru/showpost....3&postcount=22

schan 12-17-2013 02:15 AM

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

schan 12-17-2013 02:41 AM

Dreamygirl,

For troubleshooting purposes, what version of PHP are you running?

Thanks,
-S

dreamygirl 12-17-2013 04:07 AM

Quote:

Originally Posted by schan (Post 2468890)
For troubleshooting purposes, what version of PHP are you running?

5.2.17 (There's a possibilty it was lower a few months ago.)

schan 12-17-2013 10:57 PM

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'])
)));

Anonymous functions is a feature that was added in PHP 5.3, which means, servers running PHP 5.2.x would run into syntax issues - the exact issues that you and I are having.

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

dreamygirl 12-18-2013 01:06 AM

Quote:

Originally Posted by schan (Post 2469094)
This plugin works fine on our test server, which is running PHP 5.3.3.

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.

zylstra 12-18-2013 03:32 AM

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)));



All times are GMT. The time now is 03:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01094 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete