1
Burning
Count blocks displayed in a column ?
  • 2010/1/23 5:00

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hi' all designers

Is there a possibility to count how many blocks are displaying in a column ? I think about a smarty variable...

My aim is to diplay blocks horizontally and to be able to create a new row each X blocks : I know how to that, eg 4 blocks per row, but I don't know how to get number of blocks activated... if it is possible

Thanks in advance, I hope you well understand my request.

2
ghia
Re: Count blocks displayed in a column ?
  • 2010/1/23 13:51

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Other possibility:
le="color: #000000"><?php <{foreach from=$xoBlocks[$zone] item=block name=bloc}> <{if $smarty.foreach.bloc.index % 4 == 0}> </tr><tr> <{/if}> ... <{foreach}>

3
Burning
Re: Count blocks displayed in a column ?
  • 2010/1/23 14:28

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


Thanks, you are my two favorites XOOPS designers

I will test it and tell you more next week !

4
deka87
Re: Count blocks displayed in a column ?
  • 2010/2/16 12:33

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


@ ghia how do I use this code? where in this code do I need to put my ad code?

my list code looks like this:

le="color: #000000"><?php <{foreach item=item from=$items}> <tr class=<{cycle values="odd,even"}>> <{if $isauthor}> <td> <{$item.status}> </td> <{elseif $xoops_isadmin}> <td> <a href="admin/adsmod.php?op=edit&ads_id=<{$item.id}>"> <img src="images/modif.gif" border="0" alt="<{$smarty.const._MD_CATADS_EDITADS}>" /></a> </td> <{/if}> <td align="left"><b> <{$item.type}> : </b><a href="<{$xoops_url}>/modules/catads/adsitem.php?ads_id=<{$item.id}>"> <{$item.title}> </a></td> <td align="left"><{$item.price}></td> <td align="center"><{$item.date}></td> <td><{$item.local|capitalize}></td> <td ><{$item.photo}></td> <td align="center"><{$item.views}></td> </tr> <{/foreach}>

5
deka87
Re: Count blocks displayed in a column ?
  • 2010/2/16 15:04

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


pk read this http://www.smarty.net/manual/en/language.function.foreach.php and sorted it out. thanks

Login

Donat-O-Meter

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

Latest GitHub Commits