Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Header Tags Controller for Admin MS 2.2


Farrukh

Recommended Posts

Same problem. You need to go back through the instructions since you are missing files. If you are using STS the install is a little different and you should look at the STS package for those instructions.

 

Jack

 

 

Thanks jack i go see all the instalation, im not using sts, i install your last version i have SEO i dont now if its affect in some way may instalation.

 

you can see in my shop http://sat25.com

 

i go see my instalation then i post

 

thanks

Link to comment
Share on other sites

  • Replies 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

I have installed this contribution for a few friends but on this recent one I'm stumped. Basically the client purchased a Template Monster oscommerce template and wanted this installed, I thought sure no problem. Wrong! What do I do if a section of coding doesn't even exist that needs to be changed?

 

This is the part that is missing:

 

Around line 78:

 

Find

 

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

 

and replace it with

 

<td><h1><?php echo $category['categories_htc_title_tag']; ?></h1></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

<?php if (tep_not_null($category['categories_htc_description'])) { ?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><h2><?php echo $category['categories_htc_description']; ?></h2></td>

</tr>

<?php } ?>

 

Thanks!

Link to comment
Share on other sites

That's common with many templates. If you want to use the option that section of code provides, you will have to add the code back in. Otherwise, just ignore 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

Hi Jack

 

OK I have downloaded everything & have gone throught it all. Please can I check a few things? :D

 

To do:

 

update_V_2.5.9_to_2.6.0.txt

 

2) Upload all the files from the catalog/admin

 

does this mean all the admin files that are in the catalog folder AND all the includes/... files in the catalog folder? I think so but it implies only the admin ones?

 

I will just upload the files & go into admin again! :P but do I need to add the Google analytical code at the bottom again, or this an automatic thing?

 

update_v_2.6.0_to_2.6.2.txt

 

Do I need to do these?

 

update_categories_descriptions.txt

 

update_headertags_admin_controller.txt I do have the code it asks to look for in my present file.

 

update_headertags_language.txt I don't think I need this one. :huh:

 

If yes, do I do these after, or before the updates to v_2.6.2?

 

I cannot see any reference to doing anything with the database? Am I right?

 

Thank you so much for your help. With these answered I think I might have it all up straight in my head!!

 

Julie

Link to comment
Share on other sites

No database changes were made in these last two updates and the files in admin won't hurt to replace since those are not changed by you. The only thing you need to be concerned with are the files I mentioned already. Some of the changes might apply to language files. if you don't do those, it will be obvious since you will get text displayed in capital letters.

 

So, in short, upload everything in the latest archive (header tags only files), make the changes to the files (column_left.php and product_info.php) and reload your tags as mentioned already. No damage will be done except for the loss of the tags for the home page, default section and whichever other pages you may have added, if you overwrite that) and those are easily set up again.

 

Jack

Edited by Jack_mcs

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

No database changes were made in these last two updates and the files in admin won't hurt to replace since those are not changed by you. The only thing you need to be concerned with are the files I mentioned already. Some of the changes might apply to language files. if you don't do those, it will be obvious since you will get text displayed in capital letters.

 

So, in short, upload everything in the latest archive (header tags only files), make the changes to the files (column_left.php and product_info.php) and reload your tags as mentioned already. No damage will be done except for the loss of the tags for the home page, default section and whichever other pages you may have added, if you overwrite that) and those are easily set up again.

 

Jack

 

It's 1.30am so I guess I shouldn't be doing any serious code changes, but I just couldn't wait until tomorrow.

Thanks for your instructions Jack. I have successfully :D (I think) upgraded from 2.5.7 (2.5.9) to 2.6.0 & then 2.6.2 :D :D

 

I just want to say to others who label this contribution difficult, "if I can do it so can you...believe me ;) "

 

I am not sure if I'll keep the box as I have long titles etc & it is miss shaped. I am also not sure if I have mastered the keywords & titles & HTTA,HTDA,HTKA,HTCA,HTPA yet. :blink: I don't want to get too many repeats & want to get the most out of this great contribution. If you have time Jack, could you have a peak at my site & see what you think please?

 

I have another question that can wait until tomorrow about header tags & the newsletter contribution (which has a code for the header tags)

 

Thanks for your help Jack :thumbsup:

 

Julie

Link to comment
Share on other sites

Congratulations, :) The problem with the infobox is that it is trying to use different corners. Find this line in includes/boxes/header_tags.php

new infoBoxHeading($info_box_contents, false, false);

adn change to

new infoBoxHeading($info_box_contents, true, true);

On your site, I would remove the site name from the title. That is a common mistake that serves no purpose and limits the effectiveness of the keywords in the title.

 

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

Congratulations, :) The problem with the infobox is that it is trying to use different corners. Find this line in includes/boxes/header_tags.php
new infoBoxHeading($info_box_contents, false, false);

