mugitty Posted March 31, 2003 Share Posted March 31, 2003 I know I ought to be able to figure this one out, but I've been staring at it for some time and the only answer I can come up with is that I must be Dain Bread I've been looking at the AllProds code where the display can be changed to show whatever number of columns you want and have been trying to apply that to the following code. The code below gives the display that I want, but it all displays in one column and I want to display in 2 columns: <tr><td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_INFOPAGES); new infoBoxHeading($info_box_contents, true, true); // Retrieve infopages from Info table $informationString = ""; $sql=mysql_query('SELECT infopages_id, info_title FROM ' . TABLE_INFOPAGES .' WHERE visible='1' ORDER BY v_order') or die(mysql_error()); while($row=mysql_fetch_array($sql)): $informationString .= '<a href="' . tep_href_link(FILENAME_INFOPAGES, 'info_id=' . $row['infopages_id'], 'NONSSL') . '">' . $row['info_title'] . '</a><br>'; endwhile; $info_box_contents = array(); $info_box_contents[] = array('text' => $informationString . ''); new infoBox($info_box_contents); ?></td> </tr> Is there a kind soul out there who could help me past my mental block? THX :( ... if you want to REALLY see something that doesn't set up right out of the box without some tweaking, try being a Foster Parent! Link to comment Share on other sites More sharing options...
mugitty Posted April 1, 2003 Author Share Posted April 1, 2003 I've messed around with things a bit and still can't get this to display in 2 columns. My latest error reads: Warning: Illegal offset type in /home/farmex/public_html/catalog/mfr_infopages.php on line 74 using the following: <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_INFOPAGES); new infoBoxHeading($info_box_contents, true, true); // Retrieve infopages from Info table $sql=mysql_query('SELECT infopages_id, info_title FROM ' . TABLE_INFOPAGES .' WHERE visible='1' ORDER BY v_order') or die(mysql_error()); $info_box_contents = array(); $row = 0; $col = 0; while($row=mysql_fetch_array($sql)) { $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="50%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_INFOPAGES, 'info_id=' . $row['infopages_id'], 'NONSSL') . '">' . $row['info_title'] . '</a><br>'); $col ++; if ($col > 1) { $col = 0; $row ++; } } new infoBox($info_box_contents); ?> with line 74 being the one that reads $info_box_contents[$row][$col] = array('align' => 'center', I know this should be simple, but I can't seem to crack it. ... if you want to REALLY see something that doesn't set up right out of the box without some tweaking, try being a Foster Parent! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.