Skip to:
Content

bbPress.org

Changeset 1385


Ignore:
Timestamp:
03/30/2008 10:31:06 AM (18 years ago)
Author:
sambauers
Message:

Various optimisations and typo fixes - Fixes #842 - props momo360modena

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-admin/admin-functions.php

    r1358 r1385  
    120120function bb_admin_add_submenu($display_name, $capability, $file_name, $parent = 'plugins.php')
    121121{
    122     global $bb_menu, $bb_submenu;
     122    global $bb_submenu;
    123123    if ($display_name && $capability && $file_name) {
    124124        $bb_submenu[$parent][] = array($display_name, $capability, $file_name);
     
    621621function bb_forum_form( $forum_id = 0 ) {
    622622    $forum_id = (int) $forum_id;
    623     if ( $forum_id && !$forum = get_forum( $forum_id ) )
     623    if ( $forum_id && !get_forum( $forum_id ) )
    624624        return;
    625625    $action = $forum_id ? 'update' : 'add';
  • trunk/bb-admin/class-install.php

    r1370 r1385  
    994994       
    995995        // Loop through the sample config and write lines to the new config file
    996         foreach ($sample_config as $line_num => $line) {
     996        foreach ($sample_config as $line) {
    997997            switch (substr($line,0,18)) {
    998998                case "define('BBDB_NAME'":
     
    13261326            $this->strings[3]['form_errors']['keymaster_user_login'][] = 'userlogin';
    13271327        }
    1328         $data['keymaster_user_login']['value'] == sanitize_user($data['keymaster_user_login']['value']);
     1328        $data['keymaster_user_login']['value'] = sanitize_user($data['keymaster_user_login']['value']);
    13291329       
    13301330        // bb_verify_email() needs this
     
    15241524                   
    15251525                    // Loop through the sample config and write lines to the new config file
    1526                     foreach ($config as $line_num => $line) {
     1526                    foreach ($config as $line) {
    15271527                        if (substr($line,0,18) == "define('BB_SECRET_") {
    15281528                            $config_lines[] = str_replace("'" . BB_SECRET_KEY . "'", "'" . $data2['wp_secret_key']['value'] . "'", $line);
  • trunk/bb-admin/content-forums.php

    r1299 r1385  
    3939<div class="ays narrow">
    4040    <p><big><?php printf(__('Are you sure you want to delete the "<strong>%s</strong>" forum?'), $deleted_forum->forum_name); ?></big></p>
    41     <p>This forum contains</p>
     41    <p><?php _e('This forum contains'); ?></p>
    4242    <ul>
    4343        <li><?php printf(__ngettext('%d topic', '%d topics', $deleted_forum->topics), $deleted_forum->topics); ?></li>
  • trunk/bb-admin/export.php

    r1192 r1385  
    222222function bb_export_topic_tags( $r, $topic_id ) {
    223223    global $topic_tag_cache;
    224     if ( !$topic = get_topic( $topic_id ) )
     224    if ( !get_topic( $topic_id ) )
    225225        return;
    226226
     
    239239function bb_export_topic_posts( $r, $topic_id ) {
    240240    global $bb_post_cache;
    241     if ( !$topic = get_topic( $topic_id ) )
     241    if ( !get_topic( $topic_id ) )
    242242        return;
    243243
     
    272272            $bb_user_cache = array(); // For the sake of memory
    273273        }
    274         unset($users, $user_ids, $user_id, $page);
     274        unset($users, $user, $page);
    275275    }
    276276
  • trunk/bb-admin/upgrade-functions.php

    r1235 r1385  
    429429
    430430    $bbdb->hide_errors();
    431     if ( !$ids = $bbdb->get_var("SELECT forum_slug FROM $bbdb->forums ORDER BY forum_order ASC LIMIT 1" ) )
     431    if ( !$bbdb->get_var("SELECT forum_slug FROM $bbdb->forums ORDER BY forum_order ASC LIMIT 1" ) )
    432432        return; // Wait till after dbDelta
    433433    $bbdb->show_errors();
  • trunk/bb-includes/class-bb-taxonomy.php

    r1076 r1385  
    170170            $select_this = 't.*, tt.*, tr.object_id';
    171171
    172         $query = "SELECT $select_this FROM {$this->db->terms} AS t INNER JOIN {$this->db->term_taxonomy} AS tt ON tt.term_id = t.term_id INNER JOIN {$this->db->term_relationships} AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tr.object_id IN ($object_ids)$usr_sql ORDER BY $orderby $order";
     172        $query = "SELECT $select_this FROM {$this->db->terms} AS t INNER JOIN {$this->db->term_taxonomy} AS tt ON tt.term_id = t.term_id INNER JOIN {$this->db->term_relationships} AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tr.object_id IN ($object_ids)$user_sql ORDER BY $orderby $order";
    173173
    174174        if ( 'all' == $fields || 'all_with_object_id' == $fields ) {
  • trunk/bb-includes/functions.php

    r1381 r1385  
    5353            $branch[$leaf->forum_id] = true;
    5454        $_leaves = false;
    55         return $tree = empty($branch) ? false : $branch;
     55        return ( empty($branch) ? false : $branch );
    5656    }
    5757
  • trunk/bb-includes/l10n.php

    r1220 r1385  
    6767
    6868function load_default_textdomain() {
    69     global $l10n;
    70 
    7169    $locale = get_locale();
    7270    $mofile = BB_LANG_DIR . "$locale.mo";
  • trunk/bb-includes/locale.php

    r1220 r1385  
    113113    function _load_locale_data() {
    114114        $locale = get_locale();
    115         $locale_file = BB_PATH . "bb-includes/languages/$locale.php";
    116         if ( !file_exists($locale_file) )
     115        $locale_file = BB_LANG_DIR . $locale . '.php';
     116        if ( !is_file($locale_file) )
    117117            return;
    118118
  • trunk/bb-includes/pluggable.php

    r1382 r1385  
    7676if ( !function_exists('bb_login') ) :
    7777function bb_login( $login, $password, $remember = false ) {
    78     global $wp_auth_object;
    7978    if ( $user = bb_check_login( $login, $password ) ) {
    8079        wp_set_auth_cookie( $user->ID, $remember );
  • trunk/bb-includes/registration-functions.php

    r1364 r1385  
    1919        '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
    2020        '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {
    21         if ( $check_domain && function_exists('checkdnsrr') ) {
     21        if ( function_exists('checkdnsrr') ) {
    2222            list (, $domain)  = explode('@', $email);
    2323            if ( checkdnsrr($domain . '.', 'MX') || checkdnsrr($domain . '.', 'A') ) {
     
    163163 */
    164164function bb_send_pass( $user, $pass ) {
    165     global $bbdb;
    166165    if ( !$user = bb_get_user( $user ) )
    167166        return false;
  • trunk/bb-includes/template-functions.php

    r1376 r1385  
    129129
    130130function post_form( $h2 = '' ) {
    131     global $bb, $page, $topic, $forum;
     131    global $page, $topic, $forum;
    132132    $add = topic_pages_add();
    133133    if ( empty($h2) && false !== $h2 ) {
     
    170170
    171171function edit_form() {
    172     global $bb_post, $topic_title;
     172    global $bb_post;
    173173    echo "<form class='postform edit-form' method='post' action='" . bb_get_option('uri')  . "bb-edit.php'>\n";
    174174    echo "<fieldset>\n";
     
    685685        return false;
    686686
    687     if ( $r = $bb_forums_loop->step() ) {
     687    if ( $bb_forums_loop->step() ) {
    688688        $GLOBALS['forum'] =& $bb_forums_loop->elements[key($bb_forums_loop->elements)]; // Globalize the current forum object
    689689    } else {
     
    796796
    797797function topic_posts( $id = 0 ) {
    798     echo apply_filters( 'topic_posts', get_topic_posts( $id = 0 ), get_topic_id( $id ) );
     798    echo apply_filters( 'topic_posts', get_topic_posts( $id ), get_topic_id( $id ) );
    799799}
    800800
     
    893893
    894894function get_page_number_links($page, $total) {
    895     $r = '';
    896895    $args = array();
    897896    $uri = $_SERVER['REQUEST_URI'];
     
    19591958    extract($args, EXTR_SKIP);
    19601959
    1961     if ( !$forums = bb_forums( $args ) )
     1960    if ( !bb_forums( $args ) )
    19621961        return;
    19631962
  • trunk/bb-plugins/akismet.php

    r1346 r1385  
    8080
    8181function bb_akismet_verify_key( $key ) {
    82     global $bb_ksd_pre_post_status, $bb_ksd_api_host, $bb_ksd_api_port;
     82    global $bb_ksd_api_port;
    8383    $blog = urlencode( bb_get_option('uri') );
    8484    $response = bb_ksd_http_post("key=$key&blog=$blog", 'rest.akismet.com', '/1.1/verify-key', $bb_ksd_api_port);
     
    269269
    270270function bb_ksd_admin_page() {
    271     global $bb_current_submenu, $bb_posts, $page;
     271    global $bb_posts, $page;
    272272    if ( !bb_akismet_verify_key( bb_get_option( 'akismet_key' ) ) ) : ?>
    273273<div class="error"><p><?php printf(__('The API key you have specified is invalid.  Please double check the <strong>Akismet Key</strong> set in <a href="%s">Akismet configuration</a>.  If you don\'t have an API key yet, you can get one at <a href="%s">WordPress.com</a>.'), 'admin-base.php?plugin=bb_ksd_configuration_page', 'http://wordpress.com/api-keys/'); ?></p></div>
  • trunk/bb-plugins/bozo.php

    r1174 r1385  
    3737    if ( 1 < $page )
    3838        $limit = ($limit * ($page - 1)) . ", $limit";
    39     $bozo_mkey = $bbdb->prefix . 'bozo_topics';
    4039    $bb_last_countable_query = "SELECT user_id FROM $bbdb->usermeta WHERE meta_key='is_bozo' AND meta_value='1' ORDER BY umeta_id DESC LIMIT $limit";
    4140    if ( $ids = (array) $bbdb->get_col( $bb_last_countable_query ) )
     
    104103                endif;
    105104            endforeach;
    106             unset($topics, $t, $i, $counts, $posters, $bozos);
     105            unset($topics, $i, $counts, $posters, $bozos);
    107106        endif;
    108107        if ( $old ) :
     
    234233        else
    235234            $user->bozo_topics = array($topic_id => 1);
    236         bb_update_usermeta( $uid, $bbdb->prefix . 'bozo_topics', $user->bozo_topics );
     235        bb_update_usermeta( $user_id, $bbdb->prefix . 'bozo_topics', $user->bozo_topics );
    237236    }
    238237}
     
    255254        if ( --$user->bozo_topics[$topic_id] < 1 )
    256255            unset($user->bozo_topics[$topic_id]);
    257         bb_update_usermeta( $uid, $bbdb->prefix . 'bozo_topics', $user->bozo_topics );
     256        bb_update_usermeta( $user_id, $bbdb->prefix . 'bozo_topics', $user->bozo_topics );
    258257    }
    259258}
    260259
    261260function bb_bozo_profile_admin_keys( $a ) {
    262     global $user;
    263261    $a['is_bozo'] = array(
    264262        0,                          // Required
Note: See TracChangeset for help on using the changeset viewer.