Jump to content



Latest News: (loading..)

- - - - -

[Contribution] Categories Images Box support thread


  • Please log in to reply
198 replies to this topic

#121   eyal_barouk

eyal_barouk
  • Members
  • 33 posts
  • Real Name:Eyal Barouk
  • Gender:Male
  • Location:Isreal

Posted 17 July 2009 - 02:47 PM

Hi,
I have it installed and running - I love it. very nice!

I'm having trouble using this contribution along with the excellent Header tags SEO module http://addons.oscommerce.com/info/5851/v,22

Mainly (but not sure) in admin/categories.php
After installing both contributions I get the code around line 976:
if (isset($HTTP_GET_VARS['search'])) {
	  $search = tep_db_prepare_input($HTTP_GET_VARS['search']);

/*** Begin Header Tags SEO ***/
/*	  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, cd.categories_htc_title_tag, cd.categories_htc_desc_tag, cd.categories_htc_keywords_tag, cd.categories_htc_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and cd.categories_name like '%" . tep_db_input($search) . "%' order by c.sort_order, cd.categories_name");
	} else {
	  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, cd.categories_htc_title_tag, cd.categories_htc_desc_tag, cd.categories_htc_keywords_tag, cd.categories_htc_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");
 /*** End Header Tags SEO ***/

// Categories images box
	  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, cd.categories_description_front, c.categories_image, c.categories_image_front, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and cd.categories_name like '%" . tep_db_input($search) . "%' order by c.sort_order, cd.categories_name");
	} else {
// Categories images box
	  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, cd.categories_description_front, c.categories_image, c.categories_image_front, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");
	}
In this state I get an error about the "else" command being out of place. I have ended up //unmarking the  Header Tags SEO part in these lines.
Is there a solution for this?
Thanks you,
Eyal
Eyal
How About an Open Source Car?

#122   kymation

kymation

    Believers

  • Community Sponsor
  • 6,698 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 17 July 2009 - 02:59 PM

You can't just duplicate that code and expect it to work. You have to merge the changes in each line into the original code. Take the Contributions one at a time and compare the changes to the original code, then make the changes in your copy.

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#123   eyal_barouk

eyal_barouk
  • Members
  • 33 posts
  • Real Name:Eyal Barouk
  • Gender:Male
  • Location:Isreal

Posted 17 July 2009 - 05:57 PM

View Postkymation, on Jul 17 2009, 03:59 PM, said:

You can't just duplicate that code and expect it to work. You have to merge the changes in each line into the original code. Take the Contributions one at a time and compare the changes to the original code, then make the changes in your copy.

Regards
Jim
Hi Jim, thank you for this quick reply.
I did take it one at a time and I only got stuck in this part.
I found that, on the part I have posted, (Removed?) that each contribution works fine on it's own but not together. I have to admit that I gave up after a short struggle - I didn't want to mess up the code not being sure exactly what it does; plus, I thought maybe some one else got this problem and so maybe an official solution might be posted to the community benefit.
My Problem is not a critical because I don't update the tags from the category section anyway. Just wondered for perfection sake.

Edited by eyal_barouk, 17 July 2009 - 05:59 PM.

Eyal
How About an Open Source Car?

#124   kymation

kymation

    Believers

  • Community Sponsor
  • 6,698 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 17 July 2009 - 06:08 PM

You just need to compare each line to the stock osCommerce and see what is added. Header Tags adds cd.categories_htc_title_tag, cd.categories_htc_desc_tag, cd.categories_htc_keywords_tag, cd.categories_htc_description, so far as I recall. Thee could be more. The Categories Images Box adds c.categories_image_front, to the same SQL. So all you have to do is add both of those strings.

I recommend a good file comparison program (Winmerge, Windiff, Beyond Compare, etc.) to aid in this. It helps a lot to have all of the differences highlighted for you.

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#125   eyal_barouk

eyal_barouk
  • Members
  • 33 posts
  • Real Name:Eyal Barouk
  • Gender:Male
  • Location:Isreal

Posted 17 July 2009 - 09:02 PM

View Postkymation, on Jul 17 2009, 07:08 PM, said:

You just need to compare each line to the stock osCommerce and see what is added. Header Tags adds cd.categories_htc_title_tag, cd.categories_htc_desc_tag, cd.categories_htc_keywords_tag, cd.categories_htc_description, so far as I recall. Thee could be more. The Categories Images Box adds c.categories_image_front, to the same SQL.
Regards
Jim
Got them to work together! It was actually pretty easy once I started reading the code instead of blindly bulk copy/paste it as I did with all the other contributions I have installed.
Thank you so much for your help.
Eyal
How About an Open Source Car?

#126   dudeshane01

dudeshane01
  • Members
  • 1 posts
  • Real Name:Abhi

Posted 05 August 2009 - 02:49 PM

Hello Fellows
i have intsalled a template from template monster .
I am not able to find the text mentioned in the third step .
Can anyone help ?
I can give you my php file text if you need it .

Shane

#127   Bill A

Bill A
  • Members
  • 2 posts
  • Real Name:Bill anderson

Posted 27 October 2009 - 01:36 AM

I just installed the contribution and everything seems to work great except for one issue I can't figure out. Hopefully this makes sense, if it's confusing, let me know...

I have a test store with 7 categories and 13 products. I can add categories and products and everything seems to work ok except that in some cases the products go into the top category and not the category I had clicked into before I clicked the new product button. No big deal. I can use the move feature to get them into the correct place. this worked fine before I installed the files for this contribution.

My problem is that two of the categories don't display the correct image. For example if I click on category 2, it might show the image for category three. Then when I view a product in that category, it shows the image for the product in the previous category. I went into the database and matched up all the product IDs to Category IDs and they're going into the database correctly. The images names are also correct in the database so it's something with the code. I installed one of the lightbox mods (before I installed the categories Images Box mod) to display a product when you click on it and if I click on a product that shows the wrong image, the lighbox code shows the correct image.

Any thoughts on what file I should be looking at? I copied the files for this contribution directly (except for stylesheet.css, which I added the mods to) and I still have the problem.

Any ideas would be very much appreciated as is the work that went into creating this contribution. Awesome job!

One other thing I tried was to deleted the products and categories that are giving trouble and re-adding them. Again I went into the database to confirm all the product ids, category ids, and images are matched up correctly.

I have no other contributions installed yet but I did modify stylesheet.css and product_info.php slightly. I'm having problems on index.php.

#128   Bill A

Bill A
  • Members
  • 2 posts
  • Real Name:Bill anderson

Posted 28 October 2009 - 01:47 AM

I got it working. I restored a previous backup and re-installed this contrib. I am able to apply other contribs and all is well. I keep all versions of my backups so it's no big deal to go back to any point in the dev cycle.

Edited by Bill A, 28 October 2009 - 01:48 AM.


#129   rustyclockwork

rustyclockwork
  • Members
  • 116 posts
  • Real Name:.
  • Gender:Male

Posted 11 November 2009 - 07:47 AM

Hello,

I had this running really well last year on my site.  I had to do a new reinstall and new the images are not loading for the category boxes.  They do show up on the next page after you click on them though.  Not sure what I did on the install.

I remember the install last year had like three separate image uploaders in the admin, and this install has two.

EDIT- Both uploaders on the new install are both saying "category image" one should say "categories images box image"  shouldn't it?

any ideas?

Thank you for any help,

Jason

Edited by rustyclockwork, 11 November 2009 - 07:58 AM.


#130   rustyclockwork

rustyclockwork
  • Members
  • 116 posts
  • Real Name:.
  • Gender:Male

Posted 11 November 2009 - 07:52 AM

The description option won't update either...  The database update went fine, I wonder if this is a mistake in the admin section.

Jason

#131   rustyclockwork

rustyclockwork
  • Members
  • 116 posts
  • Real Name:.
  • Gender:Male

Posted 12 November 2009 - 02:45 AM

Hello, I think the description is updating now.

Earlier this year, I had the same darn problem with those images not loading on my site.  If you go to page 2 of this thread, you'll see me talking about it.

I don't think it was a permissions setting.

Does anyone have any ideas?

Thanks

#132   rustyclockwork

rustyclockwork
  • Members
  • 116 posts
  • Real Name:.
  • Gender:Male

Posted 12 November 2009 - 04:38 AM

I found a cached version of my old site before the virus got it on google.

I compared the source code on my old site that had the working version of categories images box and compared it to the current source code when seen from a browser in index.php.

This is the code from the old working version:

<td align="center" class="smallText" width="33%" valign="top"><a href="http://www.oldfoundry.com/catalog/index.php?cPath=178"><img src="images/flying_machines.gif" border="0" alt="Balloons & Flying Machines" title=" Balloons & Flying Machines " width="125" height="71" hspace="2" vspace="3"></a></td>

And this is what is going on now, it's showing the image placeholders, but no image...  where do I tell what area of code in what file to point to a full path?

<td align="center" class="smallText" width="33%" valign="top"><a href="http://www.oldfoundry.com/catalog/index.php?cPath=178">
<img src="images/" border="0" alt="Balloons & Flying Machines" title=" Balloons & Flying Machines " width="125" height="71" hspace="2" vspace="3"></a></td>

This was on a clean install, and the same thing happened almost a year ago when I first installed it.  Whatever the fix was, was easy to do, I just can't remember.  I swear it had something to do with paths, but I think I've looked everywhere tonight.

Thank you,

Jason

#133   kymation

kymation

    Believers

  • Community Sponsor
  • 6,698 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 12 November 2009 - 06:42 AM

First, do you have images uploaded for this code? Remember that these images are completely separate from the normal category images. The code you posted shows no image name, so you should also check your database. The categories table should have entries for categories_image_front for every line where parent_id has a value of 0.

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#134   rustyclockwork

rustyclockwork
  • Members
  • 116 posts
  • Real Name:.
  • Gender:Male

Posted 12 November 2009 - 07:25 AM

Hi Jim,

Yes Sir, the images are in the images directory, and the database is correct.

I remember this being some sort of simple fix, but I can't put my finger on it.

If you click on the image placeholders, the link works... the other image loads on the next page of course.

But for some reason, it won't access the images for the main page.

I really think I needed to modify some path, but I don't know what files call the path for me to modify.  It seems that I remember the fix was just one line of code or something.

Jason

#135   kymation

kymation

    Believers

  • Community Sponsor
  • 6,698 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 12 November 2009 - 05:54 PM

The image name is missing from the code that you posted. catalog/includes/modules/categories_images.php pulls the image name from the database and inserts it into the page code. Very simple. I don't see what's going wrong there.

Try this: go into your admin and check that Show Image is set to True. If that's correct, change the box style. Try each one and see if any of them show the image.

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#136   rustyclockwork

rustyclockwork
  • Members
  • 116 posts
  • Real Name:.
  • Gender:Male

Posted 12 November 2009 - 07:27 PM

Hi Jim,

I know, I can't understand it, I have my old code from the backup, and I've double checked all of that.  And that code worked.

It was the same problem I encountered earlier this year, I think I'm talking about it on page two of this thread.

I don't remember who contacted me, but they said to make sure something was turned on or have my hosting company turn this feature on or off, or something about a path...  it was a real simple fix and I'm almost positive that it had to do with the incomplete path that's showing up in the code I posted.

I tried those suggestions you mentioned, still nothing.

Jason

#137   rustyclockwork

rustyclockwork
  • Members
  • 116 posts
  • Real Name:.
  • Gender:Male

Posted 12 November 2009 - 07:35 PM

Should I send you my admin/categories.php file?

I'm out of ideas.

Jason

#138   kymation

kymation

    Believers

  • Community Sponsor
  • 6,698 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 12 November 2009 - 07:42 PM

Is the problem in the Admin and the Catalog or just one?

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#139   rustyclockwork

rustyclockwork
  • Members
  • 116 posts
  • Real Name:.
  • Gender:Male

Posted 12 November 2009 - 07:58 PM

Oh,

Just the front page on the catalog.  Sorry, I don't really know how it all fits, I thought perhaps that when the admin was uploading an image, there may be something going on there as to the path being generated.

my site is www.oldfoundry.com  and I have a few test images on the page that were uploaded by the admin section for categories images box.

the three images that are working (above the three which are not) are not related to any category.  Those are just services links.

Thank you,

Jason

#140   kymation

kymation

    Believers

  • Community Sponsor
  • 6,698 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 12 November 2009 - 08:16 PM

If your database is correct then there is no problem with the Admin. The problem would have to be in the catalog/includes/modules/categories_images.php file. Time to do some debugging there.

Find this code in that file (lines 39-44)
	  $categories_data[$categories_id] = array ('id' => $categories_id,
												'name' => $categories['categories_name'],
												'description' => $categories['categories_description_front'],
												'image' => $categories['categories_image_front']
											   );
	} //while ($categories
and paste this just after it
 print '<pre>';
 print_r ($categories_data);
 print '</pre>';
That will print a mess of data on your front page. Copy that data and paste it in a code box here.

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support