private function loadPlugin() { require_once $this->data['plugin_path']; $c = libFile::parseConfigFile('nimda.conf'); $MySQL = new MySQL($c['mysql_host'], $c['mysql_user'], $c['mysql_pass'], $c['mysql_db']); $this->Plugin = new $this->data['classname'](null, $MySQL); }
private function initBot() { $this->CONFIG = libFile::parseConfigFile('nimda.conf'); $this->MySQL = new MySQL($this->CONFIG['mysql_host'], $this->CONFIG['mysql_user'], $this->CONFIG['mysql_pass'], $this->CONFIG['mysql_db']); $this->autoUpdateSQL(); $this->createTempDir(); $this->initJobs(); $this->initPlugins(); $this->initServers(); $this->timersLastTriggered = time() + 10; // Give him some time to do the connecting before triggering the timers }
function display($template, $cache_id = null, $compile_id = null) { if (substr($template, -4) != '.tpl') { $template .= '.tpl'; } $template_path = $this->template_dir; $check = false; for ($x = 0; $x < $this->levels + 1; $x++) { if (file_exists($template_path . '/' . $template)) { $check = true; break; } $template_path = libFile::stripDirs($template_path, 2) . '/_templates'; } if (!$check) { return false; } $save = $this->template_dir; $this->template_dir = $template_path; parent::display($template, $cache_id, $compile_id); $this->template_dir = $save; }
private function updateGames() { $files = libFilesystem::getFiles(self::FILEDIR, 'conf'); $additions = array(); foreach ($files as $file) { $config = libFile::parseConfigFile(self::FILEDIR . $file); if (file_exists(self::FILEDIR . 'games/' . $config['gamefile'])) { if (!isset($this->games[$config['id']])) { $additions[] = $config['name']; } $this->games[$config['id']] = $config; } } return $additions; }