Default Avatar

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

Previous topic - Next topic

snooks

No joker i am already on SMF 201 but my default avatar is 2.1 and new version is 2.2 but when i try to uninstall 2.1 to install 2.2 i have a few test failed errors
hope that explains it better

thanks

Joker™

Quote from: snooks on October 19, 2011, 08:25:37 AM
No joker i am already on SMF 201 but my default avatar is 2.1 and new version is 2.2 but when i try to uninstall 2.1 to install 2.2 i have a few test failed errors
hope that explains it better

thanks
If you are comfortable with manual edits, go to the packages directory using ftp. Download a zip file in there named something as "Default Avatar For SMF 2x.zip".

Attach that zip file here and do mention that while your uninstallation attempt which files have showed you errors.
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

snooks

#122
No joker im not comfortable with more than one edit sorry to say very scared to mess things up  :-[
Ive attached the file you asked and here is those test failed errors many thanks for your support joker

./Sources/Subs.php - find

// Default avatar mod starts here.
if(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']) && ($context['user']['gender'] == '1') && !empty($modSettings['default_male_avatar_url']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $modSettings['default_male_avatar_url'] . '" />',
'href' => '',
'url' => '',
);

elseif(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']) && ($context['user']['gender'] == '2') && !empty($modSettings['default_female_avatar_url']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $modSettings['default_female_avatar_url'] . '" />',
'href' => '',
'url' => '',
);

elseif(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']) && !empty($modSettings['default_avatar_url']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $modSettings['default_avatar_url'] . '" />',
'href' => $modSettings['default_avatar_url'],
'url' => '',
);

elseif(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $settings['images_url'] . '/default_avatar.png" />',
'href' => '',
'url' => '',
);
// Default avatar mod ends.

// Figure out how long they've been logged in.


replace with -

      // Figure out how long they've been logged in.
=================


./Sources/ManageSettings.php - FIND

$config_vars = array(
// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!
array('check', 'enable_default_avatar'),
array('text', 'default_male_avatar_url'),
array('text', 'default_female_avatar_url'),
array('text', 'default_avatar_url', 50, 'subtext' => $txt['default_avatar_path']),


replace with -

$config_vars = array(
// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!
==========================


is that what you mean joker ?

Joker™

From the above post of yours I understand that you are having issues with following files while uninstalling the mod

- Subs.php
- ManageSettings.php

If that's the case, then make a back of both of the files somewhere on your PC before editing them


Sources/Subs.php
Code (Find and remove) Select

// Default avatar mod starts here.
if(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']) && ($context['user']['gender'] == '1') && !empty($modSettings['default_male_avatar_url']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $modSettings['default_male_avatar_url'] . '" />',
'href' => '',
'url' => '',
);

elseif(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']) && ($context['user']['gender'] == '2') && !empty($modSettings['default_female_avatar_url']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $modSettings['default_female_avatar_url'] . '" />',
'href' => '',
'url' => '',
);

elseif(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']) && !empty($modSettings['default_avatar_url']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $modSettings['default_avatar_url'] . '" />',
'href' => $modSettings['default_avatar_url'],
'url' => '',
);

elseif(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $settings['images_url'] . '/default_avatar.png" />',
'href' => '',
'url' => '',
);
// Default avatar mod ends.



Sources/ManageSettings.php
Code (Find and remove) Select
array('check', 'enable_default_avatar'),
array('text', 'default_male_avatar_url'),
array('text', 'default_female_avatar_url'),
array('text', 'default_avatar_url', 50, 'subtext' => $txt['default_avatar_path']),



Ohh and I placed the code in your post in [ code ] [ /code] tags.
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

T3CHN0

thankyou for such a great mod, works better then the other 2 default/generic avatar mods.
only problem is FireFox 7 doesn't recognize download names with spaces and your mod will download as
""default"" and not ""Default Avatar For SMF 2X.zip"" if you could rename your download file to Default_Avatar_For_SMF_2X.zip
it will stop others asking later on why there is no file extension on the download.
Maybe FireFox will fix there bug maybe not but to save everyones time. best to rename the download I think.

Cheers

snooks

Quote from: Joker™ on October 20, 2011, 12:02:45 PM
From the above post of yours I understand that you are having issues with following files while uninstalling the mod

- Subs.php
- ManageSettings.php

If that's the case, then make a back of both of the files somewhere on your PC before editing them


Sources/Subs.php
Code (Find and remove) Select

// Default avatar mod starts here.
if(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']) && ($context['user']['gender'] == '1') && !empty($modSettings['default_male_avatar_url']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $modSettings['default_male_avatar_url'] . '" />',
'href' => '',
'url' => '',
);

elseif(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']) && ($context['user']['gender'] == '2') && !empty($modSettings['default_female_avatar_url']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $modSettings['default_female_avatar_url'] . '" />',
'href' => '',
'url' => '',
);

elseif(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']) && !empty($modSettings['default_avatar_url']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $modSettings['default_avatar_url'] . '" />',
'href' => $modSettings['default_avatar_url'],
'url' => '',
);

elseif(empty($context['user']['avatar']['image']) && !empty($modSettings['enable_default_avatar']))
$context['user']['avatar'] = array(
'name' => '',
'image' => '<img class="avatar" src="' . $settings['images_url'] . '/default_avatar.png" />',
'href' => '',
'url' => '',
);
// Default avatar mod ends.



Sources/ManageSettings.php
Code (Find and remove) Select
array('check', 'enable_default_avatar'),
array('text', 'default_male_avatar_url'),
array('text', 'default_female_avatar_url'),
array('text', 'default_avatar_url', 50, 'subtext' => $txt['default_avatar_path']),



Ohh and I placed the code in your post in [ code ] [ /code] tags.

thanks joker i managed to do this  ;D

Joker™

Quote from: T3CHN0 on October 23, 2011, 09:51:26 AM
thankyou for such a great mod, works better then the other 2 default/generic avatar mods.
only problem is FireFox 7 doesn't recognize download names with spaces and your mod will download as
""default"" and not ""Default Avatar For SMF 2X.zip"" if you could rename your download file to Default_Avatar_For_SMF_2X.zip
it will stop others asking later on why there is no file extension on the download.
Maybe FireFox will fix there bug maybe not but to save everyones time. best to rename the download I think.

Cheers
yeah, I'll try my best to find some time by tomorrow to rename all of my mods around here :).
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

pixeleyes

During installation I got an error

3.    Execute Modification    ./Sources/ManageSettings.php    Test failed
1.    Add After    ./Sources/ManageSettings.php                            Test failed

So I tried to add manually code in ManageSettings.php but could not find below code in file.

Find
$config_vars = array(
// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!


So don't know where should I add below one.
Add after array('check', 'enable_default_avatar'),
array('text', 'default_male_avatar_url'),
array('text', 'default_female_avatar_url'),
array('text', 'default_avatar_url', 'subtext' => $txt['default_avatar_path']),
array('check', 'default_avatar_opacity'),


Joker™

Sources/ManageSettings.php

Attach the file over here.
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

Wiejeben

Does anyone know if http://www.somesite.com/avatars/$contect['user']/ is possible? (I'm using a service that grabs someones Minecraft avatar by URL.

T3CHN0

Quote from: Wiejeben on December 19, 2011, 05:08:41 AM
Does anyone know if http://www.somesite.com/avatars/$contect['user']/ is possible? (I'm using a service that grabs someones Minecraft avatar by URL.
I wouldn't think so
To my understanding the link you posted is cross linking
the first part beinghttp://www.somesite.com/avatars/ next part being $contact['user'] is making it look back onto your site
for example if your site was called http://www.mysit.com then your browser thinks your looking for
http://www.somesite.com/avatars/http://www.sysite.com/avatar to collect the avatar that a user has already selected.

I don't know for sure.... but this is how I would understand it.

I don't know how' you would redirect your site to look at another site for avatars.
I personally don't think it's a good idea thou... it will drag your site making it slower because
the avatars it needs to display are else where. and if say that other site stops leaches! you will no longer
see avatars and will need to fix it back to defaults again.

You would be better off downloading all the avatars and adding them to your site.
would be faster for your members and less forum lag.

Joker™

Quote from: T3CHN0 on December 19, 2011, 05:46:26 AM
I personally don't think it's a good idea thou... it will drag your site making it slower because
the avatars it needs to display are else where. and if say that other site stops leaches! you will no longer
see avatars and will need to fix it back to defaults again.

You would be better off downloading all the avatars and adding them to your site.
would be faster for your members and less forum lag.

Exact to the point reply. Thanks T3CHN0 ;).
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

Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

Seath

Hello,

I have smf 2.0.2 and I installed the Default Avatar mod, but the avatar doesn't shows up. I really don't know what else to say, because I have no idea what's wrong. I have no php errors or any error of any kind.

Thanks.

Shambles

@ Seath

Did you set the option(s) especially the first?

Admin > Configuration > Modification Settings > Miscellaneous

Enable Default Avatar
Image path for Default Avatar image for male members
Image path for Default Avatar image for female members
Image path for Default Avatar image

Seath

Well that's just embarrassing  :-X I guess I missed that part. I'm sorry  O:)
Its working now.
Thanks Shambles

FragaCampos

Thank you, it's a simple yet useful mod.

Working without errors on a heavy moded 2.0.4 forum.

Rain Forest

Thank for the mod! Works on SMF 2.0.4 :)

However: how can I make this compatible with the Buddy page mod: http://custom.simplemachines.org/mods/index.php?mod=2204


Joker™

Quote from: Soft Drink on July 10, 2013, 02:17:46 PM
Thank for the mod! Works on SMF 2.0.4 :)

However: how can I make this compatible with the Buddy page mod: http://custom.simplemachines.org/mods/index.php?mod=2204


Well it's not that hard to integrate mods with each other, but as the 'Buddy Page' doesn't not have any license associated to it, so I can't tweak it officially. I'll try to get in touch with Runic and see if we both can come up with some solution :).
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

Rain Forest

I'll wait for guys :)

Thanks, Joker :)

Advertisement: