Zen Cart Logo
Forums / Bug Reports / [Done v1.3.9a] imagefontheight() error in banner_manager.php

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

Locked

Views: 3,483

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
20 Nov 2009, 10:40 AM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

[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:

http://www.torvista.com/banner_error.gif

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

21 Nov 2009, 3:18 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.9a] 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: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:```
error_reporting(0);

21 Nov 2009, 8:09 AM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

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

Fixed,

thanks

Steve

16 Mar 2010, 12:11 AM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: [Done v1.3.9a] 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)

$this->DrawText($this->x_label_ttffont, $this->x_label_angle,

and change it to

$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)*