Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Header Tags Controller for Admin MS 2.2


Farrukh

Recommended Posts

Jack,

 

I found a couple more glitches to the 2.5.5 package. I have pretty much completed rolling-up of most of the partial contribs since 2.5.5 into a new complete package. the additions/corrections follow:

 

-> added install notes about file permissions from 241 (16 Oct 2005).

-> added install notes about some hosts restricting PHP CHMOD from HenSod (9 Sep 2005)

-> corrections for stores with /admin/ outside the catalog directory. surfalot (2 Oct 2005)

-> added the tep_ function to the (Explain) info links in two pages, without this, the link

didn't work on stores with Administration Access Level Accounts installed. (new)

-> moved remaining language to the language file. (new)

-> included the now complete French language files contributed by: maxime (13 Sep 2005)

-> Merged XHTML compliant header code contributed by: yansfung (10 Sep 2005)

-> Added Missing define('BOX_HEADER_TAGS_FILL_TAGS', 'Fill Tags'); in english.php new-shop replace files

-> removed an error in the catalog_for_new_shop_only/admin/categories.php file. This was step

two of the Install_Admin.php for the admin/categories.php file. Should have been a replacement.

The person making this file instead did an Add After. (would not have affected the functionality)

 

 

the instuction notes at the end of the catalog install are:

 

 

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

===========

These next two steps are not necessarily needed by everyone. The information is included

to help those that may need it. You can determine whether you need to take these step

by completing the installation and going to the admin, select the "Header Tags" admin menu

item, select "Text Control", then change an item and save the settings. If is saves, skip

these steps. If you have an error, take a look at the following 2 potential steps.

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

===========

 

POTENTIAL STEP #1

 

ADDITIONAL INSTALL INSTRUCTIONS (by Steve(aka 241))

 

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

 

And off course and other header_tags.php created for languages:

catalog/includes/languages/<language>/header_tags.php

 

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

 

POTENTIAL STEP #2

 

Issue reported by H. S?derlind ([email protected]) on 2005-09-09

 

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.

 

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;

} */

}

 

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

 

I was talking with 241 about his notes. He seems to think that catalog/includes/header_tags.php needs write permissions. But this file doesn't have meta data stored in it. I believe the special permissions should only be on the catalog/includes/languages/english/header_tags.php file. What do you think?

 

any thing else you'd like to add to a roll-up package? What to look it over before I post it? I did to a new shop replace install to check the work last night.

-todd

Link to comment
Share on other sites

  • Replies 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

Both files need write permissions since new sections are added when a page is added in admin->Page Control. As for the other changes, I can't comment on them. At least a few of the things you mentioned were not present in my latest version and were introduced by others. So they didn't need "fixing" in my version. If the version you uploaded works, then that should be the one you use.

 

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

Both files need write permissions since new sections are added when a page is added in admin->Page Control. If the version you uploaded works, then that should be the one you use.

 

Jack

 

I guess I'll just take you and 241's word for it. I see only code in the catalog/includes/header_tags.php (i.e switch (true) { case (strstr) } etc.). The meta data is in catalog/includes/languages/english/header_tags.php only. When I edit tags and save them it changes only catalog/includes/languages/english/header_tags.php not catalog/includes/header_tags.php. When I add new pages is saves to catalog/includes/languages/english/header_tags.php. Category tags as saved to the DB, products tags are saved to the DB. How or what is changing this file (catalog/includes/header_tags.php) is beyond me. It's not changing on my server. I'm just trying to accurate by discussing things with folks. But it doesn't seem like anyone wants to listen.

 

As for the other changes, I can't comment on them. At least a few of the things you mentioned were not present in my latest version and were introduced by others. So they didn't need "fixing" in my version.

 

Woh! the infallable attitudes I'm getting here in these forums are truly amazing. Nobody is making any judgments (least of all me). I started with your upload 2.5.5 (7 Sep 2005), as stated. I just wanted to contribute my experiences while installing the great contrib. Everything I have fixed/updated was in that package you upload 7 Sep 2005. Maybe someone switched the files on the server... ;-)

 

Feel free to check yourself. The missing define you have in the update doc, and the new install doc, but it's not in the catalog_for_new_shop_only/../english.php file, just as I state. same goes for the rest of them. At little bit of humility goes a long way for respect.

 

I'm not perfect either, that is why I offered it to you for a check. I thought this was a community, I'm just trying to be communal and not look like I'll trying to take over anything. But if you don't care either way, I'll just upload it. I guess I'm just a crazy man with 25 years of programming experience. (started with assembly on the Apple II in '80)

Link to comment
Share on other sites

Try going to admin->Header Tags->Page Control and add a new page. Call it XXX. Update it so it saves it. Now go to includes/header_tags.php. If you don't see a block of code for XXX then you have something wrong with the installation.

 

I'm sorry you took offense at my statements. It wasn't meant for you - nor anyone in particualr for that matter. There was a thread recently discussing how contributions should be updated. There is a big problem with the contributions since anyone can upload to them. Of course, that is the strength of the system too. This is a community and the contributions are open for anyone to upload to. Header Tags, in fact, is not my contribution so I am obviously not against others uploading changes. The problem is that sometimes someone uploads things that should not be uploaded. Go back in this thread a few months and you will see post after post asking what was wrong with Header Tags. It turns out someone had uploaded a broken version. I don't have time to properly support my own contributions, much less the time needed to fix someone else's mistakes, especially if they can't bother to upload a full contribuiton, which is usually the case. That's all I meant. How can I say that the latest contribution works or not if I have never seen it?

 

You don't need my approval to upload the changes you made. If they are improvements and they work, then you should do it. If they don't work, which I am not saying is the case, then there will be questions posted here asking why. As long as you are willing to take the time to address those problems, then there's no problem. But, until I have time to investigate the changes, all I can do is guess at the fix so I most likely will not even try to help in those cases since it could make the problem worse.

 

I don't know what you mean by "infallable attitudes" in the forums. I try my best to help others and there are many more that do the same. Sometime words can be mistaken and maybe that is what you are seeing, although I am not.

 

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

Try going to admin->Header Tags->Page Control and add a new page. Call it XXX. Update it so it saves it. Now go to includes/header_tags.php. If you don't see a block of code for XXX then you have something wrong with the installation.

 

I see where it is changing now. Thanks for your patience on that issue. I can think of a couple different ways that part could have been implemented better.

 

Infallible is "Incapable of erring" or as I tried to use it, "Incapable of erring" attitude. Basically meaning some folks here don't think they are capable of making a mistake. It was just the way that sentence read, not "my version" that made me think of that.

 

I had a little extra time and thought I would pass on my corrections to the community. And while I was at it, I might as well include the other tid bits that were uploaded.

 

I guess that concludes my research, I'll upload the updated package.

 

Todd

Edited by surfalot
Link to comment
Share on other sites

Jack and Todd,

 

Thank you both for your help with the Header Tags.

It turned out that I made some errors when updating

the admin/categories.php, but Todd resolved that for

me.

 

You both do great work and I am very grateful to have

people like you here to help me.

 

I don't know PHP, but I plan to learn about it because

I think it will help me quite a bit if I understand what

I am doing. I want to customize my website category

box somehow, but non of the Contributions seem to

fit what I am looking for.

 

After a while, you learn not to just go and install any

contribution since not everyone is accurate and

thorough. I am learning to read the support threads

to see what problems people are having and if they

are getting any assistance.

 

I read 50 or so pages of this support thread and I

see the time that has been devoted to helping others.

 

You both have great Contributions and are very

helpful.

 

Thanks!

Sherry

Link to comment
Share on other sites

I see where it is changing now. Thanks for your patience on that issue. I can think of a couple different ways that part could have been implemented better.

 

Infallible is "Incapable of erring" or as I tried to use it, "Incapable of erring" attitude. Basically meaning some folks here don't think they are capable of making a mistake. It was just the way that sentence read, not "my version" that made me think of that.

 

I had a little extra time and thought I would pass on my corrections to the community. And while I was at it, I might as well include the other tid bits that were uploaded.

 

I guess that concludes my research, I'll upload the updated package.

 

Todd

Your statement that it "could have been implemented better" is the problem I was trying to express. I spent a lot of time on the last 10 or 15 updates. My coding style is my own. There is always someone that thinks they can do it better. And that may be. But then the coding style isn't mine anymore and if I plan to support it, I have just doubled my workload. That's not something any of the authors enjoy, I'm sure. I know I don't.

 

Yes, I know what infallible means but your usage didn't make any sense to me since I don't see that. And you obviously have not read some of my posts since I make mistakes as much as the next poster. :) And updates to my contributions are, at times, only to fix my own errors - which I readily admit to.

 

Oh, and by the way, you said "Feel free to check yourself. The missing define you have in the update doc, and the new install doc, but it's not in the catalog_for_new_shop..."

 

From

Add to admin/includes/languages/english.php before the closing ?>. Repeat

for any other language you would like Header Tags to work with.

 

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

define('BOX_HEADER_TAGS_FILL_TAGS', 'Fill Tags');

and a search of the english file shows it is there. I think you fell victim to the "fixes" I was speaking about earlier by grabbing an updated version.

 

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

Your statement that it "could have been implemented better" is the problem I was trying to express. I spent a lot of time on the last 10 or 15 updates. My coding style is my own. There is always someone that thinks they can do it better. And that may be. But then the coding style isn't mine anymore and if I plan to support it, I have just doubled my workload. That's not something any of the authors enjoy, I'm sure. I know I don't.

 

