本文整理汇总了PHP中GWF_HTML类的典型用法代码示例。如果您正苦于以下问题:PHP GWF_HTML类的具体用法?PHP GWF_HTML怎么用?PHP GWF_HTML使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GWF_HTML类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: templatePay
private function templatePay(Module_PaymentBank $module, GWF_Order $order)
{
if (false === $order->saveVar('order_status', GWF_Order::ORDERED)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
$tVars = array('lang' => $module->loadLangGWF(), 'order_c' => $order);
return $module->templatePHP('pay2.php', $tVars);
//
// $module2 = $order->getOrderModule();
// $module2->onLoadLanguage();
// $gdo = $order->getOrderData();
// $user = $order->getUser();
// $sitename = $module->getSiteName();
//
// $action = GWF_WEB_ROOT.'index.php?mo=PaymentBank&me=Pay2';
// $hidden = GWF_Form::hidden('gwf_token', $order->getOrderToken());
// $buttons = Module_Payment::tinyform('Bank Transfer', 'img/'.GWF_ICON_SET.'buy_bank.png', $action, $hidden);
//
// $lang = $module->loadLangGWF();
//
// $tVars = array(
// 'lang' => $lang,
// 'user' => $user,
// 'order_c' => $order,
// 'order' => Module_Payment::displayOrder3S($module2, $order, $gdo, $user, $sitename, $buttons),
// );
// return $module->templatePHP('pay.php', $tVars);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:28,代码来源:Pay2.php
示例2: 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);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:WCSite_VH.php
示例3: onMarkSolved
public function onMarkSolved(GWF_HelpdeskTicket $ticket, GWF_HelpdeskMsg $message)
{
if (false === $ticket->saveVars(array('hdt_status' => 'solved'))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return $this->module->message('msg_solve_solved');
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:MarkSolved.php
示例4: write
public static function write($image, $fontfile, $x, $y, $text, $color, $maxwidth, $size = 11, $spacingx = 2, $spacingy = 2, $mx = 1, $my = 1, $angle = 0)
{
if (!Common::isFile($fontfile)) {
echo GWF_HTML::err('ERR_FILE_NOT_FOUND', array(htmlspecialchars($fontfile)));
return false;
}
$dim = GWF_GDText::getFontSize($fontfile, $size, $angle);
$fontwidth = $dim->w;
$fontheight = $dim->h;
if ($maxwidth != NULL) {
// die(''.$maxwidth);
$maxcharsperline = floor($maxwidth / $fontwidth);
$text = wordwrap($text, $maxcharsperline, "\n", 1);
// die($text);
}
// die(var_dump($color));
$lines = explode("\n", $text);
$x += $mx;
$y += $my;
foreach ($lines as $line) {
$y += $fontheight + $spacingy;
imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $line);
}
return true;
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:GWF_GDText.php
示例5: templateError
private function templateError()
{
$module = $this->module;
$module instanceof Module_GWF;
$codes = $module->lang('ERR_HTTP');
# Get the error page
$code = Common::getGetString('code', '0');
if (false === isset($codes[$code])) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
@header($_SERVER['SERVER_PROTOCOL'] . ' ' . $code . ' ' . $codes[$code]);
# Generate template
$tVars = array('code' => $code, 'file' => GWF_HTML::error(GWF_SITENAME, $module->getLang()->langA('ERR_HTTP', $code, array(htmlspecialchars($_SERVER['REQUEST_URI']))), false));
$template = $module->template($this->_tpl, $tVars);
# Is the request blacklisted?
foreach (preg_split('/[,;]/', $module->cfgBlacklist()) as $pattern) {
if (false !== strpos($_SERVER['REQUEST_URI'], $pattern)) {
# Do not log and email the request
return $template;
}
}
$message = self::getMessage($code);
# Mail it?
if (1 === preg_match("/(?:^|[,;]){$code}(?:\$|[,;])/", $module->cfgMail())) {
self::errorMail($code, $message);
}
# Log it?
if (1 === preg_match("/(?:^|[,;]){$code}(?:\$|[,;])/", $module->cfgLog())) {
GWF_Log::logHTTP($message);
}
return $template;
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:32,代码来源:ShowError.php
示例6: onVote
private function onVote(GWF_VoteMulti $poll, $user)
{
$opts = Common::getPostArray('opt', array());
$taken = array();
$max = $poll->getNumChoices();
foreach ($opts as $i => $stub) {
$i = (int) $i;
if ($i < 1 || $i > $max) {
continue;
}
if (!in_array($i, $taken, true)) {
$taken[] = $i;
}
}
$count = count($taken);
// if ($count === 0) {
// return $this->module->error('err_no_options');
// }
if (!$poll->isMultipleChoice() && $count !== 1) {
return $this->module->error('err_no_multi');
}
if (false === $poll->onVote($user, $taken)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return $this->module->message('msg_voted', array(htmlspecialchars(GWF_Session::getLastURL())));
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:VotePoll.php
示例7: 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);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:WCSite_PHM.php
示例8: onAssign
public function onAssign(GWF_HelpdeskTicket $ticket, GWF_User $user)
{
if (false === $ticket->saveVars(array('hdt_worker' => $user->getID(), 'hdt_status' => 'working'))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return $this->module->message('msg_assigned', array($ticket->getID(), $user->displayUsername()));
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:AssignWork.php
示例9: welcome
private function welcome($first_time)
{
if (false === ($user = GWF_Session::getUser())) {
return GWF_HTML::err('ERR_LOGIN_REQUIRED');
}
require_once GWF_CORE_PATH . 'module/Login/GWF_LoginHistory.php';
GWF_Hook::call(GWF_Hook::LOGIN_AFTER, $user, array(GWF_Session::getOrDefault('GWF_LOGIN_BACK', GWF_WEB_ROOT)));
$fails = GWF_Session::getOrDefault('GWF_LOGIN_FAILS', 0);
GWF_Session::remove('GWF_LOGIN_FAILS');
if ($fails > 0) {
$fails = $this->module->lang('err_failures', array($fails));
} else {
$fails = '';
}
$href_hist = $this->module->getMethodURL('History');
$username = $user->display('user_name');
if (false !== ($ll = GWF_LoginHistory::getLastLogin($user->getID()))) {
$last_login = $this->module->lang('msg_last_login', array($ll->displayDate(), $ll->displayIP(), $ll->displayHostname(), $href_hist));
$welcome = $this->module->lang('welcome_back', array($username, $ll->displayDate(), $ll->displayIP()));
} else {
$last_login = '';
$welcome = $this->module->lang('welcome', array($username));
}
$tVars = array('welcome' => $welcome, 'fails' => $fails, 'last_login' => $last_login, 'href_history' => $href_hist);
return $this->module->template('welcome.tpl', $tVars);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:Welcome.php
示例10: imageButton
private function imageButton()
{
$cs = $this->size;
$cx = $cy = round($this->size / 2);
if (false === ($image = imagecreatetruecolor($cs, $cs))) {
# FIXME: {gizmore} define in bootstrap? check if function exists?
return GWF_HTML::err('ERR_GENERAL');
}
imagealphablending($image, true);
$background = imagecolorallocatealpha($image, 0x0, 0x0, 0x0, 0x0);
imagecolortransparent($image, $background);
$color = $this->getColor($image);
$white = imagecolorallocate($image, 0xff, 0xff, 0xff);
imagefilledellipse($image, $cx, $cy, $cs, $cs, $white);
imagefilledellipse($image, $cx, $cy, $cs - 1, $cs - 1, $color);
header('Content-Type: image/' . $this->ext);
switch ($this->ext) {
case 'png':
imagepng($image);
break;
case 'gif':
imagegif($image);
break;
case 'jpg':
imagejpeg($image);
break;
default:
return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
}
imagedestroy($image);
die(0);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:32,代码来源:Button.php
示例11: execute
public function execute()
{
$this->module->includeClass('WC_Warbox');
$this->module->includeClass('WC_Warflag');
$this->module->includeClass('WC_WarToken');
$this->module->includeClass('sites/warbox/WCSite_WARBOX');
# CHECK TOKEN
if (isset($_GET['CHECK'])) {
$_GET['ajax'] = 1;
if (false === ($username = Common::getGetString('username', false))) {
return GWF_HTML::err('ERR_PARAMETER', array('username'));
}
if (false === ($token = Common::getGetString('token', false))) {
return GWF_HTML::err('ERR_PARAMETER', array('token'));
}
return WC_WarToken::isValidWarToken($username, $token) ? '1' : '0';
}
# GET CONFIG
if (isset($_GET['CONFIG'])) {
return $this->genConfig();
}
if (!GWF_Session::isLoggedIn()) {
return GWF_HTML::err('ERR_LOGIN_REQUIRED');
}
# GEN AND SHOW
return $this->templateToken();
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:Warbox.php
示例12: onPost
private function onPost($nickname, $target, $message)
{
# Validate the crap!
if (false !== ($error = GWF_ChatValidator::validate_yournick($this->module, $nickname))) {
return $error;
}
if (false !== ($error = GWF_ChatValidator::validate_target($this->module, $target))) {
$error;
}
if (false !== ($error = GWF_ChatValidator::validate_message($this->module, $message))) {
return $error;
}
# Post it!
$oldnick = $this->module->getNickname();
$sender = Common::getPost('yournick', $oldnick);
$target = trim($target);
$message = str_replace("\n", '<br/>', Common::getPost('message'));
if ($oldnick === false) {
$sender = $this->module->getGuestPrefixed($sender);
$this->module->setGuestNick($sender);
} else {
$sender = $oldnick;
}
if (false === GWF_ChatMsg::newMessage($sender, $target, $message)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return '1';
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:28,代码来源:Ajax.php
示例13: err
protected static function err($key, $args = null)
{
$message = GWF_HTML::langISO('en', $key, $args);
GWF_Log::logError($message);
self::reply($message);
return false;
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Dog_Worker.php
示例14: execute
public function execute()
{
if (false === ($group = GWF_Group::getByID(Common::getGet('gid')))) {
return $this->module->error('err_unk_group');
}
if ($group->isOptionEnabled(GWF_Group::VISIBLE_MEMBERS)) {
} else {
switch ($group->getVisibleMode()) {
case GWF_Group::VISIBLE:
break;
case GWF_Group::COMUNITY:
if (!GWF_Session::isLoggedIn()) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
break;
case GWF_Group::HIDDEN:
case GWF_Group::SCRIPT:
if (!GWF_User::isInGroupS($group->getVar('group_name'))) {
return $this->module->error('err_not_invited');
}
break;
default:
return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
}
}
return $this->templateUsers($group);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:ShowUsers.php
示例15: onAdd
private function onAdd(Dog_User $user, $url)
{
if (false !== ($link = Dog_Link::getByURL($url))) {
return true;
}
if (false === ($description = $this->getDescription($url))) {
Dog_Log::error('Mod_Link::onAdd() failed. URL: ' . $url);
return false;
}
$type = $description[0];
$description = $description[1];
switch ($type) {
case 'image':
if (false === ($link = Dog_Link::insertImage($user->getID(), $url, $description))) {
GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
return;
}
break;
case 'html':
if (false === ($link = Dog_Link::insertLink($user->getID(), $url, $description))) {
GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
return;
}
break;
default:
echo "UNKNOWN TYPE: {$type}\n";
return;
}
Dog_Log::user($user, sprintf('Inserted Link %s (ID:%d)', $url, $link->getID()));
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:DOGMOD_Link.php
示例16: Upgrade_Slaytags_1_01
function Upgrade_Slaytags_1_01(Module_Slaytags $module)
{
GWF_Website::addDefaultOutput(GWF_HTML::message('Slaytags', "BPM and Key"));
$songs = GDO::table('Slay_Song');
$songs->createColumn('ss_bpm');
$songs->createColumn('ss_key');
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Upgrade_Slaytags_1_01.php
示例17: onAddSite
public function onAddSite()
{
$form = $this->getForm();
if (false !== ($error = $form->validate($this->module))) {
return $error . $this->templateSiteAdd();
}
$site = new WC_Site(array('site_status' => 'wanted', 'site_name' => $form->getVar('site_name'), 'site_classname' => $form->getVar('site_classname'), 'site_country' => 0, 'site_language' => 0, 'site_joindate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'site_launchdate' => '', 'site_authkey' => GWF_Random::randomKey(32), 'site_xauthkey' => GWF_Random::randomKey(32), 'site_irc' => '', 'site_url' => '', 'site_url_mail' => '', 'site_url_score' => '', 'site_url_profile' => '', 'site_score' => 0, 'site_basescore' => 0, 'site_avg' => 0, 'site_vote_dif' => 0, 'site_vote_fun' => 0, 'site_challcount' => 0, 'site_usercount' => 0, 'site_visit_in' => 0, 'site_visit_out' => 0, 'site_options' => 0, 'site_boardid' => 0, 'site_threadid' => 0, 'site_tags' => ''));
if (false === $site->insert()) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
Module_WeChall::includeVotes();
if (false === $site->onCreateVotes()) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
Module_WeChall::includeForums();
if (false === $site->onCreateBoard()) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if (false === $site->onCreateThread($this->module)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
require_once GWF_CORE_PATH . 'module/WeChall/WC_SiteDescr.php';
if (false === WC_SiteDescr::insertDescr($site->getID(), 1, 'Please edit me :)')) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return $this->module->message('msg_site_added');
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:SiteAdd.php
示例18: 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);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:33,代码来源:GWF_LinksValidator.php
示例19: getDescription
public static function getDescription($siteid)
{
$siteid = (int) $siteid;
$browser_lid = GWF_Language::getCurrentID();
if (false === ($result = GDO::table('WC_Site')->selectAll('site_desc_lid, site_desc_txt', "site_desc_sid={$siteid} AND (site_desc_lid= {$browser_lid} OR site_desc_lid=site_descr_lid)", '', array('description'), 2, 0, GDO::ARRAY_N))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
// $sites = GWF_TABLE_PREFIX.'wc_site';
// $descr = GWF_TABLE_PREFIX.'wc_site_descr';
// $db = gdo_db();
//
// $query = "SELECT site_desc_lid, site_desc_txt FROM $sites JOIN $descr ON site_desc_sid=site_id WHERE site_desc_sid=$siteid AND (site_desc_lid=$browser_lid OR site_desc_lid=site_descr_lid)";
//
// if (false === ($result = $db->queryAll($query, false))) {
// return '';
// }
//
if (count($result) === 2) {
if ($result[0][0] === $browser_lid) {
return $result[0][1];
} else {
return $result[1][1];
}
} else {
return $result[0][1];
}
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:WC_SiteDescr.php
示例20: display
public static function display(GWF_Module $module, GDO $gdo, $user, $sortURL, $conditions = '', $ipp = 25, $pageURL = false, $joins = NULL)
{
$fields = $gdo->getSortableFields($user);
$headers = self::getGDOHeaders2($module, $gdo, $user, $sortURL);
$nItems = $gdo->countRows($conditions);
$nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
$page = Common::clamp(intval(Common::getGet('page', 1)), 1, $nPages);
$orderby = self::getMultiOrderBy($gdo, $user);
$from = GWF_PageMenu::getFrom($page, $ipp);
$i = 0;
$data = array();
if (false === ($result = $gdo->select('*', $conditions, $orderby, $joins, $ipp, $from))) {
echo GWF_HTML::err(ERR_DATABASE, __FILE__, __LINE__);
return false;
}
while (false !== ($row = $gdo->fetch($result, GDO::ARRAY_O))) {
$row instanceof GWF_Sortable;
$data[$i] = array();
foreach ($fields as $field) {
$data[$i][] = $row->displayColumn($module, $user, $field);
}
$i++;
}
$gdo->free($result);
if ($pageURL === false) {
$pageURL = '';
} elseif ($pageURL === true) {
$pageURL = str_replace(array('%BY%', '%DIR%'), array(urlencode(Common::getGet('by')), urlencode(Common::getGet('dir'))), $sortURL);
$pageURL .= '&page=%PAGE%';
}
$pagemenu = $pageURL === '' ? '' : GWF_PageMenu::display($page, $nPages, $pageURL);
return $pagemenu . self::display2($headers, $data) . $pagemenu;
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:33,代码来源:GWF_TableGDO.php
注:本文中的GWF_HTML类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论