vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Usergroup Member's List (https://vborg.vbsupport.ru/showthread.php?t=320943)

Cody.9791 12-22-2015 06:52 PM

Quote:

Originally Posted by Dragonsys (Post 2560849)
Ok, this is a manual edit, so if you upgrade vBulletin you might have to reapply it, but here it is quick and dirty:

Open Template: modifyusergroups_nonmemberbit
Find:
HTML Code:

<vb:else />
        {vb:rawphrase anyone_free_to_join_group}
</vb:if>

After Add:
HTML Code:

        <a href="memberlist.php?usergroupid={vb:raw usergroup.usergroupid}">{vb:rawphrase list_members}</a>

EDIT:
Just noticed this gives a permission error. The permission is coded into memberlist.php, you can get around it by doing the following edits (These will be lost when upgrading vBulletin as this is editing a core file) Line numbers based on vB v4.2.3

Open: memberlist.php
Find (lines 358-368):
PHP Code:

        // check permission to do authorizations in this group
        
if (!$leadergroup $db->query_first_slave("
            SELECT usergroupleader.usergroupleaderid, usergroup.title
            FROM " 
TABLE_PREFIX "usergroupleader AS usergroupleader
            LEFT JOIN " 
TABLE_PREFIX "usergroup AS usergroup ON (usergroupleader.usergroupid = usergroup.usergroupid)
            WHERE usergroupleader.userid = " 
$vbulletin->userinfo['userid'] . "
                AND usergroupleader.usergroupid = 
$usergroupid
        "
))
        {
            
print_no_permission();
        } 

Replace with:
PHP Code:

        // check permission to do authorizations in this group
        
if (!$leadergroup $db->query_first_slave("
            SELECT usergroupleader.usergroupleaderid, usergroup.title
            FROM " 
TABLE_PREFIX "usergroupleader AS usergroupleader
            LEFT JOIN " 
TABLE_PREFIX "usergroup AS usergroup ON (usergroupleader.usergroupid = usergroup.usergroupid)
            WHERE usergroupleader.userid = " 
$vbulletin->userinfo['userid'] . "
                AND usergroupleader.usergroupid = 
$usergroupid
        "
))
        {
            
$remove_selected_users '';
        } else {
            
$remove_selected_users '<input type="submit" class="button" value="Remove Selected Users(s)" />';
        } 

Find (line 937):
PHP Code:

$page_templater->register('oppositesort'$oppositesort); 

After Add:
PHP Code:

$page_templater->register('remove_selected_users'$remove_selected_users); 

Open Template: memberlist
Find:
HTML Code:

        <vb:if condition="$show['usergroup']">
            <input type="submit" class="button" value="{vb:rawphrase remove_selected_users}" />

Replace With:
HTML Code:

        <vb:if condition="$show['usergroup']">
            {vb:raw remove_selected_users}


One thing was brought to my attention with this. Users that are already in a usergroup aren't able to see the "List Members" link. Is there some way to get this to show in the "You are a member of the following groups" section at the bottom of the page?

Dragonsys 12-22-2015 07:36 PM

Quote:

Originally Posted by Cody.9791 (Post 2560983)
One thing was brought to my attention with this. Users that are already in a usergroup aren't able to see the "List Members" link. Is there some way to get this to show in the "You are a member of the following groups" section at the bottom of the page?

Ok, i think this will do it:

Open Template: modifyusergroups_memberbit
Find:
HTML Code:

                                        <vb:if condition="$show['isleader']">
                                                ({vb:rawphrase leader_of_this_group})
                                        <vb:else />
                                                <label for="rb_leave_{vb:raw usergroup.usergroupid}"><input type="radio" name="usergroupid" id="rb_leave_{vb:raw usergroup.usergroupid}" tabindex="1" value="{vb:raw usergroup.usergroupid}" /> {vb:rawphrase leave_group}</label>
                                        </vb:if>

After Add:
HTML Code:

                                        <a href="memberlist.php?usergroupid={vb:raw usergroup.usergroupid}">{vb:rawphrase list_members}</a>

Cody.9791 12-22-2015 08:34 PM

Quote:

Originally Posted by Dragonsys (Post 2560990)
Ok, i think this will do it:

Open Template: modifyusergroups_memberbit
Find:
HTML Code:

                                        <vb:if condition="$show['isleader']">
                                                ({vb:rawphrase leader_of_this_group})
                                        <vb:else />
                                                <label for="rb_leave_{vb:raw usergroup.usergroupid}"><input type="radio" name="usergroupid" id="rb_leave_{vb:raw usergroup.usergroupid}" tabindex="1" value="{vb:raw usergroup.usergroupid}" /> {vb:rawphrase leave_group}</label>
                                        </vb:if>

After Add:
HTML Code:

                                        <a href="memberlist.php?usergroupid={vb:raw usergroup.usergroupid}">{vb:rawphrase list_members}</a>

Thank you for the quick solution! Works great!


All times are GMT. The time now is 05:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01263 seconds
  • Memory Usage 1,757KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_html_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete