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.

Weird PHP issues

July 18, 2007 10:47pm

Subscribe [2]
  • #1 / Jul 18, 2007 10:47pm

    talinx

    20 posts

    I enabled php in all my templates so that I could use a ratings system plugin (which works fine if I use it in a separate index.php test page that is not an EE template). To get the plugin to work, I have to add <?php require(‘_plugin.php’); ?> at the top of the page and then <?php echo function(); ?> in the part of the page that I want to execute the plugin function.

    For some reason, when I do this in an EE template, the template loses all CSS style as well as the {embed} function. This happens whether I run php on input or output. Any ideas?

  • #2 / Jul 18, 2007 11:02pm

    Sue Crocker

    26054 posts

    Without actually seeing the page, it’s hard to troubleshoot. Do you have a link we can look at?

    Which version/build of EE are you using?

  • #3 / Jul 18, 2007 11:13pm

    talinx

    20 posts

    build: 20070512
    version: 1.5.2 (I would really like to avoid upgrading as I do not yet have a good handle on all I’ve done so far)


    Here is what the page looks like without the php function (though the <?php require… is at the top of the template code: http://www.thedailyslant.com/index.php/site/comments/self_doubt_hypocrisy_and_the_wests_demise/

    Here’s what the page looks like when I put a <?php function… into the template to draw from the required file and js: http://www.thedailyslant.com/index.php/site/test/self_doubt_hypocrisy_and_the_wests_demise/

  • #4 / Jul 19, 2007 11:10am

    Robin Sowell

    13255 posts

    I suspect you need the full path in that require.  And it looks like the first embeds aren’t getting parsed in the broken page- thus no styling etc.  If I had to guess, I’d say you’re throwing errors that we can’t see.  Do you have ‘Show php errors to superadmins’ set in ‘Admin- System Prefs- Output and Debug’?  If so, do you see any errors?  Can do a quick test on an empty template:

    <?php
    $dog = 'booter'
    echo $dog;
    ?>

    With php parsing on, you should see an error message rather than a blank template.

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

ExpressionEngine News!

#eecms, #events, #releases