vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Another custom profile fields in mini-profile code - View Topic
Topic Rating: *****
Printable View
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Another custom profile fields in mini-profile code (20th Dec 09 at 9:32pm UTC)
Forum: Vyren Entar Battle Network RP (Maintenance Mode enabled)

Global Header:
Code:
 
  1. <script type="text/javascript">
  2.  
  3.     function CFix(CType,CAmt){
  4.         
  5.         var CAmtFull = CAmt
  6.         var CAmt = parseInt(Dyou.replace(/[^0-9]/gi, ''));
  7.         
  8.         var CAmt2 = 0;
  9.         var CAmtBy2 = 0;
  10.         var CAmt3 = 0;
  11.         var CAmtBy3 = 0;
  12.         var CFixPost = '';
  13.  
  14.         var CTypeName = '';
  15.         var CTypeName2 = '';
  16.         var CTypeName3 = '';
  17.         
  18.         var CImg = '';
  19.         var CImg2 = '';
  20.         var CImg3 = '';
  21.         
  22.         switch(CType)
  23.         {
  24.             
  25.             case 'Watt':
  26.                 CAmtBy3 = 1000000000;
  27.                 CAmtBy2 = 1000000;
  28.                 
  29.                 CTypeName = 'Watts';
  30.                 CTypeName2 = 'Mega Watts';
  31.                 CTypeName3 = 'Giga Watts';
  32.                 
  33.                 CImg = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/Watt.gif';
  34.                 CImg2 = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/Watt2.gif';
  35.                 CImg3 = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/Watt3.gif';
  36.                 
  37.                 break;
  38.             
  39.             case 'Byte':
  40.                 CAmtBy3 = 1000000000;
  41.                 CAmtBy2 = 1000000;
  42.                 
  43.                 CTypeName = 'Bytes';
  44.                 CTypeName2 = 'Mega Bytes';
  45.                 CTypeName3 = 'Giga Bytes';
  46.                 
  47.                 CImg = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/Byte.gif';
  48.                 CImg2 = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/Byte2.gif';
  49.                 CImg3 = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/Byte3.gif';
  50.                 
  51.                 break;
  52.             
  53.             case 'Control':
  54.                 CAmtBy3 = 1000000;
  55.                 CAmtBy2 = 10000;
  56.                 
  57.                 CTypeName = 'Control';
  58.                 CTypeName2 = 'Elite Control';
  59.                 CTypeName3 = 'Master Control';
  60.                 
  61.                 CImg = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/Control.gif';
  62.                 CImg2 = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/Control2.gif';
  63.                 CImg3 = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/Control3.gif';
  64.                 
  65.                 break;
  66.             
  67.             case 'VE-Token':
  68.                 CAmtBy3 = 250;
  69.                 CAmtBy2 = 50;
  70.                 
  71.                 CTypeName = 'VE Tokens';
  72.                 CTypeName2 = 'Silver VE Tokens';
  73.                 CTypeName3 = 'Gold VE Tokens';
  74.                 
  75.                 CImg = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/VE-Token-1.gif';
  76.                 CImg2 = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/VE-Token2.gif';
  77.                 CImg3 = 'http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/VE-Token3.gif';
  78.                 
  79.                 break;
  80.  
  81.         }
  82.  
  83.         if(CAmt > CAmtBy3)
  84.         {
  85.             
  86.             while(CAmt > CAmtBy3)
  87.             {
  88.                 
  89.                 CAmt -= CAmtBy3
  90.                 ++CAmt3
  91.                 
  92.             }
  93.         
  94.         CFixPost = '<img src="' + CImg3 + '" alt="' + CAmtFull + ' ' + CTypeName + '">' + CAmt3 + ' ' + CTypeName3;
  95.         
  96.         } else if(CAmt > CAmtBy2){
  97.             
  98.             while(CAmt > CAmtBy2)
  99.             {
  100.                 
  101.                 CAmt -= CAmtBy2
  102.                 ++CAmt2
  103.                 
  104.             }
  105.  
  106.         CFixPost = '<img src="' + CImg2 + '" alt="' + CAmtFull + ' ' + CTypeName + '">' + CAmt2 + ' ' + CTypeName2;
  107.         
  108.         } else {
  109.  
  110.         CFixPost = '<img src="' + CImg + '" alt="' + CAmtFull + ' ' + CTypeName + '">' + CAmt + ' ' + CTypeName;
  111.  
  112.         }
  113.  
  114.         return CFixPost;
  115.  
  116.     }
  117.  
  118. </script>
 


Mini-Profile:

Code:
 
  1. <script type="text/javascript">
  2. document.write(CFix('Watt','{custom_value_1}'));
  3. </script>
  4. </div>
  5. <div>
  6. <script type="text/javascript">
  7. document.write(CFix('Byte','{custom_value_2}'));
  8. </script>
  9. </div>
  10. <div>
  11. <script type="text/javascript">
  12. document.write(CFix('Control','{custom_value_3}'));
  13. </script>
  14. </div>
  15. <div>
  16. <script type="text/javascript">
  17. document.write(CFix('VE-Token','{custom_value_4}'));
  18. </script>
  19. </div>
 


The global header code will work on multiple 3-tier currencies, you pass the currency and currency amount to the function forum the script in the mini-profile template

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Another custom profile fields in mini-profil.. (21st Dec 09 at 5:34pm UTC)
Nevermind, I found the problem

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
 Printable View

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