Changeset 10821
- Timestamp:
- 05/29/2016 07:08:27 AM (9 years ago)
- Location:
- trunk/src/bp-forums
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-forums/bp-forums-bbpress-sa.php
r10417 r10821 13 13 /** 14 14 * Bootstrap bbPress 1.x, and manipulate globals to integrate with BuddyPress. 15 * 16 * @since 1.1.0 15 17 * 16 18 * @return bool|null Returns false on failure. … … 157 159 * Get the current bbPress user. 158 160 * 161 * @since 1.1.0 162 * 159 163 * @return object $current_user Current user object from WordPress. 160 164 */ … … 163 167 /** 164 168 * Get userdata for a bbPress user. 169 * 170 * @since 1.1.0 165 171 * 166 172 * @param int $user_id User ID. … … 174 180 * Noop. 175 181 * 182 * @since 1.1.0 183 * 176 184 * @param array $users Array of users. 177 185 */ … … 180 188 /** 181 189 * The bbPress plugin needs this class for its usermeta manipulation. 190 * 191 * @since 1.1.0 182 192 */ 183 193 class BP_Forums_BB_Auth { 194 195 /** 196 * Update usermeta data. 197 * 198 * @since 1.1.0 199 * 200 * @param string $args Array of arguments. 201 * @return bool 202 */ 184 203 function update_meta( $args = '' ) { 185 204 $defaults = array( 'id' => 0, 'meta_key' => null, 'meta_value' => null, 'meta_table' => 'usermeta', 'meta_field' => 'user_id', 'cache_group' => 'users' ); … … 199 218 */ 200 219 if ( ! class_exists( 'BPDB' ) ) : 220 221 /** 222 * WPDB class extension. 223 * 224 * @since 1.1.0 225 */ 201 226 class BPDB extends WPDB { 202 227 var $db_servers = array(); … … 204 229 /** 205 230 * Constructor. 231 * 232 * @since 1.1.0 206 233 * 207 234 * @see WPDB::__construct() for description of parameters. … … 226 253 * supported by WordPress' minimum required MySQL version, so 227 254 * this is safe. 255 * 256 * @since 1.1.0 228 257 * 229 258 * @see WPDB::has_cap() for a description of parameters and … … 280 309 * Stub for escape_deep() compatibility. 281 310 * 311 * @since 1.1.0 312 * 282 313 * @see WPDB::escape_deep() for description of parameters and 283 314 * return values. … … 296 327 * 297 328 * The bbPress plugin needs this to convert vars. 329 * 330 * @since 1.1.0 298 331 * 299 332 * @param object $object Object to convert. … … 318 351 * Copied from wp-admin/includes/upgrade.php, this will take care of creating 319 352 * the bbPress stand-alone tables without loading a conflicting WP Admin. 353 * 354 * @since 1.5.0 320 355 * 321 356 * @see dbDelta() for a description of parameters and return value. -
trunk/src/bp-forums/bp-forums-filters.php
r10417 r10821 58 58 /** 59 59 * Custom KSES filter for the Forums component. 60 * 61 * @since 1.2.0 60 62 * 61 63 * @param string $content Content to sanitize. … … 99 101 * Get a link for a forum topic tags directory. 100 102 * 103 * @since 1.1.0 104 * 101 105 * @param string $link Link passed from filter. 102 106 * @param string $tag Name of the tag. … … 120 124 * Add rel="nofollow" to bbPress content. 121 125 * 126 * @since 1.2.1 127 * 122 128 * @param string $text Post content. 123 129 * @return string Modified post content. … … 128 134 /** 129 135 * Callback for preg_replace_callback() in bp_forums_make_nofollow_filter(). 136 * 137 * @since 1.2.1 130 138 * 131 139 * @param array $matches Regex matches from {@link bp_forums_make_nofollow_filter()}. … … 141 149 * Append forum topic to page title. 142 150 * 151 * @since 1.2.6 152 * 143 153 * @see bp_modify_page_title() 144 154 * … … 164 174 * Prevents embedded anchor tags. 165 175 * 176 * @since 1.5.0 177 * 166 178 * @param string $content Edited post content. 167 179 * @return string $content Sanitized post content. -
trunk/src/bp-forums/bp-forums-functions.php
r10417 r10821 77 77 * Wrapper for {@link bb_get_forum()}. 78 78 * 79 * @since 1.0.0 80 * 79 81 * @param int $forum_id ID of the forum being fetched. 80 82 * @return object bbPress forum object. … … 91 93 * 92 94 * Wrapper for {@link bb_new_forum()}. 95 * 96 * @since 1.0.0 93 97 * 94 98 * @param array|string $args { … … 124 128 * 125 129 * Wrapper for {@link bb_update_forum(}. 130 * 131 * @since 1.2.5 126 132 * 127 133 * @param array|string $args { … … 159 165 * Delete a group forum by the group id. 160 166 * 167 * @since 1.6.0 168 * 161 169 * @param int $group_id ID of the group whose forum is to be deleted. 162 170 */ … … 177 185 /** 178 186 * Fetch a set of forum topics. 187 * 188 * @since 1.1.0 179 189 * 180 190 * @param array|string $args { … … 256 266 * Get additional details about a given forum topic. 257 267 * 268 * @since 1.0.0 269 * 258 270 * @param int $topic_id ID of the topic for which you're fetching details. 259 271 * @return object Details about the topic. … … 274 286 * Wrapper for {@link bb_get_id_from_slug()}. 275 287 * 288 * @since 1.1.0 289 * 276 290 * @param string $topic_slug Slug of the topic. 277 291 * @return int|bool ID of the topic (if found), false on failure. … … 290 304 /** 291 305 * Create a new forum topic. 306 * 307 * @since 1.0.0 292 308 * 293 309 * @param array|string $args { … … 374 390 * Update a topic's details. 375 391 * 392 * @since 1.1.0 393 * 376 394 * @param array|string $args { 377 395 * Array of arguments. … … 419 437 } 420 438 439 /** 440 * Set a topic as sticky/unsticky. 441 * 442 * @since 1.1.0 443 * 444 * @param string $args Array of arguments for sticky topic. 445 * @return bool 446 */ 421 447 function bp_forums_sticky_topic( $args = '' ) { 422 448 … … 440 466 /** 441 467 * Set a topic's open/closed status. 468 * 469 * @since 1.1.0 442 470 * 443 471 * @param array|string $args { … … 470 498 * Delete a topic. 471 499 * 500 * @since 1.1.0 501 * 472 502 * @param array|string $args { 473 503 * @type int $topic_id ID of the topic being deleted. … … 490 520 /** 491 521 * Get a count of the total topics on the site. 522 * 523 * @since 1.2.0 492 524 * 493 525 * @return int $count Total topic count. … … 593 625 * Get a total "Topics Started" count for a given user. 594 626 * 627 * @since 1.2.0 628 * 595 629 * @param int $user_id ID of the user being queried. Falls back on displayed 596 630 * user, then loggedin. … … 694 728 * - information about topic users that may have been deleted/spammed 695 729 * 730 * @since 1.2.0 731 * 696 732 * @param array $topics Array of topics. 697 733 * @return array $topics Topics with BP details added. … … 757 793 * Get the posts belonging to a topic. 758 794 * 795 * @since 1.1.0 796 * 759 797 * @param array|string $args { 760 798 * @type int $topic_id ID of the topic for which posts are being fetched. … … 789 827 * Wrapper for {@link bb_get_post()}. 790 828 * 829 * @since 1.0.0 830 * 791 831 * @param int $post_id ID of the post being fetched. 792 832 * @return object Post object. … … 803 843 * 804 844 * Wrapper for {@link bb_delete_post()}. 845 * 846 * @since 1.1.0 805 847 * 806 848 * @param array|string $args { … … 825 867 /** 826 868 * Create a new post. 869 * 870 * @since 1.1.0 827 871 * 828 872 * @param array|string $args { … … 906 950 * - BP fullname for each poster 907 951 * 952 * @since 1.2.0 953 * 908 954 * @param array $posts List of posts. 909 955 * @return array Posts with BP-data added. … … 959 1005 * Get topic and post counts for a given forum. 960 1006 * 1007 * @since 1.1.0 1008 * 961 1009 * @param int $forum_id ID of the forum. 962 1010 * @return object Object with properties $topics (topic count) and $posts … … 975 1023 /** 976 1024 * Map WordPress caps onto bbPress users, to ensure that they can post. 1025 * 1026 * @since 1.1.0 977 1027 * 978 1028 * @param array $allcaps Array of capabilities. -
trunk/src/bp-forums/bp-forums-loader.php
r10417 r10821 16 16 defined( 'ABSPATH' ) || exit; 17 17 18 /** 19 * Sets up the forums component. 20 * 21 * @since 1.5.0 22 */ 18 23 class BP_Forums_Component extends BP_Component { 19 24 … … 80 85 /** 81 86 * Include bp-forums files. 87 * 88 * @since 1.5.0 82 89 * 83 90 * @see BP_Component::includes() for description of parameters. … … 239 246 /** 240 247 * Set up the title for pages and the <title> element. 248 * 249 * @since 1.5.0 241 250 */ 242 251 public function setup_title() { … … 264 273 /** 265 274 * Set up the bp-forums component. 275 * 276 * @since 1.6.0 266 277 */ 267 278 function bp_setup_forums() { -
trunk/src/bp-forums/bp-forums-screens.php
r10417 r10821 13 13 /** 14 14 * Load the Forums directory. 15 * 16 * @since 1.1.0 15 17 */ 16 18 function bp_forums_directory_forums_setup() { … … 103 105 /** 104 106 * Load the Topics Started screen. 107 * 108 * @since 1.5.0 105 109 */ 106 110 function bp_member_forums_screen_topics() { … … 125 129 /** 126 130 * Load the Replied To screen. 131 * 132 * @since 1.5.0 127 133 */ 128 134 function bp_member_forums_screen_replies() { … … 149 155 * 150 156 * Note that this feature is not fully implemented at the moment. 157 * 158 * @since 1.5.0 151 159 */ 152 160 function bp_member_forums_screen_favorites() { … … 171 179 /** 172 180 * Load a single forum page. 181 * 182 * @since 1.5.0 173 183 */ 174 184 function bp_forums_screen_single_forum() { … … 197 207 /** 198 208 * Load a single forum topic page. 209 * 210 * @since 1.5.0 199 211 */ 200 212 function bp_forums_screen_single_topic() { -
trunk/src/bp-forums/bp-forums-template.php
r10712 r10821 105 105 * 106 106 * Responsible for loading a group of forum topics into a loop for display. 107 * 108 * @since 1.0.0 107 109 */ 108 110 class BP_Forums_Template_Forum { … … 110 112 * The loop iterator. 111 113 * 114 * @since 1.0.0 112 115 * @var int 113 116 */ … … 117 120 * The number of topics returned by the paged query. 118 121 * 122 * @since 1.0.0 119 123 * @var int 120 124 */ … … 124 128 * Array of topics located by the query. 125 129 * 130 * @since 1.0.0 126 131 * @var array 127 132 */ … … 131 136 * The topic object currently being iterated on. 132 137 * 138 * @since 1.0.0 133 139 * @var object 134 140 */ … … 138 144 * The ID of the forum whose topics are being queried. 139 145 * 146 * @since 1.5.0 140 147 * @var int 141 148 */ … … 145 152 * A flag for whether the loop is currently being iterated. 146 153 * 154 * @since 1.0.0 147 155 * @var bool 148 156 */ … … 152 160 * The page number being requested. 153 161 * 162 * @since 1.0.0 154 163 * @var int 155 164 */ … … 159 168 * The number of items being requested per page. 160 169 * 170 * @since 1.0.0 161 171 * @var int 162 172 */ … … 166 176 * An HTML string containing pagination links. 167 177 * 178 * @since 1.0.0 168 179 * @var string 169 180 */ … … 173 184 * The total number of topics matching the query parameters. 174 185 * 186 * @since 1.0.0 175 187 * @var int 176 188 */ … … 180 192 * Whether requesting a single topic. Not currently used. 181 193 * 194 * @since 1.0.0 182 195 * @var bool 183 196 */ … … 187 200 * Term to sort by. Not currently used. 188 201 * 202 * @since 1.0.0 189 203 * @var string 190 204 */ … … 194 208 * Sort order. Not currently used. 195 209 * 210 * @since 1.0.0 196 211 * @var string 197 212 */ … … 200 215 /** 201 216 * Constructor method. 217 * 218 * @since 1.5.0 202 219 * 203 220 * @param string $type The 'type' is the sort order/kind. 'newest', … … 357 374 * Whether there are topics available in the loop. 358 375 * 376 * @since 1.0.0 377 * 359 378 * @see bp_has_forum_topics() 360 379 * … … 372 391 * Set up the next topic and iterate index. 373 392 * 393 * @since 1.0.0 394 * 374 395 * @return object The next topic to iterate over. 375 396 */ … … 383 404 /** 384 405 * Rewind the topics and reset topic index. 406 * 407 * @since 1.0.0 385 408 */ 386 409 function rewind_topics() { … … 399 422 * 400 423 * @see bp_forum_topics() 424 * 425 * @since 1.0.0 401 426 * 402 427 * @return bool True if there are more topics to show, otherwise false. … … 424 449 * Set up the current topic in the loop. 425 450 * 451 * @since 1.0.0 452 * 426 453 * @see bp_the_forum_topic() 427 454 */ … … 451 478 * are determined dynamically, depending on your current page. All of these 452 479 * $defaults can be overridden in the $args parameter. 480 * 481 * @since 1.1.0 453 482 * 454 483 * @uses apply_filters() Filter 'bp_has_topics' to manipulate the … … 664 693 * Determine whether there are still topics left in the loop. 665 694 * 695 * @since 1.1.0 696 * 666 697 * @global BP_Forums_Template_Forum $forum_template Template global. 667 698 * … … 676 707 * Get the current topic object in the loop. 677 708 * 709 * @since 1.1.0 710 * 678 711 * @global BP_Forums_Template_Forum $forum_template Template global. 679 712 * … … 687 720 /** 688 721 * Output the ID of the current topic in the loop. 722 * 723 * @since 1.0.0 689 724 */ 690 725 function bp_the_topic_id() { … … 694 729 * Return the ID of the current topic in the loop. 695 730 * 731 * @since 1.0.0 732 * 696 733 * @return int ID of the current topic in the loop. 697 734 */ … … 711 748 /** 712 749 * Output the title of the current topic in the loop. 750 * 751 * @since 1.0.0 713 752 */ 714 753 function bp_the_topic_title() { … … 718 757 * Return the title of the current topic in the loop. 719 758 * 759 * @since 1.0.0 760 * 720 761 * @return string Title of the current topic in the loop. 721 762 */ … … 735 776 /** 736 777 * Output the slug of the current topic in the loop. 778 * 779 * @since 1.0.0 737 780 */ 738 781 function bp_the_topic_slug() { … … 742 785 * Return the slug of the current topic in the loop. 743 786 * 787 * @since 1.0.0 788 * 744 789 * @return string Slug of the current topic in the loop. 745 790 */ … … 759 804 /** 760 805 * Output the text of the first post in the current topic in the loop. 806 * 807 * @since 1.1.0 761 808 */ 762 809 function bp_the_topic_text() { … … 766 813 * Return the text of the first post in the current topic in the loop. 767 814 * 815 * @since 1.1.0 816 * 768 817 * @return string Text of the first post in the current topic. 769 818 */ … … 785 834 /** 786 835 * Output the ID of the user who posted the current topic in the loop. 836 * 837 * @since 1.0.0 787 838 */ 788 839 function bp_the_topic_poster_id() { … … 792 843 * Return the ID of the user who posted the current topic in the loop. 793 844 * 845 * @since 1.0.0 846 * 794 847 * @return int ID of the user who posted the current topic. 795 848 */ … … 810 863 * Output the avatar of the user who posted the current topic in the loop. 811 864 * 865 * @since 1.0.0 866 * 812 867 * @see bp_get_the_topic_poster_avatar() for a description of arguments. 813 868 * … … 819 874 /** 820 875 * Return the avatar of the user who posted the current topic in the loop. 876 * 877 * @since 1.0.0 821 878 * 822 879 * @param array|string $args { … … 860 917 /** 861 918 * Output the name of the user who posted the current topic in the loop. 919 * 920 * @since 1.0.0 862 921 */ 863 922 function bp_the_topic_poster_name() { … … 867 926 * Return the name of the user who posted the current topic in the loop. 868 927 * 928 * @since 1.0.0 929 * 869 930 * @return string Name of the user who posted the current topic. 870 931 */ … … 889 950 /** 890 951 * Output the ID of the object associated with the current topic in the loop. 952 * 953 * @since 1.1.0 891 954 */ 892 955 function bp_the_topic_object_id() { … … 898 961 * Objects are things like associated groups. 899 962 * 963 * @since 1.1.0 964 * 900 965 * @return int ID of the associated object. 901 966 */ … … 917 982 /** 918 983 * Output the name of the object associated with the current topic in the loop. 984 * 985 * @since 1.1.0 919 986 */ 920 987 function bp_the_topic_object_name() { … … 926 993 * Objects are things like groups. So this function would return the 927 994 * name of the group associated with the forum topic, if it exists. 995 * 996 * @since 1.1.0 928 997 * 929 998 * @return string Object name. … … 952 1021 /** 953 1022 * Output the slug of the object associated with the current topic in the loop. 1023 * 1024 * @since 1.1.0 954 1025 */ 955 1026 function bp_the_topic_object_slug() { … … 962 1033 * slug of the group associated with the forum topic, if it exists. 963 1034 * 1035 * @since 1.1.0 1036 * 964 1037 * @return string Object slug. 965 1038 */ … … 982 1055 /** 983 1056 * Output the permalink of the object associated with the current topic in the loop. 1057 * 1058 * @since 1.1.0 984 1059 */ 985 1060 function bp_the_topic_object_permalink() { … … 991 1066 * Objects are things like groups. So this function would return the 992 1067 * permalink of the group associated with the forum topic, if it exists. 1068 * 1069 * @since 1.1.0 993 1070 * 994 1071 * @return string Object permalink. … … 1018 1095 /** 1019 1096 * Output the linked name of the user who last posted to the current topic in the loop. 1097 * 1098 * @since 1.0.0 1020 1099 */ 1021 1100 function bp_the_topic_last_poster_name() { … … 1024 1103 /** 1025 1104 * Return the linked name of the user who last posted to the current topic in the loop. 1105 * 1106 * @since 1.0.0 1026 1107 * 1027 1108 * @return string HTML link to the profile of the user who last posted … … 1052 1133 * Output the permalink of the object associated with the current topic in the loop. 1053 1134 * 1135 * @since 1.1.0 1136 * 1054 1137 * @see bp_get_the_topic_object_avatar() for description of arguments. 1055 1138 * … … 1064 1147 * Objects are things like groups. So this function would return the 1065 1148 * avatar of the group associated with the forum topic, if it exists. 1149 * 1150 * @since 1.1.0 1066 1151 * 1067 1152 * @param array|string $args { … … 1109 1194 * Output the avatar for the user who last posted to the current topic in the loop. 1110 1195 * 1196 * @since 1.0.0 1197 * 1111 1198 * @see bp_get_the_topic_last_poster_avatar() for description of arguments. 1112 1199 * … … 1118 1205 /** 1119 1206 * Return the avatar for the user who last posted to the current topic in the loop. 1207 * 1208 * @since 1.0.0 1120 1209 * 1121 1210 * @param array|string $args { … … 1159 1248 /** 1160 1249 * Output the start time of the current topic in the loop. 1250 * 1251 * @since 1.0.0 1161 1252 */ 1162 1253 function bp_the_topic_start_time() { … … 1166 1257 * Return the start time of the current topic in the loop. 1167 1258 * 1259 * @since 1.0.0 1260 * 1168 1261 * @return string Start time of the current topic. 1169 1262 */ … … 1183 1276 /** 1184 1277 * Output the topic time of the current topic in the loop. 1278 * 1279 * @since 1.0.0 1185 1280 */ 1186 1281 function bp_the_topic_time() { … … 1190 1285 * Return the topic time of the current topic in the loop. 1191 1286 * 1287 * @since 1.0.0 1288 * 1192 1289 * @return string Topic time of the current topic. 1193 1290 */ … … 1207 1304 /** 1208 1305 * Output the ID of the forum associated with the current topic in the loop. 1306 * 1307 * @since 1.0.0 1209 1308 */ 1210 1309 function bp_the_topic_forum_id() { … … 1214 1313 * Return the ID of the forum associated with the current topic in the loop. 1215 1314 * 1315 * @since 1.0.0 1316 * 1216 1317 * @return int ID of the forum associated with the current topic. 1217 1318 */ … … 1231 1332 /** 1232 1333 * Output the status of the current topic in the loop. 1334 * 1335 * @since 1.0.0 1233 1336 */ 1234 1337 function bp_the_topic_status() { … … 1238 1341 * Return the status of the current topic in the loop. 1239 1342 * 1343 * @since 1.0.0 1344 * 1240 1345 * @return string Status of the current topic. 1241 1346 */ … … 1255 1360 /** 1256 1361 * Output whether the current topic in the loop is open. 1362 * 1363 * @since 1.0.0 1257 1364 */ 1258 1365 function bp_the_topic_is_topic_open() { … … 1262 1369 * Return whether the current topic in the loop is open. 1263 1370 * 1371 * @since 1.0.0 1372 * 1264 1373 * @return string 1265 1374 */ … … 1279 1388 /** 1280 1389 * Output the ID of the last post in the current topic in the loop. 1390 * 1391 * @since 1.0.0 1281 1392 */ 1282 1393 function bp_the_topic_last_post_id() { … … 1286 1397 * Return the ID of the last post in the current topic in the loop. 1287 1398 * 1399 * @since 1.0.0 1400 * 1288 1401 * @return int ID of the last post in the current topic. 1289 1402 */ … … 1303 1416 /** 1304 1417 * Output whether the current topic in the loop is sticky. 1418 * 1419 * @since 1.0.0 1305 1420 */ 1306 1421 function bp_the_topic_is_sticky() { … … 1310 1425 * Return whether the current topic in the loop is sticky. 1311 1426 * 1427 * @since 1.0.0 1428 * 1312 1429 * @return bool 1313 1430 */ … … 1327 1444 /** 1328 1445 * Output a 'x posts' string with the number of posts in the current topic. 1446 * 1447 * @since 1.0.0 1329 1448 */ 1330 1449 function bp_the_topic_total_post_count() { … … 1333 1452 /** 1334 1453 * Return a 'x posts' string with the number of posts in the current topic. 1454 * 1455 * @since 1.0.0 1335 1456 * 1336 1457 * @return string String of the form 'x posts'. … … 1358 1479 /** 1359 1480 * Output the total number of posts in the current topic in the loop. 1481 * 1482 * @since 1.1.0 1360 1483 */ 1361 1484 function bp_the_topic_total_posts() { … … 1365 1488 * Return the total number of posts in the current topic in the loop. 1366 1489 * 1490 * @since 1.1.0 1491 * 1367 1492 * @return int Total number of posts in the current topic. 1368 1493 */ … … 1382 1507 /** 1383 1508 * Output the tag count for the current topic in the loop. 1509 * 1510 * @since 1.0.0 1384 1511 */ 1385 1512 function bp_the_topic_tag_count() { … … 1389 1516 * Return the tag count for the current topic in the loop. 1390 1517 * 1518 * @since 1.0.0 1519 * 1391 1520 * @return int Tag count for the current topic. 1392 1521 */ … … 1406 1535 /** 1407 1536 * Output the permalink of the current topic in the loop. 1537 * 1538 * @since 1.0.0 1408 1539 */ 1409 1540 function bp_the_topic_permalink() { … … 1412 1543 /** 1413 1544 * Return the permalink for the current topic in the loop. 1545 * 1546 * @since 1.0.0 1414 1547 * 1415 1548 * @return string Permalink for the current topic. … … 1447 1580 /** 1448 1581 * Output a 'since' string describing when the current topic was created. 1582 * 1583 * @since 1.0.0 1449 1584 */ 1450 1585 function bp_the_topic_time_since_created() { … … 1454 1589 * Return a 'since' string describing when the current topic was created. 1455 1590 * 1591 * @since 1.0.0 1592 * 1456 1593 * @see bp_core_time_since() for a description of return value. 1457 1594 * … … 1474 1611 * Output an excerpt from the latest post of the current topic in the loop. 1475 1612 * 1613 * @since 1.0.0 1614 * 1476 1615 * @param array|string $args See {@bp_get_the_topic_latest_post_excerpt()}. 1477 1616 */ … … 1481 1620 /** 1482 1621 * Return an excerpt from the latest post of the current topic in the loop. 1622 * 1623 * @since 1.0.0 1483 1624 * 1484 1625 * @param array|string $args { … … 1513 1654 /** 1514 1655 * Output a 'since' string describing when the last post in the current topic was created. 1656 * 1657 * @since 1.0.0 1515 1658 */ 1516 1659 function bp_the_topic_time_since_last_post() { … … 1520 1663 * Return a 'since' string describing when the last post in the current topic was created. 1521 1664 * 1665 * @since 1.0.0 1666 * 1522 1667 * @see bp_core_time_since() for a description of return value. 1523 1668 * … … 1539 1684 /** 1540 1685 * Output whether the current topic in the loop belongs to the logged-in user. 1686 * 1687 * @since 1.1.0 1541 1688 */ 1542 1689 function bp_the_topic_is_mine() { … … 1546 1693 * Does the current topic belong to the logged-in user? 1547 1694 * 1695 * @since 1.1.0 1696 * 1548 1697 * @return bool True if the current topic in the loop was created by 1549 1698 * the logged-in user, otherwise false. … … 1558 1707 * Output the admin links for the current topic in the loop. 1559 1708 * 1709 * @since 1.1.0 1710 * 1560 1711 * @see bp_get_the_topic_admin_links() for a description of arguments. 1561 1712 * … … 1567 1718 /** 1568 1719 * Return the admin links for the current topic in the loop. 1720 * 1721 * @since 1.1.0 1569 1722 * 1570 1723 * @param array|string $args { … … 1604 1757 /** 1605 1758 * Output the CSS class for the current topic in the loop. 1759 * 1760 * @since 1.1.0 1606 1761 */ 1607 1762 function bp_the_topic_css_class() { … … 1614 1769 * based on context. 1615 1770 * 1771 * @since 1.1.0 1772 * 1616 1773 * @return string Contents of the 'class' attribute. 1617 1774 */ … … 1645 1802 /** 1646 1803 * Output the permalink to the 'personal' topics tab. 1804 * 1805 * @since 1.1.0 1647 1806 */ 1648 1807 function bp_my_forum_topics_link() { … … 1652 1811 * Return the permalink to the 'personal' topics tab. 1653 1812 * 1813 * @since 1.1.0 1814 * 1654 1815 * @return string Link to the 'personal' topics tab. 1655 1816 */ … … 1667 1828 /** 1668 1829 * Output the permalink to the 'unreplied' topics tab. 1830 * 1831 * @since 1.1.0 1669 1832 */ 1670 1833 function bp_unreplied_forum_topics_link() { … … 1674 1837 * Return the permalink to the 'unreplied' topics tab. 1675 1838 * 1839 * @since 1.1.0 1840 * 1676 1841 * @return string Link to the 'unreplied' topics tab. 1677 1842 */ … … 1689 1854 /** 1690 1855 * Output the permalink to the 'popular' topics tab. 1856 * 1857 * @since 1.1.0 1691 1858 */ 1692 1859 function bp_popular_forum_topics_link() { … … 1696 1863 * Return the permalink to the 'popular' topics tab. 1697 1864 * 1865 * @since 1.1.0 1866 * 1698 1867 * @return string Link to the 'popular' topics tab. 1699 1868 */ … … 1711 1880 /** 1712 1881 * Output the link to the forums directory. 1882 * 1883 * @since 1.1.0 1713 1884 */ 1714 1885 function bp_newest_forum_topics_link() { … … 1718 1889 * Return the link to the forums directory. 1719 1890 * 1891 * @since 1.1.0 1892 * 1720 1893 * @return string Link to the forums directory. 1721 1894 */ … … 1733 1906 /** 1734 1907 * Output the currently viewed topic list type. 1908 * 1909 * @since 1.1.0 1735 1910 */ 1736 1911 function bp_forum_topic_type() { … … 1741 1916 * 1742 1917 * Eg, 'newest', 'popular', etc. 1918 * 1919 * @since 1.1.0 1743 1920 * 1744 1921 * @return string Type of the currently viewed topic list. … … 1806 1983 * Output the currently viewed tag name. 1807 1984 * 1985 * @since 1.1.0 1986 * 1808 1987 * @todo Deprecate? 1809 1988 */ … … 1814 1993 * Return the currently viewed tag name. 1815 1994 * 1995 * @since 1.1.0 1996 * 1816 1997 * @todo Deprecate? Seems unused 1817 1998 * … … 1826 2007 /** 1827 2008 * Output the pagination links for the current topic list. 2009 * 2010 * @since 1.0.0 1828 2011 */ 1829 2012 function bp_forum_pagination() { … … 1833 2016 * Return the pagination links for the current topic list. 1834 2017 * 2018 * @since 1.0.0 2019 * 1835 2020 * @return string HTML pagination links. 1836 2021 */ … … 1850 2035 /** 1851 2036 * Output the pagination count for the current topic list. 2037 * 2038 * @since 1.0.0 1852 2039 */ 1853 2040 function bp_forum_pagination_count() { … … 1858 2045 * 1859 2046 * The "count" is a string of the form "Viewing x of y topics". 2047 * 2048 * @since 1.5.0 1860 2049 * 1861 2050 * @return string … … 1895 2084 * Are we currently on an Edit Topic screen? 1896 2085 * 2086 * @since 1.1.0 2087 * 1897 2088 * @return bool True if currently editing a topic, otherwise false. 1898 2089 */ … … 1909 2100 * 1910 2101 * Responsible for loading a topic's posts into a loop for display. 2102 * 2103 * @since 1.0.0 1911 2104 */ 1912 2105 class BP_Forums_Template_Topic { … … 1914 2107 * The loop iterator. 1915 2108 * 2109 * @since 1.0.0 1916 2110 * @var int 1917 2111 */ … … 1921 2115 * The number of posts returned by the paged query. 1922 2116 * 2117 * @since 1.0.0 1923 2118 * @var int 1924 2119 */ … … 1928 2123 * Array of posts located by the query. 1929 2124 * 2125 * @since 1.0.0 1930 2126 * @var array 1931 2127 */ … … 1935 2131 * The post object currently being iterated on. 1936 2132 * 2133 * @since 1.0.0 1937 2134 * @var object 1938 2135 */ … … 1942 2139 * The ID of the forum whose topic is being queried. 1943 2140 * 2141 * @since 1.5.0 1944 2142 * @var int 1945 2143 */ … … 1949 2147 * The ID of the topic whose posts are being queried. 1950 2148 * 2149 * @since 1.0.0 1951 2150 * @var int 1952 2151 */ … … 1956 2155 * The topic object to which the posts belong. 1957 2156 * 2157 * @since 1.0.0 1958 2158 * @var object 1959 2159 */ … … 1963 2163 * A flag for whether the loop is currently being iterated. 1964 2164 * 2165 * @since 1.0.0 1965 2166 * @var bool 1966 2167 */ … … 1979 2180 * The page number being requested. 1980 2181 * 2182 * @since 1.0.0 1981 2183 * @var int 1982 2184 */ … … 1986 2188 * The number of items being requested per page. 1987 2189 * 2190 * @since 1.0.0 1988 2191 * @var int 1989 2192 */ … … 1993 2196 * An HTML string containing pagination links. 1994 2197 * 2198 * @since 1.0.0 1995 2199 * @var string 1996 2200 */ … … 2000 2204 * The total number of posts matching the query parameters. 2001 2205 * 2206 * @since 1.0.0 2002 2207 * @var int 2003 2208 */ … … 2007 2212 * Whether requesting a single topic. Not currently used. 2008 2213 * 2214 * @since 1.0.0 2009 2215 * @var bool 2010 2216 */ … … 2014 2220 * Term to sort by. 2015 2221 * 2222 * @since 1.0.0 2016 2223 * @var string 2017 2224 */ … … 2021 2228 * Sort order. 2022 2229 * 2230 * @since 1.0.0 2023 2231 * @var string 2024 2232 */ … … 2027 2235 /** 2028 2236 * Constructor method. 2237 * 2238 * @since 1.5.0 2029 2239 * 2030 2240 * @param int $topic_id ID of the topic whose posts are being requested. … … 2097 2307 * Whether there are posts available in the loop. 2098 2308 * 2309 * @since 1.0.0 2310 * 2099 2311 * @see bp_has_forum_topic_posts() 2100 2312 * … … 2111 2323 * Set up the next post and iterate index. 2112 2324 * 2325 * @since 1.0.0 2326 * 2113 2327 * @return object The next post to iterate over. 2114 2328 */ … … 2122 2336 /** 2123 2337 * Rewind the posts and reset post index. 2338 * 2339 * @since 1.0.0 2124 2340 */ 2125 2341 function rewind_posts() { … … 2136 2352 * the while loop that controls iteration inside the blogs loop, eg: 2137 2353 * while ( bp_forum_topic_posts() ) { ... 2354 * 2355 * @since 1.0.0 2138 2356 * 2139 2357 * @see bp_forum_topic_posts() … … 2163 2381 * Set up the current topic in the loop. 2164 2382 * 2383 * @since 1.0.0 2384 * 2165 2385 * @see bp_the_forum_topic_post() 2166 2386 */ … … 2185 2405 /** 2186 2406 * Initiate the loop for a single topic's posts. 2407 * 2408 * @since 1.1.0 2187 2409 * 2188 2410 * @param array|string $args { … … 2239 2461 * Determine whether there are posts left in the loop. 2240 2462 * 2463 * @since 1.1.0 2464 * 2241 2465 * @return bool True when posts are found. 2242 2466 */ … … 2249 2473 * Set up the current post in the loop. 2250 2474 * 2475 * @since 1.1.0 2476 * 2251 2477 * @return object 2252 2478 */ … … 2258 2484 /** 2259 2485 * Output the ID of the current post in the loop. 2486 * 2487 * @since 1.0.0 2260 2488 */ 2261 2489 function bp_the_topic_post_id() { … … 2265 2493 * Return the ID of the current post in the loop. 2266 2494 * 2495 * @since 1.0.0 2496 * 2267 2497 * @return int ID of the current post in the loop. 2268 2498 */ … … 2282 2512 /** 2283 2513 * Output the content of the current post in the loop. 2514 * 2515 * @since 1.0.0 2284 2516 */ 2285 2517 function bp_the_topic_post_content() { … … 2289 2521 * Return the content of the current post in the loop. 2290 2522 * 2523 * @since 1.0.0 2524 * 2291 2525 * @return string Content of the current post. 2292 2526 */ … … 2306 2540 /** 2307 2541 * Output the CSS class of the current post in the loop. 2542 * 2543 * @since 1.2.4 2308 2544 */ 2309 2545 function bp_the_topic_post_css_class() { … … 2316 2552 * context. 2317 2553 * 2554 * @since 1.2.4 2555 * 2318 2556 * @return string String to put in the 'class' attribute of the current 2319 2557 * post. … … 2349 2587 * Output the avatar of the user who posted the current post in the loop. 2350 2588 * 2589 * @since 1.0.0 2590 * 2351 2591 * @see bp_get_the_topic_post_poster_avatar() for a description of arguments. 2352 2592 * … … 2358 2598 /** 2359 2599 * Return the avatar of the user who posted the current post in the loop. 2600 * 2601 * @since 1.0.0 2360 2602 * 2361 2603 * @param array|string $args { … … 2399 2641 /** 2400 2642 * Output the name of the user who posted the current post in the loop. 2643 * 2644 * @since 1.0.0 2401 2645 */ 2402 2646 function bp_the_topic_post_poster_name() { … … 2406 2650 * Return the name of the user who posted the current post in the loop. 2407 2651 * 2652 * @since 1.0.0 2653 * 2408 2654 * @return string Name of the user who posted the current post. 2409 2655 */ … … 2426 2672 /** 2427 2673 * Output a link to the profile of the user who posted the current post. 2674 * 2675 * @since 1.2.0 2428 2676 */ 2429 2677 function bp_the_topic_post_poster_link() { … … 2433 2681 * Return a link to the profile of the user who posted the current post. 2434 2682 * 2683 * @since 1.2.0 2684 * 2435 2685 * @return string Link to the profile of the user who posted the 2436 2686 * current post. … … 2451 2701 /** 2452 2702 * Output a 'since' string describing when the current post in the loop was posted. 2703 * 2704 * @since 1.0.0 2453 2705 */ 2454 2706 function bp_the_topic_post_time_since() { … … 2458 2710 * Return a 'since' string describing when the current post in the loop was posted. 2459 2711 * 2712 * @since 1.0.0 2713 * 2460 2714 * @see bp_core_time_since() for a description of return value. 2461 2715 * … … 2477 2731 /** 2478 2732 * Output whether the current post in the loop belongs to the logged-in user. 2733 * 2734 * @since 1.1.0 2479 2735 */ 2480 2736 function bp_the_topic_post_is_mine() { … … 2484 2740 * Does the current post belong to the logged-in user? 2485 2741 * 2742 * @since 1.1.0 2743 * 2486 2744 * @return bool True if the current post in the loop was created by 2487 2745 * the logged-in user, otherwise false. … … 2496 2754 * Output the admin links for the current post in the loop. 2497 2755 * 2756 * @since 1.1.0 2757 * 2498 2758 * @see bp_get_the_post_admin_links() for a description of arguments. 2499 2759 * … … 2505 2765 /** 2506 2766 * Return the admin links for the current post in the loop. 2767 * 2768 * @since 1.1.0 2507 2769 * 2508 2770 * @param array|string $args { … … 2546 2808 /** 2547 2809 * Output the text to edit when editing a post. 2810 * 2811 * @since 1.1.0 2548 2812 */ 2549 2813 function bp_the_topic_post_edit_text() { … … 2553 2817 * Return the text to edit when editing a post. 2554 2818 * 2819 * @since 1.1.0 2820 * 2555 2821 * @return string Editable text. 2556 2822 */ … … 2570 2836 /** 2571 2837 * Output the pagination links for the current topic. 2838 * 2839 * @since 1.0.0 2572 2840 */ 2573 2841 function bp_the_topic_pagination() { … … 2577 2845 * Return the pagination links for the current topic page. 2578 2846 * 2847 * @since 1.0.0 2848 * 2579 2849 * @return string HTML pagination links. 2580 2850 */ … … 2597 2867 * 2598 2868 * The "count" is a string of the form "Viewing x of y posts". 2869 * 2870 * @since 1.0.0 2599 2871 */ 2600 2872 function bp_the_topic_pagination_count() { … … 2627 2899 /** 2628 2900 * Output whether this is the last page in the current topic. 2901 * 2902 * @since 1.2.0 2629 2903 */ 2630 2904 function bp_the_topic_is_last_page() { … … 2634 2908 * Is this the last page in the current topic? 2635 2909 * 2910 * @since 1.2.0 2911 * 2636 2912 * @return bool True if this is the last page of posts for the current 2637 2913 * topic, otherwise false. … … 2652 2928 /** 2653 2929 * Output the forums directory search form. 2930 * 2931 * @since 1.1.0 2654 2932 */ 2655 2933 function bp_directory_forums_search_form() { … … 2675 2953 * Output the link to a given forum. 2676 2954 * 2955 * @since 1.0.0 2956 * 2677 2957 * @see bp_get_forum_permalink() for a description of arguments. 2678 2958 * … … 2684 2964 /** 2685 2965 * Return the permalink to a given forum. 2966 * 2967 * @since 1.0.0 2686 2968 * 2687 2969 * @param int $forum_id Optional. Defaults to the current forum, if … … 2719 3001 * Output the name of a given forum. 2720 3002 * 3003 * @since 1.5.0 3004 * 2721 3005 * @see bp_get_forum_name() for a description of parameters. 2722 3006 * … … 2728 3012 /** 2729 3013 * Return the name of a given forum. 3014 * 3015 * @since 1.5.0 2730 3016 * 2731 3017 * @param int $forum_id Optional. Defaults to the current forum, if … … 2763 3049 * defaults. 2764 3050 * 3051 * @since 1.1.0 3052 * 2765 3053 * @param array|string $args { 2766 3054 * An array of optional arguments. … … 2856 3144 /** 2857 3145 * Output a URL to use in as a forum form 'action'. 3146 * 3147 * @since 1.0.0 2858 3148 */ 2859 3149 function bp_forum_action() { … … 2863 3153 * Get a URL to use in as a forum form 'action'. 2864 3154 * 3155 * @since 1.0.0 3156 * 2865 3157 * @return string URL of the current page, minus query args. 2866 3158 */ … … 2880 3172 /** 2881 3173 * Output a URL to use in as a forum topic form 'action'. 3174 * 3175 * @since 1.0.0 2882 3176 */ 2883 3177 function bp_forum_topic_action() { … … 2887 3181 * Get a URL to use in as a forum topic form 'action'. 2888 3182 * 3183 * @since 1.0.0 3184 * 2889 3185 * @return string URL of the current page, minus query args. 2890 3186 */ … … 2903 3199 /** 2904 3200 * Output the total topic count for a given user. 3201 * 3202 * @since 1.2.0 2905 3203 * 2906 3204 * @see bp_get_forum_topic_count_for_user() for description of parameters. … … 2914 3212 * Return the total topic count for a given user. 2915 3213 * 3214 * @since 1.2.0 3215 * 2916 3216 * @param int $user_id See {@link bp_forums_total_topic_count_for_user}. 2917 3217 * … … 2932 3232 /** 2933 3233 * Output the total topic count for a given user. 3234 * 3235 * @since 1.2.0 2934 3236 * 2935 3237 * @see bp_get_forum_topic_count() for description of parameters. … … 2943 3245 * Return the total topic count for a given user. 2944 3246 * 3247 * @since 1.2.0 3248 * 2945 3249 * @param int $user_id See {@link bp_forums_total_topic_count()}. 2946 3250 *
Note: See TracChangeset
for help on using the changeset viewer.