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

August 03, 2010 9:40am

Subscribe [2]
  • #1 / Aug 03, 2010 9:40am

    rcsm

    39 posts

    I am receiving a PHP error message whenever I publish a new blog post that reads:

    Undefined offset:  2 in /home/bixaldev/public_html/cmsys/core/core.functions.php(634) : eval()‘d code on line 19

    Any ideas?

    Additional note - the problem only seems to happen on some browsers/computers?

  • #2 / Aug 03, 2010 6:44pm

    Brandon Jones

    5500 posts

    dpachner,

    1. Which version and build of EE are you using?
    2. While testing, please temporarily disable extensions using the green button in the upper right of the Extension Manager.
    3. Are you using PHP in your templates? Take a look at line 19 of your template.

  • #3 / Aug 04, 2010 12:15pm

    rcsm

    39 posts

    The site is using version 1.6.8, and there is PHP in that particular template.

    Come to think of it, I think that may be when the problem started to occur.

    Basically, I am using a single template for all of the blog content, and then serving up different markup depending on the segment variable. The problem was pagination. There did not seem to be a way to test a segment variable with pagination (P1, P2, etc), so I pieced together this script that does so (see below).

    Is there a smarter way to handle that conditional logic?

    the code is:

    <?php
    global $IN;
    $seg2 = $IN->SEGS[2]; 
    
    if ($seg2=='' || substr($seg2,0,1)=='P') :
    ?>
    <body class="listing">
    <?php
    else :
    ?>
    <body>
    <?php
    endif;
    ?>

    Thanks for the help!

  • #4 / Aug 04, 2010 7:24pm

    Brandon Jones

    5500 posts

    dpachner, as this is an issue with custom PHP code I’ll need to shift this over to the CodeShare Corner. I will suggest though that you take a look at whatever is on line 19 of your template.

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

ExpressionEngine News!

#eecms, #events, #releases