Results 1 to 10 of 2267

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories Dressing

    It might be a good idea to post this in a new thread titled something like "Images for EZ-Page Links" so it will be easier for people to find.

  2. #2
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Categories Dressing

    I don't actually know how to move a post! I also just realized that the code I posted doesn't have the CSS tag code in it, even though the header comments says it does. I'll have to edit that part of the comments out before I re-post. I did have the code in there but decided to pull it out - there are already so many different ways of changing the css for the ezpages sidebox that I decided it was overkill.

    I'll dup the post at your suggestion.
    Karen

  3. #3
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Didn't know appropriate place to post it, but I followed your advice, Glenn, and posted it here:

    http://www.zen-cart.com/forum/showthread.php?t=98946

    Thanks for giving me the code in both mods to make my work so much easier!! Karen

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories Dressing

    I just noticed a typo in one line:
    PHP Code:
        $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">'
    The closing ) is misplaced.
    PHP Code:
        $content .= '<div id="' str_replace('_''-'$box_id) . 'Content" class="sideBoxContent">'

  5. #5
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Quote Originally Posted by gjh42 View Post
    I just noticed a typo in one line:
    PHP Code:
        $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">'
    The closing ) is misplaced.
    PHP Code:
        $content .= '<div id="' str_replace('_''-'$box_id) . 'Content" class="sideBoxContent">'
    Ironically, Glenn, I didn't change this code, it is still original from 1.3.8a. At first glance, I'd have to agree that it looks like a bug in the original code, though not one that I injected. Since I'm doing my development on my laptop and I'm on my desktop right now, I don't have any of my code in front of me, although I am looking at a vanilla unzipped version of 1.3.8a and the apparent oops is in there.

    ... looking more carefully ...

    Actually, the more I look at it, I don't think its a bug at all. If you look carefully, they are building the name of the div id, but they are replacing the underscores with dashes. The string 'Content' gets concatenated on to the $box_id as part of the name of the id (like sideBoxContent is the class name - notice the Content tacked onto the end of the name). If the code was changed the way you suggested, there would be an extra keyword 'Content' in the <div> declaration between the id and class attributes. I'm not sure if that would flag an error, but I'm pretty certain that 'Content' would be unrecognized.

    Does that makes sense to you?
    Karen

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Categories Dressing

    Actually either is fine and will generate the same result.

    The str_replace function here is simply replacing underlines with hyphens and including the result in the DIV ID. Since the string Content doesn't have any hyphens, it's unchanged. Whether it's therefore included in the ID by the str_replace or added afterwards makes no difference, the end result.

    Glenn's version is however, very slightly more efficient and would be the way that I would code it by default, since the code will execute a fraction of a millisecond quicker if the Content string is outside of the str_replace function as then it doesn't have to be checked to see if has any underscores.
    Kuroi Web Design and Development | Twitter

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

  7. #7
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Thanks for the info, Kuroi (and Glenn). I haven't been involved in coding enough recently to be thinking forward to optimization issues since losing all my brain cells during childbirth years ago! I'm just doing enough to get by, creating my own site right now, so I definitely appreciate all the help I can get!

    As I mentioned earlier, this code is actually the vanilla 1.3.8a code, not in the code I changed, so if the performance gain is worthwhile you might want to throw this into the 1.4 bucket of upgrades if that eventual version doesn't completely overhaul this code. I might make the change in my own code since I've already got the vanilla code overridden for my changes, just because every little bit helps!

    Thanks again for your support, Glenn and Kuroi!

 

 

Similar Threads

  1. categories dressing
    By fw541c in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 19 Nov 2010, 09:29 PM
  2. Categories Dressing
    By wotnow in forum Addon Sideboxes
    Replies: 10
    Last Post: 7 Apr 2010, 03:06 AM
  3. Categories Dressing issue
    By Maynards in forum Addon Sideboxes
    Replies: 0
    Last Post: 13 Mar 2010, 10:51 PM
  4. Categories Dressing
    By Maynards in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Mar 2010, 11:05 PM
  5. Categories Dressing
    By PGlad in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 7 Aug 2007, 07:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg