Thread: Integration with vBulletin - vB Google Search Cloud - SEO
View Single Post
  #117  
Old 05-28-2008, 01:21 AM
Amenadiel's Avatar
Amenadiel Amenadiel is offline
 
Join Date: Sep 2006
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I suggest a little fix.

I was receiving this weird SQL error on my mail (it's VB's way to alert me when something goes wrong)

Code:
Database error in vBulletin 3.7.0:

Invalid SQL:
INSERT into vb_google_searches VALUES ('pavilion tx1332 drivers xp                                                                                                                                                                \"megaupload.com/\"|\"badongo.com/file/\"|\"rapidshare.com/files\"|\"mediafire.com/?\"|\"gigasize.com/get.php\"|\"seriesyonkis.com/\"','http://www.chw.net/foro/showthread.php?t=150369\',1);

MySQL Error   : Duplicate entry 'pavilion tx1332 drivers xp                                      ' for key 1
Error Number  : 1062
Request Date  : Tuesday, May 27th 2008 @ 04:10:48 PM
Error Date    : Tuesday, May 27th 2008 @ 04:10:48 PM
Script        : http://www.chw.net/foro/aqui-tienen-los-driver-del-tx1330la-t150369.html
Referrer      : http://www.google.es/custom?cx=005259712913702778262:h0v4n2t74pm&cof=GFNT%3A%23444444%3BGALT%3A%23444444%3BCX%3ADaleYa%252Ecom%3BVLC%3A%23663399%3BDIV%3A%23336699%3BFORID%3A0%3BT%3A%236600FF%3BALC%3A%23330000%3BLC%3A%23330000%3BGIMP%3A%23444444%3BBGC%3A%23DFE5FC%3BAH%3Aleft&q=pavilion+tx1332+drivers+xp++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"megaupload.com/"|"badongo.com/file/"|"rapidshare.com/files"|"mediafire.com/?"|"gigasize.com/get.php"|"seriesyonkis.com/"&btnG=B%C3%BAsqueda&cx=005259712913702778262%3Ah0v4n2t74pm
IP Address    : 190.198.248.43
Username      : Unregistered
Classname     : vB_Database_MySQLi
MySQL Version :
After a bit of tinkering, I found out that the field kw on the vb_google_searches table is 255 chars long, so two strings of, let's say, 260 chars, whose 255 first chars are identical, would trigger a duplicate key error. ?Why? Because the search_cloud script will check for a 260 chars $search variable without finding coincidences.

Ok, perhaps I'm not explaining myself enough, but if you guys get this error, I solved it cropping the $search variable to 254 chars.

In search_cloud.php find
Code:
$this->_logHit(strtolower($search),$pageURL);
add BEFORE
Code:
$search=substr($search,0,254);
and that's it
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01336 seconds
  • Memory Usage 1,766KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete