1
baloch
HI i am trying to assign data to template but it giving me error please help
  • 2009/6/21 8:50

  • baloch

  • Just popping in

  • Posts: 34

  • Since: 2006/3/22


require('../../../mainfile.php');
global $xoopsOption,$xoopsUser,$xoopsTpl;


include_once "adminheader.php";
$xoopsOption['template_main'] = 'audio_adminindex.html';

//Display the admin menu
xoops_module_admin_menu(0,_AM_AU_ADMENU0);

/**
* To use this as a template you need to write code to display
* whatever it is you want displaying between here...
*/

$audiodata = audioLoader();
$xoopsTpl->assign('audios', $audiodata);
function audioLoader(){
global $xoopsDB;
$audios =array();
$q=1;
$query = $xoopsDB->queryF(' SELECT * FROM ' . $xoopsDB->prefix('audios')); while($myrow = $xoopsDB->fetchArray($query) )
{
$audios[$q]['id'] = $myrow['id'];
$audios[$q]['title'] = $myrow['title'];
$audios[$q]['play'] = $myrow['play'];
$audios[$q]['source'] = $myrow['source'];
$audios[$q]['type'] = $myrow['type'];
$audios[$q]['size'] = $myrow['size'];
$audios[$q]['download'] = $myrow['download'];
$q++;
}
return $audios;



}

i am following kaotik tutorial

it is givng me this error
Fatal error: Call to a member function assign() on a non-object in

please help

2
baloch
Re: HI i am trying to assign data to template but it giving me error please help
  • 2009/6/21 9:01

  • baloch

  • Just popping in

  • Posts: 34

  • Since: 2006/3/22


How do i use assign template in admin section?

3
culex
Re: HI i am trying to assign data to template but it giving me error please help
  • 2009/6/21 9:42

  • culex

  • Module Developer

  • Posts: 711

  • Since: 2004/9/23


You might want to take a look at this :)
https://xoops.org/modules/newbb/viewtopic.php?topic_id=68116&forum=68&post_id=309457
Programming is like sex:
One mistake and you have to support it for the rest of your life.

Login

Who's Online

196 user(s) are online (127 user(s) are browsing Support Forums)


Members: 0


Guests: 196


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