SMF For Free Support Forum

SMF For Free Support => SMF For Free Codes and Support => Code Requests => Topic started by: OutOfOrder on December 13, 2008, 04:25:14 pm

Title: The "No Avatar" Option
Post by: OutOfOrder on December 13, 2008, 04:25:14 pm
Forum Url: http://funcentral.smfforfree2.com
I had recently (well actually about a week- 2 weeks ago) made a topic about a code that would place an image as a default image for a user. This means that if they do not select an avatar, they will have this as their basic avatar (their default avatar).

Since no one has replied to the topic that I made, I have assumed that there is no such code/ option on the SMF For Free forums that do something like this. So I have created a new topic here so that someone can please add this to the forums.

Thanks!

-OutOfOrder-
Title: Re: The "No Avatar" Option
Post by: Colette Brunel on December 13, 2008, 06:02:39 pm
Code: [Select]
$("img:contains('View Profile')").before("<img src='http://somewhere.com/images/default_avatar.png' alt='*' /><br />");
However that makes everyone have a default avatar even if they actually set themselves an avatar. It's either a universal default avatar or everyone has their own choice.
Title: Re: The "No Avatar" Option
Post by: simply sibyl on December 13, 2008, 06:05:31 pm
Forum Url: http://funcentral.smfforfree2.com
I had recently (well actually about a week- 2 weeks ago) made a topic about a code that would place an image as a default image for a user. This means that if they do not select an avatar, they will have this as their basic avatar (their default avatar).

Since no one has replied to the topic that I made, I have assumed that there is no such code/ option on the SMF For Free forums that do something like this. So I have created a new topic here so that someone can please add this to the forums.

Thanks!

-OutOfOrder-

If you do not get a reply for several days you can always bump the topic up but please dont keep making new topics for it

moved to the codes board as that is the only way this could be achieved
Title: Re: The "No Avatar" Option
Post by: OutOfOrder on December 14, 2008, 03:16:16 pm
oh.. sorry... i thought that because no one had replied to that one, that no such thing existed, so i put it in the suggestions section.. because that was what it was... a suggestion...

ok. maybe this is too hard to do...

here is a better question, how do you change/ block some of the avatar selections?

For example, you can see "no pic" and then [Actors] and then [Anime Avatar], etc.

How do you block some of those and then also change some of them?

i think this will be an easier question because that is what has been done to this forum. (i see that there are only 2 choices sections on this forum).

Title: Re: The "No Avatar" Option
Post by: simply sibyl on December 14, 2008, 03:27:02 pm
You cannot change them on your hosted forum
Smf for Free is able to do more here at support as he has access to, and can edit files we do not have access to -  you'll notice some things are different here.
Title: Re: The "No Avatar" Option
Post by: OutOfOrder on December 17, 2008, 06:17:17 am
ok.

i will try to make a code that will do what i want then... and then maybe if it works release it to the public for general use.

Title: Re: The "No Avatar" Option
Post by: OutOfOrder on December 17, 2008, 03:38:32 pm
does anyone have any clues on how to make this?

i can make it if someone can please tell me what i need to target and what i need to put inorder to change the pic from nothing to something...

please someone..

thanks in advance!
Title: Re: The "No Avatar" Option
Post by: Colette Brunel on December 17, 2008, 06:25:20 pm
I've already answered your original topic-question.

In reference to the profile-default-avatar change code, you can perhaps manipulate the javascript that creates that area. By that area, I mean this script when you're editing your profile info:

Code: [Select]
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var files = ["Actors/Brad_Pitt.jpg", "Actors/Bruce_Campbell.jpg", "Actors/Bruce_Willis.jpg", "Actors/Cameron_Diaz.jpg", "Actors/Charisma_Carpenter.jpg", "Actors/Christopher_Lambert.jpg", "Actors/Claudia_Schiffer.jpg", "Actors/David_Boreanaz.jpg", "Actors/David_Spade.jpg", "Actors/Denise_Richards.jpg", "Actors/Emilio_Estevez.jpg", "Actors/Eva_Habermann.jpg", "Actors/Freddie_Prinze_Jr.jpg", "Actors/Gwyneth_Paltrow.jpg", "Musicians/Alanis_Morissette.jpg", "Musicians/Avril_Lavigne.jpg", "Musicians/Bob_Marley.jpg", "Musicians/Britney_Spears.jpg", "Musicians/Cardigans.jpg", "Musicians/Christina_Aguilera.jpg", "Musicians/Dido.jpg", "Musicians/Eminem.jpg", "Musicians/Jewel.jpg", "Musicians/Jon_Bon_Jovi.jpg", "Musicians/Korn.jpg", "Musicians/Limp_Bizkit.jpg", "Musicians/Linkin_Park.jpg", "Musicians/Nirvana.jpg", "Musicians/No_Doubt.jpg", "Musicians/Queen.jpg", "Musicians/Shakira.jpg", "Musicians/U2.jpg"];
var avatar = document.getElementById("avatar");
var cat = document.getElementById("cat");
var selavatar = "";
var avatardir = "http://smfsupport.com/support/cavatars/";
var size = avatar.alt.substr(3, 2) + " " + avatar.alt.substr(0, 2) + String.fromCharCode(117, 98, 116);
var file = document.getElementById("file");

if (avatar.src.indexOf("blank.gif") > -1)
changeSel(selavatar);
else
previewExternalAvatar(avatar.src)

function changeSel(selected)
{
if (cat.selectedIndex == -1)
return;

if (cat.options[cat.selectedIndex].value.indexOf("/") > 0)
{
var i;
var count = 0;

file.style.display = "inline";
file.disabled = false;

for (i = file.length; i >= 0; i = i - 1)
file.options[i] = null;

for (i = 0; i < files.length; i++)
if (files[i].indexOf(cat.options[cat.selectedIndex].value) == 0)
{
var filename = files[i].substr(files[i].indexOf("/") + 1);
var showFilename = filename.substr(0, filename.lastIndexOf("."));
showFilename = showFilename.replace(/[_]/g, " ");

file.options[count] = new Option(showFilename, files[i]);

if (filename == selected)
{
if (file.options.defaultSelected)
file.options[count].defaultSelected = true;
else
file.options[count].selected = true;
}

count++;
}

if (file.selectedIndex == -1 && file.options[0])
file.options[0].selected = true;

showAvatar();
}
else
{
file.style.display = "none";
file.disabled = true;
document.getElementById("avatar").src = avatardir + cat.options[cat.selectedIndex].value;
document.getElementById("avatar").style.width = "";
document.getElementById("avatar").style.height = "";
}
}

function showAvatar()
{
if (file.selectedIndex == -1)
return;

document.getElementById("avatar").src = avatardir + file.options[file.selectedIndex].value;
document.getElementById("avatar").alt = file.options[file.selectedIndex].text;
document.getElementById("avatar").alt += file.options[file.selectedIndex].text == size ? "!" : "";
document.getElementById("avatar").style.width = "";
document.getElementById("avatar").style.height = "";
}

function previewExternalAvatar(src)
{
if (!document.getElementById("avatar"))
return;

var maxHeight = 65;
var maxWidth = 65;
var tempImage = new Image();

tempImage.src = src;
if (maxWidth != 0 && tempImage.width > maxWidth)
{
document.getElementById("avatar").style.height = parseInt((maxWidth * tempImage.height) / tempImage.width) + "px";
document.getElementById("avatar").style.width = maxWidth + "px";
}
else if (maxHeight != 0 && tempImage.height > maxHeight)
{
document.getElementById("avatar").style.width = parseInt((maxHeight * tempImage.width) / tempImage.height) + "px";
document.getElementById("avatar").style.height = maxHeight + "px";
}
document.getElementById("avatar").src = src;
}
// ]]></script>

Unsetting each variable or "hiding" the entire script via another script (using jQuery or similar) in the header and then creating your own by following similar formats would be the best way to go about this.
Title: Re: The "No Avatar" Option
Post by: Agent Moose on December 18, 2008, 04:31:01 pm
I have tried to create a code like this, but It didn't look very well because there is no spot to actually insert an image to where it should go.

I can try again though :)
Title: Re: The "No Avatar" Option
Post by: OutOfOrder on December 19, 2008, 01:34:47 pm
I would love if you could do that!!

thanks!

I also found this: I think you have to download it and then it will work for some people's smf forums or something... maybe it will help you

http://custom.simplemachines.org/mods/index.php?mod=975
Title: Re: The "No Avatar" Option
Post by: Agent Moose on December 20, 2008, 06:21:31 pm
Your request has been finished!

http://www.smfsupport.com/support/smf_for_free_codes_and_support/code_default_avatar-t23480.0.html
Title: Re: The "No Avatar" Option
Post by: OutOfOrder on December 20, 2008, 06:24:36 pm
thank you!!!  ;D
Title: Re: The "No Avatar" Option
Post by: zammymage on December 26, 2008, 03:11:37 am
nice i would like this