1
technigrafa
PHP insert in xoops theme file

Is there any way to do a php include statement on a XOOPS theme file?

For example, I am trying to put this into my XOOPS theme file:

<?php include ("/getSermon.php?target_audience=DAILY"); ?>

I tried this method, but that didn't work either:
<{?php include ("/getSermon.php?target_audience=DAILY"); ?}>

Being the theme file ends in .html, I am guessing a php include won't work. I tried a regular include statement, but that didn't work either:

<!--#include file="/getSermon.php?target_audience=DAILY" -->

I am currently getting around this using an iframe, but I would rather not, if possible.

Anyone know another way to do this?

Thanks!

2
JMorris
Re: PHP insert in xoops theme file
  • 2005/8/29 1:23

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


I believe the smarty statement <{php}> will work. This is how I hard coded the php code that calls the db query information from the database.

Example:
<{php}>
include (
"/getSermon.php?target_audience=DAILY");
<{/
php}>


Hope this helps.

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

3
Chado
Re: PHP insert in xoops theme file
  • 2005/8/29 1:32

  • Chado

  • Not too shy to talk

  • Posts: 113

  • Since: 2003/6/6 7


Also check out the discussion in this thread for several ideas about php in themes: "exclude" some php code for my theme.html

4
LazyBadger
Re: PHP insert in xoops theme file

{include_php} is smarter (see here), but using smarty-plugins is more correct way, see example here
Quis custodiet ipsos custodes?

Webmaster of
XOOPS2.RU
XOOPS Modules Proving Ground
XOOPS Themes Exhibition

5
JMorris
Re: PHP insert in xoops theme file
  • 2005/8/29 1:47

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Excellent tips Chado and LB! I'll be sure to look them over carefully.

Best Regards,

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

6
technigrafa
Re: PHP insert in xoops theme file

You guys are the best.

Thanks, that worked like a charm!

Login

Who's Online

115 user(s) are online (77 user(s) are browsing Support Forums)


Members: 0


Guests: 115


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits