vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I clean out a hack (https://vborg.vbsupport.ru/showthread.php?t=130011)

jwashburn 10-26-2006 01:49 PM

How do I clean out a hack
 
I am running the psitats hack and for whatever reason I lost the two tables that the hack requires to run. So i get this error

Code:

Database error in vBulletin 3.6.2:

Invalid SQL:

                REPLACE INTO `psistats_cache` (`cdata`, `ctype`, `csid`)
                VALUES ('64.50.53.162', 'country', '64.50.53.162_country'), ('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)', 'useragent', '64.50.53.162_useragent');

MySQL Error  : Can't find file: 'psistats_cache.MYI' (errno: 2)
Error Number : 1017
Date        : Thursday, October 26th 2006 @ 10:43:51 AM

I also cant get into ADMINCP at all

So I looked at the XML file to see the database mods it made and it looks that it creates a couple of tables.

Here is the code from that

Code:

// DROP OLD TABLES
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_browser`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_country`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_os`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_referrer`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_screendepth`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_screenresolution`");

// CREATE TABLES
$db->query_write("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "psistats_cache` (
        `cdata` varchar(255) NOT NULL default '',
        `ctype` varchar(40) NOT NULL default '',
        `csid` varchar(255) NOT NULL default '',
        UNIQUE KEY `csid` (`csid`)) TYPE=MyISAM
");

$db->query_write("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "psistats_data` (
        `cdata` varchar(100) NOT NULL default '',
        `count` int(10) unsigned NOT NULL default '0',
        `ctype` varchar(40) NOT NULL default '',
        `cmisc` varchar(40) NOT NULL default '',
        KEY `ctype` (`ctype`)) TYPE=MyISAM
");

// CREATE CRON ON PRE-3.6.0 VBULLETIN
if (is_newer_version('3.6.0', $vbulletin->options['templateversion']))
{
        $db->query_write("DELETE FROM `" . TABLE_PREFIX  ."cron` WHERE `filename` LIKE '%psistats_update.php%' LIMIT 1");
        $db->query_write("INSERT INTO `" . TABLE_PREFIX . "cron` VALUES (NULL, 1136665500, -1, -1, -1, 'a:1:{i:0;i:25;}', './includes/cron/psistats_update.php', 1, 'psiStats 2006 Update (15-Minute Interval)')");
}

$db->show_errors();]]></installcode>
                        <uninstallcode><![CDATA[$db->hide_errors();

// DROP TABLES
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_browser`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_country`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_os`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_referrer`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_screendepth`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_screenresolution`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_cache`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_data`");

// ERASE CRON
$db->query_write("DELETE FROM `" . TABLE_PREFIX  ."cron` WHERE `filename` LIKE '%psistats_update.php%' LIMIT 1");

So I manuall made the two tables psistats_cache and psistats_data

I got no changes. I thought maybe there was a permissions issue so I inserted some data into those tables with phpmyadmin and it worked ok.

So I am at the point of reisntalling vb from scratch and i dont want to do that.

I have tried disabling hooks in my config.php but then I have a problem with a php adsnew integration that I did. IN order to get around that error I have to remove references to that in my templates, the problem is I cant get to my templates.

So if anyone knows how to reset my default template without admincp access, I can start down that road.

My main question is how do I remove this hack manually. Obviously just removing the two tables isnt going to do it, there must me some reference to it somehere else.

We have been down for 2 days now. Any help would be appreciated

akanevsky 11-26-2006 03:04 PM

Why don't you post problems related to a particular hack in that hack's thread?

To disable hacks on your site, add the following code to your config.php:
define('DISABLE_HOOKS', true);

Then uninstall whatever hack you want to uninstall. But to fix the problem, you would simply need to re-import the product xml of psistats.


All times are GMT. The time now is 04:04 PM.

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.01070 seconds
  • Memory Usage 1,728KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete