For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > November 2005 > OScommerce PHP help.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author OScommerce PHP help.
skalcevich@gmail.com

2005-11-16, 6:56 pm

Hi all.

I am working on finishing an oscommerce based site and need some help.
One page is listing in 1 column 6 down, I wish to have a layout of 4
across and 5 down. When there is more then 20 items you can press next
to go to page 2 and so on...

The page I am talking about is here
[url]http://www.philcos.com/catalog/products_new_w.php[/url]

Below is the php file. Can anyone help me out here? I went through all
the contributions and there is none like this to use. I also went
through the forum and could not find anything also went through
google!!!

----------------

<?php
/*
$Id: products_new.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3D<?php echo
CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href=3D"<?php echo (($request_type =3D=3D 'SSL') ? HTTPS_SERVER :
HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel=3D"stylesheet" type=3D"text/css" href=3D"stylesheet.css">
<link rel=3D"stylesheet" type=3D"text/css" media=3D"print" href=3D"print.cs=
s">
</head>
<body marginwidth=3D"0" marginheight=3D"0" topmargin=3D"0" bottommargin=3D"=
0"
leftmargin=3D"0" rightmargin=3D"0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border=3D"0" width=3D"100%" cellspacing=3D"1" cellpadding=3D"0">
<tr>
<td width=3D"<?php echo BOX_WIDTH; ?>" valign=3D"top"><table border=3D"=
0"
width=3D"<?php echo BOX_WIDTH; ?>" cellspacing=3D"0" cellpadding=3D"2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->


<td width=3D"100%" valign=3D"top"><table border=3D"0" width=3D"100%"
cellspacing=3D"0" cellpadding=3D"0">

<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%',
'10'); ?></td>
</tr>
<?php


$products_new_array =3D array();

$products_new_query_raw =3D "select p.products_id, pd.products_name,
p=2Eproducts_image, p.products_price, p.products_date_added,
p=2Eproducts_model, m.manufacturers_name from " . TABLE_PRODUCTS . " p
left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id =3D
m=2Emanufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where
p=2Eproducts_status =3D '1' and p.products_id =3D pd.products_id and
TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) < '" . '7' . "' and
pd.language_id =3D '" . (int)$languages_id . "' order by pd.products_name
ASC, pd.products_name";
$products_new_split =3D new splitPageResults($products_new_query_raw
,
6);

if (($products_new_split->number_of_rows > 0) &&
((PREV_NEXT_BAR_LOCATION =3D=3D '1') || (PREV_NEXT_BAR_LOCATION =3D=3D '3')=
)) {
?>


<tr>
<td><table border=3D"0" width=3D"100%" cellspacing=3D"0"
cellpadding=3D"2">
<tr>
<td class=3D"smallText"><?php echo
$products_new_split-> display_count(TEXT_DISPLAY_NUMBER_OF_PRO
DUCTS_NEW);
?></td>
<td align=3D"right" class=3D"smallText"><?php echo
TEXT_RESULT_PAGE . ' ' .
$products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS,
tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%',
'10'); ?></td>
</tr>
<?php
}
?>
<tr>
<td><table border=3D"0" width=3D"100%" cellspacing=3D"0"
cellpadding=3D"2">
<?php
if ($products_new_split->number_of_rows > 0) {
$products_new_query =3D tep_db_query($products_new_split->sql_query);
while ($products_new =3D tep_db_fetch_array($products_new_query))
{
if ($new_price =3D
tep_get_products_special_price($products
_new['products_id'])) {
$products_price =3D '<s>' .
$currencies-> display_price($products_new['products_pr
ice'],
tep_get_tax_rate($products_new['products
_tax_class_id'])) . '</s> <span
class=3D"productSpecialPrice">' . $currencies->display_price($new_price,
tep_get_tax_rate($products_new['products
_tax_class_id'])) . '</span>';
} else {
$products_price =3D
$currencies-> display_price($products_new['products_pr
ice'],
tep_get_tax_rate($products_new['products
_tax_class_id']));
}
// added for New Product Icon contribution
// convert times to unix timestamp for comparison
// 2592000 =3D 30 days in the unix timestamp format
if ( ($today_time -
strtotime($products_new['products_date_a
dded']) ) < 2592000) {
$products_new['products_name'] .=3D ' ' .
tep_image_button('icon_newarrival.gif', TEXT_ICON_NEW_PRODUCT);
}
// end addition New Product Icon contribution
?>
<tr>
<td width=3D"<?php echo SMALL_IMAGE_WIDTH; ?>"
valign=3D"left" class=3D"main"><?php echo '<a href=3D"' .
tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=3D' .
$products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES .
$products_new['products_image'], $products_new['products_name'],
SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
<td valign=3D"top"
class=3D"main"><?php echo '<a href=3D"' .
tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=3D' .
$products_new['products_id']) . '"><b>' .
$products_new['products_model'] . ' ' . $products_new['']
..'</b></a><br>' . ' ' . $products_new['manufacturers_name'] . '<br>' .
' ' . $products_price; ?></td>
</tr>
<tr>
<td colsp=FCan=3D"3"><?php echo
tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
} else {
?>
<tr>
<td class=3D"main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif',
'100%', '10'); ?></td>
</tr>
<?php
}
?>
</table></td>
</tr>
<?php

if (($products_new_split->number_of_rows > 0) &&
((PREV_NEXT_BAR_LOCATION =3D=3D '2') || (PREV_NEXT_BAR_LOCATION =3D=3D '3')=
)) {
?>
<tr>
<td><table border=3D"0" width=3D"100%" cellspacing=3D"0"
cellpadding=3D"2">
<tr>
<td class=3D"smallText"><?php echo
$products_new_split-> display_count(TEXT_DISPLAY_NUMBER_OF_PRO
DUCTS_NEW);
?></td>
<td align=3D"right" class=3D"smallText"><?php echo
TEXT_RESULT_PAGE . ' ' .
$products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS,
tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table></td>
</tr>
<?php
}
?>
</table></td>
<!-- body_text_eof //-->
<td width=3D"<?php echo BOX_WIDTH; ?>" valign=3D"top"><table border=3D"=
0"
width=3D"<?php echo BOX_WIDTH; ?>" cellspacing=3D"0" cellpadding=3D"2">
<!-- 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 //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>




-----------

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com