Developing a New Sub-Forums Hack

Dragonfly issues as they relate to modules discussed here
  
11 Aug '14 Mon Aug 11, 2014 22:04    
layingback
Site Admin  
  •  

Post Developing a New Sub-Forums Hack

Have just finished the code for a new hack to Forums (latest version with sub-Forums, but would probably work with earlier version if the now deprecated ForumsPlus was already installed.)

The attached image should show how it works.

Sub-Forums are useful on a site with lots of forums, to keep the initial (top-level) list of forums manageable. But it still means a lot of forums to hunt through to follow new posts.

In my case I had a series of similar Forums for posting pictures of Macro photography, Mono, Wildlife, Studio, etc. pentaxdslr.eu/Forums/ Crying out to be collapsed into a set of sub-forums. But while some members were happy reading posts by dub-forum, others just wanted to see all the images in a single forum.

Well I think I've found a best-of-both-worlds compromise:

If a top level forum is empty (of its own topics) but has 1 or more sub-forums, then all sub-forum topics are displayed in the top level forums as if there were no sub-forums.

You still post via the sub-forums; you can still read via the individual sub-forums; or you can read via the top-level forum.

The no-posting to the top-level forum is achieved by simply setting Post permissions for that forum to ADMIN.

Changes, which are all to viewforum.php and viewforum_body.html, consist of basically duplicating the existing code to (re-)read the topics of the combined forum and sub-forums when no forum topics are found. Plus some code to keep track of the source sub-forum and pass it to the template (the hardest bit!). And template changes to hide the NEWTOPIC button if user doesn't have post rights, and to add the source sub-forum field.

If anyone is interested I can upload the files later, after I've gone live and confirmed it all works.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
19 Aug '14 Tue Aug 19, 2014 14:32    
layingback
Site Admin  
  •  

Post Re: Developing a New Sub-Forums Hack

It's in place now if anyone wants to take a look http://pentaxdslr.eu/Forums/viewforum/f=73/

The 2 warning lines in red are temp changes only to the template, until everyone gets used to it.

For consistency all the forums are set to operate the same way, but they could be mix-and-matched.

It triggers if and only if there are 0 (non-Announcement) posts in the top level thread. As implemented it operates only on 2-level sub forums (not tri-level ones), and ignores remote sub-forums (which it has to really).

Code can be made available if requested - not a very big change and pretty well localised.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
Link  QR 
Share this Printer Friendly Page  facebook   google+   linkedin   twitthis  
Show more ...



Forum Permissions - You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum