本文整理汇总了PHP中WC_HTML::styleSelected方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_HTML::styleSelected方法的具体用法?PHP WC_HTML::styleSelected怎么用?PHP WC_HTML::styleSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_HTML
的用法示例。
在下文中一共展示了WC_HTML::styleSelected方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
echo '<span class="ib">' . GWF_Select::display('iso', $data, $tVars['iso'], "window.location=GWF_WEB_ROOT+'lang_ranking/'+this.value;") . '</span>' . PHP_EOL;
echo sprintf('<input type="submit" name="cmd" value="%s" />', $tLang->lang('btn_quickjump')) . PHP_EOL;
echo '</div></div>' . PHP_EOL;
echo '</form>' . PHP_EOL;
$headers = array(array($tLang->lang('th_rank')), array(), array($tLang->lang('th_user_name')), array($tLang->lang('th_score')), array($tLang->lang('th_progress')));
echo $tVars['page_menu'] . PHP_EOL;
echo GWF_Table::start();
$hl_rank = $tVars['hlrank'];
$rank = $tVars['rank'];
echo GWF_Table::displayHeaders2($headers) . PHP_EOL;
$solvetext = ' solved ';
$ontxt = ' on ';
foreach ($tVars['users'] as $user) {
$user instanceof GWF_User;
$username = $user->displayUsername();
$style = $rank === $hl_rank ? WC_HTML::styleSelected() : '';
echo GWF_Table::rowStart(true, '', '', $style);
echo sprintf('<td class="gwf_num">%s</td>', $rank);
echo sprintf('<td>%s</td>', $user->displayCountryFlag());
echo sprintf('<td><a href="%s" title="%s">%s</a></td>', $user->getProfileHREF(), $tLang->lang('a_title', array($user->getVar('user_level'), $username)), $user->displayUsername());
echo sprintf('<td class="gwf_num">%s</td>', $user->getVar('sum'));
echo '<td>';
foreach ($tVars['sites'] as $site) {
$site instanceof WC_Site;
// echo $site->displayName();
$sid = $site->getVar('site_id');
$var = 'ss_' . $sid;
if ($user->hasVar($var)) {
$solved = $user->getVar($var);
$percent = round($solved * 100, 2);
$txt = $username . $solvetext . $percent . '%' . $ontxt . $site->display('site_name');
示例2: array
<?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'));
示例3: foreach
$samerank = $rank;
$samescore = 0;
echo $tVars['pagemenu'];
echo '<table>' . PHP_EOL;
// echo '<thead>'.PHP_EOL;
echo GWF_Table::displayHeaders2($headers);
// echo '</thead>'.PHP_EOL;
foreach ($tVars['userdata'] as $user) {
$user instanceof GWF_User;
// var_dump($user->getGDOData());
$score = $user->getLevel();
if ($score !== $samescore) {
$samerank = $rank;
$samescore = $score;
}
$style = $samerank === $highlight_rank ? WC_HTML::styleSelected() : '';
echo GWF_Table::rowStart(true, '', 'rank_' . $rank, $style);
echo sprintf('<td>%s</td>', $samerank) . PHP_EOL;
echo sprintf('<td>%s</td>', $user->displayCountryFlag()) . PHP_EOL;
echo sprintf('<td>%s</td>', $user->displayProfileLink()) . PHP_EOL;
echo sprintf('<td class="gwf_num">%s</td>', $user->getVar('nlinks'));
echo sprintf('<td class="gwf_num">%s</td>', $user->getLevel()) . PHP_EOL;
foreach ($tVars['langs'] as $i => $lang) {
if ($user->hasVar('grank_' . $lang)) {
$anchor = GWF_HTML::anchor(GWF_WEB_ROOT . 'lang_ranking/' . $isos[$i] . '/for/' . $user->urlencode2('user_name'), $user->getVar('grank_' . $lang, ''));
} else {
$anchor = '';
}
echo sprintf('<td class="gwf_num">%s</td>', $anchor) . PHP_EOL;
}
echo GWF_Table::rowEnd();