PDA

View Full Version : Problem with the module from the Tutorial 101


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') . '";');
}

?>

The Geek
03-23-2006, 05:52 PM
huh. I just copied that code, pasted it into a test.php file. Registered and added it to my default review set (on forumdisplay AND showthread) and it works on this end.

Could be a bad upload of the php file as i've seen that happen before.

sammyman
03-27-2006, 05:57 PM
Could be a bad upload of the php file as i've seen that happen before.

Same thing here too. I hope it is just a bad upload. I will keep trying, but I wonder what would cause this. I feel like I must have missed a step, but I did what #1 did exactly.

trana
03-28-2006, 03:59 AM
Same thing here too. I hope it is just a bad upload. I will keep trying, but I wonder what would cause this. I feel like I must have missed a step, but I did what #1 did exactly.

I know it wasn't an upload problem for me since I created the file in notepad on the server. I haven't tried this again but I will go back and give it another shot in case I screwed something up.

sammyman
03-28-2006, 06:37 AM
It worked. I did it in Macromedia, then uploaded it and it worked. I wonder if it has to do with the permissions? Good luck.