phpBB.com     phpBB Academy     phpBB Modders     phpBB Weekly     ktuk     phpBB Hacks     Vlad Studio  

Groups/Contributers Page

Lists custom groups with their members on a separate page. Ideal for small groups

Not enough for a full proper MOD, but too useful not to share
Forum rules
Please read over our forum guidelines

Groups/Contributers Page

Postby kenny » 07 Jan 2010, 21:08

As requested by JohanNL in this topic, here is a simple page that lists all your custom groups and their members. It's a very simple snippet, requiring only 1 file edit :)

Comment:
Some of the features:

  • Group name is now a link to the memberlist groups page
  • Groups rank image & title
  • Config options - decide whether or not to show group rank, title and description

Demo: groups.php

I've set my page to show all custom groups as well as the pre-defined Administrators and Global Moderators. Guests, Bots ans Reg Users are hidden. You should note that any group marked as hidden will not show up on this page.

By default, the group leader is the 1st user in the list and their name is in bold. If there is no group leader, then none is shown. If there are no members, no members are shown. If there is neither a leader or any members, but the groups exists, the box will show but it will be empty. I plan on expanding on this to show messages like "The groups has no members" :)

All styling is done in the HTML file itself, so if you want to change font sizes or things like that, change them there. I also included a little bit of CSS3 - rounded corner borders. They only work on Mozilla and Webkit based browsers (Firefox, Safari). Just remove the CSS and the class="round" if you don't want that.

I should note that there is not pagination of any sort included with this script and it will pull all members of custom groups onto that one page. So if you have a group with 100 or 100 members, you may wish to exclude that group ;) This snippet is ideal for small groups of people you wish to give recognition to.
GroupsPage.zip
(4.32 KiB) Downloaded 183 times
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

Donate to 6 String MODs
If you like any of the work that I do here, please consider donating.
click the image on the left for a list of some of the advantages of donating



Groups/Contributers Page

Postby austin881 » 10 Feb 2010, 18:51

kenny wrote:If there is neither a leader or any members, but the groups exists, the box will show but it will be empty. I plan on expanding on this to show messages like "The groups has no members" :)


Could you help me figure out how to do that? I'd really like that functionality.

I see where it looks like you started to implement this...
Code: Select all
'S_NO_MEMBERS' => ($members['user_id'] == $user_id) ? true : false,


But obviously that won't work. I'm not sure what will though.
Interests: chevy astro vans, gas scooters, chevy silverado forums
I install mods for free! Go to ModernDignity.com for details.
User avatar
austin881
Registered User
Registered User
 
Posts: 8
Joined: 03 Dec 2008, 19:43
Location: Idaho, USA

Re: Groups/Contributers Page

Postby kenny » 10 Feb 2010, 21:26

My templating skillz have improved since doing this. I found you can do this quite easily :)
Code: Select all
      <!-- BEGIN leaders -->
         <a style="display: block; border-bottom: 1px dotted #{groups.GROUP_COLOUR}; padding: 3px;" href="{groups.leaders.U_VIEW_PROFILE}" title="View Profile"><strong>&raquo;</strong> <strong style="color: #{groups.GROUP_COLOUR};">{groups.leaders.USERNAME}</strong></a>
      <!-- END leaders -->   
      <!-- BEGIN members -->
         <a style="display: block; border-bottom: 1px dotted #{groups.GROUP_COLOUR}; padding: 3px;" href="{groups.members.U_VIEW_PROFILE}" title="View Profile"><span style="color: #{groups.GROUP_COLOUR};">{groups.members.USERNAME}</span></a>         
      <!-- END members -->   

