1
Joey79
Using smarty variables in a block
  • 2005/7/29 13:08

  • Joey79

  • Just popping in

  • Posts: 39

  • Since: 2005/7/28


I've posted in a couple of posts on beginners forum but nobody seems to be able to help me...

https://xoops.org/modules/newbb/viewtopic.php?topic_id=39209&forum=27
https://xoops.org/modules/newbb/viewtopic.php?topic_id=39259&forum=27

What I have to do to show the total number of members of the site?
Not only the number of members... also all the other smarty variables.
Thanks

2
Herko
Re: Using smarty variables in a block
  • 2005/7/29 13:59

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


you can't use smarty variables in custom blocks. There are site info blocks that show this kind of information.

Herko

3
Joey79
Re: Using smarty variables in a block
  • 2005/7/29 14:13

  • Joey79

  • Just popping in

  • Posts: 39

  • Since: 2005/7/28


Quote:

Herko Coomans wrote:
you can't use smarty variables in custom blocks. There are site info blocks that show this kind of information.

Herko


Even if I write a php page to insert in a custom block that includes the files where the variables are defined?

4
Joey79
Re: Using smarty variables in a block
  • 2005/7/29 14:22

  • Joey79

  • Just popping in

  • Posts: 39

  • Since: 2005/7/28


And... if I want to add this information in the block Who's Online? Is this possible?

5
Herko
Re: Using smarty variables in a block
  • 2005/7/29 14:33

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


you can edit the code that generates the smarty variables for the who's online block, sure. It's located in modules/system/blocks/ (this also answers your other question, to some extent. the point of 'custom blocks' is that they are not the PHP files, but are created from the system admin -> blocks page. But of you write your own block generation code or modify an existing block, then sure!)

Herko

6
Joey79
Re: Using smarty variables in a block
  • 2005/7/29 14:58

  • Joey79

  • Just popping in

  • Posts: 39

  • Since: 2005/7/28


Thanks for the help I begin to understand something
I tried this:
1) I've modified the file system_blocks.php and I have add the test line "$block['total_members'] = "TEST";" in the "b_system_online_show()" function.

2) I've add at the beginning of the file system_block_online "<{$block.total_members}>
".

And both works (also modifying only system_block_online)

But the smarty variable <{$lang_totalusers}> doesn't work, where is it defined what file I have to import to make it visible?

7
Herko
Re: Using smarty variables in a block
  • 2005/7/29 15:11

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


modules/system/language/langname/blocks.php I think.

Herko

8
Joey79
Re: Using smarty variables in a block
  • 2005/7/29 15:32

  • Joey79

  • Just popping in

  • Posts: 39

  • Since: 2005/7/28


no... I begin to think that <{$lang_totalusers}> doesn't exists...

9
Dave_L
Re: Using smarty variables in a block
  • 2005/7/29 15:40

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


<{$lang_totalusers}> is defined in modules/xoopsmembers/index.php.

Login

Who's Online

466 user(s) are online (368 user(s) are browsing Support Forums)


Members: 0


Guests: 466


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