<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[BuddyPress] [1921] trunk: Added "most active group forums"
to forum directory.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>1921</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-09-22 20:45:43 +0000 (Tue, 22 Sep 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Added "most active group forums" to forum directory.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpforumsphp">trunk/bp-forums.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsclassesphp">trunk/bp-groups/bp-groups-classes.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatetagsphp">trunk/bp-groups/bp-groups-templatetags.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpthemesbpdefault_inccssscreencss">trunk/bp-themes/bp-default/_inc/css/screen.css</a></li>
<li><a href="#trunkbpthemesbpsnparentdirectoriesforumsindexphp">trunk/bp-themes/bp-sn-parent/directories/forums/index.php</a></li>
<li><a href="#trunkbpthemesbpsnparentdirectoriesgroupsgroupsloopphp">trunk/bp-themes/bp-sn-parent/directories/groups/groups-loop.php</a></li>
<li><a href="#trunkbpthemesbpsnparentdirectoriesgroupsindexphp">trunk/bp-themes/bp-sn-parent/directories/groups/index.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkbpforumsbpforumsclassesphp">trunk/bp-forums/bp-forums-classes.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpforumsbpforumsclassesphp"></a>
<div class="delfile"><h4>Deleted: trunk/bp-forums/bp-forums-classes.php (1920 => 1921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-classes.php        2009-09-22 18:01:55 UTC (rev 1920)
+++ trunk/bp-forums/bp-forums-classes.php        2009-09-22 20:45:43 UTC (rev 1921)
</span><span class="lines">@@ -1,5 +0,0 @@
</span><del>-<?php
-
-
-
-?>
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbpforumsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums.php (1920 => 1921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums.php        2009-09-22 18:01:55 UTC (rev 1920)
+++ trunk/bp-forums.php        2009-09-22 20:45:43 UTC (rev 1921)
</span><span class="lines">@@ -10,7 +10,6 @@
</span><span class="cx"> if ( !defined( 'BB_PATH' ) )
</span><span class="cx">         require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-bbpress.php' );
</span><span class="cx">
</span><del>-require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-classes.php' );
</del><span class="cx"> require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-templatetags.php' );
</span><span class="cx"> require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-filters.php' );
</span><span class="cx">
</span><span class="lines">@@ -79,11 +78,41 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_menu', 'bp_forums_add_admin_menu' );
</span><span class="cx">
</span><ins>+/* Forum Functions */
+
</ins><span class="cx"> function bp_forums_get_forum( $forum_id ) {
</span><span class="cx">         do_action( 'bbpress_init' );
</span><span class="cx">         return bb_get_forum( $forum_id );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function bp_forums_new_forum( $args = '' ) {
+        do_action( 'bbpress_init' );
+        
+        $defaults = array(
+                'forum_name' => '',
+                'forum_desc' => '',
+                'forum_parent_id' => BP_FORUMS_PARENT_FORUM_ID,
+                'forum_order' => false,
+                'forum_is_category' => 0
+        );
+
+        $r = wp_parse_args( $args, $defaults );
+        extract( $r, EXTR_SKIP );
+        
+        return bb_new_forum( array( 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
+}
+
+function bp_forums_get_forum_topicpost_count( $forum_id ) {
+        global $wpdb, $bbdb;
+        
+        do_action( 'bbpress_init' );
+
+        /* Need to find a bbPress function that does this */
+        return $wpdb->get_results( $wpdb->prepare( "SELECT topics, posts from {$bbdb->forums} WHERE forum_id = %d", $forum_id ) );
+}
+
+/* Topic Functions */
+
</ins><span class="cx"> function bp_forums_get_forum_topics( $args = '' ) {
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span><span class="lines">@@ -142,44 +171,6 @@
</span><span class="cx">         return bb_get_id_from_slug( 'topic', $topic_slug );
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function bp_forums_get_topic_posts( $args = '' ) {
-        do_action( 'bbpress_init' );
-        
-        $defaults = array(
-                'topic_id' => false,
-                'page' => 1,
-                'per_page' => 15,
-                'order' => 'ASC'
-        );
-
-        $args = wp_parse_args( $args, $defaults );
-
-        $query = new BB_Query( 'post', $args, 'get_thread' );
-        return $query->results;
-}
-
-function bp_forums_get_post( $post_id ) {
-        do_action( 'bbpress_init' );
-        return bb_get_post( $post_id );
-}
-
-function bp_forums_new_forum( $args = '' ) {
-        do_action( 'bbpress_init' );
-        
-        $defaults = array(
-                'forum_name' => '',
-                'forum_desc' => '',
-                'forum_parent_id' => BP_FORUMS_PARENT_FORUM_ID,
-                'forum_order' => false,
-                'forum_is_category' => 0
-        );
-
-        $r = wp_parse_args( $args, $defaults );
-        extract( $r, EXTR_SKIP );
-        
-        return bb_new_forum( array( 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
-}
-
</del><span class="cx"> function bp_forums_new_topic( $args = '' ) {
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span><span class="lines">@@ -299,6 +290,29 @@
</span><span class="cx">         return bb_delete_topic( $topic_id, 1 );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/* Post Functions */
+
+function bp_forums_get_topic_posts( $args = '' ) {
+        do_action( 'bbpress_init' );
+        
+        $defaults = array(
+                'topic_id' => false,
+                'page' => 1,
+                'per_page' => 15,
+                'order' => 'ASC'
+        );
+
+        $args = wp_parse_args( $args, $defaults );
+
+        $query = new BB_Query( 'post', $args, 'get_thread' );
+        return $query->results;
+}
+
+function bp_forums_get_post( $post_id ) {
+        do_action( 'bbpress_init' );
+        return bb_get_post( $post_id );
+}
+
</ins><span class="cx"> function bp_forums_delete_post( $args = '' ) {
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-classes.php (1920 => 1921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-classes.php        2009-09-22 18:01:55 UTC (rev 1920)
+++ trunk/bp-groups/bp-groups-classes.php        2009-09-22 20:45:43 UTC (rev 1921)
</span><span class="lines">@@ -322,7 +322,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 
</span><span class="cx">                 $paged_requests = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0{$pag_sql}", $group_id ) );
</span><del>-                $total_requests = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0", $group_id ) );
</del><ins>+                $total_requests = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0", $group_id ) );
</ins><span class="cx">
</span><span class="cx">                 return array( 'requests' => $paged_requests, 'total' => $total_requests );
</span><span class="cx">         }
</span><span class="lines">@@ -335,7 +335,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 
</span><span class="cx">                 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE status != 'hidden' ORDER BY date_created DESC {$pag_sql}" ) );
</span><del>-                $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->groups->table_name} WHERE status != 'hidden' ORDER BY date_created DESC", $limit ) );
</del><ins>+                $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE status != 'hidden' ORDER BY date_created DESC", $limit ) );
</ins><span class="cx">
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx">         }
</span><span class="lines">@@ -347,8 +347,8 @@
</span><span class="cx">                         $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-                $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'last_activity' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC {$pag_sql}", $limit ) );
-                $total_groups = count( $wpdb->get_results( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'last_activity' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC", $limit ) ) );
</del><ins>+                $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'last_activity' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC {$pag_sql}" ) );
+                $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(group_id) FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'last_activity' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC" ) );
</ins><span class="cx">
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx">         }
</span><span class="lines">@@ -360,21 +360,21 @@
</span><span class="cx">                         $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
</span><span class="cx">                 }
</span><span class="cx">                         
</span><del>-                $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT gm.group_id FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'total_member_count' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC {$pag_sql}", $limit ) );
-                $total_groups = count( $wpdb->get_results( $wpdb->prepare( "SELECT gm.group_id FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'total_member_count' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC", $limit ) ) );
</del><ins>+                $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT gm.group_id FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'total_member_count' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC {$pag_sql}" ) );
+                $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(gm.group_id) FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'total_member_count' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC" ) );
</ins><span class="cx">
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        function get_by_most_forum_posts( $limit = null, $page = null ) {
-                global $wpdb, $bp;
</del><ins>+        function get_by_most_forum_topics( $limit = null, $page = null ) {
+                global $wpdb, $bp, $bbdb;
</ins><span class="cx">                 
</span><span class="cx">                 if ( $limit && $page ) {
</span><span class="cx">                         $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
</span><span class="cx">                 }
</span><span class="cx">                         
</span><del>-                $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT gm.group_id FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'total_member_count' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC {$pag_sql}", $limit ) );
-                $total_groups = count( $wpdb->get_results( $wpdb->prepare( "SELECT gm.group_id FROM {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name} g WHERE g.id = gm.group_id AND g.status != 'hidden' AND gm.meta_key = 'total_member_count' ORDER BY CONVERT(gm.meta_value, SIGNED) DESC", $limit ) ) );
</del><ins>+                $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT gm.group_id FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky = '0' GROUP BY t.forum_id ORDER BY COUNT(t.topic_posts) DESC {$pag_sql}" ) );
+                $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT COUNT(gm.group_id) FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky = '0' GROUP BY t.forum_id ORDER BY COUNT(t.topic_posts) DESC" ) );
</ins><span class="cx">
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );                
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (1920 => 1921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2009-09-22 18:01:55 UTC (rev 1920)
+++ trunk/bp-groups/bp-groups-templatetags.php        2009-09-22 20:45:43 UTC (rev 1921)
</span><span class="lines">@@ -1832,9 +1832,9 @@
</span><span class="cx">                                         $this->groups = groups_get_popular( $this->pag_num, $this->pag_page );
</span><span class="cx">                                         break;        
</span><span class="cx">
</span><del>-                                case 'most-forum-posts':
-                                        $this->groups = groups_get_by_most_forum_posts( $this->pag_num, $this->pag_page );
-                                        break;                
</del><ins>+                                case 'most-forum-topics':
+                                        $this->groups = groups_get_by_most_forum_topics( $this->pag_num, $this->pag_page );
+                                        break;
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 
</span><span class="lines">@@ -2032,6 +2032,7 @@
</span><span class="cx">
</span><span class="cx">                 return apply_filters( 'bp_get_the_site_group_name', bp_get_group_name( $site_groups_template->group ) );
</span><span class="cx">         }
</span><ins>+        
</ins><span class="cx">
</span><span class="cx"> function bp_the_site_group_last_active() {
</span><span class="cx">         echo bp_get_the_site_group_last_active();
</span><span class="lines">@@ -2063,7 +2064,7 @@
</span><span class="cx">         function bp_get_the_site_group_description_excerpt() {
</span><span class="cx">                 global $site_groups_template;
</span><span class="cx">
</span><del>-                return apply_filters( 'bp_get_the_site_group_description_excerpt', bp_create_excerpt( bp_get_group_description( $site_groups_template->group, false ), 35 ) );        
</del><ins>+                return apply_filters( 'bp_get_the_site_group_description_excerpt', bp_create_excerpt( bp_get_group_description( $site_groups_template->group, false ), 25 ) );        
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx"> function bp_the_site_group_date_created() {
</span><span class="lines">@@ -2096,6 +2097,74 @@
</span><span class="cx">                 return apply_filters( 'bp_get_the_site_group_type', bp_get_group_type( $site_groups_template->group ) );
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+function bp_the_site_group_forum_topic_count( $args = '' ) {
+        echo bp_get_the_site_group_forum_topic_count( $args );
+}
+        function bp_get_the_site_group_forum_topic_count( $args = '' ) {
+                global $site_groups_template;
+
+                $defaults = array(
+                        'showtext' => false
+                );
+
+                $r = wp_parse_args( $args, $defaults );
+                extract( $r, EXTR_SKIP );
+
+                if ( !$forum_id = groups_get_groupmeta( $site_groups_template->group->id, 'forum_id' ) )
+                        return false;
+
+                if ( !function_exists( 'bp_forums_get_forum_topicpost_count' ) )
+                        return false;
+                        
+                if ( !$site_groups_template->group->forum_counts )
+                        $site_groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int)$forum_id );
+
+                if ( (bool) $showtext ) {
+                        if ( 1 == (int) $site_groups_template->group->forum_counts[0]->topics )
+                                $total_topics = sprintf( __( '%d topic'), (int) $site_groups_template->group->forum_counts[0]->topics );
+                        else
+                                $total_topics = sprintf( __( '%d topics'), (int) $site_groups_template->group->forum_counts[0]->topics );        
+                } else {
+                        $total_topics = (int) $site_groups_template->group->forum_counts[0]->topics;
+                }
+                
+                return apply_filters( 'bp_get_the_site_group_forum_topic_count', $total_topics, (bool)$showtext );
+        }
+
+function bp_the_site_group_forum_post_count( $args = '' ) {
+        echo bp_get_the_site_group_forum_post_count( $args );
+}
+        function bp_get_the_site_group_forum_post_count( $args = '' ) {
+                global $site_groups_template;
+                
+                $defaults = array(
+                        'showtext' => false
+                );
+
+                $r = wp_parse_args( $args, $defaults );
+                extract( $r, EXTR_SKIP );
+                
+                if ( !$forum_id = groups_get_groupmeta( $site_groups_template->group->id, 'forum_id' ) )
+                        return false;
+
+                if ( !function_exists( 'bp_forums_get_forum_topicpost_count' ) )
+                        return false;
+                        
+                if ( !$site_groups_template->group->forum_counts )
+                        $site_groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int)$forum_id );
+
+                if ( (bool) $showtext ) {
+                        if ( 1 == (int) $site_groups_template->group->forum_counts[0]->posts )
+                                $total_posts = sprintf( __( '%d post'), (int) $site_groups_template->group->forum_counts[0]->posts );
+                        else
+                                $total_posts = sprintf( __( '%d posts'), (int) $site_groups_template->group->forum_counts[0]->posts );        
+                } else {
+                        $total_posts = (int) $site_groups_template->group->forum_counts[0]->posts;
+                }
+                
+                return apply_filters( 'bp_get_the_site_group_forum_post_count', $total_posts, (bool)$showtext );
+        }
+
</ins><span class="cx"> function bp_the_site_group_hidden_fields() {
</span><span class="cx">         if ( isset( $_REQUEST['s'] ) ) {
</span><span class="cx">                 echo '<input type="hidden" id="search_terms" value="' . attribute_escape( $_REQUEST['s'] ) . '" name="search_terms" />';
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (1920 => 1921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2009-09-22 18:01:55 UTC (rev 1920)
+++ trunk/bp-groups.php        2009-09-22 20:45:43 UTC (rev 1921)
</span><span class="lines">@@ -1864,8 +1864,8 @@
</span><span class="cx">         return BP_Groups_Group::get_random( $limit, $page );
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function groups_get_by_most_forum_posts( $limit = null, $page = 1 ) {
-        return BP_Groups_Group::get_by_most_forum_posts( $limit, $page );
</del><ins>+function groups_get_by_most_forum_topics( $limit = null, $page = 1 ) {
+        return BP_Groups_Group::get_by_most_forum_topics( $limit, $page );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function groups_get_user_groups( $user_id = false, $pag_num = false, $pag_page = false ) {
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_inccssscreencss"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/css/screen.css (1920 => 1921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/css/screen.css        2009-09-22 18:01:55 UTC (rev 1920)
+++ trunk/bp-themes/bp-default/_inc/css/screen.css        2009-09-22 20:45:43 UTC (rev 1921)
</span><span class="lines">@@ -830,7 +830,6 @@
</span><span class="cx">         border-bottom: 1px solid #FFE8C4;
</span><span class="cx">         display: inline-block;
</span><span class="cx">         font: normal 0.9em "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif !important;
</span><del>-        max-width: 60%;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> div.avatar-block {
</span><span class="lines">@@ -1005,6 +1004,7 @@
</span><span class="cx"> .post p.date, .small, h3 span {
</span><span class="cx">         color: #888;
</span><span class="cx">         font-size: 0.95em;
</span><ins>+        margin: 5px 0 15px 0;
</ins><span class="cx"> }
</span><span class="cx">         .post p.date em {
</span><span class="cx">                 color: #f7740a;
</span><span class="lines">@@ -1658,6 +1658,34 @@
</span><span class="cx">                 border-width: 3px !important;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+div#popular-group-forum-listing {
+        overflow: hidden;
+}
+        div#popular-group-forum-listing div.group-forum {
+                width: 47%;
+                float: left;
+                min-height: 60px;
+                background: url( ../images/message_thread_back.gif ) top left repeat-x;
+                padding: 15px 1.5%;
+        }
+                div.group-forum div.item-avatar {
+                        float: left;
+                }
+                
+                div.group-forum div.item {
+                        margin-left: 70px;
+                }
+                        div.group-forum div.item div.item-title {
+                                font-size: 1.2em;
+                                font-family: Georgia, times, serif;
+                        }
+                        
+                        div.group-forum div.desc {
+                                font-size: 0.95em;
+                                color: #888;
+                                margin-top: 5px;
+                        }
+
</ins><span class="cx"> /**** FRIENDS *****************/
</span><span class="cx">
</span><span class="cx"> ul#friend-list li {
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentdirectoriesforumsindexphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/directories/forums/index.php (1920 => 1921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/directories/forums/index.php        2009-09-22 18:01:55 UTC (rev 1920)
+++ trunk/bp-themes/bp-sn-parent/directories/forums/index.php        2009-09-22 20:45:43 UTC (rev 1921)
</span><span class="lines">@@ -8,6 +8,36 @@
</span><span class="cx">         
</span><span class="cx">                         <form action="<?php echo site_url() . '/' ?>" method="post" id="forums-directory-form">
</span><span class="cx">
</span><ins>+                                <?php if ( bp_has_site_groups( 'type=most-forum-topics&max=6' ) ) : ?>
+
+                                        <div id="popular-group-forum-listing">
+                                                <h3><?php _e( 'Popular Group Forums', 'buddypress' ) ?></h3>
+        
+                                                <?php do_action( 'bp_before_directory_popular_group_forums' ) ?>                
+
+                                                <?php while ( bp_site_groups() ) : bp_the_site_group(); ?>
+
+                                                        <div class="group-forum">
+                                                                <div class="item-avatar">
+                                                                        <a href="<?php bp_the_site_group_link() ?>/forum/"><?php bp_the_site_group_avatar_thumb() ?></a>
+                                                                </div>
+
+                                                                <div class="item">
+                                                                        <div class="item-title"><a href="<?php bp_the_site_group_link() ?>/forum/"><?php bp_the_site_group_name() ?></a> (<?php bp_the_site_group_forum_topic_count( 'showtext=true' ) ?>, <?php bp_the_site_group_forum_post_count( 'showtext=true' ) ?>)</div>
+                                                                        <div class="item-meta desc"><?php bp_the_site_group_description_excerpt() ?></div>
+
+                                                                        <?php do_action( 'bp_directory_popular_group_forums_item' ) ?>
+                                                                </div>
+                                                        </div>
+
+                                                <?php endwhile; ?>
+
+                                                <?php do_action( 'bp_after_directory_popular_group_forums' ) ?>                
+        
+                                        </div>
+                                        
+                                <?php endif; ?>
+
</ins><span class="cx">                                 <div id="forums-directory-listing" class="directory-listing">
</span><span class="cx">                                         <h3><?php _e( 'Latest Forum Topics', 'buddypress' ) ?></h3>
</span><span class="cx">                                         
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentdirectoriesgroupsgroupsloopphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/directories/groups/groups-loop.php (1920 => 1921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/directories/groups/groups-loop.php        2009-09-22 18:01:55 UTC (rev 1920)
+++ trunk/bp-themes/bp-sn-parent/directories/groups/groups-loop.php        2009-09-22 20:45:43 UTC (rev 1921)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx">                                 <div class="item-title"><a href="<?php bp_the_site_group_link() ?>"><?php bp_the_site_group_name() ?></a></div>
</span><span class="cx">                                 <div class="item-meta"><span class="activity"><?php bp_the_site_group_last_active() ?></span></div>
</span><span class="cx">
</span><del>-                                <div class="item-meta desc"><?php bp_the_site_group_description() ?></div>
</del><ins>+                                <div class="item-meta desc"><?php bp_the_site_group_description_excerpt() ?></div>
</ins><span class="cx">
</span><span class="cx">                                 <?php do_action( 'bp_directory_groups_item' ) ?>
</span><span class="cx">                         </div>
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentdirectoriesgroupsindexphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/directories/groups/index.php (1920 => 1921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/directories/groups/index.php        2009-09-22 18:01:55 UTC (rev 1920)
+++ trunk/bp-themes/bp-sn-parent/directories/groups/index.php        2009-09-22 20:45:43 UTC (rev 1921)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">                                                         
</span><span class="cx">                                                                         <div class="field-name">
</span><span class="cx">                                                                                 <strong><?php _e( 'Description:', 'buddypress' ) ?></strong>
</span><del>-                                                                                <?php bp_the_site_group_description() ?>
</del><ins>+                                                                                <?php bp_the_site_group_description_excerpt() ?>
</ins><span class="cx">                                                                         </div>
</span><span class="cx">                                                                 </div>
</span><span class="cx">                                                 
</span></span></pre>
</div>
</div>
</body>
</html>