本文整理汇总了PHP中WC_Challenge::display方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Challenge::display方法的具体用法?PHP WC_Challenge::display怎么用?PHP WC_Challenge::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_Challenge
的用法示例。
在下文中一共展示了WC_Challenge::display方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: templateSolutions
private function templateSolutions(WC_Challenge $chall, GWF_User $user, $length, $token)
{
$tt = $this->module->lang('pt_wmc_sol', array($chall->display('chall_title'), $length));
GWF_Website::setPageTitle($tt);
$ipp = 50;
$cid = $chall->getID();
$length = (int) $length;
$whitelist = array('user_name', 'wmc_date', 'wmc_length', 'wmc_solution');
$by = GDO::getWhitelistedByS(Common::getGetString('by'), $whitelist, self::DEFAULT_BY);
$dir = GDO::getWhitelistedDirS(Common::getGetString('dir'), self::DEFAULT_DIR);
$wmc = GWF_TABLE_PREFIX . 'wc_math_chall';
$users = GWF_TABLE_PREFIX . 'user';
$where = "wmc_cid={$cid} AND wmc_length>={$length}";
$db = gdo_db();
$result = $db->queryFirst("SELECT COUNT(*) c FROM {$wmc} WHERE {$where}");
$nRows = (int) $result['c'];
$nPages = GWF_PageMenu::getPagecount($ipp, $nRows);
$page = Common::clamp(Common::getGetInt('page', 1), 1, $nPages);
$from = GWF_PageMenu::getFrom($page, $ipp);
$limit = GDO::getLimit($ipp, $from);
$query = "SELECT user_name, wmc_date, wmc_length, wmc_solution FROM {$wmc} LEFT JOIN {$users} ON user_id=wmc_uid WHERE {$where} ORDER BY {$by} {$dir} {$limit}";
$tVars = array('sort_url' => GWF_WEB_ROOT . "index.php?mo=WeChall&me=MathSolutions&cid={$cid}&length={$length}&token={$token}&by=%BY%&dir=%DIR%", 'data' => $db->queryAll($query), 'page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . sprintf('index.php?mo=WeChall&me=MathSolutions&cid=%d&length=%d&token=%s&by=%s&dir=%s&page=%%PAGE%%', $cid, $length, $token, urlencode($by), urlencode($dir))), 'table_title' => $tt, 'chall' => $chall);
return $this->module->templatePHP('math_solutions.php', $tVars);
}