+ Reply to Thread
Results 1 to 9 of 9
Like Tree2Likes
  • 1 Post By descalzo
  • 1 Post By ben reilly tribute

Thread: Photo Gallery has given random error and stopped working

  1. #1
    ben reilly tribute is offline x10Hosting Member ben reilly tribute is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    6

    Photo Gallery has given random error and stopped working

    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?

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Photo Gallery has given random error and stopped working

    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 by descalzo; 08-12-2011 at 08:26 PM.
    Nothing is always absolutely so.

  3. #3
    ben reilly tribute is offline x10Hosting Member ben reilly tribute is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    6

    Re: Photo Gallery has given random error and stopped working

    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; };
    }

  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Photo Gallery has given random error and stopped working

    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"];
    Nothing is always absolutely so.

  5. #5
    ben reilly tribute is offline x10Hosting Member ben reilly tribute is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    6

    Re: Photo Gallery has given random error and stopped working

    That got it working!! Some images aren't loading properly as a thumbnail or zoomed.

  6. #6
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Photo Gallery has given random error and stopped working

    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).
    karimirt47 likes this.
    Nothing is always absolutely so.

  7. #7
    ben reilly tribute is offline x10Hosting Member ben reilly tribute is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    6

    Re: Photo Gallery has given random error and stopped working

    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

  8. #8
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Photo Gallery has given random error and stopped working

    // comment out

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

    Code:
    $current_gallery = array_pop(explode("/", dirname($img)));
    Nothing is always absolutely so.

  9. #9
    ben reilly tribute is offline x10Hosting Member ben reilly tribute is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    6

    Re: Photo Gallery has given random error and stopped working

    You did it!!! Thanks so much man!
    dinomirt96 likes this.

+ Reply to Thread

Similar Threads

  1. Flash photo gallery help
    By fllrfth in forum Programming Help
    Replies: 1
    Last Post: 02-22-2011, 08:52 PM
  2. CNAME stopped working at random
    By mc se7en in forum Free Hosting
    Replies: 11
    Last Post: 11-11-2009, 08:44 AM
  3. Best Photo Gallery
    By mac173 in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 12-10-2007, 02:34 PM
  4. Photo Gallery recommendations?
    By jeffpattyhertel in forum Off Topic
    Replies: 3
    Last Post: 11-19-2007, 03:21 PM
  5. Gallery stopped working
    By digitaljit in forum Free Hosting
    Replies: 1
    Last Post: 06-18-2007, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers