ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

conditional variable giving error :unexpected T_ENDIF

April 25, 2011 5:06pm

Subscribe [4]
  • #16 / Apr 28, 2011 2:27pm

    Brandon Jones

    5500 posts

    Hmm, what exactly is in the extended_text field? Any EE tags? Have you tried with an extended_text field that contains only “test”?

  • #17 / Apr 28, 2011 3:20pm

    notebook

    31 posts

    extended_text only contains a paragraph of Lorem Ipsum text. I also tried putting just *test* in the extended_text but still the same error.

  • #18 / Apr 29, 2011 3:05am

    notebook

    31 posts

    On the same hosting account if i use EE ver 2.1.3 , then there is no such problem , these errors are only coming in EE ver 2.1.4 .

  • #19 / Apr 29, 2011 9:27pm

    Lisa Wess

    20502 posts

    Hi, notebook -

    Can you provide a link to the page that you’re testing Brandon’s code snippet on, please?

    Thank you.

  • #20 / Apr 29, 2011 9:28pm

    Lisa Wess

    20502 posts

    Actually, if you look at the error:

    Parse error: syntax error, unexpected T_ENDIF in /www/public_html/blog/system/expressionengine/libraries/Functions.php(650) : eval()‘d code on line 561

    This is telling us that the error is in your template, on line 561.  Can you show us the entire code for your template?  Are there really 561 lines?

    Thank you!

  • #21 / Apr 30, 2011 3:27am

    notebook

    31 posts

    Hi

    Lisa

    Here is the link to my under construction site.

    http://cantt.ehclients.com/blog/

    i can give the user name and password of admin area to EE staff as well to have a look at this issue. Let me know if i can PM.

  • #22 / Apr 30, 2011 12:07pm

    Lisa Wess

    20502 posts

    Hi, notebook -

    What I need you to do is this:

    1.  Create a new template, don’t duplicate anything, call it “test”
    2.  Put this code, and only this code in it:

    {exp:channel:entries channel="YOUR_CHANNEL" limit="20"}
    <h1>{title}</h1>
    {if extended_text != ""}<a href="http://{comment_url_title_auto_path}" class="more-link">Read more</a>{/if} 
    {/exp:channel:entries}

    3.  Replace YOUR_CHANNEL with the short name for your channel.  The template should have 4 lines of code in it. 
    4.  Now, visit that template - does it give you that PHP error?
    5.  Also, please give us the direct link to that template.

    Thank you!

  • #23 / Apr 30, 2011 3:18pm

    notebook

    31 posts

    Actually, if you look at the error:

    Parse error: syntax error, unexpected T_ENDIF in /www/public_html/blog/system/expressionengine/libraries/Functions.php(650) : eval()‘d code on line 561

    This is telling us that the error is in your template, on line 561.  Can you show us the entire code for your template?  Are there really 561 lines?

    Thank you!

    i missed this message of yours last night as it was on 2nd page,Anyways, my code does not have that number of lines , and i think this error is referring to “Functions.php” line number and not mine code , however i’ll post my code.

  • #24 / Apr 30, 2011 3:26pm

    Greg Salt

    3988 posts

    Hi notebook,

    Okay but also please do run a test as Lisa asked.

    Cheers

    Greg

  • #25 / Apr 30, 2011 3:29pm

    notebook

    31 posts

    Hi, notebook -

    What I need you to do is this:

    1.  Create a new template, don’t duplicate anything, call it “test”
    2.  Put this code, and only this code in it:

    {exp:channel:entries channel="YOUR_CHANNEL" limit="20"}
    <h1>{title}</h1>
    {if extended_text != ""}<a href="http://{comment_url_title_auto_path}" class="more-link">Read more</a>{/if} 
    {/exp:channel:entries}

    3.  Replace YOUR_CHANNEL with the short name for your channel.  The template should have 4 lines of code in it. 
    4.  Now, visit that template - does it give you that PHP error?
    5.  Also, please give us the direct link to that template.

    Thank you!

    This is working without any PHP error, here is the link to that template

    http://cantt.ehclients.com/blog/index.php/test

    so that means , there is a problem in my template ? The strange thing is, in my own code i am not using any PHP , how come it is triggering this error. Anyways i will thoroughly check my template code and also post it here.

  • #26 / Apr 30, 2011 3:36pm

    Greg Salt

    3988 posts

    Hi notebook,

    EE tags are converted and evaluated as PHP expressions so if there is an error you will see a PHP notification like that. Please do check your code but we’ll also have a look when you post it.

    Cheers

    Greg

  • #27 / Apr 30, 2011 8:56pm

    notebook

    31 posts

    Below is my template code for Home Page

    {html_head}
    
        {global_stylesheets}
        {if_ie6}
    
    {html_head_end}    
    
    {branding_begin}
    
        {embed="global_embeds/.top_nav"}
        {embed="global_embeds/.cat_nav"}
        {global_top_search}
                
    {branding_end}
    
    {wrapper_begin}
    
        {feature_wrap_begin}
        {feature_wrap_end}
    
    {container_begin}
    
        {main_blog_entry_with_pics}
            
        {single_entry_without_pic}
    
        {double_entry_with_pics}
                
        {pagination}
                
        {aside}            
                
    {container_close}    
                
    {wrapper_close}
    
    {global_footer}
    
    {js}
    
    {html_close}
  • #28 / Apr 30, 2011 9:15pm

    notebook

    31 posts

    And here is the actual code in snippet {main_blog_entry_with_pics}

    <!-- ################ Entry Start ####################### -->
                
    {exp:channel:entries channel="blog" limit="5"}
    
    <div class="entry">
    
    <div class="entry-previewimage rounded preloading_background">
    <a href="http://single.html">{post_image}</a>
    </div>
                    
    <div class="entry-content">
    <h1 class="entry-heading"><a href="http://single.html">{title}</a></h1>
    <div class="entry-head">
    <span class="date ie6fix">{entry_date format="%M %d, %Y"}</span>
    <span class="comments ie6fix"><a href="http://single.html">{comment_total} Comments</a></span>
    <span class="author ie6fix"><a href="http://single.html">by {author}</a></span>
    </div><!--entry-head-->
                        
    <div class="entry-text">
                {post_body}
    </div><!--entry-text-->
                        
    <div class="entry-bottom">
    <span class="categories"><a href="#">{channel}</a>, <a href="#">{channel}</a></span>
    <a href="http://{comment_url_title_auto_path}" class="more-link">Read more</a>
    </div><!--entry-bottom-->
    </div><!--end entry_content-->
    </div><!--end entry -->
        
    {/exp:channel:entries}
    
    <!-- ################ Entry End ####################### -->

    In the above code when i use this code line for “Read more”

    {if extended_text != ""}<a href="http://{comment_url_title_auto_path}" class="more-link">Read more</a>{/if}

    it gives me this error

    Parse error: syntax error, unexpected T_ENDIF in /www/public_html/blog/system/expressionengine/libraries/Functions.php(650) : eval()‘d code on line 458

  • #29 / May 01, 2011 2:52pm

    Greg Salt

    3988 posts

    Hi notebook,

    What is the content of the extended_text field in this case? Is it just straight text are you using any tags or PHP in it?

    Cheers

    Greg

  • #30 / May 01, 2011 2:56pm

    notebook

    31 posts

    Hi

    Greg

    it is just straight text ,one paragraph of Lorem Ipsum. No EE tags , no PHP.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases