Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

All Prods


WendyM

Recommended Posts

I'm using All Prods v2.61 and using "allprods_without_model.php", does not currently show pictures.

 

I'd like to have pictures show, but just small ones...say, using the "small_height" and "small_width" parameters.(the ones I set up through admin...used for thumbnails?)

 

I do not know how to do this, as my knowledge of PHP is still quite limited.

(I looked at the code from the "new products" php file since it shows those small pictures I would like to see, but still couldn't quite "get" it)

 

Could anyone please post the code that I should add to accomplish this?

 

Much thanks in advance. :)

 

The actual file I'm using is shown below:

 

==========================

 

<?php 
/* 
 $Id: allprods.php,v 1.5 2002/09/29 1

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
 
*/ 

 require('includes/application_top.php'); 
 include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ALLPRODS); 

// Set number of columns in listing
define ('NR_COLUMNS', 1);
//
 $breadcrumb->add(HEADING_TITLE, tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL')); 
?> 
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html <?php echo HTML_PARAMS; ?>> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 
<?php 
// BOF: WebMakers.com Changed: Header Tag Controller v1.0 
// Replaced by header_tags.php 
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { 
 require(DIR_WS_INCLUDES . 'header_tags.php'); 
} else { 
?> 
 <title><?php echo TITLE ?></title> 
<?php 
} 
// EOF: WebMakers.com Changed: Header Tag Controller v1.0 
?> 

<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> 
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head> 
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> 
<!-- header //--> 
<?php require(DIR_WS_INCLUDES . 'header.php'); ?> 
<!-- header_eof //--> 

<!-- body //--> 
<table border="0" width="100%" cellspacing="3" cellpadding="3"> 
 <tr> 
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="8"> 
<!-- left_navigation //--> 
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> 
<!-- left_navigation_eof //--> 
   </table></td> 
<!-- body_text //--> 
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> 
     <tr> 
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> 
         <tr> 
        <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> 
           <td align="right"></td> 
         </tr> 
       </table></td> 
     </tr> 
     <tr> 
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 
     </tr> 
     <tr> 
       <td> 
       <table border="0" width="100%" cellspacing="0" cellpadding="2"> 
       <tr class="productListing-heading"> 
       <td align="left" class="productListing-heading">Product Name</td> 
      <td align="center" class="productListing-heading">Manufacturer</td> 
      <td align="right" class="productListing-heading">Price  </td> 
      </tr> 
            <?php   
            
              
          $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order"); 
         while ($languages = tep_db_fetch_array($languages_query)) { 
           $languages_array[] = array('id' => $languages['languages_id'], 
                                      'name' => $languages['name'], 
                                      'code' => $languages['code'], 
                                      'image' => $languages['image'], 
                                      'directory'   => $languages['directory']); 
         } 
                   for ($i=0; $i<sizeof($languages_array); $i++) 
                   {          
           $this_language_id = $languages_array[$i]['id']; 
           $this_language_name = $languages_array[$i]['name']; 
           $this_language_code = $languages_array[$i]['code']; 
           $this_language_image = $languages_array[$i]['image']; 
           $this_language_directory = $languages_array[$i]['directory']; 
   echo " <tr>\n"; 
      
         $products_query = tep_db_query("select p.products_id, p.products_model ,pd.products_name, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p , " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = p2c.products_id and c.categories_id = p2c.categories_id and products_status = '1' order by pd.products_name");
                        
      
           $products_array = array(); 
           while($products = tep_db_fetch_array($products_query)) 
           { 
              $products_array[] = array('id'=> $products['products_id'], 
                            'name'    => $products['products_name'], 
                            'manufacturer'  => $products['manufacturers_name'], 
                            'price'   => $products['products_price'], 
                            'tax'     => $products['products_tax_class_id'], 
                            'special' => $products['specials_new_products_price']); 
           } 
            
           $num_prods = sizeof($products_array);  // This optimizes that slow FOR loop... 
            
           for ($i = 0; $i < $num_prods; $i++)    // Traverse Rows 
           { 
              // Rotate Row Colors 
              if ($i % 2)  // Odd Row 
              { 
                 $row_col = 'class="productListing-odd"'; 
              } 
              else   // Guess... 
              { 
                 $row_col = 'class="productListing-even"'; 
              } 
               
     
              $this_id = $products_array[$i]['id']; 
              $this_name = $products_array[$i]['name']; 
              $this_manufacturer = $products_array[$i]['manufacturer']; 
              $this_price = $products_array[$i]['price']; 
              $this_special = $products_array[$i]['special']; 
              $this_tax = $products_array[$i]['tax']; 
              $this_url = tep_href_link(FILENAME_PRODUCT_INFO,  'store=' . str_replace(" ", "_", $this_name). '&products_id=' . $this_id . (($this_language_code == DEFAULT_LANGUAGE) ? '' : ('&language=' . $this_language_code)), 'NONSSL', false); 

              echo "<tr $row_col>"; 
              echo "<td class='productListing-data' align='left'><a href='$this_url'>$this_name</a></td>"; 
              echo "<td class='productListing-data' align='center'><a href='$this_url'>$this_manufacturer</a></td>"; 
              if (tep_not_null($this_special)) 
              { 
                 echo "<td class='productListing-data' align='right'><a href='$this_url'><span class='productSpecialPrice'>".$currencies->display_price($this_special, tep_get_tax_rate($this_tax))."</span></a></td>"; 
              } 
              else 
              { 
                 echo "<td class='productListing-data' align='right'><a href='$this_url'>".$currencies->display_price($this_price, tep_get_tax_rate($this_tax))."</a></td>"; 
              } 
              echo "</tr>\n"; 
           } 
        } 
        
        
         
?> 
           </td> 
         </tr> 
       </table></td> 
     </tr> 
     <tr> 
   <td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> 
     </tr> 
   </table></td> 
<!-- body_text_eof //--> 
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="8"> 
<!-- right_navigation //--> 
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> 
<!-- right_navigation_eof //--> 
   </table></td> 
 </tr> 
</table> 
<!-- body_eof //--> 

<!-- footer //--> 
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?> 
<!-- footer_eof //--> 
</body> 
</html> 
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

=============================

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...