当前位置: 首页>>代码示例>>PHP>>正文


PHP GWF_Box::box方法代码示例

本文整理汇总了PHP中GWF_Box::box方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_Box::box方法的具体用法?PHP GWF_Box::box怎么用?PHP GWF_Box::box使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GWF_Box的用法示例。


在下文中一共展示了GWF_Box::box方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: die

    die(file_get_contents('index.php'));
}
# Header
chdir('../../../');
define('GWF_PAGE_TITLE', 'Training: RegexMini');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, 'challenge/training/regex2/index.php', false);
}
$chall->showHeader();
# Info box
echo GWF_Box::box($chall->lang('info', array('index.php?show=source', 'index.php?highlight=christmas')), $chall->lang('title'));
# Show highlighted src
if (isset($_GET['highlight'])) {
    $source = '[PHP title=regex2/index.php]' . file_get_contents('challenge/training/regex2/index.php') . '[/PHP]';
    echo GWF_Box::box(GWF_Message::display($source, true, false));
}
# Submitted?
if (isset($_POST['submit'])) {
    # Check it!
    $error = ludde_is_satisfied($chall);
    # Oooops!
    if ($error === true) {
        $chall->onChallengeSolved(GWF_Session::getUserID());
    } elseif ($error === false) {
        echo GWF_HTML::message(GWF_PAGE_TITLE, $chall->lang('msg_ok', array($_POST['username'])), false);
    } else {
        echo GWF_HTML::error(GWF_PAGE_TITLE, $error, false);
    }
}
# Check it!
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:index.php

示例2: testSmiley

 public static function testSmiley(WC_Challenge $chall, $smiley, $path)
 {
     $back = true;
     # Test passed :S?
     # Generate test input :)
     $ues = str_replace('\\', '', $smiley);
     $ues = Common::regex('#/([^/]+)/#', $ues);
     $text = 'Test ' . $ues . '. Test ' . $ues;
     echo GWF_Box::box($text, $chall->lang('test_input'));
     # Generate test output :)
     if (NULL === ($out = self::replaceSmiley($smiley, $path, $text))) {
         $back = false;
         $out = $text;
     }
     # Output the test :)
     echo GWF_Box::box($out, $chall->lang('test_output'));
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:LIVIN_Smile.php

示例3: execute

 public function execute()
 {
     if (Common::getGetString('list', '0') === '1') {
         return $this->module->template("tools/list.tpl");
     }
     $whitelist = array('jpk', 'yabfdbg', 'jcs', 'jdictac', 'wordpat', 'wordlists', 'startcpp', 'encodings');
     $file = Common::getGet('file');
     if (!in_array($file, $whitelist, true)) {
         return GWF_HTML::err('ERR_PARAMETER', array(__FILE__, __LINE__, 'file'));
     }
     # Counter Box
     $count = GWF_Counter::getAndCount($file, 1);
     $box = GWF_Box::box($this->module->lang('pi_viewcount', array($count)));
     # Translations
     $langpath = $this->module->getDir() . '/lang/' . $file;
     #.'/'.$file;
     $trans = new GWF_LangTrans($langpath);
     GWF_Website::setPageTitle($trans->lang('page_title'));
     GWF_Website::setMetaTags($trans->lang('meta_tags'));
     $tVars = array('lang2' => $trans);
     return $this->module->templatePHP("tools/{$file}/{$file}.php", $tVars) . $box;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:22,代码来源:Tools.php

示例4: wordpat

function wordpat($pattern)
{
    if (false === ($pattern = wordpatValidatePattern($pattern))) {
        return htmlDisplayError("Invalid pattern");
    }
    if (false === ($matches = wordpatMatch($pattern))) {
        return htmlDisplayError("Internal error");
    }
    $numMatches = count($matches);
    $title = "{$numMatches} words matching '{$pattern}'";
    if ($numMatches == 0) {
        $text = "No Match";
    } else {
        $text = '<table><tr>';
        $i = 0;
        foreach ($matches as $match) {
            $text .= "<td style=\"margin: 1px 6px; padding: 1px 6px;\">{$match}</td>";
            $text .= ++$i % 5 == 0 ? "</tr><tr>" : "";
        }
        $text .= '</tr></table>';
    }
    echo GWF_Box::box($text, $title);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:23,代码来源:wordpat.php

示例5: array

<?php

$headers = array(array('Rank'), array(''), array('Points'), array('Username'), array('Solved'), array('Last Activity'));
$box = $tVars['box'];
$box instanceof WC_Warbox;
$site = $box->getSite();
echo $tVars['site_quickjump'];
echo $tVars['pagemenu'];
$vars = array($tVars['playercount'], $box->displayName(), $site->displayName());
echo GWF_Box::box($tLang->lang('info_warbox_players', $vars), $tLang->lang('title_warbox_players', $vars));
echo GWF_Table::start();
echo GWF_Table::displayHeaders1($headers);
$rank = $tVars['rank'];
foreach ($tVars['data'] as $row) {
    echo GWF_Table::rowStart();
    echo GWF_Table::column($rank++, 'gwf_num');
    echo GWF_Table::column(GWF_Country::displayFlagS($row['country']));
    echo GWF_Table::column($row['score'], 'gwf_num');
    echo GWF_Table::column(GWF_User::displayProfileLinkS($row['user_name']));
    echo GWF_Table::column(sprintf('%s (%.02f%%)', $row['solved'], $row['percent']), 'gwf_num');
    echo GWF_Table::column(GWF_Time::displayDate($row['solvedate']), 'gwf_date');
    echo GWF_Table::rowEnd();
}
echo GWF_Table::end();
echo $tVars['pagemenu'];
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:warbox_players.php

示例6: array

// $href_api_3 = GWF_WEB_ROOT.'index.php?mo=WeChall&amp;me=JoinUs&amp;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&amp;me=JoinUs&amp;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&amp;me=JoinUs&amp;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&section=warbox');
echo GWF_Button::generic($l->lang('btn_join_opt'), GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs&section=optional');
echo GWF_Button::generic($l->lang('btn_api'), GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs&section=wechall_api', 'generic', '', true);
echo GWF_Button::wrapEnd();
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:join_api.php

示例7: chdir

<?php

chdir('../../');
define('GWF_PAGE_TITLE', 'Pimitive Encryption');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 4, 'challenge/pimitive_encryption/index.php');
}
$chall->showHeader();
$href_zip = 'pimitive.zip';
if (false === ($jander = GWF_User::getByName('Jander'))) {
    $jander = '<b>Jander</b>';
} else {
    $jander = $jander->displayProfileLink();
}
$chall->onCheckSolution();
echo GWF_Box::box($chall->lang('info', array($jander, $href_zip)), $chall->lang('title'));
echo formSolutionbox($chall);
# Your footer
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
开发者ID:sinfocol,项目名称:gwf3,代码行数:22,代码来源:index.php

示例8: chdir

<?php

$data = (require 'data.php');
$solution = (require 'solution.php');
require 'expdb.php';
chdir('../../../../');
define('GWF_PAGE_TITLE', 'Experience');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 3, 'challenge/training/php/experience/index.php', $solution);
}
$chall->showHeader();
$chall->onCheckSolution();
$user = GWF_User::getStaticOrGuest();
$username = $user->isGuest() ? $chall->lang('guest') : $user->displayUsername();
$hint = '<span style="color:#fff;">' . $chall->lang('hint') . '</span>' . PHP_EOL;
echo GWF_Box::box($chall->lang('descr', array($username, $hint)));
if (!($db = gdo_db_instance(EXP_DB_HOST, EXP_DB_USER, EXP_DB_PASS, EXP_DB_NAME))) {
    echo GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
} else {
    require 'blackbox.php';
    formSolutionbox($chall);
}
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:index.php

示例9: array

<?php

$headers = array(array('Pos', 'wf_order', 'ASC'), array('Score', 'wf_score', 'ASC'), array('Title', 'wf_title', 'ASC'), array('Solvers', 'wf_solvers', 'ASC'), array('LastSolvedBy', 'user_name', 'ASC'), array('LastSolved', 'wf_last_solved_at', 'ASC'));
$logged_in = GWF_User::isLoggedIn();
if ($logged_in) {
    $headers[] = array('Unlock');
}
$box = $tVars['box'];
$box instanceof WC_Warbox;
$site = $tVars['site'];
$site instanceof WC_Site;
$user = GWF_Session::getUser();
$href_flags = $box->hrefFlags();
echo $tVars['site_quickjump'];
echo GWF_Box::box($tLang->lang('info_warbox_details', array($site->displayName(), $box->displayName(), count($tVars['data']))), $tLang->lang('title_warbox_details', array($site->displayName(), $box->displayName())));
echo GWF_Table::start();
echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']);
function solving_form($tVars, WC_Warflag $flag)
{
    $form = '';
    $form .= GWF_Form::start(true, GWF_Form::ENC_DEFAULT, 'post', false);
    $form .= sprintf('<input type="hidden" name="wfid" value="%s" />', $flag->getID());
    $form .= sprintf('<input type="text" name="password_solution" value="" />');
    $form .= sprintf('<input type="submit" name="igotitnow" value="!" />');
    $form .= GWF_Form::end();
    // 	$data = array(
    // 		'flagid' => array(GWF_Form::HIDDEN, $flag->getID()),
    // 		'solution' => array(GWF_Form::STRING, ''),
    // 	);
    // 	$form = new GWF_Form($tVars['method'], $data);
    // 	return $form->templateX();
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:warbox_details.php

示例10: sprintf

<?php

$box_c = '';
if (!isset($tVars['no_info'])) {
    $box_c .= sprintf('<p>%s</p>', $tLang->lang('payment_info'));
}
if (isset($tVars['paymodule_info']) && $tVars['paymodule_info'] !== '') {
    $box_c .= sprintf('<p>%s</p>', $tVars['paymodule_info']);
}
echo GWF_Box::box($box_c);
echo sprintf('<p>%s</p>', $tVars['order']);
?>
<table>
<?php 
echo sprintf('%s<td colspan="2">%s</td><td>%s</td>%s', GWF_Table::rowStart(), $tLang->lang('th_price'), $tVars['price'], GWF_Table::rowEnd());
if ($tVars['has_fee']) {
    echo sprintf('%s<td>%s</td><td>%s</td><td>%s</td>%s', GWF_Table::rowStart(), $tLang->lang('th_fee_per'), $tVars['fee_percent'], $tVars['fee'], GWF_Table::rowEnd());
    echo sprintf('%s<td colspan="2">%s</td><td>%s</td>%s', GWF_Table::rowStart(), $tLang->lang('th_price_total'), $tVars['price_total'], GWF_Table::rowEnd());
}
echo sprintf('<tr><td colspan="3">%s</td></tr>', $tVars['buttons']);
?>
</table>
开发者ID:sinfocol,项目名称:gwf3,代码行数:22,代码来源:order.php

示例11: chdir

<?php

# WeChall things
chdir('../../../');
define('GWF_PAGE_TITLE', 'PHP 0819');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, 'challenge/space/php0819/index.php', false);
}
$chall->showHeader();
###############
## Challenge ##
###############
GWF_Debug::setDieOnError(false);
GWF_Debug::setMailOnError(false);
require_once 'challenge/space/php0819/php0819.php';
echo GWF_Box::box($chall->lang('info', array(GWF_WEB_ROOT . 'profile/space')), $chall->lang('title'));
if (isset($_GET['eval'])) {
    if (true === $challenge()) {
        $chall->onChallengeSolved(GWF_Session::getUserID());
    }
}
GWF_Debug::setDieOnError(true);
GWF_Debug::setMailOnError(true);
$filename = 'challenge/space/php0819/php0819.php';
$message = '[PHP]' . file_get_contents($filename) . '[/PHP]';
echo GWF_Message::display($message);
# TODO: GET form input box? (gizmore)
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:index.php

