trana
03-22-2006, 11:07 PM
I'm trying to follow along with the GARS Tutorial 101, and seem to be hitting a basic problem. I used the code provided in a test.php, registered the module, added the module to the module set (which is already applied to a GARS enabled forum). When I do this, on the forumdisplay I get a blank page. When I remove this module from the set it loads the page properly. Note that I am adding this module to the default review set.
I'm just using the listed code, do I need to do anything else? Sorry, the Tutorial doesn't go into much depth on this. Can I leave the variable as the custom1 below?
Any help would be appreciated.
Thanks!
<?php
if ($stage == "edit")
{
$output .= "Rating: <SELECT name=\"custom1[my_rating]\">
<OPTION value=\"G\">G - General Audiences</OPTION>
<OPTION value=\"PG\">PG - Parental Guidance</OPTION>
<OPTION value=\"PG13\">PG13 - Children under 13 are too cute for this movie</OPTION>
<OPTION value=\"R\">R - Under 17's not admitted without parents</OPTION>
<OPTION value=\"X\">X - It marks the spot</OPTION>
</SELECT>";
}
elseif($stage == "persist")
{
$my_rating = $this->vb->GPC['custom1']['my_rating'];
$values['my_rating'] = $my_rating;
}
elseif($stage == "display")
{
$title = "Rating";
$bits = "<tr><td class=\"alt1\" align=\"center\">" . $values['my_rating'] . "</td></tr>";
eval('$output.="' . fetch_template('GARS_mod_container') . '";');
}
?>
I'm just using the listed code, do I need to do anything else? Sorry, the Tutorial doesn't go into much depth on this. Can I leave the variable as the custom1 below?
Any help would be appreciated.
Thanks!
<?php
if ($stage == "edit")
{
$output .= "Rating: <SELECT name=\"custom1[my_rating]\">
<OPTION value=\"G\">G - General Audiences</OPTION>
<OPTION value=\"PG\">PG - Parental Guidance</OPTION>
<OPTION value=\"PG13\">PG13 - Children under 13 are too cute for this movie</OPTION>
<OPTION value=\"R\">R - Under 17's not admitted without parents</OPTION>
<OPTION value=\"X\">X - It marks the spot</OPTION>
</SELECT>";
}
elseif($stage == "persist")
{
$my_rating = $this->vb->GPC['custom1']['my_rating'];
$values['my_rating'] = $my_rating;
}
elseif($stage == "display")
{
$title = "Rating";
$bits = "<tr><td class=\"alt1\" align=\"center\">" . $values['my_rating'] . "</td></tr>";
eval('$output.="' . fetch_template('GARS_mod_container') . '";');
}
?>