1
bstr72
Adding php content
  • 2011/1/8 20:20

  • bstr72

  • Just popping in

  • Posts: 3

  • Since: 2010/12/4


This is a really basic question and I feel stupid for asking but here goes.
I've been using the XT_Conteudo module to add html formatted pages of my own. Now I want to add content pages using php so my content is dynamic. I don't think xt-conteudo has options for parsing my content with php.
I can successfully make blocks with php content but this is not what I want. I want the dynamic content to be a full page. I want to reference the php content like I do the xt-conteudo pages:

http://<my web site>/modules/xt_conteudo/index.php?id=3

This way I can reference the pages from my main menu.

Can I make php content pages (not blocks) without adding another new module? If not, what module do I need?

Thanks!

2
hipoonios
Re: Adding php content
  • 2011/1/8 20:53

  • hipoonios

  • Friend of XOOPS

  • Posts: 298

  • Since: 2005/9/24


I don't know about xt-conteudo. But with the TinyD module it works to add pages with php code without problems. Just make sure the page have the .php extension.
I love Xoops!

3
oswaldo
Re: Adding php content
  • 2011/1/8 22:06

  • oswaldo

  • Quite a regular

  • Posts: 215

  • Since: 2008/8/22


You can use this code
<?php 

include_once 'mainfile.php'
include_once 
XOOPS_ROOT_PATH."/header.php"

if (
file_exists('language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php')) { 
  include_once 
'language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php'
}else{ 
  include_once 
'language/english/modinfo.php'



?> 

//Here your content 
// 
// 

<?php 
include(XOOPS_ROOT_PATH."/footer.php"); 
?>

4
bstr72
Re: Adding php content
  • 2011/1/9 6:30

  • bstr72

  • Just popping in

  • Posts: 3

  • Since: 2010/12/4


Thanks all. I was able to get things working the way I wanted following oswaldo's advice. Simply put, you can create any php page you want and by including mainfile and header before your content and footer after your content, you get a nicely formatted page with your theme and all blocks. Sweet!

Login

Who's Online

161 user(s) are online (110 user(s) are browsing Support Forums)


Members: 0


Guests: 161


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