示例12: chdir

<?php

require_once 'warconfig.php';
chdir('../../../');
define('GWF_PAGE_TITLE', 'Training: Warchall - The Beginning');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 1, 'challenge/warchall/begins/index.php', 'bitwarrior,LameStartup,HiddenIsConfig,RepeatingHistory,AndIknowchown,OhRightThePerms');
}
$chall->showHeader();
$score = 0;
$chall->onCheckSolution();
echo GWF_Box::box($chall->lang('info'), $chall->lang('title'));
if (false === ($user = GWF_Session::getUser())) {
    echo GWF_HTML::error('Warchall', $chall->lang('err_login'));
} elseif ($score > ($scre = $user->getLevel())) {
    echo GWF_HTML::error('Warchall', $chall->lang('err_score', $scre, $score));
} else {
    echo warchall1createAccount($chall);
}
formSolutionbox($chall);
echo $chall->copyrightFooter();
require 'challenge/warchall/ads.php';
require_once 'challenge/html_foot.php';
final class WCA_FormCreate
{
    public function form(WC_Challenge $chall)
    {
        $data = array('password1' => array(GWF_Form::PASSWORD, '', $chall->lang('th_password')), 'password2' => array(GWF_Form::PASSWORD, '', $chall->lang('th_password2')), 'create' => array(GWF_Form::SUBMIT, $chall->lang('btn_submit')));
        return new GWF_Form($this, $data);
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:index.php

示例13: chdir

chdir('../../../');
define('GWF_PAGE_TITLE', 'Stop us');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 3, 'challenge/noother/stop_us/index.php', false);
}
$chall->showHeader();
# -------------------------- #
$href1 = 'index.php?show=source';
$href2 = 'index.php?highlight=christmas';
$href3 = 'index.php?show=noothtable';
$href4 = 'index.php?highlight=noothtable';
$jjk = 'jjk';
$dloser = 'dloser';
echo GWF_Box::box($chall->lang('info', array('nootherdomain.php', $href1, $href2, $href3, $href4, $jjk, $dloser)), $chall->lang('title'));
# -------------------------- #
if (false !== ($file = Common::getGetString('highlight', false))) {
    if ($file === 'noothtable') {
        $file = 'noothtable.php';
    } else {
        $file = 'nootherdomain.php';
    }
    $message = '[PHP title=' . $file . ']' . file_get_contents('challenge/noother/stop_us/' . $file) . '[/PHP]';
    echo GWF_Box::box(GWF_Message::display($message));
}
# -------------------------- #
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
?>

开发者ID:sinfocol,项目名称:gwf3,代码行数:29,代码来源:index.php

示例14: array

# -------------------------- #
if (false !== ($answer = Common::getPostString('answer', false))) {
    require_once 'challenge/livinskull/smile/LIVIN_Smile.php';
    $solution = LIVIN_Smile::getSolution();
    if ($answer === $solution) {
        $chall->onChallengeSolved(GWF_Session::getUserID());
    } else {
        echo WC_HTML::error('err_wrong');
    }
}
# -------------------------- #
$url1 = 'index.php?show=smile';
$url2 = 'index.php?highlight=smile';
$url3 = 'index.php?show=livin_smile';
$url4 = 'index.php?highlight=livin_smile';
$url5 = 'smile.php';
echo GWF_Box::box($chall->lang('info', array($url1, $url2, $url3, $url4, $url5)), $chall->lang('title'));
# -------------------------- #
if (false !== ($file = Common::getGetString('highlight', false))) {
    $files = array('smile' => 'smile.php', 'livin_smile' => 'LIVIN_Smile.php');
    if (isset($files[$file])) {
        $content = file_get_contents("challenge/livinskull/smile/" . $files[$file]);
        $message = '[PHP]' . $content . '[/PHP]';
        echo GWF_Box::box(GWF_Message::display($message), $files[$file]);
    }
}
# -------------------------- #
echo formSolutionbox($chall);
# -------------------------- #
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:index.php

示例15: chdir

<?php

chdir('../../../../');
define('GWF_PAGE_TITLE', 'Training: Caterpillar');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, 'challenge/training/stegano/caterpillar/index.php');
}
$chall->showHeader();
$chall->onCheckSolution();
echo GWF_Box::box($chall->lang('info', array('caterpillar.png')), $chall->lang('title'));
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
开发者ID:sinfocol,项目名称:gwf3,代码行数:15,代码来源:index.php


注:本文中的GWF_Box::box方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。