Becomes this:
Code: Select all
      <!-- BEGIN leaders -->
         <a style="display: block; border-bottom: 1px dotted #{groups.GROUP_COLOUR}; padding: 3px;" href="{groups.leaders.U_VIEW_PROFILE}" title="View Profile"><strong>&raquo;</strong> <strong style="color: #{groups.GROUP_COLOUR};">{groups.leaders.USERNAME}</strong></a>
      <!-- BEGINELSE -->
         <span style="display: block;">{L_NO_LEADERS}</span>   
      <!-- END leaders -->
            
      <!-- BEGIN members -->
         <a style="display: block; border-bottom: 1px dotted #{groups.GROUP_COLOUR}; padding: 3px;" href="{groups.members.U_VIEW_PROFILE}" title="View Profile"><span style="color: #{groups.GROUP_COLOUR};">{groups.members.USERNAME}</span></a>         
      <!-- BEGINELSE -->
         <span style="display: block;">{L_NO_MEMBERS}</span>   
      <!-- END members -->

And 2 new language strings for the ./mods/groups.php file:
Code: Select all
    'NO_LEADERS'        => 'This group does not have a leader assigned.',
    'NO_MEMBERS'        => 'There are currently no members in this group.', 

Edit: If you can confirm this is ok, I'll update the main package (ps. it's now updated on this site ;))
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

Groups/Contributers Page

Postby austin881 » 10 Feb 2010, 21:40

Wow you mean to tell me after all the silly weird things I tried in the template and in the groups.php file THAT IS THE FIX?! Don' you just love this stuff?

Thanks a million! It works great. :mrgreen:
http://www.silveradosierra.com/groups.php
Interests: chevy astro vans, gas scooters, chevy silverado forums
I install mods for free! Go to ModernDignity.com for details.
User avatar
austin881
Registered User
Registered User
 
Posts: 8
Joined: 03 Dec 2008, 19:43
Location: Idaho, USA

Re: Groups/Contributers Page

Postby kenny » 10 Feb 2010, 21:42

Excellent. That looks great :)
I'll upload the new package in a few minutes
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

Re: Groups/Contributers Page

Postby JimA » 13 Feb 2010, 17:05

I just edited it a little to make sure the Newly Registered Users group isn't displayed at the group page as well. Might be worth to edit in your package as well. :)

Open: groups.php

Find:
Code: Select all
// I would like to thank the wiki many times over <3 - http://wiki.phpbb.com/Template_Syntax
$sql = 'SELECT * FROM ' . GROUPS_TABLE . '
    WHERE group_type <> 2
    AND group_id > 3
    AND group_id <> 6
    ORDER BY group_name'
;
$result = $db->sql_query($sql); 

Inline, find:
Code: Select all
AND group_id <> 6

Add after (on a new line):
Code: Select all
AND group_name <> "NEWLY_REGISTERED" 

(I first did just a check on the Group ID, that differs however on all boards, since the feature was added in 3.0.6, so someone tipped me about the above, will work for everyone :) )
User avatar
JimA JimA - Don't worry, it's just me.
Donator
Donator
 
Posts: 14
Joined: 30 Nov 2008, 09:58
Location: The Netherlands

Re: Groups/Contributers Page

Postby kenny » 14 Feb 2010, 12:05

That's great, thanks Jim. I'll have the package updated in the next few days :)
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

Re: Groups/Contributers Page

Postby kenny » 17 Feb 2010, 02:09

And updated. Easiest thing to do is simple replace groups.php with the new file. SQL update, file header info updated and added a link to this topic in the file as well :)
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

Re: Groups/Contributers Page

Postby RMcGirr83 » 19 Mar 2010, 19:32

Code: Select all
    AND group_name <> "NEWLY_REGISTERED"


Jim is a baaaaad, baaaaad boy!!

Code: Select all
    AND group_name != "NEWLY_REGISTERED"
User avatar
RMcGirr83 RMcGirr83 has donated to 6 String MODs
V.I.P
V.I.P
 
Posts: 12
Joined: 10 Mar 2009, 18:08

Re: Groups/Contributers Page

Postby Dakin Quelia » 25 Mar 2010, 11:13

Excellent work, kenny. ;)
User avatar
Dakin Quelia
Registered User
Registered User
 
Posts: 7
Joined: 04 Oct 2009, 20:45




Return to Code Snippets

Who is online

No registered users


cron