adn change to

new infoBoxHeading($info_box_contents, true, true);

On your site, I would remove the site name from the title. That is a common mistake that serves no purpose and limits the effectiveness of the keywords in the title.

 

Jack

I have done that with the inc/boxes/header_tags.php :blink:

 

Which one do I uncheck for that please as I seem to have tried all combinations of tick. There is always one combination that you miss. :blush: There is one keyword in my site title but I think I can include that else where. Is there a suggested limit to the length of what you put in description & keywords?

 

Now for the other document files :D

 

Shall I do the one titled:

update_HeaderTags_Admin_Controller.txt ?

I would like to add other info pages & this seems to say it can do that. I have a few that are in red & when I try to add a page & tags it say I don't have permission. Is everything already there without doing this & I just need to do something with the permissions settings?

 

I have a box at the bottom for categories description so I guess I do not need to do Update_Categories_Descriptions.txt or is it an update?

 

Thanks :thumbsup:

Julie

Link to comment
Share on other sites

Hi again Jack

 

Right as mentioned last night this came with the newsletter contribution & says it will add header tags for those pages, for 2.3 onwards, BUT it doesn't work. Are you able to see what is wrong please? If not am I able to include these pages in as the others using the header tags now?

 

###Author

http://www.bristleconeweb.com - Jonathan Stanley

 

###Description

Very simple contribution. Articles written for your site can help generate free search engine traffic, however they work alot better if the title tags correspond. This contri will change the title tag to include the article and category in the following format:

article name: Blue Widget

category: Gadgets

store name: Joe's Toy World

*Title Tag would be: Blue Widget Gadgets Joe's Toy World

 

###Install Instructions

***note, in order to use this contribution you must have the newsdesk contribution as well as the webmakers header tags generator

***this has been tested and working with header tags v2.3 contribution combined with newsdesk 1.48.2

 

 

 

1)BACKUP

 

2)If this is a fresh install, you should be able to copy the header_tags.php file to /includes folder and you are done! Otherwise, open /includes/header_tags.php

 

3)Look for

// Define specific settings per page:

switch (true) {

 

4)Insert the following immediately after the switch statement

 

// NEWSDESK_INDEX.PHP etc

case ( strstr($_SERVER['PHP_SELF'],'newsdesk_index.php') or

strstr($PHP_SELF,'newsdesk_index.php') or

strstr($_SERVER['PHP_SELF'],'newsdesk_info.php') or

strstr($PHP_SELF,'newsdesk_info.php')):

$the_newsdesk_query = tep_db_query("

SELECT

categories_name

FROM

" . TABLE_NEWSDESK_CATEGORIES_DESCRIPTION . "

WHERE

categories_id = '" . $HTTP_GET_VARS['newsPath'] . "'

AND language_id='" . $languages_id . "'");

$the_newsdesk_category = tep_db_fetch_array($the_newsdesk_query);

$the_title = $the_newsdesk_category['categories_name'] . ' - ' . HEAD_TITLE_TAG_ALL;

if ($HTTP_GET_VARS['newsdesk_id'] != ''){

$the_newsdesk_id_query = tep_db_query("

SELECT

newsdesk_article_name

FROM

" . TABLE_NEWSDESK_DESCRIPTION . "

WHERE

newsdesk_id = '" . $HTTP_GET_VARS['newsdesk_id'] . "'

AND language_id='" . $languages_id . "'");

$the_newsdesk_article = tep_db_fetch_array($the_newsdesk_id_query);

$the_title = $the_newsdesk_article['newsdesk_article_name'] . ' ' . $the_title;

}

 

break;

 

5) Enjoy

 

Thanks again :D

Julie

Link to comment
Share on other sites

That change is in the product_info file and should have nothing to do with STS since once that code is used, STS is finished loading. You might want to look at the instructions for it again. Placing the codein the header_tags.php file as you did means the code ends up in the <head> section, which isn't proper coding.

Jack

Hi Jack, Thanks for your reply.

I don't know if it is a STS problem or not, but I've dealed with the problem by adding the page where are the variables I need , in the application_top page. Thus those variables can be accessed from everypage.

So in application_top.php I added at the end :

require('includes/header_tags.php');

And now the $tags_array['title'] is accessible on every page of my website.

Seb

Osc 2.2 MS2

Link to comment
Share on other sites

I have done that with the inc/boxes/header_tags.php :blink:

 

Which one do I uncheck for that please as I seem to have tried all combinations of tick. There is always one combination that you miss. :blush: There is one keyword in my site title but I think I can include that else where. Is there a suggested limit to the length of what you put in description & keywords?

 

Now for the other document files :D

 

Shall I do the one titled:

update_HeaderTags_Admin_Controller.txt ?

I would like to add other info pages & this seems to say it can do that. I have a few that are in red & when I try to add a page & tags it say I don't have permission. Is everything already there without doing this & I just need to do something with the permissions settings?

 

I have a box at the bottom for categories description so I guess I do not need to do Update_Categories_Descriptions.txt or is it an update?

 

Thanks :thumbsup:

Julie

I don't understand what you are saying by "update_HeaderTags_Admin_Controller.txt." If the warning about permissions is present, then verify the permissions settings on the includes/header_tags.php and english/header_tags.php files are the same as on the images directory.

 

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

 

Right as mentioned last night this came with the newsletter contribution & says it will add header tags for those pages, for 2.3 onwards, BUT it doesn't work. Are you able to see what is wrong please? If not am I able to include these pages in as the others using the header tags now?

Thanks again :D

Julie

That code is for a very old version and is not compatible with the present code. It should work if you replace all instances of
$the_title

with

$tags_array['title']

. The same for $the_description and $the_keywords if they are there too.

 

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 understand what you are saying by "update_HeaderTags_Admin_Controller.txt." If the warning about permissions is present, then verify the permissions settings on the includes/header_tags.php and english/header_tags.php files are the same as on the images directory.

 

Jack

Sorry Jack

 

In the latest download there is a folder called update_docs. That is where I got the instructions for the update from 2.5.7 right through to 2.6.2. update_headertags_admin_controller.txt is one of the instruction files in it. This looks like an extra if you want it. I am just checking that I install/update everything so that I can keep up with it again.

 

Here is the file

 

========================================================================

This option is only available for version of Header Tags after

V 2.3.9. You can tell if you have a version after 2.3.9 by looking at

the includes/header_tags.php file. If you have this line

 

$tags_array = array();

 

in that file, then this modification should work for you.

 

========================================================================

What it does!

 

If you want Header Tags to work for a page on your site (except for the

ones already setup) you need to edit the includes/header_tags.php and

includes/languages/english/header_tags.php files. This addition will allow

you to do that from within admin. You can add, delete and modify the

listings. Note that the HTCA tag appears for all entries. Currently, it is

used only for the index.php file. This might change in the future so I went

ahead and added the code for it now.

 

========================================================================

How to Install

 

1 - Copy the following new files to your shop in the same location:

 

admin/header_tags_controller.php

admin/header_tags_english.php

admin/includes/functions/header_tags.php

admin/includes/boxes/header_tags_controller.php

admin/includes/languages/english/header_tags_controller.php

 

2 - add to admin/includes/filenames.php anywhere before the closing ?>

 

define('FILENAME_HEADER_TAGS_CONTROLLER', 'header_tags_controller.php');

define('FILENAME_HEADER_TAGS_ENGLISH', 'header_tags_english.php');

 

3 - add to admin/includes/languages/english.php before the closing ?>

 

// header_tags_controller text in includes/boxes/header_tags_controller.php

define('BOX_HEADING_HEADER_TAGS_CONTROLLER', 'Header Tags');

define('BOX_HEADER_TAGS_ADD_A_PAGE', 'Page Control');

define('BOX_HEADER_TAGS_ENGLISH', 'Text Control');

 

4 - add to admin/includes/column_left.php before the closing ?>

 

require(DIR_WS_BOXES . 'header_tags_controller.php');

 

Basically I think I need to go through all my other info pages & add them so I can put title/description/keywords etc. Only the normal default ones are there at present, with a few extra pages in red.

 

Hope I have explained myself better. :blush:

 

Thanks

Julie

Link to comment
Share on other sites

That update file is for a previous version. You just need to use the one that says Update from 2.5.9... and update from 2.6.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

That update file is for a previous version. You just need to use the one that says Update from 2.5.9... and update from 2.6.0...

 

Jack

Thank you for all your help Jack. :thumbsup: Now to play & get the keywords right (would help :lol: )

 

Julie

Link to comment
Share on other sites

This is my first foray into search engine optimization for my e-commerce site. I am having problems locating certain strings of code in the index.php. To start with, following the directions in Install_Catalog.txt, Around line 78:

 

Find

 

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

 

I have no entries in my index.php that have anything with HEADING_TITLE in them. It seems to not be present. Also the next string of code I cannot find is:

Around line 298

 

Find

 

<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

I am using EditPlus editor and notepad and have searched for HEADING, HEADING_TITLE, etc to no avail. Is this a big problem? Does that code have to be there and replaced? I am by no means a php programmer. Please Help!

Thanks

Link to comment
Share on other sites

Hey jack, I like like some of the new features. Food for thought in a future release. I had a situation where the page name I was adding "information.php" kept telling me it existed, but didn't. It was because there was a define() line that had "infomation..." as the first data past the first space.

 

define('HEAD_TITLE_TAG_FAQDESK_INDEX','FAQ-Help Information... and more.');

 

Which is what the function in /admin/includes/functions/header_tags.php is looking for:

 

function GetSectionName($line)
{
 $name = explode(" ", $line);
 $name[1] = trim($name[1]);
 $pos = strpos($name[1], '.');
 return (substr($name[1], 0, $pos)); 
}

 

I changed it to this:

 

function GetSectionName($line)
{
 $name = explode(" ", $line);
 $name[1] = trim($name[1]);
 $pos = strpos($name[1], '.php');
 return (substr($name[1], 0, $pos)); 
}

 

which seemed to work fine. I don't know if ever there would be a case of the Section name not having a .php after it, but this should work for this installation. The other though I had was to check $name[0] for the "//". Maybe do both just to make sure we don't get anymore false positives.

Link to comment
Share on other sites

hey Jack, another situation. This one's been around for a while, just tracked it down.

 

If you have a file called faqdesk_index.php, the code tries to setup for index.php. Will happen for any files in which one file name in contained at the end of another.

 

the resolution that worked for me was instead of these cases:

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

 

do something like this:

 

  case ( (basename($_SERVER['PHP_SELF']) == FILENAME_DEFAULT) || (basename($PHP_SELF) == FILENAME_DEFAULT) ):

 

works for this installation. I'll bet that bug predates your work on this project.

Link to comment
Share on other sites

:D hehe, looks like that was already used for the product reviews and product reviews write pages. probably should be use on all of the decisions in /includes/header_tags.php considering the problem.

Link to comment
Share on other sites

Thanks for the code. You're correct about the last one. The code I added to that section uses strstr. I never bother looking at the other since there was never any reported problems. I will set up a test shop and install FAQ-Desk and play around with it to see if changing that would cause any other problems but it looks good to me at first glance.

 

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

 

I have checked the missing pages on admin>Header Tags>Page Control & noted all the relevant pages I want the code to be added.

Next I add the page name, switches,title,description,keywords in the section above & press update. I do not get any warnings.

Next I go to admin>fill tags & select "fill empty tags" & update. Ok done.

Next I go to admin>text control. The page & details are there, but it is in red, which I read above means the page will not show the header tags.

 

I have read all the instructions, but am not sure what to do next to make my new pages accept (ie show as black & not red)

 

Please could you explain?

 

Thank you.

 

Julie

Link to comment
Share on other sites

Adding the page in Page Control only adds an entry for that page in the Header Tags files. It doesn't add the actual Header Tags code to the file. See the Install_Catalog.txt file where it mentions changing the code for the <title>. You have to do that for each page you want to use Header Tags with.

 

Also, you don't need to run Fill Tags for new pages. That option is only for filling in items stored in the database (categories, manufacturers and products). And even for those, the tags are filled automatically when those items are created in case you forget.

 

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

 

I have read and read about this contrib and it has been recommended so strongly, that I had to give it a whirl even though I was very leary about doing so on an already modified site. Alas, I have run into trouble, but I think it may be minor, at least that's what I'm hoping;)

 

