Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2010, 06:24 PM
sherwood sherwood is offline
 
Join Date: May 2008
Location: United Kingdom
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 01-03-2010, 06:32 PM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nope but this would
Code:
<vb:if condition="$post['fieldX']"><div class="smallfont">Label for text: {vb:raw post.fieldX}</div></vb:if>
Reply With Quote
  #3  
Old 01-03-2010, 06:40 PM
sherwood sherwood is offline
 
Join Date: May 2008
Location: United Kingdom
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you
Reply With Quote
  #4  
Old 01-03-2010, 11:08 PM
claudib claudib is offline
 
Join Date: Jan 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am trying to use this code in a widget and it doesn't work? Any ideas?
Thanks
Reply With Quote
  #5  
Old 01-04-2010, 12:43 AM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #6  
Old 01-04-2010, 06:50 AM
Dygear's Avatar
Dygear Dygear is offline
 
Join Date: Apr 2008
Location: Levittown, NY
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 01-04-2010, 09:34 AM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Charlie98902 View Post
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
Reply With Quote
  #8  
Old 01-04-2010, 10:20 AM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 01-04-2010, 10:51 AM
consolegaming consolegaming is offline
 
Join Date: Jan 2007
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Charlie98902 View Post
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.
Reply With Quote
  #10  
Old 01-04-2010, 11:04 AM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks I may look into that one first.

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

Quote:
Originally Posted by consolegaming View Post
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.
Reply With Quote
Reply


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 09:52 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.04438 seconds
  • Memory Usage 2,293KB
  • 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
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete