Default Avatar

Started by vbgamer45, July 30, 2010, 11:25:41 PM

Previous topic - Next topic

vbgamer45

Link to Mod

Link to Mod


If a user's has not selected or uploaded any avatar, then this mod shows a standard avatar on post pages.


Which mod package to download?
People using SMF 1.x download package named - Default Avatar For SMF 1x.zip
People using SMF 2.x download package named - Default Avatar For SMF 2x.zip


Settings to enable and disable it can be found at

For smf 1.x
Features and Options » Layout and Options

For SMF 2.x
Modification Settings » Miscellaneous.


The default_avatar.png images is located in
Theme><YourTheme>/images/default_avatar.png

you can simply change it with the image you like to be as default avatar for your forum members.(Do remember to give that image file also same name "default_avatar.png"


Change Log

Version 2.3
- Extended support for other mods.
- Change in license
- Mod added on GitHub
- Big fixes


Version 2.2
- Removed the w3c validation error
- Add option to make avatars transparent after a user having default avatar logs out.
Credit for transparent avatars idea goes to Project Evolution


Version 2.1 (SMF 2.0) and Version 1.4 (SMF 1.1.14)
- Mod updated for SMF 2.0 final and SMF 1.1.14
- License added to the mod
- Added 2 more features in mod
- Admin can add separate Default avatar images for users based on there genders (available for SMF 2.0 version only)


Version 2.0 * (SMF 2 RC4)
- Mod edits only source files, hence mod is compatible to all themes
- Now with the new version you can simply change the image path through settings panel only. You just have to place the image url and click save, the url image will become default image automatically.


Version 1.3 * (SMF 1.1.12) and  Version 1.4 * (SMF 2 RC4)
- Mod updated for SMF 1.1.12 and SMF 2.0 RC4


Version 1.2 * (SMF 1.1.11) and  version 1.3 * (SMF 2 RC3)
After uninstalling the mod image was not removed from images directory. This issue has been resolved now. Anyone facing the issue, simply install this version and uninstall it. Image from you images directory will be removed.


Version 1.1 * (SMF 1.1.11)
Added default avatar in Profile Header, Personal Messages and Profile Summary . Options are provided to enable and disable them also.


Version 1.2 * (SMF 2.0 RC3)
Added default avatar in Profile Header, Personal Messages and Profile Summary . Options are provided to enable and disable them also.


Mod released for SMF 1.1.11 also ;)


Version 1.1x
Removed extra slash from image transfer directory.(wasn't a major effect on mod , but still work should be done properly ;) )



FAQ's

1. How can I use default avatar in my mod?

Well to do this, you just need to place this code in your mod

if(function_exists('checkDefaultAvatar')) {
$context['user']['id']['avatar']['image'] = checkDefaultAvatar($context['buddies'][$uid]);
}



2. After putting the code my avatar images are gone?
While calling the function the data should be appended to the parameter which is carrying the avatar image. For e.g,
a) If you are using avatar image on '$context['user']['id']['avatar']' then use the above code as follow

if(function_exists('checkDefaultAvatar')) {
$context['user']['id']['avatar'] = checkDefaultAvatar($context['buddies'][$uid]);
}


b) If you are using avatar image on '$context['my_user']['id']['avatar']['img']' then use the above code as follow
if(function_exists('checkDefaultAvatar')) {
$context['my_user']['id']['avatar']['img'] = checkDefaultAvatar($context['buddies'][$uid]);
}




GitHub Link

All images/css used in the mod falls under the license used below.

License
* This SMF Modification is subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this SMF modification except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

frozenas

Hi. I'm not sure if this is supposed to be like that, just trying to help you with my barely new knowledge about PHP (Unfortunently most of the time i don't get support for plugins i'm trying to install, currently i need support for 3 of them. :/), but anyway, i've found this, when installing (double slashes):

./Themes/default/images//default_avatar.png

Although it works and it copies the image to /images folder. Don't know why it might be wrong, but it looks strange to me, lol. Sorry if it's alright, just trying to help.

Anyway, thanks for the modification, exatly what i needed. ;) Nice plugins you are doing.

PurpleCrow

SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Joker™

Quote from: frozenas on July 31, 2010, 08:14:37 AM
but anyway, i've found this, when installing (double slashes):

./Themes/default/images//default_avatar.png


Extra slashed removed , thanks for reporting it :) .

Thanks to both or you for such great comments ;D .
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

ɔɔɔɔɔɔuɥoɾ

Nice mod JokerTM


Well done :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Grim Line

#6
Great mod even more useful to me than the avatar on register mod. Good job! :)

Would there be anyway to have a default avatar thats pulled from a URL though?

Exochat

Great mod, read my mind as i was searching for something similar about 2 days ago and was disappointed nothing had been done!

Couple of small irrelevant things:

1) The instructions you have on the Mod Download page states Theme><YourTheme>default_avatar.png and you have missed out the IMAGES part of the directory.

It should read Theme><YourTheme>/images/default_avatar.png

Might save you a few support questions asking where it is located if you update your already simple and fantastic instructions to be correct :)

2) Do you know whether it will one day be compatible with such things as Dynamic Memberlist or Ultimate Profile, both of which display the users avatars and are not displaying your default one when its installed.

Otherwise, great Mod and should be included as standard on SMF forums!

Joker™

Quote from: Exochat on July 31, 2010, 06:31:27 PM
1) The instructions you have on the Mod Download page states Theme><YourTheme>default_avatar.png and you have missed out the IMAGES part of the directory.
It should read Theme><YourTheme>/images/default_avatar.png

Done :) , thanks for informing .

Quote2) Do you know whether it will one day be compatible with such things as Dynamic Memberlist or Ultimate Profile, both of which display the users avatars and are not displaying your default one when its installed.

Actually it is difficult to make a mod compatible to other mods , as there may be some other mods also , like these where you require default avatars.So, all i can say is you can take code from this mod and can add in those mods , as i tried to make the code as simple as possible .


Thanks for your comments :)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

arty5

I was wondering if their was a mod for this and yea their is now thanx mate i will install it :D
My Facebook Id : 1245925771

Community Message Boards - Create a Free Sig Now


Community Message Boards - My Main Forum

Joker™

#10
was sitting idle today and was thinking of adding some more features in it.Avatar is shown at 3 places

1.Header
2.Posts
3.Profile Summary

How about showing default avatar at all these places and adding permission for each membergroup that at which of these 3 places avatar should be shown. What do you guys say about this ? If you people find it interesting then only i'll start working on it.


Edit - Mod released for SMF 1.1.11 :). [Do report if you find any bug in it]
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Grim Line

I think thats a great idea Joker :)

diamondred123

Quote from: Nick; on August 15, 2010, 04:59:32 PM
I think thats a great idea Joker :)

i posted in the coders section for it and he made the mod :D
Learner but knows a little

Joker™

Quote from: Nick; on August 15, 2010, 04:59:32 PM
I think thats a great idea Joker :)
Quote from: diamondred123 on August 15, 2010, 05:10:14 PM
Quote from: Nick; on August 15, 2010, 04:59:32 PM
I think thats a great idea Joker :)
i posted in the coders section for it and he made the mod :D

Right now i'm in no mood to upgrade it here , i might release it at my site if feel like working on it.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

#14
Mod upgraded to version 1.2 for SMF 2.0 RC3.
Change log*

Added default avatar in Profile Header, Personal Messages and Profile Summary . Options are provided to enable and disable them also.

In next upgrade i'm planning to get the code out of template files and put them in source files ;). ( Above upgrade for SMF 1.1x will be done very soon. )
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

Mod upgraded to version 1.1 for SMF 1.1.11
Change log*

Added default avatar in Profile Header, Personal Messages and Profile Summary . Options are provided to enable and disable them also.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

pugcabclub

Ive uplaoded the package, but cant find modifications>misc whereabouts is it please :-\ :-\ :-\ :-\

Joker™

#17
Quote from: pugcabclub on August 27, 2010, 03:57:43 PM
Ive uplaoded the package, but cant find modifications>misc whereabouts is it please :-\ :-\ :-\ :-\
have you installed the mod ? as after installation you will be automatically redirected to the Modification Settings page .(which smf version are you using ?)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

pugcabclub

Im using smf 1.1.11

The package is showing as being installled

Joker™

#19
in smf 1.1.11 option are in

admin panel >> Features and Options >> Layout and Options (but the mod should have redirected you automatically)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Advertisement: