[TEP-COMMIT] [CVS catalog] use the new database class
hpdl-OfajU3CKLf1/[email protected] 23 Feb 2005 16:30:50 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>catalog/catalog/includes/boxes</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">manufacturer_info.php</a></tt></td><td align="right" id="added">+13</td><td align="right" id="removed">-7</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/manufacturer_info.php?rev=1.12&content-type=text/vnd.viewcvs-markup">1.12</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/manufacturer_info.php.diff?r1=1.12&r2=1.13">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/manufacturer_info.php?rev=1.13&content-type=text/vnd.viewcvs-markup">1.13</a></td></tr>
<tr class="alt"><td><tt><a href="#file2">order_history.php</a></tt></td><td align="right" id="added">+23</td><td align="right" id="removed">-9</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/order_history.php?rev=1.7&content-type=text/vnd.viewcvs-markup">1.7</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/order_history.php.diff?r1=1.7&r2=1.8">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/order_history.php?rev=1.8&content-type=text/vnd.viewcvs-markup">1.8</a></td></tr>
<tr><td><tt><a href="#file3">product_notifications.php</a></tt></td><td align="right" id="added">+7</td><td align="right" id="removed">-4</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/product_notifications.php?rev=1.10&content-type=text/vnd.viewcvs-markup">1.10</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/product_notifications.php.diff?r1=1.10&r2=1.11">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/product_notifications.php?rev=1.11&content-type=text/vnd.viewcvs-markup">1.11</a></td></tr>
<tr><td></td><td align="right" id="added">+43</td><td align="right" id="removed">-20</td><td></td></tr>
</table>
<small id="info">3 modified files</small><br />
<pre class="comment">
use the new database class
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes">boxes</a><br /></span>
<div class="fileheader"><big><b>manufacturer_info.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/manufacturer_info.php?rev=1.12&content-type=text/vnd.viewcvs-markup">1.12</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/manufacturer_info.php.diff?r1=1.12&r2=1.13">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/manufacturer_info.php?rev=1.13&content-type=text/vnd.viewcvs-markup">1.13</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.12 -r1.13
--- manufacturer_info.php 2003/11/17 20:01:23 1.12
+++ manufacturer_info.php 2005/02/23 16:30:48 1.13
@@ -5,15 +5,21 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">3</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
if (isset($_GET['products_id'])) {
</pre><pre class="diff" id="removed">- $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$osC_Session->value('languages_id') . "'), " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$_GET['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
- if (tep_db_num_rows($manufacturer_query)) {
- $manufacturer = tep_db_fetch_array($manufacturer_query);
</pre><pre class="diff" id="added">+ $Qmanufacturer = $osC_Database->query('select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from :table_manufacturers m left join :table_manufacturers_info mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id), :table_products p where p.products_id = :products_id and p.manufacturers_id = m.manufacturers_id');
+ $Qmanufacturer->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
+ $Qmanufacturer->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
+ $Qmanufacturer->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qmanufacturer->bindInt(':languages_id', $osC_Session->value('languages_id'));
+ $Qmanufacturer->bindInt(':products_id', $_GET['products_id']);
+ $Qmanufacturer->execute();
+
+ if ($Qmanufacturer->numberOfRows()) {
</pre><pre class="diff" id="context"> ?>
<!-- manufacturer_info //-->
<tr>
</pre><pre class="diff"><small id="info">@@ -25,9 +31,9 @@
</small></pre><pre class="diff" id="context"> new infoBoxHeading($info_box_contents, false, false);
$manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
</pre><pre class="diff" id="removed">- if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';
- if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';
- $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . '</a></td></tr>' .
</pre><pre class="diff" id="added">+ if (tep_not_null($Qmanufacturer->value('manufacturers_image'))) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $Qmanufacturer->value('manufacturers_image'), $Qmanufacturer->value('manufacturers_name')) . '</td></tr>';
+ if (tep_not_null($Qmanufacturer->value('manufacturers_url'))) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $Qmanufacturer->valueInt('manufacturers_id')) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $Qmanufacturer->value('manufacturers_name')) . '</a></td></tr>';
+ $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $Qmanufacturer->valueInt('manufacturers_id')) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . '</a></td></tr>' .
</pre><pre class="diff" id="context"> '</table>';
$info_box_contents = array();
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes">boxes</a><br /></span>
<div class="fileheader"><big><b>order_history.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/order_history.php?rev=1.7&content-type=text/vnd.viewcvs-markup">1.7</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/order_history.php.diff?r1=1.7&r2=1.8">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/order_history.php?rev=1.8&content-type=text/vnd.viewcvs-markup">1.8</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.7 -r1.8
--- order_history.php 2004/04/13 07:53:42 1.7
+++ order_history.php 2005/02/23 16:30:48 1.8
@@ -5,15 +5,23 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">3</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
if ($osC_Customer->isLoggedOn()) {
// retreive the last x products purchased
</pre><pre class="diff" id="removed">- $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$osC_Customer->id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
- if (tep_db_num_rows($orders_query)) {
</pre><pre class="diff" id="added">+ $Qorders = $osC_Database->query('select distinct op.products_id from :table_orders o, :table_orders_products op, :table_products p where o.customers_id = :customers_id and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = :products_status group by products_id order by o.date_purchased desc limit :limit');
+ $Qorders->bindTable(':table_orders', TABLE_ORDERS);
+ $Qorders->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
+ $Qorders->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qorders->bindInt(':customers_id', $osC_Customer->id);
+ $Qorders->bindInt(':products_status', 1);
+ $Qorders->bindInt(':limit', MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
+ $Qorders->execute();
+
+ if ($Qorders->numberOfRows()) {
</pre><pre class="diff" id="context"> ?>
<!-- customer_orders //-->
<tr>
</pre><pre class="diff"><small id="info">@@ -25,17 +33,23 @@
</small></pre><pre class="diff" id="context"> new infoBoxHeading($info_box_contents, false, false);
$product_ids = '';
</pre><pre class="diff" id="removed">- while ($orders = tep_db_fetch_array($orders_query)) {
- $product_ids .= (int)$orders['products_id'] . ',';
</pre><pre class="diff" id="added">+ while ($Qorders->next()) {
+ $product_ids .= $Qorders->valueInt('products_id') . ',';
</pre><pre class="diff" id="context"> }
$product_ids = substr($product_ids, 0, -1);
$customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
</pre><pre class="diff" id="removed">- $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$osC_Session->value('languages_id') . "' order by products_name");
- while ($products = tep_db_fetch_array($products_query)) {
</pre><pre class="diff" id="added">+
+ $Qproducts = $osC_Database->query('select products_id, products_name from :table_products_description where products_id in (:products_id) and language_id = :language_id order by products_name');
+ $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
+ $Qproducts->bindRaw(':products_id', $product_ids);
+ $Qproducts->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qproducts->execute();
+
+ while ($Qproducts->next()) {
</pre><pre class="diff" id="context"> $customer_orders_string .= ' <tr>' .
</pre><pre class="diff" id="removed">- ' <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
- ' <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($_SERVER['PHP_SELF']), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
</pre><pre class="diff" id="added">+ ' <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $Qproducts->valueInt('products_id')) . '">' . $Qproducts->value('products_name') . '</a></td>' .
+ ' <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($_SERVER['PHP_SELF']), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $Qproducts->valueInt('products_id')) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
</pre><pre class="diff" id="context"> ' </tr>';
}
$customer_orders_string .= '</table>';
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes">boxes</a><br /></span>
<div class="fileheader"><big><b>product_notifications.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/product_notifications.php?rev=1.10&content-type=text/vnd.viewcvs-markup">1.10</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/product_notifications.php.diff?r1=1.10&r2=1.11">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/boxes/product_notifications.php?rev=1.11&content-type=text/vnd.viewcvs-markup">1.11</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.10 -r1.11
--- product_notifications.php 2004/04/13 07:53:43 1.10
+++ product_notifications.php 2005/02/23 16:30:48 1.11
@@ -5,7 +5,7 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">3</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff"><small id="info">@@ -22,10 +22,13 @@
</small></pre><pre class="diff" id="context"> new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
if ($osC_Customer->isLoggedOn()) {
</pre><pre class="diff" id="removed">- $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$_GET['products_id'] . "' and customers_id = '" . (int)$osC_Customer->id . "'");
- $check = tep_db_fetch_array($check_query);
</pre><pre class="diff" id="added">+ $Qcheck = $osC_Database->query('select count(*) as count from :table_products_notifications where products_id = :products_id and customers_id = :customers_id');
+ $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
+ $Qcheck->bindInt(':products_id', $_GET['products_id']);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $notification_exists = (($<span id="removedchars">check['count']</span> > 0) ? true : false);
</pre><pre class="diff" id="added">+ $notification_exists = (($<span id="addedchars">Qcheck->valueInt('count')</span> > 0) ? true : false);
</pre><pre class="diff" id="context"> } else {
$notification_exists = false;
}
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.9</small></center>
</body></html>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click