Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2009
    Posts
    2
    Plugin Contributions
    0

    Default Overriding functions/html_output.php

    Zen Cart 1.3.8a
    Database Patch Level: 1.3.8
    Server OS: Linux 2.4.20PIII
    PHP Version: 4.4.2 (Zend: 1.3.0)
    Database: MySQL 4.1.19-standard

    I would like to override the functions in the html_output.php file that output HTML tags.

    Where do I put these functions, and what replacement structure do I need to use to remove / disregard the previously defined versions of these functions so I dont end up with PHP errors saying I duplicated something.

  2. #2
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: Overriding functions/html_output.php

    There is no in-built override system for files in the includes/functions folder, but I recentyly figured out a method to do it by utilizing the override capabilities within the autoload/init_includes system.

    First, make a copy of includes/init_includes/init_general_functions.php and save it in the includes/init_includes/overrides/ folder. Then edit that file to modify the loading of the html_output.php file so that it calls the file from an overrides folder like:
    Code:
    require(DIR_WS_FUNCTIONS . 'overrides/html_output.php');
    Then you can create your new folder includes/functions/overrides/, and put an edited copy of html_output in there. This way you can edit or add functions within html_output.php and not have to worry about duplicate functions warnings, or about your changes getting overwritten during an upgrade.

    You can use a similar method for overriding anything in the functions or classes folders, which don't have an inherent override capability.
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  3. #3
    Join Date
    Feb 2009
    Posts
    2
    Plugin Contributions
    0

    Default Re: Overriding functions/html_output.php

    Awesome! Thank you! This is the perfect solution!

  4. #4
    Join Date
    Mar 2009
    Posts
    30
    Plugin Contributions
    0

    Default Re: Overriding functions/html_output.php

    wow, it really helped me as well bunyip. I was looking into fixing the size of the header 2 banner regardless the size of the original image.
    So I overrided banner.php and added two parameters to function zen_display_banner, width and height, both to be passed at the same time to zen_image, so that the image will be resized if needed.

 

 

Similar Threads

  1. v151 Plugin authors: Overrides of /includes/functions/html_output.php
    By lat9 in forum Contribution-Writing Guidelines
    Replies: 2
    Last Post: 3 May 2014, 08:48 AM
  2. v139h Overriding functions?
    By retched in forum Contribution-Writing Guidelines
    Replies: 4
    Last Post: 15 Feb 2012, 03:55 PM
  3. Can I override functions/html_output ?
    By Minnie Mouse in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 20 Aug 2008, 06:00 AM
  4. Overriding Functions
    By jgamio in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Nov 2006, 06:03 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR