Changeset 2716
- Timestamp:
- 12/11/2010 04:58:47 PM (16 years ago)
- File:
-
- 1 edited
-
branches/plugin/bbp-includes/bbp-widgets.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-widgets.php
r2679 r2716 39 39 if ( bbp_has_forums( $default ) ) : 40 40 echo "<ul>"; 41 while ( bbp_forums () ) : bbp_the_forum();41 while ( bbp_forums() ) : bbp_the_forum(); 42 42 ?> 43 43 … … 102 102 echo $before_title . $title . $after_title; 103 103 104 if ( ($pop_check < $max_shown) && bbp_has_topics( $default ) ) : 105 echo "<ul>"; 106 while ( bbp_topics ( ) ) : bbp_the_topic(); 107 ?> 104 if ( $pop_check < $max_shown && bbp_has_topics( $default ) ) : 105 echo "<ul>"; 106 while ( bbp_topics() ) : bbp_the_topic(); 107 ?> 108 108 109 <li><a class="bbp-forum-title" href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>"><?php bbp_topic_title(); ?></a><?php if ( $show_date == 'on' ) 109 110 _e( ', ' . bbp_get_topic_last_active() . ' ago' ); ?></li> 111 110 112 <?php 111 113 endwhile; … … 113 115 endif; 114 116 115 if ( ($pop_check >= $max_shown)&& bbp_has_topics( $default ) ) :117 if ( $pop_check >= $max_shown && bbp_has_topics( $default ) ) : 116 118 echo "<ul>"; 117 119 while ( bbp_topics ( ) ) : bbp_the_topic(); … … 122 124 foreach ( $topics as $topic_id => $topic_reply_count ) { 123 125 ?> 126 124 127 <li><a class="bbp-forum-title" href="<?php bbp_topic_permalink( $topic_id ); ?>" title="<?php bbp_topic_title( $topic_id ); ?>"><?php bbp_topic_title( $topic_id ); ?></a><?php if ( $show_date == 'on' ) 125 128 _e( ', ' . bbp_get_topic_last_active( $topic_id ) . ' ago' ); ?></li> 129 126 130 <?php 127 131 $topic_count++; … … 145 149 146 150 function form( $instance ) { 147 $title = esc_attr( $instance['title'] ); 148 $max_shown = esc_attr( $instance['max_shown'] ); 149 $show_date = esc_attr( $instance['show_date'] ); 150 $pop_check = esc_attr( $instance['pop_check'] ); 151 ?> 151 $title = !empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 152 $max_shown = !empty( $instance['max_shown'] ) ? esc_attr( $instance['max_shown'] ) : ''; 153 $show_date = !empty( $instance['show_date'] ) ? esc_attr( $instance['show_date'] ) : ''; 154 $pop_check = !empty( $instance['pop_check'] ) ? esc_attr( $instance['pop_check'] ) : ''; 155 ?> 156 152 157 <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></label></p> 153 158 <p><label for="<?php echo $this->get_field_id( 'max_shown' ); ?>"><?php _e( 'Maximum topics to show:' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_shown' ); ?>" name="<?php echo $this->get_field_name( 'max_shown' ); ?>" type="text" value="<?php echo $max_shown; ?>" /></label></p> … … 192 197 echo "<ul>"; 193 198 194 while ( bbp_replies ( ) ) : bbp_the_reply(); 195 ?> 199 while ( bbp_replies() ) : bbp_the_reply(); 200 ?> 201 196 202 <li> 197 203 <a class="bbp-forum-title" href="<?php bbp_reply_permalink(); ?>" title="<?php bbp_reply_title(); ?>"><?php bbp_reply_title(); ?></a> … … 200 206 201 207 </li> 208 202 209 <?php 203 210 endwhile; … … 221 228 $show_date = !empty( $instance['show_date'] ) ? esc_attr( $instance['show_date'] ) : ''; 222 229 ?> 230 223 231 <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></label></p> 224 232 <p><label for="<?php echo $this->get_field_id( 'max_shown' ); ?>"><?php _e( 'Maximum replies to show:' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_shown' ); ?>" name="<?php echo $this->get_field_name( 'max_shown' ); ?>" type="text" value="<?php echo $max_shown; ?>" /></label></p> … … 230 238 } 231 239 232 add_action( 'widgets_init', create_function( '', 'return register_widget("BBP_Forums_Widget");' ) );233 add_action( 'widgets_init', create_function( '', 'return register_widget("BBP_Topics_Widget");' ) );240 add_action( 'widgets_init', create_function( '', 'return register_widget("BBP_Forums_Widget");' ) ); 241 add_action( 'widgets_init', create_function( '', 'return register_widget("BBP_Topics_Widget");' ) ); 234 242 add_action( 'widgets_init', create_function( '', 'return register_widget("BBP_Replies_Widget");' ) ); 235 243
Note: See TracChangeset
for help on using the changeset viewer.