本文整理汇总了PHP中die_message函数的典型用法代码示例。如果您正苦于以下问题:PHP die_message函数的具体用法?PHP die_message怎么用?PHP die_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了die_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugin_edit_action
function plugin_edit_action()
{
global $vars, $_title_edit, $load_template_func;
if (PKWK_READONLY) {
die_message('PKWK_READONLY prohibits editing');
}
$page = isset($vars['page']) ? $vars['page'] : '';
check_editable($page, true, true);
if (isset($vars['preview']) || $load_template_func && isset($vars['template'])) {
return plugin_edit_preview();
} else {
if (isset($vars['write'])) {
return plugin_edit_write();
} else {
if (isset($vars['cancel'])) {
return plugin_edit_cancel();
}
}
}
$postdata = @join('', get_source($page));
if ($postdata == '') {
$postdata = auto_template($page);
}
return array('msg' => $_title_edit, 'body' => edit_form($page, $postdata));
}
示例2: plugin_newpage_action
function plugin_newpage_action()
{
global $vars;
$qm = get_qm();
if (PKWK_READONLY) {
die_message($qm->m['fmt_err_pkwk_readonly']);
}
if ($vars['page'] == '') {
$retvars['msg'] = $qm->m['plg_newpage']['label'];
$retvars['body'] = plugin_newpage_convert();
if (preg_match('/id="([^"]+)"/', $retvars['body'], $ms)) {
$domid = $ms[1];
//jquery ライブラリの読み込み
$qt = get_qt();
$qt->setv('jquery_include', true);
$addscript = <<<EOS
<script type="text/javascript">
jQuery(function(){
\tjQuery("#{$domid}").focus().select();
});
</script>
EOS;
$qt->appendv_once('plugin_select_fsize', 'beforescript', $addscript);
}
return $retvars;
} else {
$page = strip_bracket($vars['page']);
$r_page = rawurlencode(isset($vars['refer']) ? get_fullname($page, $vars['refer']) : $page);
$r_refer = rawurlencode($vars['refer']);
pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?cmd=read&page=' . $r_page . '&refer=' . $r_refer);
exit;
}
}
示例3: plugin_doc_ini_action
function plugin_doc_ini_action()
{
global $script, $vars, $_doc_ini_msg;
if (auth::check_role('role_adm_contents')) {
die_message('NOT AUTHORIZED.');
}
if (empty($vars['page'])) {
return;
}
if (!is_pagename($vars['page'])) {
return '';
}
// Invalid page name;
$action = empty($vars['action']) ? '' : $vars['action'];
$retval = array();
$msg_title = sprintf($_doc_ini_msg['msg_confirmation'], $vars['page']);
if ($action === 'exec') {
return plugin_doc_ini_exec($vars['page']);
}
$retval['body'] = <<<EOD
<form action="{$script}" method="post">
<div>
\t{$msg_title}
<input type="hidden" name="plugin" value="doc_ini" />
<input type="hidden" name="action" value="exec" />
<input type="hidden" name="page" value="{$vars['page']}" />
<input type="submit" value="{$_doc_ini_msg['btn_exec']}" />
</div>
</form>
EOD;
$retval['msg'] = $_doc_ini_msg['title_confirmation'];
return $retval;
}
示例4: plugin_gb_pageset_convert
/**
* GreyBox (gb_pageset) プラグイン
*
* @copyright Copyright © 2009, Katsumi Saito <katsumi@jo1upk.ymt.prug.or.jp>
* @version $Id: gb_pageset.inc.php,v 0.1 2009/03/31 00:37:00 upk Exp $
* @link http://orangoo.com/labs/GreyBox/
*/
function plugin_gb_pageset_convert()
{
global $script, $vars;
static $get_greybox = true;
if ($get_greybox) {
$get_greybox = false;
if (exist_plugin('greybox')) {
greybox_set_head_tags();
} else {
die_message('greybox plugin not found.');
}
}
$argv = func_get_args();
$argc = func_num_args();
$field = array('page_set_name', 'caption', 'url');
for ($i = 0; $i < $argc; $i++) {
${$field}[$i] = htmlspecialchars($argv[$i], ENT_QUOTES);
}
if (empty($page_set_name) || empty($url)) {
return 'usage: #gb_pageset(page_set_name, caption, url)';
}
if (empty($caption)) {
$caption = 'no title';
}
$caption = str_replace('&#039;', '\'', $caption);
// ' の対応
return '<a href="' . $url . '" title="' . $caption . '" rel="gb_pageset[' . $page_set_name . ']">' . $caption . "</a>\n";
}
示例5: plugin_newpage_action
function plugin_newpage_action()
{
global $vars;
$_btn_edit = _('Edit');
$_msg_newpage = _('New page');
// if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');
if (auth::check_role('readonly')) {
die_message(_('PKWK_READONLY prohibits editing'));
}
if (auth::is_check_role(PKWK_CREATE_PAGE)) {
die_message(_('PKWK_CREATE_PAGE prohibits editing'));
}
if ($vars['page'] == '') {
$retvars['msg'] = $_msg_newpage;
$retvars['body'] = plugin_newpage_convert();
return $retvars;
} else {
$page = strip_bracket($vars['page']);
if (isset($vars['refer'])) {
$r_page = get_fullname($page, $vars['refer']);
$r_refer = 'refer=' . $vars['refer'];
} else {
$r_page = $page;
$r_refer = '';
}
pkwk_headers_sent();
header('Location: ' . get_page_location_uri($r_page, $r_refer));
exit;
}
}
示例6: plugin_html2pdf_get_request_uri
function plugin_html2pdf_get_request_uri($init_uri = '')
{
if ($init_uri == '') {
// Set automatically
$msg = 'get_request_uri() failed: Please set $script at INI_FILE manually';
if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'][0] == '/') {
$url = SERVER_PORT == 443 ? 'https://' : 'http://';
// scheme
$url .= SERVER_NAME;
// host
$url .= SERVER_PORT == 80 ? '' : ':' . SERVER_PORT;
// port
$url .= $_SERVER['REQUEST_URI'];
} else {
global $vars;
$url = get_script_uri() . '?';
$queries = array();
$queries[] = $vars['cmd'] != '' ? 'cmd=' . rawurlencode($vars['cmd']) : '';
$queries[] = $vars['page'] != '' ? 'page=' . rawurlencode($vars['page']) : '';
$url .= implode('&', $queries);
}
if (!is_url($url, TRUE)) {
die_message($msg);
}
} else {
// Set manually
if (!is_url($init_uri, TRUE)) {
die_message('$url: Invalid URI');
}
$url = $init_uri;
}
return $url;
}
示例7: plugin_search_action
function plugin_search_action()
{
global $post, $vars, $_title_result, $_title_search, $_msg_searching;
if (PLUGIN_SEARCH_DISABLE_GET_ACCESS) {
$s_word = isset($post['word']) ? htmlsc($post['word']) : '';
} else {
$s_word = isset($vars['word']) ? htmlsc($vars['word']) : '';
}
if (strlen($s_word) > PLUGIN_SEARCH_MAX_LENGTH) {
unset($vars['word']);
// Stop using $_msg_word at lib/html.php
die_message('Search words too long');
}
$type = isset($vars['type']) ? $vars['type'] : '';
$base = isset($vars['base']) ? $vars['base'] : '';
if ($s_word != '') {
// Search
$msg = str_replace('$1', $s_word, $_title_result);
$body = do_search($vars['word'], $type, false, $base);
} else {
// Init
unset($vars['word']);
// Stop using $_msg_word at lib/html.php
$msg = $_title_search;
$body = '<br />' . "\n" . $_msg_searching . "\n";
}
// Show search form
$bases = $base == '' ? array() : array($base);
$body .= plugin_search_search_form($s_word, $type, $bases);
return array('msg' => $msg, 'body' => $body);
}
示例8: plugin_mypage_convert
function plugin_mypage_convert()
{
global $_mypage_msg;
@(list($is_page) = func_get_args());
$is_page = empty($is_page) ? false : true;
$auth_key = Auth::get_user_info();
// 認証確認
if (empty($auth_key['key'])) {
return '';
}
// マイページ利用の確認
if (empty($auth_key['mypage'])) {
return '';
}
// マイページの作成により制御
// マイページ未作成の場合
// is_page : true -> プラグイン利用ページに遷移 -> #mypage(1)
// : false -> 新規作成画面に遷移 -> #mypage
// The page cannot be prepared. -> ページの準備ができていません。
if ($is_page && !is_page($auth_key['mypage'])) {
return $_mypage_msg['msg_no_page'];
}
// 画面に誘導
header('Location: ' . get_page_location_uri($auth_key['mypage']));
// 誘導失敗時の対処(ブラウザによる)
die_message($_mypage_msg['err_jump']);
}
示例9: plugin_links_action
function plugin_links_action()
{
global $script, $post, $vars, $foot_explain;
global $_links_messages;
if (PKWK_READONLY) {
die_message('PKWK_READONLY prohibits this');
}
$msg = $body = '';
if (empty($vars['action']) || empty($post['adminpass']) || !pkwk_login($post['adminpass'])) {
$msg =& $_links_messages['title_update'];
$body = convert_html($_links_messages['msg_usage']);
$body .= <<<EOD
<form method="POST" action="{$script}">
<div>
<input type="hidden" name="plugin" value="links" />
<input type="hidden" name="action" value="update" />
<label for="_p_links_adminpass">{$_links_messages['msg_adminpass']}</label>
<input type="password" name="adminpass" id="_p_links_adminpass" size="20" value="" />
<input type="submit" value="{$_links_messages['btn_submit']}" />
</div>
</form>
EOD;
} elseif ($vars['action'] == 'update') {
links_init();
$foot_explain = array();
// Exhaust footnotes
$msg =& $_links_messages['title_update'];
$body =& $_links_messages['msg_done'];
} else {
$msg =& $_links_messages['title_update'];
$body =& $_links_messages['err_invalid'];
}
return array('msg' => $msg, 'body' => $body);
}
示例10: plugin_search2_action
function plugin_search2_action()
{
global $post, $vars;
$qm = get_qm();
$s_word = isset($vars['word']) ? h($vars['word']) : '';
if (strlen($s_word) > PLUGIN_SEARCH2_MAX_LENGTH) {
unset($vars['word']);
die_message($qm->m['plg_search']['err_toolong']);
}
$type = isset($vars['type']) ? $vars['type'] : '';
$base = isset($vars['base']) ? $vars['base'] : '';
if ($s_word != '') {
// Search
$msg = str_replace('$1', $s_word, $qm->m['plg_search']['title_result']);
$body = plugin_search2_do_search($vars['word'], $type, FALSE, $base);
} else {
// Init
unset($vars['word']);
$msg = $qm->m['plg_search']['title_search'];
$body = '<br />' . "\n" . $qm->m['plg_search']['note'] . "\n";
}
// Show search form
$bases = $base == '' ? array() : array($base);
$body .= plugin_search2_form($s_word, $type, $bases);
return array('msg' => $msg, 'body' => $body);
}
示例11: plugin_commentx_action
function plugin_commentx_action()
{
global $vars, $post;
// Petit SPAM Check (Client(Browser)-Server Ticket Check)
$spam = FALSE;
if (isset($post['encode_hint']) && $post['encode_hint'] != '') {
if (PKWK_ENCODING_HINT != $post['encode_hint']) {
$spam = TRUE;
}
} else {
if (PKWK_ENCODING_HINT != '') {
$spam = TRUE;
}
}
if (method_exists('auth', 'check_role')) {
// Plus!
if (auth::check_role('readonly')) {
die_message('PKWK_READONLY prohibits editing');
}
if (!is_page($vars['refer']) && auth::is_check_role(PKWK_CREATE_PAGE)) {
die_message(_('PKWK_CREATE_PAGE prohibits editing'));
}
} else {
if (PKWK_READONLY) {
die_message('PKWK_READONLY prohibits editing');
}
}
// If SPAM, goto jail.
if ($spam) {
return plugin_commentx_honeypot();
}
return plugin_commentx_write();
}
示例12: plugin_search_action
function plugin_search_action()
{
global $post, $vars;
$_title_search = _('Search for word(s)');
$_title_result = _('Search result of $1');
$_msg_searching = _('Key words are case-insenstive, and are searched for in all pages.');
if (PLUGIN_SEARCH_DISABLE_GET_ACCESS) {
$s_word = isset($post['word']) ? htmlspecialchars($post['word']) : '';
} else {
$s_word = isset($vars['word']) ? htmlspecialchars($vars['word']) : '';
}
if (strlen($s_word) > PLUGIN_SEARCH_MAX_LENGTH) {
unset($vars['word']);
// Stop using $_msg_word at lib/html.php
die_message('Search words too long');
}
$type = isset($vars['type']) ? $vars['type'] : '';
$base = isset($vars['base']) ? $vars['base'] : '';
if ($s_word != '') {
// Search
$msg = str_replace('$1', $s_word, $_title_result);
$body = do_search($vars['word'], $type, FALSE, $base);
} else {
// Init
unset($vars['word']);
// Stop using $_msg_word at lib/html.php
$msg = $_title_search;
$body = '<br />' . "\n" . $_msg_searching . "\n";
}
// Show search form
$bases = $base == '' ? array() : array($base);
$body .= plugin_search_search_form($s_word, $type, $bases);
return array('msg' => $msg, 'body' => $body);
}
示例13: plugin_memo_action
function plugin_memo_action()
{
global $vars, $cols, $rows, $_string;
// global $_title_collided, $_msg_collided, $_title_updated;
$_title_collided = $_string['title_collided'];
$_title_updated = $_string['updated'];
$_msg_collided = $_string['msg_collided'];
// if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');
if (Auth::check_role('readonly')) {
die_message('PKWK_READONLY prohibits editing');
}
if (!isset($vars['msg']) || $vars['msg'] == '') {
return;
}
$memo_body = preg_replace('/' . "\r" . '/', '', $vars['msg']);
$memo_body = str_replace("\n", '\\n', $memo_body);
$memo_body = str_replace('"', '"', $memo_body);
// Escape double quotes
$memo_body = str_replace(',', ',', $memo_body);
// Escape commas
$wiki = Factory::Wiki($vars['refer']);
$postdata = array();
$memo_no = 0;
foreach ($wiki->get() as $line) {
if (preg_match('/^#memo\\(?.*\\)?$/i', $line)) {
if ($memo_no == $vars['memo_no']) {
$postdata[] = '#memo(' . $memo_body . ')' . "\n";
$line = '';
}
++$memo_no;
}
$postdata[] = $line;
}
$postdata_input = $memo_body . "\n";
$body = '';
if ($wiki->digest() !== $vars['digest']) {
$title = $_title_collided;
$body = $_msg_collided . "\n";
$s_refer = Utility::htmlsc($vars['refer']);
$s_digest = Utility::htmlsc($vars['digest']);
$s_postdata_input = Utility::htmlsc($postdata_input);
$script = get_script_uri();
$body .= <<<EOD
<form action="{$script}" method="post" class="plugin-memo-form">
\t<input type="hidden" name="cmd" value="preview" />
\t<input type="hidden" name="refer" value="{$s_refer}" />
\t<input type="hidden" name="digest" value="{$s_digest}" />
\t<textarea name="msg" rows="{$rows}" cols="{$cols}" class="form-control">{$s_postdata_input}</textarea>
</form>
EOD;
} else {
$wiki->set($postdata);
$title = $_title_updated;
}
$retvars['msg'] =& $title;
$retvars['body'] =& $body;
$vars['page'] = $vars['refer'];
return $retvars;
}
示例14: plugin_versionlist_action
function plugin_versionlist_action()
{
global $_title_versionlist;
if (PKWK_SAFE_MODE) {
die_message('PKWK_SAFE_MODE prohibits this');
}
return array('msg' => $_title_versionlist, 'body' => plugin_versionlist_convert());
}
示例15: plugin_versionlist_action
function plugin_versionlist_action()
{
// if (PKWK_SAFE_MODE) die_message('PKWK_SAFE_MODE prohibits this');
if (Auth::check_role('safemode')) {
die_message('PKWK_SAFE_MODE prohibits this');
}
return array('msg' => _('version list'), 'body' => plugin_versionlist_convert());
}