本文整理匯總了PHP中Get::postHeader方法的典型用法代碼示例。如果您正苦於以下問題:PHP Get::postHeader方法的具體用法?PHP Get::postHeader怎麽用?PHP Get::postHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Get
的用法示例。
在下文中一共展示了Get::postHeader方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: do_private_post
function do_private_post($content, $results)
{
global $config, $speak;
$results = Mecha::O($results);
$results = $config->is->post ? Get::postHeader($results->path, POST . DS . $config->page_type, '/', $config->page_type . ':') : false;
if ($results === false) {
return $speak->plugin_private_post->description;
}
$s = isset($results->fields->pass) ? $results->fields->pass : "";
if (strpos($s, ':') !== false) {
$s = explode(':', $s, 2);
if (isset($s[1])) {
$speak->plugin_private_post->hint = ltrim($s[1]);
}
// override password hint
$s = $s[0];
}
$hash = md5($s . PRIVATE_POST_SALT);
$html = Notify::read(false) . '<div class="overlay--' . File::B(__DIR__) . '"></div><form class="form--' . File::B(__DIR__) . '" action="' . $config->url . '/' . File::B(__DIR__) . '/do:access" method="post">' . NL;
$html .= TAB . Form::hidden('token', Guardian::token()) . NL;
$html .= TAB . Form::hidden('_', $hash) . NL;
$html .= TAB . Form::hidden('kick', $config->url_current) . NL;
$html .= TAB . '<p>' . $speak->plugin_private_post->hint . '</p>' . NL;
$html .= TAB . '<p>' . Form::text('access', "", $speak->password . '…', array('autocomplete' => 'off')) . ' ' . Form::button($speak->submit, null, 'submit') . '</p>' . NL;
$html .= '</form>' . O_END;
if ($results && isset($results->fields->pass) && trim($results->fields->pass) !== "") {
if (!Guardian::happy() && Session::get('is_allow_post_access') !== $hash) {
return $html;
}
}
return $content;
}
示例2: function
* GET PAGE/ARTICLE HEADER(S) ONLY
* ==========================================================================
*
* -- CODE: -----------------------------------------------------------------
*
* var_dump(Get::pageHeader('lorem-ipsum'));
* var_dump(Get::articleHeader('lorem-ipsum'));
*
* --------------------------------------------------------------------------
*
*/
Get::plug('pageHeader', function ($path) {
return Get::postHeader($path, PAGE, '/', 'page:');
});
Get::plug('articleHeader', function ($path) {
return Get::postHeader($path, ARTICLE, '/' . Config::get('index.slug') . '/', 'article:');
});
/**
* ==========================================================================
* EXTRACT PAGE/ARTICLE FILE INTO LIST OF PAGE/ARTICLE DATA
* ==========================================================================
*
* -- CODE: -----------------------------------------------------------------
*
* var_dump(Get::page('lorem-ipsum'));
* var_dump(Get::article('lorem-ipsum'));
*
* --------------------------------------------------------------------------
*
*/
Get::plug('page', function ($reference, $excludes = array()) {