コード例 #1
0
ファイル: admin.messages.php プロジェクト: alucard263096/KJ
    $page = ForceIncomingInt('p');
    $uid = ForceIncomingInt('u');
    for ($i = 0; $i < count($deletecommentids); $i++) {
        $DB->query("DELETE FROM " . TABLE_PREFIX . "msg WHERE msgid = '" . ForceInt($deletecommentids[$i]) . "'");
    }
    GotoPage('admin.messages.php' . Iif($page, '?p=' . $page . Iif($uid, '&u=' . $uid), Iif($uid, '?u=' . $uid)), 1);
}
//########### FAST DELETE COMMENTS ###########
if ($action == 'fastdelete') {
    $days = ForceIncomingInt('days');
    $uid = ForceIncomingInt('u');
    $realtime = time();
    $searchsql = Iif($uid, " WHERE fromid ='{$uid}' ", "");
    $searchsql .= Iif($searchsql, Iif($days, " AND created < " . $realtime - 3600 * 24 * $days), Iif($days, " WHERE created < " . $realtime - 3600 * 24 * $days));
    $DB->query("DELETE FROM " . TABLE_PREFIX . "msg " . $searchsql);
    GotoPage('admin.messages.php' . Iif($uid, '?u=' . $uid), 1);
}
//########### PRINT DEFAULT ###########
if ($action == 'default') {
    $NumPerPage = 20;
    $page = ForceIncomingInt('p', 1);
    $start = $NumPerPage * ($page - 1);
    $fromid = ForceIncomingInt('u');
    $toid = ForceIncomingInt('toid');
    /*$searchsql = Iif($uid, "WHERE touserid ='$uid' ", "");
    */
    //die ("SELECT userid, userfrontname FROM " . TABLE_PREFIX . "user WHERE usergroupid <>1 ORDER BY userid");
    $getusers = $DB->query("SELECT userid, userfrontname FROM " . TABLE_PREFIX . "user WHERE usergroupid <>1 ORDER BY userid");
    while ($user = $DB->fetch($getusers)) {
        $users[$user['userid']] = $user['userfrontname'];
        $useroptions .= '<option value="' . $user['userid'] . '" ' . Iif($uid == $user['userid'], 'SELECTED', '') . '>' . $user['userfrontname'] . '</option>';
コード例 #2
0
ファイル: admin.groups.php プロジェクト: alucard263096/KJ
    $description = ForceIncomingString('description');
    $descriptionen = ForceIncomingString('descriptionen');
    if ($groupname == '') {
        $errors[] = "群组名称不能为空!";
    }
    if ($groupename == '') {
        $errors[] = "群组英文名称不能为空!";
    }
    if (isset($errors)) {
        $errortitle = '添加群组错误';
        $action = 'default';
    } else {
        $DB->exe("INSERT INTO " . TABLE_PREFIX . "usergroup (displayorder, groupname, groupename, activated, description, descriptionen) VALUES (1, '{$groupname}', '{$groupename}', 1, '{$description}', '{$descriptionen}')");
        $usergroupid = $DB->insert_id();
        $DB->exe("UPDATE " . TABLE_PREFIX . "usergroup SET displayorder = '{$usergroupid}' WHERE usergroupid = '{$usergroupid}'");
        GotoPage('admin.groups.php', 1);
    }
}
//########### PRINT DEFAULT ###########
if ($action == 'default') {
    $usergroup = array('groupname' => '', 'groupename' => '', 'description' => '', 'descriptionen' => '');
    if (isset($errors)) {
        PrintErrors($errors, $errortitle);
        if (!IsPost('updategroups')) {
            $usergroup = array('groupname' => $groupname, 'groupename' => $groupename, 'description' => $_POST['description'], 'descriptionen' => $_POST['descriptionen']);
        }
    }
    echo '<form method="post" action="admin.groups.php" name="groupform">
	<input type="hidden" name="action" value="creatgroup">
	<table border="0" cellpadding="0" cellspacing="0" class="moreinfo">
	<thead>
コード例 #3
0
ファイル: admin.settings.php プロジェクト: alucard263096/NCMI
                        $value = ForceInt($value, 20);
                        break;
                    default:
                        $value = ForceString($value);
                        break;
                }
                $code = ForceString($key);
                $contents = preg_replace("/[\$]_CFG\\['{$code}'\\]\\s*\\=\\s*[\"'].*?[\"'];/is", "\$_CFG['{$code}'] = \"{$value}\";", $contents);
            }
        }
        if ($contents != $oldcontents) {
            $fp = @fopen($filename, 'wb');
            @fwrite($fp, $contents);
            @fclose($fp);
        }
        GotoPage('admin.settings.php', 1);
    }
}
//########### PRINT DEFAULT ###########
if ($action == 'displaysettings') {
    echo '<form method="post" action="admin.settings.php">
	<input type="hidden" name="action" value="updatesettings">
	<table id="welive_list" border="0" cellpadding="0" cellspacing="0" class="moreinfo">
	<thead>
	<tr>
	<th colspan="2">系统设置:</th>
	</tr>
	</thead>
	<tbody>
	<tr>
	<td><B>前台默认语言</B><BR>当选择 \'<b>自动</b>\' 时, 将根据访客的浏览器语言自动选择语言, 中文浏览器进入中文, 其它语言浏览器自动进入英文.</td>
コード例 #4
0
ファイル: admin.comments.php プロジェクト: alucard263096/KJ
    $page = ForceIncomingInt('p');
    $uid = ForceIncomingInt('u');
    for ($i = 0; $i < count($deletecommentids); $i++) {
        $DB->exe("DELETE FROM " . TABLE_PREFIX . "comment WHERE commentid = '" . ForceInt($deletecommentids[$i]) . "'");
    }
    GotoPage('admin.comments.php' . Iif($page, '?p=' . $page . Iif($uid, '&u=' . $uid), Iif($uid, '?u=' . $uid)), 1);
}
//########### FAST DELETE COMMENTS ###########
if ($action == 'fastdelete') {
    $days = ForceIncomingInt('days');
    $uid = ForceIncomingInt('u');
    $realtime = time();
    $searchsql = Iif($uid, " WHERE touserid ='{$uid}' ", "");
    $searchsql .= Iif($searchsql, Iif($days, " AND created < " . $realtime - 3600 * 24 * $days), Iif($days, " WHERE created < " . $realtime - 3600 * 24 * $days));
    $DB->exe("DELETE FROM " . TABLE_PREFIX . "comment " . $searchsql);
    GotoPage('admin.comments.php' . Iif($uid, '?u=' . $uid), 1);
}
//########### PRINT DEFAULT ###########
if ($action == 'default') {
    $NumPerPage = 20;
    $page = ForceIncomingInt('p', 1);
    $start = $NumPerPage * ($page - 1);
    $uid = ForceIncomingInt('u');
    $searchsql = Iif($uid, "WHERE touserid ='{$uid}' ", "");
    $getusers = $DB->query("SELECT userid, userfrontname FROM " . TABLE_PREFIX . "user WHERE usergroupid <>1 ORDER BY userid");
    while ($user = $DB->fetch($getusers)) {
        $users[$user['userid']] = $user['userfrontname'];
        $useroptions .= '<option value="' . $user['userid'] . '" ' . Iif($uid == $user['userid'], 'SELECTED', '') . '>' . $user['userfrontname'] . '</option>';
    }
    $getcomments = $DB->query("SELECT * FROM " . TABLE_PREFIX . "comment " . $searchsql . " ORDER BY commentid DESC LIMIT {$start},{$NumPerPage}");
    $maxrows = $DB->getOne("SELECT COUNT(commentid) AS value FROM " . TABLE_PREFIX . "comment " . $searchsql);
コード例 #5
0
ファイル: admin.users.php プロジェクト: alucard263096/KJ
        GotoPage('admin.users.php', 1);
    }
}
//########### DELETE users ###########
if ($action == 'deleteusers') {
    $deleteuserids = $_POST['deleteuserids'];
    for ($i = 0; $i < count($deleteuserids); $i++) {
        $DB->exe("DELETE FROM " . TABLE_PREFIX . "user WHERE userid <>1 AND userid = '" . ForceInt($deleteuserids[$i]) . "'");
    }
    if (!storeCache()) {
        //更新小面板在线客服缓存文件
        $errortitle = $cache_errortitle;
        $errors = $cache_errors;
        $action = 'default';
    } else {
        GotoPage('admin.users.php', 1);
    }
}
// ############################ DISPLAY QQ MSN SKYPE FORM #############################
if ($action == 'editqms' or $action == 'addqms') {
    $userid = ForceIncomingInt('userid');
    if (isset($errors)) {
        PrintErrors($errors, $errortitle);
        $user = array('userid' => $userid, 'usergroupid' => Iif($userid == $userinfo['usergroupid'], $userinfo['usergroupid'], $usergroupid), 'activated' => Iif($userid == $userinfo['userid'], $userinfo['activated'], $activated), 'displayorder' => $displayorder, 'username' => $username, 'userfrontname' => $userfrontname, 'userfrontename' => $userfrontename, 'type' => $type);
    } else {
        if ($userid) {
            $user = $DB->getOne("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = '{$userid}'");
        } else {
            $user = array('userid' => 0, 'activated' => 1);
        }
    }
コード例 #6
0
ファイル: admin.automsg.php プロジェクト: alucard263096/KJ
    }
    if (strlen($msg) == 0) {
        $errors = '请输入短语内容!';
    }
    if (isset($errors)) {
        $errortitle = Iif($msgid, '编辑短语错误', '添加短语错误');
        $action = Iif($msgid, 'editmsg', 'addmsg');
    } else {
        if ($action == 'updatemsg') {
            $DB->exe("UPDATE " . TABLE_PREFIX . "automsg SET ordernum    = '{$ordernum}',\r\n\t\t\tactivated       = '{$activated}',\r\n\t\t\tmsg       = '{$msg}'\t\t\t\t\t\t\t\t\t\t \r\n\t\t\tWHERE msgid      = '{$msgid}'");
        } else {
            $DB->exe("INSERT INTO " . TABLE_PREFIX . "automsg (ordernum, activated, msg) VALUES (0, 1, '{$msg}')");
            $newmsgid = $DB->insert_id();
            $DB->exe("UPDATE " . TABLE_PREFIX . "automsg SET ordernum = '{$newmsgid}' WHERE msgid = '{$newmsgid}'");
        }
        GotoPage('admin.automsg.php', 1);
    }
}
//########### ADD OR EDIT MESSAGE ###########
if ($action == 'editmsg' or $action == 'addmsg') {
    $msgid = ForceIncomingInt('msgid');
    if (isset($errors)) {
        PrintErrors($errors, $errortitle);
        $msg = array('msgid' => $msgid, 'activated' => $activated, 'ordernum' => $ordernum, 'msg' => $_POST['msg']);
    } else {
        if ($msgid) {
            $msg = $DB->getOne("SELECT * FROM " . TABLE_PREFIX . "automsg WHERE msgid = '{$msgid}'");
        } else {
            $msg = array('msgid' => 0, 'activated' => 1);
        }
    }
コード例 #7
0
ファイル: admin.mycomments.php プロジェクト: alucard263096/KJ
//########### DELETE COMMENTS ###########
if ($action == 'deletecomments') {
    $deletecommentids = $_POST['deletecommentids'];
    $page = ForceIncomingInt('p');
    for ($i = 0; $i < count($deletecommentids); $i++) {
        $DB->exe("DELETE FROM " . TABLE_PREFIX . "comment WHERE touserid ='{$uid}' AND commentid = '" . ForceInt($deletecommentids[$i]) . "'");
    }
    GotoPage('admin.mycomments.php' . Iif($page, '?p=' . $page), 1);
}
//########### FAST DELETE COMMENTS ###########
if ($action == 'fastdelete') {
    $days = ForceIncomingInt('days');
    $realtime = time();
    $searchsql = Iif($days, " AND created < " . $realtime - 3600 * 24 * $days);
    $DB->exe("DELETE FROM " . TABLE_PREFIX . "comment WHERE touserid ='{$uid}' " . $searchsql);
    GotoPage('admin.mycomments.php', 1);
}
//########### PRINT DEFAULT ###########
if ($action == 'default') {
    $NumPerPage = 20;
    $page = ForceIncomingInt('p', 1);
    $start = $NumPerPage * ($page - 1);
    $getcomments = $DB->query("SELECT * FROM " . TABLE_PREFIX . "comment WHERE touserid ='{$uid}' ORDER BY commentid DESC LIMIT {$start},{$NumPerPage}");
    $maxrows = $DB->getOne("SELECT COUNT(commentid) AS value FROM " . TABLE_PREFIX . "comment WHERE touserid ='{$uid}'");
    echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
	<td>&nbsp;&nbsp;&nbsp;共有: <span class=note>' . $maxrows['value'] . '</span> 条留言</td>
	<td>
	<form method="post" action="admin.mycomments.php" name="deleteform">
	<input type="hidden" name="action" value="fastdelete">
	选择:&nbsp;<select name="days"><option value="0">全部留言</option><option value="1">1 天前</option><option value="5">5 天前</option><option value="10">10 天前</option><option value="30">30 天前</option><option value="60">60 天前</option><option value="90">90 天前</option></select>&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="delete" onclick="return confirm(\'确定删除所选留言吗?\');" value=" 快速删除 " />