本文整理汇总了PHP中GWF_HTML::display方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_HTML::display方法的具体用法?PHP GWF_HTML::display怎么用?PHP GWF_HTML::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_HTML
的用法示例。
在下文中一共展示了GWF_HTML::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sanitize
private function sanitize()
{
$this->quoted = Common::getGet('quote') !== false;
if (false === ($pid = Common::getGet('pid'))) {
if (false === ($this->thread = $this->module->getCurrentThread())) {
return $this->module->error('err_post');
}
if (false === ($this->post = $this->thread->getLastPost())) {
// return $this->module->error('err_post');
}
$this->replyThread = true;
} elseif (false === ($this->post = $this->module->getCurrentPost())) {
return $this->module->error('err_post');
} else {
if (false === ($this->thread = $this->post->getThread())) {
return $this->module->error('err_post');
}
}
# Check Permission
$user = GWF_Session::getUser();
if (!$this->thread->hasReplyPermission($user, $this->module)) {
$a = GWF_HTML::display($this->post->getShowHREF());
return $this->module->error('err_reply_perm', array($a));
}
if (false !== ($last_post = $this->thread->getLastPost())) {
if ($last_post->getPosterID() === GWF_Session::getUserID()) {
if (!$this->module->cfgDoublePost()) {
$a = GWF_HTML::display($this->post->getShowHREF());
return $this->module->error('err_better_edit', array($a));
}
}
}
return false;
}
示例2: validate_tags
public static function validate_tags(Module_Links $module, $arg)
{
$errors = array();
$new = 0;
$arg = explode(',', trim($arg));
$taken = array();
$minlen = 3;
$maxlen = $module->cfgMaxTagLen();
foreach ($arg as $tag) {
$tag = trim($tag);
if (strlen($tag) === 0) {
continue;
}
if (false === GWF_LinksTag::getByName($tag)) {
if (self::isValidTagName($tag, $minlen, $maxlen)) {
$taken[] = $tag;
$new++;
} else {
$errors[] = $module->lang('err_tag', array(GWF_HTML::display($tag), $minlen, $maxlen));
}
} else {
$taken[] = $tag;
}
}
if (count($taken) === 0) {
$errors[] = $module->lang('err_no_tag');
}
$_POST['link_tags'] = implode(',', $taken);
if (count($errors) === 0) {
return false;
}
return implode('<br/>', $errors);
}
示例3: parseStats
public function parseStats($url)
{
if (false === ($result = GWF_HTTP::getFromURL($url, false))) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$result = str_replace("", '', $result);
# BOM
$result = trim($result);
$stats = explode(":", $result);
if (count($stats) !== 7) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$i = 0;
$username = $stats[$i++];
$rank = intval($stats[$i++]);
$onsitescore = intval($stats[$i++]);
$onsitescore = Common::clamp($onsitescore, 0);
$maxscore = intval($stats[$i++]);
$challssolved = intval($stats[$i++]);
$challcount = intval($stats[$i++]);
$usercount = intval($stats[$i++]);
if ($maxscore === 0 || $challcount === 0 || $usercount === 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($onsitescore, $rank, $challssolved, $maxscore, $usercount, $challcount);
}
示例4: parseStats
public function parseStats($url)
{
if (false === ($result = GWF_HTTP::getFromURL($url, false))) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$stats = explode(':', $result);
if (count($stats) !== 7) {
// if ($result === '0') {
// return array(0, 0);
// }
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
# username:rank:score:maxscore:challssolved:challcount:usercount
$uname = $stats[0];
$rank = intval($stats[1]);
$onsitescore = intval($stats[2]);
$maxscore = intval($stats[3]);
$challssolved = intval($stats[4]);
$challcount = intval($stats[5]);
$usercount = intval($stats[6]);
if ($maxscore === 0 || $challcount === 0 || $usercount === 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($onsitescore, $rank, $challssolved, $maxscore, $usercount, $challcount);
}
示例5: send
private function send(GWF_User $user)
{
$form = $this->form($user);
if (false !== ($errors = $form->validate($this->module))) {
return $errors . $this->template($user);
}
$u = GWF_User::getStaticOrGuest();
$sendermail = $u->getValidMail();
if ($sendermail === '') {
$sendermail = Common::getPost('email');
}
if ($sendermail === '') {
$sendermail = GWF_HTML::lang('unknown');
}
$sendermail = GWF_HTML::display($sendermail);
$mail = new GWF_Mail();
$mail->setSender(GWF_BOT_EMAIL);
$mail->setReceiver($user->getValidMail());
$mail->setReply($sendermail);
$mail->setSubject($this->module->langUser($user, 'mail_subj_mail', $sendermail));
$mail->setBody($this->module->langUser($user, 'mail_subj_body', array($user->displayUsername(), $sendermail, GWF_Message::display($_POST['message']))));
if (false === $mail->sendToUser($user)) {
return GWF_HTML::err('ERR_MAIL_SENT');
}
return $this->module->message('msg_mailed', array($user->displayUsername()));
}
示例6: 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));
}
示例7: parseStats
public function parseStats($url)
{
$result2 = GWF_HTTP::getFromURL($url, false);
$result = explode(':', $result2);
if (count($result) !== 6) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result2), $this->displayName())));
}
list($rank, $score, $maxscore, $challsolved, $challcount, $usercount) = $result;
return array(intval($score), (int) $rank, $challsolved, $maxscore, $usercount, $challcount);
}
示例8: templateFile
private function templateFile($filename)
{
if (false === ($file = $this->gatherFile($filename))) {
return GWF_HTML::err('ERR_FILE_NOT_FOUND', array(GWF_HTML::display($filename)));
}
$fileclass = GWF_LangFile::getByPath($file[0]);
$form = $this->getFileForm($file);
$tVars = array('file' => $file, 'class' => $fileclass, 'form' => $form->templateY($this->module->lang('ft_edit_file', array(GWF_HTML::display($filename)))));
return $this->module->templatePHP('file.php', $tVars);
}
示例9: templateShow
public function templateShow()
{
if (false === ($news = GWF_News::getNewsQuick($this->module->getNewsPerPage(), $this->catid, $this->page, GWF_Language::getCurrentID()))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
$date = count($news) > 0 ? $news[0]['news_date'] : GWF_Settings::getSetting('gwf_site_birthday') . '090000';
$date = GWF_Time::displayDate($date);
GWF_Website::setPageTitle($this->module->lang('pt_news', array($date)));
GWF_Website::setMetaTags($this->module->lang('mt_news', array($date)));
GWF_Website::setMetaDescr($this->module->lang('md_news', array($this->page, $this->nPages)));
// $mod_forum = GWF_Module::getModule('Forum', true);
$tVars = array('news' => $news, 'titles' => GWF_News::getTitlesQuick($this->catid, GWF_Language::getCurrentID()), 'cats' => GWF_News::getCategories(), 'catid' => $this->catid, 'cat' => GWF_HTML::display($this->catTitle), 'page_menu' => $this->getPageMenu(), 'page' => $this->page, 'can_sign' => $this->module->canSignNewsletter(GWF_Session::getUser()), 'href_sign_news' => $this->module->hrefSignNewsletter(), 'may_add' => GWF_User::isAdminS() || GWF_User::isStaffS(), 'href_add' => $this->module->hrefAddNews());
return $this->module->templatePHP('show.php', $tVars);
}
示例10: parseStats
public function parseStats($url)
{
$result = GWF_HTTP::getFromURL($url, false);
if ($result === false) {
return false;
}
if ($result === "Unknown User") {
return htmlDisplayError(WC_HTML::lang('err_onsitename', array($this->displayName())));
}
$data = explode(":", $result);
if (count($data) !== 5 || $data[3] < 0 || $data[3] > $data[4] || $data[2] == 0 || $data[4] == 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($data[3], Common::clamp($data[1], 0), $data[3], $data[4], $data[2], $data[4]);
}
示例11: parseStats
public function parseStats($url)
{
if (false === ($result = GWF_HTTP::getFromURL($url, false))) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$stats = explode(':', $result);
if (count($stats) !== 3) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
list($onsitescore, $challcount, $usercount) = $stats;
if ($challcount == 0 || $usercount == 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($onsitescore, -1, -1, $challcount, $usercount, $challcount);
}
示例12: parseStats
public function parseStats($url)
{
if (false === ($result = GWF_HTTP::getFromURL($url, false))) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$result = explode(":", $result);
if (count($result) !== 4) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
list($rank, $score, $challcount, $usercount) = $result;
if ($rank < 1 || $challcount == 0 || $usercount == 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($score, $rank, $score, $challcount, $usercount, $challcount);
}
示例13: parseStats
public function parseStats($url)
{
if (false === ($result = GWF_HTTP::getFromURL($url, false))) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$data = explode(':', $result);
if (count($data) !== 5) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
list($rank, $score, $maxscore, $usercount, $challcount) = $data;
if ($rank == 0 || $maxscore == 0 || $usercount == 0 || $challcount == 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array(round($score), $rank, -1, $maxscore, $usercount, $challcount);
}
示例14: parseStats
public function parseStats($url)
{
if (false === ($result = GWF_HTTP::getFromURL($url, false))) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$stats = explode(":", $result);
if (count($stats) !== 4) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
if ($stats[0] < 0 || $stats[0] > $stats[1] || $stats[3] == 0 || $stats[2] == 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$score = round($stats[0] / $stats[1] * 10000);
return array($score, -1, -1, 10000, $stats[3], $stats[2]);
}
示例15: parseStats
public function parseStats($url)
{
if (false === ($result = GWF_HTTP::getFromURL($url, false))) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$data = explode(":", $result);
if (count($data) !== 7) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$challcount = isset($data[5]) ? intval($data[5]) : $this->getVar('challcount');
$usercount = isset($data[6]) ? intval($data[6]) : $this->getVar('usercount');
if ($data[1] < 0 || $data[1] > $data[2] || $challcount == 0 || $usercount == 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($data[1], $data[4], -1, $data[2], $usercount, $challcount);
}