Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default [Done v1.3.9a] imagefontheight() error in banner_manager.php

    Hi,
    I think this is related to the latest xampp package with php 5.3 and the GD library. The error occurs on a fresh install of 1.38a with this package and not with 5.2.9.

    In admin, tools, Banner Manager there are multiple warnings along the lines of
    Warning: imagefontheight() expects parameter 1 to be long, string given in D:\....\httpdocs\zen138a\admin\includes\classes\phplot.php on line 686
    Screenshot here:
    [SCR]http://www.torvista.com/banner_error.gif[/SCR]

    All the errors are referencing the use of the same variable $which_font which gets passed to the function DrawText.

    I cannot find any other file (outside of phplot.php) that makes a call to this function and so don't know where this variable is coming from to know how it is created. In either case the echo value of $which_font is 4.

    On the web the only identical report is in the oscommerce forums:

    forums.oscommerce.com/topic/348579-error-message-in-banner-manager/

    where the guy has copied a replacement phplot.php from the german forum:
    forums.oscommerce.de/lofiversion/index.php?t70562.html

    I compared this file with the original oscommerce version and all the originator has done is remove the lines that were causing the error!!

    I can find reference to similar messages related to the use of the GD library but those waters are too deep for me....
    So, here I am for help.

    Server Info 5.2.9 pdf

    Server Info 5.3.0 pdf

    thanks
    Steve
    Last edited by Kim; 21 Nov 2009 at 05:30 AM.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: imagefontheight() error in banner_manager.php

    It's a PHP 5.3 incompatibility resulting from some sloppy coding in the old phplot class inherited from osCommerce days.
    The messages are merely "warnings", so can be ignored in the short term.

    To fix, assuming you have the PHP 5.3 patch for v1.3.8 installed on your v1.3.8 site, make the following simple change:
    /admin/includes/application_top.php
    line 36 will say:
    Code:
    error_reporting(version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 6.0, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);
    change that to just this:
    Code:
    error_reporting(0);
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: imagefontheight() error in banner_manager.php

    Fixed,

    thanks

    Steve

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

    Default Re: imagefontheight() error in banner_manager.php

    Fix for the underlying problem is to make the following change to the admin/includes/classes/phplot.php file ...

    find the following at about line 2435 (you may find similar lines elsewhere in the file, but this is the one that does the damage)
    PHP Code:
    $this->DrawText($this->x_label_ttffont$this->x_label_angle
    and change it to
    PHP Code:
    $this->DrawText($this->small_font$this->x_label_angle


    [MODERATOR NOTE: This update has been included in the PHP 5.3 Patch file for v1.3.8a)
    Kuroi Web Design and Development | Twitter

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

 

 

Similar Threads

  1. Replies: 8
    Last Post: 6 Jan 2010, 02:34 PM
  2. Replies: 1
    Last Post: 11 Jul 2009, 07:11 PM
  3. Parse error: banner_manager.php
    By Tig in forum General Questions
    Replies: 2
    Last Post: 26 Nov 2007, 09:28 PM
  4. 406 Error on banner_manager.php?
    By bettysue in forum General Questions
    Replies: 1
    Last Post: 8 Jul 2007, 10:41 AM

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