Firefox PHP

Module: User Avatar

Posted by Maurice Makaay 
All files from this thread

File Name File Size   Posted by Date  
user_avatar-3.0.5.zip 24.2 KB open | download Maurice Makaay 09/01/2016 Read message
control_panel.png 18.5 KB open | download nica 01/06/2008 Read message
avatar.png 43.7 KB open | download SecretNinjaMan Maker 08/08/2008 Read message
avatar_images.PNG 78.4 KB open | download Sheldon 08/04/2009 Read message
avatar_images.PNG 45.2 KB open | download Sheldon 08/04/2009 Read message
tmp_messages.txt 3 KB open | download Lammi 04/14/2010 Read message
read_hybrid.tpl 7.4 KB open | download Sreenadh OG 09/22/2010 Read message
user_avatar-german.zip 3.6 KB open | download Oliver Riesen-Mallmann 01/04/2011 Read message
Module: User Avatar
September 14, 2007 06:28AM
Allows users to setup an avatar image, which can appear in their posts and profile page. Users can upload multiple avatar images in the control center. One of these can be selected as the active avatar.

The administrator can do some configuration through the module settings:
- allowed file types (options are gif, jpg and/or png)
- number of avatars that can be uploaded
- maximum filesize for an avatar
- maximum dimensions (in pixels) for an avatar
- who can use avatars (admins, moderators+admins, all users)
- who can disable displaying of avatars (admins, moderators+admins, all users, nobody)

Thomas and I started this version of the module as a port of the old Phorum 5.1 compatible User Avatar module, but it ended up as a full rewrite. It makes use of a lot of 5.2 features and installing it is easier than ever. The only thing that you need to do manually, is editing your templates to specify where you want to place the avatar in the messages and user profile.

Note: Because of some new features and fixes for Phorum 5.2, you need to install at least version 5.2.1-alpha. The module will not work with older versions of Phorum.

Changelog:
----------

2016-09-01 3.0.5 Oliver Riesen-Mallmann <oliver@riesen.org>

    - Made XHTML 1.0 Transitional compliant.

2008-11-14 3.0.4 Maurice Makaay

    - Generate the avatar for the currently active user as well. The
      avatar is available in {USER->user_avatar}.

    - For all template variables, the names have changed from

      {DATA->mod_user_avatar}   -> {DATA->user_avatar}
      {DATA->mod_user_avatar_w} -> {DATA->user_avatar_w}
      {DATA->mod_user_avatar_h} -> {DATA->user_avatar_h}

      The template variables that were used up to version 3.0.3
      have all been implemented as backward compabibility options,
      so no changes are needed in the templates. The new
      {USER->user_avatar} is only available under that name.

2008-07-01 3.0.3 Maurice Makaay

    - Fixed an undefined index warning.
      Thanks to Oliver Riesen for noticing.

2008-01-08 3.0.2 Maurice Makaay

    - The image dimensions (width and height) for avatar images are
      now stored in the user avatar data. Extra template variables
      {OBJECT->mod_user_avatar_w} and {OBJECT->mod_user_avatar_h}
      have been introduced to make this information available from the
      templates. This can be used to assign a correct width and height
      to avatar images. See the README for updated template examples.

      The idea for this was provided by Phorum user "tomierna". He also
      provided a patch, but that one had to retrieve the image data for
      the avatars on each request to determine the filesize. Since we
      already have the dimensions available, right after the avatar file
      upload, I figured we could better remember that data from there
      to make this a really lightweight option.

2007-11-01 3.0.1 Maurice Makaay

    - Added Russian language file.
      Thanks to user "born2die" at phorum.org.

    - Added German language files.
      Thanks to user "Berti" at phorum.org.

    - Added French language file.
      Thanks to notre-planete.info.

    - Added Turkish language file.
      Thanks to user "scabboy" at phorum.org.

    - Added Italian language file.
      Thanks to Nicola.

2007-09-14 3.0.0 Maurice Makaay

- First stable release for Phorum 5.2.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce



Edited 10 time(s). Last edit at 09/01/2016 09:38AM by Oliver Riesen-Mallmann.
Attachments:
open | download - user_avatar-3.0.5.zip (24.2 KB)
Re: Module: User Avatar
October 22, 2007 03:11PM
FYI, to implement these in the emerald template, I put the following in read.tpl
<td width="100%">
    {IF MESSAGES->mod_user_avatar}
        <img src="{MESSAGES->mod_user_avatar}" alt="" style="float: left;margin-right: 5px;" />
    {/IF}
    <div class="message-author icon-user">
        {IF MESSAGES->URL->PROFILE}<a href="{MESSAGES->URL->PROFILE}">{/IF}{MESSAGES->author}{IF MESSAGES->URL->PROFILE}</a>{/IF}
        {IF MESSAGES->URL->PM}<small>[ <a href="{MESSAGES->URL->PM}">{LANG->PrivateReply}</a> ]</small>{/IF}
    </div>

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Module: User Avatar
October 23, 2007 01:18PM
Weee avatar on Phorum.org :-)

Sergej

------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Re: Module: User Avatar
October 24, 2007 01:01PM
Gee, Wee!

A nice module addtion to phorum!

[opensourceCMS.com]
[ongetc.com]
Chanh Ong
Re: Module: User Avatar
October 27, 2007 06:07AM
This mod is too easy to install ;-). Works great for me!

Thank you!
Re: Module: User Avatar
December 30, 2007 04:41PM
If you want to even further enhance the display of the avatar, you can hide default user icon if there is an avatar available. In that case the default user icon will display only if the user didn't set the avatar or disabled it in the user's profile.

Here's the code for the "read.tpl" within the "emerald" template.

<td width="100%">
	{IF MESSAGES->mod_user_avatar}
		<img src="{MESSAGES->mod_user_avatar}" alt="" style="float: left; margin-right: 5px;" />
		<div class="message-author">
	{ELSE}
		<div class="message-author icon-user">
	{/IF}
		{IF MESSAGES->URL->PROFILE}<a href="{MESSAGES->URL->PROFILE}">{/IF}{MESSAGES->author}{IF MESSAGES->URL->PROFILE}</a>{/IF}
		{IF MESSAGES->URL->PM}<small>[ <a href="{MESSAGES->URL->PM}">{LANG->PrivateReply}</a> ]</small>{/IF}
		</div>
		<small>
		<strong>{MESSAGES->subject} {IF MESSAGES->new}<span class="new-flag">{MESSAGES->new}</span>{/IF}</strong><br />
		{MESSAGES->datestamp}
		</small>
</td>

Normally the default icon is hidden behind the avatar, but if the avatar is transparent the icon would show beneath. The upper condition solves the problem for that case.

--
Regards,
Mario
Re: Module: User Avatar
January 04, 2008 06:40PM
I uploaded version 3.0.2.This implements a feature as proposed by tomierna: add some extra template variables that indicate the width and height of the avatar image. See the Changelog and README in the new package for more info.

Tom proposed a patch, but I didn't go with that one. We have the dimension information already available at avatar upload time, so I figured we could best store it right away, so we don't have to retrieve the required avatar images and determine their sizes on each request. This makes it a really light weight feature.

One drawback is that the data is only stored for newly uploaded images. So for existing images, there is no size information available. To pull this straight, we would need an upgrade script that - for al users - fills the data in $user['mod_user_avatar']['image_info'] with the info for the available avatar images. If somebody wants to write that: all or most of the required elements can be found in the user_avatar.php file.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
User Avatar without Cookies
January 05, 2008 12:38PM
Hello Maurice,
i have testing my Forum without Cookies.

Look at this Link of the Avatarpicture:
<td style="text-align:right; vertical-align:middle">
<img src="http.//test.clever-forum.de/file.php?0,file=11,filename=berti.jpg,phorum_session_v5=2%3A1013fxxxxxxxxxxea9fc2a902bc0c2" />

With session_v5 it don't works

Thanks
Berti

I speek swabian and german very well - not english :-(

My Phorum on [clever-forum.de]

My testfforum with version 5.2.x is on [test.clever-forum.de] (user: Phorum password: Clever)
Re: User Avatar without Cookies
January 05, 2008 02:15PM
I don't know what's going on. I'm testing on your forum without cookies and it doesn't show the image. If I right click it and select "view image" however, it shows up fine. Also, if I hit the back button in my browser after viewing the image, I see it in the posting!

I have currently no idea why the browser trips over the image when loaded in the page :-/ I somebody else has a clue, please share it.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: User Avatar without Cookies
January 05, 2008 02:21PM
hello Maurice,
i had deaktivated Cookies in the adminarea. since a few minutes not.

Now i deaktivate Cookies again.
phorumone is now admin ;-)
You can now more...

I thinks thats a problem with file.php
Embed Images works also wrong.

Thanks Berti

I speek swabian and german very well - not english :-(

My Phorum on [clever-forum.de]

My testfforum with version 5.2.x is on [test.clever-forum.de] (user: Phorum password: Clever)
Sorry, only registered users may post in this forum.

Click here to login