Quote:
Originally Posted by XrayHead
Please can someone give me the steps to remove this hack and the tables ETC I need to remove from my SQL database?
Thanks
Xray
|
well these are the queries i could find that are in the databse
Code:
<?php
// The query should probably be enclosed by '
// Be sure you include TABLE_PREFIX
// Replace 'build' with either 'new', 'uninstall', or the build number the query is meant to upgrade FROM.
$query['uninstall'][] = 'DROP TABLE `maf_application`;';
$query['uninstall'][] = 'DROP TABLE `maf_ratings`;';
?>
there may be more but its late so i didnt finish looking
also if you want this is the contents of the uninstaller
PHP Code:
<?php
// ###################### Uninstall ###########################
if ($_REQUEST['do'] == 'uninstall') {
if ($step == '0') {
// Put the hacks in an array and print some text.
$hacks = explode("|||", $_REQUEST['hacks']);
echo "These are the hacks you have selected to uninstall: <ul>";
foreach ($hacks as $key => $hack) {
// Put the hack name in an array.
$hackd = $hack;
unset($hack);
$hack['name'] = $hackd;
$hack['displayname'] = str_replace("_", " ", $hack['name']);
// Check for installed varsions and set some variables.
// Some sanity checking as well.
if (isset($installedhack[$hack[displayname]])) {
// There is a record of the hack being installed.
$hack['installed_build'] = $installedhack[$hack[displayname]]['build'];
$hack['installed_version'] = $installedhack[$hack[displayname]]['version'];
$hack['path'] = $path_to_install . "hacks/$hack[name]/";
$hack['build'] = $hack['installed_build'];
} elseif (!isset($override)) {
// We can't find a record of the hack being installed and override is not enabled.
echo "There is no record of $hack[displayname] being installed. It cannot be uninstalled.";
unset($hacks[$key]);
$ohnoes = true;
} else {
// The hack hasn't been found to be installed, but we have override on.
// Path to the hack directory.
$hack['path'] = $path_to_install . "hacks/$hack[name]/";
$hack_dir = opendir($hack['path']);
// Find all the builds.
while (($file = readdir($hack_dir)) !== false) {
if (is_numeric($file) && $file != "." && $file != "..") {
$hack['builds'][$file] = $file;
}
}
// Find the latest build.
if (!empty($hack['builds'])) {
arsort($hack['builds']);
foreach ($hack['builds'] as $build) {
$hack['build'] = $build;
break;
}
}
}
// Sanity checking and require the file.
if (file_exists("./hacks/$hack[name]/$hack[build]/index.php")) {
chdir("./hacks/$hack[name]/$hack[build]");
require_once("./index.php");
chdir('./../../../');
} else {
if (!isset($ohnoes)) {
echo $hack['displayname'] . " build #" . $hack['build'] . " contains no index.php containing hack information and cannot be uninstalled.<br /><br />";
unset($hacks[$key]);
$ohnoes = true;
}
}
// If we are still sane, print out the hack name.
if (!isset($ohnoes)) {
echo "<li>$hack[displayname]</li>";
} else {
unset($ohnoes);
}
}
// Print some text and some links and continue.
$hacks = implode("|||", $hacks);
echo "</ul><p>We're sorry you didn't like these hacks. Running this script will remove all settings and templates created.</p>";
echo "<p><a href=\"hack_install.php?do=uninstall&step=1&hacks=$hacks$fileurl$override\">Click here to uninstall --></b></a></p>\n";
}
if ($step == '1') {
// Put the hacks in an array.
$hacks = explode("|||", $_REQUEST['hacks']);
foreach ($hacks as $key => $hack) {
// Put the hack name in an array.
$hackd = $hack;
unset($hack);
$hack['name'] = $hackd;
$hack['displayname'] = str_replace("_", " ", $hack['name']);
// Check for installed versions.
if (isset($installedhack[$hack[displayname]])) {
// There is a record of the hack being installed.
$hack['installed_build'] = $installedhack[$hack[displayname]]['build'];
$hack['installed_version'] = $installedhack[$hack[displayname]]['version'];
$hack['path'] = $path_to_install . "hacks/$hack[name]/";
$hack['build'] = $hack['installed_build'];
} elseif (!isset($override)) {
// There is no record of the hack being installed and override is not enabled.
echo "There is no record of $hack[displayname] being installed. It cannot be uninstalled.";
unset($hacks[$key]);
$ohnoes = true;
} else {
// There is no record of the hack being installed, but we have override.
// Path to the hack folder.
$hack['path'] = $path_to_install . "hacks/$hack[name]/";
$hack_dir = opendir($hack['path']);
// Find all the builds.
while (($file = readdir($hack_dir)) !== false) {
if (is_numeric($file) && $file != "." && $file != "..") {
$hack['builds'][$file] = $file;
}
}
// Find the latest build.
if (!empty($hack['builds'])) {
arsort($hack['builds']);
foreach ($hack['builds'] as $build) {
$hack['build'] = $build;
break;
}
}
}
// Some sanity and require the file.
if (file_exists("./hacks/$hack[name]/$hack[build]/index.php")) {
chdir("./hacks/$hack[name]/$hack[build]");
require_once("./index.php");
chdir('./../../../');
} else {
if (!isset($ohnoes)) {
echo $hack['displayname'] . " build #" . $hack['build'] . " contains no index.php containing hack information and cannot be uninstalled.<br /><br />";
unset($hacks[$key]);
$ohnoes = true;
}
}
// If we are still sane, uninstall the hack.
if (!isset($ohnoes)) {
// Kill the settinggroups.s
if (isset($settinggroup)) {
foreach ($settinggroup as $group => $sg) {
settinggroup_kill_list($group, $sg['phrase']);
}
}
// Kill the settings.
if (isset($setting)) {
foreach ($setting as $varname => $set) {
setting_kill_list($varname, $set['titlephrase']);
}
}
kill_settings();
// Kill the phrases.
if (isset($phrase)) {
foreach ($phrase as $varname => $text) {
phrase_kill_list($varname);
}
kill_phrases();
}
// Kill the adminhelp.
if (isset($adminhelp)) {
foreach ($adminhelp as $ah) {
adminhelp_kill_list($ah['script'], $ah['action'], $ah['optionname'], $ah['title']);
}
kill_adminhelp();
}
// Kill the templates.
if (isset($templates)) {
foreach ($templates as $name => $content) {
template_kill_list($name);
}
kill_templates();
}
// Run uninstallation queries.
if (isset($query)) {
foreach ($query as $build => $querie) {
if ($build == "uninstall") {
foreach ($querie as $i => $querieie) {
$DB_site->query($querieie);
}
}
}
echo "<font size=\"1\">$hack[displayname]: Ran removal queries.</font><br />";
}
// Remove the hack from the installation log, print some text, and unset a lot of crap.
$DB_site->query("DELETE FROM ".TABLE_PREFIX."his_installed WHERE hack='".addslashes($hack['displayname'])."'");
echo "<font size=\"1\">$hack[displayname]: Removed from installation log.</font><br /><br /><br />";
unset($hack);
unset($templates);
unset($adminhelp);
unset($settinggroup);
unset($setting);
unset($phrase);
unset($query);
} else {
unset($ohnoes);
}
}
$hacks = implode("|||", $hacks);
// Print the ending text and some links. We are done.
echo "<br /><b>Hacks Uninstalled!</b><br /><br />";
echo "<a href=\"hack_install.php?do=install&step=doedits&noinstall=1&hacks=$hacks$fileurl&override=1\"><b>Click here to view these hacks' modifications - you must do them backwards to finish the install. --></b></a><br />\n";
echo "<a href=\"$vboptions[bburl]/$admincpdir/index.php\"><b>Click here to log into your Admin CP. --></b></a><br />\n";
echo "<a href=\"hack_install.php\"><b>Click here to go back to the hack selection page. --></b></a><br />\n";
}
}
// Finish up the page with the footer.
$DB_site->free_result($installedhacks);
if (!isset($_REQUEST['no_cp_footer']) && ($_REQUEST['do'] != "genreadme" && $_REQUEST['do'] != "nothing" && $_REQUEST['text'] != 1)) {
print_cp_footer();
}
$DB_site->free_result($installedhacks);
?>
you should be able to copy and paste that into a new file and call it uninstall.php and run it. although i dont see how it would make a difference since i just copied it and it crashed on you before but hey worth a try