本文整理汇总了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()) {