Jump to content
Latest News: (loading..)
surfalot

[Contribution] More_pics_6 v1.1 For osC 2.2 MS2

Recommended Posts

Here's a quick fix. Replace this code (Lines 151-161 of popup_image.php)

	if ($previous_image_id != -1 || $next_image_id != -1) {
  echo '<hr color="#666" size="3">';
}

if ($previous_image_id != -1){
  echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $previous_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'left.gif', 'previous', '', '', 'border="0"') . '</a>';
}

if ($next_image_id != -1){
  echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $next_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'right.gif', 'next', '', '', 'border="0"') . '</a>';
}

with this code:

  if ($num_products_images > 1) {
if ($previous_image_id != -1 || $next_image_id != -1) {
  echo '<hr color="#666" size="3">';
}

if ($previous_image_id != -1){
  echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $previous_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'left.gif', 'previous', '', '', 'border="0"') . '</a>';
}

if ($next_image_id != -1){
  echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $next_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'right.gif', 'next', '', '', 'border="0"') . '</a>';
}
 } // if ($num_products_images

That should take care of the case where there's only one image. I need to look at this some more, just in case there are other odd exceptions lurking in the code.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
Here's a quick fix. Replace this code (Lines 151-161 of popup_image.php)

	if ($previous_image_id != -1 || $next_image_id != -1) {
  echo '<hr color="#666" size="3">';
}

if ($previous_image_id != -1){
  echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $previous_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'left.gif', 'previous', '', '', 'border="0"') . '</a>';
}

if ($next_image_id != -1){
  echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $next_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'right.gif', 'next', '', '', 'border="0"') . '</a>';
}

with this code:

  if ($num_products_images > 1) {
if ($previous_image_id != -1 || $next_image_id != -1) {
  echo '<hr color="#666" size="3">';
}

if ($previous_image_id != -1){
  echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $previous_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'left.gif', 'previous', '', '', 'border="0"') . '</a>';
}

if ($next_image_id != -1){
  echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $next_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'right.gif', 'next', '', '', 'border="0"') . '</a>';
}
 } // if ($num_products_images

That should take care of the case where there's only one image. I need to look at this some more, just in case there are other odd exceptions lurking in the code.

 

Regards

Jim

 

 

Brilliant!!!! It worked like a charm. Thanks.

Share this post


Link to post
Share on other sites

I'm getting this error in the ADMIN section.

 

1054 - Unknown column 'p.image_filename' in 'field list'

 

select p.products_id, pd.products_name, p.products_quantity, p.image_filename, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p left join products_images pi on p.products_id = pi.products_id, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' and pi.product_page = '1' order by pd.products_name

 

[TEP STOP]

 

No clue on what to do?

Share this post


Link to post
Share on other sites

Hi, you say it is a typo but where is the typo located...what file?

 

I read the forum and I could not determine the page that this typo is a part of.

 

I am also getting the same error.

 

Thank you

 

 

As Kymation mentioned here: http://forums.oscommerce.com/index.php?sho...t&p=1351670

 

Its a typo, Change p.image_filename to pi.image_filename and you will hopefully have it working.

Share this post


Link to post
Share on other sites

This is getting really frustrating. Stop and think, people, this is not rocket science. Really.

 

The page that you are seeing the error on is the one you need to correct. Any decent editor will do a search through a file to find the code. If you can't figure out which file to modify, do a search through all of them. You operating system has a search function. Use it. If you have a decent editor, that will search multiple files as well. Use that.

 

And, if all else fails, READ THE FREAKIN' INSTRUCTIONS!!!!!

 

I think I need to go lie down now....

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I found the page that it belonged to - after about 1 hour of searching..

 

I did read the instructions ...i even blew away all my code and replaced it with all of contributions..

 

I used "Beyond Compare" to review all the files and the code is 100% the same... Minus some color changes on my stylesheet...

 

I replaced the p.image_filename with pi.image_filename - it was located in the admin/categories.php page 2 times...

 

After replacing it - I now get the error...

 

1054 - Unknown column 'pi.products_image' in 'field list'

select pi.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id left join products_images pi on p.products_id = pi.products_id, products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '25' and pi.product_page = '1' order by pd.products_name limit 0, 20

[TEP STOP]

 

This appears on the main shopping pages as well as in the admin area..

 

I respect that the author is getting frustrated so I am wondering does anyone else have a clue how to resolve this issue?

 

Thank you for your time..

Share this post


Link to post
Share on other sites

pi.products_image should be pi.image_filename. Another typo. Thanks for spotting that one. I found it in catalog/index.php -- after about 30 seconds of searching. If it seriously takes you an hour to find something like that, get a better editor. Eclipse is free and open source. It has a great search feature. Two of them, actually, but you want the global search for something like this.

 

Other editors have a global search feature as well, so if you don't like Eclipse then go find one that you like. You'll do a lot better work with a lot less frustration if you have good tools. Not that frustration never happens (What do you mean "Unknown error at Line 0"? Stupid PHP.)

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thank you - that fixed that error -

 

This leaves just an ongoing error that I was holding off on...

 

When you are in the admin area and select catalog and product images...

 

Each image provides you with these choices...

 

Share this post


Link to post
Share on other sites

Thank you - that fixed that error -

 

This leaves just an ongoing error that I was holding off on...

 

When you are in the admin area and select catalog and product images...

 

Each image provides you with these choices...

 

Use on Category page

false

 

Use on Product Info page

false

 

Use in Popup

false

 

The issue is that when you change one image that is assigned to a certain product it "turns off" all the other images assigned to that product.

 

Also, the Categories images do not appear at all...

 

http://fesup-usa.com/shopping/index.php?cPath=21

 

Even though they are selected in the product images -

Share this post


Link to post
Share on other sites

No, that is correct behavior. All of those flags refer to the images as they would appear in stock osCommerce. Since each of those is a single image, only one image can be selected at a time for each flag. Anything that is not flagged is an additional image that will appear in the Popup or the CSS box, depending on your settings. You can also make the flagged images show up in the popup or the CSS box along with the additional images as well -- there are Admin settings for that. See Admin > Configuration > More Pics > Group Category image with sub-images, Group Products image with sub-images, and Group Popup image with sub-images.

 

Your categories images are showing just fine here. Remember that these are the images of products, not the subcategory icons that you are missing.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thank you for the clarification...

 

The only thing is the category images...

 

http://www.fesup-usa.com/shopping/

 

Click on MENS...

 

That is where they do not appear...

 

You will also see on the same page that the "What's New" image does not appear on the left side of the page...

 

It is also true about the images of each of the major headings of the pages -

 

According to the source that I can view on the page the image call is blank??

 

<td class="pageHeading" align="right"><img src="images/" alt="Mens" title=" Mens " width="57" border="0" height="40"></td>

Edited by bcsweb1

Share this post


Link to post
Share on other sites

English is not my language.

Nevertheless hope that I understood expressions.

 

Have More pics 2.0.3 installed.

There have a problem with the sub-images.

If I really believe you can in the admin with the recruitment of Number of columns and Number of rows to display images of the sub-set.

Is that so?

But I had 37 sub-images in a column.

Need more columns and rows.

see Picture

 

Where can be the problem?

Or are the settings not for the sub-images?

Where can I change the script then, to get multiple rows and columns to produce?

 

 

Thanks for help.

Joby

Share this post


Link to post
Share on other sites
Thank you for the clarification...

 

The only thing is the category images...

 

http://www.fesup-usa.com/shopping/

 

Click on MENS...

 

That is where they do not appear...

Again, that is a category image. They are NOT part of More Pics and are NOT affected by More Pics. You set those by editing your category in the admin.

 

You will also see on the same page that the "What's New" image does not appear on the left side of the page...

