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)

BirdOPrey5 02-12-2011 10:23 PM

I do believe that is possible, in fact it is exactly what I do on my vb 3.8 forum with this mod installed...

You need a collection of icons that have file names like 2.png, 3.png, 4.png, etc... basically ForumID#.png for each forum id you have...in this example in your misc images directory but you could make it anywhere you want.

Then manually edit the threadbit template... Find a suitable location and add the code:
Code:

<img src="images/misc/{vb raw thread.forumid}.png" border="0" />
I'm not able to test it right now but I think it should work.

You can add a conditional too so if the $thread[forumid] equals $forum[forumid] you don't show any icon at all. (Because the thread is from the same forum you are viewing).

COL NIL SATIS 02-13-2011 03:09 PM

tagged,will install later ..many thanks

Jennifer2010 04-19-2011 08:55 PM

I'm having a weird issue with this mod.

Running on 4.1.2 patch 1

Threads displayed in master forum will only display as many threads as there are in the master forum. In other words, if there's 50 threads in the master forum, and 200 in a sub forum, it will still only show 50 threads in the master forum. It will still show sub-forum threads, but it will remove threads based on what I believe to be the last time they had activity. The missing threads from one of my sub-forums we're the oldest ones. I replied to them and then they would show up again in the master forum, which the total thread count stayed the same - so I assumed other threads were then gone missing.

Would really appreciate some help. Maybe I'm doing something wrong? :(

Thank you!

BirdOPrey5 04-19-2011 11:07 PM

I see the issue, it is indeed a bug. I will work on a fix and post back soon.

Alan_SP 04-19-2011 11:33 PM

Is it possible to designate one master forum to hold all forums? Something like:

76|all
or
76|0

And does this respect usergroup permissions to view certain forums, i.e. if forum is invisible to this usergroup, would thread from this forum also be invisible?

BirdOPrey5 04-20-2011 01:02 AM

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.

BirdOPrey5 04-20-2011 01:07 AM

Quote:

Originally Posted by Alan_SP (Post 2186473)
Is it possible to designate one master forum to hold all forums? Something like:

76|all
or
76|0

And does this respect usergroup permissions to view certain forums, i.e. if forum is invisible to this usergroup, would thread from this forum also be invisible?

I have added the "all" feature to the latest version 2.1. You would use * to do all forums, so from your example:

76|*

As for usergroup permissions, users will see the thread title for every thread in every forum, but they will get a permission denied error if they try to view a thread from a forum they don't have permission to view.

Jennifer2010 04-20-2011 09:14 AM

Wow, awesome job on the super quick update! Thank you so much!

Installed now and works great :)

Some bugs to note though:

- On top of all of my forums above my header in the upper left, the forum #'s are displayed and pushes the header down.
https://vborg.vbsupport.ru/external/2011/04/23.jpg

- There also seems to be an intermediary blank white page with the forum #'s in the same place before going into a forum, which loads for 1 or 2 seconds before it hits the actual forum

Thank you!

BirdOPrey5 04-20-2011 11:21 AM

Oh whoops. :o That's what I get for updating the software on 0 hours sleep. That's likely responsible for both issues.

I left a debug line of code in there. I have commented it out and re-uploaded the file. Same version number, please re-import the new version above OR you can manually delete the 1 line....

In the plugin All Topic Forumdisplay Thread Count find the line:
PHP Code:

echo $alltopics 

and erase it.

Jennifer2010 04-20-2011 11:39 AM

That worked like a charm! Thank you so much for your hard work!


All times are GMT. The time now is 12: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.01347 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
  • (3)bbcode_php_printable
  • (1)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