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.


All times are GMT. The time now is 08:41 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.01245 seconds
  • Memory Usage 1,756KB
  • 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
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete