rotulistaz Posted October 9, 2006 Posted October 9, 2006 Please somebody know how put several column in this contribution http://www.oscommerce.com/community/contributions,1685 This is the code <!-- all manufacturers begin //--> <center> <?php $manufacturers_query = tep_db_query("select manufacturers_name, manufacturers_id, manufacturers_image from " . TABLE_MANUFACTURERS . " order by manufacturers_name" ); if (tep_db_num_rows($manufacturers_query) >= '1') { while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] . '=' . $manufacturers['manufacturers_name'], 'NONSSL', false) . '">'. $manufacturers['manufacturers_name'] . ' ' . tep_image(DIR_WS_IMAGES . $manufacturers['manufacturers_image'], $manufacturers['manufacturers_name']) . "</a> \n"; } } ?> </center> <!-- all manufacturers end //--> Thak you very much for help Quote
rotulistaz Posted October 10, 2006 Author Posted October 10, 2006 Please somebody know how put several column in this contribution http://www.oscommerce.com/community/contributions,1685 This is the code <!-- all manufacturers begin //--> <center> <?php $manufacturers_query = tep_db_query("select manufacturers_name, manufacturers_id, manufacturers_image from " . TABLE_MANUFACTURERS . " order by manufacturers_name" ); if (tep_db_num_rows($manufacturers_query) >= '1') { while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] . '=' . $manufacturers['manufacturers_name'], 'NONSSL', false) . '">'. $manufacturers['manufacturers_name'] . ' ' . tep_image(DIR_WS_IMAGES . $manufacturers['manufacturers_image'], $manufacturers['manufacturers_name']) . "</a> \n"; } } ?> </center> <!-- all manufacturers end //--> Thak you very much for help Please some help..? Quote
rotulistaz Posted October 11, 2006 Author Posted October 11, 2006 What are you asking for? when you install this contribution appear all logo manufactures in one column, my question is possible four columns..? thanks Quote
pyramids Posted October 11, 2006 Posted October 11, 2006 here is some code I put together to do what you asked. you will have to debug it since I don't use the mod you are takling about. <!-- all manufacturers begin //--> <center> <table><tr><td> <?php $manufacturers_query = tep_db_query("select manufacturers_name, manufacturers_id, manufacturers_image from " . TABLE_MANUFACTURERS . " order by manufacturers_name" ); if (tep_db_num_rows($manufacturers_query) >= '1') { $count = tep_db_fetch_array($manufacturers_query); // count the manufactures $show_columns = 3; // number of columns one less than needed since it starts with 0 $column_place = 0; // hold the starting point $list_manufacturers = ''; // create an empty var $modulus = 4 -($count % 4); //get remaining empty columns while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { // this is unchanged $list_manufacturers .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] . '=' . $manufacturers['manufacturers_name'], 'NONSSL', false) . '">'. $manufacturers['manufacturers_name'] . ' ' . tep_image(DIR_WS_IMAGES . $manufacturers['manufacturers_image'], $manufacturers['manufacturers_name']) . "</a>\n"; // count which column it is and add the right table code if ($column_place == 3) { $list_manufacturers .= '</td></tr><tr><td>'; }else { $list_manufacturers .= '</td><td>'; } if ($column_place == 3){$column_place == 0;}else {$column_place ++;} } // when the list of manufactures is done fill in the empty table tags for ($i=0, $i<$modulus; $i++) { $list_manufacturers .= ' </td><td>'; } // print to screen the 4 column list echo $list_manufacturers; } ?> </td></tr></table> </center> Quote
rotulistaz Posted October 12, 2006 Author Posted October 12, 2006 here is some code I put together to do what you asked.you will have to debug it since I don't use the mod you are takling about. <!-- all manufacturers begin //--> <center> <table><tr><td> <?php $manufacturers_query = tep_db_query("select manufacturers_name, manufacturers_id, manufacturers_image from " . TABLE_MANUFACTURERS . " order by manufacturers_name" ); if (tep_db_num_rows($manufacturers_query) >= '1') { $count = tep_db_fetch_array($manufacturers_query); // count the manufactures $show_columns = 3; // number of columns one less than needed since it starts with 0 $column_place = 0; // hold the starting point $list_manufacturers = ''; // create an empty var $modulus = 4 -($count % 4); //get remaining empty columns while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { // this is unchanged $list_manufacturers .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] . '=' . $manufacturers['manufacturers_name'], 'NONSSL', false) . '">'. $manufacturers['manufacturers_name'] . ' ' . tep_image(DIR_WS_IMAGES . $manufacturers['manufacturers_image'], $manufacturers['manufacturers_name']) . "</a>\n"; // count which column it is and add the right table code if ($column_place == 3) { $list_manufacturers .= '</td></tr><tr><td>'; }else { $list_manufacturers .= '</td><td>'; } if ($column_place == 3){$column_place == 0;}else {$column_place ++;} } // when the list of manufactures is done fill in the empty table tags for ($i=0, $i<$modulus; $i++) { $list_manufacturers .= ' </td><td>'; } // print to screen the 4 column list echo $list_manufacturers; } ?> </td></tr></table> </center> Thank very much pyramids, now is work fine. Quote
rotulistaz Posted October 12, 2006 Author Posted October 12, 2006 here is some code I put together to do what you asked.you will have to debug it since I don't use the mod you are takling about. <!-- all manufacturers begin //--> <center> <table><tr><td> <?php $manufacturers_query = tep_db_query("select manufacturers_name, manufacturers_id, manufacturers_image from " . TABLE_MANUFACTURERS . " order by manufacturers_name" ); if (tep_db_num_rows($manufacturers_query) >= '1') { $count = tep_db_fetch_array($manufacturers_query); // count the manufactures $show_columns = 3; // number of columns one less than needed since it starts with 0 $column_place = 0; // hold the starting point $list_manufacturers = ''; // create an empty var $modulus = 4 -($count % 4); //get remaining empty columns while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { // this is unchanged $list_manufacturers .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] . '=' . $manufacturers['manufacturers_name'], 'NONSSL', false) . '">'. $manufacturers['manufacturers_name'] . ' ' . tep_image(DIR_WS_IMAGES . $manufacturers['manufacturers_image'], $manufacturers['manufacturers_name']) . "</a>\n"; // count which column it is and add the right table code if ($column_place == 3) { $list_manufacturers .= '</td></tr><tr><td>'; }else { $list_manufacturers .= '</td><td>'; } if ($column_place == 3){$column_place == 0;}else {$column_place ++;} } // when the list of manufactures is done fill in the empty table tags for ($i=0, $i<$modulus; $i++) { $list_manufacturers .= ' </td><td>'; } // print to screen the 4 column list echo $list_manufacturers; } ?> </td></tr></table> </center> Thank very much pyramids, now is work fine. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.