private function sanitize() { $this->user = GWF_Session::getUser(); $links = GDO::table('GWF_Links'); $this->by = Common::getGet('by', self::DEFAULT_BY); $this->dir = Common::getGet('dir', self::DEFAULT_DIR); // if ($this->by === false && $this->dir === false) // { // $this->by = self::DEFAULT_BY; // $this->dir = self::DEFAULT_DIR; // $this->orderby = self::DEFAULT_ORDERBY; // } // else // { $this->orderby = $links->getMultiOrderby($this->by, $this->dir); // } $this->tag = GWF_LinksTag::getWhitelistedTag(Common::getGet('tag'), ''); $this->lpp = $this->module->cfgLinksPerPage(); $this->nLinks = $links->countLinks($this->module, $this->user, $this->tag, false); $this->nPages = GWF_PageMenu::getPagecount($this->lpp, $this->nLinks); $this->page = Common::clamp(Common::getGet('page', 1), 1, $this->nPages); $this->from = GWF_PageMenu::getFrom($this->page, $this->lpp); if ($this->tag === '') { $this->sortURL = GWF_WEB_ROOT . 'links/by/%BY%/%DIR%/page-1'; $href = GWF_WEB_ROOT . 'links/by/' . $this->by . '/' . $this->dir . '/page-%PAGE%'; } else { $this->sortURL = GWF_WEB_ROOT . 'links/' . $this->tag . '/by/%BY%/%DIR%/page-1'; $href = GWF_WEB_ROOT . 'links/' . Common::urlencodeSEO($this->tag) . '/by/' . $this->by . '/' . $this->dir . '/page-%PAGE%'; } // var_dump($this->tag); // $unread_query = $this->module->getUnreadQuery($this->user); $tag_query = $links->getTagQuery($this->tag); // var_dump($tag_query); if ($this->module->cfgShowPermitted()) { $conditions = "({$tag_query})"; } else { $perm_query = $this->module->getPermQuery($this->user); $mod_query = $links->getModQuery($this->user); $member_query = $links->getMemberQuery($this->user); $private_query = $links->getPrivateQuery($this->user); $conditions = "({$perm_query}) AND ({$tag_query}) AND ({$mod_query}) AND ({$member_query}) AND ({$private_query})"; # AND (NOT $unread_query))"; } // var_dump($conditions); if (false === ($this->links = $links->selectObjects('*', $conditions, $this->orderby, $this->lpp, $this->from))) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } $this->pagemenu = GWF_PageMenu::display($this->page, $this->nPages, $href); $this->add_link_text = GWF_LinksValidator::mayAddLink($this->module, $this->user); $this->hrefAdd = $this->add_link_text === false ? $this->module->getMethodURL('Add', '&tag=' . $this->tag) : false; // $this->newLinks = $links->select("(($perm_query) AND ($unread_query) AND ($mod_query) AND ($member_query) AND ($tag_query))", 'link_date ASC'); return false; }
<?php echo GWF_Box::box($tLang->lang('pi_csrank'), $tLang->lang('pt_csrank')); WC_HTML::rankingPageButtons(); $headers = array(array('#', null, null, 2), array('', null, null, 1), array($tLang->lang('th_user_countryid'), 'countryname', 'ASC', 3), array($tLang->lang('th_players'), 'users', 'DESC', 6), array($tLang->lang('th_score'), 'totalscore', 'DESC', 4), array($tLang->lang('th_spc'), 'spc', 'DESC', 7), array($tLang->lang('th_avg'), 'avg', 'DESC', 8), array($tLang->lang('th_sumtop3'), 'top3', 'DESC', 9), array($tLang->lang('th_top_player'), 'topuser', 'ASC', 5)); $rank = 1; $hlc = $tVars['highlight_country']; echo GWF_Table::start(); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); $sl = WC_HTML::styleSelected(); foreach ($tVars['data'] as $row) { $cid = $row['country_id']; $topuser = $row['topuser']; $style = $hlc == $cid ? $sl : ''; $href = GWF_WEB_ROOT . 'country_ranking/for/' . $cid . '/' . Common::urlencodeSEO($row['countryname']); echo GWF_Table::rowStart(true, '', '', $style); echo sprintf('<td class="gwf_num">%d</td>', $rank++); echo sprintf('<td>%s</td>', GWF_Country::displayFlagS2($cid, $row['countryname'])); echo sprintf('<td><a href="%s">%s</a></td>', $href, GWF_HTML::display($row['countryname'])); echo sprintf('<td class="gwf_num">%d</td>', $row['users']); echo sprintf('<td class="gwf_num">%d</td>', $row['totalscore']); echo sprintf('<td class="gwf_num">%s</td>', $row['spc']); echo sprintf('<td class="gwf_num">%d</td>', $row['avg']); echo sprintf('<td class="gwf_num">%d</td>', $row['top3']); echo sprintf('<td><a href="%s" title="%s">%s</a></td>', GWF_WEB_ROOT . 'profile/' . urlencode($topuser), $tLang->lang('a_title', array($row['topscore'])), GWF_HTML::display($topuser)); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo GWF_Box::box($tLang->lang('scorefaq_box', GWF_WEB_ROOT . 'scoring_faq'));
</h1> <p><?php echo $tLang->lang('pi_history'); ?> </p> <p><a href="/chat/history/page-1"><?php echo $tLang->lang('btn_history'); ?> </a></p> <div class="fl"> <?php foreach ($tVars['friends'] as $friend) { ?> <div><a href="/chat/history/for/<?php echo Common::urlencodeSEO($friend); ?> /page-1"><?php echo GWF_HTML::display($friend); ?> </a></div> <?php } ?> </div> <?php echo $tVars['pagemenu']; ?> <div><?php
private function onQuickTranslate() { $newsid = (int) Common::getPost('newsid', 0); if (false === ($news = GWF_News::getByID($newsid))) { return $this->module->error('err_news'); } $translateID = (int) Common::getPost('translate', 0); if (false === ($lang = GWF_Language::getByID($translateID))) { return $this->module->error('err_lang_dest'); } $trans = $news->getFirstTranslation(); $title = Common::urlencodeSEO($trans['newst_title']); $location = GWF_WEB_ROOT . 'news/edit/' . $newsid . '-' . $title . '/langid-1'; #.$translateID; header('Location: ' . $location); die; }
public function hrefShow(GWF_Language $lang) { $langid = $lang->getID(); $newsid = $this->getVar('news_id'); $catid = $this->getVar('news_catid'); $cat = Common::urlencodeSEO($this->getCategoryTitle($langid)); $title = Common::urlencodeSEO($this->getTitleL($langid)); return GWF_WEB_ROOT . sprintf('news/%s/%s/%s/%s/%s#newsid_%s', $lang->getVar('lang_iso'), $catid, $cat, $newsid, $title, $newsid); }
$tVars['news'] = array(array('news_id' => '0', 'news_date' => '', 'user_name' => '', 'newst_title' => $tLang->lang('title_no_news'), 'newst_message' => $tLang->lang('msg_no_news'))); } ?> <span class="t" style=""> <span class="ssy800v_R ssy_st_out3"><span class="ssy_small_softbox"> <?php echo sprintf('<a href="%snewsletter/subscribe">%s</a>', GWF_WEB_ROOT, $tLang->lang('btn_sign')); echo '<span class="b" style="height: 20px;"></span>'; $iso = GWF_Language::getCurrentISO(); foreach ($tVars['titles'] as $id => $d) { $newsid = $d[0]; $title = $d[1]; $catid = 0; $cat = 'FOO'; // $title = $d[0]; $etitle = Common::urlencodeSEO($title); // $catid = $d[1]; // $cat = 'foo'; // $cat = $d[2];#($catid === 0) ? GWF_HTML::lang('no_category') : $d[2]; // $cat = Common::urlencodeSEO($cat); // $newsid = (int)$d[3]; $url = sprintf(GWF_WEB_ROOT . 'news/%s/%s/%s/%s/%s#newsid_%d', $iso, $catid, $cat, $newsid, $etitle, $newsid); echo sprintf('<a href="%s">%s</a>', $url, GWF_HTML::display($title)); } ?> </span> <span class="ssy_st_out3_t ssy800h"><?php echo $tVars['page_menu']; ?> </span> <span class="ssy800v ssy_st_out2">
echo $tVars['module']->templatePHP('_admin_nav.php', $tVars); $headers = array(array($tLang->lang('th_date'), 'news_date', 'ASC'), array($tLang->lang('th_userid'), 'user_name', 'ASC'), array($tLang->lang('th_catid'), 'news_catid', 'ASC'), array($tLang->lang('th_langid')), array($tLang->lang('th_title')), array($tLang->lang('th_hidden'), 'news_options&' . GWF_News::HIDDEN, 'DESC')); echo $tVars['page_menu']; echo GWF_Table::start(); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); foreach ($tVars['news'] as $item) { $item instanceof GWF_News; $newsid = $item->getID(); $trans = $item->getTranslations(); $date = $item->displayDate(); $author = $item->displayAuthor(); $cat = $item->displayCategory(); $lang_visible = $tLang->lang('th_visible'); $lang_hidden = $tLang->lang('th_hidden'); foreach ($trans as $langid => $t) { var_dump($langid, $t); if ($item->isHidden()) { $icon = GWF_Button::add($lang_hidden, $item->hrefEnable()); } else { $icon = GWF_Button::sub($lang_visible, $item->hrefDisable()); } echo GWF_Table::rowStart(); $title = $t['newst_title']; $data[] = array($date, $author, $cat, GWF_Language::getByID($langid)->display('lang_nativename'), sprintf('<a href="%snews/edit/%d-%s/langid-%d">%s</a>', GWF_WEB_ROOT, $newsid, Common::urlencodeSEO($title), $langid, $title), $item->isHidden() ? $icon_hidden : $icon_visible); echo GWF_Table::rowEnd(); } } echo GWF_Table::end(); echo $tVars['page_menu']; echo GWF_Button::wrap(GWF_Button::add($tLang->lang('btn_add'), GWF_WEB_ROOT . 'news/add'));
/** * Gizmore urlencode SEO modifier * * Type: modifier * Name: date * Date: Mar 22, 2011 * Purpose: Replace chars in urls with readable ascii characters. * Input: url to replace * Example: {'HAHA ?!?!'|urlencodeseo} * @author gizmore * @param array $params parameters * @return urlencoded string */ function smarty_modifier_urlencodeseo($url) { return Common::urlencodeSEO($url); }
<div style="margin-bottom: 40px;"> <span style="margin-top: 40px; margin-bottom: 50px; display: table;"> <span class="fl ssy_leftlinks" style="display: table;"> <?php echo sprintf('<a href="/newsletter/subscribe">%s</a>', $tLang->lang('btn_sign')); #echo sprintf('<a href="#">%s</a>', $tVars['cat']); echo '<span class="b" style="height: 20px;"></span>'; $iso = GWF_Language::getCurrentISO(); foreach ($tVars['titles'] as $id => $d) { $title = $d[0]; $etitle = Common::urlencodeSEO($d[0]); $catid = $d[1]; $cat = $d[2]; #($catid === 0) ? GWF_HTML::lang('no_category') : $d[2]; $cat = Common::urlencodeSEO($cat); $newsid = (int) $d[3]; $url = sprintf('/news/%s/%s/%s/%s/%s#newsid_%d', $iso, $catid, $cat, $newsid, $etitle, $newsid); echo sprintf('<a href="%s">%s</a>', $url, GWF_HTML::display($title)); } ?> </span> <span class="ssy_rightcontainer ssy_v800" style="display: table; min-width: 480px; max-width: 1500px; padding: 2px; margin-top: 5px;"> <span class="ssy_v800R ib" style="display: table; min-width: 480px; max-width: 1500px; min-height: 240px; padding: 10px;"> <?php echo $tVars['page_menu']; ?> <?php if (count($tVars['news']) === 0) { $tVars['news'] = array(GWF_NEWS::getFakeNews($tLang->lang('title_no_news'), $tLang->lang('msg_no_news')));
$lang_hidden = $tLang->lang('th_hidden'); echo GWF_Table::start(); foreach ($tVars['news'] as $item) { $item instanceof GWF_News; $newsid = $item->getID(); $trans = $item->getTranslations(); $author = $item->displayAuthor(); $cat = $item->displayCategory(); $date = $item->displayDate(); foreach ($trans as $langid => $t) { if ($item->isHidden()) { $icon = GWF_Button::sub($lang_hidden, $item->hrefEnable()); } else { $icon = GWF_Button::add($lang_visible, $item->hrefDisable()); } echo GWF_Table::rowStart(); echo GWF_Table::column($date, 'gwf_date'); echo GWF_Table::column($author); echo GWF_Table::column($cat); echo GWF_Table::column(GWF_Language::getByID($langid)->display('lang_nativename')); $title = $t['newst_title']; $href = GWF_WEB_ROOT . sprintf('news/edit/%d-%s/langid-%d', $newsid, Common::urlencodeSEO($title), $langid); echo GWF_Table::column(sprintf('<a href="%s">%s</a>', $href, htmlspecialchars($title))); echo GWF_Table::column($icon); echo GWF_Table::rowEnd(); } } echo GWF_Table::end(); echo $tVars['page_menu']; $buttons = GWF_Button::add($tLang->lang('btn_add'), GWF_WEB_ROOT . 'news/add'); echo GWF_Button::wrap($buttons);
public static function getNavTree($imploder = '->') { $module = self::getInstance(); if (false === ($board = $module->getCurrentBoard())) { return ''; } $back = array(); $tree = $board->getBoardTree(); foreach ($tree as $b) { list($reserved, $bid, $title) = $b; $back[] = GWF_HTML::anchor(GWF_WEB_ROOT . "forum-b{$bid}/" . Common::urlencodeSEO($title) . '.html', $title); } return implode($imploder, $back); }
<?php #if ($is_staff) { echo '<div class="gwf_newsbox_translate">'.$news->getTranslateSelect().'</div>'; } ?> <?php $more = ''; if ($module->cfgAllowComments()) { if (false !== ($comments = GWF_Module::loadModuleDB('Comments', true, true))) { $comments instanceof Module_Comments; $gid = GWF_Group::getByName(GWF_Group::MODERATOR)->getID(); if (false !== ($c = GWF_Comments::getOrCreateComments('_NEWS_ID_' . $news['news_id'], 0, $gid))) { } $c instanceof GWF_Comments; // $more .= '<br/>'.$c->displayMore($tVars['href_comments_more']); // $more .= '<br/>'.$c->displayTopComments(); // $more .= '<br/>'.$c->displayReplyForm($tVars['href_comments_reply']); $more .= '<br/>' . $c->displayMore(GWF_WEB_ROOT . 'news-comments-' . $news['news_id'] . '-' . Common::urlencodeSEO($news['newst_title']) . '-page-1.html'); // $more .= '<br/>'.$c->displayTopComments(); // $more .= '<br/>'.$c->displayReplyForm(); } } ?> <article class="gwf_newsbox_message"><?php echo GWF_Message::display($news['newst_message']) . $more; ?> </article> <?php // $tid = intval($t['newst_threadid']); // if ($tVars['with_forum'] && $tid > 0) // {
public function urlencodeSEO($var) { return Common::urlencodeSEO($this->gdo_data[$var]); }
echo '<div class="gwf_news_titles oa">' . PHP_EOL; $headers = array(array($tLang->lang('th_title'))); $data = array(); $iso = GWF_Language::getCurrentISO(); echo GWF_Table::start(); echo GWF_Table::displayHeaders1($headers); foreach ($tVars['titles'] as $d) { echo GWF_Table::rowStart(); $newsid = $d[0]; $title = $d[1]; $catid = 0; $cat = 'FOO'; // $catid = (int) $d[1]; // $cat = $catid === 0 ? GWF_HTML::lang('no_category') : $d[2]; // $cat = Common::urlencodeSEO($cat); $url = sprintf(GWF_WEB_ROOT . 'news/%s/%d/%s/%s/%s#newsid%s', $iso, $catid, urlencode($cat), $newsid, Common::urlencodeSEO($title), $newsid); echo GWF_Table::column(sprintf('<a href="%s">%s</a>', htmlspecialchars($url), htmlspecialchars($title))); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo '</div>' . PHP_EOL; echo '<div class="gwf_news_items fr oa">' . PHP_EOL; foreach ($tVars['news'] as $news) { ?> <div class="gwf_newsbox_item"> <div><a name="newsid_<?php echo $news['news_id']; ?> "></a></div> <div class="gwf_newsbox_title">