Advertise Here

Author Topic: The "No Avatar" Option  (Read 3568 times)

0 Members and 1 Guest are viewing this topic.

Offline OutOfOrder

  • SMF For Free Sr. Member
  • *
  • Posts: 385
  • Creator of the X-treme Gaming Forums
    • View Profile
    • X-treme Gaming Forums!!!

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
The "No Avatar" Option
« 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-

Offline Colette Brunel

  • SMF For Free Sr. Member
  • *
  • Posts: 424
    • View Profile

  • Total Badges: 17
    Badges: (View All)
    Poll Voter Level 4 Fourth year Anniversary Windows User Topic Starter
Re: The "No Avatar" Option
« Reply #1 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.

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: The "No Avatar" Option
« Reply #2 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

Offline OutOfOrder

  • SMF For Free Sr. Member
  • *
  • Posts: 385
  • Creator of the X-treme Gaming Forums
    • View Profile
    • X-treme Gaming Forums!!!

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: The "No Avatar" Option
« Reply #3 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).


Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: The "No Avatar" Option
« Reply #4 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.
« Last Edit: December 14, 2008, 03:28:51 pm by simply sibyl »

Offline OutOfOrder

  • SMF For Free Sr. Member
  • *
  • Posts: 385
  • Creator of the X-treme Gaming Forums
    • View Profile
    • X-treme Gaming Forums!!!

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: The "No Avatar" Option
« Reply #5 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.


Offline OutOfOrder

  • SMF For Free Sr. Member
  • *
  • Posts: 385
  • Creator of the X-treme Gaming Forums
    • View Profile
    • X-treme Gaming Forums!!!

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: The "No Avatar" Option
« Reply #6 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!

Offline Colette Brunel

  • SMF For Free Sr. Member
  • *
  • Posts: 424
    • View Profile

  • Total Badges: 17
    Badges: (View All)
    Poll Voter Level 4 Fourth year Anniversary Windows User Topic Starter
Re: The "No Avatar" Option
« Reply #7 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.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: The "No Avatar" Option
« Reply #8 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 :)
Check out Revolution X's Brand new Code Index!

Offline OutOfOrder

  • SMF For Free Sr. Member
  • *
  • Posts: 385
  • Creator of the X-treme Gaming Forums
    • View Profile
    • X-treme Gaming Forums!!!

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: The "No Avatar" Option
« Reply #9 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

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: The "No Avatar" Option
« Reply #10 on: December 20, 2008, 06:21:31 pm »
Check out Revolution X's Brand new Code Index!

Offline OutOfOrder

  • SMF For Free Sr. Member
  • *
  • Posts: 385
  • Creator of the X-treme Gaming Forums
    • View Profile
    • X-treme Gaming Forums!!!

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: The "No Avatar" Option
« Reply #11 on: December 20, 2008, 06:24:36 pm »
thank you!!!  ;D

Offline zammymage

  • SMF For Free Full Member
  • *
  • Posts: 108
    • View Profile

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: The "No Avatar" Option
« Reply #12 on: December 26, 2008, 03:11:37 am »
nice i would like this

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
2320 Views
Last post May 13, 2007, 08:05:39 am
by Crasy
3 Replies
2410 Views
Last post July 27, 2007, 05:10:31 pm
by doggiedoo86
2 Replies
1387 Views
Last post November 14, 2007, 08:31:34 pm
by Nick_LRG
0 Replies
1140 Views
Last post May 15, 2008, 06:47:08 pm
by Lucas A33
1 Replies
822 Views
Last post November 09, 2008, 08:37:11 pm
by simply sibyl