本文整理匯總了PHP中is_freeze函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_freeze函數的具體用法?PHP is_freeze怎麽用?PHP is_freeze使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了is_freeze函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: plugin_markdown_convert
/**
* Markdon Syntax
*
* @author sonots
* @license http://www.gnu.org/licenses/gpl.html GPL v2
* @link http://lsx.sourceforge.jp/?Plugin%2Fmarkdown.inc.php
* @version $Id: markdown.inc.php,v 1.2 2007-02-24 16:28:39Z sonots $
* @package plugin
*/
function plugin_markdown_convert()
{
if (defined('PLUGIN_DIR') && file_exists(PLUGIN_DIR . 'markdown.php')) {
$markdown = PLUGIN_DIR . 'markdown.php';
} elseif (defined('EXT_PLUGIN_DIR') && file_exists(EXT_PLUGIN_DIR . 'markdown.php')) {
$markdown = EXT_PLUGIN_DIR . 'markdown.php';
} else {
return "markdown(): markdown.php does not exist under " . PLUGIN_DIR . ' or ' . EXT_PLUGIN_DIR;
}
$args = func_get_args();
$body = array_pop($args);
$noskin = in_array("noskin", $args);
global $vars;
if (!(PKWK_READONLY > 0 or is_freeze($vars['page']) or plugin_markdown_is_edit_auth($vars['page']))) {
$body = htmlspecialchars($body);
}
require_once $markdown;
$body = Markdown($body);
if ($noskin) {
pkwk_common_headers();
print $body;
exit;
}
return $body;
}
示例2: convert
function convert()
{
if (func_num_args() == 0) {
return '<p>$this->plugin(): no argument(s). </p>';
}
global $vars;
$args = func_get_args();
$url = array_shift($args);
if (!is_url($url) && is_interwiki($url)) {
list($interwiki, $page) = explode(':', $url, 2);
$url = get_interwiki_url($interwiki, $page);
}
$page = $vars['page'];
if (!(PKWK_READONLY > 0 or is_freeze($page) or $this->is_edit_auth($page))) {
if (!$this->accept($url)) {
return "<p>{$this->plugin}(): The specified url, {$url}, is not allowed, modify iframe.inc.php<br />" . "Or, restrict editing of current page using freeze or edit_auth or PKWK_READONLY.</p>";
}
}
$url = htmlspecialchars($url);
$options = array();
foreach ($args as $arg) {
list($key, $val) = array_pad(explode('=', $arg, 2), 2, TRUE);
$options[$key] = htmlspecialchars($val);
}
$style = isset($options['style']) ? $options['style'] : NULL;
if (preg_match("/MSIE (3|4|5|6|7)/", getenv("HTTP_USER_AGENT"))) {
$style = isset($options['iestyle']) ? $options['iestyle'] : $style;
return $this->show_iframe($url, $style);
} else {
return $this->show_object($url, $style);
}
}
示例3: is_editable
function is_editable($page)
{
static $is_editable = array();
if (!isset($is_editable[$page])) {
$is_editable[$page] = is_pagename($page) && !is_freeze($page) && !is_cantedit($page);
}
return $is_editable[$page];
}
示例4: plugin_nofollow_convert
function plugin_nofollow_convert()
{
global $vars, $nofollow;
$page = isset($vars['page']) ? $vars['page'] : '';
if (is_freeze($page)) {
$nofollow = 1;
}
return '';
}
示例5: is_editable
function is_editable($page)
{
global $cantedit;
static $is_editable = array();
if (!isset($is_editable[$page])) {
$is_editable[$page] = is_pagename($page) && !is_freeze($page) && !in_array($page, $cantedit);
}
return $is_editable[$page];
}
示例6: plugin_unfreeze_action
function plugin_unfreeze_action()
{
global $script, $vars, $function_freeze;
global $_title_isunfreezed, $_title_unfreezed, $_title_unfreeze;
global $_msg_invalidpass, $_msg_unfreezing, $_btn_unfreeze;
$page = isset($vars['page']) ? $vars['page'] : '';
if (!$function_freeze || !is_page($page)) {
return array('msg' => '', 'body' => '');
}
$pass = isset($vars['pass']) ? $vars['pass'] : NULL;
$msg = $body = '';
if (!is_freeze($page)) {
// Unfreezed already
$msg =& $_title_isunfreezed;
$body = str_replace('$1', htmlspecialchars(strip_bracket($page)), '<p>' . $_title_isunfreezed . '</p>');
} else {
if ($pass !== NULL && pkwk_login($pass)) {
// Unfreeze
$postdata = get_source($page);
array_shift($postdata);
$postdata = join('', $postdata);
file_write(DATA_DIR, $page, $postdata, TRUE);
// Update
is_freeze($page, TRUE);
if (PLUGIN_UNFREEZE_EDIT) {
$vars['cmd'] = 'read';
// To show 'Freeze' link
$msg =& $_title_unfreezed;
$body = edit_form($page, $postdata);
} else {
$vars['cmd'] = 'read';
$msg =& $_title_unfreezed;
$body = '';
}
} else {
// Show unfreeze form
// kazuwaya
$msg =& $_title_unfreeze;
$s_page = htmlspecialchars($page);
$body = $pass === NULL ? '' : "<p><strong>{$_msg_invalidpass}</strong></p>\n";
$body .= <<<EOD
<p>{$_msg_unfreezing}</p>
<form action="{$script}" method="post">
<p>
<input type="hidden" name="cmd" value="unfreeze" />
<input type="hidden" name="page" value="{$s_page}" />
<input type="password" name="pass" size="12" />
<input type="submit" name="ok" value="{$_btn_unfreeze}" />
</p>
</form>
EOD;
}
}
return array('msg' => $msg, 'body' => $body);
}
示例7: plugin_logsw_convert
function plugin_logsw_convert()
{
global $log, $vars;
if ($log['browse']['use']) {
return;
}
if (USE_FREEZE_ONLY && !is_freeze($vars['page'])) {
return;
}
$log['browse']['use'] = 1;
}
示例8: plugin_html_convert
function plugin_html_convert()
{
global $script, $vars;
$qm = get_qm();
$qt = get_qt();
$page = isset($vars['page_alt']) ? $vars['page_alt'] : $vars['page'];
$ids = $qt->getv('plugin_html_id');
if (!$ids) {
$ids = array($page => 0);
}
$id = ++$ids[$page];
$qt->setv('plugin_html_id', $ids);
if (!(PKWK_READONLY > 0 or is_freeze($page) or plugin_html_is_edit_auth($page))) {
return $qm->replace('fmt_msg_not_editable', '#html', $page);
}
$args = func_get_args();
$body = array_pop($args);
$size = '';
$class = 'autofit_iframe';
foreach ($args as $arg) {
if ($arg == 'noskin') {
$noskin = true;
break;
} else {
if ($arg == 'iframe') {
$iframe = true;
} else {
if (preg_match('/^(\\d+)(?:x(\\d+))?$/', $arg, $mts)) {
$x = "width:{$mts[1]}px;";
$y = isset($mts[2]) ? "height:{$mts[2]}px;" : '';
$size = $x . $y;
$class = '';
}
}
}
}
if ($noskin) {
pkwk_common_headers();
print $body;
exit;
} else {
if ($iframe) {
$qt->setv('jquery_include', true);
exist_plugin('iframe');
$qt->appendv_once('plugin_iframe', 'beforescript', PLUGIN_IFRAME_FIT_IFRAME_JS);
$r_page = rawurlencode($page);
$body = '<iframe src="' . $script . '?cmd=html&page=' . $r_page . '&id=' . $id . '" frameborder="0" class="' . $class . '" style="' . $size . '"></iframe>';
}
}
return $body;
}
示例9: plugin_dlbutton_inline
function plugin_dlbutton_inline()
{
global $vars, $script;
$qm = get_qm();
$page = $vars['page'];
if (!(PKWK_READONLY > 0 or is_freeze($page) or plugin_dlbutton_is_edit_auth($page))) {
return $qm->replace('fmt_err_not_editable', 'dlbutton', $page);
}
$args = func_get_args();
$args_num = count($args);
if ($args_num < 1 || 5 < $args_num) {
return $qm->replace('fmt_err_iln', 'dlbutton', $qm->m['plg_dlbutton']['err_usage']);
}
$filename = "";
$label = "";
$email = "";
$title = "";
list($filename, $label, $email, $title) = array_pad($args, 4, '');
//param check
if (!is_url($filename) && !file_exists($filename)) {
return $qm->replace('plg_dlbutton.err_file_notfound', '');
}
if ($label == '') {
$label = $qm->m['plg_dlbutton']['label'];
}
if ($email != '') {
if (!preg_match('/^[a-zA-Z0-9_\\.\\-]+?@[A-Za-z0-9_\\.\\-]+$/', $email)) {
return $qm->replace('plg_dlbutton.err_invalid_email', $email);
}
}
if ($title == '') {
$title = $qm->replace('plg_dlbutton.subject', $filename);
}
$title = urlencode($title);
if (isset($vars['page_alt'])) {
$page = $vars['page_alt'];
}
//url encode
$filename = urlencode($filename);
$page = urlencode($page);
//ボタン作成
$md5 = md5(file_get_contents('qhm.ini.php'));
if ($email == '') {
$dlurl = dirname($script) . '/plugin/dlexec.php?filename=' . $filename . '&key=' . $md5;
} else {
$dlurl = dirname($script) . '/plugin/dlexec.php?filename=' . $filename . '&key=' . $md5 . '&email=' . $email . '&title=' . $title;
}
$dlurl .= '&refer=' . $page;
$btn = '<input type="button" value=' . $label . ' onClick=\'location.href="' . h($dlurl) . '"\' />';
return $btn;
}
示例10: plugin_freeze_action
function plugin_freeze_action()
{
global $script, $vars, $function_freeze;
$_title_isfreezed = _(' $1 has already been frozen');
$_title_freezed = _(' $1 has been frozen.');
$_title_freeze = _('Freeze $1');
$_msg_invalidpass = _('Invalid password.');
$_msg_freezing = _('Please input the password for freezing.');
$_btn_freeze = _('Freeze');
$page = isset($vars['page']) ? $vars['page'] : '';
if (!$function_freeze || is_cantedit($page) || !is_page($page)) {
return array('msg' => '', 'body' => '');
}
$pass = isset($vars['pass']) ? $vars['pass'] : NULL;
$msg = $body = '';
if (is_freeze($page)) {
// Freezed already
$msg =& $_title_isfreezed;
$body = str_replace('$1', htmlspecialchars(strip_bracket($page)), $_title_isfreezed);
} else {
if (!auth::check_role('role_adm_contents') || $pass !== NULL && pkwk_login($pass)) {
// Freeze
$postdata = get_source($page);
array_unshift($postdata, "#freeze\n");
file_write(DATA_DIR, $page, join('', $postdata), TRUE);
// Update
is_freeze($page, TRUE);
$vars['cmd'] = 'read';
$msg =& $_title_freezed;
$body = '';
} else {
// Show a freeze form
$msg =& $_title_freeze;
$s_page = htmlspecialchars($page);
$body = $pass === NULL ? '' : "<p><strong>{$_msg_invalidpass}</strong></p>\n";
$body .= <<<EOD
<p>{$_msg_freezing}</p>
<form action="{$script}" method="post">
<div>
<input type="hidden" name="cmd" value="freeze" />
<input type="hidden" name="page" value="{$s_page}" />
<input type="password" name="pass" size="12" />
<input type="submit" name="ok" value="{$_btn_freeze}" />
</div>
</form>
EOD;
}
}
return array('msg' => $msg, 'body' => $body);
}
示例11: plugin_beforescript_convert
function plugin_beforescript_convert()
{
global $vars;
$qm = get_qm();
$page = $vars['page'];
if (!(PKWK_READONLY > 0 or is_freeze($page) or plugin_beforescript_is_edit_auth($page))) {
return $qm->replace('fmt_err_not_editable', '#html', $page);
}
$args = func_get_args();
$addscript = array_pop($args);
$qt = get_qt();
$qt->appendv('beforescript', $addscript);
return "";
}
示例12: plugin_php_convert
/**
* Evaluate text as a php code
*
* Current page must be edit_authed or frozen or whole system must be PKWK_READONLY.Tag Plugin
*
* Example:
* #php{{
* return 1+1;
* }}
*
* @author sonots
* @license http://www.gnu.org/licenses/gpl.html GPL v2
* @version $Id: php.inc.php,v 1.1 2007-02-24 16:28:39Z sonots $
* @package plugin
*/
function plugin_php_convert()
{
global $vars;
$page = $vars['page'];
if (!(PKWK_READONLY > 0 or is_freeze($page) or plugin_php_is_edit_auth($page))) {
return "<p>php(): Current page, {$page}, must be edit_authed or frozen or whole system must be PKWK_READONLY.</p>";
}
$args = func_get_args();
//ob_start();
$body = eval(array_pop($args));
//$body = ob_get_contents();
//ob_end_clean();
return $body;
}
示例13: plugin_freeze_action
function plugin_freeze_action()
{
global $script, $vars, $function_freeze;
global $_title_isfreezed, $_title_freezed, $_title_freeze;
global $_msg_invalidpass, $_msg_freezing, $_btn_freeze;
$qt = get_qt();
//キャッシュしない
$qt->enable_cache = false;
$page = isset($vars['page']) ? $vars['page'] : '';
if (!$function_freeze || !is_page($page)) {
return array('msg' => '', 'body' => '');
}
$pass = isset($vars['pass']) ? $vars['pass'] : NULL;
$msg = $body = '';
if (is_freeze($page)) {
// Freezed already
$msg =& $_title_isfreezed;
$body = str_replace('$1', htmlspecialchars(strip_bracket($page)), $_title_isfreezed);
} else {
if ($pass !== NULL && pkwk_login($pass)) {
// Freeze
$postdata = get_source($page);
array_unshift($postdata, "#freeze\n");
file_write(DATA_DIR, $page, join('', $postdata), TRUE);
// Update
is_freeze($page, TRUE);
$vars['cmd'] = 'read';
$msg =& $_title_freezed;
$body = '';
} else {
// Show a freeze form
$msg =& $_title_freeze;
$s_page = htmlspecialchars($page);
$body = $pass === NULL ? '' : "<p><strong>{$_msg_invalidpass}</strong></p>\n";
$body .= <<<EOD
<p>{$_msg_freezing}</p>
<form action="{$script}" method="post">
<div>
<input type="hidden" name="cmd" value="freeze" />
<input type="hidden" name="page" value="{$s_page}" />
<input type="password" name="pass" size="12" />
<input type="submit" name="ok" value="{$_btn_freeze}" />
</div>
</form>
EOD;
}
}
return array('msg' => $msg, 'body' => $body);
}
示例14: plugin_monobook_navigation
function plugin_monobook_navigation($wikinote, $tabs, $background)
{
global $vars, $plugin, $_monobook_navigation_messages;
if (!exist_plugin('monobook_getlink')) {
die('monobook_getlink plugin not found');
}
do_plugin_init('monobook_navigation');
$main_tabs = '';
if ($wikinote->is_effect()) {
$main_tabs = str_replace(array('<ul class="wikinote">', '</ul>', "\n"), '', $wikinote->show_tabs(array(array('cmd' => 'main', 'label' => $_monobook_navigation_messages['article']), array('cmd' => 'note', 'label' => $_monobook_navigation_messages['discuss']))));
}
$sub_tabs = '';
$selected_flag = FALSE;
foreach ($tabs as $tab) {
if ($tab === 'edit' && is_freeze($vars['page']) && !in_array('source', $tabs)) {
$tab = 'source';
}
if ($tab === 'edit' && $plugin === 'paraedit') {
$tab = 'paraedit';
}
if ($tab === 'edit' && exist_plugin('revert') && plugin_revert_getlink()) {
$tab = 'revert';
}
list($link, $selected) = plugin_monobook_getlink($tab, $_monobook_navigation_messages, TRUE);
if (!$link) {
continue;
}
if ($selected) {
$sub_tabs .= '<li class="selected">' . $link . '</li>';
$selected_flag = TRUE;
} else {
$sub_tabs .= '<li>' . $link . '</li>';
}
}
if (!$selected_flag) {
$link = plugin_monobook_getlink('nowplugin', $_monobook_navigation_messages);
if (!$main_tabs) {
if ($link) {
$sub_tabs = '<li class="selected" id="separate">' . $link . '</li>' . $sub_tabs;
} else {
$sub_tabs = '<li class="selected"><a href="' . get_script_uri() . strrchr($_SERVER['REQUEST_URI'], '?') . '">' . $_monobook_navigation_messages['undefined'] . '</a></li>';
}
} elseif ($main_tabs && !arg_check('read') && $link) {
$sub_tabs = '<li class="selected">' . $link . '</li>' . $sub_tabs;
}
}
return '<div id="navigator"><ul' . $background . '>' . $main_tabs . $sub_tabs . '</ul></div>' . "\n";
}
示例15: plugin_html2_convert
/**
* Output 1-Line HTML Plugin
* -------------------------------------------
* plugin/html2.inc.php
*
* Copyright (c) 2010 hokuken
* http://hokuken.com/
*
* created :
* modified :
*
* 1行HTMLをそのまま出力します。
*
* Usage :
* #html2(HTML)
*
*/
function plugin_html2_convert()
{
global $vars;
$qm = get_qm();
$page = $vars['page'];
if (!(PKWK_READONLY > 0 or is_freeze($page) or plugin_html2_is_edit_auth($page))) {
return $qm->replace('fmt_msg_not_editable', '#html2', $page);
}
$args = func_get_args();
$ret = array_shift($args);
foreach ($args as $tmpstr) {
$ret .= ',';
$ret .= $tmpstr;
}
return $ret;
}