TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,234
  • Total Topics: 21,353
  • Online today: 739
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 285
  • Total: 285

Multi-Functional members snippet

Started by Megaforum, January 18, 2008, 04:37:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dragooon

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 implement
Step 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 :)

Zetan


Dragooon

Ah No, I am sorry, I usually devolepe them on my local computer.

IchBin

You need a test site Dragooon? I could setup a forum for you on my site or something you could use for live testing.

Dragooon

I usually use my live forums for testing(Cant find a better ground).

tick

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

ACE420

#6
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

Dragooon


ACE420

#8
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

Dragooon

Make sure you configured everything correctly because I cannot re-create this error, did you modified the file?

This website is proudly hosted on Crocweb Cloud Website Hosting.