Changeset 445
- Timestamp:
- 06/16/07 17:04:06 (1 year ago)
- Files:
-
- avatar-upload/branches/0.4.1b/avatar-upload.php (modified) (2 diffs)
- avatar-upload/branches/0.4.1b/my-plugins/bb-avatar-upload.php (modified) (3 diffs)
- avatar-upload/branches/0.4.1b/my-plugins/identicon.php (added)
- avatar-upload/branches/0.4.1b/my-templates/avatar.php (modified) (1 diff)
- avatar-upload/branches/0.4.1b/readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
avatar-upload/branches/0.4.1b/avatar-upload.php
r440 r445 3 3 Plugin Name: Avatar Upload 4 4 Plugin 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 .5 Branch: 0.4.1b 6 Description: Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress, with Identicon support. 7 7 Author: Louise Dade 8 8 Author URI: http://www.classical-webdesigns.co.uk/ … … 163 163 } 164 164 165 // Has user checked the "Use Identicon" option? 166 if( $_POST['identicon'] ) 167 { 168 felapplyidenticon( $user_id ); // create an identicon 169 } 170 165 171 bb_load_template( 'avatar.php', array('success_message', 'config') ); 166 172 ?> avatar-upload/branches/0.4.1b/my-plugins/bb-avatar-upload.php
r440 r445 3 3 Plugin Name: Avatar Upload 4 4 Plugin 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 .5 Branch: 0.4.1b 6 Description: Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress, with Identicon support. 7 7 Author: Louise Dade 8 8 Author URI: http://www.classical-webdesigns.co.uk/ … … 26 26 // The default URI is in the '$this->avatar_dir' folder. 27 27 $this->default_avatar = array( 28 'use_default' => 1,28 'use_default' => 0, 29 29 'uri' => bb_get_option('uri') . $this->avatar_dir . 'default.png', 30 30 'width' => 80, … … 77 77 echo'" width="'.$a[1].'" height="'.$a[2].'" alt="'.$a[4].'" />'; 78 78 } else { 79 // no stored avatar was found so we opt for the defaults 80 79 81 $config = new avatarupload_config(); 80 82 81 83 if ($config->default_avatar['use_default'] == 1) 82 84 { 85 // Use a "genric" default avatar 83 86 echo '<img src="'.$config->default_avatar['uri'].'" width="'.$config->default_avatar['width'] 84 87 .'" 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 } 85 101 } 86 102 } avatar-upload/branches/0.4.1b/my-templates/avatar.php
r437 r445 29 29 <p><?php echo avatarupload_display($user->ID, 'new'); ?></p> 30 30 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 31 36 <?php } ?> 32 37 avatar-upload/branches/0.4.1b/readme.txt
r440 r445 4 4 Requires at least: 0.8 5 5 Tested up to: 0.8.1 6 Stable Tag: 0.4.1 6 Branch: 0.4.1b 7 7 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. 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. Includes fel64's code for 'Identicons' - default avatars made of abstract patterns based on the user's email address. 9 10 This is a branch of Avatar Upload version 0.4.1. 9 11 10 12 == Description == … … 32 34 * Option to display a default avatar for users who do not upload their own. 33 35 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 38 Credit 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 35 40 36 41 == Installation == … … 39 44 40 45 1. 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. 41 49 42 50 2. 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: … … 78 86 `my-plugins/bb-avatar-upload.php` - your `my-plugins/` dir (and activated). 79 87 88 `my-plugins/identicon.php` - your `my-plugins/` dir (and activated). 89 80 90 That's it, the 'Avatar Upload' plugin should now be working. 81 91 … … 97 107 98 108 == Change Log == 109 2007-06-16 ver. 0.4.1b branch to include Identicons as avatar option. 99 110 100 111 2007-06-10 Ver. 0.4.1 minor bug fixes (and made readme more readable in the plugin browser).
