Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 02-21-2009, 04:19 AM
LCN2007 LCN2007 is offline
 
Join Date: Jul 2007
Posts: 323
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Force Hack Removal

I am trying to remove an obsolete mod on my site but a while back i deleted the SQL Database that was attached to the hack so now when i try to remove it i get the following error:

Quote:
Database error in vBulletin 3.7.2:

Invalid SQL:
SELECT COUNT(*) AS users
FROM user AS user, userfield AS userfield

WHERE userfield.field55>0
AND user.userid = userfield.userid;

MySQL Error : Unknown column 'userfield.field55' in 'where clause'
Error Number : 1054
Request Date : Saturday, February 21st 2009 @ 12:17:02 AM
Error Date : Saturday, February 21st 2009 @ 12:17:02 AM
Script : http://www.sitename.net/forum/timeslips.php
Referrer :
IP Address : 68.229.86.93
Username : *******
Classname : vB_Database
MySQL Version : 5.1.30

I thought a while ago i saw such a hack to force remove mods when such things happen.

any help is appreciated,

Thanks
Reply With Quote
  #2  
Old 02-21-2009, 04:42 AM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Same thing happened with me and a mod I was testing out. In your product manager, you have drop down options next to each mod... Edit the mod and remove the conflicting SQL query from the uninstall code. In this case it'll be this code:

Code:
SELECT COUNT(*) AS users
FROM user AS user, userfield AS userfield
Once you yank that out of there, remove it normally - you may have to repeat the process for removing other conflicting SQL queries, though.
Reply With Quote
  #3  
Old 02-21-2009, 07:40 AM
vbplusme vbplusme is offline
 
Join Date: Sep 2008
Location: CyberSpace
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unfortunately, deleting the database references puts the hack in an unknown state so you may have multiple instances where you will need to follow the suggestion provided until the uninstall completes successfully. You may have some other residue that pops up as well. Hope it works out for you. If all else fails you might want to consider the alternative which is to reinstall the hack in upgrade / overwrite mode then do the uninstall. That should clean up any residual stuff that might be hiding out on your system.
Reply With Quote
  #4  
Old 02-23-2009, 12:52 PM
LCN2007 LCN2007 is offline
 
Join Date: Jul 2007
Posts: 323
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i cant seem to find that snip of code here is the uninstall code.


$db->query_write("DROP TABLE " . TABLE_PREFIX . "customfile");
$db->query_write("ALTER TABLE `" . TABLE_PREFIX . "user` DROP `tdban` ");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '50' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '51' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '52' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '53' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '54' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '55' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '56' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '57' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '58' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '59' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '60' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '61' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '62' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '63' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '64' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '65' LIMIT 1");
$db->query_write("ALTER TABLE `" . TABLE_PREFIX . "userfield` DROP `field50` ,
DROP `field51` ,
DROP `field52` ,
DROP `field53` ,
DROP `field54` ,
DROP `field55` ,
DROP `field56` ,
DROP `field57` ,
DROP `field58` ,
DROP `field59` ,
DROP `field60` ,
DROP `field61` ,
DROP `field62` ,
DROP `field63` ,
DROP `field64` ,
DROP `field65`");
$db->query_write("OPTIMIZE TABLE " . TABLE_PREFIX . "userfield");
Reply With Quote
  #5  
Old 02-24-2009, 04:44 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Remove this line:
Code:
DROP `field55` ,
Reply With Quote
  #6  
Old 02-24-2009, 01:00 PM
LCN2007 LCN2007 is offline
 
Join Date: Jul 2007
Posts: 323
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Dismounted

This worked i just kept removing the errored lines untill success.

I took out:

Code:
$db->query_write("DROP TABLE " . TABLE_PREFIX . "customfile");
$db->query_write("ALTER TABLE `" . TABLE_PREFIX . "user` DROP `tdban` ");

"userfield` 
DROP `field50` ,
DROP `field51` ,
Thanks again.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:55 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04376 seconds
  • Memory Usage 2,209KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete