Zen Cart Logo
Forums / General Questions / Coders--- is this ok?

Coders--- is this ok?

Locked

Views: 1,018

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
17 Mar 2007, 4:18 PM
#1
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Coders--- is this ok?

I wanted to add an extra link into the Information sidebox (ZenCart v. 1.3.7) and spent several days on the boards trying to learn the methods. I did download the "About Us" module, as many posts suggested, but was scared away from using it because it required editing core files and I don't want to lose any changes on upgrade.
I also could not use the EZ-Pages sidebox, which was a method favored by many users, because it is already being utilized for something else on my site.

Long story short, I found a post where someone was adding a link to an EZ-page to his "More Information" sidebox as opposed to the "Information" box, so I edited the code I found there since the link I needed is also pointing to an EZ-Page. What I wound up with is:

$information[] = '<a href="' . zen_ez_pages_link(4) . '">Dog Clothes Sizing</a>';

which I pasted directly into my information.php file located in /includes/modules/sideboxes/MYTEMPLATE/ folder

Everything works fine. The only issue I notice is that the link url that is in the Information sidebox ends with page&id=4 while the link in the footer bar (which points to the same page) has a url ending with page&id=4&chapter=0. Is this a major issue that will get me penalized by search engines?

Also, is there anything wrong with that code I pasted into my information.php file? In particular, I wasn't sure if the $information[] part was correct, since nothing else in the information.php file starts with that.

17 Mar 2007, 4:25 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Coders--- is this ok?

The code building the footer could use a bit of tidying up to not include the chapter when set to 0 ..

We will look into this further for a future release ... :smile:

17 Mar 2007, 4:37 PM
#3
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Coders--- is this ok?

Oh my goodness, do you mean I actually did that right?! (lol). It's odd trying to play with code that you don't understand in the least bit, but I figure if I look for patterns and use the overrides then I can always undo things. Yes, I will learn php eventually, but right now I'm bringing myself up to date with CSS2 (I only know v.1) and XHTML (I only knew old-school html). Php is next though, since learning keeps the brain young. :D

Is there anything I should do right now about the urls? Or is it just not that big of an issue?

17 Mar 2007, 4:41 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Coders--- is this ok?

I doubt it will be a major issue ...

The changes to fix this are ... fast ain't I, eh? :smartass:

change line 53 in:
/includes/modules/ezpages_bar_footer.php

      zen_href_link(FILENAME_EZPAGES, 'id=' . $page_query->fields['pages_id'] . ($page_query->fields['toc_chapter'] > 0 ? '&chapter=' . $page_query->fields['toc_chapter'] : ''), ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL')) :

change line 52 in:
/includes/modules/ezpages_bar_header.php

      zen_href_link(FILENAME_EZPAGES, 'id=' . $page_query->fields['pages_id'] . ($page_query->fields['toc_chapter'] > 0 ? '&chapter=' . $page_query->fields['toc_chapter'] : ''), ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL')) :

change line 50 in:
/includes/modules/sideboxes/ezpages.php

        zen_href_link(FILENAME_EZPAGES, 'id=' . $page_query->fields['pages_id'] . ($page_query->fields['toc_chapter'] > 0 ? '&chapter=' . $page_query->fields['toc_chapter'] : ''), ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL')) :

Now they will not have the chapter when the chapter is 0 ... :cool:

17 Mar 2007, 9:03 PM
#5
intelcos avatar

intelcos

Totally Zenned

Join Date:
Apr 2004
Location:
Montreal
Posts:
584
Plugin Contributions:
0

Re: Coders--- is this ok?

:smartass: Dang, thanks, I needed that as well :thumbsup: :thumbsup: :thumbsup:

17 Mar 2007, 9:48 PM
#6
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Coders--- is this ok?

Thank you VERY much, that works perfectly!

Just in case anyone else is editing the same files, in the instructions above where it says:
" /includes/sideboxes/ezpages.php"

the path is actually /includes/modules/sideboxes/ezpages.php

Linda, please don't take any offense at the correction, I'm just trying to make it easier for any newer Zenners that may be reading this. :smile:

18 Mar 2007, 2:16 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Coders--- is this ok?

Heck if I was 100% perfect all of the time you'd begin to wonder just how good I really am ... :smartass:

Thanks for the catch! :smile:

18 Mar 2007, 2:17 AM
#8
intelcos avatar

intelcos

Totally Zenned

Join Date:
Apr 2004
Location:
Montreal
Posts:
584
Plugin Contributions:
0

Re: Coders--- is this ok?

Um, don't overrides get caught in here as well :smartass:

I used the classic template and overrides

thus in../mod../side../classic

18 Mar 2007, 2:20 AM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Coders--- is this ok?

Overrides would go in your overrides directory:
/includes/modules/sideboxes/your_template_dir

But this is a fix ... and it will be in the next release ... :cool: