Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 03-10-2012, 05:20 PM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default User Ranks - (In)Famous Stars - [CENTER]?

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.



Thanks,
~tEh'P?r4d0x
Attached Images
File Type: jpg Postbit Stars.jpg (130.0 KB, 0 views)
Reply With Quote
  #2  
Old 03-11-2012, 02:12 PM
Iain M's Avatar
Iain M Iain M is offline
 
Join Date: Jul 2005
Location: Glasgow, Scotland
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 03-11-2012, 02:34 PM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 03-11-2012, 03:02 PM
Iain M's Avatar
Iain M Iain M is offline
 
Join Date: Jul 2005
Location: Glasgow, Scotland
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 03-11-2012, 05:57 PM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:





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
Attached Images
File Type: jpg Postbit Stars - 02.jpg (53.1 KB, 0 views)
File Type: jpg Postbit Stars - 03.jpg (64.2 KB, 0 views)
Reply With Quote
  #6  
Old 03-12-2012, 03:44 PM
Iain M's Avatar
Iain M Iain M is offline
 
Join Date: Jul 2005
Location: Glasgow, Scotland
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 03-13-2012, 10:43 AM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi again,

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



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
Attached Images
File Type: jpg Postbit Stars - 04.jpg (44.0 KB, 0 views)
Reply With Quote
  #8  
Old 03-14-2012, 02:02 AM
Iain M's Avatar
Iain M Iain M is offline
 
Join Date: Jul 2005
Location: Glasgow, Scotland
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not quite sure why it's not working in the memberinfo template, it could be inheriting the behavior from another surrounding div.
Reply With Quote
  #9  
Old 03-14-2012, 12:34 PM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Iain M View Post
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
Reply With Quote
  #10  
Old 03-14-2012, 08:39 PM
Iain M's Avatar
Iain M Iain M is offline
 
Join Date: Jul 2005
Location: Glasgow, Scotland
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great! Glad you got it sorted =]
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:33 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05491 seconds
  • Memory Usage 2,272KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete