Changeset 10587
- Timestamp:
- 02/13/2016 07:32:53 PM (9 years ago)
- Location:
- trunk/src/bp-friends
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-actions.php
r10417 r10587 17 17 /** 18 18 * Catch and process friendship requests. 19 * 20 * @since 1.0.1 19 21 */ 20 22 function friends_action_add_friend() { … … 55 57 /** 56 58 * Catch and process Remove Friendship requests. 59 * 60 * @since 1.0.1 57 61 */ 58 62 function friends_action_remove_friend() { -
trunk/src/bp-friends/bp-friends-activity.php
r10563 r10587 19 19 * A wrapper for {@link bp_activity_add()} that provides some Friends-specific 20 20 * defaults. 21 * 22 * @since 1.0.0 21 23 * 22 24 * @see bp_activity_add() for more detailed description of parameters and … … 57 59 * Delete an activity item related to the Friends component. 58 60 * 61 * @since 1.0.0 62 * 59 63 * @param array $args { 60 64 * An array of arguments for the item to delete. … … 83 87 /** 84 88 * Register the activity actions for bp-friends. 89 * 90 * @since 1.1.0 85 91 */ 86 92 function friends_register_activity_actions() { … … 291 297 * @param array $retval Empty array by default. 292 298 * @param array $filter Current activity arguments. 293 *294 299 * @return array 295 300 */ -
trunk/src/bp-friends/bp-friends-cache.php
r10417 r10587 16 16 /** 17 17 * Clear friends-related cache for members of a specific friendship. 18 * 19 * @since 1.0.0 18 20 * 19 21 * @param int $friendship_id ID of the friendship whose two members should -
trunk/src/bp-friends/bp-friends-functions.php
r10417 r10587 18 18 /** 19 19 * Create a new friendship. 20 * 21 * @since 1.0.0 20 22 * 21 23 * @param int $initiator_userid ID of the "initiator" user (the user who is … … 91 93 * Will also delete the related "friendship_accepted" activity item. 92 94 * 95 * @since 1.0.0 96 * 93 97 * @param int $initiator_userid ID of the friendship initiator. 94 98 * @param int $friend_userid ID of the friend user. … … 152 156 * 153 157 * Also initiates a "friendship_accepted" activity item. 158 * 159 * @since 1.0.0 154 160 * 155 161 * @param int $friendship_id ID of the pending friendship object. … … 188 194 * Mark a friendship request as rejected. 189 195 * 196 * @since 1.0.0 197 * 190 198 * @param int $friendship_id ID of the pending friendship object. 191 199 * @return bool True on success, false on failure. … … 214 222 * Withdraw a friendship request. 215 223 * 224 * @since 1.6.0 225 * 216 226 * @param int $initiator_userid ID of the friendship initiator - this is the 217 227 * user who requested the friendship, and is doing the withdrawing. … … 247 257 * Check whether two users are friends. 248 258 * 259 * @since 1.0.0 260 * 249 261 * @param int $user_id ID of the first user. 250 262 * @param int $possible_friend_id ID of the other user. … … 263 275 * 264 276 * Will return 'is_friends', 'not_friends', 'pending' or 'awaiting_response'. 277 * 278 * @since 1.2.0 265 279 * 266 280 * @param int $user_id ID of the first user. … … 285 299 * Get the friend count of a given user. 286 300 * 301 * @since 1.2.0 302 * 287 303 * @param int $user_id ID of the user whose friends are being counted. 288 304 * @return int Friend count of the user. … … 309 325 * Check whether a given user has any friends. 310 326 * 327 * @since 1.0.0 328 * 311 329 * @param int $user_id ID of the user whose friends are being checked. 312 330 * @return bool True if the user has friends, otherwise false. … … 326 344 /** 327 345 * Get the ID of two users' friendship, if it exists. 346 * 347 * @since 1.2.0 328 348 * 329 349 * @param int $initiator_user_id ID of the first user. … … 337 357 /** 338 358 * Get the IDs of a given user's friends. 359 * 360 * @since 1.0.0 339 361 * 340 362 * @param int $user_id ID of the user whose friends are being retrieved. … … 352 374 /** 353 375 * Search the friends of a user by a search string. 376 * 377 * @since 1.0.0 354 378 * 355 379 * @param string $search_terms The search string, matched against xprofile fields (if … … 372 396 * Get a list of IDs of users who have requested friendship of a given user. 373 397 * 398 * @since 1.2.0 399 * 374 400 * @param int $user_id The ID of the user who has received the friendship requests. 375 401 * @return array|bool An array of user IDs, or false if none are found. … … 381 407 /** 382 408 * Get a user's most recently active friends. 409 * 410 * @since 1.0.0 383 411 * 384 412 * @see BP_Core_User::get_users() for a description of return value. … … 411 439 * Get a user's friends, in alphabetical order. 412 440 * 441 * @since 1.0.0 442 * 413 443 * @see BP_Core_User::get_users() for a description of return value. 414 444 * … … 440 470 * Get a user's friends, in the order in which they joined the site. 441 471 * 472 * @since 1.0.0 473 * 442 474 * @see BP_Core_User::get_users() for a description of return value. 443 475 * … … 469 501 * Get the last active date of many users at once. 470 502 * 503 * @since 1.0.0 504 * 471 505 * @see BP_Friends_Friendship::get_bulk_last_active() for a description of 472 506 * arguments and return value. … … 578 612 * - users who have been banned from the group 579 613 * 614 * @since 1.0.0 615 * 580 616 * @param int $user_id ID of the user whose friends are being counted. 581 617 * @param int $group_id ID of the group friends are being invited to. … … 589 625 * Get a total friend count for a given user. 590 626 * 627 * @since 1.0.0 628 * 591 629 * @param int $user_id Optional. ID of the user whose friendships you are 592 630 * counting. Default: displayed user (if any), otherwise logged-in user. … … 599 637 /** 600 638 * Return a list of a user's friends, filtered by a search term. 639 * 640 * @since 1.0.0 601 641 * 602 642 * @param string $search_terms Search term to filter on. … … 625 665 * Has a friendship been confirmed (accepted)? 626 666 * 667 * @since 1.0.0 668 * 627 669 * @param int $friendship_id The ID of the friendship being checked. 628 670 * @return bool True if the friendship is confirmed, otherwise false. … … 639 681 * friendship event (acceptance, deletion), call this function to regenerate 640 682 * the cached values. 683 * 684 * @since 1.0.0 641 685 * 642 686 * @param int $initiator_user_id ID of the first user. … … 666 710 * - Notifications of friendship requests sent by the user. 667 711 * 712 * @since 1.0.0 713 * 668 714 * @param int $user_id ID of the user whose friend data is being removed. 669 715 */ … … 701 747 * 702 748 * This is intended to speed up @mentions lookups for a majority of use cases. 749 * 750 * @since 2.1.0 703 751 * 704 752 * @see bp_activity_mentions_script() -
trunk/src/bp-friends/bp-friends-loader.php
r10519 r10587 17 17 /** 18 18 * Set up the bp-forums component. 19 * 20 * @since 1.6.0 19 21 */ 20 22 function bp_setup_friends() { -
trunk/src/bp-friends/bp-friends-notifications.php
r10479 r10587 22 22 * the user of whom friendship has been requested ($friend_id). 23 23 * 24 * @since 1.0 24 * @since 1.0.0 25 25 * 26 26 * @param int $friendship_id ID of the friendship object. … … 53 53 * sent to the user who requested the friendship ($initiator_id). 54 54 * 55 * @since 1.0 55 * @since 1.0.0 56 56 * 57 57 * @param int $friendship_id ID of the friendship object. … … 81 81 /** 82 82 * Notification formatting callback for bp-friends notifications. 83 * 84 * @since 1.0.0 83 85 * 84 86 * @param string $action The kind of notification being rendered. … … 177 179 /** 178 180 * Clear friend-related notifications when ?new=1 181 * 182 * @since 1.2.0 179 183 */ 180 184 function friends_clear_friend_notifications() { -
trunk/src/bp-friends/bp-friends-screens.php
r10417 r10587 17 17 /** 18 18 * Catch and process the My Friends page. 19 * 20 * @since 1.0.0 19 21 */ 20 22 function friends_screen_my_friends() { … … 39 41 /** 40 42 * Catch and process the Requests page. 43 * 44 * @since 1.0.0 41 45 */ 42 46 function friends_screen_requests() { … … 94 98 /** 95 99 * Add Friends-related settings to the Settings > Notifications page. 100 * 101 * @since 1.0.0 96 102 */ 97 103 function friends_screen_notification_settings() { -
trunk/src/bp-friends/bp-friends-template.php
r10424 r10587 219 219 /** 220 220 * Output the friend count for the current member in the loop. 221 * 222 * @since 1.2.0 221 223 */ 222 224 function bp_member_total_friend_count() { … … 227 229 * 228 230 * Return value is a string of the form "x friends". 231 * 232 * @since 1.2.0 229 233 * 230 234 * @return string A string of the form "x friends". … … 254 258 * Output the ID of the current user in the friend request loop. 255 259 * 260 * @since 1.2.6 261 * 256 262 * @see bp_get_potential_friend_id() for a description of arguments. 257 263 * … … 263 269 /** 264 270 * Return the ID of current user in the friend request loop. 271 * 272 * @since 1.2.6 265 273 * 266 274 * @global object $friends_template … … 293 301 * Returns - 'is_friend', 'not_friends', 'pending'. 294 302 * 303 * @since 1.2.6 304 * 295 305 * @param int $user_id ID of the potential friend. Default: the value of 296 306 * {@link bp_get_potential_friend_id()}. … … 321 331 * Output the Add Friend button. 322 332 * 333 * @since 1.0.0 334 * 323 335 * @see bp_get_add_friend_button() for information on arguments. 324 336 * … … 331 343 /** 332 344 * Create the Add Friend button. 345 * 346 * @since 1.1.0 333 347 * 334 348 * @param int $potential_friend_id ID of the user to whom the button … … 430 444 * Get a comma-separated list of IDs of a user's friends. 431 445 * 446 * @since 1.2.0 447 * 432 448 * @param int $user_id Optional. Default: the displayed user's ID, or the 433 449 * logged-in user's ID. … … 454 470 * because of the structure of the $include parameter in bp_has_members(). 455 471 * 472 * @since 1.2.0 473 * 456 474 * @param int $user_id ID of the user whose requests are being retrieved. 457 475 * Defaults to displayed user. … … 487 505 /** 488 506 * Output the ID of the friendship between the logged-in user and the current user in the loop. 507 * 508 * @since 1.2.0 489 509 */ 490 510 function bp_friend_friendship_id() { … … 493 513 /** 494 514 * Return the ID of the friendship between the logged-in user and the current user in the loop. 515 * 516 * @since 1.2.0 495 517 * 496 518 * @return int ID of the friendship. … … 516 538 /** 517 539 * Output the URL for accepting the current friendship request in the loop. 540 * 541 * @since 1.0.0 518 542 */ 519 543 function bp_friend_accept_request_link() { … … 522 546 /** 523 547 * Return the URL for accepting the current friendship request in the loop. 548 * 549 * @since 1.0.0 524 550 * 525 551 * @return string accept-friendship URL. … … 545 571 /** 546 572 * Output the URL for rejecting the current friendship request in the loop. 573 * 574 * @since 1.0.0 547 575 */ 548 576 function bp_friend_reject_request_link() { … … 551 579 /** 552 580 * Return the URL for rejecting the current friendship request in the loop. 581 * 582 * @since 1.0.0 553 583 * 554 584 * @return string reject-friendship URL. … … 575 605 * Output the total friend count for a given user. 576 606 * 607 * @since 1.2.0 608 * 577 609 * @param int $user_id See {@link friends_get_total_friend_count()}. 578 610 */ … … 583 615 * Return the total friend count for a given user. 584 616 * 617 * @since 1.2.0 618 * 585 619 * @param int $user_id See {@link friends_get_total_friend_count()}. 586 620 * @return int Total friend count. … … 602 636 * Output the total friendship request count for a given user. 603 637 * 638 * @since 1.2.0 639 * 604 640 * @see bp_friend_get_total_requests_count() for description of arguments. 605 641 * … … 611 647 /** 612 648 * Return the total friendship request count for a given user. 649 * 650 * @since 1.2.0 613 651 * 614 652 * @param int $user_id ID of the user whose requests are being counted. -
trunk/src/bp-friends/classes/class-bp-core-friends-widget.php
r10553 r10587 20 20 /** 21 21 * Class constructor. 22 * 23 * @since 1.9.0 22 24 */ 23 25 function __construct() { … … 32 34 /** 33 35 * Display the widget. 36 * 37 * @since 1.9.0 34 38 * 35 39 * @param array $args Widget arguments. … … 139 143 * Process a widget save. 140 144 * 145 * @since 1.9.0 146 * 141 147 * @param array $new_instance The parameters saved by the user. 142 148 * @param array $old_instance The parameters as previously saved to the database. … … 155 161 /** 156 162 * Render the widget edit form. 163 * 164 * @since 1.9.0 157 165 * 158 166 * @param array $instance The saved widget settings. -
trunk/src/bp-friends/classes/class-bp-friends-component.php
r10555 r10587 15 15 /** 16 16 * Defines the BuddyPress Friends Component. 17 * 18 * @since 1.5.0 17 19 */ 18 20 class BP_Friends_Component extends BP_Component { … … 36 38 /** 37 39 * Include bp-friends files. 40 * 41 * @since 1.5.0 38 42 * 39 43 * @see BP_Component::includes() for description of parameters. … … 226 230 /** 227 231 * Set up the title for pages and <title>. 232 * 233 * @since 1.5.0 228 234 */ 229 235 public function setup_title() { -
trunk/src/bp-friends/classes/class-bp-friends-friendship.php
r10424 r10587 13 13 /** 14 14 * BuddyPress Friendship object. 15 * 16 * @since 1.0.0 15 17 */ 16 18 class BP_Friends_Friendship { … … 19 21 * ID of the friendship. 20 22 * 23 * @since 1.0.0 21 24 * @var int 22 25 */ … … 26 29 * User ID of the friendship initiator. 27 30 * 31 * @since 1.0.0 28 32 * @var int 29 33 */ … … 33 37 * User ID of the 'friend' - the one invited to the friendship. 34 38 * 39 * @since 1.0.0 35 40 * @var int 36 41 */ … … 40 45 * Has the friendship been confirmed/accepted? 41 46 * 47 * @since 1.0.0 42 48 * @var int 43 49 */ … … 49 55 * Not currently used by BuddyPress. 50 56 * 57 * @since 1.0.0 51 58 * @var int 52 59 */ … … 56 63 * Date the friendship was created. 57 64 * 65 * @since 1.0.0 58 66 * @var string 59 67 */ … … 65 73 * Not currently used in BuddyPress. 66 74 * 75 * @since 1.0.0 67 76 * @var bool 68 77 */ … … 72 81 * Should additional friend details be queried? 73 82 * 83 * @since 1.0.0 74 84 * @var bool 75 85 */ … … 79 89 * Details about the friend. 80 90 * 91 * @since 1.0.0 81 92 * @var BP_Core_User 82 93 */ … … 85 96 /** 86 97 * Constructor method. 98 * 99 * @since 1.5.0 87 100 * 88 101 * @param int|null $id Optional. The ID of an existing friendship. … … 102 115 /** 103 116 * Set up data about the current friendship. 117 * 118 * @since 1.0.0 104 119 */ 105 120 public function populate() { … … 127 142 /** 128 143 * Save the current friendship to the database. 144 * 145 * @since 1.0.0 129 146 * 130 147 * @return bool True on success, false on failure. … … 175 192 * Delete the current friendship from the database. 176 193 * 194 * @since 1.0.0 195 * 177 196 * @return bool|int 178 197 */ … … 189 208 /** 190 209 * Get the IDs of a given user's friends. 210 * 211 * @since 1.0.0 191 212 * 192 213 * @param int $user_id ID of the user whose friends are being retrieved. … … 227 248 * Get the ID of the friendship object, if any, between a pair of users. 228 249 * 250 * @since 1.0.0 251 * 229 252 * @param int $user_id The ID of the first user. 230 253 * @param int $friend_id The ID of the second user. … … 242 265 * Get a list of IDs of users who have requested friendship of a given user. 243 266 * 267 * @since 1.2.0 268 * 244 269 * @param int $user_id The ID of the user who has received the 245 270 * friendship requests. … … 264 289 /** 265 290 * Get a total friend count for a given user. 291 * 292 * @since 1.0.0 266 293 * 267 294 * @param int $user_id Optional. ID of the user whose friendships you … … 296 323 /** 297 324 * Search the friends of a user by a search string. 325 * 326 * @since 1.0.0 298 327 * 299 328 * @param string $filter The search string, matched against xprofile … … 303 332 * @param int|null $page Optional. The page of results to return. Default: 304 333 * null (no pagination - return all results). 305 *306 334 * @return array|bool On success, an array: { 307 335 * @type array $friends IDs of friends returned by the query. … … 364 392 * while 'awaiting_response' is the other way around ($possible_friend_userid 365 393 * sent the initial request). 394 * 395 * @since 1.0.0 366 396 * 367 397 * @param int $initiator_userid The ID of the user who is the initiator … … 401 431 * @todo Why is this in the Friends component? 402 432 * 433 * @since 1.0.0 434 * 403 435 * @param array $user_ids IDs of users whose last_active meta is 404 436 * being queried. … … 434 466 * Mark a friendship as accepted. 435 467 * 468 * @since 1.0.0 469 * 436 470 * @param int $friendship_id ID of the friendship to be accepted. 437 471 * @return int Number of database rows updated. … … 448 482 * Remove a friendship or a friendship request INITIATED BY the logged-in user. 449 483 * 484 * @since 1.6.0 485 * 450 486 * @param int $friendship_id ID of the friendship to be withdrawn. 451 487 * @return int Number of database rows deleted. … … 462 498 * Remove a friendship or a friendship request MADE OF the logged-in user. 463 499 * 500 * @since 1.0.0 501 * 464 502 * @param int $friendship_id ID of the friendship to be rejected. 465 503 * @return int Number of database rows deleted. … … 477 515 * 478 516 * @todo Why does this exist, and why is it in bp-friends? 517 * 518 * @since 1.0.0 479 519 * 480 520 * @param string $filter String to search by. … … 521 561 * @todo Why does this exist, and why is it in bp-friends? 522 562 * 563 * @since 1.0.0 564 * 523 565 * @param string $filter Search term. 524 566 * @return int Count of users matching the search term. … … 556 598 * @todo Why does this exist, and why is it in bp-friends? 557 599 * 600 * @since 1.0.0 601 * 558 602 * @param array $user_ids Array of user IDs. 559 603 * @return array User IDs, sorted by the associated display names. … … 574 618 /** 575 619 * Get a list of random friend IDs. 620 * 621 * @since 1.0.0 576 622 * 577 623 * @param int $user_id ID of the user whose friends are being retrieved. … … 609 655 * - users who have been banned from the group 610 656 * 657 * @since 1.0.0 658 * 611 659 * @param int $user_id ID of the user whose friends are being counted. 612 660 * @param int $group_id ID of the group friends are being invited to. … … 643 691 * Get the friend user IDs for a given friendship. 644 692 * 693 * @since 1.0.0 694 * 645 695 * @param int $friendship_id ID of the friendship. 646 696 * @return object friend_user_id and initiator_user_id. … … 656 706 /** 657 707 * Delete all friendships and friend notifications related to a user. 708 * 709 * @since 1.0.0 658 710 * 659 711 * @param int $user_id ID of the user being expunged.
Note: See TracChangeset
for help on using the changeset viewer.