Changeset 2460
- Timestamp:
- 01/26/2010 05:49:48 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r2424 r2460 253 253 'item_id' => false, 254 254 'secondary_item_id' => false, 255 'recorded_time' => gmdate( "Y-m-d H:i:s" ), 255 256 'hide_sitewide' => false 256 257 ); … … 278 279 ) ); 279 280 280 return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, ' hide_sitewide' => $hide_sitewide ) );281 return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 281 282 } 282 283 -
trunk/bp-core.php
r2451 r2460 1463 1463 $last_active = __( 'not recently active', 'buddypress' ); 1464 1464 } else { 1465 if ( strstr( $last_activity_date, '-' ) ) { 1466 $last_active = bp_core_time_since( strtotime( $last_activity_date ) ); 1467 } else { 1468 $last_active = bp_core_time_since( $last_activity_date ); 1469 } 1470 1471 $last_active = sprintf( $string, $last_active ); 1465 $last_active = sprintf( $string, bp_core_time_since( $last_activity_date ) ); 1472 1466 } 1473 1467 -
trunk/bp-core/bp-core-templatetags.php
r2455 r2460 253 253 global $members_template; 254 254 255 $last_activity = attribute_escape( bp_core_get_last_activity( $members_template->member->last_activity, __( 'active %s ago', 'buddypress' )) );255 $last_activity = bp_core_get_last_activity( $members_template->member->last_activity, __( 'active %s ago', 'buddypress' ) ); 256 256 257 257 return apply_filters( 'bp_member_last_active', $last_activity ); -
trunk/bp-forums/bp-forums-templatetags.php
r2448 r2460 738 738 'mid_size' => 1 739 739 )); 740 $this->pag->total_pages = ceil($this->total_post_count / $this->pag_num); 740 741 } 741 742 … … 914 915 extract( $r, EXTR_SKIP ); 915 916 916 $links = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . $topic_template->post->id . 'edit/post/' . $topic_template->post->post_id, 'bp_forums_edit_post' ) . '">' . __( 'Edit Post', 'buddypress' ) . '</a> ' . $seperator . ' '; 917 $links .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete Post', 'buddypress' ) . '</a>'; 917 if ( $_SERVER['QUERY_STRING'] ) 918 $query_vars = '?' . $_SERVER['QUERY_STRING']; 919 920 $links = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . $topic_template->post->id . 'edit/post/' . $topic_template->post->post_id . '/' . $query_vars, 'bp_forums_edit_post' ) . '">' . __( 'Edit', 'buddypress' ) . '</a> ' . $seperator . ' '; 921 $links .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete', 'buddypress' ) . '</a> | '; 918 922 919 923 return $links; … … 950 954 <?php 951 955 } 956 957 function bp_the_topic_is_last_page() { 958 echo bp_get_the_topic_is_last_page(); 959 } 960 function bp_get_the_topic_is_last_page() { 961 global $topic_template; 962 963 return apply_filters( 'bp_get_the_topic_is_last_page', $topic_template->pag_page == $topic_template->pag->total_pages ); 964 } 952 965 953 966 function bp_directory_forums_search_form() { -
trunk/bp-friends.php
r2416 r2460 276 276 'item_id' => false, 277 277 'secondary_item_id' => false, 278 'recorded_time' => gmdate( "Y-m-d H:i:s" ), 278 279 'hide_sitewide' => false 279 280 ); … … 282 283 extract( $r, EXTR_SKIP ); 283 284 284 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, ' hide_sitewide' => $hide_sitewide ) );285 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 285 286 } 286 287 -
trunk/bp-groups.php
r2424 r2460 375 375 groups_join_group( $bp->groups->current_group->id, $bp->loggedin_user->id ); 376 376 377 if ( ! groups_new_group_forum_post( $_POST['reply_text'], $topic_id) )377 if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $_GET['topic_page'] ) ) 378 378 bp_core_add_message( __( 'There was an error when replying to that topic', 'buddypress'), 'error' ); 379 379 else … … 383 383 $query_vars = '?' . $_SERVER['QUERY_STRING']; 384 384 385 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars );385 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id ); 386 386 } 387 387 … … 522 522 check_admin_referer( 'bp_forums_edit_post' ); 523 523 524 if ( ! groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id) )524 if ( !$post_id = groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id, $_GET['topic_page'] ) ) 525 525 bp_core_add_message( __( 'There was an error when editing that post', 'buddypress'), 'error' ); 526 526 else 527 527 bp_core_add_message( __( 'The post was edited successfully', 'buddypress') ); 528 528 529 if ( $_SERVER['QUERY_STRING'] ) 530 $query_vars = '?' . $_SERVER['QUERY_STRING']; 531 529 532 do_action( 'groups_edit_forum_post', $post_id ); 530 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' );533 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id ); 531 534 } 532 535 … … 1318 1321 1319 1322 $defaults = array( 1323 'id' => false, 1320 1324 'user_id' => $bp->loggedin_user->id, 1321 1325 'action' => '', … … 1326 1330 'item_id' => false, 1327 1331 'secondary_item_id' => false, 1332 'recorded_time' => gmdate( "Y-m-d H:i:s" ), 1328 1333 'hide_sitewide' => $hide_sitewide 1329 1334 ); … … 1332 1337 extract( $r, EXTR_SKIP ); 1333 1338 1334 return bp_activity_add( array( ' user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide ) );1339 return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 1335 1340 } 1336 1341 … … 1929 1934 } 1930 1935 1931 function groups_new_group_forum_post( $post_text, $topic_id ) {1936 function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { 1932 1937 global $bp; 1933 1938 … … 1938 1943 $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id ); 1939 1944 1940 if ( $ forum_post= bp_forums_insert_post( array( 'post_text' => $post_text, 'topic_id' => $topic_id ) ) ) {1945 if ( $post_id = bp_forums_insert_post( array( 'post_text' => $post_text, 'topic_id' => $topic_id ) ) ) { 1941 1946 $topic = bp_forums_get_topic_details( $topic_id ); 1942 1947 1943 1948 $activity_action = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 1944 1949 $activity_content = '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>'; 1950 $primary_link = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/'; 1951 1952 if ( $page ) 1953 $primary_link .= "?topic_page=" . $page; 1945 1954 1946 1955 /* Record this in activity streams */ 1947 1956 groups_record_activity( array( 1948 'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_ text, &$topic, &$forum_post),1949 'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_ text, &$topic, &$forum_post),1950 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/'),1957 'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_id, $post_text, &$topic ), 1958 'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_id, $post_text, &$topic ), 1959 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', "{$primary_link}#post-{$post_id}" ), 1951 1960 'type' => 'new_forum_post', 1952 1961 'item_id' => $bp->groups->current_group->id, 1953 'secondary_item_id' => $ forum_post1962 'secondary_item_id' => $post_id 1954 1963 ) ); 1955 1964 1956 do_action( 'groups_new_forum_topic_post', $bp->groups->current_group->id, $ forum_post);1957 1958 return $ forum_post;1965 do_action( 'groups_new_forum_topic_post', $bp->groups->current_group->id, $post_id ); 1966 1967 return $post_id; 1959 1968 } 1960 1969 … … 2020 2029 'user_id' => (int)$topic->topic_poster, 2021 2030 'secondary_item_id' => $topic->topic_id, 2022 'recorded_time' => strtotime( $topic->topic_time )2031 'recorded_time' => $topic->topic_time 2023 2032 ) ); 2024 2033 2025 2034 do_action( 'groups_update_group_forum_topic', &$topic ); 2026 2035 2027 return true;2036 return $topic; 2028 2037 } 2029 2038 … … 2031 2040 } 2032 2041 2033 function groups_update_group_forum_post( $post_id, $post_text, $topic_id ) {2042 function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) { 2034 2043 global $bp; 2035 2044 … … 2042 2051 $topic = bp_forums_get_topic_details( $topic_id ); 2043 2052 2044 /* Update the activity stream item */2045 if ( function_exists( 'bp_activity_delete_by_item_id' ) )2046 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) );2047 2048 2053 $activity_action = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 2049 2054 $activity_content = '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>'; 2050 2051 /* Record this in activity streams */ 2055 $primary_link = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/'; 2056 2057 if ( $page ) 2058 $primary_link .= "?topic_page=" . $page; 2059 2060 /* Fetch an existing entry and update if one exists. */ 2061 if ( function_exists( 'bp_activity_get_activity_id' ) ) 2062 $id = bp_activity_get_activity_id( array( 'user_id' => $post->poster_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post', 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id ) ); 2063 2064 /* Update the entry in activity streams */ 2052 2065 groups_record_activity( array( 2066 'id' => $id, 2053 2067 'action' => apply_filters( 'groups_activity_new_forum_post_action', $activity_action, $post_text, &$topic, &$forum_post ), 2054 2068 'content' => apply_filters( 'groups_activity_new_forum_post_content', $activity_content, $post_text, &$topic, &$forum_post ), 2055 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group )),2069 'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', $primary_link . "#post-" . $post_id ), 2056 2070 'type' => 'new_forum_post', 2057 2071 'item_id' => (int)$bp->groups->current_group->id, 2058 2072 'user_id' => (int)$post->poster_id, 2059 2073 'secondary_item_id' => $post_id, 2060 'recorded_time' => strtotime( $post->post_time )2074 'recorded_time' => $post->post_time 2061 2075 ) ); 2062 2076 2063 2077 do_action( 'groups_update_group_forum_post', &$post, &$topic ); 2064 2078 2065 return true;2079 return $post_id; 2066 2080 } 2067 2081 -
trunk/bp-themes/bp-default/_inc/css/default.css
r2453 r2460 1530 1530 margin: 5px 0 25px 0; 1531 1531 } 1532 div.navigation.alignright {1532 .alignright { 1533 1533 float: right; 1534 } 1535 1536 div.navigation .alignleft { 1534 margin-left: 15px; 1535 } 1536 1537 .alignleft { 1537 1538 float: left; 1539 margin-right: 15px; 1538 1540 } 1539 1541 -
trunk/bp-themes/bp-default/_inc/global.js
r2449 r2460 671 671 var el = j('li.filter select'); 672 672 673 alert(el.attr('id')); 674 673 675 var page_number = 1; 674 676 var css_id = el.attr('id').split( '-' ); -
trunk/bp-themes/bp-default/groups/single/forum.php
r2455 r2460 27 27 <?php endif; ?> 28 28 29 < a name="post-new"></a>30 <h 3><?php _e( 'Post a New Topic:', 'buddypress' ) ?></h3>29 <p id="post-new"></p> 30 <h4><?php _e( 'Post a New Topic:', 'buddypress' ) ?></h4> 31 31 32 32 <label><?php _e( 'Title:', 'buddypress' ) ?></label> -
trunk/bp-themes/bp-default/groups/single/forum/topic.php
r2170 r2460 3 3 <form action="<?php bp_forum_topic_action() ?>" method="post" id="forum-topic-form" class="standard-form"> 4 4 5 <div class="pagination ">5 <div class="pagination no-ajax"> 6 6 7 7 <div id="post-count" class="pag-count"> … … 37 37 </div> 38 38 39 <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?> 40 <div class="admin-links"><?php bp_the_topic_post_admin_links() ?></div> 41 <?php endif; ?> 39 <div class="admin-links"> 40 <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?> 41 <?php bp_the_topic_post_admin_links() ?> 42 <?php endif; ?> 43 <a href="#post-<?php bp_the_topic_post_id() ?>" title="<?php _e( 'Permanent link to this post', 'buddypress' ) ?>">#</a> 44 </div> 42 45 </li> 43 46 … … 45 48 </ul> 46 49 50 <div class="pagination no-ajax"> 51 52 <div id="post-count" class="pag-count"> 53 <?php bp_the_topic_pagination_count() ?> 54 </div> 55 56 <div class="pagination-links" id="topic-pag"> 57 <?php bp_the_topic_pagination() ?> 58 </div> 59 60 </div> 61 47 62 <?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?> 48 63 49 <?php if ( bp_get_the_topic_is_ topic_open() ) : ?>64 <?php if ( bp_get_the_topic_is_last_page() ) : ?> 50 65 51 <div id="post-topic-reply"> 52 <a name="post-reply"></a> 66 <?php if ( bp_get_the_topic_is_topic_open() ) : ?> 53 67 54 <?php if ( !bp_group_is_member() ) : ?> 55 <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ) ?></p> 56 <?php endif; ?> 68 <div id="post-topic-reply"> 69 <p id="post-reply"></p> 57 70 58 <?php do_action( 'groups_forum_new_reply_before' ) ?> 71 <?php if ( !bp_group_is_member() ) : ?> 72 <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ) ?></p> 73 <?php endif; ?> 59 74 60 <p><strong><?php _e( 'Add a reply:', 'buddypress' ) ?></strong></p>75 <?php do_action( 'groups_forum_new_reply_before' ) ?> 61 76 62 <textarea name="reply_text" id="reply_text"></textarea>77 <h4><?php _e( 'Add a reply:', 'buddypress' ) ?></h4> 63 78 64 <div class="submit"> 65 <input type="submit" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'buddypress' ) ?>" /> 79 <textarea name="reply_text" id="reply_text"></textarea> 80 81 <div class="submit"> 82 <input type="submit" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'buddypress' ) ?>" /> 83 </div> 84 85 <?php do_action( 'groups_forum_new_reply_after' ) ?> 86 87 <?php wp_nonce_field( 'bp_forums_new_reply' ) ?> 66 88 </div> 67 89 68 <?php do_action( 'groups_forum_new_reply_after' )?>90 <?php else : ?> 69 91 70 <?php wp_nonce_field( 'bp_forums_new_reply' ) ?> 71 </div> 92 <div id="message" class="info"> 93 <p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ) ?></p> 94 </div> 72 95 73 <?php else : ?> 74 75 <div id="message" class="info"> 76 <p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ) ?></p> 77 </div> 96 <?php endif; ?> 78 97 79 98 <?php endif; ?> -
trunk/bp-xprofile.php
r2416 r2460 490 490 'item_id' => false, 491 491 'secondary_item_id' => false, 492 'recorded_time' => gmdate( "Y-m-d H:i:s" ), 492 493 'hide_sitewide' => false 493 494 ); … … 496 497 extract( $r, EXTR_SKIP ); 497 498 498 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, ' hide_sitewide' => $hide_sitewide ) );499 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 499 500 } 500 501
Note: See TracChangeset
for help on using the changeset viewer.