Changeset 532

Show
Ignore:
Timestamp:
08/02/07 16:25:17 (1 year ago)
Author:
louisedade
Message:

avatar-upload: committing version 0.8.1 - bug-fix, plus improved cache support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • avatar-upload/trunk/additional-files/my-templates/avatar.php

    r510 r532  
    3333<?php if (!usingidenticon($user->ID)) { ?> 
    3434<form method="POST" action="<?php profile_tab_link($user->ID, 'avatar'); ?>"> 
    35 <p><label for"useidenticon"><input type="checkbox" name="identicon" value="1" id="useidenticon" /> <?php _e('Use your Identicon instead?'); ?></label></p> 
     35<p><label for="useidenticon"><input type="checkbox" name="identicon" value="1" id="useidenticon" /> <?php _e('Use your Identicon instead?'); ?></label></p> 
    3636<p><input type="submit" name="submit" id="submit" value="Use Identicon" /></p> 
    3737</form> 
  • avatar-upload/trunk/bb-avatar-upload.php

    r531 r532  
    33Plugin Name: Avatar Upload 
    44Plugin URI: http://bbpress.org/plugins/topic/46 
    5 Version: 0.8 
     5Version: 0.8.1 
    66Description: Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress. 
    77Author: Louise Dade 
     
    108108        global $bbdb, $user; 
    109109 
    110         if ($id == $user->ID && $force_db == 0) 
     110        $cached = bb_get_user($id); 
     111 
     112        if ($force_db == 0 && (!empty($user) || !empty($cached)) ) 
    111113        { 
    112114                if (!empty($user->avatar_file)) { 
    113115                        $a = explode("|", $user->avatar_file); 
     116                        $a[] = $user->user_login; // for 'alt' attribute 
    114117                } else { 
    115                         return false; 
     118                        if (!empty($cached)) { 
     119                                $a = explode("|", $cached->avatar_file); 
     120                                $a[] = $cached->user_login; // for 'alt' attribute 
     121                        } else { 
     122                                return false; 
     123                        } 
    116124                } 
    117125        } 
     
    122130                if ( $avatar = $bbdb->get_results($bb_query) ) { 
    123131                        $a = explode("|", $avatar[0]->meta_value); 
     132                        $a[] = substr($a[0], 0, strrpos($a[0], ".")); // for 'alt' attribute (extract from filename) 
    124133                } else { 
    125134                        return false; 
     
    133142                $a[0] = bb_get_option('uri') . $config->avatar_dir . $a[0]; 
    134143        } 
    135  
    136         // Add the username for use in 'alt' attribute to end of array 
    137         $a[] = $user->user_login; 
    138144 
    139145        return $a; 
  • avatar-upload/trunk/readme.txt

    r531 r532  
    44Requires at least: 0.8.2 
    55Tested up to: 0.8.2.1 
    6 Stable Tag: 0.8 
     6Stable Tag: 0.8.1 
    77 
    88Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress. Admins can configure maximum allowed file size and image dimensions. Includes fel64's code enabling 'Identicons' - default avatars made of abstract patterns unique to each user. 
     
    133133 
    134134== Change Log == 
     1352007-08-02 Ver. 0.8.1 Bug-fix, plus improved cache support that should have been in previous update. 
     136 
    1351372007-08-02 Ver. 0.8   Added support for transparent GIFs and PNGs in resize routine. 
    136138