Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Mod gone bad? - fonts somehow screwed up

Mod gone bad? - fonts somehow screwed up

Locked

Views: 9,016

Results 1 to 20 of 44
This thread is locked. New replies are disabled.
22 Mar 2009, 10:49 PM
#1
pdxdoug avatar

pdxdoug

Zen Follower

Join Date:
Jan 2008
Location:
Portland, Oregon USA
Posts:
356
Plugin Contributions:
0

Mod gone bad? - fonts somehow screwed up

Tried to add some new define pages to the information sidebox and when I did, things really got screwed up. :oops:

The only file I thought was changed was the information.php put into mods/sideboxes/your_template.

Restored the \includes directory from a backup several weeks ago to no avail. I must have unintentionally changed something else but for the life of me I don't know what. I'm wondering if I might have accidentally saved something to wrong directory or to a core file.

All the page fonts are huge - product titles seem to be a courier font. There is now text at the top of the main page that says "Your Page Text Goes Here". When you log into Your Account The Account page yields a blank page with the same message "Your Page Text Goes Here"

https://www.broadwayfloral.com

Would REALLY appreciate some help. Thanks!

Doug

Zen Cart V1.3.8a Patched
SEO Mod, Date Reminder Mod, Invoice Mod, Add Customer From Admin, About Us Page

Doug

22 Mar 2009, 11:06 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Mod gone bad? - fonts somehow screwed up

What has happened is that you have added the contents of one of your new pages the the information sidebox instead of a link to it.

Since the sidebox is built before anything is displayed and you are now outputing page content when it is built, your page content comes out first. The words "Your page text goes here" top left are the visible part of that, though there is more that can be seen in the source code.

This in turn means that the doctype statment isn't the first thing received byt he browser, and as a result it's not sure how to interpret other information it receives, including ... font sizes.

So you need to re-visit what you're doing in your includes/modules/sideboxes/iC_AcadameV1.2/information.php file.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

22 Mar 2009, 11:45 PM
#3
pdxdoug avatar

pdxdoug

Zen Follower

Join Date:
Jan 2008
Location:
Portland, Oregon USA
Posts:
356
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Thanks Kuroi,

As you saw, my front page was modified (hacked) by a web design firm to move the feature products to the top and the main page text below.

I had seen a post by Kobra that explained how move elements around properly so I had created a new define page - main_top that I was going to insert into the tpl_index and the tpl_main_page to sit between the header/nav bar and the featured section, then I was going to re-insert the define_main_page back into the proper place. The intent was to give me two editable sections (define pages) with the featured items in the middle.

It appears that ZenCart found the main_top page I'd created and stuck it in at the very beginning without me adding any code - that was the "Page text goes here" message. The change to the information sidebox was coincidental. Deleting the main_top new page fixed it.

So why? And if I use another name instead of main_top can I accomplish what I'm trying to do?

Thanks,
Doug

Doug

22 Mar 2009, 11:55 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Mod gone bad? - fonts somehow screwed up

This isn't a naming issue. Whatever was done would likely be a problem however, it was named. Unfortunately, there are a huge number of possible approaches with this sort of customization (and that's just the ones that work!) and despite reading your posts several times I was unable to form a clear picture of what had been done, or the scope of what you were trying to do (i.e. to which pages it should apply).

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

23 Mar 2009, 12:44 AM
#5
pdxdoug avatar

pdxdoug

Zen Follower

Join Date:
Jan 2008
Location:
Portland, Oregon USA
Posts:
356
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Kuroi,
Sorry to be vague in my explanation.

I had used the define_pages generator mod to create some new pages - most to be added to the information sidebox like the about_us mod, and one that I had hoped to make editable via the tools:define pages editor that I was going to insert into the main page to provide another section of text in addition to the built-in define_main_page.

I uploaded all these pages into their respective directories. They all appeared in the tools:define_pages editor so I added some content to one of them - About the Design Studio - and then went about modifying the information.php file to add that one page.

The only page that was added to the information.php file was About the Design Studio.

The information.php file was uploaded into the correct override directory and when I looked at the site things were displaying wrong.

When I viewed the site and saw what had happened, I restored the information.php back to the original but that didn't fix the problem. Then after posting I deleted all the pages I'd added named main_top from all the directories and that's when the site reverted back to normal.

I made no changes to any other files at all. It seems for whatever reason that one of the pages I'd created, named main_top was being grabbed by ZenCart and was being added first thing to the main page and other pages even though I'd not made any reference to the main_top page at all.

Back to my intended change to the main page:

Since I sell flowers, I thought it best the have the featured products display before the main page text, so a web design company hacked the tpl_main_page so that a single line of hard-coded static text would be at the top, then whatever products were enabled on the main page (featured, new, special) followed by some text.

Instead of moving the main_page text to be after the products, they inserted page 4, so to edit text on my main page I edit the define_page_4 file.

I had seen an earlier post about moving the display order -
http://www.zen-cart.com/forum/showthread.php?t=118972 -

So what I intended to do was to split my main page text into two parts. I figured that my new main_top page (the one that screwed up) would replace the static, hard coded text that now is between my header/nav bar area and that I re-enable the main_page text and place it below the products.

That was my plan and would welcome your thoughts/opinions/recommendations.

Thanks,
Doug

Doug

23 Mar 2009, 3:02 AM
#6
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Mod gone bad? - fonts somehow screwed up

Doug,
Achieving what you want is really quite simple - it's obvious that the company you hired doesn't have a good understanding of Zen Cart's architecture.

Five simple steps for what you want to do:

  1. For the content you want at the top of your main page, just use the existing define main page system, with no changes - just edit the define_main_page in admin as normal.
  2. For the content that you want to show at the bottom of your main page, create a new file includes/languages/english/html_includes/define_main_page_lower.php - you'll be able to edit the content of that from the Define Pages Editor in Admin.
  3. Create a new file includes/extra_datafiles/main_page_definitions.php with this content:```
<?php define('FILENAME_DEFINE_MAIN_PAGE_LOWER', 'define_main_page_lower'); ?>
4. Edit includes/modules/pages/index/header_php.php and add this line of code:```
$define_main_page_lower = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_MAIN_PAGE_LOWER, 'false');
``` immediately below this line:```
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_MAIN_PAGE, 'false');
  1. Make an override copy of includes/templates/template_default/templates/tpl_index_default.php and add this line of code immediately before the closing /div tag at the end of the file:
<div id="indexDefaultLowerContent" class="content"><?php require($define_main_page_lower); ?></div>

Neville
An assumption is what you arrive at when you get tired of thinking...

23 Mar 2009, 11:41 PM
#7
pdxdoug avatar

pdxdoug

Zen Follower

Join Date:
Jan 2008
Location:
Portland, Oregon USA
Posts:
356
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Thank you for your reply. It looks to be the answer to my dilemma.

The web hosting people HAVE done a good job in modifying the checkout process to include additional information needed for my business - delivery date/delivery time/occasion/gift card message in addition to the standard order comments - everything appears in the admin order area and on all Emails along with our delivery and substitution policies. They also took the Date Reminder mod and customized it to include a occasion and a customized Email sent to both the customer and us so we know of the event also.

The main_page hack was a quick response to a need and now it's time to clean it up and make it more functional. Breaking it up with two areas of main page text insures that potential customers see our products and Google sees our 'content' and steers customers our way.

I'll override the hack tonight.

Thanks again,
Doug

Doug

19 Oct 2009, 7:15 AM
#9
matt_smith avatar

matt_smith

Zen Follower

Join Date:
Oct 2008
Posts:
108
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Hi

Followed Bunyip's instructions for adding new text section to bottom of homepage and something is going wrong and I'm getting in a bit of a mess. See below:

http://trulyethical.com

What have I done wrong?

Can anyone help?

Thanks

Matt:oops:

19 Oct 2009, 8:05 AM
#10
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Mod gone bad? - fonts somehow screwed up

