Zen Cart Logo
Forums / General Questions / uninstall SQL patch that's messed up my site

uninstall SQL patch that's messed up my site

Locked

Views: 3,959

Results 21 to 30 of 30
This thread is locked. New replies are disabled.
6 Feb 2009, 4:53 PM
#21
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

uninstall SQL patch that's messed up my site

I tried to install the mod once more and it's stopped messing up my layout. However, instead of doing what it's supposed to be doing, I just get this message:

if ($products_attributes->fields['total'] > 1) { $products_id=(preg_match("/^\d{1,10}({\d{1,10}}\d{1,10})$/",$_GET['products_id']) ? $GET['products_id'] : (int)$GET['products_id']); require(DIR_WS_CLASSES . 'pad' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI . '.php'); $class = 'pad' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI; $pad = new $class($products_id); echo $pad->draw(); } elseif ($products_attributes->fields['total'] > 0) { $products_id=(preg_match("/^\d{1,10}({\d{1,10}}\d{1,10})$/",$_GET['products_id']) ? $GET['products_id'] : (int)$GET['products_id']); require(DIR_WS_CLASSES . 'pad' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE . '.php'); $class = 'pad' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE; $pad = new $class($products_id); echo $pad->draw(); } ?>

Don't suppose you have any idea why I'm getting this message as opposed to the dynamic drop down for stock by attributes?

I merged my two tpl_modules_attributes.php using WinMerge this time, however I get the same error, even if I use the tpl_modules_attributes.php that shipped with the MOD. Only thing that takes this error code away is reinstating my original tpl_modules_attributes.php

Is there perhaps something wrong with the install.sql?

Any help greatly appreciated.

6 Feb 2009, 5:05 PM
#22
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: uninstall SQL patch that's messed up my site

looks like you're missing a ```

<?php ``` opening tag or have added a php closing tag before that if statement. In the file that is included with the mod, there is an sql query just before that section of code - check that you haven't inadvertently added a php closing tag after it.

Neville
An assumption is what you arrive at when you get tired of thinking...

6 Feb 2009, 5:11 PM
#23
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

Hi Again,

I'm nearly there with this, if you can spare me another few minutes then I bet you can solve it.

When I use the PREMOD tpl_modules_attributes the layout is fine, but obviously the mod doesn't work.

When I use the MOD version of tpl_modules_attributes then the mod wirks, but it messup up my layout.

When I use the MERGED tpl_modules_attributes it gives me the error code I pasted earlier but the layout is ok.

It's obviously a case of poor merging :-)

If I pasted the two files here could you look at them and maybe advise as to how I could merge?? I'd buy you another drink :-)

6 Feb 2009, 5:17 PM
#24
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

ORIGINAL (PREMOD)

<?php /** * Module Template * * Template used to render attribute display/input fields * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $ */ ?> <div id="productAttributes"> <?php if ($zv_display_select_option > 0) { ?> <h3 id="attribsOptionsText"><?php echo TEXT_PRODUCT_OPTIONS; ?></h3> <?php } // show please select unless all are readonly ?> <?php for($i=0;$i<sizeof($options_name);$i++) { ?> <?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') { ?> <h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3> <?php } ?> <div class="wrapperAttribsOptions"> <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4> <div class="back"><?php echo "\n" . $options_menu[$i]; ?></div> <br class="clearBoth" /> </div> <?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?>
<div class="ProductInfoComments"><?php echo $options_comment[$i]; ?></div>
<?php } ?> <?php if ($options_attributes_image[$i] != '') { ?> <?php echo $options_attributes_image[$i]; ?> <?php } ?> <br class="clearBoth" /> <?php } ?> <?php if ($show_onetime_charges_description == 'true') { ?>
<div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div>
<?php } ?> <?php if ($show_attributes_qty_prices_description == 'true') { ?>
<div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . ' ' . '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div>
<?php } ?> </div>

MOD VERSION SHIPPED WITH THE MOD FILES

<?php /** * Module Template * * Template used to render attribute display/input fields * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $ */ ?> <div id="productAttributes"> <?php if ($zv_display_select_option > 0) { ?> <?php $products_attributes = $db->Execute("select count(distinct products_options_id) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = ". (int)$_SESSION['languages_id'] ."");
 if ($products_attributes->fields['total'] > 1)  {

  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); 
 require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI . '.php');
  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI;

 $pad = new $class($products_id);
 
 echo $pad->draw();

}
elseif ($products_attributes->fields['total'] > 0) {

  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); 
 require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE . '.php');
  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE;

 $pad = new $class($products_id);
 
 echo $pad->draw();

}

?>

<?php if ($options_attributes_image[$i] != '') { ?> <?php echo $options_attributes_image[$i]; ?> <?php } ?> <br class="clearBoth" /> <?php } ?> <?php if ($show_onetime_charges_description == 'true') { ?>
<div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div>
<?php } ?> <?php if ($show_attributes_qty_prices_description == 'true') { ?>
<div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . ' ' . '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div>
<?php } ?> </div>

MY ATTEMPTED MERGE

<?php /** * Module Template * * Template used to render attribute display/input fields * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $ */ ?> <div id="productAttributes"> <?php if ($zv_display_select_option > 0) { ?> <h3 id="attribsOptionsText"><?php echo TEXT_PRODUCT_OPTIONS; ?></h3> <?php } // show please select unless all are readonly ?> <?php for($i=0;$i<sizeof($options_name);$i++) { ?> <?php $products_attributes = $db->Execute("select count(distinct products_options_id) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = ". (int)$_SESSION['languages_id'] .""); if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') { ?> <h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3> <?php } ?> <div class="wrapperAttribsOptions"> <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4> <div class="back"><?php echo "\n" . $options_menu[$i]; ?></div> <br class="clearBoth" /> </div> <?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?>
<div class="ProductInfoComments"><?php echo $options_comment[$i]; ?></div>
<?php } ?>
 if ($products_attributes->fields['total'] > 1)  {

  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); 
 require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI . '.php');
  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI;

 $pad = new $class($products_id);
 
 echo $pad->draw();

}
elseif ($products_attributes->fields['total'] > 0) {

  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); 
 require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE . '.php');
  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE;

 $pad = new $class($products_id);
 
 echo $pad->draw();

}

?>

<?php if ($options_attributes_image[$i] != '') { ?> <?php echo $options_attributes_image[$i]; ?> <?php } ?> <br class="clearBoth" /> <?php } ?> <?php if ($show_onetime_charges_description == 'true') { ?>
<div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div>
<?php } ?> <?php if ($show_attributes_qty_prices_description == 'true') { ?>
<div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . ' ' . '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div>
<?php } ?> </div>
6 Feb 2009, 5:27 PM
#25
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: uninstall SQL patch that's messed up my site

Yep - you're missing a php opening tag.
Add ```

<?php ``` just before this line in your merged file ``` if ($products_attributes->fields['total'] > 1) { ```

Neville
An assumption is what you arrive at when you get tired of thinking...

6 Feb 2009, 5:38 PM
#26
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

Tired that, but it's done something else now.....

http://www.dystynction.com/index.php?main_page=product_info&cPath=1_4&products_id=6

It's taken the main pic and title out of the tabbed product area and it's kept both size drop downs... not done that before. Here's the new merged file, did I do it right?

<?php /** * Module Template * * Template used to render attribute display/input fields * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $ */ ?> <div id="productAttributes"> <?php if ($zv_display_select_option > 0) { ?> <h3 id="attribsOptionsText"><?php echo TEXT_PRODUCT_OPTIONS; ?></h3> <?php } // show please select unless all are readonly ?> <?php for($i=0;$i<sizeof($options_name);$i++) { ?> <?php $products_attributes = $db->Execute("select count(distinct products_options_id) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = ". (int)$_SESSION['languages_id'] .""); if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') { ?> <h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3> <?php } ?> <div class="wrapperAttribsOptions"> <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4> <div class="back"><?php echo "\n" . $options_menu[$i]; ?></div> <br class="clearBoth" /> </div> <?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?> <div class="ProductInfoComments"><?php echo $options_comment[$i]; ?></div> <?php } ?> <?php if ($products_attributes->fields['total'] > 1) { $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI . '.php'); $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI; $pad = new $class($products_id); echo $pad->draw(); } elseif ($products_attributes->fields['total'] > 0) { $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE . '.php'); $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE; $pad = new $class($products_id); echo $pad->draw(); } ?> <?php if ($options_attributes_image[$i] != '') { ?> <?php echo $options_attributes_image[$i]; ?> <?php } ?> <br class="clearBoth" /> <?php } ?> <?php if ($show_onetime_charges_description == 'true') { ?> <div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div> <?php } ?> <?php if ($show_attributes_qty_prices_description == 'true') { ?> <div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . ' ' . '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div> <?php } ?> </div>
6 Feb 2009, 6:03 PM
#27
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

I think my merge attempt is making it worse than the original file shipped with the mod.

the original file does not cause duplicate drop downs for the size.

both the merged version and the shipped version do take the main pic out of the tabbed products and both make the additional images disappear.

Do you think it could be something as simple as loose div tags?

6 Feb 2009, 6:16 PM
#28
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

Is it possible that this MOD file version is somehow conflicting with the info in the tpl_product_info_display.php file which I used to control the layout?

Why else would it make the additional images disappear?

6 Feb 2009, 6:25 PM
#29
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

OK, I've figured out that this mod is quite simply not compatible with TABBED_PRODUCT_PRO mod. I disable tabbed products and this drop down mod is working a treat.

Decisions, decisions... use tabbed products, or have a dynamic drop down size menu that marks out of stock sizes as such?!?!?

It's one or the other!

If I could get the drop down and the add to cart to move to the right of the description text then I'd gladly ditch the tabbed products, but I can't I spend nearly three days trying :-)

20 Dec 2010, 11:52 PM
#30
sohailarif avatar

sohailarif

New Zenner

Join Date:
Dec 2010
Posts:
10
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

could you please help me with uninstalling sql

CREATE TABLE customers_additional (
field_id int(11) NOT NULL auto_increment,
field_name varchar(255) NOT NULL default '',
field_status char(2) NOT NULL default '',
PRIMARY KEY (field_id)
) ENGINE=MyISAM;

after this patch i have started getting error below

1054 Unknown column 'field_required' in 'field list'
in:
[ SELECT field_id, field_name, field_required, field_status, use_url, field_url FROM customers_additional WHERE field_status = 1 ]