#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    UK
    Posts
    76
    Rep Power
    16

    Unhappy smarty renders blank page


    I posted a message before but no one was keen to reply .

    here is my phpinfo file phpinfo

    my include path is /wwwroot/php/include - under which ive copied the smarty class files and the plugins directory .

    my index.php looks like this

    PHP Code:
    <?php

    require 'Smarty.class.php';

    $smarty = new Smarty;

    $smarty->template_dir /wwwroot/htdocs/scs/templates/;
    $smarty->compile_dir /wwwroot/htdocs/scs/templates_c/;
    $smarty->config_dir /wwwroot/htdocs/scs/configs/;
    $smarty->cache_dir /wwwroot/htdocs/scs/cache/;

    $smarty->compile_check true;
    $smarty->debugging true;

    $smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill");
    $smarty->assign("FirstName",array("John","Mary","James","Henry"));
    $smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
    $smarty->assign("Class",array(array("A","B","C","D"), array("E""F""G""H"),
          array(
    "I""J""K""L"), array("M""N""O""P")));

    $smarty->assign("contacts", array(array("phone" => "1""fax" => "2""cell" => "3"),
          array(
    "phone" => "555-4444""fax" => "555-3333""cell" => "760-1234")));

    $smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
    $smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
    $smarty->assign("option_selected""NE");

    $smarty->display('index.tpl');

    ?>
    my index.tpl file looks like this

    PHP Code:

    {config_load file=test.conf section="setup"}
    {include 
    file="header.tpl" title=foo}

    <
    PRE>

    {* 
    bold and title are read from the config file *}
    {if 
    #bold#}<b>{/if}
    {* capitalize the first letters of each word of the title *}
    Title: {#title#|capitalize}
    {if #bold#}</b>{/if}

    The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}

    Tooltip exampleMove your mouse over the <A HREF="" {popup sticky=true caption="Smarty pop-up text" delay=400 text="This is an example of a tooltip. Tooltips are handy for context sensitive information, and extremely easy to add to your templates with Smarty and the integration of <a href='http://www.bosrup.com/web/overlib/'>overLIB</a> by Erik Bosrup"onclick="return false;">Help</Alink to see an example of a tooltip using Smarty's popup function.

    The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}

    Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}

    The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>

    variable modifier example of {ldelim}$Name|upper{rdelim}

    <b>{$Name|upper}</b>


    An example of a section loop:

    {section name=outer loop=$FirstName}
    {if %outer.index% is odd by 2}
        {%outer.rownum%} . {$FirstName[outer]} {$LastName[outer]}
    {else}
        {%outer.rownum%} * {$FirstName[outer]} {$LastName[outer]}
    {/if}
    {sectionelse}
        none
    {/section}

    An example of section looped key values:

    {section name=sec1 loop=$contacts}
        phone: {$contacts[sec1].phone}<br>
        fax: {$contacts[sec1].fax}<br>
        cell: {$contacts[sec1].cell}<br>
    {/section}
    <p>

    testing strip tags
    {strip}
    <table border=0>
        <tr>
            <td>
                <A HREF="{$SCRIPT_NAME}">
                <font color="red">This is a  test     </font>
                </A>
            </td>
        </tr>
    </table>
    {/strip}

    </PRE>

    This is an example of the html_select_date function:

    <form>
    {html_select_date start_year=1998 end_year=2010}
    </form>

    This is an example of the html_select_time function:

    <form>
    {html_select_time use_24_hours=false}
    </form>

    This is an example of the html_options function:

    <form>
    <select name=states>
    {html_options values=$option_values selected=$option_selected output=$option_output}
    </select>
    </form>

    {include file="footer.tpl"} 
    i've also allowed user 'nobody' full read-write permission on the directory in where my templates and index.php are stored, however smarty renders a blank page.....can someone please pass on some ideas ? ive tried everything...thanks

    my smarty app

    here is my error log if it helps

    PHP Code:

    PHP Warning
    :  mkdir() failed (Permission deniedin /wwwroot/php/include/Smarty.class.php on line 1604
    PHP Warning
    :  Smarty errorproblem creating directory "/%%-90/%%-906680308" in /wwwroot/php/include/Smarty.class.php on line 589
    PHP Warning
    :  Smarty errorproblem writing '/%%-90/%%-906680308/debug.tpl.php.' in /wwwroot/php/include/Smarty.class.php on line 589
    PHP Warning
    :  Failed opening '/%%-90/%%-906680308/debug.tpl.php' for inclusion (include_path='/wwwroot/php/include'in /wwwroot/php/include/Smarty.class.php on line 775
    PHP Notice
    :  Use of undefined constant ’ assumed '’' in /wwwroot/htdocs/scs/index.php on line 6
    PHP Notice
    :  Use of undefined constant templates assumed 'templates' in /wwwroot/htdocs/scs/index.php on line 6
    PHP Warning
    :  Division by zero in /wwwroot/htdocs/scs/index.php on line 6
    PHP Notice
    :  Use of undefined constant ’ assumed '’' in /wwwroot/htdocs/scs/index.php on line 6
    PHP Warning
    :  Division by zero in /wwwroot/htdocs/scs/index.php on line 6
    PHP Notice
    :  Use of undefined constant ’templates_c assumed '’templates_c' in /wwwroot/htdocs/scs/index.php on line 7
    PHP Notice
    :  Use of undefined constant ’ assumed '’' in /wwwroot/htdocs/scs/index.php on line 7
    PHP Warning
    :  Division by zero in /wwwroot/htdocs/scs/index.php on line 7
    PHP Notice
    :  Use of undefined constant ’ assumed '’' in /wwwroot/htdocs/scs/index.php on line 8
    PHP Notice
    :  Use of undefined constant configs assumed 'configs' in /wwwroot/htdocs/scs/index.php on line 8
    PHP Warning
    :  Division by zero in /wwwroot/htdocs/scs/index.php on line 8
    PHP Notice
    :  Use of undefined constant ’ assumed '’' in /wwwroot/htdocs/scs/index.php on line 8
    PHP Warning
    :  Division by zero in /wwwroot/htdocs/scs/index.php on line 8
    PHP Notice
    :  Use of undefined constant ’ assumed '’' in /wwwroot/htdocs/scs/index.php on line 9
    PHP Notice
    :  Use of undefined constant cache assumed 'cache' in /wwwroot/htdocs/scs/index.php on line 9
    PHP Warning
    :  Division by zero in /wwwroot/htdocs/scs/index.php on line 9
    PHP Notice
    :  Use of undefined constant ’ assumed '’' in /wwwroot/htdocs/scs/index.php on line 9
    PHP Warning
    :  Division by zero in /wwwroot/htdocs/scs/index.php on line 9
    PHP Warning
    :  Smarty errorunable to read template resource"index.tpl" in /wwwroot/php/include/Smarty.class.php on line 589
    PHP Warning
    :  mkdir() failed (Permission deniedin /wwwroot/php/include/Smarty.class.php on line 1604
    PHP Warning
    :  Smarty errorproblem creating directory "/%%-90/%%-906680308" in /wwwroot/php/include/Smarty.class.php on line 589
    PHP Warning
    :  Smarty errorproblem writing '/%%-90/%%-906680308/debug.tpl.php.' in /wwwroot/php/include/Smarty.class.php on line 589
    PHP Warning
    :  Failed opening '/%%-90/%%-906680308/debug.tpl.php' for inclusion (include_path='/wwwroot/php/include'in /wwwroot/php/include/Smarty.class.php on line 775
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 2
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 2
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 2
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 2
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 2
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7
    PHP Parse error
    :  parse error in /wwwroot/htdocs/scs/index.php on line 7 
    Last edited by eemo; October 24th, 2002 at 10:36 AM.
  2. #2
  3. Shamans + Orc BladeMaster
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    KL,Malaysia
    Posts
    34
    Rep Power
    16
    Hi,are you running Smarty on Windows or Linux machine ?
    I have a modified smarty and it will run on both machine.

    http://www.protonmania.com/imz/

    About your problem, I guess it it because of permission problem on templates_c folder..just rm -rf your current templates_c and mkdir templates_c and chmod 777 of templates_c ..chmoding existing templates_c also will not solve the problem..try create new one.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    UK
    Posts
    76
    Rep Power
    16
    hi

    thanks for replying. i removed templates_c and did chmod 777 as u suggested. i also made sure that the ownership belongs to user and group 'nobody'...still no luck

    im running on Red Hat linux 7.3 by the way

  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Belfast sumwhere, although it could be Lisburn not too sure
    Posts
    178
    Rep Power
    15
    eemo did u ever get that sorted im having the same problem

IMN logo majestic logo threadwatch logo seochat tools logo