Not logged in. · Lost password · Register
Forum: Customising UNB Modifications and plug-ins Plug-in gallery RSS
Show moderators below the forum tagline
elven #1
Member since Sep 2006 · 20 posts
Group memberships: Members
Show profile · Link to this post
Subject: Show moderators below the forum tagline
  1. <?php
  2. if (!defined('UNB_RUNNING')) die('Not a UNB environment in ' . basename(__FILE__));
  3.  
  4. // Define plug-in meta-data
  5. UnbPluginMeta('Show moderators below fora description texts');
  6. // UnbPluginMeta('de en', 'lang');
  7.  
  8. if (!UnbPluginEnabled()) return;
  9.  
  10. /* ForumId: in
  11.    output: out
  12. */
  13. function UnbShowModForumListPostDesc(&$data) {
  14. //      global $UNB_T;
  15.  
  16.         // ForumId => Group that holds moderators-Id
  17.         $assigns = array(
  18.                 5 => 13, // Kalender
  19.                 8 => 22, // Bugs
  20.                 14 => 6, //FAQ
  21.                 19 => array(array(1)), // Administratives: elven
  22.  
  23.                 18 => array(array(1)), // Anmeldung
  24.                 25 => array(array(1)), // Anfrage
  25.  
  26.                 7 => 20, 17 => 20, 24 => 20, // Allgemeines
  27.                 20 => 23, // Handwerk
  28.                 2 => 21, 3 => 21, 4 => 21, 26 => 21// Rollenspiel
  29.                 15 => 17, 21 => 14, 22 => 15, 16 => 16, // Fraktionsfora
  30.  
  31.                 28 => array(array(1)), // Staff-Wiki
  32.                 // 11 => 5, 13 => 5, 23 => 5, 29 => 5, // Staff-Fora
  33.                 0 => 0 // Placeholder
  34.                 );
  35.  
  36.         $fid = $data['ForumId'];
  37.         if (!$assigns[$fid])
  38.                 return;
  39.  
  40.         $forum = $data['Forum']; //new IForum($fid);
  41.         if ($forum->IsCategory())
  42.                 return;
  43.         $mods = array();
  44.  
  45.         if(is_array($assigns[$fid])) {
  46.                 foreach($assigns[$fid] as $list)
  47.                         if (is_array($list))
  48.                                 $mods = array_merge($mods, $list);
  49.                         else
  50.                                 $mods = array_merge($mods, UnbGetGroupMembers($list));
  51.         } else {
  52.                 $mods = array_merge($mods, UnbGetGroupMembers($assigns[$fid]));
  53.         }
  54.         sort($mods);
  55.  
  56.         $out = '';
  57.         $out .= '<br />';
  58.         //$out .= '<div style="border-top: 1px solid lightgrey; margin: 4px 0;"></div>';
  59.         $out .= '<div style="margin-left: 10px; font-size:0.8em;line-height:120%">Ansprechpartner: ';
  60.  
  61.         $mymods = array();
  62.  
  63.         $names = UnbGetUserNames();
  64.         foreach($mods as $mod) {
  65.                 $mymods[] = UnbMakeUserLink($mod, $names[$mod]);
  66.         }
  67.  
  68.         if (count($mods) == 0)
  69.                 $mymods[] = "<i>Niemand eingetragen</i>";
  70.  
  71.         $out .= implode(", ", $mymods);
  72.  
  73.         $out .= '</div>';
  74.  
  75.         $data['output'] .= $out;
  76.         return 1;
  77. }
  78.  
  79. UnbRegisterHook("forumlist.postdescription", "UnbShowModForumListPostDesc");
  80. ?>

As can be seen here.

Configuration is, as for now, without frills.

Set $assigns to reflect your moderation groups, and use array-arrays to specify userIDs instead of group-IDs.
There are no language files, but could be added with a minimum of fuss.
Change the code to reflect your language. :)
I reject your reality and substitute my own.
elven #2
Member since Sep 2006 · 20 posts
Group memberships: Members
Show profile · Link to this post
Whoops, please nudge this to the gallery. :/
I reject your reality and substitute my own.
Avatar
bestreaction #3
User title: mathematics
Member since Apr 2007 · 52 posts · Location: istanbul
Group memberships: Members
Show profile · Link to this post
In reply to post #1
#
$assigns = array(
#
                5 => 13, // Kalender
#
                8 => 22, // Bugs
#
                14 => 6, //FAQ
#
                19 => array(array(1)), // Administratives: elven
#
 
#
                18 => array(array(1)), // Anmeldung
#
                25 => array(array(1)), // Anfrage
#
 
#
                7 => 20, 17 => 20, 24 => 20, // Allgemeines
#
                20 => 23, // Handwerk
#
                2 => 21, 3 => 21, 4 => 21, 26 => 21,  // Rollenspiel
#
                15 => 17, 21 => 14, 22 => 15, 16 => 16, // Fraktionsfora
#
 
#
                28 => array(array(1)), // Staff-Wiki
#
                // 11 => 5, 13 => 5, 23 => 5, 29 => 5, // Staff-Fora
#
                0 => 0 // Placeholder

in english?
This post was edited on 2007-05-03, 02:35 by bestreaction.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20110527-dev, © 2003-2011 by Yves Goergen
Page created in 228.3 ms (138.3 ms) · 49 database queries in 119 ms
Current time: 2012-02-04, 03:08:49 (UTC +01:00)