Originally Posted by TecBrat View Post
Not a Question, but I didn't know where else to post this.
I posted this in the infopages thread a while back. I have updated it to work with ezpages in 1.3.0
To allow PHP code to run inside a "page".
copy includes/templates/template_default/templates/tpl_page_default.php to
includes/templates/*your template*/templates/
Then edit the new copy as such
find between "<div></div>"
Code:
echo $var_pageDetails->fields['pages_html_text'];
and replace with:
Code:
$titlecheck=substr($var_pageDetails->fields[pages_title],0,9);
if ($titlecheck=="allowcode"){
eval(stripslashes($var_pageDetails->fields['pages_html_text']));}
else{echo $var_pageDetails->fields['pages_html_text']; }
Change "allocode" to whatever name you want your php code ezpages to have, or add more names or remove the if alltogether if you want. (dont forget to change ,0,9 to ,0,x where x is the length of your "allowcode" replacement string.
I hope this is helpful. (I notice that someone else was looking to use include in infopages or ezpages, That's exactly what I am doing. Apparently That person didn't dig deep enough in the other thread, it was 30+ pages long.)
Bookmarks