Re: [SMARTY] Smarty bug? or stupid coder?
| From: | Jason Dunbar | Date: | Wed, 13 Nov 2002 08:36:12 +0000 |
| Subject: | Re: [SMARTY] Smarty bug? or stupid coder? | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6408@lists.php.net to get a copy of this message | ||
Oh and yes of course, this is my mistake.
I had forgotten about having posted the URL on here and have inadvertantly
moved the testing pages.
"Jason Dunbar" <jason@interactivesolutions.co.uk> wrote in message
news:20021113082238.87286.qmail@pb1.pair.com...
> File not found? hm.. That is interesting.
>
> Ok here goes: this is the PHP script -
>
> // the forum reading class and the smarty class:
> require('./global/smarty.inc.php');
> require_once('./global/CforumReading.inc.php');
> // $smarty object available
> $oReadPosts = new CforumReading;
> $aPosts = array();
> $nLimit = 10;
> $oReadPosts->readPosts($id, $nLimit, $aPosts);
> $smarty->assign('blah', $_COOKIE['thisCookie']);
> $smarty->assign('aPosts', $aPosts);
> $smarty->assign('id', $_GET['id']);
> $smarty->display('template.tpl');
> // time to clean up after ourselves
> unset($oReadPosts);
>
> The smarty object is instantiated when the file relating to it is
required,
> so don't worry about where $smarty comes from.
>
> And here is template.tpl -
>
> !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xml:lang="en" lang="en">
> <head>
> <title>Viewing posts</title>
> <link rel="StyleSheet" href="./css/styles.css"
> type="text/css"
> media=screen>
> </head>
> <body>
> <!-- header navigation table -->
> {* Is the forum user/client logged in? *}
> {if $blah == ''}
> {include file="1_navigation_guest.tpl"}
> {else}
> {include file="1_navigation.tpl"}
> {/if}
> <br>
> <!-- posts printed below -->
> <table width="100%" cellpadding="4" cellspacing="0"
> border="0">
> <tr>
> <td width="50%" align="left"
> class="colHeader">Post
> subject</td>
> <td width="12%" align="left"
> class="colHeader">Posted
> by</td>
> <td width="13%" align="left"
> class="colHeader">Posted
> on</td>
> <td width="12%" align="left"
> class="colHeader">Last
> post</td>
> <td width="13%" align="left"
> class="colHeader">Date
> replied</td>
> </tr>
> {$aPosts[2]}
> </table>
> <!-- pagination -->
> {include file="pagination.tpl"}
> <br>
> <!-- footer navigation table -->
> {* Is the forum user/client logged in? *}
> {if $blah == ''}
> {include file="1_navigation_guest.tpl"}
> {else}
> {include file="1_navigation.tpl"}
> {/if}
> </body>
> </html>
>
> "Manfred 'Dwerg' Stienstra" <manfred.stienstra@dwerg.net> wrote in
> message
> news:200211130039.54009.manfred.stienstra@dwerg.net...
> On Tuesday 12 November 2002 15:41, Jason Dunbar wrote:
> > Take a look at
> > http://www.interactdev1.co.uk/forum/forums_view.php
>
> I'm sorry, but I'm getting a 'file not found'.
>
> > Now try going up a level to view the forums, then try clicking on
another
> > forum. See? nothing displays.
> > it is EXACTLY the same file.. just a different id variable passed in the
> > querystring. The application works fine locally on a similar setup. I've
> > tried this.. I've tried that..
>
> My guess is that some sort of post/get variable isn't passed on because of
> some php setting (session management for instance). That's why some if
> statement might fail and the page isn't displayed. Please post you
template
> so we can look at possible errors in the code. You might also want to post
> some relevant php code.
>
> Manfred
>
>