Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Header Tags Controller for Admin MS 2.2


Farrukh

Recommended Posts

Warning: main(DIR_WS_FUNCTIONSheader_tags.php): failed to open stream: No such file or directory in /home/htdocs/users/ebonni34/ebonni34/hockeyheadquarters.com/catalog/includes/application_top.php on line 14

 

Fatal error: main(): Failed opening required 'DIR_WS_FUNCTIONSheader_tags.php' (include_path='.:/usr/local/lib/php') in /home/htdocs/users/ebonni34/ebonni34/hockeyheadquarters.com/catalog/includes/application_top.php on line 14

 

Thats the error I am getting, like I said I am new to php but I am certain the files are in the correct osCommerce directories on my site.... so why it can't find them makes no sense to me. The files and directories are there....

 

Thanks

Eric B

AJ2000

Link to comment
Share on other sites

  • Replies 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

Eric - You only need to comment out that code if you are using STS and then only if you are having a problem. Your problem seems more related to a bad install or a problem with your configure file. The error shows

DIR_WS_FUNCTIONSheader_tags.php
There should be a slash in there like
DIR_WS_FUNCTIONS/header_tags.php
Normally this is added by the DIR_WS_FUNCTIONS define although I would think you would be having other problems if that was bad. It might not hurt to post your includes/configure.php file here just for a quick look though. Be sure to remove your username & password from it first if you do.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hello Jack,

 

Here is my configure.php file:

 

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// Configured to work with Moneris eSelect - E. Bonnici www.aj2000.com
 define('DIR_WS_MONERIS',DIR_WS_INCLUDES.'moneris/'); 

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
 define('HTTP_SERVER', 'http://www.hockeyheadquarters.com'); // eg, http://localhost - should not be empty for productive servers
 define('HTTPS_SERVER', 'https://www.hockeyheadquarters.com'); // eg, https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', true); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', 'www.hockeyheadquarters.com');
 define('HTTPS_COOKIE_DOMAIN', 'www.hockeyheadquarters.com');
 define('HTTP_COOKIE_PATH', '/catalog/');
 define('HTTPS_COOKIE_PATH', '/catalog/');
 define('DIR_WS_HTTP_CATALOG', '/catalog/');
 define('DIR_WS_HTTPS_CATALOG', '/catalog/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/htdocs/ebonni34/hockeyheadquarters.com/catalog/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

// define our database connection
 define('DB_SERVER', 'mysql4.bluegravity.com'); // eg, localhost - should not be empty for productive servers
 define('DB_SERVER_USERNAME', 'REMOVED');
 define('DB_SERVER_PASSWORD', 'REMOVED');
 define('DB_DATABASE', 'hockeyhq');
 define('USE_PCONNECT', 'false'); // use persistent connections?
 define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
?>

 

Do you see anything in there?

 

The Moneris Eselct line is for a merchant account/payment gateway that is being used with the site. Other than that there has been no mods or anything besides the HTC one.

 

I am testing out the HTC on a fresh install, except for the Moneris mod.

 

You can see the test site at www.hockeyheadquarters.com/catalog

 

Thanks

Eric B

 

Eric - You only need to comment out that code if you are using STS and then only if you are having a problem.  Your problem seems more related to a bad install or a problem with your configure file.  The error shows There should be a slash in there likeNormally this is added by the DIR_WS_FUNCTIONS define although I would think you would be having other problems if that was bad.  It might not hurt to post your includes/configure.php file here just for a quick look though.  Be sure to remove your username & password from it first if you do.

 

Jack

AJ2000

Link to comment
Share on other sites

Well, I just cant stay away :D while adding products to my store I have started to run acrossed this error-->

Warning: Cannot modify header information - headers already sent by (output started at /home/pnwgifts/public_html/admin/includes/languages/english.php:347) in /home/pnwgifts/public_html/admin/includes/functions/general.php on line 18

 

this is only after I update or adding something. It errors when the site tries to redirect me, but the post or update goes through..

 

here is what that part says:

<?php
/*
 $Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

////
// Redirect to another page or site
 function tep_redirect($url) {
   global $logger;

   header('Location: ' . $url);

   if (STORE_PAGE_PARSE_TIME == 'true') {
     if (!is_object($logger)) $logger = new logger;
     $logger->timer_stop();
   }

   exit;
 }

////

 

Thanks for your continued support. :thumbsup:

Edited by PnwGifts
Link to comment
Share on other sites

I don't see anything wrong with it. Are you having the problem on the admin or catalog side of your shop? The link you gave is working so I am assuming it is the admin side. I re-read your first post and I think you said you commented out the HTC code at line 14. If that is true, that is your problem. The code you add to that file should go at or near the bottom, not at the top, of the file. Let me know if this is what's happened.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Well, I just cant stay away :D while adding products to my store I have started to run acrossed this error-->
Warning: Cannot modify header information - headers already sent by (output started at /home/pnwgifts/public_html/admin/includes/languages/english.php:347) in /home/pnwgifts/public_html/admin/includes/functions/general.php on line 18

This error is usually because of an extra space at the top or end of one of your files, probably the english one in this case. Open the file and make shre the first character is < and the last character is >. No spaces allowed.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I don't see anything wrong with it.  Are you having the problem on the admin or catalog side of your shop?  The link you gave is working so I am assuming it is the admin side. I re-read your first post and I think you said you commented out the HTC code at line 14.  If that is true, that is your problem.  The code you add to that file should go at or near the bottom, not at the top, of the file.  Let me know if this is what's happened.

 

Jack

 

 

Thanks Jack!!!

 

I actually had commented out the HTC code for application_top.php on the catalog side and it was at the top starting around line 12 or so. Thats why the catalog side was working.

 

I moved the code to the bottom and removed the comments and it still works!!!

 

I appreaciate your help on this so much.

 

I am having a problem on the admin side. I tried to move the same code to the bottom of that page too but it didn't work. Here is the error I had.

 

Warning: main(includes/classes/navigation_history.php): failed to open stream: No such file or directory in /home/htdocs/users/ebonni34/ebonni34/hockeyheadquarters.com/catalog/admin/includes/application_top.php on line 130

 

Fatal error: main(): Failed opening required 'includes/classes/navigation_history.php' (include_path='.:/usr/local/lib/php') in /home/htdocs/users/ebonni34/ebonni34/hockeyheadquarters.com/catalog/admin/includes/application_top.php on line 130

 

I plan to take a look at that tomorrow to see if I can figure something out. Don't be surprised if you see me back here again with more questions.

 

Thanks so much for your help and great modifications to the HTC.

 

Sincerely

Eric B

AJ2000

Link to comment
Share on other sites

The navigation_history.php file is part of the basic shop and not changed by HTC. It may have been deleted by mistake or corrupted somehow. Please verify it exists in the path shown in the error.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Jack,

 

I double checked and the file is indeed there.

 

I left out part of the error message, so here it is again....

 

Warning: main(includes/classes/navigation_history.php): failed to open stream: No such file or directory in /home/htdocs/users/ebonni34/ebonni34/hockeyheadquarters.com/catalog/admin/includes/application_top.php on line 130

Fatal error: main(): Failed opening required 'includes/classes/navigation_history.php' (include_path='.:/usr/local/lib/php') in /home/htdocs/users/ebonni34/ebonni34/hockeyheadquarters.com/catalog/admin/includes/application_top.php on line 130

 

I will be doing more checking later today.

 

Should I post the navigation_history.php file here?

 

Thanks

Eric B

AJ2000

Link to comment
Share on other sites

The error is saying it can't open that file so it is either missing or corrupted. Since you verified the first, you need to check the second. You may want to relace it with a copy from the basic OSC install. Make a copy of your current file first though. I doubt that it has been changed from the original but best to play it safe.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The error is saying it can't open that file so it is either missing or corrupted. Since you verified the first,  you need to check the second.  You may want to relace it with a copy from the basic OSC install.  Make a copy of your current file first though.  I doubt that it has been changed from the original but best to play it safe. 

 

Jack

 

Hi Jack,

 

I don't think that file is corrupted... I think I may have found the problem though... hopefully you can help confirm this.

 

I have a feeling the problem has to do with the file

catalog/admin/includes/application_top.php

 

What I did was upload the back up copy that was in use before I implemented HTC

 

when I did this my admin area worked again and I was able to login... I was able to see the HTC fields for title, keywords, and description in the product catalog admin area for each product.

 

So what I did was go over the instructions once more and everything seems to have been done correctly.

 

What I did notice was no where in the instructions did it say to make any changes to

 

catalog/admin/includes/application_top.php

 

But on my server that file was very different from my back up. What I think happend was I uploaded the wrong file after making the HTC changes... I think that I uploaded the

 

catalog/includes/application_top.php

 

into

 

catalog/admin/includes/application_top.php

 

I think this was the mistake.

 

So basically by reuploading my backup file to

catalog/admin/includes/application_top.php it makes everything work so far.

 

Does this make sense? Could that have been what my problem was?

 

Also, just to confirm for HTC there are no changes necessary to the file

catalog/admin/includes/application_top.php correct?

 

Please confirm and thanks

Eric B

AJ2000

Link to comment
Share on other sites

Yep, sounds like you figured it out. :) Only the application_top file in includes gets changed, not in admin/includes.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Yep, sounds like you figured it out. :)  Only the application_top file in includes gets changed, not in admin/includes.

 

Jack

 

Thanks for your help and quick responses Jack,

 

I was wondering about this HTC, javascript, and SEO. From a SEO standpoint it is a good idea to keep javascript seperate in a .js file. Do you know if there any contributions for OSC that address this issue?

 

If not I think this would be a good future plan for this current mod.

 

Would love to hear your thoughts on this.

 

Thanks

Eric B

AJ2000

Link to comment
Share on other sites

Yes, javascript and css code should always be in an external file. I'm not sure why you would need a contribution to do this. It is just creating a file. HTC doesn't use javasript that I recall. Where would it be used in HTC?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Yes, javascript and css code should always be in an external file.  I'm not sure why you would need a contribution to do this.  It is just creating a file.  HTC doesn't use javasript that I recall.  Where would it be used in HTC?

 

Jack

 

To be honest I am a beginner at PHP and mysql so I can't really make comments on how to change HTC to help with the .js external file

 

I am very familiar with SEO though. I think OSCommerce sometimes puts too much code like javascript in the header of some pages and I hope to figure out how to put that into a .js file. The problem is that being a beginner I find OSCommerce a little overwhelming, although I am learning more and more as I stumble through it all.

 

If I find out any info on this you will be the first to know. Its the least I can do for all you help and great mod to HTC.

 

Thanks

Eric B

AJ2000

Link to comment
Share on other sites

It's a pretty simple procedure. In your file where there is javescript it will be surrounded by <script & /script> tags. Take everything between them and place them in a new file. Save that file to somewhere in your shop. The best way, for organizational purposes, is to mkae a javascript directory and put it in there. Name the file whatever you like but end it in .js (i.e., myfile.js). The first line of the file should be

<!--

and the last line should be

// -->

 

Then in the file you removed it from, include this line

<script src="javascript/myfile.js" type="text/javascript"></script>

That's it.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks Jack,

 

I am familiar with the procedure but I think I am letting the enormous size of OSCommerce overwhelm me a bit. I will make the changes in the near future.

 

So much to do so little time.

 

Thanks so much for your heop.

 

Eric B

AJ2000

Link to comment
Share on other sites

Actually, I think the main place that javascript would be a main concern is in the product pages. Some of the other pages don't seem to have much if any javascript at all. The ones that do may not be something you plan to focus heavily on for SEO purposes... like the account files like account.php

 

I suspect that the SEO and files you would want to focus on are mainly the product related files... such as product_info.php, product_reviews.php etc. I also noticed

 

Looks like the same script for each product realted page too.

 

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>

 

So you could probably get away with using the script once in one .js file for the product pages.

 

Again I consider myself a beginner when it comes to PHP and OSCommerce.

 

So if you would confirm this I think it would be helpful to others who read this and myself.

 

Thanks

Eric B

AJ2000

Link to comment
Share on other sites

Hi, I am running this script and it works just fine except...it is not carrying over the description to the main index page. Carrys the description for products on what I entered, etc..Any ideas? Is there a way I can hardcore it into the main index without thrownig in it's own blank description?

Link to comment
Share on other sites

Hi, I am running this script and it works just fine except...it is not carrying over the description to the main index page. Carrys the description for products on what I entered, etc..Any ideas? Is there a way I can hardcore it into the main index without thrownig in it's own blank description?

 

 

Hi Jimthesaint

 

Look at the Operate Readme file... it tells you there... here is the part to look at

 

USE OF HEADER TAGS GENERATOR

 

How you want each page to handle the Header Tags is defined in /includes/header_tags.php

 

What definitions you want used with each page is defined in /includes/languages/english/header_tags.php

 

You can modify which pages use what by looking at the samples setup in these two files.

 

Be careful if editing or changing /catalog/includes/header_tags.php and watch for == vs !=

 

NOTE:

HTTA - means Header Tag Title All

HTKA - means Header Tag Keywords All

HTDA - means Header Tag Description All

 

Eric B

AJ2000

Link to comment
Share on other sites

Hi, I am running this script and it works just fine except...it is not carrying over the description to the main index page. Carrys the description for products on what I entered, etc..Any ideas? Is there a way I can hardcore it into the main index without thrownig in it's own blank description?

Can you post the code from your english/header_tags.php file and a link to your site?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Can you post the code from your english/header_tags.php file and a link to your site??

 

Jack

 

<?php

// /catalog/includes/languages/english/header_tags.php

// WebMakers.com Added: Header Tags Generator v2.3

// Add META TAGS and Modify TITLE

//

// DEFINITIONS FOR /includes/languages/english/header_tags.php

 

// Define your email address to appear on all pages

define('HEAD_REPLY_TAG_ALL', STORE_OWNER_EMAIL_ADDRESS);

 

// For all pages not defined or left blank, and for products not defined

// These are included unless you set the toggle switch in each section below to OFF ( '0' )

// The HEAD_TITLE_TAG_ALL is included BEFORE the specific one for the page

// The HEAD_DESC_TAG_ALL is included AFTER the specific one for the page

// The HEAD_KEY_TAG_ALL is included BEFORE the specific one for the page

define('HEAD_TITLE_TAG_ALL', STORE_NAME);

define('HEAD_DESC_TAG_ALL','Boy\'s and Girl\'s communion, christening, gifts, viels and more, new castle, new castle pa, baby gifts, discounted items, cheap shipping, Jimm\'s Dept Store, Jimm\'s Department Store, Jimms Dept Store, Jimms Department Store, Best Communion Outfits');

define ('HEAD_KEY_TAG_ALL','Clothing,Women\'s Fashions,Accessories ,Women,Special Occasion Dresses,Tops,DressesCommunion, Christening, Boy\'s and Girl\'s communion, christening, gifts, viels, new castle, new castle pa, baby gifts, discounted items, cheap shipping, Jimm\'s Dept Store, Jimm\'s Department Store, Jimms Dept Store, Jimms Department Store, Best Communion Outfits');

// DEFINE TAGS FOR INDIVIDUAL PAGES

 

// index.php

define('HTTA_DEFAULT_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title

define('HTKA_DEFAULT_ON','1'); // Include HEAD_KEY_TAG_ALL in Keywords

define('HTDA_DEFAULT_ON','1'); // Include HEAD_DESC_TAG_ALL in Description

define('HEAD_TITLE_TAG_DEFAULT', 'Jimm\'s Department Store');

define('HEAD_DESC_TAG_DEFAULT','Boy\'s and Girl\'s communion, christening, gifts, veils');

define('HEAD_KEY_TAG_DEFAULT','Boy\'s and Girl\'s communion, christening, gifts, veils');

 

// product_info.php - if left blank in products_description table these values will be used

define('HTTA_PRODUCT_INFO_ON','1');

define('HTKA_PRODUCT_INFO_ON','1');

define('HTDA_PRODUCT_INFO_ON','1');

define('HEAD_TITLE_TAG_PRODUCT_INFO','');

define('HEAD_DESC_TAG_PRODUCT_INFO','');

define('HEAD_KEY_TAG_PRODUCT_INFO','');

 

// products_new.php - whats_new

define('HTTA_WHATS_NEW_ON','1');

define('HTKA_WHATS_NEW_ON','1');

define('HTDA_WHATS_NEW_ON','1');

define('HEAD_TITLE_TAG_WHATS_NEW','New Products');

define('HEAD_DESC_TAG_WHATS_NEW','I am ON PRODUCTS_NEW as HEAD_DESC_TAG_WHATS_NEW and over ride the HEAD_DESC_TAG_ALL');

define('HEAD_KEY_TAG_WHATS_NEW','I am on PRODUCTS_NEW as HEAD_KEY_TAG_WHATS_NEW and over ride HEAD_KEY_TAG_ALL');

 

// specials.php

// If HEAD_KEY_TAG_SPECIALS is left blank, it will build the keywords from the products_names of all products on special

define('HTTA_SPECIALS_ON','1');

define('HTKA_SPECIALS_ON','1');

define('HTDA_SPECIALS_ON','1');

define('HEAD_TITLE_TAG_SPECIALS','Specials');

define('HEAD_DESC_TAG_SPECIALS','');

define('HEAD_KEY_TAG_SPECIALS','');

 

// product_reviews_info.php and product_reviews.php - if left blank in products_description table these values will be used

define('HTTA_PRODUCT_REVIEWS_INFO_ON','1');

define('HTKA_PRODUCT_REVIEWS_INFO_ON','1');

define('HTDA_PRODUCT_REVIEWS_INFO_ON','1');

define('HEAD_TITLE_TAG_PRODUCT_REVIEWS_INFO','');

define('HEAD_DESC_TAG_PRODUCT_REVIEWS_INFO','');

define('HEAD_KEY_TAG_PRODUCT_REVIEWS_INFO','');

 

?>

 

my site is jimmsdeptstore.com/shop

It might be down since I have a conflict with the hosting company saying I went over my bandwith when I have not..must be a glitch, but should be back up soon today

Edited by thesaintjim
Link to comment
Share on other sites

I see the problem you are describing but your english file looks good. Would you please post your includes/header_tags.php when you get a chance.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

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...