Matt Smith:

Followed Bunyip's instructions for adding new text section to bottom of homepage and something is going wrong and I'm getting in a bit of a mess.Unfortunately the answer to this lies on your site in the files that you've changes and that we can't see. But my best guess would be that you have added the code that is showing at the top of your site after the closing php tage "?>" on the file where you added it. It should be before it (or better still, just remove the closing tag completely - you don't need it and it can get in the way).

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

19 Oct 2009, 8:33 AM
#11
matt_smith avatar

matt_smith

Zen Follower

Join Date:
Oct 2008
Posts:
108
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Thanks for the quick response.

I did put the code in the wrong place and now the code has gone from the top of the page. But my aim of getting a section of text at the bottom of the page has still not worked. I've edited the main_page_lower.php in define pages and the changes do not show.

Do i need to create an override copy of all the changed files in my custom template?

Thanks

Matt:unsure:

19 Oct 2009, 10:53 AM
#12
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Mod gone bad? - fonts somehow screwed up

Matt Smith:

Do i need to create an override copy of all the changed files in my custom template?If you don't then there's a risk that the files in your custom template may override your changes.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

19 Oct 2009, 11:47 AM
#13
matt_smith avatar

matt_smith

Zen Follower

Join Date:
Oct 2008
Posts:
108
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Hi

Thanks for your help so far. But still the text I put in the main_page_lower page in define pages does not show up on my homepage.

I have created override files for all the changes, except the extra datafiles. I know it is hard to know what I'm doing wrong, but any suggestions would be most welcome. I would include copies of the files but I'm not sure how to do this without copying the whole file.

Thanks

Matt

25 Oct 2009, 4:01 PM
#14
matt_smith avatar

matt_smith

Zen Follower

Join Date:
Oct 2008
Posts:
108
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Thanks Doug for all your help. I have made sure my files are exactly like yours and still it does not work. Any clues to other files I should have changed.

Thanks in hope.

Matt :mellow:

26 Oct 2009, 1:29 AM
#15
pdxdoug avatar

pdxdoug

Zen Follower

Join Date:
Jan 2008
Location:
Portland, Oregon USA
Posts:
356
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

@Matt,

At this point it would seem that somewhere in your editing there is an error that is preventing this to work. You could use WinMerge against a fresh set of ZenCart files to see where the error might be.

Good luck.

Doug

16 Jan 2010, 5:03 PM
#16
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

I tried to follow Doug's instructions, and copied and pasted the code as directed.

I am now now receiving the following error message when I try to access my site on my test WAMP server:

"Content encoding error--the page you are trying to view cannot be shown because it uses an invalid form of compression."

I do not think it is related to my WAMP having Gzip compression and my web host not having implemented that.

More likely is that I did not correctly identify the location of where to put the override copy. The instructions say to make the override copy, but do not state where to place it.

I placed it in includes/templates/MY_TEMPLATE/templates/tpl_index_default.php. If someone can identify the correct place for the override copy identified in Doug's Step 5, I would appreciate that.

At the moment, I will just remove the file in the probably wrong override box and see if the WAMP site works again.

As an alternative, I intend to try Numinix's module, Center Box Categories, http://74.125.47.132/search?q=cache:TwO1aCo3M5UJ:www.numinix.com/zen-cart/template-modifications/categories-center-box-module+zen+cart+numinex+center+box+categories&cd=1&hl=en&ct=clnk&gl=us to accomplish the split of the main page text with insertion of pictures higher up.

However, the Numinix module appears limited to category display, with the problem of trying to come up with representative images for each category instead of going with specials, featured, or new products as the prominent main page images.

16 Jan 2010, 5:21 PM
#17
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Mod gone bad? - fonts somehow screwed up

If you're getting a message saying that you're using an invalid form of compression, then most likely you're using an invalid form of compression.

This message would certainly not be generated by putting your over-ride file in the wrong place, since that would result only in the over-ride file not being found and the file that it is supposed to over-ridden being used instead.

I'm also puzzled by your reference to your web host. If you're using WAMP aren't you running it locally, so why is your web host relevant? Or are you trying to run WAMP in hosted space? In which case I could see that this might mess with your hosted account's configuration settings (such as compression).

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

16 Jan 2010, 9:40 PM
#18
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Thanks, Kuroi.

I am using Gzip compression on my local WAMP test site. When I copy my live site to my wamp, I always need to change the compression settings in my database, and make sure I do not overwrite my local config files.

I went online to try to troubleshoot the "invalid form of compression" error and found suggestions such as reload, clear cache everywhere, and make sure there are no stray spaces or lines in the php code, all of which I have tried to follow, including a complete restart of Firefox 3 which seems to be the source of this error often, and a complete reboot.

I am about to remove all of the files and code added under Doug's instructions before restoring my backup cart.

Since I can't control my live site's host, I am thinking maybe I need to change to having no gzip compression on my WAMP. However, I will then need to figure out how to change the config file accordingly.

Doug's instructions seem so straightforward and it is so appealing to be able to have this lower define main page file, I regret that I could not ascertain how to fix this. I have re-examined the files and really find nothing that stands out as a possible error.

One thing I did do, however, was try to add a "//this file added 1-09 by myself" comment so that I could recognize the modified file if ever I do a future Zen Cart update. I did have an unintended space before the //, which I corrected, and then I finally took that addition out. It was inserted just before a sentence stating "this is the first line of...." So maybe I created an error situation that is being retained despite my taking out the extra space.

I would like to know how to add a comment identifying changes in future files I try to change without messing up the code.

Thanks for looking at this.

16 Jan 2010, 10:07 PM
#19
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Well, I reviewed my Gzip compression setting in PHPMyAdmin on my WAMP server, and it had the wrong setting for my local site. I changed it, and ... er ... indeed, it works. It helps for someone like Kuroi to point out the obvious. A compression error is a compression error. I don't know how the particular changes made would have caused this so maybe on my last copy of my online site I forgot to change the compression to adapt to my WAMP server's opposite setting.

The define_main_page_lower isn't working yet but I will revisit that before I try the Numinex Center Box Category solution.

Thanks Kuroi.

16 Jan 2010, 11:39 PM
#20
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

I regrouped and tried a suggestion earlier in this thread to compare files with Winmerge. I did find that I had left in a "//this file changed 1-2010" type of comment so I took that out. I found that some of the changes made had not been double-spaced as they were in the original file. Also, I removed the "featured products" center box that I had activated to be in the middle of the two main text center boxes.

I now see a difference in what I did and my result, in that instruction #2 states: "For the content that you want to show at the bottom of your main page, create a new file includes/languages/english/html_includes/define_main_page_lower.php - you'll be able to edit the content of that from the Define Pages Editor in Admin."

I did place a file there, but I also noted that the define_main_page.php appeared in MY_TEMPLATE at includes/languages/english/html_includes/MY_TEMPLATE/define_main_page.php, so I put a copy of the define_main_page_lower.php file in that override file, and that is the file that is actually appearing in my define pages edit screen from the tools/define pages editor.

I believe that since Doug's instructions didn't mention the MY_TEMPLATE override, maybe the code in his steps 3, 4, or 5 didn't incorporate the MY_TEMPLATE override, and that may be why I can edit it in Admin->Tools_define_main_page_lower, but it doesn't show up on my main center box.

However, I am not seeing an obvious place where the MY_TEMPLATE override should be referenced. In Step 5, I placed the new version of includes/templates/template_default/templates/tpl_index_default.php in includes/templates/MY_TEMPLATE/templates/tpl_index_default.php, but this made sense because there are other override templates in that directory which appear in the template-default file.

It is difficult to let this go as it is such a mystery and there must be some form of php code or logic that is essential to solving this that would probably elucidate the whole coding process which I am not seeing, so if someone else sees it, it would be a great thing to understand and solve.