[Snippet] Moderators pulldown in forum list

Moderators pulldown in forum list
With this Snippet you can display the moderators in forumlist as pulldown
instead of a comma separated list. It supports group colours and profile links.
phpbb3-Version: 3.0.10
Requested by: malhayek
Request Topic: http://www.phpbb.com/community/viewtopi ... &t=2160373
Credit: trigger_error
Demo: index.php
Instruction
open
includes/functions_display.php
find
before add
open
styles/prosilver/template/forumlist_body.html
find
replace with
Clear all Board- and Browser-Caches
With this Snippet you can display the moderators in forumlist as pulldown
instead of a comma separated list. It supports group colours and profile links.
phpbb3-Version: 3.0.10
Requested by: malhayek
Request Topic: http://www.phpbb.com/community/viewtopi ... &t=2160373
Credit: trigger_error
Demo: index.php
Instruction
open
includes/functions_display.php
find
- Code: Select all
// Assign subforums loop for style authors
foreach ($subforums_list as $subforum)
{
before add
- Code: Select all
// Moderators pulldown in forum list / trigger_error / 2012
$for_mods = (isset($forum_moderators[$forum_id]) && !empty($forum_moderators[$forum_id])) ? $forum_moderators[$forum_id] : array();
foreach ($for_mods as $key => $value)
{
preg_match('#<a(.*?)href="(.*?)"(.*?)style="color:(.*?)\#(.*?);"(.*?)>(.*?)</a>#', $value, $opt);
$template->assign_block_vars('forumrow.moderators', array(
'LINK' => (isset($opt[2])) ? $opt[2] : false,
'COLOR' => (isset($opt[5])) ? $opt[5] : false,
'NAME' => (isset($opt[7])) ? $opt[7] : false,
'INDEX' => $key,
'MODERATORS' => $value
));
}
// Moderators pulldown in forum list
open
styles/prosilver/template/forumlist_body.html
find
- Code: Select all
<!-- IF forumrow.MODERATORS -->
<br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}
<!-- ENDIF -->
replace with
- Code: Select all
<!-- IF forumrow.MODERATORS -->
<!-- <br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS} -->
<!-- ENDIF -->
<!-- IF .forumrow.moderators -->
<br />
<select style="background-color:transparent;" onchange="location = this.options[this.selectedIndex].value;">
<option selected="selected">{forumrow.L_MODERATOR_STR}</option>
<!-- BEGIN moderators -->
<option<!-- IF forumrow.moderators.COLOR --> style="color: #{forumrow.moderators.COLOR}; font-weight: bold;"<!-- ENDIF --> value="{forumrow.moderators.LINK}">{forumrow.moderators.NAME}</option>
<!-- END moderators -->
</select>
<!-- ENDIF -->
Clear all Board- and Browser-Caches