vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   custom field in postbit (https://vborg.vbsupport.ru/showthread.php?t=112798)

webmastershome 04-12-2006 05:57 AM

custom field in postbit
 
Dear Sir,

Yes i am looking for new field.

I create a new field in member profile area single text box..

And define the value in showthread.php like belwo

$post['fieldx']

Now

I want this field value in PostBit template but there is no value here

Regards
Jitender

Jordan17 04-12-2006 06:18 AM

<if condition $post['fieldx'];>$post['fieldx'];</if>

I think that should work.

Freesteyelz 04-12-2006 06:18 AM

Use instead:

Code:

<if condition="$post['fieldx']">
  $post[fieldx]
</if>

Where "x" is you will need to change it to the Field ID. The ID is found in the custom field you've created in Admin CP.

webmastershome 04-12-2006 08:32 AM

thanks for your reply...

but i change the $post['fieldx'] in showthread.php as below

$post['my_variable']='text'.$post['fieldx'];

now when i call the $post['my_variable'] in postbit there is no value

Regards
Jitender

Borgs8472 04-12-2006 11:42 AM

You only need to add this to postbit, nothing else

webmastershome 04-12-2006 11:52 AM

but in postbit i have no value

i am using below

<if condition="!$post['my_variable']">
$post[my_variable]
</if>

peterska2 04-12-2006 02:16 PM

Quote:

Originally Posted by webmastershome
but in postbit i have no value

i am using below

<if condition="!$post['my_variable']">
$post[my_variable]
</if>

Ok, there are a couple of things wrong with this which is why it isn't working.
  1. A '!' means 'not' so what you are actually doing here is telling it that if it is not to post my_variable then you want it to post my_variable. So it is reading the if condition and ignoring it as it doesn't want to not to post it. Sounds confusing? Think how your poor site feels :p
  2. If you are using a profile field that you have created as per your first post, then you do not need to use a different variable to call it. You simply use [fieldx] where x is the number assigned to the profile field in the profile field manager.
So you should use
Code:

<if condition="$post[fieldx]">
$post[fieldx]
</if>

Make sure you replace both instances of x with the field number, found as detailed in point #2 above.

If you wish to add a label before the contents of the field, simply add this text before the middle line of code and ensure you leave a space, otherwise it will all run into one.

Freesteyelz 04-12-2006 10:43 PM

Wow. Where did I go wrong? LOL. :D

peterska2 04-12-2006 10:44 PM

Quote:

Originally Posted by Freesteyelz
Wow. Where did I go wrong? LOL. :D

Don't worry about it. Your code is good, it just got itself changed.

Freesteyelz 04-12-2006 10:53 PM

No worries at all. I'm just having fun with it. :)


All times are GMT. The time now is 07:39 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.02019 seconds
  • Memory Usage 1,729KB
  • 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
  • (2)bbcode_code_printable
  • (2)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