<?php // $Revision: 1.7 $
/* vim: set expandtab ts=4 sw=4 sts=4: */
/**
* $Id: deletepost.php,v 1.7 2003/11/22 03:43:38 madbear Exp $
*
* Copyright (c) 2003 by the NetOffice developers
*
* 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.
*/
$checkSession = true;
require_once("../includes/library.php");
$tmpquery = "WHERE topic.id = '$topic'";
$detailTopic = new request();
$detailTopic->openTopics($tmpquery);
if ($action == "delete") {
$detailTopic->top_posts[0] = $detailTopic->top_posts[0] - 1;
$tmpquery = "DELETE FROM " . $tableCollab["posts"] . " WHERE id = '$id'";
connectSql("$tmpquery");
$tmpquery2 = "UPDATE " . $tableCollab["topics"] . " SET posts='" . $detailTopic->top_posts[0] . "' WHERE id = '$topic'";
connectSql("$tmpquery2");
header("Location: ../topics/viewtopic.php?msg=delete&id=$topic");
exit;
}
$tmpquery = "WHERE pos.id = '$id'";
$detailPost = new request();
$detailPost->openPosts($tmpquery);
require_once("../themes/" . THEME . "/header.php");
$blockPage = new block();
$blockPage->openBreadcrumbs();
$blockPage->itemBreadcrumbs($blockPage->buildLink("../projects/listprojects.php?", $strings["projects"], in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../projects/viewproject.php?id=" . $detailTopic->top_pro_id[0], $detailTopic->top_pro_name[0], in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../topics/listtopics.php?topic=" . $detailTopic->top_id[0], $strings["discussion"], in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../topics/viewtopic.php?id=" . $detailTopic->top_id[0], $detailTopic->top_subject[0], in));
$blockPage->itemBreadcrumbs($strings["delete_messages"]);
$blockPage->closeBreadcrumbs();
if ($msg != "") {
require_once("../includes/messages.php");
$blockPage->messagebox($msgLabel);
}
$block1 = new block();
$block1->form = "saP";
$block1->openForm("../topics/deletepost.php?id=$id&topic=$topic&action=delete");
$block1->heading($strings["delete_messages"]);
$block1->openContent();
$block1->contentTitle($strings["delete_following"]);
echo "<tr class=\"odd\"><td valign=\"top\" class=\"leftvalue\"> </td><td>" . nl2br($detailPost->pos_message[0]) . "</td>
<tr class=\"odd\"><td valign=\"top\" class=\"leftvalue\"> </td><td><input type=\"submit\" name=\"delete\" value=\"" . $strings["delete"] . "\"> <input type=\"button\" name=\"cancel\" value=\"" . $strings["cancel"] . "\" onClick=\"history.back();\"></td></tr>";
$block1->closeContent();
$block1->closeForm();
require_once("../themes/" . THEME . "/footer.php");
?>