1 (edited by Tubby 2006-12-04 08:01)

Topic: Moderator Display

Ahh nevermind sorry to bother you guys i now have it so i might as well share it. Im currently displaying the forum moderators in viewforum.php just before the pagination links rather than taking up more space on index.php smile tell me what you think.

<div id="moderators">
    <div class="box" style="margin-bottom: 12px">
        <div class="inbox" style="margin: 5px">
            <?php if ($cur_forum['moderators'] != '')
    {
        $mods_array = unserialize($cur_forum['moderators']);
        $moderators = array();

        while (list($mod_username, $mod_id) = @each($mods_array))
            $moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';

        $moderators = "\t\t\t\t\t\t\t\t".'<p>'.$lang_common['Moderated by'].': '.implode(', ', $moderators).'</p>'."\n";
    } ?>
    <?php echo $moderators ?>
        </div>
    </div>
</div>

demo may be viewed here: http://www.fatal-gfx.com (look in the announcements forum ( the only forum set up )

Re: Moderator Display

Moved to Modifications

3

Re: Moderator Display

This seams better to me.

فهد

4 (edited by naitkris 2007-02-23 02:41)

Re: Moderator Display

good stuff, except the div tags need not be outputted when there is no moderators on a forum (unless it is wanted by someone to output anyway and have it as "Moderated by: None"), small change to remove displaying the lot is:

<?php if ($cur_forum['moderators'] != '') { ?>
<div id="moderators">
    <div class="box" style="margin-bottom: 12px">
        <div class="inbox" style="margin: 5px">
            <?php
            $mods_array = unserialize($cur_forum['moderators']);
            $moderators = array();

            while (list($mod_username, $mod_id) = @each($mods_array)) {
               $moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';
            }

            $moderators = "\t\t\t\t\t\t\t\t".'<p>'.$lang_common['Moderated by'].': '.implode(', ', $moderators).'</p>'."\n";
            echo $moderators
            ?>
        </div>
    </div>
</div>
<?php } ?>

anyone adding this should also move the div parameters from here and add them to the PunBB stylesheet for conformity.

edit, another option for those who want to save space and have it in the footer to the right of the quickjump list is to do the following:

In footer.php

FIND:
else if ($footer_style == 'viewforum' || $footer_style == 'viewtopic')
{

AFTER ADD:
   if ($cur_forum['moderators'] != '') {
      echo "\n\t\t\t".'<div class="conr">'."\n";
         $mods_array = unserialize($cur_forum['moderators']);
         $moderators = array();

         while (list($mod_username, $mod_id) = @each($mods_array)) {
            $moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';
         }

         $moderators = "\t\t\t\t\t\t\t\t".'<p>'.$lang_common['Moderated by'].': '.implode(', ', $moderators).'</p>'."\n";
         echo $moderators;

          echo "\t\t\t".'</div>'."\n";
   }