![]() |
[Postbit-Legacy Hack] Attractive User Info Boxes for Posts
1 Attachment(s)
This mod will allow you to create attractive custom containers for your member's user info in postbit. For example, Join date, post count, location, thanks etc.
See screenshot in attachments for example. First, you need to add a class to your additional.css files. Go to styles and templates > edit templates > css templates > additional.css Add to the bottom: HTML Code:
.postbitboxes { Now you need to make some edits to your postbit_legacy template. Go to styles and templates > edit templates > postbit templates > postbit_legacy Find: HTML Code:
<dt>{vb:rawphrase join_date}</dt> <dd>{vb:raw post.joindate}</dd> HTML Code:
<div class="postbitboxes"> Find: HTML Code:
<dt>{vb:rawphrase location_perm}</dt> <dd>{vb:raw post.field2}</dd> HTML Code:
<div class="postbitboxes"> Find: HTML Code:
<dt>{vb:rawphrase age}</dt> <dd>{vb:raw post.age}</dd> HTML Code:
<div class="postbitboxes"> Find: HTML Code:
<dt>{vb:rawphrase posts}</dt> <dd>{vb:raw post.posts}</dd> HTML Code:
<div class="postbitboxes"> Essentially all that you've done here is wrapped the new div tag around each element of your user info displayed in the sidebar. So the above template edits can also be applied to templates for other mods which display info here such as Abe's Post Thank You Hack. NOTE: To also include place BLOG ENTRIES inside the same box, see post #3 https://vborg.vbsupport.ru/showpost....70&postcount=3 Enjoy! Check out my other Template Modifications for 4.x! Link Private Forums to thread instead of error message Sidebar Anywhere Enhancement - Custom Blocks Per Forum or Page Change Thread Title Color for Specific Forums on Homepage Change Background Color for Specific Forums on Homepage Change Title Color of Specific Forums on Homepage Thread Starter Image in Postbit for OP CUSTOM BUTTONS that look like your forum! Custom User Rank Box in Posts |
Thanks for sharing! :)
|
"Blog entries: x" block is not in postbit_legacy template.
Open blog_postbit_entries_link template and replace its contents with these: HTML Code:
<div class="postbitboxes"><dt>{vb:rawphrase blog_entries}</dt><dd><a href="{vb:link blog, {vb:raw post}, null, 'userid', 'blog_title'}">{vb:raw post.entries}</a></dd></div> |
Thanks !!
Looks great. |
I love this hack, it gives a more professional look to the postbit
|
Ha. I've had this for my v3 for several years. Cool to see someone did it for v4.
|
I added this to my forum, with a few modifications to the CSS to match my Custom Style. Thank you for this! *Installed*
|
Thank you :)
|
I have added the modification but there are some problem
http://oi62.tinypic.com/i3dnw3.jpg What I have to do? Thank you :) |
Looks to me like you forgot to close a DIV tag, or left some other tag open...
I would recommend starting over and repeating the steps again, making sure to do it correctly. I hope that helps, should be a simple fix if my assumption is correct. |
Quote:
Thank you :) |
In vBulletin 4.2.1 - <vb:if> conditionals with this - how do we handle that syntax?
We have alot of custom fields in postbit, and they have IF conditionals, but if the field isn't filled in by the user the box still shows, but is empty. See screenies: When the user leaves the custom fields blank: https://vborg.vbsupport.ru/external/2014/06/5.jpg When he does not: https://vborg.vbsupport.ru/external/2014/06/6.jpg Here is the entire postbit_legacy code: PHP Code:
When i try to put the DIVs inside the IFs, it breaks the template. |
There is a conditional for custom fields that you should wrap around each div element which contains a custom field.
Try Code:
<vb:if condition="$post['field5']"></vb:if> So for example IF the join date was a custom field, your code would look as follows: Code:
<vb:if condition="$post['field5']"> PS - Mark as installed! :) |
Quote:
Wait. I am not clear on the bolded. What does this mean? |
The code in your example shows that you didn't use the code exactly as provided.
You have the vb:if conditionals inside the div containers, it should be the other way around, you should have the div containers inside the if conditionals. That way the div only displays if the conditional is true. Check my example above again to see what I mean. Your divs need to be INSIDE your conditionals, not vice versa. For example where you have: Code:
<div class="postbitboxes"><vb:if condition="$post['field14']"><dt>Ideology</dt> <dd>{vb:raw post.field14}</dd></vb:if></div> Code:
<vb:if condition="$post['field14']"><div class="postbitboxes"><dt>Ideology</dt> <dd>{vb:raw post.field14}</dd></div></vb:if> |
Quote:
|
Quote:
Code:
{vb:raw template_hook.postbit_start} |
The code you provided me in your example was incorrect, my response was based on the code errors i saw in what you showed. So if your reply is "i know", then please provide the broken code so I can have another look.
One of your entries, you had half a div inside an if, and the other half of the div outside the if. Then you had other entries with the entire if is inside the div. You should go back through and try again. Unless the postbit legacy code you provided isn't the actual code that you're using, because what you provided a couple posts back definitely has errors.. The conditionals cannot break the template, all they do is show the div or not show the div, depending on if the user has entered any value. I recommend going through each entry for your custom fields and double check your code making sure it is done exactly as instructed. See post 12 on the previous page |
Quote:
However, only marginally better than i had, as seen in my screengrab in post 12. Here's what we get now using your provided code: https://vborg.vbsupport.ru/external/2014/06/4.jpg A couple of the boxes are still showing when nothing is entered in the custom fields. |
Also, trying to support the rounded corners for safari, using the webkit definition, and having zero luck. Trying it this way:
HTML Code:
{ |
Quote:
Read my post #12, and post #18, that will fix your problem. As far as the rounded corners in Safari, I'm not fluent with syntax and compatibility with that browser so I personally cannot point you in the right direction, but maybe someone else will chime in. |
Quote:
Any mistakes in this template aren't mine, I have no access to edit the template directly and am trying to help someone else via skype. It is also a custom style and there is no telling what errors existed in it before any edits were made. I didn't have any trouble at all doing this myself, for my own sites, years before you posted this. Quote:
Quote:
HTML Code:
/* Safari,Chrome*/ |
Quote:
And, some of your code had an opening div tag, AFTER the opening IF condition,, then you (or your friend whom you are assisting) closed it with a closing IF condition BEFORE closing the div. ex. if div - if div That means you have half of your DIV container inside the if condition and half outside, or vice versa, this is why your template is breaking as I said in a previous post. I provided you with the correct format of the code, https://vborg.vbsupport.ru/showpost....6&postcount=15 Do this for each custom field... That's the best I can do, I told you exactly what is wrong with your code and how to fix it, you or your friend incorrectly implemented the code I provided. |
Quote:
The formatting only breaks when I apply the edits as you're instructing. It was done that way before any questions were asked. Hence the questions. |
Quote:
You applied my edits incorrectly, as I said before. That's why you're still having problems... Any further posts about this problem will only be in vein. |
Quote:
Quote:
|
Quote:
|
works a dream on a custom vB style - my postbit is organised to cover situations where a user doesn't fill in fields and works fine, the basic instructions are fine - you literally surround the option within the div's and it works fine.
Marked as installed - thanks mate Some examples to help those still struggling..... Join date - Code:
<vb:if condition="$post['joindate']"><div class="postbitboxes"> Custom Field 1 (location) - Code:
<vb:if condition="$post['field1']"><div class="postbitboxes"> |
Thanks for clarifying that for others Stevie!
|
You could also try this Max:
Code:
{vb:raw template_hook.postbit_start} |
All times are GMT. The time now is 03:02 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|