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)

alex.sk 02-20-2013 11:00 PM

vBSEO-style friendly urls using vB_Friendly_Url mechanism
 
1 Attachment(s)
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]

Adjust ^members/ to match your friendlyurl_memberdir if necessary.

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.

sodasusu 02-21-2013 04:01 PM

i will try thx

final kaoss 02-21-2013 04:37 PM

Ok so what about us who are already using the vbulletin friendly url htaccess rewrite (minus vbseo). Does it handle redirecting traffic to the proper urls as well?

Also are there any changes to be made to the htaccess to achieve the urls above?

PHP Code:

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 


final kaoss 02-21-2013 08:53 PM

Unfortunately there's something wrong with this plugin. This immediately appears when enabled. Disappears with plugin disabled. Also this only appears on forum.php

The other pages like threads, forums & member pages were rewritten though.

Quote:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4864 bytes) in /home/content/v/g/c/vgchat/html/forum/includes/init.php(336) : eval()'d code(466) : runtime-created function on line 1

dizzynation 02-21-2013 10:11 PM

If you are going to install this, I highly recommend not doing so on a populate forum, perform it on a test site. Google is the main source for traffic for many forum owners, so please keep in mind that braking your urls will drop your SERPS like its hot.

final kaoss 02-21-2013 10:20 PM

All the more reason to await this guy's response. :)

abdobasha2004 02-22-2013 09:57 AM

what is the point of buying vbseo after vb4 ? !

alex.sk 02-22-2013 11:34 AM

Ok, first of all:
DO NOT CHANGE URL STRUCTURE ON A LIVE BOARD
if you care about your Google rankings.
I didn't expect any questions in this direction, so I didn't even mention it in the first post.
Use a test board. Plan your moves and have redirects ready for your old urls if you decide to move.

Quote:

Ok so what about us who are already using the vbulletin friendly url htaccess rewrite (minus vbseo)
Major link rot.
Same as installing vBSEO on a live board, atop of existing vB4 urls. It's a change in url structure.

Currently the board with this plugin activated will not recognize standard vB4 urls (forums/ID-name, thread/ID-name etc) and will not redirect them to resp. forum/thread-ID.html urls. I can be done, btw, I just didn't even think of it.

Quote:

Also are there any changes to be made to the htaccess to achieve the urls above?
RewriteRules from the first post are necessary for FRIENDLY_URL_REWRITE mode to work.
Same as with standard vB4 urls.

final kaoss, which vB version do you use?
That looks really bad, but the only runtime-created function in the plugin is used in array_map(..., preg_split(...)), I wonder what could go wrong there.
In any case, I guess I'll try it one something more recent than my 4.0.3 in a day or two, some maybe there will be updates from my side.

Quote:

what is the point of buying vbseo after vb4 ?!
None?
For me, it's about moving from vB3+vBSEO to vB4 while keeping the links intact.
An alternative to this plugin being vB4+vBSEO, which, I totally agree, makes little sense.

final kaoss 02-22-2013 12:59 PM

I am using vb 420 PL2. Waiting for 421 and just skip PL3 altogether.

Black Snow 02-22-2013 02:49 PM

Quote:

Originally Posted by final kaoss (Post 2405769)
I am using vb 420 PL2. Waiting for 421 and just skip PL3 altogether.

Is there going to be a 4.2.1?....

final kaoss 02-22-2013 02:58 PM

It is planned yes.

dizzynation 02-22-2013 07:40 PM

Quote:

Originally Posted by alex.sk (Post 2405758)

Major link rot.
Same as installing vBSEO on a live board, atop of existing vB4 urls. It's a change in url structure.



None?
For me, it's about moving from vB3+vBSEO to vB4 while keeping the links intact.
An alternative to this plugin being vB4+vBSEO, which, I totally agree, makes little sense.


VBSEO offers more then just SE friendly URL's - it has about 85 functions that can increase your rankings, URL rewrites is just one.

I think this is a great mod idea for 3.8.7 vbseo users to vb 4.2 without vbseo - If it works, I hope it does for users. Best of luck

alex.sk 02-23-2013 01:34 PM

Version 0.6 uploaded. Standard vB4 style urls are now accepted, FRIENDLY_URL_BASIC mode fixed
Note you'll need two more RewriteRules for the old urls to work.

final kaoss: works well for me in vB 4.2.0.
Check what you've got on line 466 of your init_startup.

Quote:

VBSEO offers more then just SE friendly URL's - it has about 85 functions that can increase your rankings, URL rewrites is just one.
Are they described or listed anywhere?
My impression from the code is that it's 50% url rewrites, 30% general housekeeping (admincp, db, caches etc), 10% for template tweaks (title, meta etc) and the remaining 10% for stuff I have no idea about.

final kaoss 03-10-2013 04:03 AM

Are you talking about your plugin's init_startup or vbulletins init_statup.php file? Because afaik both of those are vanilla, aka untouched.

alex.sk 03-11-2013 09:34 AM

I have a strong impression part of this thread is missing.

I meant init_startup hook from datastore. I.e. the piece of eval()'d code where line 466 happens to be.
Unless you have better ideas, something like
Code:

if($_GET['dumpinitstartup']) var_dump(vBulletinHook::fetch_hook('init_startup'));
right before line 336
Code:

($hook = vBulletinHook::fetch_hook('init_startup')) ? eval($hook) : false;
in includes/init.php, and then calling http://your/board/index.php?dumpinitstartup=1 should show you that code.

Quote:

Because afaik both of those are vanilla, aka untouched.
That would be really strange. Line 466 in this plugin alone is nowhere near any user-defined functions.
In any case, with errors like this, I'd try to avoid any guesswork and make sure it's clear where exactly it happens.

alex.sk 03-11-2013 09:49 AM

Also, a note: this plugin was written for vBSEO 3.5.2.
I didn't realize it but even 3.6.0 uses different link scheme in its default configuration.

final kaoss 03-11-2013 04:12 PM

No idea, it decided to dump it all into one line doing it that way.

PHP Code:

