代码拉取完成,页面将自动刷新
同步操作将从 foru/ForU CMS 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
include './library/inc.php';
include './language/common.php';
switch (PATH_SEPARATOR) {
case ';':
$spt = "\r\n";
break;
case ':':
$spt = "\n";
break;
default:
$spt = "\r";
break;
}
// subscribe post
if ($act == 'subscribe') {
$sub_mail = str_safe($_POST['sub-mail']);
if (check_email($sub_mail)) {
$arr['sub_mail'] = $sub_mail;
$arr['sub_date'] = gmtime();
if ($db->getRow("SELECT * FROM cms_subscribe WHERE sub_mail = '$sub_mail'")) {
alert_back($_lang['reg']['email_existing']);
} else {
$db->autoExecute('cms_subscribe',$arr,LIB_INST);
alert_back($_lang[LIB_FBACK][COM_SUC]);
}
} else {
alert_back($_lang['reg']['email_error']);
}
}
// feedback ajax
elseif ($act == LIB_FBACK) {
$arr[LIB_FBNAME] = !empty($_POST['name']) ? str_safe($_POST['name']) : '';
$arr[LIB_FBCONT] = !empty($_POST[AJAX_MSG]) ? str_safe($_POST[AJAX_MSG]) : '';
foreach ($arr as $val) {
if ($val == '') {
$res['err'] = 'y';
$res['msg'] = $_lang[COM_MSGFLD];
die(json_encode($res));
}
}
$arr[LIB_FBTEL] = !empty($_POST['tel']) ? str_safe($_POST['tel']) : '';
$arr[LIB_FBMAIL] = !empty($_POST[LIB_EMAIL]) ? str_safe($_POST[LIB_EMAIL]) : '';
$arr[LIB_FBTTL] = !empty($_POST[AJAX_SUBJ]) ? str_safe($_POST[AJAX_SUBJ]) : '';
if ($db->autoExecute('cms_feedback',$arr,LIB_INST)) {
$res['err'] = 'n';
$res['msg'] = $_lang[LIB_FBACK][COM_SUC];
} else {
$res['err'] = 'y';
$res['msg'] = $_lang[COM_MSGFLD];
}
die(json_encode($res));
}
elseif ($act == 'feedback_post') {
$arr[LIB_FBNAME] = !empty($_POST['name']) ? str_safe($_POST['name']) : '';
$arr[LIB_FBCONT] = !empty($_POST[AJAX_MSG]) ? str_safe($_POST[AJAX_MSG]) : '';
foreach ($arr as $val) {
if ($val == '') {
alert_back($_lang[COM_MSGFLD]);
}
}
$arr[LIB_FBTEL] = !empty($_POST['tel']) ? str_safe($_POST['tel']) : '';
$arr[LIB_FBTTL] = !empty($_POST[AJAX_SUBJ]) ? str_safe($_POST[AJAX_SUBJ]) : '';
$arr[LIB_FBMAIL] = !empty($_POST[LIB_EMAIL]) ? str_safe($_POST[LIB_EMAIL]) : '';
if ($db->autoExecute('cms_feedback',$arr,LIB_INST)) {
alert_back($_lang[LIB_FBACK][COM_SUC]);
} else {
alert_back($_lang[COM_MSGFLD]);
}
}
// rewrite
elseif ($act == 'rewrite_apache') {
$str = "RewriteEngine On{$spt}#主域名指向www二级域名{$spt}#RewriteCond %{HTTP_HOST} ^domain.com [NC]{$spt}#RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]{$spt}RewriteBase /{$spt}RewriteRule ^index\.html$ index.php{$spt}RewriteRule ^channel-([0-9]+)\.html$ channel.php?id=$1{$spt}RewriteRule ^channel-([0-9]+)-([0-9]+)\.html$ channel.php?id=$1&page=$2{$spt}RewriteRule ^detail-([0-9]+)\.html$ detail.php?id=$1{$spt}RewriteRule ^user\.html$ user.php{$spt}RewriteRule ^user-(.*)\.html$ user.php?act=$1{$spt}RewriteRule ^user-(.*)-([0-9]+)\.html$ user.php?act=$1&page=$2";
$fp = fopen(".htaccess","w+");
fwrite($fp,$str);
fclose($fp);
alert_back($_lang[COM_MSGSUC]);
}
elseif ($act == 'rewrite_nginx') {
$str = "location " . SITE_DIR . " {{$spt}rewrite " . SITE_DIR . "index\.html$ " . SITE_DIR . "index.php;{$spt}rewrite ^" . SITE_DIR . "channel-([0-9]+)\.html$ " . SITE_DIR . "channel.php?id=$1;{$spt}rewrite ^" . SITE_DIR . "channel-([0-9]+)-([0-9]+)\.html$ " . SITE_DIR . "channel.php?id=$1&page=$2;{$spt}rewrite ^" . SITE_DIR . "detail-([0-9]+)\.html$ " . SITE_DIR . "detail.php?id=$1;{$spt}rewrite ^" . SITE_DIR . "user\.html$ " . SITE_DIR . "user.php;{$spt}rewrite ^" . SITE_DIR . "user-(.*)\.html$ " . SITE_DIR . "user.php?act=$1;{$spt}rewrite ^" . SITE_DIR . "user-(.*)-([0-9]+)\.html$ " . SITE_DIR . "user.php?act=$1&page=$2;{$spt}}";
$fp = fopen(".nginx","w+");
fwrite($fp,$str);
fclose($fp);
alert_back($_lang[COM_MSGSUC]);
}
elseif ($act == 'rewrite_isapi') {
$str = "[ISAPI_Rewrite]{$spt}# 3600 = 1 hour{$spt}CacheClockRate 3600{$spt}RepeatLimit 32{$spt}# Protext httpd.ini and httpd.parse.errors files{$spt}# from accessing through HTTP{$spt}RewriteRule ^index\.html$ index.php{$spt}RewriteRule ^channel-([0-9]+)\.html$ channel\.php\?id=$1{$spt}RewriteRule ^channel-([0-9]+)-([0-9]+)\.html$ channel\.php\?id=$1&page=$2{$spt}RewriteRule ^detail-([0-9]+)\.html$ detail\.php\?id=$1{$spt}RewriteRule ^user\.html$ user.php{$spt}RewriteRule ^user-(.*)\.html$ user\.php\?act=$1{$spt}RewriteRule ^user-(.*)-([0-9]+)\.html$ user\.php\?act=$1&page=$2";
$fp = fopen("httpd.ini","w+");
fwrite($fp,$str);
fclose($fp);
alert_back($_lang[COM_MSGSUC]);
}
elseif ($act == 'rewrite_dotnet') {
$str = '<?xml version="1.0" encoding="UTF-8"?><configuration><system.webServer><rewrite><rules><rule name="index" stopProcessing="true"><match url="^index.html" /><action type="Rewrite" url="index.php" /></rule><rule name="channelp" stopProcessing="true"><match url="^channel-([0-9]+)\.html$" /><action type="Rewrite" url="channel.php?id={R:1}" /></rule><rule name="channelpp" stopProcessing="true"><match url="^channel-([0-9]+)-([0-9]+)\.html$" /><action type="Rewrite" url="channel.php?id={R:1}&page={R:2}" /></rule><rule name="detailp" stopProcessing="true"><match url="^detail-([0-9]+)\.html$" /><action type="Rewrite" url="detail.php?id={R:1}" /></rule><rule name="user" stopProcessing="true"><match url="^user\.html$" /><action type="Rewrite" url="user.php" /></rule><rule name="userp" stopProcessing="true"><match url="^user-(.*)\.html$" /><action type="Rewrite" url="user.php?act={R:1}" /></rule><rule name="userpp" stopProcessing="true"><match url="^user-(.*)-([0-9]+)\.html$" /><action type="Rewrite" url="user.php?act={R:1}&page={R:2}" /></rule></rules></rewrite></system.webServer></configuration>';
$fp = fopen("web.config","w+");
fwrite($fp,$str);
fclose($fp);
alert_back($_lang[COM_MSGSUC]);
}
else {
die($_lang['illegal']);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。