Changeset 3855 for branches/plugin/bbp-includes/bbp-forum-template.php
- Timestamp:
- 04/28/2012 10:25:50 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-forum-template.php
r3842 r3855 1829 1829 remove_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' ); 1830 1830 1831 // Build the forum description 1832 $topic_count = bbp_get_forum_topics_link ( $forum_id ); 1833 $reply_count = bbp_get_forum_reply_count ( $forum_id ); 1834 $time_since = bbp_get_forum_freshness_link( $forum_id ); 1835 1836 // Singlular/Plural 1837 $reply_count = sprintf( _n( '%s reply', '%s replies', $reply_count, 'bbpress' ), $reply_count ); 1838 1839 // Forum has posts 1840 $last_reply = bbp_get_forum_last_active_id( $forum_id ); 1841 if ( !empty( $last_reply ) ) { 1842 1843 // Freshness author 1844 $last_updated_by = bbp_get_author_link( array( 'post_id' => $last_reply, 'size' => $size ) ); 1845 1846 // Category 1847 if ( bbp_is_forum_category( $forum_id ) ) { 1848 $retstr = sprintf( __( 'This category contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_count, $reply_count, $last_updated_by, $time_since ); 1849 1850 // Forum 1851 } else { 1852 $retstr = sprintf( __( 'This forum contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_count, $reply_count, $last_updated_by, $time_since ); 1853 } 1831 // Get some forum data 1832 $topic_count = bbp_get_forum_topic_count( $forum_id ); 1833 $reply_count = bbp_get_forum_reply_count( $forum_id ); 1834 $last_active = bbp_get_forum_last_active_id( $forum_id ); 1835 1836 // Has replies 1837 if ( !empty( $reply_count ) ) { 1838 $reply_text = sprintf( _n( '%s reply', '%s replies', $reply_count, 'bbpress' ), $reply_count ); 1839 } 1840 1841 // Forum has active data 1842 if ( !empty( $last_active ) ) { 1843 $topic_text = bbp_get_forum_topics_link( $forum_id ); 1844 $time_since = bbp_get_forum_freshness_link( $forum_id ); 1845 $last_updated_by = bbp_get_author_link( array( 'post_id' => $last_active, 'size' => $size ) ); 1854 1846 1855 1847 // Forum has no last active data 1856 1848 } else { 1857 1858 // Category 1859 if ( bbp_is_forum_category( $forum_id ) ) { 1860 $retstr = sprintf( __( 'This category contains %1$s and %2$s.', 'bbpress' ), $topic_count, $reply_count ); 1861 1862 // Forum 1849 $topic_text = sprintf( _n( '%s topic', '%s topics', $topic_count, 'bbpress' ), $topic_count ); 1850 } 1851 1852 // Forum has active data 1853 if ( !empty( $last_active ) ) { 1854 1855 if ( !empty( $reply_count ) ) { 1856 1857 if ( bbp_is_forum_category( $forum_id ) ) { 1858 $retstr = sprintf( __( 'This category contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_text, $reply_text, $last_updated_by, $time_since ); 1859 } else { 1860 $retstr = sprintf( __( 'This forum contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_text, $reply_text, $last_updated_by, $time_since ); 1861 } 1862 1863 1863 } else { 1864 $retstr = sprintf( __( 'This forum contains %1$s and %2$s.', 'bbpress' ), $topic_count, $reply_count ); 1864 1865 if ( bbp_is_forum_category( $forum_id ) ) { 1866 $retstr = sprintf( __( 'This category contains %1$s, and was last updated by %2$s %3$s.', 'bbpress' ), $topic_text, $last_updated_by, $time_since ); 1867 } else { 1868 $retstr = sprintf( __( 'This forum contains %1$s, and was last updated by %2$s %3$s.', 'bbpress' ), $topic_text, $last_updated_by, $time_since ); 1869 } 1870 } 1871 1872 // Forum has no last active data 1873 } else { 1874 1875 if ( !empty( $reply_count ) ) { 1876 1877 if ( bbp_is_forum_category( $forum_id ) ) { 1878 $retstr = sprintf( __( 'This category contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text ); 1879 } else { 1880 $retstr = sprintf( __( 'This forum contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text ); 1881 } 1882 1883 } else { 1884 1885 if ( !empty( $topic_count ) ) { 1886 1887 if ( bbp_is_forum_category( $forum_id ) ) { 1888 $retstr = sprintf( __( 'This category contains %1$s.', 'bbpress' ), $topic_text ); 1889 } else { 1890 $retstr = sprintf( __( 'This forum contains %1$s.', 'bbpress' ), $topic_text ); 1891 } 1892 1893 } else { 1894 $retstr = __( 'This forum is empty.', 'bbpress' ); 1895 } 1865 1896 } 1866 1897 }
Note: See TracChangeset
for help on using the changeset viewer.