Skip to:
Content

bbPress.org

Changeset 1386


Ignore:
Timestamp:
03/30/2008 10:36:13 AM (19 years ago)
Author:
sambauers
Message:

Various optimisations and typo fixes - Fixes #842 - props momo360modena - branches/0.8

Location:
branches/0.8
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/0.8/bb-admin/admin-functions.php

    r1342 r1386  
    8484function bb_admin_add_submenu($display_name, $capability, $file_name, $parent = 'plugins.php')
    8585{
    86         global $bb_menu, $bb_submenu;
     86        global $bb_submenu;
    8787        if ($display_name && $capability && $file_name) {
    8888                $bb_submenu[$parent][] = array($display_name, $capability, $file_name);
    … …  
    557557function bb_forum_form( $forum_id = 0 ) {
    558558        $forum_id = (int) $forum_id;
    559         if ( $forum_id && !$forum = get_forum( $forum_id ) )
     559        if ( $forum_id && !get_forum( $forum_id ) )
    560560                return;
    561561        $action = $forum_id ? 'update' : 'add';
  • branches/0.8/bb-admin/class-install.php

    r1372 r1386  
    990990               
    991991                // Loop through the sample config and write lines to the new config file
    992                 foreach ($sample_config as $line_num => $line) {
     992                foreach ($sample_config as $line) {
    993993                        switch (substr($line,0,18)) {
    994994                                case "define('BBDB_NAME'":
    … …  
    13221322                        $this->strings[3]['form_errors']['keymaster_user_login'][] = 'userlogin';
    13231323                }
    1324                 $data['keymaster_user_login']['value'] == sanitize_user($data['keymaster_user_login']['value']);
     1324                $data['keymaster_user_login']['value'] = sanitize_user($data['keymaster_user_login']['value']);
    13251325               
    13261326                // bb_verify_email() needs this
    … …  
    15201520                                       
    15211521                                        // Loop through the sample config and write lines to the new config file
    1522                                         foreach ($config as $line_num => $line) {
     1522                                        foreach ($config as $line) {
    15231523                                                if (substr($line,0,18) == "define('BB_SECRET_") {
    15241524                                                        $config_lines[] = str_replace("'" . BB_SECRET_KEY . "'", "'" . $data2['wp_secret_key']['value'] . "'", $line);
  • branches/0.8/bb-admin/content-forums.php

    r1286 r1386  
    3737<div class="ays narrow">
    3838        <p><big><?php printf(__('Are you sure you want to delete the "<strong>%s</strong>" forum?'), $deleted_forum->forum_name); ?></big></p>
    39         <p>This forum contains</p>
     39        <p><?php _e('This forum contains'); ?></p>
    4040        <ul>
    4141                <li><?php printf(__ngettext('%d topic', '%d topics', $deleted_forum->topics), $deleted_forum->topics); ?></li>
  • branches/0.8/bb-admin/export.php

    r1173 r1386  
    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
  • branches/0.8/bb-admin/upgrade-functions.php

    r1236 r1386  
    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();
  • branches/0.8/bb-includes/functions.php

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

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

    r1221 r1386  
    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
  • branches/0.8/bb-includes/registration-functions.php

    r1359 r1386  
    55                '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
    66                '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {
    7                 if ( $check_domain && function_exists('checkdnsrr') ) {
     7                if ( function_exists('checkdnsrr') ) {
    88                        list (, $domain)  = explode('@', $email);
    99                        if ( checkdnsrr($domain . '.', 'MX') || checkdnsrr($domain . '.', 'A') ) {
    … …  
    8686
    8787function bb_send_pass( $user, $pass ) {
    88         global $bbdb;
    8988        if ( !$user = bb_get_user( $user ) )
    9089                return false;
  • branches/0.8/bb-includes/template-functions.php

    r1377 r1386  
    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
  • branches/0.8/bb-plugins/akismet.php

    r1346 r1386  
    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>
  • branches/0.8/bb-plugins/bozo.php

    r1175 r1386  
    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.