Results 1 to 7 of 7

Thread: Fread error..

  1. #1
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Fread error..

    Hey all my site is here for some reason I'm getting a fread error. Can someone look at my coding for me? Every time I reupload the files it all works for about a week or so...... Its getting frustrating...

    Thanks.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Make sure that the file that fread is reading isn't changing because if it is then that could be a posibility. Also can we see your code?


    Make sure your function is coded correctly: http://us.php.net/fread
    Jeremy | jfein.net

  3. #3
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    ok the code is here or the first few lines of it just tell me if you need more..

    Code:
    <?php
    //require('sp_config.php');
    
    define("VERSION","Enhanced Simple PHP Gallery 1.7");
    
    if ($editmode==true)
    {
    	$modrewrite = false;
    	$image_fade_in = false;
    }
    
    //DETECT AND STORE GD VERSION IF THIS IS THE FIRST TIME THE SCRIPT IS RUN.
    if(!isset($gd_version))
    {
    	$config_file = @fopen('sp_config.php','r');
    	$contents = fread($config_file, filesize('sp_config.php'));
    	@fclose($config_file);
    	$gd_version = gd_version();
    	$contents = str_replace('?>','$gd_version = "' . $gd_version . "\";\n?" . ">",$contents);
    	$config_file = @fopen('sp_config.php','w');
    	@fwrite($config_file, $contents);
    and here is the config.php its not 0kb...

    This is the config.php, its in the directory. Thing is if I reupload this file the error will go away.... weird.
    Code:
    <?php
    $title = 'Photo Gallery';
    
    //Thumbnail Settings
    $maxthumbwidth = 120;
    $maxthumbheight = 120;
    $thumbquality = 75;
    
    //Thumbnail next to category
    $cat_thumbs = false;
    
    // Unsharp mask settings for thumbnails
    $thumb_applyunsharpmask = true;
    $thumb_amount = 50;
    $thumb_radius = 0.5;
    $thumb_threshold = 2;
    
    //Main Image Resize Settings
    $resize = true;
    $maxwidth = 600;
    $maxheight = 500;
    $resizequality = 75;
    
    // Unsharp mask settings for resized images
    $resize_applyunsharpmask = true;
    $resize_amount = 50;
    $resize_radius = 0.5;
    $resize_threshold = 2;
    
    //$modrewrite Settings
    $modrewrite = false;
    
    //Cache Settings
    $cachethumbs = false;
    $cachefolder = 'cache';
    
    $cacheresized = false;
    $cacheresizedfolder = 'rcache';
    
    //Preload next image
    $precache = false;
    
    //Folder Hiding
    $hide_folders[] = 'cgi-bin';
    
    // Editing functions
    $allowdeleting = true;
    $allowmaking = true;
    
    //Max image upload size default is 150Kb or 153600 bytes
    $max_size = 153600;
    
    // Number of thumbnails to display on one page
    $limit = 15;
    
    //Miscellaneous Settings
    $showcomments=false;
    $showfolderdetails = true;
    $showimgtitles = true;
    $showdatesonthumbspage = false;
    $alignimages = true;
    $image_fade_in = true;// requires javascript
    
    // Sort directories by title (true) or folder name (false)
    $sortfoldersbytitle = false;
    
    $gd_version = "2.0.28";
    ?>

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I need the part of the code that has the fread() function in it.
    Jeremy | jfein.net

  5. #5
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    PHP Code:
    $contents fread($config_filefilesize('sp_config.php')) 
    in the first code.

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Ok, so try re-uploading it and see if it works.
    Jeremy | jfein.net

  7. #7
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    it works but the thing is after a week or so the error comes back I've tried that for a month.

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
  •