Changeset 3911 for branches/plugin/bbp-includes/bbp-user-template.php
- Timestamp:
- 05/22/2012 08:00:55 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-user-template.php
r3860 r3911 1530 1530 } 1531 1531 1532 /** Post Counts ***************************************************************/1533 1534 /**1535 * Output a users topic count1536 *1537 * @since bbPress (r3632)1538 *1539 * @param int $user_id1540 * @uses bbp_get_user_topic_count()1541 * @return string1542 */1543 function bbp_user_topic_count( $user_id = 0 ) {1544 echo bbp_get_user_topic_count( $user_id );1545 }1546 /**1547 * Return a users reply count1548 *1549 * @since bbPress (r3632)1550 *1551 * @param int $user_id1552 * @uses bbp_get_user_id()1553 * @uses get_user_meta()1554 * @uses apply_filters()1555 * @return string1556 */1557 function bbp_get_user_topic_count( $user_id = 0 ) {1558 1559 // Validate user id1560 $user_id = bbp_get_user_id( $user_id );1561 if ( empty( $user_id ) )1562 return false;1563 1564 $count = get_user_meta( $user_id, '_bbp_topic_count', true );1565 1566 return apply_filters( 'bbp_get_user_topic_count', (int) $count, $user_id );1567 }1568 1569 /**1570 * Output a users reply count1571 *1572 * @since bbPress (r3632)1573 *1574 * @param int $user_id1575 * @uses bbp_get_user_reply_count()1576 * @return string1577 */1578 function bbp_user_reply_count( $user_id = 0 ) {1579 echo bbp_get_user_reply_count( $user_id );1580 }1581 /**1582 * Return a users reply count1583 *1584 * @since bbPress (r3632)1585 *1586 * @param int $user_id1587 * @uses bbp_get_user_id()1588 * @uses get_user_meta()1589 * @uses apply_filters()1590 * @return string1591 */1592 function bbp_get_user_reply_count( $user_id = 0 ) {1593 1594 // Validate user id1595 $user_id = bbp_get_user_id( $user_id );1596 if ( empty( $user_id ) )1597 return false;1598 1599 $count = get_user_meta( $user_id, '_bbp_reply_count', true );1600 1601 return apply_filters( 'bbp_get_user_reply_count', (int) $count, $user_id );1602 }1603 1604 /**1605 * Output a users total post count1606 *1607 * @since bbPress (r3632)1608 *1609 * @param int $user_id1610 * @uses bbp_get_user_post_count()1611 * @return string1612 */1613 function bbp_user_post_count( $user_id = 0 ) {1614 echo bbp_get_user_post_count( $user_id );1615 }1616 /**1617 * Return a users total post count1618 *1619 * @since bbPress (r3632)1620 *1621 * @param int $user_id1622 * @uses bbp_get_user_id()1623 * @uses get_user_meta()1624 * @uses apply_filters()1625 * @return string1626 */1627 function bbp_get_user_post_count( $user_id = 0 ) {1628 1629 // Validate user id1630 $user_id = bbp_get_user_id( $user_id );1631 if ( empty( $user_id ) )1632 return false;1633 1634 $topics = get_user_meta( $user_id, '_bbp_topic_count', true );1635 $replies = get_user_meta( $user_id, '_bbp_reply_count', true );1636 $count = (int) $topics + (int) $replies;1637 1638 return apply_filters( 'bbp_get_user_post_count', (int) $count, $user_id );1639 }1640 1641 1532 ?>
Note: See TracChangeset
for help on using the changeset viewer.