string(15810"/** * * @param $ref - string - current search engine referrer * @return string - delemiter for current search engine referrer */ function seoqueries_get_delim($ref) { // Search engine match array // Used for fast delimiter lookup for single host search engines. // Non .com Google/MSN/Yahoo referrals are checked for after this array is checked $search_engines = array( 'google.fr' => 'q', 'google.com' => 'q', 'search.yahoo.com' => 'p', 'fr.search.yahoo.com' => 'p', 'search.msn.com' => 'q', 'bing.com' => 'q', 'search.live.com' => 'q', 'rechercher.aliceadsl.fr' => 'qs', 'vachercher.lycos.fr' => 'query', 'search.lycos.com' => 'query', 'alltheweb.com' => 'q', 'search.aol.com' => 'query', 'search.ke.voila.fr' => 'rdata', 'recherche.club-internet.fr' => 'q', 'ask.com' => 'q', 'hotbot.com' => 'query', 'overture.com' => 'Keywords', 'search.netscape.com' => 'query', 'search.looksmart.com' => 'qt', 'search.earthlink.net' => 'q', 'search.viewpoint.com' => 'k', 'mamma.com' => 'query' ); $delim = FALSE; // Check to see if we have a host match in our lookup array if (isset($search_engines[$ref])) { $delim = $search_engines[$ref]; } else { // Lets check for referrals for international TLDs and sites with strange formats if (strpos($ref, 'google.') !== FALSE && strpos($ref, 'reader') === FALSE) $delim = 'q'; elseif (strpos($ref, 'search.msn.') !== FALSE) $delim = 'q'; elseif (strpos($ref, '.search.yahoo.') !== FALSE) $delim = 'q'; elseif (strpos($ref, 'exalead.') !== FALSE) $delim = 'q'; elseif (strpos($ref, 'search.aol.') !== FALSE) $delim = 'query'; elseif (strpos($ref, '.ask.com') !== FALSE) $delim = 'q'; elseif (strpos($ref, 'recherche.aol.fr') !== FALSE) $delim = (strpos($_SERVER['HTTP_REFERER'], 'query')!==FALSE)?'query':'q'; } return $delim; } function seoqueries_get_position(){ if( preg_match('/cd=(\d+)/',$_SERVER['HTTP_REFERER'],$match) ){ return $match[1]; } return 0; } /** * * @param $d - delimiter in referrer string * @return string - search keywords */ function seoqueries_get_terms($d) { $terms = null; $query_array = array(); $query_terms = null; // Get raw query $query = str_replace( 'site%3A', '', $_SERVER['HTTP_REFERER'] ); $query = explode($d.'=', $query); $query = explode('&', $query[1]); $query = urldecode($query[0]); // Remove quotes, split into words, and format for HTML display $query = str_replace("'", '', $query); $query = str_replace('"', '', $query); $query_array = preg_split('/[\s,\+]+/',$query); $query_terms = implode(' ', $query_array); global $vbulletin; if( $vbulletin->options['seofq_enc'] != '' ){ $terms = htmlspecialchars( iconv("utf-8", $vbulletin->options['seofq_enc'], urldecode($query_terms)) ); }else{ $terms = htmlspecialchars(urldecode($query_terms)); } return $terms; } /** * This function looks for referrer variable and return it in special format (without "www." prefix) * @return string - referrer value */ function seoqueries_get_refer() { // Break out quickly so we don't waste CPU cycles on non referrals if (!isset($_SERVER['HTTP_REFERER']) || ($_SERVER['HTTP_REFERER'] == '')) return FALSE; $referer_info = parse_url($_SERVER['HTTP_REFERER']); $referer = $referer_info['host']; // Remove www. is it exists if (substr($referer, 0, 4) == 'www.') $referer = substr($referer, 4); return $referer; } /** * Return true if the referer is a search engine * @param $what - what info you are going to get * @return mixed */ function seoqueries_getinfo($what) { // Did we come from a search engine? $referer = seoqueries_get_refer(); if (!$referer) return FALSE; $delimiter = seoqueries_get_delim($referer); if ($delimiter) { $terms = seoqueries_get_terms($delimiter); if ($what == 'isref') { return ($terms != ''?true:false); } if ($what == 'referrer') { $parsed = parse_url($_SERVER['HTTP_REFERER']); echo ''.$parsed['host'].''; } if ($what == 'terms') { echo $terms; } } } /** * Gets type and id for current loading page * It may be homepage, single post page, static page, category page, tag page or archive page * @return array with two keys: 'type' and 'id' */ function seoqueries_get_type_id( $param ){ if (THIS_SCRIPT == 'forumdisplay' || THIS_SCRIPT == 'index' || THIS_SCRIPT == 'showthread'){ $return['type'] = THIS_SCRIPT; }else{ return array(); } switch(THIS_SCRIPT){ case 'forumdisplay': $return['id'] = $param['forumid']; //$return['id'] = $_GET['f']; break; case 'index': $return['id'] = 0; break; case 'showthread': $return['id'] = $param['threadid']; //$return['id'] = $_GET['t']; break; }; return $return; } /** * * @param $term * @param $min_founded - int, minimal number of 'founded' value for terms * @param $max_founded - int, max number of 'founded' value for terms * @return string - tag value (by default one from 'strong','h6'-'h2' You can edit tag list in setting in the wp-admin) */ function seoqueries_get_tag( $term$min_founded$max_founded$tags_count ){ if( empty($tags_count) ) return false; $step = ($max_founded - $min_founded)/$tags_count; if ($step == 0){ return '0'; } $number = (int)($term['founded'] - $min_founded)/$step; if ($number == $tags_count){ $number--; } return $number; } function seoqueries_get_item_title($type,$id){ switch ($type){ case 'post': $post = get_post($id); return $post->post_title; case 'page': $page = get_page($id); return $page->post_title; case 'category': $cat = get_category($id); return $cat->name; case 'archive': return $id; case 'tag': $tag = get_tag($id); return $tag->name; } } function seoqueries_get_google_position($stid){ global $wpdb$sql = "SELECT position FROM {$wpdb->searchterms_statsWHERE position IS NOT NULL AND stid=$stid ORDER BY date_clicked DESC LIMIT 1"; return $wpdb->get_var($sql); } function seoqueries_last_clicked_date($stid,$page_type = false, $page_id = false){ global $wpdb$sql = "SELECT date_clicked FROM {$wpdb->searchterms_statsWHERE stid=$stid "; if (!empty($page_type) && !empty($page_id)){ $sql .=" AND page_type '$page_type' AND page_id='$page_id' "; } $sql .=" ORDER BY date_clicked DESC LIMIT 1"; return $wpdb->get_var($sql); } function seoqueries_write_to_log($str){ $file = file_get_contents('plugin-log.txt'); $file .= "\n". time() ." ". $str ."\n"; file_put_contents('plugin-log.txt', $file); } function seoqueries_init(){ global $seoqueries; global $vbulletin; if (!$seoqueries){ $seoqueries = new stdClass(); } $seoqueries->searchterms = TABLE_PREFIX .'seoqueries_terms'; $seoqueries->searchterms_data = TABLE_PREFIX .'seoqueries_data'; $seoqueries->searchterms_stats = TABLE_PREFIX .'seoqueries_terms_stats'; $seoqueries->searchterms_filter = TABLE_PREFIX .'seoqueries_filtered_terms'; //imitating http_referer variable uncomment this line if you want to test plugin /* $referers = array( 'http://google.com/?q=seoforums&cd=2','http://google.com/?q=superforum&cd=1','http://google.com/?q=vbulletin&cd=','http://google.com/?q=tendrassil','http://google.com/?q=rocket&cd=2','http://google.com/?q=moon','http://google.com/?q=beatles&cd=2','http://google.com/?q=commodi','http://google.com/?q=forum&cd=1','http://www.google.com/search?client=safari&rls=en&q=seoforums.org&ie=UTF-8&oe=UTF-8','http://google.com/?q=perspiciatis,','http://google.com/?q=omnis','http://google.com/?q=natus','http://google.com/?q=error','http://google.com/?q=voluptatem','http://google.com/?q=accusantium','http://google.com/?q=doloremque','http://google.com/?q=laudantium,','http://google.com/?q=totam','http://google.com/?q=aperiam','http://google.com/?q=eaque','http://google.com/?q=ipsa,','http://google.com/?q=inventore','http://google.com/?q=veritatis','http://google.com/?q=quasi','http://google.com/?q=architecto','http://google.com/?q=beatae','http://google.com/?q=vitae','http://google.com/?q=dicta','http://google.com/?q=sunt,','http://google.com/?q=explicabo.','http://google.com/?q=ipsam','http://google.com/?q=voluptatem,','http://google.com/?q=voluptas','http://google.com/?q=aspernatur','http://google.com/?q=fugit,','http://google.com/?q=consequuntur','http://google.com/?q=magni','http://google.com/?q=dolores','http://google.com/?q=ratione','http://google.com/?q=voluptatem','http://google.com/?q=sequi','http://google.com/?q=nesciunt,','http://google.com/?q=ne\que','http://google.com/?q=porro','http://google.com/?q=quisquam','http://google.com/?q=dolorem','http://google.com/?q=ipsum,','http://google.com/?q=dolor','http://google.com/?q=amet,','http://google.com/?q=consectetur,','http://google.com/?q=adipisci','http://google.com/?q=velit,','http://google.com/?q=numquam','http://google.com/?q=tempora','http://google.com/?q=incidunt,','http://google.com/?q=labore','http://google.com/?q=dolore','http://google.com/?q=magnam','http://google.com/?q=aliquam','http://google.com/?q=quaerat','http://google.com/?q=voluptatem.','http://google.com/?q=minima','http://google.com/?q=veniam,','http://google.com/?q=nostrum','http://google.com/?q=exercitationem','http://google.com/?q=ullam','http://google.com/?q=corporis','http://google.com/?q=suscipit','http://google.com/?q=laboriosam,','http://google.com/?q=aliquid','http://google.com/?q=commodi','http://google.com/?q=consequatur?','http://google.com/?q=autem','http://google.com/?q=reprehenderit,','http://google.com/?q=voluptate','http://google.com/?q=velit','http://google.com/?q=esse,','http://google.com/?q=nihil','http://google.com/?q=molestiae','http://google.com/?q=consequatur,','http://google.com/?q=illum,','http://google.com/?q=dolorem','http://google.com/?q=fugiat,','http://google.com/?q=voluptas','http://google.com/?q=nulla','http://google.com/?q=pariatur?', ); //$_SERVER['HTTP_REFERER'] = 'http://www.google.com/search?client=safari&rls=en&q=%D8%A7%D9%84%D8%A3%D8%BA%D8%A7%D9%86%D9%8A&ie=UTF-8&oe=UTF-8'; //shuffle($referers); //$_SERVER['HTTP_REFERER'] = array_pop($referers); $ref_count = count($referers); //$_SERVER['HTTP_REFERER'] = 'http://www.google.com/search?hl=ru&client=safari&rls=en&q=%40mail'; for($i=0;$i<100;$i++){ */ $abanded_chars=array('\'','\\','/','%','|','$','?',',','~'); $ref = seoqueries_get_refer(); $type_id = seoqueries_get_type_id($vbulletin->GPC); if (seoqueries_getinfo('isref')){ $referer = seoqueries_get_refer(); $delimiter = seoqueries_get_delim($referer); $terms = seoqueries_get_terms($delimiter); $terms_safe = str_replace($abanded_chars, '', $terms); if(strlen($terms_safe)<4){ return; } //use filter $sql = "SELECT FROM ". $seoqueries->searchterms_filter$result = $vbulletin->db->query_read_slave($sql); while( $row = $vbulletin->db->fetch_array($result) ){ //echo $row['filter'].' - '.$terms."\n"; if(stripos($terms,$row['filter'])!==false) return; } $sql = "SELECT FROM ". $seoqueries->searchterms ." WHERE term_value='". $terms_safe ."'"; $result = $vbulletin->db->query_read_slave($sql); if (!empty($result)){ $term = $vbulletin->db->fetch_array($result); } $vbulletin->db->free_result($result); if (empty($term)){ $sql = "INSERT INTO ". $seoqueries->searchterms ." (term_valueVALUES('". $terms_safe ."')"; $vbulletin->db->query_write($sql); $sql = "SELECT FROM ". $seoqueries->searchterms ." WHERE term_value='". $terms_safe ."'"; $result = $vbulletin->db->query_read_slave($sql); $term = $vbulletin->db->fetch_array($result); } if (empty($term)){ return; } //if banned if($term['ban']==1) return; global $seoqueries_type; if (empty($type_id)){ return ''; } $seoqueries_type = new stdClass(); $seoqueries_type->type = $type_id['type']; $seoqueries_type->id = $type_id['id']; $sql = " SELECT FROM ". $seoqueries->searchterms_data ." WHERE stid=". $term['stid'] ." AND page_type='". $type_id['type'] ."' AND page_id=". $type_id['id']; $result = $vbulletin->db->query_read_slave($sql); $row = $vbulletin->db->fetch_array($result); if (empty($row)){ $sql = "INSERT INTO ". $seoqueries->searchterms_data ." VALUES ". $term['stid'] ."". 1 ."'". $type_id['type'] ."'". $type_id['id'] ."CURRENT_TIMESTAMP )"; $vbulletin->db->query_write($sql); }else{ $row['founded']++; $sql = "UPDATE ". $seoqueries->searchterms_data ." SET founded=". $row['founded'] ."last_click=CURRENT_TIMESTAMP WHERE stid=". $row['stid'] ." AND page_type='". $row['page_type']. "' AND page_id=". $row['page_id']; $vbulletin->db->query_write($sql); } //post to statistic $position = seoqueries_get_position(); $sql = " INSERT INTO ". $seoqueries->searchterms_stats ." VALUES NULL". $term['stid'] ."'". $type_id['type'] ."'". $type_id['id'] ."". $position ."CURRENT_TIMESTAMP "; $vbulletin->db->query_write($sql); } //}//for 100 fish of google } class SpambotHammer { static function markup() { global $vbulletin$vbphrase$r = array( sprintf('', TIMENOW), ); if ($vbulletin->options['spambot_hammer_safety_lock']) { $constants = array( 'SPAMBOT_HAMMER_MODULE_TIMER_MATURITY', $vbulletin->options['spambot_hammer_time_difference'], 'SPAMBOT_HAMMER_MODULE_TIMER_COUNTDOWN_TEXT', addslashes_js($vbphrase['spambot_hammer_module_timer_countdown_text']) ); $script = ''; if (version_compare(FILE_VERSION, '3.0.0', '>=') && version_compare(FILE_VERSION, '3.9.9', '<=')) { eval('$script = "' . fetch_template('spambot_hammer_module_timer_js') . '";'); } if (version_compare(FILE_VERSION, '4.0.0', '>=') && version_compare(FILE_VERSION, '4.9.9', '<=')) { $script = vB_Template::create('spambot_hammer_module_timer_js')->render(); } $r[] = vsprintf('', $constants); $r[] = $script; } return implode("\n", $r); } static function upgrade() { global $vbulletin; if (isset($vbulletin->options['bot_blocker_time_difference'])) { require_once DIR . '/includes/adminfunctions_options.php'; require_once DIR . '/includes/adminfunctions_plugin.php'; save_settings(array( 'spambot_hammer_time_difference' => $vbulletin->options['bot_blocker_time_difference'], 'spambot_hammer_bounce_url' => $vbulletin->options['bot_blocker_bounce_url'], 'spambot_hammer_report_email' => $vbulletin->options['bot_blocker_report_email'], 'spambot_hammer_safety_lock' => $vbulletin->options['bot_blocker_safety_lock'] )); delete_product('bot_blocker'); } } } " 


uninvited13th 04-14-2013 01:16 PM

please fix

final kaoss 04-17-2013 04:15 PM

Really though the only issue that I could find with it is that it enables the forum.php page to not render. The rest (forumdisplay, showthreads) works.

rmd708 05-06-2013 07:08 AM

....found the problem....

final kaoss 05-19-2013 12:46 AM

mind sharing?

Amaury 05-27-2013 03:43 AM

Our owner installed this, and now we are getting this:
Quote:

Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home3/khmediaf/public_html/includes/init.php(336) : eval()'d code on line 183

Fatal error: Call to undefined method vB_Friendly_Url_Error::get_url() in /home3/khmediaf/public_html/includes/functions.php on line 7708
We can access our Admin CP login panel via a direct URL, but we still cannot login because of the error in order to access Manage Products and disable it.

Any ideas?

ellenthompson 06-06-2013 11:48 AM

Sir i got 404 error :( please help

final kaoss 08-14-2013 09:41 PM

on which page did you receive 404?

dreamygirl 09-02-2013 09:41 PM

Any help is appreciated. I am on 4.2.0 PL3. Upon installing, it gives an error. The error starts with
PHP Code:

Parse errorsyntax errorunexpected T_FUNCTIONexpecting ')' in 

and IIRC it says line 46. I thought I found an extra ) in one of the hooks plugins. I hoped to find an extra ( and make the error stop. After removing the extra ), it has the same error, but with line 43.

final kaoss 09-03-2013 12:57 PM

Might be a long shot but try this php checker.
http://phpcodechecker.com/

armagan 09-03-2013 01:33 PM

...................

ozzy47 09-03-2013 02:01 PM

To disable the plugin/hook system open your config.php which can be found in your forumroot/includes directory

Just below
Code:

<?php
enter
Code:

define('DISABLE_HOOKS', true);
and save the file.

Then you can get into your ACP and disable the mod.

Then enable the plugin/hook system again, either remove the line again or simply comment that line out. To do so, add two forward slashes " / " so it will look like

Code:

// define('DISABLE_HOOKS', true);
Next time you would like to disable the plugin/hook system again
you simply have to remove those two " / ".

ShortBuss 11-02-2013 08:26 PM

Just installed this mod, so far so good. Adding a line for content.php helped as I'm running the suite.
Code:

RewriteRule ^content/(.*) content.php [L]
There's a few things I need to work out still. The lists/category hits a 404 but I should have that under control soon
Gone Fishing Forum

Thanks a ton for this mod! With vbseo on the outs I was wondering how I was going to get the tidy urls I wanted.

ShortBuss 11-02-2013 08:40 PM

Sure nuff, adding a couple more lines to htaccess gets things rolling right along

Code:

RewriteRule ^blog/(.*) blog.php [L]
RewriteRule ^list/category/(.*) list.php [L]

Thanks again for the mod!

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 05:33 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.01625 seconds
  • Memory Usage 1,987KB
  • 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
  • (11)bbcode_code_printable
  • (3)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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