本文整理汇总了PHP中section_head函数的典型用法代码示例。如果您正苦于以下问题:PHP section_head函数的具体用法?PHP section_head怎么用?PHP section_head使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了section_head函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_solved_challenges
function print_solved_challenges($user_id)
{
validate_id($user_id);
section_head(lang_get('solved_challenges'));
$submissions = db_query_fetch_all('
SELECT
s.added,
((SELECT COUNT(*) FROM submissions AS ss WHERE ss.correct = 1 AND ss.added < s.added AND ss.challenge=s.challenge)+1) AS pos,
ch.id AS challenge_id,
ch.available_from,
ch.title,
ch.points,
ca.title AS category_title
FROM submissions AS s
LEFT JOIN challenges AS ch ON ch.id = s.challenge
LEFT JOIN categories AS ca ON ca.id = ch.category
WHERE
s.correct = 1 AND
s.user_id = :user_id AND
ch.exposed = 1 AND
ca.exposed = 1
ORDER BY s.added DESC', array('user_id' => $user_id));
if (count($submissions)) {
echo '
<table class="table table-striped table-hover">
<thead>
<tr>
<th>', lang_get('challenge'), '</th>
<th>', lang_get('solved'), '</th>
<th>', lang_get('points'), '</th>
</tr>
</thead>
<tbody>
';
foreach ($submissions as $submission) {
echo '
<tr>
<td>
<a href="', CONFIG_SITE_URL, 'challenge?id=', htmlspecialchars($submission['challenge_id']), '">
', htmlspecialchars($submission['title']), '
</a> (', htmlspecialchars($submission['category_title']), ')
</td>
<td>
', get_position_medal($submission['pos'], true), '
', time_elapsed($submission['added'], $submission['available_from']), ' ', lang_get('after_release'), ' (', date_time($submission['added']), ')
</td>
<td>', number_format($submission['points']), '</td>
</tr>
';
}
echo '
</tbody>
</table>
';
} else {
message_inline_blue(lang_get('no_challenges_solved'));
}
}
示例2: tx_detail
/**
* Output transaction details via HTML code
*
* @param string $tx_id
*/
function tx_detail($tx_id)
{
$raw_tx = getrawtransaction($tx_id);
if (!isset($raw_tx["txid"])) {
section_head("Error");
section_subhead("This transaction is not in the blockchain");
return;
}
section_head("Transaction: " . $raw_tx["txid"]);
section_subhead("Detailed Description");
detail_display("TX Version", $raw_tx["version"]);
detail_display("TX Time", date("F j, Y, H:i:s", $raw_tx["time"]));
detail_display("Lock Time", $raw_tx["locktime"]);
detail_display("Confirmations", $raw_tx["confirmations"]);
detail_display("Block Hash", blockhash_link($raw_tx["blockhash"]));
// Florin Coin Feature
if (isset($raw_tx["tx-comment"]) && $raw_tx["tx-comment"] != "") {
detail_display("TX Message", htmlspecialchars($raw_tx["tx-comment"]));
}
detail_display("HEX Data", $raw_tx["hex"], 50);
section_head("Transaction Inputs");
foreach ($raw_tx["vin"] as $key => $txin) {
section_subhead("Input Transaction " . $key);
if (isset($txin["coinbase"])) {
detail_display("Coinbase", $txin["coinbase"]);
detail_display("Sequence", $txin["sequence"]);
} else {
detail_display("TX ID", tx_link($txin["txid"]));
detail_display("TX Output", $txin["vout"]);
detail_display("TX Sequence", $txin["sequence"]);
detail_display("Script Sig (ASM)", $txin["scriptSig"]["asm"], 50);
detail_display("Script Sig (HEX)", $txin["scriptSig"]["hex"], 50);
}
}
section_head("Transaction Outputs");
foreach ($raw_tx["vout"] as $key => $txout) {
section_subhead("Output Transaction " . $key);
detail_display("TX Value", $txout["value"]);
detail_display("TX Type", $txout["scriptPubKey"]["type"]);
if (isset($txout["scriptPubKey"]["reqSigs"])) {
detail_display("Required Sigs", $txout["scriptPubKey"]["reqSigs"]);
}
detail_display("Script Pub Key (ASM)", $txout["scriptPubKey"]["asm"], 50);
detail_display("Script Pub Key (HEX)", $txout["scriptPubKey"]["hex"], 50);
if (isset($txout["scriptPubKey"]["addresses"])) {
foreach ($txout["scriptPubKey"]["addresses"] as $key => $address) {
}
detail_display("Address " . $key, $address);
}
}
/* Commented as all the raw info is already presented above
section_head ("Raw Transaction Detail");
echo " <textarea name=\"rawtrans\" rows=\"25\" cols=\"80\" style=\"text-align:left;\">\n";
print_r ($raw_tx);
echo " \n</textarea><br><br>\n";*/
}
示例3: enforce_authentication
<?php
require '../../include/mellivora.inc.php';
enforce_authentication(CONFIG_UC_MODERATOR);
head('Users');
menu_management();
section_head('Users');
echo '
<table id="files" class="table table-striped table-hover">
<thead>
<tr>
<th>Team</th>
<th>Email</th>
<th>Added</th>
<th>Class</th>
<th>Enabled</th>
<th>Num IPs</th>
<th>Manage</th>
</tr>
</thead>
<tbody>
';
$values = array();
$search_for = array_get($_GET, 'search_for');
if ($search_for) {
$values['search_for_team_name'] = '%' . $search_for . '%';
$values['search_for_email'] = '%' . $search_for . '%';
}
$from = get_pager_from($_GET);
$num_users = db_count_num('users');
$results_per_page = 100;
示例4: login_session_refresh
<?php
require '../include/mellivora.inc.php';
login_session_refresh();
if (strlen(array_get($_GET, 'code')) != 2) {
message_error(lang_get('please_supply_country_code'));
}
$country = db_select_one('countries', array('id', 'country_name', 'country_code'), array('country_code' => $_GET['code']));
if (!$country) {
message_error(lang_get('please_supply_country_code'));
}
head($country['country_name']);
if (cache_start(CONST_CACHE_NAME_COUNTRY . $_GET['code'], CONFIG_CACHE_TIME_COUNTRIES)) {
section_head(htmlspecialchars($country['country_name']) . country_flag_link($country['country_name'], $country['country_code'], true), '', false);
$scores = db_query_fetch_all('
SELECT
u.id AS user_id,
u.team_name,
u.competing,
co.id AS country_id,
co.country_name,
co.country_code,
SUM(c.points) AS score,
MAX(s.added) AS tiebreaker
FROM users AS u
LEFT JOIN countries AS co ON co.id = u.country_id
LEFT JOIN submissions AS s ON u.id = s.user_id AND s.correct = 1
LEFT JOIN challenges AS c ON c.id = s.challenge
WHERE u.competing = 1 AND co.id = :country_id
GROUP BY u.id
ORDER BY score DESC, tiebreaker ASC', array('country_id' => $country['id']));
示例5: enforce_authentication
<?php
require '../../include/ctf.inc.php';
enforce_authentication(CONST_USER_CLASS_MODERATOR);
head('Hints');
menu_management();
section_head('Hints', button_link('Add new hint', 'new_hint'), false);
echo '
<table id="hints" class="table table-striped table-hover">
<thead>
<tr>
<th>Challenge</th>
<th>Added</th>
<th>Hint</th>
<th>Manage</th>
</tr>
</thead>
<tbody>
';
$hints = db_query_fetch_all('
SELECT
h.id,
h.added,
h.body,
c.title
FROM hints AS h
LEFT JOIN challenges AS c ON c.id = h.challenge');
foreach ($hints as $hint) {
echo '
<tr>
<td>', htmlspecialchars($hint['title']), '</td>
示例6: SUM
SELECT
ca.title,
(SELECT SUM(ch.points) FROM challenges AS ch JOIN submissions AS s ON s.challenge = ch.id AND s.user_id = :user_id AND s.correct = 1 WHERE ch.category = ca.id GROUP BY ch.category) AS points,
(SELECT SUM(ch.points) FROM challenges AS ch WHERE ch.category = ca.id GROUP BY ch.category) AS category_total
FROM categories AS ca
ORDER BY ca.title ASC', array('user_id' => $_GET['id']));
$user_total = 0;
$ctf_total = 0;
foreach ($challenges as $challenge) {
echo '<strong>', htmlspecialchars($challenge['title']), '</strong>, ', number_format($challenge['points']), ' / ', number_format($challenge['category_total']), ' (', round($challenge['points'] / max(1, $challenge['category_total']) * 100), '%)';
progress_bar($challenge['points'] / max(1, $challenge['category_total']) * 100);
$user_total += $challenge['points'];
$ctf_total += $challenge['category_total'];
}
echo 'Total: ', number_format($user_total), ' / ', number_format($ctf_total), ' (', round($user_total / $ctf_total * 100, 1), '%)';
section_head('Solved challenges');
$submissions = db_query_fetch_all('
SELECT
s.added,
((SELECT COUNT(*) FROM submissions AS ss WHERE ss.correct = 1 AND ss.added < s.added AND ss.challenge=s.challenge)+1) AS pos,
ch.id AS challenge_id,
ch.available_from,
ch.title,
ch.points,
ca.title AS category_title
FROM submissions AS s
LEFT JOIN challenges AS ch ON ch.id = s.challenge
LEFT JOIN categories AS ca ON ca.id = ch.category
WHERE
s.correct = 1 AND
s.user_id = :user_id
示例7: enforce_authentication
<?php
require '../../include/mellivora.inc.php';
enforce_authentication(CONST_USER_CLASS_MODERATOR);
head('IP log');
menu_management();
$where = array();
if (is_valid_ip(array_get($_GET, 'ip'))) {
section_head('Teams using IP ' . $_GET['ip']);
$where['ip'] = ip2long($_GET['ip']);
} else {
if (is_valid_id(array_get($_GET, 'user_id'))) {
section_head('IP log for user');
$where['user_id'] = $_GET['user_id'];
} else {
message_error('Must supply either IP or user ID');
}
}
echo '
<table id="files" class="table table-striped table-hover">
<thead>
<tr>
<th>Team name</th>
<th>Hostname</th>
<th>First used</th>
<th>Last used</th>
<th>Times used</th>
</tr>
</thead>
<tbody>
';
示例8: prefer_ssl
<?php
require '../include/ctf.inc.php';
prefer_ssl();
head(lang_get('two_factor_auth_required'));
section_head(lang_get('two_factor_auth_required'));
form_start('actions/two_factor_auth');
form_input_text('Code', false, array('autocomplete' => 'off', 'autofocus' => true));
form_hidden('action', 'authenticate');
form_button_submit(lang_get('authenticate'));
form_end();
foot();
示例9: array
FROM users AS u
LEFT JOIN countries AS co ON co.id = u.country_id
LEFT JOIN submissions AS s ON u.id = s.user_id AND s.correct = 1
LEFT JOIN challenges AS c ON c.id = s.challenge
WHERE u.competing = 1 AND u.user_type = :user_type
GROUP BY u.id
ORDER BY score DESC, tiebreaker ASC', array('user_type' => $user_type['id']));
scoreboard($scores);
}
}
echo '
</div> <!-- / span6 -->
<div class="col-lg-6">
';
section_head('Challenges');
$categories = db_query_fetch_all('
SELECT
id,
title,
available_from,
available_until
FROM
categories
WHERE
available_from < ' . $now . '
ORDER BY title');
foreach ($categories as $category) {
echo '
<table class="table table-striped table-hover">
<thead>
示例10: login_session_refresh
<?php
require '../include/mellivora.inc.php';
login_session_refresh();
if (!isset($_GET['show'])) {
message_error(lang_get('please_request_page'));
}
$menu_data = db_select_one('dynamic_menu', array('internal_page'), array('permalink' => $_GET['show']));
if (!is_valid_id($menu_data['internal_page'])) {
message_error(lang_get('not_a_valid_link'));
}
$content = db_select_one('dynamic_pages', array('id', 'title', 'body', 'visibility', 'min_user_class'), array('id' => $menu_data['internal_page']));
if ($content['visibility'] == 'private') {
enforce_authentication($content['min_user_class']);
}
head($content['title']);
if (cache_start($content['id'], CONFIG_CACHE_TIME_DYNAMIC, CONST_CACHE_DYNAMIC_PAGES_GROUP)) {
section_head($content['title']);
require CONST_PATH_THIRDPARTY . 'nbbc/nbbc.php';
$bbc = new BBCode();
$bbc->SetEnableSmileys(false);
echo $bbc->parse($content['body']);
cache_end($content['id'], CONST_CACHE_DYNAMIC_PAGES_GROUP);
}
foot();
示例11: UNIX_TIMESTAMP
ca.title AS category_title
FROM hints AS h
LEFT JOIN challenges AS c ON c.id = h.challenge
LEFT JOIN categories AS ca ON ca.id = c.category
WHERE
c.available_from < UNIX_TIMESTAMP() AND
c.available_until > UNIX_TIMESTAMP() AND
h.visible = 1 AND
c.exposed = 1 AND
ca.exposed = 1
ORDER BY h.id DESC
');
if (!count($hints)) {
message_generic(lang_get('hints'), lang_get('no_hints_available'), false);
}
section_head('Hints');
echo '
<table id="files" class="table table-striped table-hover">
<thead>
<tr>
<th>', lang_get('category'), '</th>
<th>', lang_get('challenge'), '</th>
<th>', lang_get('added'), '</th>
<th>', lang_get('hint'), '</th>
</tr>
</thead>
<tbody>
';
foreach ($hints as $hint) {
echo '
<tr>
示例12: enforce_authentication
<?php
require '../../include/mellivora.inc.php';
enforce_authentication(CONFIG_UC_MODERATOR);
require CONFIG_PATH_THIRDPARTY . 'nbbc/nbbc.php';
$bbc = new BBCode();
$bbc->SetEnableSmileys(false);
head('Site management');
menu_management();
section_head('List news');
$news = db_query_fetch_all('SELECT * FROM news WHERE instanceID=\'' . $_SESSION["IID"] . '\' ORDER BY added DESC');
foreach ($news as $item) {
echo '
<div class="news-container">';
section_head($item['title'] . ' <a href="edit_news.php?id=' . htmlspecialchars($item['id']) . '" class="btn btn-xs btn-primary">Edit</a>', '', false);
echo '
<div class="news-body">
', $item['body'], '
</div>
</div>
';
}
foot();
示例13: array
LEFT JOIN submissions AS s ON u.id = s.user_id AND s.correct = 1
LEFT JOIN challenges AS c ON c.id = s.challenge
WHERE
u.competing = 1 AND
u.user_type = :user_type
GROUP BY u.id
ORDER BY score DESC, tiebreaker ASC', array('user_type' => $user_type['id']));
scoreboard($scores);
}
}
echo '
</div> <!-- / span6 -->
<div class="col-lg-6">
';
section_head(lang_get('challenges'));
$categories = db_query_fetch_all('
SELECT
id,
title,
available_from,
available_until
FROM
categories
WHERE
available_from < ' . $now . ' AND
exposed = 1
ORDER BY title');
challenges($categories);
echo '
</div> <!-- / span6 -->
示例14: prefer_ssl
<?php
require '../include/mellivora.inc.php';
prefer_ssl();
enforce_authentication();
head('Expression of interest');
section_head('Expression of interest');
message_inline_bland("Like the look of our sponsors? They're all hiring. Please fill out the form below if you wish to be contacted with recruitment information. Each team member can fill out the form individually. We won't share your details with anyone but our sponsors. We won't spam you. Only addresses entered into this form will be shared.");
form_start('actions/recruit', 'form-signin');
echo '
<input name="name" type="text" class="form-control" placeholder="Name (optional)">
<input name="email" type="email" class="form-control" placeholder="Email address" required>
<input name="city" type="text" class="form-control" placeholder="City (optional)">
';
country_select();
form_hidden('action', 'register');
echo '
<button class="btn btn-primary" type="submit">Register interest</button>
';
form_end();
foot();
示例15: enforce_authentication
<?php
require '../../include/mellivora.inc.php';
enforce_authentication(CONFIG_UC_MODERATOR);
head('User types');
menu_management();
section_head('Users types');
echo '
<table id="files" class="table table-striped table-hover">
<thead>
<tr>
<th>Title</th>
<th>Description</th>
<th></th>
</tr>
</thead>
<tbody>
';
$types = db_query_fetch_all('SELECT * FROM user_types ORDER BY title ASC');
foreach ($types as $type) {
echo '
<tr>
<td>', htmlspecialchars($type['title']), '</td>
<td>', short_description($type['description'], 50), '</td>
<td><a href="edit_user_type.php?id=', htmlspecialchars($type['id']), '" class="btn btn-xs btn-primary">Edit</a></td>
</tr>
';
}
echo '
</tbody>
</table>