本文整理汇总了PHP中WC_HTML类的典型用法代码示例。如果您正苦于以下问题:PHP WC_HTML类的具体用法?PHP WC_HTML怎么用?PHP WC_HTML使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WC_HTML类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例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())));
}
$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
示例3: insertEntry
public static function insertEntry($siteid, $score, $usercount, $challcount, $comment = '')
{
$entry = new self(array('sitehist_sid' => $siteid, 'sitehist_date' => time(), 'sitehist_score' => $score, 'sitehist_usercount' => $usercount, 'sitehist_challcount' => $challcount, 'sitehist_comment' => $comment));
if (WECHALL_DEBUG_SCORING) {
echo WC_HTML::message('Inserting Site History Item...');
}
return $entry->insert();
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:WC_HistorySite.php
示例4: 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);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:WCSite_WC.php
示例5: execute
public function execute()
{
GWF3::setConfig('log_request', false);
$back = array();
$user = GWF_User::getStaticOrGuest();
$back['news'] = (int) $this->module->getNewsCount();
$back['pm'] = (int) WC_HTML::getUnreadPMCount($user);
$back['links'] = (int) WC_HTML::getUnreadLinksCount($user);
$back['forum'] = (int) WC_HTML::getUnreadThreadCount($user);
return json_encode($back);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:UnreadCounter.php
示例6: insertEntry
public static function insertEntry(GWF_User $user, WC_Site $site, $onsitescore, $comment)
{
$user = GWF_User::getByID($user->getID());
$max = $site->getOnsiteScore();
$perc = $max <= 0 ? 0 : round($onsitescore / $max * 10000);
$entry = new self(array('userhist_uid' => $user->getVar('user_id'), 'userhist_date' => time(), 'userhist_sid' => $site->getVar('site_id'), 'userhist_percent' => $perc, 'userhist_onsitescore' => $onsitescore, 'userhist_rank' => WC_RegAt::calcRank($user), 'userhist_totalscore' => $user->getVar('user_level'), 'userhist_comment' => $comment));
if (WECHALL_DEBUG_SCORING) {
echo WC_HTML::message('Inserting User History entry...');
}
return $entry->insert();
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:WC_HistoryUser.php
示例7: execute
public function execute()
{
Module_WeChall::includeForums();
if (false !== ($cid = Common::getGet('solver'))) {
return $this->templateSolvers($cid);
}
WC_HTML::$RIGHT_PANEL = WC_HTML::$LEFT_PANEL = -1;
$for_userid = GWF_Session::getUserID();
$from_userid = false;
$tag = Common::getGetString('tag', '');
$by = $_GET['by'] = Common::getGetString('by', self::DEFAULT_BY);
$dir = $_GET['dir'] = Common::getGetString('dir', self::DEFAULT_DIR);
return $this->templateChalls($for_userid, $from_userid, $tag, $by, $dir);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:14,代码来源:Challs.php
示例8: 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);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:15,代码来源:WCSite_Asta.php
示例9: 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);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:15,代码来源:WCSite_NF.php
示例10: 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]);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:15,代码来源:WCSite_HQ.php
示例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())));
}
$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);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:15,代码来源:WCSite_BQ.php
示例12: 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]);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:15,代码来源:WCSite_TBS.php
示例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) !== 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);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:16,代码来源:WCSite_Rankk.php
示例14: execute
public function execute()
{
if (false === ($this->user = GWF_Session::getUser())) {
return GWF_HTML::err('ERR_LOGIN_REQUIRED');
}
$this->module->includeClass('WC_Warbox');
$this->module->includeClass('WC_Warflag');
$this->module->includeClass('WC_SiteAdmin');
$this->module->includeClass('WC_SiteCats');
$this->module->includeClass('sites/warbox/WCSite_WARBOX');
if (false === ($this->warbox = WC_Warbox::getByID(Common::getGetString('wbid')))) {
return WC_HTML::error('err_warbox');
}
if (!$this->warbox->hasEditPermission($this->user)) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
if (isset($_GET['edit'])) {
if (false === ($this->flag = WC_Warflag::getByID(Common::getGetString('edit')))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if (isset($_POST['edit'])) {
return $this->onEdit();
} else {
return $this->templateEdit();
}
}
if (isset($_POST['add'])) {
return $this->onAdd();
}
if (isset($_GET['add'])) {
return $this->templateAdd();
}
if (isset($_POST['import'])) {
return $this->onCSVImport();
}
if (isset($_GET['export'])) {
return $this->onCSVExport();
}
if (isset($_GET['up'])) {
return $this->onUp() . $this->templateOverview();
} elseif (isset($_GET['down'])) {
return $this->onDown() . $this->templateOverview();
}
return $this->templateOverview();
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:45,代码来源:Warflags.php
示例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())));
}
$stats = explode(':', $result);
if (count($stats) < 2) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$onsitescore = intval($stats[0]);
$maxscore = intval($stats[1]);
$challcount = $maxscore;
$usercount = intval($stats[2]);
if ($onsitescore === 0 || $maxscore === 0 || $challcount === 0 || $usercount === 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($onsitescore, -1, $onsitescore, $maxscore, $usercount, $challcount);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:WCSite_ae2.php
示例16: 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())));
}
$challs = $stats[1];
$done = $stats[0];
#$usercount = $stats[2];
if ($challs == 0) {
# || $usercount == 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($done, -1, $done, $challs, 0, $challs);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:WCSite_Hispa.php
示例17: 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);
$percent = $data[0];
if (!is_numeric($percent) || $percent < 0 || $percent > 1) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$usercount = isset($data[1]) ? $data[1] : $this->getUsercount();
if ($usercount == 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
$maxscore = $this->getOnsiteScore();
$challcount = $this->getChallcount();
return array(round($percent * $maxscore), -1, -1, $maxscore, $usercount, $challcount);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:WCSite_Elec.php
示例18: sidologyRemixCheckAnswer
function sidologyRemixCheckAnswer(WC_Challenge $chall, $answer)
{
if (false !== ($error = $chall->isAnswerBlocked(GWF_User::getStaticOrGuest()))) {
echo $error;
return;
}
$solution = '726f3a30c8ae485b4f34d5ff0fed05552d3da60b';
# :) HappyCracking!
$hash = $answer;
for ($i = 0; $i < 100000; $i++) {
$hash = sha1($hash);
}
// echo "$hash<br/>\n";
if ($hash === $solution) {
$chall->onChallengeSolved();
} else {
echo WC_HTML::error('err_wrong');
}
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:index.php
示例19: 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())));
}
$rank = (int) $data[0];
$score = (int) ($data[1] * 100);
$maxscore = (int) ($data[2] * 100);
$users = (int) $data[3];
$challs = (int) $data[4];
if ($score > $maxscore || $score < 0 || $maxscore == 0 || $challs == 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($score, $rank, -1, $maxscore, $users, $challs);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:WCSite_DYM.php
示例20: 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())));
}
$onsitescore = intval($stats[0]);
$onsitescore = Common::clamp($onsitescore, 0);
$maxscore = intval($stats[1]);
$usercount = intval($stats[2]);
$onsiterank = isset($stats[3]) ? intval($stats[3]) : -1;
$challcount = $maxscore;
if ($maxscore === 0 || $challcount === 0 || $usercount === 0) {
return htmlDisplayError(WC_HTML::lang('err_response', array(GWF_HTML::display($result), $this->displayName())));
}
return array($onsitescore, $onsiterank, $onsitescore, $maxscore, $usercount, $challcount);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:20,代码来源:WCSite_BBox.php
注:本文中的WC_HTML类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论