PDA

View Full Version : User's Ranks Help


Tasking Mickey
01-22-2011, 02:58 PM
So, Posted this on another site, and they directed me to come here, and now I am totally lost.

On this site, in their 'Edit Options" page, they have a "Ranks" option, look,

http://iaza.com/work/110123C/iaza18195646303600.png


How can I get that option, into my sites 'Edit Option" page?

Lynne
01-22-2011, 03:43 PM
I would guess it is a Custom User Profile Field that is creating the option. But, then you would need to actually use the field in your code to only have that many rows.

Tasking Mickey
01-22-2011, 04:21 PM
I already know where the ranks show code in the postbit template, but how would I, like for each option, or in my case, yes or no. For the no option, I click "No" and it wouldnt show the tags.

Lynne
01-22-2011, 04:36 PM
You would put a condition around the code in the postibt template. If it's set to No, then you don't show it. Is that what you are asking?

Tasking Mickey
01-22-2011, 04:40 PM
Yes I am, can you show me?

Lynne
01-22-2011, 05:39 PM
<vb:if condition="$post['fieldx'] != 'No'">show code</vb:if>'No' is a string so it must be exact since it's case-sensitive.

Tasking Mickey
01-22-2011, 05:52 PM
And where do I put that, right below the rank code in the postbit template, or I put the rank in the "show code" part?

Lynne
01-22-2011, 08:19 PM
You said you knew where the rank code was in the postbit, no? So, put the condition around that code.

You really should just try it out and see. I assume you are doing this on a test site and not your live site.

Tasking Mickey
01-22-2011, 08:44 PM
I put the <vb:if condition="$post[fieldx'] != 'No'">
In front of the rank code, in the postbit, and put the </vb:if> at the end of the rank code,

And this is the rank code,

<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>

And when I clicked save, said there was an error in the template, please go back and fix it.

BTW: On 3.8.6 vbulletin.

Am I putting in the wrong way?

Lynne
01-22-2011, 11:04 PM
Whoops, it should be $post['fieldx'] (with a single apostrophe on each side). Also, fieldx should be changed to the field number you have created. If it's field5, then you should have $post['field5'].

Tasking Mickey
01-22-2011, 11:11 PM
Did that, and when I click to save the template, it still comes up with that error.

Lynne
01-22-2011, 11:14 PM
Can I see exactly what your code right there is now? You may want to just combine the condition with the existing one.

<if condition="$post['rank'] AND $post['fieldx'] != 'No'">
stuff
</vb:if>

Tasking Mickey
01-22-2011, 11:32 PM
This is my coding,

<vb:if condition="$post['field5'] != 'No'"> <if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if></vb:if>

And when I save, a error comes up. Do I use your code? The exact code I use to replace the current rank code?

Lynne
01-23-2011, 12:43 AM
Try combining the two conditions into one like I wrote (remember there should only be one </vb:if> if you combine the two).

BirdOPrey5
01-23-2011, 04:22 AM
Ahem...

Being this is vBulletin 3.8 the if conditions are wrong (those are VB4 conditionals.)

The VB3 code would be:
<if condition="$post['field5'] != 'No'"> <if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if></if>

Tasking Mickey
01-23-2011, 10:20 AM
BirdOPrey5, I used your code, it actually saved. But when I went to my edit options, and put "No" to disable viewing the users ranks in posts, the ranks still showed in posts. Theres a "Yes" option, and a "No" option.

Yes = Show the ranks in the posts
No = Not show the ranks in the posts.

BirdOPrey5
01-23-2011, 11:55 AM
Only one of two things then:
It really isn't field5
OR
You didn't make the value of "No" exactly No in the profile field settings. It is case sensitive...

If you still have issue can you try to post a screen shot of your custom profile field edit page?

Oh one more thing is to try is to remove the single quotes in the code, make it $post[field5] rather than $post['field5'].

Tasking Mickey
01-23-2011, 12:02 PM
Sure,

http://iaza.com/work/110124C/iaza18195627483800.png

It shows it's field5 there,

And inside,

http://iaza.com/work/110124C/iaza18195610380900.png

BirdOPrey5
01-23-2011, 12:35 PM
Hmmm... everything looks right...

try this code instead:


<if condition="$post['rank'] AND $post['field5'] != 'No' "><div class="smallfont">$post[rank]</div></if>


Also just to confirm this is in your postbit or postbit_legacy template, right?

Tasking Mickey
01-23-2011, 12:39 PM
Yes, I'm doing this in the postbit template, not the legacy, and still, when I put your code in, Not taking out the 'AND" of course. I click save, it saves. I go back to a thread, and again, it still shows the ranks, even tho my option in the "Edit Options" is set to No.

Still shows the ranks.

BirdOPrey5
01-23-2011, 01:05 PM
Try making a new post, just in case it's a cache issue.

Tasking Mickey
01-23-2011, 01:20 PM
Finally, it works. BUT a issue.

I made another user on the test site, and that's users option is set to "Yes" show ranks. But when I went to check out my test posty (On my new user) it doesnt show the ranks even tho it's set to "Yes"

BirdOPrey5
01-23-2011, 02:46 PM
OK... when a user chooses to NOT show ranks in their options, do you want that to mean it doesn't show THEIR rank in THEIR posts or it doesn't show anyone's ranks in any posts (basically turning off the rank system for them).

Post $post['field5'] turns it off only for the posts of whoever's profile "No" was set to.

To turn it off completely for the user try:

$bbuserinfo['field5'] instead of $post['field5']

Tasking Mickey
01-23-2011, 02:57 PM
Yes, the whole rank system, meaning it doesnt show the ranks in anyone posts.

Finally, yes it works. Thank you so much, thanks so much. I actually have a little question about 1 thing, but I will submit another thread about it.

Lynne
01-23-2011, 03:09 PM
Thank you Joe for noticing this was vB3 and helping desi5257 finally get this working!

BirdOPrey5
01-23-2011, 03:22 PM
Thank you Joe for noticing this was vB3 and helping desi5257 finally get this working!

That's what I am here for. :up: