Photo Gallery has given random error and stopped working

ben reilly tribute

New Member
Messages
23
Reaction score
0
Points
1
Here is the error the gallery is giving:
Deprecated: Function ereg_replace() is deprecated in /home/enforcer/public_html/enforcer/libraries/general.init.php on line 96

Notice: Undefined index: JPG Support in /home/enforcer/public_html/enforcer/libraries/general.init.php on line 100
[DEBUG] Mozilla/5.0 (Windows NT 5.2; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1

click to dismiss...

on my page: http://www.benreillytribute.x10hosting.com/enforcer/

Any suggestions?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
They upgraded to PHP 5.3 which causes the "Deprecated" warning. Since it is just one line, why don't you post lines 90-110 from that script and maybe we can rewrite that part for you.

Please label line #96 (if you open the file in cPanel->File Manager Code editor, it has line numbers)

Not sure about the 'Undefined index". Maybe we can fix that too.
 
Last edited:

ben reilly tribute

New Member
Messages
23
Reaction score
0
Points
1
This?

require_once($langfile);

/* check version of GD libraries */
if (function_exists('gd_info')) {
$gda = gd_info();
$gd['version'] = $gda['GD Version'];
<<Line 96>>>$gd['num'] = ereg_replace('[[:alpha:][:space:]()]+','',$gda['GD Version']);
$gd['freetype'] = $gda["FreeType Support"];
$gd['gif_read'] = $gda["GIF Read Support"];
$gd['gif_make'] = $gda["GIF Create Support"];
$gd['jpg'] = $gda["JPG Support"];
$gd['png'] = $gda["PNG Support"];
//$gd['t1lib'] = $gd_array["T1Lib Support"];
//$gd['wbmp'] = $gd_array["WBMP Support"];
//$gd['xbm'] = $gd_array["XBM Support"];

$gd_info = '';
foreach ($gda as $key => $val) { $gd_info .= $key.'='.$val.'; '; };
if ($settings['thumbnail_debug']) { $alert_message[] = $gd_info; };
}
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Comment out the line ( add // in front ) and add on the next line after it:

Code:
$gd['num'] = preg_replace('/[a-zA-Z\s()]+/','',$gda['GD Version']);

ALSO, four lines below that, comment out:

Code:
$gd['jpg'] = $gda["JPG Support"];

and add

Code:
$gd['jpg'] = $gda["JPEG Support"];
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Deprecated: Function split() is deprecated in /home/enforcer/public_html/enforcer/libraries/thumb.display.php on line 204

is one problem on the first page when you click on the thumb.

Again, post the code lines 195 - 210 from thumb.display.php and I will try to find a fix (tomorrow, going to bed now).
 

ben reilly tribute

New Member
Messages
23
Reaction score
0
Points
1
No problem. Thanks for your help!!

/// up the image quality
$img_quality = 100;

} else {
$created = imagecopyresampled($thumb, $image, 0, 0, $move_w, $move_h, $w, $h, $th_w, $th_h);

}

//// cache images (if enabled)
$current_gallery = array_pop(split("/", dirname($img)));
$cache_thumb_dir = "../cache/"
.$settings['gallery_prefix']
.$current_gallery;

$thumb_url = $cache_thumb_dir."/"
.$_prefix
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
// comment out

Code:
$current_gallery = array_pop(split("/", dirname($img)));

add below it

Code:
$current_gallery = array_pop(explode("/", dirname($img)));
 
Top