Example #1
0
     if (!($r = sql_query($sql))) {
         forumerror('0001');
     }
     $sql = "UPDATE " . $NPDS_Prefix . "forumtopics SET topic_title = '{$subject}', topic_time = '" . date("Y-m-d H:i:s", time() + $gmt * 3600) . "', current_poster='" . $userdata['uid'] . "' WHERE topic_id = '" . $row['topic_id'] . "'";
     if (!($result = sql_query($sql))) {
         forumerror('0020');
     }
     redirect_url("{$hrefX}?topic=" . $row['topic_id'] . "&forum={$forum}");
 } else {
     $indice = sql_num_rows(sql_query("select post_id from " . $NPDS_Prefix . "posts where post_idH='{$post_id}'"));
     if (!$indice) {
         $sql = "DELETE FROM " . $NPDS_Prefix . "posts WHERE post_id='{$post_id}'";
         if (!($r = sql_query($sql))) {
             forumerror('0001');
         }
         control_efface_post("forum_npds", $post_id, "", "");
         if (get_total_posts($forum, $row['topic_id'], "topic", $Mmod) == 0) {
             $sql = "DELETE FROM " . $NPDS_Prefix . "forumtopics WHERE topic_id = '" . $row['topic_id'] . "'";
             if (!($r = sql_query($sql))) {
                 forumerror('0001');
             }
             $sql = "DELETE FROM " . $NPDS_Prefix . "forum_read WHERE topicid = '" . $row['topic_id'] . "'";
             @sql_query($sql);
             redirect_url("viewforum.php?forum={$forum}");
             die;
         } else {
             $result = sql_query("SELECT post_time, poster_id FROM " . $NPDS_Prefix . "posts where topic_id='" . $row['topic_id'] . "' ORDER BY post_id DESC limit 0,1");
             $rowX = sql_fetch_row($result);
             $sql = "UPDATE " . $NPDS_Prefix . "forumtopics SET topic_time = '{$rowX['0']}', current_poster='{$rowX['1']}' WHERE topic_id = '" . $row['topic_id'] . "'";
             if (!($r = sql_query($sql))) {
                 forumerror('0001');
Example #2
0
function ForumMaintTopicSup($topic)
{
    global $NPDS_Prefix;
    $sql = "DELETE FROM " . $NPDS_Prefix . "posts WHERE topic_id = '{$topic}'";
    if (!($result = sql_query($sql))) {
        forumerror('0009');
    }
    $sql = "DELETE FROM " . $NPDS_Prefix . "forumtopics WHERE topic_id = '{$topic}'";
    if (!($result = sql_query($sql))) {
        forumerror('0010');
    }
    $sql = "DELETE FROM " . $NPDS_Prefix . "forum_read WHERE topicid = '{$topic}'";
    if (!($r = sql_query($sql))) {
        forumerror('0001');
    }
    sql_free_result;
    control_efface_post("forum_npds", "", $topic, "");
    Q_Clean();
    header("location: admin.php?op=MaintForumTopics");
}
Example #3
0
     include "footer.php";
     break;
 case 'del':
     $sql = "DELETE FROM " . $NPDS_Prefix . "posts WHERE topic_id='{$topic}' and forum_id='{$forum}'";
     if (!($result = sql_query($sql))) {
         forumerror('0009');
     }
     $sql = "DELETE FROM " . $NPDS_Prefix . "forumtopics WHERE topic_id='{$topic}'";
     if (!($result = sql_query($sql))) {
         forumerror('0010');
     }
     $sql = "DELETE FROM " . $NPDS_Prefix . "forum_read where topicid='{$topic}'";
     if (!($r = sql_query($sql))) {
         forumerror('0001');
     }
     control_efface_post("forum_npds", "", $topic, "");
     header("location: viewforum.php?forum={$forum}");
     break;
 case 'lock':
     $sql = "UPDATE " . $NPDS_Prefix . "forumtopics SET topic_status=1 WHERE topic_id='{$topic}'";
     if (!($r = sql_query($sql))) {
         forumerror('0011');
     }
     header("location: {$url_ret}?topic={$topic}&forum={$forum}");
     break;
 case 'unlock':
     $topic_title = "";
     $sql = "SELECT topic_title FROM " . $NPDS_Prefix . "forumtopics WHERE topic_id = '{$topic}'";
     $r = sql_fetch_assoc(sql_query($sql));
     $topic_title = str_replace("[" . translate("Solved") . "] - ", "", $r['topic_title']);
     $sql = "UPDATE " . $NPDS_Prefix . "forumtopics SET topic_status = '0', topic_first='1', topic_title='" . addslashes($topic_title) . "' WHERE topic_id = '{$topic}'";
Example #4
0
function ForumGoDel($forum_id, $ok = 0)
{
    global $hlpfile;
    global $NPDS_Prefix;
    if ($ok == 1) {
        sql_query("DELETE FROM " . $NPDS_Prefix . "forumtopics WHERE forum_id='{$forum_id}'");
        sql_query("DELETE FROM " . $NPDS_Prefix . "forum_read WHERE forum_id='{$forum_id}'");
        control_efface_post("forum_npds", "", "", $forum_id);
        sql_query("DELETE FROM " . $NPDS_Prefix . "forums WHERE forum_id='{$forum_id}'");
        Q_Clean();
        global $aid;
        Ecr_Log("security", "DeleteForum({$forum_id}) by AID : {$aid}", "");
        Header("Location: admin.php?op=ForumAdmin");
    } else {
        include "header.php";
        GraphicAdmin($hlpfile);
        opentable();
        echo "<p align=\"center\" class=\"rouge\"><b>" . adm_translate("ATTENTION :  ĂȘtes-vous certain de vouloir effacer ce Forum et tous ses Sujets ?") . "</b><br /><br />";
    }
    echo "[ <a href=\"admin.php?op=ForumGoDel&amp;forum_id={$forum_id}&amp;ok=1\" class=\"rouge\">" . adm_translate("Oui") . "</a> | <a href=\"admin.php?op=ForumAdmin\" class=\"noir\">" . adm_translate("Non") . "</a> ]<br /><br />";
    closetable();
    include "footer.php";
}