Global Header:Code:
- <script>
- function PostLevel(Posts){
- if(vf_username != 'guest' && GroupCheck(0)){
- Posts = parseInt(Posts)
- var PPost = ''
- var PostList = []
- PostList[0] = [0,1];
- PostList[1] = [1,5];
- PostList[2] = [5,250];
- PostList[3] = [250,250];
- for(i = PostList.length; i >= 0; i--){
- if(Posts > PostsList[i][0]){
- var PostPer = (Posts/PostList[i][1])*100
- if(PostPer > 100){
- PostPer = 100
- }
- PostPer = (PostPer * 2)-4
- PPost = '<tr><td class="window2" colspan="2"><div style="width:98px; height:18px; background-color:000;"><div style="float:left; width:' + PostPer + 'px; height:16px; background-color:FF0;"></div></div></td></tr>';
- document.write(PPost);
- }
- }
- }
- }
- </script>
Mini-Profile template:
It is not being displayed at all
Do you have a link to a profile with this on so that I can see the rest of the coding please?![]()
Doesn't work for me either.
http://dmtesting.vforums.co.uk/action/view_profile/admin
I put it under the post count table, so it should be directly underneath the post count, but it's not.
Darkmage... the reason I asked for a link is because he is using other predefined functions within his coding that you don't have defined.![]()
Oh I see.Well it still doesn't work on mine. >.<
Here's one: http://tfah.vforums.us/profile/eunie
This line:
if(Posts > PostsList[i][0]){
PostsList is undefined
I think you mean "PostList"
I fixed that but it still isn't working
Change your for loop to:
for(i = PostList.length-1; i >= 0; i--){
Also add a break; statement to the end of your if statement.
I did that, still not showing
Unfortunately being a guest I can't test it exactly. Can you remove the first line (and the corresponding closing brace) from your code that sets it so that only guests can see it ... then I can test it further for you ... I have it on my test forum, and it worked fine... :/
I think I might have coded that part wrong O.o
I took it off but the div's in the code aren't there but the tr and td are
That could be the bit that's 'causing to not work. Is there any reason that you don't want to show it to the Guests?
That isn't what I was trying to do, my mistake
Does it work now?
Only half of the output is working, the tr and td are there but I don't see the 2 div's
The Divs are being outputted... look into your html for the divs.![]()
Then what is the problem?
Also I want it to work for only regular posting ranks and certain member groups
Well why don't you tell me what you want it to do, and I will then code it up for you![]()
It is a bar that appears below the post count as a progress bar to the next posting rank
Global Header:
<script type = 'text/javascript'>
/* Post bar to next rank - Wrighty */
var r = [0, 20, 50, 100, 250, 500];
function postBar(x){
for(i = r.length-1; i >= 0; i--)
if(x >= r[i]){
document.write('<tr><td class="window2" colspan="2"><div style="width:98px; height:18px; background-color:#000;"><div style="float:left; width:' + ((x-r[i])/(r[i+1]-r[i]))*98 + 'px; height:16px; background-color:#FF0;"></div></div></td></tr>');
break;
}
}
</script>
Alter the red to be a list of the number of posts for each rank, making sure that they are incrementing![]()
In Mini Profile Template:
<script type = 'text/javascript'>
postBar({posts});
</script>
It's not showing up at all
I updated my code in my previous post, (the first section only), please recopy.
I see a problem with your code, you are missing a pair of braces for the for()
But even fixing that problem it still isn't working
the for doesn't require them. Try adding quotes around the digits .... eg:
"5", "10", "50" etc...
Nope, still not working
The code works flawlessly on my forum (as posted in my last post)... you have this in your headers:
<script>SetDisLink(Guest);</script>
(might be in the Welcome Table Template) .. remove it, as it's returning an errror.
I removed that but the code still isn't working
Is it at the bottom of your global header?
Yeah