1
phillipd
In xoopsmembers module the $user array in the template...
  • 2004/10/28 3:54

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I'm trying to get a better understanding of templates. Looking at the template xoopsmembers_searchresults.html in the xoopsmembers module, I see the "$users" array being used in a loop:

<{section name=i loop=$users}>

I can't see how $users[] are passed to the template because there are no references to a xoopsTpl->assign('user') in the index.php code. I understand the other smarty template variables in the file but not the "$users" array. Could someone please give me an explanation of this mechanism? Please be verbose, I'm new at this.

[Edit]

Now I'm totally confused. I removed the xoopsmembers_searchresults.html, uninstalled the module, reinstalled the module and everything still works. How can this be? The messages during the install even say the template was compiled and reinserted properly. The template is gone! I guess I have a very basic misunderstanding about how templates work...

Thanks a bunch

Doug P

2
Dave_L
Re: In xoopsmembers module the $user array in the template...
  • 2004/10/28 7:29

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


1) The template variable 'users' is assigned in modules/xoopsmembers/index.php:

$xoopsTpl->append('users'$userdata);


2) Are you sure you removed the file xoopsmembers_searchresults.html?

3
phillipd
Re:In xoopsmembers module the $user array in the template...
  • 2004/10/28 13:15

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


Oh! Thanks for pointing out the "users" reference I competely missed it in the code. Yes, I completely removed the xoopsmembers_searchresults.html file. Will a form still appear without the template? And why does the install program still say the template was compiled and installed?

What db table does the template go in to? I have smarty debugging on and the console shows:

included templates & config files (load time in seconds):
db:system_block_search.html
db:system_block_mainmenu.html
db:system_block_user.html
db:xoopsmembers_searchform.html

But xoopsmembers_searchform.html wasn't there when I reinstalled the module!

Regards

Doug

4
phillipd
Re:In xoopsmembers module the $user array in the template...
  • 2004/10/28 13:29

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


AHHHHH! I figured it out. The template was cached by my browser! If I deinstall the module, dump my cache, restart my browser, reinstall the module. The installer still shows the template being compiled and installed but the modules form doesn't show up. Damn mozilla! Template development is going to be a royal pain with Mozilla if this is the case...

I would still like to kow what table th template goes into though.

Thanks

Doug P

5
Dave_L
Re:In xoopsmembers module the $user array in the template...
  • 2004/10/28 17:23

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Hmmm ... I know a browser can cache the final HTML page, and of course XOOPS stores both the compiled templates and the cached pages, but I don't understand how a browser can cache the source template.

I think the templates are stored in the tables xoops_tplfile, xoops_tplset and xoops_tplsource. I had to manually fix a stray template once, but I don't remember the details now.

6
JasonMR
Re:In xoopsmembers module the $user array in the template...
  • 2004/10/29 3:31

  • JasonMR

  • Just can't stay away

  • Posts: 655

  • Since: 2004/6/21


The template-file-content is stored in the table XOOPS_tplsource. To find out, where to find the template you are looking for, you will need to check the XOOPS_tplfile table.

The XOOPS_tplset table, only lists the template sets you have installed via the Template Manager.

Sometimes (I haven't found out why yet - NOTE: could be Module Code related!), XOOPS doesn't seem to update properly, and one is left with having to completely uninstall (which works with out any hick ups).


And please don't spread any FUD , there are no issues developing templates and themes when working with MOZILLA!!!!.

I can make this bold statement, as I use nothing BUT Mozilla (besides maybe the occasional display test with Opera and IE), and this DAILY.

Login

Who's Online

258 user(s) are online (93 user(s) are browsing Support Forums)


Members: 0


Guests: 258


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