Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Default avatar
Topic Started: Aug 4 2006, 06:49 PM (2,541 Views)
HelenaZF
Member Avatar
advanced techno feeb
 *   *   *   *   *   *   *  
Code by by CraZyJ
repost until topics are restored:

Code description: It adds a default avatar for everyone who doesn't yet have a avatar.
Code preview: click
Code placement: Board wrappers > Footers
Code instructions: Replace DEFAULT AVATAR IMAGE HERE with the url of the default avatar

Code:
 
<script type='text/javascript'>
/* Default avatar by CrAzY_J
do not redistribure this code without the creator's permission
This copyright header must stay intact at all times*/

var img = 'DEFAULT AVATAR IMAGE HERE';
if(/(showtopic|code=03)/i.test(this.location.href)){
var span = document.getElementsByTagName('span');
for(var s=0;s<span.length;s++){
if(span[s].className == 'postdetails' && /Posts:/.test(span[s].innerHTML) && !/img/i.test(span[s].firstChild.nodeName)){
var imag = document.createElement('img');
imag.border = '0';
imag.alt = 'Avatar';
imag.src = img;
span[s].insertBefore(imag,span[s].firstChild);
}
}
}else if(/showuser/i.test(this.location.href)){
var tr = document.getElementsByTagName('tr');
for(var r=0;r<tr.length;r++){
if(tr[r].cells.length == 2 && tr[r].cells[0].getElementsByTagName('b')[0] && /Avatar/.test(tr[r].cells[0].getElementsByTagName('b')[0].firstChild.data) && tr[r].cells[1].innerHTML == ''){
var imag = document.createElement('img');
imag.border = '0';
imag.alt = 'Avatar';
imag.src = img;
tr[r].cells[1].appendChild(imag);
}
}
}

</script>


[Edited to removed quote tags around code--conversion of this board to ZB caused quote tags to alter the code.]
Edited by HelenaZF, Mar 14 2009, 02:56 PM.
Offline Profile Quote Post Goto Top
 
Victory l
Member Avatar
Member
 *   *   *   *  
I saw this code somewhere. Anyways nice code :)
Offline Profile Quote Post Goto Top
 
Tatsuya ex
Member Avatar
Member
 *   *  
I'll be using this. >: )

Good job. It doesn't have any bugs, right?
Offline Profile Quote Post Goto Top
 
jrock
Member
 *  
me too thank you for puting this up for us thx
Offline Profile Quote Post Goto Top
 
RollEXE
Member Avatar
Member
 *  
There's only one drawback, in the PM screen everyone has this default avatar and the one they've got. Any ideas?
Offline Profile Quote Post Goto Top
 
crashpod
Member Avatar
Member
 *  
cool but ya the pm thing gets annoying >_<
Offline Profile Quote Post Goto Top
 
aang8again
Member Avatar
Evil Member <3
 *   *  
This code doesnt work for me :(
Offline Profile Quote Post Goto Top
 
Tony
Katorga-12

Please take a look at your other support topic.
Offline Profile Quote Post Goto Top
 
Twilight Sea
Member Avatar
Member
 *  
Why do you put it on the footer? And what annoying PM thing are you talking about, crashpod?
Offline Profile Quote Post Goto Top
 
Bombe
Tha Godfather
 *   *  
Could this be adjusted so that you can make it active for 1 or multiple user groups, instead of all?
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Code Snippets · Next Topic »
Add Reply