Here is a multi-functional members snippet!
Features# Have 3 modes
- Random members
- Recently registered
- Top poster
# You have the ability to set the limit
# You have the ability to get members from specific membergroup(s)
# You have the ability to show there posts in 4 different modes(Recent posts, Recent Topics, Random posts, Random Topics) and even set there limit.
# You have the ability to set the no. of columns to divide the block in(Good for articles or center blocks)
# You have the ability to show various attributes of the member
How to implementStep 1 - First download the attached file (MembersSnippet.php) and upload it to Sources directory
Step 2 - In a php block add
/***********************************
* Multi-Function Members Snippet
* By Dragooon
* Version 1.0
* www.gforumx.com
************************************/
// Call the source file
global $sourcedir;
require_once($sourcedir . '/MemberSnippet.php');
/************************************
* How To Customize!
************************************/
# This is how to customize the block. To customize this please edit the variable given in the Below function call (members). Do Not edit the variables given in this How To. This How to explains, what is the variable is and what does it do.
# How to Customize is given below.
# Make sure not to remove ANY comma
# Make sure not to remove "array()" part in the $memberGroups array.
# $mode - Controls the mode of the snippet
# 1 - Random
# 2 - Recently Registered
# 3 - Top poster
# $limit - Maximum no. of members to show
# $memberGroups - If set, will only show members from this groups
# - Leave blank to show from all groups
# - Enter ID's of groups NOT names
# - Use comma as a seperator
# Example : $memberGroups = array(1, 2, 3),
# $getPosts - Weather to show there posts or not
# 0 - For Not Showing them
# 1 - For Recent Posts
# 2 - For Recent Topics
# 3 - For Random Posts
# 4 - For Random Topics
# $getPostsLimit - No of topics/post to show
# $columns - No. of columns to divide the block in
# Below are some config variables to show various things, use 'true' as a yes and 'false' as a no(Without Quotes)
# $show_numPosts - Weather to show there number of posts or not
# $show_memberGroupName = Show there memberGroup names or not
# $show_memberGroupStars - Weather to show there membergroup's stars or not
# $show_lastLogin - Weather to show there last login or not
# $show_personalTitle - Weather to show there personal title or not
# $show_customTitle - Weather to show there custom title or not
# $show_gender - Weather to show there gender or not
# $genderUseImages - Weather to show gender as images or texts
# $show_registerDate - Weather to show there register date or not
# $show_avatar - Weather to show there avatar or not
/************************************
* End How to Customize!
************************************/
/************************************
* The Finale!
************************************/
members(
$mode = 1,
$limit = 5,
$memberGroups = array(),
$getPosts = 0,
$getPostsLimit = 5,
$columns = 1,
$show_numPosts = true,
$show_memberGroupName = true,
$show_memberGroupStars = true,
$show_lastLogin = true,
$show_personalTitle = true,
$show_customTitle = true,
$show_gender = true,
$genderUseImages = true,
$show_lastLogin = true,
$show_registerDate = true,
$show_avatar = true
);
// Thank you for using this snippet :)And you are fit to go, customization and how to customize is in the block code
Even though this is tested, chance still remains of errors, if you encounter any error please tell me via replying to this thread
Use this thread for feedback or queries
Thank you :)
Do you have a demo?
Ah No, I am sorry, I usually devolepe them on my local computer.
You need a test site Dragooon? I could setup a forum for you on my site or something you could use for live testing.
I usually use my live forums for testing(Cant find a better ground).
You can also use the dev site we got for tph if you need it. Let me know and I will shoot you the ftp info
Good work Dragoon!!
This works well. Tested first on my test site to insure there would be no errors. There was none then installed to my main site. Since there was no demo this was a stab in the dark what it would look like. I have enabled guests to see the block on my site if any one wants to see a demo.
Note: I'm still learning smf forums so I'm fixing some broken images.
Demo: Sorry demo is down due to errors will put link back when block is back
Thank you and glad you liked it!
Dragooon, Not sure what I may have done wrong but forums seems to be getting loads of error messages. It may be some thing to do with the permissions set and the block snippets. This is the error message recorded i had 16 pages of the same error.
2: Invalid argument supplied for foreach()
File: /home/*****/public_html/wcp/Sources/MemberSnippet.php
Line: 198
I'm gonna uninstall this block till you can give any advice what it may be thank you
Make sure you configured everything correctly because I cannot re-create this error, did you modified the file?
I configured only what was able to be edited. (left the MemberSnippet.php) untouched since that is above me in editing. I had my 5 top posters showing 'only'. 1 of them witch uploaded there avatar to the server. this made an error cause guests could not see it till the signed in. I fixed that error by removing his avatar from server and had him post on a image sharing site. Also when his avatar was in the profile when you logged it took you to his avatar link on server you had to back space and re log only in IE, fire fox did not do this. Why this other error posted above me is there i cant figure.
1 thing i did not try is open up main bored to guests this may take care of the error since it only came in as you was a guest. witch makes me thing it was a permission issue.When i have more time to look this over more closely i will post back results.
This is a really good snippet just need to work this one error out.
P.S I'm not looking for support just reported an error i received.
I tried every singe possibility and no errors found, umm I think I'll look onto this.
I have problem with additional members group.
I have group called friends and would like to have snippert to show only friends on one page.
This snippet dont works with custom group, - when I choose 'all' - works
with few groups Id's - works only with standard groups, for rest query is empty. Could You check this ?
I use 114,
Group (friends) with ID 9 is in database, working, etc
[quote]
/***********************************
* Multi-Function Members Snippet
* By Dragooon
* Version 1.0
* www.gforumx.com
************************************/
// Call the source file
global $sourcedir;
require_once($sourcedir . '/MemberSnippet.php');
/************************************
* How To Customize!
************************************/
# This is how to customize the block. To customize this please edit the variable given in the Below function call (members). Do Not edit the variables given in this How To. This How to explains, what is the variable is and what does it do.
# How to Customize is given below.
# Make sure not to remove ANY comma
# Make sure not to remove "array()" part in the $memberGroups array.
# $mode - Controls the mode of the snippet
# 1 - Random
# 2 - Recently Registered
# 3 - Top poster
# $limit - Maximum no. of members to show
# $memberGroups - If set, will only show members from this groups
# - Leave blank to show from all groups
# - Enter ID's of groups NOT names
# - Use comma as a seperator
# Example : $memberGroups = array(1, 2, 3),
# $getPosts - Weather to show there posts or not
# 0 - For Not Showing them
# 1 - For Recent Posts
# 2 - For Recent Topics
# 3 - For Random Posts
# 4 - For Random Topics
# $getPostsLimit - No of topics/post to show
# $columns - No. of columns to divide the block in
# Below are some config variables to show various things, use 'true' as a yes and 'false' as a no(Without Quotes)
# $show_numPosts - Weather to show there number of posts or not
# $show_memberGroupName = Show there memberGroup names or not
# $show_memberGroupStars - Weather to show there membergroup's stars or not
# $show_lastLogin - Weather to show there last login or not
# $show_personalTitle - Weather to show there personal title or not
# $show_customTitle - Weather to show there custom title or not
# $show_gender - Weather to show there gender or not
# $genderUseImages - Weather to show gender as images or texts
# $show_registerDate - Weather to show there register date or not
# $show_avatar - Weather to show there avatar or not
/************************************
* End How to Customize!
************************************/
/************************************
* The Finale!
************************************/
members(
$mode = 2,
$limit = 99,
$memberGroups = array(9),
$getPosts = 0,
$getPostsLimit = 5,
$columns = 6,
$show_numPosts = false,
$show_memberGroupName = false,
$show_memberGroupStars = false,
$show_lastLogin = false,
$show_personalTitle = false,
$show_customTitle = false,
$show_gender = true,
$genderUseImages = true,
$show_lastLogin = false,
$show_registerDate = false,
$show_avatar = true
);
// Thank you for using this snippet :)
[/quote]
best regards
I didn't made it to work with Additional groups, I'll consider that later.
ups , for my it will by the best solution for this mod to print each group what we made (friends, class in school, or VIP) on separated pages. Also I dont like quering database on each box, few times, then I have 50 queries in to with few boxex and snipets ...
nice code dragoon!
just a thought,,, is it possible to display a default image for members without avatar?
it seems not to work when you specify it to get a random member from a specific group
is it possible to get the avatar size to 100px.. member avatars are displayed at the original size. this becomes a problem especially for member who hotlinked their avatar to their profile..
Quote from: Dragooon on February 20, 2008, 12:19:34 PM
I didn't made it to work with Additional groups, I'll consider that later.
1> Has this been updated to work with additional groups?
2> Can it be set to list in order rather than random/recent registered/top poster
3> Can I run more than one instance of it?