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 21 to 40 of 44
This thread is locked. New replies are disabled.
17 Jan 2010, 12:01 AM
#21
notageek avatar

notageek

Zen Follower

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

Mod gone bad? - fonts somehow screwed up

Okay, I removed the file from my override directory to see if the define_main_page_lower.php in the template_default directory would work, and although it seemed to access the directory and record the test message, still nothing is showing in my main page center box.

I noted the "get" command is from zen_get_file_directory and thought of checking PHPMyAdmin as my tables do not begin with "zen" but there is no such table.

So, I guess that is the extent of my capability to explore this problem after trying to check for differences in what I did and what the instructions advise to do.

18 Jan 2010, 1:31 AM
#22
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

Well, maybe someday someone will benefit from this monologue. I found that the although the Numinix Centerbox Categories module seemed to help by placing 3 commands in the Index Listing referable to the center box, when I activated the center box categories it was the default Zen Cart categories that came up. I had placed category numbers of subcategories in the box to choose categories, and it ignored that, and when I finally put the category numbers there it made no difference, and has the same appearance as the Zen Cart categories as they appear in the center box.

I see there is a "Define Page Status" under the Admin->Configuration menu. I am wondering what it would take to make a page status become active in that menu for the define_main_page_lower box that was attempted pursuant to this thread. I still do not see how to add text below my 3 top categories on my main page.

Also, I find that the "Featured Products" box that I wanted to include in the center box on the main page will no longer show up, and I suppose that is because I now have categories showing.

Am I right in thinking if categories show up, then the featured products center box cannot show in the center box? I now have a tremendous amount of dead space on my main page below my top paragraph plus one line of 3 top categories with images. This is my WAMP test server, so I have not posted a link.

18 Jan 2010, 2:44 AM
#23
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

Regarding the splitting of text on the main page - bunyip provided the instructions for this modification. His post is here:

http://www.zen-cart.com/forum/showpost.php?p=703831&postcount=6

I followed his instructions as laid out and the modification worked perfectly. Maybe it is a template issue - the templates for both sites I used this on is iC_AcadameV.12

Doug

18 Jan 2010, 2:56 PM
#24
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

Doug, thanks for the reply. Does your define_main_page_lower show up in the Admin->Configure>Define Pages?

Does your page work as set up if you add text to the Admin->Tools->Define_main_page?

(Really nice presentation on your site, by the way. Would you be using a grid template to place each item in its own box?)

Your responses may shed light on what is going on with my process.

Thanks.

18 Jan 2010, 6:51 PM
#25
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

No, the new define_page_lower does not appear in Configure/Define Pages. In fact most of the additional define pages I've added do not appear there.

The new define_main_page_lower as well as all the other new define pages (about 20 new pages) all can be selected and can be edited with Tools/Define Pages Editor.

For the product listings, I used the Column Layout Grid for Product Listing contribution:

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=77

and then had to fiddle with the css to get it right.

Doug

26 Jan 2010, 6:27 AM
#26
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

Still trying for text below products on main page center box. The last thing I tried, following bunyip's directions in post 6 of this thread, was to add the following at the bottom of includes/templates/MYTEMPLATE/tpl_index_default.php:

[CODE]

<?php if (DEFINE_MAIN_PAGE_LOWER_STATUS >= 1 and DEFINE_MAIN_PAGE_LOWER_STATUS <= 2) { ?> <?php /** * get the Define Main Page Lower Text */ ?> <div id="indexDefaultLowerContent" class="content"><?php require($define_main_page_lower); ?></div> <?php } ?> /CODE]

Basically I was following a suggestion from another thread where the poster repositioned text from the top to the bottom of the file which called the main page text, and I modified the language to match bunyip's code (could not locate the post at this time).

I also tried repositioning the original code without the above modifications, calling the define_main_page, to the bottom without any changes occuring on refresh.

This is a test WAMP server home page running version 1.3.8a of Zen Cart.

It seems odd that I cannot see the text but I successfully added the define_main_page_lower to my configuration file in MySQL and it does show up in both the admin->tools>define pages and the configuration->define pages menus.

As an alternative, I was able to get text to show up on the includes/templates/MYTEMPLATE/common/tpl_main_page.php, but it is not dynamic and needs a bit of html coding, so I could use that as a last resort. This was from a suggestion in the "Re: Adding content to main page above and below "Featured" products???" thread.

At least I have the ability to do this "some" way now, thanks to Aly22's and giftmeister's posts in that thread, for which I am very thankful.

But I seem to be missing something very basic to get so far with bunyip's method, and accomplish being able to see the pages in tools and admin menus, but still not be able to see text at the bottom of the home page under the products pictures.

Even if there are no products, it should show up, and be controllable separately from the top text.

I just can't seem to move on without accomplishing this, and keep coming back to it. It's actually quite fun to try to accomplish it, but tiring, and I really should move on but I hate to leave this undone; it seems like such a necessity at the moment.

27 Jan 2010, 3:56 AM
#27
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

Before Bunyip was so kind and posted these instructions, a web design firm has hacked my main page to do something similar by using define_page_4 as the lower main page text.

Attached is my tpl_main_page.php that had this hack. Search for define_main_page_4 and see where they inserted the text. They removed the define_main_page and inserted some static text at the top.

Maybe this file might help. Like I posted before, Bunyips code fixed the hacks in this file.

Doug

27 Jan 2010, 3:59 AM
#28
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

Oops, file didn't get attached.

See lines 101 and 113 for start of inserted code.

Doug

29 Jan 2010, 6:53 AM
#29
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

Doug, thanks very much. This seemed promising. I compared your tpl_main_page.zip with includes/languages/english/html_includes/define_page_4.php. As you are aware, there were 3 lines in define_page_4.php and 200 in your tpl_main_page.zip, but I saw no overlap of the two files.

I looked at the lines you referred to, and tried them in the includes/templates/MYTEMPLATE/templates/tpl_index_default.php changing words to call the define_main_page_lower. Your template's lines calling that page were much more complicated than those already in the Zen Cart file to call the main_page.

While this was instructive to see similar coding possibilities, I am not seeing any change at all on my main page, oddly. The hack does make one appreciate the simplicity of coding in Zen Cart. If only I had a better grasp of PHP I might make better sense of it all.

30 Jan 2010, 3:47 AM
#30
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

Can I make a suggestion-

Backup your tpl_main_page.php file, load this in and see if the define_page_4 content shows up. That way you can see if this works with your template.

Doug

5 Feb 2010, 10:33 PM
#31
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

Doug,

I was able to finally see my define_main_page_lower. Probably the main reason is that I was so convinced it was correctly done, because you provided your references to bunyip's instructions and also so generously provided your actual template in another thread which was more helpful than the one just above this post. I was pretty sure what I had done was correct.

By accident this morning, I was working on getting categories to show on my centerbox, and had installed Niminix's Centerbox Categories module which wasn't working, and which is controlled in Index Listing in Admin. I was in Layout Settings, and learned that Admin->Layout Settings->Main page - opens with category set to BLANK allowed my define_main_page_lower text to then show. I also found that the Centerbox Categories module worked once this "Main page - opens with category" was set to BLANK.

So with this setting I both have the categories pictures and the text below the categories.

As an aside, I also learned that this can be achieved without the Centerbox Categories module, if one only wants to list one category, by setting the Admin->Layout Settings->Main page opens with category to the category number one wants to show. If one has a category description, that description will appear below the category picture, and sort of achieve the objective of text below a picture on the main page.

I feel so fortunate that you took the time to help with this problem, and can't thank you enough.

Soon my findings on my WAMP test server will be transferred to my live site at http://www.riverfrontsouth.com., and it will be a great improvement.

6 Feb 2010, 4:38 AM
#32
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

Glad it finally worked out.

Doug

8 Feb 2010, 5:54 AM
#33
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

Hi. Before I leave this lower main page issue, I just realized that on comparing files with the files Doug originally provided as examples, there was a change.

I am not spending the time I should to find the references again, but when I compared with the original, there was no includes/extra_data_files/main_page_definitions.php in the example file.

Instead there was an includes/languages/english/extra_definitions/main_page_definitions.php file. That is something I also changed that obviously contributed to making the define_main_page_lower text work.

There was a time lag between doing that and making it work by making the Admin->Layout Settings->Main page opens with category=BLANK, so I forgot to add that to these comments, but that was a pretty significant change.

So before I am hastening to add this to the discussion above before I move on. Thanks, Doug and Bunyip.

22 Feb 2010, 5:48 AM
#34
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

Well, I'm back again.

My Captcha with TTF and GD stopped working.

What stops it from working is the "main_page_definitions.php" file:

<?php define("FILENAME_DEFINE_MAIN_PAGE_LOWER', 'define_main_page_lower'); ?>

bunyip's instructions (earlier in this thread) were to place the above in includes/extra_datafiles/main_page_definitions.php

but I also found instructions to place in:

includes/languages/English/extra_definitions/main_page_definitions.php

I had taken the "extra_definitions" location from an "includes" file provided by pdxdoug at this thread location:

http://http://www.zen-cart.com/forum/showthread.php?t=102226&highlight=categories+center&page=3

In troubleshooting why my Captcha stopped working, it came down to this file. I have a backup with Captcha working, and it works until I add this code. It completely stops showing the Captcha picture whether I place this code in the extra_datafiles or the extra_definitions location.

I found that it made both my WAMP zencart and my online site able to show both the upper and the lower define_main_page files. My online site is here, where both upper and lower text is working, but the captcha is not working:

http://www.riverfrontsouth.com

Oddly, if I added the file in the extra_datafile location it completely broke my online site, although my WAMP would still work and just not show the define_main_page_lower.

At the moment, my captcha is working on my backup site as long as I do not place this file in either location.

As a secondary problem, I cannot get the define_main_page_lower to show on this backup site, even if I add the define_main_page_lower in the extra_definitions location that still works on my online site and more recent WAMP site. Two of the files (tpl_index_default.php annd define_main_page_lower) needed to be placed both in the default and my custom template to work, but I do not see an override location where this main_page_definitions.php file could be tried.

In trying to see a potential conflict, I see there is a captcha.php in the extra_definitions location which looks like this:

[QUOTE]<?php
/**

  • captcha.php CAPTCHA class
  • @package captcha
  • @copyright Copyright 2004-2007 AndrewBerezin
  • @copyright Copyright 2003-2006 Zen Cart Development Team
  • @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  • @version $Id: zen_captcha_img.php 1 26.02.2007 8:01 AndrewBerezin $
    */

define('INTRO_CAPTCHA', 'In our effort to combat email spamming, we now require all contact emails to include verification. Please type the letters and numbers shown below into the verification code field.');
define('TEXT_CAPTCHA_REDRAW', '(If this image is unclear, click the redraw button.)');

define('TITLE_CAPTCHA', 'Enter verification code shown above:');
define('TEXT_CAPTCHA', '* (case insensitive)');
define('ERROR_CAPTCHA', 'You did not enter the validation code correctly. Please, try again.');
define('BUTTON_IMAGE_CAPTCHA_REDRAW', 'button_redraw.gif');
define('BUTTON_IMAGE_CAPTCHA_REDRAW_ALT', 'Redraw Capture Image');
define('BUTTON_IMAGE_CAPTCHA_REDRAW_TEXT', 'If the image text is not readable use this button to redisplay it');
define('IMAGE_CAPTCHA_ALT', 'Enable this picture');

define('ERROR_CAPTCHA_GD', 'CAPTCHA Error: There is no GD-Library enabled. The CAPTCHA cannot be used!');
define('ERROR_CAPTCHA_GIF', 'CAPTCHA Error: GD-Library does not support GIF. The CAPTCHA cannot be used!');
define('ERROR_CAPTCHA_PNG', 'CAPTCHA Error: GD-Library does not support PNG. The CAPTCHA cannot be used!');
define('ERROR_CAPTCHA_JPG', 'CAPTCHA Error: GD-Library does not support JPG. The CAPTCHA cannot be used!');
define('ERROR_CAPTCHA_SESSION', 'CAPTCHA Error: Session not started. The CAPTCHA cannot be used!');
?>/QUOTE]

