[2.0.20] Avatars in Memberlist

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
13
76%
Very Good
4
24%
Good
0
No votes
Fair
0
No votes
Poor
0
No votes
 
Total votes: 17

rhinton
Registered User
Posts: 299
Joined: Sat Dec 20, 2003 8:01 pm
Location: orlando, fl

Post by rhinton »

installed it on three boards. works, but with a minor change i had to make in the templates/subSilver/memberlist_body.tpl
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/memberlist_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_USERNAME}</th>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_AVATAR}</th>
#
#-----[ FIND ]------------------------------------------------
#
<td class="{memberrow.ROW_CLASS}" align="center">&nbsp;{memberrow.PM_IMG}&nbsp;</td>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<td class="{memberrow.ROW_CLASS}" align="center">&nbsp;{memberrow.AVATAR_IMG}&nbsp;</td>


when you do it in this specific way, the named columns will be wrong. the first add puts the name after the username. the second puts the column after the PM column.

the memberlist order of columns for subSilver goes like this.

# ---- PM --- username --- email---etc...

in your method, you add the avatar cloumn after the username, but added the column name after the PM column name.
so, the change should look like this instead.
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/memberlist_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_USERNAME}</th>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_AVATAR}</th>
#
#-----[ FIND ]------------------------------------------------
#
<td class="{memberrow.ROW_CLASS}" align="center"><span class="gen">{memberrow.USERNAME}</span></td>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<td class="{memberrow.ROW_CLASS}" align="center">&nbsp;{memberrow.AVATAR_IMG}&nbsp;</td>


now, if you've added other columns from other MODS like i have, the individual will need to look at where the placement is for the column name. for the most part, the correction i just did should take care of the column name vs actual column mismatch.
User avatar
Makc666
Registered User
Posts: 358
Joined: Fri Mar 07, 2003 12:03 pm
Location: MSK-RU
Name: Maxim
Contact:

Post by Makc666 »

rhinton wrote: installed it on three boards. works, but with a minor change i had to make in the templates/subSilver/memberlist_body.tpl

when you do it in this specific way, the named columns will be wrong. the first add puts the name after the username. the second puts the column after the PM column.

the memberlist order of columns for subSilver goes like this.

# ---- PM --- username --- email---etc...


You are fully right.
Thanks for pointing out.
You example of change is not right.
As AFTER and BEFORE place those lines in different palces.
I submited changes to database.

Here is how the CODE must look like:

Code: Select all

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/memberlist_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
	  <th class="thTop" nowrap="nowrap">{L_USERNAME}</th>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
	  <th class="thTop" nowrap="nowrap">{L_AVATAR}</th>
#
#-----[ FIND ]------------------------------------------------
#
	  <td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"><a href="{memberrow.U_VIEWPROFILE}" class="gen">{memberrow.USERNAME}</a></span></td>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
	  <td class="{memberrow.ROW_CLASS}" align="center">&nbsp;{memberrow.AVATAR_IMG}&nbsp;</td>
#
#-----[ FIND ]------------------------------------------------
#
	  <td class="catBottom" colspan="{%:1}" height="28">&nbsp;</td>
#
#-----[ INCREMENT ]----------------------------------------
#
%:1 +1
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
rhinton
Registered User
Posts: 299
Joined: Sat Dec 20, 2003 8:01 pm
Location: orlando, fl

Post by rhinton »

Makc666 wrote: You are fully right.
Thanks for pointing out.
You example of change is not right.
As AFTER and BEFORE place those lines in different palces.
I submited changes to database.

Here is how the CODE must look like:

Code: Select all

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/memberlist_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
	  <th class="thTop" nowrap="nowrap">{L_USERNAME}</th>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
	  <th class="thTop" nowrap="nowrap">{L_AVATAR}</th>
#
#-----[ FIND ]------------------------------------------------
#
	  <td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"><a href="{memberrow.U_VIEWPROFILE}" class="gen">{memberrow.USERNAME}</a></span></td>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
	  <td class="{memberrow.ROW_CLASS}" align="center">&nbsp;{memberrow.AVATAR_IMG}&nbsp;</td>
#
#-----[ FIND ]------------------------------------------------
#
	  <td class="catBottom" colspan="{%:1}" height="28">&nbsp;</td>
#
#-----[ INCREMENT ]----------------------------------------
#
%:1 +1
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM


stupid me. i didn't pay attention to the before one. i was thinking after. through my mess up, still found a correction. thanks for correcting mine as well. :oops:
rhinton
Registered User
Posts: 299
Joined: Sat Dec 20, 2003 8:01 pm
Location: orlando, fl

Post by rhinton »

actually, now that i went back and looked at it the right way, it would have put them together. this is providing you didn't have other MODS to the memberlist like i have. but, your newest version ensures, it's in the correct place no matter if you have additional columns or not.
rhinton
Registered User
Posts: 299
Joined: Sat Dec 20, 2003 8:01 pm
Location: orlando, fl

Post by rhinton »

thorugh using this, i found something else we can change on the memberlist. if you notice, the second column is the PM button. look above it and you'll notice the column name is blank. look over at the column for the email button and it has email at the top. so, one small change and you can have Private Message added to the top of the PM buitton column.

Code: Select all

#
#-----[ OPEN ]------------------------------------------------------------------
#

templates/subSilver/memberlist_body.tpl (This will work with any template. Just substitute subSilver with whatever template you are using.)

#
#-----[ FIND ]------------------------------------------------------------------
#

	<th class="thTop" nowrap="nowrap">&nbsp;</th>

#
#-----[ REPLACE WITH ]------------------------------------------------------------
#

	<th class="thTop" nowrap="nowrap">{L_PM}</th>
	

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------------------------
#
# EoM
i've sent this to the MODS database for approval. my first one. i know it's tiny and insignificant. but, i like to have all of the columns have names at the top.
User avatar
webmacster87
Former Team Member
Posts: 3758
Joined: Fri Jun 11, 2004 2:30 am
Location: San Mateo, CA
Name: Douglas Bell
Contact:

Post by webmacster87 »

MOD Updated to version 1.0.3
See first post for Download Link
Gephri
Registered User
Posts: 158
Joined: Wed Feb 23, 2005 4:17 pm

Very clean Mod

Post by Gephri »

Nice clean mod.

wanted to also have avatar show in viewonline.php - any idea how?
jrodrigo
Registered User
Posts: 5
Joined: Fri Jun 02, 2006 9:08 pm

Post by jrodrigo »

I have tried to install this MOD in phpBB 2.0.19 and it doesn't work :(

Perhaps the problem is in the last change. In templates/subSilver/memberlist_body.tpl I would have to find:

<td class="catBottom" colspan="{%:1}" height="28">&nbsp;</td>

But this line is like this:

<td class="catBottom" colspan="8" height="28">&nbsp;</td>

Cheers!
User avatar
Makc666
Registered User
Posts: 358
Joined: Fri Mar 07, 2003 12:03 pm
Location: MSK-RU
Name: Maxim
Contact:

Post by Makc666 »

Gephri wrote: Nice clean mod.

wanted to also have avatar show in viewonline.php - any idea how?


I will try to look for this one.
I think that it will not be too hard.
Will inform here in thread about this change.
jrodrigo wrote: I have tried to install this MOD in phpBB 2.0.19 and it doesn't work :(

Perhaps the problem is in the last change. In templates/subSilver/memberlist_body.tpl I would have to find:

<td class="catBottom" colspan="{%:1}" height="28">&nbsp;</td>

But this line is like this:

<td class="catBottom" colspan="8" height="28">&nbsp;</td>

Cheers!

Read here, you will find your answer:
http://www.phpbb.com/kb/article.php?article_id=39
The INCREMENT Action

Also, use EasyMOD 0.3.0 to install MODs.
jrodrigo
Registered User
Posts: 5
Joined: Fri Jun 02, 2006 9:08 pm

Post by jrodrigo »

Thanks and excuse me for my silly question. :oops:

Cheers!
User avatar
Makc666
Registered User
Posts: 358
Joined: Fri Mar 07, 2003 12:03 pm
Location: MSK-RU
Name: Maxim
Contact:

Re: Very clean Mod

Post by Makc666 »

Gephri wrote: Nice clean mod.

wanted to also have avatar show in viewonline.php - any idea how?

I submited a new MOD named 'Avatars in Who is Online' to MODs' database.
Hope it will be online soon.
jrodrigo
Registered User
Posts: 5
Joined: Fri Jun 02, 2006 9:08 pm

Re: Very clean Mod

Post by jrodrigo »

Makc666 wrote: I submited a new MOD named 'Avatars in Who is Online' to MODs' database.
Hope it will be online soon.


I'll wait to install it... if it's so good as this one, it will be a must! ;-)

But I have a doubt: in my forum, users has a number and a standard avatar with this number (because is a limited forum: only 100 users, when somebody wants to enter, someone must leave free his number)

So, Memberlist ordered by avatar is very interesting for me.

But I have seen the order is the opposite it must be.

My avatars are named CL01.JPG, CL02.JPG, ... CL99.JPG

If I order by avatar ascending the first one is CL99.JPG ¿?

Thanks for everything!
User avatar
Makc666
Registered User
Posts: 358
Joined: Fri Mar 07, 2003 12:03 pm
Location: MSK-RU
Name: Maxim
Contact:

Re: Very clean Mod

Post by Makc666 »

jrodrigo wrote:
Makc666 wrote:I submited a new MOD named 'Avatars in Who is Online' to MODs' database.
Hope it will be online soon.


I'll wait to install it... if it's so good as this one, it will be a must! ;-)

I PM it to you.
jrodrigo wrote: But I have a doubt: in my forum, users has a number and a standard avatar with this number (because is a limited forum: only 100 users, when somebody wants to enter, someone must leave free his number)

So, Memberlist ordered by avatar is very interesting for me.

But I have seen the order is the opposite it must be.

My avatars are named CL01.JPG, CL02.JPG, ... CL99.JPG

If I order by avatar ascending the first one is CL99.JPG ¿?

Thanks for everything!

From version 1.0.2 of this MOD Avatars in Memberlist has sort option by Avatar file name.

If you sort by Ascending your users will be sorted by Avatars as:
CL01.JPG
CL02.JPG
...
CL50.JPG
...
CL98.JPG
CL99.JPG
rhinton
Registered User
Posts: 299
Joined: Sat Dec 20, 2003 8:01 pm
Location: orlando, fl

Re: Very clean Mod

Post by rhinton »

Makc666 wrote:
Gephri wrote:Nice clean mod.

wanted to also have avatar show in viewonline.php - any idea how?

I submited a new MOD named 'Avatars in Who is Online' to MODs' database.
Hope it will be online soon.


there's already one. all the boards i maintain have that done to them. called AvatarOnIndex_121. not that i haven't seen more than one MOD for a given improvement to the boards.
rhinton
Registered User
Posts: 299
Joined: Sat Dec 20, 2003 8:01 pm
Location: orlando, fl

Post by rhinton »

Code: Select all

##############################################################
## MOD Title: Avatar on index
## MOD Author: RedFoxy < redfoxy@redfoxy.it > (Massimo Ciccio') http://www.redfoxy.it/
## MOD Description: Insert user avatar (with link to search about last message recived),
##                  user name (with link to user's profile) and last message recived on
##                  index page near who is online table box.
##                  Very usefully!
##
## MOD Version: 1.2.1
##
## Installation Level: Easy
## Installation Time: 1 Minutes
## Files To Edit:
##         index.php
##         templates/subSilver/index_body.tpl 
##
## Included Files:
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
##############################################################
## Author Notes:
## That's my first release of that MOD, just to remember what I've do...
## I have tested this MOD whit phpBB 2.0.4/2.0.6/2.0.10 with MySQL Database 3.23.56/4.0.16
##
## EasyMod: Tested with 0.1.13
##
## Future versions can be found at http://www.redfoxy.it
## I've set up a support forum for my mods at http://www.forum.redfoxy.com (it's an
## italian forum but you can post in english without problems.
##
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
## Copyright:      (C) 2004 Avatar on index 1.2.0 - RedFoxy
##
##############################################################
## MOD History:
##
##   2004-11-08 - Version 1.2.0
##   - Corrected some typo for phpbb.com mod database
##
##   2004-11-08 - Version 1.2.0
##   - Add link to search about last message recived
##   - Changed support to user's message and profile
##   - Draw tpl again
##   - EasyMod 0.1.13 compliant
##
##   2004-11-05 - Version 1.0.1
##   - Typo corrected
##   - Add link to edit profile
##   - Draw new tpl
##
##   2004-11-03 - Version 1.0.0
##   - First release
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
#
#-----[ OPEN ]----------------------------------------------------------
#
index.php
#
#-----[ FIND ]----------------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]----------------------------------------------------
#
//-- mod : Avatar on index -------------------------------------------------------------------------
#
#-----[ FIND ]----------------------------------------------------------
#
	$template->set_filenames(array(
		'body' => 'index_body.tpl')
	);
#
#-----[ BEFORE, ADD ]---------------------------------------------------
#
//-- mod : Avatar on index -------------------------------------------------------------------------
//-- add
	if( $userdata['session_logged_in'] )
	{
		$sql = "SELECT u.user_avatar, u.user_avatar_type, u.user_id, u.user_allowavatar, u.username
			FROM " . USERS_TABLE . " u
			WHERE u.user_id = " . $userdata['user_id'] ;
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not query user information', '', __LINE__, __FILE__, $sql);
		}
			$avatarrow = $db->sql_fetchrow($result);

		if ( $avatarrow['user_avatar_type'] && $userdata['user_id'] != ANONYMOUS && $avatarrow['user_allowavatar'] )
		{
			switch( $avatarrow['user_avatar_type'] )
			{
				case USER_AVATAR_UPLOAD:
					$user_avatar = ( $board_config['allow_avatar_upload'] ) ? $board_config['avatar_path'] . '/' . $avatarrow['user_avatar'] : '';
					break;
				case USER_AVATAR_REMOTE:
					$user_avatar = ( $board_config['allow_avatar_remote'] ) ? $avatarrow['user_avatar'] : '';
					break;
				case USER_AVATAR_GALLERY:
					$user_avatar = ( $board_config['allow_avatar_local'] ) ? $board_config['avatar_gallery_path'] . '/' . $avatarrow['user_avatar'] : '';
					break;
			}
			$user_avatar = '<a href="' . append_sid($phpbb_root_path.'search.'.$phpEx.'?search_id=egosearch') .
					'"><img src="' . $user_avatar . '" alt="' . $avatarrow['username'] . '" border="0" /></a><br>';
		}
		$user_name = '<a href="' . append_sid($phpbb_root_path.'profile.'.$phpEx.'?mode=editprofile') .
				'"><b>' . $avatarrow['username'] . '</b></a>';

		$sql = "SELECT COUNT(post_id) as tot
			FROM " . POSTS_TABLE . "
			WHERE post_time >= " . $userdata['user_lastvisit'] . "
			AND poster_id != " . $userdata['user_id'];

		$result = $db->sql_query($sql);

		if( $result )
		{
			$row = $db->sql_fetchrow($result);
			$user_newposts = '<a href="' . append_sid($phpbb_root_path.'search.'.$phpEx.'?search_id=newposts') .
						'" class="gensmall">' . $lang['Search_new'] . ' (' . $row['tot'] .')</a>';
		}
	}
	else
	{
		$user_avatar = '';
	}
//-- end : Avatar on index -------------------------------------------------------------------------

#
#-----[ FIND ]----------------------------------------------------------
#
                'FORUM_LOCKED_IMG' => $images['forum_locked'],
#
#-----[ AFTER, ADD ]----------------------------------------------------
#

//-- mod : Avatar on index -------------------------------------------------------------------------
//-- add
		'USER_AVATAR' => $user_avatar,
		'USER_NAME' => $user_name,
		'USER_NEWPOSTS' => $user_newposts,
//-- end : Avatar on index -------------------------------------------------------------------------
#
#-----[ OPEN ]----------------------------------------------------------
#
templates/subSilver/index_body.tpl 
#
#-----[ FIND ]----------------------------------------------------------
#
#
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
#
#-----[ BEFORE, ADD ]---------------------------------------------------
#
<!-- mod : Avatar on index -->
#
#-----[ FIND ]----------------------------------------------------------
#
	<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
#
#-----[ REPLACE WITH ]--------------------------------------------------
#
	<td class="row1" align="center" valign="middle" rowspan="2">{USER_AVATAR}
	<span class="genmed">{USER_NAME}</b></span><br>
	<span class="gensmall">{USER_NEWPOSTS}</span></td>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Post Reply

Return to “[2.0.x] MOD Database Releases”