本文整理汇总了PHP中GWF_User::urlencode方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_User::urlencode方法的具体用法?PHP GWF_User::urlencode怎么用?PHP GWF_User::urlencode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_User
的用法示例。
在下文中一共展示了GWF_User::urlencode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: templateChalls
public function templateChalls(GWF_User $user)
{
$whitelist = array('chall_score', 'chall_title', 'chall_creator_name', 'chall_solvecount', 'chall_date', 'chall_dif', 'chall_edu', 'chall_fun', 'csolve_date', 'csolve_time_taken');
require_once GWF_CORE_PATH . 'module/WeChall/WC_ChallSolved.php';
$challs = GDO::table('WC_Challenge');
$db = gdo_db();
$uid = $user->getVar('user_id');
$challs = GWF_TABLE_PREFIX . 'wc_chall';
$solved = GWF_TABLE_PREFIX . 'wc_chall_solved';
$by = GDO::getWhitelistedByS(Common::getGet('pcby'), $whitelist, self::DEFAULT_BY);
$dir = GDO::getWhitelistedDirS(Common::getGet('pcdir'), self::DEFAULT_DIR);
$orderby = "ORDER BY {$by} {$dir}";
$query = "SELECT c.*, s.* FROM {$challs} c LEFT JOIN {$solved} s ON c.chall_id=s.csolve_cid AND s.csolve_uid={$uid} {$orderby}";
$tVars = array('data' => $db->queryAll($query), 'sort_url' => GWF_WEB_ROOT . 'index.php?mo=Profile&me=Profile&username=' . $user->urlencode('user_name') . '&pcby=%BY%&pcdir=%DIR%#wc_profile_challenges', 'table_title' => $this->module->lang('tt_challs_for', array('', $user->display('user_name'))));
return $this->module->templatePHP('challs_profile.php', $tVars);
}
示例2: create
private function create()
{
if (false === ($this->rec = GWF_User::getByName(Common::getPost('username'))) && false === ($this->rec = GWF_User::getByName(Common::getPost('username_sel')))) {
return GWF_HTML::err('ERR_UNKNOWN_USER') . $this->module->requestMethodB('Overview');
}
GWF_Website::redirect(GWF_WEB_ROOT . 'pm/send/to/' . $this->rec->urlencode('user_name'));
die;
}
示例3: wcProfileGraph
function wcProfileGraph(GWF_User $user, $type)
{
if (false === ($tu = GWF_Session::getUser()) || ($tu->getLevel() === 0 || $tu->getID() === $user->getID())) {
$href = GWF_WEB_ROOT . 'graph/wc_' . $type . '.' . $user->urlencode('user_name') . '.png';
$alt = WC_HTML::lang('alt_graph_' . $type, array($user->displayUsername()));
return sprintf('<img src="%s" alt="%s" title="%s" />', $href, $alt, $alt);
} else {
$href = GWF_WEB_ROOT . 'graph/wc_' . $type . '.' . $user->urlencode('user_name') . '.vs.' . $tu->urlencode('user_name') . '.png';
$alt = WC_HTML::lang('alt_graph_' . $type . '_vs', array($user->displayUsername(), $tu->displayUsername()));
return sprintf('<img src="%s" alt="%s" title="%s" />', $href, $alt, $alt);
}
}