Header Tags V 2.6.2

 

I have successfully completed steps 1 (loaded http://www.mysite.com/database_setup.php and saw the success message), step 2 (refreshed my home page and saw "Home Page osc" at the top). I am currently on step 3 and have made it to the part of the instructions where I am editing admin/categories.php. I have made my way down the instructions until I got to the line that says...

 

"FIND (about line 1013)

 

$category_inputs_string = '';...etc...etc...

 

The problem is that I cannot find that line. There was a similar line changed before this step...

"Around line 984, find

 

$category_inputs_string = '';....etc...etc...

 

...and I added the appropriate code after that.

 

So, the code that the "FIND (about line 1013)" refers to does not exist in my admin/categories.php file. I decided to check the next step to see if that code existed...and it's not there either. That code is referred to in the instructions here...

 

"FIND (about line 1022) $contents[] = array('text' => '<br>' . TEXT_EDIT_SORT_ORDER . '<br>' ....etc..etc..."

 

A similar line of code was also referred to earlier in the instructions, and I added the specified code after it. I even did a search with my editor for "TEXT_EDIT_SORT_ORDER" just to make sure I wasn't missing another instance of this code, but could only find the first one.

 

I have a sinking feeling that maybe these lines have been deleted from a previous contribution, but I can't say for sure. I have not gone any further with this...it's on hold.

 

Can anyone please assist me with what I might do next? Would anyone more knowledgable consider looking at my admin/categories.php page to possibly tell me if this code can just be added to the existing code?

 

Thanks to anyone for any help/advice with this issue.

 

Adam

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

Those lines are in all oscommerce shops. I suppose they could be removed for some reason, maybe some contribution you have installed, but I've never ran across where they are not in there. The contribution comes with a completed categories file. You can use that to compate against. If you don't find it with that, post your categories file here.

 

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