(You will see some added text at the top of this file which is from "chrx" from the thread "How to add the Captcha to Ask A Question" I believe)

I do not know whether this issue should be posted in a Captcha forum or here, so for now, I will post here, and if no one can help, I will post a much reduced question in a Captcha thread. Hopefully that would not be considered a double post.

Thanks for any suggestions.

25 Feb 2010, 5:06 AM
#35
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

Last update, I think. In my post above I noticed a typing error, placing a " where a ' should have been.

I decided to really scrutinize the file in question and compare it with other files in my "extra_definitions" files. Although I thought there was no space at the end, because when I backspaced the entire line was deleted, there were actually 2 spaces at the end which I found by comparison with the other files, and by using the "delete" key and not the backspace key.

Once those two spaces were deleted, my Captcha shows again, along with my define_main_page_lower.

I didn't quite get my backup to show the define_main_page_lower, but my test WAMP and online site do work now, so that will just be an investigation to pursue for a learning exercise.

I hope these exploits in mistakes really serve to help someone in the future and really appreciate the help received here.

I think a lot of mistakes just come from sheer fatigue at the long process of trouble-shooting, and it just takes a little rest and looking at things from more of a distance to see these things. I really thought I would never solve this one, but I just kept remembering what others had gone through and found, and it turned out that I had that same extra spaces error others had spoken of that I hadn't seen before.

16 May 2010, 6:54 PM
#36
ekele avatar

ekele

Zen Follower

Join Date:
Apr 2010
Location:
UK
Posts:
150
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

Doug, notageek, I am a newbie but I tried your advice and I successfully installed main_lower_page and it works :clap:
I also had a problem but, like notageek did, I set "Main page -opens with category" to blanc and it works!

Thanks a lot! :D

16 May 2010, 8:19 PM
#37
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

Ekele,

It makes all the time and effort seem worth it when someone benefits from the dialog working out problems. I know I couldn't have made the main_page_lower module work without Doug's help. It is really a great add-on and I am glad you were able to make it work.

27 Jun 2010, 5:28 PM
#38
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

This define_main_page_lower feature is so useful to me that I put it into a module based on the foregoing advice. It works fine on my new install of Zencart version 1.3.9d (as well as on 1.3.8a), not only with the main_page_lower in the define pages menu in Admin, but also with the SQL patch placing it into the configuration menu to turn on or off.

It is not packaged as an Add-on as I have not (1) placed it in a zip file (though I might be able to figure out how to do that) (2) with instructions, or (3)created an uninstall, and (4) I could not even begin to support it, since it is derived from Bunyip's and Doug's advice as well as that of another Zenner who provided the instructions to create the SQL patch, from another thread. It would really be beyond me to explain and analyze the code or troubleshoot related problems for others.

Nevertheless, I would love to "give back" to the Zen Cart community in this way, saving someone else the enormous time expenditure it cost me.

If anyone wants to email me for this module, it will be necessary to ask to be allowed through my spam filter at [email protected].

If I should submit it, I hope the Zen Cart Team will let me know.

Notageek

4 Jul 2010, 6:07 PM
#39
notageek avatar

notageek

Zen Follower

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

Re: Mod gone bad? - fonts somehow screwed up

It should be mentioned with regard to the Define_Main_Page_Lower system that one cannot show categories on the main page with this module, since admin->configuration-layout settings must place the "show categories on main page" setting at blank, or zero which works with Zen Cart version 1.3.9d. I tried this out and when I placed the "show categories on main page" setting to show the categories, the lower define page disappeared.

Therefore, to show categories on the main page with this module, Numinix's Centerbox Categories module is great, plus with that module you can select some categories to show and not others. There may be other centerbox categories that might work with the Define_Main_Page_Lower system, for example the module that places categories in the grid might work with this.

This information seems important for any future use of the Define_Main_Page_Lower system, so this information is just a clarification for the record.

Notageek

4 Jul 2010, 7:40 PM
#40
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,659
Plugin Contributions:
0

Re: Mod gone bad? - fonts somehow screwed up

If I should submit it, I hope the Zen Cart Team will let me know.

Submitting it to the downloads would make life easier for you, not having to have people email you for the addition.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.