Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Code for New Posts in sub categories

Quote Reply
Code for New Posts in sub categories
Hi,
I've just been looking at the code in "category_list.html" that is used to indicate if there is a new message in a sub category :

<% if forum_new > 0%>
<font color="red"><small><br><b><%forum_new%>&nbsp;NEW<br></b></small></font>
<% endif%>

Is there a similar function for the parent category that this subcategory is part of to indicate if there are new messages when people collapse the sub-parts ?

John
Significant Media
Quote Reply
Re: [Jag] Code for New Posts in sub categories In reply to
Hi,

No, <%forum_new%> is a count of new posts in a forum. I don't believe the category has any such tag (you can do a <%GT::Template::dump%> to confirm).

You could create a global pretty easily that would just go through the main loop and update the category hash if it has forums that are new. This might be worthwhile adding to Gossamer Forum itself. The only tricky thing is that you don't have counts if the forum is not going to be displayed(i.e. the menu is collapsed -- this is to speed things up).

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Code for New Posts in sub categories In reply to
Alex,
I was just looking at this again and as you say one of the issues is that there can be users that collapse certain sub categories and this was my motivation to indicate in the collapsed bar that there were new messages below. If I understand you, when the sub categories are collapsed then the loop will not take messages in that area into account ?

Thanks

John
Significant Media
Quote Reply
Re: [Jag] Code for New Posts in sub categories In reply to
Correct. Gossamer Forum know which forums it will need to display on the home page, and so for performance reasons, only calculates counts, and new posts counts for forums it is going to end up showing. If a category is collapsed, Gossamer Forum will not look at forums inside that category.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Code for New Posts in sub categories In reply to
Has anyone tried to do this? I'd be interested in this function as well. We have a bunch of forums and have to have some collapsed so the category view isn't to big...yet folks seem to miss the forums not immediately visible to them. This should help.

I'm not a programmer, so I need some help from the field. Any takers?

Dave