Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 19:24

All times are UTC + 1 hour




Post new topic TOPIC_LOCKED  [ 1 post ] 
Author Message
PostPosted: 08 Aug 2012, 00:20 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
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

Code:
        // Assign subforums loop for style authors
        foreach ($subforums_list as $subforum)
        {


before add

Code:
    // 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:
                    <!-- IF forumrow.MODERATORS -->
                        <br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}
                    <!-- ENDIF -->


replace with

Code:
                    <!-- 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

_________________
Mod-Bot / Service-Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic TOPIC_LOCKED  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.032s | 22 Queries | GZIP : Off ]