Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Xthreads variable questions
automaton Offline
Junior Member
**
Posts: 3
Joined: Oct 2010
Post: #1
Xthreads variable questions
I was playing around with the Xthreads tutorial for setting up a product review forum and what I would like to be able to do is to pass a custom thread field variable, i.e {$GLOBALS['threadfields']['pfname']} on to some PHP code to be able to use it as a PHP variable, to be able to do some stuff with it, i.e. stripslashes and so on.

It appears that there's a Xthreads plugin that enables PHP in templates.  Is this the way to go?  How would I use a custom thread variable reply as a PHP variable?  Am I being silly?

Any advice would be much appreciated.

thanks
10-28-2010 11:48 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: Xthreads variable questions
Basically, we can use function shortcut in Display Format or other textarea in custom thread fields settings.
An example for the Display Format (the output):

Code:
<func stripslashes>{VALUE}</func>


Or something like this:

Code:
<?=number_format({VALUE},2)?>


Text Mask Filter feature is a really useful tools if you want to sanitize the input.

But if you want to add it directly in template, you need "at least" Template Conditional plugin for that.
Or you can use PHP In Template plugin.

More info about it:
http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=288&pid=36

I'm really sorry if I misunderstand what you want.


10-29-2010 06:06 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: