Page 1 of 1
PHP?
Posted: Wed Dec 29, 2004 12:47 am
by SN3
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:
Code: Select all
<?
$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:
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)!
PHP?
Posted: Wed Dec 29, 2004 12:59 am
by SN3
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
PHP?
Posted: Wed Dec 29, 2004 1:00 am
by Ted
PHP?
Posted: Wed Dec 29, 2004 1:02 am
by SN3
Patricia wrote:remove opening
they are replaced by {php} and {/php}
I did that, it still won't work.
PHP?
Posted: Wed Dec 29, 2004 1:04 am
by SN3
I tried that before but it wouldn't work.
It did work with the date thing though, and it worked. Now it won't.
PHP?
Posted: Wed Dec 29, 2004 1:18 am
by SN3
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
PHP?
Posted: Wed Dec 29, 2004 1:19 am
by Ted
I made a user plugin called currenturl. It's code was:
Code: Select all
$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.
PHP?
Posted: Wed Dec 29, 2004 1:23 am
by SN3
wishy wrote:I made a user plugin called currenturl. It's code was:
Code: Select all
$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?
PHP?
Posted: Wed Dec 29, 2004 1:35 am
by SN3
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!
PHP?
Posted: Mon Jan 10, 2005 3:05 am
by iNSiPiD
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.