Skip to:
Content

BuddyPress.org

Changeset 8411


Ignore:
Timestamp:
05/10/2014 02:03:21 AM (7 years ago)
Author:
boonebgorges
Message:

Introduce bp_group_is_invited(), and use it to improve private group message for non-members

When non-member visits a private group of which she is not a member, she now
sees a message that tells her to accept her pending invitation.

Fixes #5510

Props hnla

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-template.php

    r8397 r8411  
    16261626
    16271627/**
     1628 * Check whether the current user has an outstanding invite to the current group in the loop.
     1629 *
     1630 * @param object $group Optional. Group data object. Defaults to the current
     1631 *        group in the groups loop.
     1632 * @return bool True if the user has an outstanding invite, otherwise false.
     1633 */
     1634function bp_group_is_invited( $group = false ) {
     1635    global $groups_template;
     1636
     1637    if ( empty( $group ) ) {
     1638        $group =& $groups_template->group;
     1639    }
     1640
     1641    return apply_filters( 'bp_group_is_invited', ! empty( $group->is_invited ) );
     1642}
     1643
     1644/**
    16281645 * Checks if a user is banned from a group.
    16291646 *
     
    19561973    if ( 'private' == $group->status ) {
    19571974        if ( ! bp_group_has_requested_membership() ) {
    1958             if ( is_user_logged_in() )
     1975            if ( is_user_logged_in() && bp_group_is_invited() ) {
     1976                $message = __( 'You must accept your pending invitation before you can access this private group.', 'buddypress' );
     1977            } else if ( is_user_logged_in() ) {
    19591978                $message = __( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
    1960             else
     1979            } else {
    19611980                $message = __( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
     1981            }
    19621982
    19631983        } else {
  • trunk/src/bp-languages/buddypress.pot

    r8408 r8411  
    55"Project-Id-Version: BuddyPress 2.1-alpha\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/buddypress\n"
    7 "POT-Creation-Date: 2014-05-10 01:35:41+00:00\n"
     7"POT-Creation-Date: 2014-05-10 02:02:13+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
     
    570570#: bp-activity/bp-activity-template.php:139 bp-groups/bp-groups-classes.php:646
    571571#: bp-groups/bp-groups-functions.php:419 bp-groups/bp-groups-template.php:112
    572 #: bp-groups/bp-groups-template.php:2045 bp-groups/bp-groups-template.php:3018
    573 #: bp-groups/bp-groups-template.php:3286
     572#: bp-groups/bp-groups-template.php:2065 bp-groups/bp-groups-template.php:3038
     573#: bp-groups/bp-groups-template.php:3306
    574574msgid ""
    575575"Arguments passed to %1$s should be in an associative array. See the inline "
     
    680680#: bp-groups/bp-groups-template.php:1287 bp-groups/bp-groups-template.php:1303
    681681#: bp-groups/bp-groups-template.php:1352 bp-groups/bp-groups-template.php:1368
    682 #: bp-groups/bp-groups-template.php:2243 bp-groups/bp-groups-template.php:2252
    683 #: bp-groups/bp-groups-template.php:2261 bp-groups/bp-groups-template.php:3177
     682#: bp-groups/bp-groups-template.php:2263 bp-groups/bp-groups-template.php:2272
     683#: bp-groups/bp-groups-template.php:2281 bp-groups/bp-groups-template.php:3197
    684684#: bp-members/bp-members-buddybar.php:64 bp-members/bp-members-loader.php:235
    685685#: bp-members/bp-members-template.php:703
     
    978978
    979979#: bp-blogs/bp-blogs-template.php:661 bp-core/bp-core-classes.php:816
    980 #: bp-groups/bp-groups-template.php:3394 bp-groups/bp-groups-widgets.php:85
     980#: bp-groups/bp-groups-template.php:3414 bp-groups/bp-groups-widgets.php:85
    981981#: bp-groups/bp-groups-widgets.php:197 bp-members/bp-members-template.php:811
    982982#: bp-members/bp-members-template.php:1231
     
    10821082
    10831083#: bp-blogs/bp-blogs-template.php:1187 bp-core/deprecated/1.5.php:417
    1084 #: bp-forums/bp-forums-template.php:2196 bp-groups/bp-groups-template.php:2798
     1084#: bp-forums/bp-forums-template.php:2196 bp-groups/bp-groups-template.php:2818
    10851085#: bp-members/bp-members-template.php:999
    10861086#: bp-messages/bp-messages-template.php:471 bp-themes/bp-default/header.php:30
     
    20052005#: bp-core/bp-core-classes.php:814 bp-core/bp-core-classes.php:815
    20062006#: bp-core/bp-core-template.php:160 bp-core/bp-core-template.php:176
    2007 #: bp-groups/bp-groups-template.php:3388 bp-groups/bp-groups-template.php:3389
    2008 #: bp-groups/bp-groups-template.php:3390
     2007#: bp-groups/bp-groups-template.php:3408 bp-groups/bp-groups-template.php:3409
     2008#: bp-groups/bp-groups-template.php:3410
    20092009msgid "Avatar of %s"
    20102010msgstr ""
     
    20602060msgstr ""
    20612061
    2062 #: bp-core/bp-core-classes.php:830 bp-groups/bp-groups-template.php:3398
     2062#: bp-core/bp-core-classes.php:830 bp-groups/bp-groups-template.php:3418
    20632063msgid "%d group"
    20642064msgid_plural "%d groups"
     
    21272127
    21282128#: bp-core/bp-core-filters.php:462 bp-groups/bp-groups-loader.php:577
    2129 #: bp-groups/bp-groups-template.php:1932 bp-groups/bp-groups-template.php:1933
     2129#: bp-groups/bp-groups-template.php:1949 bp-groups/bp-groups-template.php:1950
    21302130#: bp-themes/bp-default/groups/create.php:18
    21312131#: bp-themes/bp-default/groups/index.php:21
     
    22862286#: bp-core/deprecated/1.6.php:129 bp-core/deprecated/1.6.php:152
    22872287#: bp-friends/bp-friends-widgets.php:98 bp-friends/bp-friends-widgets.php:186
    2288 #: bp-groups/bp-groups-template.php:2438 bp-groups/bp-groups-widgets.php:65
     2288#: bp-groups/bp-groups-template.php:2458 bp-groups/bp-groups-widgets.php:65
    22892289#: bp-groups/bp-groups-widgets.php:146
    22902290#: bp-templates/bp-legacy/buddypress/blogs/index.php:39
     
    24092409
    24102410#: bp-core/deprecated/1.6.php:128 bp-core/deprecated/1.6.php:149
    2411 #: bp-groups/bp-groups-template.php:2814 bp-groups/bp-groups-template.php:2836
     2411#: bp-groups/bp-groups-template.php:2834 bp-groups/bp-groups-template.php:2856
    24122412msgid "Recently Active"
    24132413msgstr ""
    24142414
    24152415#: bp-core/deprecated/1.6.php:130 bp-core/deprecated/1.6.php:155
    2416 #: bp-groups/bp-groups-template.php:2819 bp-groups/bp-groups-template.php:2851
     2416#: bp-groups/bp-groups-template.php:2839 bp-groups/bp-groups-template.php:2871
    24172417msgid "Alphabetically"
    24182418msgstr ""
     
    24662466msgstr ""
    24672467
    2468 #: bp-forums/bp-forums-screens.php:208 bp-groups/bp-groups-template.php:1777
    2469 #: bp-groups/bp-groups-template.php:1778
     2468#: bp-forums/bp-forums-screens.php:208 bp-groups/bp-groups-template.php:1794
     2469#: bp-groups/bp-groups-template.php:1795
    24702470#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:19
    24712471#: bp-themes/bp-default/forums/index.php:23
     
    34483448msgstr ""
    34493449
    3450 #: bp-groups/bp-groups-loader.php:454 bp-groups/bp-groups-template.php:1891
    3451 #: bp-groups/bp-groups-template.php:1892
     3450#: bp-groups/bp-groups-loader.php:454 bp-groups/bp-groups-template.php:1908
     3451#: bp-groups/bp-groups-template.php:1909
    34523452#: bp-templates/bp-legacy/buddypress-functions.php:1214
    34533453#: bp-themes/bp-default/_inc/ajax.php:780
     
    39443944
    39453945#: bp-groups/bp-groups-template.php:1307 bp-groups/bp-groups-template.php:1372
    3946 #: bp-groups/bp-groups-template.php:2336
     3946#: bp-groups/bp-groups-template.php:2356
    39473947msgid "joined %s"
    39483948msgstr ""
     
    39643964msgstr ""
    39653965
    3966 #: bp-groups/bp-groups-template.php:1817 bp-groups/bp-groups-template.php:1818
     3966#: bp-groups/bp-groups-template.php:1834 bp-groups/bp-groups-template.php:1835
    39673967#: bp-templates/bp-legacy/buddypress-functions.php:1178
    39683968#: bp-templates/bp-legacy/buddypress-functions.php:1191
     
    39723972msgstr ""
    39733973
    3974 #: bp-groups/bp-groups-template.php:1840 bp-groups/bp-groups-template.php:1841
     3974#: bp-groups/bp-groups-template.php:1857 bp-groups/bp-groups-template.php:1858
    39753975#: bp-templates/bp-legacy/buddypress-functions.php:1212
    39763976#: bp-themes/bp-default/_inc/ajax.php:778
     
    39783978msgstr ""
    39793979
    3980 #: bp-groups/bp-groups-template.php:1859 bp-groups/bp-groups-template.php:1860
     3980#: bp-groups/bp-groups-template.php:1876 bp-groups/bp-groups-template.php:1877
    39813981msgid "Accept Invitation"
    39823982msgstr ""
    39833983
    3984 #: bp-groups/bp-groups-template.php:1875 bp-groups/bp-groups-template.php:1876
     3984#: bp-groups/bp-groups-template.php:1892 bp-groups/bp-groups-template.php:1893
    39853985msgid "Request Sent"
    39863986msgstr ""
    39873987
    3988 #: bp-groups/bp-groups-template.php:1959
     3988#: bp-groups/bp-groups-template.php:1976
     3989msgid ""
     3990"You must accept your pending invitation before you can access this private "
     3991"group."
     3992msgstr ""
     3993
     3994#: bp-groups/bp-groups-template.php:1978
    39893995msgid ""
    39903996"This is a private group and you must request group membership in order to "
     
    39923998msgstr ""
    39933999
    3994 #: bp-groups/bp-groups-template.php:1961
     4000#: bp-groups/bp-groups-template.php:1980
    39954001msgid ""
    39964002"This is a private group. To join you must be a registered site member and "
     
    39984004msgstr ""
    39994005
    4000 #: bp-groups/bp-groups-template.php:1964
     4006#: bp-groups/bp-groups-template.php:1984
    40014007msgid ""
    40024008"This is a private group. Your membership request is awaiting approval from "
     
    40044010msgstr ""
    40054011
    4006 #: bp-groups/bp-groups-template.php:1968
     4012#: bp-groups/bp-groups-template.php:1988
    40074013msgid "This is a hidden group and only invited members can join."
    40084014msgstr ""
    40094015
    4010 #: bp-groups/bp-groups-template.php:2384 bp-members/bp-members-template.php:522
     4016#: bp-groups/bp-groups-template.php:2404 bp-members/bp-members-template.php:522
    40114017msgid "Viewing member %1$s to %2$s (of %3$s member)"
    40124018msgid_plural "Viewing members %1$s to %2$s (of %3$s members)"
     
    40144020msgstr[1] ""
    40154021
    4016 #: bp-groups/bp-groups-template.php:2436
     4022#: bp-groups/bp-groups-template.php:2456
    40174023#: bp-notifications/bp-notifications-template.php:940
    40184024#: bp-templates/bp-legacy/buddypress/blogs/index.php:36
     
    40374043msgstr ""
    40384044
    4039 #: bp-groups/bp-groups-template.php:2439
     4045#: bp-groups/bp-groups-template.php:2459
    40404046msgid "Oldest"
    40414047msgstr ""
    40424048
    4043 #: bp-groups/bp-groups-template.php:2442
     4049#: bp-groups/bp-groups-template.php:2462
    40444050msgid "Group Activity"
    40454051msgstr ""
    40464052
    4047 #: bp-groups/bp-groups-template.php:2445
     4053#: bp-groups/bp-groups-template.php:2465
    40484054#: bp-templates/bp-legacy/buddypress/blogs/index.php:40
    40494055#: bp-templates/bp-legacy/buddypress/groups/index.php:42
     
    40614067msgstr ""
    40624068
    4063 #: bp-groups/bp-groups-template.php:2672 bp-groups/bp-groups-template.php:2922
     4069#: bp-groups/bp-groups-template.php:2692 bp-groups/bp-groups-template.php:2942
    40644070msgid "Group avatar"
    40654071msgstr ""
    40664072
    4067 #: bp-groups/bp-groups-template.php:2815 bp-groups/bp-groups-template.php:2839
     4073#: bp-groups/bp-groups-template.php:2835 bp-groups/bp-groups-template.php:2859
    40684074msgid "Recently Joined"
    40694075msgstr ""
    40704076
    4071 #: bp-groups/bp-groups-template.php:2816 bp-groups/bp-groups-template.php:2842
     4077#: bp-groups/bp-groups-template.php:2836 bp-groups/bp-groups-template.php:2862
    40724078msgid "Most Popular"
    40734079msgstr ""
    40744080
    4075 #: bp-groups/bp-groups-template.php:2817 bp-groups/bp-groups-template.php:2845
     4081#: bp-groups/bp-groups-template.php:2837 bp-groups/bp-groups-template.php:2865
    40764082msgid "Administrator Of"
    40774083msgstr ""
    40784084
    4079 #: bp-groups/bp-groups-template.php:2818 bp-groups/bp-groups-template.php:2848
     4085#: bp-groups/bp-groups-template.php:2838 bp-groups/bp-groups-template.php:2868
    40804086msgid "Moderator Of"
    40814087msgstr ""
    40824088
    4083 #: bp-groups/bp-groups-template.php:3210
     4089#: bp-groups/bp-groups-template.php:3230
    40844090msgid "requested %s"
    40854091msgstr ""
    40864092
    4087 #: bp-groups/bp-groups-template.php:3262
     4093#: bp-groups/bp-groups-template.php:3282
    40884094msgid "Viewing requests %1$s to %2$s (of %3$s request)"
    40894095msgid_plural "Viewing request %1$s to %2$s (of %3$s requests)"
     
    40914097msgstr[1] ""
    40924098
    4093 #: bp-groups/bp-groups-template.php:3557
     4099#: bp-groups/bp-groups-template.php:3577
    40944100msgid "Viewing invitation %1$s to %2$s (of %3$s invitation)"
    40954101msgid_plural "Viewing invitation %1$s to %2$s (of %3$s invitations)"
     
    40974103msgstr[1] ""
    40984104
    4099 #: bp-groups/bp-groups-template.php:3573
     4105#: bp-groups/bp-groups-template.php:3593
    41004106msgid "Group Activity RSS Feed"
    41014107msgstr ""
    41024108
    4103 #: bp-groups/bp-groups-template.php:3744
     4109#: bp-groups/bp-groups-template.php:3764
    41044110msgid "%s group"
    41054111msgid_plural "%s groups"
Note: See TracChangeset for help on using the changeset viewer.