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.

PHP Error

June 23, 2009 2:09am

Subscribe [4]
  • #1 / Jun 23, 2009 2:09am

    Mark A. Klassen

    17 posts

    My client’s website has been acting quite weird. I’ve been randomly getting this warning.

    Parse error: syntax error, unexpected T_ELSE in(server_url)/www/system/core/core.functions.php(637) : eval()‘d code on line 64


    It usually clears up if I go into the templates page and click update on a random template and then refresh the page, but I’ve been getting this error quite a bit today and I’m not sure what to do.

  • #2 / Jun 23, 2009 2:21am

    John Henry Donovan

    12339 posts

    Mark,

    What version and build of EE are you on?

    Do you have conditionals in your templates?

    That error is usually related to a conditional syntax issue and perhaps the parse order of your template.

  • #3 / Jun 23, 2009 12:45pm

    Mark A. Klassen

    17 posts

    I’m running 1.6.7.

    I do have conditionals in my templates. There are a few variables.

    Suggestions? Do you need access to the site to see the code?

  • #4 / Jun 23, 2009 12:57pm

    silenz

    1651 posts

    At first you should try to determine in which template the error occurs.

    Then try to narrow down which (if there are multiple) conditional is the problematic one. Might need some reduction testing.

    If you can post the code that would be helpful.

  • #5 / Jun 23, 2009 1:17pm

    Mark A. Klassen

    17 posts

    I’ve narrowed it down to this template. I know this is a lot of code but I’m not sure exactly what I can do:

    {if embed:type == "preview"}
    <!-- Post Starts Here-->
    {exp:weblog:entries weblog="blog" limit="5" paginate="bottom"}
    {if no_results}
    <h1>There Are No Blog Posts!</h1>
    We're sorry, but {site_name} has yet to write anything in their blog. Please come back soon to see if we have written anything or subscribe to our <a href="http://{path=blog/rss}">RSS Feed</a> to get blog posts sent to you!
    {/if}
    <h1><a href="http://{url_title_path=blog/post}">{title}</a></h1>
    <h6>Posted on {entry_date format="%l, %F %j, %Y"} |  <a href="http://{title_permalink=">{if comment_total == "0"}There Are No Comments{/if}{if comment_total == "1"}{comment_total} Person Left A Comment{/if}{if comment_total >= "2"}{comment_total} People Left Comments{/if}</a> | <a href="http://{title_permalink=" title="Read more: {title}">Read Full Entry</a></h6>
    
    <p>{summary-text}<br />
                            <br />
                            <a href="http://{title_permalink=" title="Read more: {title}">Continue Reading ››</a><br />
                            <div id="entry-tags"><div class="post-information-left">Tags: {exp:simpletag:taggify path="{path=blog/post}" delimiter=",_"}{keywords}{/exp:simpletag:taggify}</div><div class="post-information">Category: {categories}</p>
    
    <p><a href="http://{category_url_title}">{category_name}</a></p>
    
    <p>{/categories}</div><div class="post-information">[removed][removed]</div></div><hr><br />
    {paginate}<!-- paginiation begins--><br />
                            <div id="pagination" class="grid_9"><br />
                                <div id="pagination-padding"><br />
                                Page {current_page} of {total_pages} pages {pagination_links}<br />
                                </div><br />
                            </div><br />
                            <!-- paginiation ends-->{/paginate}<br />
    {/exp:weblog:entries}</div><br />
    <!-- POST ENDS HERE--><br />
    {if:else}<br />
    {/if}</p>
    
    <p><br />
    {if embed:type == "posts"}<br />
    <!-- Post Starts Here--><br />
    {exp:weblog:entries weblog="blog" limit="1" status="open"}<br />
    {if no_results}<br />
    <h1>There Are No Blog Posts!</h1><br />
    We're sorry, but we couldn't find what you were looking for. It seems like there are no blog posts here. Please try refreshing your browser and double checking the web address.<br />
    {/if}<br />
    <h1><a href="http://{title_permalink=">{title}</a></h1></p><h6>Posted on {entry_date format="%l, %F %j, %Y"} |  <a href="http://{title_permalink=">{if comment_total == "0"}There Are No Comments{/if}{if comment_total == "1"}{comment_total} Person Left A Comment{/if}{if comment_total >= "2"}{comment_total} People Left Comments{/if}</a> | <a href="http://{path=blog/index}" title="Recent Posts">View Recent Posts</a></h6>
    <p>{post-text}<br />
                            <div id="entry-tags">Tags: Weddings, Events, Photos | Category: Uncategorized</div><hr>{/exp:weblog:entries}</div><br />
    <!-- POST ENDS HERE--><br />
    {if:else}<br />
    {/if}

  • #6 / Jun 23, 2009 5:39pm

    Sue Crocker

    26054 posts

    Mark, what we recommend in these cases is to create a new template and reduce what it is you are doing. If a reduced template works, add back additional elements until you figure out what broke it.

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

ExpressionEngine News!

#eecms, #events, #releases