Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Header Tags Controller for Admin MS 2.2


Farrukh

Recommended Posts

Did you add the header tags code into those files? See Install_Catalog.txt on how to do that.

 

Jack

 

 

1 - open incldues/languages/english/header_tags.php, find this block of code, copy it

and paste it somewhere else in the file:

 

// 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', '');

define('HEAD_DESC_TAG_DEFAULT','');

define('HEAD_KEY_TAG_DEFAULT','');

 

Then change all occurrences of DEFAULT to the name of your page. For example, if you want

to add a contact_us page, it would be CONTACT_US.

 

2 - open includes/header_tags.php and find this block of code, copy it and paste it

somewhere else in the file:

 

// about_us.PHP - was default.php

case (strstr($_SERVER['PHP_SELF'],FILENAME_ABOUT_US) or strstr($PHP_SELF, FILENAME_ABOUT_US) ):

$tags_array = tep_header_tag_page(HTTA_ABOUTUS_ON, HEAD_TITLE_TAG_ABOUTUS,

HTDA_ABOUTUS_ON, HEAD_DESC_TAG_ABOUTUS,

HTKA_ABOUTUS_ON, HEAD_KEY_TAG_ABOUTUS );

break;

--------------------------------

 

i have done this if it was what you asked. all the references pointing to my files (advanced_search ....)

Link to comment
Share on other sites

  • Replies 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

this is what i have in the advanced_search_result.php

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

 

and this in the advanced_search.php

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<title><?php echo TITLE; ?></title>

 

do i have to change it to this

 

<?php

// BOF: WebMakers.com Changed: Header Tag Controller v2.5.2

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

<title><?php echo TITLE; ?></title>

<?php

}

// EOF: WebMakers.com Changed: Header Tag Controller v2.5.2

?>

Link to comment
Share on other sites

There are very few that not compatible. The SEF one mentioned a few posts ago and Unlimited Pages (or something like that) are the only ones I am aware of. There are some that won't work since they use the same code, like Categories Description and all of the other meta tags contributions. What you have sounds like it falls into this last category. I'm not sure what you are trying to accomplish but Header Tags already displays the product name in the title tag.

 

Jack

 

Thanks for the reply, it is the fact that I installed the title tag contribution a while ago, but would now prefer to have title and head tags filled in with each product's info. Otherwise I would have just installed this contribution certainly

Link to comment
Share on other sites

this is what i have in the advanced_search_result.php

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

 

and this in the advanced_search.php

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<title><?php echo TITLE; ?></title>

 

do i have to change it to this

 

<?php

// BOF: WebMakers.com Changed: Header Tag Controller v2.5.2

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

<title><?php echo TITLE; ?></title>

<?php

}

// EOF: WebMakers.com Changed: Header Tag Controller v2.5.2

?>

 

 

can enyone help me here please

Link to comment
Share on other sites

Hi again, brilliant contribution, thanks, I have it working instead of the older title tags contrib. Can I just check something. Are there separate titles for each product. I can only get the product info page showing a single title.

 

Is there a way that it shows different titles according to product?

 

I have searched on this but not found an answer yet

Link to comment
Share on other sites

delete from English 26 for 4

Warning: chmod(): Operation not permitted in /home/admin/shop/html/admin/includes/functions/header_tags.php on line 203
Cannot change the mode of file (/home/admin/shop/html/includes/header_tags.php)

 

when i press update i always getting this error.

 

how to fix it ?

 

thank you for help.

Link to comment
Share on other sites

delete from English 26 for 4

Warning: chmod(): Operation not permitted in /home/admin/shop/html/admin/includes/functions/header_tags.php on line 203
Cannot change the mode of file (/home/admin/shop/html/includes/header_tags.php)

 

when i press update i always getting this error.

 

how to fix it ?

 

thank you for help.

 

 

Hi look in the install admin file and you will find the following

 

OTES:

 

1 - It is a vital to make sure two files have the correct permissions to allow the Header Tags

admin to access and change them. The permissions should be set to CHMOD 666. If you do not know

what this is, ask your host to help you do this. If you get a message about permission denied like this:

----------

THE ERROR

----------

Warning: fopen(../includes/languages/english/header_tags.php):

failed to open stream: Permission denied in /home/xxxxxx/public_html/admin/includes/functions/header_tags.php on line 208

----------

THE FIX

----------

It is a vital to make sure these files have the correct permissions to allow the Header Tags

admin to access and change them. The permissions should be set to CHMOD 666. If you do not know

what this is, ask your host to help you do this.

 

catalog/includes/header_tags.php

catalog/includes/languages/english/header_tags.php

 

 

2 - Some hosts restrict a function used in catalog/admin/includes/functions/header_tags.php.

If you get an error regarding the chmod() php function in this file, and you have addressed

the file permission stated above, you may have to comment out the function. The following

will direct you to the problem and provide the solution.

-----------

THE ERROR

-----------

Warning: chmod(): Operation not permitted in /home/xxxxxx/public_html/admin/includes/functions/header_tags.php on line 203

Cannot change the mode of file (../includes/languages/english/header_tags.php)

-----------

THE FIX

-----------

OPEN: catalog/admin/includes/functions/header_tags.php

 

Around line 201 you find this code:

 

if (!is_writable($filename))

{

if (!chmod($filename, 0666)) {

echo "Cannot change the mode of file ($filename)";

exit;

}

}

 

Replce that with the following code:

 

if (!is_writable($filename))

{

echo "The file isn't writable";

exit;

/* if (!chmod($filename, 0666)) {

echo "Cannot change the mode of file ($filename)";

exit;

} */

}

 

To change the permissions easily you can usually do the following.

 

Ftp to the site and right click the files mentioned above, choose file permissions and tick the "write" boxes until the code shows as 666

Link to comment
Share on other sites

thank you for your help. its helped to resolve problem.

 

but now i have another one.

 

 <title>HEAD_TITLE_TAG_DEFAULT</title>
 <meta name="Description" content="HEAD_DESC_TAG_DEFAULT"/>
 <meta name="Keywords" content="HEAD_KEY_TAG_DEFAULT"/>

 

script do not change index title. i getting such results on my page source.

what to do ?

 

thank you.

Link to comment
Share on other sites

do i have to change it to this

 

<?php

// BOF: WebMakers.com Changed: Header Tag Controller v2.5.2

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

<title><?php echo TITLE; ?></title>

<?php

}

// EOF: WebMakers.com Changed: Header Tag Controller v2.5.2

?>

yes

Link to comment
Share on other sites

Hi again, brilliant contribution, thanks, I have it working instead of the older title tags contrib. Can I just check something. Are there separate titles for each product. I can only get the product info page showing a single title.

 

Is there a way that it shows different titles according to product?

 

I have searched on this but not found an answer yet

yes, if you completed the admin install, there should be a Header Tags menu. Run the Fill Tags utility. It will automatically fill them all with the product name. You can also manually add them in the product editor.

Link to comment
Share on other sites

thank you for your help. its helped to resolve problem.

 

but now i have another one.

 

 <title>HEAD_TITLE_TAG_DEFAULT</title>
 <meta name="Description" content="HEAD_DESC_TAG_DEFAULT"/>
 <meta name="Keywords" content="HEAD_KEY_TAG_DEFAULT"/>

 

script do not change index title. i getting such results on my page source.

what to do ?

 

thank you.

Did you add the code from the instructions to your /catalog/includes/application_top.php ?

Link to comment
Share on other sites

yes i added it.

the only other thing to make it work for the index.php is to have the files uploaded:

 

catalog/includes/header_tags.php

catalog/includes/languages/english/header_tags.php

 

Try uploading a fresh copy of each of those.

 

are you using BTS or STS?

Link to comment
Share on other sites

yes, if you completed the admin install, there should be a Header Tags menu. Run the Fill Tags utility. It will automatically fill them all with the product name. You can also manually add them in the product editor.

 

 

Thanks, problem resolved by uploading the files in catalog/includes again. Titles now changing

Link to comment
Share on other sites

its posible to make this contribution working with BTS template structure ? maybe someone can give some tips ?

 

thank you.

It works fine in BTS systems. The admin install is the same, unless you want to integrate it into the admin panel most of those shops use, but it is not necessary. For the shop side, you just need to install the header Tags title change to the main_page.tpl and index.default.php file (as I recall.I could be off on those names), as well as the other changes mentioned.

 

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 have to say that although I had no problems with the earlier version of this contribution (at least none that I couldn't work out), this one just doesn't seem to be working for me.

 

Everything is installed, no errors, files chmodded to 666 where needed, Fill Tags completed - and all I get for Meta Tags using View Source is:

 

<META NAME="Description" Content="osCommerce: What's New Here?">

<META NAME="Keywords" CONTENT="What's New Here?">

 

Everything else is there in the database.

 

Am I missing something really simple?

 

Vger

Link to comment
Share on other sites

What version were you running before? The latest one doesn't make a lot of changes from the previous one that should cause any problems that I can think of. If you had a real old version, which it deosn't sound like, then the includes/header_tags.php and english/header_tags.php files were changed as well as the location of the category tags in the database. You could try to add this line to the includes/header_tags.php file. Add it to the index section of code and right before the break; statement.

$tags_array['title']= 'some title';

You could do the same for the description and keywords too if you want. If the text you entered doesn't show up in the source for the home page, then the problem is with the index.php file. Otherwise, the problem is with the database or the above file. The admin section is not needed for Header Tags to work so doing the above should help isolate the problem.

 

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 am using an older version (2.3.7) of this great contribution, but I don't think it supported default.php pages. I've been looking at the newer versions, and it looks like the support is now there. Is there a way to "upgrade" my version without doing a total new install?

 

Thanks a bunch!!

 

~ Dani

Link to comment
Share on other sites

I explained how to do this somewhere in this thread. Basically, you need to run the update categories and update categories description sql files, replace your includes/header_tags.php with the newer one and make all of the new changes to admin. There are update instructions but they apply to each version so with that old of a version, it will be a lot of work. But if you use a file comparison tool, it shouldn't be too difficult.

 

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

how to add header tags in other language ? i sow french language with this contribution. i would like to make this contribution working with my language. maybe someone could give some tips ?

 

thank you.

Link to comment
Share on other sites

Hallo,

 

i use the 2.5.6 and OS 2.2MS2

 

The meta tags are not filled only the standart (default) will filled. I checked the HTTA, HTDA, HTKA i use german i put the header tag in the folder german, by index stand define('HTTA_INDEX_ON','1'); i think this is okay. The h1 will fill and description too are not the meta.

 

What is wrong ? Can one help me

 

Adress for look My Webpage

 

Regards

Schrotti

Link to comment
Share on other sites

I may be misunderstanding the problem but someone mentioned a problem where other languages won't work if english is not listed. That might be the problem you are having.

 

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 again,

 

now i have a little problem with languages. very strange problem.

 

I have two languages. english is default second language is french. When i open my page with mozilla i getting english default language. When i open my shop with IE i getting my french language not the default english.

 

How to resolve such problem ?

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