Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 03-21-2012, 01:00 PM
BrightStar's Avatar
BrightStar BrightStar is offline
 
Join Date: Nov 2008
Location: UK
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to make avatar central in postbit?

Hiya

How can I make this avatar appear central as per other elements? Do I mess in postbit template or have to do somewhere else?



Thanks

--------------- Added [DATE]1332334864[/DATE] at [TIME]1332334864[/TIME] ---------------

Quote:
<vb:if condition="$show['avatar']">
<div class="usercenter">
<a class="postuseravatar" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</a>
</div>
The above is the code from the postbit template.
Reply With Quote
  #2  
Old 03-22-2012, 09:06 PM
BrightStar's Avatar
BrightStar BrightStar is offline
 
Join Date: Nov 2008
Location: UK
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone???
Reply With Quote
  #3  
Old 03-22-2012, 11:55 PM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey there,

this is postbit_legacy, what you're showing, it has its own template though, just to make it clear.

You simply throw <center> tags in there, that worked for me. If that fails, simply go for "div" and "align: center" - that would definitely work.

For those <center> ones, try to wrap it around the <a href> tag.

If all that fails, PM me, I will check with my own postbit_legacy.

Regards,
~tEh'Pâr4d0x
Reply With Quote
Благодарность от:
BrightStar
  #4  
Old 03-23-2012, 09:20 AM
BrightStar's Avatar
BrightStar BrightStar is offline
 
Join Date: Nov 2008
Location: UK
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot ssdevious.

So which template should I editing for this avatar location? I've tried adding

<div class="usercenter align="center"> doesn't seem to work.
Reply With Quote
  #5  
Old 03-23-2012, 12:32 PM
HawkeBoE HawkeBoE is offline
 
Join Date: Mar 2012
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

why not try to edit the css file for this?

Edit the postbit.css and type in a new line:

Code:
.postuseravatar img {
margin-left: 50px; 
}
or an other value that fits
margin-left: auto; margin-right: auto; isn't working, don't know why
I don't know much about this (html, css and php coding), but for me it seems to be the easiest way.
Reply With Quote
  #6  
Old 03-23-2012, 01:03 PM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I was using this, to center the ranks:

Code:
<div class="rank" style="text-align:center;">{vb:raw post.rank}</div>
You could try to apply the same onto your avatar, it should work.

Else, read this topic: https://vborg.vbsupport.ru/showthread.php?t=279869

It might help you to get understand, how this works.

What I learned from that is that you must follow the blocks, because very often, it inherits style (floating, align, etc.) from some "master" parameter above it.

Hope this helps a bit, if you want to play with it on your own. If not, try to PM Lynne or Iain, those guys are really amazing at helping people.

Wish you fixing this soon,
~tEh'P?r4d0x
Reply With Quote
Благодарность от:
Iain M
  #7  
Old 03-23-2012, 02:10 PM
Iain M's Avatar
Iain M Iain M is offline
 
Join Date: Jul 2005
Location: Glasgow, Scotland
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Aww thanks SSDevious

I'll have a look and see if I can figure it out.

EDIT:
If you remove the class from
Code:
<a class="postuseravatar" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</a>
so it becomes
Code:
<a href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</a>
that should center it.

If not, send me a link to your forum =]
Reply With Quote
  #8  
Old 03-23-2012, 06:43 PM
BrightStar's Avatar
BrightStar BrightStar is offline
 
Join Date: Nov 2008
Location: UK
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot guys. Very much appreciate the time you guys take to resolve other people's issue.

Awesome.....it works

Thank you so much, :up:
Reply With Quote
Благодарность от:
Iain M
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 11:34 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.07174 seconds
  • Memory Usage 2,240KB
  • Queries Executed 13 (?)
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
  • (8)post_thanks_box
  • (3)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete