⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 在综合英文版XOOPS 2.09, 2.091, 2.092 的基础上正式发布XOOPS 2.09中文版 XOOPS 2.09x 版主要是PHP5升级、bug修正和安全补正: 1 全面兼容PHP 5.
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php
// $Id: index.php,v 1.1.1.44 2004/11/21 17:32:57 praedator Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System                      //
// Copyright (c) 2000 XOOPS.org                           //
// <http://www.xoops.org/>                             //
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify     //
// it under the terms of the GNU General Public License as published by     //
// the Free Software Foundation; either version 2 of the License, or        //
// (at your option) any later version.                                      //
// //
// You may not change or alter any portion of this comment or credits       //
// of supporting developers from this source code or any supporting         //
// source code which is considered copyrighted (c) material of the          //
// original comment or credit authors.                                      //
// //
// This program is distributed in the hope that it will be useful,          //
// but WITHOUT ANY WARRANTY; without even the implied warranty of           //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
// GNU General Public License for more details.                             //
// //
// You should have received a copy of the GNU General Public License        //
// along with this program; if not, write to the Free Software              //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
// ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
include('admin_header.php');

$op = '';
$ok = isset($_POST['ok']) ? intval($_POST['ok']) : 0;
foreach (array('approved', 'topic_id', 'post_id') as $getint) {
    ${$getint} = isset($_POST[$getint]) ? intval($_POST[$getint]) : 0;
}
foreach (array('approved', 'topic_id', 'post_id') as $getint) {
    ${$getint} = (${$getint})?${$getint}:(isset($_GET[$getint]) ? intval($_GET[$getint]) : 0);
}
if (isset($_GET['op'])) $op = $_GET['op'];
if (isset($_POST['op'])) $op = $_POST['op'];

switch ($op) {
    case "del":
        $post_handler = &xoops_getmodulehandler('post', 'newbb');
        if (!empty($ok)) {
            if (!empty($post_id)) {
                $post = &$post_handler->get($post_id);

                if ($ok == 2 && isset($post)) {
                    $post_handler->delete($post, true);
                }

                sync($post->getVar('forum_id'), "forum");
                sync($post->getVar('topic_id'), "topic");
            }
            if ($post->istopic()) {
                redirect_header("index.php", 2, _AM_NEWBB_POSTSDELETED);
                exit();
            } else {
                redirect_header("index.php", 2, _AM_NEWBB_POSTSDELETED);
                exit();
            }
        } else {
            xoops_cp_header();
            xoops_confirm(array('post_id' => $post_id, 'op' => 'del', 'ok' => 2), 'index.php', _AM_NEWBB_DEL_ONE);
            xoops_cp_footer();
        }
        exit();
        break;

    case "approve":

        if (isset($post_id) && $post_id > 0) {
            $post_handler = &xoops_getmodulehandler('post', 'newbb');
            if ($post_handler->approve($post_id)) {
                redirect_header("index.php", 1, _AM_NEWBB_POSTAPPROVED);
            } else {
                redirect_header("index.php", 1, _AM_NEWBB_POSTNOTAPPROVED);
            }
        } elseif (isset($topic_id) && $topic_id > 0) {
            $topic_handler = &xoops_getmodulehandler('topic', 'newbb');
            if ($topic_handler->approve($topic_id)) {
                redirect_header("index.php", 1, _AM_NEWBB_TOPICAPPROVED);
            } else {
                redirect_header("index.php", 1, _AM_NEWBB_TOPICNOTAPPROVED);
            }
        }
        exit();
        break;

	/* removed */

    case "mod":

        if (empty($post_id)) {
            redirect_header("index.php", 2, _MD_ERRORPOST);
            exit();
        } else {
            xoops_cp_header();
            newbb_adminmenu(0, "");
            echo "<br />";

            $post_handler = &xoops_getmodulehandler('post', 'newbb');
            $forumpost = &$post_handler->get($post_id);
		    $forum_handler =& xoops_getmodulehandler('forum', 'newbb');
		    $forum = $forum_handler->get($forumpost->getVar('forum_id'));

    		$pid = $forumpost->getVar('pid');
		    $dohtml = $forumpost->getVar('dohtml');
		    $dosmiley = $forumpost->getVar('dosmiley');
		    $doxcode = $forumpost->getVar('doxcode');
		    $icon = $forumpost->getVar('icon');
		    $attachsig = $forumpost->getVar('attachsig');
		    $topic_id=$forumpost->getVar('topic_id');
		    $istopic = ( $forumpost->istopic() )?1:0;
		    $isedit =1;
		    $subject_pre="";
		    $subject=$forumpost->getVar('subject', "E");
		    $message=$forumpost->getVar('post_text', "E");
		    $poster_name=$forumpost->getVar('poster_name', "E");
		    $attachments=$forumpost->getAttachment();
		    $post_karma=$forumpost->getVar('post_karma');
		    $require_reply=$forumpost->getVar('require_reply');
		    $hidden = "";

			$admin_form_action = "admin_post.php";
            include '../include/forumform.inc.php';
            xoops_cp_footer();
        }

        exit();
        break;
	/* */

    case "createdir":
		if (isset($_GET['path'])) $path = $_GET['path'];
        $res = newbb_admin_mkdir($path);
        $msg = ($res)?_AM_NEWBB_DIRCREATED:_AM_NEWBB_DIRNOTCREATED;
        redirect_header('index.php', 2, $msg . ': ' . $path);
        exit();
        break;

    case "setperm":
        $res = newbb_admin_chmod($path);
        $msg = ($res)?_AM_NEWBB_PERMSET:_AM_NEWBB_PERMNOTSET;
        redirect_header('index.php', 2, $msg . ': ' . $path);
        exit();
        break;

    case "senddigest":
        $digest_handler = &xoops_getmodulehandler('digest', 'newbb');
        $res = $digest_handler->process(true);
        $msg = ($res)?_AM_NEWBB_DIGEST_FAILED:_AM_NEWBB_DIGEST_SENT;
        redirect_header('index.php', 2, $msg);
        exit();
        break;

    case "default":
    default:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -