CMS Made Simple Forums
https://forum.cmsmadesimple.org/

PHP?
https://forum.cmsmadesimple.org/viewtopic.php?f=7&t=303
Page 1 of 1

Author:  SN3 [ Wed Dec 29, 2004 12:47 am ]
Post subject:  PHP?

How can I put PHP codes in CMS made simple? I was able to put a simple time code by creating a plug in, but what about other simple codes like PHP includes? I also want to put in a translate code, but that won't work either. Here is the php translate code:

\$1:
<?
$currenturl = $_SERVER["PHP_SELF"];
if ( $_SERVER['QUERY_STRING'] <> '') {
   $currenturl .= "?" . $_SERVER['QUERY_STRING'];
   }
$currenturl = 'http://' . $_SERVER["SERVER_NAME"] . $currenturl;
$currenturl = str_replace(":", "%3A", $currenturl);
$currenturl = str_replace("/", "%2F", $currenturl);
$currenturl = str_replace("&", "%26", $currenturl);
?>

That's just some simple php code that won't work when I put it in. Even when I put in in as a plugin, the code never shows up when I go to view the source, and it never replaces the:
\$1:
 <?echo
$currenturl;?>

in the links with the address.

The PHP code works fine when it is not in CMS made simple. I really love this software, but if I can't get php includes to work, I can't use it. Thanks so much for working so hard to create this - I've been looking for months now, and this is so simple to use! Just what I wanted (except for the PHP problems)! 8)

Author:  SN3 [ Wed Dec 29, 2004 12:59 am ]
Post subject:  PHP?

I get an error:


Parse error: parse error, unexpected '<' in /home/stealth/public_html/invisionmicro/smarty/cms/templates_c/%%F9^F9E^F9E10D84%%preview%3Acmspreview4ALXNJ.php on line 218

Author:  Ted [ Wed Dec 29, 2004 1:00 am ]
Post subject:  PHP?

Make a user defined plguin as outlined in http://wiki.cmsmadesimple.org/pmwiki.ph ... sicPlug-In

Author:  SN3 [ Wed Dec 29, 2004 1:02 am ]
Post subject:  PHP?  Topic is solved

Patricia \Patricia:
remove opening and closing ?>

they are replaced by {php} and {/php}


I did that, it still won't work.

Author:  SN3 [ Wed Dec 29, 2004 1:04 am ]
Post subject:  PHP?

wishy \wishy:
Make a user defined plguin as outlined in http://wiki.cmsmadesimple.org/pmwiki.ph ... sicPlug-In


I tried that before but it wouldn't work.

It did work with the date thing though, and it worked. Now it won't. :cry:

Author:  SN3 [ Wed Dec 29, 2004 1:18 am ]
Post subject:  PHP?

I'm talking about the code when I put it in the WYSIWYG editor. I did the date thing directly in the PHP template file (the {curdate} tag, the actual code was a plugin). I want to be able to do this in the content area (somehow):

text..blah..blah

Author:  Ted [ Wed Dec 29, 2004 1:19 am ]
Post subject:  PHP?

I made a user plugin called currenturl. It's code was:

\$1:
$currenturl = $_SERVER["PHP_SELF"];
if ( $_SERVER['QUERY_STRING'] <> '') {
   $currenturl .= "?" . $_SERVER['QUERY_STRING'];
   }
$currenturl = 'http://' . $_SERVER["SERVER_NAME"] . $currenturl;
$currenturl = str_replace(":", "%3A", $currenturl);
$currenturl = str_replace("/", "%2F", $currenturl);
$currenturl = str_replace("&", "%26", $currenturl);
echo $currenturl;


and put it in my page. Worked fine for me.

Author:  SN3 [ Wed Dec 29, 2004 1:23 am ]
Post subject:  PHP?

wishy \wishy:
I made a user plugin called currenturl. It's code was:

\$1:
$currenturl = $_SERVER["PHP_SELF"];
if ( $_SERVER['QUERY_STRING'] <> '') {
   $currenturl .= "?" . $_SERVER['QUERY_STRING'];
   }
$currenturl = 'http://' . $_SERVER["SERVER_NAME"] . $currenturl;
$currenturl = str_replace(":", "%3A", $currenturl);
$currenturl = str_replace("/", "%2F", $currenturl);
$currenturl = str_replace("&", "%26", $currenturl);
echo $currenturl;


and put it in my page. Worked fine for me.


Ok it works now. And that's exactly what I had before!

What about the PHP includes? :shock:

Author:  SN3 [ Wed Dec 29, 2004 1:35 am ]
Post subject:  PHP?

They are different. The one you just got working goes in the template file, the one I need to get working (includes) goes in the content part. Is this possible? I really appreciate your help!

Author:  iNSiPiD [ Mon Jan 10, 2005 3:05 am ]
Post subject:  PHP?

I also have a bunch of complex PHP for our conference site which includes conference registration and abstract submissions.

I would LOVE to be able to easily use this code for pages inside CMS.

Wishy, in the Contentment Management > Edit Content section for each page you have a Head Tags section. Would it be a terribly difficult task to allow the pasting of PHP code into either that section, or a new one called Raw Code...or something?

Sorry if I come across as a little ignorant but I've not had the time to test all these things myself.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/