Thread: Administrative and Maintenance Tools - vBH-Bot's ~ Your site a better effective at search engine
View Single Post
  #59  
Old 07-31-2007, 08:11 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Those that have this modification installed (version 2.0) might have problems to uninstall or disable the product.

This is caused by the use of an invalid product-id:
- Current product-id is "vBH-Bot's"
- No product should ever use a product-id that starts with "vb" as this is reserved to official Jelsoft products.
- The product-id should be lowercase and only alphanumeric characters and underscore. Using a single-quote (') in the productid will break some javascript that is needed when uninstalling/disabling the product.

We strongly suggest not to install this product until the author releases an updated version.

For those who already have installed this product and need to disable or remove it, the attached script should correct the product-id by changing it from "vBH-Bot's" to "burach_bot_070731". This should allow for normal uninstall.

Please note that running the attached script might break the functioning of this modification, so only use the attached script if you plan on uninstalling the modification.

Place the following script in your 'admincp' directory and point your browser to http://myboard.com/admincp/fix_quoted_prodid.php

The script will not ask for a confirmation and will immediate make the needed changes. Once completed please remove the script again.

PS:
- This script has been undergoing a limited test. Use at own risk!
- If you have 2 boards installed in a single database, 1 without table-prefix and 1 with a table-prefix, then running this script for the board without a table-prefix might result in also the tables for the prefixed board to be updated (if this modification was also installed there)

As this modification has now been withdrawn by the author, the attachment is not downloadable anymore. If you still need this solution, please copy and paste the script below into a file named fix_quoted_prodid.php and place this file in your admincp directory.
PHP Code:
<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### settings for this script ######################
// The product-id to search for
$prod_find "vBH-Bot's";
// The product-id to use as replacement
$prod_replace "burach_bot_070731";
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
// loop thru all table names
$tables $db->query_read("SHOW TABLES LIKE '" TABLE_PREFIX "%'");
while (
$tablename $db->fetch_array($tablesDBARRAY_NUM))
{
 
// Check for columnname 'productid'
 
$tbl_columns $db->query_read("SHOW COLUMNS FROM $tablename[0] LIKE 'productid'");
 if (
$db->num_rows($tbl_columns) > 0)
 {
  
replace_productid($tablename[0], 'productid');
 }
 
 
// Check for columnname 'product'
 
$tbl_columns $db->query_read("SHOW COLUMNS FROM $tablename[0] LIKE 'product'");
 if (
$db->num_rows($tbl_columns) > 0)
 {
  
replace_productid($tablename[0], 'product');
 }
}
function 
replace_productid($tablename$column)
{
 global 
$db$prod_replace$prod_find;
 
 echo 
"<br />Updating table: " $tablename;
 
 
$result $db->query_write("UPDATE $tablename SET $column = '" $db->escape_string($prod_replace) . "' WHERE $column = '" $db->escape_string($prod_find) . "'");
 
 echo 
"<br />Updated " $db->affected_rows() . " row(s).";
 
}
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05037 seconds
  • Memory Usage 1,795KB
  • 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
  • (1)bbcode_php
  • (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