Wrighty Very Senior Member
    
![[Avatar]](http://av.wrighty.info/av.png) Posts: 3,269 Status: Offline Gender: Male Joined: 16th Dec 2007
| | Avatar Anywhere (9th Mar 08 at 12:20am) | | Preview
This code allows you to display the user's avatar anywhere that you so wish. It's rather awesome to be honest! 
Global Header: <script type="text/javascript"> /*Avatar Anywhere Coded By Wrighty*/
var functions = { av: document.createElement('img'), save: function(prefix, item, place){ if(get(place,'name')[0].value.match('{'+prefix+': (.+?)}')){ get(place,'name')[0].value = get(place,'name')[0].value.replace(RegExp.$1, item); }else{ get(place,'name')[0].value += '{'+prefix+': '+item+'}'; } }, load: function(prefix){ if(vf_hiddenvars.match('{'+prefix+': (.+?)}')){ return RegExp.$1.replace(/(\[|\])/g,''); }else{ return ''; } }, build: function(){ with(this.av){ src = this.load('av-url'); height = this.load('av-height'); width = this.load('av-width'); } get('av_hold','id').appendChild(this.av); } } </script>
Global Footer: <script type="text/javascript"> /*Avatar Anywhere Coded By Wrighty*/ if(location.href.match(/\/modify_profile\/user\/(.+?)($|\/$)/) && RegExp.$1 == vf_username){ var f = document.profile_form if(document.addEventListener){ f.addEventListener('submit', function(){ functions.save('av-url','['+get("avatar_url","name")[0].value+']','hidden'); functions.save('av-width', '['+get("avatar_width","name")[0].value+']', 'hidden'); functions.save('av-height', '['+get("avatar_height","name")[0].value+']', 'hidden');} , false); }else{ f.attachEvent('onsubmit', function(){ functions.save('av-url','['+get("avatar_url","name")[0].value+']','hidden'); functions.save('av-width', '['+get("avatar_width","name")[0].value+']', 'hidden'); functions.save('av-height', '['+get("avatar_height","name")[0].value+']', 'hidden');});
} } functions.build(); </script>
Now, to decide where to put the avatar, we use a simple 'div' with id: 'av_hold'. The code will then put the avatar in that div with the correct height and width too! 
<div id='av_hold'></div>
Enjoy. | | Back to Top - Link to Post - Last edit: 9th Mar 08 at 12:40am by Wrighty |
 |
|
Darkmage Senior Member
    I will never be a MEMORY!!!
![[Avatar]](http://i185.photobucket.com/albums/x20/magedesigns/vforums/kenny_1_12199_4450_thumb.png) I'm like a Ninja! I lurk in the shadows behind you, one swift attack will bring you down. Posts: 1,719 Status: Offline Gender: Male Location: In the Shadows. Age: 18 Joined: 25th Nov 2007
| | Re: Avatar Anywhere (9th Mar 08 at 12:32am) | | You know its coming.....Were is the preview?  | | Back to Top - Link to Post |



|
|
Wrighty Very Senior Member
    
![[Avatar]](http://av.wrighty.info/av.png) Posts: 3,269 Status: Offline Gender: Male Joined: 16th Dec 2007
| |
Darkmage Senior Member
    I will never be a MEMORY!!!
![[Avatar]](http://i185.photobucket.com/albums/x20/magedesigns/vforums/kenny_1_12199_4450_thumb.png) I'm like a Ninja! I lurk in the shadows behind you, one swift attack will bring you down. Posts: 1,719 Status: Offline Gender: Male Location: In the Shadows. Age: 18 Joined: 25th Nov 2007
| |
Wrighty Very Senior Member
    
![[Avatar]](http://av.wrighty.info/av.png) Posts: 3,269 Status: Offline Gender: Male Joined: 16th Dec 2007
| |
Dwight Senior Member
   
![[Avatar]](http://i25.photobucket.com/albums/c51/dog199200/Naruto/RockLeeAvi.gif) I'm an evil turkey!!! Posts: 994 Status: Offline Gender: Male Location: Behind You Age: 16 Joined: 21st Jan 2008
| | Re: Avatar Anywhere (9th Mar 08 at 12:44am) | | | wondering, this may sound a little weird but could it even be used an a place where you put in a url such as the on/off icon places? | | Back to Top - Link to Post |


 |
|
Wrighty Very Senior Member
    
![[Avatar]](http://av.wrighty.info/av.png) Posts: 3,269 Status: Offline Gender: Male Joined: 16th Dec 2007
| | Re: Avatar Anywhere (9th Mar 08 at 12:47am) | | No, but a code could be made to use the avatar as an on/off icon!  | | Back to Top - Link to Post |
 |
|
Dwight Senior Member
   
![[Avatar]](http://i25.photobucket.com/albums/c51/dog199200/Naruto/RockLeeAvi.gif) I'm an evil turkey!!! Posts: 994 Status: Offline Gender: Male Location: Behind You Age: 16 Joined: 21st Jan 2008
| | Re: Avatar Anywhere (9th Mar 08 at 12:55am) | | | no its ok, i was just wondering to what extent that it could be used. | | Back to Top - Link to Post |


 |
|
Darkmage Senior Member
    I will never be a MEMORY!!!
![[Avatar]](http://i185.photobucket.com/albums/x20/magedesigns/vforums/kenny_1_12199_4450_thumb.png) I'm like a Ninja! I lurk in the shadows behind you, one swift attack will bring you down. Posts: 1,719 Status: Offline Gender: Male Location: In the Shadows. Age: 18 Joined: 25th Nov 2007
| | Re: Avatar Anywhere (9th Mar 08 at 2:05am) | | it looks ok I guess, but pointless, you can just add Html Tags from Photobucket or image shack. and put it any were in the head/foot of any board, even the board Description.  | | Back to Top - Link to Post - Last edit: 9th Mar 08 at 2:06am by Darkmage |



|
|
Cryhavoc_ Full Member
  
Just do it. Posts: 238 Status: Offline Gender: Male Location: The wrong way. Age: 15 Joined: 3rd Jan 2008
| | Re: Avatar Anywhere (9th Mar 08 at 2:49am) | | Wrighty has a new soulmate: hidden_vars.
Whens the wedding Wrighty boy?  | | Back to Top - Link to Post |
|
|
Fel!x Full Member
  
[AVATAR] Posts: 168 Status: Offline Gender: Male Location: Sydney Age: 15 Joined: 1st Jan 2008
| |
Wrighty Very Senior Member
    
![[Avatar]](http://av.wrighty.info/av.png) Posts: 3,269 Status: Offline Gender: Male Joined: 16th Dec 2007
| |
Ash. Full Member
  
![[Avatar]](http://needaear.com/a/alwaysloveyou.gif) Posts: 477 Status: Offline Joined: 5th Jan 2008
| |
Darkmage Senior Member
    I will never be a MEMORY!!!
![[Avatar]](http://i185.photobucket.com/albums/x20/magedesigns/vforums/kenny_1_12199_4450_thumb.png) I'm like a Ninja! I lurk in the shadows behind you, one swift attack will bring you down. Posts: 1,719 Status: Offline Gender: Male Location: In the Shadows. Age: 18 Joined: 25th Nov 2007
| | Re: Avatar Anywhere (28th Jul 08 at 5:12am) | |   it looks ok I guess, but pointless, you can just add Html Tags from Photobucket or image shack. and put it any were in the head/foot of any board, even the board Description.   But this code makes it so whoever is logged in's avatar appears, if you logged in you'd see your avatar in that place while I'd see mine. If you wanted everyone to see your avatar you could do what you said ;] Nice code Wrighty, could come in handy very soon =] 
For that point, then that's alright. | | Back to Top - Link to Post |



|
|