vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   User Ranks - (In)Famous Stars - [CENTER]? (https://vborg.vbsupport.ru/showthread.php?t=279869)

ssdevious 03-10-2012 04:20 PM

User Ranks - (In)Famous Stars - [CENTER]?
 
1 Attachment(s)
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/attachmen...1&d=1331403576

Thanks,
~tEh'P?r4d0x

Iain M 03-11-2012 01:12 PM

Have you tried editing the postbit_legacy template?

Find:
Code:

<span class="rank">{vb:raw post.rank}</span>
Replace with:
Code:

<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 01: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:

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 02: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 04:57 PM

1 Attachment(s)
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/attachmen...1&d=1331488152

https://vborg.vbsupport.ru/attachmen...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 02: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 09:43 AM

1 Attachment(s)
Hi again,

thanks for helping, I just hope, we can get over with it soon. ;|

https://vborg.vbsupport.ru/attachmen...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 01: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 11:34 AM

Quote:

Originally Posted by Iain M (Post 2309261)
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 [DATE]1331739771[/DATE] at [TIME]1331739771[/TIME] ---------------

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:

... 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 07:39 PM

Great! Glad you got it sorted =]


All times are GMT. The time now is 03:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02097 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete