public function set_modActions()
{
global $locale;
if (!isset($_GET['rowstart'])) {
$_GET['rowstart'] = 0;
}
if (isset($_POST['step']) && $_POST['step'] != "") {
$_GET['step'] = $_POST['step'];
}
$_GET['step'] = isset($_GET['step']) && in_array($_GET['step'], $this->allowed_actions) ? $_GET['step'] : '';
$_GET['error'] = isset($_GET['error']) ? $_GET['error'] : '';
if ($this->thread_id && !$this->forum_id) {
$forum_id_data = dbarray(dbquery("SELECT forum_id FROM " . DB_FORUM_THREADS . " WHERE thread_id='" . $this->thread_id . "'"));
$this->forum_id = $forum_id_data['forum_id'];
}
$this->form_action = INFUSIONS . "forum/viewthread.php?forum_id=" . $this->forum_id . "&thread_id=" . $this->thread_id . "&rowstart=" . $_GET['rowstart'];
// get forum parents
$branch_data = dbarray(dbquery("SELECT forum_cat, forum_branch FROM " . DB_FORUMS . " WHERE forum_id='" . $this->forum_id . "'"));
$this->parent_id = $branch_data['forum_cat'];
$this->branch_id = $branch_data['forum_branch'];
// at any time when cancel is clicked, redirect to forum id.
if (isset($_POST['cancelDelete'])) {
redirect("viewthread.php?thread_id=" . intval($this->thread_id));
}
/**
* Thread actions
*/
switch ($_GET['step']) {
case 'renew':
self::mod_renew_thread();
break;
case 'delete':
self::mod_delete_thread();
break;
case 'lock':
self::mod_lock_thread();
break;
case 'unlock':
self::mod_unlock_thread();
break;
case 'sticky':
self::mod_sticky_thread();
break;
case 'nonsticky':
self::mod_nonsticky_thread();
break;
case 'move':
self::mod_move_thread();
break;
}
$message = '';
switch ($_GET['error']) {
case '1':
$message = $locale['error-MP001'];
break;
case '2':
$message = $locale['error-MP002'];
break;
case '3':
$message = $locale['error-MP003'];
break;
}
if ($message != "") {
opentable($locale['error-MP000']);
echo "<div id='close-message'><div class='admin-message'>" . $message . "<br /><br />\n";
echo "<a href='" . INFUSIONS . "forum/viewthread.php?thread_id=" . intval($this->thread_id) . "&rowstart=" . $_GET['rowstart'] . "'>" . $locale['forum_0309'] . "</a><br />";
echo "</div></div>\n";
closetable();
}
// Delete Posts
self::mod_delete_posts();
// Move Posts
self::mod_move_posts();
}