vForums Support > Programming & Coding :: Code Requests & Support :: > [F] Re-Define Avatar Size Limits

[F] Re-Define Avatar Size Limits - Posted By CåñåÐå™ (canada) on 27th Feb 08 at 12:56pm
I was wondering if it is possible to get an code so i can set the avatar size more than 100x100px please.

Re: Re-Define Avatar Size Limits - Posted By Michael (wrighty) on 27th Feb 08 at 10:52pm
Do you want to impose a new limit? Or just default it to the current avatar size?

Try this:

Code:
 
  1. <script>
  2. /*Remove Avatar Max Size
  3. Created By Wrighty*/
  4.  
  5. for(i=0;i<get('img','tag').length;i++){
  6.     if(get('img','tag')[i].alt == '[Avatar]'){
  7.         get('img','tag')[i].removeAttribute('style');
  8.     }
  9. }
  10. </script>
 

Re: Re-Define Avatar Size Limits - Posted By CåñåÐå™ (canada) on 27th Feb 08 at 11:30pm
I want to impose a new limit please.

Say i wanted to have an avatar 140x140 , i would like to have all avatars at that size . {Smile}

Ok wait this code will allow me to change my avatar size ??

And it goes in Global Footer?

Re: Re-Define Avatar Size Limits - Posted By Michael (wrighty) on 27th Feb 08 at 11:37pm
ooo ok...

try this:

Code:
 
  1. <script>
  2. /*New Max Av Size
  3. Created By Wrighty*/
  4.  
  5. for(i=0;i<get('img','tag').length;i++){
  6.     if(get('img','tag')[i].alt == '[Avatar]'){
  7.         get('img','tag')[i].removeAttribute('style');
  8.         get('img','tag')[i].height = (get('img','tag')[i].height > 140)? '140' : get('img','tag')[i].height;
  9.         get('img','tag')[i].width = (get('img','tag')[i].width > 140)? '140' : get('img','tag')[i].width;
  10.     }
  11. }
  12. </script>
 





Global FooteR! {Smile}

Re: Re-Define Avatar Size Limits - Posted By CåñåÐå™ (canada) on 27th Feb 08 at 11:42pm
Its in my Global Footer and i'm sorry Wrighty but it doesn't work bro.
http://tropolis.virtualforums.co.uk/

Re: Re-Define Avatar Size Limits - Posted By Michael (wrighty) on 27th Feb 08 at 11:46pm
I have tested it on my forum and it works.

Code:
 
  1. <script>
  2. /*Remove Avatar Max Size
  3. Created By Wrighty*/
  4.  
  5. for(i=0;i<get('img','tag').length;i++){
  6.     if(get('img','tag')[i].alt == '[Avatar]'){
  7.         get('img','tag')[i].removeAttribute('style');
  8.         get('img','tag')[i].height = (get('img','tag')[i].height > 140)? '140' : get('img','tag')[i].height;
  9.         get('img','tag')[i].width = (get('img','tag')[i].width > 140)? '140' : get('img','tag')[i].width;
  10.     }
  11. }
  12.  
  13. </script>
 



That?

Re: Re-Define Avatar Size Limits - Posted By CåñåÐå™ (canada) on 27th Feb 08 at 11:57pm
It doesn't seems to change anything Wrighty , i even tried the first code you gave and that wouldn't work {Cry} .

I'm i putting it in the right place?

Re: Re-Define Avatar Size Limits - Posted By Michael (wrighty) on 27th Feb 08 at 11:58pm
Hold on, I might have mis understood you. Do you want the av to be 140 x 140 irrespective of anything? Try this:

Code:
 
  1. <script>
  2. /*Remove Avatar Max Size
  3. Created By Wrighty*/
  4.  
  5. for(i=0;i<get('img','tag').length;i++){
  6.     if(get('img','tag')[i].alt == '[Avatar]'){
  7.         get('img','tag')[i].removeAttribute('style');
  8.         get('img','tag')[i].height = '140';
  9.         get('img','tag')[i].width = '140';
  10.     }
  11. }
  12.  
  13. </script>
 

Re: Re-Define Avatar Size Limits - Posted By CåñåÐå™ (canada) on 28th Feb 08 at 12:01am
That's it Wrighty its perfect my friend thank you {Grin} .

Re: Re-Define Avatar Size Limits - Posted By Michael (wrighty) on 28th Feb 08 at 12:03am
{Grin}