Changeset 2328
- Timestamp:
- 07/28/2009 03:41:57 PM (15 years ago)
- Location:
- trunk/bb-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-includes/functions.bb-posts.php
r2279 r2328 347 347 bb_update_usermeta( $poster_id, $bbdb->prefix . 'topics_replied', $user->topics_replied + 1 ); 348 348 349 if ( $voices = $bbdb->get_col( $bbdb->prepare( "SELECT DISTINCT poster_id FROM $bbdb->posts WHERE topic_id = %s AND post_status = '0';", $topic_id ) ) ) {350 $voices = count( $voices );351 bb_update_topicmeta( $topic_id, 'voices_count', $voices );352 }353 349 } else { 354 350 bb_update_topicmeta( $topic->topic_id, 'deleted_posts', isset($topic->deleted_posts) ? $topic->deleted_posts + 1 : 1 ); 355 351 } 356 352 } 353 bb_update_topic_voices( $topic_id ); 357 354 358 355 if ( $throttle && !bb_current_user_can( 'throttle' ) ) … … 446 443 bb_topic_set_last_post( $topic_id ); 447 444 bb_update_post_positions( $topic_id ); 448 } 445 bb_update_topic_voices( $topic_id ); 446 } 447 449 448 $user = bb_get_user( $uid ); 450 449 -
trunk/bb-includes/functions.bb-topics.php
r2279 r2328 409 409 } 410 410 411 function bb_update_topic_voices( $topic_id ) 412 { 413 if ( !$topic_id ) { 414 return; 415 } 416 417 $topic_id = abs( (int) $topic_id ); 418 419 global $bbdb; 420 if ( $voices = $bbdb->get_col( $bbdb->prepare( "SELECT DISTINCT poster_id FROM $bbdb->posts WHERE topic_id = %s AND post_status = '0';", $topic_id ) ) ) { 421 $voices = count( $voices ); 422 bb_update_topicmeta( $topic_id, 'voices_count', $voices ); 423 } 424 } 425 411 426 /* Thread */ 412 427
Note: See TracChangeset
for help on using the changeset viewer.