Yeah, I found it kinda annoying how having multiple moderators for one forum would make things rather ugly and cluttery and jumble up my front page. So, I made this nifty little hack ^_^
Features:
- Upon choosing a moderator, it will link to that moderator's profile
- A link to showgroups.php
Download, install, enjoy. Only one edit!! 8)
PHP Code:
Open includes/functions_forumlist.php, find this:
//////////////////////////////////////////////////////////////////
// get moderators ( this is why we needed cache_moderators() )
if ($vboptions['showmoderatorcolumn'])
{
$showmods = array();
$listexploded = explode(',', $forum['parentlist']);
foreach ($listexploded AS $parentforumid)
{
if (!isset($imodcache["$parentforumid"]))
{
continue;
}
foreach($imodcache["$parentforumid"] AS $moderator)
{
if ($showmods["$moderator[userid]"] === true)
{
continue;
}
$showmods["$moderator[userid]"] = true;
if (!isset($forum['moderators']))
{
eval('$forum[\'moderators\'] = "' . fetch_template('forumhome_moderator') . '";');
}
else
{
eval('$forum[\'moderators\'] .= ", ' . fetch_template('forumhome_moderator') . '";');
}
}
}
if (!isset($forum['moderators']))
{
$forum['moderators'] = '';
}
}
//////////////////////////////////////////////////////////////////
Replace it with this:
//////////////////////////////////////////////////////////////////
// get moderators ( this is why we needed cache_moderators() )
if ($vboptions['showmoderatorcolumn'])
{
$showmods = array();
$listexploded = explode(',', $forum['parentlist']);
foreach ($listexploded AS $parentforumid)
{
if (!isset($imodcache["$parentforumid"]))
{
continue;
}
foreach($imodcache["$parentforumid"] AS $moderator)
{
if ($showmods["$moderator[userid]"] === true)
{
continue;
}
$forum['moderators'] .= "<option value='{$moderator[userid]}'>{$moderator[username]}</option>";
}
}
$modhack_head = <<< CONTENT
<script>
<!--
function moddrophack_redir(tparam)
{
if (tparam != -1) {
location.href = 'member.php?userid=' + tparam;
}
else {
location.href = 'showgroups.php';
}
}
// -->
</script>
<form method="post">
<select id="moddrophack" onchange="moddrophack_redir(this.options[selectedIndex].value)">
<option value="-1">--------------</option>
CONTENT;
$modhack_foot = '<option value="-1">View All Mods</option></select></form>';
if (!isset($forum['moderators']))
{
$forum['moderators'] = '';
}
else {
$forum['moderators'] = $modhack_head . $forum['moderators'] . $modhack_foot;
}
}