View Full Version : User Ranks - (In)Famous Stars - [CENTER]?
ssdevious
03-10-2012, 05:20 PM
Hello there,
I've recently stumbled onto a weird problem, well, it's not vBulletin' fault, it's just I want to customize this one simple thing within users' postbit area.
Default settings: if you create a rank, make it a single .png and then set it to repeat itself, when it reaches the edge of the postbit area, it jumps onto next line, but aligns to the left.
My goal: I want it to align to the center, when on the second line.
Please, check out the attachment screenshot.
https://vborg.vbsupport.ru/attachment.php?attachmentid=136967&stc=1&d=1331403576
Thanks,
~tEh'P?r4d0x
Iain M
03-11-2012, 02:12 PM
Have you tried editing the postbit_legacy template?
Find:
<span class="rank">{vb:raw post.rank}</span>
Replace with:
<div class="rank" style="text-align:center;">{vb:raw post.rank}</div>
Span doesn't align text... so it needs to be changed to a div.
ssdevious
03-11-2012, 02:34 PM
Hi Iain,
thank, I've luckily figured this out just a couple of minute, before you posted this message, I used this code:
<vb:if condition="$post['rank']">
<ul><span style="text-align: center;"><span class="rank">{vb:raw post.rank}</span></ul>
</vb:if>
Which is a bit lame version of your solution, I was surprised by myself that it actually did work within the postbit, heh.
Anyway, your solution is much cleaner, so I will stick with it next time.
Also, I got 2 additional question, I hope you won't be mad. :)
1st - speaking of postbit_legacy, I did find it via admin CP, but in what file on the FTP is it actually integrated?
2nd - how center this within the user's area?
And one more thing, but this one is really tough one: we got 3 sets of rank images, first one is a simple star.png, which repeats itself up to 10 stars, second one is just another star_2.png, which also repeats up to 10 images, that's why I wanted to center it and that's what the screenshot shows.
But then we got 3rd set of images, which are set to not repeat, so 1 rank = only 1 image always and I want to keep those aligned to the left, just as it is by default.
Any idea, would that even be possible?
Or this is like an superb advanced vBulletin customization class, heh. My experience with vB are like 5 days. ;|
Best Regards,
~tEh'P?r4d0x
Iain M
03-11-2012, 03:02 PM
1. Templates are stored in the database.
2. What do you mean by users area?
3. I've not got time to look into it, but you could maybe check if the rankid = non repeating rankid text-align: left, else text-align: center
ssdevious
03-11-2012, 05:57 PM
Thank you for the quick reply Iain!
Thing with the templates actually explains, why it can be only accessed via ACP, anyway..
Here a couple of more attachments:
https://vborg.vbsupport.ru/attachment.php?attachmentid=136974&stc=1&d=1331488152
https://vborg.vbsupport.ru/attachment.php?attachmentid=136975&stc=1&d=1331488152
And really, really the last thing: we got 10 stars over there, what if I wanted to limit the first row only to 7, just like it is in the postbit, I know, it's because in the postbit isn't enough space and it randomly (because of the size) cut it behind 7th star and placed the other 3 on the 2nd line, but what if we want to do the same in user's profile?
Greatly appreciate your help,
~tEh'P?r4d0x
Iain M
03-12-2012, 03:44 PM
To fix it on the member profile, have a look in the MEMBERINFO template, and change the width of the block containing the username/title/rank etc.
ssdevious
03-13-2012, 10:43 AM
Hi again,
thanks for helping, I just hope, we can get over with it soon. ;|
https://vborg.vbsupport.ru/attachment.php?attachmentid=137002&stc=1&d=1331636430
The MEMBERINFO area is still causing troubles, the "div" doesn't seem to have any affect on it, which is weird, in the postbit_legacy it worked as a charm.
Let's forget for a while about adding the restriction for how many stars it should allow it per a line, etc.
Just center it.
Any ideas, why the parameter "prepared" doesn't accept it?
Thanks,
~tEh'P?r4d0x
Iain M
03-14-2012, 02:02 AM
I'm not quite sure why it's not working in the memberinfo template, it could be inheriting the behavior from another surrounding div.
ssdevious
03-14-2012, 12:34 PM
I'm not quite sure why it's not working in the memberinfo template, it could be inheriting the behavior from another surrounding div.
Could be that. You mean within the same template or a different one?
Thanks,
~tEh'P?r4d0x
--------------- Added 1331739771 at 1331739771 ---------------
Finally have figured it out!
Great thanks again Iain.
It was just like you said. I misread it and didn't realize, it was wrapped around in higher level tags.
All I had to do was to move the <vb:if> out of it and it worked as intended.
... code ... </h1>
<vb:if condition="$prepared['rank']">
<br />
<span class="rank">{vb:raw prepared.rank}</span>
</vb:if>
<div id="userinfoblock" class="floatcontainer"> ... code continues ...
Thanks again,
~tEh'P?r4d0x
Iain M
03-14-2012, 08:39 PM
Great! Glad you got it sorted =]
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.