The only thing I see is what is in the div by default
Code:
- <div id="DyouPost">{custom_value_2} Dyou</div>
- <script>
- var Dyou; DyouNum, DyouBox; DyouBox1K; DyouPost;
- Dyou = {custom_value_2};
- DyouNum = (Dyou)/10;
- DyouPost = '<div style="text: #000000;">';
- DyouBox1K = new Array()
- var n = -1;
- if(DyouNum > 1000)
- {
- DyouPost = '<div style="height: 8px; width: 100px; background-color: #C0C000; float: left; margin: 1px;">10000+ Dyou</div>';
- } else {
- if(DyouNum >= 100)
- {
- while(DyouNum >= 100)
- {
- DyouBox1K[n++] = '<div style="height: 8px; width: 8px; background-color: #FFFF00; float: left; margin: 1px;">1K</div>';
- DyouNum -= 100;
- }
- }
- DyouBox = '<div style="height: 8px; width: ' + DyouNum + 'px; background-color: #FFFF00; float: left; margin: 1px;">' + DyouNum + ' Dyou</div>';
- if(DyouBox1K.length > 0)
- {
- for(i = 0; i <= DyouBox1k.length; i++)
- {
- DyouPost += DyouBox1K[i];
- }
- DyouPost += "<br>";
- }
- DyouPost += DyouBox;
- }
- DyouPost += "</div>
- document.getElementById("DyouPost") = DyouPost;
- </script>
Hi,
Can you post the link to your forum so I can check how that custom field is setup? You can PM it if you prefer![]()
http://xenqarnarp.vforums.co.uk/
Hi,
There were a couple of little errors in the javascript which were stopping it from working. Things like:
DyouBox1K = new Array();
DyouPost += "</div>";
document.getElementById("DyouPost").innerHTML = DyouPost;
I have fixed them on your forum for you![]()
I see there is a problem with the code, in a thread only the profile on the top seems to be using the code
I written up a alternate code for this using the headers and footers, I just don't know how to use it in the template so that all profiles in a thread will use it
Here is the code for Global Header:
Code:
- <script>
- function Dyou(dyou){
- var Dyou; DyouMil; DyouPost;
- Dyou = dyou
- if(DyouNum > 1000000){
- while(DyouNum > 1000000){
- ++DyouMil
- DyouNum -= 1000000;
- DyouPost = '<div style="height: 20px; width: 30px; color: #000000; background-color: #C0C000; float: right; margin: 1px;">' + DyouMil + ' Mil</div>';
- DyouPost += '<div style="height: 20px; width: 70px; color: #000000; background-color: #FFFF00; float: right; margin: 1px;">' + Dyou + ' Dyou</div>';
- } else {
- DyouPost = '<div style="height: 20px; width: 100px; color: #000000; background-color: #FFFF00; float: right; margin: 1px;">' + Dyou + ' Dyou</div>';
- }
- return DyouPost;
- }
- </script>
This one might work better
Hi,
I've updated your mini-profile template so it writes out the result of that Dyou function (although I had to fix a few errors in it). The most up-to-date Dyou function is now in your Global Header. I was unsure how you were hoping it to display but expect you can tweak it as needed now it is setup![]()
I still seem to have a slight problem when I change the number in the additional information, when I change it from 185 to 1850000 it displays as 1850
Hi,
When a numeric custom field is greater than 1000 it adds commas (eg. 1,850,000). These were confusing the script. I've fixed that now![]()
I made a modification to my code and because of what you did it works just the way I want it to, I made it so there is a maximum value
What is this for?