Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to give a field a default value
JimR Offline
Junior Member
**
Posts: 15
Joined: Jun 2012
Post: #5
RE: How to give a field a default value
(02-27-2013 09:31 AM)ZiNgA BuRgA Wrote:  Okay, so you want a Blank Replacement Value, not a Default Value.
In which case, you place the code there.

As for your PHP, you need to globalise your $sub and $build variables, otherwise nothing outside the template can actually access them.
You may wish to review your code though.  There's certainly stuff in there that you probably aren't intending, and the logic seems unnecessarily complicated.

The big switch statement is required the llpg database (this contains all UK addresses) has 200 fields of which none are required to be filled in (different entry clerks use different fields). in order to make things simple I have chosen the most popular fields. To make the address display without blank lines I took the approach of using the switch. unless you can advise me of a better way of doing it.
I tried to use the Blank Replacement Value which works when you use {$GLOBALS['threadfields']['add1']} in the postbit template but when you use {$tfinput['add1']} in the editpost template there is no value.
I have used a fresh install of mybb 1.69 with xthreads 1.62
produced a threadfield with the Default Value value set and this is not displayed when the post is edited I have also set a Blank Replacement Value should I only set one or the other ?
02-28-2013 04:10 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
How to give a field a default value - JimR - 02-26-2013, 05:11 AM
RE: How to give a field a default value - JimR - 02-28-2013 04:10 AM

 Standard Tools
Forum Jump: