(SOLVED) [PHP] in articles?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

(SOLVED) [PHP] in articles?

Post by ExVee »

Later solution: Turns out [PHP] in article content parts is originally disabled in conf.inc.php. So setting $phpwcms['allow_cntPHP_rt'] = 1; has fixed my problem. Very simple. I don't know whether this is actually documented, but if so I couldn't find it.

Original problem follows.

--

Backstory: I use Gallery for photos for my website. Currently I'm looking at using Gallery's External Image Block function to embed a selection of thumbnail images relevant to particular articles on my website. To do this, I need to execute a PHP function.

I've been testing this using a template I've reserved specifically for testing stuff, and in the template it works just fine using the [PHP] replacement tag. But when I try to test it in an article, the [PHP] tag gets stripped off and I'm left with the code rendering as plain text in the body of the article. I've tried to search on this, but when both "php" and "article" are considered too common words and can't be used as search keywords I'm clearly not going to get very far. If this is going to work at all, it has to be within the article body and not a template since I need to have different arguments in each call relevant to a given article. So I'm needing to know first if for some reason it's not possible to execute a PHP function in an article body (and if that's the case, why?!) and if it is possible, what's going wrong for me?

I'm using 1.3.9.
Last edited by ExVee on Thu 7. May 2009, 20:06, edited 2 times in total.
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: [PHP] in articles?

Post by pepe »

Have you tried, to put a ContentPart "HTML" into your article... and then put your [PHP].....[/PHP] in there???
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

Re: [PHP] in articles?

Post by ExVee »

Thank you for your reply.

But, why would that even be necessary? I have never come upon another replacement tag that would not work correctly in a WYSIWYG environment. And I need for the PHP to work inline with the main body of the article which is a WYSIWYG content part.
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: [PHP] in articles?

Post by pepe »

have you tried to switched the WYSIWYG-Editor to source ... put the RT in ... and save then?
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

Re: [PHP] in articles?

Post by ExVee »

Yeah. That time it either still stripped the tags off, or rendered them uselessly as plain text in the output. At the moment I cannot recall for sure. Maybe it was that the RT rendered as plain text that way, and trying to use correct HTML markup for the PHP ended up with the tags getting stripped away.
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

Re: (SOLVED) [PHP] in articles?

Post by ExVee »

I found out how to make this work. Once more I bemoan the lack of good documentation on some of the inner workings of phpWCMS.

But all's well that ends well, I suppose!

pepe, thanks very much for trying to help. :)
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: (SOLVED) [PHP] in articles?

Post by update »

And how did you happen to make this work? I mean, for following readers such information could be of enormous value ;)
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Re: (SOLVED) [PHP] in articles?

Post by juergen »

Claus is speaking right out of my soul ;) How did he do it ? I mean, once in a while if all self helpers will be quiet the lack of docu becomes a worldwide hole :| :? :lol:
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: (SOLVED) [PHP] in articles?

Post by update »

found it - exvee did a little editing of the initial posting: http://forum.phpwcms.org/viewtopic.php?p=116401#p116401
but you'll need an detectives eye to discover that....
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Post Reply