function subrosian_decay()
 {
     global $GLOBAL;
     foreach ($GLOBAL['subrosian']['water_use'] as $loop_key => $loop_content) {
         if ($GLOBAL['user_info']['subrosian']['status'][$loop_key] < 0.15) {
             $GLOBAL['user_info']['subrosian']['color'][$loop_key] = "Black";
             if ($GLOBAL['user_info']['subrosian']['favorite'] == $loop_key) {
                 include $_SERVER['DOCUMENT_ROOT'] . "/Members/apply.color.php";
                 subrosian_create(strtolower($GLOBAL['user_info']['user_name']), "black", strtolower($GLOBAL['user_info']['user_class']));
             }
         } else {
             $GLOBAL['user_info']['subrosian']['water'][$loop_key] *= pow($GLOBAL['subrosian']['update_time'] / time(), 800);
             $GLOBAL['user_info']['subrosian']['food'][$loop_key] *= pow($GLOBAL['subrosian']['update_time'] / time(), 650);
             $GLOBAL['user_info']['subrosian']['water'][$loop_key] = round($GLOBAL['user_info']['subrosian']['water'][$loop_key], 2);
             $GLOBAL['user_info']['subrosian']['food'][$loop_key] = round($GLOBAL['user_info']['subrosian']['food'][$loop_key], 2);
         }
     }
     mysql_query("UPDATE `subrosian_main` SET `color`='" . implode(":", $GLOBAL['user_info']['subrosian']['color']) . "', `water`='" . implode(":", $GLOBAL['user_info']['subrosian']['water']) . "', `food`='" . implode(":", $GLOBAL['user_info']['subrosian']['food']) . "' WHERE `id`=" . $GLOBAL['user_info']['user_id'] . " LIMIT 1");
     mysql_query("UPDATE `subrosian_date` SET `viewdate`=UNIX_TIMESTAMP() WHERE `id`=" . $GLOBAL['user_info']['user_id'] . " LIMIT 1");
 }
