Forums / General Questions / PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

Views: 1,620

Results 1 to 13 of 13
11 Mar 2012, 12:26 PM
#1
lastmiracle avatar

lastmiracle

New Zenner

Join Date:
Nov 2011
Posts:
11
Plugin Contributions:
0

PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

Hi guys,

I spent the past 2 hours trying to figure out what went wrong with my site. The PHP definition text (like HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere.

I've looked and looked for the last files I changed, and couldn't see what went wrong. It's not just on one or two lines, or one or two pages; the bug's everywhere!

http://jhlstyle.com/index.php?main_page=products_new
http://jhlstyle.com/index.php?main_page=contact_us

The only thing I did tonight was to install Vertical Multilevel Slideout Category Menu and customized the CSS file heavily. I don't think that would have any effect on the PHP codes, would it?

Any help would be greatly appreciated. I've been on this since midnight (it's 5 AM now..) and can't think anymore. I was so close to wrapping up the project (the slideout menu was the final task).. and this happened. :(

Thanks so much!

11 Mar 2012, 12:35 PM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

lastmiracle:

Hi guys,

I spent the past 2 hours trying to figure out what went wrong with my site. The PHP definition text (like HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere.

This is indicative of missing or corrupt /languages/ files.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

11 Mar 2012, 1:16 PM
#3
lastmiracle avatar

lastmiracle

New Zenner

Join Date:
Nov 2011
Posts:
11
Plugin Contributions:
0

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

RodG:

This is indicative of missing or corrupt /languages/ files.

Cheers
Rod

Thanks Rod.. I've just checked all the files in \includes\languages\english\ and the latest "modified date" on those files on the server was weeks ago on Feb 27, on my FTP client.. Would corrupted file show any time stamp?

I'm not sure what exactly happened tonight.. the only files I changed were the template files for the sidebox. But it does make sense that the /languages/ files are affected to cause this problem.

I don't see anything regarding this sidebox add on in the MYDEBUG logs, except for this from another add on: ```
[11-Mar-2012 02:14:59] PHP Warning: Missing argument 1 for template_func::get_template_dir(), called in /home/content/17/8199617/html/includes/templates/template_default/sideboxes/tpl_advanced_categories.php on line 12 and defined in /home/content/17/8199617/html/includes/classes/template_func.php on line 42
[11-Mar-2012 02:14:59] PHP Warning: Missing argument 2 for template_func::get_template_dir(), called in /home/content/17/8199617/html/includes/templates/template_default/sideboxes/tpl_advanced_categories.php on line 12 and defined in /home/content/17/8199617/html/includes/classes/template_func.php on line 42
[11-Mar-2012 02:14:59] PHP Warning: Missing argument 3 for template_func::get_template_dir(), called in /home/content/17/8199617/html/includes/templates/template_default/sideboxes/tpl_advanced_categories.php on line 12 and defined in /home/content/17/8199617/html/includes/classes/template_func.php on line 42
[11-Mar-2012 02:14:59] PHP Warning: Missing argument 4 for template_func::get_template_dir(), called in /home/content/17/8199617/html/includes/templates/template_default/sideboxes/tpl_advanced_categories.php on line 12 and defined in /home/content/17/8199617/html/includes/classes/template_func.php on line 42
[11-Mar-2012 02:14:59] PHP Warning: Missing argument 1 for template_func::get_template_dir(), called in /home/content/17/8199617/html/includes/templates/template_default/sideboxes/tpl_advanced_categories.php on line 13 and defined in /home/content/17/8199617/html/includes/classes/template_func.php on line 42
[11-Mar-2012 02:14:59] PHP Warning: Missing argument 2 for template_func::get_template_dir(), called in /home/content/17/8199617/html/includes/templates/template_default/sideboxes/tpl_advanced_categories.php on line 13 and defined in /home/content/17/8199617/html/includes/classes/template_func.php on line 42
[11-Mar-2012 02:14:59] PHP Warning: Missing argument 3 for template_func::get_template_dir(), called in /home/content/17/8199617/html/includes/templates/template_default/sideboxes/tpl_advanced_categories.php on line 13 and defined in /home/content/17/8199617/html/includes/classes/template_func.php on line 42
[11-Mar-2012 02:14:59] PHP Warning: Missing argument 4 for template_func::get_template_dir(), called in /home/content/17/8199617/html/includes/templates/template_default/sideboxes/tpl_advanced_categories.php on line 13 and defined in /home/content/17/8199617/html/includes/classes/template_func.php on line 42
[11-Mar-2012 02:14:59] PHP Fatal error: Call to undefined function zen_get_categories_ul_li() in /home/content/17/8199617/html/includes/templates/template_default/sideboxes/tpl_advanced_categories.php on line 17


It's another add on, and I've removed all the files from that add on since. Don't know how it would still be causing troubles, if it were the cause.
11 Mar 2012, 1:31 PM
#4
lastmiracle avatar

lastmiracle

New Zenner

Join Date:
Nov 2011
Posts:
11
Plugin Contributions:
0

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

I've run a text-comparison for all the files in languages/ and they were all identical with my original backup dated a few months ago, except for 3 files that I changed last month: define_contact_us.php, contact_us.php, and shopping_cart.php.

I checked their codes and they seem fine, and how would they affect the rest of the site anyway??

:(

11 Mar 2012, 3:19 PM
#5
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

Could be a permissions thing on the appropriate folder on the site that isn't working, or a file or files could have been corrupted, which wouldn't affect the Date Changed value.

I would use the Developers Tool Kit to search for those define names in the working site and check the files it returns in the non-working site.

11 Mar 2012, 10:09 PM
#6
lastmiracle avatar

lastmiracle

New Zenner

Join Date:
Nov 2011
Posts:
11
Plugin Contributions:
0

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

stevesh:

Could be a permissions thing on the appropriate folder on the site that isn't working, or a file or files could have been corrupted, which wouldn't affect the Date Changed value.

I would use the Developers Tool Kit to search for those define names in the working site and check the files it returns in the non-working site.

Thanks for your suggestions. I used the Developers Tool Kit to look for the define names, and they all have proper codes (no missing syntax, etc.).

I've combed through and compared all the files under /includes/ with my backup, and double checked the ones that are different due to recent changes, and they looked fine. I even re-uploaded them to see if I can overwrite any corruption; but still didn't work. I also checked the new files / folders attributes and they are the same as the working files / folders.

It seems that the problem isn't in many files, but in just one common file that may have set everything off. The reason I'm thinking this is that the define names show up everywhere, from contact page, advanced search results, product details, to shopping cart, etc.

I just need to identify that one file, but I tried all the above methods but still couldn't do anything. It's so frustrating! What else am I not seeing?

Thanks so much for your help.

12 Mar 2012, 4:46 AM
#7
lastmiracle avatar

lastmiracle

New Zenner

Join Date:
Nov 2011
Posts:
11
Plugin Contributions:
0

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

Here's the progress to no avail:

I downloaded a fresh copy of Zen Cart and compared with WinMerge all the files under includes/:

  • There are **no **missing files in my site (besides the addition of custom files)
  • I checked the codes in conflicting files, and reuploaded them
  • I reuploaded english.php as well.

I actually removed english.php temporarily to see what would happen, and the problem of course got worse. DEFINE_TEXT would show up on the main index page as well. Which is interesting, because the problem I have does not appear on the index page, but as soon as you go somewhere else like the contact, shopping cart, product info, search results, etc. they show up.

I wish it was just a simple matter of missing files.... Any other suggestions? Thanks much in advance.

12 Mar 2012, 4:53 AM
#8
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

lastmiracle:

I wish it was just a simple matter of missing files.... Any other suggestions? Thanks much in advance.

https://www.zen-cart.com/tutorials/index.php?article=95

Other than what you find here there is very little that any of us can really say or do to help.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

12 Mar 2012, 5:37 AM
#9
lastmiracle avatar

lastmiracle

New Zenner

Join Date:
Nov 2011
Posts:
11
Plugin Contributions:
0

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

RodG:

https://www.zen-cart.com/tutorials/index.php?article=95

Other than what you find here there is very little that any of us can really say or do to help.

Cheers
Rod

Thanks Rod. I saw that file before and followed all the steps. Of course all the constants are defined in my files, and they still show up. sigh I've reached a dead end at this point, not sure what else to do.:Flush:

12 Mar 2012, 6:04 AM
#10
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

lastmiracle:

Of course all the constants are defined in my files, and they still show up. sigh I've reached a dead end at this point, not sure what else to do.:Flush:

There is no 'of course' about it.

FACT: If the defines exist and are readable it WILL work as expected.

The computer is telling us that these defines either don't exist or they are unreadable. This means missing files, files are in the wrong location, or the server doesn't have permission to read the files.

If you've not already done so, go get a good nights sleep and take another look in the morning. It is often surprising how effective this can be. :)

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

12 Mar 2012, 6:36 AM
#11
lastmiracle avatar

lastmiracle

New Zenner

Join Date:
Nov 2011
Posts:
11
Plugin Contributions:
0

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

I've managed to completely replaced the entire /includes/languages/english folder and english.php with the stock Zen Cart folder and file, and the problem still remains.

This does *not *seem to be due to errors in the languages folder at this point. What else can cause this? Is there any sort of header files or pre-load files that can cause the site to not echo out the defined constants?

I'm gonna try to systematically replace files from

Module Files: includes/modules
Template Files: includes/templates/template_default

tomorrow. Thanks again for your encouragement.

13 Mar 2012, 7:57 AM
#12
lastmiracle avatar

lastmiracle

New Zenner

Join Date:
Nov 2011
Posts:
11
Plugin Contributions:
0

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

I FIXED IT!!!!!

After spending HOURS replacing original files and renaming custom files to see if they were the source of the error, it all boiled down to:

/index.php

The culprit is 5 little characters:

** /** **
$language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
** /*

I've NEVER touched this file before. I really suspect foul play here. What do you guys think? Can **any **action in the Admin area made this line into a comment? I'm gonna email my client and let him know to change all the passwords. He claims that he only uses the Admin area to add products, and there's no one else working on the site.

13 Mar 2012, 8:30 AM
#13
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP definition text (HEADING_TITLE, ENTRY_NAME, etc.) started showing up everywhere!

lastmiracle:

I FIXED IT!!!!!

After spending HOURS replacing original files and renaming custom files to see if they were the source of the error, it all boiled down to:

/index.php

This would be one of the last places I would have suspected. It's hardly a surprise it took so long for you to locate.
Well done.

lastmiracle:

The culprit is 5 little characters:

** /** **
$language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
** /*

I've NEVER touched this file before.

Did you happen to note the date/timestamp of the file?
As far as I can tell, this file hasn't changed since Feb 2006

lastmiracle:

I really suspect foul play here. What do you guys think?

I doubt that is was 'foul play' (there doesn't seem to be any point to this change), nonetheless someone has changed it at some stage.

lastmiracle:

Can **any **action in the Admin area made this line into a comment?

No.

The change would have been made by person or persons unknown.

If I were you, and if you took note of the date/time when the file was changed I'd also be looking for any other files that were changed on the same day. Firstly because if it was foul play there would almost certainly have been other changes made at the same time, which will need to be repaired, but secondly, it may jog someones memory (eg; Your client) that is was something they did after all for some reason or other.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.