<!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] [2243] trunk: Added shortcode support to activity entries.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>2243</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-01-02 11:09:29 +0000 (Sat, 02 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Added shortcode support to activity entries.
Consolidated ajax filter functions.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityfiltersphp">trunk/bp-activity/bp-activity-filters.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incglobaljs">trunk/bp-themes/bp-default/_inc/global.js</a></li>
<li><a href="#trunkbpthemesbpdefaultforumsindexphp">trunk/bp-themes/bp-default/forums/index.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkbpthemesbpdefaultforumsforumsloopphp">trunk/bp-themes/bp-default/forums/forums-loop.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkbpthemesbpdefaultforumstopicsloopphp">trunk/bp-themes/bp-default/forums/topics-loop.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivityfiltersphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-filters.php (2242 => 2243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-filters.php        2010-01-01 17:14:00 UTC (rev 2242)
+++ trunk/bp-activity/bp-activity-filters.php        2010-01-02 11:09:29 UTC (rev 2243)
</span><span class="lines">@@ -32,6 +32,9 @@
</span><span class="cx">
</span><span class="cx"> add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' );
</span><span class="cx">
</span><ins>+/* Allow shortcodes in activity posts */
+add_filter( 'bp_get_activity_content', 'do_shortcode' );
+
</ins><span class="cx"> function bp_activity_filter_kses( $content ) {
</span><span class="cx">         global $allowedtags;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (2242 => 2243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2010-01-01 17:14:00 UTC (rev 2242)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2010-01-02 11:09:29 UTC (rev 2243)
</span><span class="lines">@@ -9,19 +9,19 @@
</span><span class="cx"> * your own _inc/ajax.php file and add/remove AJAX functionality as you see fit.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-function bp_dtheme_members_filter() {
</del><ins>+function bp_dtheme_content_filter() {
</ins><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        $type = $_POST['type'];
-        $filter = $_POST['filter'];
-        $page = $_POST['page'];
-        $search_terms = $_POST['search_terms'];
</del><ins>+        $content = esc_attr( $_POST['content'] );
+        $type = esc_attr( $_POST['type'] );
+        $filter = esc_attr( $_POST['filter'] );
+        $page = esc_attr( $_POST['page'] );
+        $search_terms = esc_attr( $_POST['search_terms'] );
</ins><span class="cx">
</span><span class="cx">         if ( __( 'Search anything...', 'buddypress' ) == $search_terms || 'false' == $search_terms )
</span><span class="cx">                 $search_terms = false;
</span><span class="cx">
</span><span class="cx">         /* Build the querystring */
</span><del>-
</del><span class="cx">         /* Sort out type ordering */
</span><span class="cx">         if ( 'active' != $filter && 'newest' != $filter && 'popular' != $filter && 'online' != $filter && 'alphabetical' != $filter )
</span><span class="cx">                 $filter = 'active';
</span><span class="lines">@@ -31,136 +31,25 @@
</span><span class="cx">         if ( $search_terms )
</span><span class="cx">                 $bp->ajax_querystring .= '&search_terms=' . $search_terms;
</span><span class="cx">
</span><del>-        if ( !$type || ( 'all' != $type && 'friends' != $type ) )
</del><ins>+        if ( !$type )
</ins><span class="cx">                 $type = 'all';
</span><span class="cx">
</span><del>-        if ( ( 'friends' == $type ) && !is_user_logged_in() )
</del><ins>+        if ( ( 'all' != $type ) && !is_user_logged_in() )
</ins><span class="cx">                 $filter = 'all';
</span><span class="cx">
</span><del>-        if ( 'friends' == $type || $bp->displayed_user->id ) {
</del><ins>+        if ( 'all' != $type || $bp->displayed_user->id ) {
</ins><span class="cx">                 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
</span><span class="cx">                 $bp->ajax_querystring .= '&user_id=' . $user_id;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         $bp->is_directory = true;
</span><del>-        locate_template( array( 'members/members-loop.php' ), true );
</del><ins>+        locate_template( array( "$content/$content-loop.php" ), true );
</ins><span class="cx"> }
</span><del>-add_action( 'wp_ajax_members_filter', 'bp_dtheme_members_filter' );
</del><ins>+add_action( 'wp_ajax_members_filter', 'bp_dtheme_content_filter' );
+add_action( 'wp_ajax_groups_filter', 'bp_dtheme_content_filter' );
+add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_content_filter' );
+add_action( 'wp_ajax_forums_filter', 'bp_dtheme_content_filter' );
</ins><span class="cx">
</span><del>-function bp_dtheme_groups_filter() {
-        global $bp;
-
-        $type = $_POST['type'];
-        $filter = $_POST['filter'];
-        $page = $_POST['page'];
-        $search_terms = $_POST['search_terms'];
-
-        if ( __( 'Search anything...', 'buddypress' ) == $search_terms || 'false' == $search_terms )
-                $search_terms = false;
-
-        /* Build the querystring */
-
-        /* Sort out type ordering */
-        if ( 'active' != $filter && 'newest' != $filter && 'popular' != $filter && 'online' != $filter && 'alphabetical' != $filter )
-                $type = 'active';
-
-        $bp->ajax_querystring = 'type=' . $filter . '&page=' . $page;
-
-        if ( $search_terms )
-                $bp->ajax_querystring .= '&search_terms=' . $search_terms;
-
-        if ( !$type || ( 'all' != $type && 'mygroups' != $type ) )
-                $type = 'all';
-
-        if ( ( 'mygroups' == $type ) && !is_user_logged_in() )
-                $type = 'all';
-
-        if ( 'mygroups' == $type || $bp->displayed_user->id ) {
-                $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
-                $bp->ajax_querystring .= '&user_id=' . $user_id;
-        }
-
-        $bp->is_directory = true;
-        locate_template( array( 'groups/groups-loop.php' ), true );
-}
-add_action( 'wp_ajax_groups_filter', 'bp_dtheme_groups_filter' );
-
-function bp_dtheme_blogs_filter() {
-        global $bp;
-
-        $type = $_POST['type'];
-        $filter = $_POST['filter'];
-        $page = $_POST['page'];
-        $search_terms = $_POST['search_terms'];
-
-        if ( __( 'Search anything...', 'buddypress' ) == $search_terms || 'false' == $search_terms )
-                $search_terms = false;
-
-        /* Build the querystring */
-
-        /* Sort out type ordering */
-        if ( 'active' != $filter && 'newest' != $filter && 'alphabetical' != $filter )
-                $type = 'active';
-
-        $bp->ajax_querystring = 'type=' . $filter . '&page=' . $page;
-
-        if ( $search_terms )
-                $bp->ajax_querystring .= '&search_terms=' . $search_terms;
-
-        if ( !$type || ( 'all' != $type && 'myblogs' != $type ) )
-                $type = 'all';
-
-        if ( ( 'myblogs' == $type ) && !is_user_logged_in() )
-                $type = 'all';
-
-        if ( 'myblogs' == $type || $bp->displayed_user->id ) {
-                $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
-                $bp->ajax_querystring .= '&user_id=' . $user_id;
-        }
-
-        $bp->is_directory = true;
-        locate_template( array( 'blogs/blogs-loop.php' ), true );
-}
-add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_blogs_filter' );
-
-function bp_dtheme_forums_filter() {
-        global $bp;
-
-        $type = $_POST['type'];
-        $filter = $_POST['filter'];
-        $page = $_POST['page'];
-        $search_terms = $_POST['search_terms'];
-
-        if ( __( 'Search anything...', 'buddypress' ) == $search_terms || 'false' == $search_terms )
-                $search_terms = false;
-
-        /* Build the querystring */
-
-        /* Sort out type ordering */
-        if ( 'active' != $filter && 'popular' != $filter && 'unreplied' != $filter )
-                $type = 'active';
-
-        $bp->ajax_querystring = 'type=' . $filter . '&page=' . $page;
-
-        if ( $search_terms )
-                $bp->ajax_querystring .= '&search_terms=' . $search_terms;
-
-        if ( !$type || ( 'all' != $type && 'mytopics' != $type ) )
-                $type = 'all';
-
-        if ( ( 'mytopics' == $type ) && !is_user_logged_in() )
-                $type = 'all';
-
-        if ( 'mytopics' == $type || $bp->displayed_user->id ) {
-                $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
-                $bp->ajax_querystring .= '&user_id=' . $user_id;
-        }
-
-        $bp->is_directory = true;
-        locate_template( array( 'forums/topics-loop.php' ), true );
-}
-add_action( 'wp_ajax_forums_filter', 'bp_dtheme_forums_filter' );
-
</del><span class="cx"> function bp_dtheme_post_update() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incglobaljs"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/global.js (2242 => 2243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2010-01-01 17:14:00 UTC (rev 2242)
+++ trunk/bp-themes/bp-default/_inc/global.js        2010-01-02 11:09:29 UTC (rev 2243)
</span><span class="lines">@@ -518,6 +518,7 @@
</span><span class="cx">                         'type': type,
</span><span class="cx">                         'filter': filter,
</span><span class="cx">                         'page': page,
</span><ins>+                        'content': id,
</ins><span class="cx">                         'search_terms': search_terms
</span><span class="cx">                 },
</span><span class="cx">                 function(response)
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultforumsforumsloopphp"></a>
<div class="addfile"><h4>Added: trunk/bp-themes/bp-default/forums/forums-loop.php (0 => 2243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/forums/forums-loop.php         (rev 0)
+++ trunk/bp-themes/bp-default/forums/forums-loop.php        2010-01-02 11:09:29 UTC (rev 2243)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+<?php if ( bp_has_forum_topics( bp_ajax_querystring() ) ) : ?>
+
+        <div class="pagination">
+
+                <div id="post-count" class="pag-count">
+                        <?php if ( bp_is_group_forum() && is_user_logged_in() ) : ?>
+                                <a href="#post-new" class="button"><?php _e( 'New Topic', 'buddypress' ) ?></a> &nbsp;
+                        <?php endif; ?>
+
+                        <?php bp_forum_pagination_count() ?>
+                </div>
+
+                <div class="pagination-links" id="topic-pag">
+                        <?php bp_forum_pagination() ?>
+                </div>
+
+        </div>
+
+        <?php do_action( 'bp_before_directory_forums_list' ) ?>
+
+        <table class="forum">
+
+                <tr>
+                        <th id="th-title"><?php _e( 'Topic Title', 'buddypress' ) ?></th>
+                        <th id="th-poster"><?php _e( 'Latest Poster', 'buddypress' ) ?></th>
+
+                        <?php if ( !bp_is_group_forum() ) : ?>
+                                <th id="th-group"><?php _e( 'Posted In Group', 'buddypress' ) ?></th>
+                        <?php endif; ?>
+
+                        <th id="th-postcount"><?php _e( 'Posts', 'buddypress' ) ?></th>
+                        <th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ) ?></th>
+                </tr>
+
+                <?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?>
+
+                <tr class="<?php bp_the_topic_css_class() ?>">
+                        <td class="td-title">
+                                <a class="topic-title" href="<?php bp_the_topic_permalink() ?>" title="<?php bp_the_topic_title() ?> - <?php _e( 'Permalink', 'buddypress' ) ?>">
+                                        <?php bp_the_topic_title() ?>
+                                </a>
+                        </td>
+                        <td class="td-poster">
+                                <a href="<?php bp_the_topic_permalink() ?>"><?php bp_the_topic_last_poster_avatar( 'type=thumb&width=20&height=20' ) ?></a>
+                                <div class="poster-name"><?php bp_the_topic_last_poster_name() ?></div>
+                        </td>
+
+                        <?php if ( !bp_is_group_forum() ) : ?>
+                                <td class="td-group">
+                                        <a href="<?php bp_the_topic_object_permalink() ?>"><?php bp_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) ?></a>
+                                        <div class="object-name"><a href="<?php bp_the_topic_object_permalink() ?>" title="<?php bp_the_topic_object_name() ?>"><?php bp_the_topic_object_name() ?></a></div>
+                                </td>
+                        <?php endif; ?>
+
+                        <td class="td-postcount">
+                                <?php bp_the_topic_total_posts() ?>
+                        </td>
+                        <td class="td-freshness">
+                                <?php bp_the_topic_time_since_last_post() ?>
+                        </td>
+
+                        <?php do_action( 'bp_directory_forums_extra_cell' ) ?>
+                </tr>
+
+                <?php do_action( 'bp_directory_forums_extra_row' ) ?>
+
+                <?php endwhile; ?>
+
+        </table>
+
+        <?php do_action( 'bp_after_directory_forums_list' ) ?>
+
+<?php else: ?>
+
+        <div id="message" class="info">
+                <p><?php _e( 'Sorry, there were no forum topics found.', 'buddypress' ) ?></p>
+        </div>
+
+<?php endif;?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultforumsindexphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/forums/index.php (2242 => 2243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/forums/index.php        2010-01-01 17:14:00 UTC (rev 2242)
+++ trunk/bp-themes/bp-default/forums/index.php        2010-01-02 11:09:29 UTC (rev 2243)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">                         </div>
</span><span class="cx">
</span><span class="cx">                         <div id="forums-dir-list" class="forums dir-list">
</span><del>-                                <?php /* 'forums/topic-loop.php' is loaded here via AJAX */ ?>
</del><ins>+                                <?php /* 'forums/forums-loop.php' is loaded here via AJAX */ ?>
</ins><span class="cx">                         </div>
</span><span class="cx">
</span><span class="cx">                         <?php do_action( 'bp_directory_groups_content' ) ?>
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultforumstopicsloopphp"></a>
<div class="delfile"><h4>Deleted: trunk/bp-themes/bp-default/forums/topics-loop.php (2242 => 2243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/forums/topics-loop.php        2010-01-01 17:14:00 UTC (rev 2242)
+++ trunk/bp-themes/bp-default/forums/topics-loop.php        2010-01-02 11:09:29 UTC (rev 2243)
</span><span class="lines">@@ -1,79 +0,0 @@
</span><del>-<?php if ( bp_has_forum_topics( bp_ajax_querystring() ) ) : ?>
-
-        <div class="pagination">
-
-                <div id="post-count" class="pag-count">
-                        <?php if ( bp_is_group_forum() && is_user_logged_in() ) : ?>
-                                <a href="#post-new" class="button"><?php _e( 'New Topic', 'buddypress' ) ?></a> &nbsp;
-                        <?php endif; ?>
-
-                        <?php bp_forum_pagination_count() ?>
-                </div>
-
-                <div class="pagination-links" id="topic-pag">
-                        <?php bp_forum_pagination() ?>
-                </div>
-
-        </div>
-
-        <?php do_action( 'bp_before_directory_forums_list' ) ?>
-
-        <table class="forum">
-
-                <tr>
-                        <th id="th-title"><?php _e( 'Topic Title', 'buddypress' ) ?></th>
-                        <th id="th-poster"><?php _e( 'Latest Poster', 'buddypress' ) ?></th>
-
-                        <?php if ( !bp_is_group_forum() ) : ?>
-                                <th id="th-group"><?php _e( 'Posted In Group', 'buddypress' ) ?></th>
-                        <?php endif; ?>
-
-                        <th id="th-postcount"><?php _e( 'Posts', 'buddypress' ) ?></th>
-                        <th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ) ?></th>
-                </tr>
-
-                <?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?>
-
-                <tr class="<?php bp_the_topic_css_class() ?>">
-                        <td class="td-title">
-                                <a class="topic-title" href="<?php bp_the_topic_permalink() ?>" title="<?php bp_the_topic_title() ?> - <?php _e( 'Permalink', 'buddypress' ) ?>">
-                                        <?php bp_the_topic_title() ?>
-                                </a>
-                        </td>
-                        <td class="td-poster">
-                                <a href="<?php bp_the_topic_permalink() ?>"><?php bp_the_topic_last_poster_avatar( 'type=thumb&width=20&height=20' ) ?></a>
-                                <div class="poster-name"><?php bp_the_topic_last_poster_name() ?></div>
-                        </td>
-
-                        <?php if ( !bp_is_group_forum() ) : ?>
-                                <td class="td-group">
-                                        <a href="<?php bp_the_topic_object_permalink() ?>"><?php bp_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) ?></a>
-                                        <div class="object-name"><a href="<?php bp_the_topic_object_permalink() ?>" title="<?php bp_the_topic_object_name() ?>"><?php bp_the_topic_object_name() ?></a></div>
-                                </td>
-                        <?php endif; ?>
-
-                        <td class="td-postcount">
-                                <?php bp_the_topic_total_posts() ?>
-                        </td>
-                        <td class="td-freshness">
-                                <?php bp_the_topic_time_since_last_post() ?>
-                        </td>
-
-                        <?php do_action( 'bp_directory_forums_extra_cell' ) ?>
-                </tr>
-
-                <?php do_action( 'bp_directory_forums_extra_row' ) ?>
-
-                <?php endwhile; ?>
-
-        </table>
-
-        <?php do_action( 'bp_after_directory_forums_list' ) ?>
-
-<?php else: ?>
-
-        <div id="message" class="info">
-                <p><?php _e( 'Sorry, there were no forum topics found.', 'buddypress' ) ?></p>
-        </div>
-
-<?php endif;?>
</del><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>