Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/06/2011 08:25:58 AM (16 years ago)
Author:
johnjamesjacoby
Message:

"...pursuing a career in the custodial arts." phpDoc fixes and code clean-up. Props GautamGupta via Google Code-in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-functions.php

    r2749 r2758  
    11<?php
    22
    3 function bbp_admin_notices ( $message, $class = false ) {
     3/**
     4 * bbPress Admin Functions
     5 *
     6 * @package bbPress
     7 * @subpackage Administration
     8 */
     9
     10/**
     11 * Display the admin notices
     12 *
     13 * @since bbPress (r2613)
     14 *
     15 * @param string|WP_Error $message A message to be displayed or {@link WP_Error}
     16 * @param string $class Optional. A class to be added to the message div
     17 * @uses WP_Error::get_error_messages() To get the error messages of $message
     18 * @uses add_action() Adds the admin notice action with the message HTML
     19 * @return string The message HTML
     20 */
     21function bbp_admin_notices( $message, $class = false ) {
    422        if ( is_string( $message ) ) {
    523                $message = '<p>' . $message . '</p>';
    … …  
    3654}
    3755
    38 function bbp_recount_list () {
     56/**
     57 * Get the array of the recount list
     58 *
     59 * @since bbPress (r2613)
     60 *
     61 * @uses apply_filters() Calls 'bbp_recount_list' with the recount list array
     62 * @return array Recount list
     63 */
     64function bbp_recount_list() {
    3965        $recount_list = array(
    4066                5  => array( 'bbp-forum-topics',          __( 'Count topics in each forum',                    'bbpress' ), 'bbp_recount_forum_topics'          ),
    … …  
    5581}
    5682
    57 function bbp_recount_topic_replies () {
     83/**
     84 * Recount topic replies
     85 *
     86 * @since bbPress (r2613)
     87 *
     88 * @uses wpdb::query() To run our recount sql queries
     89 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     90 * @return array An array of the status code and the message
     91 */
     92function bbp_recount_topic_replies() {
    5893        global $wpdb, $bbp;
    5994
    … …  
    73108}
    74109
    75 function bbp_recount_topic_voices () {
     110/**
     111 * Recount topic voices
     112 *
     113 * @since bbPress (r2613)
     114 *
     115 * @uses wpdb::query() To run our recount sql queries
     116 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     117 * @return array An array of the status code and the message
     118 */
     119function bbp_recount_topic_voices() {
    76120        global $wpdb, $bbp;
    77121
    … …  
    83127                return array( 1, sprintf( $statement, $result ) );
    84128
    85         $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `ID`, '_bbp_topic_voice_count', COUNT(DISTINCT `post_author`) as `meta_value` FROM `{$wpdb->posts}` WHERE `post_type` IN ( '{$bbp->topic_id}', '{{$bbp->reply_id}}' ) AND `post_status` = 'publish' GROUP BY `post_parent`);";
     129        $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `ID`, '_bbp_topic_voice_count', COUNT(DISTINCT `post_author`) as `meta_value` FROM `{$wpdb->posts}` WHERE `post_type` IN ( '{$bbp->topic_id}', '{$bbp->reply_id}' ) AND `post_status` = 'publish' GROUP BY `post_parent`);";
    86130        if ( is_wp_error( $wpdb->query( $sql ) ) )
    87131                return array( 2, sprintf( $statement, $result ) );
    … …  
    118162}
    119163
    120 function bbp_recount_forum_topics () {
     164/**
     165 * Recount forum topics
     166 *
     167 * @since bbPress (r2613)
     168 *
     169 * @uses wpdb::query() To run our recount sql queries
     170 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     171 * @return array An array of the status code and the message
     172 */
     173function bbp_recount_forum_topics() {
    121174        global $wpdb, $bbp;
    122175
    … …  
    136189}
    137190
    138 function bbp_recount_forum_replies () {
     191/**
     192 * Recount forum replies
     193 *
     194 * @since bbPress (r2613)
     195 *
     196 * @uses wpdb::query() To run our recount sql queries
     197 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     198 * @return array An array of the status code and the message
     199 */
     200function bbp_recount_forum_replies() {
    139201        global $wpdb, $bbp;
    140202
    … …  
    154216}
    155217
    156 function bbp_recount_user_topics_replied () {
     218/**
     219 * Recount topic replied by the users
     220 *
     221 * @since bbPress (r2613)
     222 *
     223 * @uses wpdb::query() To run our recount sql queries
     224 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     225 * @return array An array of the status code and the message
     226 */
     227function bbp_recount_user_topics_replied() {
    157228        global $wpdb, $bbp;
    158229
    … …  
    191262
    192263// This function bypasses the taxonomy API
    193 function bbp_recount_topic_tags () {
     264/**
     265 * Recount topic tags in each topic
     266 *
     267 * @since bbPress (r2613)
     268 *
     269 * @uses wpdb::query() To run our recount sql queries
     270 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     271 * @return array An array of the status code and the message
     272 */
     273function bbp_recount_topic_tags() {
    194274        global $wpdb;
    195275
    … …  
    261341
    262342// This function bypasses the taxonomy API
    263 function bbp_recount_tag_topics () {
     343/**
     344 * Recount the number of topics in each topic tag
     345 *
     346 * @since bbPress (r2613)
     347 *
     348 * @uses wpdb::query() To run our recount sql queries
     349 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     350 * @return array An array of the status code and the message
     351 */
     352function bbp_recount_tag_topics() {
    264353        global $wpdb;
    265354
    … …  
    334423
    335424// This function bypasses the taxonomy API
    336 function bbp_recount_tag_delete_empty () {
     425/**
     426 * Recount topic tags with no topics
     427 *
     428 * @since bbPress (r2613)
     429 *
     430 * @uses wpdb::query() To run our recount sql queries
     431 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     432 * @return array An array of the status code and the message
     433 */
     434function bbp_recount_tag_delete_empty() {
    337435        global $wpdb;
    338436
    … …  
    456554}
    457555
    458 function bbp_recount_clean_favorites () {
     556/**
     557 * Clean the users' favorites
     558 *
     559 * @since bbPress (r2613)
     560 *
     561 * @uses wpdb::query() To run our recount sql queries
     562 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     563 * @return array An array of the status code and the message
     564 */
     565function bbp_recount_clean_favorites() {
    459566        global $wpdb, $bbp;
    460567
    … …  
    505612}
    506613
    507 function bbp_recount_clean_subscriptions () {
     614/**
     615 * Clean the users' subscriptions
     616 *
     617 * @since bbPress (r2668)
     618 *
     619 * @uses wpdb::query() To run our recount sql queries
     620 * @uses is_wp_error() To check if the executed query returned {@link WP_Error}
     621 * @return array An array of the status code and the message
     622 */
     623function bbp_recount_clean_subscriptions() {
    508624        global $wpdb, $bbp;
    509625
Note: See TracChangeset for help on using the changeset viewer.