Changeset 1198
- Timestamp:
- 03/03/2008 06:16:23 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
bb-admin/options-general.php (modified) (2 diffs)
-
bb-includes/pluggable.php (modified) (1 diff)
-
bb-includes/template-functions.php (modified) (3 diffs)
-
bb-templates/kakumei/post.php (modified) (1 diff)
-
bb-templates/kakumei/profile.php (modified) (1 diff)
-
bb-templates/kakumei/style.css (modified) (5 diffs)
-
bb-templates/kakumei/topic.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-admin/options-general.php
r1174 r1198 67 67 $selected[bb_get_option('mod_rewrite')] = ' selected="selected"'; 68 68 ?> 69 <option value="0"<?php echo $selected[0]; ?>><?php _e('None') ?> .../forums.php?id=1</option> 70 <option value="1"<?php echo $selected[1]; ?>><?php _e('Numeric') ?> .../forums/1</option> 71 <option value="slugs"<?php echo $selected['slugs']; ?>><?php _e('Name based') ?> .../forums/first-forum</option> 69 <option value="0"<?php echo $selected[0]; ?>><?php _e('None'); ?> .../forums.php?id=1</option> 70 <option value="1"<?php echo $selected[1]; ?>><?php _e('Numeric'); ?> .../forums/1</option> 71 <option value="slugs"<?php echo $selected['slugs']; ?>><?php _e('Name based'); ?> .../forums/first-forum</option> 72 <?php 73 unset($selected); 74 ?> 72 75 </select> 73 76 </div> … … 122 125 </fieldset> 123 126 <fieldset> 127 <legend><?php _e('Avatars'); ?></legend> 128 <p> 129 <?php _e('bbPress includes built-in support for <a href="http://gravatar.com/">Gravatars</a>, you can enable this feature here.'); ?> 130 </p> 131 <label for="avatars_show"> 132 <?php _e('Show avatars:') ?> 133 </label> 134 <div> 135 <?php 136 $checked = array(); 137 $checked[bb_get_option('avatars_show')] = ' checked="checked"'; 138 ?> 139 <input type="checkbox" class="checkbox" name="avatars_show" id="avatars_show" value="1"<?php echo $checked[1]; ?> /> 140 <?php 141 unset($checked); 142 ?> 143 </div> 144 <label for="avatars_rating"> 145 <?php _e('Gravatar maximum rating:'); ?> 146 </label> 147 <div> 148 <select name="avatars_rating" id="avatars_rating"> 149 <?php 150 $selected = array(); 151 $selected[bb_get_option('avatars_rating')] = ' selected="selected"'; 152 ?> 153 <option value="0"<?php echo $selected[0]; ?>><?php _e('None'); ?></option> 154 <option value="X"<?php echo $selected['X']; ?>><?php _e('X'); ?></option> 155 <option value="R"<?php echo $selected['R']; ?>><?php _e('R'); ?></option> 156 <option value="PG"<?php echo $selected['PG']; ?>><?php _e('PG'); ?></option> 157 <option value="G"<?php echo $selected['G']; ?>><?php _e('G'); ?></option> 158 <?php 159 unset($selected); 160 ?> 161 </select> 162 <p> 163 <img src="http://site.gravatar.com/images/gravatars/ratings/3.gif" alt="Rated X" style="height:30px; width:30px; float:left; margin-right:10px;" /> 164 <?php _e('X rated gravatars may contain hardcore sexual imagery or extremely disturbing violence.'); ?> 165 </p> 166 <p> 167 <img src="http://site.gravatar.com/images/gravatars/ratings/2.gif" alt="Rated R" style="height:30px; width:30px; float:left; margin-right:10px;" /> 168 <?php _e('R rated gravatars may contain such things as harsh profanity, intense violence, nudity, or hard drug use.'); ?> 169 </p> 170 <p> 171 <img src="http://site.gravatar.com/images/gravatars/ratings/1.gif" alt="Rated PG" style="height:30px; width:30px; float:left; margin-right:10px;" /> 172 <?php _e('PG rated gravatars may contain rude gestures, provocatively dressed individuals, the lesser swear words, or mild violence.'); ?> 173 </p> 174 <p> 175 <img src="http://site.gravatar.com/images/gravatars/ratings/0.gif" alt="Rated G" style="height:30px; width:30px; float:left; margin-right:10px;" /> 176 <?php _e('A G rated gravatar is suitable for display on all websites with any audience type.'); ?> 177 </p> 178 </div> 179 </fieldset> 180 <fieldset> 124 181 <?php bb_nonce_field( 'options-general-update' ); ?> 125 182 <input type="hidden" name="action" id="action" value="update" /> -
trunk/bb-includes/pluggable.php
r1153 r1198 428 428 endif; 429 429 430 if ( !function_exists( 'bb_get_avatar' ) ) : 431 /** 432 * bb_get_avatar() - Get avatar for a user 433 * 434 * Retrieve the avatar for a user provided a user ID or email address 435 * 436 * @since 0.8.4 437 * @param int|string $id_or_email A user ID or email address 438 * @param int $size Size of the avatar image 439 * @param string $default URL to a default image to use if no avatar is available 440 * @return string <img> tag for the user's avatar 441 */ 442 function bb_get_avatar( $id_or_email, $size = '80', $default = '' ) { 443 if ( !bb_get_option('avatars_show') ) 444 return false; 445 446 if ( !$email = bb_get_user_email($id_or_email) ) 447 $email = $id_or_email; 448 449 if ( !$email ) 450 $email = ''; 451 452 if ( empty($default) ) 453 $default = 'http://www.gravatar.com/avatar.php?gravatar_id=ad516503a11cd5ca435acc9bb6523536&size=' . $size; 454 // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com') 455 $default = urlencode( $default ); 456 457 if ( !empty($email) ) { 458 $out = 'http://www.gravatar.com/avatar.php?gravatar_id='; 459 $out .= md5( $email ); 460 $out .= '&size=' . $size; 461 $out .= '&default=' . $default; 462 463 $rating = bb_get_option('avatars_rating'); 464 if ( !empty( $rating ) ) 465 $out .= '&rating=' . $rating; 466 467 $avatar = '<img alt="" src="' . $out . '" class="avatar avatar-' . $size . '" height="' . $size . '" width="' . $size . '" />'; 468 } else { 469 $avatar = '<img alt="" src="' . $default . '" />'; 470 } 471 472 return apply_filters('bb_get_avatar', $avatar, $id_or_email, $size, $default); 473 } 474 endif; 430 475 ?> -
trunk/bb-includes/template-functions.php
r1185 r1198 4 4 global $bb, $bbdb, $bb_current_user, $page, $bb_cache, 5 5 $posts, $bb_post, $post_id, $topics, $topic, $topic_id, 6 $forums, $forum, $forum_id, $tags, $tag, $tag_name, $user, $user_id, $view; 6 $forums, $forum, $forum_id, $tags, $tag, $tag_name, $user, $user_id, $view, 7 $del_class, $bb_alt; 7 8 8 9 if ( $globals ) … … 1150 1151 } 1151 1152 1153 function post_author_avatar( $size = '48', $default = '', $post_id = 0 ) { 1154 if ( ! bb_get_option('show_avatars') ) 1155 return false; 1156 1157 $author_id = get_post_author_id( $post_id ); 1158 if ( $link = get_user_link( $author_id ) ) { 1159 echo '<a href="' . attribute_escape( $link ) . '">' . bb_get_avatar( $author_id, $size, $default ) . '</a>'; 1160 } else { 1161 echo bb_get_avatar( $author_id, $size, $default ); 1162 } 1163 } 1164 1152 1165 function post_text( $post_id = 0 ) { 1153 1166 echo apply_filters( 'post_text', get_post_text( $post_id ), get_post_id( $post_id ) ); … … 1423 1436 if ( is_array( $profile_info_keys ) ) { 1424 1437 foreach ( $profile_info_keys as $key => $label ) { 1425 if ( 'user_email' != $key && isset($user->$key) && '' !== $user->$key && 'http://' != $user->$key ) { 1438 if ( 1439 ( 'user_email' != $key || ( 'user_email' == $key && bb_current_user_can( 'edit_users' ) ) ) 1440 && isset($user->$key) 1441 && '' !== $user->$key 1442 && 'http://' != $user->$key 1443 ) { 1426 1444 echo "\t<dt>{$label[1]}</dt>\n"; 1427 1445 echo "\t<dd>" . make_clickable($user->$key) . "</dd>\n"; -
trunk/bb-templates/kakumei/post.php
r678 r1198 1 1 <div class="threadauthor"> 2 <p><strong><?php post_author_link(); ?></strong><br /> 3 <small><?php post_author_title(); ?></small></p> 2 <?php post_author_avatar(); ?> 3 <p> 4 <strong><?php post_author_link(); ?></strong><br /> 5 <small><?php post_author_title(); ?></small> 6 </p> 4 7 </div> 5 8 6 <div class="threadpost">9 <div<?php alt_class('post', 'threadpost ' . $del_class); ?>> 7 10 <div class="post"><?php post_text(); ?></div> 8 11 <div class="poststuff"><?php printf( __('Posted %s ago'), bb_get_post_time() ); ?> <a href="<?php post_anchor_link(); ?>">#</a> <?php post_ip_link(); ?> <?php post_edit_link(); ?> <?php post_delete_link(); ?></div> -
trunk/bb-templates/kakumei/profile.php
r711 r1198 2 2 3 3 <h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> » <?php _e('Profile') ?></h3> 4 <div id="useravatar"><?php echo bb_get_avatar( $user->ID ); ?></div> 4 5 <h2 id="userlogin"><?php echo get_user_name( $user->ID ); ?></h2> 5 6 -
trunk/bb-templates/kakumei/style.css
r1169 r1198 40 40 41 41 h2 { font-size: 1.5em; } 42 43 img.avatar { border: 1px solid #ddd; } 42 44 43 45 /* Structure … … 233 235 234 236 #thread { 235 background: #eee;236 237 list-style: none; 237 margin: 0 0 0 100px;238 margin: 0; 238 239 padding: 0; 239 240 } 240 241 241 242 #thread li { 242 padding: 1.5em 1.0em;243 243 line-height: 1.5em; 244 clear: both; 245 /* Hack to force padding on .threadauthor on IE */ 246 border-top: 1px solid #fff; 244 247 } 245 248 … … 249 252 250 253 .threadauthor { 251 margin-left: -110px; 252 overflow: hidden; 253 position: absolute; 254 width: 95px; 255 } 254 float: left; 255 padding: 1em 0 0 1em; 256 width: 120px; 257 } 258 259 .threadauthor p { margin: 0; } 256 260 257 261 .threadauthor small { font: 11px Verdana, Arial, Helvetica, sans-serif; } 258 262 263 .threadpost { 264 padding: 1.5em 1em; 265 margin-left: 140px; 266 background-color: #eee; 267 -moz-border-radius: 6px; 268 -khtml-border-radius: 6px; 269 -webkit-border-radius: 6px; 270 border-radius: 6px; 271 } 272 273 .threadpost.alt { 274 background-color: transparent; 275 } 259 276 260 277 #thread .post blockquote { … … 387 404 position: relative; 388 405 top: -10px; 389 -moz-border- bottom-left-radius: 6px;406 -moz-border-radius-bottomleft: 6px; 390 407 -khtml-border-bottom-left-radius: 6px; 391 408 -webkit-border-bottom-left-radius: 6px; 392 409 border-bottom-left-radius: 6px; 393 -moz-border- bottom-right-radius: 6px;410 -moz-border-radius-bottomright: 6px; 394 411 -khtml-border-bottom-right-radius: 6px; 395 412 -webkit-border-bottom-right-radius: 6px; … … 405 422 background: #e4f3e1; 406 423 } 424 425 #useravatar { margin-bottom: 1em; } 426 427 #useravatar img { display: block; border-width: 3px; border-style: double; } 407 428 408 429 #userinfo { margin-top: 10px; } -
trunk/bb-templates/kakumei/topic.php
r968 r1198 22 22 <?php topic_tags(); ?> 23 23 24 < br clear="all" />24 <div style="clear:both;"></div> 25 25 </div> 26 26 <?php do_action('under_title', ''); ?> … … 33 33 34 34 <?php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?> 35 <li id="post-<?php post_id(); ?>" <?php alt_class('post', $del_class); ?>>35 <li id="post-<?php post_id(); ?>"> 36 36 <?php bb_post_template(); ?> 37 37 </li>
Note: See TracChangeset
for help on using the changeset viewer.