$return = 0; } else { $numRows = $countRes; $rP = $numRows / $viewmaxtopic; $rPInt = floor($numRows / $viewmaxtopic); $return = $rPInt; if ($rP == $rPInt) { $return -= 1; } } db_delete($Ts, 'topic_id', '=', $topic); $topicsDel = db_delete($Tt, 'topic_id', '=', $topic, 'forum_id', '=', $forum); $postsDel = db_delete($Tp, 'topic_id', '=', $topic, 'forum_id', '=', $forum); $postsDel--; db_forumReplies($forum, $Tp, $Tf); db_forumTopics($forum, $Tt, $Tf); //fire event require_once 'geograph/event.class.php'; new Event(EVENT_DELTOPIC, $topic); if (isset($metaLocation)) { $meta_relocate = "{$main_url}/{$indexphp}action=vtopic&forum={$forum}&page={$return}&h={$h}"; echo ParseTpl(makeUp($metaLocation)); exit; } else { header("Location: {$main_url}/{$indexphp}action=vtopic&forum={$forum}&page={$return}&h={$h}"); exit; } } else { $errorMSG = $l_forbidden; $correctErr = ''; echo load_header();
$RES1 = $result; $CNT1 = $countRes; if ($lp = db_simpleSelect(0, $Tp, 'post_id', 'topic_id', '=', $topic_id, 'post_id DESC', 1)) { $topic_last_post_id = $lp[0]; $fs = updateArray(array('topic_last_post_id'), $Tt, 'topic_id', $topic_id); $aff += $fs; } $result = $RES1; $countRes = $CNT1; } while ($rrr = db_simpleSelect(1)); } /* Update forums posts, topics amount */ if ($res = db_simpleSelect(0, $Tf, 'forum_id')) { do { db_forumReplies($res[0], $Tp, $Tf); db_forumTopics($res[0], $Tt, $Tf); } while ($res = db_simpleSelect(1)); } if ($aff > 0) { $warning .= "<br>" . $l_userMsgsDeleted; } else { $warning .= "<br>" . $l_userMsgsNotDeleted; } } else { /*Make user posts as anonymous*/ $aff = 0; $poster_id = 0; $topic_poster = 0; $aff += updateArray(array('poster_id'), $Tp, 'poster_id', $userID); $aff += updateArray(array('topic_poster'), $Tt, 'topic_poster', $userID); if ($aff > 0) {