Jump to content

Dax87

Members
  • Content count

    8
  • Joined

  • Last visited

Profile Information

  • Real Name
    Daniele
  • Gender
    Male
  1. azz error. in product_info.php Error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /web/htdocs/www.piatino.it/home/Store/includes/functions/database.php on line 103 Original code: <?php if (tep_not_null($product_info['products_image'])) { ?> <table cellpadding="0" cellspacing="0" border="0" align="left" class="prod_info"> <tr><td align="center"> <?php echo tep_draw_prod_pic_top();?> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' style="margin:0px 0px 0px 0px;"') . ''; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' style="margin:0px 0px 0px 0px;"') . ''; ?> </noscript> <?php echo tep_draw_prod_pic_bottom();?> </td></tr> <tr><td align="center"> <script language="javascript"><!-- document.write('<?php echo '<div><a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . TEXT_CLICK_TO_ENLARGE . '</a></div>'; ?>'); //--></script> <noscript> <?php echo '<div><a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank"><br style="line-height:7px">' . TEXT_CLICK_TO_ENLARGE . '</a></div>'; ?> </noscript> </td></tr> </table> <?php } ?> does function: Find (124): <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> </td> </tr> </table> Replace With: <!-- Simple multi image addon --> <div id="fancy"> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <?php if (strlen($product_info['products_name']) > $max_title_length) { $title = wordwrap(htmlspecialchars($product_info['products_name']), $max_title_length, '<br>'); } else { $title = htmlspecialchars($product_info['products_name']); } $m_source = ''; $thumb = (class_exists('oscthumb') && CFG_MASTER_SWITCH == 'On'); if ($thumb) { preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $product_info['products_image'],'','','','','',5), ENT_NOQUOTES), $image); $m_source=str_replace('&','&',$image[1]); } echo '<a rel="image_group" title="'.$title.'" href="' . ($m_source ? $m_source : DIR_WS_IMAGES . $product_info['products_image']) . '" alt="' . $product_info['products_name'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '<br /></a>'; if(!$vertical_format) { echo ''; $row = 1; reset($products_image_array); foreach($products_image_array as $value) { if ($thumb) { $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image); $source=str_replace('&','&',$image[1]); } echo '<a rel="image_group" title="'.$title.'" href="' . ($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ++$row; if ($row > $image_group) { echo '<br />'; $row = 1; } } } echo '</td>'; if($vertical_format) { echo '<td>'; $row = 1; reset($products_image_array); foreach($products_image_array as $value) { if ($thumb) { $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image); $source=str_replace('&','&',$image[1]); } echo '<a rel="image_group" title="'.$title.'" href="' . ($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . '</a>'; ++$row; if ($row > $image_group) { echo '</td><td>'; $row = 1; } } echo '</td>'; } ?> </tr><?php echo '<tr><td class="smallText">' . TEXT_CLICK_TO_ENLARGE . '</td></tr>'; ?> </table> </div> <!-- EOF Simple multi image addon --> What to do? :(
  2. True, The script is a good departure point. You could create another file to retrieve only the prices of the attributes or incorporate all the same php acting in admin with more choices ...... the problem is that I can not ^ _ ^ also will..
  3. Hello, sorry but I do not know English well so I help with google. I found this interesting contrb: http://addons.oscommerce.com/info/4663 Increase / Decrease price by x% for all products or products from a category if you have 1000 products in price increases of 3% becomes hard .. this rate varies automatically ... and very simple ... but only of goods, not attributes you think there is the possibility to file admin to integrate the change in price for attributes? changes only the products but the prices of the attributes remain unchanged .. how to change it? Code: <?php /* $Id: mail.php,v 1.1.1.1 2004/03/04 23:38:43 ccwjr 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'); if (isset($_GET["action"]) && $_GET["action"]=='modify_prices') { $category_id = $_POST["category_id"]; if (trim($_POST["amount"])!="0") { $amount = $_POST["amount"]; } elseif (trim($_POST["amount_dollars"]!="0")) { $amount_dollars = $_POST["amount_dollars"]; } $operation = $_POST["operation"]; if ($category_id != 'all') { $query = 'select p.products_id, p.products_price, ptc.categories_id from products p, products_to_categories ptc where p.products_id = ptc.products_id and ptc.categories_id = "'.(int)$category_id.'"'; $result = mysql_query($query) or die(mysql_error()); $number_of_modified_records = 0; while ($row = mysql_fetch_array($result)) { if ($operation == "plus") { if (isset($amount) && trim($amount)!="0") { $new_price = round((1+($amount/100)) * $row["products_price"],2); } elseif (isset($amount_dollars) && trim($amount_dollars)!="0") { $new_price = $row["products_price"] + $amount_dollars; } } else { if (isset($amount) && trim($amount)!="0") { $new_price = round((1-($amount/100)) * $row["products_price"],2); } elseif (isset($amount_dollars) && trim($amount_dollars)!="0") { $new_price = $row["products_price"] - $amount_dollars; } } $query_update = 'update products set products_price = '.$new_price.' where products_id = '.$row["products_id"]; mysql_query($query_update); $number_of_modified_records++; } } else { $query = 'select products_id, products_price from products'; $result = mysql_query($query) or die(mysql_error()); $number_of_modified_records = 0; while ($row = mysql_fetch_array($result)) { if ($operation == "plus") { if (isset($amount) && trim($amount)!="0") { $new_price = round((1+($amount/100)) * $row["products_price"],2); } elseif (isset($amount_dollars) && trim($amount_dollars)!="0") { $new_price = $row["products_price"] + $amount_dollars; } } else { if (isset($amount) && trim($amount)!="0") { $new_price = round((1-($amount/100)) * $row["products_price"],2); } elseif (isset($amount_dollars) && trim($amount_dollars)!="0") { $new_price = $row["products_price"] - $amount_dollars; } } $query_update = 'update products set products_price = '.$new_price.' where products_id = '.$row["products_id"]; mysql_query($query_update); $number_of_modified_records++; } } } ?> <!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; ?>"> <title><?php echo MODIFY_PRICES_TITLE;?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/menu.js"></script> <script language="Javascript1.2"><!-- // load htmlarea // MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 HTML Email HTML - <head> _editor_url = "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>htmlarea/"; // URL to htmlarea files var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]); if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; } if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; } if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; } <?php if (HTML_AREA_WYSIWYG_BASIC_EMAIL == 'Basic'){ ?> if (win_ie_ver >= 5.5) { document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_basic.js"'); document.write(' language="Javascript1.2"></scr' + 'ipt>'); } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); } <?php } else{ ?> if (win_ie_ver >= 5.5) { document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_advanced.js"'); document.write(' language="Javascript1.2"></scr' + 'ipt>'); } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); } <?php }?> // --></script> <script language="JavaScript" src="htmlarea/validation.js"></script> <script language="JavaScript"> <!-- Begin function init() { define('customers_email_address', 'string', 'Customer or Newsletter Group'); } // End --> </script> </head> <body OnLoad="init()" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- 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 MODIFY_PRICES_TITLE;?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr><?php echo tep_draw_form('mail', 'prices_per.php', 'action=modify_prices'); ?> <td><table border="0" width="100%" cellpadding="0" cellspacing="2"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="smallText"><b><?php echo MODIFY_PRICES_CATEGORY;?></b><br> <select name='category_id'> <option value='all'><?php echo MODIFY_PRICES_ALL;?></option> <?php $query = "select categories_id, categories_name from categories_description"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { echo '<option value='.$row["categories_id"].'>'.$row["categories_name"].'</option>'; } mysql_free_result($result); ?> </select> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="smallText"><b>+/-</b><br> <select name='operation'> <option value='plus'>+</option> <option value='minus'>-</option> </select> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="smallText"><b><?php echo MODIFY_PRICES_AMOUNT;?></b><br><input type=text name=amount size=4 value=0>%</td> </tr> <tr> <td class="smallText"><b><?php echo MODIFY_PRICES_OR;?></b><br>$<input type=text name=amount_dollars size=4 value=0></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="smallText"><b> <?php if (isset($_GET["action"]) && $_GET["action"]=='modify_prices') { echo $number_of_modified_records . " products modified"; if (isset($amount) && trim($amount)!="0") echo " by ".$amount."% "; else echo " by $".$amount_dollars; } ?> </b></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td> <tr> <td align="right"><?php echo '<a href="' . tep_href_link('prices_per.php') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . tep_image_submit('button_confirm.gif', IMAGE_SEND_EMAIL); ?></td> </tr> <td class="smallText"></td> </tr> </table></td> </tr> </table></td> </form></tr> <!-- body_text_eof //--> </table></td> </tr> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <table aling=center><tr><td>Powered by <a href=http://www.PinkCrow.net>PinkCrow</a></td></tr></table> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
×