21
mschmid
Re:module dev: use smarty template in admin part
  • 2004/10/15 22:41

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


Many thx for the quick answer
==> will try the hack



22
mschmid
module dev: use smarty template in admin part
  • 2004/10/15 21:37

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


The smarty works on the normal modules site of my programed module. But I wanna now add some admin functions. And for this I like to use also the smarty template. But it does not work. I found the following tread about the same question but not with an answer:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=21907&forum=8

I have in the normal module that works:
----------------------------------
require('../../mainfile.php');
$xoopsOption['template_main'] = 'emailform.html';
require(XOOPS_ROOT_PATH.'/header.php');
$xoopsTpl->assign('itemSourceEmail', $refSourceEmail);
require(XOOPS_ROOT_PATH.'/footer.php');

In the Admin that does NOT work:
----------------------------
require('../../../mainfile.php');
include '../../../include/cp_header.php';
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$xoopsOption['template_main'] = 'emailform.html';
xoops_cp_header();
$xoopsTpl->assign('itemSourceEmail', $refSourceEmail);
xoops_cp_footer();

=> The error is: Call to a member function on a non-object in
line 270.
The line 270 is the $xoopsTpl->assign
Did I forgot an include?

Any input or remark where I can get more information will help
many thx
Markus



23
mschmid
Re: How to pass variable to theme.html
  • 2004/8/2 23:56

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


hrac,

in the index.php you have to assign the $variable to the smarty template:

$variable = "/modules/news/index.php?x=1";
$xoopsTpl->assign('variable', $variable);

in the theme.html you can then go as you describet:
http://www.mysite.com/xoopsroot2<{$variable}>

Don't forget to update the module as the theme is only updated you do an install or update of the module.

hope it helps
Markus



24
mschmid
Re: array[][] and xoops template (smarty)
  • 2004/7/12 20:30

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


Hey MANY thx it works with your help )

Below what I did for completation if it helps some one else:

PHP:
----
for ($j = 1; $j <= $countToDisplay; $j++) {
$ssr[$j][0] = "fooBar0";
$ssr[$j][1] = "fooBar1";
.......
}

// it look that the assign does the full handover of the
// hole $ssr array whatever it is.

$xoopsTpl->assign('ssr',$ssr);

Themplate:
----------
<{section name=i loop=$itemCountToDisplay}>
TestFooBar0: <{$ssr[i].0}>

TestFooBar1: <{$ssr[i].1}>

<{/section}>



25
mschmid
array[][] and xoops template (smarty)
  • 2004/7/12 19:44

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


I wanna use a 2 dimensional array. Fill it in php and print
it out in XOOPS template (smarty).

In php:
-------
$ssr[0][0] = "foobar";
echo $ssr[0][0];
This prints: foobar

if I wanna have this foobar in the XOOPS template, it does
not work?
In the template:
----------------
TestFooBar: <{$ssr[0][0]}>


even if I add in php $xoopsTpl->assign('ssr',$ssr[0][0]);

If I have normal variables then it works.

Any input or hint will help
many thx
Markus



26
mschmid
Re: Blank Page??
  • 2004/6/1 20:49

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


If you also copied the files new to the server.....
Check the cache directory must have write access.
That's the only thing that hits my brain
Markus



27
mschmid
Re: Formulaire and Anonymous users
  • 2004/5/10 22:57

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


Had the same problem. Now it works
I changed in the database in table xoops_modules the field hasmain to 1.
This gives you the form entry in Module Access Right
=> enable that for the Anonymous users.
Now it should work

You can also change the line
$modversion['hasMain'] = 0;
to
$modversion['hasMain'] = 1;
in the /modules/formulaire/xoops_version.php
and reinstall it

hope it helps
Markus



28
mschmid
Re: wee: blankpage problem - plz help
  • 2004/2/21 17:19

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


I had the same problem. I had to change the permission on certion dirs. I don't remember exact which you have to change (cache...). But check the dir that are given during the install proces with chmod 666 and use chmod 777

hope it helps
Markus




TopTop
« 1 2 (3)



Login

Who's Online

139 user(s) are online (85 user(s) are browsing Support Forums)


Members: 0


Guests: 139


more...

Donat-O-Meter

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

Latest GitHub Commits