header_redirect("lthread_list.php?webtag={$webtag}&mode={$mode}&folder={$folder}&mark_read_success=true");
                            exit;
                        } else {
                            $error_msg_array[] = gettext("Failed to mark selected threads as read");
                            $valid = false;
                        }
                    } else {
                        if ($_REQUEST['mark_read_type'] == THREAD_MARK_READ_FOLDER && (isset($folder) && is_numeric($folder))) {
                            if (threads_mark_folder_read($folder)) {
                                header_redirect("lthread_list.php?webtag={$webtag}&mode={$mode}&folder={$folder}&mark_read_success=true");
                                exit;
                            } else {
                                $error_msg_array[] = gettext("Failed to mark selected threads as read");
                                $valid = false;
                            }
                        }
                    }
                }
            }
        } else {
            unset($_REQUEST['mark_read_submit'], $_REQUEST['mark_read_confirm']);
            light_html_draw_top();
            light_html_display_msg(gettext("Confirm"), gettext("Are you sure you want to mark the selected threads as read?"), 'lthread_list.php', 'post', array('mark_read_submit' => gettext("Confirm"), 'cancel' => gettext("Cancel")), array_merge($_REQUEST, array('mark_read_confirm' => 'Y')));
            light_html_draw_bottom();
            exit;
        }
    }
}
light_html_draw_top();
light_draw_thread_list($mode, $folder, $start_from);
light_html_draw_bottom();
                    } else {
                        if ($_REQUEST['mark_read_type'] == THREAD_MARK_READ_FOLDER && (isset($folder) && is_numeric($folder))) {
                            if (threads_mark_folder_read($folder)) {
                                header_redirect("lthread_list.php?webtag={$webtag}&mode={$mode}&folder={$folder}&mark_read_success=true");
                                exit;
                            } else {
                                $error_msg_array[] = gettext("Failed to mark selected threads as read");
                                $valid = false;
                            }
                        }
                    }
                }
            }
        } else {
            unset($_REQUEST['mark_read_submit'], $_REQUEST['mark_read_confirm']);
            light_html_draw_top();
            light_navigation_bar();
            light_html_display_msg(gettext("Confirm"), gettext("Are you sure you want to mark the selected threads as read?"), 'lthread_list.php', 'post', array('mark_read_submit' => gettext("Confirm"), 'cancel' => gettext("Cancel")), array_merge($_REQUEST, array('mark_read_confirm' => 'Y')));
            light_html_draw_bottom();
            exit;
        }
    }
}
light_html_draw_top(array('js' => array('js/thread_list.js')));
if (forums_get_available_count() > 1 || !forum_get_default()) {
    light_navigation_bar(array('back' => "lforums.php?webtag={$webtag}", 'nav_links' => array(array('text' => gettext('New Discussion'), 'url' => "lpost.php?webtag={$webtag}", 'class' => 'post_new', 'image' => 'mobile_post'))));
} else {
    light_navigation_bar(array('nav_links' => array(array('text' => gettext('New Discussion'), 'url' => "lpost.php?webtag={$webtag}", 'class' => 'post_new', 'image' => 'mobile_post'))));
}
light_draw_thread_list($mode, $folder, $page);
light_html_draw_bottom();