Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] More_pics_6 v1.1 For osC 2.2 MS2


surfalot

Recommended Posts

  • Replies 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

i have a message when i try to run the install script

 

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/content/d/w/a/name****/html/store/mp_autoinstaller/autoinstaller.php on line 9

 

 

 

does anybody know what i am missing?

 

 

thanks

 

found out that the error coule be fixed by changing the php version from 4 to 5 but now i hava another error message

 

Cannot open file 'stylesheet.css' for writing. Check if the file exists or try to change file permissions and click the "Retry" button.

 

i copied the stylesheet.css from the main rolup dir to the main dir of the install..... is that the css that is needed?

 

did somebody run into the same issue??

Link to comment
Share on other sites

Take another look at catalog/includes/modules/new_products.php

 

Regards

Jim

 

More Pics was the first contribution I used, so I just dropped all the files in. Here is what I have:

 

<?php

/*

$Id: new_products.php 1806 2008-01-11 22:48:15Z hpdl $

$Loc: catalog/includes/modules/ $

$Mod: 20081228 More Pics 2.0.3 kymation $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 osCommerce

 

Released under the GNU General Public License

*/

?>

<!-- new_products //-->

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 

new infoBoxHeading($info_box_contents, false, false);

 

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

// More Pics

$new_products_query = tep_db_query("select p.products_id, pi.image_filename, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1', " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

} else {

// More Pics

$new_products_query = tep_db_query("select distinct p.products_id, pi.image_filename, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1', " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

 

$row = 0;

$col = 0;

$info_box_contents = array();

while ($new_products = tep_db_fetch_array($new_products_query)) {

// More Pics

$info_box_contents[$row][$col] = array('align' => 'center',

'params' => 'class="smallText" width="33%" valign="top"',

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

 

$col ++;

if ($col > 2) {

$col = 0;

$row ++;

}

}

 

new contentBox($info_box_contents);

?>

<!-- new_products_eof //-->

 

Is there somethng wrong in there?

Link to comment
Share on other sites

Sorry, what do you mean? Do you mean a broken image?

 

I just figured out what you mean. When I list a product I have about 7-10 images. The first image I upload and tick the category, product and pop-up flag. The rest I leave off.

Link to comment
Share on other sites

It's not just missing images; the whole contents of the New Products box is missing. There is probably an error in the first product that is causing it to stop loading.

 

First, remove the illegal characters from your image names. I'm seeing a lot of images on that site with spaces in the filename. There could be other errors as well. Try again once you get the filenames scrubbed.

 

Regards

Jim

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

Link to comment
Share on other sites

It's not just missing images; the whole contents of the New Products box is missing. There is probably an error in the first product that is causing it to stop loading.

 

First, remove the illegal characters from your image names. I'm seeing a lot of images on that site with spaces in the filename. There could be other errors as well. Try again once you get the filenames scrubbed.

 

Regards

Jim

 

What illegal characters? All the images of products have spaces between each word. I just tried renaming one but nothing change where I need it to.

 

What do you mean by an error in the first product?

Link to comment
Share on other sites

Space is not a legal character in any URL. Legal characters are letters, numbers, dash, underscore, and period. There should only be one period as well. Anything else and you're asking for trouble.

 

The New Products box is halting on an error. I don't have access to your error logs, so I can't tell what the error is. You might be able to find out by changing this line in catalog/includes/application_top:

  error_reporting(E_ALL & ~E_NOTICE);

to this:

  error_reporting(E_ALL);

Then view that category page again. You should see a warning or error notice where the New Products box should be. There may be more than one error. Copy and paste those messages here.

 

Regards

Jim

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

Link to comment
Share on other sites

Space is not a legal character in any URL. Legal characters are letters, numbers, dash, underscore, and period. There should only be one period as well. Anything else and you're asking for trouble.

 

The New Products box is halting on an error. I don't have access to your error logs, so I can't tell what the error is. You might be able to find out by changing this line in catalog/includes/application_top:

  error_reporting(E_ALL & ~E_NOTICE);

to this:

  error_reporting(E_ALL);

Then view that category page again. You should see a warning or error notice where the New Products box should be. There may be more than one error. Copy and paste those messages here.

 

Regards

Jim

 

 

Jebus! There are things all over the place now. This is what shows up where you said:

 

Notice: Undefined variable: NAME in fashionstation.co.uk/includes/modules/header_tags_social_bookmarks.php on line 28

 

Its' also on line 31 and a few others where the social bookmarks are.

Link to comment
Share on other sites

The errors you show are in /includes/modules/header_tags_social_bookmarks.php. That's your Social Bookmarks addon. You need to fix those, but they are not what's wrong with the New Products box. The error(s) that you want will be above the ones shown. You may need to click View -> Source in your browser and look at the source to find them.

 

The rest of those errors should probably be fixed as well. They aren't critical, but they will slow down the page generation.

 

Regards

Jim

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

Link to comment
Share on other sites

The errors you show are in /includes/modules/header_tags_social_bookmarks.php. That's your Social Bookmarks addon. You need to fix those, but they are not what's wrong with the New Products box. The error(s) that you want will be above the ones shown. You may need to click View -> Source in your browser and look at the source to find them.

 

The rest of those errors should probably be fixed as well. They aren't critical, but they will slow down the page generation.

 

Regards

Jim

 

This is what is above it:

 

Notice: Undefined index: osCsid in www./includes/modules/header_tags_social_bookmarks.php on line 17

 

Notice: Undefined variable: page in www./includes/modules/header_tags_social_bookmarks.php on line 22

Edited by Whiskers
Link to comment
Share on other sites

Okay, I have a couple questions.

 

1) Is there anyway to get the images into sub-directories the way that stock osCommerce comes? If you could give me a hint to where to look so that this can be implemented I would be most grateful.

 

2) Can you verify that my "/categories.php" display is correct on the admin side?

 

I'm not allowed to see any images in /categories.php. Instead I get "IMAGE DOES NOT EXIST", as shown below.

more_pics.png

 

My pictures display correctly as far as I can tell, but I am not able to see the pictures in my categories.php file on the admin side.

 

Thank you for such a wonderful contribution.

 

Naloomi

Link to comment
Share on other sites

1) Stock osCommerce actually has no way to do this. The demo site cannot be duplicated without an addon. there is at least one addon that puts the images into subdirectories, but it hasn't been adapted to work with More Pics. I may add this some day, but don't hold your breath.

 

2) That's a bug. In catalog/admin/categories.php, find line 848ff:

// Start More Pics
     $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, pi.image_filename, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.product_page = '1', " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
   } else {
     $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, pi.image_filename, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.product_page = '1', " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
// End More pics

and replace it with:

// Start More Pics
     $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, pi.image_filename, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1', " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
   } else {
     $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, pi.image_filename, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1', " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
// End More pics

 

Then find line 1037:

            $contents[] = array('text' => '<br>' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $pInfo->products_image);

and replace it with

            $contents[] = array('text' => '<br>' . tep_info_image($pInfo->image_filename, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $pInfo->image_filename);

Thanks for the bug report. I'll add the fix to the next release.

 

Regards

Jim

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

Link to comment
Share on other sites

Thank you. Your fix is working beautifully.

 

I'll look at a couple of the subdirectory changes and see if I can get them to work with your wonderful contribution.

 

I'll let you know if I have any luck.

 

First one I'm going to look at is http://addons.oscommerce.com/info/3873/v,22

It says it can work with yours, but the image directory is showing the 6 image upload, whereas I'm using the advanced version of More Pics and so I am unsure if it would work (not to mention your latest change is after their latest change).

 

Naloomi

Link to comment
Share on other sites

It shouldn't be that hard to add a directory addon to More Pics Advanced. It's mostly a matter of getting the changes into the right places. They will be making changes to admin/categories.php, while most of the changes will now need to be made to admin/images.php.

 

Please let me know how you do with this. Others may also be interested in your work.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...