Changeset 1156 for trunk/common


Ignore:
Timestamp:
12/06/11 01:14:30 (6 months ago)
Author:
bogdan2412
Message:

Fix errors that appeared during deployment of avatar optimization

  • Use hardlinks for full size avatars when possible, so we conserve

disk space.

  • Skip users with invalid usernames
  • Create 'tiny', 'small', etc folders if missing
  • Added verbose parameter that allows one to view progress
  • Coding style, don't use " when not needed.

There are still some tasks left, as described in
REVIEW URL http://reviewboard.infoarena.ro/r/180/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/avatar.php

    r1155 r1156  
    2121            'L50x50' => 'normal/' , '75x75'=> 'forum/', '150x150' => 'big/'); 
    2222 
    23     // Copying the original image 
    24     copy($filepath, IA_AVATAR_FOLDER.'full/'.$new_filename); 
     23    // Hardlink / Copy the original image 
     24    $new_filepath = IA_AVATAR_FOLDER . 'full/' . $new_filename; 
     25    if (is_file($new_filepath) || is_link($new_filepath)) { 
     26        unlink($new_filepath); 
     27    } 
     28    if (!link($filepath, $new_filepath)) { 
     29        if (!copy($filepath, $new_filepath)) { 
     30            log_error('Unable to copy user avatar into avatar folder'); 
     31        } 
     32    } 
    2533 
    2634    list($image_width, $image_height, $image_type, $image_attribute) = 
Note: See TracChangeset for help on using the changeset viewer.