[Contribution] More_pics_6 v1.1 For osC 2.2 MS2
#1
Posted 29 November 2005 - 06:00 AM
More Pics 6 allows you to add up to 6 additional pics to each product. The pics
can be different sizes and different types (jpg,gif,png,...). The image pop-up
will display forward and next buttons so the customer can page through each
larger image without needing to go back to the main product page. You will have
the ability to configure the number of rows and columns to display the products
in on the main products info page. If more images are defined then columns and
rows are defined the remaining images can be viewed in the pop-up. You will also
be able to configure whether the images show above the description, below the
description or on either side of the description.
Many thanks to all that have contributed to this contrib. All are credited.
Get it here:
http://www.oscommerce.com/community/contributions,1611
#2
Posted 02 December 2005 - 09:50 AM
I want to install it, but I can't, because I am with oscommerce template. In your readme file you say "use file compare program to see the difference", but in my case when I compare, for example, product_info.php all is completely different.
Do you have list with all additional code which I have to add to my already modified code?
#3
Posted 02 December 2005 - 06:03 PM
I marked the changes with "BOF: More Pics 6" and "EOF: More Pics". there are only 4 changes. All the line numbers are referencing the contrib's product_info.php.
1) lines 72-74: is simply adding
p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6,to the line original line 72 that starts (placed after p.products_image,) :
$product_info_query = tep_db_query("select p.products_id...
2) Lines 90-133 are all new. Placed just before the end php code tag ( ?> ) that comes after the change above.
3) line 149: In the product_info.php of the contrib package I have commented out the original image code using /* */ so it can remain for reference. I'm thinking of adding a switch to easily turn on and off the contrib completely which will use the code, so don't remove it, just comment it out like in line 149 of product_info.php in the contrib. This is the original code
<?php
if (tep_not_null($product_info['products_image'])) {
?>
<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>
<?php
}
Replace with <?php /* BOF: More Pics 6
if (tep_not_null($product_info['products_image'])) {
?>
<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>
<?php
} */
if (MOPICS_TABLE_LOCATION=='above') {
echo ' <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="smallText">'.$mopics_output.'</td>
</tr>
</table>
<br>'."\n";
} else if (MOPICS_TABLE_LOCATION=='sides') {
echo $mopics_output;
}
// EOF: More Pics 6
?>
4) Add the code in Lines 216 to 225, all new.
Hope that helps.
#4
Posted 02 December 2005 - 07:37 PM
#5
Posted 06 December 2005 - 10:10 PM
#6
Posted 06 December 2005 - 10:51 PM
dainbramaged05, on Dec 6 2005, 05:10 PM, said:
#7
Posted 07 December 2005 - 01:50 AM
If that is all that is going wrong, I would suggest that maybe the block code in lines 230-285 in /admin/categories.php of the package didn't get in your production file. If the code worked to setup and upload the image, then you have have the right permissions on the folder (should be: 666).
#8
Posted 07 December 2005 - 06:43 AM
#9
Posted 07 December 2005 - 07:00 AM
#10
Posted 07 December 2005 - 07:36 PM
// BOF: More Pics 6
if (isset($HTTP_POST_VARS['products_subimage1']) && tep_not_null($HTTP_POST_VARS['products_subimage1']) && ($HTTP_POST_VARS['products_subimage1'] != 'none')) {
$sql_data_array['products_subimage1'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage1']);
}
//add delete image function
if ($HTTP_POST_VARS['delete_image_3'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS[products_subimage1]);
$sql_data_array['products_subimage1'] = tep_db_prepare_input($HTTP_POST_VARS['none']);
}
//end delete image function
if (isset($HTTP_POST_VARS['products_subimage2']) && tep_not_null($HTTP_POST_VARS['products_subimage2']) && ($HTTP_POST_VARS['products_subimage1'] != 'none')) {
$sql_data_array['products_subimage2'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage2']);
}
//add delete image function
if ($HTTP_POST_VARS['delete_image_5'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS[products_subimage2]);
$sql_data_array['products_subimage2'] = tep_db_prepare_input($HTTP_POST_VARS['none']);
}
//end delete image function
if (isset($HTTP_POST_VARS['products_subimage3']) && tep_not_null($HTTP_POST_VARS['products_subimage3']) && ($HTTP_POST_VARS['products_subimage3'] != 'none')) {
$sql_data_array['products_subimage3'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage3']);
}
//add delete image function
if ($HTTP_POST_VARS['delete_image_7'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS[products_subimage3]);
$sql_data_array['products_subimage3'] = tep_db_prepare_input($HTTP_POST_VARS['none']);
}
//end delete image function
if (isset($HTTP_POST_VARS['products_subimage4']) && tep_not_null($HTTP_POST_VARS['products_subimage4']) && ($HTTP_POST_VARS['products_subimage4'] != 'none')) {
$sql_data_array['products_subimage4'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage4']);
}
//add delete image function
if ($HTTP_POST_VARS['delete_image_9'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS[products_subimage4]);
$sql_data_array['products_subimage4'] = tep_db_prepare_input($HTTP_POST_VARS['none']);
}
//end delete image function
if (isset($HTTP_POST_VARS['products_subimage5']) && tep_not_null($HTTP_POST_VARS['products_subimage5']) && ($HTTP_POST_VARS['products_subimage5'] != 'none')) {
$sql_data_array['products_subimage5'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage5']);
}
//add delete image function
if ($HTTP_POST_VARS['delete_image_11'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS[products_subimage5]);
$sql_data_array['products_subimage5'] = tep_db_prepare_input($HTTP_POST_VARS['none']);
}
//end delete image function
if (isset($HTTP_POST_VARS['products_subimage6']) && tep_not_null($HTTP_POST_VARS['products_subimage6']) && ($HTTP_POST_VARS['products_subimage6'] != 'none')) {
$sql_data_array['products_subimage6'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage6']);
}
//add delete image function
if ($HTTP_POST_VARS['delete_image_13'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS[products_subimage6]);
$sql_data_array['products_subimage6'] = tep_db_prepare_input($HTTP_POST_VARS['none']);
}
//end delete image function
// EOF: More Pics 6
This code? When I change the permissions on the images folder, none of the images show up, just a red x.
Edited by dainbramaged05, 07 December 2005 - 07:38 PM.
#11
Posted 07 December 2005 - 07:59 PM
#12
Posted 07 December 2005 - 08:06 PM
change the permissions to the images folder back to 755 or whatever it was (should have been 755). that wasn't the problem.
Edited by surfalot, 07 December 2005 - 08:07 PM.
#13
Posted 10 December 2005 - 12:52 AM
Can anyone please give me some simple instructions?
Using MyPHPAdmin, I got to the 'configuration' part, click on insert and that's where I get lost. The instructions don't help much.
Thanks
#14
Posted 10 December 2005 - 02:01 AM
#15
Posted 14 December 2005 - 02:30 AM
SQL query:
INSERT INTO configuration_group( configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible )
VALUES ( 6124, 'More Pics', 'Configuration Options for More Pics', 20, 1 )
MySQL said:
Little help please? I've tried pasting into the query box, and selecting a text file, same result both ways. MySQL5, phpmyadmin 2.6.4, php4.
#16
Posted 14 December 2005 - 03:48 AM
INSERT INTO `configuration_group` (`configuration_group_id`, `configuration_group_title`, `configuration_group_description`, `sort_order`, `visible`) VALUES (6124, 'More Pics', 'Configuration Options for More Pics', 20, 1);
#17
Posted 14 December 2005 - 05:58 AM
SQL query: INSERT INTO `configuration_group` ( `configuration_group_id` , `configuration_group_title` , `configuration_group_description` , `sort_order` , `visible` ) VALUES ( 6124, 'More Pics', 'Configuration Options for More Pics', 20, 1 ) MySQL said: #1062 - Duplicate entry '6124' for key 1I don't recall ever having been successful, so I'm not sure why I would be seing a duplicate entry.
So I tried skipping that one, moved onto the following ones, same thing
SQL query:
INSERT INTO `configuration`
VALUES (
'', 'Show All MorePics on Product Info page', 'MOPICS_SHOW_ALL_ON_PRODUCT_INFO', 'true', 'Show All extra images from the MorePics contrib on Product Info page.', 6124, NULL , now( ) , now( ) , NULL , 'tep_cfg_select_option(array(''true'', ''false''),'
)
MySQL said:
I think I got an out of range value error at some point. I'm totally lost here.
Edited by doctorstupid, 14 December 2005 - 05:58 AM.
#18
Posted 14 December 2005 - 06:00 AM
SQL query:
INSERT INTO `configuration`
VALUES (
'', 'Show All MorePics on Product Info page', 'MOPICS_SHOW_ALL_ON_PRODUCT_INFO', 'true', 'Show All extra images from the MorePics contrib on Product Info page.', 6124, NULL , now( ) , now( ) , NULL , 'tep_cfg_select_option(array(''true'', ''false''),'
)
MySQL said:
#1264 - Out of range value adjusted for column 'configuration_id' at row 1
#19
Posted 14 December 2005 - 08:03 AM
INSERT INTO `configuration` ( `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ( 'Show All MorePics on Product Info page', 'MOPICS_SHOW_ALL_ON_PRODUCT_INFO', 'true', 'Show All extra images from the MorePics contrib on Product Info page.', 6124, NULL, now(), now(), NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` ( `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ( 'Use SMALL_IMAGE_ Restrictions', 'MOPICS_RESTRICT_IMAGE_SIZE', 'true', 'Restrict product images to SMALL_IMAGE_WIDTH and SMALL_IMAGE_HEIGHT values.', 6124, NULL, now(), now(), NULL, 'tep_cfg_select_option(array(''true'', ''false''),');
INSERT INTO `configuration` ( `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ( 'Table Alignment', 'MOPICS_TABLE_ALIGNMENT', 'right', 'Align Pics table to the left or to the right of the products description.', 6124, NULL, now(), now(), NULL, 'tep_cfg_select_option(array(''left'', ''right'', ''center''),');
INSERT INTO `configuration` ( `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ( 'Table Location', 'MOPICS_TABLE_LOCATION', 'sides', 'Align Pics table to the sides, above or below description.', 6124, NULL, now(), now(), NULL, 'tep_cfg_select_option(array(''sides'', ''above'', ''below''),');
INSERT INTO `configuration` ( `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ( 'Number of Columns', 'MOPICS_NUMBER_OF_COLS', '1', 'Number of columns to display.', 6124, NULL, now(), now(), NULL, NULL);
INSERT INTO `configuration` ( `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ( 'Number of Rows', 'MOPICS_NUMBER_OF_ROWS', '2', 'Number of rows to display.', 6124, NULL, now(), now(), NULL, NULL);
#20
Posted 14 December 2005 - 09:06 AM









