• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: PHP?
PostPosted: Wed Dec 29, 2004 12:47 am 
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:
<?
$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:
Code:
 <?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)


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: PHP?
PostPosted: Wed Dec 29, 2004 12:59 am 
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


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: PHP?
PostPosted: Wed Dec 29, 2004 1:00 am 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jun 11, 2004 6:58 pm
Posts: 3332
Location: Fairless Hills, Pa USA
Make a user defined plguin as outlined in http://wiki.cmsmadesimple.org/pmwiki.ph ... sicPlug-In

_________________
http://about.me/tedkulp


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: PHP?  Topic is solved
PostPosted: Wed Dec 29, 2004 1:02 am 
Patricia wrote:
remove opening and closing ?>

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


I did that, it still won't work.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: PHP?
PostPosted: Wed Dec 29, 2004 1:04 am 
wishy wrote:
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:


Last edited by SN3 on Wed Dec 29, 2004 1:19 am, edited 1 time in total.

Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: PHP?
PostPosted: Wed Dec 29, 2004 1:18 am 
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


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: PHP?
PostPosted: Wed Dec 29, 2004 1:19 am 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jun 11, 2004 6:58 pm
Posts: 3332
Location: Fairless Hills, Pa USA
I made a user plugin called currenturl. It's code was:

Code:
$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.

_________________
http://about.me/tedkulp


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: PHP?
PostPosted: Wed Dec 29, 2004 1:23 am 
wishy wrote:
I made a user plugin called currenturl. It's code was:

Code:
$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:


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: PHP?
PostPosted: Wed Dec 29, 2004 1:35 am 
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!


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: PHP?
PostPosted: Mon Jan 10, 2005 3:05 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Fri Jan 07, 2005 1:52 am
Posts: 449
Location: Sydney, OZ
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.

_________________
If at first you don't succeed, ask someone who knows how.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting