Loading...
 
Features / Usability

Features / Usability


Include PHP functionality

posts: 2 Portugal

Hi, I just started with TikiWiki, and all went fine so far, this is realy great. I just have problems to find my way through all these features ...Now, I understand I can do all kinds of dynamic stuff.

Could you give me an advice what I should do to include some home-grown PHP stuff or function calls?

I am not talking about integrating a full PHP application, I'd just like to call a few php functions to get some info and display it somewhere - within an article, or within any place where you can have dynamic contents.
I also know that in general, I should be able to create a new template, but this sounds not right if I just want to get a php variable.
Could please anybody tell me what's the best approach?
Thank you,
Yalta

posts: 9309 Germany

If it is just some SQL data, try the SQL PlugIn

For other things it depends on what you want to add...


posts: 2 Portugal

Thanks very much for that plugin advice.

Meanwhile, what I started to do is learn and use the template engine used in TikiWiki (smarty), and I even managed to write a smarty modifier and refer to it in a template. Huhu, I am still very clumsy, but it works.


posts: 24

Yalta, I struggled with the same problem. I have no intention of learning to code using the Smarty engine but I found out it's really easy to do some home grown PHP. Just add whatever you want between {php} and {/php} tags (no capitals!).

Good luck!

posts: 4656 Japan

You put those tags in a wiki page (php in curly braces)? When I tried this, the brackets and php code just displayed on the page. Can you give more details, please?

-- Gary


posts: 24

chibaguy, I only use this in templates and it works perfectly. If you want to have it in specific wiki pages or something, you know, through editing the wiki page, that doesn't work.
I suppose if you allow HTML inside your wiki pages and take out some of tiki's restrictions, it could works with the real PHP tags. I haven't tried, I don't see the need for that either and it's very very bad for security.

Perhaps if you can ellaborate on what you are trying to do in the first place, we could help you find another road to get there.