Exemplo n.º 1
0
/*
Simple:Press
Forum Topic/Post Saves
$LastChangedDate: 2014-06-14 17:34:16 -0700 (Sat, 14 Jun 2014) $
$Rev: 11559 $
*/
if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {
    die('Access denied - you cannot directly call this file');
}
# set up required globals and load support files -----------------------------------
global $spThisUser, $spGlobals;
sp_forum_api_support();
sp_load_editor(0, 1);
include_once SF_PLUGIN_DIR . '/forum/library/sp-post-support.php';
# Initialise the class -------------------------------------------------------------
$p = new spPost();
# Set up curret user details needed to keep class user agnostic
$p->userid = $spThisUser->ID;
$p->admin = $spThisUser->admin;
$p->moderator = $spThisUser->moderator;
$p->member = $spThisUser->member;
$p->guest = $spThisUser->guest;
$p->call = 'post';
# Set data items needed for initial needed permission checks -----------------------
if (isset($_POST['action'])) {
    $p->action = $_POST['action'];
}
if (isset($_POST['forumid'])) {
    $p->newpost['forumid'] = sp_esc_int($_POST['forumid']);
}
if (isset($_POST['forumslug'])) {
Exemplo n.º 2
0
/*
Simple:Press
Forum Topic/Post Saves
$LastChangedDate: 2015-02-15 00:54:47 -0800 (Sun, 15 Feb 2015) $
$Rev: 12486 $
*/
if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {
    die('Access denied - you cannot directly call this file');
}
# set up required globals and load support files -----------------------------------
global $spThisUser, $spGlobals;
sp_forum_api_support();
sp_load_editor(0, 1);
include_once SF_PLUGIN_DIR . '/forum/library/sp-post-support.php';
# Initialise the class -------------------------------------------------------------
$p = new spPost();
# Set up curret user details needed to keep class user agnostic
$p->userid = $spThisUser->ID;
$p->admin = $spThisUser->admin;
$p->moderator = $spThisUser->moderator;
$p->member = $spThisUser->member;
$p->guest = $spThisUser->guest;
$p->call = 'post';
# Set data items needed for initial needed permission checks -----------------------
if (isset($_POST['action'])) {
    $p->action = $_POST['action'];
}
if (isset($_POST['forumid'])) {
    $p->newpost['forumid'] = sp_esc_int($_POST['forumid']);
}
if (isset($_POST['forumslug'])) {
sp_load_editor(0, 1);
include_once SF_PLUGIN_DIR . '/forum/library/sp-post-support.php';
global $spThisUser;
# check credentials
if ($spThisUser->moderator == false) {
    if (!is_user_logged_in()) {
        echo __('Access denied - are you logged in?', 'spab');
    } else {
        echo __('Access denied - you do not have permission', 'spab');
    }
    die;
}
if (empty($_GET['postitem']) || empty($_GET['tid']) || empty($_GET['fid'])) {
    die;
}
$p = new spPost();
# Set up curret user details needed to keep class user agnostic
$p->userid = $spThisUser->ID;
$p->admin = $spThisUser->admin;
$p->moderator = $spThisUser->moderator;
$p->member = $spThisUser->member;
$p->guest = $spThisUser->guest;
$p->action = 'post';
$p->call = 'quickreply';
$p->newpost['topicid'] = sp_esc_int($_GET['tid']);
$p->newpost['forumid'] = sp_esc_int($_GET['fid']);
$p->newpost['forumslug'] = spdb_table(SFFORUMS, 'forum_id=' . $p->newpost['forumid'], 'forum_slug');
$t = spdb_table(SFTOPICS, 'topic_id=' . $p->newpost['topicid'], 'row');
$p->newpost['topicslug'] = $t->topic_slug;
$p->newpost['topicname'] = $t->topic_name;
$p->newpost['postcontent'] = urldecode($_GET['postitem']);