Ok now I see what you problem is!
You can just echo the "games" because you need them in a variable for sending to the template file.
I see two work arounds:
let's see the first.
Mod the get_games() function to look like this:
function get_games(){
$query = mysql_query("SELECT gameID,gameTitle,gameDescription FROM games");
$numgames = mysql_num_rows($query);
ob_start();
for ($i = 0; $i <= $numgames; $i++){
while($fetch=mysql_fetch_array($query)){
$gameID=$fetch["gameID"];
$gameTitle=$fetch["gameTitle"];
$gameDescription=$fetch["gameDescription"];
$temps = array(
'GAMEID' => $gameID,
'GAMETITLE' => $gameTitle,
'GAMEDESC' => $gameDescription
);
$file="themes/default/game_list.tpl";
$setgames = set_template($file, $temps);
$game[$i] = $setgames;
echo $game[$i];
}
}
$ret=ob_get_contents();
ob_end_clean();
return $ret;
}
I've used here the php output buffering functions. You can read a this complete tutorial about <a href="http://php.assistprogramming.com/php-buffer-output-put-contents-in-a-variable.html">PHP output buffering functions</a>.
That should be it. now it would work as you want. let me know if you have troubles making this work and I'll help you.
I won't present the other workaround just yet since I dont think that is necessary
Cheers
Claude