That's a bug. The catalog/includes/boxes/whats_new.php was left out of the distribution. For now, replace Line 13 of that file with the following:

  if ($random_product = tep_random_select("select p.products_id, pi.image_filename, p.products_tax_class_id, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id where p.products_status = '1' and pi.product_page = '1' order by p.products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {

and Line 36 with this:

								 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['image_filename'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price);

It is also true about the images of each of the major headings of the pages -

 

According to the source that I can view on the page the image call is blank??

 

<td class="pageHeading" align="right"><img src="images/" alt="Mens" title=" Mens " width="57" border="0" height="40"></td>

Those are also category images. See above.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
<snipped>Need more columns and rows.

see Picture

 

Where can be the problem?

Or are the settings not for the sub-images?

Where can I change the script then, to get multiple rows and columns to produce?

 

 

Thanks for help.

Joby

That is the CSS box. All of the small images are in a single column or a single row. The Column and Row settings have no effect. If you want your images in a grid (columns and rows) change your Admin > Configuration > More Pics > Use CSS Format to false. You can then set the number of rows and columns that you want to see.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hello Jim

 

Thanks for the quick reply.

 

That is the CSS box. All of the small images are in a single column or a single row. The Column and Row settings have no effect. If you want your images in a grid (columns and rows) change your Admin > Configuration > More Pics > Use CSS Format to false. You can then set the number of rows and columns that you want to see.

 

Regards

Jim

 

have changed CSS Format to false

But this is not good for the Users. Too confusing.

Too many large pictures.

And I get in the popup window following error:

 

1054 - Unknown column 'category_page' in 'where clause'

select products_name from products_description where products_id = '68' and category_page = '0' and product_page = '0' and language_id = '2'

[TEP STOP]

 

Where can I find the script lines, which creates the single column or a single row for the small images.

It would be conceivable an IF statement or similar to integrate, what after (x) images, a new colum or row begins.

(a nice look would also around the big picture :rolleyes: :blush: )

 

Regards

Joby

Share this post


Link to post
Share on other sites

The category_page error is a bug. See this post for the fix.

 

The code that displays the images is in catalog/includes/modules/more_pics.php. This is fairly complex, since it has to handle several different display modes. The part that you want is Lines 95-192.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I've added a new release with all of the bug fixes above. Enjoy.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
The category_page error is a bug. See this post for the fix.

 

The code that displays the images is in catalog/includes/modules/more_pics.php. This is fairly complex, since it has to handle several different display modes. The part that you want is Lines 95-192.

 

Regards

Jim

 

Thanks Jim

 

So now I must learn a little PHP.

How to get involved there for i = 1 to 8 or something similar. :rolleyes:

 

Think it takes a few weeks now. :lol:

 

Regards

Joby

Share this post


Link to post
Share on other sites

Hello,

 

first of all, thanks for this contribution, it's working great. Almost great :rolleyes: cause the specials don't show the image

 

On the homepage the box new articles shows the image correct but when I click on more new articles the productsnew.php opens without the images.

Also the images for the specials (box and page special.php) are not working.

 

Cause English is not my language I give you the link so you can see the problem:

 

http://www.kinderkledingmerkjes.nl/index.php

(yes the design is standard, first I want to get the contributions working ;) )

 

Thanks,

 

Lieke

Share this post


Link to post
Share on other sites

Hi, I recently uploaded the newest incarnation of this contribution (Jan 4), and now my products do not show in either admin or on the front end. In admin it says under catalog the number of products I have, but when I click through the categories they do not show. My url is www.firststopsecurity.com/store. I'm unsure if this issue could be database related, as per the readme, but I figured I'd ask the dumb question anyway. Any help would be greatly appreciated.

 

Thanks

Share this post


Link to post
Share on other sites
Hello,

 

first of all, thanks for this contribution, it's working great. Almost great :rolleyes: cause the specials don't show the image

 

On the homepage the box new articles shows the image correct but when I click on more new articles the productsnew.php opens without the images.

That's a bug. In catalog/products_new.php, change Line 58 to:

  $products_new_query_raw = "select p.products_id, pd.products_name, pi.image_filename, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id) left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and pi.product_page = '1' order by p.products_date_added DESC, pd.products_name";

Also the images for the specials (box and page special.php) are not working.

<snipped>

Lieke

More bugs. Change catalog/includes/boxes/specials.php, Line 13 to:

  if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, pi.image_filename, s.specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and pi.product_page = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {

and Line 25 to:

								 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['image_filename'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>');

Catalog/specials.php was modified but seems to have been left out of the distributions. So change Line 54 to:

  $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, pi.image_filename, s.specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and pi.product_page = '1' order by s.specials_date_added DESC";

and Line 82 to:

	  echo '			<td align="center" width="33%" class="smallText"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['image_filename'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . $specials['products_name'] . '</a><br><s>' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($specials['specials_new_products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span></td>' . "\n";

 

Thanks for reporting these bugs.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
Hi, I recently uploaded the newest incarnation of this contribution (Jan 4), and now my products do not show in either admin or on the front end. In admin it says under catalog the number of products I have, but when I click through the categories they do not show. My url is www.firststopsecurity.com/store. I'm unsure if this issue could be database related, as per the readme, but I figured I'd ask the dumb question anyway. Any help would be greatly appreciated.

 

Thanks

This could happen if you don't have any images installed. Did you try adding images to your products? If you had images before installing this Contribution, did you run install.php? Are you using a template?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Jim, thank you so much. I ran Install.php and deleted as per the instructions and it worked. Great contribution and great support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×