vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [f] Rank Mod Edit - View Topic
Topic Rating: *****
Printable View
dog199200
Guest
[f] Rank Mod Edit (7th Dec 08 at 5:20am UTC)
Resolved
can I get this code that that it will only show rank images, not the rank name. I'm using bar images with the rank name, and having the rank name and the image shown just takes up space and is repetitive.

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. var ranks = Array(); var r=0;
  4.  
  5. ranks[r++] = Array(0, 'Rookie Tamer', 1, 'http://i25.photobucket.com/albums/c51/dog199200/Digimon/rookietamer.png');
  6. ranks[r++] = Array(75, 'Young Tamer', 1, 'http://s1.images.proboards.com/star.gif');
  7. ranks[r++] = Array(150, 'Advanced Tamer', 2, 'http://i25.photobucket.com/albums/c51/dog199200/Digimon/advancedtamer.png');http://i25.photobucket.com/albums/c51/dog199200/Digimon/youngtamer.png
  8. ranks[r++] = Array(300, 'Star Tamer', 2, 'http://i25.photobucket.com/albums/c51/dog199200/Digimon/startamer.png');
  9. ranks[r++] = Array(600, 'Digi-Soldier', 3, 'http://i25.photobucket.com/albums/c51/dog199200/Digimon/digisoilder.png');
  10. ranks[r++] = Array(1200, 'Digi-Protector', 4, 'http://i25.photobucket.com/albums/c51/dog199200/Digimon/digiprotector.png');
  11. ranks[r++] = Array(2500, 'Digi-King', 5, 'http://i25.photobucket.com/albums/c51/dog199200/Digimon/digiking.png');
  12.  
  13. function assign_rank(display_name, posts) {
  14. if(!display_name.match(/group0/i)) {
  15. posts = parseInt(posts.replace(/,/g, ''));
  16. r = 0;
  17. while(ranks[r] && ranks[r][0] < posts) {
  18. r++;
  19. }
  20. if(r > 0)
  21. r--;
  22. var rank_str = "" + ranks[r][1] + "<br />";
  23. for(c=0; c<ranks[r][2]; c++) {
  24. rank_str += "<img src=\""+ ranks[r][3] +"\" alt=\"*\" />";
  25. }
  26. document.write(rank_str);
  27. }
  28. }
  29. //-->
  30. </script>
 
dog199200
Guest
Re: Rank Mod Edit (9th Dec 08 at 4:27pm UTC)
bump
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 33
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: (Simple Fix) Rank Mod Edit (13th Dec 08 at 12:09am UTC)
Simply change line 22 to:

var rank_str = "";

{Smile}

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: (Simple Fix) Rank Mod Edit (13th Dec 08 at 2:54am UTC)
{Tongue Out} i swear I am blind from time to time, ty
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 33
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: [f] Rank Mod Edit (13th Dec 08 at 5:24am UTC)
No problem. {Smile}

rroll.to— Shorten a link, rickroll your friends.
 Printable View

All times are GMT+0 :: The current time is 6:48am
Page generated in 0.159 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums