Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
What tags do i use to insert php?
  • Posted: 28.11.2004, 21:41
     
    xephon
    rank:
    Freshman Freshman
    registered:
     January 2003
    Status:
    offline
    last visit:
    16.04.05
    Posts:
    26
    It has been quite a while since i worked with a themeing engine, especially Smarty (it seems like xanthia is Smarty based but i might be wrong)

    anyways what are the tags to insert PHP into the template files.

    I had an older version of PostNuke up until yesterday, now im trying to change my theme back to what it was, and that requires inserting PHP.

    would it be the "literal" tag like in regular Smarty, or would it be another one?

    i tried search for PHP, but you realize that turned up a bunch of stuff that had nothing to do with what i wanted.
  • Posted: 28.11.2004, 21:57
     
    xephon
    rank:
    Freshman Freshman
    registered:
     January 2003
    Status:
    offline
    last visit:
    16.04.05
    Posts:
    26
    i think i found it



    is that it?
  • Posted: 29.11.2004, 18:03
     
    Landseer
    rank:
    Developer Developer
    registered:
     January 2003
    Status:
    offline
    last visit:
    27.11.08
    Posts:
    851
    Not exactly, it is echo "test";

    The better way would be to write a plugin. So you can use the PHP code in more than one template very easily.

    --
    "He is not dangerous, he just wants to play...."
  • Posted: 30.11.2004, 03:48
     
    xephon
    rank:
    Freshman Freshman
    registered:
     January 2003
    Status:
    offline
    last visit:
    16.04.05
    Posts:
    26
    im not quite smart enough in "Smarty" to do that :/
  • Posted: 30.11.2004, 05:47
     
    xephon
    rank:
    Freshman Freshman
    registered:
     January 2003
    Status:
    offline
    last visit:
    16.04.05
    Posts:
    26
    i put in the following code, but for some reason it will not recognize

    Code

    <!--[php]-->
         if( <!--[$bid]--> == "1")
            {
                echo "<table border=\"0\" class=\"blockrightcontent1\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">";
            } elseif ( <!--[$bid]--> == "11") {
                echo "<table border=\"0\" class=\"blockrightcontent_poll\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">";
            } elseif ( <!--[$bid]--> == "19") {
                echo "<table border=\"0\" class=\"blockrightcontent_stat\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">";
            } elseif (<!--[$bid]--> == "3") {
                echo "<table border=\"0\" class=\"blockright_online\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">";
        } elseif ( <!--[$bid]--> == "20") {
                echo "<table border=\"0\" class=\"blockright_aff\" cellpadding=\"3\" cellspacing=\"0\" width=\"140\">";
            } elseif ( <!--[$bid]--> == "18") {
                echo "<table border=\"0\" class=\"blockright_shout\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">";
            } else {
                echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">";
            }?>
    <!--[/php]-->
  • Posted: 30.11.2004, 15:19
     
    Chestnut
    rank:
    Steering Committee Steering Committee
    registered:
     August 2002
    Status:
    offline
    last visit:
    03.03.08
    Posts:
    1221
    Smarty version :

    Code

    <!--[if $bid eq 1]-->
      <table border="0" class="blockrightcontent1" cellpadding="3" cellspacing="0" width="100%">
    <!--[elseif $bid eq 11]-->
      <table border="0" class="blockrightcontent_poll" cellpadding="3" cellspacing="0" width="100%">
    <!--[elseif $bid eq 19]-->
      <table border="0" class="blockrightcontent_stat" cellpadding="3" cellspacing="0" width="100%">
    <!--[elseif $bid eq 3]-->
      <table border="0" class="blockright_online" cellpadding="3" cellspacing="0" width="100%">
    <!--[elseif $bid eq 20]-->
      <table border="0" class="blockright_aff" cellpadding="3" cellspacing="0" width="140">
    <!--[elseif $bid eq 18]-->
      <table border="0" class="blockright_shout" cellpadding="3" cellspacing="0" width="100%">
    <!--[else]-->
      <table border="0" cellpadding="3" cellspacing="0" width="100%">
    <!--[/if]-->


    :wink:

    --
    Chestnut !
    Support via Private message won't be answered...
    http://dev.pnconcept.com
    http://www.postnuke-france.org
  • Posted: 30.11.2004, 20:40
     
    mgp7419
    rank:
    Professional Professional
    registered:
     August 2004
    Status:
    offline
    last visit:
    01.11.07
    Posts:
    898
    ...Kung-fu Drop kick by the Chestnut...
    TK-O
    1-0

    --
    Im Back
  • Posted: 01.12.2004, 03:56
     
    xephon
    rank:
    Freshman Freshman
    registered:
     January 2003
    Status:
    offline
    last visit:
    16.04.05
    Posts:
    26
    i actually found that out a few hrs after my last post lol

    i worked with Smarty before, but i totally forgot about using the Smarty if loop

    then i felt too retarded to post :/

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula