Announcement

Collapse
No announcement yet.

php="true"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    php="true"

    I have had to restore my site from a snapshot due to a big mistake on my part, i am trying to insert some php code into it, yet it will contiunally highlight

    <actinic:block php="true" >

    And say there is a problem and will not work

    #2
    Code:
    <actinic:block php="true" > 
    $sShort = ""; 
    $nCount = 0; 
    $sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" 
    selectable="false" />';  
    foreach(explode(" ", $sOriginal) as $sWord) 
     { 
       if ($nCount > 10) 
        { 
        $sShort .= "..."; 
        break; 
        } 
       $sShort .= $sWord . " "; 
       $nCount++;   Advanced Users Guide - 68 
       } 
    echo $sShort; 
    </actinic:block>

    Comment


      #3
      Try

      Code:
      <actinic:block php="true" > 
      $sShort = ""; 
      $nCount = 0; 
      $sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />';  
      
      foreach(explode(" ", $sOriginal) as $sWord) 
       { 
         if ($nCount > 10) 
          { 
          $sShort .= "..."; 
          break; 
          } 
         $sShort .= $sWord . " "; 
         $nCount++; 
         } 
      echo $sShort; 
      </actinic:block>
      Fergus Weir - teclan ltd
      Ecommerce Digital Marketing

      SellerDeck Responsive Web Design

      SellerDeck Hosting
      SellerDeck Digital Marketing

      Comment


        #4
        'Advanced Users Guide - 68', is this a new php function?

        Comment


          #5
          Yes

          I believe this is my first one

          Comment


            #6
            Originally posted by fergusw View Post
            Try

            Code:
            <actinic:block php="true" > 
            $sShort = ""; 
            $nCount = 0; 
            $sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />';  
            
            foreach(explode(" ", $sOriginal) as $sWord) 
             { 
               if ($nCount > 10) 
                { 
                $sShort .= "..."; 
                break; 
                } 
               $sShort .= $sWord . " "; 
               $nCount++; 
               } 
            echo $sShort; 
            </actinic:block>
            Thanks that worked

            Comment


              #7
              Originally posted by lazystudent View Post
              Yes

              I believe this is my first one
              If you look at the code you provided, you will see the text I mentioned randomly included in the middle of the php, I expect that's why it did not work. 4th line from bottom.

              Comment


                #8
                Originally posted by lazystudent View Post
                Thanks that worked
                *points to "thanks" button*----->

                No problem - as Lee said it was just a bit of stray text that had no place hanging about inside that block of PHP code.
                Fergus Weir - teclan ltd
                Ecommerce Digital Marketing

                SellerDeck Responsive Web Design

                SellerDeck Hosting
                SellerDeck Digital Marketing

                Comment

                Working...
                X