| Re: HI i am trying to assign data to template but it giving me error please help |
| by culex on 2009/6/21 9:42:36 You might want to take a look at this :) https://xoops.org/modules/newbb/viewtopic.php?topic_id=68116&forum=68&post_id=309457 |
| Re: HI i am trying to assign data to template but it giving me error please help |
| by baloch on 2009/6/21 9:01:12 How do i use assign template in admin section? |
| HI i am trying to assign data to template but it giving me error please help |
| by baloch on 2009/6/21 8:50: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 |