PDA

View Full Version : Blank Page, Need Help


paul41598
21 Nov 2006, 12:59
What do you see wrong with this php file I made? I keep getting a blank page and its driving me crazy. All Im doing is a query and outputting the results in a table.

I think it has to do with fetching the templates. Because if I put a echo "$getadmirername1"; right before the fetch template it shows me results fine.

My templates are made and the right variables placed in em. I dont get it


<?php

$globaltemplates = array(
'jb_bit',
'jb'
);

require_once('./global.php');

$sql = $vbulletin->db->query("
SELECT thread.title as ttitle, thread.forumid, forum.forumid, forum.title as ftitle
FROM " . TABLE_PREFIX . "thread
LEFT JOIN " . TABLE_PREFIX . "forum as forum ON(thread.forumid = forum.forumid)
WHERE vbp_titletextcolor <> ''
");

while($thisuser = $vbulletin->db->fetch_array($sql))
{
$gettitle = $thisuser['ttitle'];
$getforumtitle = $thisuser['ftitle'];

eval('$jb_bits .= "' . fetch_template('jb_bit') . '";');

}
eval('$html = "' . fetch_template('jb') . '";');

?>


n/m figured it out. Guess I needed a:

eval('print_output("' . fetch_template('shell_blank') . '");');

in there... weird

harmor19
21 Nov 2006, 19:42
Let me try and explain this.

I'll rewrite it so you can see why you need eval('print_output("' . fetch_template('shell_blank') . '");');


<?php

while($thisuser = $vbulletin->db->fetch_array($sql))
{
$gettitle = $thisuser['ttitle'];
$getforumtitle = $thisuser['ftitle'];

$jb_bits .= "This text goes into the template "jb_bit";

}

$html = "This goes into the template "jb";

?>

If you notice the variables aren't being echoed. So you have to add a line to echo them out.


<?php

while($thisuser = $vbulletin->db->fetch_array($sql))
{
$gettitle = $thisuser['ttitle'];
$getforumtitle = $thisuser['ftitle'];

$jb_bits .= "This text goes into the template "jb_bit";

}

$html = "This goes into the template "jb";

echo "show us the contents of $jb_bits and $html";

?>


I know it's not a very good explanation but hopefully you now understand how it works.