vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Adding additonal info in postbit (https://vborg.vbsupport.ru/showthread.php?t=232067)

sherwood 01-03-2010 06:24 PM

Adding additonal info in postbit
 
Would this condition still work in vb 4:
PHP Code:

<if condition="$post[fieldx]"><div class="smallfont">Label for text$post[fieldx]</div></if> 

If not what would do the same thing as I'm wanting to display a custom profile field in the postbit.

Thanks

Vaupell 01-03-2010 06:32 PM

nope but this would
Code:

<vb:if condition="$post['fieldX']"><div class="smallfont">Label for text: {vb:raw post.fieldX}</div></vb:if>

sherwood 01-03-2010 06:40 PM

Thank you

claudib 01-03-2010 11:08 PM

I am trying to use this code in a widget and it doesn't work? Any ideas?
Thanks

Charlie98902 01-04-2010 12:43 AM

So this entry would go under the posts field I assume in the postbit? I need 2 things to show in mine and I planned on making the profile fields for it and mandatory as well.

This code is what I am referring too.

Code:

<vb:if condition="$post['fieldX']"><div class="smallfont">Label for text: {vb:raw post.fieldX}</div></vb:if>

Dygear 01-04-2010 06:50 AM

Code:

<vb:if condition="$post['fieldX']"><dt>Level of Care:</dt> <dd>{vb:raw post.fieldX}</dd></vb:if>
But it's meant to look like this now right? They have some new markup.

Vaupell 01-04-2010 09:34 AM

Quote:

Originally Posted by Charlie98902 (Post 1946506)
So this entry would go under the posts field I assume in the postbit? I need 2 things to show in mine and I planned on making the profile fields for it and mandatory as well.

This code is what I am referring too.

Code:

<vb:if condition="$post['fieldX']"><div class="smallfont">Label for text: {vb:raw post.fieldX}</div></vb:if>

yes you can place it anywhere really, but either
postbit or postbit_legacy

Then ofcourse REPLACE fieldX where the x is the number of the userfield you created in
adminCP, so if you go and create a field now, after done in the userfield manager i would
says "EXSAMPLE" field5 and thats what the condition should see, and also what
vbraw shows on the screen.

If condition here, ONLY shows the content IF the user have something in the field,
if the field is blank, then it wont show in the posts.


All of this can allso just be dont with a plugin, which i feel is more "clean" and i use that myself.
plugins over template edits anyday :D

Charlie98902 01-04-2010 10:20 AM

Well I asked for the plugin to get updated but I have no issue doing a template edit as the plugin for 3.8 lacked if you were able to choose several options for one field and the text wrap was a bug but fixable.

Thanks for the info so I can start on this in my test forum.

consolegaming 01-04-2010 10:51 AM

Quote:

Originally Posted by Charlie98902 (Post 1946765)
Well I asked for the plugin to get updated but I have no issue doing a template edit as the plugin for 3.8 lacked if you were able to choose several options for one field and the text wrap was a bug but fixable.

Thanks for the info so I can start on this in my test forum.

Well I don't know about Vaupell but I just use a custom plugin and then attach it to a hook at the end. i.e.

PHP Code:

if($post[field9]) $html .= '<dt>Clan</dt> <dd>'.$post[field9].'</dd>';
if(
$post[field5]) $html .= '<dt>PS2</dt> <dd>'.$post[field5].'</dd>';
if(
$post[field6]) $html .= '<dt>PS3</dt> <dd>'.$post[field6].'</dd>';
if(
$post[field7]) $html .= '<dt>XBL</dt> <dd>'.$post[field7].'</dd>';
if(
$post[field8]) $html .= '<dt>Wii</dt> <dd>'.$post[field8].'</dd>';
$html .='<br /><br />';

$template_hook['postbit_userinfo_right_after_posts'] .= $html

I just have that as a plugin attached to the postbit_display_start hook and that works great for me. And no template changes needed.

It's just an alternative way of doing the same thing.

Charlie98902 01-04-2010 11:04 AM

Thanks I may look into that one first.

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

Quote:

Originally Posted by consolegaming (Post 1946780)
Well I don't know about Vaupell but I just use a custom plugin and then attach it to a hook at the end. i.e.

PHP Code:

if($post[field9]) $html .= '<dt>Clan</dt> <dd>'.$post[field9].'</dd>';
if(
$post[field5]) $html .= '<dt>PS2</dt> <dd>'.$post[field5].'</dd>';
if(
$post[field6]) $html .= '<dt>PS3</dt> <dd>'.$post[field6].'</dd>';
if(
$post[field7]) $html .= '<dt>XBL</dt> <dd>'.$post[field7].'</dd>';
if(
$post[field8]) $html .= '<dt>Wii</dt> <dd>'.$post[field8].'</dd>';
$html .='<br /><br />';

$template_hook['postbit_userinfo_right_after_posts'] .= $html

I just have that as a plugin attached to the postbit_display_start hook and that works great for me. And no template changes needed.

It's just an alternative way of doing the same thing.

How would I go about making the answer to the profile field bold/strong?

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

Also how would I go about making a notice to users so they know they need to edit their profile as I run a software support and making it mandatory. This way I will not be or need to mass email users. Kind of like a notice to users if condition isn't met is what I am looking for I do believe.

consolegaming 01-04-2010 01:02 PM

Just add <strong></strong> tags around the variable i.e.

if($post[field8]) $html .= '<dt>Wii</dt> <dd><strong>'.$post[field8].'</strong></dd>';

That should do that part. For your second question firstly I'd recommend looking at the Field Required option for the profile field (assuming you've used a profile field yea?) If you set that to yes always it forces them to set it before they can use the forums (existing/new members).

Charlie98902 01-04-2010 01:11 PM

Thanks I didn't try the <strong> but did try <b> and got a syntax error :)

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

Strong html didn't work either but no errors using it.

Vaupell 01-04-2010 02:12 PM

i do something like this in plugins

Hook : postbit_display_complete

Code:

if (!empty($post["field9"]))
{
    $template_hook['postbit_userinfo_right_after_posts'] .= '<dd>' . 'Test : ' . $post["field9"] . '</dd>';
}

Execution Order : is just if i want it to show before or after the other plugins at same hook.
might change this number to fit your personal preferences.

Charlie98902 01-04-2010 02:28 PM

Nice. Is there a way to have the chosen field bold or both fieldx and choice bold?

Dygear 01-04-2010 04:23 PM

Quote:

Originally Posted by Charlie98902 (Post 1946880)
Thanks I didn't try the <strong> but did try <b> and got a syntax error :)

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

Strong html didn't work either but no errors using it.

Try editing the dd tag directly inline with this:

Code:

<dd style="font-weight: bold;">
However, I would recommend using a vb style variable as it would provide a more consistent user experience and might cause you less of a headache in the future.

voglermc 01-04-2010 08:29 PM

Anyone know the correct code for users album link in their postbit?

UTE304 01-06-2010 09:17 PM

1 Attachment(s)
Guys,

I've been following the useful info in this topic. But I have a little more work I'd like to do on this area.

Could you look at the attached pic, and advise me on how to achieve that? RED text request only, I fixed the first problem using Dygear's code.

Thanks

Steve.

Dygear 01-07-2010 04:26 AM

Quote:

Originally Posted by UTE304 (Post 1949099)
Could you look at the attached pic, and advise me on how to achieve that?

That is going to be a CSS edit. I've never edited the CSS file within vB so I don't know what this entails, but baiscly I would think your looking for the dd declaration within the CSS file, and just editing the width attribute to a value that is more suitable. Hopefully that's all you will need to do.

Looks like the community really could use a guide on how to customize post bits, it seems to be in demand.


All times are GMT. The time now is 05:50 PM.

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.01298 seconds
  • Memory Usage 1,781KB
  • 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
  • (6)bbcode_code_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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