本文整理汇总了PHP中dexit函数的典型用法代码示例。如果您正苦于以下问题:PHP dexit函数的具体用法?PHP dexit怎么用?PHP dexit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dexit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cpmsg
function cpmsg($message, $url_forward = '', $msgtype = 'message', $extra = '', $cancelurl = '') {
extract($GLOBALS, EXTR_SKIP);
eval("\$message = \"".(isset($msglang[$message]) ? $msglang[$message] : $message)."\";");
if($msgtype == 'form') {
$message = "<form method=\"post\" action=\"$url_forward\"><input type=\"hidden\" name=\"formhash\" value=\"".FORMHASH."\">".
"<br /><br /><br />$message$extra<br /><br /><br /><br />\n".
"<input class=\"button\" type=\"submit\" name=\"confirmed\" value=\"$lang[ok]\"> \n".
"<input class=\"button\" type=\"button\" value=\"$lang[cancel]\" onClick=\"".
($cancelurl == '' ? 'history.go(-1)' : 'location.href=\''.$cancelurl.'\'').
";\"></form><br />";
} else {
if($url_forward) {
$message .= "<br /><br /><br /><a href=\"$url_forward\">$lang[message_redirect]</a>";
$url_forward = transsid($url_forward);
$message .= "<script>setTimeout(\"redirect('$url_forward');\", 2000);</script>";
} elseif(strpos($message, $lang['return'])) {
$message .= "<br /><br /><br /><a href=\"javascript:history.go(-1);\" class=\"mediumtxt\">$lang[message_return]</a>";
}
$message = "<br /><br /><br />$message$extra<br /><br />";
}
?>
<br /><br /><br /><br /><br /><br />
<table width="500" border="0" cellpadding="0" cellspacing="0" align="center" class="tableborder">
<tr class="header"><td><?=$lang['discuz_message']?></td></tr><tr><td class="altbg2"><div align="center">
<?=$message?></div><br /><br />
</td></tr></table>
<br /><br /><br />
<?
cpfooter();
dexit();
}
示例2: dsu_paulissue_msg
function dsu_paulissue_msg($msg, $treferer = '')
{
global $_G;
$vars = explode(':', $msg);
$msg = lang('plugin/' . $vars[0], $vars[1]);
include template('dsu_paulissue:float');
dexit();
}
示例3: sign_msg
function sign_msg($msg, $treferer = '')
{
global $_G;
if (defined('IN_MOBILE')) {
include template('dsu_paulsign:float');
dexit();
} else {
include template('dsu_paulsign:float');
dexit();
}
}
示例4: parse_template
function parse_template($file, $templateid, $tpldir)
{
global $language;
$nest = 5;
$tplfile = DISCUZ_ROOT . "./{$tpldir}/{$file}.htm";
$objfile = DISCUZ_ROOT . "./forumdata/templates/{$templateid}_{$file}.tpl.php";
if (!@($fp = fopen($tplfile, 'r'))) {
dexit("Current template file './{$tpldir}/{$file}.htm' not found or have no access!");
} elseif ($language['discuz_lang'] != 'templates' && !(include language('templates', $templateid, $tpldir))) {
dexit("<br />Current template pack do not have a necessary language file 'templates.lang.php' or have syntax error!");
}
$template = @fread($fp, filesize($tplfile));
fclose($fp);
$var_regexp = "((\\\$[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*)(\\[[a-zA-Z0-9_\\-\\.\"\\'\\[\\]\$-ÿ]+\\])*)";
$const_regexp = "([a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*)";
//$template = preg_replace("/([\n\r]+)\t+/s", "\\1", $template);
$template = preg_replace("/\\<\\!\\-\\-\\{(.+?)\\}\\-\\-\\>/s", "{\\1}", $template);
$template = preg_replace("/\\{lang\\s+(.+?)\\}/ies", "languagevar('\\1')", $template);
$template = preg_replace("/\\{faq\\s+(.+?)\\}/ies", "faqvar('\\1')", $template);
$template = str_replace("{LF}", "<?=\"\\n\"?>", $template);
$template = preg_replace("/\\{(\\\$[a-zA-Z0-9_\\[\\]\\'\"\$\\.-ÿ]+)\\}/s", "<?=\\1?>", $template);
$template = preg_replace("/{$var_regexp}/es", "addquote('<?=\\1?>')", $template);
$template = preg_replace("/\\<\\?\\=\\<\\?\\={$var_regexp}\\?\\>\\?\\>/es", "addquote('<?=\\1?>')", $template);
$template = "<? if(!defined('IN_DISCUZ')) exit('Access Denied'); ?>\n{$template}";
$template = preg_replace("/[\n\r\t]*\\{template\\s+([a-z0-9_]+)\\}[\n\r\t]*/is", "\n<? include template('\\1'); ?>\n", $template);
$template = preg_replace("/[\n\r\t]*\\{template\\s+(.+?)\\}[\n\r\t]*/is", "\n<? include template(\\1); ?>\n", $template);
$template = preg_replace("/[\n\r\t]*\\{eval\\s+(.+?)\\}[\n\r\t]*/ies", "stripvtags('<? \\1 ?>','')", $template);
$template = preg_replace("/[\n\r\t]*\\{echo\\s+(.+?)\\}[\n\r\t]*/ies", "stripvtags('<? echo \\1; ?>','')", $template);
$template = preg_replace("/([\n\r\t]*)\\{elseif\\s+(.+?)\\}([\n\r\t]*)/ies", "stripvtags('\\1<? } elseif(\\2) { ?>\\3','')", $template);
$template = preg_replace("/([\n\r\t]*)\\{else\\}([\n\r\t]*)/is", "\\1<? } else { ?>\\2", $template);
for ($i = 0; $i < $nest; $i++) {
$template = preg_replace("/[\n\r\t]*\\{loop\\s+(\\S+)\\s+(\\S+)\\}[\n\r]*(.+?)[\n\r]*\\{\\/loop\\}[\n\r\t]*/ies", "stripvtags('<? if(is_array(\\1)) { foreach(\\1 as \\2) { ?>','\\3<? } } ?>')", $template);
$template = preg_replace("/[\n\r\t]*\\{loop\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\}[\n\r\t]*(.+?)[\n\r\t]*\\{\\/loop\\}[\n\r\t]*/ies", "stripvtags('<? if(is_array(\\1)) { foreach(\\1 as \\2 => \\3) { ?>','\\4<? } } ?>')", $template);
$template = preg_replace("/([\n\r\t]*)\\{if\\s+(.+?)\\}([\n\r]*)(.+?)([\n\r]*)\\{\\/if\\}([\n\r\t]*)/ies", "stripvtags('\\1<? if(\\2) { ?>\\3','\\4\\5<? } ?>\\6')", $template);
}
$template = preg_replace("/\\{{$const_regexp}\\}/s", "<?=\\1?>", $template);
$template = preg_replace("/ \\?\\>[\n\r]*\\<\\? /s", " ", $template);
if (!@($fp = fopen($objfile, 'w'))) {
dexit("Directory './forumdata/templates/' not found or have no access!");
}
$template = preg_replace("/\"(http)?[\\w\\.\\/:]+\\?[^\"]+?&[^\"]+?\"/e", "transamp('\\0')", $template);
$template = preg_replace("/\\<script[^\\>]*?src=\"(.+?)\".*?\\>\\s*\\<\\/script\\>/ise", "stripscriptamp('\\1')", $template);
$template = preg_replace("/[\n\r\t]*\\{block\\s+([a-zA-Z0-9_]+)\\}(.+?)\\{\\/block\\}/ies", "stripblock('\\1', '\\2')", $template);
flock($fp, 2);
fwrite($fp, $template);
fclose($fp);
}
示例5: step3Action
public function step3Action()
{
function dexit($msg)
{
echo '<script>alert("' . $msg . '");window.history.back();</script>';
exit;
}
extract($this->post('data'));
if (!preg_match('/^[a-z0-9]+$/i', $admin_pass) || strlen($admin_pass) < 5) {
dexit('请填写正确的后台帐号' . $admin_pass);
}
if (strlen($admin_pass) < 5) {
dexit('后台密码最少5位');
}
@($link = mysql_connect($host, $username, $password)) or dexit('无法连接到数据库,请检查数据库配置信息');
$dbname or dexit('连接正常\\n\\n不过您没有填写数据库名');
if (!mysql_select_db($dbname)) {
if (!mysql_query("CREATE DATABASE " . $dbname)) {
dexit('无权限创建数据库\\n\\n请通过其他方式建立数据库');
}
}
mysql_query('SET NAMES utf8');
mysql_query("SET sql_mode=''");
$arr = explode(':', $host);
$host = $arr['0'];
$port = isset($arr['1']) ? $arr['1'] : '3306';
$dbconfig = array('host' => $host, 'username' => $username, 'password' => $password, 'dbname' => $dbname, 'prefix' => $prefix, 'port' => $port, 'charset' => 'utf8');
$dbconfig_arr = var_export($dbconfig, true);
$dbconfig_txt = "<?php" . PHP_EOL . "if (!defined('IN_XIAOCMS')) exit();" . PHP_EOL . "return " . $dbconfig_arr . ";";
if (!file_put_contents(DATA_DIR . 'config' . DIRECTORY_SEPARATOR . 'database.ini.php', $dbconfig_txt)) {
dexit('数据库配置文件保存失败,请检查文件权限!');
}
$sql = file_get_contents(DATA_DIR . 'install/xiaocms.sql');
$sql = str_replace(array('xiao_', 'admin_name', 'admin_pass'), array($prefix, $admin_name, md5(md5($admin_pass))), $sql);
$this->install_sql_execute($sql);
if ($import) {
$sql = file_get_contents(DATA_DIR . 'install/xiaocms_data.sql');
$sql = str_replace('xiao_', $prefix, $sql);
$this->install_sql_execute($sql);
}
$adminurl = $this->get_http_host() . $this->get_base_url();
include $this->install_tpl('3');
}
示例6: loginmsg
function loginmsg($message, $url_forward = '', $msgtype = 'message')
{
extract($GLOBALS, EXTR_SKIP);
$action = dhtmlspecialchars($action);
$message = isset($msglang[$message]) ? $msglang[$message] : $message;
if ($msgtype == 'message') {
$message = '<tr><td> </td><td align="center" colspan="3" >' . $message;
if ($url_forward) {
$message .= "<br /><br /><a href=\"{$url_forward}\">{$lang['message_redirect']}</a>";
$url_forward = transsid($url_forward);
$message .= "<script>setTimeout(\"redirect('{$url_forward}');\", 1250);</script><br /><br /><br /></td><td> </td></tr>";
} else {
$message .= '<br /><br /><br />';
}
} else {
$extra = isset($action) && empty($frames) && $action != 'logout' ? '?frames=yes&' . $_SERVER['QUERY_STRING'] : (in_array($action, array('header', 'menu', 'logout')) ? '' : '?' . $_SERVER['QUERY_STRING']);
$message = '<form method="post" name="login" action="admincp.php' . $extra . '">' . '<input type="hidden" name="sid" value="' . $sid . '">' . '<input type="hidden" name="frames" value="yes>' . '<input type="hidden" name="url_forward" value="' . $url_forward . '">' . '<tr><td> </td><td align="right">' . $lang['username'] . ':</td>' . '<td>' . $discuz_user . '</td><td><a href="' . $link_logout . '&referer=' . $indexname . '" target="_blank">' . $lang['menu_logout'] . '</a></td>' . '<td> </td></tr>' . '<tr><td> </td><td align="right">' . $lang['password'] . ':</td><td><input type="password" name="admin_password" size="25"></td>' . '<td> </td><td> </td></tr>' . '<tr><td> </td><td class="line1"> </td>' . '<td class="line1" align="center"><input type="submit" class="button" value="' . $lang['submit'] . '" /></form><script language="JavaScript">document.login.admin_password.focus();</script></td>' . '<td class="line1"> </td><td> </td></tr>';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Discuz! Administrator's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php
echo $charset;
?>
">
<link href="./images/admincp/login.css" rel="stylesheet" type="text/css" />
</head>
<script language="JavaScript">
if(self.parent.frames.length != 0) {
self.parent.location=document.location;
}
function redirect(url) {
window.location.replace(url);
}
</script>
<br /><br /><br /><br />
<table width="600" border="0" cellpadding="8" cellspacing="0" class="logintable">
<tr class="loginheader"><td width="80"></td><td width="100"></td><td></td><td width="120"></td><td width="80"></td></tr>
<tr style="height:40px"><td> </td>
<td class="line1"><span style="color:#ffff66;font-size:14px;font-weight: bold;"><?php
echo $lang['admin_page'];
?>
</span></td>
<td class="line1"> </td>
<td class="line1"> </td>
<td> </td></tr>
<tr><td> </td><td class="line2"> </td><td class="line2"> </td><td class="line2"> </td><td> </td></tr>
<?php
echo $message;
?>
<tr><td> </td><td class="line2"> </td><td class="line2"> </td><td class="line2"> </td><td> </td></tr>
<tr><td colspan="5" align="center">Powered by <a href="http://www.discuz.net" target="_blank" style="color: #fff"><b>Discuz!</b></a>
© 2001-2007 <a href="http://www.comsenz.com" target="_blank" style="color: #fff">Comsenz Inc.</a></td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr></table>
</html>
<?php
dexit();
}
示例7: showmessage
function showmessage($message, $url_forward = '', $values = array(), $extraparam = array(), $custom = 0)
{
global $_G;
$param = array('header' => false, 'timeout' => null, 'refreshtime' => null, 'closetime' => null, 'locationtime' => null, 'alert' => null, 'return' => false, 'redirectmsg' => 0, 'msgtype' => 1, 'showmsg' => true, 'showdialog' => false, 'login' => false, 'handle' => false);
if ($custom) {
$alerttype = 'alert_info';
$show_message = $message;
include template('common/showmessage');
dexit();
}
define('CACHE_FORBIDDEN', TRUE);
$_G['setting']['msgforward'] = @unserialize($_G['setting']['msgforward']);
$handlekey = '';
if (empty($_G['inajax']) && (!empty($_G['gp_quickforward']) || $_G['setting']['msgforward']['quick'] && $_G['setting']['msgforward']['messages'] && @in_array($message, $_G['setting']['msgforward']['messages']))) {
$param['header'] = true;
}
if (!empty($_G['inajax'])) {
$handlekey = $_G['gp_handlekey'] = !empty($_G['gp_handlekey']) ? htmlspecialchars($_G['gp_handlekey']) : '';
$param['handle'] = true;
}
if (!empty($_G['inajax'])) {
$param['msgtype'] = empty($_G['gp_ajaxmenu']) && (empty($_POST) || !empty($_G['gp_nopost'])) ? 2 : 3;
}
if ($url_forward) {
$param['timeout'] = true;
if ($param['handle'] && !empty($_G['inajax'])) {
$param['showmsg'] = false;
}
}
foreach ($extraparam as $k => $v) {
$param[$k] = $v;
}
if (array_key_exists('set', $extraparam)) {
$setdata = array('1' => array('msgtype' => 3));
if ($setdata[$extraparam['set']]) {
foreach ($setdata[$extraparam['set']] as $k => $v) {
$param[$k] = $v;
}
}
}
if ($param['timeout'] !== null) {
$refreshtime = intval($param['refreshtime'] === null ? $_G['setting']['msgforward']['refreshtime'] : $param['refreshtime']);
$refreshsecond = !empty($refreshtime) ? $refreshtime : 3;
$refreshtime = $refreshsecond * 1000;
} else {
$refreshtime = $refreshsecond = 0;
}
if ($param['login'] && $_G['uid'] || $url_forward) {
$param['login'] = false;
}
$param['header'] = $url_forward && $param['header'] ? true : false;
if ($param['header']) {
header("HTTP/1.1 301 Moved Permanently");
dheader("location: " . str_replace('&', '&', $url_forward));
}
$_G['hookscriptmessage'] = $message;
$_G['hookscriptvalues'] = $values;
$vars = explode(':', $message);
if (count($vars) == 2) {
$show_message = lang('plugin/' . $vars[0], $vars[1], $values);
} else {
$show_message = lang('message', $message, $values);
}
$show_jsmessage = str_replace("'", "\\\\'", $show_message);
if (!$param['showmsg']) {
$show_message = '';
}
if ($param['msgtype'] == 3) {
$show_message = str_replace(lang('message', 'return_search'), lang('message', 'return_replace'), $show_message);
}
$allowreturn = !$param['timeout'] && stristr($show_message, lang('message', 'return')) || $param['return'] ? true : false;
if ($param['alert'] === null) {
$alerttype = $url_forward ? preg_match('/\\_(succeed|success)$/', $message) ? 'alert_right' : 'alert_info' : ($allowreturn ? 'alert_error' : 'alert_info');
} else {
$alerttype = 'alert_' . $param['alert'];
}
$extra = '';
if ($param['handle']) {
$valuesjs = $comma = $subjs = '';
foreach ($values as $k => $v) {
if (is_array($v)) {
$subcomma = '';
foreach ($v as $subk => $subv) {
$subjs .= $subcomma . '\'' . $subk . '\':\'' . $subv . '\'';
$subcomma = ',';
}
$valuesjs .= $comma . '\'' . $k . '\':{' . $subjs . '}';
} else {
$valuesjs .= $comma . '\'' . $k . '\':\'' . $v . '\'';
}
$comma = ',';
}
$valuesjs = '{' . $valuesjs . '}';
if ($url_forward) {
$extra .= 'if($(\'return_' . $handlekey . '\')) $(\'return_' . $handlekey . '\').className=\'onright\';if(typeof succeedhandle_' . $handlekey . '==\'function\') {succeedhandle_' . $handlekey . '(\'' . $url_forward . '\', \'' . $show_jsmessage . '\', ' . $valuesjs . ');}';
} else {
$extra .= 'if(typeof errorhandle_' . $handlekey . '==\'function\') {errorhandle_' . $handlekey . '(\'' . $show_jsmessage . '\', ' . $valuesjs . ');}';
}
}
if ($handlekey) {
//.........这里部分代码省略.........
示例8: insenz_cpmsg
function insenz_cpmsg($message, $extra = '')
{
extract($GLOBALS, EXTR_SKIP);
eval("\$message = \"" . (isset($msglang[$message]) ? $msglang[$message] : $message) . "\";");
$url_forward = 'admincp.php?action=insenz' . $extra;
$message .= "<br /><br /><br /><a href=\"{$url_forward}\">{$lang['message_redirect']}</a>";
$url_forward = transsid($url_forward);
echo '<script type="text/javascript">parent.setTimeout("redirect(\'' . $url_forward . '\');", 2000);parent.$("insenz_body").innerHTML = \'<br /><br /><br /><br /><br /><br /><table width="500" border="0" cellpadding="0" cellspacing="0" align="center" class="tableborder"><tr class="header"><td>' . $lang['discuz_message'] . '</td></tr><tr><td class="altbg2"><br /><br /><div align="center">' . $message . '</div><br /><br /></td></tr></table><br /><br /><br />\';</script>';
dexit();
}
示例9: indexAction
public function indexAction()
{
$step = $this->post('step') ? $this->post('step') : 1;
switch ($step) {
case '1':
//说明
$this->view->assign('percent', '0%');
$this->view->display('../install/' . $step);
break;
case '2':
//环境
$pass = true;
$PHP_VERSION = PHP_VERSION;
if (version_compare($PHP_VERSION, '5.2.0', '<')) {
$php_pass = $pass = false;
} else {
$php_pass = true;
}
$mysqli = $PHP_MYSQL = '';
if (extension_loaded('mysql')) {
$PHP_MYSQL = '支持';
$mysql_pass = true;
} elseif (function_exists('mysqli_init')) {
$PHP_MYSQL = 'mysqli';
$mysqli = mysqli_init();
$mysql_pass = true;
} else {
$PHP_MYSQL = '不支持';
$mysql_pass = $pass = false;
}
$PHP_GD = '';
if (function_exists('imagejpeg')) {
$PHP_GD .= 'jpg';
}
if (function_exists('imagegif')) {
$PHP_GD .= ' gif';
}
if (function_exists('imagepng')) {
$PHP_GD .= ' png';
}
$gd_pass = $PHP_GD ? true : false;
$is_json = false;
$json = '["ok","t2","t3"]';
if (function_exists('json_decode')) {
$json_data = json_decode($json);
if ($json_data) {
$is_json = true;
} else {
$pass = false;
}
} else {
$json_data = null;
$pass = false;
}
$this->view->assign(array('php_pass' => $php_pass, 'PHP_MYSQL' => $PHP_MYSQL, 'mysql_pass' => $mysql_pass, 'PHP_GD' => $PHP_GD, 'gd_pass' => $gd_pass, 'pass' => $pass, 'percent' => '20%', 'urlopen' => fn_check_url(), 'is_json' => $is_json, 'json_data' => $json_data));
$this->view->display('../install/' . $step);
break;
case '3':
//属性
$ISWIN = strpos(strtoupper(PHP_OS), 'WIN') === false ? false : true;
$files = array('cache/', 'config/', 'models/', 'uploadfiles/');
$FILES = array();
$pass = true;
foreach ($files as $k => $v) {
$FILES[$k]['name'] = $v;
if (is_writable(APP_ROOT . $v)) {
$FILES[$k]['write'] = true;
} else {
$FILES[$k]['write'] = $pass = false;
}
}
$this->view->assign(array('ISWIN' => $ISWIN, 'files' => $files, 'FILES' => $FILES, 'pass' => $pass, 'percent' => '40%'));
$this->view->display('../install/' . $step);
break;
case '4':
//数据库
$this->view->assign('percent', '60%');
$this->view->display('../install/' . $step);
break;
case '5':
//安装进度
$tdb_host = $this->post('db_host');
$tdb_user = $this->post('db_user');
$tdb_pass = $this->post('db_pass');
$tdb_name = $this->post('db_name');
$ttb_pre = $this->post('tb_pre');
$import = $this->post('import');
$username = $this->post('username');
$password = $this->post('password');
$email = $this->post('email');
function dexit($msg)
{
echo '<script>alert("' . $msg . '");window.history.back();</script>';
exit;
}
if (!preg_match('/^[a-z0-9]+$/i', $username) || strlen($username) < 4) {
dexit('请填写正确的超级管理员户名');
}
if (strlen($password) < 4) {
dexit('超级管理员密码最少4位');
//.........这里部分代码省略.........
示例10: parse_template
function parse_template($tplfile, $templateid, $tpldir)
{
global $language, $subtemplates, $timestamp;
$nest = 6;
$basefile = $file = basename($tplfile, '.htm');
$file == 'header' && CURSCRIPT && ($file = 'header_' . CURSCRIPT);
$objfile = ROOT_PATH . './data/' . COMPILEDIR . '/' . STYLEID . '_' . $templateid . '_' . $file . '.tpl.php';
if (!@($fp = fopen($tplfile, 'r'))) {
dexit("Current template file './{$tpldir}/{$file}.htm' not found or have no access!");
}
$template = @fread($fp, filesize($tplfile));
fclose($fp);
$var_regexp = "((\\\$[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*)(\\[[a-zA-Z0-9_\\-\\.\"\\'\\[\\]\$-ÿ]+\\])*)";
$const_regexp = "([a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*)";
$headerexists = preg_match("/{(sub)?template\\s+header\\}/", $template) || $basefile == 'header_ajax';
$subtemplates = array();
for ($i = 1; $i <= 3; $i++) {
if (strexists($template, '{subtemplate')) {
$template = preg_replace("/[\n\r\t]*\\{subtemplate\\s+([a-z0-9_:]+)\\}[\n\r\t]*/ies", "stripvtemplate('\\1', 1)", $template);
}
}
$template = preg_replace("/[\n\r\t]*\\{csstemplate\\}[\n\r\t]*/ies", "loadcsstemplate('\\1')", $template);
$template = preg_replace("/([\n\r]+)\t+/s", "\\1", $template);
$template = preg_replace("/\\<\\!\\-\\-\\{(.+?)\\}\\-\\-\\>/s", "{\\1}", $template);
$template = preg_replace("/\\{lang\\s+(.+?)\\}/ies", "languagevar('\\1')", $template);
$template = preg_replace("/\\{faq\\s+(.+?)\\}/ies", "faqvar('\\1')", $template);
$template = str_replace("{LF}", "<?=\"\\n\"?>", $template);
$template = preg_replace("/\\{(\\\$[a-zA-Z0-9_\\[\\]\\'\"\$\\.-ÿ]+)\\}/s", "<?=\\1?>", $template);
$template = preg_replace("/{$var_regexp}/es", "addquote('<?=\\1?>')", $template);
$template = preg_replace("/\\<\\?\\=\\<\\?\\={$var_regexp}\\?\\>\\?\\>/es", "addquote('<?=\\1?>')", $template);
$headeradd = '';
if (!empty($subtemplates)) {
$headeradd .= "\n0\n";
foreach ($subtemplates as $fname) {
$headeradd .= "|| checktplrefresh('{$tplfile}', '{$fname}', {$timestamp}, '{$templateid}', '{$tpldir}')\n";
}
$headeradd .= ';';
}
$template = "<? if(!defined('IN_PHPUP')) exit('Access Denied'); {$headeradd}?>\n{$template}";
$template = preg_replace("/[\n\r\t]*\\{template\\s+([a-z0-9_:]+)\\}[\n\r\t]*/ies", "stripvtemplate('\\1', 0)", $template);
$template = preg_replace("/[\n\r\t]*\\{template\\s+(.+?)\\}[\n\r\t]*/ies", "stripvtemplate('\\1', 0)", $template);
$template = preg_replace("/[\n\r\t]*\\{eval\\s+(.+?)\\}[\n\r\t]*/ies", "stripvtags('<? \\1 ?>','')", $template);
$template = preg_replace("/[\n\r\t]*\\{echo\\s+(.+?)\\}[\n\r\t]*/ies", "stripvtags('<? echo \\1; ?>','')", $template);
$template = preg_replace("/([\n\r\t]*)\\{elseif\\s+(.+?)\\}([\n\r\t]*)/ies", "stripvtags('\\1<? } elseif(\\2) { ?>\\3','')", $template);
$template = preg_replace("/([\n\r\t]*)\\{else\\}([\n\r\t]*)/is", "\\1<? } else { ?>\\2", $template);
for ($i = 0; $i < $nest; $i++) {
$template = preg_replace("/[\n\r\t]*\\{loop\\s+(\\S+)\\s+(\\S+)\\}[\n\r]*(.+?)[\n\r]*\\{\\/loop\\}[\n\r\t]*/ies", "stripvtags('<? if(is_array(\\1)) { foreach(\\1 as \\2) { ?>','\\3<? } } ?>')", $template);
$template = preg_replace("/[\n\r\t]*\\{loop\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\}[\n\r\t]*(.+?)[\n\r\t]*\\{\\/loop\\}[\n\r\t]*/ies", "stripvtags('<? if(is_array(\\1)) { foreach(\\1 as \\2 => \\3) { ?>','\\4<? } } ?>')", $template);
$template = preg_replace("/([\n\r\t]*)\\{if\\s+(.+?)\\}([\n\r]*)(.+?)([\n\r]*)\\{\\/if\\}([\n\r\t]*)/ies", "stripvtags('\\1<? if(\\2) { ?>\\3','\\4\\5<? } ?>\\6')", $template);
}
$template = preg_replace("/\\{{$const_regexp}\\}/s", "<?=\\1?>", $template);
$template = preg_replace("/ \\?\\>[\n\r]*\\<\\? /s", " ", $template);
if (!@($fp = fopen($objfile, 'w'))) {
dexit("Directory './data/compile/' not found or have no access!");
}
$template = preg_replace("/\"(http)?[\\w\\.\\/:]+\\?[^\"]+?&[^\"]+?\"/e", "transamp('\\0')", $template);
$template = preg_replace("/\\<script[^\\>]*?src=\"(.+?)\"(.*?)\\>\\s*\\<\\/script\\>/ise", "stripscriptamp('\\1', '\\2')", $template);
$template = preg_replace("/[\n\r\t]*\\{block\\s+([a-zA-Z0-9_]+)\\}(.+?)\\{\\/block\\}/ies", "stripblock('\\1', '\\2')", $template);
$template = str_replace('<div id="phpup_version"></div>', '<div id="phpup_version"><A HREF="http://www.kaka101.com/">Www.KaKa101.Com</A> Powered by ' . VERSION . '© 2010-2011 One plus One E-commerce Co.,Ltd.</div>', $template);
flock($fp, 2);
fwrite($fp, $template);
fclose($fp);
}
示例11: dshowmessage
function dshowmessage($message, $url_forward = '', $values = array(), $extraparam = array(), $custom = 0)
{
global $_G, $show_message;
$_G['messageparam'] = func_get_args();
if (empty($_G['inhookscript']) && defined('CURMODULE')) {
hookscript(CURMODULE, $_G['basescript'], 'messagefuncs', array('param' => $_G['messageparam']));
}
if ($extraparam['break']) {
return;
}
$_G['inshowmessage'] = true;
$param = array('header' => false, 'timeout' => null, 'refreshtime' => null, 'closetime' => null, 'locationtime' => null, 'alert' => null, 'return' => false, 'redirectmsg' => 0, 'msgtype' => 1, 'showmsg' => true, 'showdialog' => false, 'login' => false, 'handle' => false, 'extrajs' => '', 'striptags' => true);
$navtitle = lang('core', 'title_board_message');
if ($custom) {
$alerttype = 'alert_info';
$show_message = $message;
include template('common/showmessage');
dexit();
}
define('CACHE_FORBIDDEN', TRUE);
$_G['setting']['msgforward'] = @dunserialize($_G['setting']['msgforward']);
$handlekey = $leftmsg = '';
if (defined('IN_MOBILE')) {
unset($extraparam['showdialog']);
unset($extraparam['closetime']);
unset($extraparam['extrajs']);
if (!$url_forward && dreferer() && IN_MOBILE == 1) {
$url_forward = $referer = dreferer();
}
if (!empty($url_forward) && strpos($url_forward, 'mobile') === false) {
$url_forward_arr = explode("#", $url_forward);
if (strpos($url_forward_arr[0], '?') !== false) {
$url_forward_arr[0] = $url_forward_arr[0] . '&mobile=' . IN_MOBILE;
} else {
$url_forward_arr[0] = $url_forward_arr[0] . '?mobile=' . IN_MOBILE;
}
$url_forward = implode("#", $url_forward_arr);
}
}
if (empty($_G['inajax']) && (!empty($_GET['quickforward']) || $_G['setting']['msgforward']['quick'] && empty($extraparam['clean_msgforward']) && $_G['setting']['msgforward']['messages'] && @in_array($message, $_G['setting']['msgforward']['messages']))) {
$param['header'] = true;
}
$_GET['handlekey'] = !empty($_GET['handlekey']) && preg_match('/^\\w+$/', $_GET['handlekey']) ? $_GET['handlekey'] : '';
if (!empty($_G['inajax'])) {
$handlekey = $_GET['handlekey'] = !empty($_GET['handlekey']) ? dhtmlspecialchars($_GET['handlekey']) : '';
$param['handle'] = true;
}
if (!empty($_G['inajax'])) {
$param['msgtype'] = empty($_GET['ajaxmenu']) && (empty($_POST) || !empty($_GET['nopost'])) ? 2 : 3;
}
if ($url_forward) {
$param['timeout'] = true;
if ($param['handle'] && !empty($_G['inajax'])) {
$param['showmsg'] = false;
}
}
foreach ($extraparam as $k => $v) {
$param[$k] = $v;
}
if (array_key_exists('set', $extraparam)) {
$setdata = array('1' => array('msgtype' => 3));
if ($setdata[$extraparam['set']]) {
foreach ($setdata[$extraparam['set']] as $k => $v) {
$param[$k] = $v;
}
}
}
$timedefault = intval($param['refreshtime'] === null ? $_G['setting']['msgforward']['refreshtime'] : $param['refreshtime']);
if ($param['timeout'] !== null) {
$refreshsecond = !empty($timedefault) ? $timedefault : 3;
$refreshtime = $refreshsecond * 1000;
} else {
$refreshtime = $refreshsecond = 0;
}
if ($param['login'] && $_G['uid'] || $url_forward) {
$param['login'] = false;
}
$param['header'] = $url_forward && $param['header'] ? true : false;
if ($_GET['ajaxdata'] === 'json') {
$param['header'] = '';
}
if ($param['header']) {
header("HTTP/1.1 301 Moved Permanently");
dheader("location: " . str_replace('&', '&', $url_forward));
}
$url_forward_js = addslashes(str_replace('\\', '%27', $url_forward));
if ($param['location'] && !empty($_G['inajax'])) {
include template('common/header_ajax');
echo '<script type="text/javascript" reload="1">window.location.href=\'' . $url_forward_js . '\';</script>';
include template('common/footer_ajax');
dexit();
}
$_G['hookscriptmessage'] = $message;
$_G['hookscriptvalues'] = $values;
$vars = explode(':', $message);
if (count($vars) == 2) {
$show_message = lang('plugin/' . $vars[0], $vars[1], $values);
} else {
$show_message = lang('message', $message, $values);
}
//.........这里部分代码省略.........
示例12: showmessage
function showmessage($message, $url_forward = '', $extra = '', $forwardtype = 0)
{
extract($GLOBALS, EXTR_SKIP);
global $extrahead, $discuz_uid, $discuz_action, $debuginfo, $seccode, $seccodestatus, $fid, $tid, $charset, $show_message, $inajax, $_DCACHE, $advlist;
define('CACHE_FORBIDDEN', TRUE);
$show_message = $message;
$messagehandle = 0;
$msgforward = unserialize($_DCACHE['settings']['msgforward']);
$refreshtime = intval($msgforward['refreshtime']);
$refreshtime = empty($forwardtype) ? $refreshtime : ($refreshtime ? $refreshtime : 3);
$msgforward['refreshtime'] = $refreshtime * 1000;
$url_forward = empty($url_forward) ? '' : (empty($_DCOOKIE['sid']) && $transsidstatus ? transsid($url_forward) : $url_forward);
$seccodecheck = $seccodestatus & 2;
if ($url_forward && (!empty($quickforward) || empty($inajax) && $msgforward['quick'] && $msgforward['messages'] && @in_array($message, $msgforward['messages']))) {
updatesession();
dheader("location: " . str_replace('&', '&', $url_forward));
}
if (!empty($infloat)) {
if ($extra) {
$messagehandle = $extra;
}
$extra = '';
}
if (in_array($extra, array('HALTED', 'NOPERM'))) {
$fid = $tid = 0;
$discuz_action = 254;
} else {
$discuz_action = 255;
}
include language('messages');
if (isset($language[$message])) {
$pre = $inajax ? 'ajax_' : '';
eval("\$show_message = \"" . (isset($language[$pre . $message]) ? $language[$pre . $message] : $language[$message]) . "\";");
unset($pre);
}
if (empty($infloat)) {
$show_message .= $url_forward && empty($inajax) ? '<script>setTimeout("window.location.href =\'' . $url_forward . '\';", ' . $msgforward['refreshtime'] . ');</script>' : '';
} elseif ($handlekey) {
$show_message = str_replace("'", "\\'", $show_message);
if ($url_forward) {
$show_message = "<script type=\"text/javascript\" reload=\"1\">\nif(\$('return_{$handlekey}')) \$('return_{$handlekey}').className = 'onright';\nif(typeof submithandle_{$handlekey} =='function') {submithandle_{$handlekey}('{$url_forward}', '{$show_message}');} else {location.href='{$url_forward}'}\n</script>";
} else {
$show_message .= "<script type=\"text/javascript\" reload=\"1\">\nif(typeof messagehandle_{$handlekey} =='function') {messagehandle_{$handlekey}('{$messagehandle}', '{$show_message}');}\n</script>";
}
}
if ($advlist = array_merge($globaladvs ? $globaladvs['type'] : array(), $redirectadvs ? $redirectadvs['type'] : array())) {
$advitems = ($globaladvs ? $globaladvs['items'] : array()) + ($redirectadvs ? $redirectadvs['items'] : array());
foreach ($advlist as $type => $redirectadvs) {
$advlist[$type] = $advitems[$redirectadvs[array_rand($redirectadvs)]];
}
}
if ($extra == 'NOPERM') {
include template('nopermission');
} else {
include template('showmessage');
}
dexit();
}
示例13: showmessage
function showmessage($message, $url_forward = '', $extra = '')
{
extract($GLOBALS, EXTR_SKIP);
global $extrahead, $discuz_action, $debuginfo, $seccode, $fid, $tid, $supe_fromsupesite, $supe_jumpurl, $supe, $charset, $show_message, $inajax, $_DCACHE, $advlist;
define('CACHE_FORBIDDEN', TRUE);
$supe_messagetpl = $supe_error = '';
$show_message = $message;
$msgforward = unserialize($_DCACHE['settings']['msgforward']);
$msgforward['refreshtime'] = intval($msgforward['refreshtime']);
$url_forward = empty($url_forward) ? '' : (empty($_DCOOKIE['sid']) && $transsidstatus ? transsid($url_forward) : $url_forward);
if ($supe_fromsupesite && $supe['status']) {
$supe_messagetpl = 'supesite_';
$extra = '';
$supe_error = $url_forward ? false : true;
$url_forward = !empty($supe_jumpurl) && !$supe_error ? urldecode($supe_jumpurl) : $url_forward;
} elseif ($url_forward && empty($inajax) && $msgforward['quick'] && $msgforward['messages'] && @in_array($message, $msgforward['messages'])) {
updatesession();
dheader("location: " . str_replace('&', '&', $url_forward));
}
if (in_array($extra, array('HALTED', 'NOPERM'))) {
$fid = $tid = 0;
$discuz_action = 254;
} else {
$discuz_action = 255;
}
include language('messages');
if (isset($language[$message])) {
$pre = $supe_fromsupesite ? 'supe_' : ($inajax ? 'ajax_' : '');
eval("\$show_message = \"" . (isset($language[$pre . $message]) ? $language[$pre . $message] : $language[$message]) . "\";");
unset($pre);
}
$extrahead .= $url_forward ? '<meta http-equiv="refresh" content="' . $msgforward['refreshtime'] . ' url=' . $url_forward . '">' : '';
if ($advlist = array_merge($globaladvs ? $globaladvs['type'] : array(), $redirectadvs ? $redirectadvs['type'] : array())) {
$advitems = ($globaladvs ? $globaladvs['items'] : array()) + ($redirectadvs ? $redirectadvs['items'] : array());
foreach ($advlist as $type => $redirectadvs) {
$advlist[$type] = $advitems[$redirectadvs[array_rand($redirectadvs)]];
}
}
if ($extra == 'NOPERM' && !$passport_status) {
//get secure code checking status (pos. -2)
if ($seccodecheck = substr(sprintf('%05b', $seccodestatus), -2, 1)) {
$seccode = random(6, 1) + $seccode[0] * 1000000;
}
include template('nopermission');
} else {
include template($supe_messagetpl . 'showmessage');
}
dexit();
}
示例14: count
$from_cookie_num = count($from_cookie_array);
$from_cookie_start = $from_cookie_num - 10;
$from_cookie_start = $from_cookie_start > 0 ? $from_cookie_start : 0;
$from_cookie_array = array_slice($from_cookie_array, $from_cookie_start, $from_cookie_num);
$from_cookie = implode("\t", $from_cookie_array);
dsetcookie('from_cookie', $from_cookie);
}
dsetcookie('clearUserdata', 'home');
$op = 'add_success';
$article_add_url = 'portal.php?mod=portalcp&ac=article&catid='.$catid;
$article = C::t('portal_article_title')->fetch($aid);
$viewarticleurl = $_POST['url'] ? "portal.php?mod=list&catid=$_POST[catid]" : fetch_article_url($article);
include_once template("portal/portalcp_article");dexit();
} elseif(submitcheck('pushplussubmit')) {
if($aid) {
check_articleperm($article['catid'], $aid, $article);
} else {
showmessage('no_article_specified_for_pushplus', dreferer());
}
$tourl = !empty($_POST['toedit']) ? 'portal.php?mod=portalcp&ac=article&op=edit&aid='.$aid : dreferer();
$pids = (array)$_POST['pushpluspids'];
$posts = array();
$tid = intval($_GET['tid']);
if($tid && $pids) {
foreach(C::t('forum_post')->fetch_all('tid:'.$tid, $pids) as $value) {
示例15: insenz_cpmsg
function insenz_cpmsg($message, $url, $type = '')
{
extract($GLOBALS, EXTR_SKIP);
include language('admincp.msg');
eval("\$message = \"" . (isset($msglang[$message]) ? $msglang[$message] : $message) . "\";");
switch ($type) {
case 'succeed':
$classname = 'infotitle2';
break;
case 'error':
$classname = 'infotitle3';
break;
case 'loading':
$classname = 'infotitle1';
break;
default:
$classname = 'marginbot normal';
break;
}
$message = '<h4 class="' . $classname . '">' . $message . '</h4><p class="marginbot"><a href="' . $url . '" class="lightlink">' . lang('message_redirect') . '</a></p>';
$url = transsid($url);
echo '<script type="text/JavaScript">parent.setTimeout("redirect(\'' . $url . '\');", 2000);parent.$("cpcontainer").innerHTML = \'<h3>' . $lang['discuz_message'] . '</h3><div class="infobox">' . $message . '</div>\';</script>';
dexit();
}