Changeset 670
- Timestamp:
- 02/05/07 22:49:56 (2 years ago)
- Files:
-
- trunk/bb-admin/admin-functions.php (modified) (1 diff)
- trunk/bb-includes/akismet.php (modified) (3 diffs)
- trunk/bb-includes/registration-functions.php (modified) (2 diffs)
- trunk/bb-includes/template-functions.php (modified) (2 diffs)
- trunk/bb-templates/kakumei/logged-in.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bb-admin/admin-functions.php
r662 r670 187 187 function bb_user_row( $user_id, $role = '', $email = false ) { 188 188 $user = bb_get_user( $user_id ); 189 $r = "\t<tr id='user-$user_id'" . get_alt_class("user-$role") . ">\n"; 190 $r .= "\t\t<td>$user_id</td>\n"; 191 $r .= "\t\t<td><a href='" . get_user_profile_link( $user_id ) . "'>" . get_user_name( $user_id ) . "</a></td>\n"; 192 if ( $email ) 193 $r .= "\t\t<td><a href='mailto:$user->user_email'>$user->user_email</a></td>\n"; 189 $r = "\t<tr id='user-$user->ID'" . get_alt_class("user-$role") . ">\n"; 190 $r .= "\t\t<td>$user->ID</td>\n"; 191 $r .= "\t\t<td><a href='" . get_user_profile_link( $user->ID ) . "'>" . get_user_name( $user->ID ) . "</a></td>\n"; 192 if ( $email ) { 193 $email = bb_get_user_email( $user->ID ); 194 $r .= "\t\t<td><a href='mailto:$email'>$email</a></td>\n"; 195 } 194 196 $r .= "\t\t<td>$user->user_registered</td>\n"; 195 $r .= "\t\t<td><a href='" . get_profile_tab_link( $user _id, 'edit' ) . "'>" . __('Edit') . "</a></td>\n\t</tr>";197 $r .= "\t\t<td><a href='" . get_profile_tab_link( $user->ID, 'edit' ) . "'>" . __('Edit') . "</a></td>\n\t</tr>"; 196 198 return $r; 197 199 } trunk/bb-includes/akismet.php
r555 r670 58 58 'permalink' => get_topic_link( $bb_post->topic_id ), // First page 59 59 'comment_type' => 'forum', 60 'comment_author' => $user->user_login,61 'comment_author_email' => $user->user_email,62 'comment_author_url' => $user->user_url,60 'comment_author' => get_user_name( $user->ID ), 61 'comment_author_email' => bb_get_user_email( $user->ID ), 62 'comment_author_url' => get_user_link( $user->ID ), 63 63 'comment_content' => $bb_post->post_text, 64 64 'comment_date_gmt' => $bb_post->post_time … … 77 77 'permalink' => get_user_profile_link( $user->ID ), 78 78 'comment_type' => 'profile', 79 'comment_author' => $user->user_login,80 'comment_author_email' => $user->user_email,81 'comment_author_url' => $user->user_url,79 'comment_author' => get_user_name( $user-ID ), 80 'comment_author_email' => bb_get_user_email( $user->ID ), 81 'comment_author_url' => get_user_link( $user->ID ), 82 82 'comment_content' => $user->occ . ' ' . $user->interests, 83 83 'comment_date_gmt' => $user->user_registered … … 93 93 'referrer' => $_SERVER['HTTP_REFERER'], 94 94 'comment_type' => isset($_POST['topic_id']) ? 'forum' : 'profile', 95 'comment_author' => $bb_current_user->data->user_login,96 'comment_author_email' => $bb_current_user->data->user_email,97 'comment_author_url' => $bb_current_user->data->user_url,95 'comment_author' => bb_get_current_user_info( 'name' ), 96 'comment_author_email' => bb_get_current_user_info( 'email' ), 97 'comment_author_url' => bb_get_current_user_info( 'url' ), 98 98 'comment_content' => $submit 99 99 ); trunk/bb-includes/registration-functions.php
r638 r670 42 42 bb_update_usermeta( $user->ID, 'newpwdkey', $resetkey ); 43 43 if ( $user ) : 44 mail( $user->user_email, bb_get_option('name') . ': ' . __('Password Reset'), sprintf( __("If you wanted to reset your password, you may do so by visiting the following address:44 mail( bb_get_user_email( $user->ID ), bb_get_option('name') . ': ' . __('Password Reset'), sprintf( __("If you wanted to reset your password, you may do so by visiting the following address: 45 45 46 46 %s … … 100 100 if ( $user ) : 101 101 $message = __("Your username is: %1\$s \nYour password is: %2\$s \nYou can now log in: %3\$s \n\nEnjoy!"); 102 mail( $user->user_email, bb_get_option('name') . ': ' . __('Password'),102 mail( bb_get_user_email( $user->ID ), bb_get_option('name') . ': ' . __('Password'), 103 103 sprintf( $message, "$user->user_login", "$pass", bb_get_option('uri') ), 104 104 'From: ' . bb_get_option('admin_email') trunk/bb-includes/template-functions.php
r669 r670 101 101 102 102 function login_form() { 103 global $bb_current_user; 104 if ( bb_is_user_logged_in() ) { 105 printf('<p class="login">'. __('Welcome, %1$s!'). ' <a href="' . get_user_profile_link( $bb_current_user->ID ) . '">'. __('View your profile') ."»</a>\n<small>(",get_user_name( $bb_current_user->ID )); 106 if ( bb_current_user_can('moderate') ) 107 echo "<a href='" . bb_get_option( 'uri' ) . "bb-admin/'>Admin</a> | "; 108 echo "<a href='" . bb_get_option( 'uri' ) . "bb-login.php?logout'>". __('Log out') ."</a>)</small></p>"; 109 } else 103 if ( bb_is_user_logged_in() ) 104 bb_load_template( 'logged-in.php' ); 105 else 110 106 bb_load_template( 'login-form.php' ); 111 107 } … … 1242 1238 <p><strong>Note</strong>: Blocking a user does <em>not</em> block any IP addresses.'); ?></p> 1243 1239 <?php 1240 } 1241 1242 function bb_logout_link( $args = '' ) { 1243 echo apply_filters( 'bb_logout_link', bb_get_logout_link( $args ), $args ); 1244 } 1245 1246 function bb_get_logout_link( $args = '' ) { 1247 if ( $args && is_string($args) && false === strpos($args, '=') ) 1248 $args = array( 'text' => $args ); 1249 1250 $defaults = array('text' => __('Log out'), 'before' => '', 'after' => ''); 1251 $args = bb_parse_args( $args, $defaults ); 1252 extract($args); 1253 1254 return apply_filters( 'bb_get_logout_link', "$before<a href='" . bb_get_option( 'uri' ) . "bb-login.php?logout'>$text</a>$after", $args ); 1255 } 1256 1257 function bb_admin_link( $args = '' ) { 1258 echo apply_filters( 'bb_admin_link', bb_get_admin_link( $args ), $args ); 1259 } 1260 1261 function bb_get_admin_link( $args = '' ) { 1262 if ( $args && is_string($args) && false === strpos($args, '=') ) 1263 $args = array( 'text' => $args ); 1264 1265 $defaults = array('text' => __('Admin'), 'before' => '', 'after' => ''); 1266 $args = bb_parse_args( $args, $defaults ); 1267 extract($args); 1268 1269 return apply_filters( 'bb_get_admin_link', "$before<a href='" . bb_get_option( 'uri' ) . "bb-admin/'>$text</a>$after", $args ); 1270 } 1271 1272 function bb_profile_link( $args = '' ) { 1273 global $bb_current_user; 1274 1275 $defaults = array( 'text' => __('View your profile'), 'before' => '', 'after' => '' ); 1276 $args = bb_parse_args( $args, $defaults ); 1277 echo apply_filters( 'bb_profile_link', "$before<a href='" . get_user_profile_link( $bb_current_user->ID ) . "'>$text</a>$after", $args ); 1278 } 1279 1280 function bb_current_user_info( $key = '' ) { 1281 if ( !$key ) 1282 return; 1283 1284 echo apply_filters( 'bb_current_user_info', bb_get_current_user_info( $key ), $key ); 1285 } 1286 1287 1288 function bb_get_current_user_info( $key = '' ) { 1289 if ( !is_string($key) ) 1290 return; 1291 $user = bb_get_current_user(); // Not globalized 1292 1293 switch ( $key ) : 1294 case '' : 1295 return $user; 1296 break; 1297 case 'id' : 1298 case 'ID' : 1299 return $user->ID; 1300 break; 1301 case 'name' : 1302 case 'login' : 1303 case 'user_login' : 1304 return get_user_name( $user->ID ); 1305 break; 1306 case 'email' : 1307 case 'user_email' : 1308 return bb_get_user_email( $user->ID ); 1309 break; 1310 case 'url' : 1311 case 'uri' : 1312 case 'user_url' : 1313 return get_user_link( $user->ID ); 1314 break; 1315 endswitch; 1316 } 1317 1318 function bb_get_user_email( $id ) { 1319 if ( !$user = bb_get_user( $id ) ) 1320 return false; 1321 1322 return apply_filters( 'bb_get_user_email', $user->user_email, $id ); 1244 1323 } 1245 1324