gamesxs Posted May 30, 2008 Share Posted May 30, 2008 Not sure how to ask this: Have worked on this , can't find the way to do it, have also searched! Changed the index.php file so that it would show page headers which I wanted as per http://www.joicohair.net/index.php?cPath=1 The code change for this was: Approx line 270 in index.php <?php //this puts the headers in on product pages if ($category_depth == 'products') { $categories_id = ("$cPath"); $header_query = tep_db_query("select cat_header from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$categories_id . "' "); $header_stat = tep_db_fetch_array($header_query); $header = $header_stat ['cat_header']; } { echo ' <td align="centre" font size="5" strong width=" " valign="top">' . "$header" . '</a></td>' . "\n"; } ?></td> <tr> <td class="pageHeading"> <?php //this puts the header text description in on product pages if ($category_depth == 'products') { $categories_id =("$cPath"); $header_query = tep_db_query("select cat_head_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$categories_id . "' "); $header_stat = tep_db_fetch_array($header_query); $header = $header_stat ['cat_head_description']; } { echo ' <td align="centre" font size="3" width=" " valign="top">' . "$header" . '</a></td>' . "\n"; } ?> Changed the index.php file so it would show the page sub categories text as I wanted as per http://www.joicohair.net/index.php?cPath=21 The code change for this was: Approx Line 72 <?php // this puts the headers in on sub cat pages if ($category_depth == 'nested') { $categories_id = ("$cPath"); $header_query = tep_db_query("select cat_sub_text from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$categories_id . "' "); $header_stat = tep_db_fetch_array($header_query); $header = $header_stat ['cat_sub_text']; } { echo ' <td align="centre" font size="5" strong width=" " valign="top">' . "$header" . '</a></td>' . "\n"; } ?></td> <tr> <td class="pageHeading"> <?php //this puts the header text description in on sub cat pages if ($category_depth == 'nested') { $categories_id = ("$cPath"); $header_query = tep_db_query("select cat_head_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$categories_id . "' "); $header_stat = tep_db_fetch_array($header_query); $header = $header_stat ['cat_head_description']; } { echo ' <td align="centre" font size="3" width=" " valign="top">' . "$header" . '</a></td>' . "\n"; } ?> Changed the database so it works. What I want to do is have the product pages which have a $cPath of lets say 21_26 instead of just 1 or 2 or 21 to show the database query for product_id 26 in the header and sub text instead of $cPath 21. if possible would just like to be nudged in the right direction. Sorry not sure if this makes any sense! Thanks Gary The Vampire ( just a small amount of fluid, you wont feel a thing) if I had the faintest clue regarding exactly what it was that I may or may not be doing, I would stop it!! Link to comment Share on other sites More sharing options...
gamesxs Posted May 31, 2008 Author Share Posted May 31, 2008 Right, seem to have worked it out! So wanted to have independent header text and header descriptions for every category and product page. (I know that I could probably have found this as a contribution, but then I would have learned a limited amount) Made 3 new fields in the database table / categories_description cat_header varchar 32 null cat_head_description varchar 255 null cat_sub_text varchar 255 null Filled these in with the header text, header descriptions text and sub category text that I wanted. Then changed the code as above.(my first post) This worked for the categories and for product pages which had no categories, but not for product pages which came from category pages. Changed on approx line 274 in index.php this code: $categories_id = ("$cPath"); To this: $categories_id = ereg_replace(".._..",substr("$cPath",3,2),"$cPath"); And changed the same on approx line 288 All seems to work, may need to upgrade things if $cPath goes above 99_99 but that will be fun as well. Ta Gary your very very thirsty vampire!! (for fun) if I had the faintest clue regarding exactly what it was that I may or may not be doing, I would stop it!! Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 1, 2008 Share Posted June 1, 2008 Were you aware that that has already been done by the Header Tags SEO contribution? Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
gamesxs Posted June 1, 2008 Author Share Posted June 1, 2008 No, I thought that it had more than likley been done , but I wanted to do it myself. If i just load code done by someone else, what do I learn. Gary if I had the faintest clue regarding exactly what it was that I may or may not be doing, I would stop it!! Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 2, 2008 Share Posted June 2, 2008 I understand. But one of the easiest ways to learn, in my opinion, is to install a contribution into a test shop and see how it is done. You can play around with the code and change it as you like. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.