Changeset 2150
- Timestamp:
- 06/10/2009 02:45:35 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
bb-admin/bb-do-counts.php (modified) (1 diff)
-
bb-admin/includes/functions.bb-admin.php (modified) (1 diff)
-
bb-includes/functions.bb-posts.php (modified) (2 diffs)
-
bb-includes/functions.bb-template.php (modified) (1 diff)
-
bb-templates/kakumei/favorites.php (modified) (2 diffs)
-
bb-templates/kakumei/forum.php (modified) (3 diffs)
-
bb-templates/kakumei/front-page.php (modified) (3 diffs)
-
bb-templates/kakumei/tag-single.php (modified) (2 diffs)
-
bb-templates/kakumei/topic.php (modified) (1 diff)
-
bb-templates/kakumei/view.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-admin/bb-do-counts.php
r2118 r2150 31 31 } 32 32 echo "\t\t" . __('Done counting posts.'); 33 echo "\n\t</li>\n"; 34 } 35 36 if ( isset($_POST['topic-voices']) && 1 == $_POST['topic-voices'] ) { 37 echo "\t<li>\n"; 38 if ( $topics = (array) $bbdb->get_results("SELECT topic_id FROM $bbdb->topics ORDER BY topic_id") ) { 39 echo "\t\t" . __('Counting voices…') . "<br />\n"; 40 foreach ($topics as $topic) { 41 $topic_id = (int) $topic->topic_id; 42 if ( $voices = $bbdb->get_col( $bbdb->prepare( "SELECT DISTINCT poster_id FROM $bbdb->posts WHERE topic_id = %s AND post_status = '0';", $topic_id ) ) ) { 43 $voices = count( $voices ); 44 bb_update_topicmeta( $topic_id, 'voices_count', $voices ); 45 } 46 } 47 unset($topics, $topic, $topic_id); 48 } 49 echo "\t\t" . __('Done counting voices.'); 33 50 echo "\n\t</li>\n"; 34 51 } -
trunk/bb-admin/includes/functions.bb-admin.php
r2147 r2150 967 967 $recount_list = array(); 968 968 $recount_list[5] = array('topic-posts', __('Count posts of every topic')); 969 $recount_list[6] = array('topic-voices', __('Count voices of every topic')); 969 970 $recount_list[10] = array('topic-deleted-posts', __('Count deleted posts on every topic')); 970 971 $recount_list[15] = array('forums', __('Count topics and posts in every forum (relies on the above)')); -
trunk/bb-includes/functions.bb-posts.php
r2147 r2150 278 278 $topic_last_poster_name = $user->user_login; 279 279 280 $bbdb->query( $bbdb->prepare( "UPDATE $bbdb->forums SET posts = posts + 1 WHERE forum_id = %d ", $topic->forum_id ) );280 $bbdb->query( $bbdb->prepare( "UPDATE $bbdb->forums SET posts = posts + 1 WHERE forum_id = %d;", $topic->forum_id ) ); 281 281 $bbdb->update( 282 282 $bbdb->topics, … … 288 288 if ( !$query->results ) 289 289 bb_update_usermeta( $poster_id, $bbdb->prefix . 'topics_replied', $user->topics_replied + 1 ); 290 291 if ( $voices = $bbdb->get_col( $bbdb->prepare( "SELECT DISTINCT poster_id FROM $bbdb->posts WHERE topic_id = %s AND post_status = '0';", $topic_id ) ) ) { 292 $voices = count( $voices ); 293 bb_update_topicmeta( $topic_id, 'voices_count', $voices ); 294 } 290 295 } else { 291 296 bb_update_topicmeta( $topic->topic_id, 'deleted_posts', isset($topic->deleted_posts) ? $topic->deleted_posts + 1 : 1 ); -
trunk/bb-includes/functions.bb-template.php
r2147 r2150 1137 1137 1138 1138 return apply_filters( 'get_topic_page_links', $r, $_links, $topic->topic_id ); 1139 } 1140 1141 function bb_topic_voices( $id = 0 ) { 1142 echo apply_filters( 'bb_topic_voices', bb_get_topic_voices( $id ), get_topic_id( $id ) ); 1143 } 1144 1145 function bb_get_topic_voices( $id = 0 ) { 1146 $topic = get_topic( get_topic_id( $id ) ); 1147 1148 if ( empty( $topic->voices_count ) ) { 1149 global $bbdb; 1150 1151 if ( $voices = $bbdb->get_col( $bbdb->prepare( "SELECT DISTINCT poster_id FROM $bbdb->posts WHERE topic_id = %s AND post_status = '0';", $topic->topic_id ) ) ) { 1152 $voices = count( $voices ); 1153 bb_update_topicmeta( $topic->topic_id, 'voices_count', $voices ); 1154 } 1155 } else { 1156 $voices = $topic->voices_count; 1157 } 1158 1159 return apply_filters( 'bb_get_topic_voices', $voices, $topic->topic_id ); 1139 1160 } 1140 1161 -
trunk/bb-templates/kakumei/favorites.php
r2125 r2150 16 16 <th><?php _e('Topic'); ?></th> 17 17 <th><?php _e('Posts'); ?></th> 18 <!-- <th><?php _e('Voices'); ?></th> --> 18 19 <th><?php _e('Freshness'); ?></th> 19 20 <?php if ( bb_current_user_can( 'edit_favorites_of', $user_id ) ) : ?> … … 26 27 <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td> 27 28 <td class="num"><?php topic_posts(); ?></td> 29 <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> 28 30 <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td> 29 31 <?php if ( bb_current_user_can( 'edit_favorites_of', $user_id ) ) : ?> -
trunk/bb-templates/kakumei/forum.php
r2125 r2150 9 9 <th><?php _e('Topic'); ?> — <?php bb_new_topic_link(); ?></th> 10 10 <th><?php _e('Posts'); ?></th> 11 <!-- <th><?php _e('Voices'); ?></th> --> 11 12 <th><?php _e('Last Poster'); ?></th> 12 13 <th><?php _e('Freshness'); ?></th> … … 17 18 <td><?php bb_topic_labels(); ?> <big><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></big><?php topic_page_links(); ?></td> 18 19 <td class="num"><?php topic_posts(); ?></td> 20 <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> 19 21 <td class="num"><?php topic_last_poster(); ?></td> 20 22 <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td> … … 26 28 <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a><?php topic_page_links(); ?></td> 27 29 <td class="num"><?php topic_posts(); ?></td> 30 <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> 28 31 <td class="num"><?php topic_last_poster(); ?></td> 29 32 <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td> -
trunk/bb-templates/kakumei/front-page.php
r2125 r2150 17 17 <th><?php _e('Topic'); ?> — <?php bb_new_topic_link(); ?></th> 18 18 <th><?php _e('Posts'); ?></th> 19 <!-- <th><?php _e('Voices'); ?></th> --> 19 20 <th><?php _e('Last Poster'); ?></th> 20 21 <th><?php _e('Freshness'); ?></th> … … 25 26 <td><?php bb_topic_labels(); ?> <big><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></big><?php topic_page_links(); ?></td> 26 27 <td class="num"><?php topic_posts(); ?></td> 28 <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> 27 29 <td class="num"><?php topic_last_poster(); ?></td> 28 30 <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td> … … 34 36 <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a><?php topic_page_links(); ?></td> 35 37 <td class="num"><?php topic_posts(); ?></td> 38 <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> 36 39 <td class="num"><?php topic_last_poster(); ?></td> 37 40 <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td> -
trunk/bb-templates/kakumei/tag-single.php
r2125 r2150 11 11 <th><?php _e('Topic'); ?> — <?php bb_new_topic_link(); ?></th> 12 12 <th><?php _e('Posts'); ?></th> 13 <!-- <th><?php _e('Voices'); ?></th> --> 13 14 <th><?php _e('Last Poster'); ?></th> 14 15 <th><?php _e('Freshness'); ?></th> … … 19 20 <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a><?php topic_page_links(); ?></td> 20 21 <td class="num"><?php topic_posts(); ?></td> 22 <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> 21 23 <td class="num"><?php topic_last_poster(); ?></td> 22 24 <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td> -
trunk/bb-templates/kakumei/topic.php
r2144 r2150 8 8 <h2<?php topic_class( 'topictitle' ); ?>><?php topic_title(); ?></h2> 9 9 <span id="topic_posts">(<?php topic_posts_link(); ?>)</span> 10 <span id="topic_voices">(<?php printf( __( '%s voices' ), bb_get_topic_voices() ); ?>)</span> 10 11 11 12 <ul class="topicmeta"> -
trunk/bb-templates/kakumei/view.php
r2125 r2150 9 9 <th><?php _e('Topic'); ?></th> 10 10 <th><?php _e('Posts'); ?></th> 11 <!-- <th><?php _e('Voices'); ?></th> --> 11 12 <th><?php _e('Last Poster'); ?></th> 12 13 <th><?php _e('Freshness'); ?></th> … … 17 18 <td><?php bb_topic_labels(); ?> <big><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></big></td> 18 19 <td class="num"><?php topic_posts(); ?></td> 20 <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> 19 21 <td class="num"><?php topic_last_poster(); ?></td> 20 22 <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td> … … 26 28 <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a><?php topic_page_links(); ?></td> 27 29 <td class="num"><?php topic_posts(); ?></td> 30 <!-- <td class="num"><?php bb_topic_voices(); ?></td> --> 28 31 <td class="num"><?php topic_last_poster(); ?></td> 29 32 <td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td>
Note: See TracChangeset
for help on using the changeset viewer.