Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Header Tags Controller for Admin MS 2.2


Farrukh

Recommended Posts

  • Replies 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

Installed the admin and it works for the most part. However...

 

1) When i add a new page and type a title, it adds the Page Name value in the Title field, instead of the title I type. I can edit this from the Text Control page with no problems....but did I screw something up?

 

2) Works with all of my pages...except...when I add a custom page for wishlist.php (My Wishlist 2.0 contribution), I get the following error (throuhgout my store):

 

Parse error: parse error, unexpected T_CASE in /home/angarden/public_html/shop/includes/header_tags.php on line 375

 

My line 375 looks like this:

 

 ?case (strstr($_SERVER['PHP_SELF'],FILENAME_WISHLIST) or strstr($PHP_SELF, FILENAME_WISHLIST));

 

Nothing out of the ordinary as far as I can see. Deleting the wishlist file takes care of everything.

 

Do I need to do something to enable HTC to work with custom pages?

 

I am mostly concerned with problem 1 though, as it is a PITA.

1 - I don't understand the question.

 

2 - Are you adding them via admin or by editing the files yourself? The line given in an error may not be the actual one at fault. Try comparing that whole section of code to another section. Also, odds are that the problem is most likely in english/header_tags.php for the new page. A ' is probably not being handled properly for some reason. If you can't find the problem, please post that section of code here.

 

3 - Header Tags shouldn't slow down the page to any noticeable degree. It adds a database call but that would not be enough to slow it down to where you would notice.

 

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

1 - I don't understand the question.

 

2 - Are you adding them via admin or by editing the files yourself? The line given in an error may not be the actual one at fault. Try comparing that whole section of code to another section. Also, odds are that the problem is most likely in english/header_tags.php for the new page. A ' is probably not being handled properly for some reason.  If you can't find the problem, please post that section of code here.

 

3 - Header Tags shouldn't slow down the page to any noticeable degree. It adds a database call but that would not be enough to slow it down to where you would notice.

 

Jack

 

1: When I add a page via the admin tool, I input:

 

Page Name: our_location

Page Title: Driving Directions

 

When it writes the header_tags.php file with this information, it comes out:

 

Page Name: our_location

Page Title: our_location

 

I am able to correctly edit this in Text Control panel. Have I messed something up in the installation? Or is this a bug that has to deal with custom pages?

 

2:

 

My code from includes/languages/english/header_tags.php (the admin tool inserted it without a space between lines):

 

// 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','');
// wishlist_help.php
define('HTTA_WISHLIST_HELP_ON','1');
define('HTDA_WISHLIST_HELP_ON','1');
define('HTKA_WISHLIST_HELP_ON','1');
define('HEAD_TITLE_TAG_WISHLIST_HELP','Wishlist Help');
define('HEAD_DESC_TAG_WISHLIST_HELP','');
define('HEAD_KEY_TAG_WISHLIST_HELP','Wishlist');

 

3: Page load seems fine now. I think it was a cache issue with my machine.

Link to comment
Share on other sites

I don't see anything wrong with that code. But if it is recoding the entry incorrectly, then there is a problem with your install since it is not supposed to do that. The problem would be in admin/categories.php so you should try doing that one over.

 

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 that code. But if it is recoding the entry incorrectly, then there is a problem with your install since it is not supposed to do that. The problem would be in admin/categories.php so you should try doing that one over.

 

Jack

 

Alright...I re-did admin/categories.php and came back to square 1. I am still having both problems. As I am new to this, I will try to cover every bit of it.

 

#1:

 

When I input the following:

 

img1.gif

 

It posts the following to the database:

 

img2.gif

 

Which code would affect this specific action?

 

#2:

 

When I add a custom page (one not native to a fresh OSC install) using the admin tool as above (i.e., wishlist - from My Wishlist 2.0 contrib), I receive the same parse error across all pages of my shop, meaning it breaks EVERY page.

 

Parse error: parse error, unexpected T_CASE in /home/angarden/public_html/shop/includes/header_tags.php on line 382

 

Any thoughts?

Edited by pnkranger
Link to comment
Share on other sites