Yes, I know what infallible means but your usage didn't make any sense to me since I don't see that. And you obviously have not read some of my posts since I make mistakes as much as the next poster. :) And updates to my contributions are, at times, only to fix my own errors - which I readily admit to.

 

Oh, and by the way, you said "Feel free to check yourself. The missing define you have in the update doc, and the new install doc, but it's not in the catalog_for_new_shop..."

 

From and a search of the english file shows it is there. I think you fell victim to the "fixes" I was speaking about earlier by grabbing an updated version.

 

Jack

 

I'm sure your programming is just fine. I just would have put it all in the DB instead manually setting up defines for each file. that's all I was talking about. I still have a store that has a 2.2 version well before the decision to put tags in the DB.

 

Yeah I understand how that update vs. support works. That is a problem if you choose to continue supporting. I just wanted to roll-up the things I found plus the other little update posts instead of posting another little fix. I've been using it for years thought I'd contribute back. I would not put up a post if I wasn't willing to support it. I don't want to step on anyones toes either.

 

I don't have the first clue what infobroker 14 Sep 2005 update is all about. so that is being left out.

 

>> I think you fell victim to the "fixes" I was speaking about earlier by grabbing...

 

That is strange, I must be completely insane. are you sure you are downloading the Jack_mcs 7 Sep 2005 post? I've downloaded and unpacked it 3 times today alone. I even tried 241's upload which includes the full zip of 2.5.5. I don't get it. Same thing.

 

I too grep the package and get the same results each time, it's not there in my download of Jack_mcs 7 Sep 2005. The way I found the error was when I did the fresh copy-over install. It showed BOX_HEADER_TAGS_FILL_TAGS in the admin menu. What ever. It will be there in my upload.

Link to comment
Share on other sites

I try to stay away from the database since it causes unnecessary bloat. But the more important reason is that I wanted it to be compatible with previous versions in which the files had to be edited manually.

 

You're right about the version on the server. It is different from my version I have here with the same number. I must have updated it after I uploaded and forgot to upload again. Just proves my point of my fallibility. :)

 

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

After installing this contribution and selecting "Fill Empty Tags" the products all have information in the header, description, KW

 

but... going to the public catalog pages and viewing source of each product only gives my defaulted meta info. What am I doing wrong?

 

Thanks in advance

 

-Roq

Link to comment
Share on other sites

im my header tags controller i am having problems with the default title, default decriptions, default keywords (basically the info you can add at the very top of the admin contronl panel)

 

everytime i seem to change these default values they seem to appearr back to what they were previously after a little while.

 

i make the changes in the default text boxes and hit the update button at the bottom of the screen. it seems to update it. but when i go and check the next day the text goes back to want was originally written.

 

what seems to be wrong?

Link to comment
Share on other sites

Are you saying that if you make a change and check a few minutes later, the change is still there but if you check the next day it has changed?

 

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

Are you saying that if you make a change and check a few minutes later, the change is still there but if you check the next day it has changed?

 

Jack

 

yes that is what i am saying. i make the change it stays there for a little while then goes back to the original text.

Link to comment
Share on other sites

I find that hard to believe. I think you may not be looking at it correctly. Once the file is changed, there is no way fo it to change back on its own. I suppose your host could have some program installed forcing the files to be restored but that would make the site useless and seerver no purpose.

 

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 that is what i am saying. i make the change it stays there for a little while then goes back to the original text.

 

The only thought I had was this... Those settings are in a file not the database. If you are maybe "synchronizing" changes to your server each night from FTP or Dreamweaver, that will overwrite what the admin does. If this is true, you need to synchronize down the files includes/header_tags.php and includes/languages/english/header_tags.php after making that change in the Header Tags admin.

 

but... going to the public catalog pages and viewing source of each product only gives my defaulted meta info. What am I doing wrong?

 

You got me baffled. The only guess I have is that maybe this installation of HTC is an upgrade? Are you sure you have the latest catalog/includes/header_tags.php and catalog/includes/languages/english/header_tags.php uploaded and not an older version there? By your description, the code snippet has to be in your product_info.php and those files have to be there. Since those conditions are met, is should work.

Edited by surfalot
Link to comment
Share on other sites

I try to stay away from the database since it causes unnecessary bloat. But the more important reason is that I wanted it to be compatible with previous versions in which the files had to be edited manually.

Bloat is a necessary thing to utililize the db for what is meant to do. If a person is concerned about it, they simply need to limit the additional things they install.

But the more important reason is that I wanted it to be compatible with previous versions in which the files had to be edited manually.

Yeah, I meant I'd have done it differently from the beginning. (your additions are just fine) :)

-----------

So, knowing what you know now about the latest upload, do you want to collaborate and compare what I have put together with what you have in storage so the next upload is as complete as possible? I'll do it if you send me your latest zip. I'll just run it through beyond compare for a quick look.

Link to comment
Share on other sites

I have just finished installing the HTC v.2.5.5 and have this error msg when I click on the "Head Tags" button in the admin panel:

 

Warning: file(../store/includes/languages/english/header_tags.php): failed to open stream: No such file or directory in /home/httpd/vhosts/cpearl.com/httpdocs/store/admin/header_tags_controller.php on line 254

 

What really pazzles me is that I have the file (header_tags.php) setting perfectly right where it's suppose to be with propert permissions set (chmod 666). For some reason it seems that the controller's having problem accessing it.

 

Any advice on how I can fix this?

 

btw, same goes for the header_tags_english.php as well.

 

Much appreciated.

 

moby74,

 

I finally got it figured out. (Sort off...) The way I got it to work is by changing the '..' . DIR_WS_CATALOG to DIR_FS_CATALOG . DIR_WS_CATALOG

 

This is because I found that for some reason the server is not processing '..' properly and the DIR_FS_CATALOG will force the server to change the directory to root of your site directly and then the DIR_WS_CATALOG will bring it to the right sub-folder which your store was installed it. You'll have to make this change in both the /admin/header_tags_controller.php and the /admin/header_tags_english.php where the variable ($filename, I think) is established.

 

I don't know if this work around will have any effects for those stores that were installed in the root directory, but in theory it should work just the same... but then again... computer coding is the closest thing to magic now a days... :)

Link to comment
Share on other sites

Bloat is a necessary thing to utililize the db for what is meant to do. If a person is concerned about it, they simply need to limit the additional things they install.
That's not a very good solution, in my opinion. Either live with the slow down caused by extra database calls or don't use it.

 

Yeah, I meant I'd have done it differently from the beginning. (your additions are just fine) :)

Like I said, it's a matter of coding style. I much prefer using the quicker file method over the slow database calls.

-----------

So, knowing what you know now about the latest upload, do you want to collaborate and compare what I have put together with what you have in storage so the next upload is as complete as possible? I'll do it if you send me your latest zip. I'll just run it through beyond compare for a quick look.

As far as I know, that was the only change I had made.

 

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 find that hard to believe. I think you may not be looking at it correctly. Once the file is changed, there is no way fo it to change back on its own. I suppose your host could have some program installed forcing the files to be restored but that would make the site useless and seerver no purpose.

 

Jack

 

sorry, i got it wrong! what is happening is this. if i enter the information in the default areas and then update, the changes are done according to the information in the boxes on the same page. but when i click to goto another page then immediatly come back the information goes back to what it was originally. this only happens to the default title, decription and keywords, not to any other pages ive entered keywords in for.

 

can you help from this?

Link to comment
Share on other sites

Hello,

 

i have installed this contribution (v.2.3.8)

 

it works fine.

 

now i want upgrade this contrib, but i am not sure how to upgrade.

 

should i install another version before 2.5.5

or which .txt should i take.

 

i have read the .txt but i am not sure which sql

 

 

 

thanks in advandce

 

bg

michael

 

---

Link to comment
Share on other sites

There were some major changes between the version you are using and 2.4 (as I recall) and then another big change somewhere after that. Unfortunately, the update docs were not updated properly is all releases so there is no easy way to get from where you are to the lastest version. If you are comfortable with the code, you can install the latest version and work out the bugs. There shouldn't be too many. If not, you will need to upgrade one or two versions at a time.

 

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 lost on this contrib, why so bulky?

 

I changed everything per the instructions and I dont see ANY changes to the site, not even in admin, shouldnt there be a menu in admin like the screenshot?

 

Also another comment, I just downloaded this contrib and found that someone just added a txt file with their changes to the zip of the contrib and reuploaded, if it needed fixed why not just change and upload the whole thing. geez, its already complicated enough.

Link to comment
Share on other sites

HeaderTags_V_2.5.4_1_2
It was fixed in 2.5.5.

 

Jack

 

 

I am lost on this contrib, why so bulky?
It is a large contribution. There's no way around that, at least that I can see.
I changed everything per the instructions and I dont see ANY changes to the site, not even in admin, shouldnt there be a menu in admin like the screenshot?
The instructions are broken up into sections. If you followed the instructions, then you should have seen a change in your title after performing the Install_Catalog.txt insructions. Did you see that?
Also another comment, I just downloaded this contrib and found that someone just added a txt file with their changes to the zip of the contrib and reuploaded, if it needed fixed why not just change and upload the whole thing. geez, its already complicated enough.
I couldn't agree more. Read the last page or two about updates being made to the contribution. This is just the sort of thing I was talking about.

 

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