illusions2k Posted February 19, 2006 Posted February 19, 2006 I was wondering if any of your bright folks out there could tell me how i would change the following code so that it displays the results in column and not rows. also after changing it to columns, how to change it to only show two columns. thanks (PS. its displaying it in 3 columns right now because that is the default set by my stores configuration) $number_of_categories = tep_db_num_rows($categories_query); if ($number_of_categories > 0) { $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $lPath_new = 'lPath=' . $categories['link_categories_id']; $width = (int)(200 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
Guest Posted February 19, 2006 Posted February 19, 2006 see your osc admin->configuration->maximum values->Categories to list per row set it to 2.
illusions2k Posted February 19, 2006 Author Posted February 19, 2006 thanks, i did that, but the more important thing is, how do i do it in columns because its in two columns but its sorting them out like 1 2 3 4 5 6 and i want it to be like 1 4 2 5 3 6 how can i change the code to reflect that?
Guest Posted February 19, 2006 Posted February 19, 2006 You would need to collect the output in an md array. If its for general use you may want to write a function to transpose the output array. If you just want 6 items and that's it, just hard-code the locations.
illusions2k Posted February 19, 2006 Author Posted February 19, 2006 yah i think im just going to have to hard code it. but now im having a bigger problem. when i click on a category in the catelog and not the admin part, i get this error Warning: Division by zero in /home/mysite/public_html/includes/classes/split_page_results.php on line 59 then when i manually add a link to that category and refresh that page, i get this error 1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX_LINKS_DISPLAY' at line 1 select l.links_image_url, ld.links_title, l.links_clicked, l.links_id from links_description ld, links l, links_to_link_categories l2lc where l.links_status = '2' and l.links_id = l2lc.links_id and ld.links_id = l2lc.links_id and ld.language_id = '1' and l2lc.link_categories_id = '4' order by ld.links_title limit -0, MAX_LINKS_DISPLAY does anyone know what is wrong with it?
Guest Posted February 19, 2006 Posted February 19, 2006 the fix is at the end of the page. It is also included with the latest osc upgrade http://www.oscommerce.com/community/bugs,1605
Recommended Posts
Archived
This topic is now archived and is closed to further replies.