Changeset 3654
- Timestamp:
- 01/08/2012 10:32:12 PM (11 years ago)
- Location:
- branches/plugin
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-core-hooks.php
r3652 r3654 148 148 add_action( 'bbp_spammed_forum', 'bbp_update_forum_walker' ); 149 149 add_action( 'bbp_unspammed_forum', 'bbp_update_forum_walker' ); 150 151 // New/Edit Forum 152 add_action( 'template_redirect', 'bbp_new_forum_handler' ); 153 add_action( 'template_redirect', 'bbp_edit_forum_handler', 1 ); 154 add_action( 'bbp_new_forum', 'bbp_update_forum', 10 ); 155 add_action( 'bbp_edit_forum', 'bbp_update_forum', 10 ); 150 156 151 157 // New/Edit Reply -
branches/plugin/bbp-includes/bbp-extend-buddypress.php
r3627 r3654 404 404 * Append forum options to activity filter select box 405 405 * 406 * @since bbPress (r ????)406 * @since bbPress (r3653) 407 407 */ 408 408 function activity_filter_options() { … … 930 930 931 931 function display() { 932 932 global $bbp; 933 934 // More than one forum, so show hierarchy 935 if ( count( bbp_get_group_forum_ids( bp_get_current_group_id() ) ) > 1 ) 936 $this->display_group_forums(); 937 938 // Only one forum, so show its topics 939 else 940 $this->display_group_forum(); 933 941 } 934 942 … … 944 952 * @since bbPress (r3563) 945 953 * 946 * @uses groups_get_groupmeta()947 * @uses bp_get_current_group_id()948 * @uses bbp_has_forums()949 954 * @uses bbp_get_template_part() 950 955 */ 951 956 function edit_screen() { 952 957 953 // Forum data 954 $group_id = bp_get_current_group_id(); 955 $forum_ids = groups_get_groupmeta( $group_id, 'forum_id' ); 956 $forum_args = array( 957 'post__in' => $forum_ids 958 ); 959 960 // Query forums and show them if 961 if ( !empty( $forum_ids ) && bbp_has_forums( $forum_args ) ) { 962 bbp_get_template_part( 'bbpress/loop', 'forums' ); 963 } else { ?> 964 965 <div id="message" class="info"> 966 <p><?php _e( 'This group does not have any forums.', 'bbpress' ); ?></p> 967 </div> 968 969 <?php }; 958 // Add group admin actions to forum row actions 959 add_action( 'bbp_forum_row_actions', array( $this, 'forum_row_actions' ) ); 960 961 // Show forums if needed 962 $this->display_group_forums(); 970 963 971 964 // Output the forum form … … 981 974 * @since bbPress (r3465) 982 975 * 983 * @todo Everything 976 * @uses bbp_new_forum_handler() To check for forum creation 977 * @uses bbp_edit_forum_handler() To check for forum edit 984 978 */ 985 979 function edit_screen_save() { 986 check_admin_referer( 'bbp_group_edit_save_' . $this->slug ); 980 981 // Bail if not a POST action 982 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 983 return; 984 985 // Bail if action is empty 986 if ( empty( $_POST['action'] ) ) 987 return; 988 989 // Handle the different actions that can happen here 990 switch ( $_POST['action'] ) { 991 992 // New forum 993 case 'bbp-new-forum' : 994 995 // Redirect back here, not to the new forum 996 add_filter( 'bbp_new_forum_redirect_to', array( $this, 'edit_redirect_to' ) ); 997 998 // Add actions to bbp_new_forum 999 add_action( 'bbp_new_forum', array( $this, 'new_forum' ), 10, 4 ); 1000 1001 // Handle the new forum 1002 bbp_new_forum_handler(); 1003 1004 break; 1005 1006 // Edit existing forum 1007 case 'bbp-edit-forum' : 1008 1009 // Redirect back here, not to the new forum 1010 add_filter( 'bbp_edit_forum_redirect_to', array( $this, 'edit_redirect_to' ) ); 1011 1012 // Handle the forum edit 1013 bbp_edit_forum_handler(); 1014 1015 break; 1016 1017 // Trash a forum 1018 case 'bbp-trash-forum' : 1019 //bbp_trash_forum_handler(); 1020 break; 1021 1022 // Permanently delet a forum 1023 case 'bbp-delete-forum' : 1024 //bbp_delete_forum_handler(); 1025 break; 1026 } 987 1027 } 988 1028 … … 1002 1042 return false; 1003 1043 1044 // Add group admin actions to forum row actions 1045 add_action( 'bbp_forum_row_actions', array( $this, 'forum_row_actions' ) ); 1046 1047 // Show forums if needed 1048 $this->display_group_forums(); 1049 1050 // Output the forum form 1051 bbp_get_template_part( 'bbpress/form', 'forum' ); 1052 1053 // Verify intent 1054 wp_nonce_field( 'bbp_group_create_save_' . $this->slug ); 1055 } 1056 1057 /** 1058 * Save the Group Forum data on create 1059 * 1060 * @since bbPress (r3465) 1061 * 1062 * @todo Everything 1063 */ 1064 function create_screen_save() { 1065 1066 // Bail if not a POST action 1067 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 1068 return; 1069 1070 // Bail if action is empty 1071 if ( empty( $_POST['action'] ) ) 1072 return; 1073 1074 // Handle the different actions that can happen here 1075 switch ( $_POST['action'] ) { 1076 1077 // New forum 1078 case 'bbp-new-forum' : 1079 1080 // Redirect back here, not to the new forum 1081 add_filter( 'bbp_new_forum_redirect_to', array( $this, 'create_redirect_to' ) ); 1082 1083 // Add actions to bbp_new_forum 1084 add_action( 'bbp_new_forum', array( $this, 'new_forum' ), 10, 4 ); 1085 1086 // Handle the new forum 1087 bbp_new_forum_handler(); 1088 1089 break; 1090 1091 // Edit existing forum 1092 case 'bbp-edit-forum' : 1093 1094 // Redirect back here, not to the new forum 1095 add_filter( 'bbp_edit_forum_redirect_to', array( $this, 'create_redirect_to' ) ); 1096 1097 // Handle the forum edit 1098 bbp_edit_forum_handler(); 1099 1100 break; 1101 1102 // Trash a forum 1103 case 'bbp-trash-forum' : 1104 //bbp_trash_forum_handler(); 1105 break; 1106 1107 // Permanently delet a forum 1108 case 'bbp-delete-forum' : 1109 //bbp_delete_forum_handler(); 1110 break; 1111 } 1112 } 1113 1114 /** 1115 * Creating a group forum or category (including root for group) 1116 * 1117 * @since bbPress (r3653) 1118 * @param type $forum_args 1119 * @uses bbp_get_forum_id() 1120 * @uses bp_get_current_group_id() 1121 * @uses bbp_add_forum_id_to_group() 1122 * @uses bbp_add_group_id_to_forum() 1123 * @return if no forum_id is available 1124 */ 1125 public function new_forum( $forum_args = array() ) { 1126 1127 // Bail if no forum_id was passed 1128 if ( empty( $forum_args['forum_id'] ) ) 1129 return; 1130 1131 // Validate forum_id 1132 $forum_id = bbp_get_forum_id( $forum_args['forum_id'] ); 1133 $group_id = bp_get_current_group_id(); 1134 1135 bbp_add_forum_id_to_group( $group_id, $forum_id ); 1136 bbp_add_group_id_to_forum( $forum_id, $group_id ); 1137 } 1138 1139 /** 1140 * Removing a group forum or category (including root for group) 1141 * 1142 * @since bbPress (r3653) 1143 * @param type $forum_args 1144 * @uses bbp_get_forum_id() 1145 * @uses bp_get_current_group_id() 1146 * @uses bbp_add_forum_id_to_group() 1147 * @uses bbp_add_group_id_to_forum() 1148 * @return if no forum_id is available 1149 */ 1150 public function remove_forum( $forum_args = array() ) { 1151 1152 // Bail if no forum_id was passed 1153 if ( empty( $forum_args['forum_id'] ) ) 1154 return; 1155 1156 // Validate forum_id 1157 $forum_id = bbp_get_forum_id( $forum_args['forum_id'] ); 1158 $group_id = bp_get_current_group_id(); 1159 1160 bbp_remove_forum_id_from_group( $group_id, $forum_id ); 1161 bbp_remove_group_id_from_forum( $forum_id, $group_id ); 1162 } 1163 1164 /** Display Methods *******************************************************/ 1165 1166 /** 1167 * Output the forums for a group in the edit/create screens 1168 * 1169 * @since bbPress (r3653) 1170 * @uses bp_get_current_group_id() 1171 * @uses bbp_get_group_forum_ids() 1172 * @uses bbp_has_forums() 1173 * @uses bbp_get_template_part() 1174 */ 1175 static function display_group_forums() { 1176 1004 1177 // Forum data 1005 $group_id = bp_get_current_group_id(); 1006 $forum_ids = groups_get_groupmeta( $group_id, 'forum_id' ); 1007 $forum_args = array( 1008 'post__in' => $forum_ids 1009 ); 1178 $forum_ids = bbp_get_group_forum_ids( bp_get_current_group_id() ); 1179 $forum_args = array( 'post__in' => $forum_ids ); 1010 1180 1011 1181 // Query forums and show them if 1012 if ( !empty( $forum_ids ) && bbp_has_forums( $forum_args ) ) { 1013 bbp_get_template_part( 'bbpress/loop', 'forums' ); 1014 } else { ?> 1182 if ( !empty( $forum_ids ) && bbp_has_forums( $forum_args ) ) : ?> 1183 1184 <div id="bbpress-forums"> 1185 1186 <?php bbp_get_template_part( 'bbpress/loop', 'forums' ); ?> 1187 1188 </div> 1189 1190 <?php else : ?> 1015 1191 1016 1192 <div id="message" class="info"> … … 1018 1194 </div> 1019 1195 1020 <?php }; 1021 1022 // Output the forum form 1023 bbp_get_template_part( 'bbpress/form', 'forum' ); 1024 1025 // Verify intent 1026 wp_nonce_field( 'bbp_group_create_save_' . $this->slug ); 1027 } 1028 1029 /** 1030 * Save the Group Forum data on create 1031 * 1032 * @since bbPress (r3465) 1033 * 1034 * @todo Everything 1035 */ 1036 function create_screen_save() { 1037 check_admin_referer( 'groups_create_save_' . $this->slug ); 1196 <?php endif; 1197 } 1198 1199 /** 1200 * Output the forums for a group in the edit/create screens 1201 * 1202 * @since bbPress (r3653) 1203 * @uses bp_get_current_group_id() 1204 * @uses bbp_get_group_forum_ids() 1205 * @uses bbp_has_forums() 1206 * @uses bbp_get_template_part() 1207 */ 1208 static function display_group_forum() { 1209 1210 // Forum data 1211 $forum_ids = bbp_get_group_forum_ids( bp_get_current_group_id() ); 1212 $forum_args = array( 'post__in' => $forum_ids ); 1213 1214 // Query forums and show them if 1215 if ( !empty( $forum_ids ) && bbp_has_forums( $forum_args ) ) : ?> 1216 1217 <div id="bbpress-forums"> 1218 1219 <?php bbp_get_template_part( 'bbpress/content', 'single-forum' ); ?> 1220 1221 </div> 1222 1223 <?php else : ?> 1224 1225 <div id="message" class="info"> 1226 <p><?php _e( 'This group does not have any forums. Create some or continue to the next step. You can modify this groups forums later.', 'bbpress' ); ?></p> 1227 </div> 1228 1229 <?php endif; 1230 } 1231 1232 /** 1233 * Add forum row action HTML when viewing group forum admin 1234 * 1235 * @since bbPress (r3653) 1236 * 1237 * @uses bp_is_item_admin() 1238 * @uses bbp_get_forum_id() 1239 */ 1240 public function forum_row_actions() { 1241 1242 // Only admins can take actions on forums 1243 if ( !bp_is_item_admin() ) 1244 return; 1245 1246 $forum_id = bbp_get_forum_id(); 1247 1248 ?> 1249 1250 <div class="row-actions"> 1251 1252 <?php // @todo add links echo 'Edit | Remove | Trash'; ?> 1253 1254 </div> 1255 1256 <?php 1257 } 1258 1259 /** 1260 * Add topic row action HTML when viewing group forum admin 1261 * 1262 * @since bbPress (r3653) 1263 * 1264 * @uses bp_is_item_admin() 1265 * @uses bbp_get_forum_id() 1266 */ 1267 public function topic_row_actions() { 1268 1269 // Only admins can take actions on forums 1270 if ( !bp_is_item_admin() || !bp_is_item_mod() ) 1271 return; 1272 1273 $forum_id = bbp_get_forum_id(); 1274 $topic_id = bbp_get_topic_id(); 1275 1276 ?> 1277 1278 <div class="row-actions"> 1279 1280 <?php // @todo add links echo 'Edit | Trash | View | Close | Stick (To Front) | Spam'; ?> 1281 1282 </div> 1283 1284 <?php 1285 } 1286 1287 /** Redirect Helpers ******************************************************/ 1288 1289 /** 1290 * Redirect to the group admin forum edit screen 1291 * 1292 * @since bbPress (r3653) 1293 * 1294 * @uses groups_get_current_group() 1295 * @uses bp_is_group_admin_screen() 1296 * @uses trailingslashit() 1297 * @uses bp_get_root_domain() 1298 * @uses bp_get_groups_root_slug() 1299 */ 1300 public function edit_redirect_to( $redirect_url = '' ) { 1301 1302 // Get the current group, if there is one 1303 $group = groups_get_current_group(); 1304 1305 // If this is a group of any kind, empty out the redirect URL 1306 if ( bp_is_group_admin_screen( $this->slug ) ) 1307 $redirect_url = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/' . $this->slug ); 1308 1309 return $redirect_url; 1310 } 1311 1312 /** 1313 * Redirect to the group creation forum edit screen 1314 * 1315 * @since bbPress (r3653) 1316 * 1317 * @uses bp_is_group_creation_step() 1318 * @uses bp_is_action_variable() 1319 * @uses bp_get_root_domain() 1320 * @uses bp_get_groups_root_slug() 1321 */ 1322 public function create_redirect_to( $redirect_url = '' ) { 1323 global $bp; 1324 1325 // If this is a group of any kind, empty out the redirect URL 1326 if ( bp_is_group_creation_step( $this->slug ) ) { 1327 1328 // Loop through 1329 foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) { 1330 if ( bp_is_action_variable( $slug ) ) { 1331 $previous_steps[] = $slug; 1332 break; 1333 } 1334 1335 $previous_steps[] = $slug; 1336 } 1337 } 1338 $redirect_url = trailingslashit( bp_get_root_domain() ) . bp_get_groups_root_slug() . '/create/step/' . array_pop( $previous_steps ); 1339 1340 return $redirect_url; 1038 1341 } 1039 1342 } … … 1043 1346 * Creates the Forums component in BuddyPress 1044 1347 * 1045 * @since bbPress (r ????)1348 * @since bbPress (r3653) 1046 1349 * 1047 1350 * @global bbPress $bbp … … 1240 1543 } 1241 1544 1545 /** Forum/Group Sync **********************************************************/ 1546 1547 /** 1548 * These functions are used to keep the many-to-many relationships between 1549 * groups and forums synchronized. Each forum and group stores ponters to each 1550 * other in their respective meta. This way if a group or forum is deleted 1551 * their associattions can be updated without much effort. 1552 */ 1553 1554 /** 1555 * Get forum ID's for a group 1556 * 1557 * @param type $group_id 1558 * @since bbPress (r3653) 1559 */ 1560 function bbp_get_group_forum_ids( $group_id = 0 ) { 1561 1562 // Assume no forums 1563 $forum_ids = array(); 1564 1565 // Use current group if none is set 1566 if ( empty( $group_id ) ) 1567 $group_id = bp_get_current_group_id(); 1568 1569 // Get the forums 1570 if ( !empty( $group_id ) ) 1571 $forum_ids = groups_get_groupmeta( $group_id, 'forum_id' ); 1572 1573 // Trim out any empty array items 1574 $forum_ids = array_filter( $forum_ids ); 1575 1576 return (array) apply_filters( 'bbp_get_group_forum_ids', $forum_ids, $group_id ); 1577 } 1578 1579 /** 1580 * Get group ID's for a forum 1581 * 1582 * @param type $forum_id 1583 * @since bbPress (r3653) 1584 */ 1585 function bbp_get_forum_group_ids( $forum_id = 0 ) { 1586 1587 // Assume no forums 1588 $group_ids = array(); 1589 1590 // Use current group if none is set 1591 if ( empty( $forum_id ) ) 1592 $forum_id = bbp_get_forum_id(); 1593 1594 // Get the forums 1595 if ( !empty( $forum_id ) ) 1596 $group_ids = get_post_meta( $forum_id, '_bbp_group_ids' ); 1597 1598 // Trim out any empty array items 1599 $group_ids = array_filter( $group_ids ); 1600 1601 return (array) apply_filters( 'bbp_get_forum_group_ids', $group_ids, $forum_id ); 1602 } 1603 1604 /** 1605 * Get forum ID's for a group 1606 * 1607 * @param type $group_id 1608 * @since bbPress (r3653) 1609 */ 1610 function bbp_update_group_forum_ids( $group_id = 0, $forum_ids = array() ) { 1611 1612 // Use current group if none is set 1613 if ( empty( $group_id ) ) 1614 $group_id = bp_get_current_group_id(); 1615 1616 // Trim out any empties 1617 $forum_ids = array_filter( $forum_ids ); 1618 1619 // Get the forums 1620 return groups_update_groupmeta( $group_id, 'forum_id', $forum_ids ); 1621 } 1622 1623 /** 1624 * Update group ID's for a forum 1625 * 1626 * @param type $forum_id 1627 * @since bbPress (r3653) 1628 */ 1629 function bbp_update_forum_group_ids( $forum_id = 0, $group_ids = array() ) { 1630 $forum_id = bbp_get_forum_id( $forum_id ); 1631 1632 // Trim out any empties 1633 $group_ids = array_filter( $group_ids ); 1634 1635 // Get the forums 1636 return update_post_meta( $forum_id, '_bbp_group_ids', $group_ids ); 1637 } 1638 1639 /** 1640 * Add a group to a forum 1641 * 1642 * @param type $group_id 1643 * @since bbPress (r3653) 1644 */ 1645 function bbp_add_group_id_to_forum( $forum_id = 0, $group_id = 0 ) { 1646 1647 // Validate forum_id 1648 $forum_id = bbp_get_forum_id( $forum_id ); 1649 1650 // Use current group if none is set 1651 if ( empty( $group_id ) ) 1652 $group_id = bp_get_current_group_id(); 1653 1654 // Get current group IDs 1655 $group_ids = bbp_get_forum_group_ids( $forum_id ); 1656 1657 // Maybe update the groups forums 1658 if ( !in_array( $group_id, $group_ids ) ) { 1659 $group_ids[] = $group_id; 1660 return bbp_update_forum_group_ids( $forum_id, $group_ids ); 1661 } 1662 } 1663 1664 /** 1665 * Remove a forum from a group 1666 * 1667 * @param type $group_id 1668 * @since bbPress (r3653) 1669 */ 1670 function bbp_add_forum_id_to_group( $group_id = 0, $forum_id = 0 ) { 1671 1672 // Validate forum_id 1673 $forum_id = bbp_get_forum_id( $forum_id ); 1674 1675 // Use current group if none is set 1676 if ( empty( $group_id ) ) 1677 $group_id = bp_get_current_group_id(); 1678 1679 // Get current group IDs 1680 $forum_ids = bbp_get_group_forum_ids( $group_id ); 1681 1682 // Maybe update the groups forums 1683 if ( !in_array( $forum_id, $forum_ids ) ) { 1684 $forum_ids[] = $forum_id; 1685 return bbp_update_group_forum_ids( $group_id, $forum_ids ); 1686 } 1687 } 1688 1689 /** 1690 * Remove a group from a forum 1691 * 1692 * @param type $group_id 1693 * @since bbPress (r3653) 1694 */ 1695 function bbp_remove_group_id_from_forum( $forum_id = 0, $group_id = 0 ) { 1696 1697 // Validate forum_id 1698 $forum_id = bbp_get_forum_id( $forum_id ); 1699 1700 // Use current group if none is set 1701 if ( empty( $group_id ) ) 1702 $group_id = bp_get_current_group_id(); 1703 1704 // Get current group IDs 1705 $group_ids = bbp_get_forum_group_ids( $forum_id ); 1706 1707 // Maybe update the groups forums 1708 if ( in_array( $group_id, $group_ids ) ) { 1709 unset( $group_ids[$group_id] ); 1710 return bbp_update_forum_group_ids( $forum_id, $group_ids ); 1711 } 1712 } 1713 1714 /** 1715 * Remove a forum from a group 1716 * 1717 * @param type $group_id 1718 * @since bbPress (r3653) 1719 */ 1720 function bbp_remove_forum_id_from_group( $group_id = 0, $forum_id = 0 ) { 1721 1722 // Validate forum_id 1723 $forum_id = bbp_get_forum_id( $forum_id ); 1724 1725 // Use current group if none is set 1726 if ( empty( $group_id ) ) 1727 $group_id = bp_get_current_group_id(); 1728 1729 // Get current group IDs 1730 $forum_ids = bbp_get_group_forum_ids( $group_id ); 1731 1732 // Maybe update the groups forums 1733 if ( in_array( $forum_id, $forum_ids ) ) { 1734 unset( $forum_ids[$forum_id] ); 1735 return bbp_update_group_forum_ids( $group_id, $forum_ids ); 1736 } 1737 } 1738 1739 /** 1740 * Remove a group from aall forums 1741 * 1742 * @param type $group_id 1743 * @since bbPress (r3653) 1744 */ 1745 function bbp_remove_group_id_from_all_forums( $group_id = 0 ) { 1746 1747 // Use current group if none is set 1748 if ( empty( $group_id ) ) 1749 $group_id = bp_get_current_group_id(); 1750 1751 // Get current group IDs 1752 $forum_ids = bbp_get_group_forum_ids( $group_id ); 1753 1754 // Loop through forums and remove this group from each one 1755 foreach( (array) $forum_ids as $forum_id ) { 1756 bbp_remove_group_id_from_forum( $group_id, $forum_id ); 1757 } 1758 } 1759 1760 /** 1761 * Remove a forum from all groups 1762 * 1763 * @param type $forum_id 1764 * @since bbPress (r3653) 1765 */ 1766 function bbp_remove_forum_id_from_all_groups( $forum_id = 0 ) { 1767 1768 // Validate 1769 $forum_id = bbp_get_forum_id( $forum_id ); 1770 $group_ids = bbp_get_forum_group_ids( $forum_id ); 1771 1772 // Loop through groups and remove this forum from each one 1773 foreach( (array) $group_ids as $group_id ) { 1774 bbp_remove_forum_id_from_group( $forum_id, $group_id ); 1775 } 1776 } 1777 1242 1778 ?> -
branches/plugin/bbp-includes/bbp-forum-functions.php
r3646 r3654 75 75 // Return new forum ID 76 76 return $forum_id; 77 } 78 79 /** Post Form Handlers ********************************************************/ 80 81 /** 82 * Handles the front end forum submission 83 * 84 * @uses bbPress:errors::add() To log various error messages 85 * @uses check_admin_referer() To verify the nonce and check the referer 86 * @uses bbp_is_anonymous() To check if an anonymous post is being made 87 * @uses current_user_can() To check if the current user can publish forum 88 * @uses bbp_get_current_user_id() To get the current user id 89 * @uses bbp_filter_anonymous_post_data() To filter anonymous data 90 * @uses bbp_set_current_anonymous_user_data() To set the anonymous user cookies 91 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error} 92 * @uses esc_attr() For sanitization 93 * @uses bbp_is_forum_category() To check if the forum is a category 94 * @uses bbp_is_forum_closed() To check if the forum is closed 95 * @uses bbp_is_forum_private() To check if the forum is private 96 * @uses bbp_check_for_flood() To check for flooding 97 * @uses bbp_check_for_duplicate() To check for duplicates 98 * @uses bbp_get_forum_post_type() To get the forum post type 99 * @uses remove_filter() To remove 'wp_filter_kses' filters if needed 100 * @uses apply_filters() Calls 'bbp_new_forum_pre_title' with the content 101 * @uses apply_filters() Calls 'bbp_new_forum_pre_content' with the content 102 * @uses bbPress::errors::get_error_codes() To get the {@link WP_Error} errors 103 * @uses wp_insert_post() To insert the forum 104 * @uses do_action() Calls 'bbp_new_forum' with the forum id, forum id, 105 * anonymous data and reply author 106 * @uses bbp_stick_forum() To stick or super stick the forum 107 * @uses bbp_unstick_forum() To unstick the forum 108 * @uses bbp_get_forum_permalink() To get the forum permalink 109 * @uses wp_safe_redirect() To redirect to the forum link 110 * @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error 111 * messages 112 */ 113 function bbp_new_forum_handler() { 114 115 // Bail if not a POST action 116 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 117 return; 118 119 // Bail if action is not bbp-new-forum 120 if ( empty( $_POST['action'] ) || ( 'bbp-new-forum' !== $_POST['action'] ) ) 121 return; 122 123 // Nonce check 124 check_admin_referer( 'bbp-new-forum' ); 125 126 // Define local variable(s) 127 $view_all = $anonymous_data = false; 128 $forum_parent_id = $forum_author = 0; 129 $forum_title = $forum_content = ''; 130 131 /** Forum Author **********************************************************/ 132 133 // User cannot create forums 134 if ( !current_user_can( 'publish_forums' ) ) { 135 bbp_add_error( 'bbp_forum_permissions', __( '<strong>ERROR</strong>: You do not have permission to create new forums.', 'bbpress' ) ); 136 } 137 138 // Forum author is current user 139 $forum_author = bbp_get_current_user_id(); 140 141 // Remove wp_filter_kses filters from title and content for capable users and if the nonce is verified 142 if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && wp_create_nonce( 'bbp-unfiltered-html-forum_new' ) == $_POST['_bbp_unfiltered_html_forum'] ) { 143 remove_filter( 'bbp_new_forum_pre_title', 'wp_filter_kses' ); 144 remove_filter( 'bbp_new_forum_pre_content', 'wp_filter_kses' ); 145 } 146 147 /** Forum Title ***********************************************************/ 148 149 if ( !empty( $_POST['bbp_forum_title'] ) ) 150 $forum_title = esc_attr( strip_tags( $_POST['bbp_forum_title'] ) ); 151 152 // Filter and sanitize 153 $forum_title = apply_filters( 'bbp_new_forum_pre_title', $forum_title ); 154 155 // No forum title 156 if ( empty( $forum_title ) ) 157 bbp_add_error( 'bbp_forum_title', __( '<strong>ERROR</strong>: Your forum needs a title.', 'bbpress' ) ); 158 159 /** Forum Content *********************************************************/ 160 161 if ( !empty( $_POST['bbp_forum_content'] ) ) 162 $forum_content = $_POST['bbp_forum_content']; 163 164 // Filter and sanitize 165 $forum_content = apply_filters( 'bbp_new_forum_pre_content', $forum_content ); 166 167 // No forum content 168 if ( empty( $forum_content ) ) 169 bbp_add_error( 'bbp_forum_content', __( '<strong>ERROR</strong>: Your forum cannot be empty.', 'bbpress' ) ); 170 171 /** Forum Parent **********************************************************/ 172 173 // Cast Forum parent id to int 174 $forum_parent_id = (int) $_POST['bbp_forum_parent_id']; 175 176 // Forum exists 177 if ( !empty( $forum_parent_id ) ) { 178 179 // Forum is a category 180 if ( bbp_is_forum_category( $forum_parent_id ) ) 181 bbp_add_error( 'bbp_edit_forum_forum_category', __( '<strong>ERROR</strong>: This forum is a category. No forums can be created in this forum.', 'bbpress' ) ); 182 183 // Forum is closed and user cannot access 184 if ( bbp_is_forum_closed( $forum_parent_id ) && !current_user_can( 'edit_forum', $forum_parent_id ) ) 185 bbp_add_error( 'bbp_edit_forum_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new forums.', 'bbpress' ) ); 186 187 // Forum is private and user cannot access 188 if ( bbp_is_forum_private( $forum_parent_id ) && !current_user_can( 'read_private_forums' ) ) 189 bbp_add_error( 'bbp_edit_forum_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 190 191 // Forum is hidden and user cannot access 192 if ( bbp_is_forum_hidden( $forum_parent_id ) && !current_user_can( 'read_hidden_forums' ) ) 193 bbp_add_error( 'bbp_edit_forum_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 194 } 195 196 /** Forum Flooding ********************************************************/ 197 198 if ( !bbp_check_for_flood( $anonymous_data, $forum_author ) ) 199 bbp_add_error( 'bbp_forum_flood', __( '<strong>ERROR</strong>: Slow down; you move too fast.', 'bbpress' ) ); 200 201 /** Forum Duplicate *******************************************************/ 202 203 if ( !bbp_check_for_duplicate( array( 'post_type' => bbp_get_forum_post_type(), 'post_author' => $forum_author, 'post_content' => $forum_content, 'anonymous_data' => $anonymous_data ) ) ) 204 bbp_add_error( 'bbp_forum_duplicate', __( '<strong>ERROR</strong>: This forum already exists.', 'bbpress' ) ); 205 206 /** Forum Blacklist *******************************************************/ 207 208 if ( !bbp_check_for_blacklist( $anonymous_data, $forum_author, $forum_title, $forum_content ) ) 209 bbp_add_error( 'bbp_forum_blacklist', __( '<strong>ERROR</strong>: Your forum cannot be created at this time.', 'bbpress' ) ); 210 211 /** Forum Moderation ******************************************************/ 212 213 $post_status = bbp_get_public_status_id(); 214 if ( !bbp_check_for_moderation( $anonymous_data, $forum_author, $forum_title, $forum_content ) ) 215 $post_status = bbp_get_pending_status_id(); 216 217 /** Additional Actions (Before Save) **************************************/ 218 219 do_action( 'bbp_new_forum_pre_extras' ); 220 221 /** No Errors *************************************************************/ 222 223 if ( !bbp_has_errors() ) { 224 225 /** Create new forum **************************************************/ 226 227 // Add the content of the form to $post as an array 228 $forum_data = array( 229 'post_author' => $forum_author, 230 'post_title' => $forum_title, 231 'post_content' => $forum_content, 232 'post_parent' => $forum_parent_id, 233 'post_status' => $post_status, 234 'post_type' => bbp_get_forum_post_type(), 235 'comment_status' => 'closed' 236 ); 237 238 // Just in time manipulation of forum data before being created 239 $forum_data = apply_filters( 'bbp_new_forum_pre_insert', $forum_data ); 240 241 // Insert forum 242 $forum_id = wp_insert_post( $forum_data ); 243 244 /** No Errors *********************************************************/ 245 246 if ( !empty( $forum_id ) && !is_wp_error( $forum_id ) ) { 247 248 /** Trash Check ***************************************************/ 249 250 // If the forum is trash, or the forum_status is switched to 251 // trash, trash it properly 252 if ( ( get_post_field( 'post_status', $forum_id ) == bbp_get_trash_status_id() ) || ( $forum_data['post_status'] == bbp_get_trash_status_id() ) ) { 253 254 // Trash the reply 255 wp_trash_post( $forum_id ); 256 257 // Force view=all 258 $view_all = true; 259 } 260 261 /** Spam Check ****************************************************/ 262 263 // If reply or forum are spam, officially spam this reply 264 if ( $forum_data['post_status'] == bbp_get_spam_status_id() ) { 265 add_post_meta( $forum_id, '_bbp_spam_meta_status', bbp_get_public_status_id() ); 266 267 // Force view=all 268 $view_all = true; 269 } 270 271 /** Update counts, etc... *****************************************/ 272 273 $forum_args = array( 274 'forum_id' => $forum_id, 275 'post_parent' => $forum_parent_id, 276 'forum_author' => $forum_author, 277 'last_topic_id' => 0, 278 'last_reply_id' => 0, 279 'last_active_id' => 0, 280 'last_active_time' => 0, 281 'last_active_status' => bbp_get_public_status_id() 282 ); 283 do_action( 'bbp_new_forum', $forum_args ); 284 285 /** Redirect ******************************************************/ 286 287 // Redirect to 288 $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; 289 290 // Get the forum URL 291 $redirect_url = bbp_get_forum_permalink( $forum_id, $redirect_to ); 292 293 // Add view all? 294 if ( bbp_get_view_all() || !empty( $view_all ) ) { 295 296 // User can moderate, so redirect to forum with view all set 297 if ( current_user_can( 'moderate' ) ) { 298 $redirect_url = bbp_add_view_all( $redirect_url ); 299 300 // User cannot moderate, so redirect to forum 301 } else { 302 $redirect_url = bbp_get_forum_permalink( $forum_id ); 303 } 304 } 305 306 // Allow to be filtered 307 $redirect_url = apply_filters( 'bbp_new_forum_redirect_to', $redirect_url, $redirect_to ); 308 309 /** Successful Save ***********************************************/ 310 311 // Redirect back to new forum 312 wp_safe_redirect( $redirect_url ); 313 314 // For good measure 315 exit(); 316 317 // Errors 318 } else { 319 $append_error = ( is_wp_error( $forum_id ) && $forum_id->get_error_message() ) ? $forum_id->get_error_message() . ' ' : ''; 320 bbp_add_error( 'bbp_forum_error', __( '<strong>ERROR</strong>: The following problem(s) have been found with your forum:' . $append_error, 'bbpress' ) ); 321 } 322 } 323 } 324 325 /** 326 * Handles the front end edit forum submission 327 * 328 * @uses bbPress:errors::add() To log various error messages 329 * @uses bbp_get_forum() To get the forum 330 * @uses check_admin_referer() To verify the nonce and check the referer 331 * @uses bbp_is_forum_anonymous() To check if forum is by an anonymous user 332 * @uses current_user_can() To check if the current user can edit the forum 333 * @uses bbp_filter_anonymous_post_data() To filter anonymous data 334 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error} 335 * @uses esc_attr() For sanitization 336 * @uses bbp_is_forum_category() To check if the forum is a category 337 * @uses bbp_is_forum_closed() To check if the forum is closed 338 * @uses bbp_is_forum_private() To check if the forum is private 339 * @uses remove_filter() To remove 'wp_filter_kses' filters if needed 340 * @uses apply_filters() Calls 'bbp_edit_forum_pre_title' with the title and 341 * forum id 342 * @uses apply_filters() Calls 'bbp_edit_forum_pre_content' with the content 343 * and forum id 344 * @uses bbPress::errors::get_error_codes() To get the {@link WP_Error} errors 345 * @uses wp_save_post_revision() To save a forum revision 346 * @uses bbp_update_forum_revision_log() To update the forum revision log 347 * @uses bbp_stick_forum() To stick or super stick the forum 348 * @uses bbp_unstick_forum() To unstick the forum 349 * @uses wp_update_post() To update the forum 350 * @uses do_action() Calls 'bbp_edit_forum' with the forum id, forum id, 351 * anonymous data and reply author 352 * @uses bbp_move_forum_handler() To handle movement of a forum from one forum 353 * to another 354 * @uses bbp_get_forum_permalink() To get the forum permalink 355 * @uses wp_safe_redirect() To redirect to the forum link 356 * @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error 357 * messages 358 */ 359 function bbp_edit_forum_handler() { 360 361 // Bail if not a POST action 362 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 363 return; 364 365 // Bail if action is not bbp-edit-forum 366 if ( empty( $_POST['action'] ) || ( 'bbp-edit-forum' !== $_POST['action'] ) ) 367 return; 368 369 // Define local variable(s) 370 $forum = $forum_id = $forum_parent_id = $anonymous_data = 0; 371 $forum_title = $forum_content = $forum_edit_reason = ''; 372 $terms = array( bbp_get_forum_tag_tax_id() => array() ); 373 374 /** Forum *****************************************************************/ 375 376 // Forum id was not passed 377 if ( empty( $_POST['bbp_forum_id'] ) ) { 378 bbp_add_error( 'bbp_edit_forum_id', __( '<strong>ERROR</strong>: Forum ID not found.', 'bbpress' ) ); 379 380 // Forum id was passed 381 } elseif ( is_numeric( $_POST['bbp_forum_id'] ) ) { 382 $forum_id = (int) $_POST['bbp_forum_id']; 383 $forum = bbp_get_forum( $forum_id ); 384 } 385 386 // Forum does not exist 387 if ( empty( $forum ) ) { 388 bbp_add_error( 'bbp_edit_forum_not_found', __( '<strong>ERROR</strong>: The forum you want to edit was not found.', 'bbpress' ) ); 389 390 // Forum exists 391 } else { 392 393 // Nonce check 394 check_admin_referer( 'bbp-edit-forum_' . $forum_id ); 395 396 // Check users ability to create new forum 397 if ( !bbp_is_forum_anonymous( $forum_id ) ) { 398 399 // User cannot edit this forum 400 if ( !current_user_can( 'edit_forum', $forum_id ) ) { 401 bbp_add_error( 'bbp_edit_forum_permissions', __( '<strong>ERROR</strong>: You do not have permission to edit that forum.', 'bbpress' ) ); 402 } 403 404 // It is an anonymous post 405 } else { 406 407 // Filter anonymous data 408 $anonymous_data = bbp_filter_anonymous_post_data( array(), true ); 409 } 410 } 411 412 // Remove wp_filter_kses filters from title and content for capable users and if the nonce is verified 413 if ( current_user_can( 'unfiltered_html' ) && !empty( $_POST['_bbp_unfiltered_html_forum'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-forum_' . $forum_id ) == $_POST['_bbp_unfiltered_html_forum'] ) ) { 414 remove_filter( 'bbp_edit_forum_pre_title', 'wp_filter_kses' ); 415 remove_filter( 'bbp_edit_forum_pre_content', 'wp_filter_kses' ); 416 } 417 418 /** Forum Parent ***********************************************************/ 419 420 // Forum id was passed 421 if ( is_numeric( $_POST['bbp_forum_parent_id'] ) ) { 422 $forum_parent_id = (int) $_POST['bbp_forum_parent_id']; 423 } 424 425 // Current forum this forum is in 426 $current_parent_forum_id = bbp_get_forum_parent( $forum_id ); 427 428 // Forum exists 429 if ( !empty( $forum_parent_id ) && ( $forum_parent_id !== $current_parent_forum_id ) ) { 430 431 // Forum is closed and user cannot access 432 if ( bbp_is_forum_closed( $forum_parent_id ) && !current_user_can( 'edit_forum', $forum_parent_id ) ) { 433 bbp_add_error( 'bbp_edit_forum_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new forums.', 'bbpress' ) ); 434 } 435 436 // Forum is private and user cannot access 437 if ( bbp_is_forum_private( $forum_parent_id ) && !current_user_can( 'read_private_forums' ) ) { 438 bbp_add_error( 'bbp_edit_forum_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 439 } 440 441 // Forum is hidden and user cannot access 442 if ( bbp_is_forum_hidden( $forum_parent_id ) && !current_user_can( 'read_hidden_forums' ) ) { 443 bbp_add_error( 'bbp_edit_forum_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 444 } 445 } 446 447 /** Forum Title ***********************************************************/ 448 449 if ( !empty( $_POST['bbp_forum_title'] ) ) 450 $forum_title = esc_attr( strip_tags( $_POST['bbp_forum_title'] ) ); 451 452 // Filter and sanitize 453 $forum_title = apply_filters( 'bbp_edit_forum_pre_title', $forum_title, $forum_id ); 454 455 // No forum title 456 if ( empty( $forum_title ) ) 457 bbp_add_error( 'bbp_edit_forum_title', __( '<strong>ERROR</strong>: Your forum needs a title.', 'bbpress' ) ); 458 459 /** Forum Content *********************************************************/ 460 461 if ( !empty( $_POST['bbp_forum_content'] ) ) 462 $forum_content = $_POST['bbp_forum_content']; 463 464 // Filter and sanitize 465 $forum_content = apply_filters( 'bbp_edit_forum_pre_content', $forum_content, $forum_id ); 466 467 // No forum content 468 if ( empty( $forum_content ) ) 469 bbp_add_error( 'bbp_edit_forum_content', __( '<strong>ERROR</strong>: Your forum cannot be empty.', 'bbpress' ) ); 470 471 /** forum Blacklist *******************************************************/ 472 473 if ( !bbp_check_for_blacklist( $anonymous_data, bbp_get_forum_author_id( $forum_id ), $forum_title, $forum_content ) ) 474 bbp_add_error( 'bbp_forum_blacklist', __( '<strong>ERROR</strong>: Your forum cannot be edited at this time.', 'bbpress' ) ); 475 476 /** Forum Moderation ******************************************************/ 477 478 $post_status = bbp_get_public_status_id(); 479 if ( !bbp_check_for_moderation( $anonymous_data, bbp_get_forum_author_id( $forum_id ), $forum_title, $forum_content ) ) 480 $post_status = bbp_get_pending_status_id(); 481 482 /** Additional Actions (Before Save) **************************************/ 483 484 do_action( 'bbp_edit_forum_pre_extras', $forum_id ); 485 486 /** No Errors *************************************************************/ 487 488 if ( !bbp_has_errors() ) { 489 490 /** Update the forum **************************************************/ 491 492 // Add the content of the form to $post as an array 493 $forum_data = array( 494 'ID' => $forum_id, 495 'post_title' => $forum_title, 496 'post_content' => $forum_content, 497 'post_status' => $post_status, 498 'post_parent' => $forum_parent_id 499 ); 500 501 // Just in time manipulation of forum data before being edited 502 $forum_data = apply_filters( 'bbp_edit_forum_pre_insert', $forum_data ); 503 504 // Insert forum 505 $forum_id = wp_update_post( $forum_data ); 506 507 /** Revisions *********************************************************/ 508 509 /** 510 * @todo omitted for 2.1 511 // Revision Reason 512 if ( !empty( $_POST['bbp_forum_edit_reason'] ) ) 513 $forum_edit_reason = esc_attr( strip_tags( $_POST['bbp_forum_edit_reason'] ) ); 514 515 // Update revision log 516 if ( !empty( $_POST['bbp_log_forum_edit'] ) && ( 1 == $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) { 517 bbp_update_forum_revision_log( array( 518 'forum_id' => $forum_id, 519 'revision_id' => $revision_id, 520 'author_id' => bbp_get_current_user_id(), 521 'reason' => $forum_edit_reason 522 ) ); 523 } 524 * 525 */ 526 527 /** No Errors *********************************************************/ 528 529 if ( !empty( $forum_id ) && !is_wp_error( $forum_id ) ) { 530 531 // Update counts, etc... 532 $forum_args = array( 533 'forum_id' => $forum_id, 534 'post_parent' => $forum_parent_id, 535 'forum_author' => $forum->post_author, 536 'last_topic_id' => 0, 537 'last_reply_id' => 0, 538 'last_active_id' => 0, 539 'last_active_time' => 0, 540 'last_active_status' => bbp_get_public_status_id() 541 ); 542 do_action( 'bbp_edit_forum', $forum_args ); 543 544 // If the new forum parent id is not equal to the old forum parent 545 // id, run the bbp_move_forum action and pass the forum's parent id 546 // as the first arg and new forum parent id as the second. 547 // @todo implement 548 //if ( $forum_id != $forum->post_parent ) 549 // bbp_move_forum_handler( $forum_parent_id, $forum->post_parent, $forum_id ); 550 551 /** Additional Actions (After Save) *******************************/ 552 553 do_action( 'bbp_edit_forum_post_extras', $forum_id ); 554 555 /** Redirect ******************************************************/ 556 557 // Redirect to 558 $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; 559 560 // View all? 561 $view_all = bbp_get_view_all(); 562 563 // Get the forum URL 564 $forum_url = bbp_get_forum_permalink( $forum_id, $redirect_to ); 565 566 // Add view all? 567 if ( !empty( $view_all ) ) 568 $forum_url = bbp_add_view_all( $forum_url ); 569 570 // Allow to be filtered 571 $forum_url = apply_filters( 'bbp_edit_forum_redirect_to', $forum_url, $view_all, $redirect_to ); 572 573 /** Successful Edit ***********************************************/ 574 575 // Redirect back to new forum 576 wp_safe_redirect( $forum_url ); 577 578 // For good measure 579 exit(); 580 581 /** Errors ************************************************************/ 582 583 } else { 584 $append_error = ( is_wp_error( $forum_id ) && $forum_id->get_error_message() ) ? $forum_id->get_error_message() . ' ' : ''; 585 bbp_add_error( 'bbp_forum_error', __( '<strong>ERROR</strong>: The following problem(s) have been found with your forum:' . $append_error . 'Please try again.', 'bbpress' ) ); 586 } 587 } 77 588 } 78 589 -
branches/plugin/bbp-includes/bbp-forum-template.php
r3650 r3654 375 375 return apply_filters( 'bbp_get_forum_content', $content, $forum_id ); 376 376 } 377 378 /** 379 * Allow topic rows to have adminstrative actions 380 * 381 * @since bbPress (r3653) 382 * @uses do_action() 383 * @todo Links and filter 384 */ 385 function bbp_forum_row_actions() { 386 do_action( 'bbp_forum_row_actions' ); 387 } 377 388 378 389 /** -
branches/plugin/bbp-includes/bbp-topic-template.php
r3649 r3654 3150 3150 3151 3151 /** 3152 * Allow topic rows to have adminstrative actions 3153 * 3154 * @since bbPress (r3653) 3155 * @uses do_action() 3156 * @todo Links and filter 3157 */ 3158 function bbp_topic_row_actions() { 3159 do_action( 'bbp_topic_row_actions' ); 3160 } 3161 3162 /** 3152 3163 * Output value of topic tags field 3153 3164 * -
branches/plugin/bbp-themes/bbp-twentyten/bbpress/form-forum.php
r3651 r3654 68 68 69 69 <p> 70 <label for="bbp_forum_ id"><?php _e( 'Forum Type:', 'bbpress' ); ?></label><br />70 <label for="bbp_forum_type"><?php _e( 'Forum Type:', 'bbpress' ); ?></label><br /> 71 71 <?php bbp_form_forum_type_dropdown(); ?> 72 72 </p> … … 77 77 78 78 <p> 79 <label for="bbp_forum_ id"><?php _e( 'Status:', 'bbpress' ); ?></label><br />79 <label for="bbp_forum_status"><?php _e( 'Status:', 'bbpress' ); ?></label><br /> 80 80 <?php bbp_form_forum_status_dropdown(); ?> 81 81 </p> … … 86 86 87 87 <p> 88 <label for="bbp_forum_ id"><?php _e( 'Visibility:', 'bbpress' ); ?></label><br />88 <label for="bbp_forum_visibility"><?php _e( 'Visibility:', 'bbpress' ); ?></label><br /> 89 89 <?php bbp_form_forum_visibility_dropdown(); ?> 90 90 </p> … … 99 99 100 100 <p> 101 <label for="bbp_forum_ id"><?php _e( 'Parent Forum:', 'bbpress' ); ?></label><br />102 <?php bbp_dropdown( array( 's how_none' => __( '(No Parent)', 'bbpress' ), 'selected' => bbp_get_form_forum_parent() ) ); ?>101 <label for="bbp_forum_parent_id"><?php _e( 'Parent Forum:', 'bbpress' ); ?></label><br /> 102 <?php bbp_dropdown( array( 'select_id' => 'bbp_forum_parent_id', 'show_none' => __( '(No Parent)', 'bbpress' ), 'selected' => bbp_get_form_forum_parent() ) ); ?> 103 103 </p> 104 104 -
branches/plugin/bbp-themes/bbp-twentyten/bbpress/loop-single-forum.php
r3651 r3654 32 32 <?php do_action( 'bbp_theme_after_forum_description' ); ?> 33 33 34 <?php bbp_forum_row_actions(); ?> 35 34 36 </li> 35 37 -
branches/plugin/bbp-themes/bbp-twentyten/bbpress/loop-single-topic.php
r3651 r3654 45 45 46 46 <?php do_action( 'bbp_theme_after_topic_meta' ); ?> 47 48 <?php bbp_topic_row_actions(); ?> 47 49 48 50 </li> -
branches/plugin/bbp-themes/bbp-twentyten/css/bbpress.css
r3653 r3654 418 418 float: right; 419 419 clear: none; 420 margin-left: 25px; 420 421 } 421 422 … … 763 764 padding-left: 10px; 764 765 } 766 767 /* =BuddyPress Group Forums 768 -------------------------------------------------------------- */ 769 770 body.groups #bbpress-forums { 771 margin: -19px -19px 0 -19px; 772 } 773 774 body.groups #bbpress-forums ul.bbp-forums, 775 body.groups #bbpress-forums ul.bbp-topics, 776 body.groups #bbpress-forums ul.bbp-forums { 777 border: none; 778 } 779 780 #bbpress-forums div.row-actions { 781 font-size: 11px; 782 visibility: hidden; 783 } 784 785 #bbpress-forums li:hover > div.row-actions { 786 visibility: visible; 787 }
Note: See TracChangeset
for help on using the changeset viewer.