Adding To The Moderator Bar?

jor956

Active member
I would like to add something to the moderator bar that shows the number next to it (like on reported items) of how many new threads are in a specific forum. Any idea how to do this? This is the current Moderator bar template:
Code:
            <xen:if is="{$visitor.is_admin}">
                <a href="admin.php" class="acp adminLink"><span class="itemLabel">{xen:phrase admin_control_panel}</span></a>

                <xen:if is="{$session.permissionTest}">
                    <a href="{xen:link misc/reset-permissions}" class="permissionTest adminLink OverlayTrigger">
                        <span class="itemLabel">{xen:phrase permissions_from_x, 'name={$session.permissionTest.username}'}</span>
                    </a>
                </xen:if>
            </xen:if>

            <xen:if is="{$visitor.is_moderator}">
                <a href="{xen:link moderation-queue}" class="moderationQueue modLink">
                    <span class="itemLabel">{xen:phrase moderation_queue}:</span>
                    <span class="itemCount {xen:if {$session.moderationCounts.total}, 'alert'}">{$session.moderationCounts.total}</span>
                </a>

                <a href="{xen:link reports}" class="reportedItems modLink">
                    <span class="itemLabel">{xen:phrase reported_items}:</span>
                    <span class="itemCount {xen:if {$session.reportCounts.total}, 'alert'}">{$session.reportCounts.total}</span>
                </a>
            </xen:if>

            <xen:hook name="moderator_bar" />

All I really need to do is find out how to do the alert number, any ideas?
 
My question was how do I add an "itemCount" to show how many new threads are in a specific sub-forum?

Unless someone comes up with an easier way to do this, I would say as follows:

  • A model file that has a function that queries the database for the count of threads within x node
  • Listener that listens to template hooks
  • Listener file that looks for the "moderator_bar" template hook (As stated by ragtek above) and adds the count (from your function) to your template along with whatever html you need. Either that or you could create a template which you would send the count variable to that you would then include within the moderator_bar template via the hook. This way your html for it would be editable via your new template rather than being hard coded.
 
Unless someone comes up with an easier way to do this, I would say as follows:

  • A model file that has a function that queries the database for the count of threads within x node
  • Listener that listens to template hooks
  • Listener file that looks for the "moderator_bar" template hook (As stated by ragtek above) and adds the count (from your function) to your template along with whatever html you need. Either that or you could create a template which you would send the count variable to that you would then include within the moderator_bar template via the hook. This way your html for it would be editable via your new template rather than being hard coded.
Sounds way too hard :P I give up.
 
Sure :p If you need my URL it's "http://www.team-mc.net"

OK have have this working, however its a messy modification at the moment (hard coded forum ID). May play about with it and release at some point, however if you would like it before hand I will post it up here.

Just to ask, Im guessing this is for a staff area? Just asking as Im gonna use this myself for my mod room LOL
 
Top Bottom