Ejemplo n.º 1
0
require_once BH_INCLUDE_PATH . 'thread.inc.php';
require_once BH_INCLUDE_PATH . 'threads.inc.php';
require_once BH_INCLUDE_PATH . 'user.inc.php';
require_once BH_INCLUDE_PATH . 'user_rel.inc.php';
require_once BH_INCLUDE_PATH . 'word_filter.inc.php';
// Check we're logged in correctly
if (!session::logged_in()) {
    html_guest_error();
}
$error_msg_array = array();
if (isset($_POST['save'])) {
    $valid = true;
    if (isset($_POST['set_interest']) && is_array($_POST['set_interest'])) {
        foreach ($_POST['set_interest'] as $thread) {
            if ($valid && is_numeric($thread)) {
                if (!thread_set_interest($thread, 0)) {
                    $thread_title = thread_get_title($thread);
                    $error_msg_array[] = sprintf(gettext("Could not update interest on thread '%s'"), $thread_title);
                    $valid = false;
                }
            }
        }
        if ($valid) {
            header_redirect("edit_subscriptions.php?webtag={$webtag}&updated=true");
            exit;
        }
    }
}
if (isset($_GET['page']) && is_numeric($_GET['page'])) {
    $page = $_GET['page'];
} else {
Ejemplo n.º 2
0
 $valid = true;
 if (isset($_POST['markasread']) && is_numeric($_POST['markasread'])) {
     if (in_range($_POST['markasread'], 0, $thread_data['LENGTH'])) {
         $thread_data['LAST_READ'] = $_POST['markasread'];
         if (!messages_set_read($tid, $thread_data['LAST_READ'], $thread_data['MODIFIED'])) {
             $error_msg_array[] = gettext("Failed to update thread read status");
             $valid = false;
         }
     } else {
         $error_msg_array[] = gettext("Failed to update thread read status");
         $valid = false;
     }
 }
 if (isset($_POST['interest']) && is_numeric($_POST['interest'])) {
     $thread_data['INTEREST'] = $_POST['interest'];
     if (!thread_set_interest($tid, $thread_data['INTEREST'])) {
         $error_msg_array[] = gettext("Failed to update thread interest");
         $valid = false;
     }
 }
 // Admin Options
 if (session::check_perm(USER_PERM_FOLDER_MODERATE, $fid) || $thread_data['BY_UID'] == $uid && $thread_data['ADMIN_LOCK'] != THREAD_ADMIN_LOCK_ENABLED && forum_get_setting('allow_post_editing', 'Y') && (intval(forum_get_setting('post_edit_time', null, 0)) == 0 || time() - $thread_data['CREATED'] < intval(forum_get_setting('post_edit_time', null, 0) * MINUTE_IN_SECONDS))) {
     if (isset($_POST['rename']) && strlen(trim($_POST['rename'])) > 0) {
         $t_rename = trim($_POST['rename']);
         if ($t_rename !== trim($thread_data['TITLE'])) {
             if (thread_change_title($tid, $t_rename)) {
                 post_add_edit_text($tid, 1);
                 if (session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
                     admin_add_log_entry(RENAME_THREAD, array($tid, $thread_data['TITLE'], $t_rename));
                 }
             } else {