Exemplo n.º 1
0
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->ovents = Ovent::getByConditions(array('userID' => WCF::getUser()->userID, 'checked' => 0));
     $this->hovents = Ovent::getByConditions(array('userID' => WCF::getUser()->userID, 'checked' => 1));
     // news
     WCF::getCache()->addResource('news-' . PACKAGE_ID, WCF_DIR . 'cache/cache.news-' . PACKAGE_ID . '.php', LW_DIR . 'lib/system/cache/CacheBuilderNews.class.php');
     $this->news = WCF::getCache()->get('news-' . PACKAGE_ID);
 }
Exemplo n.º 2
0
 /**
  * Updates the building ovent for a planet.
  *
  * @param	int		planet id
  */
 public static function check($planetID)
 {
     $ovents = Ovent::getByConditions(array('planetID' => $planetID, 'oventTypeID' => self::OVENT_TYPE_ID));
     $planet = Planet::getInstance($planetID);
     // event needed
     if ($planet->b_building > time()) {
         if (isset($ovents[0])) {
             if ($ovents[0]->time == $planet->b_building) {
                 // no changes needed
                 return;
             }
             // delete old ovent
             $ovents[0]->getEditor()->delete();
         }
         // create new
         $data = self::getData($planet);
         $fields = array('userID' => $planet->id_owner, 'planetID' => $planetID);
         OventEditor::create(self::OVENT_TYPE_ID, $planet->b_building, null, $planetID, $fields, 0, $data);
     } else {
         foreach ($ovents as $ovent) {
             $ovent->getEditor()->delete();
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Updates the fleet data of the return events.
  */
 public static function update(Fleet $fleet)
 {
     $ovents = Ovent::getByConditions(array('oventTypeID' => self::OVENT_TYPE_ID, 'relationalID' => $fleet->fleetID), true);
     foreach ($ovents as $ovent) {
         $ovent->getEditor()->update();
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->ovents = Ovent::getByConditions(array('userID' => WCF::getUser()->userID, 'checked' => 1));
 }