コード例 #1
0
ファイル: ScoringFAQ.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     GWF_Website::setPageTitle($this->module->lang('pt_scorefaq'));
     GWF_Website::setMetaTags($this->module->lang('mt_scorefaq'));
     $tVars = array('scoring' => new GWF_LangTrans(GWF_CORE_PATH . 'module/WeChall/lang/scoring/_wc_scoring'));
     return $this->module->templatePHP('scoring_faq.php', $tVars);
 }
コード例 #2
0
ファイル: Module_Konzert.php プロジェクト: sinfocol/gwf3
 public function onStartup()
 {
     $this->onLoadLanguage();
     GWF_Website::addJavascript(GWF_WEB_ROOT . 'tpl/konz/js/konzert.js?v=5');
     GWF_Website::addJavascriptOnload('initKonzert();');
     GWF_Website::setMetaTags($this->lang('meta_tags'));
     GWF_Website::setMetaDescr($this->lang('meta_descr'));
 }
コード例 #3
0
ファイル: Tutorial.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     GWF_Website::setPageTitle($this->module->lang('pt_tut'));
     GWF_Website::setMetaTags($this->module->lang('mt_tut'));
     GWF_Website::setMetaDescr($this->module->lang('md_tut'));
     $tVars = array();
     return $this->module->templatePHP('tutorial.php', $tVars);
 }
コード例 #4
0
ファイル: About.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     $lang = new GWF_LangTrans(GWF_CORE_PATH . 'module/WeChall/lang/about/_wc_about');
     GWF_Website::setPageTitle($lang->lang('about_pagetitle'));
     GWF_Website::setMetaTags($lang->lang('about_meta'));
     $tVars = array('about_08' => $lang->lang('about_08'));
     return $this->module->template('about.tpl', $tVars);
 }
コード例 #5
0
ファイル: Search.php プロジェクト: sinfocol/gwf3
 public function templateSearch(array $matches, $term)
 {
     GWF_Website::setPageTitle($this->module->lang('pt_search'));
     GWF_Website::setMetaTags($this->module->lang('mt_search'));
     GWF_Website::setMetaDescr($this->module->lang('md_search'));
     $tVars = array('cloud' => $this->module->templateCloud(), 'matches' => $this->module->templateLinks($matches, '#', '', ''), 'form' => $this->templateQuickSearch(), 'term' => $term);
     return $this->module->templatePHP('search.php', $tVars);
 }
コード例 #6
0
ファイル: Form.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     GWF_Website::setPageTitle($this->module->lang('page_title'));
     GWF_Website::setMetaTags($this->module->lang('page_meta'));
     if (false !== Common::getPost('contact')) {
         return $this->onSend();
     }
     return $this->templateForm();
 }
コード例 #7
0
ファイル: Module_PoolTool.php プロジェクト: sinfocol/gwf3
 public function onStartup()
 {
     require_once 'PT.php';
     require_once 'PT_Menu.php';
     self::$instance = $this;
     $this->onLoadLanguage();
     //		GWF_Website::setPageTitlePre('PoolTool');
     GWF_Website::setMetaTags($this->lang('mt_about'));
     GWF_Website::setMetaDescr($this->lang('md_about'));
 }
コード例 #8
0
ファイル: Form.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     if (false !== Common::getPost('edit')) {
         return $this->onEditSettings() . $this->templateSettings();
     }
     GWF_Website::setPageTitle($this->module->lang('pt_settings'));
     GWF_Website::setMetaTags($this->module->lang('mt_settings'));
     GWF_Website::setMetaTags($this->module->lang('md_settings'));
     return $this->templateSettings();
 }
コード例 #9
0
ファイル: NewLinks.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     GWF_Website::setPageTitle($this->module->lang('pt_new_links'));
     GWF_Website::setMetaTags($this->module->lang('mt_new_links'));
     GWF_Website::addJavascript(GWF_WEB_ROOT . 'js/module/Links/gwf_links.js');
     if (Common::getGet('markread') !== false) {
         return $this->onMarkAllRead() . $this->templateNewLinks();
     }
     return $this->templateNewLinks();
 }
コード例 #10
0
ファイル: Page.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     GWF_ChatOnline::onRequest($this->module);
     GWF_Website::setPageTitle($this->module->lang('pt_chat'));
     GWF_Website::setMetaTags($this->module->lang('mt_chat'));
     GWF_Website::addJavascript(GWF_WEB_ROOT . 'js/module/Chat/gwf_chat.js?v=4');
     if (false !== Common::getPost('post')) {
         return $this->onPost() . $this->templatePage();
     }
     return $this->templatePage();
 }
コード例 #11
0
ファイル: Mibbit.php プロジェクト: sinfocol/gwf3
 private function templateMibbit()
 {
     if (!$this->module->cfgMibbit()) {
         return GWF_HTML::err('ERR_MODULE_DISABLED', array('Chat_Mibbit'));
     }
     GWF_Website::setPageTitle($this->module->lang('pt_irc_chat'));
     GWF_Website::setMetaTags($this->module->lang('mt_irc_chat'));
     GWF_Website::setMetaDescr($this->module->lang('md_irc_chat'));
     $tVars = array('href_webchat' => GWF_WEB_ROOT . 'chat', 'href_ircchat' => GWF_WEB_ROOT . 'irc_chat', 'href_ircchat_full' => GWF_WEB_ROOT . 'irc_chat_fullscreen', 'mibbit_url' => $this->module->cfgMibbitURL(), 'mibbit' => $this->module->cfgMibbit(), 'gwf_chat' => $this->module->cfgGWFChat());
     return $this->module->templatePHP('mibbit.php', $tVars);
 }
コード例 #12
0
ファイル: Overview.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     $module = $this->module;
     $module instanceof Module_PageBuilder;
     $user = GWF_User::getStaticOrGuest();
     GWF_Website::setMetaTags($module->lang('mt_overview'));
     GWF_Website::setMetaDescr($module->lang('md_overview'));
     GWF_Website::setPageTitle($module->lang('overview_title'));
     $tVars = array('add_perms' => $module->isAuthor($user), 'add_guest' => $module->cfgLockedPosting(), 'href_add' => GWF_WEB_ROOT . 'index.php?mo=PageBuilder&me=Add', 'href_search' => GWF_WEB_ROOT . 'index.php?mo=PageBuilder&me=Search');
     return $this->module->template('overview.tpl', $tVars);
 }
コード例 #13
0
ファイル: Forum.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     if (false !== ($error = $this->sanitize())) {
         return $error;
     }
     GWF_Website::setPageTitle($this->module->lang('pt_board', array($this->board->getVar('board_title'))));
     GWF_Website::setMetaDescr($this->module->lang('md_board', array($this->board->getVar('board_descr'))));
     GWF_Website::setMetaTags($this->module->lang('mt_board'));
     if (false !== Common::getGet('mark_all_read')) {
         return $this->markAllRead() . $this->templateForum();
     }
     return $this->templateForum();
 }
コード例 #14
0
ファイル: Profile.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     if (false === ($user = GWF_User::getByName(Common::getGet('username')))) {
         return GWF_HTML::err('ERR_UNKNOWN_USER');
     }
     if ($user->isDeleted()) {
         return GWF_HTML::err('ERR_UNKNOWN_USER');
     }
     $uname = $user->displayUsername();
     GWF_Website::setPageTitle($this->module->lang('pt_profile', array($uname, $uname)));
     GWF_Website::setMetaTags($this->module->lang('mt_profile', array($uname, $uname)));
     GWF_Website::setMetaDescr($this->module->lang('md_profile', array($uname, $uname)));
     return $this->profile($user);
 }
コード例 #15
0
ファイル: Show.php プロジェクト: sinfocol/gwf3
 public function templateShow()
 {
     if (false === ($news = GWF_News::getNewsQuick($this->module->getNewsPerPage(), $this->catid, $this->page, GWF_Language::getCurrentID()))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     $date = count($news) > 0 ? $news[0]['news_date'] : GWF_Settings::getSetting('gwf_site_birthday') . '090000';
     $date = GWF_Time::displayDate($date);
     GWF_Website::setPageTitle($this->module->lang('pt_news', array($date)));
     GWF_Website::setMetaTags($this->module->lang('mt_news', array($date)));
     GWF_Website::setMetaDescr($this->module->lang('md_news', array($this->page, $this->nPages)));
     //		$mod_forum = GWF_Module::getModule('Forum', true);
     $tVars = array('news' => $news, 'titles' => GWF_News::getTitlesQuick($this->catid, GWF_Language::getCurrentID()), 'cats' => GWF_News::getCategories(), 'catid' => $this->catid, 'cat' => GWF_HTML::display($this->catTitle), 'page_menu' => $this->getPageMenu(), 'page' => $this->page, 'can_sign' => $this->module->canSignNewsletter(GWF_Session::getUser()), 'href_sign_news' => $this->module->hrefSignNewsletter(), 'may_add' => GWF_User::isAdminS() || GWF_User::isStaffS(), 'href_add' => $this->module->hrefAddNews());
     return $this->module->templatePHP('show.php', $tVars);
 }
コード例 #16
0
ファイル: Show.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     # Get GB
     if (false === ($gb = GWF_Guestbook::getByID(Common::getGet('gbid')))) {
         return $this->module->error('err_gb');
     }
     # SEO
     GWF_Website::setPageTitle($gb->displayTitle());
     GWF_Website::setMetaTags($gb->displayDescr());
     # Permission
     if (!$gb->canView(GWF_Session::getUser())) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     return $this->templateShow($gb);
 }
コード例 #17
0
ファイル: Sites.php プロジェクト: sinfocol/gwf3
 private function setPageDescription($tag)
 {
     $which = (string) $this->getWhich();
     if ($tag !== '') {
         $tag = " {$tag} ";
     }
     if ($tag !== '') {
         $this->pageTitle = $this->module->lang('pt_sites_' . $which . '_tagged', array($tag));
     } else {
         $this->pageTitle = $this->module->lang('pt_sites_' . $which);
     }
     GWF_Website::setPageTitle($this->pageTitle);
     GWF_Website::setMetaDescr($this->module->lang('md_sites_' . $which));
     GWF_Website::setMetaTags($this->module->lang('mt_sites_' . $which));
 }
