Changeset 237 for sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php
- Timestamp:
- 01/08/2014 08:02:22 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php
r236 r237 48 48 } 49 49 50 function get_trac_ticket_star _count( $ticket_id ) {51 return $this->trac->get_ var( $this->trac->prepare( "SELECT COUNT(*)FROM _ticket_subs WHERE ticket = %s AND status = 1", $ticket_id ) );50 function get_trac_ticket_stars( $ticket_id ) { 51 return $this->trac->get_col( $this->trac->prepare( "SELECT username FROM _ticket_subs WHERE ticket = %s AND status = 1", $ticket_id ) ); 52 52 } 53 53 … … 148 148 $ticket_sub = $this->get_trac_ticket_subscription_status_for_user( $ticket_id, $username ); 149 149 150 $stars = $this->get_trac_ticket_star_count( $ticket_id ); 150 $stars = $this->get_trac_ticket_stars( $ticket_id ); 151 $star_count = count( $stars ); 151 152 152 153 $participants = $this->get_trac_ticket_participants( $ticket_id ); … … 182 183 $class .= ' receiving'; 183 184 } 184 if ( $stars == 0 ) { 185 $class .= ' count-0'; 186 } elseif ( $stars == 1 ) { 187 $class .= ' count-1'; 185 186 if ( $star_count === 0 || $star_count === 1 ) { 187 $class .= ' count-' . $star_count; 188 188 } 189 189 ob_start(); … … 195 195 <a href="#" class="button button-large watching-ticket"><span class="dashicons dashicons-star-filled"></span> Watching ticket</a> 196 196 <a href="#" class="button button-large watch-this-ticket"><span class="dashicons dashicons-star-empty"></span> Watch this ticket</a> 197 <span class="num-stars"><span class="count"><?php echo $stars; ?></span> <span class="count-1">star</span> <span class="count-many">stars</span></span> 197 <span class="num-stars"><span class="count"><?php echo $star_count; ?></span> <span class="count-1">star</span> <span class="count-many">stars</span></span> 198 <div class="star-list"> 199 <?php 200 foreach ( $stars as $follower ) : 201 if ( $username === $follower ) { 202 continue; 203 } 204 $follower = esc_attr( $follower ); 205 ?> 206 <a title="<?php echo $follower; ?>" href="//profiles.wordpress.org/<?php echo $follower; ?>"> 207 <img src="//wordpress.org/grav-redirect.php?user=<?php echo $follower; ?>&s=36" /> 208 </a> 209 <?php endforeach; ?> 210 <a title="you" class="star-you" href="//profiles.wordpress.org/<?php echo esc_attr( $username ); ?>"> 211 <img src="//wordpress.org/grav-redirect.php?user=<?php echo esc_attr( $username ); ?>&s=36" /> 212 </a> 213 </div> 198 214 </p> 199 215 <p class="receiving-notifications">You are receiving notifications.</p>
Note: See TracChangeset
for help on using the changeset viewer.