1
xsell
Column Layout in Smarty
  • 2010/1/27 0:46

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


Hello..

My Quastion Very Simple , How to Make My block Prints out the Records into Column instaed Row ..

this is my Block Code.
le="color: #000000"><?php include_once XOOPS_ROOT_PATH."/include/xoopscodes.php"; function b_news_blocks_show($options) { global $xoopsUser, $xoopsConfig, $xoopsDB; $block = array(); $myts =& MyTextSanitizer::getInstance(); $sql=$xoopsDB->query("select count(id) from ".$xoopsDB->prefix("test").""); list($numrows) = $xoopsDB->fetchRow($sql); $result = $xoopsDB->query("SELECT id FROM ".$xoopsDB->prefix("test")." order by id desc limit ".$options[1].""); while($myrow = $xoopsDB->fetchArray($result)){ $mytest= array(); $mytest['name'] = $myts->htmlSpecialChars($myrow['name']); $block['lang_xname'] = _MB_MYNAME; $block['mytest'][] = $mytest; } return $block; } function b_news_blocks_edit($options) { $form = "Noumber of Names &nbsp;"; $form .= "<input type='hidden' name='options[]' value='"; $form .= "date'"; $form .= " />"; $form .= "<input type='text' name='options[]' value='".$options[1]."' />&nbsp;#"; return $form; }


this is my Template which prints the result in Row , I need it to print it out to 2 column .
le="color: #000000"><?php <table cellpadding="5" cellspacing="5" class="outer"> <{foreach item=mytest from=$block.mytest}> <tr> <td class="even"> <div> <{$mytest.name}></div> </td> </tr> <tr> <{/foreach}> </tr> </table>

2
Dylian
Re: Column Layout in Smarty
  • 2010/1/28 17:10

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Try this:
le="color: #000000"><?php <table cellpadding="5" cellspacing="5" class="outer"> <tr> <{foreach item=mytest from=$block.mytest}> <td class="even"> <div> <{$mytest.name}> </div> </td> <{/foreach}> </tr> </table>


And please stop sending me pm's everytime you've got a problem. If noone reacted to your help request for a week or two then you can send me a pm, but not just a day after you posted you help request...

Greets Dylian.

Who's Online

186 user(s) are online (156 user(s) are browsing Support Forums)


Members: 0


Guests: 186


more...

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