Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

blank page... And i dont know why.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
nebulae
Guest





PostPosted: Wed Oct 22, 2003 9:15 pm    Post subject: blank page... And i dont know why. Reply with quote

ok, heres my problem:

every other page on the site works. so far Smarty has been kind ot me. however... for some reason just one page will not display anything. the debug console works, all the vars are being parsed, everything seems normal, yet the page remains blank.

heres the code:
Code:


// some phpbb stuff
define('IN_PHPBB', true);
$phpbb_root_path = '/home/web/HDTVCentral.com/html/forums/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if ( $userdata['session_logged_in'] )
{
   $u_login_logout = '/forums/login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id'];
   $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';
   echo $l_login_logout; // works
}
else
{
   $u_login_logout = '/forums/login.'.$phpEx;
   $l_login_logout = $lang['Login'];
   echo $l_login_logout; // works
}

$s = new Smarty();
$s->assign( "u_login_logout", $u_login_logout );
$s->assign( "l_login_logout", $l_login_logout );

$page = new layout(); // to create the menus
$page->id = "news";
$page->buildmenu();
$s->assign( "menu", $page->menu );
$s->assign( "submenu", $page->submenu );

$news = new news();

if( $_GET['id'] == "" ) {
  $data = $news->getLatestNewsItem();
} else {
  $news->id = $_GET['id'];
  $data = $news->getNewsItem();
}

$s->assign( "data", $data );
foreach($data as $k => $v){
  echo $k . ': ' . $v . '<br>';
} // works fine

$cart = new authenticate();
$quan = $cart->getCartQuan();
echo 'quan: ' . $quan;
$s->assign( "tot_quan", $quan );

$s->compile_dir = '/home/web/HDTVCentral.com/html/templates_c';
$s->compile_check = true;
$s->debugging = true;
$s->display( '/home/web/HDTVCentral.com/html/templates/news/index.tpl' );


everything is set up fine, all the paths are right, theres no errors, yet it just will not display.

template code:
Code:


{include file="/home/web/HDTVCentral.com/html/templates/main_top.tpl" title="Welcome to HDTVCentral.com" menu=$menu submenu=$submenu quan=$tot_quan u_login_logout=$u_login_logout l_login_logout=$l_login_logout}
               <table width="100%" cellpadding="3" cellspacing="3" border="1" bordercolor="#cccccc" align="left">
                 <tr>
                   <td width="100%" align="left"><h1>{$data['title']}</h1></td>
                 </tr>
               </table>
{include file="/home/web/HDTVCentral.com/html/templates/main_bottom.tpl"}



just will not give me anything. any ideas? Ive been going mad with this for a few hours now, cant figure it out. thanks in advance Smile

ps, the site for this page is http://hdtvcentral.com/news/index.php as you can see, all the other pages are working and yes, they all use the phpbb code snippets as well. Im baffled. help?
Back to top
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Oct 22, 2003 11:50 pm    Post subject: Reply with quote

Does this change help?

from:
Code:
{$data['title']}

to:
Code:
{$data.title}

In Smarty, you use brackets to retrieve indexed keys and the dot notation for associative keys.

I believe that when used incorrectly, this generates a PHP Fatal error, raised by a Smarty syntax error--which explains the blank page. Check your php error log.
Back to top
View user's profile Send private message
nebulae
Guest





PostPosted: Thu Oct 23, 2003 5:05 am    Post subject: Reply with quote

one of those things you had to borrow someone elses eyes to see, heheh. Thanks Smile
Back to top
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP