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

    Join Date
    Oct 2013
    Posts
    4
    Rep Power
    0

    Adding a new code


    Hello guys,
    I need a small help here. So, i want to add the code below to one of the pages on my website.
    <div class="left_menu"> {include 'myaccount/leftmenu.tpl'} </div>
    This is the page that I want modify:
    <div class="wrapper"> <div class="containerU"> <div class="container"> <h4>{php}echo WATCHED_AUCTIONS;{/php}</h4> <ul class="auction_item_h"> {include file="myaccount/live_auction_list.tpl"} </ul> {include file="include/pagination.tpl"} </div> </div> </div>
    I tried to add it many times, but there're errors show up and the page became not orgnized.

    Thank you in advance
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    189
    Rep Power
    0
    Originally Posted by obad
    Hello guys,
    I need a small help here. So, i want to add the code below to one of the pages on my website.


    This is the page that I want modify:


    I tried to add it many times, but there're errors show up and the page became not orgnized.

    Thank you in advance
    And what are those errors? That would have helped immensely!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    676
    Rep Power
    7
    If I am wrong, someone feel open to correct me here...

    The code is nothing even close to correct or valid. Each line of code is to end with a ; (w/ exeptions). The curly bracket/brace displayed appears to be your attempt at opening/closing PHP. This is not valid. Just as a QUICK re-write assuming this is the only PHP, not that this is even completely correct in all, but your open/close should look more similar to:
    PHP Code:
    <div class="wrapper">
      <div class="containerU">
        <div class="container">
          <h4><?php echo WATCHED_AUCTIONS(); ?></h4>
          <ul class="auction_item_h"><?php include("myaccount/live_auction_list.tpl"); ?></ul>
          <?php include("include/pagination.tpl"); ?>
        </div>
      </div>
    </div>
    EDIT: The curly bracket/brace is most commonly used to encapsulate the overall description of something. You will see it most in loops, and function definitions. If I am right, the reading you may have come across for the attempt at how you are trying to use them may have been poor. You CAN use them in-line, but they are more a step in/out of PHP in reference to a variable/array.

    Example:
    PHP Code:
    echo "The name " $username " has successfully been added.";
    echo 
    "The name {$username} has successfully been added.";
    echo 
    "The name $username has successfully been added."// Not recommended 
    In the example above, the final one may be fine, but in instances where there will not be a space after the variable, the name will be incorrect. So if you wish to SOMETIMES do it one way, n SOMETIMES the other, your choice, but it is best to remain constant.
    Last edited by Triple_Nothing; October 30th, 2013 at 10:02 AM.
    He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him

IMN logo majestic logo threadwatch logo seochat tools logo