1
moisty70
How to use a template for module administration
  • 2007/10/9 8:21

  • moisty70

  • Just popping in

  • Posts: 21

  • Since: 2007/8/24


Hello,
I have a module for user referrals.
Inside this module I use a template where every user that logs can see their referrals (and some more data) in a list, I show this template with this code:

$xoopsOption['template_main'] = 'referrals_list.html';
include XOOPS_ROOT_PATH.'/header.php';
$xoopsTpl->assign ('referrals', $referrals);
$user_info = array ('uid' => $xoopsUser->getVar('uid'));
$xoopsTpl->assign ('lang_referrals_lista', _PROMO_REF_LIST);
...
include XOOPS_ROOT_PATH.'/footer.php';


How can I use this template on module administration, there xoopsTpl is not instantiated (not an object error)

2
moisty70
Re: How to use a template for module administration
  • 2007/10/9 9:28

  • moisty70

  • Just popping in

  • Posts: 21

  • Since: 2007/8/24


Well I've found a way to do it. Tried something similar yesterday with no success.


require_once XOOPS_ROOT_PATH . '/class/template.php';
if (!isset($xoopsTpl)) {
$xoopsTpl = new XoopsTpl();
}

$xoopsTpl->assign ('referrals', $referrals);
$user_info = array ('uid' => $xoopsUser->getVar('uid'));
$xoopsTpl->assign ('lang_referrals_lista', _PROMO_REF_LIST);

echo $xoopsTpl->fetch('db:promociones_admin_list.html');

Login

Who's Online

78 user(s) are online (43 user(s) are browsing Support Forums)


Members: 0


Guests: 78


more...

Donat-O-Meter

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

Latest GitHub Commits