代码拉取完成,页面将自动刷新
同步操作将从 foru/ForU CMS 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
include './library/inc.php';
if ($act == 'feedback_post') {
$arr['f_name'] = !empty($_POST['name']) ? str_safe($_POST['name']) : '';
$arr['f_content'] = !empty($_POST['message']) ? str_safe($_POST['message']) : '';
foreach ($arr as $val) {
if ($val == '') alert_back('请核对信息后重试!');
}
$arr['f_tel'] = !empty($_POST['tel']) ? str_safe($_POST['tel']) : '';
$arr['f_title'] = !empty($_POST['subject']) ? str_safe($_POST['subject']) : '';
$arr['f_email'] = !empty($_POST['email']) ? str_safe($_POST['email']) : '';
if ($db->autoExecute("feedback",$arr,'INSERT')) {
alert_back('您的信息已提交,谢谢您对我们的支持!');
} else {
alert_back('请核对信息后重试!');
}
}
elseif ($act == 'feedback_post_mail') {
$arr['f_name'] = !empty($_POST['name']) ? str_safe($_POST['name']) : '';
$arr['f_content'] = !empty($_POST['message']) ? str_safe($_POST['message']) : '';
foreach ($arr as $val) {
if ($val == '') alert_back('请核对信息后重试!');
}
$arr['f_tel'] = !empty($_POST['tel']) ? str_safe($_POST['tel']) : '';
$arr['f_title'] = !empty($_POST['subject']) ? str_safe($_POST['subject']) : '';
$arr['f_email'] = !empty($_POST['email']) ? str_safe($_POST['email']) : '';
$mail_subject = '[' . $cms['s_name'] . '] 留言邮件';
$mail_body = '姓名:' . $arr['f_name'] . '<br>';
$mail_body .= '电话:' . $arr['f_tel'] . '<br>';
$mail_body .= '电邮:' . $arr['f_email'] . '<br>';
$mail_body .= '主题:' . $arr['f_title'] . '<br>';
$mail_body .= '内容:' . $arr['f_content'] . '<br>';
if (smtpMail(SMTP_RECIEVER,$mail_subject,$mail_body)) {
alert_back('您的信息已提交,谢谢您对我们的支持!');
} else {
alert_back('请核对信息后重试!');
}
}
elseif ($act == 'rewrite_apache') {
$str = "RewriteEngine On".PHP_EOL."#主域名指向www二级域名".PHP_EOL."#RewriteCond %{HTTP_HOST} ^domain.com [NC]".PHP_EOL."#RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]".PHP_EOL."RewriteBase /".PHP_EOL."RewriteRule ^index\.html$ index.php".PHP_EOL."RewriteRule ^channel-([0-9]+)\.html$ channel.php?id=$1".PHP_EOL."RewriteRule ^channel-([0-9]+)-([0-9]+)\.html$ channel.php?id=$1&page=$2".PHP_EOL."RewriteRule ^detail-([0-9]+)\.html$ detail.php?id=$1".PHP_EOL."RewriteRule ^user\.html$ user.php".PHP_EOL."RewriteRule ^user-(.*)\.html$ user.php?act=$1".PHP_EOL."RewriteRule ^user-(.*)-([0-9]+)\.html$ user.php?act=$1&page=$2";
$fp = fopen(".htaccess","w+");
fwrite($fp,$str);
fclose($fp);
alert_back($_lang['msg_success']);
}
elseif ($act == 'rewrite_nginx') {
$str = "location / {".PHP_EOL."rewrite /index\.html$ /index.php;".PHP_EOL."rewrite ^/channel-([0-9]+)\.html$ /channel.php?id=$1;".PHP_EOL."rewrite ^/channel-([0-9]+)-([0-9]+)\.html$ /channel.php?id=$1&page=$2;".PHP_EOL."rewrite ^/detail-([0-9]+)\.html$ /detail.php?id=$1;".PHP_EOL."rewrite ^/user\.html$ /user.php;".PHP_EOL."rewrite ^/user-(.*)\.html$ /user.php?act=$1;".PHP_EOL."rewrite ^/user-(.*)-([0-9]+)\.html$ /user.php?act=$1&page=$2;".PHP_EOL."}";
$fp = fopen(".nginx","w+");
fwrite($fp,$str);
fclose($fp);
alert_back($_lang['msg_success']);
}
elseif ($act == 'rewrite_isapi') {
$str = "[ISAPI_Rewrite]".PHP_EOL."# 3600 = 1 hour".PHP_EOL."CacheClockRate 3600".PHP_EOL."RepeatLimit 32".PHP_EOL."# Protext httpd.ini and httpd.parse.errors files".PHP_EOL."# from accessing through HTTP".PHP_EOL."RewriteRule ^index\.html$ index.php".PHP_EOL."RewriteRule ^channel-([0-9]+)\.html$ channel\.php\?id=$1".PHP_EOL."RewriteRule ^channel-([0-9]+)-([0-9]+)\.html$ channel\.php\?id=$1&page=$2".PHP_EOL."RewriteRule ^detail-([0-9]+)\.html$ detail\.php\?id=$1".PHP_EOL."RewriteRule ^user\.html$ user.php".PHP_EOL."RewriteRule ^user-(.*)\.html$ user\.php\?act=$1".PHP_EOL."RewriteRule ^user-(.*)-([0-9]+)\.html$ user\.php\?act=$1&page=$2";
$fp = fopen("httpd.ini","w+");
fwrite($fp,$str);
fclose($fp);
alert_back($_lang['msg_success']);
}
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['msg_success']);
}
// subscribe post
elseif ($act == 'subscribe') {
$sub_mail = str_safe($_POST['sub_mail']);
if (check($sub_mail,'email')) {
$arr['sub_name'] = str_safe($_POST['sub_name']);
$arr['sub_sex'] = str_safe($_POST['sub_sex']);
$arr['sub_mail'] = $sub_mail;
$arr['sub_addr'] = str_safe($_POST['sub_addr']);
$arr['sub_post'] = str_safe($_POST['sub_post']);
$arr['sub_date'] = gmtime();
if ($db->getRow("SELECT * FROM subscribe WHERE sub_mail = '$sub_mail'")) {
alert_back($_lang['reg']['email_existing']);
} else {
$db->autoExecute("subscribe",$arr,'INSERT');
alert_back('您已加入邮件订阅!');
}
} else {
alert_back($_lang['reg']['email_error']);
}
}
elseif($act == 'mail'){
$size = 10000;
$count = $db->getOne("SELECT COUNT(*) FROM subscribe");
if($count){
mk_dir(SUBSCRIBE_DIR);
for($i=0;$i<$count;$i+=$size){
$res = $db->getAll("SELECT * FROM subscribe ORDER BY id ASC LIMIT $i,$size");
foreach ($res as $key => $value) {
if($key==0){
$str = $value['sub_name'] . "," . $value['sub_sex'] . "," . $value['sub_mail'] . "," . $value['sub_addr'] . "," . $value['sub_post'] . "," . local_date('Y-m-d', $value['sub_date']);
}else{
$str .= PHP_EOL . $value['sub_name'] . "," . $value['sub_sex'] . "," . $value['sub_mail'] . "," . $value['sub_addr'] . "," . $value['sub_post'] . "," . local_date('Y-m-d', $value['sub_date']);
}
}
$fp = fopen("subscribe_$i.txt","w+");
fwrite($fp,$str);
fclose($fp);
}
alert_back($_lang['msg_success']);
} else {
alert_back($_lang['msg_failed']);
}
}
// cart
elseif ($act == 'cart') {
if(isset($_POST['list']) && isset($_POST['num']) && isset($_POST['amount'])){
$arr = array();
$arr['list'] = json_decode(str_replace("\\", "", $_POST['list']),true);
$arr['num'] = $_POST['num'];
$arr['amount'] = $_POST['amount'];
$_SESSION['cart'] = $arr;
$res['err'] = 'n';
$res['url'] = 'cart.php';
} else {
$res["err"] = 'y';
$res["url"] = '';
}
die(json_encode($res, JSON_NUMERIC_CHECK));
}
else {
die($_lang['illegal']);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。