chicote
06-21-2008, 02:50 PM
I create 2 fields in a table ABC, the first field is the X and Y is the second, both store data in a form checkbox, 0 if not checked, and 1 case marked.
Now my question is, I want to create a plugin, which store data from the field X and Y of the field on 2 variables for later I make a comparison in postbit and show a message if X = 1, and another case X = 0, the same applies to Y, show some message if Y = 1 and another message if Y = 0;
For this reason I created a plugin with the following code:
Hook Location: Postbit_display_complete
Plugin PHP Code:
$test = $db->query_read("SELECT * FROM". TABLE_PREFIX. "ABC");
$test = $db->num_rows($test);
$test_x = $test['x'];
$test_y = $test['y']; Then put the template postbit the following condition:
<if condition="$test_x =='1'"> Testing X </if>
<if condition="$test_y =='1'"> Testing Y </if> But nothing worked, someone could help me?
Now my question is, I want to create a plugin, which store data from the field X and Y of the field on 2 variables for later I make a comparison in postbit and show a message if X = 1, and another case X = 0, the same applies to Y, show some message if Y = 1 and another message if Y = 0;
For this reason I created a plugin with the following code:
Hook Location: Postbit_display_complete
Plugin PHP Code:
$test = $db->query_read("SELECT * FROM". TABLE_PREFIX. "ABC");
$test = $db->num_rows($test);
$test_x = $test['x'];
$test_y = $test['y']; Then put the template postbit the following condition:
<if condition="$test_x =='1'"> Testing X </if>
<if condition="$test_y =='1'"> Testing Y </if> But nothing worked, someone could help me?