Guest Posted March 23, 2004 Share Posted March 23, 2004 Thanks for responding so quickly Paul - it really is appreciated. I tried that, but eventually worked out that the top_categories.php was writing it's own version of the table to the screen before calling the BTS files. So, I have modified it as follows, which seems to work! I am pretty new to PHP, so there is a good chance I have fluffed things up! Seems OK for now though. Thanks again! <?php /**************************************************************************** * $Id: top_categories.php,v 1.0 2003/04/90 14:34:00 clescuyer Exp $ * * Display only top categories * * osCommerce, Open Source E-Commerce Solutions * http://www.oscommerce.com/ * * Copyright (c) 2003 Go?lette * Christian Lescuyer <[email protected]> * http://www.goelette.net/ * * History: 1.0 Creation * * Released under the GNU General Public License ****************************************************************************/ ?> <!-- top_categories //--> <tr> <td> <?php $box_base_name = 'top_categories'; // for easy unique box template setup (added BTSv1.2) $box_id = $box_base_name . 'Box'; // for CSS styling paulm (editted BTSv1.2) ////////// // Display box heading ////////// // $boxHeading = array(); $boxHeading = BOX_HEADING_CATEGORIES; // new infoBoxHeading($info_box_contents, true, false); ////////// // Get categories list ////////// // Test for presence of status field for compatibility with older versions $status = tep_db_num_rows(tep_db_query('describe categories status')); $query = "select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.parent_id=0"; if ($status >0) $query.= " and c.status = '1'"; $query.= " and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name"; $categories_query = tep_db_query($query); // Build categories string $categories_string = ''; while ($row = tep_db_fetch_array($categories_query)) { $categories_string .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $row['categories_id']) . '">'; list($current) = explode('_', $HTTP_GET_VARS['cPath']); if ($row['categories_id'] == $current) $categories_string .= '<b>'; $categories_string .= $row['categories_name']; if ($row['categories_id'] == $current) $categories_string .= '</b>'; $categories_string .= '</a>'; $categories_string .= '<br>'; } ////////// // Display box contents ////////// $boxContent = $categories_string; // $boxContent[] = array('align' => 'left', 'text' => $categories_string); // new infoBox($info_box_contents); // bof BTSv1.2 if(file_exists(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php')) { // if exists, load unique box template for this box from templates/boxes/ require(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php'); } else { // load default box template: templates/boxes/box.tpl.php require(DIR_WS_BOX_TEMPLATES . TEMPLATENAME_BOX); } // eof BTSv1.2 ?> </td> </tr> <!-- top_categories_eof //--> Quote Link to comment Share on other sites More sharing options...
Guest Posted March 23, 2004 Share Posted March 23, 2004 Paul Sorry to be a pain again. The category box goes in a layer which is over the top of a sculpted menu bar witha background of #FF9900. So I am trying to change the stylesheet to get rid of the borders and the background colour in the "Categories" bar and then change the text format. I've read through your (excellent) tutorial and the Wiki documentation, and tried to look at the other settings in the stylesheet, but have got myself totally confused! Perhaps this is a sign that it is time to log off and go the pub! Anyway, if you could give me any pointers as to the correct format, I would be very grateful Thanks John Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted March 23, 2004 Author Share Posted March 23, 2004 (edited) I tried that, but eventually worked out that the top_categories.php was writing it's own version of the table to the screen before calling the BTS files. Biking my way home I was already thinking there would be something like that wrong with my suggestion. The <tr>'s and <td>'s actually should not be there, if the are really needed, they belong in the template. I would have to take a closer look to be sure what to do with it, maybe you can just leave them out? Anyway, glad that you got it working now. Edited March 23, 2004 by paulm2003 Quote Link to comment Share on other sites More sharing options...
Guest Posted March 23, 2004 Share Posted March 23, 2004 Just a little update.... I'm managing to change the category box by changing the settings for infoBoxLT (which changes the others also). I guess this means that I have done something wrong that is stopping it from looking for top_categoriesBox? John Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted March 23, 2004 Author Share Posted March 23, 2004 (edited) Sorry to be a pain again.You can ask as much as you like of course, if I don't like it (or don't know anything usefull to say about it) anymore I simply won't answer :) , but hope someone else does. Just a little update.... I'm managing to change the category box by changing the settings for infoBoxLT (which changes the others also). I guess this means that I have done something wrong that is stopping it from looking for top_categoriesBox? It would be a little easyer to have an url to look at. But I don't think what happens here is wrong. All smal infoboxes should have the same a CSS class assigned (not sure if that's the right word to use) and that could be class="infoBoxLT" (use your browsers html source view to check), but all boxes also should have their own individual CSS id and that could be this id="top_categoriesBoxLT" (believe I wrote top_categories before, but look at the html source if you want to be sure, I looked at so many templates lately I can't say for sure what is the exact name in the one you are using). Each infobox having another id of course. now if you add styles to the stylesheet you could for example: for all boxes .infoBoxLT { color: red; border: 10px solid black; } only for your top_categories box : #top_categoriesBoxLT { color: green; border-width: 0; } If those styles really do what you expect a.o. depends on what other styles already exist in the stylesheet. Some times you have to be more specific to make it work. If you need to know more about CSS in general there is lot and lots of info and tutorials on the internet (a.o.: http://www.westciv.com/style_master/academy/css_tutorial/ ). It is not very difficult to learn but you have to know the basics to do nice things with it. Edited March 23, 2004 by paulm2003 Quote Link to comment Share on other sites More sharing options...
talon177 Posted March 24, 2004 Share Posted March 24, 2004 Hey Paul, I just noticed in address_book_process, that this line isn't displaying my heading titles correctly, for modify, new entry and delete, it show's up HEADING_TITLE: The code is on line 231-237 if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) { $breadcrumb->add(NAVBAR_TITLE_MODIFY_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $HTTP_GET_VARS['edit'], 'SSL')); } elseif (isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) { $breadcrumb->add(NAVBAR_TITLE_DELETE_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'], 'SSL')); } else { $breadcrumb->add(NAVBAR_TITLE_ADD_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'SSL')); } Anyone else seeing this or have a solution? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 24, 2004 Share Posted March 24, 2004 Thanks again Paul, you are an absolute star! By doing it the way you said, it is working perfectly. I am developing the site on a standalone old laptop at the moment as it is a replacement for my existing site design (which is not done in OSCommerce) so do not have a URL for the test site. I'll let you know the URL when I get it put up to the server though. Thanks again John Quote Link to comment Share on other sites More sharing options...
talon177 Posted March 24, 2004 Share Posted March 24, 2004 Is anyone else having a problem with the titles on address_book_process.php? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2004 Share Posted March 29, 2004 (edited) Hi all. Please forgive me if I've missed a post that addressed this. I read through all three BTS support threads, but you know how that goes. I'm having difficulty getting the left corner of the the "New Products" info box to be square instead of rounded. I had to hard code a square corner (corner_right_left.gif) into the contentBoxHeading function in classes/boxes.php. What I would RATHER do is figure out how to use the case function in boxes/box.tpl.php to automatically change the corner. It appears that the boxes/box.tpl.php file in the templates folders does NOT control the "New Products" info box? Is there a setting somewhere that does? Again, please forgive me if I've missed this elsewhere. If so, a gentle nudge in the right direction would be appreciated! B) - John Edited March 29, 2004 by John D. Quote Link to comment Share on other sites More sharing options...
talon177 Posted March 29, 2004 Share Posted March 29, 2004 Anyone know how to make a back to top link that'll actually work with the BTS and not bring you back to the index.php page? Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted March 30, 2004 Author Share Posted March 30, 2004 Hi talon777, Is anyone else having a problem with the titles on address_book_process.php?Don't think this has anything to do with the BTS, have you checked your defines already? Anyone know how to make a back to top link that'll actually work with the BTS and not bring you back to the index.php page?I noticed the problem, but it seems to me it's an osC problem, or isn't it? If you have managed to make these links work on a standard osC (without the BTS) I really would like to know!I did notice that if you use links like "faq.php#top" it does seem work (not ideal of course). Paul Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted March 30, 2004 Author Share Posted March 30, 2004 I'm having difficulty getting the left corner of the the "New Products" info box to be square instead of rounded. There are several new products files in osC. "templates/.../boxes/box.tpl.php" is a template only for the small infoboxes which appear in the left and right column by default (like a.o. "includes/boxes/whats_new.php"). There also is a "products_new.php" page, templated through "templates/.../content/products_new.tpl.php". And there is a "includes/modules/new_products.php" file, which you probably are asking about, but unfortunately this box isn't templated yet by the BTS. :( So if you can't get it done like you want through the stylesheet (you can hide the images by a "display: none;"), you indeed will have to edit the "includes/modules/new_products.php" itself. hth (a little) Quote Link to comment Share on other sites More sharing options...
talon177 Posted March 31, 2004 Share Posted March 31, 2004 This mod is great, just takes a little more work to get all the contributions in, but I believe i'm getting them in and working with each other! Quote Link to comment Share on other sites More sharing options...
talon177 Posted April 3, 2004 Share Posted April 3, 2004 Anyone happen to get PWA to work with BTS, I'm getting this error on the login.php page Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/xxxxx/public_html/products/login.php:1) in /home/xxxxx/public_html/products/includes/functions/sessions.php on line 67 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/xxxxx/public_html/products/login.php:1) in /home/xxxxx/public_html/products/includes/functions/sessions.php on line 67 Thanks in advance. Quote Link to comment Share on other sites More sharing options...
talon177 Posted April 4, 2004 Share Posted April 4, 2004 Just wondering, why is there 2 case CONTENT_ADDRESS_BOOK_PROCESS inside the meta_tags.php case CONTENT_ADDRESS_BOOK_PROCESS: define('META_TAG_TITLE', HEADING_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline); define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS); define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1); break; case CONTENT_ADDRESS_BOOK_PROCESS: define('META_TAG_TITLE', HEADING_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline); define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS); define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1); break; Quote Link to comment Share on other sites More sharing options...
talon177 Posted April 4, 2004 Share Posted April 4, 2004 Also for the address_book_process.php The Heading Title's aren't getting called and the code I have is <?php if (isset($HTTP_GET_VARS['edit'])) { echo HEADING_TITLE_MODIFY_ENTRY; } elseif (isset($HTTP_GET_VARS['delete'])) { echo HEADING_TITLE_DELETE_ENTRY; } else { echo HEADING_TITLE_ADD_ENTRY; } ?> Anyone else have this problem Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted April 5, 2004 Author Share Posted April 5, 2004 Also for the address_book_process.php The Heading Title's aren't getting called Ahhh.. now I see! I did look at it before , but I mixed up header and heading and didn't notice the error after all :rolleyes:This must be an error in the meta tags controller (meta_tags.php), I checked but there isn't any "HEADING_TITLE" defined in "includes/languages/english/address_book_process.php", the heading title defines are: define('HEADING_TITLE_ADD_ENTRY', 'New Address Book Entry'); define('HEADING_TITLE_MODIFY_ENTRY', 'Update Address Book Entry'); define('HEADING_TITLE_DELETE_ENTRY', 'Delete Address Book Entry'); So we have 3 different heading titles in one page :rolleyes: . Maybe it's best to add a "HEADING_TITLE" define yourself in the language files. Just wondering, why is there 2 case CONTENT_ADDRESS_BOOK_PROCESS inside the meta_tags.phpThere are 2 indeed, this is an error and it has been there already since Basic Template Structure v1.0a. You can remove one of the cases if you like. But you don't really have to do that because it does not change any functionality (the last of two same cases will never be executed of course, since there is a break executed after the first one). Quote Link to comment Share on other sites More sharing options...
talon177 Posted April 5, 2004 Share Posted April 5, 2004 Thanks for the info! I' guess i'll delete the 2nd instance of the double case to make the code a little cleaner. Quote Link to comment Share on other sites More sharing options...
talon177 Posted April 5, 2004 Share Posted April 5, 2004 Also for the address_book_process.php The Heading Title's aren't getting called Ahhh.. now I see! I did look at it before , but I mixed up header and heading and didn't notice the error after all :rolleyes:This must be an error in the meta tags controller (meta_tags.php), I checked but there isn't any "HEADING_TITLE" defined in "includes/languages/english/address_book_process.php", the heading title defines are: define('HEADING_TITLE_ADD_ENTRY', 'New Address Book Entry'); define('HEADING_TITLE_MODIFY_ENTRY', 'Update Address Book Entry'); define('HEADING_TITLE_DELETE_ENTRY', 'Delete Address Book Entry'); So we have 3 different heading titles in one page :rolleyes: . Maybe it's best to add a "HEADING_TITLE" define yourself in the language files. Just wondering, why is there 2 case CONTENT_ADDRESS_BOOK_PROCESS inside the meta_tags.phpThere are 2 indeed, this is an error and it has been there already since Basic Template Structure v1.0a. You can remove one of the cases if you like. But you don't really have to do that because it does not change any functionality (the last of two same cases will never be executed of course, since there is a break executed after the first one). Isn't it suppose to call the edit, delete, or add entry? So there would be no need for the heading_title? Quote Link to comment Share on other sites More sharing options...
talon177 Posted April 5, 2004 Share Posted April 5, 2004 Oh nm on the last msg, i see what you're saying Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted April 5, 2004 Author Share Posted April 5, 2004 (edited) Isn't it suppose to call the edit, delete, or add entry? So there would be no need for the heading_title?That would be nice, but I would not currently know how to do that. case CONTENT_ADDRESS_BOOK_PROCESS: only checks which page is active, not what part of the page, and address_book_process.php outputs 3 different pages. So at the moment I would not know how to make the difference between these pages in the dynamic meta tag controller. Edited April 5, 2004 by paulm2003 Quote Link to comment Share on other sites More sharing options...
talon177 Posted April 5, 2004 Share Posted April 5, 2004 thanks, i just add the define heading title to be My Personal Address Book. Thanks for the fix paul. Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted April 5, 2004 Author Share Posted April 5, 2004 (edited) And thank you for the report :) otherwise I probably never would have noticed the error existed. I assume (and hope) address_book_proccess is the only page this happens, if anyone finds any other page having a wrong <title> i.c.w. the BTS meta tags controller please do post it here. So for the time being I would advice anyone who uses the BTS to add one define to includes/languages/english/address_book_process.php like: define('HEADING_TITLE', 'My Personal Address Book'); Edited April 5, 2004 by paulm2003 Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted April 5, 2004 Author Share Posted April 5, 2004 The previous post was a bit too fast maybe, Instead you also can (probably is a little better solution than posted above) edit includes/meta_tags.php and replace (approx line 98) case CONTENT_ADDRESS_BOOK_PROCESS: define('META_TAG_TITLE', HEADING_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline); define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS); define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1); break; case CONTENT_ADDRESS_BOOK_PROCESS: define('META_TAG_TITLE', HEADING_TITLE . PRIMARY_SECTION . TITLE . $web_site_tagline); define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS); define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1); break; by case CONTENT_ADDRESS_BOOK_PROCESS: define('META_TAG_TITLE', NAVBAR_TITLE_2 . PRIMARY_SECTION . TITLE . $web_site_tagline); define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE_1 . SECONDARY_SECTION . WEB_SITE_KEYWORDS); define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . NAVBAR_TITLE_1); break; NAVBAR_TITLE_2 is already defined in the address_book_process language file, so no need to add any define then Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted April 5, 2004 Author Share Posted April 5, 2004 or use NAVBAR_TITLE_1 if it suits you better of course :) whatever..... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.