1
adwin
Using Smarty in Admin
  • 2005/2/9 11:56

  • adwin

  • Just popping in

  • Posts: 68

  • Since: 2004/6/27


I am going to develop a module for XOOPS and I am going to use smarty on admin pages.

Can I use smarty in this page ?

I tried with the following code, but the smarty seems didnt loaded. Can somebody tell me how to do this ?




include("admin_header.php");
$table_name = $xoopsDB->prefix("prayer_request");


/// draw the header of administrator
// header and footer defined previosly in /include/cp_functions.php
xoops_cp_header();

/*** administrator content goes here ***/

$smarty = new Smarty();
echo dirname(__FILE__).'/templates/admin_prayer_request.html';
$smarty->display(dirname(__FILE__).'/templates/admin_prayer_request.html');


echo '
';
print_r($smarty) ;
/*** administrator content end here ***/

// draw the footer of administrator
xoops_cp_footer();
?>


admin_header.php

include "../../../mainfile.php";
include_once XOOPS_ROOT_PATH."/class/xoopsmodule.php";
include_once XOOPS_ROOT_PATH."/class/smarty/Smarty.class.php";
include XOOPS_ROOT_PATH."/include/cp_functions.php";
if ( $xoopsUser ) {
$xoopsModule = XoopsModule::getByDirname("myModule");
if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
redirect_header(XOOPS_URL."/",3,_NOPERM);
exit();
}
} else {
redirect_header(XOOPS_URL."/",3,_NOPERM);
exit();
}
if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) {
include "../language/".$xoopsConfig['language']."/main.php";
} else {
include "../language/english/main.php";
}
?>

2
chapi
Re: Using Smarty in Admin
  • 2005/2/9 12:06

  • chapi

  • Theme Designer

  • Posts: 611

  • Since: 2002/1/22


Didn't you find the search button?

Look at this thread to see how smarty can work in modules administration.

3
adwin
Re: Using Smarty in Admin
  • 2005/2/9 12:08

  • adwin

  • Just popping in

  • Posts: 68

  • Since: 2004/6/27


opps ... thx chap ...

Login

Who's Online

450 user(s) are online (296 user(s) are browsing Support Forums)


Members: 0


Guests: 450


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