Ticket #6387: 6387.01.patch
File 6387.01.patch, 21.0 KB (added by , 9 years ago) |
---|
-
src/bp-groups/bp-groups-template.php
626 626 } 627 627 628 628 if ( empty( $group ) ) { 629 $group = & $groups_template->group;629 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 630 630 } 631 631 632 632 if ( 'public' == $group->status ) { … … 660 660 global $groups_template; 661 661 662 662 if ( empty( $group ) ) { 663 $group = & $groups_template->group;663 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 664 664 } 665 665 666 666 /** … … 769 769 global $groups_template; 770 770 771 771 if ( empty( $group ) ) { 772 $group = & $groups_template->group;772 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 773 773 } 774 774 775 775 /** … … 804 804 global $groups_template; 805 805 806 806 if ( empty( $group ) ) { 807 $group = & $groups_template->group;807 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 808 808 } 809 809 810 810 if ( 'public' == $group->status ) { … … 847 847 global $groups_template; 848 848 849 849 if ( empty( $group ) ) { 850 $group = & $groups_template->group;850 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 851 851 } 852 852 853 853 /** … … 957 957 * @return string 958 958 */ 959 959 function bp_get_group_avatar_thumb( $group = false ) { 960 global $groups_template; 961 962 if ( empty( $group ) ) { 963 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 964 } 965 960 966 return bp_get_group_avatar( array( 961 967 'type' => 'thumb', 962 968 'id' => ! empty( $group->id ) ? $group->id : false … … 985 991 * @return string 986 992 */ 987 993 function bp_get_group_avatar_mini( $group = false ) { 994 global $groups_template; 995 996 if ( empty( $group ) ) { 997 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 998 } 999 988 1000 return bp_get_group_avatar( array( 989 1001 'type' => 'thumb', 990 1002 'width' => 30, … … 1014 1026 global $groups_template; 1015 1027 1016 1028 if ( empty( $group ) ) { 1017 $group = & $groups_template->group;1029 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1018 1030 } 1019 1020 1031 $last_active = $group->last_activity; 1021 1032 1022 1033 if ( !$last_active ) { … … 1059 1070 global $groups_template; 1060 1071 1061 1072 if ( empty( $group ) ) { 1062 $group = & $groups_template->group;1073 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1063 1074 } 1064 1075 1065 1076 /** … … 1093 1104 global $groups_template; 1094 1105 1095 1106 if ( empty( $group ) ) { 1096 $group = & $groups_template->group;1107 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1097 1108 } 1098 1109 1099 1110 /** … … 1127 1138 global $groups_template; 1128 1139 1129 1140 if ( empty( $group ) ) { 1130 $group = & $groups_template->group;1141 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1131 1142 } 1132 1143 1133 1144 /** … … 1161 1172 global $groups_template; 1162 1173 1163 1174 if ( empty( $group ) ) { 1164 $group = & $groups_template->group;1175 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1165 1176 } 1166 1177 1167 1178 /** … … 1199 1210 global $groups_template; 1200 1211 1201 1212 if ( empty( $group ) ) { 1202 $group = & $groups_template->group;1213 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1203 1214 } 1204 1215 1205 1216 /** … … 1239 1250 global $groups_template; 1240 1251 1241 1252 if ( empty( $group ) ) { 1242 $group = & $groups_template->group;1253 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1243 1254 } 1244 1255 1245 1256 /** … … 1278 1289 global $groups_template; 1279 1290 1280 1291 if ( empty( $group ) ) { 1281 $group = & $groups_template->group;1292 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1282 1293 } 1283 1294 1284 1295 if ( $group->is_public ) { … … 1313 1324 global $groups_template; 1314 1325 1315 1326 if ( empty( $group ) ) { 1316 $group = & $groups_template->group;1327 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1317 1328 } 1318 1329 1319 1330 return apply_filters( 'bp_get_group_is_public', $group->is_public ); … … 1340 1351 global $groups_template; 1341 1352 1342 1353 if ( empty( $group ) ) { 1343 $group = & $groups_template->group;1354 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1344 1355 } 1345 1356 1346 1357 /** … … 1374 1385 global $groups_template; 1375 1386 1376 1387 if ( empty( $group ) ) { 1377 $group = & $groups_template->group;1388 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1378 1389 } 1379 1390 1380 1391 /** … … 1408 1419 global $groups_template; 1409 1420 1410 1421 if ( empty( $group ) ) { 1411 $group = & $groups_template->group;1422 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1412 1423 } 1413 1424 1414 1425 /** … … 1442 1453 global $groups_template; 1443 1454 1444 1455 if ( empty( $group ) ) { 1445 $group = & $groups_template->group;1456 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1446 1457 } 1447 1458 1448 1459 /** … … 1468 1479 global $groups_template; 1469 1480 1470 1481 if ( empty( $group ) ) { 1471 $group = & $groups_template->group;1482 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1472 1483 } 1473 1484 1474 1485 if ( empty( $user_id ) ) { … … 1513 1524 global $groups_template; 1514 1525 1515 1526 if ( empty( $group ) ) { 1516 $group = & $groups_template->group;1527 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1517 1528 } 1518 1529 1519 1530 $defaults = array( … … 1572 1583 global $groups_template; 1573 1584 1574 1585 if ( empty( $group ) ) { 1575 $group = & $groups_template->group;1586 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1576 1587 } 1577 1588 1578 1589 // fetch group admins if 'populate_extras' flag is false … … 1612 1623 global $groups_template; 1613 1624 1614 1625 if ( empty( $group ) ) { 1615 $group = & $groups_template->group;1626 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1616 1627 } 1617 1628 1618 1629 // fetch group mods if 'populate_extras' flag is false … … 1665 1676 global $groups_template; 1666 1677 1667 1678 if ( empty( $group ) ) { 1668 $group = & $groups_template->group;1679 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1669 1680 } 1670 1681 1671 1682 $admin_ids = array(); … … 1707 1718 global $groups_template; 1708 1719 1709 1720 if ( empty( $group ) ) { 1710 $group = & $groups_template->group;1721 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1711 1722 } 1712 1723 1713 1724 $mod_ids = array(); … … 1752 1763 global $groups_template; 1753 1764 1754 1765 if ( empty( $group ) ) { 1755 $group = & $groups_template->group;1766 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1756 1767 } 1757 1768 1758 1769 /** … … 1925 1936 global $groups_template; 1926 1937 1927 1938 if ( empty( $group ) ) { 1928 $group = & $groups_template->group;1939 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1929 1940 } 1930 1941 1931 1942 /** … … 1988 1999 global $groups_template; 1989 2000 1990 2001 if ( empty( $group ) ) { 1991 $group = & $groups_template->group;2002 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 1992 2003 } 1993 2004 1994 2005 /** … … 2136 2147 global $groups_template; 2137 2148 2138 2149 if ( empty( $group ) ) { 2139 $group = & $groups_template->group;2150 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2140 2151 } 2141 2152 2142 2153 if ( ! empty( $group->enable_forum ) ) { … … 2155 2166 global $groups_template; 2156 2167 2157 2168 if ( empty( $group ) ) { 2158 $group = & $groups_template->group;2169 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2159 2170 } 2160 2171 2161 2172 if ( $group->enable_forum ) { … … 2173 2184 global $groups_template; 2174 2185 2175 2186 if ( empty( $group ) ) { 2176 $group = & $groups_template->group;2187 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2177 2188 } 2178 2189 2179 2190 if ( $setting == $group->status ) { … … 2490 2501 global $groups_template; 2491 2502 2492 2503 if ( empty( $group ) ) { 2493 $group = & $groups_template->group;2504 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2494 2505 } 2495 2506 2496 2507 /** … … 2524 2535 function bp_get_group_member_promote_mod_link( $args = '' ) { 2525 2536 global $members_template, $groups_template; 2526 2537 2527 $defaults = array( 2528 'user_id' => $members_template->member->user_id, 2529 'group' => &$groups_template->group 2530 ); 2531 2532 $r = wp_parse_args( $args, $defaults ); 2533 extract( $r, EXTR_SKIP ); 2538 $r = wp_parse_args( $args, array( 2539 'user_id' => ! empty( $members_template->member->user_id ) ? $members_template->member->user_id : 0, 2540 'group' => ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(), 2541 ) ); 2534 2542 2535 2543 /** 2536 2544 * Filters a URL for promoting a user to moderator. … … 2539 2547 * 2540 2548 * @param string $value URL to use for promoting a user to moderator. 2541 2549 */ 2542 return apply_filters( 'bp_get_group_member_promote_mod_link', wp_nonce_url( bp_get_group_permalink( $ group ) . 'admin/manage-members/promote/mod/' . $user_id, 'groups_promote_member' ) );2550 return apply_filters( 'bp_get_group_member_promote_mod_link', wp_nonce_url( bp_get_group_permalink( $r['group'] ) . 'admin/manage-members/promote/mod/' . $r['user_id'], 'groups_promote_member' ) ); 2543 2551 } 2544 2552 2545 2553 /** … … 2554 2562 * Generate a URL for promoting a user to admin. 2555 2563 * 2556 2564 * @param array|string $args { 2557 * @type int $user_id ID of the member to promote. Default: 2558 * current member in a group member loop. 2559 * @type object $group Group object. Default: current group. 2565 * @type int $user_id User ID to promote. Default: current member in a member loop. 2566 * @type object|bool $group Optional. Group object. Default: current group. 2560 2567 * } 2561 2568 * @return string 2562 2569 */ 2563 2570 function bp_get_group_member_promote_admin_link( $args = '' ) { 2564 2571 global $members_template, $groups_template; 2565 2572 2566 $defaults = array( 2567 'user_id' => !empty( $members_template->member->user_id ) ? $members_template->member->user_id : false, 2568 'group' => &$groups_template->group 2569 ); 2570 2571 $r = wp_parse_args( $args, $defaults ); 2572 extract( $r, EXTR_SKIP ); 2573 $r = wp_parse_args( $args, array( 2574 'user_id' => ! empty( $members_template->member->user_id ) ? $members_template->member->user_id : 0, 2575 'group' => ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(), 2576 ) ); 2573 2577 2574 2578 /** 2575 2579 * Filters a URL for promoting a user to admin. … … 2578 2582 * 2579 2583 * @param string $value URL to use for promoting a user to admin. 2580 2584 */ 2581 return apply_filters( 'bp_get_group_member_promote_admin_link', wp_nonce_url( bp_get_group_permalink( $ group ) . 'admin/manage-members/promote/admin/' . $user_id, 'groups_promote_member' ) );2585 return apply_filters( 'bp_get_group_member_promote_admin_link', wp_nonce_url( bp_get_group_permalink( $r['group'] ) . 'admin/manage-members/promote/admin/' . $r['user_id'], 'groups_promote_member' ) ); 2582 2586 } 2583 2587 2584 2588 /** 2585 2589 * Output a URL for demoting a user to member. 2586 2590 * 2587 * @param int $user_id ID of the member to demote. Default: current member in2588 * a member loop.2591 * @param int $user_id User ID to demote. Default: current member in a member loop. 2592 * @param object|bool $group Optional. Group object. Default: current group. 2589 2593 */ 2590 function bp_group_member_demote_link( $user_id = 0 ) {2594 function bp_group_member_demote_link( $user_id = 0, $group = false ) { 2591 2595 global $members_template; 2592 2596 2593 if ( ! $user_id ) {2597 if ( ! $user_id ) { 2594 2598 $user_id = $members_template->member->user_id; 2595 2599 } 2596 2600 2597 echo bp_get_group_member_demote_link( $user_id );2601 echo bp_get_group_member_demote_link( $user_id, $group ); 2598 2602 } 2599 2603 /** 2600 2604 * Generate a URL for demoting a user to member. 2601 2605 * 2602 * @param int $user_id ID of the member to demote. Default: current 2603 * member in a member loop. 2606 * @param int $user_id User ID to demote. Default: current member in a member loop. 2604 2607 * @param object|bool $group Optional. Group object. Default: current group. 2605 *2606 2608 * @return string 2607 2609 */ 2608 2610 function bp_get_group_member_demote_link( $user_id = 0, $group = false ) { 2609 2611 global $members_template, $groups_template; 2610 2612 2611 if ( empty( $group ) ) {2612 $group =& $groups_template->group;2613 }2614 2615 2613 if ( !$user_id ) { 2616 2614 $user_id = $members_template->member->user_id; 2617 2615 } 2618 2616 2617 if ( empty( $group ) ) { 2618 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2619 } 2620 2619 2621 /** 2620 2622 * Filters a URL for demoting a user to member. 2621 2623 * … … 2629 2631 /** 2630 2632 * Output a URL for banning a member from a group. 2631 2633 * 2632 * @param int $user_id ID of the member to ban.2633 * Default: current member in a member loop.2634 * @param int $user_id User ID to ban. Default: current member in a member loop. 2635 * @param object|bool $group Optional. Group object. Default: current group. 2634 2636 */ 2635 function bp_group_member_ban_link( $user_id = 0 ) {2637 function bp_group_member_ban_link( $user_id = 0, $group = false ) { 2636 2638 global $members_template; 2637 2639 2638 if ( ! $user_id ) {2640 if ( ! $user_id ) { 2639 2641 $user_id = $members_template->member->user_id; 2640 2642 } 2641 2643 2642 echo bp_get_group_member_ban_link( $user_id );2644 echo bp_get_group_member_ban_link( $user_id, $group ); 2643 2645 } 2644 2646 /** 2645 2647 * Generate a URL for banning a member from a group. 2646 2648 * 2647 * @param int $user_id ID of the member to ban. 2648 * Default: current member in a member loop. 2649 * @param int $user_id User ID to ban. Default: current member in a member loop. 2649 2650 * @param object|bool $group Optional. Group object. Default: current group. 2650 *2651 2651 * @return string 2652 2652 */ 2653 2653 function bp_get_group_member_ban_link( $user_id = 0, $group = false ) { 2654 global $groups_template; 2654 global $members_template, $groups_template; 2655 2656 if ( ! $user_id ) { 2657 $user_id = $members_template->member->user_id; 2658 } 2655 2659 2656 2660 if ( empty( $group ) ) { 2657 $group = & $groups_template->group;2661 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2658 2662 } 2659 2663 2660 2664 /** … … 2670 2674 /** 2671 2675 * Output a URL for unbanning a member from a group. 2672 2676 * 2673 * @param int $user_id ID of the member to unban.2674 * Default: current member in a member loop.2677 * @param int $user_id User ID to unban. Default: current member in a member loop. 2678 * @param object|bool $group Optional. Group object. Default: current group. 2675 2679 */ 2676 function bp_group_member_unban_link( $user_id = 0 ) {2680 function bp_group_member_unban_link( $user_id = 0, $group = false ) { 2677 2681 global $members_template; 2678 2682 2679 2683 if ( !$user_id ) { 2680 2684 $user_id = $members_template->member->user_id; 2681 2685 } 2682 2686 2683 echo bp_get_group_member_unban_link( $user_id );2687 echo bp_get_group_member_unban_link( $user_id, $group ); 2684 2688 } 2685 2689 /** 2686 2690 * Generate a URL for unbanning a member from a group. 2687 2691 * 2688 * @param int $user_id ID of the member to unban. 2689 * Default: current member in a member loop. 2692 * @param int $user_id User ID to unban. Default: current member in a member loop. 2690 2693 * @param object|bool $group Optional. Group object. Default: current group. 2691 *2692 2694 * @return string 2693 2695 */ 2694 2696 function bp_get_group_member_unban_link( $user_id = 0, $group = false ) { 2695 2697 global $members_template, $groups_template; 2696 2698 2697 if ( ! $user_id ) {2699 if ( ! $user_id ) { 2698 2700 $user_id = $members_template->member->user_id; 2699 2701 } 2700 2702 2701 2703 if ( empty( $group ) ) { 2702 $group = & $groups_template->group;2704 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2703 2705 } 2704 2706 2705 2707 /** … … 2715 2717 /** 2716 2718 * Output a URL for removing a member from a group. 2717 2719 * 2718 * @param int $user_id ID of the member to remove.2719 * Default: current member in a member loop.2720 * @param int $user_id User ID to remove. Default: current member in a member loop. 2721 * @param object|bool $group Optional. Group object. Default: current group. 2720 2722 */ 2721 function bp_group_member_remove_link( $user_id = 0 ) {2723 function bp_group_member_remove_link( $user_id = 0, $group = false ) { 2722 2724 global $members_template; 2723 2725 2724 if ( ! $user_id ) {2726 if ( ! $user_id ) { 2725 2727 $user_id = $members_template->member->user_id; 2726 2728 } 2727 2729 2728 echo bp_get_group_member_remove_link( $user_id );2730 echo bp_get_group_member_remove_link( $user_id, $group ); 2729 2731 } 2730 2732 /** 2731 2733 * Generate a URL for removing a member from a group. 2732 2734 * 2733 * @param int $user_id ID of the member to remove. 2734 * Default: current member in a member loop. 2735 * @param int $user_id User ID to remove. Default: current member in a member loop. 2735 2736 * @param object|bool $group Optional. Group object. Default: current group. 2736 *2737 2737 * @return string 2738 2738 */ 2739 2739 function bp_get_group_member_remove_link( $user_id = 0, $group = false ) { 2740 global $groups_template; 2740 global $members_template, $groups_template; 2741 2742 if ( ! $user_id ) { 2743 $user_id = $members_template->member->user_id; 2744 } 2741 2745 2742 2746 if ( empty( $group ) ) { 2743 $group = & $groups_template->group;2747 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2744 2748 } 2745 2749 2746 2750 /** … … 2855 2859 global $groups_template; 2856 2860 2857 2861 if ( empty( $group ) ) { 2858 $group = & $groups_template->group;2862 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2859 2863 } 2860 2864 2861 2865 /** … … 2889 2893 global $groups_template; 2890 2894 2891 2895 if ( empty( $group ) ) { 2892 $group = & $groups_template->group;2896 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2893 2897 } 2894 2898 2895 2899 if ( empty( $page ) ) { … … 2918 2922 global $groups_template; 2919 2923 2920 2924 if ( empty( $group ) ) { 2921 $group = & $groups_template->group;2925 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2922 2926 } 2923 2927 2924 2928 if ( groups_check_for_membership_request( bp_loggedin_user_id(), $group->id ) ) { … … 2947 2951 } 2948 2952 2949 2953 if ( empty( $group ) ) { 2950 $group = & $groups_template->group;2954 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2951 2955 } 2952 2956 2953 2957 /** … … 2972 2976 global $groups_template; 2973 2977 2974 2978 if ( empty( $group ) ) { 2975 $group = & $groups_template->group;2979 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 2976 2980 } 2977 2981 2978 2982 /** … … 3026 3030 $retval = false; 3027 3031 3028 3032 if ( empty( $group ) ) { 3029 $group = $groups_template->group;3033 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3030 3034 } 3031 3035 3032 3036 if ( empty( $user_id ) ) { … … 3066 3070 global $groups_template; 3067 3071 3068 3072 if ( empty( $group ) ) { 3069 $group = & $groups_template->group;3073 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3070 3074 } 3071 3075 3072 3076 $bp = buddypress(); … … 3099 3103 global $groups_template; 3100 3104 3101 3105 if ( empty( $group ) ) { 3102 $group = & $groups_template->group;3106 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3103 3107 } 3104 3108 3105 3109 $bp = buddypress(); … … 3132 3136 global $groups_template; 3133 3137 3134 3138 if ( empty( $group ) ) { 3135 $group = & $groups_template->group;3139 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3136 3140 } 3137 3141 3138 3142 /** … … 3163 3167 global $groups_template; 3164 3168 3165 3169 if ( empty( $group ) ) { 3166 $group = & $groups_template->group;3170 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3167 3171 } 3168 3172 3169 3173 /** … … 3194 3198 global $groups_template; 3195 3199 3196 3200 if ( empty( $group ) ) { 3197 $group = & $groups_template->group;3201 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3198 3202 } 3199 3203 3200 3204 /** … … 3223 3227 } 3224 3228 3225 3229 if ( empty( $group ) ) { 3226 $group = & $groups_template->group;3230 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3227 3231 } 3228 3232 3229 3233 if ( !friends_check_user_has_friends( bp_loggedin_user_id() ) || !friends_count_invitable_friends( bp_loggedin_user_id(), $group->id ) ) { … … 3259 3263 global $groups_template; 3260 3264 3261 3265 if ( empty( $group ) ) { 3262 $group = & $groups_template->group;3266 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3263 3267 } 3264 3268 3265 3269 if ( !is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic() ) { … … 3313 3317 3314 3318 // Set group to current loop group if none passed 3315 3319 if ( empty( $group ) ) { 3316 $group = & $groups_template->group;3320 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3317 3321 } 3318 3322 3319 3323 // Don't show button if not logged in or previously banned … … 3557 3561 3558 3562 // Group not passed so look for loop 3559 3563 if ( empty( $group ) ) { 3560 $group = & $groups_template->group;3564 $group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group(); 3561 3565 } 3562 3566 3563 3567 // Group status is not set (maybe outside of group loop?)