Example #1
0
$min_id = 0;
$rows = NULL;
$bodies_in_list = isset($PHORUM['TMP']['bodies_in_list']) && $PHORUM['TMP']['bodies_in_list'];
if ($PHORUM['cache_messages'] && (!$PHORUM['DATA']['LOGGEDIN'] || $PHORUM['use_cookies']) && !$PHORUM['count_views']) {
    $cache_key = $PHORUM['forum_id'] . "-" . $PHORUM['cache_version'] . "-" . $page . "-";
    $cache_key .= $PHORUM['threaded_list'] . "-" . $PHORUM['threaded_read'] . "-" . $PHORUM["language"];
    $cache_key .= "-" . $PHORUM["count_views"] . "-" . ($bodies_in_list ? "1" : "0") . "-" . $PHORUM['float_to_top'];
    $cache_key .= "-" . $PHORUM['user']['tz_offset'];
    $rows = phorum_cache_get('message_list', $cache_key);
}
if ($rows == null) {
    //timing_mark('before db');
    // Get the threads
    $rows = array();
    // get the thread set started
    $rows = phorum_db_get_thread_list($offset, $bodies_in_list);
    //timing_mark('after db');
    // redirect if invalid page
    if (count($rows) < 1 && $offset > 0) {
        $dest_url = phorum_get_url(PHORUM_LIST_URL);
        phorum_redirect_by_url($dest_url);
        exit;
    }
    if ($PHORUM["threaded_list"]) {
        // prepare needed url-templates
        $read_url_template = phorum_get_url(PHORUM_READ_URL, '%thread_id%', '%message_id%');
        // loop through and read all the data in.
        foreach ($rows as $key => $row) {
            if ($PHORUM["count_views"]) {
                // show viewcount if enabled
                if ($PHORUM["count_views"] == 2) {
Example #2
0
 $forums = phorum_db_get_forums();
 // shouldn't be needed but just in case ...
 $old_forum_id = $PHORUM['forum_id'];
 // initialize some variables
 $PHORUM["float_to_top"] = 0;
 $PHORUM["threaded_list"] = 0;
 $PHORUM['list_length_flat'] = 100;
 $threads_updated = 0;
 foreach ($forums as $fid => $fdata) {
     if ($fdata['folder_flag'] == 0) {
         $PHORUM['forum_id'] = $fid;
         $PHORUM['vroot'] = $fdata['vroot'];
         $offset = 0;
         while ($offset < $fdata['thread_count']) {
             $curpage = $offset / 100;
             $threads = phorum_db_get_thread_list($curpage);
             $num_threads = count($threads);
             if ($num_threads) {
                 foreach ($threads as $tid => $tdata) {
                     phorum_update_thread_info($tid);
                 }
                 $threads_updated += $num_threads;
                 // if we got less messages, we can jump out - last page hopefully
                 if ($num_threads < 100) {
                     break;
                 }
             }
             $offset += 100;
         }
         $forums_updated++;
     }
Example #3
0
    $modforums=0;
    foreach($forums as $id=>$forum){
        if($forum["folder_flag"]==0 && phorum_user_moderate_allowed($id)){
            $modforums++;
        }
        if($modforums > 1) {
            $build_move_url=true;
            break;
        }
    }
}
// Get the threads
$rows = array();

// get the thread set started
$rows = phorum_db_get_thread_list($offset);

// redirect if invalid page
if(count($rows) < 1 && $offset > 0){
    $dest_url = phorum_get_url(PHORUM_LIST_URL);
    phorum_redirect_by_url($dest_url);
    exit();
}

if($PHORUM['threaded_list']) { // make it simpler :)
    $PHORUM["list_length"] = $PHORUM['list_length_threaded'];
} else {
    $PHORUM["list_length"] = $PHORUM['list_length_flat'];
}

// Figure out paging for threaded and flat mode. Sticky messages