Changeset 40975
- Timestamp:
- 04/16/08 17:30:25 (3 months ago)
- Files:
-
- add-local-avatar/trunk/avatars.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
add-local-avatar/trunk/avatars.php
r39565 r40975 5 5 Description: A plugin to manage public and private avatars. 6 6 Author: Peter Sterling 7 Version: 3. 07 Version: 3.2 8 8 Changes: 0.1 - Initial version. 9 9 1.0 - Added pagination of users list. … … 11 11 2.1 - Added example formatting information. 12 12 3.0 - Added ability to place avatars in written post content (plus other tweaks). 13 3.1 - Minor tweaks to usage text and options. 14 3.2 - Added check for administration pages to stop user URL wrapping breaking comment editing. 13 15 Author URI: http://www.sterling-adventures.co.uk/ 14 16 */ … … 101 103 $out = 'http://www.gravatar.com/avatar/'; 102 104 $out .= md5(strtolower($email)); 103 $out .= '?s=' .$size;105 $out .= '?s=' . $size; 104 106 $out .= '&d=' . urlencode($default); 105 107 … … 113 115 } 114 116 115 // If there is a URL wrap the avatar markup with an anchor.116 if(!empty($url) && $url != 'http://' ) $avatar = "<a alt='Avatar' href='" . attribute_escape($url) . "' title='" . (empty($name) ? '' : "Visit $name’s website.") . "' " . ($avatar_options['snapshots'] == 'on' ? '>' : "class='snap_noshots'>") . $avatar . "</a>";117 // If not in admin pages and there is a URL wrap the avatar markup with an anchor. 118 if(!empty($url) && $url != 'http://' && !is_admin()) $avatar = "<a alt='Avatar' href='" . attribute_escape($url) . "' title='" . (empty($name) ? '' : "Visit $name’s website.") . "' " . ($avatar_options['snapshots'] == 'on' ? '>' : "class='snap_noshots'>") . $avatar . "</a>"; 117 119 118 120 // Return the filtered result. … … 297 299 <tr> 298 300 <td><label for="show_avatars">Show avatars:</label><br /><small>Repeated from Settings » Discussion</small></td> 299 <td ><input type="checkbox" name="show_avatars" <?php echo (get_option('show_avatars') ? 'checked' : ''); ?> /></td>301 <td colspan=2><input type="checkbox" name="show_avatars" <?php echo (get_option('show_avatars') ? 'checked' : ''); ?> /></td> 300 302 </tr> 301 303 <tr> 302 304 <td>Avatar rating:<br /><small>Repeated from Settings » Discussion</small></td> 303 305 <td> 304 < label><input type='radio' name='avatar_rating' value='G' <?php echo (get_option('avatar_rating') == 'G' ? 'checked="checked"' : ''); ?>> G — Suitable for all audiences</label><br />305 < label><input type='radio' name='avatar_rating' value='PG' <?php echo (get_option('avatar_rating') == 'PG' ? 'checked="checked"' : ''); ?>> PG — Possibly offensive, usually for audiences 13 and above</label><br />306 < label><input type='radio' name='avatar_rating' value='R' <?php echo (get_option('avatar_rating') == 'R' ? 'checked="checked"' : ''); ?>> R — Intended for adult audiences above 17</label><br />307 < label><input type='radio' name='avatar_rating' value='X' <?php echo (get_option('avatar_rating') == 'X' ? 'checked="checked"' : ''); ?>> X — Even more mature than above</label><br />306 <input type='radio' name='avatar_rating' value='G' <?php echo (get_option('avatar_rating') == 'G' ? 'checked="checked"' : ''); ?> /> G <br /> 307 <input type='radio' name='avatar_rating' value='PG' <?php echo (get_option('avatar_rating') == 'PG' ? 'checked="checked"' : ''); ?> /> PG<br /> 308 <input type='radio' name='avatar_rating' value='R' <?php echo (get_option('avatar_rating') == 'R' ? 'checked="checked"' : ''); ?> /> R <br /> 309 <input type='radio' name='avatar_rating' value='X' <?php echo (get_option('avatar_rating') == 'X' ? 'checked="checked"' : ''); ?> /> X 308 310 </td> 309 </tr>310 <tr>311 <td><label for='size'>Size:</label></td>312 311 <td> 312 - Suitable for all audiences<br /> 313 - Possibly offensive, usually for audiences 13 and above<br /> 314 - Intended for adult audiences above 17<br /> 315 - Even more mature than above 316 </td> 317 </tr> 318 <tr> 319 <td>Size:</td> 320 <td colspan=2> 313 321 <select name='size'><?php 314 322 for ($i = 10; $i <= 80; $i = $i + 10) { … … 321 329 </tr> 322 330 <tr> 323 <td><label for='default'>Default image:</label></td> 331 <td>Default image:</td> 332 <td><?php echo get_avatar('default'); ?></td> 324 333 <td><input type='text' name='default' value='<?php echo $avatar_options['default']; ?>' size='70' /></td> 325 334 </tr> 326 335 <tr> 327 <td><label for="snapshots">Use Snapshots:</label></td> 328 <td><input type="checkbox" name="snapshots" <?php echo $avatar_options['snapshots'] == 'on' ? 'checked' : ''; ?> /> <small>if you have enabled <a href="http://www.snap.com">snapshots</a>, clearing this will disable them for avatar links</small></td> 329 </tr> 330 <tr> 331 <td><label for="in_posts">Replace <code><!-- avatar <b>e-mail</b> --></code> with avatar in posts:</label></td> 336 <td>Use Snapshots:</td> 337 <td><input type="checkbox" name="snapshots" <?php echo $avatar_options['snapshots'] == 'on' ? 'checked' : ''; ?> /></td> 338 <td><small>If you have enabled <a href="http://www.snap.com">snapshots</a>, clearing this will disable them for avatar links</small></td> 339 </tr> 340 <tr> 341 <td>Avatars in posts:</td> 332 342 <td><input type="checkbox" name="in_posts" <?php echo $avatar_options['in_posts'] == 'on' ? 'checked' : ''; ?> /></td> 343 <td><small>Replaces </small><code><!-- avatar <b>e-mail</b> --></code><small> with an avatar for that email address in post content</small></td> 333 344 </tr> 334 345 </table>
