Beispiel #1
0
<?php

/**
 * Created by PhpStorm.
 * User: SHESHA
 * Date: 14-07-2015
 * Time: 08:17 PM
 */
//Includes
require_once "./dbconnect.php";
$dbobj = new dbconnect();
//Check for all required post params
$isValidPost = $dbobj->validatePost(array("mid"));
if ($isValidPost) {
    $connection = $dbobj->getDB();
    $epost = $dbobj->escapePost(array("mid"), $connection);
    $get_query = "SELECT id,thread,catid,time,modified_time,subject from rnbje_kunena_messages WHERE id='{$epost["mid"]}'";
    $get_res = mysqli_query($connection, $get_query);
    $ids = array();
    while ($row = mysqli_fetch_assoc($get_res)) {
        $ids[] = $row["id"];
        $tid = $row["thread"];
        $cid = $row["catid"];
        $time[] = $row["time"];
        $mtime[] = $row["modified_time"];
        $sub[] = json_encode($row["subject"]);
    }
    $len = count($ids);
    $attachments = array();
    for ($i = 0; $i < $len; $i++) {
        $attach_query = "SELECT id from rnbje_kunena_attachments WHERE mesid='{$ids[$i]}'";