Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Category Titles & Images


annasweb

Recommended Posts

Posted

Hi,

 

I have spent hours researching the forum trying to get an answer on how to delete the broken image on the catalog pages. The image is referencing a "image.htm" and I can't fint it nor can I find where to remove it so it doesn't show up on any pages. Also how do I have the title of each category show up on its pages as a title?

 

Thanks,

Anna

A. Chase

Posted

if hte broken image you are refering to is on the top right and says "lets see what we have here", that is there because you havnt uploaded an image to represent that catogory, to get rid of it completly make a small transparent gif and upload that so nothing shows

Posted

Hi Anna,

 

I believe all you have to do is a modification to the catalog/index.php file called "Page Heading Title Better"

 

*****************************

 

This is a modification of Tommy Le's work so that manufacturer's names will show instead of "Let's See What We Have Here" when listing products by manufacturer.

 

I also removed the unnecessary c.categories_image select from the SQL query.

 

*****************************

 

Get rid of "Let's See What We Have Here" for SubCategories and "Categories" for Top-Categories. Replace them with the name of categories or Subcategories name.

*****************************

In the /catalog/index.php, there are three <?php echo HEADING_TITLE; ?>

 

FOR CATEGORIES, just replace the first one

<?php echo HEADING_TITLE; ?>

 

TO

 

<?php echo $category['categories_name'] ?>

 

 

FOR SUBCATEGORIES, just replace the second

<?php echo HEADING_TITLE; ?>

 

TO

 

<?php if (isset($HTTP_GET_VARS['manufacturers_id'])) {

$category_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

$category = tep_db_fetch_array($category_query);

if ($category['manufacturers_name'] != "") {echo $category['manufacturers_name'];} else { echo HEADING_TITLE;}

} else {

$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$category = tep_db_fetch_array($category_query);

if ($category['categories_name'] != "") {echo $category['categories_name'];} else { echo HEADING_TITLE;}

}

?>

 

 

The third <?php echo HEADING_TITLE; ?>

Nothing needed to modify.

 

*****************************

That's it! I hope this is what you needed. If not post again or PM me. I will try to help.

 

Take Care and God Bless

Leslie

Posted
I believe all you have to do is a modification to the catalog/index.php file called "Page Heading Title Better"

 

<snip>

 

In the /catalog/index.php, there are three <?php echo HEADING_TITLE; ?>

 

FOR CATEGORIES, just replace the first one

<?php echo HEADING_TITLE; ?>

 

TO

 

<?php echo $category['categories_name'] ?>

 

Leslie,

 

I was searching this forum looking for this exact thing - to replace the static page header with the current category name dynamically, however what you posted doesn't seem to work...

 

I've identified the 2nd instance of <?php echo HEADING_TITLE; ?> which is on or near line 232 to be the one that needs to be replaced (the first instance appears to be related to "nested" categories), however at that point in the script $category['categories_name'] seems to be empty.

 

Can you or anyone else shed a little more light on making this work?

 

Thanks!

 

George

Posted

Hi George,

 

I am not sure what you meen here. What you need to do is bring up your index.php file and do a find on this page search for the phrase

<?php echo HEADING_TITLE; ?> . There will be 3 places that it will come up.

 

When you find the first one replace the phrase with:

 

<?php echo $category['categories_name'] ?>

 

When you find the second one replace the phrase with:

 

<?php if (isset($HTTP_GET_VARS['manufacturers_id'])) {

$category_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

$category = tep_db_fetch_array($category_query);

if ($category['manufacturers_name'] != "") {echo $category['manufacturers_name'];} else { echo HEADING_TITLE;}

} else {

$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$category = tep_db_fetch_array($category_query);

if ($category['categories_name'] != "") {echo $category['categories_name'];} else { echo HEADING_TITLE;}

}

?>

 

You do not have to do anything to the 3rd one. I hope this explains it better. I think you are tying to make this harder for yourself then it is. don't worry about the other wording around this phrase, just try what they gave us and you will see it works. I don't completely understand this php stuff, but it works! Make a back up copy your file before you do it if you want. I usually do this whenever I modify coding just in case I do it wrong or something. I can always put it back to the old way.

 

Best Wishes,

Leslie

 

Leslie,

 

I was searching this forum looking for this exact thing - to replace the static page header with the current category name dynamically, however what you posted doesn't seem to work...

 

I've identified the 2nd instance of <?php echo HEADING_TITLE; ?> which is on or near line 232 to be the one that needs to be replaced (the first instance appears to be related to "nested" categories), however at that point in the script $category['categories_name'] seems to be empty.

 

Can you or anyone else shed a little more light on making this work?

 

Thanks!

 

George

Posted
Hi George,

 

I am not sure what you meen here. What you need to do is bring up your index.php file and do a find on this page search for the phrase

<?php echo HEADING_TITLE; ?> . There will be 3 places that it will come up.

 

When you find the first one replace the phrase with:

 

<?php echo $category['categories_name'] ?>

 

When you find the second one replace the phrase with:

 

<?php if (isset($HTTP_GET_VARS['manufacturers_id'])) {

$category_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

$category = tep_db_fetch_array($category_query);

if ($category['manufacturers_name'] != "") {echo $category['manufacturers_name'];} else { echo HEADING_TITLE;}

} else {

$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$category = tep_db_fetch_array($category_query);

if ($category['categories_name'] != "") {echo $category['categories_name'];} else { echo HEADING_TITLE;}

}

?>

 

You do not have to do anything to the 3rd one. I hope this explains it better. I think you are tying to make this harder for yourself then it is. don't worry about the other wording around this phrase, just try what they gave us and you will see it works. I don't completely understand this php stuff, but it works! Make a back up copy your file before you do it if you want. I usually do this whenever I modify coding just in case I do it wrong or something. I can always put it back to the old way.

 

Best Wishes,

Leslie

 

 

Hey Leslie - Thanks so much for the directions for the heading changes in the categories - IT WORKED A TREAT :-)

 

I still have the broken image though on the right hand side. I tried to get rid of the c.categories image thingy but I'm not sure I did it correctly as the broken image is still there. I've been messing around with this for 5 days now and I'm about to kill someone!!!!!!!!!! :-)

 

Thanks in advance

 

Michelle

Posted

Thanks everyone. I will try the changes recommended above, but the images are now gone. I made a transparent 20 x 20 pixel image and then went into my admin - categories - clicked on each category and then clicked on the edit to edit the category. Once in edit mode, I browsed my computer for the image I made and uploaded it as the category image. I did this for each category. Now the broken images are gone.

 

Appreciate everyone's help.

 

Anna

A. Chase

Posted

Hi Michelle,

 

Could you possibly fill me in better as to where this broken image is on your site? I'm sorry, but for some reason I can't quite grasp what you need.

 

When you say broken image are you saying that a message or alternate text comes up where an image is supposed to be? Is this on your main top page? If so, I think you would be referring to the image with the original name something like " yoururl/catalog/table_background_default.gif ". What comes up when you right click where this broken image is and then click on properties or view image? This will be a big help in finding the source of the problem.

 

If you would post your URL then I could maybe figure it out. Please post again or you may gladly email me ([email protected]). I'd like to help if I can.

 

Leslie

 

 

 

Hey Leslie - Thanks so much for the directions for the heading changes in the categories - IT WORKED A TREAT :-)

 

I still have the broken image though on the right hand side. I tried to get rid of the c.categories image thingy but I'm not sure I did it correctly as the broken image is still there. I've been messing around with this for 5 days now and I'm about to kill someone!!!!!!!!!! :-)

 

Thanks in advance

 

Michelle

Posted
Hi Michelle,

 

Could you possibly fill me in better as to where this broken image is on your site? I'm sorry, but for some reason I can't quite grasp what you need.

 

When you say broken image are you saying that a message or alternate text comes up where an image is supposed to be? Is this on your main top page? If so, I think you would be referring to the image with the original name something like " yoururl/catalog/table_background_default.gif ". What comes up when you right click where this broken image is and then click on properties or view image? This will be a big help in finding the source of the problem.

 

If you would post your URL then I could maybe figure it out. Please post again or you may gladly email me ([email protected]). I'd like to help if I can.

 

Leslie

 

Hi Leslie,

 

Thanks so much - I am THIS close to ditching oscommerce completely and moving over to Zen Cart - there HAS to be something easier than this!!!

 

The URL for one of the pages that has the broken image is this:

 

http://bkkbint.com/shop/index.php?cPath=24...70a5464143a00fa

 

and it shows up on EVERY product page.

 

Also, while you're over there :-) HOW do I get the header to be centred at the top of the page. I've tried every file I can find and put in either a 'middle' command or a 'center' command but it doesn't seem to make any difference!

 

And what the FECK is the little html thingy that's just show up at the top left hand side of my homepage????? THAT wasn't there this morning. Aaarrrggghhhhhhhhhhh!!!

 

http://bkkbint.com/

 

Any help would be gratefully received because I've pretty much decided if I can't get this fixed by tomorrow morning, I'm ditching it completely and re-downloading Zen Cart :-(

 

Michelle

Posted

Hi Michelle,

 

I think I found why this “ " /> “ is coming up. Look in your coding. Right after the </head> tag is this " /> thingy. If you delete that it should go away.

 

I’m sorry that I am very busy right now to really investigate your image problem. I tried for a little while, but I have a lot going on today. What I suggest is that something in your coding related to the images has been changes in index.php from the original. You will have to check for differences in your index.php and the original index.php file. I am sure you can find this, but there is a lot of info in this file. It might take a little checking. What I do is use the edit tool “ Find on this page” and search for the word or phrase that I am looking for. That is what I did to find the extra characters for your other problem. I would in this case probably look for something like “ images “.

 

I have found that this coding stuff is very tricky. You have an extra dot or space or something somewhere and it messes everything up. I suggest to always make a copy of any file that you will be changing so that if you change something and it doesn't work, at least you could just upload the original file and be back to that. Maybe you could try this. Make sure you have a backup copy of your index.php file, then upload the original oscommerce index.php file that came with the install just to see if the images come up then. It is worth a try! It might give you a clue that you are on the right track anyway. As a said earlier I think you must have changed something in this file that is making this happen and you will have to hunt it down. You can do it!

 

Let me know what happens. I'll check back later to see if there are any updates. Hope I helped!

 

Leslie

Posted
Hi Michelle,

 

I think I found why this “ " /> “ is coming up. Look in your coding. Right after the </head> tag is this " /> thingy. If you delete that it should go away.

 

I’m sorry that I am very busy right now to really investigate your image problem. I tried for a little while, but I have a lot going on today. What I suggest is that something in your coding related to the images has been changes in index.php from the original. You will have to check for differences in your index.php and the original index.php file. I am sure you can find this, but there is a lot of info in this file. It might take a little checking. What I do is use the edit tool “ Find on this page” and search for the word or phrase that I am looking for. That is what I did to find the extra characters for your other problem. I would in this case probably look for something like “ images “.

 

I have found that this coding stuff is very tricky. You have an extra dot or space or something somewhere and it messes everything up. I suggest to always make a copy of any file that you will be changing so that if you change something and it doesn't work, at least you could just upload the original file and be back to that. Maybe you could try this. Make sure you have a backup copy of your index.php file, then upload the original oscommerce index.php file that came with the install just to see if the images come up then. It is worth a try! It might give you a clue that you are on the right track anyway. As a said earlier I think you must have changed something in this file that is making this happen and you will have to hunt it down. You can do it!

 

Let me know what happens. I'll check back later to see if there are any updates. Hope I helped!

 

Leslie

 

Hi Leslie - thanks. I got the first problem fixed - (I had looked at that code 300 times last night and didn't see it - saw it the minute after I read your post and went back to it - so thanks :D )

 

I still can't figure out where the broken image link is though. I've gone thru a million files it seems like and I cannot find it >_< Anyone any ideas where it could be???

 

Michelle

Posted
I still can't figure out where the broken image link is though. I've gone thru a million files it seems like and I cannot find it >_< Anyone any ideas where it could be???

 

Michelle,

 

The broken image is appearing because that is where the category header image goes and you have not assigned this in the Admin Tool.

 

You have two options:

 

1) Create an image header for each of your categories and then edit each one and assign each header to it's respective category.

 

2) Open /index.php and remove this piece of code:

 

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

Jason

Posted
Michelle,

 

The broken image is appearing because that is where the category header image goes and you have not assigned this in the Admin Tool.

 

You have two options:

 

1) Create an image header for each of your categories and then edit each one and assign each header to it's respective category.

 

2) Open /index.php and remove this piece of code:

 

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

Jason

 

Hey Jason

 

Thanks for the effort - I just removed the code but it made absolutely no difference. The broken image is still there. Any other ideas? :(

 

Michelle

Posted

oops- my bad. That bit of code is for top level categories (which yours look like they are - but they're not...?)

 

In /index.php go down a bit further to around line 273 and remove this line of code instead:

 

<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

Posted
oops- my bad. That bit of code is for top level categories (which yours look like they are - but they're not...?)

 

In /index.php go down a bit further to around line 273 and remove this line of code instead:

 

<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

 

Jason, okay, so now after MY mouthing off at you in a different topic - YOU ARE A COMPLETE STUD!!!!

 

I've spent 5 days trying to find that broken image to delete it and now, THANKS TO YOU, it's GONE!!!

 

Yayyyyy for Jason :D

 

Thanks sooo much!

 

Michelle

Posted
Glad you got it fixed ;-)

 

Sorry for the other thread. I've been using OSC for years - I'm rather over-protective of it.... !

 

Hit me up with any more problems - there's nothing that can't be easily fixed.

 

:-)

 

Hey Jason

 

Remember you told me to delete the first piece of code, which I did and then you said "oops, sorry, not that one"???

 

Well NOW I can't upload any images to a new product listing and I've a feeling it might have had something to do with that first bit of code I deleted as I haven't altered anything else today.

 

So...can you please tell me EXACTLY where I need to put that code BACK??? :D

 

Michelle

Posted

Hey - that first bit of code has nothing to do with your ability to upload product images? To put it back it goes in around line 67 after this bit of code:

 

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

But as you can see from the bolded bits below - the code you'll be putting back pulls in a category image header, enclosed in it's own table cell - notjing else. It has nothing to do with product images. If you are finding it is affecting your product images there is something very wrong with your index page - which I think there is anyway because your categories are behaving extremely oddly?

 

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

Posted
Hey - that first bit of code has nothing to do with your ability to upload product images? To put it back it goes in around line 67 after this bit of code:

 

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

But as you can see from the bolded bits below - the code you'll be putting back pulls in a category image header, enclosed in it's own table cell - notjing else. It has nothing to do with product images. If you are finding it is affecting your product images there is something very wrong with your index page - which I think there is anyway because your categories are behaving extremely oddly?

 

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

Jason,

 

I think you're right. The categories are coming and going and I can't figure out why. I've obviously changed something by mistake but now I can't remember what I changed.

 

What's your suggestion? Upload a new index file? But then if I do that, isn't it going to delete my categories (and thus my products completely?) and if I DO upload a new index file, what else am I going to need to change as I can't remember now what I've changed in there to get it running more or less okay.

 

If I can just figure out the easiest way to fix this, I dont mind spending a couple of hours getting it up and running because it's been mostly great over the last two days and I've almost finished everything. I just don't want to have to start again from the beginning because that was a week's work and I don't have the energy for another week redoing the same stuff I've already done :(

 

Michelle

Posted

Hey - no uploading a new index file won't do anything other than fix the problems. Remember - your categories and products are stored in the *database* - not a PHP file. The PHP just queries and extracts the info in your database and displays the information in a browser - so replacing it may change a few cosmetic things like colors, but you can only delete categories etc by editing your database either thru admin or directly via the MySQL monitor or a MySQL client like PHPMyAdmin.

Posted
I think you are tying to make this harder for yourself then it is. don't worry about the other wording around this phrase, just try what they gave us and you will see it works. I don't completely understand this php stuff, but it works!

 

Best Wishes,

Leslie

 

...Leslie it works now...

 

thanks!

 

George

  • 4 months later...
Posted
oops- my bad. That bit of code is for top level categories (which yours look like they are - but they're not...?)

 

In /index.php go down a bit further to around line 273 and remove this line of code instead:

 

<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

Jason,

 

I tried your little tweak and it worked great.

so easy even for a noob like me

4 :thumbsup: to you.

 

cheers aaron

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...