Ejemplo n.º 1
0
<?php

require_once 'bbs_public.php';
//验证用户登陆相关操作
$admin = new action_admin();
$admin->check_login();
$category = db_bbs_category::getInstance();
$category_data = $category->getAll();
$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 1;
$label = db_bbs_label::getInstance();
$lable_data = $label->getAll();
if (isset($_POST['submit'])) {
    if (strtolower(trim($_POST['verify'])) != strtolower($_SESSION['verify'])) {
        action_public::turnPage('index.php', '验证码输入错误!');
    }
    $archive = db_bbs_archive::getInstance();
    unset($_POST['submit']);
    unset($_POST['verify']);
    $_POST['username'] = $_COOKIE['login_username'];
    $_POST['userid'] = $admin->userid;
    $_POST['ip'] = $_SERVER['REMOTE_ADDR'];
    $_POST['addtime'] = mktime();
    if ($id = $archive->inserData($_POST)) {
        action_public::turnPage('archive-display.php?aid=' . $id, '文章添加成功');
    } else {
        action_public::turnPage('index.php', '添加失败,请联系我们!');
    }
}
include 'header.php';
?>
Ejemplo n.º 2
0
function daddslashes($string, $force = 1)
{
    if (is_array($string)) {
        $keys = array_keys($string);
        foreach ($keys as $key) {
            $val = $string[$key];
            unset($string[$key]);
            $string[addslashes($key)] = daddslashes($val, $force);
        }
    } else {
        $string = addslashes($string);
    }
    return $string;
}
$GLOBALS['config'] = (require_once '../include/bbs_config.php');
require_once ROOT . '/bbs/model/loadClass.php';
require_once ROOT . '/editor/fckeditor.php';
/*
 * 配置fckeditor
 */
$editor = new FCKeditor('content');
$editor->BasePath = '../../editor/';
$editor->Height = 300;
$editor->Width = 500;
$editor->ToolbarSet = 'Default';
/******************************/
$sessionox = db_sessionox::getInstance();
$spsession = new SPSession($sessionox, $GLOBALS['config']);
$admin = new action_admin();
$admin->check_admin_login();
$roles = $_SESSION['roles'];