Changeset 343
- Timestamp:
- 06/15/06 00:51:43 (3 years ago)
- Files:
-
- trunk/bb-includes/formatting-functions.php (modified) (1 diff)
- trunk/bb-includes/functions.php (modified) (4 diffs)
- trunk/bb-includes/registration-functions.php (modified) (4 diffs)
- trunk/bb-includes/template-functions.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bb-includes/formatting-functions.php
r336 r343 289 289 if ( '0' === $topic->topic_open ) { 290 290 if ( is_bb_feed() ) 291 return "[closed] $title";291 return sprintf(__('[closed] %s'), $title); 292 292 else 293 return "[closed] <span class='closed'>$title</span>";293 return sprintf(__('[closed]'). "<span class='closed'>%s</span>", $title); 294 294 } 295 295 return $title; trunk/bb-includes/functions.php
r341 r343 297 297 // array of time period chunks 298 298 $chunks = array( 299 array(60 * 60 * 24 * 365 , 'year'),300 array(60 * 60 * 24 * 30 , 'month'),301 array(60 * 60 * 24 * 7, 'week'),302 array(60 * 60 * 24 , 'day'),303 array(60 * 60 , 'hour'),304 array(60 , 'minute'),299 array(60 * 60 * 24 * 365 , __('year')), 300 array(60 * 60 * 24 * 30 , __('month')), 301 array(60 * 60 * 24 * 7, __('week')), 302 array(60 * 60 * 24 , __('day')), 303 array(60 * 60 , __('hour')), 304 array(60 , __('minute')), 305 305 ); 306 306 307 307 $today = time(); 308 308 $since = $today - bb_offset_time($original); … … 456 456 global $bbdb, $bb_table_prefix, $bb_current_user; 457 457 bb_update_usermeta( $bb_current_user->ID, $bb_table_prefix . 'been_blocked', 1 ); // Just for logging. 458 die( "You've been blocked. If you think a mistake has been made, contact this site's administrator.");458 die(__("You've been blocked. If you think a mistake has been made, contact this site's administrator.")); 459 459 } 460 460 … … 467 467 global $bb_cache, $bb_user_cache; 468 468 if ( !is_numeric( $user_id ) ) 469 die( 'bb_get_user needs a numeric ID');469 die(__('bb_get_user needs a numeric ID')); 470 470 $user_id = (int) $user_id; 471 471 if ( isset( $bb_user_cache[$user_id] ) && $cache ) … … 1338 1338 1339 1339 if ( isset($bb->debug) && 1 === $bb->debug ) : 1340 echo "<table>\n<tr><td> REQUEST_URI:</td><td>";1340 echo "<table>\n<tr><td>". __('REQUEST_URI') .":</td><td>"; 1341 1341 var_dump($uri); 1342 echo "</td></tr>\n<tr><td> should be:</td><td>";1342 echo "</td></tr>\n<tr><td>". __('should be') .":</td><td>"; 1343 1343 var_dump($check); 1344 echo "</td></tr>\n<tr><td> full permalink:</td><td>";1344 echo "</td></tr>\n<tr><td>". __('full permalink') .":</td><td>"; 1345 1345 var_dump($permalink); 1346 echo "</td></tr>\n<tr><td> PATH_INFO:</td><td>";1346 echo "</td></tr>\n<tr><td>". __('PATH_INFO') ."</td>:<td>"; 1347 1347 var_dump($_SERVER['PATH_INFO']); 1348 1348 echo "</td></tr>\n</table>"; trunk/bb-includes/registration-functions.php
r328 r343 63 63 bb_update_usermeta( $user->ID, 'newpwdkey', $resetkey ); 64 64 if ( $user ) : 65 mail( $user->user_email, bb_get_option('name') . ': Password Reset',"If you wanted to reset your password, you may do so by visiting the following address:65 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: 66 66 67 " . bb_get_option('uri') . "bb-reset-password.php?key=$resetkey 67 %s 68 68 69 If you don't want to reset your password, just ignore this email. Thanks!" , 'From: ' . bb_get_option('admin_email') );69 If you don't want to reset your password, just ignore this email. Thanks!"), bb_get_option('uri')."bb-reset-password.php?key=".$resetkey ), 'From: ' . bb_get_option('admin_email') ); 70 70 71 71 endif; … … 76 76 $key = user_sanitize( $key ); 77 77 if ( empty( $key ) ) 78 die( 'Key not found.');78 die(__('Key not found.')); 79 79 $user_id = $bbdb->get_var("SELECT user_id FROM $bbdb->usermeta WHERE meta_key = 'newpwdkey' AND meta_value = '$key'"); 80 80 if ( $user = bb_get_user( $user_id ) ) : … … 84 84 bb_update_usermeta( $user->ID, 'newpwdkey', '' ); 85 85 else : 86 die( 'Key not found.');86 die(__('Key not found.')); 87 87 endif; 88 88 } … … 115 115 116 116 if ( $user ) : 117 mail( $user->user_email, bb_get_option('name') . ': Password', "118 Your username is: $user->user_login 119 Your password is: $pass120 You can now login: " . bb_get_option('uri') . "117 mail( $user->user_email, bb_get_option('name') . ':' __('Password'), sprintf( 118 __("Your username is: %1$s 119 Your password is: %2$s 120 You can now login: %3$s 121 121 122 Enjoy!" , 'From: ' . bb_get_option('admin_email') );122 Enjoy!"), $user->user_login, $pass, bb_get_option('uri') ), 'From: ' . bb_get_option('admin_email') ); 123 123 124 124 endif; trunk/bb-includes/template-functions.php
r334 r343 49 49 global $bb_current_user, $bb; 50 50 if ($bb_current_user) { 51 echo '<p class="login">Welcome, ' . get_user_name( $bb_current_user->ID ) . "! <a href='" . get_user_profile_link( $bb_current_user->ID ) . "'>View your profile »</a>\n<small>(";51 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 )); 52 52 if ( bb_current_user_can('moderate') ) 53 53 echo "<a href='" . bb_get_option('uri') . "bb-admin/'>Admin</a> | "; 54 echo "<a href='" . bb_get_option('uri') . "bb-login.php?logout'> Logout</a>)</small></p>";54 echo "<a href='" . bb_get_option('uri') . "bb-login.php?logout'>". __('Logout') ."</a>)</small></p>"; 55 55 } else { 56 56 include( BBPATH . '/bb-templates/login-form.php'); … … 405 405 406 406 $resolved_form .= "</select>\n"; 407 $resolved_form .= '<input type="submit" name="submit" id="resolvedformsub" value=" Change" />' . "\n</div></form>";407 $resolved_form .= '<input type="submit" name="submit" id="resolvedformsub" value="'. __('Change') .'" />' . "\n</div></form>"; 408 408 echo $resolved_form; 409 409 else: … … 462 462 $args, 463 463 str_replace("/page/$page", ( 2 == $page ? '' : '/page/' . ($page - 1) ), $uri) 464 ) ) . '">« Previous Page</a>' . "\n";464 ) ) . '">« '. __('Previous Page') .'</a>' . "\n"; 465 465 } 466 466 if ( ( $total_pages = ceil( $total / bb_get_option('page_topics') ) ) > 1 ) { … … 491 491 $args, 492 492 str_replace("/page/$page", '/page/' . ($page + 1), $uri) 493 ) ) . '"> Next Page»</a>' . "\n";493 ) ) . '">'. __('Next Page') .' »</a>' . "\n"; 494 494 } 495 495 return $r; … … 502 502 503 503 if ( 0 == $topic->topic_status ) 504 echo "<a href='" . bb_get_option('uri') . 'bb-admin/delete-topic.php?id=' . get_topic_id() . "' onclick=\"return confirm(' Are you sure you wanna delete that?')\">Delete entire topic</a>";505 else 506 echo "<a href='" . bb_get_option('uri') . 'bb-admin/delete-topic.php?id=' . get_topic_id() . "&view=all' onclick=\"return confirm(' Are you sure you wanna undelete that?')\">Undelete entire topic</a>";504 echo "<a href='" . bb_get_option('uri') . 'bb-admin/delete-topic.php?id=' . get_topic_id() . "' onclick=\"return confirm('". __('Are you sure you wanna delete that?') ."')\">Delete entire topic</a>"; 505 else 506 echo "<a href='" . bb_get_option('uri') . 'bb-admin/delete-topic.php?id=' . get_topic_id() . "&view=all' onclick=\"return confirm('". __('Are you sure you wanna undelete that?') ."')\">Undelete entire topic</a>"; 507 507 } 508 508 … … 513 513 514 514 if ( topic_is_open( get_topic_id() ) ) 515 $text = 'Close topic';516 else 517 $text = 'Open topic';515 $text = __('Close topic'); 516 else 517 $text = __('Open topic'); 518 518 echo "<a href='" . bb_get_option('uri') . 'bb-admin/topic-toggle.php?id=' . get_topic_id() . "'>$text</a>"; 519 519 } … … 525 525 526 526 if ( topic_is_sticky( get_topic_id() ) ) 527 echo "<a href='" . bb_get_option('uri') . 'bb-admin/sticky.php?id=' . get_topic_id() . "'> Unstick topic</a>";528 else 529 echo "<a href='" . bb_get_option('uri') . 'bb-admin/sticky.php?id=' . get_topic_id() . "'> Stick topic</a> (<a href='" . bb_get_option('uri') . 'bb-admin/sticky.php?id=' . get_topic_id() . "&super=1'>to front</a>)";527 echo "<a href='" . bb_get_option('uri') . 'bb-admin/sticky.php?id=' . get_topic_id() . "'>". __('Unstick topic') ."</a>"; 528 else 529 echo "<a href='" . bb_get_option('uri') . 'bb-admin/sticky.php?id=' . get_topic_id() . "'>". __('Stick topic') ."</a> (<a href='" . bb_get_option('uri') . 'bb-admin/sticky.php?id=' . get_topic_id() . "&super=1'>". __('to front') ."</a>)"; 530 530 } 531 531 … … 535 535 return; 536 536 if ( 'all' == @$_GET['view'] ) 537 echo "<a href='" . get_topic_link() . "'> View normal posts</a>";538 else 539 echo "<a href='" . bb_specialchars( bb_add_query_arg( 'view', 'all', get_topic_link() ) ) . "'> View all posts</a>";537 echo "<a href='" . get_topic_link() . "'>". __('View normal posts') ."</a>"; 538 else 539 echo "<a href='" . bb_specialchars( bb_add_query_arg( 'view', 'all', get_topic_link() ) ) . "'>". __('View all posts') ."</a>"; 540 540 } 541 541 … … 548 548 echo '<form id="topic-move" method="post" action="' . bb_get_option('uri') . 'bb-admin/topic-move.php"><div>' . "\n\t"; 549 549 echo '<input type="hidden" name="topic_id" value="' . get_topic_id() . '" />' . "\n\t"; 550 echo '<label for="forum_id"> Move this topic to the selected forum: ';550 echo '<label for="forum_id">'. __('Move this topic to the selected forum:'); 551 551 forum_dropdown(); 552 552 echo "</label>\n\t"; 553 echo "<input type='submit' name='Submit' value=' Move' />\n</div></form>";553 echo "<input type='submit' name='Submit' value='". __('Move') ."' />\n</div></form>"; 554 554 } 555 555 … … 584 584 return $user->user_login; 585 585 else 586 return 'Anonymous';586 return __('Anonymous'); 587 587 } 588 588 … … 643 643 644 644 if ( bb_current_user_can( 'edit_post', $bb_post->post_id ) ) 645 echo "<a href='" . bb_apply_filters( 'post_edit_uri', bb_get_option('uri') . 'edit.php?id=' . get_post_id() ) . "'> Edit</a>";645 echo "<a href='" . bb_apply_filters( 'post_edit_uri', bb_get_option('uri') . 'edit.php?id=' . get_post_id() ) . "'>". __('Edit') ."</a>"; 646 646 } 647 647 … … 661 661 662 662 if ( 0 == $bb_post->post_status ) 663 $r = "<a href='" . bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . get_post_id() . "&status=1' onclick='return ajaxPostDelete(" . get_post_id() . ", \"" . get_post_author() . "\");'> Delete</a>";664 else 665 $r = "<a href='" . bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . get_post_id() . "&status=0&view=all' onclick='return confirm(\" Are you sure you wanna undelete that?\");'>Undelete</a>";663 $r = "<a href='" . bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . get_post_id() . "&status=1' onclick='return ajaxPostDelete(" . get_post_id() . ", \"" . get_post_author() . "\");'>". __('Delete') ."</a>"; 664 else 665 $r = "<a href='" . bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . get_post_id() . "&status=0&view=all' onclick='return confirm(\" ". __('Are you sure you wanna undelete that?') ." \");'>". __('Undelete') ."</a>"; 666 666 $r = bb_apply_filters( 'post_delete_link', array($r, $bb_post->post_status) ); 667 667 echo $r[0]; … … 861 861 return false; 862 862 $form = "<ul id='manage-tags'>\n "; 863 $form .= "<li id='tag-rename'> Rename tag:\n\t";863 $form .= "<li id='tag-rename'>". __('Rename tag:') ."\n\t"; 864 864 $form .= "<form method='post' action='" . bb_get_option('uri') . "bb-admin/tag-rename.php'><div>\n\t"; 865 865 $form .= "<input type='text' name='tag' size='10' maxlength='30' />\n\t"; 866 866 $form .= "<input type='hidden' name='id' value='$tag->tag_id' />\n\t"; 867 $form .= "<input type='submit' name='Submit' value=' Rename' />\n\t</div></form>\n </li>\n ";868 $form .= "<li id='tag-merge'> Merge this tag into:\n\t";867 $form .= "<input type='submit' name='Submit' value='". __('Rename') ."' />\n\t</div></form>\n </li>\n "; 868 $form .= "<li id='tag-merge'>". __('Merge this tag into:') ."\n\t"; 869 869 $form .= "<form method='post' action='" . bb_get_option('uri') . "bb-admin/tag-merge.php'><div>\n\t"; 870 870 $form .= "<input type='text' name='tag' size='10' maxlength='30' />\n\t"; 871 871 $form .= "<input type='hidden' name='id' value='$tag->tag_id' />\n\t"; 872 $form .= "<input type='submit' name='Submit' value=' Merge'";873 $form .= "onclick='return confirm(\"Are you sure you want to merge the '" . bb_specialchars( $tag->raw_tag ) . "' tag into the tag you specified? This is permanent and cannot be undone.\")' />\n\t</div></form>\n </li>\n ";874 $form .= "<li id='tag-destroy'> Destroy tag:\n\t";872 $form .= "<input type='submit' name='Submit' value='". __('Merge') ."'"; 873 $form .= "onclick='return confirm(\" ". sprintf(__('Are you sure you want to merge the '%s' tag into the tag you specified? This is permanent and cannot be undone.'), bb_specialchars( $tag->raw_tag )) ."\")' />\n\t</div></form>\n </li>\n "; 874 $form .= "<li id='tag-destroy'>". __('Destroy tag:') ."\n\t"; 875 875 $form .= "<form method='post' action='" . bb_get_option('uri') . "bb-admin/tag-destroy.php'><div>\n\t"; 876 876 $form .= "<input type='hidden' name='id' value='$tag->tag_id' />\n\t"; 877 $form .= "<input type='submit' name='Submit' value=' Destroy'";878 $form .= "onclick='return confirm(\" Are you sure you want to destroy the '" . bb_specialchars( $tag->raw_tag ) . "' tag? This is permanent and cannot be undone.\")' />\n\t</div></form>\n </li>\n</ul>";877 $form .= "<input type='submit' name='Submit' value='". __('Destroy') ."'"; 878 $form .= "onclick='return confirm(\" ". sprintf(__('Are you sure you want to destroy the '%s' tag? This is permanent and cannot be undone.'), bb_specialchars( $tag->raw_tag )) ."\")' />\n\t</div></form>\n </li>\n</ul>"; 879 879 echo $form; 880 880 } … … 885 885 return false; 886 886 887 echo '[<a href="' . bb_get_option('uri') . 'tag-remove.php?tag=' . $tag->tag_id . '&user=' . $tag->user_id . '&topic=' . $tag->topic_id . '" onclick="return ajaxDelTag(' . $tag->tag_id . ', ' . $tag->user_id . ', \'' . addslashes(htmlspecialchars($tag->raw_tag)) . '\');" title=" Remove this tag">x</a>]';887 echo '[<a href="' . bb_get_option('uri') . 'tag-remove.php?tag=' . $tag->tag_id . '&user=' . $tag->user_id . '&topic=' . $tag->topic_id . '" onclick="return ajaxDelTag(' . $tag->tag_id . ', ' . $tag->user_id . ', \'' . addslashes(htmlspecialchars($tag->raw_tag)) . '\');" title="'. __('Remove this tag') .'">x</a>]'; 888 888 } 889 889