The code that affects the above is in admin/categories. So if you have done it over from scracth, I wouldn't think you would have made the same msitake twice so it is probably something else.

 

Try posting your entire includes/header_tags.php file here. i will stick in my test shop and see if it works.

 

I will also PM you a link whre you can download a set of files already set up. You won't be able to use them if you have made other changes to the shop, but you should be able to put them in temporairly to see if the same problem exists or, in the least, compare your files to them.

 

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,

 

I've installed the Header Tag Controller v2.5.0. Everything seems to be ok until I clicked on Header tag in the left column of admin. The "Header Tag" is replaced by a string of error message:

 

Fatal error: Call to undefined function: tep_admin_files_boxes() in .../admin/includes/boxes/header_tags_controller.php on line 28

 

Here's the code for admin/includes/boxes/header_tags_controller.php

 

<?php
/*
 $Id: header_tags_controller.php,v 1.00 2003/10/02 Exp $

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

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- header_tags_controller //-->
         <tr>
           <td>
<?php
 $heading = array();
 $contents = array();

 $heading[] = array('text'  => BOX_HEADING_HEADER_TAGS_CONTROLLER,
                    'link'  => tep_href_link(FILENAME_HEADER_TAGS_CONTROLLER, 'selected_box=header tags'));

 if ($selected_box == 'header tags') {
   $contents[] = array('text'  =>
//     '<a href="' . tep_href_link(FILENAME_HEADER_TAGS_CONTROLLER, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_HEADER_TAGS_ADD_A_PAGE . '</a><br>' .
//     '<a href="' . tep_href_link(FILENAME_HEADER_TAGS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_HEADER_TAGS . '</a>'
// for admin access level, change the //
                                  tep_admin_files_boxes(FILENAME_HEADER_TAGS_CONTROLLER, BOX_HEADER_TAGS_ADD_A_PAGE) . 
                                  tep_admin_files_boxes(FILENAME_HEADER_TAGS, BOX_HEADER_TAGS)  
    
    
    );
                                  
 }

 $box = new box;
 echo $box->menuBox($heading, $contents);
?>
           </td>
         </tr>
<!-- header_tags_controller_eof //-->

 

 

Thanks.

Link to comment
Share on other sites

Hi, I have a problem with my header tags which is that when I add a new page e.g. shipping and I go to view that page I get the following error

 

Fatal error: Call to undefined function: tep_header_tag_page() in /home/virtual/site41/fst/var/www/html/catalog/includes/header_tags.php on line 124

 

I did try and replace the file with the one from v2.5 but it stopped the header tags from working properly since I have ultimate seo v2.1b installed

 

How can I fix this, thanks :(

Link to comment
Share on other sites

Hi, I have a problem with my header tags which is that when I add a new page e.g. shipping and I go to view that page I get the following error

 

Fatal error: Call to undefined function: tep_header_tag_page() in /home/virtual/site41/fst/var/www/html/catalog/includes/header_tags.php on line 124

 

I did try and replace the file with the one from v2.5 but it stopped the header tags from working properly since I have ultimate seo v2.1b installed

 

How can I fix this, thanks  :(

 

Are Ultimate SEO and Header Tags contribs not compatable with eachother?

 

Is version 2.5 Header Tags seen as stable by most people - I am about to install.

 

Floob.

Link to comment
Share on other sites

Rick - From what others have said, version 2.5.0 is broken. You will need to install the 2.4.9 version.

 

Tom - That function is in includes/funtions/header_tags.php. Did you copy that file from the contribution?

 

Allen - Header Tags and Ultimate SEO are completely compatible and I have instsalled them both in many shops without a problem. However, see the note above about version 2.5.0.

 

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

Tom - That function is in includes/funtions/header_tags.php. Did you copy that file from the contribution?

Jack

 

I copied the file, the old one must have been from a previous version, also I noticed that I didnt update the includes/header_tags previously so I updated it from the V2.0 to V2.3 but now when I create a new header it will just list the url in the title and all the header tags become broken and I get the following error:

 

parse error: parse error in /home/virtual/site41/fst/var/www/html/catalog/includes/header_tags.php on line 138

 

I checked the includes/header_tags file and at the end it adds this

 

// shipping.php

case (strstr($_SERVER['PHP_SELF'],FILENAME_SHIPPING) or strstr($PHP_SELF, FILENAME_SHIPPING));

$tags_array = tep_header_tag_page(HTTA_SHIPPING_ON, HEAD_TITLE_TAG_SHIPPING,

HTDA_SHIPPING_ON, HEAD_DESC_TAG_SHIPPING,

HTKA_SHIPPING_ON, HEAD_KEY_TAG_SHIPPING );

break;

Edited by TDK
Link to comment
Share on other sites

My guess is that you have more files that are not compatible. The current, working, version is 2.4.9. There have been quite a few changes since 2.3. The code using teh array ($tags_array) was added in 2.3.9 I think. So your files look like they are not correct.

 

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

Jack....found the answer to problem #1.

 

In admin/header_tags_controller.php from 2.4.9 there is a small error in the ENGLISH SECTION:

 

$fileUpper = strtoupper($args['page']);      //prepare the english array
     $engArray = array();
     $engArray['page'] = sprintf("// %s.php\n", $args['page']);  
     $engArray['htta'] = sprintf("define('HTTA_%s_ON','%d');\n", $fileUpper, $args['htta']);
     $engArray['htda'] = sprintf("define('HTDA_%s_ON','%d');\n", $fileUpper, $args['htda']);
     $engArray['htka'] = sprintf("define('HTKA_%s_ON','%d');\n", $fileUpper, $args['htka']);
     $engArray['title'] = sprintf("define('HEAD_TITLE_TAG_%s','%s');\n", $fileUpper, $args['page']);
     $engArray['desc'] = sprintf("define('HEAD_DESC_TAG_%s','%s');\n", $fileUpper, $args['desc']);
     $engArray['keyword'] = sprintf("define('HEAD_KEY_TAG_%s','%s');\n", $fileUpper, $args['keyword']);

 

look at the $args value for title. This should be changed in the 2.4.9 contribution and re-submitted.

 

Still working on the wishlist problem, but it is minor.

Link to comment
Share on other sites

Ok...Jack...an update on the problems I was experiencing.

 

I receive this error:

 

Parse error: parse error, unexpected T_CASE in /home/angarden/public_html/shop/includes/header_tags.php on line 375

 

any time that I add a page whose title begins alphabetically AFTER the "specials" page (which is alphabetically the last of the pages included as part of the install). I tried adding the "tell_a_friend" page as a test. Will you try it on your store and see if it causes the same issue.

 

As long as the page falls alphabetically before "specials" then it works like a charm.

 

Any idea why this would happen?

Link to comment
Share on other sites

$fileUpper, $args['page']);

? ? ?$engArray['desc'] = sprintf("define('HEAD_DESC_TAG_%s','%s');\n", $fileUpper, $args['desc']);

? ? ?$engArray['keyword'] = sprintf("define('HEAD_KEY_TAG_%s','%s');\n", $fileUpper, $args['keyword']);[/code]

 

look at the $args value for title. This should be changed in the 2.4.9 contribution and re-submitted.

 

Still working on the wishlist problem, but it is minor.

page? What about 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

My guess is that you have more files that are not compatible. The current, working, version is 2.4.9. There have been quite a few changes since 2.3. The code using teh array ($tags_array) was added in 2.3.9 I think. So your files look like they are not correct.

 

Thats my fault when I upgraded I left the old file still there, I put the new one 1.4.9 in and it nearly works now, the titles for the pages e.g. shipping appears in the title bar however it dispays it like this

 

Shipping (default title) instead of Shipping - (default title)

 

The index page is working but also after changing the file the categories arent added to the header and also the product title it will display it like this

 

Product(default title) instead of Product - (default title)

 

Its probably becasue I edited the files wrong in the upgrade, or forgot to change a line.

 

Also there must be a slight bug because sometimes when I created a new header page in the admin, once or twice it moved some text to the box below so I had to manually change it through ftp

Link to comment
Share on other sites

Ok...Jack...an update on the problems I was experiencing.

 

I receive this error:

 

Parse error: parse error, unexpected T_CASE in /home/angarden/public_html/shop/includes/header_tags.php on line 375

 

any time that I add a page whose title begins alphabetically AFTER the "specials" page (which is alphabetically the last of the pages included as part of the install). I tried adding the "tell_a_friend" page as a test. Will you try it on your store and see if it causes the same issue.

 

As long as the page falls alphabetically before "specials" then it works like a charm.

 

Any idea why this would happen?

I tried adding zzz and it worked fine.

 

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

OK, just to start over so there is no confusion. Here is my problem as it currently stands:

 

When I add a new page to have custom META content via the admin tool, it works flawlessly, UNLESS I add a page that starts alphabetically AFTER the specials page.

 

When I do this, two bad things happen:

 

1) The trailing "?>" are removed from both the includes/header_tags_controller.php and the includes/languages/english/header_tags_controller.php.

 

2) The entries in includes/header_tags_controller.php for these pages that start after specials are placed AFTER the default page entry and AFTER the:

 

echo ' <title>' . $tags, etc.

 

lines, just before where the closing ?> should be.

 

Any thoughts on this?

Link to comment
Share on other sites

Rick - From what others have said, version 2.5.0 is broken. You will need to install the 2.4.9 version.

 

 

I've replaced all the header_tags**** files with those from v2.4.9 and it works nicely now.

 

Thank you.

Link to comment
Share on other sites

I'm installing version 2.4.9. Just about finished with the install.

 

I'm getting this error in admin when I click on Header Tags in the left column.

 

Warning: file(../includes/languages/english/header_tags.php): failed to open stream: No such file or directory in /hsphere/local/home/baldys0/funtasticcandle.com/admin/header_tags_controller.php on line 228

 

I'm pretty new to PHP. I goto /admin/header_tags_controller.php, and line 228 reads

 

$fp = file($filenameEng);

 

I don't know what the error message is trying to tell me, nor how to determine what the variable $filenameEng is supposed to be.

 

The file catalog/includes/languages/english/header_tags.php exists (and is unmodified from the contribution), but there is no such file in /admin in that directory. The file header_tags_controller.php is also unmodified from the contribution.

 

I would appreciate any help pointing me in the right direction.

 

Thanks

Scott

Link to comment
Share on other sites

I'm installing version 2.4.9. Just about finished with the install.

 

I'm getting this error in admin when I click on Header Tags in the left column.

 

Warning: file(../includes/languages/english/header_tags.php): failed to open stream: No such file or directory in /hsphere/local/home/baldys0/funtasticcandle.com/admin/header_tags_controller.php on line 228

 

I'm pretty new to PHP. I goto /admin/header_tags_controller.php, and line 228 reads 

 

$fp = file($filenameEng);

 

I don't know what the error message is trying to tell me, nor how to determine what the variable $filenameEng is supposed to be.

 

The file catalog/includes/languages/english/header_tags.php exists (and is unmodified from the contribution), but there is no such file in /admin in that directory. The file header_tags_controller.php is also unmodified from the contribution.

 

I would appreciate any help pointing me in the right direction.

 

Thanks

Scott

 

Try to re-do the changes to the admin/categories changes...it sounds like you missed something there.

 

Or visit oscommerce-solutions.com and download the full install...simply replace your categories.php file with the one in that package.

Link to comment
Share on other sites

I'm installing version 2.4.9. Just about finished with the install.

 

I'm getting this error in admin when I click on Header Tags in the left column.

 

Warning: file(../includes/languages/english/header_tags.php): failed to open stream: No such file or directory in /hsphere/local/home/baldys0/funtasticcandle.com/admin/header_tags_controller.php on line 228

 

I'm pretty new to PHP. I goto /admin/header_tags_controller.php, and line 228 reads 

 

$fp = file($filenameEng);

 

I don't know what the error message is trying to tell me, nor how to determine what the variable $filenameEng is supposed to be.

 

The file catalog/includes/languages/english/header_tags.php exists (and is unmodified from the contribution), but there is no such file in /admin in that directory. The file header_tags_controller.php is also unmodified from the contribution.

 

I would appreciate any help pointing me in the right direction.

 

Thanks

Scott

There are some files you have to copy from the contribution to the includes directory in your shop. Did you do that? It sounds like it can't find them.

 

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