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($tables, DBARRAY_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).";
}
?>