vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Forum Display Enhancements - All Topic - Master Forums - Shows threads from multiple forums in one forum (https://vborg.vbsupport.ru/showthread.php?t=245839)

Nik S 06-16-2011 04:44 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2204547)
Forum names will now be linked. :)

Works great, thanks! :up:

8thos 06-18-2011 04:11 AM

Wow...

8thos 06-18-2011 05:23 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2186502)
Version 2.1 Released

Full instructions in .zip file...

But basically there is now a required manual file edit- there is no way around this in order to get the thread count correct for master forums.

As Jennifer2010 pointed out the master forum would only count as many threads as were originally in the forum. This is especially an issue when the master forum contains very few threads and the slave forums contain many more threads. No page numbers (or not enough) will be produced.

The fix requires deleting 1 line from your forumdisplay.php file.

At approximately line 761 you will find this code:
PHP Code:

    ($hook vBulletinHook::fetch_hook('forumdisplay_query_threadscount')) ? eval($hook) : false;

    
# Include visible IN (0,1,2) in order to hit upon the 4 column index
    
$threadscount $db->query_first_slave("
      SELECT COUNT(*) AS threads,
      (
       SELECT COUNT(*) AS newthread
       FROM " 
TABLE_PREFIX "thread AS thread
       WHERE forumid = 
$foruminfo[forumid]
        AND lastpost > 
$lastread
        AND open <> 10
        AND sticky = 0
        
$prefix_filter
        
$visiblethreads
        
$globalignore
        
$limitothers
        
$datecut
        
$hook_query_where     
      ) AS newthread
        
$hook_query_fields
        FROM " 
TABLE_PREFIX "thread AS thread
        
$tachyjoin
        
$hook_query_joins
        WHERE forumid = 
$foruminfo[forumid]
            AND sticky = 0
            
$prefix_filter
            
$visiblethreads
            
$globalignore
            
$limitothers
            
$datecut
            
$hook_query_where
    "
);
    
$totalthreads $threadscount['threads'];
    
$newthreads $threadscount['newthread']; 

You must delete the 1st instance of: $hook_query_where

So your final code should look like:
PHP Code:

    ($hook vBulletinHook::fetch_hook('forumdisplay_query_threadscount')) ? eval($hook) : false;

    
# Include visible IN (0,1,2) in order to hit upon the 4 column index
    
$threadscount $db->query_first_slave("
      SELECT COUNT(*) AS threads,
      (
       SELECT COUNT(*) AS newthread
       FROM " 
TABLE_PREFIX "thread AS thread
       WHERE forumid = 
$foruminfo[forumid]
        AND lastpost > 
$lastread
        AND open <> 10
        AND sticky = 0
        
$prefix_filter
        
$visiblethreads
        
$globalignore
        
$limitothers
        
$datecut
 
      ) AS newthread
        
$hook_query_fields
        FROM " 
TABLE_PREFIX "thread AS thread
        
$tachyjoin
        
$hook_query_joins
        WHERE forumid = 
$foruminfo[forumid]
            AND sticky = 0
            
$prefix_filter
            
$visiblethreads
            
$globalignore
            
$limitothers
            
$datecut
            
$hook_query_where
    "
);
    
$totalthreads $threadscount['threads'];
    
$newthreads $threadscount['newthread']; 

Save the file and replace your forumdisplay.php file with this one.

Then import/install the new product .xml file version 2.1.

NOTE- You MUST DELETE the entire line, you cannot "comment it out."

Also New in 2.1

You can now use an * to specify "ALL" forums be included in your master forum, such as:
Code:

2|*
Would make a master forum in forum id #2 that contains threads from EVERY forum on your site.

I am running vb4.1.4. This edit killed my forum display. I added the code back and it's fine.

Is there something different with 4.1.4 that's preventing this modification from working?

8thos 06-18-2011 05:46 AM

Okay nevermind, that was because I used Alan SP's version.

I disabled and uninstalled his version.

I used the one in the first post. Running fine now.

kkk333 07-05-2011 09:13 PM

thank you for this amazing mod
but does it cause extra queries ? extra load ? because I want use it in big forum

BirdOPrey5 07-06-2011 12:40 AM

There are no extra queries- it modifies an existing query. There shouldn't be any noticeable extra load.

vbandroid 07-09-2011 02:29 PM

Hey BirdOfPrey, any update on whether you can use prefix instead of forum id to pull threads from forums? or only to a certain prefix from the specified forums?

BirdOPrey5 07-09-2011 11:55 PM

Quote:

Originally Posted by vbandroid (Post 2218521)
Hey BirdOfPrey, any update on whether you can use prefix instead of forum id to pull threads from forums? or only to a certain prefix from the specified forums?

The more I think about it the less I think I could or should integrate that into this mod. It might be possible as a separate mod but not a priority right now.

NovoCiv 07-20-2011 02:53 PM

I'm on 4.0.5 still and the forumdisplay.php edit isn't possible. The original appears as:
Code:

        ($hook = vBulletinHook::fetch_hook('forumdisplay_query_threadscount')) ? eval($hook) : false;

        # Include visible IN (0,1,2) in order to hit upon the 4 column index
        $threadscount = $db->query_first_slave("
                SELECT COUNT(*) AS threads, SUM(IF(thread.lastpost > $lastread AND open <> 10, 1, 0)) AS newthread
                $hook_query_fields
                FROM " . TABLE_PREFIX . "thread AS thread
                $tachyjoin
                $hook_query_joins
                WHERE forumid = $foruminfo[forumid]
                        AND sticky = 0
                        $prefix_filter
                        $visiblethreads
                        $globalignore
                        $limitothers
                        $datecut
                        $hook_query_where
        ");
        $totalthreads = $threadscount['threads'];
        $newthreads = $threadscount['newthread'];

Removing the $hook_query_where causes database errors. I tried replacing the entire section with the "this is what your code should look like" and the forums run fine until I enable the product. When enabled, it causes this error on forumdisplay:

Quote:

vBulletin Message
Unable to add cookies, header already sent.
File: /home/novoci5/public_html/forums/vb/exception/templatefatalerror.php
Line: 67
Is there a way to make this work without upgrading?

BirdOPrey5 07-20-2011 04:06 PM

In 4.0.5 try just using the original forumdisplay.php without any edits at all.


All times are GMT. The time now is 05:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01158 seconds
  • Memory Usage 1,772KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete