Example #1
0
 public function getForm()
 {
     $langid = Common::getPostString('langid', GWF_Language::getEnglish()->getID());
     require_once GWF_CORE_PATH . 'module/Category/GWF_CategorySelect.php';
     //key => array(TYPE, default, text, classname)
     //		GWF_Language::setShowSupported(true);
     $data = array('langid' => array(GWF_Form::SELECT, GWF_LangSelect::single(GWF_Language::SUPPORTED, 'langid', $langid), $this->module->lang('th_langid')), 'catid' => array(GWF_Form::SELECT, GWF_CategorySelect::single('catid', Common::getPostString('catid', '1'), 0), $this->module->lang('th_category')), 'title' => array(GWF_Form::STRING, '', $this->module->lang('th_title')), 'message' => array(GWF_Form::MESSAGE, '', $this->module->lang('th_message')), 'div1' => array(GWF_Form::DIVIDER), 'div2' => array(GWF_Form::DIVIDER), 'preview' => array(GWF_Form::SUBMIT, $this->module->lang('btn_preview'), ''), 'add' => array(GWF_Form::SUBMIT, $this->module->lang('btn_add'), ''));
     return new GWF_Form($this, $data);
 }
Example #2
0
 private static function installSiteWeChall(Module_WeChall $module)
 {
     if (false !== ($site = WC_Site::getWeChall())) {
         return '';
     }
     $options = WC_Site::AUTO_UPDATE;
     $site = new WC_Site(array('site_id' => 1, 'site_status' => WC_Site::UP, 'site_name' => 'WeChall', 'site_classname' => 'WC', 'site_logo_v' => 0, 'site_country' => 0, 'site_language' => GWF_Language::getEnglish()->getID(), 'site_joindate' => '20080218000000', 'site_launchdate' => '20080218', 'site_authkey' => 'iusdgsdgsiog3!s', 'site_xauthkey' => 'rw98t693g!9sg', 'site_irc' => 'irc://irc.idlemonkeys.net#wechall', 'site_url' => 'http://' . GWF_DOMAIN . GWF_WEB_ROOT, 'site_url_mail' => 'index.php?mo=WeChall&me=CrossSite&link=%USERNAME%&email=%EMAIL%&no_session=yes', 'site_url_score' => 'index.php?mo=WeChall&me=CrossSite&score=%USERNAME%&no_session=yes', 'site_url_profile' => 'profile/%USERNAME%', 'site_score' => 0, 'site_basescore' => 10000, 'site_avg' => 0.0, 'site_dif' => 3.0, 'site_fun' => 3.0, 'site_vote_dif' => 0, 'site_vote_fun' => 0, 'site_maxscore' => 0, 'site_challcount' => 0, 'site_usercount' => 0, 'site_linkcount' => 0, 'site_visit_in' => 0, 'site_visit_out' => 0, 'site_options' => $options, 'site_tags' => 'Exploit,Programming,Stegano,Crypto', 'site_boardid' => 0, 'site_threadid' => 0, 'site_tagbits' => 0, 'site_color' => '0000FF'));
     if (false === $site->onCreateSite($module, $back)) {
         return $back;
     }
     require_once GWF_CORE_PATH . 'module/WeChall/WC_SiteDescr.php';
     if (false === WC_SiteDescr::insertDescr($site->getID(), 1, 'Please edit me :)')) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return '';
 }
Example #3
0
 public function showAccountLinkNews()
 {
     //		$db = gdo_db();
     //		$users = GWF_TABLE_PREFIX.'user';
     ////		$history = GWF_TABLE_PREFIX.'wc_user_history';
     //		$regat = GWF_TABLE_PREFIX.'wc_regat';
     //		$sites = GWF_TABLE_PREFIX.'wc_site';
     ////		$time = GWF_Time::getTimeWeekStart();
     //		$today = GWF_Time::getDate(GWF_Date::LEN_DAY);
     //		$query =
     //			"SELECT user_name, site_name, regat_solved ".
     //			"FROM $regat ".
     //			"LEFT JOIN $users ON user_id=regat_uid ".
     //			"LEFT JOIN $sites ON site_id=regat_sid ".
     //			"WHERE regat_linkdate='$today' AND regat_solved>0";
     //		if (false === ($result = $db->queryAll($query))) {
     //			return '';
     //		}
     $result = $this->getFirstLinkNews();
     if (count($result) === 0) {
         return '';
     }
     $msg = '';
     foreach ($result as $row) {
         $un = $row['fili_username'];
         $sn = $row['fili_sitename'];
         //			$site_link = sprintf('[url=%s]%s[/url]', GWF_WEB_ROOT, urlencode($sn), GWF_HTML::display($sn));
         $site_link = sprintf('[b]%s[/b]', $sn);
         $perc = sprintf('%.02f', $row['fili_percent']);
         $profile_link = sprintf('[url=/profile/%s]%s[/url]', $un, $un);
         $msg .= $this->lang('newsrow_link', array($profile_link, $site_link, $perc)) . PHP_EOL;
         //			$msg .= sprintf('%s', $this->lang('newsrow_link', sprintf('<a href="%sprofile/%s">%s</a>', GWF_WEB_ROOT, urlencode($un), GWF_HTML::display($row['fili_username'])), , )).PHP_EOL;
     }
     $title = $this->lang('newsrow_linkt');
     $wechalluser = $this->cfgWeChallUser();
     $english = GWF_Language::getEnglish();
     $news = GWF_News::newNews(GWF_Time::getDate(GWF_Date::LEN_SECOND), 0, $wechalluser->getID(), $english->getID(), $title, $msg, true);
     return Module_News::displayItem($news);
 }
Example #4
0
 private static function createHelpLangFile()
 {
     # Get current english from src.
     $help = Shadowhelp::getAllHelp();
     $help = self::prepareHelpArrayForLangFiles($help);
     # Update existing.
     foreach (Dog_Lang::getISOCodes() as $iso) {
         $path = Shadowrun4::getShadowDir() . "lang/help/shadowhelp_{$iso}.php";
         if (false === ($lang = GWF_Language::getByISO($iso))) {
             $lang = GWF_Language::getEnglish();
         }
         if (false === self::createHelpLangFileB($lang, $path, $help, false)) {
             return false;
         }
     }
     # Build english from source.
     $path = Shadowrun4::getShadowDir() - 'lang/item/shadowitems_en.php';
     return self::createHelpLangFileB(GWF_Language::getEnglish(), $path, $help, true);
 }