1
jinzora
Porting Postnuke Module to Xoops
  • 2003/12/19 15:36

  • jinzora

  • Just popping in

  • Posts: 3

  • Since: 2003/12/19


Hello,

First nice CMS you got here Very nice, simple to use, and sweet!!!

Here's my issue. I'm the project admin for Jinzora, a web based media (mainly MP3's) jukebox, similar to Zina and Netjuke (but I think much better I've had a request to port it to Xoops, and after looking at XOOPS (today was the first time I'd ever heard about it) I decided that would definetly be a good idea, so here I am...

I've read through the module dev quick start, and completed that just fine, but I'm having problem porting my module. Here's what I need to do:

* I need to have a function OPEN the XOOPS header
* I need my code to run
* I need to have a function CLOSE the XOOPS footer

So here's a small sample I tried...

// Let's open the header
openXoops();
// Let's output some stuff
echo "HERE";
// Let's close the footer
closeXoops();

// This function opens the header for the XOOPS CMS system
function openXoops(){
require('../../mainfile.php');
// Include the page header
require(XOOPS_ROOT_PATH.'/header.php');
}

// This fucntion closes the footer for the XOOPS CMS system
function closeXoops(){
// Include the page footer
require(XOOPS_ROOT_PATH.'/footer.php');

}

I installed it, which went fine and created my menu entry, then I went to the page and all I get is:

Fatal error: Call to a member function on a non-object in C:\Program Files\Apache Group\Apache2\htdocs\xoops\kernel\configitem.php on line 286

My app will not use any database table so I don't need to do anything there. One thing to note is that if I do NOT use functions, meaning all the above code just happens straight it works just fine. If I call into functions it dies...

Please help!?!?!? I'd really like to port my module (and write a Postnuke - to - XOOPS converstion guide). I really think the XOOPS community would dig my module

Thanks and sorry for the long post...

Ross
ross@jinzora.org
http://www.jinzora.org

2
Draven
Re: Porting Postnuke Module to Xoops
  • 2003/12/19 19:05

  • Draven

  • Module Developer

  • Posts: 337

  • Since: 2003/5/28


You don't need a function, just create a header.php file in the module directory and includ the following in it.

include '../../mainfile.php';
include 
XOOPS_ROOT_PATH.'/header.php';


And also include any other classes you may need.

Then for the footer just do:

include_once XOOPS_ROOT_PATH.'/footer.php';

In your pages, be sure to use the $tpl class to set your template up.

It helps to review a finished module to see how things work. We are working on documentation that will help everyone out. But it's going to take time.

3
jinzora
Re: Porting Postnuke Module to Xoops
  • 2003/12/19 23:50

  • jinzora

  • Just popping in

  • Posts: 3

  • Since: 2003/12/19


Nope, that doesn't do it. Here's what I'm doing (very simply).

Since my app supports Standalone/PHPNuke/Postnuke (and hopefully other CMS like Xoops) I do this:

* User loads index.php
* index.php includes my settings file
* IF the user is using a CMS I run an appropriate function to open that CMS's header
* I then run all my code
* I then run the appropriate function to close the CMS page

I have to do it this way becuase there are multiple ways that I build the page, and I have to run other functions first, so that I can write headers, etc (for my playlist generation). I call the open function from multiple places in my code, which is why I put the include('header.php') inside that function. That's what doesn't work? My example from my first post is about as simple as it can be, but it doesn't work either?

Granted I am new to Xoops, but I did go through your little module development guide and got that to work. The issue is IF the code example you provided is inside another PHP function it won't work for some reason. I totally understand it's hard to do documentation, but can you provide any other pointers on this? This is a nice CMS and I've love to support it for your users...

Thanks again for your help, I hope you can point me in the right direction...

Thanks,

Ross
ross@jinzora.org
http://www.jinzora.org

4
skalpa
Re: Porting Postnuke Module to Xoops
  • 2003/12/20 2:37

  • skalpa

  • Quite a regular

  • Posts: 300

  • Since: 2003/4/16


Your problem (I believe) is coming from the fact that some files (like header.php) assume they are included from the global scope (so they just create variables without using $GLOBALS['varname']=stuff thinking those will become global vars).
Right now there's no real solution to solve this (that's one we should look at, but even if it's not a difficult one there are a lot of things to change).

So the only thing you can try is "without the function":
If your if block is not inside an "openCMSHeader()" function, you can try doing:
if ( $is_xoops ) {
    include 
XOOPS_ROOT_PATH 'header.php';
} elseif ( 
$other_cms ) {
    
otherCMSOpen();
}


otherwise I guess there's no solution right now (to be exact: I'm not able to find one )

Skalpa.>
PS: Sorry for the not so long but not really useful answer

5
jinzora
Re: Porting Postnuke Module to Xoops
  • 2003/12/20 22:06

  • jinzora

  • Just popping in

  • Posts: 3

  • Since: 2003/12/19


Skalpa,

Thanks for replying back. Yeah, I figured it was something like that. I've been in contact with another of your module developers about this, and hopefully we can work something out.

Not that I'm a huge developer or anything, but I suggest you do change the way you're handling the variables there. I'm totally willing to write a "Postnuke to Xoops" module conversion guide. I think you could get a lot of modules ported that way...

Thanks anyway, hopefully we can work it out...

Thanks,

Ross

6
dlh
Re: Porting Postnuke Module to Xoops
  • 2004/4/2 5:04

  • dlh

  • Posts: 182

  • Since: 2002/2/20


Any progress on this? I would LOVE to use Jinzora for my site.

Dan

7
king76
Re: Porting Postnuke Module to Xoops
  • 2006/3/19 19:20

  • king76

  • Just popping in

  • Posts: 93

  • Since: 2003/1/15


I work for integration of Jinzora on XOOPS 2.013 since today.. but I have the same problem with :

Fatal error: Call to a member function on a non-object in /home/king/public_html/eric/kernel/configitem.php on line 286

;-(

A+
I'm a poor french man, i don't speak english
----------------

8
king76
Re: Porting Postnuke Module to Xoops
  • 2006/8/12 23:15

  • king76

  • Just popping in

  • Posts: 93

  • Since: 2003/1/15


Xoops is now integrate with Jinzora...

Look last version here : http://www.jinzora.com/

A+
I'm a poor french man, i don't speak english
----------------

9
davidl2
Re: Porting Postnuke Module to Xoops
  • 2006/8/13 0:04

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


That's great news!

10
davidl2
Re: Porting Postnuke Module to Xoops
  • 2006/8/13 1:36

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


.. except it seems to get very mixed up in the screen on my test install on 2.0.14 ..

Login

Who's Online

334 user(s) are online (259 user(s) are browsing Support Forums)


Members: 0


Guests: 334


more...

Donat-O-Meter

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

Latest GitHub Commits