Thread: Show Thread Enhancements - [AJAX] Post Thank You Hack
View Single Post
  #904  
Old 05-24-2010, 06:36 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cmeinck View Post
I'm sure I'm not the only one, so would appreciate any help on how to prevent these database errors. As far as I can tell, there are no visible links to "find thanks".

Code:
Database error in vBulletin 4.0.3:

Invalid SQL:

			REPLACE INTO search (userid, ipaddress, personal, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, displayterms, searchhash)
			VALUES (0, '66.249.65.181', 1, 'manic', '', 'post.dateline', 'DESC', 0.12551, 1, '351328,351311,348467,348466,346458,346411,344262,342697,342689', 1274289300, 'a:6:{s:5:\"words\";a:0:{}s:9:\"highlight\";a:0:{}s:6:\"common\";a:0:{}s:5:\"users\";a:1:{i:118484;s:5:\"manic\";}s:6:\"forums\";i:0;s:7:\"options\";a:3:{s:11:\"starteronly\";i:0;s:11:\"childforums\";i:1;s:6:\"action\";s:7:\"process\";}}', 'cd78b1a0b7a48890db58b480739e121c');

MySQL Error   : Table 'my_forum.search' doesn't exist
Error Number  : 1146
Request Date  : Wednesday, May 19th 2010 @ 12:15:00 PM
Error Date    : Wednesday, May 19th 2010 @ 12:15:01 PM
Script        : http://www.mysite.com/forum/post_thanks.php?do=findthanks_user_gave&u=118484
Referrer      : 
IP Address    : 66.249.65.181
Username      : Unregistered
Classname     : vB_Database
MySQL Version :
Quote:
Originally Posted by Golzarion View Post
The same problem .... I think it is a bug for this hack on vB 4.0.3 !
This questioned has been asked and answered several times in this thread.

Quote:
Originally Posted by imagirlgeek View Post
What I did to resolve this was to comment out these lines in post_thanks.php...

PHP Code:
$db->query_write("
   REPLACE INTO " 
TABLE_PREFIX "search (userid, ipaddress, personal, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, displayterms, searchhash)
   VALUES (" 
$vbulletin->userinfo['userid'] . ", '" $db->escape_string(IPADDRESS) . "', 1, '" $db->escape_string($user['username']) . "', '" $db->escape_string($forumchoice) . "', 'post.dateline', 'DESC', $searchtime, 1, '" $db->escape_string(implode(','$orderedids)) . "', " TIMENOW ", '" $db->escape_string(serialize($display)) . "', '" $db->escape_string($searchhash) . "')
  "
);
  
$searchid $db->insert_id();
 
  
$vbulletin->url 'search.php?' $vbulletin->session->vars['sessionurl'] . "searchid=$searchid";
  eval(
print_standard_redirect('search')); 
I found this query on lines 278 - 285, 413 - 420, and 527 - 534. I commented out all of them 3 days ago and haven't received this error and also haven't seen any adverse effects.
If you don't know how to do those edits, upload the attached corrected post_thanks.php file to the forum root and import the attached corrected product-post_thanks.xml file, making sure you select the "overwrite" option.

To fix the cosmetic (font size) errors, apply the fixes in post_thanks_7_82_improvements.zip, posted earlier in this thread bu attached here for convenience.
Attached Files
File Type: php post_thanks.php (17.8 KB, 72 views)
File Type: xml product-post_thanks.xml (31.9 KB, 60 views)
File Type: zip post_thanks_7_82_improvements.zip (7.0 KB, 66 views)
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01293 seconds
  • Memory Usage 1,825KB
  • Queries Executed 12 (?)
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
  • (1)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (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
  • (3)postbit_attachment
  • (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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete