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.
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  ";
    
$form .= ";
    
$form .= "date'";
    
$form .= " />";
    
$form .= ".$options[1]."' /> #";
    return 
$form;
}


this is my Template which prints the result in Row , I need it to print it out to 2 column .
<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:
<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.

Login

Who's Online

331 user(s) are online (182 user(s) are browsing Support Forums)


Members: 0


Guests: 331


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