1
angaran
Problem with $xoopsTpl in xoops 2.2
  • 2005/8/29 15:09

  • angaran

  • Not too shy to talk

  • Posts: 103

  • Since: 2003/8/17


Hi,

I'm testing XOOPS 2.2.3 on localhost but it seems it has some problems with a module that I use on my site.

It is a customized version of th original Sections shipped with the 2.0 core. I have modified it a lot but with XOOPS 2.0.13 i works perfectly on my site.

Here some details of the problem.

There is a page of the module, actually inde.php, that use differents templates using a $op variable.

For example if $op="print" it shows up the print page, if it is "listsections" it lists the sections, ecc.. Each page is generated by a function.

This is the error:

Fatal error: Call to a member function on a non-object in c:\programmi\easyphp1-8\www\xoops-2.2.2\modules\sections\index.php on line 44

The non-object is $xoopsTpl. If I add it to global variables of the functions the error disappear but the template is also not loading ( as I see in the Smarty debug ).

Do you know if XOOPS 2.2 changes something with xoopsTpl?

Also, do you know if there's a document where I can find the differences from XOOPS 2.0 to 2.2 from a module develloping point of view?

Fiuu, I used al my English skills to write down this post I hope someone is gonna reply me

thank you!

2
Mithrandir
Re: Problem with $xoopsTpl in xoops 2.2

Are you including XOOPS_ROOT_PATH."/header.php" and XOOPS_ROOT_PATH."/footer.php" in those functions, too?

$xoopsTpl declaration has moved from /header.php to /include/common.php so it would not be in the same scope as before, if you include /header.php in the function.

I've been trying to find the time to list differences between 2.0 and 2.2 from a module developer's pov, but haven't felt I had the time for it. Will make a renewed effort with this.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

3
angaran
Re: Problem with $xoopsTpl in xoops 2.2
  • 2005/8/29 17:42

  • angaran

  • Not too shy to talk

  • Posts: 103

  • Since: 2003/8/17


Yes, they include "header.php" and "footer.php".

I've tried moving those inclusions to the top of each function but nothing appened. Also i tried including "common.php" but the problemi is still there ( but I don't need to declare the global variable for XoopsTpl no more ).

Quote:

Mithrandir wrote:

$xoopsTpl declaration has moved from /header.php to /include/common.php so it would not be in the same scope as before, if you include /header.php in the function.


I don't follow you. Do you mean that including header isn't enough?

4
angaran
Re: Problem with $xoopsTpl in xoops 2.2
  • 2005/8/31 8:12

  • angaran

  • Not too shy to talk

  • Posts: 103

  • Since: 2003/8/17


Any news?

5
Mithrandir
Re: Problem with $xoopsTpl in xoops 2.2

global $xoopsTpl;

at the top of the function, prior to including header.php
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

6
angaran
Re: Problem with $xoopsTpl in xoops 2.2
  • 2005/8/31 12:24

  • angaran

  • Not too shy to talk

  • Posts: 103

  • Since: 2003/8/17


Tried this but it's not working.

This is the code:

global $xoopsTpl;
include 
XOOPS_ROOT_PATH.'/header.php';
include_once 
XOOPS_ROOT_PATH "/modules/sections/class/class.article.php";
global 
$xoopsConfig$xoopsUser$xoopsDB$xoopsTheme$xoopsLogger$xoopsModule;
$xoopsOption['template_main'] = 'sections_index.html';


Am I missing something?

7
angaran
Re: Problem with $xoopsTpl in xoops 2.2
  • 2005/8/31 12:28

  • angaran

  • Not too shy to talk

  • Posts: 103

  • Since: 2003/8/17


Yes, I did it!!

It was needed to include the global variable $xoopsOptions too.

Thank you for your help.

8
Mithrandir
Re: Problem with $xoopsTpl in xoops 2.2

Glad, you got it working.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

Login

Who's Online

456 user(s) are online (67 user(s) are browsing Support Forums)


Members: 0


Guests: 456


more...

Donat-O-Meter

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

Latest GitHub Commits