Beispiel #1
0
 public function execute()
 {
     if (Common::getGetString('list', '0') === '1') {
         return $this->module->template("tools/list.tpl");
     }
     $whitelist = array('jpk', 'yabfdbg', 'jcs', 'jdictac', 'wordpat', 'wordlists', 'startcpp', 'encodings');
     $file = Common::getGet('file');
     if (!in_array($file, $whitelist, true)) {
         return GWF_HTML::err('ERR_PARAMETER', array(__FILE__, __LINE__, 'file'));
     }
     # Counter Box
     $count = GWF_Counter::getAndCount($file, 1);
     $box = GWF_Box::box($this->module->lang('pi_viewcount', array($count)));
     # Translations
     $langpath = $this->module->getDir() . '/lang/' . $file;
     #.'/'.$file;
     $trans = new GWF_LangTrans($langpath);
     GWF_Website::setPageTitle($trans->lang('page_title'));
     GWF_Website::setMetaTags($trans->lang('meta_tags'));
     $tVars = array('lang2' => $trans);
     return $this->module->templatePHP("tools/{$file}/{$file}.php", $tVars) . $box;
 }
Beispiel #2
0
 private function increasePageView($by = 1)
 {
     //		require_once 'GWF_Pageview.php';
     //		GWF_Pageview::increaseTodayView($by);
     self::$pagecount = GWF_Counter::getAndCount('pagecount', $by);
     //		$this->saveModuleVar('pagecount', $this->cfgPagecount()+$by);
 }
Beispiel #3
0
 public static function shadowTimer()
 {
     # 1 second over in the Shadowlamb world.
     self::$sr_timestamp = GWF_Counter::getAndCount('SR4_TIME', self::SECONDS_PER_TICK);
     # Execute Web Commands
     // 		self::shadowTimerWebcommands();
     if (defined('SL4_REALS')) {
         self::shadowTimerRealNPCs();
     }
     # All parties:
     $partyids = array_keys(self::$parties);
     shuffle($partyids);
     # Shuffle which party goes first to have evenly distributed winners in race conditions.
     foreach ($partyids as $id) {
         # still there?
         if (isset(self::$parties[$id])) {
             if (self::$parties[$id]->getTimestamp() < time() - self::KICK_IDLE_TIMEOUT) {
                 self::removeParty(self::$parties[$id]);
             } else {
                 self::$parties[$id] instanceof SR_Party;
                 self::$parties[$id]->timer(self::$sr_timestamp);
             }
         }
     }
     # Next tick in one second pls.
     Dog_Timer::addTimer(array(__CLASS__, 'shadowTimer'), NULL, self::TICKLEN, false);
 }