Esempio n. 2
0
     }
     if ($_POST['favorite']) {
         mysql_query("UPDATE `subrosian_main` SET `favorite`=" . $_GET['nr'] . " WHERE `id`=" . $GLOBAL['user_info']['user_id'] . " LIMIT 1");
         include $_SERVER['DOCUMENT_ROOT'] . "/Members/apply.color.php";
         subrosian_create(strtolower($GLOBAL['user_info']['user_name']), strtolower($GLOBAL['user_info']['subrosian']['color'][$_POST['favorite']]), strtolower($GLOBAL['user_info']['user_class']));
     }
 }
 // Change color
 if ($_POST['color']) {
     data_fetch("color", "SELECT * FROM `subrosian_items` WHERE `id`=" . $_POST['color'] . " LIMIT 1");
     $GLOBAL['user_info']['subrosian']['color'][$_GET['nr']] = $GLOBAL['color'][strtolower($GLOBAL['user_info']['subrosian']['color'][$_GET['nr']])][strtolower(str_replace(" color", "", $color_data['name']))];
     mysql_query("UPDATE `subrosian_main` SET `color`='" . implode(":", $GLOBAL['user_info']['subrosian']['color']) . "' WHERE `id`=" . $GLOBAL['user_info']['user_id'] . " LIMIT 1");
     mysql_query("UPDATE `subrosian_inventory` SET `" . $_POST['color'] . "`=`" . $_POST['color'] . "`-1 WHERE `id`=" . $GLOBAL['user_info']['user_id'] . " LIMIT 1");
     if ($_GET['nr'] == $GLOBAL['user_info']['subrosian']['favorite']) {
         include $_SERVER['DOCUMENT_ROOT'] . "/Members/apply.color.php";
         subrosian_create(strtolower($GLOBAL['user_info']['user_name']), strtolower($GLOBAL['user_info']['subrosian']['color'][$_GET['nr']]), strtolower($GLOBAL['user_info']['user_class']));
     }
 }
 // Go to surgical bay
 if ($_POST['misc']) {
     header("Location: http://" . $_SERVER['HTTP_HOST'] . "/Members/Subrosians/plastic.php");
     exit;
 }
 // Update stats on user action
 if ($_POST['update']) {
     data_fetch("item", "SELECT * FROM `subrosian_items` WHERE `id`=" . $_POST['update'] . " LIMIT 1");
     $subrosian_tolerance = array("water" => 7200, "food" => 14400, "attention" => 0);
     $GLOBAL['user_info']['subrosian'][$item_data['type']][$_GET['nr']] += ($GLOBAL['subrosian'][$item_data['type'] . '_diff'][$_GET['nr']] - $subrosian_tolerance[$item_data['type']] + 1) / abs($GLOBAL['subrosian'][$item_data['type'] . '_diff'][$_GET['nr']] - $subrosian_tolerance[$item_data['type']] + 1) * $item_data['increase'];
     $GLOBAL['user_info']['subrosian'][$item_data['type']][$_GET['nr']] = round($GLOBAL['user_info']['subrosian'][$item_data['type']][$_GET['nr']], 2);
     if ($GLOBAL['user_info']['subrosian'][$item_data['type']][$_GET['nr']] > 1) {
         $GLOBAL['user_info']['subrosian'][$item_data['type']][$_GET['nr']] = 1;
Esempio n. 3
0
    if ($mem_c_rows < 1 && $mem_t_rows < 1) {
        mysql_query("INSERT INTO `user_temporary` (`name`,`password`,`email`,`md5tag`,`joined`) VALUES ('" . $_POST['mem_username'] . "'," . $_POST['mem_pass'][0] . ",'" . $_POST['mem_email'] . "',MD5('" . $_POST['mem_username'] . "'),NOW())");
        $mail_message = "\r\nWelcome as a member at Zelda Shrine!\r\n\r\nIn order to activate your account, please follow the link below.\r\nhttp://www.zshrine.com/Members/apply.action.php?activate=1&md5=" . md5($_POST['mem_username']) . "\r\n\r\nSincerely,\r\nThe staff at Zelda Shrine";
        mail($_POST['mem_email'], "Zelda Shrine: Membership", $mail_message, "FROM: carl@zshrine.com");
        header("Location: http://" . $_SERVER['HTTP_HOST'] . "/Members/apply.message.php?applied=1");
        exit;
    } else {
        header("Location: http://" . $_SERVER['HTTP_HOST'] . "/Members/apply.message.php?exists=1");
        exit;
    }
}
if (isset($_GET['activate'])) {
    include $_SERVER['DOCUMENT_ROOT'] . "/Members/apply.color.php";
    data_fetch("mem_a", "SELECT `name`,`password`,`email` FROM `user_temporary` WHERE `md5tag`='" . $_GET['md5'] . "' LIMIT 1");
    if ($mem_a_rows < 1) {
        header("Location: http://" . $_SERVER['HTTP_HOST'] . "/Members/apply.message.php?expired=1");
        exit;
    }
    mysql_query("INSERT INTO `user_data` (`name`,`password`,`joined`,`logon`,`email`,`class`,`ip`) VALUES ('" . $mem_a_data['name'] . "','" . $mem_a_data['password'] . "',CURRENT_DATE(),CURRENT_DATE(),'" . $mem_a_data['email'] . "','Member','" . $_SERVER['REMOTE_ADDR'] . "')") or die("Fel 1");
    data_fetch("id", "SELECT LAST_INSERT_ID() AS `id`");
    mysql_query("INSERT INTO `subrosian_main` (`id`,`name`,`color`,`water`,`food`,`attention`,`money`,`favorite`) VALUES ('" . $id_data['id'] . "','" . $mem_a_data['name'] . "','Pink','0.7','0.7','1','15','0')") or die("Fel 2");
    mysql_query("INSERT INTO `subrosian_date` (`id`,`viewdate`,`usedate`,`water`,`food`,`attention`) VALUES ('" . $id_data['id'] . "',UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),'0','0','0')") or die("Fel 3");
    mysql_query("INSERT INTO `subrosian_inventory` (`id`,`1`,`2`,`3`,`4`,`5`,`6`,`7`) VALUES ('" . $id_data['id'] . "',0,0,0,0,0,0,1)") or die("Fel 4");
    mysql_query("DELETE FROM `user_temporary` WHERE `md5tag`='" . $_GET['md5'] . "' LIMIT 1");
    subrosian_create(strtolower($mem_a_data['name']), "pink", "member");
    setcookie("ZeldaShrine", $mem_a_data['name'], time() * 2, "/", ".zshrine.com");
    $mail_message = "\r\nWelcome as a member at Zelda Shrine!\r\n\r\nYour account has now been activated and you have been logged onto the site.\r\nShould you forget your password, just use the password retrieval function.\r\n\r\nPlease check on your subrosians at:\r\nhttp://www.zshrine.com/Members/Subrosians\r\n\r\nIntroduce yourself at the community forum:\r\nhttp://www.zshrine.com/Forum/forum.php\r\n\r\nSincerely,\r\nThe staff at Zelda Shrine";
    mail($mem_a_data['email'], "Zelda Shrine: Membership", $mail_message, "FROM: carl@zshrine.com") or die("Could not send email, please contact webmaster.");
    header("Location: http://" . $_SERVER['HTTP_HOST'] . "/Members/apply.message.php?activated=1");
    exit;
}
Esempio n. 4
0
<?php

include $_SERVER['DOCUMENT_ROOT'] . "/Members/Subrosians/color.function.php";
include $_SERVER['DOCUMENT_ROOT'] . "/includes/db.connect.php";
include $_SERVER['DOCUMENT_ROOT'] . "/includes/db.fetch.php";
$subrosian_colors = array("black" => array(0, 0, 0), "blue" => array(30, 40, 220), "brown" => array(147, 117, 27), "green" => array(30, 220, 40), "pink" => array(255, 160, 160), "purple" => array(220, 30, 220), "red" => array(255, 0, 0), "turquoise" => array(30, 220, 220), "white" => array(255, 255, 255), "yellow" => array(220, 220, 30), "custom" => array(255, 160, 160));
foreach ($subrosian_colors as $key => $content) {
    subrosian_create(strtolower("generic." . $key), $key, "member");
}
//	data_fetch("member","SELECT `id`,`name`,`class` FROM `user_data`");
//	for($i=0;$i<$member_rows;$i++,$member_data = mysql_fetch_array($member_array)){
//		data_fetch("subrosian","SELECT `color`,`favorite` FROM `subrosian_main` WHERE `id`=".$member_data['id']." LIMIT 1");
//		$subrosian_data['color'] = explode(":",$subrosian_data['color']);
//		if(strtolower($subrosian_data['color'][$subrosian_data['favorite']]) == "custom"){
//			mysql_query("UPDATE `subrosian_inventory` SET `10`=`10`+1 WHERE `id`=".$member_data['id']." LIMIT 1");
//		}
//		subrosian_create(strtolower($member_data['name']),strtolower($subrosian_data['color'][$subrosian_data['favorite']]),strtolower($member_data['class']));
//	}
header("Location: http://" . $_SERVER['HTTP_HOST'] . "/Members/Subrosians/color.maker.php");
exit;
Esempio n. 5
0
include $_SERVER['DOCUMENT_ROOT'] . "/includes/db.connect.php";
include $_SERVER['DOCUMENT_ROOT'] . "/includes/db.fetch.php";
include $_SERVER['DOCUMENT_ROOT'] . "/includes/values.main.php";
include $_SERVER['DOCUMENT_ROOT'] . "/includes/values.subrosian.php";
include $_SERVER['DOCUMENT_ROOT'] . "/includes/values.subrosian.color.php";
if (isset($_COOKIE['ZeldaShrine'])) {
    // Customize a subrosian using plastic surgery
    if (isset($_GET['customize'])) {
        foreach ($_POST['color_fur'] as $main_key => $main_content) {
            if ($main_content > 255) {
                $_POST['color_fur'][$main_key] = 255;
            }
        }
        include $_SERVER['DOCUMENT_ROOT'] . "/Members/apply.color.php";
        subrosian_create(strtolower($GLOBAL['user_info']['user_name']), $_POST, strtolower($GLOBAL['user_info']['user_class']), "1");
        // Redirect
        header("Location: http://" . $_SERVER['HTTP_HOST'] . "/Members/Subrosians/plastic.php?f=" . implode("¤", $_POST['color_fur']));
        exit;
    }
    // Finalize the subrosian
    if (isset($_GET['finalize'])) {
        if (is_file($_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/" . strtolower($GLOBAL['user_info']['user_name']) . ".large.gif")) {
            unlink($_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/" . strtolower($GLOBAL['user_info']['user_name']) . ".large.gif");
            unlink($_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/" . strtolower($GLOBAL['user_info']['user_name']) . ".forum.gif");
            unlink($_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/" . strtolower($GLOBAL['user_info']['user_name']) . ".skin.gif");
        }
        rename($_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/temporary/" . strtolower($GLOBAL['user_info']['user_name']) . ".large.gif", $_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/" . strtolower($GLOBAL['user_info']['user_name']) . ".large.gif");
        rename($_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/temporary/" . strtolower($GLOBAL['user_info']['user_name']) . ".forum.gif", $_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/" . strtolower($GLOBAL['user_info']['user_name']) . ".forum.gif");
        rename($_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/temporary/" . strtolower($GLOBAL['user_info']['user_name']) . ".skin.gif", $_SERVER['DOCUMENT_ROOT'] . "/images/main/Members/" . strtolower($GLOBAL['user_info']['user_name']) . ".skin.gif");
        $GLOBAL['user_info']['subrosian']['color'][$GLOBAL['user_info']['subrosian']['favorite']] = "Custom";