Newb PHP in pages - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Installation & Setup (http://get-simple.info/forums/forumdisplay.php?fid=5) +--- Thread: Newb PHP in pages (/showthread.php?tid=1084) |
Newb PHP in pages - eru321 - 2010-10-29 First of all i want to introduce myself, my name is Enrico 30 from Italy and i want to sorry for my english. i don't understand how to insert PHP script in page. For example i have a scipt to list all the file in a directory, and i want to insert this script on the index page or in an another page. I've tried to insert the function in the functions.php file but i don't understand hot to recall the function in the page.. so, anyway, thx for this CMS and for the Help. Ciao Newb PHP in pages - Zegnåt - 2010-10-30 Normally PHP can only be used from within other PHP code. In the case of GetSimple, you can only call functions from within the theme files. If you want to be able to use PHP in the normal page editor, you will need a plugin. Chris’ Exec-PHP can help you out. Newb PHP in pages - eru321 - 2010-10-30 Zegnåt Wrote:Normally PHP can only be used from within other PHP code. In the case of GetSimple, you can only call functions from within the theme files. I've download the exec-php plugin but it seems not to work I mean if i write php code in the normal page editor.. the result is that you read on the page the php code i wrote.. i hope you can understand me better then i explein ) Newb PHP in pages - Carlos - 2010-10-30 Exec-PHP requires disabling the rich editor. Looks like you pasted your code in WYSIWYG mode. Newb PHP in pages - ccagle8 - 2010-10-30 for exec php to work, i believe you need to turn the HTML editor off in the settings panel. Can you try that? Newb PHP in pages - Carlos - 2010-10-30 Some other possible options... - Just insert code in your theme's template.php file (wherever you want it): Code: <?php (Of course you can use if...else or switch...case... sentences, for several pages, different code, etc.) - Another option is stuffing that code into a function, and call it using one of GetSimple's front-end hooks. Example: Code: <?php This can be done either in your theme's functions.php file, or by creating your own custom plugin. (The plugin option may be better because your code will be executed with any theme: no need to edit themes or copy the functions.php file.) Newb PHP in pages - Carlos - 2010-10-30 OMG Chris! We both answered at the same minute!! :-D Newb PHP in pages - ccagle8 - 2010-10-30 haha, great minds think alike. Also, great mini-tutorial there Carlos. Newb PHP in pages - eru321 - 2010-10-30 Thx a lot to everyone. At the moment i've to go to work so i can't do any "try". Tonight i'll try to turn off the html editor, and also other method. really thx. if i succeed in using PHP with this CMS, i thik i'll use CMS for every site i'll do. Grazie ) Newb PHP in pages - yojoe - 2010-11-01 Does turning HTML editor is really needed ? Can't be the php code pasted in "source view" mode in wysiwyg ckedit window ? Newb PHP in pages - eru321 - 2010-11-02 ccagle8, if you want to add at the title of the post with solved. Turning off the html editor the exec-php plugin works. The method of Carlos works too. So really thx to every one. Cheers |