How to add php script into the directory templates file?

Discussion in 'PHP' started by hhheng, Oct 12, 2007.

  1. #1
    I tried to add another directory submission form in my directory's submit page. And to show the other directory's category, I need to connect to the other directory's database, and use php script to output the category.

    But when I tried to add some php script in the submit.tpl file, it showed smarty errors.

    So how to include my own php script into the directory template files like submit.tpl, main.tpl, etc.
     
    hhheng, Oct 12, 2007 IP
  2. Squash

    Squash Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is bad idea to add something to smarty templates. IF you need add any php code - you must add it to php script, and call smarty template from this script. It's a very bad idea to put php code into smarty templates.

    But if you are really want this - you can use smarty tags
    {php}
    php code will be here
    {/php}
     
    Squash, Oct 12, 2007 IP
  3. hhheng

    hhheng Banned

    Messages:
    2,633
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello Squash,

    How to call smarty template as you said? I just want to add the following into the right of the submit.php page:

     
    hhheng, Oct 13, 2007 IP