Page 2 of 2

Re: Replacing Problem

Posted: Sun Jan 31, 2010 4:23 pm
by AbraCadaver
It's really hard to tell what's going on without debugging it myself, so to pytrin's point, forget the eval() and include the file:

Instead of:

Code: Select all

$data = (file_exists($data)) ? join("", file($data)) : $data;
Try:

Code: Select all

if(file_exists($data)) {
    ob_start();
    include($data);
    $data = ob_get_clean();
}

Re: Replacing Problem

Posted: Sun Jan 31, 2010 4:35 pm
by Trahb
AbraCadaver wrote:It's really hard to tell what's going on without debugging it myself, so to pytrin's point, forget the eval() and include the file:

Instead of:

Code: Select all

$data = (file_exists($data)) ? join("", file($data)) : $data;
Try:

Code: Select all

if(file_exists($data)) {
    ob_start();
    include($data);
    $data = ob_get_clean();
}
Wow.
It worked <3 Saved my life! :D :drunk:

Re: Replacing Problem

Posted: Sun Jan 31, 2010 4:38 pm
by AbraCadaver
Well thank pytrin. That was the path he was trying to get you to follow. I was was trying to give you a quick change to allow PHP code in your templates.

Re: Replacing Problem

Posted: Sun Jan 31, 2010 4:44 pm
by Trahb
Well thanks to both of you :D