Advertisement:

Author Topic: Adding mod drop down box to forum index  (Read 18947 times)

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Adding mod drop down box to forum index
« on: November 14, 2004, 11:33:36 AM »
I think I want to try out using a moderator drop down box on the far right after where it says Last Post.

So it would look something like how iB does it.

Example: (Scoll Right To see Mod Drop Down Box)



Basically I would want it just like that. So it would say moderator and then you could click it to drop down to see the moderators of that forum.

Does anyone think they can help me with that?

I was able to do that myself when I used IPB, but now as SMF uses php in their template files it gets me confused.  :P

[edit] I think this would be done using BoardIndex.template.php right? I think I want this done with the classic BoardIndex.template.php file but if you want you can explain how to do it with the default one and I can figure out how to adjust it to the classic one[/edit]
« Last Edit: November 14, 2004, 04:57:52 PM by akabugeyes »
Dev Consultant
Former SMF Doc Coordinator

Offline A.M.A

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,133
  • Gender: Male
  • ..
Re: Adding mod drop down box to forum index
« Reply #1 on: November 14, 2004, 06:50:18 PM »
in the default theme BoardIndex.template.php look for:
Code: [Select]
<td colspan="4" class="catbg', $category['new'] ? '2' : '', '" height="18">';replace it with:
Code: [Select]
<td colspan="5" class="catbg', $category['new'] ? '2' : '', '" height="18">';

look for:
Code: [Select]
', $txt['smf88'], ' ', $board['last_post']['link'], ' ', $txt[525], ' ', $board['last_post']['member']['link'];

echo '
</td>
add after:
Code: [Select]
<td class="smalltext" valign="middle">
<select name="ModLst">
<option value="" style="font-weight: bold;">Moderator(s)</option>';

// Show the Moderators drop down list!
foreach ($board['link_moderators'] as $boardI=> $boardM)
{
echo '
<option value="">',$boardM,'</option>';
}
echo '
</select>
</td>


finally find and delete this:
Code: [Select]
// Show the "Moderators: ".  Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']))
echo '
<div style="padding-top: 1px;" class="smalltext"><i>', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i></div>';
Do not forget to backup the template first.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Re: Adding mod drop down box to forum index
« Reply #2 on: November 14, 2004, 09:21:15 PM »
Thanks. I adjusted that code for the classic BoardIndex.template and it worked very well! Now I think I may increase the width of my forum a bit as now I have 5 boxes using the classic one and so it looks a bit cluttered.  ;)
Dev Consultant
Former SMF Doc Coordinator