Insert php code into FCK Editor

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
bojans

Insert php code into FCK Editor

Post by bojans »

Hi!

I want to insert a php code ( in one of page, but when I try in FCK editor type this code (in source mode), editor change my code in something like < -- ?php include.....

So, how can I insert a php code into my pages?

Thanks!
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Insert php code into FCK Editor

Post by tsw »

right way would be creating user defined tag with your php code (remember udt adds automatically) and call it with {yourudtname} another way is to allow smarty php tags in config.php and use {php} {/php}

hope this helps
bojans

Re: Insert php code into FCK Editor

Post by bojans »

thank you!  it works!!!  :D
Fabi

Re: Insert php code into FCK Editor

Post by Fabi »

Hello..

first of all, CMSMS is a really good CMS system, but to publish my site I need to include an external news script into CMSMS.
I activated the smarty tags in the config.php but it don't works!

The code I want to include is:

Code: Select all

<?PHP
 $number = "2";
 include("http://start.fgnet.de/fnet/cutenews/show_news.php");
?>
So I inserted the following into my "Home"-site with the FCK Editor

Code: Select all

{php}$number="2";include("http://start.fgnet.de/fnet/cutenews/show_news.php");{/php}
Well, with this code inserted, the page needs very long to load and after it loaded completely, I don't see the included file.

Thanks in advance
Fabi
bojans

Re: Insert php code into FCK Editor

Post by bojans »

Try this:

Go to admin control panel -> extensions -> user defined tags -> add user defined tags. Then name your new tag (for example news1), and insert this code (withouth :

$number = "2";
include("http://start.fgnet.de/fnet/cutenews/show_news.php");

Then on your site, where you want to have this news, type in FCK editor {news1}, and your done!

Hope it helps!

Bojan
Fabi

Re: Insert php code into FCK Editor

Post by Fabi »

Thanks for your tipp,

I tried this out, too, but unfortunaly, it don't works, too :-(

Any other tipps and opinions?
bojans

Re: Insert php code into FCK Editor

Post by bojans »

I try it on my site and it works  :-\

See: http://www.studiosplet.com/index.php?stran=test-2

Bojan
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Insert php code into FCK Editor

Post by Dr.CSS »

Did you do it in Source mode so it doesn't get formated?...
Fabi

Re: Insert php code into FCK Editor

Post by Fabi »

I try it on my site and it works
Thats crazy. I tried the same way with the correct path, too, but it didn't worked, too..
Did you do it in Source mode so it doesn't get formated?...
Yes, I did it in the source mode.

Btw. the site is http://start.fgnet.de/cms if you want to take a look.
Locked

Return to “CMSMS Core”