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.

[SOLVED] - Very serious parsing problem

September 20, 2011 1:24pm

Subscribe [0]
  • #1 / Sep 20, 2011 1:24pm

    MrBaseball34

    99 posts

    I have this code in my header:

    {if embed:channel == ""}
        <title>My Company Title</title>
    {if:elseif embed:channel == "leadership" && segment_4 == ''}
        <title>Leadership Team - My Company Title</title>
    {if:elseif embed:channel == "leadership"}
        {exp:channel:entries limit="1" channel="{embed:channel}" dynamic="no" url_title="{segment_4}"}
        <title>{title} - My Company Title</title>
        {/exp:channel:entries}
    {if:else}
        {exp:channel:entries orderby="nav_order" sort="asc" limit="1" channel="{embed:channel}"}
        <title>{title} - My Company Title</title>
        {/exp:channel:entries}
    {/if}
        <link rel="icon" href="/images/favicon.ico" type="image/x-icon" />
        <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
        <!-- styles -->
        <link rel="stylesheet" type="text/css" href="/css/c/style" />
        <link rel="stylesheet" type="text/css" href="/css/c/dd.css" />
    {if "{embed:js}" == "schedule" or segment_3 == "register_for_others" }
        <link rel="stylesheet" type="text/css" href="/css/c/modal.css" media="screen" charset="utf-8" />
    {/if}
    <script src="/assets/js/jquery-1.6.min.js" type="text/javascript"></script>
    
    {!-- EH - load the banner_sliders js if on homepage --}
    {if "{embed:js}" == "home" }
    <script src="/j/banner_slides" type="text/javascript"></script>
    <script src="/j/multi-click-slider" type="text/javascript"></script>
    <script src="/j/designation_logo.js" type="text/javascript"></script>
    {/if}

    Because I am getting eval errors, I decided to echo out the string that it was evaluating.
    Here is the change I made to the evaluate function in Functions.php:

    function evaluate($str)
    {    
      $x = eval('?'.'>'.$str.'<?php ');        
      if($x ===false) {
        echo $str;
        exit;
       } else {
         return $x;
        }
    }

    When I echo out the string, this is what I get:

    <?php if("" == "") : ?>
        <title>My Company Title</title>
    <?php elseif("" == "leadership" && "" == '') : ?>
        <title>Leadership Team - My Company Title</title>
    
    <?php elseif("" == "leadership") : ?>
        
        <title>CISR Main Page - My Company Title</title>
        
    <?php else : ?>
        
        <title>CISR Main Page - My Company Title</title>
        
    <?php endif; ?>
        <link rel="icon" href="/images/favicon.ico" type="image/x-icon" />
        <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
        <!-- styles -->
    
        <link rel="stylesheet" type="text/css" href="/css/c/style" />
        <link rel="stylesheet" type="text/css" href="/css/c/dd.css" />
    <?php if("schedule" == "schedule" FALSE "" == "register_for_others") : ?>
        <link rel="stylesheet" type="text/css" href="/css/c/modal.css" media="screen" charset="utf-8" />
    <?php endif; ?>
    89Protect17021Me01Please47
    
    
    <?php if("schedule" == "home") : ?>
        89Protect17121Me01Please47
        89Protect17221Me01Please47
        89Protect17321Me01Please47
    <?php endif; ?>

    Can someone please explain to me where the “protect” stuff came from?

  • #2 / Sep 20, 2011 1:30pm

    MrBaseball34

    99 posts

    Oh, forget it, the or in this statement was the culprit:

    {if "{embed:js}" == "schedule" or segment_3 == "register_for_others" }
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases