Skip to content

Commit

Permalink
Merge pull request #148 from myfossil/wall
Browse files Browse the repository at this point in the history
Wall
  • Loading branch information
woodb committed Feb 4, 2015
2 parents 62ec6aa + 85387b0 commit bdfec86
Show file tree
Hide file tree
Showing 12 changed files with 242 additions and 43 deletions.
21 changes: 16 additions & 5 deletions assets/src/js/buddypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jq(document).ready(function() {
if ($whats_new.length && bp_get_querystring('r')) {
var $member_nicename = $whats_new.val();

/*
jq('#whats-new-options').animate({
height: '40px'
});
Expand All @@ -44,6 +45,7 @@ jq(document).ready(function() {
offset: -125,
easing: 'swing'
});
*/

$whats_new.val('').focus().val($member_nicename);
}
Expand Down Expand Up @@ -96,7 +98,7 @@ jq(document).ready(function() {
height:'20px'
});
*/
jq('#aw-whats-new-submit').prop('disabled', true);
//jq('#aw-whats-new-submit').prop('disabled', true);
}
}
});
Expand Down Expand Up @@ -126,7 +128,15 @@ jq(document).ready(function() {
firstrow = jq('#buddypress ul.activity-list li').first();
activity_row = firstrow;
timestamp = null;

var post_action;

// Set custom action if available
if ( jq('#whats-new-action').length ) {
post_action = jq('#whats-new-action').val();
} else {
post_action = 'post_update';
}

// Checks if at least one activity exists
if (firstrow.length) {

Expand All @@ -147,7 +157,7 @@ jq(document).ready(function() {
}

jq.post(ajaxurl, {
action: 'post_update',
action: post_action,
'cookie': bp_get_cookies(),
'_wpnonce_post_update': jq('#_wpnonce_post_update').val(),
'content': content,
Expand All @@ -157,7 +167,6 @@ jq(document).ready(function() {
'_bp_as_nonce': jq('#_bp_as_nonce').val() || ''
},
function(response) {

form.children().each(function() {
if (jq.nodeName(this, 'textarea') || jq.nodeName(this, 'input')) {
jq(this).prop('disabled', false);
Expand Down Expand Up @@ -212,12 +221,14 @@ jq(document).ready(function() {
activity_last_recorded = 0;
}

/*
jq('#whats-new-options').animate({
height: '0px'
});
jq('#whats-new-form textarea').animate({
height: '20px'
});
*/
jq('#aw-whats-new-submit').prop('disabled', true).removeClass('loading');
});

Expand Down Expand Up @@ -1918,4 +1929,4 @@ function bp_get_cookies() {

// returns BP cookies as querystring
return encodeURIComponent(jq.param(bpCookies));
}
}
4 changes: 4 additions & 0 deletions assets/src/scss/myfossil/_myfossil.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@
* myfossil/forum
*/
@import "myfossil/forum/entry";

.current {
@extend .active;
}
1 change: 1 addition & 0 deletions buddypress-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1487,3 +1487,4 @@ function myfossil_group_creation_tabs() {

do_action( 'groups_creation_tabs' );
}

41 changes: 20 additions & 21 deletions buddypress/activity/activity-loop.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
<?php do_action('bp_before_activity_loop'); ?>

<?php if ( bp_has_activities() ) : ?>
<?php if (empty($_POST['page'])): ?>
<ul id="activity-stream" class="activity-list item-list">
<?php endif; ?>

<?php if (empty($_POST['page'])): ?>
<ul id="activity-stream" class="activity-list item-list">
<?php endif; ?>

<?php while (bp_activities()): ?>
<?php while ( bp_activities() ) : ?>
<?php bp_the_activity(); ?>
<?php bp_get_template_part('activity/entry'); ?>
<?php endwhile; ?>
<?php bp_get_template_part('activity/entry'); ?>
<?php endwhile; ?>

<?php if (bp_activity_has_more_items()): ?>
<li class="load-more">
<a href="<?php bp_activity_load_more_link() ?>"><?php _e('Load More', 'buddypress'); ?></a>
</li>
<?php endif; ?>
<?php if (bp_activity_has_more_items()): ?>
<li class="load-more">
<a href="<?php bp_activity_load_more_link() ?>"><?php _e('Load More', 'buddypress'); ?></a>
</li>
<?php endif; ?>

<?php if (empty($_POST['page'])): ?>
</ul>
<?php endif; ?>
<?php if (empty($_POST['page'])): ?>
</ul>
<?php endif; ?>
<?php else: ?>
<div id="message" class="info">
<p><?php _e('Sorry, there was no activity found. Please try a different filter.', 'buddypress'); ?></p>
</div>
<div id="message" class="info">
<p><?php _e('Sorry, there was no activity found. Please try a different filter.', 'buddypress'); ?></p>
</div>
<?php endif; ?>

<?php do_action('bp_after_activity_loop'); ?>

<?php if (empty($_POST['page'])): ?>
<form action="" name="activity-loop-form" id="activity-loop-form" method="post">
<?php wp_nonce_field('activity_filter', '_wpnonce_activity_filter'); ?>
</form>
<form action="" name="activity-loop-form" id="activity-loop-form" method="post">
<?php wp_nonce_field('activity_filter', '_wpnonce_activity_filter'); ?>
</form>
<?php endif; ?>
4 changes: 4 additions & 0 deletions buddypress/activity/post-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
<?php endif; ?>
<?php if ( bp_displayed_user_id() ) : ?>
<input type="hidden" id="whats-new-action" name="whats-new-action" value="post_to_wall" />
<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php echo bp_displayed_user_id() ?>" />
<?php endif; ?>
<div id="whats-new-user-avatar">
<?php bp_loggedin_user_avatar('width=50&height=50' ); ?>
</div>
Expand Down
10 changes: 0 additions & 10 deletions buddypress/members/single/activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,8 @@

<div class="activity" role="main">
<?php
do_action( 'bp_before_member_activity_post_form' );

if ( is_user_logged_in() && bp_is_my_profile() &&
( !bp_current_action() || bp_is_current_action( 'just-me' ) ) )
bp_get_template_part( 'activity/post-form' );

do_action( 'bp_after_member_activity_post_form' );

do_action( 'bp_before_member_activity_content' );

bp_get_template_part( 'activity/activity-loop' );

?>
</div><!-- .activity -->

Expand Down
3 changes: 3 additions & 0 deletions buddypress/members/single/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
elseif ( bp_is_current_component( 'fossils' ) ) :
bp_get_template_part( 'members/single/fossils' );

elseif ( bp_is_current_component( 'wall' ) ) :
bp_get_template_part( 'members/single/wall' );

// If nothing sticks, load a generic template
else :
bp_get_template_part( 'members/single/plugins' );
Expand Down
63 changes: 63 additions & 0 deletions buddypress/members/single/wall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/**
* BuddyPress - Users Activity
*
* @package BuddyPress
* @subpackage bp-legacy
*/
?>

<div class="row">

<div class="activity" role="main">

<?php
do_action( 'bp_before_member_activity_post_form' );

if ( bp_are_friends( bp_displayed_user_id(), bp_loggedin_user_id() ) )
bp_get_template_part( 'activity/post-form' );

do_action( 'bp_after_member_activity_post_form' );

?>

<?php if ( bp_has_activities( array(
'scope' => 'activity',
'action' => 'wall_post' ) ) ) : ?>
<?php if ( empty( $_POST['page'] ) ) : ?>
<ul id="activity-stream" class="activity-list item-list">
<?php endif; ?>

<?php while ( bp_activities() ) : ?>
<?php bp_the_activity(); ?>
<?php bp_get_template_part('activity/entry'); ?>
<?php endwhile; ?>

<?php if (bp_activity_has_more_items()): ?>
<li class="load-more">
<a href="<?php bp_activity_load_more_link() ?>"><?php _e('Load More', 'buddypress'); ?></a>
</li>
<?php endif; ?>

<?php if (empty($_POST['page'])): ?>
</ul>
<?php endif; ?>
<?php else: ?>
<div id="message" class="info">
<p><?php _e('Sorry, there was no activity found. Please try a different filter.', 'buddypress'); ?></p>
</div>
<?php endif; ?>

<?php do_action('bp_after_activity_loop'); ?>

<?php if (empty($_POST['page'])): ?>
<form action="" name="activity-loop-form" id="activity-loop-form" method="post">
<?php wp_nonce_field('activity_filter', '_wpnonce_activity_filter'); ?>
</form>
<?php endif; ?>

</div><!-- .activity -->

</div>

<?php do_action( 'bp_after_member_activity_content' ); ?>
2 changes: 1 addition & 1 deletion content-fossils-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div id="item-nav" class="container">
<div class="item-list-tabs" role="navigation">
<ul class="nav nav-tabs">
<li class="selected active">
<li class="selected current active">
<a>
<?php printf( __( 'All Fossils', 'buddypress' ) ); ?>
</a>
Expand Down
11 changes: 6 additions & 5 deletions includes/bbpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function myfossil_bbp_get_breadcrumb($r){
}



add_filter ( 'bbp_get_topic_class', 'myfossil_social_bbp_get_topic_class', 10, 2);
function myfossil_social_bbp_get_topic_class ($classes, $topic_id) {
$bbp = bbpress();
Expand Down Expand Up @@ -88,9 +87,11 @@ function myfossil_social_bbp_replies_pagination($array){


function myfossil_social_bbp_get_reply_class_modal($reply_id = 0) {
/* $bbp = bbpress();
$reply_id = bbp_get_reply_id( $reply_id );
$count = isset( $bbp->reply_query->current_post ) ? $bbp->reply_query->current_post : 1;*/
/*
* $bbp = bbpress();
* $reply_id = bbp_get_reply_id( $reply_id );
* $count = isset( $bbp->reply_query->current_post ) ? $bbp->reply_query->current_post : 1;
*/
global $myfossil_bbpress_count;
$myfossil_bbpress_count++;
$class = ( (int) $myfossil_bbpress_count % 2 ) ? 'panel-footer' : 'panel-body';
Expand Down Expand Up @@ -410,7 +411,7 @@ function myfossil_bbp_get_dropdown( $_, $args = '' ) {
$retval .= '<select name="' . $name . '" id="' . $select_id . '"' . $tab . $disabled . ' class="form-control">' . "\n";
}

$retval .= !empty( $show_none ) ? "\t<option value=\"\" class=\"level-0\">" . $show_none . '</option>' : '';
$retval .= ! empty( $show_none ) ? "\t<option value=\"\" class=\"level-0\">" . $show_none . '</option>' : '';
$retval .= walk_page_dropdown_tree( $posts, 0, $r );

if ( empty( $options_only ) )
Expand Down
5 changes: 4 additions & 1 deletion includes/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function filter_nav_item( $bp_tpl_contents ) {

// We use the word "Wall" instead of "Home"
if ( $nav_item_name == 'Home' || $nav_item_name == 'Activity' )
$nav_item_name = 'Wall';
$nav_item_name = 'Activity';

// Put it all back together
return $tpl . "<a href=\"" . $nav_item_link . "\">" . $nav_item_name . "</a></li>";
Expand Down Expand Up @@ -120,6 +120,7 @@ function filter_nav_item_no_count( $bp_tpl_contents ) {
return $tpl . "<a href=\"" . $nav_item_link . "\">" . $nav_item_name . "</a></li>";
}

add_filter( 'bp_get_options_nav', 'filter_nav_item', 10, 1 );
add_filter( 'bp_get_options_nav_public', 'filter_nav_item', 10, 1 );
add_filter( 'bp_get_options_nav_edit', 'filter_nav_item', 10, 1 );
add_filter( 'bp_get_options_nav_change-avatar', 'filter_nav_item', 10, 1 );
Expand All @@ -132,6 +133,8 @@ function filter_nav_item_no_count( $bp_tpl_contents ) {
add_filter( 'bp_get_options_nav_requests', 'filter_nav_item', 10, 1 );
add_filter( 'bp_get_options_nav_groups-my-groups', 'filter_nav_item_no_count', 10, 1 );
add_filter( 'bp_get_options_nav_invites', 'filter_nav_item', 10, 1 );
add_filter( 'bp_get_options_nav_wall', 'filter_nav_item', 10, 1 );
add_filter( 'bp_get_options_nav_fossil', 'filter_nav_item_no_count', 10, 1 );
add_filter( 'bp_get_options_nav_home', 'filter_nav_item', 10, 1 );
add_filter( 'bp_get_options_nav_members', 'filter_nav_item_no_count', 10, 1 );
add_filter( 'bp_get_options_nav_invite', 'filter_nav_item', 10, 1 );
Expand Down
Loading

0 comments on commit bdfec86

Please sign in to comment.