コード例 #18
0
ファイル: RankingLang.php プロジェクト: sinfocol/gwf3
 private function templateRanking(GWF_Language $lang, $user)
 {
     $db = gdo_db();
     $ipp = 50;
     $iso = $lang->getISO();
     $langid = $lang->getID();
     $users = GWF_TABLE_PREFIX . 'user';
     $regat = GWF_TABLE_PREFIX . 'wc_regat';
     # Count number of users playing this language.
     $query = "SELECT COUNT(DISTINCT regat_uid) AS c FROM {$regat} WHERE regat_langid={$langid} AND regat_options&4=0";
     if (false === ($result = $db->queryFirst($query))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     # Page Menu
     $nItems = intval($result['c']);
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     list($page, $hl_rank) = $this->getPageRank($langid, $ipp, $user);
     GWF_Website::setPageTitle($this->module->lang('pt_langrank', array($lang->displayName(), $page, $nPages)));
     GWF_Website::setMetaTags($this->module->lang('mt_ranking_lang', array($lang->displayName())));
     GWF_Website::setMetaDescr($this->module->lang('md_ranking_lang', array($lang->displayName(), $page, $nPages)));
     //		echo 'PAGE:';
     //		var_dump($page);
     //
     //		echo 'RANK:';
     //		var_dump($hl_rank);
     //
     $page = Common::clamp($page, 1, $nPages);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     # Query Data
     $query = "SELECT r1.regat_uid AS user_id, user_name, user_level, user_countryid, r1.regat_sid, r1.regat_solved AS solved, r2.sum AS sum " . "FROM {$regat} AS r1 " . "JOIN (SELECT regat_uid,SUM(regat_score) AS sum FROM {$regat} WHERE regat_langid={$langid}  GROUP BY regat_uid ORDER BY SUM(regat_score) DESC LIMIT {$from},{$ipp}) AS r2 ON r1.regat_uid=r2.regat_uid " . "JOIN {$users} AS u ON u.user_id=r1.regat_uid " . "WHERE regat_options&4=0 " . "ORDER BY sum DESC ";
     if (false === ($result = $db->queryRead($query))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     //		var_dump($query);
     $data = array();
     while (false !== ($row = $db->fetchAssoc($result))) {
         $uid = intval($row['user_id']);
         if (!isset($data[$uid])) {
             $data[$uid] = new GWF_User($row);
         }
         $sid = $row['regat_sid'];
         $data[$uid]->setVar('ss_' . $sid, (double) $row['solved']);
     }
     $db->free($result);
     # Show template
     $tVars = array('rank' => $from + 1, 'hlrank' => $hl_rank, 'page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'lang_ranking/' . $iso . '/page-%PAGE%'), 'langname' => $lang->displayName(), 'users' => $data, 'sites' => WC_Site::getSitesLang($langid), 'form_action' => $this->getMethodHref(), 'iso' => $lang->getISO());
     return $this->module->templatePHP('ranking_lang.php', $tVars);
 }
コード例 #19
0
ファイル: List.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     # SEO
     GWF_Website::setMetaTags($this->module->lang('mt_list'));
     GWF_Website::setMetaDescr($this->module->lang('md_list'));
     GWF_Website::setPageTitle($this->module->lang('pt_list'));
     $user = GWF_Session::getUser();
     # Permission
     //		if ((false === ($user = GWF_Session::getUser())) && (!$this->module->cfgAnonDown())) {
     //			return GWF_HTML::err('ERR_NO_PERMISSION');
     //		}
     if (false !== ($mod_pay = GWF_Module::getModule('Payment'))) {
         $mod_pay->onInclude();
     }
     return $this->templateList($user);
 }
コード例 #20
0
ファイル: History.php プロジェクト: sinfocol/gwf3
 private function templatePage()
 {
     $ipp = $this->module->cfgIPP();
     $shouts = GDO::table('GWF_Shoutbox');
     $by = Common::getGet('by', 'shout_date');
     $dir = Common::getGet('dir', 'ASC');
     $orderby = $shouts->getMultiOrderby($by, $dir);
     $nItems = $shouts->countRows();
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     $page = Common::clamp(intval(Common::getGet('page', $nPages)), 1, $nPages);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     GWF_Website::setPageTitle($this->module->lang('pt_history', array($page, $nPages)));
     GWF_Website::setMetaDescr($this->module->lang('md_history'));
     GWF_Website::setMetaTags($this->module->lang('mt_history'));
     $tVars = array('data' => $shouts->selectAll('*', '', $orderby, array('shout_uid'), $ipp, $from, GDO::ARRAY_O), 'sort_url' => GWF_WEB_ROOT . 'shoutbox/history/by/%BY%/%DIR%/page-1', 'page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'shoutbox/history/by/' . urlencode($by) . '/' . urlencode($dir) . '/page-%PAGE%'), 'form_action' => $this->module->hrefShout());
     return $this->module->templatePHP('history.php', $tVars);
 }
コード例 #21
0
ファイル: SiteRankings.php プロジェクト: sinfocol/gwf3
 public function templateRanking()
 {
     if (false === ($site = WC_Site::getByID(Common::getGet('sid')))) {
         return $this->module->error('err_site');
     }
     $ipp = $this->module->cfgItemsPerPage();
     $nItems = $site->getLinkcount() - $this->getLinkcountUnranked($site->getID());
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     $page = Common::clamp(intval(Common::getGet('page', 1)), 1, $nPages);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     $args = array($site->displayName(), $page);
     $title = $this->module->lang('pt_site_ranking', $args);
     GWF_Website::setPageTitle($title);
     GWF_Website::setMetaTags($this->module->lang('mt_site_ranking', $args));
     GWF_Website::setMetaDescr($this->module->lang('md_site_ranking', $args));
     $tVars = array('userdata' => $this->getRankedUsers($site, $from, $ipp), 'site' => $site, 'sites' => $site->getSimilarSites(), 'site_quickjump' => $this->module->templateSiteQuickjumpRanking(), 'rank' => $from + 1, 'page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'site/ranking/for/' . $site->getID() . '/' . $site->urlencodeSEO('site_name') . '/page-%PAGE%'), 'page_title' => $title);
     return $this->module->templatePHP('site_ranking.php', $tVars);
 }
コード例 #22
0
ファイル: RankingCountry.php プロジェクト: sinfocol/gwf3
 private function templateSingle($cid, $user)
 {
     if (false === ($country = GWF_Country::getByID($cid))) {
         return GWF_HTML::err('ERR_UNKNOWN_COUNTRY');
     }
     require_once GWF_CORE_PATH . 'module/WeChall/WC_RegAt.php';
     $cid = $country->getID();
     $ipp = 50;
     $nItems = GDO::table('GWF_User')->countRows("user_countryid={$cid}");
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     list($page, $hlrank) = $this->getSinglePageRank($cid, $ipp, $user);
     $page = Common::clamp($page, 1, $nPages);
     $rank = ($page - 1) * $ipp + 1;
     $from = GWF_PageMenu::getFrom($page, $ipp);
     $cname = $country->display('country_name');
     GWF_Website::setPageTitle($this->module->lang('pt_crank', array($cname, $page)));
     GWF_Website::setMetaTags($this->module->lang('mt_crank', array($cname, $cname)));
     GWF_Website::setMetaDescr($this->module->lang('md_crank', array($cname, $page)));
     $tVars = array('country' => $country, 'cid' => $cid, 'cname' => $cname, 'rank' => $rank, 'hl_rank' => $hlrank, 'page' => $page, 'page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'country_ranking/for/' . $cid . '/' . $country->urlencodeSEO('country_name') . '/page-%PAGE%'), 'data' => $this->getDataForCountry($country, $ipp, $from));
     return $this->module->templatePHP('ranking_country.php', $tVars);
 }
コード例 #23
0
ファイル: Challs.php プロジェクト: sinfocol/gwf3
 private function setPageDescr($for_userid, $from_userid, $tag, $challcount)
 {
     $dtag = GWF_HTML::display($tag);
     GWF_Website::setPageTitle($this->getTableTitle($for_userid, $from_userid, $tag, $challcount), false);
     if ($for_userid != 0) {
         $for_user = GWF_User::getByIDOrGuest($for_userid);
         $for_username = $for_user->displayUsername();
         GWF_Website::setMetaTags($this->module->lang('mt_challs_for', array($dtag, $for_username)), false);
         GWF_Website::setMetaDescr($this->module->lang('md_challs_for', array($dtag, $for_username)), false);
     } else {
         if ($from_userid != 0) {
             $from_user = GWF_User::getByIDOrGuest($from_userid);
             $from_username = $from_user->displayUsername();
             GWF_Website::setMetaTags($this->module->lang('mt_challs_from', array($dtag, $from_username)), false);
             GWF_Website::setMetaDescr($this->module->lang('md_challs_from', array($dtag, $from_username)), false);
         } else {
             GWF_Website::setMetaTags($this->module->lang('mt_challs', array($dtag, GWF_HTML::display($tag))), false);
             GWF_Website::setMetaDescr($this->module->lang('md_challs', array($dtag, GWF_HTML::display($tag))), false);
         }
     }
 }
コード例 #24
0
ファイル: AvatarGallery.php プロジェクト: sinfocol/gwf3
 private function page()
 {
     $db = gdo_db();
     $users = GWF_TABLE_PREFIX . 'user';
     $ag = GWF_TABLE_PREFIX . 'user_avatar_g';
     $has_av = GWF_User::HAS_AVATAR;
     $usert = GDO::table('GWF_User');
     $num_x = $this->module->cfgAvatarsX();
     $num_y = $this->module->cfgAvatarsY();
     $ipp = $num_x * $num_y;
     $nItems = $usert->countRows("user_options&{$has_av}>0");
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     $page = Common::clamp(intval(Common::getGet('page', 1)), 1, $nPages);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     $limit = $usert->getLimit($ipp, $from);
     $query = "SELECT user_id,user_name,user_avatar_v,ag_hits,user_level FROM {$users} LEFT JOIN {$ag} ON ag_uid=user_id AND ag_version=user_avatar_v WHERE user_options&{$has_av}>0  ORDER BY ag_hits DESC, user_level DESC {$limit}";
     GWF_Website::setPageTitle($this->module->lang('pt_avatars'));
     GWF_Website::setMetaDescr($this->module->lang('md_avatars'));
     GWF_Website::setMetaTags($this->module->lang('mt_avatars'));
     $tVars = array('page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'avatar/gallery/page-%PAGE%'), 'avatars' => $db->queryAll($query), 'num_x' => $num_x, 'num_y' => $num_y);
     return $this->module->templatePHP('avatars.php', $tVars);
 }
コード例 #25
0
ファイル: HistoryText.php プロジェクト: sinfocol/gwf3
 private function templateHistory(GWF_User $user)
 {
     require_once GWF_CORE_PATH . 'module/WeChall/WC_SiteDescr.php';
     require_once GWF_CORE_PATH . 'module/WeChall/WC_HistoryUser2.php';
     $uid = $user->getID();
     $ipp = 50;
     $history = GDO::table('WC_HistoryUser2');
     $nItems = $history->countRows("userhist_uid={$uid}");
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     $page = Common::clamp(Common::getGet('page', 1), 1, $nPages);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     $by = Common::getGet('by', '');
     $dir = Common::getGet('dir', '');
     $orderby = $history->getMultiOrderby($by, $dir);
     $uuname = $user->urlencode2('user_name');
     $duname = $user->displayUsername();
     GWF_Website::setPageTitle($this->module->lang('pt_texthis', array($duname)));
     GWF_Website::setMetaDescr($this->module->lang('md_texthis', array($duname)));
     GWF_Website::setMetaTags($this->module->lang('mt_texthis', array($duname)));
     $tVars = array('user' => $user, 'duname' => $duname, 'sites' => WC_Site::getSites('site_id'), 'data' => $history->selectObjects('*', "userhist_uid={$uid}", $orderby, $ipp, $from), 'sort_url' => GWF_WEB_ROOT . 'history/for/' . $uuname . '/by/%BY%/%DIR%/page-1', 'page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'history/for/' . $uuname . '/by/' . urlencode($by) . '/' . urlencode($dir) . '/page-%PAGE%'));
     return $this->module->templatePHP('text_history.php', $tVars);
 }
コード例 #26
0
ファイル: Stats.php プロジェクト: sinfocol/gwf3
 private function setPageTitles()
 {
     if ($this->user1 === false) {
         GWF_Website::setPageTitle($this->module->lang('pt_stats', array('Unknown')));
         GWF_Website::setMetaTags($this->module->lang('mt_stats', array('Unknown')));
         GWF_Website::setMetaDescr($this->module->lang('md_stats', array('Unknown')));
         return;
     }
     $name1 = $this->user1->displayUsername();
     $name2 = $this->user2 === false ? '' : $this->user2->displayUsername();
     if ($name2 === '') {
         $args = array($name1);
         GWF_Website::setPageTitle($this->module->lang('pt_stats', $args));
         GWF_Website::setMetaTags($this->module->lang('mt_stats', $args));
         GWF_Website::setMetaDescr($this->module->lang('md_stats', $args));
     } else {
         $args = array($name1, $name2);
         GWF_Website::setPageTitle($this->module->lang('pt_stats2', $args));
         GWF_Website::setMetaTags($this->module->lang('mt_stats2', $args));
         GWF_Website::setMetaDescr($this->module->lang('md_stats2', $args));
     }
 }
コード例 #27
0
ファイル: Tools.php プロジェクト: sinfocol/gwf3
 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;
 }
コード例 #28
0
ファイル: RankingTag.php プロジェクト: sinfocol/gwf3
 private function templateRanking()
 {
     require_once GWF_CORE_PATH . 'module/WeChall/WC_SiteCats.php';
     $tag = Common::getGet('tag', self::DEFAULT_TAG);
     if (0 === ($bit = WC_SiteCats::getBitForCat($tag))) {
         $bit = 1;
         $tag = $_GET['tag'] = WC_SiteCats::getCatForBit($bit);
     }
     $ipp = 50;
     $nItems = $this->countItems($bit);
     list($page, $hlrank) = $this->getPageNum($ipp, $bit);
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     $page = Common::clamp($page, 1, $nPages);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     $rank = ($page - 1) * $ipp + 1;
     $data = $bit === 0 ? array() : $this->selectPage($bit, $from, $ipp);
     $dtag = GWF_HTML::display($tag);
     GWF_Website::setPageTitle($this->module->lang('pt_tagrank', array($dtag)));
     GWF_Website::setMetaTags($this->module->lang('mt_tagrank', array($dtag, $dtag)));
     GWF_Website::setMetaDescr($this->module->lang('md_tagrank', array($dtag, $page, $nPages)));
     $tVars = array('rank' => $rank, 'hlrank' => $hlrank, 'sites' => WC_Site::getSimilarSitesS($bit, true), 'data' => $data, 'tag' => $dtag, 'form_action' => GWF_WEB_ROOT . 'category_ranking', 'page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . sprintf('category_ranking/%s/page-%%PAGE%%', urlencode($tag))), 'select' => $this->getTagSelect());
     return $this->module->templatePHP('ranking_tag.php', $tVars);
 }
コード例 #29
0
ファイル: Ranking.php プロジェクト: sinfocol/gwf3
 private function templateRanking($user)
 {
     require_once GWF_CORE_PATH . 'module/WeChall/WC_RegAt.php';
     $users = GDO::table('GWF_User');
     $ipp = $this->module->cfgItemsPerPage();
     $nItems = $users->countRows("user_level>0");
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     if (false === ($page = Common::getGet('page'))) {
         list($page, $rank) = $this->getPageForSession($ipp, $user);
     } else {
         $page = Common::clamp(intval($page), 1, $nPages);
         $rank = $user === false || $user->isOptionEnabled(0x10000000) ? 1 : WC_RegAt::calcExactRank($user);
     }
     //		var_dump($page);
     //		var_dump($rank);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     $href = GWF_WEB_ROOT . 'ranking/page-%PAGE%';
     GWF_Website::setPageTitle($this->module->lang('pt_ranking', array($page)));
     GWF_Website::setMetaTags($this->module->lang('mt_ranking'));
     $userdata = $this->selectUsers($ipp, $from);
     $tVars = array('rank' => $from + 1, 'highlight_rank' => $rank, 'langs' => WC_Site::getLangs(), 'userdata' => $userdata, 'pagemenu' => GWF_PageMenu::display($page, $nPages, $href));
     return $this->module->templatePHP('ranking.php', $tVars);
 }
コード例 #30
0
ファイル: JoinUs.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     $lang = new GWF_LangTrans(GWF_CORE_PATH . 'module/WeChall/lang/join_us/_wc_join');
     GWF_Website::setPageTitle($lang->lang('pt_joinus'));
     GWF_Website::setMetaTags($lang->lang('mt_joinus'));
     $section = Common::getGetString('section', 'join');
     switch ($section) {
         case 'optional':
             $filename = 'join_opt.php';
             break;
         case 'wechall_api':
             $filename = 'join_api.php';
             break;
         case 'warbox':
             $filename = 'join_warbox.php';
             break;
         default:
             $filename = 'join.php';
             break;
     }
     $tVars = array('join' => $lang);
     return $this->module->templatePHP($filename, $tVars);
 }