1
tl
Two Arrays in a Block?
  • 2004/3/31 14:54

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


I am trying to display two different categories (A and B) in a block - one colum for A and one for B.

I have tried both two blocks and two arrays in the block_show function. Neither of them worked. It seems that XOOPS only recognizes one block with one array.

Does anyone have other sugguestions? Thanks.

2
fatman
Re: Two Arrays in a Block?
  • 2004/3/31 18:09

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


1 block with 1 multi-dimensional array?

function myBlockFunction()
{

$block['array_a'] = array('a','b','c','d');
$block['array_b'] = array('1','2','3','4');

return 
$block;
}

// in template
<p>
<{foreach 
item=array_a from=$block.array_a }>
 <{ 
$array_a }>
<{/foreach}>
p>
<
p>
<{foreach 
item=array_b from=$block.array_b }>
 <{ 
$array_b }>
<{/foreach}>
p>


Hope that helps.

3
tl
Re: Two Arrays in a Block?
  • 2004/3/31 18:20

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


fatman, thanks for the help. very much appreciated.

I did figure out what went wrong with my trying of one block two arrays. My second sql statement was wrong and I ended up pulling incorrect information from the database. After having spent over 1 hour with no result, I "assumed" two-arrays was not working. Now I just need to figure out how to just do one query for my task.


Login

Who's Online

851 user(s) are online (295 user(s) are browsing Support Forums)


Members: 0


Guests: 851


more...

Donat-O-Meter

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

Latest GitHub Commits