Changeset 445

Show
Ignore:
Timestamp:
06/16/07 17:04:06 (1 year ago)
Author:
louisedade
Message:

avatar-upload: Committing to branch 0.4.1b, adding Identicons

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • avatar-upload/branches/0.4.1b/avatar-upload.php

    r440 r445  
    33Plugin Name: Avatar Upload 
    44Plugin URI: http://bbpress.org/plugins/topic/46 
    5 Version: 0.4.1 
    6 Description: Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress
     5Branch: 0.4.1b 
     6Description: Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress, with Identicon support
    77Author: Louise Dade 
    88Author URI: http://www.classical-webdesigns.co.uk/ 
     
    163163} 
    164164 
     165// Has user checked the "Use Identicon" option? 
     166if( $_POST['identicon'] ) 
     167{ 
     168        felapplyidenticon( $user_id ); // create an identicon 
     169} 
     170 
    165171bb_load_template( 'avatar.php', array('success_message', 'config') ); 
    166172?> 
  • avatar-upload/branches/0.4.1b/my-plugins/bb-avatar-upload.php

    r440 r445  
    33Plugin Name: Avatar Upload 
    44Plugin URI: http://bbpress.org/plugins/topic/46 
    5 Version: 0.4.1 
    6 Description: Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress
     5Branch: 0.4.1b 
     6Description: Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress, with Identicon support
    77Author: Louise Dade 
    88Author URI: http://www.classical-webdesigns.co.uk/ 
     
    2626                // The default URI is in the '$this->avatar_dir' folder. 
    2727                $this->default_avatar = array(   
    28                         'use_default' => 1
     28                        'use_default' => 0
    2929                        'uri' =>  bb_get_option('uri') . $this->avatar_dir . 'default.png', 
    3030                        'width' => 80, 
     
    7777                echo'" width="'.$a[1].'" height="'.$a[2].'" alt="'.$a[4].'" />'; 
    7878        } else { 
     79                // no stored avatar was found so we opt for the defaults 
     80 
    7981                $config = new avatarupload_config(); 
    8082 
    8183                if ($config->default_avatar['use_default'] == 1) 
    8284                { 
     85                        // Use a "genric" default avatar 
    8386                        echo '<img src="'.$config->default_avatar['uri'].'" width="'.$config->default_avatar['width'] 
    8487                        .'" height="'.$config->default_avatar['height'].'" alt="'.$config->default_avatar['alt'].'" />'; 
     88                } else { 
     89                        // Or use Identicons instead.  New users will have an identicon automatically 
     90                        // created when they join, but this is for existing users with no avatar. 
     91 
     92                        felapplyidenticon($id); // create identicon 
     93 
     94                        // now fetch it from the database 
     95                        if ($a = avatarupload_get_avatar($id)) 
     96                        { 
     97                                echo '<img src="'.$a[0]; 
     98                                echo ($status == 'new') ? '?'.time() : ''; 
     99                                echo'" width="'.$a[1].'" height="'.$a[2].'" alt="'.$a[4].'" />'; 
     100                        } 
    85101                } 
    86102        } 
  • avatar-upload/branches/0.4.1b/my-templates/avatar.php

    r437 r445  
    2929<p><?php echo avatarupload_display($user->ID, 'new'); ?></p> 
    3030 
     31<form method="POST" action="<?php profile_tab_link($user->ID, 'avatar'); ?>"> 
     32<p><label><input type="checkbox" name="identicon" /> Use your Identicon instead.</label></p> 
     33<p><input type="submit" name="submit" id="submit" value="Use Identicon" /></p> 
     34</form> 
     35 
    3136<?php } ?> 
    3237 
  • avatar-upload/branches/0.4.1b/readme.txt

    r440 r445  
    44Requires at least: 0.8 
    55Tested up to: 0.8.1 
    6 Stable Tag: 0.4.1 
     6Branch: 0.4.1b 
    77 
    8 Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress. Admins can configure maximum allowed file size and image dimensions. 
     8Allows 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 for 'Identicons' - default avatars made of abstract patterns based on the user's email address. 
     9 
     10This is a branch of Avatar Upload version 0.4.1. 
    911 
    1012== Description == 
     
    3234* Option to display a default avatar for users who do not upload their own. 
    3335 
    34 * Can be extended with fel64's "Identicons" plugin to give users the option of displaying an identicon instead of uploading an image (becomes their 'default' avatar). http://bbpress.org/forums/topic/1027?replies=25#post-6759 
     36* fel64's "Identicons" plugin gives users the option of displaying an identicon instead of uploading an image (becomes their 'default' avatar). http://bbpress.org/forums/topic/1027?replies=25#post-6759 
     37 
     38Credit to fel64 for providing the bbPress interface for Identicons and Scott Sherrill-Mix for writing the Identicon code at http://scott.sherrillmix.com/blog/blogger/wp_identicon/  
     39 
    3540 
    3641== Installation == 
     
    3944 
    40451. Open up the `my-plugins/bb-avatar-upload.php` file and configure the "Configuration Settings". At least make sure the `$avatar_dir` variable is correct. 
     46 
     47    IMPORTANT: to use Identicons, you must leave the 'use_default' (avatar) option as '0' so that 
     48    the user's automatically created identicon is displayed and not the generic default image. 
    4149 
    42502. The avatar upload page should appear as a tab ("Avatar") on the user's Profile menu.  If you'd prefer the link to be elsewhere, insert the following "Upload Avatar" link wherever you wish: 
     
    7886   `my-plugins/bb-avatar-upload.php` - your `my-plugins/` dir (and activated). 
    7987 
     88   `my-plugins/identicon.php`        - your `my-plugins/` dir (and activated). 
     89 
    8090That's it, the 'Avatar Upload' plugin should now be working. 
    8191 
     
    97107 
    98108== Change Log == 
     1092007-06-16 ver. 0.4.1b branch to include Identicons as avatar option. 
    99110 
    1001112007-06-10 Ver. 0.4.1 minor bug fixes (and made readme more readable in the plugin browser).