function customeq_install()
{
    module_addhook("lodge");
    module_addhook("pointsdesc");
    module_addhook("charstats");
    return true;
}
function proveyourself_install()
{
    $condition = "if (\$session['user']['location'] == \"Pleasantville\") {return true;} else {return false;};";
    module_addhook("village", false, $condition);
    module_addhook("footer-hof");
    return true;
}
function jeweler_install()
{
    $condition = "if (\$session['user']['location'] == \"Improbable Central\") {return true;} else {return false;};";
    module_addhook("village", false, $condition);
    module_addhook("biostat");
    return true;
}
function gravebless_install()
{
    module_addhook("ramiusfavors");
    module_addhook("dragonkilltext");
    module_addhook("newday");
    return true;
}
function peerpressure_install()
{
    module_addeventhook("village", "require_once(\"modules/peerpressure.php\"); return peerpressure_victimtest();");
    module_addhook("newday");
    module_addhook("battle-defeat");
    return true;
}
function crying_install()
{
    global $session;
    module_addeventhook("inn", "require_once(\"modules/crying.php\"); return crying_seentest();");
    module_addhook("newday");
    return true;
}
function mountprereq_install()
{
    module_addhook("stables-nav");
    module_addhook("boughtmount");
    module_addhook("dragonkill");
    return true;
}
function unclean_install()
{
    module_addhook("censor");
    module_addhook("header-badword");
    module_addhook("biostat");
    return true;
}
function pinata_install()
{
    module_addeventhook("forest", "return 100;");
    module_addhook("gardens");
    module_addhook("newday");
    return true;
}
function improbablehousing_furnitureshop_install()
{
    $condition = "if (\$session['user']['location'] == \"Improbable Central\") {return true;} else {return false;};";
    module_addhook("village", false, $condition);
    module_addhook("improbablehousing_sleepslot");
    return true;
}
function specialcomments_install()
{
    module_addhook("commentary");
    module_addhook("lodge");
    module_addhook("postcomment");
    return true;
}
function eqbuffhelper_install()
{
    module_addhook("forest");
    module_addhook("newday");
    module_addhook("village");
    return true;
}
function sethsong_install()
{
    // Convert the seenbard field.
    $sql = "DESCRIBE " . db_prefix("accounts");
    $result = db_query($sql);
    while ($row = db_fetch_assoc($result)) {
        if ($row['Field'] == "seenbard") {
            $sql = "SELECT seenbard,acctid FROM " . db_prefix("accounts") . " WHERE seenbard>0";
            $result1 = db_query($sql);
            debug("Migrating seenbard.`n");
            while ($row1 = db_fetch_assoc($result1)) {
                $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) VALUES ('seth','been',{$row1['acctid']},{$row1['seenbard']})";
                db_query($sql);
            }
            //end while
            debug("Dropping seenbard column from the user table.`n");
            $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP seenbard";
            db_query($sql);
            //drop it from the user's session too.
            unset($session['user']['seenbard']);
        }
        //end if
    }
    //end while
    module_addhook("inn");
    module_addhook("newday");
    return true;
}
function iitemcrates_install()
{
    module_addhook("worldnav");
    module_addhook("newday-runonce");
    module_addhook("donation");
    return true;
}
function heidi_install()
{
    $condition = "if (\$session['user']['location'] == \"Kittania\") {return true;} else {return false;};";
    module_addhook("village", false, $condition);
    module_addhook("newday");
    return true;
}
function creatureaddon_install()
{
    module_addhook("creatureencounter");
    module_addhook("battle-victory");
    module_addhook("gravefight-start");
    return true;
}
function settings_install()
{
    module_addhook('footer-news');
    module_addhook('village');
    module_addhook('footer-modules');
    return true;
}
function cityprefs_install()
{
    global $session;
    require_once "lib/tabledescriptor.php";
    $cityprefs = array('cityid' => array('name' => 'cityid', 'type' => 'int unsigned', 'extra' => 'not null auto_increment'), 'module' => array('name' => 'module', 'type' => 'varchar(255)', 'extra' => 'not null'), 'cityname' => array('name' => 'cityname', 'type' => 'varchar(255)', 'extra' => 'not null'), 'key-PRIMARY' => array('name' => 'PRIMARY', 'type' => 'primary key', 'unique' => '1', 'columns' => 'cityid'), 'index-cityid' => array('name' => 'cityid', 'type' => 'index', 'columns' => 'cityid'), 'index-module' => array('name' => 'module', 'type' => 'index', 'columns' => 'module'), 'index-cityname' => array('name' => 'cityname', 'type' => 'index', 'columns' => 'cityname'));
    synctable(db_prefix('cityprefs'), $cityprefs, true);
    if (!is_module_active('cityprefs')) {
        if ($session['user']['superuser'] & ~SU_DOESNT_GIVE_GROTTO) {
            output_notl("`4Installing cityprefs Module.`n");
        }
        $sql = "INSERT INTO " . db_prefix("cityprefs") . " (module,cityname) VALUES ('none','" . getsetting("villagename", LOCATION_FIELDS) . "')";
        db_query($sql);
        $vloc = array();
        $vloc = modulehook("validlocation", $vloc);
        ksort($vloc);
        reset($vloc);
        foreach ($vloc as $loc => $val) {
            $sql = "select modulename from " . db_prefix("module_settings") . " where value='" . addslashes($loc) . "' and setting='villagename'";
            $result = db_query($sql);
            $row = db_fetch_assoc($result);
            $sql = "INSERT INTO " . db_prefix("cityprefs") . " (module,cityname) VALUES ('" . $row['modulename'] . "','" . addslashes($loc) . "')";
            db_query($sql);
        }
    } else {
        if ($session['user']['superuser'] & ~SU_DOESNT_GIVE_GROTTO) {
            output("`4Updating cityprefs Module.`n");
        }
    }
    module_addhook("superuser");
    module_addhook("changesetting");
    return true;
}
function newbfaq_install()
{
    module_addhook("village");
    module_addhook("biostat");
    module_addhook("commentary_talkform");
    return true;
}
function wcgpoints_install()
{
    module_addhook("gardens");
    module_addhook("newday");
    module_addhook("moderate");
    return true;
}
function game_stones_install()
{
    global $session;
    debug("Adding Hooks");
    module_addhook("darkhorsegame");
    return true;
}
function bloodbank_install()
{
    $condition = "if (\$session['user']['location'] == \"New Pittsburgh\") {return true;} else {return false;};";
    module_addhook("village", false, $condition);
    module_addhook("changesetting");
    return true;
}
function oldchurch_install()
{
    module_addhook("newday");
    $condition = "if (\$session['user']['location'] == \"Improbable Central\") {return true;} else {return false;};";
    module_addhook("village", false, $condition);
    return true;
}
function commentaryicons_customrace_install()
{
    module_addhook_priority("postcomment", 100);
    module_addhook("lodge");
    module_addhook("pointsdesc");
    return true;
}
function hundredpointrally_install()
{
    module_addhook("village");
    module_addhook("worldnav");
    module_addhook("charstats");
    return true;
}
function kissingbooth_install()
{
    module_addhook("changesetting");
    module_addhook("newday");
    module_addhook("gardens");
    return true;
}
function stocks_install()
{
    module_addhook("village-desc");
    module_addhook("dragonkill");
    module_addhook("namechange");
    return true;
}
function eboy_install()
{
    module_addhook("village");
    module_addhook("newday-runonce");
    module_addhook("items-returnlinks");
    return true;
}
function quester_install()
{
    module_addeventhook("forest", "return 100;");
    module_addhook("ale");
    module_addhook("footer-hof");
    return true;
}
function worldmap_items_install()
{
    module_addhook("worldnav");
    module_addhook("inventory");
    module_addhook("inventory-predisplay");
    return true;
}