1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding To The Moderator Bar?

Discussion in 'Styling and Customization Questions' started by jor956, Jun 11, 2011.

  1. jor956

    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?
     
  2. ragtek

    ragtek Guest

    Use the moderator_bar template hook!
     
  3. jor956

    jor956 Active Member

    My question was how do I add an "itemCount" to show how many new threads are in a specific sub-forum?
     
  4. Marc

    Marc Well-Known Member

    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.
     
  5. jor956

    jor956 Active Member

    Sounds way too hard :p I give up.
     
  6. Marc

    Marc Well-Known Member

    Not at all .. Have you done any PHP before? If so Im more than happy to point you in the right direction
     
  7. jor956

    jor956 Active Member

    No, I haven't really done any PHP :p In fact I don't even know how I would make the model file or queries..
     
  8. Marc

    Marc Well-Known Member

    LOL .. okais .... Will see if I can sort you something later tonight
     
  9. jor956

    jor956 Active Member

    Ok, thanks for the help :D
     
  10. Marc

    Marc Well-Known Member

    Need to work out how to find out x new threads first so bare with me LOL
     
  11. jor956

    jor956 Active Member

    Sure :p If you need my URL it's "http://www.team-mc.net"
     
  12. Marc

    Marc Well-Known Member

    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
     
  13. Marc

    Marc Well-Known Member

  14. jor956

    jor956 Active Member

  15. Marc

    Marc Well-Known Member

    No problem ... was a good idea :)
     

Share This Page