Changeset 1671
- Timestamp:
- 08/27/08 22:32:37 (3 months ago)
- Files:
-
- trunk/bb-admin/admin-functions.php (modified) (5 diffs)
- trunk/bb-admin/content-posts.php (modified) (1 diff)
- trunk/bb-admin/options-general.php (modified) (7 diffs)
- trunk/bb-admin/options-wordpress.php (modified) (5 diffs)
- trunk/bb-admin/themes.php (modified) (1 diff)
- trunk/bb-admin/users-blocked.php (modified) (1 diff)
- trunk/bb-admin/users-moderators.php (modified) (1 diff)
- trunk/bb-admin/users.php (modified) (1 diff)
- trunk/bb-includes/class-bb-taxonomy.php (modified) (1 diff)
- trunk/bb-includes/classes.php (modified) (8 diffs)
- trunk/bb-includes/default-filters.php (modified) (1 diff)
- trunk/bb-includes/functions.php (modified) (8 diffs)
- trunk/bb-includes/template-functions.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bb-admin/admin-functions.php
r1664 r1671 176 176 global $bb_current_menu, $bb_current_submenu; 177 177 $title = bb_get_option('name') . ' › ' . $bb_current_menu[0] . ( $bb_current_submenu ? ' » ' . $bb_current_submenu[0] : '' ) . ' — bbPress'; 178 echo $title;178 echo wp_specialchars( $title ); 179 179 } 180 180 … … 391 391 392 392 function results_are_paged() { 393 if ( $this->paging_text )393 if ( isset($this->paging_text) && $this->paging_text ) 394 394 return true; 395 395 return false; … … 1015 1015 1016 1016 $plugin_name = wp_specialchars( trim($plugin_name[1]) ); 1017 $plugin_uri = clean_url( trim($plugin_uri[1]) ); 1018 $author_name = wp_specialchars( trim($author_name[1]) ); 1019 $author_uri = clean_url( trim($author_uri[1]) ); 1020 1021 $description = trim($description[1]); 1022 $description = bb_encode_bad( $description ); 1023 $description = bb_code_trick( $description ); 1024 $description = force_balance_tags( $description ); 1025 $description = bb_filter_kses( $description ); 1026 $description = bb_autop( $description ); 1017 1018 if ( $plugin_uri ) 1019 $plugin_uri = clean_url( trim($plugin_uri[1]) ); 1020 else 1021 $plugin_uri = ''; 1022 1023 if ( $author_name ) 1024 $author_name = wp_specialchars( trim($author_name[1]) ); 1025 else 1026 $author_name = ''; 1027 1028 if ( $author_uri ) 1029 $author_uri = clean_url( trim($author_uri[1]) ); 1030 else 1031 $author_uri = ''; 1032 1033 if ( $description ) { 1034 $description = trim($description[1]); 1035 $description = bb_encode_bad( $description ); 1036 $description = bb_code_trick( $description ); 1037 $description = force_balance_tags( $description ); 1038 $description = bb_filter_kses( $description ); 1039 $description = bb_autop( $description ); 1040 } else { 1041 $description = ''; 1042 } 1027 1043 1028 1044 $plugin_file = str_replace( '\\', '/', $plugin_file ); … … 1111 1127 $theme = $name; 1112 1128 1113 if ( '' == $author_uri[1] ) { 1114 $author = wp_specialchars( trim($author_name[1]) ); 1129 if ( $author_name || $author_uri ) { 1130 if ( empty($author_uri[1]) ) { 1131 $author = wp_specialchars( trim($author_name[1]) ); 1132 } else { 1133 $author = '<a href="' . clean_url( trim($author_uri[1]) ) . '" title="' . attribute_escape( __('Visit author homepage') ) . '">' . wp_specialchars( trim($author_name[1]) ) . '</a>'; 1134 } 1115 1135 } else { 1116 $author = '<a href="' . clean_url( trim($author_uri[1]) ) . '" title="' . attribute_escape( __('Visit author homepage') ) . '">' . wp_specialchars( trim($author_name[1]) ) . '</a>'; 1117 } 1118 1119 if ( '' == $porter_uri[1] ) { 1120 $porter = wp_specialchars( trim($porter_name[1]) ); 1136 $author = ''; 1137 } 1138 1139 if ( $porter_name || $porter_uri ) { 1140 if ( empty($porter_uri[1]) ) { 1141 $porter = wp_specialchars( trim($porter_name[1]) ); 1142 } else { 1143 $porter = '<a href="' . clean_url( trim($porter_uri[1]) ) . '" title="' . attribute_escape( __('Visit porter homepage') ) . '">' . wp_specialchars( trim($porter_name[1]) ) . '</a>'; 1144 } 1121 1145 } else { 1122 $porter = ' <a href="' . clean_url( trim($porter_uri[1]) ) . '" title="' . attribute_escape( __('Visit porter homepage') ) . '">' . wp_specialchars( trim($porter_name[1]) ) . '</a>';1146 $porter = ''; 1123 1147 } 1124 1148 … … 1136 1160 } 1137 1161 1162 if ( !function_exists( 'checked' ) ) : 1163 function checked( $checked, $current) { 1164 if ( $checked == $current) 1165 echo ' checked="checked"'; 1166 } 1167 endif; 1168 1169 if ( !function_exists( 'selected' ) ) : 1170 function selected( $selected, $current) { 1171 if ( $selected == $current) 1172 echo ' selected="selected"'; 1173 } 1174 endif; 1175 1138 1176 ?> trunk/bb-admin/content-posts.php
r1333 r1671 31 31 $h2_noun = __('Posts'); 32 32 else 33 $h2_noun = sprintf( __( '%1$sposts'), $stati[$h2_status] , $topic_open[$h2_open]);33 $h2_noun = sprintf( __( '%1$sposts'), $stati[$h2_status] ); 34 34 35 35 printf( __( '%1$s%2$s%3$s%4$s%5$s' ), $h2_noun, $h2_search, $h2_forum, $h2_tag, $h2_author ); trunk/bb-admin/options-general.php
r1602 r1671 2 2 require_once('admin.php'); 3 3 4 if ( $_POST['action'] == 'update') {4 if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update') { 5 5 6 6 bb_check_admin_referer( 'options-general-update' ); … … 32 32 } 33 33 34 if ( $_GET['updated']) {34 if ( !empty($_GET['updated']) ) { 35 35 bb_admin_notice( __('Settings saved.') ); 36 36 } … … 85 85 <div> 86 86 <select name="mod_rewrite" id="mod_rewrite"> 87 <?php 88 $selected = array(); 89 $selected[bb_get_option('mod_rewrite')] = ' selected="selected"'; 90 ?> 91 <option value="0"<?php echo $selected[0]; ?>><?php _e('None'); ?> .../forums.php?id=1</option> 92 <option value="1"<?php echo $selected[1]; ?>><?php _e('Numeric'); ?> .../forums/1</option> 93 <option value="slugs"<?php echo $selected['slugs']; ?>><?php _e('Name based'); ?> .../forums/first-forum</option> 94 <?php 95 unset($selected); 96 ?> 87 <option value="0"<?php selected( bb_get_option('mod_rewrite'), 0 ); ?>><?php _e('None'); ?> .../forums.php?id=1</option> 88 <option value="1"<?php selected( bb_get_option('mod_rewrite'), 1 ); ?>><?php _e('Numeric'); ?> .../forums/1</option> 89 <option value="slugs"<?php selected( bb_get_option('mod_rewrite'), 'slugs' ); ?>><?php _e('Name based'); ?> .../forums/first-forum</option> 97 90 </select> 98 91 <p><?php printf(__('If you activate "Numeric" or "Name based" permalinks, you will need to create a file at <code>%s</code> containing the url rewriting rules <a href="%s">provided here</a>.'), BB_PATH . '.htaccess', bb_get_uri('bb-admin/rewrite-rules.php', null, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN)); ?></p> … … 170 163 </label> 171 164 <div> 172 <?php 173 $checked = array(); 174 $checked[bb_get_option('avatars_show')] = ' checked="checked"'; 175 ?> 176 <input type="checkbox" class="checkbox" name="avatars_show" id="avatars_show" value="1"<?php echo $checked[1]; ?> /> 177 <?php 178 unset($checked); 179 ?> 180 </div> 181 </div> 165 <input type="checkbox" class="checkbox" name="avatars_show" id="avatars_show" value="1"<?php checked( bb_get_option('avatars_show'), 1 ); ?> /> 166 </div> 167 </div> 168 <?php 169 $bb_get_option_avatars_show = create_function( '$a', 'return 1;' ); 170 add_filter( 'bb_get_option_avatars_show', $bb_get_option_avatars_show ); 171 ?> 182 172 <div> 183 173 <label for="avatars_default"> … … 186 176 <div> 187 177 <select name="avatars_default" id="avatars_default"> 188 <?php 189 $selected = array(); 190 $selected[bb_get_option('avatars_default')] = ' selected="selected"'; 191 ?> 192 <option value="default"<?php echo $selected['default']; ?>><?php _e('Default'); ?></option> 193 <option value="logo"<?php echo $selected['logo']; ?>><?php _e('Gravatar Logo'); ?></option> 194 <option value="monsterid"<?php echo $selected['monsterid']; ?>><?php _e('MonsterID'); ?></option> 195 <option value="wavatar"<?php echo $selected['wavatar']; ?>><?php _e('Wavatar'); ?></option> 196 <option value="identicon"<?php echo $selected['identicon']; ?>><?php _e('Identicon'); ?></option> 197 <?php 198 unset($selected); 199 ?> 178 <option value="default"<?php selected( bb_get_option('avatars_default'), 'default' ); ?>><?php _e('Default'); ?></option> 179 <option value="logo"<?php selected( bb_get_option('avatars_default'), 'logo' ); ?>><?php _e('Gravatar Logo'); ?></option> 180 <option value="monsterid"<?php selected( bb_get_option('avatars_default'), 'monsterid' ); ?>><?php _e('MonsterID'); ?></option> 181 <option value="wavatar"<?php selected( bb_get_option('avatars_default'), 'wavatar' ); ?>><?php _e('Wavatar'); ?></option> 182 <option value="identicon"<?php selected( bb_get_option('avatars_default'), 'identicon' ); ?>><?php _e('Identicon'); ?></option> 200 183 </select> 201 184 <p>Select what style of avatar to display to users without a Gravatar</p> … … 217 200 </div> 218 201 </div> 202 <?php 203 remove_filter( 'bb_get_option_avatars_show', $bb_get_option_avatars_show ); 204 ?> 219 205 <div> 220 206 <label for="avatars_rating"> … … 223 209 <div> 224 210 <select name="avatars_rating" id="avatars_rating"> 225 <?php 226 $selected = array(); 227 $selected[bb_get_option('avatars_rating')] = ' selected="selected"'; 228 ?> 229 <option value="0"<?php echo $selected[0]; ?>><?php _e('None'); ?></option> 230 <option value="x"<?php echo $selected['x']; ?>><?php _e('X'); ?></option> 231 <option value="r"<?php echo $selected['r']; ?>><?php _e('R'); ?></option> 232 <option value="pg"<?php echo $selected['pg']; ?>><?php _e('PG'); ?></option> 233 <option value="g"<?php echo $selected['g']; ?>><?php _e('G'); ?></option> 234 <?php 235 unset($selected); 236 ?> 211 <option value="0"<?php selected( bb_get_option('avatars_rating'), 0 ); ?>><?php _e('None'); ?></option> 212 <option value="x"<?php selected( bb_get_option('avatars_rating'), 'x' ); ?>><?php _e('X'); ?></option> 213 <option value="r"<?php selected( bb_get_option('avatars_rating'), 'r' ); ?>><?php _e('R'); ?></option> 214 <option value="pg"<?php selected( bb_get_option('avatars_rating'), 'pg' ); ?>><?php _e('PG'); ?></option> 215 <option value="g"<?php selected( bb_get_option('avatars_rating'), 'g' ); ?>><?php _e('G'); ?></option> 237 216 </select> 238 217 <p class="gravatarRating"> trunk/bb-admin/options-wordpress.php
r1606 r1671 2 2 require_once('admin.php'); 3 3 4 $action = $_POST['action']; 4 if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) ) 5 $action = @$_POST['action']; 6 else 7 $action = false; 5 8 6 9 if ( in_array( $action, array('update-users', 'update-options') ) ) { … … 36 39 } 37 40 38 switch ( $_GET['updated']) {41 switch (@$_GET['updated']) { 39 42 case 'update-users': 40 43 bb_admin_notice( __('User role mapping saved.') ); … … 167 170 </div> 168 171 <script type="text/javascript" charset="utf-8"> 172 /* <![CDATA[ */ 169 173 function updateWordPressOptionURL () { 170 174 var siteURLInputValue = document.getElementById('wp_siteurl').value; … … 193 197 siteURLInput.onclick = updateWordPressOptionURL; 194 198 siteURLInput.onchange = updateWordPressOptionURL; 199 /* ]]> */ 195 200 </script> 196 201 <?php … … 247 252 </label> 248 253 <?php 249 $advanced_display = 'none';250 254 if ( bb_get_option('user_bbdb_advanced') ) { 251 255 $advanced_display = 'block'; 252 256 $checked = ' checked="checked"'; 253 } 257 } else { 258 $advanced_display = 'none'; 259 $checked = ''; 260 } 261 254 262 ?> 255 263 <script type="text/javascript" charset="utf-8"> trunk/bb-admin/themes.php
r1603 r1671 56 56 $activation_url = clean_url( bb_nonce_url( $activation_url, 'switch-theme' ) ); 57 57 ?> 58 <li<?php alt_class( 'theme' , $class); ?>>58 <li<?php alt_class( 'theme' ); ?>> 59 59 <div class="screen-shot"><?php if ( $screen_shot ) : ?><a href="<?php echo $activation_url; ?>" title="<?php echo attribute_escape( __('Click to activate') ); ?>"><img alt="<?php echo attribute_escape( $theme_data['Title'] ); ?>" src="<?php echo $screen_shot; ?>" /></a><?php endif; ?></div> 60 60 <div class="description"> trunk/bb-admin/users-blocked.php
r1299 r1671 3 3 4 4 // Query the users 5 $bb_blocked_users = new BB_Users_By_Role( array('inactive', 'blocked'), $_GET['userspage'] );5 $bb_blocked_users = new BB_Users_By_Role( array('inactive', 'blocked'), @$_GET['userspage'] ); 6 6 7 7 bb_get_admin_header(); trunk/bb-admin/users-moderators.php
r1299 r1671 3 3 4 4 // Query the users 5 $bb_moderators = new BB_Users_By_Role( bb_trusted_roles(), $_GET['userspage'] );5 $bb_moderators = new BB_Users_By_Role( bb_trusted_roles(), @$_GET['userspage'] ); 6 6 7 7 bb_get_admin_header(); trunk/bb-admin/users.php
r1299 r1671 3 3 4 4 // Query the users 5 $bb_user_search = new BB_User_Search( $_GET['usersearch'],$_GET['userspage']);5 $bb_user_search = new BB_User_Search(@$_GET['usersearch'], @$_GET['userspage']); 6 6 7 7 bb_get_admin_header(); trunk/bb-includes/class-bb-taxonomy.php
r1618 r1671 159 159 } else { 160 160 $t = $this->get_taxonomy($taxonomies[0]); 161 if ( is _array($t->args) )161 if ( isset($t->args) && is_array($t->args) ) 162 162 $args = array_merge($args, $t->args); 163 163 } trunk/bb-includes/classes.php
r1528 r1671 279 279 // Only one FULLTEXT search per query please 280 280 if ( $array['search'] ) 281 unset($array['post_text']);281 $array['post_text'] = false; 282 282 283 283 return $array; … … 1108 1108 1109 1109 // Walk the tree. 1110 if ( !empty($ this->previous_element) && ($element->$parent_field == $this->previous_element->$id_field)) {1110 if ( !empty($element) && !empty($this->previous_element) && $element->$parent_field == $this->previous_element->$id_field ) { 1111 1111 // Previous element is my parent. Descend a level. 1112 1112 array_unshift($this->parents, $this->previous_element); … … 1119 1119 } 1120 1120 $this->depth++; //always do this so when we start the element further down, we know where we are 1121 } else if ( $element->$parent_field == $this->previous_element->$parent_field) {1121 } else if ( !empty($element) && !empty($this->previous_element) && $element->$parent_field == $this->previous_element->$parent_field) { 1122 1122 // On the same level as previous element. 1123 1123 if ( !$to_depth || ($this->depth <= $to_depth) ) { … … 1140 1140 call_user_func_array(array(&$this, 'end_el'), $cb_args); 1141 1141 } 1142 if ( isset($this->parents[0]) && $element->$parent_field == $this->parents[0]->$id_field ) {1142 if ( !empty($element) && isset($this->parents[0]) && $element->$parent_field == $this->parents[0]->$id_field ) { 1143 1143 break; 1144 1144 } … … 1154 1154 // Start the element. 1155 1155 if ( !$to_depth || ($this->depth <= $to_depth) ) { 1156 if ( $element->$id_field != 0 ) {1156 if ( !empty($element) && $element->$id_field != 0 ) { 1157 1157 $cb_args = array_merge( array(&$output, $element, $this->depth - 1), $args); 1158 1158 call_user_func_array(array(&$this, 'start_el'), $cb_args); … … 1200 1200 1201 1201 function &start( $elements, $walker = 'BB_Walker_Blank' ) { 1202 $null = null; 1202 1203 $a = new BB_Loop( $elements ); 1203 1204 if ( !$a->elements ) 1204 return null;1205 return $null; 1205 1206 $a->walker = new $walker; 1206 1207 return $a; … … 1245 1246 1246 1247 foreach ( $array as $key ) 1247 $this->_preserve[$key] = $GLOBALS[$key]; 1248 if ( isset($GLOBALS[$key]) ) 1249 $this->_preserve[$key] = $GLOBALS[$key]; 1248 1250 } 1249 1251 … … 1270 1272 end($this->elements); 1271 1273 1272 if ( $next->{$this->walker->db_fields['parent']} == $current->{$this->walker->db_fields['id']} )1274 if ( !empty($next) && $next->{$this->walker->db_fields['parent']} == $current->{$this->walker->db_fields['id']} ) 1273 1275 $classes[] = 'bb-parent'; 1274 elseif ( $next->{$this->walker->db_fields['parent']} == $current->{$this->walker->db_fields['parent']} )1276 elseif ( !empty($next) && $next->{$this->walker->db_fields['parent']} == $current->{$this->walker->db_fields['parent']} ) 1275 1277 $classes[] = 'bb-precedes-sibling'; 1276 1278 else 1277 1279 $classes[] = 'bb-last-child'; 1278 1280 1279 if ( $current->{$this->walker->db_fields['parent']} == $prev->{$this->walker->db_fields['id']} )1281 if ( !empty($prev) && $current->{$this->walker->db_fields['parent']} == $prev->{$this->walker->db_fields['id']} ) 1280 1282 $classes[] = 'bb-first-child'; 1281 elseif ( $current->{$this->walker->db_fields['parent']} == $prev->{$this->walker->db_fields['parent']} )1283 elseif ( !empty($prev) && $current->{$this->walker->db_fields['parent']} == $prev->{$this->walker->db_fields['parent']} ) 1282 1284 $classes[] = 'bb-follows-sibling'; 1283 1285 elseif ( $prev ) trunk/bb-includes/default-filters.php
r1669 r1671 25 25 26 26 // Format Strings for Display 27 $filters = array( 'get_forum_name', 'topic_title' );27 $filters = array( 'get_forum_name', 'topic_title', 'bb_title', 'bb_option_name' ); 28 28 foreach ( $filters as $filter ) { 29 29 add_filter( $filter, 'wp_specialchars' ); trunk/bb-includes/functions.php
r1663 r1671 309 309 if ( $cache ) { 310 310 wp_cache_set( $topic->topic_id, $topic, 'bb_topic' ); 311 wp_cache_add( $topic->topic_slug, $topic _id, 'bb_topic_slug' );311 wp_cache_add( $topic->topic_slug, $topic->topic_id, 'bb_topic_slug' ); 312 312 } 313 313 … … 1600 1600 function get_user_favorites( $user_id, $topics = false ) { 1601 1601 $user = bb_get_user( $user_id ); 1602 if ( $user->favorites) {1602 if ( !empty($user->favorites) ) { 1603 1603 if ( $topics ) 1604 1604 $query = new BB_Query( 'topic', array('favorites' => $user_id, 'append_meta' => 0), 'get_user_favorites' ); … … 1621 1621 return; 1622 1622 1623 return in_array($topic->topic_id, explode(',', $user->favorites)); 1623 if ( isset($user->favorites) ) 1624 return in_array($topic->topic_id, explode(',', $user->favorites)); 1625 return false; 1624 1626 } 1625 1627 … … 1664 1666 1665 1667 function bb_option( $option ) { 1666 echo bb_get_option( $option );1668 echo apply_filters( 'bb_option_' . $option, bb_get_option( $option ) ); 1667 1669 } 1668 1670 … … 1882 1884 $resource = $_resource; 1883 1885 $_query = wp_parse_args($_query); 1884 } 1885 1886 // Make sure $_query is an array for array_merge() 1887 if (!$_query) { 1886 } else { 1887 // Make sure $_query is an array for array_merge() 1888 1888 $_query = array(); 1889 1889 } … … 2038 2038 */ 2039 2039 function bb_is_ssl() { 2040 return ( 'on' == strtolower( $_SERVER['HTTPS']) ) ? true : false;2040 return ( 'on' == strtolower(@$_SERVER['HTTPS']) ) ? true : false; 2041 2041 } 2042 2042 … … 2389 2389 // GMT -> Local 2390 2390 // in future versions this could eaily become a user option. 2391 function bb_offset_time( $time, $args = '') {2392 if ( 'since' == $args['format'] )2391 function bb_offset_time( $time, $args = null ) { 2392 if ( isset($args['format']) && 'since' == $args['format'] ) 2393 2393 return $time; 2394 2394 if ( !is_numeric($time) ) { … … 3095 3095 $sql_terms[] = "$field LIKE ('%$likeit%')"; 3096 3096 3097 if ( $user_meta_ids )3097 if ( isset($user_meta_ids) && $user_meta_ids ) 3098 3098 $sql_terms[] = "ID IN (". join(',', $user_meta_ids) . ")"; 3099 3099 trunk/bb-includes/template-functions.php
r1661 r1671 135 135 global $page, $topic, $forum; 136 136 137 if ( $forum->forum_is_category)137 if ( isset($forum->forum_is_category) && $forum->forum_is_category ) 138 138 return; 139 139 … … 148 148 } 149 149 150 $last_page = get_page_number( $topic->topic_posts+ $add );150 $last_page = get_page_number( ( isset($topic->topic_posts) ? $topic->topic_posts : 0 ) + $add ); 151 151 152 152 if ( !empty($h2) ) { … … 158 158 do_action('pre_post_form'); 159 159 160 if ( ( is_topic() && bb_current_user_can( 'write_post', $topic->topic_id ) && $page == $last_page ) || ( !is_topic() && bb_current_user_can( 'write_topic', $forum->forum_id) ) ) {160 if ( ( is_topic() && bb_current_user_can( 'write_post', $topic->topic_id ) && $page == $last_page ) || ( !is_topic() && bb_current_user_can( 'write_topic', isset($forum->forum_id) ? $forum->forum_id : 0 ) ) ) { 161 161 echo '<form class="postform post-form" id="postform" method="post" action="' . bb_get_uri('bb-post.php', null, BB_URI_CONTEXT_FORM_ACTION) . '">' . "\n"; 162 162 echo '<fieldset>' . "\n"; … … 578 578 function bb_get_forum_is_category( $forum_id = 0 ) { 579 579 $forum = get_forum( get_forum_id( $forum_id ) ); 580 return apply_filters( 'bb_get_forum_is_category', $forum->forum_is_category, $forum->forum_id );580 return apply_filters( 'bb_get_forum_is_category', isset($forum->forum_is_category) ? $forum->forum_is_category : false, $forum->forum_id ); 581 581 } 582 582 … … 602 602 global $page; 603 603 $forum = get_forum( get_forum_id( $forum_id ) ); 604 echo apply_filters( 'forum_pages', get_page_number_links( $page, $forum->topics ), $forum-> forum_topics );604 echo apply_filters( 'forum_pages', get_page_number_links( $page, $forum->topics ), $forum->topics ); 605 605 } 606 606 … … 676 676 } 677 677 $current_trail_forum_id = $trail_forum->forum_id; 678 while ( $trail_forum->forum_id > 0) {678 while ( $trail_forum && $trail_forum->forum_id > 0 ) { 679 679 $crumb = $separator; 680 680 if ($current_trail_forum_id != $trail_forum->forum_id || !is_forum()) { … … 735 735 return $bb_forums_loop->elements; 736 736 } 737 return false; 737 $false = false; 738 return $false; 738 739 } 739 740 … … 790 791 else 791 792 $_topic =& $topic; 792 return $_topic->topic_id; 793 if ( !isset($topic->topic_id) ) 794 return 0; 795 796 return (int) $_topic->topic_id; 793 797 } 794 798 … … 875 879 function get_topic_deleted_posts( $id = 0 ) { 876 880 $topic = get_topic( get_topic_id( $id ) ); 877 return apply_filters( 'get_topic_deleted_posts', $topic->deleted_posts, $topic->topic_id );881 return apply_filters( 'get_topic_deleted_posts', isset($topic->deleted_posts) ? $topic->deleted_posts : 0, $topic->topic_id ); 878 882 } 879 883 … … 958 962 function topic_pages_add( $id = 0 ) { 959 963 $topic = get_topic( get_topic_id( $id ) ); 960 if ( isset($_GET['view']) && 'all' == $_GET['view'] && bb_current_user_can('browse_deleted') ) 961 $add += $topic->deleted_posts; 962 return apply_filters( 'topic_pages_add', $add, $topic->topic_id ); 964 if ( isset($_GET['view']) && 'all' == $_GET['view'] && bb_current_user_can('browse_deleted') && isset( $topic->deleted_posts ) ) 965 $add = $topic->deleteted_posts; 966 else 967 $add = 0; 968 return apply_filters( 'topic_pages_add', $add, isset($topic->topic_id) ? $topic->topic_id : 0 ); 963 969 } 964 970 … … 1074 1080 $uri = attribute_escape( bb_nonce_url( $uri, 'close-topic_' . $topic->topic_id ) ); 1075 1081 1076 return $before . '<a href="' . $uri . '" onclick="return confirm(\'' . js_escape( $confirm ) . '\');">' . $display . '</a>' . $after;1082 return $before . '<a href="' . $uri . '">' . $display . '</a>' . $after; 1077 1083 } 1078 1084 … … 1662 1668 if ( is_array( $profile_info_keys ) ) { 1663 1669 foreach ( $profile_info_keys as $key => $label ) { 1664 if ( in_array($key, array('first_name', 'last_name', 'display_name')) )1670 if ( in_array($key, array('first_name', 'last_name', 'display_name')) || !isset($user->$key) ) 1665 1671 continue; 1666 1672 $val = 'user_url' == $key ? get_user_link( $user->ID ) : $user->$key; 1667 1673 if ( 1668 1674 ( 'user_email' != $key || ( 'user_email' == $key && bb_current_user_can( 'edit_users' ) ) ) 1669 && isset( $user->$key )1670 1675 && $val 1671 1676 && 'http://' != $val … … 1727 1732 $message = "<p class='error'>$message</p>"; 1728 1733 } else { 1729 $value = $user->$key;1734 $value = isset( $user->$key ) ? $user->$key : ''; 1730 1735 $message = ''; 1731 1736 } … … 1746 1751 //$public_display['display_nickname'] = $user->nickname; 1747 1752 $public_display['display_username'] = $user->user_login; 1748 $public_display['display_firstname'] = $user->first_name; 1749 $public_display['display_firstlast'] = $user->first_name.' '.$user->last_name; 1750 $public_display['display_lastfirst'] = $user->last_name.' '.$user->first_name; 1753 if ( isset($user->first_name) ) { 1754 $public_display['display_firstname'] = $user->first_name; 1755 if ( isset($user->last_name) ) { 1756 $public_display['display_firstlast'] = $user->first_name.' '.$user->last_name; 1757 $public_display['display_lastfirst'] = $user->last_name.' '.$user->first_name; 1758 } 1759 } 1760 if ( isset($user->last_name) ) 1761 $public_display['display_lastname'] = $user->last_name; 1762 1751 1763 $public_display = array_unique(array_filter(array_map('trim', $public_display))); 1752 1764 … … 1882 1894 $value = $label[3]; 1883 1895 } else { 1884 $value = $user->$key;1896 $value = isset($user->$key) ? $user->$key : ''; 1885 1897 } 1886 1898 $message = ''; … … 2116 2128 else 2117 2129 $_tag =& $tag; 2118 return $_tag->raw_tag; 2130 if ( is_object($_tag) ) 2131 return $_tag->raw_tag; 2132 return ''; 2119 2133 } 2120 2134 … … 2418 2432 while ( $depth = bb_forum() ) : 2419 2433 global $forum; // Globals + References = Pain 2420 if ( $disable_categories && $forum->forum_is_category) {2434 if ( $disable_categories && isset($forum->forum_is_category) && $forum->forum_is_category ) { 2421 2435 $options[] = array( 2422 2436 'value' => 0,