コード例 #1
0
ファイル: options.php プロジェクト: sonicmaster/RPG
     }
     // check buildings
     $sql = "SELECT *\r\n\t\t\t\tFROM ugml_planets\r\n\t\t\t\tWHERE (b_building_id != 0\r\n\t\t\t\t\tOR b_tech_id != 0\r\n\t\t\t\t\tOR b_hangar_id != '')\r\n\t\t\t\t\tAND id_owner = " . WCF::getUser()->userID;
     $planet = WCF::getDB()->getFirstRow($sql);
     if ($planet) {
         message('Du hast auf dem ' . Planet::getInstance(null, $planet) . ' noch etwas in Bau!');
     }
     if (!$fleet && !$planet && !$user['urlaubs_modus']) {
         $urlaubs_modus = time() + 60 * 60 * 24 * 2;
     } else {
         $urlaubs_modus = $user['urlaubs_modus'];
     }
 } else {
     if ($user['urlaubs_modus']) {
         // umode bug workaround
         $planets = Planet::getByUserID(WCF::getUser()->userID);
         foreach ($planets as $planet) {
             $planet->calculateResources();
         }
     }
     if (TIME_NOW > $user['urlaubs_modus']) {
         $urlaubs_modus = 0;
     } else {
         $urlaubs_modus = $user['urlaubs_modus'];
     }
 }
 //Borrar cuenta
 if (isset($_POST["db_deaktjava"]) && $_POST["db_deaktjava"] == 'on') {
     $db_deaktjava = "1";
 } else {
     $db_deaktjava = "0";
コード例 #2
0
 /**
  * Checks if the user requests a planet change.
  */
 protected function checkPlanetChange()
 {
     if (!(isset($_GET['cp']) || isset($_POST['cp'])) || !(isset($_REQUEST['page']) || isset($_REQUEST['form']) || isset($_REQUEST['action']))) {
         return;
     }
     $planetID = isset($_GET['cp']) ? intval(@$_GET['cp']) : intval(@$_POST['cp']);
     $planets = Planet::getByUserID($this->userID);
     if (isset($planets[$planetID])) {
         $this->changePlanet($planetID, $planets[$planetID]->className);
         // now create new request without planet change (forwarding)
         unset($_REQUEST['cp']);
         if (isset($_REQUEST['re'])) {
             unset($_REQUEST['re']);
         }
         $location = LWUtil::getFileName() . '.php' . LWUtil::getArgsStr();
         WCF::getDB()->deleteShutdownUpdates();
         header('Location: ' . $location);
         exit;
     }
 }
コード例 #3
0
ファイル: LWCore.class.php プロジェクト: sonicmaster/RPG
 /**
  * @see	WCF::assignDefaultTemplateVariables()
  */
 protected function assignDefaultTemplateVariables()
 {
     parent::assignDefaultTemplateVariables();
     $dpath = !self::getUser()->dpath ? DEFAULT_SKINPATH : self::getUser()->dpath;
     if (!defined('DPATH')) {
         define('DPATH', $dpath);
     }
     self::getTPL()->assign(array('dpath' => $dpath, 'planets' => Planet::getByUserID(WCF::getUser()->userID, null, true), 'site' => LWUtil::getFileName(), 'args' => LWUtil::getArgsStr()));
 }