示例#1
0
//---------------------------
require_once '../header.inc.php';
require_once 'post.class.php';
require_once inc_response;
require_once inc_dataReader;
require_once inc_component;
require_once inc_manage_unit;
require_once inc_QueryHelper;
$task = isset($_POST["task"]) ? $_POST["task"] : (isset($_GET["task"]) ? $_GET["task"] : "");
switch ($task) {
    case "fullSelect":
        fullSelect();
    case "selectPost":
        selectPost();
    case "SavePost":
        SavePost();
    case "DeletePost":
        DeletePost();
    case "MovePost":
        MovePost();
}
function selectPost()
{
    $where = "1=1";
    $whereParam = array();
    //-----------------------
    if (!empty($_POST["post_id"])) {
        $where .= "post_id=:pid";
        $whereParam[":pid"] = $_POST["post_id"];
    }
    if (!empty($_POST["title"])) {
示例#2
0
文件: editpost.php 项目: OvBB/v1.0
}
// Get the attachments in this post.
$dbConn->query("SELECT id, filename FROM attachment WHERE parent={$iPostID}");
while (list($iAttachmentID, $strFilename) = $dbConn->getresult()) {
    $aAttachments[$iAttachmentID] = $strFilename;
}
// Get the thread ID, thread description, forum, and category the post belongs to.
$dbConn->query("SELECT thread.title, thread.description, board.id AS bID, board.name AS bName, cat.id AS cID, cat.name AS cName FROM thread INNER JOIN board ON (thread.parent = board.id) INNER JOIN board AS cat ON (board.parent = cat.id) WHERE thread.id={$aPostInfo['parent']}");
list($strThreadTitle, $strThreadDesc, $iForumID, $strForumName, $iCategoryID, $strCategoryName) = $dbConn->getresult();
// Get the thread's root.
$dbConn->query("SELECT post.id FROM post LEFT JOIN thread ON (post.parent = thread.id) WHERE thread.id={$aPostInfo['parent']} ORDER BY post.datetime_posted ASC LIMIT 1");
list($iRootID) = $dbConn->getresult();
// Are they saving?
if ($_REQUEST['submit'] == 'Save') {
    // Yes, do that now.
    $aError = SavePost($aPostInfo);
    // Store the posted values in case we get errors while saving,
    // the user won't have to reenter their information.
    $strSubject = $_REQUEST['subject'];
    $strThreadDesc = $_REQUEST['description'];
    $iPostIcon = (int) $_REQUEST['icon'];
    $strBody = $_REQUEST['message'];
    $bParseURLs = (bool) $_REQUEST['parseurls'];
    $bParseEMails = (bool) $_REQUEST['parseemails'];
    $bDisableSmilies = (bool) $_REQUEST['dsmilies'];
    $aDeleteAttachments = $_REQUEST['deleteattach'];
} else {
    // Store the post info into variables.
    $strSubject = $aPostInfo['title'];
    $iPostIcon = (int) $aPostInfo['icon'];
    $strBody = $aPostInfo['body'];
示例#3
0
文件: send.php 项目: Hepic/web-class
<?php

include 'models/posts.php';
include 'models/database.php';
session_start();
if (!isset($_SESSION['userid'])) {
    header('Location: login.php');
    die;
}
if (isset($_POST['shout'])) {
    SavePost($_SESSION['userid'], $_POST['shout']);
    header('Location: index.php');
}