本文整理汇总了PHP中GWF_HTML::anchor方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_HTML::anchor方法的具体用法?PHP GWF_HTML::anchor怎么用?PHP GWF_HTML::anchor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_HTML
的用法示例。
在下文中一共展示了GWF_HTML::anchor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deliver
public static function deliver(Module_PM $module, GWF_PM $pm)
{
if (false === ($pmo = GWF_PMOptions::getPMOptions($pm->getReceiver()))) {
return 0;
}
if (!$pmo->isOptionEnabled(GWF_PMOptions::EMAIL_ON_PM)) {
return 0;
}
$sender = $pm->getSender();
$receiver = $pm->getReceiver();
if ('' === ($rec = $receiver->getValidMail())) {
return 0;
}
$sendername = $sender->getID() !== '0' ? $sender->display('user_name') : GWF_HTML::langUser($receiver, 'guest');
$email = new GWF_Mail();
$email->setSender($module->cfgEmailSender());
$email->setReceiver($rec);
$email->setSubject($module->langUser($receiver, 'mail_subj', array($sendername)));
$autofolder = sprintf('index.php?mo=PM&me=AutoFolder&pmid=%s&uid=%s&token=%s', $pm->getID(), $receiver->getID(), $pm->getHashcode());
$autofolder = Common::getAbsoluteURL($autofolder);
$autofolder = GWF_HTML::anchor($autofolder, $autofolder);
$delete = sprintf('index.php?mo=PM&me=Delete&pmid=%s&uid=%s&token=%s', $pm->getID(), $receiver->getID(), $pm->getHashcode());
$delete = Common::getAbsoluteURL($delete);
$delete = GWF_HTML::anchor($delete, $delete);
$email->setBody($module->langUser($receiver, 'mail_body', array($receiver->displayUsername(), $sendername, $pm->display('pm_title'), $pm->display('pm_message'), $autofolder, $delete)));
if (false === $email->sendToUser($receiver)) {
return -4;
}
return 1;
}
示例2: displayUsername
public function displayUsername()
{
$uname = $this->getVar('shout_uname');
if ($this->isGuestShout()) {
return $uname;
// return GWF_HTML::lang('guest').'_'.$uname;
}
return GWF_HTML::anchor(GWF_WEB_ROOT . 'profile/' . urlencode($uname), GWF_HTML::display($uname));
}
示例3: wcProfileLastActivity
function wcProfileLastActivity(GWF_User $user, $ipp, $priv = false)
{
$uid = $user->getID();
$uh = GDO::table('WC_HistoryUser2');
$entries = $uh->selectObjects('*', "userhist_uid={$uid}", 'userhist_date DESC', $ipp);
// $entries = array_reverse($entries);
$back = '';
$back .= '<table class="cl">';
$href_txt_history = GWF_WEB_ROOT . 'history/for/' . $user->urlencode2('user_name');
$anchor = GWF_HTML::anchor($href_txt_history, WC_HTML::lang('th_last_activites', array($user->displayUsername())));
$back .= sprintf('<thead><tr><th colspan="2">%s</th></tr></thead>', $anchor);
$unknown = GWF_HTML::lang('unknown');
foreach ($entries as $entry) {
$entry instanceof WC_HistoryUser2;
$back .= GWF_Table::rowStart();
$back .= sprintf('<td class="gwf_date">%s</td>', $priv ? $unknown : $entry->displayDate());
$back .= sprintf('<td>%s</td>', $entry->displayComment());
$back .= GWF_Table::rowEnd();
}
$back .= '</table>';
return $back;
}
示例4: gwfProfileRow
}
if ('' !== ($v = $p->display('prof_lastname'))) {
echo gwfProfileRow($tLang->lang('th_lastname'), $v);
}
if ($u->isOptionEnabled(GWF_User::SHOW_BIRTHDAY) && '00000000' !== ($v = $u->getVar('user_birthdate'))) {
echo gwfProfileRow($tLang->lang('th_age'), GWF_Time::displayAge($v));
echo gwfProfileRow($tLang->lang('th_birthdate'), GWF_Time::displayDate($v));
}
if ('' !== ($v = $p->display('prof_street'))) {
echo gwfProfileRow($tLang->lang('th_street'), $v);
}
if (' ' !== ($v = $p->display('prof_zip') . ' ' . $p->display('prof_city'))) {
echo gwfProfileRow($tLang->lang('th_city'), $v);
}
if ('' !== ($v = $p->getVar('prof_website', ''))) {
echo gwfProfileRow($tLang->lang('th_website'), GWF_HTML::anchor($v, $v));
}
if (!$p->isContactHidden($user) || $is_admin) {
if ($u->isOptionEnabled(GWF_User::SHOW_EMAIL) || $is_admin) {
if ('' !== ($v = $u->displayEMail())) {
echo gwfProfileRow($tLang->lang('th_email'), $v);
}
}
$v = $p->display('prof_tel');
if ($v !== '0' && $v !== '') {
echo gwfProfileRow($tLang->lang('th_tel'), $v);
}
$v = $p->display('prof_mobile');
if ($v !== '0' && $v !== '') {
echo gwfProfileRow($tLang->lang('th_mobile'), $v);
}
示例5: displayWWW
public function displayWWW()
{
$url = $this->getVar('cmt_www');
return GWF_HTML::anchor($url, $url, $url);
}
示例6: array
// $href_api_3 = GWF_WEB_ROOT.'index.php?mo=WeChall&me=JoinUs&section=api#api_3';
echo '<a name="api_3"></a>' . PHP_EOL;
echo GWF_Box::box($l->lang('api_3b', array($usage_3_1, $usage_3_1, $usage_3_1, $event_types, $examples)), $l->lang('api_3t'));
# API 4)
$href_api_4 = GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs&section=api#api_4';
$url = sprintf('%s://%s%sindex.php?mo=WeChall&me=API_User&no_session=1&', Common::getProtocol(), GWF_DOMAIN, GWF_WEB_ROOT);
$usage_4_1 = htmlspecialchars($url . 'username=<username>[&apikey=<your_api_key>]');
$example_4_1 = GWF_HTML::anchor($url . 'username=' . $uname, $url . 'username=' . $uname);
if ($user !== false && isset($udata['WC_NO_XSS_PASS'])) {
$api_key = urlencode($udata['WC_NO_XSS_PASS']);
$example_4_2 = GWF_HTML::anchor($url . "username={$uname}&apikey={$api_key}", $url . "username={$uname}&apikey={$api_key}");
} else {
$example_4_2 = '';
}
echo '<a name="api_4"></a>' . PHP_EOL;
echo GWF_Box::box($l->lang('api_4b', array($usage_4_1, $usage_4_1, $example_4_1, $example_4_2)), $l->lang('api_4t'));
# API 5)
$href_api_5 = GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs&section=api#api_5';
$url = sprintf('%s://%s%sindex.php?mo=WeChall&me=API_Site&no_session=1', Common::getProtocol(), GWF_DOMAIN, GWF_WEB_ROOT);
$usage_5_1 = htmlspecialchars($url . '[&sitename=<sitename>]');
$example_5_1 = GWF_HTML::anchor($url, $url);
$example_5_2 = GWF_HTML::anchor($url . '&sitename=WeChall', $url . '&sitename=WeChall');
echo '<a name="api_5"></a>' . PHP_EOL;
echo GWF_Box::box($l->lang('api_5b', array($usage_5_1, $usage_5_1, $example_5_1, $example_5_2)), $l->lang('api_5t'));
# Buttons
echo GWF_Button::wrapStart();
echo GWF_Button::generic($l->lang('btn_join'), GWF_WEB_ROOT . 'join_us');
echo GWF_Button::generic($l->lang('btn_join_war'), GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs§ion=warbox');
echo GWF_Button::generic($l->lang('btn_join_opt'), GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs§ion=optional');
echo GWF_Button::generic($l->lang('btn_api'), GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs§ion=wechall_api', 'generic', '', true);
echo GWF_Button::wrapEnd();
示例7: getLastPosterLink
public function getLastPosterLink()
{
if ($this->getPostCount() === 1) {
return '';
}
if ('' === ($username = $this->getVar('thread_lastposter'))) {
return GWF_HTML::lang('guest');
}
$href = sprintf('%sprofile/%s', GWF_WEB_ROOT, urlencode($username));
return GWF_HTML::anchor($href, $username);
}
示例8:
$lastdate = $t->displayLastDate();
$b2 = $t->getBoard();
$anchor_board = GWF_HTML::anchor($b2->getShowBoardHREF(), $b2->getVar('board_title'));
$anchor_thread = GWF_HTML::anchor($t->getPageHREF(1), $t->getVar('thread_title'));
echo GWF_Table::rowStart();
echo GWF_Table::column($anchor_board . '<br/>' . $anchor_thread);
// GWF_HTML::anchor($t->getPageHREF(1), $t->displayBoardTitle().'<br/>'.$t->display('thread_title'), '', '', false));
echo GWF_Table::column($edit . $unread);
echo GWF_Table::column($t->getFirstPosterLink());
echo GWF_Table::column($t->getVar('thread_postcount'), 'gwf_num');
echo GWF_Table::column($t->getLastPosterLink());
$btn_next = GWF_Button::next($hrefLastPage, $lastposttxt);
echo GWF_Table::column(GWF_HTML::anchor($hrefLastPage, $lastdate, '', '', false) . $btn_next, 'gwf_date');
echo GWF_Table::column(GWF_HTML::anchor($hrefLastPage, $t->getVar('thread_thanks')), 'gwf_num');
echo GWF_Table::column(GWF_HTML::anchor($hrefLastPage, $t->getVar('thread_votes_up')), 'gwf_num');
echo GWF_Table::column(GWF_HTML::anchor($hrefLastPage, $t->getVar('thread_viewcount')), 'gwf_num');
echo GWF_Table::rowEnd();
}
echo GWF_table::end();
}
?>
<!-- End Of Latest Threads -->
<!-- Boards -->
<?php
echo $tVars['pagemenu_boards'];
?>
<?php
$childs = $tVars['boards'];
if (count($childs) > 0) {
示例9: array
<?php
$headers = array(array('WCID'), array('TITLE'), array('CAT'), array('SOL'), array('BTN'));
echo GWF_Form::start();
echo GWF_Table::start();
echo GWF_Table::displayHeaders1($headers);
foreach ($tVars['flags'] as $flag) {
$flag instanceof WC_Warflag;
$solved = $flag->getVar('wf_solved_at') !== NULL;
echo GWF_Table::rowStart();
echo GWF_Table::column($flag->getID());
$class = 'wc_chall_solved_' . ($solved ? '1' : '0');
echo GWF_Table::column(GWF_HTML::anchor($flag->getURL(), $flag->getTitle()), $class);
echo GWF_Table::column($flag->displayCat());
if ($flag->isWarchall()) {
echo GWF_Table::column('');
echo GWF_Table::column('');
} elseif ($solved) {
echo GWF_Table::column('SOLVED!');
echo GWF_Table::column('');
} else {
echo GWF_Table::column(sprintf('<input type="text" name="password[%s]" value="">', $flag->getID()));
echo GWF_Table::column(sprintf('<input type="submit" name="button[%s]" value="CHECK">', $flag->getID()));
}
echo GWF_Table::rowEnd();
}
echo GWF_Table::end();
echo GWF_Form::end();
示例10: displayColumn
public function displayColumn(GWF_Module $module, GWF_User $user, $col_name)
{
switch ($col_name) {
case 'order_id':
return $this->getVar($col_name);
case 'user_name':
return $this->getUser()->display($col_name);
case 'order_date_paid':
case 'order_date_ordered':
return GWF_Time::displayDate($this->getVar($col_name));
case 'order_price':
case 'order_price_total':
return $this->getCurrency()->displayValue($this->getVar($col_name), true);
case 'order_site':
return GWF_HTML::display($this->getPaymentModule()->getSiteName());
case 'order_status':
$status = $this->getVar('order_status');
$text = $module->lang('status_' . $status);
switch ($status) {
case self::CREATED:
case self::ORDERED:
case self::PAID:
case self::PROCESSED:
$href = '#';
}
return GWF_HTML::anchor($href, $text);
case 'order_data':
return $this->getData()->displayOrder();
case 'order_descr_admin':
$text = $this->display($col_name);
$href = GWF_WEB_ROOT . 'index.php?mo=Payment&me=StaffOrder&oid=' . $this->getID();
return GWF_HTML::anchor($href, $text);
default:
return $this->display($col_name);
// return sprintf('=[%s]=', $this->display($col_name));
}
}
示例11: array
<p><?php
echo $tLang->lang('pi_trashcan');
?>
</p>
<?php
echo $tVars['pagemenu'];
$headers = array(array($tLang->lang('th_pm_options&1'), 'options&1', 'DESC'), array($tLang->lang('th_pm_date'), 'pm_date', 'DESC'), array($tLang->lang('th_pm_from'), 'T_B.user_name', 'ASC'), array($tLang->lang('th_pm_to'), 'T_A.user_name', 'ASC'), array($tLang->lang('th_pm_title'), 'pm_title', 'ASC'), array());
$data = array();
$uid = GWF_Session::getUserID();
echo sprintf('<form id="gwf_pm_form" method="post" action="%s">', $tVars['form_action']);
//echo sprintf('<table>');
foreach ($tVars['pms'] as $pm) {
$pm instanceof GWF_PM;
// $is_read = $pm->isOptionEnabled(GWF_PM::READ);
// $is_sender = $pm->getSender()->getID() === $uid;
// $is_deleted = $pm->getReceiver()->
// $class = $is_sender ? ($is_read ? 'gwf_pm_read' : 'gwf_pm_unread') : ($is_read ? 'gwf_pm_new' : 'gwf_pm_old');
$data[] = array(sprintf('<span class="%s" />', $pm->getHTMLClass()), sprintf('%s', GWF_Time::displayDate($pm->getVar('pm_date'))), sprintf('%s', $pm->getSender()->display('user_name')), sprintf('%s', $pm->getReceiver()->display('user_name')), sprintf('%s', GWF_HTML::anchor($pm->getDisplayHREF(), $pm->getVar('pm_title'))), sprintf('<input type="checkbox" name="pm[%s]" />', $pm->getID()));
}
$headers = GWF_Table::getHeaders2($headers, $tVars['sort_url']);
$btns = '<input type="submit" name="restore" value="' . $tLang->lang('btn_restore') . '" />';
$raw_body = '<tr><td colspan="4"></td><td class="ri">' . $btns . '</td><td>' . '<input type="checkbox" onclick="gwfPMToggleAll(this.checked);"/>' . '</td></tr>';
echo GWF_Table::display2($headers, $data, $tVars['sort_url'], '', $raw_body);
//echo sprintf('</table>');
echo sprintf('</form>');
echo $tVars['form_empty'];
示例12: array
<?php
GWF_Javascript::focusElementByName('term');
echo $tVars['form_q'];
# quickform
# Start PMs
if (count($tVars['pms']) > 0) {
$headers = array(array($tLang->lang('th_pm_options&1'), 'pm_options&1'), array($tLang->lang('th_pm_date'), 'pm_date'), array($tLang->lang('th_pm_from')), array($tLang->lang('th_pm_to')), array($tLang->lang('th_pm_title'), 'pm_title'), array('<input type="checkbox" onclick="gwfPmToggleAll"/>'));
$uid = GWF_Session::getUserID();
echo $tVars['pagemenu'];
echo sprintf('<form id="gwf_pm_form" method="post" action="%s">', $tVars['form_action']);
echo GWF_Table::start();
echo GWF_Table::displayHeaders2($headers, $tVars['sort_url']);
foreach ($tVars['pms'] as $pm) {
$pm instanceof GWF_PM;
echo GWF_Table::rowStart();
echo sprintf('<td><span class="%s" /></td>', $pm->getHTMLClass()) . PHP_EOL;
echo sprintf('<td>%s</td>', GWF_Time::displayDate($pm->getVar('pm_date'))) . PHP_EOL;
echo sprintf('<td>%s</td>', $pm->getSender()->display('user_name')) . PHP_EOL;
echo sprintf('<td>%s</td>', $pm->getReceiver()->display('user_name')) . PHP_EOL;
echo sprintf('<td>%s</td>', GWF_HTML::anchor($pm->getDisplayHREF($tVars['term']), $pm->getVar('pm_title'))) . PHP_EOL;
echo sprintf('<td><input type="checkbox" name="pm[%s]" /></td>', $pm->getID()) . PHP_EOL;
echo GWF_Table::rowEnd();
}
echo GWF_Table::end();
echo '</form>' . PHP_EOL;
echo $tVars['pagemenu'];
}
# End PMs
示例13: switch
<?php
$order = $tVars['order'];
$order instanceof GWF_Order;
$status = $order->getVar('order_status');
$status_text = $tLang->lang('status_' . $status);
switch ($status) {
case GWF_Order::CREATED:
case GWF_Order::ORDERED:
$status_link = GWF_HTML::anchor($tVars['href_paid'], $status_text);
break;
case GWF_Order::PAID:
case GWF_Order::PROCESSED:
$status_link = $status_text;
break;
}
echo GWF_Table::start();
echo GWF_Table::rowStart();
echo sprintf('<td>%s</td>', $tLang->lang('th_order_id'));
echo sprintf('<td>%s</td>', $order->getVar('order_id'));
echo GWF_Table::rowEnd();
echo GWF_Table::rowStart();
echo sprintf('<td>%s</td>', $tLang->lang('th_order_token'));
echo sprintf('<td>%s</td>', $order->getVar('order_token'));
echo GWF_Table::rowEnd();
echo GWF_Table::rowStart();
echo sprintf('<td>%s</td>', $tLang->lang('th_user_name'));
echo sprintf('<td>%s</td>', $order->getOrderUser()->displayProfileLink());
echo GWF_Table::rowEnd();
echo GWF_Table::rowStart();
echo sprintf('<td>%s</td>', $tLang->lang('th_order_email'));
示例14: sprintf
$same_score = $solved;
}
if ($has_osr === true) {
$osr = $user->getVar('regat_onsiterank');
if ($osr === '0') {
$osr = '?';
}
$onsiterank = " ({$osr})";
} else {
$onsiterank = '';
}
echo GWF_Table::rowStart();
echo sprintf('<td>%s</td>', $same_rank);
// echo sprintf('<td>%s</td>', GWF_Country::displayFlagS($data['user_countryid']));
echo sprintf('<td>%s</td>', $user->displayCountryFlag());
echo sprintf('<td>%s</td>', GWF_HTML::anchor($user->getProfileHREF(), $user->getVar('user_name')));
// echo sprintf('<td class="gwf_num">%s</td>', $score);
echo sprintf('<td class="gwf_num">%s</td>', $user->getVar('regat_score'));
echo sprintf('<td class="gwf_num">%.02f%%</td>', $user->getVar('regat_solved') * 100);
echo '<td>';
echo $logo;
$username = $user->display('user_name');
foreach ($tVars['sites'] as $site) {
$site instanceof WC_Site;
$sid2 = $site->getVar('site_id');
$var = 'site_' . $sid2;
if ($user->hasVar($var)) {
$solved = $user->getVar($var);
$percent = round($solved * 100, 2);
$txt = $username . $solvetext . $percent . '%' . $ontxt . $site->display('site_name');
echo $site->displayLogo(round(30 * $solved + 2), $txt, $solved >= 1, 32, $username);
示例15: elseif
} else {
$ugopt = 0;
}
if (($ugopt & (GWF_UserGroup::LEADER | GWF_UserGroup::CO_LEADER)) > 0) {
$edit = GWF_Button::edit(GWF_WEB_ROOT . 'edit_usergroup/' . $group->getID() . '/' . $group->urlencodeSEO('group_name'));
} else {
$edit = '';
}
$parent_board = $tVars['module']->getForumBoard();
if (false !== ($board = GWF_ForumBoard::getByID($group->getVar('group_bid')))) {
$href = $board->getShowBoardHREF();
$forum = GWF_HTML::anchor($href, $group->getVar('group_name'));
} else {
$forum = $group->display('group_name');
}
$members = GWF_HTML::anchor(GWF_WEB_ROOT . 'users_in_group/' . $group->getID() . '/' . $group->urlencodeSEO('group_name'), $group->getVar('group_memberc'));
echo GWF_Table::rowStart();
echo GWF_Table::column($edit . $forum, 'nowrap');
echo GWF_Table::column($members, 'gwf_num');
echo GWF_Table::column($founder->displayProfileLink());
if ($user->isGuest()) {
echo '<td></td>' . PHP_EOL;
} elseif ($in_grp) {
echo GWF_Table::column(sprintf('<input type="submit" name="part[%s]" value="%s" />', $group->getVar('group_id'), $btn_part));
} elseif ($group->isOptionEnabled(GWF_Group::FREE)) {
echo GWF_Table::column(sprintf('<input type="submit" name="join[%s]" value="%s" />', $group->getVar('group_id'), $btn_join));
} else {
echo '<td></td>' . PHP_EOL;
}
echo GWF_Table::rowEnd();
}