Hello to the great devs at CMS Made Simple,
I am testing the script to be used by our local Arts Council and so far it has met our needs.
However I would like to ask the dev people if it is possible to do a PHP include to include a photo gallery PHP script.
The gallery that comes with CMSMS is great but I would like to include another gallery script. It is a flat file db script.
This is my test install of CMSMS http://cms2.webentia.net/index.php
Thank you!!
Can I do a PHP include for front end?
Re: Can I do a PHP include for front end?
You should be able to with the {php} {/php} keywords. You would be able to include PHP code within in. Just make sure your configurations allows you to do that.
Re: Can I do a PHP include for front end?
Thanks duclet,
Let me get this straight in my head, I would make a new page the do a:
Configurations? - I searched the support about this.
Can you elaborate?
Thanks!!!!
Let me get this straight in my head, I would make a new page the do a:
Code: Select all
{php}<? include("script_name.php");?>{/php}
Can you elaborate?
Thanks!!!!
Re: Can I do a PHP include for front end?
Hi MarkP!
You can find this in Wiki
You can find this in Wiki
Here's the link for that http://wiki.cmsmadesimple.org/index.php/Developers_FAQUsing {php} and {/php} Tags
The second way to include php code into your page is by using {php} and {/php} tags to surround your php code in your page or template (you do not need the tags with this syntax). However, this functionality is disabled by default on new installs.
To enable this functionality, you need to change one line of the config.php file in your installation. Change the "use_smarty_php_tags" setting to true. i.e.:
#Allow smarty {php} tags? These could be dangerous if you don't trust your users.
$config['use_smarty_php_tags'] = true;
Now you can place php code into your page or template at will. i.e.:
{php}phpinfo();{/php}
Note: This is not the recommended way of accomplishing this task, as any user with the ability to edit the page, or the template could edit the php code, and besides causing script errors, could potentially introduce security issues. Use a User-Defined tag instead.
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Re: Can I do a PHP include for front end?
Thanks Coldman,
Just checked out the link you sent.
What I did was do my include in my UDT:
I named it "sgal" and added {sgal} to the page.
Now I feel I am getting closer... now I just have some issues with the gallery script to work out But I must say that this Forum community is has been so helpful - I wasn't expecting an answer so quick.
If you want to see what I have so far >> http://cms2.webentia.net/index.php?page=sgal
There are issues with the footer (a CSS conflict that I will work out later).
Also I was wondering how I could eliminate the Print page icon for certain pages?
Thanks
Coldman!
Just checked out the link you sent.
What I did was do my include in my UDT:
Code: Select all
include("folder/file1.php");
include("folder/file2.php");
I named it "sgal" and added {sgal} to the page.
Now I feel I am getting closer... now I just have some issues with the gallery script to work out But I must say that this Forum community is has been so helpful - I wasn't expecting an answer so quick.
If you want to see what I have so far >> http://cms2.webentia.net/index.php?page=sgal
There are issues with the footer (a CSS conflict that I will work out later).
Also I was wondering how I could eliminate the Print page icon for certain pages?
Thanks
Coldman!
Re: Can I do a PHP include for front end?
Yes, use UDT instead. Don't let arbitrary users inject arbitrary code into your site.Coldman wrote:Using {php} and {/php} Tags
Note: This is not the recommended way of accomplishing this task, as any user with the ability to edit the page, or the template could edit the php code, and besides causing script errors, could potentially introduce security issues. Use a User-Defined tag instead.
Those pages simply need a template not including the unwanted stuff. Copy the template and edit the copy to remove it. Then assign the new template.MarkP wrote: Also I was wondering how I could eliminate the Print page icon for certain pages?
Pierre M.
Re: Can I do a PHP include for front end?
Thank Pierre!
I now have Singapore gallery in the CMS, http://cms2.webentia.net/index.php?page=sgal&gallery=TEST
I now have Singapore gallery in the CMS, http://cms2.webentia.net/index.php?page=sgal&gallery=TEST