Version Description
Download this release
Release Info
| Developer | johnjamesjacoby |
| Plugin | |
| Version | 2.3-beta1 |
| Comparing to | |
| See all releases | |
Code changes from version 2.2.4 to 2.3-beta1
- bbpress.php +61 -34
- humans.txt +6 -2
- includes/admin/admin.php +22 -6
- includes/admin/converter.php +24 -21
- includes/admin/converters/Invision.php +443 -183
- includes/admin/converters/Mingle.php +454 -0
- includes/admin/converters/SimplePress5.php +537 -0
- includes/admin/converters/Vanilla.php +545 -0
- includes/admin/converters/bbPress1.php +17 -3
- includes/admin/converters/phpBB.php +441 -141
- includes/admin/converters/vBulletin.php +190 -47
- includes/admin/metaboxes.php +28 -28
- includes/admin/settings.php +26 -1
- includes/admin/tools.php +111 -20
- includes/admin/users.php +1 -5
- includes/common/ajax.php +115 -0
- includes/common/classes.php +0 -127
- includes/common/formatting.php +263 -0
- includes/common/functions.php +106 -69
- includes/common/shortcodes.php +93 -3
- includes/common/template-tags.php +370 -155
- includes/common/widgets.php +253 -34
- includes/core/actions.php +44 -38
- includes/core/capabilities.php +4 -1
- includes/core/filters.php +51 -30
- includes/core/functions.php +17 -4
- includes/core/options.php +12 -0
- includes/core/sub-actions.php +40 -2
- includes/core/template-functions.php +36 -2
- includes/core/template-loader.php +42 -0
- includes/core/theme-compat.php +68 -11
- includes/core/update.php +36 -30
- includes/extend/buddypress/activity.php +6 -5
- includes/extend/buddypress/functions.php +172 -0
- includes/extend/buddypress/group.php +113 -25
- includes/extend/buddypress/loader.php +17 -17
- includes/extend/buddypress/members.php +30 -0
- includes/forums/capabilities.php +1 -1
- includes/forums/functions.php +62 -70
- includes/forums/template-tags.php +76 -66
- includes/replies/functions.php +349 -53
- includes/replies/template-tags.php +215 -101
- includes/search/functions.php +55 -0
- includes/search/index.php +5 -0
- includes/search/template-tags.php +371 -0
- includes/topics/functions.php +179 -117
- includes/topics/template-tags.php +242 -196
- includes/users/capabilities.php +10 -4
- includes/users/functions.php +19 -28
- includes/users/template-tags.php +169 -129
- languages/bbpress.pot +891 -729
- readme.txt +2 -2
- templates/default/bbpress-functions.php +162 -89
- templates/default/bbpress/content-archive-forum.php +6 -0
- templates/default/bbpress/content-search.php +41 -0
- templates/default/bbpress/content-single-forum.php +1 -1
- templates/default/bbpress/content-statistics.php +77 -0
- templates/default/bbpress/feedback-no-search.php +14 -0
- templates/default/bbpress/form-reply-move.php +91 -0
- templates/default/bbpress/form-reply.php +0 -4
- templates/default/bbpress/form-search.php +18 -0
- templates/default/bbpress/loop-search-forum.php +46 -0
- templates/default/bbpress/loop-search-reply.php +70 -0
- templates/default/bbpress/loop-search-topic.php +89 -0
- templates/default/bbpress/loop-search.php +52 -0
- templates/default/bbpress/loop-single-forum.php +6 -6
- templates/default/bbpress/loop-single-reply.php +4 -4
- templates/default/bbpress/loop-single-topic.php +3 -3
- templates/default/bbpress/pagination-search.php +28 -0
- templates/default/css/bbpress-rtl.css +192 -31
- templates/default/css/bbpress-rtl.min.css +1 -1
- templates/default/css/bbpress.css +192 -31
- templates/default/css/bbpress.min.css +1 -1
- templates/default/extras/page-forum-statistics.php +3 -68
- templates/default/extras/single-reply-move.php +32 -0
- templates/default/js/topic.js +27 -83
- templates/default/js/topic.min.js +1 -1
bbpress.php
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
*
|
| 6 |
* bbPress is forum software with a twist from the creators of WordPress.
|
| 7 |
*
|
| 8 |
-
* $Id: bbpress.php
|
| 9 |
*
|
| 10 |
* @package bbPress
|
| 11 |
* @subpackage Main
|
|
@@ -17,7 +17,7 @@
|
|
| 17 |
* Description: bbPress is forum software with a twist from the creators of WordPress.
|
| 18 |
* Author: The bbPress Community
|
| 19 |
* Author URI: http://bbpress.org
|
| 20 |
-
* Version: 2.
|
| 21 |
* Text Domain: bbpress
|
| 22 |
* Domain Path: /languages/
|
| 23 |
*/
|
|
@@ -29,7 +29,7 @@ if ( !class_exists( 'bbPress' ) ) :
|
|
| 29 |
/**
|
| 30 |
* Main bbPress Class
|
| 31 |
*
|
| 32 |
-
*
|
| 33 |
*
|
| 34 |
* @since bbPress (r2464)
|
| 35 |
*/
|
|
@@ -38,11 +38,12 @@ final class bbPress {
|
|
| 38 |
/** Magic *****************************************************************/
|
| 39 |
|
| 40 |
/**
|
| 41 |
-
* bbPress uses many variables,
|
| 42 |
-
* the way
|
| 43 |
-
*
|
| 44 |
-
*
|
| 45 |
-
*
|
|
|
|
| 46 |
*
|
| 47 |
* @see bbPress::setup_globals()
|
| 48 |
* @var array
|
|
@@ -144,19 +145,26 @@ final class bbPress {
|
|
| 144 |
public function __isset( $key ) { return isset( $this->data[$key] ); }
|
| 145 |
|
| 146 |
/**
|
| 147 |
-
* Magic method for getting bbPress
|
| 148 |
*
|
| 149 |
* @since bbPress (r3951)
|
| 150 |
*/
|
| 151 |
public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; }
|
| 152 |
|
| 153 |
/**
|
| 154 |
-
* Magic method for setting bbPress
|
| 155 |
*
|
| 156 |
* @since bbPress (r3951)
|
| 157 |
*/
|
| 158 |
public function __set( $key, $value ) { $this->data[$key] = $value; }
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
/**
|
| 161 |
* Magic method to prevent notices and errors from invalid method calls
|
| 162 |
*
|
|
@@ -180,7 +188,7 @@ final class bbPress {
|
|
| 180 |
|
| 181 |
/** Versions **********************************************************/
|
| 182 |
|
| 183 |
-
$this->version = '2.
|
| 184 |
$this->db_version = '224';
|
| 185 |
|
| 186 |
/** Paths *************************************************************/
|
|
@@ -221,13 +229,14 @@ final class bbPress {
|
|
| 221 |
$this->trash_status_id = apply_filters( 'bbp_trash_post_status', 'trash' );
|
| 222 |
|
| 223 |
// Other identifiers
|
| 224 |
-
$this->user_id = apply_filters( 'bbp_user_id',
|
| 225 |
-
$this->tops_id = apply_filters( 'bbp_tops_id',
|
| 226 |
-
$this->reps_id = apply_filters( 'bbp_reps_id',
|
| 227 |
-
$this->favs_id = apply_filters( 'bbp_favs_id',
|
| 228 |
-
$this->subs_id = apply_filters( 'bbp_subs_id',
|
| 229 |
-
$this->view_id = apply_filters( 'bbp_view_id',
|
| 230 |
-
$this->
|
|
|
|
| 231 |
|
| 232 |
/** Queries ***********************************************************/
|
| 233 |
|
|
@@ -239,6 +248,7 @@ final class bbPress {
|
|
| 239 |
$this->forum_query = new stdClass(); // Main forum query
|
| 240 |
$this->topic_query = new stdClass(); // Main topic query
|
| 241 |
$this->reply_query = new stdClass(); // Main reply query
|
|
|
|
| 242 |
|
| 243 |
/** Theme Compat ******************************************************/
|
| 244 |
|
|
@@ -287,8 +297,10 @@ final class bbPress {
|
|
| 287 |
/** Components ********************************************************/
|
| 288 |
|
| 289 |
// Common
|
|
|
|
| 290 |
require( $this->includes_dir . 'common/classes.php' );
|
| 291 |
require( $this->includes_dir . 'common/functions.php' );
|
|
|
|
| 292 |
require( $this->includes_dir . 'common/template-tags.php' );
|
| 293 |
require( $this->includes_dir . 'common/widgets.php' );
|
| 294 |
require( $this->includes_dir . 'common/shortcodes.php' );
|
|
@@ -308,6 +320,10 @@ final class bbPress {
|
|
| 308 |
require( $this->includes_dir . 'replies/functions.php' );
|
| 309 |
require( $this->includes_dir . 'replies/template-tags.php' );
|
| 310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
// Users
|
| 312 |
require( $this->includes_dir . 'users/capabilities.php' );
|
| 313 |
require( $this->includes_dir . 'users/functions.php' );
|
|
@@ -357,8 +373,8 @@ final class bbPress {
|
|
| 357 |
'register_views', // Register the views (no-replies)
|
| 358 |
'register_theme_packages', // Register bundled theme packages (bbp-theme-compat/bbp-themes)
|
| 359 |
'load_textdomain', // Load textdomain (bbpress)
|
| 360 |
-
'add_rewrite_tags', // Add rewrite tags (view|user|edit)
|
| 361 |
-
'generate_rewrite_rules' // Generate rewrite rules (view|edit)
|
| 362 |
);
|
| 363 |
|
| 364 |
// Add the actions
|
|
@@ -398,7 +414,7 @@ final class bbPress {
|
|
| 398 |
}
|
| 399 |
|
| 400 |
/**
|
| 401 |
-
* Setup the default bbPress theme
|
| 402 |
*
|
| 403 |
* @since bbPress (r3778)
|
| 404 |
*/
|
|
@@ -831,6 +847,7 @@ final class bbPress {
|
|
| 831 |
public static function add_rewrite_tags() {
|
| 832 |
add_rewrite_tag( '%%' . bbp_get_view_rewrite_id() . '%%', '([^/]+)' ); // View Page tag
|
| 833 |
add_rewrite_tag( '%%' . bbp_get_edit_rewrite_id() . '%%', '([1]{1,})' ); // Edit Page tag
|
|
|
|
| 834 |
add_rewrite_tag( '%%' . bbp_get_user_rewrite_id() . '%%', '([^/]+)' ); // User Profile tag
|
| 835 |
add_rewrite_tag( '%%' . bbp_get_user_favorites_rewrite_id() . '%%', '([1]{1,})' ); // User Favorites tag
|
| 836 |
add_rewrite_tag( '%%' . bbp_get_user_subscriptions_rewrite_id() . '%%', '([1]{1,})' ); // User Subscriptions tag
|
|
@@ -852,23 +869,29 @@ final class bbPress {
|
|
| 852 |
public static function generate_rewrite_rules( $wp_rewrite ) {
|
| 853 |
|
| 854 |
// Slugs
|
| 855 |
-
$view_slug
|
| 856 |
-
$
|
|
|
|
| 857 |
|
| 858 |
// Unique rewrite ID's
|
| 859 |
-
$edit_id
|
| 860 |
-
$view_id
|
| 861 |
-
$
|
| 862 |
-
$
|
| 863 |
-
$
|
| 864 |
-
$
|
| 865 |
-
$
|
|
|
|
| 866 |
|
| 867 |
// Rewrite rule matches used repeatedly below
|
| 868 |
-
$root_rule
|
| 869 |
-
$edit_rule
|
| 870 |
-
$feed_rule
|
| 871 |
-
$page_rule
|
|
|
|
|
|
|
|
|
|
|
|
|
| 872 |
|
| 873 |
// User profile rules
|
| 874 |
$tops_rule = '/([^/]+)/topics/?$';
|
|
@@ -906,6 +929,10 @@ final class bbPress {
|
|
| 906 |
$view_slug . $page_rule => 'index.php?' . $view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ),
|
| 907 |
$view_slug . $feed_rule => 'index.php?' . $view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&feed=' . $wp_rewrite->preg_index( 2 ),
|
| 908 |
$view_slug . $root_rule => 'index.php?' . $view_id . '=' . $wp_rewrite->preg_index( 1 ),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 909 |
);
|
| 910 |
|
| 911 |
// Merge bbPress rules with existing
|
| 5 |
*
|
| 6 |
* bbPress is forum software with a twist from the creators of WordPress.
|
| 7 |
*
|
| 8 |
+
* $Id: bbpress.php 4732 2013-01-28 18:30:40Z johnjamesjacoby $
|
| 9 |
*
|
| 10 |
* @package bbPress
|
| 11 |
* @subpackage Main
|
| 17 |
* Description: bbPress is forum software with a twist from the creators of WordPress.
|
| 18 |
* Author: The bbPress Community
|
| 19 |
* Author URI: http://bbpress.org
|
| 20 |
+
* Version: 2.3-beta1
|
| 21 |
* Text Domain: bbpress
|
| 22 |
* Domain Path: /languages/
|
| 23 |
*/
|
| 29 |
/**
|
| 30 |
* Main bbPress Class
|
| 31 |
*
|
| 32 |
+
* "How doth the little busy bee, improve each shining hour..."
|
| 33 |
*
|
| 34 |
* @since bbPress (r2464)
|
| 35 |
*/
|
| 38 |
/** Magic *****************************************************************/
|
| 39 |
|
| 40 |
/**
|
| 41 |
+
* bbPress uses many variables, several of which can be filtered to
|
| 42 |
+
* customize the way it operates. Most of these variables are stored in a
|
| 43 |
+
* private array that gets updated with the help of PHP magic methods.
|
| 44 |
+
*
|
| 45 |
+
* This is a precautionary measure, to avoid potential errors produced by
|
| 46 |
+
* unanticipated direct manipulation of bbPress's run-time data.
|
| 47 |
*
|
| 48 |
* @see bbPress::setup_globals()
|
| 49 |
* @var array
|
| 145 |
public function __isset( $key ) { return isset( $this->data[$key] ); }
|
| 146 |
|
| 147 |
/**
|
| 148 |
+
* Magic method for getting bbPress variables
|
| 149 |
*
|
| 150 |
* @since bbPress (r3951)
|
| 151 |
*/
|
| 152 |
public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; }
|
| 153 |
|
| 154 |
/**
|
| 155 |
+
* Magic method for setting bbPress variables
|
| 156 |
*
|
| 157 |
* @since bbPress (r3951)
|
| 158 |
*/
|
| 159 |
public function __set( $key, $value ) { $this->data[$key] = $value; }
|
| 160 |
|
| 161 |
+
/**
|
| 162 |
+
* Magic method for unsetting bbPress variables
|
| 163 |
+
*
|
| 164 |
+
* @since bbPress (r4628)
|
| 165 |
+
*/
|
| 166 |
+
public function __unset( $key ) { if ( isset( $this->data[$key] ) ) unset( $this->data[$key] ); }
|
| 167 |
+
|
| 168 |
/**
|
| 169 |
* Magic method to prevent notices and errors from invalid method calls
|
| 170 |
*
|
| 188 |
|
| 189 |
/** Versions **********************************************************/
|
| 190 |
|
| 191 |
+
$this->version = '2.3-beta1';
|
| 192 |
$this->db_version = '224';
|
| 193 |
|
| 194 |
/** Paths *************************************************************/
|
| 229 |
$this->trash_status_id = apply_filters( 'bbp_trash_post_status', 'trash' );
|
| 230 |
|
| 231 |
// Other identifiers
|
| 232 |
+
$this->user_id = apply_filters( 'bbp_user_id', 'bbp_user' );
|
| 233 |
+
$this->tops_id = apply_filters( 'bbp_tops_id', 'bbp_tops' );
|
| 234 |
+
$this->reps_id = apply_filters( 'bbp_reps_id', 'bbp_reps' );
|
| 235 |
+
$this->favs_id = apply_filters( 'bbp_favs_id', 'bbp_favs' );
|
| 236 |
+
$this->subs_id = apply_filters( 'bbp_subs_id', 'bbp_subs' );
|
| 237 |
+
$this->view_id = apply_filters( 'bbp_view_id', 'bbp_view' );
|
| 238 |
+
$this->search_id = apply_filters( 'bbp_search_id', 'bbp_search' );
|
| 239 |
+
$this->edit_id = apply_filters( 'bbp_edit_id', 'edit' );
|
| 240 |
|
| 241 |
/** Queries ***********************************************************/
|
| 242 |
|
| 248 |
$this->forum_query = new stdClass(); // Main forum query
|
| 249 |
$this->topic_query = new stdClass(); // Main topic query
|
| 250 |
$this->reply_query = new stdClass(); // Main reply query
|
| 251 |
+
$this->search_query = new stdClass(); // Main search query
|
| 252 |
|
| 253 |
/** Theme Compat ******************************************************/
|
| 254 |
|
| 297 |
/** Components ********************************************************/
|
| 298 |
|
| 299 |
// Common
|
| 300 |
+
require( $this->includes_dir . 'common/ajax.php' );
|
| 301 |
require( $this->includes_dir . 'common/classes.php' );
|
| 302 |
require( $this->includes_dir . 'common/functions.php' );
|
| 303 |
+
require( $this->includes_dir . 'common/formatting.php' );
|
| 304 |
require( $this->includes_dir . 'common/template-tags.php' );
|
| 305 |
require( $this->includes_dir . 'common/widgets.php' );
|
| 306 |
require( $this->includes_dir . 'common/shortcodes.php' );
|
| 320 |
require( $this->includes_dir . 'replies/functions.php' );
|
| 321 |
require( $this->includes_dir . 'replies/template-tags.php' );
|
| 322 |
|
| 323 |
+
// Search
|
| 324 |
+
require( $this->includes_dir . 'search/functions.php' );
|
| 325 |
+
require( $this->includes_dir . 'search/template-tags.php' );
|
| 326 |
+
|
| 327 |
// Users
|
| 328 |
require( $this->includes_dir . 'users/capabilities.php' );
|
| 329 |
require( $this->includes_dir . 'users/functions.php' );
|
| 373 |
'register_views', // Register the views (no-replies)
|
| 374 |
'register_theme_packages', // Register bundled theme packages (bbp-theme-compat/bbp-themes)
|
| 375 |
'load_textdomain', // Load textdomain (bbpress)
|
| 376 |
+
'add_rewrite_tags', // Add rewrite tags (view|user|edit|search)
|
| 377 |
+
'generate_rewrite_rules' // Generate rewrite rules (view|edit|search)
|
| 378 |
);
|
| 379 |
|
| 380 |
// Add the actions
|
| 414 |
}
|
| 415 |
|
| 416 |
/**
|
| 417 |
+
* Setup the default bbPress theme compatibility location.
|
| 418 |
*
|
| 419 |
* @since bbPress (r3778)
|
| 420 |
*/
|
| 847 |
public static function add_rewrite_tags() {
|
| 848 |
add_rewrite_tag( '%%' . bbp_get_view_rewrite_id() . '%%', '([^/]+)' ); // View Page tag
|
| 849 |
add_rewrite_tag( '%%' . bbp_get_edit_rewrite_id() . '%%', '([1]{1,})' ); // Edit Page tag
|
| 850 |
+
add_rewrite_tag( '%%' . bbp_get_search_rewrite_id() . '%%', '([^/]+)' ); // Search Results tag
|
| 851 |
add_rewrite_tag( '%%' . bbp_get_user_rewrite_id() . '%%', '([^/]+)' ); // User Profile tag
|
| 852 |
add_rewrite_tag( '%%' . bbp_get_user_favorites_rewrite_id() . '%%', '([1]{1,})' ); // User Favorites tag
|
| 853 |
add_rewrite_tag( '%%' . bbp_get_user_subscriptions_rewrite_id() . '%%', '([1]{1,})' ); // User Subscriptions tag
|
| 869 |
public static function generate_rewrite_rules( $wp_rewrite ) {
|
| 870 |
|
| 871 |
// Slugs
|
| 872 |
+
$view_slug = bbp_get_view_slug();
|
| 873 |
+
$search_slug = bbp_get_search_slug();
|
| 874 |
+
$user_slug = bbp_get_user_slug();
|
| 875 |
|
| 876 |
// Unique rewrite ID's
|
| 877 |
+
$edit_id = bbp_get_edit_rewrite_id();
|
| 878 |
+
$view_id = bbp_get_view_rewrite_id();
|
| 879 |
+
$search_id = bbp_get_search_rewrite_id();
|
| 880 |
+
$user_id = bbp_get_user_rewrite_id();
|
| 881 |
+
$favs_id = bbp_get_user_favorites_rewrite_id();
|
| 882 |
+
$subs_id = bbp_get_user_subscriptions_rewrite_id();
|
| 883 |
+
$tops_id = bbp_get_user_topics_rewrite_id();
|
| 884 |
+
$reps_id = bbp_get_user_replies_rewrite_id();
|
| 885 |
|
| 886 |
// Rewrite rule matches used repeatedly below
|
| 887 |
+
$root_rule = '/([^/]+)/?$';
|
| 888 |
+
$edit_rule = '/([^/]+)/edit/?$';
|
| 889 |
+
$feed_rule = '/([^/]+)/feed/?$';
|
| 890 |
+
$page_rule = '/([^/]+)/page/?([0-9]{1,})/?$';
|
| 891 |
+
|
| 892 |
+
// Search rules (without slug check)
|
| 893 |
+
$search_root_rule = '/?$';
|
| 894 |
+
$search_page_rule = '/page/?([0-9]{1,})/?$';
|
| 895 |
|
| 896 |
// User profile rules
|
| 897 |
$tops_rule = '/([^/]+)/topics/?$';
|
| 929 |
$view_slug . $page_rule => 'index.php?' . $view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ),
|
| 930 |
$view_slug . $feed_rule => 'index.php?' . $view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&feed=' . $wp_rewrite->preg_index( 2 ),
|
| 931 |
$view_slug . $root_rule => 'index.php?' . $view_id . '=' . $wp_rewrite->preg_index( 1 ),
|
| 932 |
+
|
| 933 |
+
// Search All
|
| 934 |
+
$search_slug . $search_page_rule => 'index.php?paged=' . $wp_rewrite->preg_index( 1 ),
|
| 935 |
+
$search_slug . $search_root_rule => 'index.php?' . $search_id,
|
| 936 |
);
|
| 937 |
|
| 938 |
// Merge bbPress rules with existing
|
humans.txt
CHANGED
|
@@ -38,9 +38,13 @@ Title: Lead Developer
|
|
| 38 |
Twitter: jjj
|
| 39 |
Favorite Food: Truffle Lasagna
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
/* THANKS */
|
| 42 |
-
Mike Adams, Gautam Gupta,
|
| 43 |
|
| 44 |
/* META */
|
| 45 |
-
Updated: 2012/
|
| 46 |
See: http://humanstxt.org/
|
| 38 |
Twitter: jjj
|
| 39 |
Favorite Food: Truffle Lasagna
|
| 40 |
|
| 41 |
+
Name: Jennifer M. Dodd
|
| 42 |
+
Title: Core Contributor
|
| 43 |
+
Twitter: jmdodd
|
| 44 |
+
|
| 45 |
/* THANKS */
|
| 46 |
+
Mike Adams, Gautam Gupta, Ben L, Justin Tadlock, cnorris23, anointed, andy, nacin, netweb
|
| 47 |
|
| 48 |
/* META */
|
| 49 |
+
Updated: 2012/12/22
|
| 50 |
See: http://humanstxt.org/
|
includes/admin/admin.php
CHANGED
|
@@ -49,7 +49,7 @@ class BBP_Admin {
|
|
| 49 |
/**
|
| 50 |
* @var bool Minimum capability to access Tools and Settings
|
| 51 |
*/
|
| 52 |
-
public $minimum_capability = '
|
| 53 |
|
| 54 |
/** Functions *************************************************************/
|
| 55 |
|
|
@@ -142,6 +142,9 @@ class BBP_Admin {
|
|
| 142 |
// Hide the theme compat package selection
|
| 143 |
add_filter( 'bbp_admin_get_settings_sections', array( $this, 'hide_theme_compat_packages' ) );
|
| 144 |
|
|
|
|
|
|
|
|
|
|
| 145 |
/** Network Admin *****************************************************/
|
| 146 |
|
| 147 |
// Add menu item to settings menu
|
|
@@ -361,7 +364,7 @@ class BBP_Admin {
|
|
| 361 |
|
| 362 |
// BuddyPress
|
| 363 |
case 'bbp_settings_buddypress' :
|
| 364 |
-
if ( ( is_plugin_active( 'buddypress/bp-loader.php' ) && defined( 'BP_VERSION' ) ) && is_super_admin() ) {
|
| 365 |
$caps = array( bbpress()->admin->minimum_capability );
|
| 366 |
} else {
|
| 367 |
$caps = array( 'do_not_allow' );
|
|
@@ -390,8 +393,8 @@ class BBP_Admin {
|
|
| 390 |
case 'bbp_settings_theme_compat' : // Settings - Theme compat
|
| 391 |
case 'bbp_settings_root_slugs' : // Settings - Root slugs
|
| 392 |
case 'bbp_settings_single_slugs' : // Settings - Single slugs
|
| 393 |
-
case 'bbp_settings_per_page' : // Settings -
|
| 394 |
-
case '
|
| 395 |
$caps = array( bbpress()->admin->minimum_capability );
|
| 396 |
break;
|
| 397 |
}
|
|
@@ -1260,6 +1263,19 @@ class BBP_Admin {
|
|
| 1260 |
return $sections;
|
| 1261 |
}
|
| 1262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1263 |
/** Ajax ******************************************************************/
|
| 1264 |
|
| 1265 |
/**
|
|
@@ -1326,7 +1342,7 @@ class BBP_Admin {
|
|
| 1326 |
</div>
|
| 1327 |
|
| 1328 |
<div class="changelog">
|
| 1329 |
-
<h3><?php _e( 'Theme
|
| 1330 |
|
| 1331 |
<div class="feature-section">
|
| 1332 |
<h4><?php _e( 'Twenty Twelve', 'bbpress' ); ?></h4>
|
|
@@ -1361,7 +1377,7 @@ class BBP_Admin {
|
|
| 1361 |
<div class="changelog">
|
| 1362 |
<h3><?php _e( 'Under the Hood', 'bbpress' ); ?></h3>
|
| 1363 |
|
| 1364 |
-
<div class="feature-section three-col">
|
| 1365 |
<div>
|
| 1366 |
<h4><?php _e( 'Template Logic', 'bbpress' ); ?></h4>
|
| 1367 |
<p><?php _e( 'New functions and template stacks are in place to help plugin developers extend bbPress further.', 'bbpress' ); ?></p>
|
| 49 |
/**
|
| 50 |
* @var bool Minimum capability to access Tools and Settings
|
| 51 |
*/
|
| 52 |
+
public $minimum_capability = 'keep_gate';
|
| 53 |
|
| 54 |
/** Functions *************************************************************/
|
| 55 |
|
| 142 |
// Hide the theme compat package selection
|
| 143 |
add_filter( 'bbp_admin_get_settings_sections', array( $this, 'hide_theme_compat_packages' ) );
|
| 144 |
|
| 145 |
+
// Allow keymasters to save forums settings
|
| 146 |
+
add_filter( 'option_page_capability_bbpress', array( $this, 'option_page_capability_bbpress' ) );
|
| 147 |
+
|
| 148 |
/** Network Admin *****************************************************/
|
| 149 |
|
| 150 |
// Add menu item to settings menu
|
| 364 |
|
| 365 |
// BuddyPress
|
| 366 |
case 'bbp_settings_buddypress' :
|
| 367 |
+
if ( ( is_plugin_active( 'buddypress/bp-loader.php' ) && defined( 'BP_VERSION' ) && bp_is_root_blog() ) && is_super_admin() ) {
|
| 368 |
$caps = array( bbpress()->admin->minimum_capability );
|
| 369 |
} else {
|
| 370 |
$caps = array( 'do_not_allow' );
|
| 393 |
case 'bbp_settings_theme_compat' : // Settings - Theme compat
|
| 394 |
case 'bbp_settings_root_slugs' : // Settings - Root slugs
|
| 395 |
case 'bbp_settings_single_slugs' : // Settings - Single slugs
|
| 396 |
+
case 'bbp_settings_per_page' : // Settings - Per page
|
| 397 |
+
case 'bbp_settings_per_rss_page' : // Settings - Per RSS page
|
| 398 |
$caps = array( bbpress()->admin->minimum_capability );
|
| 399 |
break;
|
| 400 |
}
|
| 1263 |
return $sections;
|
| 1264 |
}
|
| 1265 |
|
| 1266 |
+
/**
|
| 1267 |
+
* Allow keymaster role to save Forums settings
|
| 1268 |
+
*
|
| 1269 |
+
* @since bbPress (r4678)
|
| 1270 |
+
*
|
| 1271 |
+
* @param string $capability
|
| 1272 |
+
* @return string Return 'keep_gate' capability
|
| 1273 |
+
*/
|
| 1274 |
+
public function option_page_capability_bbpress( $capability = 'manage_options' ) {
|
| 1275 |
+
$capability = 'keep_gate';
|
| 1276 |
+
return $capability;
|
| 1277 |
+
}
|
| 1278 |
+
|
| 1279 |
/** Ajax ******************************************************************/
|
| 1280 |
|
| 1281 |
/**
|
| 1342 |
</div>
|
| 1343 |
|
| 1344 |
<div class="changelog">
|
| 1345 |
+
<h3><?php _e( 'Theme Compatibility', 'bbpress' ); ?></h3>
|
| 1346 |
|
| 1347 |
<div class="feature-section">
|
| 1348 |
<h4><?php _e( 'Twenty Twelve', 'bbpress' ); ?></h4>
|
| 1377 |
<div class="changelog">
|
| 1378 |
<h3><?php _e( 'Under the Hood', 'bbpress' ); ?></h3>
|
| 1379 |
|
| 1380 |
+
<div class="feature-section col three-col">
|
| 1381 |
<div>
|
| 1382 |
<h4><?php _e( 'Template Logic', 'bbpress' ); ?></h4>
|
| 1383 |
<p><?php _e( 'New functions and template stacks are in place to help plugin developers extend bbPress further.', 'bbpress' ); ?></p>
|
includes/admin/converter.php
CHANGED
|
@@ -976,10 +976,11 @@ abstract class BBP_Converter_Base {
|
|
| 976 |
|
| 977 |
$has_update = false;
|
| 978 |
|
| 979 |
-
if ( !empty( $this->sync_table ) )
|
| 980 |
-
$query =
|
| 981 |
-
else
|
| 982 |
-
$query =
|
|
|
|
| 983 |
|
| 984 |
update_option( '_bbp_converter_query', $query );
|
| 985 |
|
|
@@ -987,7 +988,7 @@ abstract class BBP_Converter_Base {
|
|
| 987 |
|
| 988 |
foreach ( (array) $forum_array as $row ) {
|
| 989 |
$parent_id = $this->callback_forumid( $row->meta_value );
|
| 990 |
-
$this->wpdb->query(
|
| 991 |
$has_update = true;
|
| 992 |
}
|
| 993 |
|
|
@@ -1004,10 +1005,11 @@ abstract class BBP_Converter_Base {
|
|
| 1004 |
|
| 1005 |
/** Delete bbconverter topics/forums/posts ****************************/
|
| 1006 |
|
| 1007 |
-
if ( true === $this->sync_table )
|
| 1008 |
-
$query =
|
| 1009 |
-
else
|
| 1010 |
-
$query =
|
|
|
|
| 1011 |
|
| 1012 |
update_option( '_bbp_converter_query', $query );
|
| 1013 |
|
|
@@ -1022,10 +1024,11 @@ abstract class BBP_Converter_Base {
|
|
| 1022 |
|
| 1023 |
/** Delete bbconverter users ******************************************/
|
| 1024 |
|
| 1025 |
-
if ( true === $this->sync_table )
|
| 1026 |
-
$query =
|
| 1027 |
-
else
|
| 1028 |
-
$query =
|
|
|
|
| 1029 |
|
| 1030 |
update_option( '_bbp_converter_query', $query );
|
| 1031 |
|
|
@@ -1055,7 +1058,7 @@ abstract class BBP_Converter_Base {
|
|
| 1055 |
|
| 1056 |
/** Delete bbconverter passwords **************************************/
|
| 1057 |
|
| 1058 |
-
$query =
|
| 1059 |
update_option( '_bbp_converter_query', $query );
|
| 1060 |
|
| 1061 |
$bbconverter = $this->wpdb->get_results( $query, ARRAY_A );
|
|
@@ -1064,10 +1067,10 @@ abstract class BBP_Converter_Base {
|
|
| 1064 |
|
| 1065 |
foreach ( $bbconverter as $value ) {
|
| 1066 |
if ( is_serialized( $value['meta_value'] ) ) {
|
| 1067 |
-
$this->wpdb->query(
|
| 1068 |
} else {
|
| 1069 |
-
$this->wpdb->query(
|
| 1070 |
-
$this->wpdb->query(
|
| 1071 |
}
|
| 1072 |
}
|
| 1073 |
$has_delete = true;
|
|
@@ -1121,12 +1124,12 @@ abstract class BBP_Converter_Base {
|
|
| 1121 |
public function callback_pass( $username, $password ) {
|
| 1122 |
$user = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT * FROM ' . $this->wpdb->users . ' WHERE user_login = "%s" AND user_pass = "" LIMIT 1', $username ) );
|
| 1123 |
if ( !empty( $user ) ) {
|
| 1124 |
-
$usermeta = $this->wpdb->get_row(
|
| 1125 |
|
| 1126 |
if ( !empty( $usermeta ) ) {
|
| 1127 |
if ( $this->authenticate_pass( $password, $usermeta->meta_value ) ) {
|
| 1128 |
-
$this->wpdb->query(
|
| 1129 |
-
$this->wpdb->query(
|
| 1130 |
}
|
| 1131 |
}
|
| 1132 |
}
|
|
@@ -1216,7 +1219,7 @@ abstract class BBP_Converter_Base {
|
|
| 1216 |
if ( empty( $topicid ) ) {
|
| 1217 |
$this->map_topicid_to_forumid[$topicid] = 0;
|
| 1218 |
} elseif ( ! isset( $this->map_topicid_to_forumid[$topicid] ) ) {
|
| 1219 |
-
$row = $this->wpdb->get_row(
|
| 1220 |
|
| 1221 |
if ( !is_null( $row ) ) {
|
| 1222 |
$this->map_topicid_to_forumid[$topicid] = $row->post_parent;
|
| 976 |
|
| 977 |
$has_update = false;
|
| 978 |
|
| 979 |
+
if ( !empty( $this->sync_table ) ) {
|
| 980 |
+
$query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_forum_parent_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
|
| 981 |
+
} else {
|
| 982 |
+
$query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_forum_parent_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
|
| 983 |
+
}
|
| 984 |
|
| 985 |
update_option( '_bbp_converter_query', $query );
|
| 986 |
|
| 988 |
|
| 989 |
foreach ( (array) $forum_array as $row ) {
|
| 990 |
$parent_id = $this->callback_forumid( $row->meta_value );
|
| 991 |
+
$this->wpdb->query( 'UPDATE ' . $this->wpdb->posts . ' SET post_parent = "' . $parent_id . '" WHERE ID = "' . $row->value_id . '" LIMIT 1' );
|
| 992 |
$has_update = true;
|
| 993 |
}
|
| 994 |
|
| 1005 |
|
| 1006 |
/** Delete bbconverter topics/forums/posts ****************************/
|
| 1007 |
|
| 1008 |
+
if ( true === $this->sync_table ) {
|
| 1009 |
+
$query = 'SELECT value_id FROM ' . $this->sync_table_name . ' INNER JOIN ' . $this->wpdb->posts . ' ON(value_id = ID) WHERE meta_key LIKE "_bbp_%" AND value_type = "post" GROUP BY value_id ORDER BY value_id DESC LIMIT ' . $this->max_rows;
|
| 1010 |
+
} else {
|
| 1011 |
+
$query = 'SELECT post_id AS value_id FROM ' . $this->wpdb->postmeta . ' WHERE meta_key LIKE "_bbp_%" GROUP BY post_id ORDER BY post_id DESC LIMIT ' . $this->max_rows;
|
| 1012 |
+
}
|
| 1013 |
|
| 1014 |
update_option( '_bbp_converter_query', $query );
|
| 1015 |
|
| 1024 |
|
| 1025 |
/** Delete bbconverter users ******************************************/
|
| 1026 |
|
| 1027 |
+
if ( true === $this->sync_table ) {
|
| 1028 |
+
$query = 'SELECT value_id FROM ' . $this->sync_table_name . ' INNER JOIN ' . $this->wpdb->users . ' ON(value_id = ID) WHERE meta_key = "_bbp_user_id" AND value_type = "user" LIMIT ' . $this->max_rows;
|
| 1029 |
+
} else {
|
| 1030 |
+
$query = 'SELECT user_id AS value_id FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_user_id" LIMIT ' . $this->max_rows;
|
| 1031 |
+
}
|
| 1032 |
|
| 1033 |
update_option( '_bbp_converter_query', $query );
|
| 1034 |
|
| 1058 |
|
| 1059 |
/** Delete bbconverter passwords **************************************/
|
| 1060 |
|
| 1061 |
+
$query = 'SELECT user_id, meta_value FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" LIMIT ' . $start . ', ' . $this->max_rows;
|
| 1062 |
update_option( '_bbp_converter_query', $query );
|
| 1063 |
|
| 1064 |
$bbconverter = $this->wpdb->get_results( $query, ARRAY_A );
|
| 1067 |
|
| 1068 |
foreach ( $bbconverter as $value ) {
|
| 1069 |
if ( is_serialized( $value['meta_value'] ) ) {
|
| 1070 |
+
$this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "" ' . 'WHERE ID = "' . $value['user_id'] . '"' );
|
| 1071 |
} else {
|
| 1072 |
+
$this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "' . $value['meta_value'] . '" ' . 'WHERE ID = "' . $value['user_id'] . '"' );
|
| 1073 |
+
$this->wpdb->query( 'DELETE FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $value['user_id'] . '"' );
|
| 1074 |
}
|
| 1075 |
}
|
| 1076 |
$has_delete = true;
|
| 1124 |
public function callback_pass( $username, $password ) {
|
| 1125 |
$user = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT * FROM ' . $this->wpdb->users . ' WHERE user_login = "%s" AND user_pass = "" LIMIT 1', $username ) );
|
| 1126 |
if ( !empty( $user ) ) {
|
| 1127 |
+
$usermeta = $this->wpdb->get_row( 'SELECT * FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $user->ID . '" LIMIT 1' );
|
| 1128 |
|
| 1129 |
if ( !empty( $usermeta ) ) {
|
| 1130 |
if ( $this->authenticate_pass( $password, $usermeta->meta_value ) ) {
|
| 1131 |
+
$this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "' . wp_hash_password( $password ) . '" ' . 'WHERE ID = "' . $user->ID . '"' );
|
| 1132 |
+
$this->wpdb->query( 'DELETE FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $user->ID . '"' );
|
| 1133 |
}
|
| 1134 |
}
|
| 1135 |
}
|
| 1219 |
if ( empty( $topicid ) ) {
|
| 1220 |
$this->map_topicid_to_forumid[$topicid] = 0;
|
| 1221 |
} elseif ( ! isset( $this->map_topicid_to_forumid[$topicid] ) ) {
|
| 1222 |
+
$row = $this->wpdb->get_row( 'SELECT post_parent FROM ' . $this->wpdb->posts . ' WHERE ID = "' . $topicid . '" LIMIT 1' );
|
| 1223 |
|
| 1224 |
if ( !is_null( $row ) ) {
|
| 1225 |
$this->map_topicid_to_forumid[$topicid] = $row->post_parent;
|
includes/admin/converters/Invision.php
CHANGED
|
@@ -1,363 +1,623 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
-
* Implementation of Invision Power Board converter.
|
|
|
|
|
|
|
|
|
|
| 5 |
*/
|
| 6 |
-
class Invision extends BBP_Converter_Base
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
parent::__construct();
|
| 11 |
$this->setup_globals();
|
| 12 |
}
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
/** Forum Section ******************************************************/
|
| 17 |
|
| 18 |
-
// Forum id
|
| 19 |
$this->field_map[] = array(
|
| 20 |
-
'from_tablename'
|
| 21 |
-
'
|
|
|
|
|
|
|
| 22 |
);
|
| 23 |
-
|
| 24 |
-
// Forum parent id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
$this->field_map[] = array(
|
| 26 |
-
'from_tablename' => 'forums',
|
| 27 |
-
'
|
|
|
|
|
|
|
| 28 |
);
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
// Forum title.
|
| 31 |
$this->field_map[] = array(
|
| 32 |
-
'from_tablename'
|
| 33 |
-
'
|
|
|
|
|
|
|
| 34 |
);
|
| 35 |
-
|
| 36 |
-
// Forum slug
|
| 37 |
$this->field_map[] = array(
|
| 38 |
-
'from_tablename'
|
| 39 |
-
'
|
|
|
|
|
|
|
| 40 |
'callback_method' => 'callback_slug'
|
| 41 |
);
|
| 42 |
-
|
| 43 |
// Forum description.
|
| 44 |
$this->field_map[] = array(
|
| 45 |
-
'from_tablename'
|
| 46 |
-
'
|
|
|
|
|
|
|
| 47 |
'callback_method' => 'callback_null'
|
| 48 |
);
|
| 49 |
-
|
| 50 |
-
// Forum display order
|
| 51 |
$this->field_map[] = array(
|
| 52 |
-
'from_tablename'
|
| 53 |
-
'
|
|
|
|
|
|
|
| 54 |
);
|
| 55 |
-
|
| 56 |
-
// Forum
|
| 57 |
$this->field_map[] = array(
|
| 58 |
-
'to_type'
|
|
|
|
| 59 |
'default' => date('Y-m-d H:i:s')
|
| 60 |
);
|
| 61 |
$this->field_map[] = array(
|
| 62 |
-
'to_type'
|
|
|
|
| 63 |
'default' => date('Y-m-d H:i:s')
|
| 64 |
);
|
| 65 |
$this->field_map[] = array(
|
| 66 |
-
'to_type'
|
|
|
|
| 67 |
'default' => date('Y-m-d H:i:s')
|
| 68 |
);
|
| 69 |
$this->field_map[] = array(
|
| 70 |
-
'to_type'
|
|
|
|
| 71 |
'default' => date('Y-m-d H:i:s')
|
| 72 |
);
|
| 73 |
|
| 74 |
/** Topic Section ******************************************************/
|
| 75 |
|
| 76 |
-
// Topic id
|
| 77 |
$this->field_map[] = array(
|
| 78 |
-
'from_tablename'
|
| 79 |
-
'
|
|
|
|
|
|
|
| 80 |
);
|
| 81 |
-
|
| 82 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
$this->field_map[] = array(
|
| 84 |
-
'from_tablename'
|
| 85 |
-
'
|
|
|
|
|
|
|
| 86 |
'callback_method' => 'callback_forumid'
|
| 87 |
);
|
| 88 |
-
|
| 89 |
// Topic author.
|
| 90 |
$this->field_map[] = array(
|
| 91 |
-
'from_tablename'
|
| 92 |
-
'
|
|
|
|
|
|
|
| 93 |
'callback_method' => 'callback_userid'
|
| 94 |
);
|
| 95 |
-
|
| 96 |
// Topic content.
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
'
|
| 100 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
'callback_method' => 'callback_html'
|
| 102 |
-
);
|
| 103 |
-
|
| 104 |
// Topic title.
|
| 105 |
$this->field_map[] = array(
|
| 106 |
-
'from_tablename'
|
| 107 |
-
'
|
|
|
|
|
|
|
| 108 |
);
|
| 109 |
-
|
| 110 |
-
// Topic slug
|
| 111 |
$this->field_map[] = array(
|
| 112 |
-
'from_tablename'
|
| 113 |
-
'
|
|
|
|
|
|
|
| 114 |
'callback_method' => 'callback_slug'
|
| 115 |
);
|
| 116 |
-
|
| 117 |
-
//
|
| 118 |
$this->field_map[] = array(
|
| 119 |
-
'from_tablename'
|
| 120 |
-
'
|
|
|
|
|
|
|
| 121 |
'callback_method' => 'callback_forumid'
|
| 122 |
);
|
| 123 |
|
| 124 |
-
// Topic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
$this->field_map[] = array(
|
| 126 |
-
'from_tablename'
|
| 127 |
-
'
|
|
|
|
|
|
|
| 128 |
'callback_method' => 'callback_datetime'
|
| 129 |
);
|
| 130 |
$this->field_map[] = array(
|
| 131 |
-
'from_tablename'
|
| 132 |
-
'
|
|
|
|
|
|
|
| 133 |
'callback_method' => 'callback_datetime'
|
| 134 |
);
|
| 135 |
$this->field_map[] = array(
|
| 136 |
-
'from_tablename'
|
| 137 |
-
'
|
|
|
|
|
|
|
| 138 |
'callback_method' => 'callback_datetime'
|
| 139 |
);
|
| 140 |
$this->field_map[] = array(
|
| 141 |
-
'from_tablename' => 'topics',
|
| 142 |
-
'
|
|
|
|
|
|
|
| 143 |
'callback_method' => 'callback_datetime'
|
| 144 |
);
|
| 145 |
|
| 146 |
/** Tags Section ******************************************************/
|
| 147 |
-
|
| 148 |
// Topic id.
|
| 149 |
$this->field_map[] = array(
|
| 150 |
-
'from_tablename'
|
| 151 |
-
'
|
|
|
|
|
|
|
| 152 |
'callback_method' => 'callback_topicid'
|
| 153 |
);
|
| 154 |
-
|
| 155 |
-
//
|
| 156 |
$this->field_map[] = array(
|
| 157 |
-
'from_tablename'
|
| 158 |
-
'
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
|
|
|
|
|
|
| 162 |
|
| 163 |
-
//
|
| 164 |
$this->field_map[] = array(
|
| 165 |
-
'from_tablename'
|
| 166 |
-
'
|
|
|
|
|
|
|
| 167 |
);
|
| 168 |
-
|
| 169 |
-
//
|
| 170 |
$this->field_map[] = array(
|
| 171 |
-
'from_tablename'
|
| 172 |
-
'
|
|
|
|
|
|
|
| 173 |
'callback_method' => 'callback_topicid_to_forumid'
|
| 174 |
);
|
| 175 |
-
|
| 176 |
-
//
|
| 177 |
$this->field_map[] = array(
|
| 178 |
-
'from_tablename'
|
| 179 |
-
'
|
|
|
|
|
|
|
| 180 |
'callback_method' => 'callback_topicid'
|
| 181 |
);
|
| 182 |
-
|
| 183 |
-
//
|
| 184 |
-
$this->field_map[] = array(
|
| 185 |
-
'from_tablename' => 'posts', 'from_fieldname' => 'ip_address',
|
| 186 |
-
'to_type' => 'reply', 'to_fieldname' => '__bbp_author_ip'
|
| 187 |
-
);
|
| 188 |
-
|
| 189 |
-
// Post author.
|
| 190 |
$this->field_map[] = array(
|
| 191 |
-
'from_tablename'
|
| 192 |
-
'
|
| 193 |
-
'
|
|
|
|
| 194 |
);
|
| 195 |
-
|
| 196 |
-
//
|
| 197 |
$this->field_map[] = array(
|
| 198 |
-
'from_tablename'
|
| 199 |
-
'
|
|
|
|
|
|
|
|
|
|
| 200 |
);
|
| 201 |
-
|
| 202 |
-
//
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
'
|
| 206 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
);
|
| 208 |
-
|
| 209 |
-
//
|
| 210 |
$this->field_map[] = array(
|
| 211 |
-
'from_tablename'
|
| 212 |
-
'
|
|
|
|
|
|
|
| 213 |
'callback_method' => 'callback_html'
|
| 214 |
);
|
| 215 |
-
|
| 216 |
-
//
|
| 217 |
$this->field_map[] = array(
|
| 218 |
-
'from_tablename'
|
| 219 |
-
'
|
|
|
|
|
|
|
| 220 |
'callback_method' => 'callback_topicid'
|
| 221 |
);
|
| 222 |
|
| 223 |
-
//
|
| 224 |
$this->field_map[] = array(
|
| 225 |
-
'from_tablename'
|
| 226 |
-
'
|
|
|
|
|
|
|
| 227 |
'callback_method' => 'callback_datetime'
|
| 228 |
);
|
| 229 |
$this->field_map[] = array(
|
| 230 |
-
'from_tablename'
|
| 231 |
-
'
|
|
|
|
|
|
|
| 232 |
'callback_method' => 'callback_datetime'
|
| 233 |
);
|
| 234 |
$this->field_map[] = array(
|
| 235 |
-
'from_tablename'
|
| 236 |
-
'
|
|
|
|
|
|
|
| 237 |
'callback_method' => 'callback_datetime'
|
| 238 |
);
|
| 239 |
$this->field_map[] = array(
|
| 240 |
-
'from_tablename'
|
| 241 |
-
'
|
|
|
|
|
|
|
| 242 |
'callback_method' => 'callback_datetime'
|
| 243 |
);
|
| 244 |
|
| 245 |
/** User Section ******************************************************/
|
| 246 |
|
| 247 |
-
// Store old User id
|
| 248 |
$this->field_map[] = array(
|
| 249 |
-
'from_tablename'
|
| 250 |
-
'
|
|
|
|
|
|
|
| 251 |
);
|
| 252 |
-
|
| 253 |
-
// Store old User password
|
| 254 |
$this->field_map[] = array(
|
| 255 |
-
'from_tablename'
|
| 256 |
-
'
|
|
|
|
|
|
|
| 257 |
'callback_method' => 'callback_savepass'
|
| 258 |
);
|
| 259 |
|
| 260 |
-
// Store old User Salt
|
| 261 |
$this->field_map[] = array(
|
| 262 |
-
'from_tablename'
|
| 263 |
-
'
|
|
|
|
|
|
|
| 264 |
);
|
| 265 |
-
|
| 266 |
-
// User password verify class
|
| 267 |
$this->field_map[] = array(
|
| 268 |
-
'to_type'
|
|
|
|
| 269 |
'default' => 'Invision'
|
| 270 |
);
|
| 271 |
-
|
| 272 |
// User name.
|
| 273 |
$this->field_map[] = array(
|
| 274 |
-
'from_tablename'
|
| 275 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 276 |
);
|
| 277 |
-
|
| 278 |
// User email.
|
| 279 |
$this->field_map[] = array(
|
| 280 |
-
'from_tablename'
|
| 281 |
-
'
|
|
|
|
|
|
|
| 282 |
);
|
| 283 |
-
|
| 284 |
// User registered.
|
| 285 |
$this->field_map[] = array(
|
| 286 |
-
'from_tablename'
|
| 287 |
-
'
|
|
|
|
|
|
|
| 288 |
'callback_method' => 'callback_datetime'
|
| 289 |
);
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
// User homepage.
|
| 294 |
$this->field_map[] = array(
|
| 295 |
-
'from_tablename'
|
| 296 |
-
'
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
|
|
|
|
|
|
| 300 |
$this->field_map[] = array(
|
| 301 |
-
'from_tablename'
|
| 302 |
-
'
|
|
|
|
|
|
|
| 303 |
);
|
| 304 |
-
|
| 305 |
-
// User
|
| 306 |
$this->field_map[] = array(
|
| 307 |
-
'from_tablename'
|
| 308 |
-
'
|
|
|
|
|
|
|
| 309 |
);
|
| 310 |
-
*/
|
| 311 |
-
|
| 312 |
}
|
| 313 |
|
| 314 |
/**
|
| 315 |
* This method allows us to indicates what is or is not converted for each
|
| 316 |
* converter.
|
| 317 |
*/
|
| 318 |
-
public function info()
|
| 319 |
-
{
|
| 320 |
return '';
|
| 321 |
}
|
| 322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
/**
|
| 324 |
* This method is to save the salt and password together. That
|
| 325 |
* way when we authenticate it we can get it out of the database
|
| 326 |
* as one value. Array values are auto sanitized by wordpress.
|
| 327 |
*/
|
| 328 |
-
public function callback_savepass( $field, $row )
|
| 329 |
-
|
| 330 |
-
$pass_array = array( 'hash' => $field, 'salt' => $row['members_pass_salt'] );
|
| 331 |
-
return $pass_array;
|
| 332 |
}
|
| 333 |
|
| 334 |
/**
|
| 335 |
* This method is to take the pass out of the database and compare
|
| 336 |
* to a pass the user has typed in.
|
| 337 |
*/
|
| 338 |
-
public function authenticate_pass( $password, $serialized_pass )
|
| 339 |
-
{
|
| 340 |
$pass_array = unserialize( $serialized_pass );
|
| 341 |
return ( $pass_array['hash'] == md5( md5( $pass_array['salt'] ) . md5( $this->to_char( $password ) ) ) );
|
| 342 |
}
|
| 343 |
|
| 344 |
-
|
| 345 |
-
{
|
| 346 |
$output = "";
|
| 347 |
-
for( $i = 0; $i < strlen( $input ); $i++ )
|
| 348 |
-
{
|
| 349 |
$j = ord( $input{$i} );
|
| 350 |
-
if( ( $j >= 65 && $j <= 90 )
|
| 351 |
|| ( $j >= 97 && $j <= 122 )
|
| 352 |
|| ( $j >= 48 && $j <= 57 ) )
|
| 353 |
{
|
| 354 |
$output .= $input{$i};
|
| 355 |
-
}
|
| 356 |
-
else
|
| 357 |
-
{
|
| 358 |
$output .= "&#" . ord( $input{$i} ) . ";";
|
| 359 |
}
|
| 360 |
}
|
| 361 |
return $output;
|
| 362 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 363 |
}
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
+
* Implementation of Invision Power Board v3.x converter.
|
| 5 |
+
*
|
| 6 |
+
* @since bbPress (r4713)
|
| 7 |
+
* @link Codex Docs http://codex.bbpress.org/import-forums/invision
|
| 8 |
*/
|
| 9 |
+
class Invision extends BBP_Converter_Base {
|
| 10 |
+
|
| 11 |
+
/**
|
| 12 |
+
* Main Constructor
|
| 13 |
+
*
|
| 14 |
+
* @uses Invision::setup_globals()
|
| 15 |
+
*/
|
| 16 |
+
function __construct() {
|
| 17 |
parent::__construct();
|
| 18 |
$this->setup_globals();
|
| 19 |
}
|
| 20 |
|
| 21 |
+
/**
|
| 22 |
+
* Sets up the field mappings
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
public function setup_globals() {
|
| 26 |
+
|
| 27 |
/** Forum Section ******************************************************/
|
| 28 |
|
| 29 |
+
// Forum id (Stored in postmeta)
|
| 30 |
$this->field_map[] = array(
|
| 31 |
+
'from_tablename' => 'forums',
|
| 32 |
+
'from_fieldname' => 'id',
|
| 33 |
+
'to_type' => 'forum',
|
| 34 |
+
'to_fieldname' => '_bbp_forum_id'
|
| 35 |
);
|
| 36 |
+
|
| 37 |
+
// Forum parent id (If no parent, then 0. Stored in postmeta)
|
| 38 |
+
$this->field_map[] = array(
|
| 39 |
+
'from_tablename' => 'forums',
|
| 40 |
+
'from_fieldname' => 'parent_id',
|
| 41 |
+
'to_type' => 'forum',
|
| 42 |
+
'to_fieldname' => '_bbp_forum_parent_id'
|
| 43 |
+
);
|
| 44 |
+
|
| 45 |
+
// Forum topic count (Stored in postmeta)
|
| 46 |
$this->field_map[] = array(
|
| 47 |
+
'from_tablename' => 'forums',
|
| 48 |
+
'from_fieldname' => 'topics',
|
| 49 |
+
'to_type' => 'forum',
|
| 50 |
+
'to_fieldname' => '_bbp_topic_count'
|
| 51 |
);
|
| 52 |
+
|
| 53 |
+
// Forum reply count (Stored in postmeta)
|
| 54 |
+
$this->field_map[] = array(
|
| 55 |
+
'from_tablename' => 'forums',
|
| 56 |
+
'from_fieldname' => 'posts',
|
| 57 |
+
'to_type' => 'forum',
|
| 58 |
+
'to_fieldname' => '_bbp_reply_count'
|
| 59 |
+
);
|
| 60 |
+
|
| 61 |
+
// Forum total topic count (Stored in postmeta)
|
| 62 |
+
$this->field_map[] = array(
|
| 63 |
+
'from_tablename' => 'forums',
|
| 64 |
+
'from_fieldname' => 'topics',
|
| 65 |
+
'to_type' => 'forum',
|
| 66 |
+
'to_fieldname' => '_bbp_total_topic_count'
|
| 67 |
+
);
|
| 68 |
+
|
| 69 |
+
// Forum total reply count (Stored in postmeta)
|
| 70 |
+
$this->field_map[] = array(
|
| 71 |
+
'from_tablename' => 'forums',
|
| 72 |
+
'from_fieldname' => 'posts',
|
| 73 |
+
'to_type' => 'forum',
|
| 74 |
+
'to_fieldname' => '_bbp_total_reply_count'
|
| 75 |
+
);
|
| 76 |
+
|
| 77 |
// Forum title.
|
| 78 |
$this->field_map[] = array(
|
| 79 |
+
'from_tablename' => 'forums',
|
| 80 |
+
'from_fieldname' => 'name',
|
| 81 |
+
'to_type' => 'forum',
|
| 82 |
+
'to_fieldname' => 'post_title'
|
| 83 |
);
|
| 84 |
+
|
| 85 |
+
// Forum slug (Clean name to avoid confilcts)
|
| 86 |
$this->field_map[] = array(
|
| 87 |
+
'from_tablename' => 'forums',
|
| 88 |
+
'from_fieldname' => 'name',
|
| 89 |
+
'to_type' => 'forum',
|
| 90 |
+
'to_fieldname' => 'post_name',
|
| 91 |
'callback_method' => 'callback_slug'
|
| 92 |
);
|
| 93 |
+
|
| 94 |
// Forum description.
|
| 95 |
$this->field_map[] = array(
|
| 96 |
+
'from_tablename' => 'forums',
|
| 97 |
+
'from_fieldname' => 'description',
|
| 98 |
+
'to_type' => 'forum',
|
| 99 |
+
'to_fieldname' => 'post_content',
|
| 100 |
'callback_method' => 'callback_null'
|
| 101 |
);
|
| 102 |
+
|
| 103 |
+
// Forum display order (Starts from 1)
|
| 104 |
$this->field_map[] = array(
|
| 105 |
+
'from_tablename' => 'forums',
|
| 106 |
+
'from_fieldname' => 'position',
|
| 107 |
+
'to_type' => 'forum',
|
| 108 |
+
'to_fieldname' => 'menu_order'
|
| 109 |
);
|
| 110 |
+
|
| 111 |
+
// Forum dates.
|
| 112 |
$this->field_map[] = array(
|
| 113 |
+
'to_type' => 'forum',
|
| 114 |
+
'to_fieldname' => 'post_date',
|
| 115 |
'default' => date('Y-m-d H:i:s')
|
| 116 |
);
|
| 117 |
$this->field_map[] = array(
|
| 118 |
+
'to_type' => 'forum',
|
| 119 |
+
'to_fieldname' => 'post_date_gmt',
|
| 120 |
'default' => date('Y-m-d H:i:s')
|
| 121 |
);
|
| 122 |
$this->field_map[] = array(
|
| 123 |
+
'to_type' => 'forum',
|
| 124 |
+
'to_fieldname' => 'post_modified',
|
| 125 |
'default' => date('Y-m-d H:i:s')
|
| 126 |
);
|
| 127 |
$this->field_map[] = array(
|
| 128 |
+
'to_type' => 'forum',
|
| 129 |
+
'to_fieldname' => 'post_modified_gmt',
|
| 130 |
'default' => date('Y-m-d H:i:s')
|
| 131 |
);
|
| 132 |
|
| 133 |
/** Topic Section ******************************************************/
|
| 134 |
|
| 135 |
+
// Topic id (Stored in postmeta)
|
| 136 |
$this->field_map[] = array(
|
| 137 |
+
'from_tablename' => 'topics',
|
| 138 |
+
'from_fieldname' => 'tid',
|
| 139 |
+
'to_type' => 'topic',
|
| 140 |
+
'to_fieldname' => '_bbp_topic_id'
|
| 141 |
);
|
| 142 |
+
|
| 143 |
+
// Topic reply count (Stored in postmeta)
|
| 144 |
+
$this->field_map[] = array(
|
| 145 |
+
'from_tablename' => 'topics',
|
| 146 |
+
'from_fieldname' => 'posts',
|
| 147 |
+
'to_type' => 'topic',
|
| 148 |
+
'to_fieldname' => '_bbp_reply_count',
|
| 149 |
+
'callback_method' => 'callback_topic_reply_count'
|
| 150 |
+
);
|
| 151 |
+
|
| 152 |
+
// Topic parent forum id (If no parent, then 0. Stored in postmeta)
|
| 153 |
$this->field_map[] = array(
|
| 154 |
+
'from_tablename' => 'topics',
|
| 155 |
+
'from_fieldname' => 'forum_id',
|
| 156 |
+
'to_type' => 'topic',
|
| 157 |
+
'to_fieldname' => '_bbp_forum_id',
|
| 158 |
'callback_method' => 'callback_forumid'
|
| 159 |
);
|
| 160 |
+
|
| 161 |
// Topic author.
|
| 162 |
$this->field_map[] = array(
|
| 163 |
+
'from_tablename' => 'topics',
|
| 164 |
+
'from_fieldname' => 'starter_id',
|
| 165 |
+
'to_type' => 'topic',
|
| 166 |
+
'to_fieldname' => 'post_author',
|
| 167 |
'callback_method' => 'callback_userid'
|
| 168 |
);
|
| 169 |
+
|
| 170 |
// Topic content.
|
| 171 |
+
// Note: We join the posts table because topics do not have content.
|
| 172 |
+
$this->field_map[] = array(
|
| 173 |
+
'from_tablename' => 'posts',
|
| 174 |
+
'from_fieldname' => 'post',
|
| 175 |
+
'join_tablename' => 'topics',
|
| 176 |
+
'join_type' => 'INNER',
|
| 177 |
+
'join_expression' => 'ON(topics.tid = posts.topic_id) WHERE posts.new_topic = 1',
|
| 178 |
+
'to_type' => 'topic',
|
| 179 |
+
'to_fieldname' => 'post_content',
|
| 180 |
'callback_method' => 'callback_html'
|
| 181 |
+
);
|
| 182 |
+
|
| 183 |
// Topic title.
|
| 184 |
$this->field_map[] = array(
|
| 185 |
+
'from_tablename' => 'topics',
|
| 186 |
+
'from_fieldname' => 'title',
|
| 187 |
+
'to_type' => 'topic',
|
| 188 |
+
'to_fieldname' => 'post_title'
|
| 189 |
);
|
| 190 |
+
|
| 191 |
+
// Topic slug (Clean name to avoid conflicts)
|
| 192 |
$this->field_map[] = array(
|
| 193 |
+
'from_tablename' => 'topics',
|
| 194 |
+
'from_fieldname' => 'title',
|
| 195 |
+
'to_type' => 'topic',
|
| 196 |
+
'to_fieldname' => 'post_name',
|
| 197 |
'callback_method' => 'callback_slug'
|
| 198 |
);
|
| 199 |
+
|
| 200 |
+
// Topic parent forum id (If no parent, then 0)
|
| 201 |
$this->field_map[] = array(
|
| 202 |
+
'from_tablename' => 'topics',
|
| 203 |
+
'from_fieldname' => 'forum_id',
|
| 204 |
+
'to_type' => 'topic',
|
| 205 |
+
'to_fieldname' => 'post_parent',
|
| 206 |
'callback_method' => 'callback_forumid'
|
| 207 |
);
|
| 208 |
|
| 209 |
+
// Topic dates.
|
| 210 |
+
$this->field_map[] = array(
|
| 211 |
+
'from_tablename' => 'topics',
|
| 212 |
+
'from_fieldname' => 'start_date',
|
| 213 |
+
'to_type' => 'topic',
|
| 214 |
+
'to_fieldname' => 'post_date',
|
| 215 |
+
'callback_method' => 'callback_datetime'
|
| 216 |
+
);
|
| 217 |
$this->field_map[] = array(
|
| 218 |
+
'from_tablename' => 'topics',
|
| 219 |
+
'from_fieldname' => 'start_date',
|
| 220 |
+
'to_type' => 'topic',
|
| 221 |
+
'to_fieldname' => 'post_date_gmt',
|
| 222 |
'callback_method' => 'callback_datetime'
|
| 223 |
);
|
| 224 |
$this->field_map[] = array(
|
| 225 |
+
'from_tablename' => 'topics',
|
| 226 |
+
'from_fieldname' => 'last_post',
|
| 227 |
+
'to_type' => 'topic',
|
| 228 |
+
'to_fieldname' => 'post_modified',
|
| 229 |
'callback_method' => 'callback_datetime'
|
| 230 |
);
|
| 231 |
$this->field_map[] = array(
|
| 232 |
+
'from_tablename' => 'topics',
|
| 233 |
+
'from_fieldname' => 'last_post',
|
| 234 |
+
'to_type' => 'topic',
|
| 235 |
+
'to_fieldname' => 'post_modified_gmt',
|
| 236 |
'callback_method' => 'callback_datetime'
|
| 237 |
);
|
| 238 |
$this->field_map[] = array(
|
| 239 |
+
'from_tablename' => 'topics',
|
| 240 |
+
'from_fieldname' => 'last_post',
|
| 241 |
+
'to_type' => 'topic',
|
| 242 |
+
'to_fieldname' => '_bbp_last_active_time',
|
| 243 |
'callback_method' => 'callback_datetime'
|
| 244 |
);
|
| 245 |
|
| 246 |
/** Tags Section ******************************************************/
|
| 247 |
+
|
| 248 |
// Topic id.
|
| 249 |
$this->field_map[] = array(
|
| 250 |
+
'from_tablename' => 'core_tags',
|
| 251 |
+
'from_fieldname' => 'tag_meta_id',
|
| 252 |
+
'to_type' => 'tags',
|
| 253 |
+
'to_fieldname' => 'objectid',
|
| 254 |
'callback_method' => 'callback_topicid'
|
| 255 |
);
|
| 256 |
+
|
| 257 |
+
// Term text.
|
| 258 |
$this->field_map[] = array(
|
| 259 |
+
'from_tablename' => 'core_tags',
|
| 260 |
+
'from_fieldname' => 'tag_text',
|
| 261 |
+
'to_type' => 'tags',
|
| 262 |
+
'to_fieldname' => 'name'
|
| 263 |
+
);
|
| 264 |
+
|
| 265 |
+
/** Reply Section ******************************************************/
|
| 266 |
|
| 267 |
+
// Reply id (Stored in postmeta)
|
| 268 |
$this->field_map[] = array(
|
| 269 |
+
'from_tablename' => 'posts',
|
| 270 |
+
'from_fieldname' => 'pid',
|
| 271 |
+
'to_type' => 'reply',
|
| 272 |
+
'to_fieldname' => '_bbp_post_id'
|
| 273 |
);
|
| 274 |
+
|
| 275 |
+
// Reply parent forum id (If no parent, then 0. Stored in postmeta)
|
| 276 |
$this->field_map[] = array(
|
| 277 |
+
'from_tablename' => 'posts',
|
| 278 |
+
'from_fieldname' => 'topic_id',
|
| 279 |
+
'to_type' => 'reply',
|
| 280 |
+
'to_fieldname' => '_bbp_forum_id',
|
| 281 |
'callback_method' => 'callback_topicid_to_forumid'
|
| 282 |
);
|
| 283 |
+
|
| 284 |
+
// Reply parent topic id (If no parent, then 0. Stored in postmeta)
|
| 285 |
$this->field_map[] = array(
|
| 286 |
+
'from_tablename' => 'posts',
|
| 287 |
+
'from_fieldname' => 'topic_id',
|
| 288 |
+
'to_type' => 'reply',
|
| 289 |
+
'to_fieldname' => '_bbp_topic_id',
|
| 290 |
'callback_method' => 'callback_topicid'
|
| 291 |
);
|
| 292 |
+
|
| 293 |
+
// Reply author ip (Stored in postmeta)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
$this->field_map[] = array(
|
| 295 |
+
'from_tablename' => 'posts',
|
| 296 |
+
'from_fieldname' => 'ip_address',
|
| 297 |
+
'to_type' => 'reply',
|
| 298 |
+
'to_fieldname' => '_bbp_author_ip'
|
| 299 |
);
|
| 300 |
+
|
| 301 |
+
// Reply author.
|
| 302 |
$this->field_map[] = array(
|
| 303 |
+
'from_tablename' => 'posts',
|
| 304 |
+
'from_fieldname' => 'author_id',
|
| 305 |
+
'to_type' => 'reply',
|
| 306 |
+
'to_fieldname' => 'post_author',
|
| 307 |
+
'callback_method' => 'callback_userid'
|
| 308 |
);
|
| 309 |
+
|
| 310 |
+
// Reply title.
|
| 311 |
+
// Note: We join the topics table because post table does not include topic title.
|
| 312 |
+
$this->field_map[] = array(
|
| 313 |
+
'from_tablename' => 'topics',
|
| 314 |
+
'from_fieldname' => 'title',
|
| 315 |
+
'join_tablename' => 'posts',
|
| 316 |
+
'join_type' => 'INNER',
|
| 317 |
+
'join_expression' => 'ON (topics.tid = posts.topic_id) WHERE posts.new_topic = 0',
|
| 318 |
+
'to_type' => 'reply',
|
| 319 |
+
'to_fieldname' => 'post_title',
|
| 320 |
+
'callback_method' => 'callback_reply_title'
|
| 321 |
);
|
| 322 |
+
|
| 323 |
+
// Reply content.
|
| 324 |
$this->field_map[] = array(
|
| 325 |
+
'from_tablename' => 'posts',
|
| 326 |
+
'from_fieldname' => 'post',
|
| 327 |
+
'to_type' => 'reply',
|
| 328 |
+
'to_fieldname' => 'post_content',
|
| 329 |
'callback_method' => 'callback_html'
|
| 330 |
);
|
| 331 |
+
|
| 332 |
+
// Reply parent topic id (If no parent, then 0)
|
| 333 |
$this->field_map[] = array(
|
| 334 |
+
'from_tablename' => 'posts',
|
| 335 |
+
'from_fieldname' => 'topic_id',
|
| 336 |
+
'to_type' => 'reply',
|
| 337 |
+
'to_fieldname' => 'post_parent',
|
| 338 |
'callback_method' => 'callback_topicid'
|
| 339 |
);
|
| 340 |
|
| 341 |
+
// Reply dates.
|
| 342 |
$this->field_map[] = array(
|
| 343 |
+
'from_tablename' => 'posts',
|
| 344 |
+
'from_fieldname' => 'post_date',
|
| 345 |
+
'to_type' => 'reply',
|
| 346 |
+
'to_fieldname' => 'post_date',
|
| 347 |
'callback_method' => 'callback_datetime'
|
| 348 |
);
|
| 349 |
$this->field_map[] = array(
|
| 350 |
+
'from_tablename' => 'posts',
|
| 351 |
+
'from_fieldname' => 'post_date',
|
| 352 |
+
'to_type' => 'reply',
|
| 353 |
+
'to_fieldname' => 'post_date_gmt',
|
| 354 |
'callback_method' => 'callback_datetime'
|
| 355 |
);
|
| 356 |
$this->field_map[] = array(
|
| 357 |
+
'from_tablename' => 'posts',
|
| 358 |
+
'from_fieldname' => 'edit_time',
|
| 359 |
+
'to_type' => 'reply',
|
| 360 |
+
'to_fieldname' => 'post_modified',
|
| 361 |
'callback_method' => 'callback_datetime'
|
| 362 |
);
|
| 363 |
$this->field_map[] = array(
|
| 364 |
+
'from_tablename' => 'posts',
|
| 365 |
+
'from_fieldname' => 'edit_time',
|
| 366 |
+
'to_type' => 'reply',
|
| 367 |
+
'to_fieldname' => 'post_modified_gmt',
|
| 368 |
'callback_method' => 'callback_datetime'
|
| 369 |
);
|
| 370 |
|
| 371 |
/** User Section ******************************************************/
|
| 372 |
|
| 373 |
+
// Store old User id (Stored in usermeta)
|
| 374 |
$this->field_map[] = array(
|
| 375 |
+
'from_tablename' => 'members',
|
| 376 |
+
'from_fieldname' => 'member_id',
|
| 377 |
+
'to_type' => 'user',
|
| 378 |
+
'to_fieldname' => '_bbp_user_id'
|
| 379 |
);
|
| 380 |
+
|
| 381 |
+
// Store old User password (Stored in usermeta serialized with salt)
|
| 382 |
$this->field_map[] = array(
|
| 383 |
+
'from_tablename' => 'members',
|
| 384 |
+
'from_fieldname' => 'members_pass_hash',
|
| 385 |
+
'to_type' => 'user',
|
| 386 |
+
'to_fieldname' => '_bbp_password',
|
| 387 |
'callback_method' => 'callback_savepass'
|
| 388 |
);
|
| 389 |
|
| 390 |
+
// Store old User Salt (This is only used for the SELECT row info for the above password save)
|
| 391 |
$this->field_map[] = array(
|
| 392 |
+
'from_tablename' => 'members',
|
| 393 |
+
'from_fieldname' => 'members_pass_salt',
|
| 394 |
+
'to_type' => 'user',
|
| 395 |
+
'to_fieldname' => ''
|
| 396 |
);
|
| 397 |
+
|
| 398 |
+
// User password verify class (Stored in usermeta for verifying password)
|
| 399 |
$this->field_map[] = array(
|
| 400 |
+
'to_type' => 'user',
|
| 401 |
+
'to_fieldname' => '_bbp_class',
|
| 402 |
'default' => 'Invision'
|
| 403 |
);
|
| 404 |
+
|
| 405 |
// User name.
|
| 406 |
$this->field_map[] = array(
|
| 407 |
+
'from_tablename' => 'members',
|
| 408 |
+
'from_fieldname' => 'name',
|
| 409 |
+
'to_type' => 'user',
|
| 410 |
+
'to_fieldname' => 'user_login'
|
| 411 |
+
);
|
| 412 |
+
|
| 413 |
+
// User nice name.
|
| 414 |
+
$this->field_map[] = array(
|
| 415 |
+
'from_tablename' => 'members',
|
| 416 |
+
'from_fieldname' => 'name',
|
| 417 |
+
'to_type' => 'user',
|
| 418 |
+
'to_fieldname' => 'user_nicename'
|
| 419 |
);
|
| 420 |
+
|
| 421 |
// User email.
|
| 422 |
$this->field_map[] = array(
|
| 423 |
+
'from_tablename' => 'members',
|
| 424 |
+
'from_fieldname' => 'email',
|
| 425 |
+
'to_type' => 'user',
|
| 426 |
+
'to_fieldname' => 'user_email'
|
| 427 |
);
|
| 428 |
+
|
| 429 |
// User registered.
|
| 430 |
$this->field_map[] = array(
|
| 431 |
+
'from_tablename' => 'members',
|
| 432 |
+
'from_fieldname' => 'joined',
|
| 433 |
+
'to_type' => 'user',
|
| 434 |
+
'to_fieldname' => 'user_registered',
|
| 435 |
'callback_method' => 'callback_datetime'
|
| 436 |
);
|
| 437 |
+
|
| 438 |
+
// User display name.
|
| 439 |
+
$this->field_map[] = array(
|
| 440 |
+
'from_tablename' => 'members',
|
| 441 |
+
'from_fieldname' => 'members_display_name',
|
| 442 |
+
'to_type' => 'user',
|
| 443 |
+
'to_fieldname' => 'display_name'
|
| 444 |
+
);
|
| 445 |
+
|
| 446 |
+
/*
|
| 447 |
+
* Table pfields_content AND pfields_data
|
| 448 |
+
* These can be included once USER import JOIN bug is fixed
|
| 449 |
// User homepage.
|
| 450 |
$this->field_map[] = array(
|
| 451 |
+
'from_tablename' => 'members',
|
| 452 |
+
'from_fieldname' => 'homepage',
|
| 453 |
+
'to_type' => 'user',
|
| 454 |
+
'to_fieldname' => 'user_url'
|
| 455 |
+
);
|
| 456 |
+
|
| 457 |
+
// User AIM (Stored in usermeta)
|
| 458 |
$this->field_map[] = array(
|
| 459 |
+
'from_tablename' => 'members',
|
| 460 |
+
'from_fieldname' => 'aim',
|
| 461 |
+
'to_type' => 'user',
|
| 462 |
+
'to_fieldname' => 'aim'
|
| 463 |
);
|
| 464 |
+
|
| 465 |
+
// User Yahoo (Stored in usermeta)
|
| 466 |
$this->field_map[] = array(
|
| 467 |
+
'from_tablename' => 'members',
|
| 468 |
+
'from_fieldname' => 'yahoo',
|
| 469 |
+
'to_type' => 'user',
|
| 470 |
+
'to_fieldname' => 'yim'
|
| 471 |
);
|
| 472 |
+
*/
|
| 473 |
+
|
| 474 |
}
|
| 475 |
|
| 476 |
/**
|
| 477 |
* This method allows us to indicates what is or is not converted for each
|
| 478 |
* converter.
|
| 479 |
*/
|
| 480 |
+
public function info() {
|
|
|
|
| 481 |
return '';
|
| 482 |
}
|
| 483 |
|
| 484 |
+
/**
|
| 485 |
+
* Verify the topic reply count.
|
| 486 |
+
*
|
| 487 |
+
* @param int $count Invision reply count
|
| 488 |
+
* @return string WordPress safe
|
| 489 |
+
*/
|
| 490 |
+
public function callback_topic_reply_count( $count = 1 ) {
|
| 491 |
+
$count = absint( (int) $count - 1 );
|
| 492 |
+
return $count;
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
/**
|
| 496 |
+
* Set the reply title
|
| 497 |
+
*
|
| 498 |
+
* @param string $title Invision topic title of this reply
|
| 499 |
+
* @return string Prefixed topic title, or empty string
|
| 500 |
+
*/
|
| 501 |
+
public function callback_reply_title( $title = '' ) {
|
| 502 |
+
$title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
|
| 503 |
+
return $title;
|
| 504 |
+
}
|
| 505 |
+
|
| 506 |
/**
|
| 507 |
* This method is to save the salt and password together. That
|
| 508 |
* way when we authenticate it we can get it out of the database
|
| 509 |
* as one value. Array values are auto sanitized by wordpress.
|
| 510 |
*/
|
| 511 |
+
public function callback_savepass( $field, $row ) {
|
| 512 |
+
return array( 'hash' => $field, 'salt' => $row['members_pass_salt'] );
|
|
|
|
|
|
|
| 513 |
}
|
| 514 |
|
| 515 |
/**
|
| 516 |
* This method is to take the pass out of the database and compare
|
| 517 |
* to a pass the user has typed in.
|
| 518 |
*/
|
| 519 |
+
public function authenticate_pass( $password, $serialized_pass ) {
|
|
|
|
| 520 |
$pass_array = unserialize( $serialized_pass );
|
| 521 |
return ( $pass_array['hash'] == md5( md5( $pass_array['salt'] ) . md5( $this->to_char( $password ) ) ) );
|
| 522 |
}
|
| 523 |
|
| 524 |
+
private function to_char( $input ) {
|
|
|
|
| 525 |
$output = "";
|
| 526 |
+
for ( $i = 0; $i < strlen( $input ); $i++ ) {
|
|
|
|
| 527 |
$j = ord( $input{$i} );
|
| 528 |
+
if ( ( $j >= 65 && $j <= 90 )
|
| 529 |
|| ( $j >= 97 && $j <= 122 )
|
| 530 |
|| ( $j >= 48 && $j <= 57 ) )
|
| 531 |
{
|
| 532 |
$output .= $input{$i};
|
| 533 |
+
} else {
|
|
|
|
|
|
|
| 534 |
$output .= "&#" . ord( $input{$i} ) . ";";
|
| 535 |
}
|
| 536 |
}
|
| 537 |
return $output;
|
| 538 |
}
|
| 539 |
+
|
| 540 |
+
/**
|
| 541 |
+
* This callback processes any custom BBCodes with parser.php
|
| 542 |
+
*/
|
| 543 |
+
protected function callback_html( $field ) {
|
| 544 |
+
|
| 545 |
+
// Strips Invision custom HTML first from $field before parsing $field to parser.php
|
| 546 |
+
$invision_markup = $field;
|
| 547 |
+
$invision_markup = html_entity_decode( $invision_markup );
|
| 548 |
+
|
| 549 |
+
// Replace '[html]' with '<pre><code>'
|
| 550 |
+
$invision_markup = preg_replace( '/\[html\]/', '<pre><code>', $invision_markup );
|
| 551 |
+
// Replace '[/html]' with '</code></pre>'
|
| 552 |
+
$invision_markup = preg_replace( '/\[\/html\]/', '</code></pre>', $invision_markup );
|
| 553 |
+
// Replace '[sql]' with '<pre><code>'
|
| 554 |
+
$invision_markup = preg_replace( '/\[sql\]/', '<pre><code>', $invision_markup );
|
| 555 |
+
// Replace '[/sql]' with '</code></pre>'
|
| 556 |
+
$invision_markup = preg_replace( '/\[\/sql\]/', '</code></pre>', $invision_markup );
|
| 557 |
+
// Replace '[php]' with '<pre><code>'
|
| 558 |
+
$invision_markup = preg_replace( '/\[php\]/', '<pre><code>', $invision_markup );
|
| 559 |
+
// Replace '[/php]' with '</code></pre>'
|
| 560 |
+
$invision_markup = preg_replace( '/\[\/php\]/', '</code></pre>', $invision_markup );
|
| 561 |
+
// Replace '[xml]' with '<pre><code>'
|
| 562 |
+
$invision_markup = preg_replace( '/\[xml\]/', '<pre><code>', $invision_markup );
|
| 563 |
+
// Replace '[/xml]' with '</code></pre>'
|
| 564 |
+
$invision_markup = preg_replace( '/\[\/xml\]/', '</code></pre>', $invision_markup );
|
| 565 |
+
// Replace '[CODE]' with '<pre><code>'
|
| 566 |
+
$invision_markup = preg_replace( '/\[CODE\]/', '<pre><code>', $invision_markup );
|
| 567 |
+
// Replace '[/CODE]' with '</code></pre>'
|
| 568 |
+
$invision_markup = preg_replace( '/\[\/CODE\]/', '</code></pre>', $invision_markup );
|
| 569 |
+
|
| 570 |
+
// Replace '[quote:XXXXXXX]' with '<blockquote>'
|
| 571 |
+
$invision_markup = preg_replace( '/\[quote:(.*?)\]/', '<blockquote>', $invision_markup );
|
| 572 |
+
// Replace '[quote="$1"]' with '<em>@$1 wrote:</em><blockquote>'
|
| 573 |
+
$invision_markup = preg_replace( '/\[quote="(.*?)":(.*?)\]/', '<em>@$1 wrote:</em><blockquote>', $invision_markup );
|
| 574 |
+
// Replace '[/quote:XXXXXXX]' with '</blockquote>'
|
| 575 |
+
$invision_markup = preg_replace( '/\[\/quote:(.*?)\]/', '</blockquote>', $invision_markup );
|
| 576 |
+
|
| 577 |
+
// Replace '[twitter]$1[/twitter]' with '<a href="https://twitter.com/$1">@$1</a>"
|
| 578 |
+
$invision_markup = preg_replace( '/\[twitter\](.*?)\[\/twitter\]/', '<a href="https://twitter.com/$1">@$1</a>', $invision_markup );
|
| 579 |
+
|
| 580 |
+
// Replace '[member='username']' with '@username"
|
| 581 |
+
$invision_markup = preg_replace( '/\[member=\'(.*?)\'\]/', '@$1 ', $invision_markup );
|
| 582 |
+
|
| 583 |
+
// Replace '[media]' with ''
|
| 584 |
+
$invision_markup = preg_replace( '/\[media\]/', '', $invision_markup );
|
| 585 |
+
// Replace '[/media]' with ''
|
| 586 |
+
$invision_markup = preg_replace( '/\[\/media\]/', '', $invision_markup );
|
| 587 |
+
|
| 588 |
+
// Replace '[list:XXXXXXX]' with '<ul>'
|
| 589 |
+
$invision_markup = preg_replace( '/\[list\]/', '<ul>', $invision_markup );
|
| 590 |
+
// Replace '[list=1:XXXXXXX]' with '<ul>'
|
| 591 |
+
$invision_markup = preg_replace( '/\[list=1\]/', '<ul>', $invision_markup );
|
| 592 |
+
// Replace '[*:XXXXXXX]' with '<li>'
|
| 593 |
+
$invision_markup = preg_replace( '/\[\*\](.*?)\<br \/\>/', '<li>$1</li>', $invision_markup );
|
| 594 |
+
// Replace '[/list:u:XXXXXXX]' with '</ul>'
|
| 595 |
+
$invision_markup = preg_replace( '/\[\/list\]/', '</ul>', $invision_markup );
|
| 596 |
+
|
| 597 |
+
// Replace '[hr]' with '<hr>"
|
| 598 |
+
$invision_markup = preg_replace( '/\[hr\]/', '<hr>', $invision_markup );
|
| 599 |
+
|
| 600 |
+
// Replace '[font=XXXXXXX]' with ''
|
| 601 |
+
$invision_markup = preg_replace( '/\[font=(.*?)\]/', '', $invision_markup );
|
| 602 |
+
// Replace '[/font]' with ''
|
| 603 |
+
$invision_markup = preg_replace( '/\[\/font\]/', '', $invision_markup );
|
| 604 |
+
|
| 605 |
+
// Replace any Invision smilies from path '/sp-resources/forum-smileys/sf-smily.gif' with the equivelant WordPress Smilie
|
| 606 |
+
$invision_markup = preg_replace( '/\<img src=(.*?)EMO\_DIR(.*?)bbc_emoticon(.*?)alt=\'(.*?)\' \/\>/', '$4', $invision_markup );
|
| 607 |
+
$invision_markup = preg_replace( '/\:angry\:/', ':mad:', $invision_markup );
|
| 608 |
+
$invision_markup = preg_replace( '/\:mellow\:/', ':neutral:', $invision_markup );
|
| 609 |
+
$invision_markup = preg_replace( '/\:blink\:/', ':eek:', $invision_markup );
|
| 610 |
+
$invision_markup = preg_replace( '/B\)/', ':cool:', $invision_markup );
|
| 611 |
+
$invision_markup = preg_replace( '/\:rolleyes\:/', ':roll:', $invision_markup );
|
| 612 |
+
$invision_markup = preg_replace( '/\:unsure\:/', ':???:', $invision_markup );
|
| 613 |
+
|
| 614 |
+
// Now that Invision custom HTML has been stripped put the cleaned HTML back in $field
|
| 615 |
+
$field = $invision_markup;
|
| 616 |
+
|
| 617 |
+
require_once( bbpress()->admin->admin_dir . 'parser.php' );
|
| 618 |
+
$bbcode = BBCode::getInstance();
|
| 619 |
+
$bbcode->enable_smileys = false;
|
| 620 |
+
$bbcode->smiley_regex = false;
|
| 621 |
+
return html_entity_decode( $bbcode->Parse( $field ) );
|
| 622 |
+
}
|
| 623 |
}
|
includes/admin/converters/Mingle.php
ADDED
|
@@ -0,0 +1,454 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Implementation of Mingle Forums converter.
|
| 5 |
+
*
|
| 6 |
+
* @since bbPress (r4691)
|
| 7 |
+
* @link Codex Docs http://codex.bbpress.org/import-forums/mingle
|
| 8 |
+
*/
|
| 9 |
+
class Mingle extends BBP_Converter_Base {
|
| 10 |
+
|
| 11 |
+
/**
|
| 12 |
+
* Main constructor
|
| 13 |
+
*
|
| 14 |
+
* @uses Mingle::setup_globals()
|
| 15 |
+
*/
|
| 16 |
+
function __construct() {
|
| 17 |
+
parent::__construct();
|
| 18 |
+
$this->setup_globals();
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
* Sets up the field mappings
|
| 23 |
+
*/
|
| 24 |
+
public function setup_globals() {
|
| 25 |
+
|
| 26 |
+
/** Forum Section ******************************************************/
|
| 27 |
+
|
| 28 |
+
// Forum id (Stored in postmeta)
|
| 29 |
+
$this->field_map[] = array(
|
| 30 |
+
'from_tablename' => 'forum_forums',
|
| 31 |
+
'from_fieldname' => 'id',
|
| 32 |
+
'to_type' => 'forum',
|
| 33 |
+
'to_fieldname' => '_bbp_forum_id'
|
| 34 |
+
);
|
| 35 |
+
|
| 36 |
+
// Forum parent id (If no parent, then 0. Stored in postmeta)
|
| 37 |
+
$this->field_map[] = array(
|
| 38 |
+
'from_tablename' => 'forum_forums',
|
| 39 |
+
'from_fieldname' => 'parent_id',
|
| 40 |
+
'to_type' => 'forum',
|
| 41 |
+
'to_fieldname' => '_bbp_forum_parent_id'
|
| 42 |
+
);
|
| 43 |
+
|
| 44 |
+
// Forum title.
|
| 45 |
+
$this->field_map[] = array(
|
| 46 |
+
'from_tablename' => 'forum_forums',
|
| 47 |
+
'from_fieldname' => 'name',
|
| 48 |
+
'to_type' => 'forum',
|
| 49 |
+
'to_fieldname' => 'post_title'
|
| 50 |
+
);
|
| 51 |
+
|
| 52 |
+
// Forum slug (Clean name to avoid confilcts)
|
| 53 |
+
$this->field_map[] = array(
|
| 54 |
+
'from_tablename' => 'forum_forums',
|
| 55 |
+
'from_fieldname' => 'name',
|
| 56 |
+
'to_type' => 'forum',
|
| 57 |
+
'to_fieldname' => 'post_name',
|
| 58 |
+
'callback_method' => 'callback_slug'
|
| 59 |
+
);
|
| 60 |
+
// Forum description.
|
| 61 |
+
$this->field_map[] = array(
|
| 62 |
+
'from_tablename' => 'forum_forums',
|
| 63 |
+
'from_fieldname' => 'description',
|
| 64 |
+
'to_type' => 'forum',
|
| 65 |
+
'to_fieldname' => 'post_content',
|
| 66 |
+
'callback_method' => 'callback_null'
|
| 67 |
+
);
|
| 68 |
+
|
| 69 |
+
// Forum display order (Starts from 1)
|
| 70 |
+
$this->field_map[] = array(
|
| 71 |
+
'from_tablename' => 'forum_forums',
|
| 72 |
+
'from_fieldname' => 'sort',
|
| 73 |
+
'to_type' => 'forum',
|
| 74 |
+
'to_fieldname' => 'menu_order'
|
| 75 |
+
);
|
| 76 |
+
|
| 77 |
+
// Forum dates.
|
| 78 |
+
$this->field_map[] = array(
|
| 79 |
+
'to_type' => 'forum',
|
| 80 |
+
'to_fieldname' => 'post_date',
|
| 81 |
+
'default' => date('Y-m-d H:i:s')
|
| 82 |
+
);
|
| 83 |
+
$this->field_map[] = array(
|
| 84 |
+
'to_type' => 'forum',
|
| 85 |
+
'to_fieldname' => 'post_date_gmt',
|
| 86 |
+
'default' => date('Y-m-d H:i:s')
|
| 87 |
+
);
|
| 88 |
+
$this->field_map[] = array(
|
| 89 |
+
'to_type' => 'forum',
|
| 90 |
+
'to_fieldname' => 'post_modified',
|
| 91 |
+
'default' => date('Y-m-d H:i:s')
|
| 92 |
+
);
|
| 93 |
+
$this->field_map[] = array(
|
| 94 |
+
'to_type' => 'forum',
|
| 95 |
+
'to_fieldname' => 'post_modified_gmt',
|
| 96 |
+
'default' => date('Y-m-d H:i:s')
|
| 97 |
+
);
|
| 98 |
+
|
| 99 |
+
/** Topic Section ******************************************************/
|
| 100 |
+
|
| 101 |
+
// Topic id (Stored in postmeta)
|
| 102 |
+
$this->field_map[] = array(
|
| 103 |
+
'from_tablename' => 'forum_threads',
|
| 104 |
+
'from_fieldname' => 'id',
|
| 105 |
+
'to_type' => 'topic',
|
| 106 |
+
'to_fieldname' => '_bbp_topic_id'
|
| 107 |
+
);
|
| 108 |
+
|
| 109 |
+
// Topic parent forum id (If no parent, then 0. Stored in postmeta)
|
| 110 |
+
$this->field_map[] = array(
|
| 111 |
+
'from_tablename' => 'forum_threads',
|
| 112 |
+
'from_fieldname' => 'parent_id',
|
| 113 |
+
'to_type' => 'topic',
|
| 114 |
+
'to_fieldname' => '_bbp_forum_id',
|
| 115 |
+
'callback_method' => 'callback_forumid'
|
| 116 |
+
);
|
| 117 |
+
|
| 118 |
+
// Topic author.
|
| 119 |
+
$this->field_map[] = array(
|
| 120 |
+
'from_tablename' => 'forum_threads',
|
| 121 |
+
'from_fieldname' => 'starter',
|
| 122 |
+
'to_type' => 'topic',
|
| 123 |
+
'to_fieldname' => 'post_author',
|
| 124 |
+
'callback_method' => 'callback_userid'
|
| 125 |
+
);
|
| 126 |
+
|
| 127 |
+
// Topic content.
|
| 128 |
+
// Note: We join the forum_posts table because forum_topics do not have topic content.
|
| 129 |
+
$this->field_map[] = array(
|
| 130 |
+
'from_tablename' => 'forum_posts',
|
| 131 |
+
'from_fieldname' => 'text',
|
| 132 |
+
'join_tablename' => 'forum_threads',
|
| 133 |
+
'join_type' => 'INNER',
|
| 134 |
+
'join_expression' => 'USING (subject)',
|
| 135 |
+
'to_type' => 'topic',
|
| 136 |
+
'to_fieldname' => 'post_content',
|
| 137 |
+
'callback_method' => 'callback_html'
|
| 138 |
+
);
|
| 139 |
+
// Topic title.
|
| 140 |
+
$this->field_map[] = array(
|
| 141 |
+
'from_tablename' => 'forum_threads',
|
| 142 |
+
'from_fieldname' => 'subject',
|
| 143 |
+
'to_type' => 'topic',
|
| 144 |
+
'to_fieldname' => 'post_title'
|
| 145 |
+
);
|
| 146 |
+
|
| 147 |
+
// Topic slug (Clean name to avoid conflicts)
|
| 148 |
+
$this->field_map[] = array(
|
| 149 |
+
'from_tablename' => 'forum_threads',
|
| 150 |
+
'from_fieldname' => 'subject',
|
| 151 |
+
'to_type' => 'topic',
|
| 152 |
+
'to_fieldname' => 'post_name',
|
| 153 |
+
'callback_method' => 'callback_slug'
|
| 154 |
+
);
|
| 155 |
+
|
| 156 |
+
// Topic parent forum id (If no parent, then 0)
|
| 157 |
+
$this->field_map[] = array(
|
| 158 |
+
'from_tablename' => 'forum_threads',
|
| 159 |
+
'from_fieldname' => 'parent_id',
|
| 160 |
+
'to_type' => 'topic',
|
| 161 |
+
'to_fieldname' => 'post_parent',
|
| 162 |
+
'callback_method' => 'callback_forumid'
|
| 163 |
+
);
|
| 164 |
+
|
| 165 |
+
// Topic dates.
|
| 166 |
+
$this->field_map[] = array(
|
| 167 |
+
'from_tablename' => 'forum_threads',
|
| 168 |
+
'from_fieldname' => 'date',
|
| 169 |
+
'to_type' => 'topic',
|
| 170 |
+
'to_fieldname' => 'post_date'
|
| 171 |
+
);
|
| 172 |
+
$this->field_map[] = array(
|
| 173 |
+
'from_tablename' => 'forum_threads',
|
| 174 |
+
'from_fieldname' => 'date',
|
| 175 |
+
'to_type' => 'topic',
|
| 176 |
+
'to_fieldname' => 'post_date_gmt'
|
| 177 |
+
);
|
| 178 |
+
$this->field_map[] = array(
|
| 179 |
+
'from_tablename' => 'forum_threads',
|
| 180 |
+
'from_fieldname' => 'last_post',
|
| 181 |
+
'to_type' => 'topic',
|
| 182 |
+
'to_fieldname' => 'post_modified'
|
| 183 |
+
);
|
| 184 |
+
$this->field_map[] = array(
|
| 185 |
+
'from_tablename' => 'forum_threads',
|
| 186 |
+
'from_fieldname' => 'last_post',
|
| 187 |
+
'to_type' => 'topic',
|
| 188 |
+
'to_fieldname' => 'post_modified_gmt'
|
| 189 |
+
);
|
| 190 |
+
$this->field_map[] = array(
|
| 191 |
+
'from_tablename' => 'forum_threads',
|
| 192 |
+
'from_fieldname' => 'last_post',
|
| 193 |
+
'to_type' => 'topic',
|
| 194 |
+
'to_fieldname' => '_bbp_last_active_time'
|
| 195 |
+
);
|
| 196 |
+
|
| 197 |
+
// Topic status (Open or Closed)
|
| 198 |
+
$this->field_map[] = array(
|
| 199 |
+
'from_tablename' => 'forum_threads',
|
| 200 |
+
'from_fieldname' => 'closed',
|
| 201 |
+
'to_type' => 'topic',
|
| 202 |
+
'to_fieldname' => 'post_status',
|
| 203 |
+
'callback_method' => 'callback_topic_status'
|
| 204 |
+
);
|
| 205 |
+
|
| 206 |
+
/** Tags Section ******************************************************/
|
| 207 |
+
|
| 208 |
+
/**
|
| 209 |
+
* Mingle Forums do not support topic tags
|
| 210 |
+
*/
|
| 211 |
+
|
| 212 |
+
/** Reply Section ******************************************************/
|
| 213 |
+
|
| 214 |
+
// Reply id (Stored in postmeta)
|
| 215 |
+
$this->field_map[] = array(
|
| 216 |
+
'from_tablename' => 'forum_posts',
|
| 217 |
+
'from_fieldname' => 'id',
|
| 218 |
+
'to_type' => 'reply',
|
| 219 |
+
'to_fieldname' => '_bbp_post_id'
|
| 220 |
+
);
|
| 221 |
+
|
| 222 |
+
// Setup reply section table joins
|
| 223 |
+
// We need join the 'forum_threads' table to only import replies
|
| 224 |
+
$this->field_map[] = array(
|
| 225 |
+
'from_tablename' => 'forum_threads',
|
| 226 |
+
'from_fieldname' => 'date',
|
| 227 |
+
'join_tablename' => 'forum_posts',
|
| 228 |
+
'join_type' => 'INNER',
|
| 229 |
+
'join_expression' => 'ON forum_posts.parent_id = forum_threads.id',
|
| 230 |
+
'from_expression' => 'WHERE forum_threads.subject != forum_posts.subject',
|
| 231 |
+
'to_type' => 'reply',
|
| 232 |
+
'to_fieldname' => '_bbp_last_active_time'
|
| 233 |
+
);
|
| 234 |
+
|
| 235 |
+
// Reply parent forum id (If no parent, then 0. Stored in postmeta)
|
| 236 |
+
$this->field_map[] = array(
|
| 237 |
+
'from_tablename' => 'forum_posts',
|
| 238 |
+
'from_fieldname' => 'parent_id',
|
| 239 |
+
'to_type' => 'reply',
|
| 240 |
+
'to_fieldname' => '_bbp_forum_id',
|
| 241 |
+
'callback_method' => 'callback_topicid_to_forumid'
|
| 242 |
+
);
|
| 243 |
+
|
| 244 |
+
// Reply parent topic id (If no parent, then 0. Stored in postmeta)
|
| 245 |
+
$this->field_map[] = array(
|
| 246 |
+
'from_tablename' => 'forum_posts',
|
| 247 |
+
'from_fieldname' => 'id',
|
| 248 |
+
'to_type' => 'reply',
|
| 249 |
+
'to_fieldname' => '_bbp_topic_id',
|
| 250 |
+
'callback_method' => 'callback_topicid'
|
| 251 |
+
);
|
| 252 |
+
|
| 253 |
+
// Reply author.
|
| 254 |
+
$this->field_map[] = array(
|
| 255 |
+
'from_tablename' => 'forum_posts',
|
| 256 |
+
'from_fieldname' => 'author_id',
|
| 257 |
+
'to_type' => 'reply',
|
| 258 |
+
'to_fieldname' => 'post_author',
|
| 259 |
+
'callback_method' => 'callback_userid'
|
| 260 |
+
);
|
| 261 |
+
|
| 262 |
+
// Reply title.
|
| 263 |
+
$this->field_map[] = array(
|
| 264 |
+
'from_tablename' => 'forum_posts',
|
| 265 |
+
'from_fieldname' => 'subject',
|
| 266 |
+
'to_type' => 'reply',
|
| 267 |
+
'to_fieldname' => 'post_title'
|
| 268 |
+
);
|
| 269 |
+
|
| 270 |
+
// Reply slug (Clean name to avoid conflicts)
|
| 271 |
+
$this->field_map[] = array(
|
| 272 |
+
'from_tablename' => 'forum_posts',
|
| 273 |
+
'from_fieldname' => 'subject',
|
| 274 |
+
'to_type' => 'reply',
|
| 275 |
+
'to_fieldname' => 'post_name',
|
| 276 |
+
'callback_method' => 'callback_slug'
|
| 277 |
+
);
|
| 278 |
+
|
| 279 |
+
// Reply content.
|
| 280 |
+
$this->field_map[] = array(
|
| 281 |
+
'from_tablename' => 'forum_posts',
|
| 282 |
+
'from_fieldname' => 'text',
|
| 283 |
+
'to_type' => 'reply',
|
| 284 |
+
'to_fieldname' => 'post_content',
|
| 285 |
+
'callback_method' => 'callback_html'
|
| 286 |
+
);
|
| 287 |
+
|
| 288 |
+
// Reply parent topic id (If no parent, then 0)
|
| 289 |
+
$this->field_map[] = array(
|
| 290 |
+
'from_tablename' => 'forum_posts',
|
| 291 |
+
'from_fieldname' => 'parent_id',
|
| 292 |
+
'to_type' => 'reply',
|
| 293 |
+
'to_fieldname' => 'post_parent',
|
| 294 |
+
'callback_method' => 'callback_topicid'
|
| 295 |
+
);
|
| 296 |
+
|
| 297 |
+
// Reply dates.
|
| 298 |
+
$this->field_map[] = array(
|
| 299 |
+
'from_tablename' => 'forum_posts',
|
| 300 |
+
'from_fieldname' => 'date',
|
| 301 |
+
'to_type' => 'reply',
|
| 302 |
+
'to_fieldname' => 'post_date'
|
| 303 |
+
);
|
| 304 |
+
$this->field_map[] = array(
|
| 305 |
+
'from_tablename' => 'forum_posts',
|
| 306 |
+
'from_fieldname' => 'date',
|
| 307 |
+
'to_type' => 'reply',
|
| 308 |
+
'to_fieldname' => 'post_date_gmt'
|
| 309 |
+
);
|
| 310 |
+
$this->field_map[] = array(
|
| 311 |
+
'from_tablename' => 'forum_posts',
|
| 312 |
+
'from_fieldname' => 'date',
|
| 313 |
+
'to_type' => 'reply',
|
| 314 |
+
'to_fieldname' => 'post_modified'
|
| 315 |
+
);
|
| 316 |
+
$this->field_map[] = array(
|
| 317 |
+
'from_tablename' => 'forum_posts',
|
| 318 |
+
'from_fieldname' => 'date',
|
| 319 |
+
'to_type' => 'reply',
|
| 320 |
+
'to_fieldname' => 'post_modified_gmt'
|
| 321 |
+
);
|
| 322 |
+
|
| 323 |
+
/** User Section ******************************************************/
|
| 324 |
+
|
| 325 |
+
// Store old User id (Stored in usermeta)
|
| 326 |
+
$this->field_map[] = array(
|
| 327 |
+
'from_tablename' => 'users',
|
| 328 |
+
'from_fieldname' => 'ID',
|
| 329 |
+
'to_type' => 'user',
|
| 330 |
+
'to_fieldname' => '_bbp_user_id'
|
| 331 |
+
);
|
| 332 |
+
|
| 333 |
+
// Store old User password (Stored in usermeta)
|
| 334 |
+
$this->field_map[] = array(
|
| 335 |
+
'from_tablename' => 'users',
|
| 336 |
+
'from_fieldname' => 'user_pass',
|
| 337 |
+
'to_type' => 'user',
|
| 338 |
+
'to_fieldname' => '_bbp_password'
|
| 339 |
+
);
|
| 340 |
+
|
| 341 |
+
// User name.
|
| 342 |
+
$this->field_map[] = array(
|
| 343 |
+
'from_tablename' => 'users',
|
| 344 |
+
'from_fieldname' => 'user_login',
|
| 345 |
+
'to_type' => 'user',
|
| 346 |
+
'to_fieldname' => 'user_login'
|
| 347 |
+
);
|
| 348 |
+
|
| 349 |
+
// User nice name.
|
| 350 |
+
$this->field_map[] = array(
|
| 351 |
+
'from_tablename' => 'users',
|
| 352 |
+
'from_fieldname' => 'user_nicename',
|
| 353 |
+
'to_type' => 'user',
|
| 354 |
+
'to_fieldname' => 'user_nicename'
|
| 355 |
+
);
|
| 356 |
+
|
| 357 |
+
// User email.
|
| 358 |
+
$this->field_map[] = array(
|
| 359 |
+
'from_tablename' => 'users',
|
| 360 |
+
'from_fieldname' => 'user_email',
|
| 361 |
+
'to_type' => 'user',
|
| 362 |
+
'to_fieldname' => 'user_email'
|
| 363 |
+
);
|
| 364 |
+
|
| 365 |
+
// User homepage.
|
| 366 |
+
$this->field_map[] = array(
|
| 367 |
+
'from_tablename' => 'users',
|
| 368 |
+
'from_fieldname' => 'user_url',
|
| 369 |
+
'to_type' => 'user',
|
| 370 |
+
'to_fieldname' => 'user_url'
|
| 371 |
+
);
|
| 372 |
+
|
| 373 |
+
// User registered.
|
| 374 |
+
$this->field_map[] = array(
|
| 375 |
+
'from_tablename' => 'users',
|
| 376 |
+
'from_fieldname' => 'user_registered',
|
| 377 |
+
'to_type' => 'user',
|
| 378 |
+
'to_fieldname' => 'user_registered'
|
| 379 |
+
);
|
| 380 |
+
|
| 381 |
+
// User status.
|
| 382 |
+
$this->field_map[] = array(
|
| 383 |
+
'from_tablename' => 'users',
|
| 384 |
+
'from_fieldname' => 'user_status',
|
| 385 |
+
'to_type' => 'user',
|
| 386 |
+
'to_fieldname' => 'user_status'
|
| 387 |
+
);
|
| 388 |
+
|
| 389 |
+
// User display name.
|
| 390 |
+
$this->field_map[] = array(
|
| 391 |
+
'from_tablename' => 'users',
|
| 392 |
+
'from_fieldname' => 'display_name',
|
| 393 |
+
'to_type' => 'user',
|
| 394 |
+
'to_fieldname' => 'display_name'
|
| 395 |
+
);
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
/**
|
| 399 |
+
* This method allows us to indicates what is or is not converted for each
|
| 400 |
+
* converter.
|
| 401 |
+
*/
|
| 402 |
+
public function info() {
|
| 403 |
+
return '';
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
/**
|
| 407 |
+
* This method is to save the salt and password together. That
|
| 408 |
+
* way when we authenticate it we can get it out of the database
|
| 409 |
+
* as one value. Array values are auto sanitized by wordpress.
|
| 410 |
+
*/
|
| 411 |
+
public function callback_savepass( $field, $row ) {
|
| 412 |
+
return false;
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
/**
|
| 416 |
+
* This method is to take the pass out of the database and compare
|
| 417 |
+
* to a pass the user has typed in.
|
| 418 |
+
*/
|
| 419 |
+
public function authenticate_pass( $password, $serialized_pass ) {
|
| 420 |
+
return false;
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
/**
|
| 424 |
+
* Translate the post status from Mingle numeric's to WordPress's strings.
|
| 425 |
+
*
|
| 426 |
+
* @param int $status Mingle v1.x numeric topic status
|
| 427 |
+
* @return string WordPress safe
|
| 428 |
+
*/
|
| 429 |
+
public function callback_topic_status( $status = 0 ) {
|
| 430 |
+
switch ( $status ) {
|
| 431 |
+
case 1 :
|
| 432 |
+
$status = 'closed';
|
| 433 |
+
break;
|
| 434 |
+
|
| 435 |
+
case 0 :
|
| 436 |
+
default :
|
| 437 |
+
$status = 'publish';
|
| 438 |
+
break;
|
| 439 |
+
}
|
| 440 |
+
return $status;
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
/**
|
| 444 |
+
* This callback processes any custom BBCodes with parser.php
|
| 445 |
+
*/
|
| 446 |
+
protected function callback_html( $field ) {
|
| 447 |
+
require_once( bbpress()->admin->admin_dir . 'parser.php' );
|
| 448 |
+
$bbcode = BBCode::getInstance();
|
| 449 |
+
$bbcode->enable_smileys = false;
|
| 450 |
+
$bbcode->smiley_regex = false;
|
| 451 |
+
return html_entity_decode( $bbcode->Parse( $field ) );
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
}
|
includes/admin/converters/SimplePress5.php
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Implementation of SimplePress v5 converter.
|
| 5 |
+
*
|
| 6 |
+
* @since bbPress (r4638)
|
| 7 |
+
* @link Codex Docs http://codex.bbpress.org/import-forums/simplepress/
|
| 8 |
+
*/
|
| 9 |
+
class SimplePress5 extends BBP_Converter_Base {
|
| 10 |
+
|
| 11 |
+
/**
|
| 12 |
+
* Main Constructor
|
| 13 |
+
*
|
| 14 |
+
* @uses SimplePress5::setup_globals()
|
| 15 |
+
*/
|
| 16 |
+
function __construct() {
|
| 17 |
+
parent::__construct();
|
| 18 |
+
$this->setup_globals();
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
* Sets up the field mappings
|
| 23 |
+
*/
|
| 24 |
+
public function setup_globals() {
|
| 25 |
+
|
| 26 |
+
/** Forum Section ******************************************************/
|
| 27 |
+
|
| 28 |
+
// Forum id (Stored in postmeta)
|
| 29 |
+
$this->field_map[] = array(
|
| 30 |
+
'from_tablename' => 'sfforums',
|
| 31 |
+
'from_fieldname' => 'forum_id',
|
| 32 |
+
'to_type' => 'forum',
|
| 33 |
+
'to_fieldname' => '_bbp_forum_id'
|
| 34 |
+
);
|
| 35 |
+
|
| 36 |
+
// Forum parent id (If no parent, then 0, Stored in postmeta)
|
| 37 |
+
$this->field_map[] = array(
|
| 38 |
+
'from_tablename' => 'sfforums',
|
| 39 |
+
'from_fieldname' => 'parent',
|
| 40 |
+
'to_type' => 'forum',
|
| 41 |
+
'to_fieldname' => '_bbp_forum_parent_id'
|
| 42 |
+
);
|
| 43 |
+
|
| 44 |
+
// Forum topic count (Stored in postmeta)
|
| 45 |
+
$this->field_map[] = array(
|
| 46 |
+
'from_tablename' => 'sfforums',
|
| 47 |
+
'from_fieldname' => 'topic_count',
|
| 48 |
+
'to_type' => 'forum',
|
| 49 |
+
'to_fieldname' => '_bbp_topic_count'
|
| 50 |
+
);
|
| 51 |
+
|
| 52 |
+
// Forum reply count (Stored in postmeta)
|
| 53 |
+
$this->field_map[] = array(
|
| 54 |
+
'from_tablename' => 'sfforums',
|
| 55 |
+
'from_fieldname' => 'post_count',
|
| 56 |
+
'to_type' => 'forum',
|
| 57 |
+
'to_fieldname' => '_bbp_reply_count'
|
| 58 |
+
);
|
| 59 |
+
|
| 60 |
+
// Forum total topic count (Stored in postmeta)
|
| 61 |
+
$this->field_map[] = array(
|
| 62 |
+
'from_tablename' => 'sfforums',
|
| 63 |
+
'from_fieldname' => 'topic_count',
|
| 64 |
+
'to_type' => 'forum',
|
| 65 |
+
'to_fieldname' => '_bbp_total_topic_count'
|
| 66 |
+
);
|
| 67 |
+
|
| 68 |
+
// Forum total reply count (Stored in postmeta)
|
| 69 |
+
$this->field_map[] = array(
|
| 70 |
+
'from_tablename' => 'sfforums',
|
| 71 |
+
'from_fieldname' => 'post_count',
|
| 72 |
+
'to_type' => 'forum',
|
| 73 |
+
'to_fieldname' => '_bbp_total_reply_count'
|
| 74 |
+
);
|
| 75 |
+
|
| 76 |
+
// Forum title.
|
| 77 |
+
$this->field_map[] = array(
|
| 78 |
+
'from_tablename' => 'sfforums',
|
| 79 |
+
'from_fieldname' => 'forum_name',
|
| 80 |
+
'to_type' => 'forum',
|
| 81 |
+
'to_fieldname' => 'post_title'
|
| 82 |
+
);
|
| 83 |
+
|
| 84 |
+
// Forum slug (Clean name to avoid conflicts)
|
| 85 |
+
$this->field_map[] = array(
|
| 86 |
+
'from_tablename' => 'sfforums',
|
| 87 |
+
'from_fieldname' => 'forum_name',
|
| 88 |
+
'to_type' => 'forum',
|
| 89 |
+
'to_fieldname' => 'post_name',
|
| 90 |
+
'callback_method' => 'callback_slug'
|
| 91 |
+
);
|
| 92 |
+
|
| 93 |
+
// Forum description.
|
| 94 |
+
$this->field_map[] = array(
|
| 95 |
+
'from_tablename' => 'sfforums',
|
| 96 |
+
'from_fieldname' => 'forum_desc',
|
| 97 |
+
'to_type' => 'forum',
|
| 98 |
+
'to_fieldname' => 'post_content',
|
| 99 |
+
'callback_method' => 'callback_null'
|
| 100 |
+
);
|
| 101 |
+
|
| 102 |
+
// Forum display order (Starts from 1)
|
| 103 |
+
$this->field_map[] = array(
|
| 104 |
+
'from_tablename' => 'sfforums',
|
| 105 |
+
'from_fieldname' => 'forum_seq',
|
| 106 |
+
'to_type' => 'forum',
|
| 107 |
+
'to_fieldname' => 'menu_order'
|
| 108 |
+
);
|
| 109 |
+
|
| 110 |
+
// Forum dates.
|
| 111 |
+
$this->field_map[] = array(
|
| 112 |
+
'to_type' => 'forums',
|
| 113 |
+
'to_fieldname' => 'post_date',
|
| 114 |
+
'default' => date('Y-m-d H:i:s')
|
| 115 |
+
);
|
| 116 |
+
$this->field_map[] = array(
|
| 117 |
+
'to_type' => 'forums',
|
| 118 |
+
'to_fieldname' => 'post_date_gmt',
|
| 119 |
+
'default' => date('Y-m-d H:i:s')
|
| 120 |
+
);
|
| 121 |
+
$this->field_map[] = array(
|
| 122 |
+
'to_type' => 'forums',
|
| 123 |
+
'to_fieldname' => 'post_modified',
|
| 124 |
+
'default' => date('Y-m-d H:i:s')
|
| 125 |
+
);
|
| 126 |
+
$this->field_map[] = array(
|
| 127 |
+
'to_type' => 'forums',
|
| 128 |
+
'to_fieldname' => 'post_modified_gmt',
|
| 129 |
+
'default' => date('Y-m-d H:i:s')
|
| 130 |
+
);
|
| 131 |
+
|
| 132 |
+
/** Topic Section ******************************************************/
|
| 133 |
+
|
| 134 |
+
// Topic id (Stored in postmeta)
|
| 135 |
+
$this->field_map[] = array(
|
| 136 |
+
'from_tablename' => 'sftopics',
|
| 137 |
+
'from_fieldname' => 'topic_id',
|
| 138 |
+
'to_type' => 'topic',
|
| 139 |
+
'to_fieldname' => '_bbp_topic_id'
|
| 140 |
+
);
|
| 141 |
+
|
| 142 |
+
// Topic reply count (Stored in postmeta)
|
| 143 |
+
$this->field_map[] = array(
|
| 144 |
+
'from_tablename' => 'sftopics',
|
| 145 |
+
'from_fieldname' => 'post_count',
|
| 146 |
+
'to_type' => 'topic',
|
| 147 |
+
'to_fieldname' => '_bbp_reply_count',
|
| 148 |
+
'callback_method' => 'callback_topic_reply_count'
|
| 149 |
+
);
|
| 150 |
+
|
| 151 |
+
// Topic parent forum id (If no parent, then 0. Stored in postmeta)
|
| 152 |
+
$this->field_map[] = array(
|
| 153 |
+
'from_tablename' => 'sftopics',
|
| 154 |
+
'from_fieldname' => 'forum_id',
|
| 155 |
+
'to_type' => 'topic',
|
| 156 |
+
'to_fieldname' => '_bbp_forum_id',
|
| 157 |
+
'callback_method' => 'callback_forumid'
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
// Topic author.
|
| 161 |
+
$this->field_map[] = array(
|
| 162 |
+
'from_tablename' => 'sftopics',
|
| 163 |
+
'from_fieldname' => 'user_id',
|
| 164 |
+
'to_type' => 'topic',
|
| 165 |
+
'to_fieldname' => 'post_author',
|
| 166 |
+
'callback_method' => 'callback_userid'
|
| 167 |
+
);
|
| 168 |
+
|
| 169 |
+
// Topic content.
|
| 170 |
+
// Note: We join the sfposts table because sftopics do not have content.
|
| 171 |
+
$this->field_map[] = array(
|
| 172 |
+
'from_tablename' => 'sfposts',
|
| 173 |
+
'from_fieldname' => 'post_content',
|
| 174 |
+
'join_tablename' => 'sftopics',
|
| 175 |
+
'join_type' => 'INNER',
|
| 176 |
+
'join_expression' => 'USING (topic_id) WHERE sfposts.post_index = 1',
|
| 177 |
+
'to_type' => 'topic',
|
| 178 |
+
'to_fieldname' => 'post_content',
|
| 179 |
+
'callback_method' => 'callback_html'
|
| 180 |
+
);
|
| 181 |
+
|
| 182 |
+
// Topic title.
|
| 183 |
+
$this->field_map[] = array(
|
| 184 |
+
'from_tablename' => 'sftopics',
|
| 185 |
+
'from_fieldname' => 'topic_name',
|
| 186 |
+
'to_type' => 'topic',
|
| 187 |
+
'to_fieldname' => 'post_title'
|
| 188 |
+
);
|
| 189 |
+
|
| 190 |
+
// Topic slug (Clean name to avoid conflicts)
|
| 191 |
+
$this->field_map[] = array(
|
| 192 |
+
'from_tablename' => 'sftopics',
|
| 193 |
+
'from_fieldname' => 'topic_name',
|
| 194 |
+
'to_type' => 'topic',
|
| 195 |
+
'to_fieldname' => 'post_name',
|
| 196 |
+
'callback_method' => 'callback_slug'
|
| 197 |
+
);
|
| 198 |
+
|
| 199 |
+
// Topic parent forum id (If no parent, then 0)
|
| 200 |
+
$this->field_map[] = array(
|
| 201 |
+
'from_tablename' => 'sftopics',
|
| 202 |
+
'from_fieldname' => 'forum_id',
|
| 203 |
+
'to_type' => 'topic',
|
| 204 |
+
'to_fieldname' => 'post_parent',
|
| 205 |
+
'callback_method' => 'callback_forumid'
|
| 206 |
+
);
|
| 207 |
+
|
| 208 |
+
// Topic dates.
|
| 209 |
+
$this->field_map[] = array(
|
| 210 |
+
'from_tablename' => 'sftopics',
|
| 211 |
+
'from_fieldname' => 'topic_date',
|
| 212 |
+
'to_type' => 'topic',
|
| 213 |
+
'to_fieldname' => 'post_date'
|
| 214 |
+
);
|
| 215 |
+
$this->field_map[] = array(
|
| 216 |
+
'from_tablename' => 'sftopics',
|
| 217 |
+
'from_fieldname' => 'topic_date',
|
| 218 |
+
'to_type' => 'topic',
|
| 219 |
+
'to_fieldname' => 'post_date_gmt'
|
| 220 |
+
);
|
| 221 |
+
$this->field_map[] = array(
|
| 222 |
+
'from_tablename' => 'sftopics',
|
| 223 |
+
'from_fieldname' => 'topic_date',
|
| 224 |
+
'to_type' => 'topic',
|
| 225 |
+
'to_fieldname' => 'post_modified'
|
| 226 |
+
);
|
| 227 |
+
$this->field_map[] = array(
|
| 228 |
+
'from_tablename' => 'sftopics',
|
| 229 |
+
'from_fieldname' => 'topic_date',
|
| 230 |
+
'to_type' => 'topic',
|
| 231 |
+
'to_fieldname' => 'post_modified_gmt'
|
| 232 |
+
);
|
| 233 |
+
$this->field_map[] = array(
|
| 234 |
+
'from_tablename' => 'sftopics',
|
| 235 |
+
'from_fieldname' => 'topic_date',
|
| 236 |
+
'to_type' => 'topic',
|
| 237 |
+
'to_fieldname' => '_bbp_last_active_time'
|
| 238 |
+
);
|
| 239 |
+
|
| 240 |
+
// Topic status (Open or Closed)
|
| 241 |
+
$this->field_map[] = array(
|
| 242 |
+
'from_tablename' => 'sftopics',
|
| 243 |
+
'from_fieldname' => 'topic_status',
|
| 244 |
+
'to_type' => 'topic',
|
| 245 |
+
'to_fieldname' => 'post_status',
|
| 246 |
+
'callback_method' => 'callback_status'
|
| 247 |
+
);
|
| 248 |
+
|
| 249 |
+
/** Tags Section ******************************************************/
|
| 250 |
+
|
| 251 |
+
/**
|
| 252 |
+
* SimplePress Forums do not support topic tags without paid extensions
|
| 253 |
+
*/
|
| 254 |
+
|
| 255 |
+
/** Reply Section *****************************************************/
|
| 256 |
+
|
| 257 |
+
// Reply id (Stored in postmeta)
|
| 258 |
+
$this->field_map[] = array(
|
| 259 |
+
'from_tablename' => 'sfposts',
|
| 260 |
+
'from_fieldname' => 'post_id',
|
| 261 |
+
'to_type' => 'reply',
|
| 262 |
+
'to_fieldname' => '_bbp_post_id'
|
| 263 |
+
);
|
| 264 |
+
|
| 265 |
+
// Reply parent forum id (If no parent, then 0. Stored in postmeta)
|
| 266 |
+
$this->field_map[] = array(
|
| 267 |
+
'from_tablename' => 'sfposts',
|
| 268 |
+
'from_fieldname' => 'forum_id',
|
| 269 |
+
'to_type' => 'reply',
|
| 270 |
+
'to_fieldname' => '_bbp_forum_id',
|
| 271 |
+
'callback_method' => 'callback_topicid_to_forumid'
|
| 272 |
+
);
|
| 273 |
+
|
| 274 |
+
// Reply parent topic id (If no parent, then 0. Stored in postmeta)
|
| 275 |
+
$this->field_map[] = array(
|
| 276 |
+
'from_tablename' => 'sfposts',
|
| 277 |
+
'from_fieldname' => 'topic_id',
|
| 278 |
+
'to_type' => 'reply',
|
| 279 |
+
'to_fieldname' => '_bbp_topic_id',
|
| 280 |
+
'callback_method' => 'callback_topicid'
|
| 281 |
+
);
|
| 282 |
+
|
| 283 |
+
// Reply author ip (Stored in postmeta)
|
| 284 |
+
$this->field_map[] = array(
|
| 285 |
+
'from_tablename' => 'sfposts',
|
| 286 |
+
'from_fieldname' => 'poster_ip',
|
| 287 |
+
'to_type' => 'reply',
|
| 288 |
+
'to_fieldname' => '_bbp_author_ip'
|
| 289 |
+
);
|
| 290 |
+
|
| 291 |
+
// Reply author.
|
| 292 |
+
$this->field_map[] = array(
|
| 293 |
+
'from_tablename' => 'sfposts',
|
| 294 |
+
'from_fieldname' => 'user_id',
|
| 295 |
+
'to_type' => 'reply',
|
| 296 |
+
'to_fieldname' => 'post_author',
|
| 297 |
+
'callback_method' => 'callback_userid'
|
| 298 |
+
);
|
| 299 |
+
|
| 300 |
+
// Reply title.
|
| 301 |
+
// Note: We join the sftopics table because sfposts table does not include topic title.
|
| 302 |
+
$this->field_map[] = array(
|
| 303 |
+
'from_tablename' => 'sftopics',
|
| 304 |
+
'from_fieldname' => 'topic_name',
|
| 305 |
+
'join_tablename' => 'sfposts',
|
| 306 |
+
'join_type' => 'LEFT',
|
| 307 |
+
'join_expression' => 'USING (topic_id) WHERE sfposts.post_index != 1',
|
| 308 |
+
'to_type' => 'reply',
|
| 309 |
+
'to_fieldname' => 'post_title',
|
| 310 |
+
'callback_method' => 'callback_reply_title'
|
| 311 |
+
);
|
| 312 |
+
|
| 313 |
+
// Reply content.
|
| 314 |
+
$this->field_map[] = array(
|
| 315 |
+
'from_tablename' => 'sfposts',
|
| 316 |
+
'from_fieldname' => 'post_content',
|
| 317 |
+
'to_type' => 'reply',
|
| 318 |
+
'to_fieldname' => 'post_content',
|
| 319 |
+
'callback_method' => 'callback_html'
|
| 320 |
+
);
|
| 321 |
+
|
| 322 |
+
// Reply parent topic id (If no parent, then 0)
|
| 323 |
+
$this->field_map[] = array(
|
| 324 |
+
'from_tablename' => 'sfposts',
|
| 325 |
+
'from_fieldname' => 'topic_id',
|
| 326 |
+
'to_type' => 'reply',
|
| 327 |
+
'to_fieldname' => 'post_parent',
|
| 328 |
+
'callback_method' => 'callback_topicid'
|
| 329 |
+
);
|
| 330 |
+
|
| 331 |
+
// Reply dates.
|
| 332 |
+
$this->field_map[] = array(
|
| 333 |
+
'from_tablename' => 'sfposts',
|
| 334 |
+
'from_fieldname' => 'post_date',
|
| 335 |
+
'to_type' => 'reply',
|
| 336 |
+
'to_fieldname' => 'post_date'
|
| 337 |
+
);
|
| 338 |
+
$this->field_map[] = array(
|
| 339 |
+
'from_tablename' => 'sfposts',
|
| 340 |
+
'from_fieldname' => 'post_date',
|
| 341 |
+
'to_type' => 'reply',
|
| 342 |
+
'to_fieldname' => 'post_date_gmt'
|
| 343 |
+
);
|
| 344 |
+
$this->field_map[] = array(
|
| 345 |
+
'from_tablename' => 'sfposts',
|
| 346 |
+
'from_fieldname' => 'post_date',
|
| 347 |
+
'to_type' => 'reply',
|
| 348 |
+
'to_fieldname' => 'post_modified'
|
| 349 |
+
);
|
| 350 |
+
$this->field_map[] = array(
|
| 351 |
+
'from_tablename' => 'sfposts',
|
| 352 |
+
'from_fieldname' => 'post_date',
|
| 353 |
+
'to_type' => 'reply',
|
| 354 |
+
'to_fieldname' => 'post_modified_gmt'
|
| 355 |
+
);
|
| 356 |
+
|
| 357 |
+
/** User Section ******************************************************/
|
| 358 |
+
|
| 359 |
+
// Store old User id (Stored in usermeta)
|
| 360 |
+
$this->field_map[] = array(
|
| 361 |
+
'from_tablename' => 'users',
|
| 362 |
+
'from_fieldname' => 'ID',
|
| 363 |
+
'to_type' => 'user',
|
| 364 |
+
'to_fieldname' => '_bbp_user_id'
|
| 365 |
+
);
|
| 366 |
+
|
| 367 |
+
// Store old User password (Stored in usermeta)
|
| 368 |
+
$this->field_map[] = array(
|
| 369 |
+
'from_tablename' => 'users',
|
| 370 |
+
'from_fieldname' => 'user_pass',
|
| 371 |
+
'to_type' => 'user',
|
| 372 |
+
'to_fieldname' => '_bbp_password'
|
| 373 |
+
);
|
| 374 |
+
|
| 375 |
+
// User name.
|
| 376 |
+
$this->field_map[] = array(
|
| 377 |
+
'from_tablename' => 'users',
|
| 378 |
+
'from_fieldname' => 'user_login',
|
| 379 |
+
'to_type' => 'user',
|
| 380 |
+
'to_fieldname' => 'user_login'
|
| 381 |
+
);
|
| 382 |
+
|
| 383 |
+
// User nice name.
|
| 384 |
+
$this->field_map[] = array(
|
| 385 |
+
'from_tablename' => 'users',
|
| 386 |
+
'from_fieldname' => 'user_nicename',
|
| 387 |
+
'to_type' => 'user',
|
| 388 |
+
'to_fieldname' => 'user_nicename'
|
| 389 |
+
);
|
| 390 |
+
|
| 391 |
+
// User email.
|
| 392 |
+
$this->field_map[] = array(
|
| 393 |
+
'from_tablename' => 'users',
|
| 394 |
+
'from_fieldname' => 'user_email',
|
| 395 |
+
'to_type' => 'user',
|
| 396 |
+
'to_fieldname' => 'user_email'
|
| 397 |
+
);
|
| 398 |
+
|
| 399 |
+
// User homepage.
|
| 400 |
+
$this->field_map[] = array(
|
| 401 |
+
'from_tablename' => 'users',
|
| 402 |
+
'from_fieldname' => 'user_url',
|
| 403 |
+
'to_type' => 'user',
|
| 404 |
+
'to_fieldname' => 'user_url'
|
| 405 |
+
);
|
| 406 |
+
|
| 407 |
+
// User registered.
|
| 408 |
+
$this->field_map[] = array(
|
| 409 |
+
'from_tablename' => 'users',
|
| 410 |
+
'from_fieldname' => 'user_registered',
|
| 411 |
+
'to_type' => 'user',
|
| 412 |
+
'to_fieldname' => 'user_registered'
|
| 413 |
+
);
|
| 414 |
+
|
| 415 |
+
// User status.
|
| 416 |
+
$this->field_map[] = array(
|
| 417 |
+
'from_tablename' => 'users',
|
| 418 |
+
'from_fieldname' => 'user_status',
|
| 419 |
+
'to_type' => 'user',
|
| 420 |
+
'to_fieldname' => 'user_status'
|
| 421 |
+
);
|
| 422 |
+
|
| 423 |
+
// User display name.
|
| 424 |
+
$this->field_map[] = array(
|
| 425 |
+
'from_tablename' => 'users',
|
| 426 |
+
'from_fieldname' => 'display_name',
|
| 427 |
+
'to_type' => 'user',
|
| 428 |
+
'to_fieldname' => 'display_name'
|
| 429 |
+
);
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
/**
|
| 433 |
+
* This method allows us to indicates what is or is not converted for each
|
| 434 |
+
* converter.
|
| 435 |
+
*/
|
| 436 |
+
public function info() {
|
| 437 |
+
return '';
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
/**
|
| 441 |
+
* This method is to save the salt and password together. That
|
| 442 |
+
* way when we authenticate it we can get it out of the database
|
| 443 |
+
* as one value. Array values are auto sanitized by wordpress.
|
| 444 |
+
*/
|
| 445 |
+
public function callback_savepass( $field, $row ) {
|
| 446 |
+
return false;
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
/**
|
| 450 |
+
* This method is to take the pass out of the database and compare
|
| 451 |
+
* to a pass the user has typed in.
|
| 452 |
+
*/
|
| 453 |
+
public function authenticate_pass( $password, $serialized_pass ) {
|
| 454 |
+
return false;
|
| 455 |
+
}
|
| 456 |
+
|
| 457 |
+
/**
|
| 458 |
+
* Translate the post status from Simple:Press v5.x numeric's to WordPress's strings.
|
| 459 |
+
*
|
| 460 |
+
* @param int $status Simple:Press numeric status
|
| 461 |
+
* @return string WordPress safe
|
| 462 |
+
*/
|
| 463 |
+
public function callback_status( $status = 0 ) {
|
| 464 |
+
switch ( $status ) {
|
| 465 |
+
case 1 :
|
| 466 |
+
$status = 'closed';
|
| 467 |
+
break;
|
| 468 |
+
|
| 469 |
+
case 0 :
|
| 470 |
+
default :
|
| 471 |
+
$status = 'publish';
|
| 472 |
+
break;
|
| 473 |
+
}
|
| 474 |
+
return $status;
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
/**
|
| 478 |
+
* Verify the topic reply count.
|
| 479 |
+
*
|
| 480 |
+
* @param int $count Simple:Press v5.x reply count
|
| 481 |
+
* @return string WordPress safe
|
| 482 |
+
*/
|
| 483 |
+
public function callback_topic_reply_count( $count = 1 ) {
|
| 484 |
+
$count = absint( (int) $count - 1 );
|
| 485 |
+
return $count;
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
/**
|
| 489 |
+
* Set the reply title
|
| 490 |
+
*
|
| 491 |
+
* @param string $title Simple:Press v5.x topic title of this reply
|
| 492 |
+
* @return string Prefixed topic title, or empty string
|
| 493 |
+
*/
|
| 494 |
+
public function callback_reply_title( $title = '' ) {
|
| 495 |
+
$title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
|
| 496 |
+
return $title;
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
/**
|
| 500 |
+
* This callback processes any custom parser.php attributes and custom HTML code with preg_replace
|
| 501 |
+
*/
|
| 502 |
+
protected function callback_html( $field ) {
|
| 503 |
+
|
| 504 |
+
// Strip any custom HTML not supported by parser.php first from $field before parsing $field to parser.php
|
| 505 |
+
$simplepress_markup = $field;
|
| 506 |
+
$simplepress_markup = html_entity_decode( $simplepress_markup );
|
| 507 |
+
|
| 508 |
+
// Replace any SimplePress smilies from path '/sp-resources/forum-smileys/sf-smily.gif' with the equivelant WordPress Smilie
|
| 509 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-confused\.gif(.*?)\" \/>/', ':?' , $simplepress_markup );
|
| 510 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-cool\.gif(.*?)\" \/>/', ':cool:', $simplepress_markup );
|
| 511 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-cry\.gif(.*?)\" \/>/', ':cry:', $simplepress_markup );
|
| 512 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-embarassed\.gif(.*?)\" \/>/' , ':oops:', $simplepress_markup );
|
| 513 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-frown\.gif(.*?)\" \/>/', ':(', $simplepress_markup );
|
| 514 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-kiss\.gif(.*?)\" \/>/', ':P', $simplepress_markup );
|
| 515 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-laugh\.gif(.*?)\" \/>/', ':D', $simplepress_markup );
|
| 516 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-smile\.gif(.*?)\" \/>/', ':smile:', $simplepress_markup );
|
| 517 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-surprised\.gif(.*?)\" \/>/', ':o', $simplepress_markup );
|
| 518 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-wink\.gif(.*?)\" \/>/', ':wink:', $simplepress_markup );
|
| 519 |
+
$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-yell\.gif(.*?)\" \/>/', ':x', $simplepress_markup );
|
| 520 |
+
|
| 521 |
+
// Replace '<div class="sfcode">example code</div>' with '<code>*</code>'
|
| 522 |
+
$simplepress_markup = preg_replace( '/\<div class\=\"sfcode\"\>(.*?)\<\/div\>/' , '<code>$1</code>' , $simplepress_markup );
|
| 523 |
+
|
| 524 |
+
// Replace '<strong>username said </strong>' with '@username said:'
|
| 525 |
+
$simplepress_markup = preg_replace ( '/\<strong\>(.*?)\ said\ \<\/strong\>/', '@$1 said:', $simplepress_markup );
|
| 526 |
+
|
| 527 |
+
// Now that SimplePress' custom HTML codes have been stripped put the cleaned HTML back in $field
|
| 528 |
+
$field = $simplepress_markup;
|
| 529 |
+
|
| 530 |
+
// Parse out any bbCodes with the BBCode 'parser.php'
|
| 531 |
+
require_once( bbpress()->admin->admin_dir . 'parser.php' );
|
| 532 |
+
$bbcode = BBCode::getInstance();
|
| 533 |
+
$bbcode->enable_smileys = false;
|
| 534 |
+
$bbcode->smiley_regex = false;
|
| 535 |
+
return html_entity_decode( $bbcode->Parse( $field ) );
|
| 536 |
+
}
|
| 537 |
+
}
|
includes/admin/converters/Vanilla.php
ADDED
|
@@ -0,0 +1,545 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Implementation of Vanilla 2.0.18.1 Converter
|
| 5 |
+
*
|
| 6 |
+
* @since bbPress (r4717)
|
| 7 |
+
* @link Codex Docs http://codex.bbpress.org/import-forums/vanilla
|
| 8 |
+
*/
|
| 9 |
+
class Vanilla extends BBP_Converter_Base {
|
| 10 |
+
|
| 11 |
+
/**
|
| 12 |
+
* Main Constructor
|
| 13 |
+
*
|
| 14 |
+
* @uses Vanilla::setup_globals()
|
| 15 |
+
*/
|
| 16 |
+
function __construct() {
|
| 17 |
+
parent::__construct();
|
| 18 |
+
$this->setup_globals();
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
* Sets up the field mappings
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
public function setup_globals() {
|
| 26 |
+
|
| 27 |
+
/** Forum Section *****************************************************/
|
| 28 |
+
|
| 29 |
+
// Forum id (Stored in postmeta)
|
| 30 |
+
$this->field_map[] = array(
|
| 31 |
+
'from_tablename' => 'Category',
|
| 32 |
+
'from_fieldname' => 'CategoryID',
|
| 33 |
+
'from_expression' => 'WHERE Category.CategoryID > 0',
|
| 34 |
+
'to_type' => 'forum',
|
| 35 |
+
'to_fieldname' => '_bbp_forum_id'
|
| 36 |
+
);
|
| 37 |
+
|
| 38 |
+
// Forum parent id (If no parent, then 0. Stored in postmeta)
|
| 39 |
+
$this->field_map[] = array(
|
| 40 |
+
'from_tablename' => 'Category',
|
| 41 |
+
'from_fieldname' => 'ParentCategoryID',
|
| 42 |
+
'to_type' => 'forum',
|
| 43 |
+
'to_fieldname' => '_bbp_forum_parent_id',
|
| 44 |
+
'callback_method' => 'callback_forum_parent'
|
| 45 |
+
);
|
| 46 |
+
|
| 47 |
+
// Forum topic count (Stored in postmeta)
|
| 48 |
+
$this->field_map[] = array(
|
| 49 |
+
'from_tablename' => 'Category',
|
| 50 |
+
'from_fieldname' => 'CountDiscussions',
|
| 51 |
+
'to_type' => 'forum',
|
| 52 |
+
'to_fieldname' => '_bbp_topic_count'
|
| 53 |
+
);
|
| 54 |
+
|
| 55 |
+
// Forum reply count (Stored in postmeta)
|
| 56 |
+
$this->field_map[] = array(
|
| 57 |
+
'from_tablename' => 'Category',
|
| 58 |
+
'from_fieldname' => 'CountComments',
|
| 59 |
+
'to_type' => 'forum',
|
| 60 |
+
'to_fieldname' => '_bbp_reply_count'
|
| 61 |
+
);
|
| 62 |
+
|
| 63 |
+
// Forum total topic count (Stored in postmeta)
|
| 64 |
+
$this->field_map[] = array(
|
| 65 |
+
'from_tablename' => 'Category',
|
| 66 |
+
'from_fieldname' => 'CountDiscussions',
|
| 67 |
+
'to_type' => 'forum',
|
| 68 |
+
'to_fieldname' => '_bbp_total_topic_count'
|
| 69 |
+
);
|
| 70 |
+
|
| 71 |
+
// Forum total reply count (Stored in postmeta)
|
| 72 |
+
$this->field_map[] = array(
|
| 73 |
+
'from_tablename' => 'Category',
|
| 74 |
+
'from_fieldname' => 'CountComments',
|
| 75 |
+
'to_type' => 'forum',
|
| 76 |
+
'to_fieldname' => '_bbp_total_reply_count'
|
| 77 |
+
);
|
| 78 |
+
|
| 79 |
+
// Forum title.
|
| 80 |
+
$this->field_map[] = array(
|
| 81 |
+
'from_tablename' => 'Category',
|
| 82 |
+
'from_fieldname' => 'Name',
|
| 83 |
+
'to_type' => 'forum',
|
| 84 |
+
'to_fieldname' => 'post_title'
|
| 85 |
+
);
|
| 86 |
+
|
| 87 |
+
// Forum slug (Clean name to avoid confilcts)
|
| 88 |
+
$this->field_map[] = array(
|
| 89 |
+
'from_tablename' => 'Category',
|
| 90 |
+
'from_fieldname' => 'Name',
|
| 91 |
+
'to_type' => 'forum',
|
| 92 |
+
'to_fieldname' => 'post_name',
|
| 93 |
+
'callback_method' => 'callback_slug'
|
| 94 |
+
);
|
| 95 |
+
|
| 96 |
+
// Forum description.
|
| 97 |
+
$this->field_map[] = array(
|
| 98 |
+
'from_tablename' => 'Category',
|
| 99 |
+
'from_fieldname' => 'Description',
|
| 100 |
+
'to_type' => 'forum',
|
| 101 |
+
'to_fieldname' => 'post_content',
|
| 102 |
+
'callback_method' => 'callback_null'
|
| 103 |
+
);
|
| 104 |
+
|
| 105 |
+
// Forum display order (Starts from 1)
|
| 106 |
+
$this->field_map[] = array(
|
| 107 |
+
'from_tablename' => 'Category',
|
| 108 |
+
'from_fieldname' => 'Sort',
|
| 109 |
+
'to_type' => 'forum',
|
| 110 |
+
'to_fieldname' => 'menu_order'
|
| 111 |
+
);
|
| 112 |
+
|
| 113 |
+
// Forum dates.
|
| 114 |
+
$this->field_map[] = array(
|
| 115 |
+
'from_tablename' => 'Category',
|
| 116 |
+
'from_fieldname' => 'DateInserted',
|
| 117 |
+
'to_type' => 'forum',
|
| 118 |
+
'to_fieldname' => 'post_date',
|
| 119 |
+
);
|
| 120 |
+
$this->field_map[] = array(
|
| 121 |
+
'from_tablename' => 'Category',
|
| 122 |
+
'from_fieldname' => 'DateInserted',
|
| 123 |
+
'to_type' => 'forum',
|
| 124 |
+
'to_fieldname' => 'post_date_gmt',
|
| 125 |
+
);
|
| 126 |
+
$this->field_map[] = array(
|
| 127 |
+
'from_tablename' => 'Category',
|
| 128 |
+
'from_fieldname' => 'DateUpdated',
|
| 129 |
+
'to_type' => 'forum',
|
| 130 |
+
'to_fieldname' => 'post_modified',
|
| 131 |
+
);
|
| 132 |
+
$this->field_map[] = array(
|
| 133 |
+
'from_tablename' => 'Category',
|
| 134 |
+
'from_fieldname' => 'DateUpdated',
|
| 135 |
+
'to_type' => 'forum',
|
| 136 |
+
'to_fieldname' => 'post_modified_gmt',
|
| 137 |
+
);
|
| 138 |
+
|
| 139 |
+
/** Topic Section *****************************************************/
|
| 140 |
+
|
| 141 |
+
// Topic id (Stored in postmeta)
|
| 142 |
+
$this->field_map[] = array(
|
| 143 |
+
'from_tablename' => 'Discussion',
|
| 144 |
+
'from_fieldname' => 'DiscussionID',
|
| 145 |
+
'to_type' => 'topic',
|
| 146 |
+
'to_fieldname' => '_bbp_topic_id'
|
| 147 |
+
);
|
| 148 |
+
|
| 149 |
+
// Topic reply count (Stored in postmeta)
|
| 150 |
+
$this->field_map[] = array(
|
| 151 |
+
'from_tablename' => 'Discussion',
|
| 152 |
+
'from_fieldname' => 'CountComments',
|
| 153 |
+
'to_type' => 'topic',
|
| 154 |
+
'to_fieldname' => '_bbp_reply_count',
|
| 155 |
+
'callback_method' => 'callback_topic_reply_count'
|
| 156 |
+
);
|
| 157 |
+
|
| 158 |
+
// Topic parent forum id (If no parent, then 0. Stored in postmeta)
|
| 159 |
+
$this->field_map[] = array(
|
| 160 |
+
'from_tablename' => 'Discussion',
|
| 161 |
+
'from_fieldname' => 'CategoryID',
|
| 162 |
+
'to_type' => 'topic',
|
| 163 |
+
'to_fieldname' => '_bbp_forum_id',
|
| 164 |
+
'callback_method' => 'callback_forumid'
|
| 165 |
+
);
|
| 166 |
+
|
| 167 |
+
// Topic author.
|
| 168 |
+
$this->field_map[] = array(
|
| 169 |
+
'from_tablename' => 'Discussion',
|
| 170 |
+
'from_fieldname' => 'InsertUserID',
|
| 171 |
+
'to_type' => 'topic',
|
| 172 |
+
'to_fieldname' => 'post_author',
|
| 173 |
+
'callback_method' => 'callback_userid'
|
| 174 |
+
);
|
| 175 |
+
|
| 176 |
+
// Topic title.
|
| 177 |
+
$this->field_map[] = array(
|
| 178 |
+
'from_tablename' => 'Discussion',
|
| 179 |
+
'from_fieldname' => 'Name',
|
| 180 |
+
'to_type' => 'topic',
|
| 181 |
+
'to_fieldname' => 'post_title'
|
| 182 |
+
);
|
| 183 |
+
|
| 184 |
+
// Topic slug (Clean name to avoid conflicts)
|
| 185 |
+
$this->field_map[] = array(
|
| 186 |
+
'from_tablename' => 'Discussion',
|
| 187 |
+
'from_fieldname' => 'Name',
|
| 188 |
+
'to_type' => 'topic',
|
| 189 |
+
'to_fieldname' => 'post_name',
|
| 190 |
+
'callback_method' => 'callback_slug'
|
| 191 |
+
);
|
| 192 |
+
|
| 193 |
+
// Topic content.
|
| 194 |
+
$this->field_map[] = array(
|
| 195 |
+
'from_tablename' => 'Discussion',
|
| 196 |
+
'from_fieldname' => 'Body',
|
| 197 |
+
'to_type' => 'topic',
|
| 198 |
+
'to_fieldname' => 'post_content',
|
| 199 |
+
'callback_method' => 'callback_html'
|
| 200 |
+
);
|
| 201 |
+
|
| 202 |
+
// Topic status (Open or Closed)
|
| 203 |
+
$this->field_map[] = array(
|
| 204 |
+
'from_tablename' => 'Discussion',
|
| 205 |
+
'from_fieldname' => 'closed',
|
| 206 |
+
'to_type' => 'topic',
|
| 207 |
+
'to_fieldname' => 'post_status',
|
| 208 |
+
'callback_method' => 'callback_topic_status'
|
| 209 |
+
);
|
| 210 |
+
|
| 211 |
+
// Topic author ip (Stored in postmeta)
|
| 212 |
+
$this->field_map[] = array(
|
| 213 |
+
'from_tablename' => 'Discussion',
|
| 214 |
+
'from_fieldname' => 'InsertIPAddress',
|
| 215 |
+
'to_type' => 'topic',
|
| 216 |
+
'to_fieldname' => '_bbp_author_ip'
|
| 217 |
+
);
|
| 218 |
+
|
| 219 |
+
// Topic parent forum id (If no parent, then 0)
|
| 220 |
+
$this->field_map[] = array(
|
| 221 |
+
'from_tablename' => 'Discussion',
|
| 222 |
+
'from_fieldname' => 'CategoryID',
|
| 223 |
+
'to_type' => 'topic',
|
| 224 |
+
'to_fieldname' => 'post_parent',
|
| 225 |
+
'callback_method' => 'callback_forumid'
|
| 226 |
+
);
|
| 227 |
+
|
| 228 |
+
// Topic dates.
|
| 229 |
+
$this->field_map[] = array(
|
| 230 |
+
'from_tablename' => 'Discussion',
|
| 231 |
+
'from_fieldname' => 'DateInserted',
|
| 232 |
+
'to_type' => 'topic',
|
| 233 |
+
'to_fieldname' => 'post_date'
|
| 234 |
+
);
|
| 235 |
+
$this->field_map[] = array(
|
| 236 |
+
'from_tablename' => 'Discussion',
|
| 237 |
+
'from_fieldname' => 'DateInserted',
|
| 238 |
+
'to_type' => 'topic',
|
| 239 |
+
'to_fieldname' => 'post_date_gmt'
|
| 240 |
+
);
|
| 241 |
+
$this->field_map[] = array(
|
| 242 |
+
'from_tablename' => 'Discussion',
|
| 243 |
+
'from_fieldname' => 'DateUpdated',
|
| 244 |
+
'to_type' => 'topic',
|
| 245 |
+
'to_fieldname' => 'post_modified'
|
| 246 |
+
);
|
| 247 |
+
$this->field_map[] = array(
|
| 248 |
+
'from_tablename' => 'Discussion',
|
| 249 |
+
'from_fieldname' => 'DateUpdated',
|
| 250 |
+
'to_type' => 'topic',
|
| 251 |
+
'to_fieldname' => 'post_modified_gmt'
|
| 252 |
+
);
|
| 253 |
+
$this->field_map[] = array(
|
| 254 |
+
'from_tablename' => 'Discussion',
|
| 255 |
+
'from_fieldname' => 'DateLastComment',
|
| 256 |
+
'to_type' => 'topic',
|
| 257 |
+
'to_fieldname' => '_bbp_last_active_time'
|
| 258 |
+
);
|
| 259 |
+
|
| 260 |
+
/** Tags Section ******************************************************/
|
| 261 |
+
|
| 262 |
+
// Topic id.
|
| 263 |
+
$this->field_map[] = array(
|
| 264 |
+
'from_tablename' => 'TagDiscussion',
|
| 265 |
+
'from_fieldname' => 'DiscussionID',
|
| 266 |
+
'to_type' => 'tags',
|
| 267 |
+
'to_fieldname' => 'objectid',
|
| 268 |
+
'callback_method' => 'callback_topicid'
|
| 269 |
+
);
|
| 270 |
+
|
| 271 |
+
// Taxonomy ID.
|
| 272 |
+
$this->field_map[] = array(
|
| 273 |
+
'from_tablename' => 'TagDiscussion',
|
| 274 |
+
'from_fieldname' => 'TagID',
|
| 275 |
+
'to_type' => 'tags',
|
| 276 |
+
'to_fieldname' => 'taxonomy'
|
| 277 |
+
);
|
| 278 |
+
|
| 279 |
+
// Term text.
|
| 280 |
+
$this->field_map[] = array(
|
| 281 |
+
'from_tablename' => 'Tag',
|
| 282 |
+
'from_fieldname' => 'Name',
|
| 283 |
+
'join_tablename' => 'TagDiscussion',
|
| 284 |
+
'join_type' => 'INNER',
|
| 285 |
+
'join_expression' => 'USING (tagid)',
|
| 286 |
+
'to_type' => 'tags',
|
| 287 |
+
'to_fieldname' => 'name'
|
| 288 |
+
);
|
| 289 |
+
|
| 290 |
+
/** Reply Section *****************************************************/
|
| 291 |
+
|
| 292 |
+
// Reply id (Stored in postmeta)
|
| 293 |
+
$this->field_map[] = array(
|
| 294 |
+
'from_tablename' => 'Comment',
|
| 295 |
+
'from_fieldname' => 'CommentID',
|
| 296 |
+
'to_type' => 'reply',
|
| 297 |
+
'to_fieldname' => '_bbp_post_id'
|
| 298 |
+
);
|
| 299 |
+
|
| 300 |
+
// Reply parent topic id (If no parent, then 0. Stored in postmeta)
|
| 301 |
+
$this->field_map[] = array(
|
| 302 |
+
'from_tablename' => 'Comment',
|
| 303 |
+
'from_fieldname' => 'DiscussionID',
|
| 304 |
+
'to_type' => 'reply',
|
| 305 |
+
'to_fieldname' => '_bbp_topic_id',
|
| 306 |
+
'callback_method' => 'callback_topicid'
|
| 307 |
+
);
|
| 308 |
+
|
| 309 |
+
// Reply parent forum id (If no parent, then 0. Stored in postmeta)
|
| 310 |
+
$this->field_map[] = array(
|
| 311 |
+
'from_tablename' => 'Discussion',
|
| 312 |
+
'from_fieldname' => 'CategoryID',
|
| 313 |
+
'join_tablename' => 'Comment',
|
| 314 |
+
'join_type' => 'INNER',
|
| 315 |
+
'join_expression' => 'USING (DiscussionID)',
|
| 316 |
+
'to_type' => 'reply',
|
| 317 |
+
'to_fieldname' => '_bbp_forum_id',
|
| 318 |
+
'callback_method' => 'callback_topicid_to_forumid'
|
| 319 |
+
);
|
| 320 |
+
|
| 321 |
+
// Reply title.
|
| 322 |
+
// Note: We join the Discussion table because Comment table does not include topic title.
|
| 323 |
+
$this->field_map[] = array(
|
| 324 |
+
'from_tablename' => 'Discussion',
|
| 325 |
+
'from_fieldname' => 'Name',
|
| 326 |
+
'join_tablename' => 'Comment',
|
| 327 |
+
'join_type' => 'INNER',
|
| 328 |
+
'join_expression' => 'USING (DiscussionID)',
|
| 329 |
+
'to_type' => 'reply',
|
| 330 |
+
'to_fieldname' => 'post_title',
|
| 331 |
+
'callback_method' => 'callback_reply_title'
|
| 332 |
+
);
|
| 333 |
+
|
| 334 |
+
// Reply author ip (Stored in postmeta)
|
| 335 |
+
$this->field_map[] = array(
|
| 336 |
+
'from_tablename' => 'Comment',
|
| 337 |
+
'from_fieldname' => 'InsertIPAddress',
|
| 338 |
+
'to_type' => 'reply',
|
| 339 |
+
'to_fieldname' => '_bbp_author_ip'
|
| 340 |
+
);
|
| 341 |
+
|
| 342 |
+
// Reply author.
|
| 343 |
+
$this->field_map[] = array(
|
| 344 |
+
'from_tablename' => 'Comment',
|
| 345 |
+
'from_fieldname' => 'InsertUserID',
|
| 346 |
+
'to_type' => 'reply',
|
| 347 |
+
'to_fieldname' => 'post_author',
|
| 348 |
+
'callback_method' => 'callback_userid'
|
| 349 |
+
);
|
| 350 |
+
|
| 351 |
+
// Reply content.
|
| 352 |
+
$this->field_map[] = array(
|
| 353 |
+
'from_tablename' => 'Comment',
|
| 354 |
+
'from_fieldname' => 'Body',
|
| 355 |
+
'to_type' => 'reply',
|
| 356 |
+
'to_fieldname' => 'post_content',
|
| 357 |
+
'callback_method' => 'callback_html'
|
| 358 |
+
);
|
| 359 |
+
|
| 360 |
+
// Reply parent topic id (If no parent, then 0)
|
| 361 |
+
$this->field_map[] = array(
|
| 362 |
+
'from_tablename' => 'Comment',
|
| 363 |
+
'from_fieldname' => 'DiscussionID',
|
| 364 |
+
'to_type' => 'reply',
|
| 365 |
+
'to_fieldname' => 'post_parent',
|
| 366 |
+
'callback_method' => 'callback_topicid'
|
| 367 |
+
);
|
| 368 |
+
|
| 369 |
+
// Reply dates.
|
| 370 |
+
$this->field_map[] = array(
|
| 371 |
+
'from_tablename' => 'Comment',
|
| 372 |
+
'from_fieldname' => 'DateInserted',
|
| 373 |
+
'to_type' => 'reply',
|
| 374 |
+
'to_fieldname' => 'post_date'
|
| 375 |
+
);
|
| 376 |
+
$this->field_map[] = array(
|
| 377 |
+
'from_tablename' => 'Comment',
|
| 378 |
+
'from_fieldname' => 'DateInserted',
|
| 379 |
+
'to_type' => 'reply',
|
| 380 |
+
'to_fieldname' => 'post_date_gmt'
|
| 381 |
+
);
|
| 382 |
+
$this->field_map[] = array(
|
| 383 |
+
'from_tablename' => 'Comment',
|
| 384 |
+
'from_fieldname' => 'DateUpdated',
|
| 385 |
+
'to_type' => 'reply',
|
| 386 |
+
'to_fieldname' => 'post_modified'
|
| 387 |
+
);
|
| 388 |
+
$this->field_map[] = array(
|
| 389 |
+
'from_tablename' => 'Comment',
|
| 390 |
+
'from_fieldname' => 'DateUpdated',
|
| 391 |
+
'to_type' => 'reply',
|
| 392 |
+
'to_fieldname' => 'post_modified_gmt'
|
| 393 |
+
);
|
| 394 |
+
|
| 395 |
+
/** User Section ******************************************************/
|
| 396 |
+
|
| 397 |
+
// Store old User id (Stored in usermeta)
|
| 398 |
+
$this->field_map[] = array(
|
| 399 |
+
'from_tablename' => 'User',
|
| 400 |
+
'from_fieldname' => 'UserID',
|
| 401 |
+
'to_type' => 'user',
|
| 402 |
+
'to_fieldname' => '_bbp_user_id'
|
| 403 |
+
);
|
| 404 |
+
|
| 405 |
+
// Store old User password (Stored in usermeta)
|
| 406 |
+
$this->field_map[] = array(
|
| 407 |
+
'from_tablename' => 'User',
|
| 408 |
+
'from_fieldname' => 'Password',
|
| 409 |
+
'to_type' => 'user',
|
| 410 |
+
'to_fieldname' => '_bbp_password'
|
| 411 |
+
);
|
| 412 |
+
|
| 413 |
+
// User name.
|
| 414 |
+
$this->field_map[] = array(
|
| 415 |
+
'from_tablename' => 'User',
|
| 416 |
+
'from_fieldname' => 'Name',
|
| 417 |
+
'to_type' => 'user',
|
| 418 |
+
'to_fieldname' => 'user_login'
|
| 419 |
+
);
|
| 420 |
+
|
| 421 |
+
// User nice name.
|
| 422 |
+
$this->field_map[] = array(
|
| 423 |
+
'from_tablename' => 'User',
|
| 424 |
+
'from_fieldname' => 'Name',
|
| 425 |
+
'to_type' => 'user',
|
| 426 |
+
'to_fieldname' => 'user_nicename'
|
| 427 |
+
);
|
| 428 |
+
|
| 429 |
+
// User email.
|
| 430 |
+
$this->field_map[] = array(
|
| 431 |
+
'from_tablename' => 'User',
|
| 432 |
+
'from_fieldname' => 'Email',
|
| 433 |
+
'to_type' => 'user',
|
| 434 |
+
'to_fieldname' => 'user_email'
|
| 435 |
+
);
|
| 436 |
+
|
| 437 |
+
// User registered.
|
| 438 |
+
$this->field_map[] = array(
|
| 439 |
+
'from_tablename' => 'User',
|
| 440 |
+
'from_fieldname' => 'DateInserted',
|
| 441 |
+
'to_type' => 'user',
|
| 442 |
+
'to_fieldname' => 'user_registered'
|
| 443 |
+
);
|
| 444 |
+
|
| 445 |
+
// Display Name
|
| 446 |
+
$this->field_map[] = array(
|
| 447 |
+
'from_tablename' => 'User',
|
| 448 |
+
'from_fieldname' => 'Name',
|
| 449 |
+
'to_type' => 'user',
|
| 450 |
+
'to_fieldname' => 'display_name'
|
| 451 |
+
);
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
/**
|
| 455 |
+
* This method allows us to indicates what is or is not converted for each
|
| 456 |
+
* converter.
|
| 457 |
+
*/
|
| 458 |
+
public function info() {
|
| 459 |
+
return '';
|
| 460 |
+
}
|
| 461 |
+
|
| 462 |
+
/**
|
| 463 |
+
* Translate the topic status from Vanilla v2.x numeric's to WordPress's strings.
|
| 464 |
+
*
|
| 465 |
+
* @param int $status Vanilla v2.x numeric topic status
|
| 466 |
+
* @return string WordPress safe
|
| 467 |
+
*/
|
| 468 |
+
public function callback_topic_status( $status = 0 ) {
|
| 469 |
+
switch ( $status ) {
|
| 470 |
+
case 1 :
|
| 471 |
+
$status = 'closed';
|
| 472 |
+
break;
|
| 473 |
+
|
| 474 |
+
case 0 :
|
| 475 |
+
default :
|
| 476 |
+
$status = 'publish';
|
| 477 |
+
break;
|
| 478 |
+
}
|
| 479 |
+
return $status;
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
/**
|
| 483 |
+
* Clean Root Parent ID -1 to 0
|
| 484 |
+
*
|
| 485 |
+
* @param int $parent Vanilla v2.x Parent ID
|
| 486 |
+
* @return int
|
| 487 |
+
*/
|
| 488 |
+
public function callback_forum_parent( $parent = 0 ) {
|
| 489 |
+
if ( $parent == -1 ) {
|
| 490 |
+
return 0;
|
| 491 |
+
} else {
|
| 492 |
+
return $parent;
|
| 493 |
+
}
|
| 494 |
+
}
|
| 495 |
+
|
| 496 |
+
/**
|
| 497 |
+
* Verify the topic reply count.
|
| 498 |
+
*
|
| 499 |
+
* @param int $count Vanilla v2.x reply count
|
| 500 |
+
* @return string WordPress safe
|
| 501 |
+
*/
|
| 502 |
+
public function callback_topic_reply_count( $count = 1 ) {
|
| 503 |
+
$count = absint( (int) $count - 1 );
|
| 504 |
+
return $count;
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
/**
|
| 508 |
+
* Set the reply title
|
| 509 |
+
*
|
| 510 |
+
* @param string $title Vanilla v2.x topic title of this reply
|
| 511 |
+
* @return string Prefixed topic title, or empty string
|
| 512 |
+
*/
|
| 513 |
+
public function callback_reply_title( $title = '' ) {
|
| 514 |
+
$title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
|
| 515 |
+
return $title;
|
| 516 |
+
}
|
| 517 |
+
|
| 518 |
+
/**
|
| 519 |
+
* This method is to save the salt and password together. That
|
| 520 |
+
* way when we authenticate it we can get it out of the database
|
| 521 |
+
* as one value. Array values are auto sanitized by wordpress.
|
| 522 |
+
*/
|
| 523 |
+
public function callback_savepass( $field, $row ) {
|
| 524 |
+
return false;
|
| 525 |
+
}
|
| 526 |
+
|
| 527 |
+
/**
|
| 528 |
+
* This method is to take the pass out of the database and compare
|
| 529 |
+
* to a pass the user has typed in.
|
| 530 |
+
*/
|
| 531 |
+
public function authenticate_pass( $password, $serialized_pass ) {
|
| 532 |
+
return false;
|
| 533 |
+
}
|
| 534 |
+
|
| 535 |
+
/**
|
| 536 |
+
* This callback processes any custom BBCodes with parser.php
|
| 537 |
+
*/
|
| 538 |
+
protected function callback_html( $field ) {
|
| 539 |
+
require_once( bbpress()->admin->admin_dir . 'parser.php' );
|
| 540 |
+
$bbcode = BBCode::getInstance();
|
| 541 |
+
$bbcode->enable_smileys = false;
|
| 542 |
+
$bbcode->smiley_regex = false;
|
| 543 |
+
return html_entity_decode( $bbcode->Parse( $field ) );
|
| 544 |
+
}
|
| 545 |
+
}
|
includes/admin/converters/bbPress1.php
CHANGED
|
@@ -195,8 +195,7 @@ class bbPress1 extends BBP_Converter_Base {
|
|
| 195 |
'callback_method' => 'callback_html'
|
| 196 |
);
|
| 197 |
|
| 198 |
-
//
|
| 199 |
-
// Note: post_status is more accurate than topic_status
|
| 200 |
$this->field_map[] = array(
|
| 201 |
'from_tablename' => 'posts',
|
| 202 |
'from_fieldname' => 'post_status',
|
|
@@ -477,7 +476,7 @@ class bbPress1 extends BBP_Converter_Base {
|
|
| 477 |
'to_fieldname' => 'user_status'
|
| 478 |
);
|
| 479 |
|
| 480 |
-
// User
|
| 481 |
$this->field_map[] = array(
|
| 482 |
'from_tablename' => 'users',
|
| 483 |
'from_fieldname' => 'display_name',
|
|
@@ -557,4 +556,19 @@ class bbPress1 extends BBP_Converter_Base {
|
|
| 557 |
public function authenticate_pass( $password, $serialized_pass ) {
|
| 558 |
return false;
|
| 559 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 560 |
}
|
| 195 |
'callback_method' => 'callback_html'
|
| 196 |
);
|
| 197 |
|
| 198 |
+
// Post status (Spam, Trash or Publish)
|
|
|
|
| 199 |
$this->field_map[] = array(
|
| 200 |
'from_tablename' => 'posts',
|
| 201 |
'from_fieldname' => 'post_status',
|
| 476 |
'to_fieldname' => 'user_status'
|
| 477 |
);
|
| 478 |
|
| 479 |
+
// User display name.
|
| 480 |
$this->field_map[] = array(
|
| 481 |
'from_tablename' => 'users',
|
| 482 |
'from_fieldname' => 'display_name',
|
| 556 |
public function authenticate_pass( $password, $serialized_pass ) {
|
| 557 |
return false;
|
| 558 |
}
|
| 559 |
+
|
| 560 |
+
/**
|
| 561 |
+
* This callback:
|
| 562 |
+
*
|
| 563 |
+
* - turns off smiley parsing
|
| 564 |
+
* - processes any custom parser.php attributes
|
| 565 |
+
* - decodes necessary HTML entities
|
| 566 |
+
*/
|
| 567 |
+
protected function callback_html( $field ) {
|
| 568 |
+
require_once( bbpress()->admin->admin_dir . 'parser.php' );
|
| 569 |
+
$bbcode = BBCode::getInstance();
|
| 570 |
+
$bbcode->enable_smileys = false;
|
| 571 |
+
$bbcode->smiley_regex = false;
|
| 572 |
+
return html_entity_decode( $bbcode->Parse( $field ) );
|
| 573 |
+
}
|
| 574 |
}
|
includes/admin/converters/phpBB.php
CHANGED
|
@@ -1,34 +1,78 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
-
* Implementation of phpBB
|
|
|
|
|
|
|
|
|
|
| 5 |
*/
|
| 6 |
class phpBB extends BBP_Converter_Base {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
function __construct() {
|
| 8 |
parent::__construct();
|
| 9 |
$this->setup_globals();
|
| 10 |
}
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
public function setup_globals() {
|
| 13 |
|
| 14 |
/** Forum Section ******************************************************/
|
| 15 |
|
| 16 |
-
// Forum id
|
| 17 |
$this->field_map[] = array(
|
| 18 |
'from_tablename' => 'forums',
|
| 19 |
'from_fieldname' => 'forum_id',
|
| 20 |
'to_type' => 'forum',
|
| 21 |
'to_fieldname' => '_bbp_forum_id'
|
| 22 |
);
|
| 23 |
-
|
| 24 |
-
// Forum parent id
|
| 25 |
$this->field_map[] = array(
|
| 26 |
'from_tablename' => 'forums',
|
| 27 |
'from_fieldname' => 'parent_id',
|
| 28 |
'to_type' => 'forum',
|
| 29 |
-
'to_fieldname' => '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
);
|
| 31 |
-
|
| 32 |
// Forum title.
|
| 33 |
$this->field_map[] = array(
|
| 34 |
'from_tablename' => 'forums',
|
|
@@ -36,8 +80,8 @@ class phpBB extends BBP_Converter_Base {
|
|
| 36 |
'to_type' => 'forum',
|
| 37 |
'to_fieldname' => 'post_title'
|
| 38 |
);
|
| 39 |
-
|
| 40 |
-
// Forum slug
|
| 41 |
$this->field_map[] = array(
|
| 42 |
'from_tablename' => 'forums',
|
| 43 |
'from_fieldname' => 'forum_name',
|
|
@@ -45,7 +89,7 @@ class phpBB extends BBP_Converter_Base {
|
|
| 45 |
'to_fieldname' => 'post_name',
|
| 46 |
'callback_method' => 'callback_slug'
|
| 47 |
);
|
| 48 |
-
|
| 49 |
// Forum description.
|
| 50 |
$this->field_map[] = array(
|
| 51 |
'from_tablename' => 'forums',
|
|
@@ -54,48 +98,75 @@ class phpBB extends BBP_Converter_Base {
|
|
| 54 |
'to_fieldname' => 'post_content',
|
| 55 |
'callback_method' => 'callback_null'
|
| 56 |
);
|
| 57 |
-
|
| 58 |
-
// Forum display order
|
| 59 |
$this->field_map[] = array(
|
| 60 |
'from_tablename' => 'forums',
|
| 61 |
-
'from_fieldname' => '
|
| 62 |
'to_type' => 'forum',
|
| 63 |
'to_fieldname' => 'menu_order'
|
| 64 |
);
|
| 65 |
-
|
| 66 |
-
// Forum
|
| 67 |
$this->field_map[] = array(
|
| 68 |
-
'
|
| 69 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
'default' => date('Y-m-d H:i:s')
|
| 71 |
);
|
| 72 |
$this->field_map[] = array(
|
| 73 |
-
'to_type' => '
|
| 74 |
-
'to_fieldname' => '
|
| 75 |
'default' => date('Y-m-d H:i:s')
|
| 76 |
);
|
| 77 |
$this->field_map[] = array(
|
| 78 |
-
'to_type' => '
|
| 79 |
-
'to_fieldname' => '
|
| 80 |
'default' => date('Y-m-d H:i:s')
|
| 81 |
);
|
| 82 |
$this->field_map[] = array(
|
| 83 |
-
'to_type' => '
|
| 84 |
-
'to_fieldname' => '
|
| 85 |
'default' => date('Y-m-d H:i:s')
|
| 86 |
);
|
| 87 |
|
| 88 |
/** Topic Section ******************************************************/
|
| 89 |
|
| 90 |
-
// Topic id
|
| 91 |
$this->field_map[] = array(
|
| 92 |
'from_tablename' => 'topics',
|
| 93 |
'from_fieldname' => 'topic_id',
|
| 94 |
'to_type' => 'topic',
|
| 95 |
'to_fieldname' => '_bbp_topic_id'
|
| 96 |
);
|
| 97 |
-
|
| 98 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
$this->field_map[] = array(
|
| 100 |
'from_tablename' => 'topics',
|
| 101 |
'from_fieldname' => 'forum_id',
|
|
@@ -103,7 +174,7 @@ class phpBB extends BBP_Converter_Base {
|
|
| 103 |
'to_fieldname' => '_bbp_forum_id',
|
| 104 |
'callback_method' => 'callback_forumid'
|
| 105 |
);
|
| 106 |
-
|
| 107 |
// Topic author.
|
| 108 |
$this->field_map[] = array(
|
| 109 |
'from_tablename' => 'topics',
|
|
@@ -114,6 +185,7 @@ class phpBB extends BBP_Converter_Base {
|
|
| 114 |
);
|
| 115 |
|
| 116 |
// Topic content.
|
|
|
|
| 117 |
$this->field_map[] = array(
|
| 118 |
'from_tablename' => 'posts',
|
| 119 |
'from_fieldname' => 'post_text',
|
|
@@ -123,7 +195,7 @@ class phpBB extends BBP_Converter_Base {
|
|
| 123 |
'to_type' => 'topic',
|
| 124 |
'to_fieldname' => 'post_content',
|
| 125 |
'callback_method' => 'callback_html'
|
| 126 |
-
);
|
| 127 |
|
| 128 |
// Topic title.
|
| 129 |
$this->field_map[] = array(
|
|
@@ -132,8 +204,8 @@ class phpBB extends BBP_Converter_Base {
|
|
| 132 |
'to_type' => 'topic',
|
| 133 |
'to_fieldname' => 'post_title'
|
| 134 |
);
|
| 135 |
-
|
| 136 |
-
// Topic slug
|
| 137 |
$this->field_map[] = array(
|
| 138 |
'from_tablename' => 'topics',
|
| 139 |
'from_fieldname' => 'topic_title',
|
|
@@ -141,8 +213,8 @@ class phpBB extends BBP_Converter_Base {
|
|
| 141 |
'to_fieldname' => 'post_name',
|
| 142 |
'callback_method' => 'callback_slug'
|
| 143 |
);
|
| 144 |
-
|
| 145 |
-
//
|
| 146 |
$this->field_map[] = array(
|
| 147 |
'from_tablename' => 'topics',
|
| 148 |
'from_fieldname' => 'forum_id',
|
|
@@ -151,7 +223,7 @@ class phpBB extends BBP_Converter_Base {
|
|
| 151 |
'callback_method' => 'callback_forumid'
|
| 152 |
);
|
| 153 |
|
| 154 |
-
// Topic
|
| 155 |
$this->field_map[] = array(
|
| 156 |
'from_tablename' => 'topics',
|
| 157 |
'from_fieldname' => 'topic_time',
|
|
@@ -180,41 +252,53 @@ class phpBB extends BBP_Converter_Base {
|
|
| 180 |
'to_fieldname' => 'post_modified_gmt',
|
| 181 |
'callback_method' => 'callback_datetime'
|
| 182 |
);
|
| 183 |
-
|
| 184 |
-
/** Tags Section ******************************************************/
|
| 185 |
-
/*
|
| 186 |
-
// Topic id.
|
| 187 |
$this->field_map[] = array(
|
| 188 |
-
'from_tablename'
|
| 189 |
-
'from_fieldname'
|
| 190 |
-
'to_type'
|
| 191 |
-
'to_fieldname'
|
| 192 |
-
'callback_method' => '
|
| 193 |
);
|
| 194 |
-
|
| 195 |
-
//
|
| 196 |
$this->field_map[] = array(
|
| 197 |
-
'from_tablename' => '
|
| 198 |
-
'from_fieldname' => '
|
| 199 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
'join_type' => 'INNER',
|
| 201 |
-
'join_expression' => 'USING (
|
| 202 |
-
'to_type' => '
|
| 203 |
-
'to_fieldname' => '
|
| 204 |
-
);
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
/** Post Section ******************************************************/
|
| 208 |
|
| 209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
$this->field_map[] = array(
|
| 211 |
'from_tablename' => 'posts',
|
| 212 |
'from_fieldname' => 'post_id',
|
| 213 |
'to_type' => 'reply',
|
| 214 |
'to_fieldname' => '_bbp_post_id'
|
| 215 |
);
|
| 216 |
-
|
| 217 |
-
//
|
| 218 |
$this->field_map[] = array(
|
| 219 |
'from_tablename' => 'topics',
|
| 220 |
'from_fieldname' => 'topic_id',
|
|
@@ -222,9 +306,9 @@ class phpBB extends BBP_Converter_Base {
|
|
| 222 |
'join_type' => 'LEFT',
|
| 223 |
'join_expression' => 'USING (topic_id) WHERE posts.post_id != topics.topic_first_post_id',
|
| 224 |
'to_type' => 'reply'
|
| 225 |
-
);
|
| 226 |
-
|
| 227 |
-
//
|
| 228 |
$this->field_map[] = array(
|
| 229 |
'from_tablename' => 'posts',
|
| 230 |
'from_fieldname' => 'forum_id',
|
|
@@ -232,8 +316,8 @@ class phpBB extends BBP_Converter_Base {
|
|
| 232 |
'to_fieldname' => '_bbp_forum_id',
|
| 233 |
'callback_method' => 'callback_topicid_to_forumid'
|
| 234 |
);
|
| 235 |
-
|
| 236 |
-
//
|
| 237 |
$this->field_map[] = array(
|
| 238 |
'from_tablename' => 'posts',
|
| 239 |
'from_fieldname' => 'topic_id',
|
|
@@ -241,16 +325,16 @@ class phpBB extends BBP_Converter_Base {
|
|
| 241 |
'to_fieldname' => '_bbp_topic_id',
|
| 242 |
'callback_method' => 'callback_topicid'
|
| 243 |
);
|
| 244 |
-
|
| 245 |
-
//
|
| 246 |
$this->field_map[] = array(
|
| 247 |
'from_tablename' => 'posts',
|
| 248 |
'from_fieldname' => 'poster_ip',
|
| 249 |
'to_type' => 'reply',
|
| 250 |
'to_fieldname' => '_bbp_author_ip'
|
| 251 |
-
);
|
| 252 |
-
|
| 253 |
-
//
|
| 254 |
$this->field_map[] = array(
|
| 255 |
'from_tablename' => 'posts',
|
| 256 |
'from_fieldname' => 'poster_id',
|
|
@@ -258,16 +342,16 @@ class phpBB extends BBP_Converter_Base {
|
|
| 258 |
'to_fieldname' => 'post_author',
|
| 259 |
'callback_method' => 'callback_userid'
|
| 260 |
);
|
| 261 |
-
|
| 262 |
-
//
|
| 263 |
$this->field_map[] = array(
|
| 264 |
'from_tablename' => 'posts',
|
| 265 |
'from_fieldname' => 'post_subject',
|
| 266 |
'to_type' => 'reply',
|
| 267 |
'to_fieldname' => 'post_title'
|
| 268 |
);
|
| 269 |
-
|
| 270 |
-
//
|
| 271 |
$this->field_map[] = array(
|
| 272 |
'from_tablename' => 'posts',
|
| 273 |
'from_fieldname' => 'post_subject',
|
|
@@ -275,8 +359,8 @@ class phpBB extends BBP_Converter_Base {
|
|
| 275 |
'to_fieldname' => 'post_name',
|
| 276 |
'callback_method' => 'callback_slug'
|
| 277 |
);
|
| 278 |
-
|
| 279 |
-
//
|
| 280 |
$this->field_map[] = array(
|
| 281 |
'from_tablename' => 'posts',
|
| 282 |
'from_fieldname' => 'post_text',
|
|
@@ -284,8 +368,8 @@ class phpBB extends BBP_Converter_Base {
|
|
| 284 |
'to_fieldname' => 'post_content',
|
| 285 |
'callback_method' => 'callback_html'
|
| 286 |
);
|
| 287 |
-
|
| 288 |
-
//
|
| 289 |
$this->field_map[] = array(
|
| 290 |
'from_tablename' => 'posts',
|
| 291 |
'from_fieldname' => 'topic_id',
|
|
@@ -294,7 +378,7 @@ class phpBB extends BBP_Converter_Base {
|
|
| 294 |
'callback_method' => 'callback_topicid'
|
| 295 |
);
|
| 296 |
|
| 297 |
-
//
|
| 298 |
$this->field_map[] = array(
|
| 299 |
'from_tablename' => 'posts',
|
| 300 |
'from_fieldname' => 'post_time',
|
|
@@ -326,15 +410,15 @@ class phpBB extends BBP_Converter_Base {
|
|
| 326 |
|
| 327 |
/** User Section ******************************************************/
|
| 328 |
|
| 329 |
-
// Store old User id
|
| 330 |
$this->field_map[] = array(
|
| 331 |
'from_tablename' => 'users',
|
| 332 |
'from_fieldname' => 'user_id',
|
| 333 |
'to_type' => 'user',
|
| 334 |
'to_fieldname' => '_bbp_user_id'
|
| 335 |
);
|
| 336 |
-
|
| 337 |
-
// Store old User password
|
| 338 |
$this->field_map[] = array(
|
| 339 |
'from_tablename' => 'users',
|
| 340 |
'from_fieldname' => 'user_password',
|
|
@@ -343,21 +427,21 @@ class phpBB extends BBP_Converter_Base {
|
|
| 343 |
'callback_method' => 'callback_savepass'
|
| 344 |
);
|
| 345 |
|
| 346 |
-
// Store old User Salt
|
| 347 |
$this->field_map[] = array(
|
| 348 |
'from_tablename' => 'users',
|
| 349 |
'from_fieldname' => 'user_form_salt',
|
| 350 |
'to_type' => 'user',
|
| 351 |
'to_fieldname' => ''
|
| 352 |
);
|
| 353 |
-
|
| 354 |
-
// User password verify class
|
| 355 |
$this->field_map[] = array(
|
| 356 |
'to_type' => 'user',
|
| 357 |
'to_fieldname' => '_bbp_class',
|
| 358 |
'default' => 'phpBB'
|
| 359 |
);
|
| 360 |
-
|
| 361 |
// User name.
|
| 362 |
$this->field_map[] = array(
|
| 363 |
'from_tablename' => 'users',
|
|
@@ -365,7 +449,7 @@ class phpBB extends BBP_Converter_Base {
|
|
| 365 |
'to_type' => 'user',
|
| 366 |
'to_fieldname' => 'user_login'
|
| 367 |
);
|
| 368 |
-
|
| 369 |
// User email.
|
| 370 |
$this->field_map[] = array(
|
| 371 |
'from_tablename' => 'users',
|
|
@@ -373,7 +457,7 @@ class phpBB extends BBP_Converter_Base {
|
|
| 373 |
'to_type' => 'user',
|
| 374 |
'to_fieldname' => 'user_email'
|
| 375 |
);
|
| 376 |
-
|
| 377 |
// User homepage.
|
| 378 |
$this->field_map[] = array(
|
| 379 |
'from_tablename' => 'users',
|
|
@@ -381,7 +465,7 @@ class phpBB extends BBP_Converter_Base {
|
|
| 381 |
'to_type' => 'user',
|
| 382 |
'to_fieldname' => 'user_url'
|
| 383 |
);
|
| 384 |
-
|
| 385 |
// User registered.
|
| 386 |
$this->field_map[] = array(
|
| 387 |
'from_tablename' => 'users',
|
|
@@ -390,22 +474,89 @@ class phpBB extends BBP_Converter_Base {
|
|
| 390 |
'to_fieldname' => 'user_registered',
|
| 391 |
'callback_method' => 'callback_datetime'
|
| 392 |
);
|
| 393 |
-
|
| 394 |
-
// User
|
| 395 |
$this->field_map[] = array(
|
| 396 |
'from_tablename' => 'users',
|
| 397 |
'from_fieldname' => 'user_aim',
|
| 398 |
'to_type' => 'user',
|
| 399 |
'to_fieldname' => 'aim'
|
| 400 |
);
|
| 401 |
-
|
| 402 |
-
// User
|
| 403 |
$this->field_map[] = array(
|
| 404 |
'from_tablename' => 'users',
|
| 405 |
'from_fieldname' => 'user_yim',
|
| 406 |
'to_type' => 'user',
|
| 407 |
'to_fieldname' => 'yim'
|
| 408 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 409 |
}
|
| 410 |
|
| 411 |
/**
|
|
@@ -422,52 +573,57 @@ class phpBB extends BBP_Converter_Base {
|
|
| 422 |
* as one value.
|
| 423 |
*/
|
| 424 |
public function callback_savepass( $field, $row ) {
|
| 425 |
-
|
| 426 |
-
|
|
|
|
|
|
|
| 427 |
}
|
| 428 |
-
|
| 429 |
/**
|
| 430 |
* Check for correct password
|
| 431 |
*
|
| 432 |
* @param string $password The password in plain text
|
| 433 |
* @param string $hash The stored password hash
|
| 434 |
*
|
|
|
|
|
|
|
|
|
|
| 435 |
* @return bool Returns true if the password is correct, false if not.
|
| 436 |
*/
|
| 437 |
-
public function authenticate_pass($password, $serialized_pass) {
|
| 438 |
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
| 439 |
-
$pass_array = unserialize($serialized_pass);
|
| 440 |
-
if (strlen($pass_array['hash']) == 34) {
|
| 441 |
-
return ($this->_hash_crypt_private($password, $pass_array['hash'], $itoa64) === $pass_array['hash']) ? true : false;
|
| 442 |
}
|
| 443 |
-
|
| 444 |
-
return (md5($password) === $pass_array['hash']) ? true : false;
|
| 445 |
}
|
| 446 |
-
|
| 447 |
/**
|
| 448 |
* The crypt function/replacement
|
| 449 |
*/
|
| 450 |
-
private function _hash_crypt_private($password, $setting, &$itoa64) {
|
| 451 |
$output = '*';
|
| 452 |
-
|
| 453 |
// Check for correct hash
|
| 454 |
-
if (substr($setting, 0, 3) != '$H$') {
|
| 455 |
return $output;
|
| 456 |
}
|
| 457 |
-
|
| 458 |
-
$count_log2 = strpos($itoa64, $setting[3]);
|
| 459 |
-
|
| 460 |
-
if ($count_log2 < 7 || $count_log2 > 30) {
|
| 461 |
return $output;
|
| 462 |
}
|
| 463 |
-
|
| 464 |
$count = 1 << $count_log2;
|
| 465 |
-
$salt
|
| 466 |
-
|
| 467 |
-
if (strlen($salt) != 8) {
|
| 468 |
return $output;
|
| 469 |
}
|
| 470 |
-
|
| 471 |
/**
|
| 472 |
* We're kind of forced to use MD5 here since it's the only
|
| 473 |
* cryptographic primitive available in all versions of PHP
|
|
@@ -476,63 +632,207 @@ class phpBB extends BBP_Converter_Base {
|
|
| 476 |
* consequently in lower iteration counts and hashes that are
|
| 477 |
* quicker to crack (by non-PHP code).
|
| 478 |
*/
|
| 479 |
-
if (floatval(phpversion()) >= 5) {
|
| 480 |
-
$hash = md5($salt . $password, true);
|
| 481 |
do
|
| 482 |
{
|
| 483 |
-
$hash = md5($hash . $password, true);
|
| 484 |
}
|
| 485 |
-
while (--$count);
|
| 486 |
} else {
|
| 487 |
-
$hash = pack('H*', md5($salt . $password));
|
| 488 |
do {
|
| 489 |
-
$hash = pack('H*', md5($hash . $password));
|
| 490 |
}
|
| 491 |
-
while (--$count);
|
| 492 |
}
|
| 493 |
|
| 494 |
$output = substr($setting, 0, 12);
|
| 495 |
$output .= $this->_hash_encode64($hash, 16, $itoa64);
|
| 496 |
-
|
| 497 |
return $output;
|
| 498 |
}
|
| 499 |
-
|
| 500 |
/**
|
| 501 |
* Encode hash
|
| 502 |
*/
|
| 503 |
-
private function _hash_encode64($input, $count, &$itoa64) {
|
| 504 |
$output = '';
|
| 505 |
$i = 0;
|
| 506 |
-
|
| 507 |
do {
|
| 508 |
-
$value = ord($input[$i++]);
|
| 509 |
$output .= $itoa64[$value & 0x3f];
|
| 510 |
-
|
| 511 |
if ($i < $count) {
|
| 512 |
-
$value |= ord($input[$i]) << 8;
|
| 513 |
}
|
| 514 |
-
|
| 515 |
-
$output .= $itoa64[($value >> 6) & 0x3f];
|
| 516 |
-
|
| 517 |
-
if ($i++ >= $count) {
|
| 518 |
break;
|
| 519 |
}
|
| 520 |
-
|
| 521 |
-
if ($i < $count) {
|
| 522 |
-
$value |= ord($input[$i]) << 16;
|
| 523 |
}
|
| 524 |
-
|
| 525 |
-
$output .= $itoa64[($value >> 12) & 0x3f];
|
| 526 |
-
|
| 527 |
-
if ($i++ >= $count) {
|
| 528 |
break;
|
| 529 |
}
|
| 530 |
-
|
| 531 |
$output .= $itoa64[($value >> 18) & 0x3f];
|
| 532 |
-
}
|
| 533 |
-
|
| 534 |
-
|
| 535 |
return $output;
|
| 536 |
}
|
| 537 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 538 |
}
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
+
* Implementation of phpBB v3 Converter.
|
| 5 |
+
*
|
| 6 |
+
* @since bbPress (r4689)
|
| 7 |
+
* @link Codex Docs http://codex.bbpress.org/import-forums/phpbb
|
| 8 |
*/
|
| 9 |
class phpBB extends BBP_Converter_Base {
|
| 10 |
+
|
| 11 |
+
/**
|
| 12 |
+
* Main Constructor
|
| 13 |
+
*
|
| 14 |
+
* @uses phpBB::setup_globals()
|
| 15 |
+
*/
|
| 16 |
function __construct() {
|
| 17 |
parent::__construct();
|
| 18 |
$this->setup_globals();
|
| 19 |
}
|
| 20 |
|
| 21 |
+
/**
|
| 22 |
+
* Sets up the field mappings
|
| 23 |
+
*/
|
| 24 |
public function setup_globals() {
|
| 25 |
|
| 26 |
/** Forum Section ******************************************************/
|
| 27 |
|
| 28 |
+
// Forum id (Stored in postmeta)
|
| 29 |
$this->field_map[] = array(
|
| 30 |
'from_tablename' => 'forums',
|
| 31 |
'from_fieldname' => 'forum_id',
|
| 32 |
'to_type' => 'forum',
|
| 33 |
'to_fieldname' => '_bbp_forum_id'
|
| 34 |
);
|
| 35 |
+
|
| 36 |
+
// Forum parent id (If no parent, then 0, Stored in postmeta)
|
| 37 |
$this->field_map[] = array(
|
| 38 |
'from_tablename' => 'forums',
|
| 39 |
'from_fieldname' => 'parent_id',
|
| 40 |
'to_type' => 'forum',
|
| 41 |
+
'to_fieldname' => '_bbp_forum_parent_id'
|
| 42 |
+
);
|
| 43 |
+
|
| 44 |
+
// Forum topic count (Stored in postmeta)
|
| 45 |
+
$this->field_map[] = array(
|
| 46 |
+
'from_tablename' => 'forums',
|
| 47 |
+
'from_fieldname' => 'forum_topics',
|
| 48 |
+
'to_type' => 'forum',
|
| 49 |
+
'to_fieldname' => '_bbp_topic_count'
|
| 50 |
+
);
|
| 51 |
+
|
| 52 |
+
// Forum reply count (Stored in postmeta)
|
| 53 |
+
$this->field_map[] = array(
|
| 54 |
+
'from_tablename' => 'forums',
|
| 55 |
+
'from_fieldname' => 'forum_posts',
|
| 56 |
+
'to_type' => 'forum',
|
| 57 |
+
'to_fieldname' => '_bbp_reply_count'
|
| 58 |
+
);
|
| 59 |
+
|
| 60 |
+
// Forum total topic count (Includes unpublished topics, Stored in postmeta)
|
| 61 |
+
$this->field_map[] = array(
|
| 62 |
+
'from_tablename' => 'forums',
|
| 63 |
+
'from_fieldname' => 'forum_topics_real',
|
| 64 |
+
'to_type' => 'forum',
|
| 65 |
+
'to_fieldname' => '_bbp_total_topic_count'
|
| 66 |
+
);
|
| 67 |
+
|
| 68 |
+
// Forum total reply count (Stored in postmeta)
|
| 69 |
+
$this->field_map[] = array(
|
| 70 |
+
'from_tablename' => 'forums',
|
| 71 |
+
'from_fieldname' => 'forum_posts',
|
| 72 |
+
'to_type' => 'forum',
|
| 73 |
+
'to_fieldname' => '_bbp_total_reply_count'
|
| 74 |
);
|
| 75 |
+
|
| 76 |
// Forum title.
|
| 77 |
$this->field_map[] = array(
|
| 78 |
'from_tablename' => 'forums',
|
| 80 |
'to_type' => 'forum',
|
| 81 |
'to_fieldname' => 'post_title'
|
| 82 |
);
|
| 83 |
+
|
| 84 |
+
// Forum slug (Clean name to avoid conflicts)
|
| 85 |
$this->field_map[] = array(
|
| 86 |
'from_tablename' => 'forums',
|
| 87 |
'from_fieldname' => 'forum_name',
|
| 89 |
'to_fieldname' => 'post_name',
|
| 90 |
'callback_method' => 'callback_slug'
|
| 91 |
);
|
| 92 |
+
|
| 93 |
// Forum description.
|
| 94 |
$this->field_map[] = array(
|
| 95 |
'from_tablename' => 'forums',
|
| 98 |
'to_fieldname' => 'post_content',
|
| 99 |
'callback_method' => 'callback_null'
|
| 100 |
);
|
| 101 |
+
|
| 102 |
+
// Forum display order (Starts from 1)
|
| 103 |
$this->field_map[] = array(
|
| 104 |
'from_tablename' => 'forums',
|
| 105 |
+
'from_fieldname' => 'left_id',
|
| 106 |
'to_type' => 'forum',
|
| 107 |
'to_fieldname' => 'menu_order'
|
| 108 |
);
|
| 109 |
+
|
| 110 |
+
// Forum status (Locked =1 Unlocked =0, Stored in postmeta)
|
| 111 |
$this->field_map[] = array(
|
| 112 |
+
'from_tablename' => 'forums',
|
| 113 |
+
'from_fieldname' => 'forum_status',
|
| 114 |
+
'to_type' => 'forum',
|
| 115 |
+
'to_fieldname' => '_bbp_status',
|
| 116 |
+
'callback_method' => 'callback_forum_status'
|
| 117 |
+
);
|
| 118 |
+
|
| 119 |
+
// Forum dates.
|
| 120 |
+
$this->field_map[] = array(
|
| 121 |
+
'to_type' => 'forum',
|
| 122 |
+
'to_fieldname' => 'post_date',
|
| 123 |
'default' => date('Y-m-d H:i:s')
|
| 124 |
);
|
| 125 |
$this->field_map[] = array(
|
| 126 |
+
'to_type' => 'forum',
|
| 127 |
+
'to_fieldname' => 'post_date_gmt',
|
| 128 |
'default' => date('Y-m-d H:i:s')
|
| 129 |
);
|
| 130 |
$this->field_map[] = array(
|
| 131 |
+
'to_type' => 'forum',
|
| 132 |
+
'to_fieldname' => 'post_modified',
|
| 133 |
'default' => date('Y-m-d H:i:s')
|
| 134 |
);
|
| 135 |
$this->field_map[] = array(
|
| 136 |
+
'to_type' => 'forum',
|
| 137 |
+
'to_fieldname' => 'post_modified_gmt',
|
| 138 |
'default' => date('Y-m-d H:i:s')
|
| 139 |
);
|
| 140 |
|
| 141 |
/** Topic Section ******************************************************/
|
| 142 |
|
| 143 |
+
// Topic id (Stored in postmeta)
|
| 144 |
$this->field_map[] = array(
|
| 145 |
'from_tablename' => 'topics',
|
| 146 |
'from_fieldname' => 'topic_id',
|
| 147 |
'to_type' => 'topic',
|
| 148 |
'to_fieldname' => '_bbp_topic_id'
|
| 149 |
);
|
| 150 |
+
|
| 151 |
+
// Topic reply count (Stored in postmeta)
|
| 152 |
+
$this->field_map[] = array(
|
| 153 |
+
'from_tablename' => 'topics',
|
| 154 |
+
'from_fieldname' => 'topic_replies',
|
| 155 |
+
'to_type' => 'topic',
|
| 156 |
+
'to_fieldname' => '_bbp_reply_count',
|
| 157 |
+
'callback_method' => 'callback_topic_reply_count'
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
// Topic total reply count (Includes unpublished replies, Stored in postmeta)
|
| 161 |
+
$this->field_map[] = array(
|
| 162 |
+
'from_tablename' => 'topics',
|
| 163 |
+
'from_fieldname' => 'topic_replies_real',
|
| 164 |
+
'to_type' => 'topic',
|
| 165 |
+
'to_fieldname' => '_bbp_total_reply_count',
|
| 166 |
+
'callback_method' => 'callback_topic_reply_count'
|
| 167 |
+
);
|
| 168 |
+
|
| 169 |
+
// Topic parent forum id (If no parent, then 0. Stored in postmeta)
|
| 170 |
$this->field_map[] = array(
|
| 171 |
'from_tablename' => 'topics',
|
| 172 |
'from_fieldname' => 'forum_id',
|
| 174 |
'to_fieldname' => '_bbp_forum_id',
|
| 175 |
'callback_method' => 'callback_forumid'
|
| 176 |
);
|
| 177 |
+
|
| 178 |
// Topic author.
|
| 179 |
$this->field_map[] = array(
|
| 180 |
'from_tablename' => 'topics',
|
| 185 |
);
|
| 186 |
|
| 187 |
// Topic content.
|
| 188 |
+
// Note: We join the posts table because topics do not have content.
|
| 189 |
$this->field_map[] = array(
|
| 190 |
'from_tablename' => 'posts',
|
| 191 |
'from_fieldname' => 'post_text',
|
| 195 |
'to_type' => 'topic',
|
| 196 |
'to_fieldname' => 'post_content',
|
| 197 |
'callback_method' => 'callback_html'
|
| 198 |
+
);
|
| 199 |
|
| 200 |
// Topic title.
|
| 201 |
$this->field_map[] = array(
|
| 204 |
'to_type' => 'topic',
|
| 205 |
'to_fieldname' => 'post_title'
|
| 206 |
);
|
| 207 |
+
|
| 208 |
+
// Topic slug (Clean name to avoid conflicts)
|
| 209 |
$this->field_map[] = array(
|
| 210 |
'from_tablename' => 'topics',
|
| 211 |
'from_fieldname' => 'topic_title',
|
| 213 |
'to_fieldname' => 'post_name',
|
| 214 |
'callback_method' => 'callback_slug'
|
| 215 |
);
|
| 216 |
+
|
| 217 |
+
// Topic parent forum id (If no parent, then 0)
|
| 218 |
$this->field_map[] = array(
|
| 219 |
'from_tablename' => 'topics',
|
| 220 |
'from_fieldname' => 'forum_id',
|
| 223 |
'callback_method' => 'callback_forumid'
|
| 224 |
);
|
| 225 |
|
| 226 |
+
// Topic dates.
|
| 227 |
$this->field_map[] = array(
|
| 228 |
'from_tablename' => 'topics',
|
| 229 |
'from_fieldname' => 'topic_time',
|
| 252 |
'to_fieldname' => 'post_modified_gmt',
|
| 253 |
'callback_method' => 'callback_datetime'
|
| 254 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
$this->field_map[] = array(
|
| 256 |
+
'from_tablename' => 'topics',
|
| 257 |
+
'from_fieldname' => 'topic_last_post_time',
|
| 258 |
+
'to_type' => 'topic',
|
| 259 |
+
'to_fieldname' => '_bbp_last_active_time',
|
| 260 |
+
'callback_method' => 'callback_datetime'
|
| 261 |
);
|
| 262 |
+
|
| 263 |
+
// Topic status (Open or Closed)
|
| 264 |
$this->field_map[] = array(
|
| 265 |
+
'from_tablename' => 'topics',
|
| 266 |
+
'from_fieldname' => 'topic_status',
|
| 267 |
+
'to_type' => 'topic',
|
| 268 |
+
'to_fieldname' => 'post_status',
|
| 269 |
+
'callback_method' => 'callback_topic_status'
|
| 270 |
+
);
|
| 271 |
+
|
| 272 |
+
// Topic Author ip (Stored in postmeta)
|
| 273 |
+
$this->field_map[] = array(
|
| 274 |
+
'from_tablename' => 'posts',
|
| 275 |
+
'from_fieldname' => 'poster_ip',
|
| 276 |
+
'join_tablename' => 'topics',
|
| 277 |
'join_type' => 'INNER',
|
| 278 |
+
'join_expression' => 'USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id',
|
| 279 |
+
'to_type' => 'topic',
|
| 280 |
+
'to_fieldname' => '_bbp_author_ip'
|
| 281 |
+
);
|
| 282 |
+
|
| 283 |
+
// Sticky Status
|
|
|
|
| 284 |
|
| 285 |
+
/** Tags Section ******************************************************/
|
| 286 |
+
|
| 287 |
+
/**
|
| 288 |
+
* phpBB Forums do not support topic tags
|
| 289 |
+
*/
|
| 290 |
+
|
| 291 |
+
/** Reply Section *****************************************************/
|
| 292 |
+
|
| 293 |
+
// Reply id (Stored in postmeta)
|
| 294 |
$this->field_map[] = array(
|
| 295 |
'from_tablename' => 'posts',
|
| 296 |
'from_fieldname' => 'post_id',
|
| 297 |
'to_type' => 'reply',
|
| 298 |
'to_fieldname' => '_bbp_post_id'
|
| 299 |
);
|
| 300 |
+
|
| 301 |
+
// Setup reply section table joins
|
| 302 |
$this->field_map[] = array(
|
| 303 |
'from_tablename' => 'topics',
|
| 304 |
'from_fieldname' => 'topic_id',
|
| 306 |
'join_type' => 'LEFT',
|
| 307 |
'join_expression' => 'USING (topic_id) WHERE posts.post_id != topics.topic_first_post_id',
|
| 308 |
'to_type' => 'reply'
|
| 309 |
+
);
|
| 310 |
+
|
| 311 |
+
// Reply parent forum id (If no parent, then 0. Stored in postmeta)
|
| 312 |
$this->field_map[] = array(
|
| 313 |
'from_tablename' => 'posts',
|
| 314 |
'from_fieldname' => 'forum_id',
|
| 316 |
'to_fieldname' => '_bbp_forum_id',
|
| 317 |
'callback_method' => 'callback_topicid_to_forumid'
|
| 318 |
);
|
| 319 |
+
|
| 320 |
+
// Reply parent topic id (If no parent, then 0. Stored in postmeta)
|
| 321 |
$this->field_map[] = array(
|
| 322 |
'from_tablename' => 'posts',
|
| 323 |
'from_fieldname' => 'topic_id',
|
| 325 |
'to_fieldname' => '_bbp_topic_id',
|
| 326 |
'callback_method' => 'callback_topicid'
|
| 327 |
);
|
| 328 |
+
|
| 329 |
+
// Reply author ip (Stored in postmeta)
|
| 330 |
$this->field_map[] = array(
|
| 331 |
'from_tablename' => 'posts',
|
| 332 |
'from_fieldname' => 'poster_ip',
|
| 333 |
'to_type' => 'reply',
|
| 334 |
'to_fieldname' => '_bbp_author_ip'
|
| 335 |
+
);
|
| 336 |
+
|
| 337 |
+
// Reply author.
|
| 338 |
$this->field_map[] = array(
|
| 339 |
'from_tablename' => 'posts',
|
| 340 |
'from_fieldname' => 'poster_id',
|
| 342 |
'to_fieldname' => 'post_author',
|
| 343 |
'callback_method' => 'callback_userid'
|
| 344 |
);
|
| 345 |
+
|
| 346 |
+
// Reply title.
|
| 347 |
$this->field_map[] = array(
|
| 348 |
'from_tablename' => 'posts',
|
| 349 |
'from_fieldname' => 'post_subject',
|
| 350 |
'to_type' => 'reply',
|
| 351 |
'to_fieldname' => 'post_title'
|
| 352 |
);
|
| 353 |
+
|
| 354 |
+
// Reply slug (Clean name to avoid conflicts)
|
| 355 |
$this->field_map[] = array(
|
| 356 |
'from_tablename' => 'posts',
|
| 357 |
'from_fieldname' => 'post_subject',
|
| 359 |
'to_fieldname' => 'post_name',
|
| 360 |
'callback_method' => 'callback_slug'
|
| 361 |
);
|
| 362 |
+
|
| 363 |
+
// Reply content.
|
| 364 |
$this->field_map[] = array(
|
| 365 |
'from_tablename' => 'posts',
|
| 366 |
'from_fieldname' => 'post_text',
|
| 368 |
'to_fieldname' => 'post_content',
|
| 369 |
'callback_method' => 'callback_html'
|
| 370 |
);
|
| 371 |
+
|
| 372 |
+
// Reply parent topic id (If no parent, then 0)
|
| 373 |
$this->field_map[] = array(
|
| 374 |
'from_tablename' => 'posts',
|
| 375 |
'from_fieldname' => 'topic_id',
|
| 378 |
'callback_method' => 'callback_topicid'
|
| 379 |
);
|
| 380 |
|
| 381 |
+
// Reply dates.
|
| 382 |
$this->field_map[] = array(
|
| 383 |
'from_tablename' => 'posts',
|
| 384 |
'from_fieldname' => 'post_time',
|
| 410 |
|
| 411 |
/** User Section ******************************************************/
|
| 412 |
|
| 413 |
+
// Store old User id (Stored in usermeta)
|
| 414 |
$this->field_map[] = array(
|
| 415 |
'from_tablename' => 'users',
|
| 416 |
'from_fieldname' => 'user_id',
|
| 417 |
'to_type' => 'user',
|
| 418 |
'to_fieldname' => '_bbp_user_id'
|
| 419 |
);
|
| 420 |
+
|
| 421 |
+
// Store old User password (Stored in usermeta serialized with salt)
|
| 422 |
$this->field_map[] = array(
|
| 423 |
'from_tablename' => 'users',
|
| 424 |
'from_fieldname' => 'user_password',
|
| 427 |
'callback_method' => 'callback_savepass'
|
| 428 |
);
|
| 429 |
|
| 430 |
+
// Store old User Salt (This is only used for the SELECT row info for the above password save)
|
| 431 |
$this->field_map[] = array(
|
| 432 |
'from_tablename' => 'users',
|
| 433 |
'from_fieldname' => 'user_form_salt',
|
| 434 |
'to_type' => 'user',
|
| 435 |
'to_fieldname' => ''
|
| 436 |
);
|
| 437 |
+
|
| 438 |
+
// User password verify class (Stored in usermeta for verifying password)
|
| 439 |
$this->field_map[] = array(
|
| 440 |
'to_type' => 'user',
|
| 441 |
'to_fieldname' => '_bbp_class',
|
| 442 |
'default' => 'phpBB'
|
| 443 |
);
|
| 444 |
+
|
| 445 |
// User name.
|
| 446 |
$this->field_map[] = array(
|
| 447 |
'from_tablename' => 'users',
|
| 449 |
'to_type' => 'user',
|
| 450 |
'to_fieldname' => 'user_login'
|
| 451 |
);
|
| 452 |
+
|
| 453 |
// User email.
|
| 454 |
$this->field_map[] = array(
|
| 455 |
'from_tablename' => 'users',
|
| 457 |
'to_type' => 'user',
|
| 458 |
'to_fieldname' => 'user_email'
|
| 459 |
);
|
| 460 |
+
|
| 461 |
// User homepage.
|
| 462 |
$this->field_map[] = array(
|
| 463 |
'from_tablename' => 'users',
|
| 465 |
'to_type' => 'user',
|
| 466 |
'to_fieldname' => 'user_url'
|
| 467 |
);
|
| 468 |
+
|
| 469 |
// User registered.
|
| 470 |
$this->field_map[] = array(
|
| 471 |
'from_tablename' => 'users',
|
| 474 |
'to_fieldname' => 'user_registered',
|
| 475 |
'callback_method' => 'callback_datetime'
|
| 476 |
);
|
| 477 |
+
|
| 478 |
+
// User AIM (Stored in usermeta)
|
| 479 |
$this->field_map[] = array(
|
| 480 |
'from_tablename' => 'users',
|
| 481 |
'from_fieldname' => 'user_aim',
|
| 482 |
'to_type' => 'user',
|
| 483 |
'to_fieldname' => 'aim'
|
| 484 |
);
|
| 485 |
+
|
| 486 |
+
// User Yahoo (Stored in usermeta)
|
| 487 |
$this->field_map[] = array(
|
| 488 |
'from_tablename' => 'users',
|
| 489 |
'from_fieldname' => 'user_yim',
|
| 490 |
'to_type' => 'user',
|
| 491 |
'to_fieldname' => 'yim'
|
| 492 |
+
);
|
| 493 |
+
|
| 494 |
+
// Store ICQ (Stored in usermeta)
|
| 495 |
+
$this->field_map[] = array(
|
| 496 |
+
'from_tablename' => 'users',
|
| 497 |
+
'from_fieldname' => 'user_icq',
|
| 498 |
+
'to_type' => 'user',
|
| 499 |
+
'to_fieldname' => '_bbp_phpbb_user_icq'
|
| 500 |
+
);
|
| 501 |
+
|
| 502 |
+
// Store MSN (Stored in usermeta)
|
| 503 |
+
$this->field_map[] = array(
|
| 504 |
+
'from_tablename' => 'users',
|
| 505 |
+
'from_fieldname' => 'user_msnm',
|
| 506 |
+
'to_type' => 'user',
|
| 507 |
+
'to_fieldname' => '_bbp_phpbb_user_msnm'
|
| 508 |
+
);
|
| 509 |
+
|
| 510 |
+
// Store Jabber
|
| 511 |
+
$this->field_map[] = array(
|
| 512 |
+
'from_tablename' => 'users',
|
| 513 |
+
'from_fieldname' => 'user_jabber',
|
| 514 |
+
'to_type' => 'user',
|
| 515 |
+
'to_fieldname' => 'jabber'
|
| 516 |
+
);
|
| 517 |
+
|
| 518 |
+
// Store Occupation (Stored in usermeta)
|
| 519 |
+
$this->field_map[] = array(
|
| 520 |
+
'from_tablename' => 'users',
|
| 521 |
+
'from_fieldname' => 'user_occ',
|
| 522 |
+
'to_type' => 'user',
|
| 523 |
+
'to_fieldname' => '_bbp_phpbb_user_occ'
|
| 524 |
+
);
|
| 525 |
+
|
| 526 |
+
// Store Interests (Stored in usermeta)
|
| 527 |
+
$this->field_map[] = array(
|
| 528 |
+
'from_tablename' => 'users',
|
| 529 |
+
'from_fieldname' => 'user_interests',
|
| 530 |
+
'to_type' => 'user',
|
| 531 |
+
'to_fieldname' => '_bbp_phpbb_user_interests'
|
| 532 |
+
);
|
| 533 |
+
|
| 534 |
+
// Store Signature (Stored in usermeta)
|
| 535 |
+
$this->field_map[] = array(
|
| 536 |
+
'from_tablename' => 'users',
|
| 537 |
+
'from_fieldname' => 'user_sig',
|
| 538 |
+
'to_type' => 'user',
|
| 539 |
+
'to_fieldname' => '_bbp_phpbb_user_sig',
|
| 540 |
+
'callback_method' => 'callback_html'
|
| 541 |
+
);
|
| 542 |
+
|
| 543 |
+
// Store Location (Stored in usermeta)
|
| 544 |
+
$this->field_map[] = array(
|
| 545 |
+
'from_tablename' => 'users',
|
| 546 |
+
'from_fieldname' => 'user_from',
|
| 547 |
+
'to_type' => 'user',
|
| 548 |
+
'to_fieldname' => '_bbp_phpbb_user_from'
|
| 549 |
+
);
|
| 550 |
+
|
| 551 |
+
// Store Avatar Filename (Stored in usermeta)
|
| 552 |
+
$this->field_map[] = array(
|
| 553 |
+
'from_tablename' => 'users',
|
| 554 |
+
'from_fieldname' => 'user_avatar',
|
| 555 |
+
'to_type' => 'user',
|
| 556 |
+
'to_fieldname' => '_bbp_phpbb_user_avatar'
|
| 557 |
+
);
|
| 558 |
+
|
| 559 |
+
// Store old role (Stored in usermeta)
|
| 560 |
}
|
| 561 |
|
| 562 |
/**
|
| 573 |
* as one value.
|
| 574 |
*/
|
| 575 |
public function callback_savepass( $field, $row ) {
|
| 576 |
+
return array(
|
| 577 |
+
'hash' => $field,
|
| 578 |
+
'salt' => $row['salt']
|
| 579 |
+
);
|
| 580 |
}
|
| 581 |
+
|
| 582 |
/**
|
| 583 |
* Check for correct password
|
| 584 |
*
|
| 585 |
* @param string $password The password in plain text
|
| 586 |
* @param string $hash The stored password hash
|
| 587 |
*
|
| 588 |
+
* @link Original source for password functions http://openwall.com/phpass/
|
| 589 |
+
* @link phpass is now included in WP Core http://core.trac.wordpress.org/browser/trunk/wp-includes/class-phpass.php
|
| 590 |
+
*
|
| 591 |
* @return bool Returns true if the password is correct, false if not.
|
| 592 |
*/
|
| 593 |
+
public function authenticate_pass( $password, $serialized_pass ) {
|
| 594 |
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
| 595 |
+
$pass_array = unserialize( $serialized_pass );
|
| 596 |
+
if ( strlen( $pass_array['hash'] ) == 34 ) {
|
| 597 |
+
return ( $this->_hash_crypt_private( $password, $pass_array['hash'], $itoa64 ) === $pass_array['hash'] ) ? true : false;
|
| 598 |
}
|
| 599 |
+
|
| 600 |
+
return ( md5( $password ) === $pass_array['hash'] ) ? true : false;
|
| 601 |
}
|
| 602 |
+
|
| 603 |
/**
|
| 604 |
* The crypt function/replacement
|
| 605 |
*/
|
| 606 |
+
private function _hash_crypt_private( $password, $setting, &$itoa64 ) {
|
| 607 |
$output = '*';
|
| 608 |
+
|
| 609 |
// Check for correct hash
|
| 610 |
+
if ( substr( $setting, 0, 3 ) != '$H$' ) {
|
| 611 |
return $output;
|
| 612 |
}
|
| 613 |
+
|
| 614 |
+
$count_log2 = strpos( $itoa64, $setting[3] );
|
| 615 |
+
|
| 616 |
+
if ( $count_log2 < 7 || $count_log2 > 30 ) {
|
| 617 |
return $output;
|
| 618 |
}
|
| 619 |
+
|
| 620 |
$count = 1 << $count_log2;
|
| 621 |
+
$salt = substr( $setting, 4, 8 );
|
| 622 |
+
|
| 623 |
+
if ( strlen( $salt ) != 8 ) {
|
| 624 |
return $output;
|
| 625 |
}
|
| 626 |
+
|
| 627 |
/**
|
| 628 |
* We're kind of forced to use MD5 here since it's the only
|
| 629 |
* cryptographic primitive available in all versions of PHP
|
| 632 |
* consequently in lower iteration counts and hashes that are
|
| 633 |
* quicker to crack (by non-PHP code).
|
| 634 |
*/
|
| 635 |
+
if ( floatval( phpversion() ) >= 5 ) {
|
| 636 |
+
$hash = md5( $salt . $password, true );
|
| 637 |
do
|
| 638 |
{
|
| 639 |
+
$hash = md5( $hash . $password, true );
|
| 640 |
}
|
| 641 |
+
while ( --$count );
|
| 642 |
} else {
|
| 643 |
+
$hash = pack( 'H*', md5( $salt . $password ) );
|
| 644 |
do {
|
| 645 |
+
$hash = pack( 'H*', md5( $hash . $password ) );
|
| 646 |
}
|
| 647 |
+
while ( --$count );
|
| 648 |
}
|
| 649 |
|
| 650 |
$output = substr($setting, 0, 12);
|
| 651 |
$output .= $this->_hash_encode64($hash, 16, $itoa64);
|
| 652 |
+
|
| 653 |
return $output;
|
| 654 |
}
|
| 655 |
+
|
| 656 |
/**
|
| 657 |
* Encode hash
|
| 658 |
*/
|
| 659 |
+
private function _hash_encode64( $input, $count, &$itoa64 ) {
|
| 660 |
$output = '';
|
| 661 |
$i = 0;
|
| 662 |
+
|
| 663 |
do {
|
| 664 |
+
$value = ord( $input[$i++] );
|
| 665 |
$output .= $itoa64[$value & 0x3f];
|
| 666 |
+
|
| 667 |
if ($i < $count) {
|
| 668 |
+
$value |= ord( $input[$i] ) << 8;
|
| 669 |
}
|
| 670 |
+
|
| 671 |
+
$output .= $itoa64[( $value >> 6 ) & 0x3f];
|
| 672 |
+
|
| 673 |
+
if ( $i++ >= $count ) {
|
| 674 |
break;
|
| 675 |
}
|
| 676 |
+
|
| 677 |
+
if ( $i < $count ) {
|
| 678 |
+
$value |= ord( $input[$i] ) << 16;
|
| 679 |
}
|
| 680 |
+
|
| 681 |
+
$output .= $itoa64[( $value >> 12 ) & 0x3f];
|
| 682 |
+
|
| 683 |
+
if ( $i++ >= $count ) {
|
| 684 |
break;
|
| 685 |
}
|
| 686 |
+
|
| 687 |
$output .= $itoa64[($value >> 18) & 0x3f];
|
| 688 |
+
} while ( $i < $count );
|
| 689 |
+
|
|
|
|
| 690 |
return $output;
|
| 691 |
}
|
| 692 |
|
| 693 |
+
/**
|
| 694 |
+
* Translate the forum status from phpBB v3.x numeric's to WordPress's strings.
|
| 695 |
+
*
|
| 696 |
+
* @param int $status phpBB v3.x numeric forum status
|
| 697 |
+
* @return string WordPress safe
|
| 698 |
+
*/
|
| 699 |
+
public function callback_forum_status( $status = 0 ) {
|
| 700 |
+
switch ( $status ) {
|
| 701 |
+
case 1 :
|
| 702 |
+
$status = 'closed';
|
| 703 |
+
break;
|
| 704 |
+
|
| 705 |
+
case 0 :
|
| 706 |
+
default :
|
| 707 |
+
$status = 'open';
|
| 708 |
+
break;
|
| 709 |
+
}
|
| 710 |
+
return $status;
|
| 711 |
+
}
|
| 712 |
+
|
| 713 |
+
/**
|
| 714 |
+
* Translate the topic status from phpBB v3.x numeric's to WordPress's strings.
|
| 715 |
+
*
|
| 716 |
+
* @param int $status phpBB v3.x numeric topic status
|
| 717 |
+
* @return string WordPress safe
|
| 718 |
+
*/
|
| 719 |
+
public function callback_topic_status( $status = 0 ) {
|
| 720 |
+
switch ( $status ) {
|
| 721 |
+
case 1 :
|
| 722 |
+
$status = 'closed';
|
| 723 |
+
break;
|
| 724 |
+
|
| 725 |
+
case 0 :
|
| 726 |
+
default :
|
| 727 |
+
$status = 'publish';
|
| 728 |
+
break;
|
| 729 |
+
}
|
| 730 |
+
return $status;
|
| 731 |
+
}
|
| 732 |
+
|
| 733 |
+
/**
|
| 734 |
+
* Verify the topic reply count.
|
| 735 |
+
*
|
| 736 |
+
* @param int $count phpBB v3.x reply count
|
| 737 |
+
* @return string WordPress safe
|
| 738 |
+
*/
|
| 739 |
+
public function callback_topic_reply_count( $count = 1 ) {
|
| 740 |
+
$count = absint( (int) $count - 1 );
|
| 741 |
+
return $count;
|
| 742 |
+
}
|
| 743 |
+
|
| 744 |
+
/**
|
| 745 |
+
* This callback processes any custom parser.php attributes and custom code with preg_replace
|
| 746 |
+
*/
|
| 747 |
+
protected function callback_html( $field ) {
|
| 748 |
+
|
| 749 |
+
// Strips custom phpBB 'magic_url' and 'bbcode_uid' first from $field before parsing $field to parser.php
|
| 750 |
+
$phpbb_uid = $field;
|
| 751 |
+
$phpbb_uid = html_entity_decode( $phpbb_uid );
|
| 752 |
+
|
| 753 |
+
// Replace '[b:XXXXXXX]' with '<strong>'
|
| 754 |
+
$phpbb_uid = preg_replace( '/\[b:(.*?)\]/', '<strong>', $phpbb_uid );
|
| 755 |
+
// Replace '[/b:XXXXXXX]' with '</strong>'
|
| 756 |
+
$phpbb_uid = preg_replace( '/\[\/b:(.*?)\]/', '</strong>', $phpbb_uid );
|
| 757 |
+
|
| 758 |
+
// Replace '[i:XXXXXXX]' with '<em>'
|
| 759 |
+
$phpbb_uid = preg_replace( '/\[i:(.*?)\]/', '<em>', $phpbb_uid );
|
| 760 |
+
// Replace '[/i:XXXXXXX]' with '</em>'
|
| 761 |
+
$phpbb_uid = preg_replace( '/\[\/i:(.*?)\]/', '</em>', $phpbb_uid );
|
| 762 |
+
|
| 763 |
+
// Replace '[u:XXXXXXX]' with '<u>'
|
| 764 |
+
$phpbb_uid = preg_replace( '/\[u:(.*?)\]/', '<u>', $phpbb_uid );
|
| 765 |
+
// Replace '[/u:XXXXXXX]' with '</u>'
|
| 766 |
+
$phpbb_uid = preg_replace( '/\[\/u:(.*?)\]/', '</u>', $phpbb_uid );
|
| 767 |
+
|
| 768 |
+
// Replace '[quote:XXXXXXX]' with '<blockquote>'
|
| 769 |
+
$phpbb_uid = preg_replace( '/\[quote:(.*?)\]/', '<blockquote>', $phpbb_uid );
|
| 770 |
+
// Replace '[quote="$1"]' with '<em>$1 wrote:</em><blockquote>"
|
| 771 |
+
$phpbb_uid = preg_replace( '/\[quote="(.*?)":(.*?)\]/', '<em>@$1 wrote:</em><blockquote>', $phpbb_uid );
|
| 772 |
+
// Replace '[/quote:XXXXXXX]' with '</blockquote>'
|
| 773 |
+
$phpbb_uid = preg_replace( '/\[\/quote:(.*?)\]/', '</blockquote>', $phpbb_uid );
|
| 774 |
+
|
| 775 |
+
// Replace '[img:XXXXXXX]' with '<img src="'
|
| 776 |
+
$phpbb_uid = preg_replace( '/\[img:(.*?)\]/', '<img src="', $phpbb_uid );
|
| 777 |
+
// Replace '[/img:XXXXXXX]' with ' alt="">'
|
| 778 |
+
$phpbb_uid = preg_replace( '/\[\/img:(.*?)\]/', '" alt="">', $phpbb_uid );
|
| 779 |
+
|
| 780 |
+
// Replace '<!-- s$1 --><img src=\"{SMILIES_PATH}$2 -->' with '$1'
|
| 781 |
+
$phpbb_uid = preg_replace( '/<!-- s(.*?) --><img src=\"{SMILIES_PATH}(.*?)-->/', '$1', $phpbb_uid );
|
| 782 |
+
|
| 783 |
+
// Replace '<!-- m --><a class="postlink" href="$1">$1</a><!-- m -->' with '$1'
|
| 784 |
+
$phpbb_uid = preg_replace( '/\<!-- m --\>\<a class="postlink" href="([^\[]+?)"\>([^\[]+?)\<\/a\>\<!-- m --\>/', '$1', $phpbb_uid );
|
| 785 |
+
|
| 786 |
+
// Replace '[url:XXXXXXX]$1[/url:XXXXXXX]' with '<a href="http://$1">$1</a>'
|
| 787 |
+
$phpbb_uid = preg_replace( '/\[url:(?:[^\]]+)\]([^\[]+?)\[\/url:(?:[^\]]+)\]/', '<a href="http://$1">$1</a>', $phpbb_uid );
|
| 788 |
+
// Replace '[url=http://$1:XXXXXXX]$3[/url:XXXXXXX]' with '<a href="http://$1">$3</a>'
|
| 789 |
+
$phpbb_uid = preg_replace( '/\[url\=http\:\/\/(.*?)\:(.*?)\](.*?)\[\/url:(.*?)\]/i', '<a href="http://$1">$3</a>', $phpbb_uid );
|
| 790 |
+
// Replace '[url=https://$1:XXXXXXX]$3[/url:XXXXXXX]' with '<a href="http://$1">$3</a>'
|
| 791 |
+
$phpbb_uid = preg_replace( '/\[url\=https\:\/\/(.*?)\:(.*?)\](.*?)\[\/url:(.*?)\]/i', '<a href="https://$1">$3</a>', $phpbb_uid );
|
| 792 |
+
|
| 793 |
+
// Replace '[email:XXXXXXX]' with '<a href="mailto:$2">$2</a>'
|
| 794 |
+
$phpbb_uid = preg_replace( '/\[email:(.*?)\](.*?)\[\/email:(.*?)\]/', '<a href="mailto:$2">$2</a>', $phpbb_uid );
|
| 795 |
+
// Replace '<!-- e -->no.one@domain.adr<!-- e -->' with '$1'
|
| 796 |
+
$phpbb_uid = preg_replace( '/\<!-- e --\>(.*?)\<!-- e --\>/', '$1', $phpbb_uid );
|
| 797 |
+
|
| 798 |
+
// Replace '[code:XXXXXXX]' with '<pre><code>'
|
| 799 |
+
$phpbb_uid = preg_replace( '/\[code:(.*?)\]/', '<pre><code>', $phpbb_uid );
|
| 800 |
+
// Replace '[/code:XXXXXXX]' with '</code></pre>'
|
| 801 |
+
$phpbb_uid = preg_replace( '/\[\/code:(.*?)\]/', '</code></pre>', $phpbb_uid );
|
| 802 |
+
|
| 803 |
+
// Replace '[color=$1:XXXXXXXX]' with '<span style="color:$1">'
|
| 804 |
+
$phpbb_uid = preg_replace( '/\[color=(.*?)\:(.*?)\]/', '<span style="color: $1">', $phpbb_uid );
|
| 805 |
+
// Replace '[/color:XXXXXXX]' with '</span>'
|
| 806 |
+
$phpbb_uid = preg_replace( '/\[\/color:(.*?)\]/', '</span>', $phpbb_uid );
|
| 807 |
+
|
| 808 |
+
// Replace '[size=$1:XXXXXXXX]' with '<span style="font-size:$1%;">$3</span>'
|
| 809 |
+
$phpbb_uid = preg_replace( '/\[size=(.*?):(.*?)\]/', '<span style="font-size:$1%;">', $phpbb_uid );
|
| 810 |
+
// Replace '[/size:XXXXXXX]' with ''
|
| 811 |
+
$phpbb_uid = preg_replace( '/\[\/size:(.*?)\]/', '</span>', $phpbb_uid );
|
| 812 |
+
|
| 813 |
+
// Replace '[list:XXXXXXX]' with '<ul>'
|
| 814 |
+
$phpbb_uid = preg_replace( '/\[list:(.*?)\]/', '<ul>', $phpbb_uid );
|
| 815 |
+
// Replace '[list=a:XXXXXXX]' with '<ol type="a">'
|
| 816 |
+
$phpbb_uid = preg_replace( '/\[list=a:(.*?)\]/', '<ol type="a">', $phpbb_uid );
|
| 817 |
+
// Replace '[list=1:XXXXXXX]' with '<ol>'
|
| 818 |
+
$phpbb_uid = preg_replace( '/\[list=1:(.*?)\]/', '<ol>', $phpbb_uid );
|
| 819 |
+
// Replace '[*:XXXXXXX]' with '<li>'
|
| 820 |
+
$phpbb_uid = preg_replace( '/\[\*:(.*?)\]/', '<li>', $phpbb_uid );
|
| 821 |
+
// Replace '[/*:m:XXXXXXX]' with '</li>'
|
| 822 |
+
$phpbb_uid = preg_replace( '/\[\/\*:m:(.*?)\]/', '</li>', $phpbb_uid );
|
| 823 |
+
// Replace '[/list:u:XXXXXXX]' with '</ul>'
|
| 824 |
+
$phpbb_uid = preg_replace( '/\[\/list:u:(.*?)\]/', '</ul>', $phpbb_uid );
|
| 825 |
+
// Replace '[/list:o:XXXXXXX]' with '</ol>'
|
| 826 |
+
$phpbb_uid = preg_replace( '/\[\/list:o:(.*?)\]/', '</ol>', $phpbb_uid );
|
| 827 |
+
|
| 828 |
+
// Now that phpBB's 'magic_url' and 'bbcode_uid' have been stripped put the cleaned HTML back in $field
|
| 829 |
+
$field = $phpbb_uid;
|
| 830 |
+
|
| 831 |
+
// Parse out any bbCodes in $field with the BBCode 'parser.php'
|
| 832 |
+
require_once( bbpress()->admin->admin_dir . 'parser.php' );
|
| 833 |
+
$bbcode = BBCode::getInstance();
|
| 834 |
+
$bbcode->enable_smileys = false;
|
| 835 |
+
$bbcode->smiley_regex = false;
|
| 836 |
+
return html_entity_decode( $bbcode->Parse( $field ) );
|
| 837 |
+
}
|
| 838 |
}
|
includes/admin/converters/vBulletin.php
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
-
* vBulletin Converter
|
| 5 |
*
|
| 6 |
-
* @since bbPress (
|
|
|
|
| 7 |
*/
|
| 8 |
class vBulletin extends BBP_Converter_Base {
|
| 9 |
|
|
@@ -32,7 +33,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 32 |
'to_fieldname' => '_bbp_forum_id'
|
| 33 |
);
|
| 34 |
|
| 35 |
-
// Forum parent id (If no parent,
|
| 36 |
$this->field_map[] = array(
|
| 37 |
'from_tablename' => 'forum',
|
| 38 |
'from_fieldname' => 'parentid',
|
|
@@ -40,6 +41,22 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 40 |
'to_fieldname' => '_bbp_forum_parent_id'
|
| 41 |
);
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
// Forum title.
|
| 44 |
$this->field_map[] = array(
|
| 45 |
'from_tablename' => 'forum',
|
|
@@ -74,7 +91,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 74 |
'to_fieldname' => 'menu_order'
|
| 75 |
);
|
| 76 |
|
| 77 |
-
// Forum
|
| 78 |
$this->field_map[] = array(
|
| 79 |
'to_type' => 'forum',
|
| 80 |
'to_fieldname' => 'post_date',
|
|
@@ -106,7 +123,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 106 |
'to_fieldname' => '_bbp_topic_id'
|
| 107 |
);
|
| 108 |
|
| 109 |
-
//
|
| 110 |
$this->field_map[] = array(
|
| 111 |
'from_tablename' => 'thread',
|
| 112 |
'from_fieldname' => 'forumid',
|
|
@@ -115,6 +132,15 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 115 |
'callback_method' => 'callback_forumid'
|
| 116 |
);
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
// Topic author.
|
| 119 |
$this->field_map[] = array(
|
| 120 |
'from_tablename' => 'thread',
|
|
@@ -141,7 +167,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 141 |
'callback_method' => 'callback_slug'
|
| 142 |
);
|
| 143 |
|
| 144 |
-
//
|
| 145 |
$this->field_map[] = array(
|
| 146 |
'from_tablename' => 'thread',
|
| 147 |
'from_fieldname' => 'forumid',
|
|
@@ -163,7 +189,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 163 |
'callback_method' => 'callback_html'
|
| 164 |
);
|
| 165 |
|
| 166 |
-
// Topic
|
| 167 |
$this->field_map[] = array(
|
| 168 |
'from_tablename' => 'thread',
|
| 169 |
'from_fieldname' => 'dateline',
|
|
@@ -192,6 +218,22 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 192 |
'to_fieldname' => 'post_modified_gmt',
|
| 193 |
'callback_method' => 'callback_datetime'
|
| 194 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
/** Tags Section ******************************************************/
|
| 197 |
|
|
@@ -204,7 +246,15 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 204 |
'callback_method' => 'callback_topicid'
|
| 205 |
);
|
| 206 |
|
| 207 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
$this->field_map[] = array(
|
| 209 |
'from_tablename' => 'tag',
|
| 210 |
'from_fieldname' => 'tagtext',
|
|
@@ -215,27 +265,29 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 215 |
'to_fieldname' => 'name'
|
| 216 |
);
|
| 217 |
|
| 218 |
-
/**
|
| 219 |
|
| 220 |
-
//
|
| 221 |
$this->field_map[] = array(
|
| 222 |
'from_tablename' => 'post',
|
| 223 |
'from_fieldname' => 'postid',
|
| 224 |
-
'from_expression' => 'WHERE post.parentid != 0',
|
| 225 |
'to_type' => 'reply',
|
| 226 |
'to_fieldname' => '_bbp_post_id'
|
| 227 |
);
|
| 228 |
|
| 229 |
-
//
|
| 230 |
$this->field_map[] = array(
|
| 231 |
-
'from_tablename' => '
|
| 232 |
-
'from_fieldname' => '
|
|
|
|
|
|
|
|
|
|
| 233 |
'to_type' => 'reply',
|
| 234 |
'to_fieldname' => '_bbp_forum_id',
|
| 235 |
'callback_method' => 'callback_topicid_to_forumid'
|
| 236 |
);
|
| 237 |
|
| 238 |
-
//
|
| 239 |
$this->field_map[] = array(
|
| 240 |
'from_tablename' => 'post',
|
| 241 |
'from_fieldname' => 'threadid',
|
|
@@ -244,7 +296,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 244 |
'callback_method' => 'callback_topicid'
|
| 245 |
);
|
| 246 |
|
| 247 |
-
//
|
| 248 |
$this->field_map[] = array(
|
| 249 |
'from_tablename' => 'post',
|
| 250 |
'from_fieldname' => 'ipaddress',
|
|
@@ -252,7 +304,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 252 |
'to_fieldname' => '_bbp_author_ip'
|
| 253 |
);
|
| 254 |
|
| 255 |
-
//
|
| 256 |
$this->field_map[] = array(
|
| 257 |
'from_tablename' => 'post',
|
| 258 |
'from_fieldname' => 'userid',
|
|
@@ -261,24 +313,20 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 261 |
'callback_method' => 'callback_userid'
|
| 262 |
);
|
| 263 |
|
| 264 |
-
//
|
|
|
|
| 265 |
$this->field_map[] = array(
|
| 266 |
-
'from_tablename'
|
| 267 |
-
'from_fieldname' => 'title',
|
| 268 |
-
'to_type' => 'reply',
|
| 269 |
-
'to_fieldname' => 'post_title'
|
| 270 |
-
);
|
| 271 |
-
|
| 272 |
-
// Topic slug (Clean name)
|
| 273 |
-
$this->field_map[] = array(
|
| 274 |
-
'from_tablename' => 'post',
|
| 275 |
'from_fieldname' => 'title',
|
|
|
|
|
|
|
|
|
|
| 276 |
'to_type' => 'reply',
|
| 277 |
-
'to_fieldname' => '
|
| 278 |
-
'callback_method' => '
|
| 279 |
);
|
| 280 |
|
| 281 |
-
//
|
| 282 |
$this->field_map[] = array(
|
| 283 |
'from_tablename' => 'post',
|
| 284 |
'from_fieldname' => 'pagetext',
|
|
@@ -287,7 +335,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 287 |
'callback_method' => 'callback_html'
|
| 288 |
);
|
| 289 |
|
| 290 |
-
//
|
| 291 |
$this->field_map[] = array(
|
| 292 |
'from_tablename' => 'post',
|
| 293 |
'from_fieldname' => 'threadid',
|
|
@@ -296,7 +344,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 296 |
'callback_method' => 'callback_topicid'
|
| 297 |
);
|
| 298 |
|
| 299 |
-
//
|
| 300 |
$this->field_map[] = array(
|
| 301 |
'from_tablename' => 'post',
|
| 302 |
'from_fieldname' => 'dateline',
|
|
@@ -328,7 +376,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 328 |
|
| 329 |
/** User Section ******************************************************/
|
| 330 |
|
| 331 |
-
// Store old User id (
|
| 332 |
$this->field_map[] = array(
|
| 333 |
'from_tablename' => 'user',
|
| 334 |
'from_fieldname' => 'userid',
|
|
@@ -336,7 +384,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 336 |
'to_fieldname' => '_bbp_user_id'
|
| 337 |
);
|
| 338 |
|
| 339 |
-
// Store old User password (
|
| 340 |
$this->field_map[] = array(
|
| 341 |
'from_tablename' => 'user',
|
| 342 |
'from_fieldname' => 'password',
|
|
@@ -345,8 +393,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 345 |
'callback_method' => 'callback_savepass'
|
| 346 |
);
|
| 347 |
|
| 348 |
-
// Store old User Salt (This is only used for the SELECT row info for
|
| 349 |
-
// the above password save)
|
| 350 |
$this->field_map[] = array(
|
| 351 |
'from_tablename' => 'user',
|
| 352 |
'from_fieldname' => 'salt',
|
|
@@ -354,7 +401,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 354 |
'to_fieldname' => ''
|
| 355 |
);
|
| 356 |
|
| 357 |
-
// User password verify class (
|
| 358 |
$this->field_map[] = array(
|
| 359 |
'to_type' => 'user',
|
| 360 |
'to_fieldname' => '_bbp_class',
|
|
@@ -369,14 +416,6 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 369 |
'to_fieldname' => 'user_login'
|
| 370 |
);
|
| 371 |
|
| 372 |
-
// User nice name.
|
| 373 |
-
$this->field_map[] = array(
|
| 374 |
-
'from_tablename' => 'user',
|
| 375 |
-
'from_fieldname' => 'user_nicename',
|
| 376 |
-
'to_type' => 'user',
|
| 377 |
-
'to_fieldname' => 'user_nicename'
|
| 378 |
-
);
|
| 379 |
-
|
| 380 |
// User email.
|
| 381 |
$this->field_map[] = array(
|
| 382 |
'from_tablename' => 'user',
|
|
@@ -402,7 +441,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 402 |
'callback_method' => 'callback_datetime'
|
| 403 |
);
|
| 404 |
|
| 405 |
-
// User
|
| 406 |
$this->field_map[] = array(
|
| 407 |
'from_tablename' => 'user',
|
| 408 |
'from_fieldname' => 'aim',
|
|
@@ -410,13 +449,37 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 410 |
'to_fieldname' => 'aim'
|
| 411 |
);
|
| 412 |
|
| 413 |
-
// User
|
| 414 |
$this->field_map[] = array(
|
| 415 |
'from_tablename' => 'user',
|
| 416 |
'from_fieldname' => 'yahoo',
|
| 417 |
'to_type' => 'user',
|
| 418 |
'to_fieldname' => 'yim'
|
| 419 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 420 |
}
|
| 421 |
|
| 422 |
/**
|
|
@@ -427,6 +490,7 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 427 |
return '';
|
| 428 |
}
|
| 429 |
|
|
|
|
| 430 |
/**
|
| 431 |
* This method is to save the salt and password together. That
|
| 432 |
* way when we authenticate it we can get it out of the database
|
|
@@ -440,9 +504,88 @@ class vBulletin extends BBP_Converter_Base {
|
|
| 440 |
/**
|
| 441 |
* This method is to take the pass out of the database and compare
|
| 442 |
* to a pass the user has typed in.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 443 |
*/
|
| 444 |
public function authenticate_pass( $password, $serialized_pass ) {
|
| 445 |
$pass_array = unserialize( $serialized_pass );
|
| 446 |
return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) );
|
| 447 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 448 |
}
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
+
* Implementation of vBulletin v4.x Converter.
|
| 5 |
*
|
| 6 |
+
* @since bbPress (r4724)
|
| 7 |
+
* @link Codex Docs http://codex.bbpress.org/import-forums/vbulletin
|
| 8 |
*/
|
| 9 |
class vBulletin extends BBP_Converter_Base {
|
| 10 |
|
| 33 |
'to_fieldname' => '_bbp_forum_id'
|
| 34 |
);
|
| 35 |
|
| 36 |
+
// Forum parent id (If no parent, then 0. Stored in postmeta)
|
| 37 |
$this->field_map[] = array(
|
| 38 |
'from_tablename' => 'forum',
|
| 39 |
'from_fieldname' => 'parentid',
|
| 41 |
'to_fieldname' => '_bbp_forum_parent_id'
|
| 42 |
);
|
| 43 |
|
| 44 |
+
// Forum topic count (Stored in postmeta)
|
| 45 |
+
$this->field_map[] = array(
|
| 46 |
+
'from_tablename' => 'forum',
|
| 47 |
+
'from_fieldname' => 'threadcount',
|
| 48 |
+
'to_type' => 'forum',
|
| 49 |
+
'to_fieldname' => '_bbp_topic_count'
|
| 50 |
+
);
|
| 51 |
+
|
| 52 |
+
// Forum reply count (Stored in postmeta)
|
| 53 |
+
$this->field_map[] = array(
|
| 54 |
+
'from_tablename' => 'forum',
|
| 55 |
+
'from_fieldname' => 'replycount',
|
| 56 |
+
'to_type' => 'forum',
|
| 57 |
+
'to_fieldname' => '_bbp_reply_count'
|
| 58 |
+
);
|
| 59 |
+
|
| 60 |
// Forum title.
|
| 61 |
$this->field_map[] = array(
|
| 62 |
'from_tablename' => 'forum',
|
| 91 |
'to_fieldname' => 'menu_order'
|
| 92 |
);
|
| 93 |
|
| 94 |
+
// Forum dates.
|
| 95 |
$this->field_map[] = array(
|
| 96 |
'to_type' => 'forum',
|
| 97 |
'to_fieldname' => 'post_date',
|
| 123 |
'to_fieldname' => '_bbp_topic_id'
|
| 124 |
);
|
| 125 |
|
| 126 |
+
// Topic parent forum id (If no parent, then 0. Stored in postmeta)
|
| 127 |
$this->field_map[] = array(
|
| 128 |
'from_tablename' => 'thread',
|
| 129 |
'from_fieldname' => 'forumid',
|
| 132 |
'callback_method' => 'callback_forumid'
|
| 133 |
);
|
| 134 |
|
| 135 |
+
// Topic reply count (Stored in postmeta)
|
| 136 |
+
$this->field_map[] = array(
|
| 137 |
+
'from_tablename' => 'thread',
|
| 138 |
+
'from_fieldname' => 'replycount',
|
| 139 |
+
'to_type' => 'topic',
|
| 140 |
+
'to_fieldname' => '_bbp_reply_count',
|
| 141 |
+
'callback_method' => 'callback_topic_reply_count'
|
| 142 |
+
);
|
| 143 |
+
|
| 144 |
// Topic author.
|
| 145 |
$this->field_map[] = array(
|
| 146 |
'from_tablename' => 'thread',
|
| 167 |
'callback_method' => 'callback_slug'
|
| 168 |
);
|
| 169 |
|
| 170 |
+
// Topic parent forum id (If no parent, then 0)
|
| 171 |
$this->field_map[] = array(
|
| 172 |
'from_tablename' => 'thread',
|
| 173 |
'from_fieldname' => 'forumid',
|
| 189 |
'callback_method' => 'callback_html'
|
| 190 |
);
|
| 191 |
|
| 192 |
+
// Topic dates.
|
| 193 |
$this->field_map[] = array(
|
| 194 |
'from_tablename' => 'thread',
|
| 195 |
'from_fieldname' => 'dateline',
|
| 218 |
'to_fieldname' => 'post_modified_gmt',
|
| 219 |
'callback_method' => 'callback_datetime'
|
| 220 |
);
|
| 221 |
+
$this->field_map[] = array(
|
| 222 |
+
'from_tablename' => 'thread',
|
| 223 |
+
'from_fieldname' => 'lastpost',
|
| 224 |
+
'to_type' => 'topic',
|
| 225 |
+
'to_fieldname' => '_bbp_last_active_time',
|
| 226 |
+
'callback_method' => 'callback_datetime'
|
| 227 |
+
);
|
| 228 |
+
|
| 229 |
+
// Topic status (Open or Closed)
|
| 230 |
+
$this->field_map[] = array(
|
| 231 |
+
'from_tablename' => 'thread',
|
| 232 |
+
'from_fieldname' => 'open',
|
| 233 |
+
'to_type' => 'topic',
|
| 234 |
+
'to_fieldname' => 'post_status',
|
| 235 |
+
'callback_method' => 'callback_topic_status'
|
| 236 |
+
);
|
| 237 |
|
| 238 |
/** Tags Section ******************************************************/
|
| 239 |
|
| 246 |
'callback_method' => 'callback_topicid'
|
| 247 |
);
|
| 248 |
|
| 249 |
+
// Taxonomy ID.
|
| 250 |
+
$this->field_map[] = array(
|
| 251 |
+
'from_tablename' => 'tagcontent',
|
| 252 |
+
'from_fieldname' => 'tagid',
|
| 253 |
+
'to_type' => 'tags',
|
| 254 |
+
'to_fieldname' => 'taxonomy'
|
| 255 |
+
);
|
| 256 |
+
|
| 257 |
+
// Term text.
|
| 258 |
$this->field_map[] = array(
|
| 259 |
'from_tablename' => 'tag',
|
| 260 |
'from_fieldname' => 'tagtext',
|
| 265 |
'to_fieldname' => 'name'
|
| 266 |
);
|
| 267 |
|
| 268 |
+
/** Reply Section *****************************************************/
|
| 269 |
|
| 270 |
+
// Reply id (Stored in postmeta)
|
| 271 |
$this->field_map[] = array(
|
| 272 |
'from_tablename' => 'post',
|
| 273 |
'from_fieldname' => 'postid',
|
|
|
|
| 274 |
'to_type' => 'reply',
|
| 275 |
'to_fieldname' => '_bbp_post_id'
|
| 276 |
);
|
| 277 |
|
| 278 |
+
// Reply parent forum id (If no parent, then 0. Stored in postmeta)
|
| 279 |
$this->field_map[] = array(
|
| 280 |
+
'from_tablename' => 'thread',
|
| 281 |
+
'from_fieldname' => 'forumid',
|
| 282 |
+
'join_tablename' => 'post',
|
| 283 |
+
'join_type' => 'INNER',
|
| 284 |
+
'join_expression' => 'USING (threadid) WHERE post.parentid != 0',
|
| 285 |
'to_type' => 'reply',
|
| 286 |
'to_fieldname' => '_bbp_forum_id',
|
| 287 |
'callback_method' => 'callback_topicid_to_forumid'
|
| 288 |
);
|
| 289 |
|
| 290 |
+
// Reply parent topic id (If no parent, then 0. Stored in postmeta)
|
| 291 |
$this->field_map[] = array(
|
| 292 |
'from_tablename' => 'post',
|
| 293 |
'from_fieldname' => 'threadid',
|
| 296 |
'callback_method' => 'callback_topicid'
|
| 297 |
);
|
| 298 |
|
| 299 |
+
// Reply author ip (Stored in postmeta)
|
| 300 |
$this->field_map[] = array(
|
| 301 |
'from_tablename' => 'post',
|
| 302 |
'from_fieldname' => 'ipaddress',
|
| 304 |
'to_fieldname' => '_bbp_author_ip'
|
| 305 |
);
|
| 306 |
|
| 307 |
+
// Reply author.
|
| 308 |
$this->field_map[] = array(
|
| 309 |
'from_tablename' => 'post',
|
| 310 |
'from_fieldname' => 'userid',
|
| 313 |
'callback_method' => 'callback_userid'
|
| 314 |
);
|
| 315 |
|
| 316 |
+
// Reply title.
|
| 317 |
+
// Note: We join the thread table because post table does not include topic title.
|
| 318 |
$this->field_map[] = array(
|
| 319 |
+
'from_tablename' => 'thread',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 320 |
'from_fieldname' => 'title',
|
| 321 |
+
'join_tablename' => 'post',
|
| 322 |
+
'join_type' => 'INNER',
|
| 323 |
+
'join_expression' => 'USING (threadid) WHERE post.parentid != 0',
|
| 324 |
'to_type' => 'reply',
|
| 325 |
+
'to_fieldname' => 'post_title',
|
| 326 |
+
'callback_method' => 'callback_reply_title'
|
| 327 |
);
|
| 328 |
|
| 329 |
+
// Reply content.
|
| 330 |
$this->field_map[] = array(
|
| 331 |
'from_tablename' => 'post',
|
| 332 |
'from_fieldname' => 'pagetext',
|
| 335 |
'callback_method' => 'callback_html'
|
| 336 |
);
|
| 337 |
|
| 338 |
+
// Reply parent topic id (If no parent, then 0)
|
| 339 |
$this->field_map[] = array(
|
| 340 |
'from_tablename' => 'post',
|
| 341 |
'from_fieldname' => 'threadid',
|
| 344 |
'callback_method' => 'callback_topicid'
|
| 345 |
);
|
| 346 |
|
| 347 |
+
// Reply dates.
|
| 348 |
$this->field_map[] = array(
|
| 349 |
'from_tablename' => 'post',
|
| 350 |
'from_fieldname' => 'dateline',
|
| 376 |
|
| 377 |
/** User Section ******************************************************/
|
| 378 |
|
| 379 |
+
// Store old User id (Stored in usermeta)
|
| 380 |
$this->field_map[] = array(
|
| 381 |
'from_tablename' => 'user',
|
| 382 |
'from_fieldname' => 'userid',
|
| 384 |
'to_fieldname' => '_bbp_user_id'
|
| 385 |
);
|
| 386 |
|
| 387 |
+
// Store old User password (Stored in usermeta serialized with salt)
|
| 388 |
$this->field_map[] = array(
|
| 389 |
'from_tablename' => 'user',
|
| 390 |
'from_fieldname' => 'password',
|
| 393 |
'callback_method' => 'callback_savepass'
|
| 394 |
);
|
| 395 |
|
| 396 |
+
// Store old User Salt (This is only used for the SELECT row info for the above password save)
|
|
|
|
| 397 |
$this->field_map[] = array(
|
| 398 |
'from_tablename' => 'user',
|
| 399 |
'from_fieldname' => 'salt',
|
| 401 |
'to_fieldname' => ''
|
| 402 |
);
|
| 403 |
|
| 404 |
+
// User password verify class (Stored in usermeta for verifying password)
|
| 405 |
$this->field_map[] = array(
|
| 406 |
'to_type' => 'user',
|
| 407 |
'to_fieldname' => '_bbp_class',
|
| 416 |
'to_fieldname' => 'user_login'
|
| 417 |
);
|
| 418 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 419 |
// User email.
|
| 420 |
$this->field_map[] = array(
|
| 421 |
'from_tablename' => 'user',
|
| 441 |
'callback_method' => 'callback_datetime'
|
| 442 |
);
|
| 443 |
|
| 444 |
+
// User AIM (Stored in usermeta)
|
| 445 |
$this->field_map[] = array(
|
| 446 |
'from_tablename' => 'user',
|
| 447 |
'from_fieldname' => 'aim',
|
| 449 |
'to_fieldname' => 'aim'
|
| 450 |
);
|
| 451 |
|
| 452 |
+
// User Yahoo (Stored in usermeta)
|
| 453 |
$this->field_map[] = array(
|
| 454 |
'from_tablename' => 'user',
|
| 455 |
'from_fieldname' => 'yahoo',
|
| 456 |
'to_type' => 'user',
|
| 457 |
'to_fieldname' => 'yim'
|
| 458 |
);
|
| 459 |
+
|
| 460 |
+
// User ICQ (Stored in usermeta)
|
| 461 |
+
$this->field_map[] = array(
|
| 462 |
+
'from_tablename' => 'user',
|
| 463 |
+
'from_fieldname' => 'icq',
|
| 464 |
+
'to_type' => 'user',
|
| 465 |
+
'to_fieldname' => '_bbp_vbulletin_user_icq'
|
| 466 |
+
);
|
| 467 |
+
|
| 468 |
+
// User MSN (Stored in usermeta)
|
| 469 |
+
$this->field_map[] = array(
|
| 470 |
+
'from_tablename' => 'user',
|
| 471 |
+
'from_fieldname' => 'msn',
|
| 472 |
+
'to_type' => 'user',
|
| 473 |
+
'to_fieldname' => '_bbp_vbulletin_user_msn'
|
| 474 |
+
);
|
| 475 |
+
|
| 476 |
+
// User Skype (Stored in usermeta)
|
| 477 |
+
$this->field_map[] = array(
|
| 478 |
+
'from_tablename' => 'user',
|
| 479 |
+
'from_fieldname' => 'skype',
|
| 480 |
+
'to_type' => 'user',
|
| 481 |
+
'to_fieldname' => '_bbp_vbulletin_user_skype'
|
| 482 |
+
);
|
| 483 |
}
|
| 484 |
|
| 485 |
/**
|
| 490 |
return '';
|
| 491 |
}
|
| 492 |
|
| 493 |
+
|
| 494 |
/**
|
| 495 |
* This method is to save the salt and password together. That
|
| 496 |
* way when we authenticate it we can get it out of the database
|
| 504 |
/**
|
| 505 |
* This method is to take the pass out of the database and compare
|
| 506 |
* to a pass the user has typed in.
|
| 507 |
+
*
|
| 508 |
+
* vBulletin passwords do not work. Maybe use the below plugin's approach?
|
| 509 |
+
*
|
| 510 |
+
* @link http://wordpress.org/extend/plugins/vb-user-copy/
|
| 511 |
+
* @link http://plugins.trac.wordpress.org/browser/vb-user-copy/trunk/vb_user_copy.php
|
| 512 |
*/
|
| 513 |
public function authenticate_pass( $password, $serialized_pass ) {
|
| 514 |
$pass_array = unserialize( $serialized_pass );
|
| 515 |
return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) );
|
| 516 |
}
|
| 517 |
+
|
| 518 |
+
/**
|
| 519 |
+
* Verify the topic reply count.
|
| 520 |
+
*
|
| 521 |
+
* @param int $count vBulletin v4.x reply count
|
| 522 |
+
* @return string WordPress safe
|
| 523 |
+
*/
|
| 524 |
+
public function callback_topic_reply_count( $count = 1 ) {
|
| 525 |
+
$count = absint( (int) $count - 1 );
|
| 526 |
+
return $count;
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
/**
|
| 530 |
+
* Set the reply title
|
| 531 |
+
*
|
| 532 |
+
* @param string $title vBulletin v4.x topic title of this reply
|
| 533 |
+
* @return string Prefixed topic title, or empty string
|
| 534 |
+
*/
|
| 535 |
+
public function callback_reply_title( $title = '' ) {
|
| 536 |
+
$title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
|
| 537 |
+
return $title;
|
| 538 |
+
}
|
| 539 |
+
|
| 540 |
+
/**
|
| 541 |
+
* Translate the post status from vBulletin numeric's to WordPress's strings.
|
| 542 |
+
*
|
| 543 |
+
* @param int $status vBulletin v4.x numeric topic status
|
| 544 |
+
* @return string WordPress safe
|
| 545 |
+
*/
|
| 546 |
+
public function callback_topic_status( $status = 1 ) {
|
| 547 |
+
switch ( $status ) {
|
| 548 |
+
case 0 :
|
| 549 |
+
$status = 'closed';
|
| 550 |
+
break;
|
| 551 |
+
|
| 552 |
+
case 1 :
|
| 553 |
+
default :
|
| 554 |
+
$status = 'publish';
|
| 555 |
+
break;
|
| 556 |
+
}
|
| 557 |
+
return $status;
|
| 558 |
+
}
|
| 559 |
+
|
| 560 |
+
/**
|
| 561 |
+
* This callback processes any custom parser.php attributes and custom code with preg_replace
|
| 562 |
+
*/
|
| 563 |
+
protected function callback_html( $field ) {
|
| 564 |
+
|
| 565 |
+
// Strips vBulletin custom HTML first from $field before parsing $field to parser.php
|
| 566 |
+
$vbulletin_markup = $field;
|
| 567 |
+
$vbulletin_markup = html_entity_decode( $vbulletin_markup );
|
| 568 |
+
|
| 569 |
+
// Replace '[QUOTE]' with '<blockquote>'
|
| 570 |
+
$vbulletin_markup = preg_replace( '/\[QUOTE\]/', '<blockquote>', $vbulletin_markup );
|
| 571 |
+
// Replace '[QUOTE=User Name($1);PostID($2)]' with '<em>@$1 $2 wrote:</em><blockquote>"
|
| 572 |
+
$vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/' , '<em>@$1 $2 wrote:</em><blockquote>', $vbulletin_markup );
|
| 573 |
+
// Replace '[/QUOTE]' with '</blockquote>'
|
| 574 |
+
$vbulletin_markup = preg_replace( '/\[\/QUOTE\]/', '</blockquote>', $vbulletin_markup );
|
| 575 |
+
// Replace '[MENTION=###($1)]User Name($2)[/MENTION]' with '@$2"
|
| 576 |
+
$vbulletin_markup = preg_replace( '/\[MENTION=(.*?)\](.*?)\[\/MENTION\]/', '@$2', $vbulletin_markup );
|
| 577 |
+
|
| 578 |
+
// Replace '[video=youtube;$1]$2[/video]' with '$2"
|
| 579 |
+
$vbulletin_markup = preg_replace( '/\[video\=youtube;(.*?)\](.*?)\[\/video\]/', '$2', $vbulletin_markup );
|
| 580 |
+
|
| 581 |
+
// Now that vBulletin custom HTML has been stripped put the cleaned HTML back in $field
|
| 582 |
+
$field = $vbulletin_markup;
|
| 583 |
+
|
| 584 |
+
// Parse out any bbCodes in $field with the BBCode 'parser.php'
|
| 585 |
+
require_once( bbpress()->admin->admin_dir . 'parser.php' );
|
| 586 |
+
$bbcode = BBCode::getInstance();
|
| 587 |
+
$bbcode->enable_smileys = false;
|
| 588 |
+
$bbcode->smiley_regex = false;
|
| 589 |
+
return html_entity_decode( $bbcode->Parse( $field ) );
|
| 590 |
+
}
|
| 591 |
}
|
includes/admin/metaboxes.php
CHANGED
|
@@ -34,8 +34,8 @@
|
|
| 34 |
*/
|
| 35 |
function bbp_dashboard_widget_right_now() {
|
| 36 |
|
| 37 |
-
// Get the statistics
|
| 38 |
-
|
| 39 |
|
| 40 |
<div class="table table_content">
|
| 41 |
|
|
@@ -46,8 +46,8 @@ function bbp_dashboard_widget_right_now() {
|
|
| 46 |
<tr class="first">
|
| 47 |
|
| 48 |
<?php
|
| 49 |
-
$num = $forum_count;
|
| 50 |
-
$text = _n( 'Forum', 'Forums', $forum_count, 'bbpress' );
|
| 51 |
if ( current_user_can( 'publish_forums' ) ) {
|
| 52 |
$link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 53 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
|
@@ -63,8 +63,8 @@ function bbp_dashboard_widget_right_now() {
|
|
| 63 |
<tr>
|
| 64 |
|
| 65 |
<?php
|
| 66 |
-
$num = $topic_count;
|
| 67 |
-
$text = _n( 'Topic', 'Topics', $topic_count, 'bbpress' );
|
| 68 |
if ( current_user_can( 'publish_topics' ) ) {
|
| 69 |
$link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 70 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
|
@@ -80,8 +80,8 @@ function bbp_dashboard_widget_right_now() {
|
|
| 80 |
<tr>
|
| 81 |
|
| 82 |
<?php
|
| 83 |
-
$num = $reply_count;
|
| 84 |
-
$text = _n( 'Reply', 'Replies', $reply_count, 'bbpress' );
|
| 85 |
if ( current_user_can( 'publish_replies' ) ) {
|
| 86 |
$link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 87 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
|
@@ -99,8 +99,8 @@ function bbp_dashboard_widget_right_now() {
|
|
| 99 |
<tr>
|
| 100 |
|
| 101 |
<?php
|
| 102 |
-
$num = $topic_tag_count;
|
| 103 |
-
$text = _n( 'Topic Tag', 'Topic Tags', $topic_tag_count, 'bbpress' );
|
| 104 |
if ( current_user_can( 'manage_topic_tags' ) ) {
|
| 105 |
$link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
|
| 106 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
|
@@ -131,8 +131,8 @@ function bbp_dashboard_widget_right_now() {
|
|
| 131 |
<tr class="first">
|
| 132 |
|
| 133 |
<?php
|
| 134 |
-
$num = $user_count;
|
| 135 |
-
$text = _n( 'User', 'Users', $user_count, 'bbpress' );
|
| 136 |
if ( current_user_can( 'edit_users' ) ) {
|
| 137 |
$link = get_admin_url( null, 'users.php' );
|
| 138 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
|
@@ -145,19 +145,19 @@ function bbp_dashboard_widget_right_now() {
|
|
| 145 |
|
| 146 |
</tr>
|
| 147 |
|
| 148 |
-
<?php if ( isset( $topic_count_hidden ) ) : ?>
|
| 149 |
|
| 150 |
<tr>
|
| 151 |
|
| 152 |
<?php
|
| 153 |
-
$num = $topic_count_hidden;
|
| 154 |
-
$text = _n( 'Hidden Topic', 'Hidden Topics', $topic_count_hidden, 'bbpress' );
|
| 155 |
$link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 156 |
if ( '0' != $num ) {
|
| 157 |
$link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
|
| 158 |
}
|
| 159 |
-
$num = '<a href="' . $link . '" title="' . esc_attr( $hidden_topic_title ) . '">' . $num . '</a>';
|
| 160 |
-
$text = '<a class="waiting" href="' . $link . '" title="' . esc_attr( $hidden_topic_title ) . '">' . $text . '</a>';
|
| 161 |
?>
|
| 162 |
|
| 163 |
<td class="b b-hidden-topics"><?php echo $num; ?></td>
|
|
@@ -167,19 +167,19 @@ function bbp_dashboard_widget_right_now() {
|
|
| 167 |
|
| 168 |
<?php endif; ?>
|
| 169 |
|
| 170 |
-
<?php if ( isset( $reply_count_hidden ) ) : ?>
|
| 171 |
|
| 172 |
<tr>
|
| 173 |
|
| 174 |
<?php
|
| 175 |
-
$num = $reply_count_hidden;
|
| 176 |
-
$text = _n( 'Hidden Reply', 'Hidden Replies', $reply_count_hidden, 'bbpress' );
|
| 177 |
$link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 178 |
if ( '0' != $num ) {
|
| 179 |
$link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
|
| 180 |
}
|
| 181 |
-
$num = '<a href="' . $link . '" title="' . esc_attr( $hidden_reply_title ) . '">' . $num . '</a>';
|
| 182 |
-
$text = '<a class="waiting" href="' . $link . '" title="' . esc_attr( $hidden_reply_title ) . '">' . $text . '</a>';
|
| 183 |
?>
|
| 184 |
|
| 185 |
<td class="b b-hidden-replies"><?php echo $num; ?></td>
|
|
@@ -189,13 +189,13 @@ function bbp_dashboard_widget_right_now() {
|
|
| 189 |
|
| 190 |
<?php endif; ?>
|
| 191 |
|
| 192 |
-
<?php if ( bbp_allow_topic_tags() && isset( $empty_topic_tag_count ) ) : ?>
|
| 193 |
|
| 194 |
<tr>
|
| 195 |
|
| 196 |
<?php
|
| 197 |
-
$num = $empty_topic_tag_count;
|
| 198 |
-
$text = _n( 'Empty Topic Tag', 'Empty Topic Tags', $empty_topic_tag_count, 'bbpress' );
|
| 199 |
$link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
|
| 200 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
| 201 |
$text = '<a class="waiting" href="' . $link . '">' . $text . '</a>';
|
|
@@ -301,7 +301,7 @@ function bbp_forum_metabox() {
|
|
| 301 |
<?php bbp_dropdown( array(
|
| 302 |
'post_type' => bbp_get_forum_post_type(),
|
| 303 |
'selected' => $post_parent,
|
| 304 |
-
'
|
| 305 |
'numberposts' => -1,
|
| 306 |
'orderby' => 'title',
|
| 307 |
'order' => 'ASC',
|
|
@@ -359,7 +359,7 @@ function bbp_topic_metabox() {
|
|
| 359 |
<?php bbp_dropdown( array(
|
| 360 |
'post_type' => bbp_get_forum_post_type(),
|
| 361 |
'selected' => bbp_get_topic_forum_id( $post_id ),
|
| 362 |
-
'
|
| 363 |
'numberposts' => -1,
|
| 364 |
'orderby' => 'title',
|
| 365 |
'order' => 'ASC',
|
|
@@ -412,7 +412,7 @@ function bbp_reply_metabox() {
|
|
| 412 |
<?php bbp_dropdown( array(
|
| 413 |
'post_type' => bbp_get_forum_post_type(),
|
| 414 |
'selected' => $reply_forum_id,
|
| 415 |
-
'
|
| 416 |
'numberposts' => -1,
|
| 417 |
'orderby' => 'title',
|
| 418 |
'order' => 'ASC',
|
| 34 |
*/
|
| 35 |
function bbp_dashboard_widget_right_now() {
|
| 36 |
|
| 37 |
+
// Get the statistics
|
| 38 |
+
$r = bbp_get_statistics(); ?>
|
| 39 |
|
| 40 |
<div class="table table_content">
|
| 41 |
|
| 46 |
<tr class="first">
|
| 47 |
|
| 48 |
<?php
|
| 49 |
+
$num = $r['forum_count'];
|
| 50 |
+
$text = _n( 'Forum', 'Forums', $r['forum_count'], 'bbpress' );
|
| 51 |
if ( current_user_can( 'publish_forums' ) ) {
|
| 52 |
$link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 53 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
| 63 |
<tr>
|
| 64 |
|
| 65 |
<?php
|
| 66 |
+
$num = $r['topic_count'];
|
| 67 |
+
$text = _n( 'Topic', 'Topics', $r['topic_count'], 'bbpress' );
|
| 68 |
if ( current_user_can( 'publish_topics' ) ) {
|
| 69 |
$link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 70 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
| 80 |
<tr>
|
| 81 |
|
| 82 |
<?php
|
| 83 |
+
$num = $r['reply_count'];
|
| 84 |
+
$text = _n( 'Reply', 'Replies', $r['reply_count'], 'bbpress' );
|
| 85 |
if ( current_user_can( 'publish_replies' ) ) {
|
| 86 |
$link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 87 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
| 99 |
<tr>
|
| 100 |
|
| 101 |
<?php
|
| 102 |
+
$num = $r['topic_tag_count'];
|
| 103 |
+
$text = _n( 'Topic Tag', 'Topic Tags', $r['topic_tag_count'], 'bbpress' );
|
| 104 |
if ( current_user_can( 'manage_topic_tags' ) ) {
|
| 105 |
$link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
|
| 106 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
| 131 |
<tr class="first">
|
| 132 |
|
| 133 |
<?php
|
| 134 |
+
$num = $r['user_count'];
|
| 135 |
+
$text = _n( 'User', 'Users', $r['user_count'], 'bbpress' );
|
| 136 |
if ( current_user_can( 'edit_users' ) ) {
|
| 137 |
$link = get_admin_url( null, 'users.php' );
|
| 138 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
| 145 |
|
| 146 |
</tr>
|
| 147 |
|
| 148 |
+
<?php if ( isset( $r['topic_count_hidden'] ) ) : ?>
|
| 149 |
|
| 150 |
<tr>
|
| 151 |
|
| 152 |
<?php
|
| 153 |
+
$num = $r['topic_count_hidden'];
|
| 154 |
+
$text = _n( 'Hidden Topic', 'Hidden Topics', $r['topic_count_hidden'], 'bbpress' );
|
| 155 |
$link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 156 |
if ( '0' != $num ) {
|
| 157 |
$link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
|
| 158 |
}
|
| 159 |
+
$num = '<a href="' . $link . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num . '</a>';
|
| 160 |
+
$text = '<a class="waiting" href="' . $link . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $text . '</a>';
|
| 161 |
?>
|
| 162 |
|
| 163 |
<td class="b b-hidden-topics"><?php echo $num; ?></td>
|
| 167 |
|
| 168 |
<?php endif; ?>
|
| 169 |
|
| 170 |
+
<?php if ( isset( $r['reply_count_hidden'] ) ) : ?>
|
| 171 |
|
| 172 |
<tr>
|
| 173 |
|
| 174 |
<?php
|
| 175 |
+
$num = $r['reply_count_hidden'];
|
| 176 |
+
$text = _n( 'Hidden Reply', 'Hidden Replies', $r['reply_count_hidden'], 'bbpress' );
|
| 177 |
$link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
|
| 178 |
if ( '0' != $num ) {
|
| 179 |
$link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
|
| 180 |
}
|
| 181 |
+
$num = '<a href="' . $link . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num . '</a>';
|
| 182 |
+
$text = '<a class="waiting" href="' . $link . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $text . '</a>';
|
| 183 |
?>
|
| 184 |
|
| 185 |
<td class="b b-hidden-replies"><?php echo $num; ?></td>
|
| 189 |
|
| 190 |
<?php endif; ?>
|
| 191 |
|
| 192 |
+
<?php if ( bbp_allow_topic_tags() && isset( $r['empty_topic_tag_count'] ) ) : ?>
|
| 193 |
|
| 194 |
<tr>
|
| 195 |
|
| 196 |
<?php
|
| 197 |
+
$num = $r['empty_topic_tag_count'];
|
| 198 |
+
$text = _n( 'Empty Topic Tag', 'Empty Topic Tags', $r['empty_topic_tag_count'], 'bbpress' );
|
| 199 |
$link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
|
| 200 |
$num = '<a href="' . $link . '">' . $num . '</a>';
|
| 201 |
$text = '<a class="waiting" href="' . $link . '">' . $text . '</a>';
|
| 301 |
<?php bbp_dropdown( array(
|
| 302 |
'post_type' => bbp_get_forum_post_type(),
|
| 303 |
'selected' => $post_parent,
|
| 304 |
+
'post_parent' => 0,
|
| 305 |
'numberposts' => -1,
|
| 306 |
'orderby' => 'title',
|
| 307 |
'order' => 'ASC',
|
| 359 |
<?php bbp_dropdown( array(
|
| 360 |
'post_type' => bbp_get_forum_post_type(),
|
| 361 |
'selected' => bbp_get_topic_forum_id( $post_id ),
|
| 362 |
+
'post_parent' => 0,
|
| 363 |
'numberposts' => -1,
|
| 364 |
'orderby' => 'title',
|
| 365 |
'order' => 'ASC',
|
| 412 |
<?php bbp_dropdown( array(
|
| 413 |
'post_type' => bbp_get_forum_post_type(),
|
| 414 |
'selected' => $reply_forum_id,
|
| 415 |
+
'post_parent' => 0,
|
| 416 |
'numberposts' => -1,
|
| 417 |
'orderby' => 'title',
|
| 418 |
'order' => 'ASC',
|
includes/admin/settings.php
CHANGED
|
@@ -299,6 +299,14 @@ function bbp_admin_get_settings_fields() {
|
|
| 299 |
'callback' => 'bbp_admin_setting_callback_view_slug',
|
| 300 |
'sanitize_callback' => 'sanitize_title',
|
| 301 |
'args' => array()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 302 |
)
|
| 303 |
),
|
| 304 |
|
|
@@ -494,7 +502,7 @@ function bbp_admin_setting_callback_anonymous() {
|
|
| 494 |
function bbp_admin_setting_callback_global_access() {
|
| 495 |
?>
|
| 496 |
|
| 497 |
-
<input id="_bbp_allow_global_access" name="_bbp_allow_global_access" type="checkbox" id="_bbp_allow_global_access" value="1" <?php checked( bbp_allow_global_access(
|
| 498 |
<label for="_bbp_allow_global_access"><?php _e( 'Automatically assign default role to new, registered users upon visiting the site.', 'bbpress' ); ?></label>
|
| 499 |
|
| 500 |
<?php
|
|
@@ -883,6 +891,23 @@ function bbp_admin_setting_callback_view_slug() {
|
|
| 883 |
bbp_form_slug_conflict_check( '_bbp_view_slug', 'view' );
|
| 884 |
}
|
| 885 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 886 |
/** BuddyPress ****************************************************************/
|
| 887 |
|
| 888 |
/**
|
| 299 |
'callback' => 'bbp_admin_setting_callback_view_slug',
|
| 300 |
'sanitize_callback' => 'sanitize_title',
|
| 301 |
'args' => array()
|
| 302 |
+
),
|
| 303 |
+
|
| 304 |
+
// Search slug setting
|
| 305 |
+
'_bbp_search_slug' => array(
|
| 306 |
+
'title' => __( 'Search slug', 'bbpress' ),
|
| 307 |
+
'callback' => 'bbp_admin_setting_callback_search_slug',
|
| 308 |
+
'sanitize_callback' => 'sanitize_title',
|
| 309 |
+
'args' => array()
|
| 310 |
)
|
| 311 |
),
|
| 312 |
|
| 502 |
function bbp_admin_setting_callback_global_access() {
|
| 503 |
?>
|
| 504 |
|
| 505 |
+
<input id="_bbp_allow_global_access" name="_bbp_allow_global_access" type="checkbox" id="_bbp_allow_global_access" value="1" <?php checked( bbp_allow_global_access( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_global_access' ); ?> />
|
| 506 |
<label for="_bbp_allow_global_access"><?php _e( 'Automatically assign default role to new, registered users upon visiting the site.', 'bbpress' ); ?></label>
|
| 507 |
|
| 508 |
<?php
|
| 891 |
bbp_form_slug_conflict_check( '_bbp_view_slug', 'view' );
|
| 892 |
}
|
| 893 |
|
| 894 |
+
/**
|
| 895 |
+
* Search slug setting field
|
| 896 |
+
*
|
| 897 |
+
* @since bbPress (r4579)
|
| 898 |
+
*
|
| 899 |
+
* @uses bbp_form_option() To output the option value
|
| 900 |
+
*/
|
| 901 |
+
function bbp_admin_setting_callback_search_slug() {
|
| 902 |
+
?>
|
| 903 |
+
|
| 904 |
+
<input name="_bbp_search_slug" type="text" id="_bbp_search_slug" class="regular-text code" value="<?php bbp_form_option( '_bbp_search_slug', 'search', true ); ?>"<?php bbp_maybe_admin_setting_disabled( '_bbp_search_slug' ); ?> />
|
| 905 |
+
|
| 906 |
+
<?php
|
| 907 |
+
// Slug Check
|
| 908 |
+
bbp_form_slug_conflict_check( '_bbp_search_slug', 'search' );
|
| 909 |
+
}
|
| 910 |
+
|
| 911 |
/** BuddyPress ****************************************************************/
|
| 912 |
|
| 913 |
/**
|
includes/admin/tools.php
CHANGED
|
@@ -161,17 +161,18 @@ function bbp_admin_repair_list() {
|
|
| 161 |
5 => array( 'bbp-sync-forum-meta', __( 'Recalculate the parent forum for each post', 'bbpress' ), 'bbp_admin_repair_forum_meta' ),
|
| 162 |
10 => array( 'bbp-sync-forum-visibility', __( 'Recalculate private and hidden forums', 'bbpress' ), 'bbp_admin_repair_forum_visibility' ),
|
| 163 |
15 => array( 'bbp-sync-all-topics-forums', __( 'Recalculate last activity in each topic and forum', 'bbpress' ), 'bbp_admin_repair_freshness' ),
|
| 164 |
-
20 => array( 'bbp-
|
| 165 |
-
25 => array( 'bbp-
|
| 166 |
-
30 => array( 'bbp-forum-
|
| 167 |
-
35 => array( 'bbp-
|
| 168 |
-
40 => array( 'bbp-topic-
|
| 169 |
-
45 => array( 'bbp-topic-
|
| 170 |
-
50 => array( 'bbp-
|
| 171 |
-
55 => array( 'bbp-user-topics', __( 'Count
|
| 172 |
-
60 => array( 'bbp-user-
|
| 173 |
-
65 => array( 'bbp-user-
|
| 174 |
-
70 => array( 'bbp-user-
|
|
|
|
| 175 |
);
|
| 176 |
ksort( $repair_list );
|
| 177 |
|
|
@@ -304,10 +305,12 @@ function bbp_admin_repair_group_forum_relationship() {
|
|
| 304 |
$statement = __( 'Repairing BuddyPress group-forum relationships… %s', 'bbpress' );
|
| 305 |
$g_count = 0;
|
| 306 |
$f_count = 0;
|
|
|
|
| 307 |
|
| 308 |
// Copy the BuddyPress filter here, incase BuddyPress is not active
|
| 309 |
-
$prefix
|
| 310 |
-
$
|
|
|
|
| 311 |
|
| 312 |
// Get the converted forum IDs
|
| 313 |
$forum_ids = $wpdb->query( "SELECT `forum`.`ID`, `forummeta`.`meta_value`
|
|
@@ -333,17 +336,45 @@ function bbp_admin_repair_group_forum_relationship() {
|
|
| 333 |
continue;
|
| 334 |
|
| 335 |
// Attempt to update group meta
|
| 336 |
-
$updated = $wpdb->query( "UPDATE `{$
|
| 337 |
|
| 338 |
// Bump the count
|
| 339 |
if ( !empty( $updated ) && ! is_wp_error( $updated ) ) {
|
| 340 |
++$g_count;
|
| 341 |
}
|
| 342 |
|
| 343 |
-
// Update group
|
| 344 |
-
$group_id = (int) $wpdb->get_var( "SELECT `group_id` FROM `{$
|
| 345 |
if ( !empty( $group_id ) ) {
|
|
|
|
|
|
|
| 346 |
update_post_meta( $group_forums->ID, '_bbp_group_ids', array( $group_id ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 347 |
++$f_count;
|
| 348 |
}
|
| 349 |
}
|
|
@@ -380,7 +411,7 @@ function bbp_admin_repair_group_forum_relationship() {
|
|
| 380 |
update_option( '_bbp_group_forums_root_id', $posts[0]->ID );
|
| 381 |
}
|
| 382 |
|
| 383 |
-
// Remove bbPress 1.1 roles (BuddyPress)
|
| 384 |
remove_role( 'member' );
|
| 385 |
remove_role( 'inactive' );
|
| 386 |
remove_role( 'blocked' );
|
|
@@ -388,7 +419,7 @@ function bbp_admin_repair_group_forum_relationship() {
|
|
| 388 |
remove_role( 'keymaster' );
|
| 389 |
|
| 390 |
// Complete results
|
| 391 |
-
$result = sprintf( __( 'Complete! %s groups updated; %s forums updated.', 'bbpress' ), bbp_number_format( $g_count ), bbp_number_format( $f_count ) );
|
| 392 |
return array( 0, sprintf( $statement, $result ) );
|
| 393 |
}
|
| 394 |
|
|
@@ -704,7 +735,7 @@ function bbp_admin_repair_user_roles() {
|
|
| 704 |
|
| 705 |
// If no role map exists, give the default forum role (bbp-participant)
|
| 706 |
$new_role = isset( $role_map[$role] ) ? $role_map[$role] : $default_role;
|
| 707 |
-
|
| 708 |
// Get users of this site, limited to 1000
|
| 709 |
while ( $users = get_users( array(
|
| 710 |
'role' => $role,
|
|
@@ -835,6 +866,63 @@ function bbp_admin_repair_freshness() {
|
|
| 835 |
return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
|
| 836 |
}
|
| 837 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 838 |
/**
|
| 839 |
* Recaches the private and hidden forums
|
| 840 |
*
|
|
@@ -1091,7 +1179,10 @@ function bbp_admin_reset_handler() {
|
|
| 1091 |
|
| 1092 |
/** Topic Tags ********************************************************/
|
| 1093 |
|
| 1094 |
-
|
|
|
|
|
|
|
|
|
|
| 1095 |
|
| 1096 |
/** User Meta *********************************************************/
|
| 1097 |
|
| 161 |
5 => array( 'bbp-sync-forum-meta', __( 'Recalculate the parent forum for each post', 'bbpress' ), 'bbp_admin_repair_forum_meta' ),
|
| 162 |
10 => array( 'bbp-sync-forum-visibility', __( 'Recalculate private and hidden forums', 'bbpress' ), 'bbp_admin_repair_forum_visibility' ),
|
| 163 |
15 => array( 'bbp-sync-all-topics-forums', __( 'Recalculate last activity in each topic and forum', 'bbpress' ), 'bbp_admin_repair_freshness' ),
|
| 164 |
+
20 => array( 'bbp-sync-all-topics-sticky', __( 'Recalculate the sticky replationship of each topic', 'bbpress' ), 'bbp_admin_repair_sticky' ),
|
| 165 |
+
25 => array( 'bbp-group-forums', __( 'Repair BuddyPress Group Forum relationships', 'bbpress' ), 'bbp_admin_repair_group_forum_relationship' ),
|
| 166 |
+
30 => array( 'bbp-forum-topics', __( 'Count topics in each forum', 'bbpress' ), 'bbp_admin_repair_forum_topic_count' ),
|
| 167 |
+
35 => array( 'bbp-forum-replies', __( 'Count replies in each forum', 'bbpress' ), 'bbp_admin_repair_forum_reply_count' ),
|
| 168 |
+
40 => array( 'bbp-topic-replies', __( 'Count replies in each topic', 'bbpress' ), 'bbp_admin_repair_topic_reply_count' ),
|
| 169 |
+
45 => array( 'bbp-topic-voices', __( 'Count voices in each topic', 'bbpress' ), 'bbp_admin_repair_topic_voice_count' ),
|
| 170 |
+
50 => array( 'bbp-topic-hidden-replies', __( 'Count spammed & trashed replies in each topic', 'bbpress' ), 'bbp_admin_repair_topic_hidden_reply_count' ),
|
| 171 |
+
55 => array( 'bbp-user-topics', __( 'Count topics for each user', 'bbpress' ), 'bbp_admin_repair_user_topic_count' ),
|
| 172 |
+
60 => array( 'bbp-user-replies', __( 'Count replies for each user', 'bbpress' ), 'bbp_admin_repair_user_reply_count' ),
|
| 173 |
+
65 => array( 'bbp-user-favorites', __( 'Remove trashed topics from user favorites', 'bbpress' ), 'bbp_admin_repair_user_favorites' ),
|
| 174 |
+
70 => array( 'bbp-user-subscriptions', __( 'Remove trashed topics from user subscriptions', 'bbpress' ), 'bbp_admin_repair_user_subscriptions' ),
|
| 175 |
+
75 => array( 'bbp-user-role-map', __( 'Remap existing users to default forum roles', 'bbpress' ), 'bbp_admin_repair_user_roles' )
|
| 176 |
);
|
| 177 |
ksort( $repair_list );
|
| 178 |
|
| 305 |
$statement = __( 'Repairing BuddyPress group-forum relationships… %s', 'bbpress' );
|
| 306 |
$g_count = 0;
|
| 307 |
$f_count = 0;
|
| 308 |
+
$s_count = 0;
|
| 309 |
|
| 310 |
// Copy the BuddyPress filter here, incase BuddyPress is not active
|
| 311 |
+
$prefix = apply_filters( 'bp_core_get_table_prefix', $wpdb->base_prefix );
|
| 312 |
+
$groups_table = $prefix . 'bp_groups';
|
| 313 |
+
$groups_meta_table = $prefix . 'bp_groups_groupmeta';
|
| 314 |
|
| 315 |
// Get the converted forum IDs
|
| 316 |
$forum_ids = $wpdb->query( "SELECT `forum`.`ID`, `forummeta`.`meta_value`
|
| 336 |
continue;
|
| 337 |
|
| 338 |
// Attempt to update group meta
|
| 339 |
+
$updated = $wpdb->query( "UPDATE `{$groups_meta_table}` SET `meta_value` = '{$group_forums->ID}' WHERE `meta_key` = 'forum_id' AND `meta_value` = '{$group_forums->meta_value}';" );
|
| 340 |
|
| 341 |
// Bump the count
|
| 342 |
if ( !empty( $updated ) && ! is_wp_error( $updated ) ) {
|
| 343 |
++$g_count;
|
| 344 |
}
|
| 345 |
|
| 346 |
+
// Update group to forum relationship data
|
| 347 |
+
$group_id = (int) $wpdb->get_var( "SELECT `group_id` FROM `{$groups_meta_table}` WHERE `meta_key` = 'forum_id' AND `meta_value` = '{$group_forums->ID}';" );
|
| 348 |
if ( !empty( $group_id ) ) {
|
| 349 |
+
|
| 350 |
+
// Update the group to forum meta connection in forums
|
| 351 |
update_post_meta( $group_forums->ID, '_bbp_group_ids', array( $group_id ) );
|
| 352 |
+
|
| 353 |
+
// Get the group status
|
| 354 |
+
$group_status = $wpdb->get_var( "SELECT `status` FROM `{$groups_table}` WHERE `id` = '{$group_id}';" );
|
| 355 |
+
|
| 356 |
+
// Sync up forum visibility based on group status
|
| 357 |
+
switch ( $group_status ) {
|
| 358 |
+
|
| 359 |
+
// Public groups have public forums
|
| 360 |
+
case 'public' :
|
| 361 |
+
bbp_publicize_forum( $group_forums->ID );
|
| 362 |
+
|
| 363 |
+
// Bump the count for output later
|
| 364 |
+
++$s_count;
|
| 365 |
+
break;
|
| 366 |
+
|
| 367 |
+
// Private/hidden groups have hidden forums
|
| 368 |
+
case 'private' :
|
| 369 |
+
case 'hidden' :
|
| 370 |
+
bbp_hide_forum( $group_forums->ID );
|
| 371 |
+
|
| 372 |
+
// Bump the count for output later
|
| 373 |
+
++$s_count;
|
| 374 |
+
break;
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
// Bump the count for output later
|
| 378 |
++$f_count;
|
| 379 |
}
|
| 380 |
}
|
| 411 |
update_option( '_bbp_group_forums_root_id', $posts[0]->ID );
|
| 412 |
}
|
| 413 |
|
| 414 |
+
// Remove old bbPress 1.1 roles (BuddyPress)
|
| 415 |
remove_role( 'member' );
|
| 416 |
remove_role( 'inactive' );
|
| 417 |
remove_role( 'blocked' );
|
| 419 |
remove_role( 'keymaster' );
|
| 420 |
|
| 421 |
// Complete results
|
| 422 |
+
$result = sprintf( __( 'Complete! %s groups updated; %s forums updated; %s forum statuses synced.', 'bbpress' ), bbp_number_format( $g_count ), bbp_number_format( $f_count ), bbp_number_format( $s_count ) );
|
| 423 |
return array( 0, sprintf( $statement, $result ) );
|
| 424 |
}
|
| 425 |
|
| 735 |
|
| 736 |
// If no role map exists, give the default forum role (bbp-participant)
|
| 737 |
$new_role = isset( $role_map[$role] ) ? $role_map[$role] : $default_role;
|
| 738 |
+
|
| 739 |
// Get users of this site, limited to 1000
|
| 740 |
while ( $users = get_users( array(
|
| 741 |
'role' => $role,
|
| 866 |
return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
|
| 867 |
}
|
| 868 |
|
| 869 |
+
/**
|
| 870 |
+
* Repairs the relationship of sticky topics to the actual parent forum
|
| 871 |
+
*
|
| 872 |
+
* @since bbPress (r4695)
|
| 873 |
+
*
|
| 874 |
+
* @uses wpdb::get_col() To run our recount sql queries
|
| 875 |
+
* @uses is_wp_error() To check if the executed query returned {@link WP_Error}
|
| 876 |
+
* @return array An array of the status code and the message
|
| 877 |
+
*/
|
| 878 |
+
function bbp_admin_repair_sticky() {
|
| 879 |
+
global $wpdb;
|
| 880 |
+
|
| 881 |
+
$statement = __( 'Repairing the sticky topic to the parent forum relationships… %s', 'bbpress' );
|
| 882 |
+
$result = __( 'Failed!', 'bbpress' );
|
| 883 |
+
$forums = $wpdb->get_col( "SELECT ID FROM `{$wpdb->posts}` WHERE `post_type` = 'forum';" );
|
| 884 |
+
|
| 885 |
+
// Bail if no forums found
|
| 886 |
+
if ( empty( $forums ) || is_wp_error( $forums ) )
|
| 887 |
+
return array( 1, sprintf( $statement, $result ) );
|
| 888 |
+
|
| 889 |
+
// Loop through forums and get their sticky topics
|
| 890 |
+
foreach ( $forums as $forum ) {
|
| 891 |
+
$forum_stickies[$forum] = get_post_meta( $forum, '_bbp_sticky_topics', true );
|
| 892 |
+
}
|
| 893 |
+
|
| 894 |
+
// Cleanup
|
| 895 |
+
unset( $forums, $forum );
|
| 896 |
+
|
| 897 |
+
// Loop through each forum with sticky topics
|
| 898 |
+
foreach ( $forum_stickies as $forum_id => $stickies ) {
|
| 899 |
+
|
| 900 |
+
// Skip if no stickies
|
| 901 |
+
if ( empty( $stickies ) ) {
|
| 902 |
+
continue;
|
| 903 |
+
}
|
| 904 |
+
|
| 905 |
+
// Loop through each sticky topic
|
| 906 |
+
foreach ( $stickies as $id => $topic_id ) {
|
| 907 |
+
|
| 908 |
+
// If the topic is not a super sticky, and the forum ID does not
|
| 909 |
+
// match the topic's forum ID, unset the forum's sticky meta.
|
| 910 |
+
if ( ! bbp_is_topic_super_sticky( $topic_id ) && $forum_id != bbp_get_topic_forum_id( $topic_id ) ) {
|
| 911 |
+
unset( $forum_stickies[$forum_id][$id] );
|
| 912 |
+
}
|
| 913 |
+
}
|
| 914 |
+
|
| 915 |
+
// Get sticky topic ID's, or use empty string
|
| 916 |
+
$stickers = empty( $forum_stickies[$forum_id] ) ? '' : array_values( $forum_stickies[$forum_id] );
|
| 917 |
+
|
| 918 |
+
// Update the forum's sticky topics meta
|
| 919 |
+
update_post_meta( $forum_id, '_bbp_sticky_topics', $stickers );
|
| 920 |
+
}
|
| 921 |
+
|
| 922 |
+
// Complete results
|
| 923 |
+
return array( 0, sprintf( $statement, __( 'Complete!', 'bbpress' ) ) );
|
| 924 |
+
}
|
| 925 |
+
|
| 926 |
/**
|
| 927 |
* Recaches the private and hidden forums
|
| 928 |
*
|
| 1179 |
|
| 1180 |
/** Topic Tags ********************************************************/
|
| 1181 |
|
| 1182 |
+
$statement = __( 'Deleting Topic Tags… %s', 'bbpress' );
|
| 1183 |
+
$sql_delete = "DELETE a,b,c FROM `{$wpdb->terms}` AS a LEFT JOIN `{$wpdb->term_taxonomy}` AS c ON a.term_id = c.term_id LEFT JOIN `{$wpdb->term_relationships}` AS b ON b.term_taxonomy_id = c.term_taxonomy_id WHERE c.taxonomy = 'topic-tag';";
|
| 1184 |
+
$result = is_wp_error( $wpdb->query( $sql_delete ) ) ? $failed : $success;
|
| 1185 |
+
$messages[] = sprintf( $statement, $result );
|
| 1186 |
|
| 1187 |
/** User Meta *********************************************************/
|
| 1188 |
|
includes/admin/users.php
CHANGED
|
@@ -139,13 +139,9 @@ class BBP_Users_Admin {
|
|
| 139 |
<select name="bbp-new-role" id="bbp-new-role" style="display:inline-block; float:none;">
|
| 140 |
<option value=''><?php _e( 'Change forum role to…', 'bbpress' ) ?></option>
|
| 141 |
<?php foreach ( $dynamic_roles as $role => $details ) : ?>
|
| 142 |
-
|
| 143 |
<option value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option>
|
| 144 |
-
|
| 145 |
<?php endforeach; ?>
|
| 146 |
-
</select
|
| 147 |
-
|
| 148 |
-
<?php submit_button( __( 'Change', 'bbpress' ), 'secondary', 'bbp-change-role', false );
|
| 149 |
}
|
| 150 |
|
| 151 |
/**
|
| 139 |
<select name="bbp-new-role" id="bbp-new-role" style="display:inline-block; float:none;">
|
| 140 |
<option value=''><?php _e( 'Change forum role to…', 'bbpress' ) ?></option>
|
| 141 |
<?php foreach ( $dynamic_roles as $role => $details ) : ?>
|
|
|
|
| 142 |
<option value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option>
|
|
|
|
| 143 |
<?php endforeach; ?>
|
| 144 |
+
</select><?php submit_button( __( 'Change', 'bbpress' ), 'secondary', 'bbp-change-role', false );
|
|
|
|
|
|
|
| 145 |
}
|
| 146 |
|
| 147 |
/**
|
includes/common/ajax.php
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* bbPress Common AJAX Functions
|
| 5 |
+
*
|
| 6 |
+
* Common AJAX functions are ones that are used to setup and/or use during
|
| 7 |
+
* bbPress specific, theme-side AJAX requests.
|
| 8 |
+
*
|
| 9 |
+
* @package bbPress
|
| 10 |
+
* @subpackage Ajax
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
// Exit if accessed directly
|
| 14 |
+
if ( !defined( 'ABSPATH' ) ) exit;
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* Output the URL to use for theme-side bbPress AJAX requests
|
| 18 |
+
*
|
| 19 |
+
* @since bbPress (r4543)
|
| 20 |
+
*
|
| 21 |
+
* @uses bbp_get_ajax_url() To get the URL to use for AJAX requests
|
| 22 |
+
*/
|
| 23 |
+
function bbp_ajax_url() {
|
| 24 |
+
echo bbp_get_ajax_url();
|
| 25 |
+
}
|
| 26 |
+
/**
|
| 27 |
+
* Return the URL to use for theme-side bbPress AJAX requests
|
| 28 |
+
*
|
| 29 |
+
* @since bbPress (r4543)
|
| 30 |
+
*
|
| 31 |
+
* @global WP $wp
|
| 32 |
+
* @return string
|
| 33 |
+
*/
|
| 34 |
+
function bbp_get_ajax_url() {
|
| 35 |
+
global $wp;
|
| 36 |
+
|
| 37 |
+
$base_url = home_url( trailingslashit( $wp->request ), ( is_ssl() ? 'https' : 'http' ) );
|
| 38 |
+
$ajaxurl = add_query_arg( array( 'bbp-ajax' => 'true' ), $base_url );
|
| 39 |
+
|
| 40 |
+
return apply_filters( 'bbp_get_ajax_url', $ajaxurl );
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* Is this a bbPress AJAX request?
|
| 45 |
+
*
|
| 46 |
+
* @since bbPress (r4543)
|
| 47 |
+
*
|
| 48 |
+
* @return bool Looking for bbp-ajax
|
| 49 |
+
*/
|
| 50 |
+
function bbp_is_ajax() {
|
| 51 |
+
return (bool) ( isset( $_GET['bbp-ajax'] ) && ! empty( $_REQUEST['action'] ) );
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* Hooked to the 'bbp_template_redirect' action, this is bbPress's custom
|
| 56 |
+
* theme-side ajax handler.
|
| 57 |
+
*
|
| 58 |
+
* @since bbPress (r4543)
|
| 59 |
+
*
|
| 60 |
+
* @return If not a bbPress ajax request
|
| 61 |
+
*/
|
| 62 |
+
function bbp_do_ajax() {
|
| 63 |
+
|
| 64 |
+
// Bail if not an ajax request
|
| 65 |
+
if ( ! bbp_is_ajax() )
|
| 66 |
+
return;
|
| 67 |
+
|
| 68 |
+
// Set WordPress core ajax constant
|
| 69 |
+
define( 'DOING_AJAX', true );
|
| 70 |
+
|
| 71 |
+
// Set the header content type
|
| 72 |
+
@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
|
| 73 |
+
|
| 74 |
+
// Disable content sniffing in browsers that support it
|
| 75 |
+
send_nosniff_header();
|
| 76 |
+
|
| 77 |
+
// Perform custom bbPress ajax
|
| 78 |
+
do_action( 'bbp_ajax_' . $_REQUEST['action'] );
|
| 79 |
+
|
| 80 |
+
// All done
|
| 81 |
+
die( '0' );
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* Helper method to return JSON response for the ajax calls
|
| 86 |
+
*
|
| 87 |
+
* @since bbPress (r4542)
|
| 88 |
+
*
|
| 89 |
+
* @param bool $success
|
| 90 |
+
* @param string $content
|
| 91 |
+
* @param array $extras
|
| 92 |
+
*/
|
| 93 |
+
function bbp_ajax_response( $success = false, $content = '', $status = -1, $extras = array() ) {
|
| 94 |
+
|
| 95 |
+
// Set status to 200 if setting response as successful
|
| 96 |
+
if ( ( true === $success ) && ( -1 === $status ) )
|
| 97 |
+
$status = 200;
|
| 98 |
+
|
| 99 |
+
// Setup the response array
|
| 100 |
+
$response = array(
|
| 101 |
+
'success' => $success,
|
| 102 |
+
'status' => $status,
|
| 103 |
+
'content' => $content
|
| 104 |
+
);
|
| 105 |
+
|
| 106 |
+
// Merge extra response parameters in
|
| 107 |
+
if ( !empty( $extras ) && is_array( $extras ) ) {
|
| 108 |
+
$response = array_merge( $response, $extras );
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
// Send back the JSON
|
| 112 |
+
@header( 'Content-type: application/json' );
|
| 113 |
+
echo json_encode( $response );
|
| 114 |
+
die();
|
| 115 |
+
}
|
includes/common/classes.php
CHANGED
|
@@ -173,133 +173,6 @@ class BBP_Component {
|
|
| 173 |
endif; // BBP_Component
|
| 174 |
|
| 175 |
if ( class_exists( 'Walker' ) ) :
|
| 176 |
-
/**
|
| 177 |
-
* Create HTML list of forums.
|
| 178 |
-
*
|
| 179 |
-
* @package bbPress
|
| 180 |
-
* @subpackage Classes
|
| 181 |
-
*
|
| 182 |
-
* @since bbPress (r2514)
|
| 183 |
-
*
|
| 184 |
-
* @uses Walker
|
| 185 |
-
*/
|
| 186 |
-
class BBP_Walker_Forum extends Walker {
|
| 187 |
-
|
| 188 |
-
/**
|
| 189 |
-
* @see Walker::$tree_type
|
| 190 |
-
*
|
| 191 |
-
* @since bbPress (r2514)
|
| 192 |
-
*
|
| 193 |
-
* @var string
|
| 194 |
-
*/
|
| 195 |
-
var $tree_type;
|
| 196 |
-
|
| 197 |
-
/**
|
| 198 |
-
* @see Walker::$db_fields
|
| 199 |
-
*
|
| 200 |
-
* @since bbPress (r2514)
|
| 201 |
-
*
|
| 202 |
-
* @var array
|
| 203 |
-
*/
|
| 204 |
-
var $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
|
| 205 |
-
|
| 206 |
-
/** Methods ***************************************************************/
|
| 207 |
-
|
| 208 |
-
/**
|
| 209 |
-
* Set the tree_type
|
| 210 |
-
*
|
| 211 |
-
* @since bbPress (r2514)
|
| 212 |
-
*/
|
| 213 |
-
public function __construct() {
|
| 214 |
-
$this->tree_type = bbp_get_forum_post_type();
|
| 215 |
-
}
|
| 216 |
-
|
| 217 |
-
/**
|
| 218 |
-
* @see Walker::start_lvl()
|
| 219 |
-
*
|
| 220 |
-
* @since bbPress (r2514)
|
| 221 |
-
*
|
| 222 |
-
* @param string $output Passed by reference. Used to append additional
|
| 223 |
-
* content.
|
| 224 |
-
* @param int $depth Depth of page. Used for padding.
|
| 225 |
-
*/
|
| 226 |
-
public function start_lvl( &$output, $depth ) {
|
| 227 |
-
$indent = str_repeat( "\t", $depth );
|
| 228 |
-
$output .= "\n$indent<ul class='children'>\n";
|
| 229 |
-
}
|
| 230 |
-
|
| 231 |
-
/**
|
| 232 |
-
* @see Walker::end_lvl()
|
| 233 |
-
*
|
| 234 |
-
* @since bbPress (r2514)
|
| 235 |
-
*
|
| 236 |
-
* @param string $output Passed by reference. Used to append additional
|
| 237 |
-
* content.
|
| 238 |
-
* @param int $depth Depth of page. Used for padding.
|
| 239 |
-
*/
|
| 240 |
-
public function end_lvl( &$output, $depth ) {
|
| 241 |
-
$indent = str_repeat( "\t", $depth );
|
| 242 |
-
$output .= "$indent</ul>\n";
|
| 243 |
-
}
|
| 244 |
-
|
| 245 |
-
/**
|
| 246 |
-
* @see Walker::start_el()
|
| 247 |
-
*
|
| 248 |
-
* @since bbPress (r2514)
|
| 249 |
-
*
|
| 250 |
-
* @param string $output Passed by reference. Used to append additional
|
| 251 |
-
* content.
|
| 252 |
-
* @param object $forum Page data object.
|
| 253 |
-
* @param int $depth Depth of page. Used for padding.
|
| 254 |
-
* @param int $current_forum Page ID.
|
| 255 |
-
* @param array $args
|
| 256 |
-
*/
|
| 257 |
-
public function start_el( &$output, $forum, $depth, $args, $current_forum ) {
|
| 258 |
-
|
| 259 |
-
$indent = $depth ? str_repeat( "\t", $depth ) : '';
|
| 260 |
-
|
| 261 |
-
extract( $args, EXTR_SKIP );
|
| 262 |
-
$css_class = array( 'bbp-forum-item', 'bbp-forum-item-' . $forum->ID );
|
| 263 |
-
|
| 264 |
-
if ( !empty( $current_forum ) ) {
|
| 265 |
-
$_current_page = bbp_get_forum( $current_forum );
|
| 266 |
-
|
| 267 |
-
if ( isset( $_current_page->ancestors ) && in_array( $forum->ID, (array) $_current_page->ancestors ) )
|
| 268 |
-
$css_class[] = 'bbp-current-forum-ancestor';
|
| 269 |
-
|
| 270 |
-
if ( $forum->ID == $current_forum )
|
| 271 |
-
$css_class[] = 'bbp_current_forum_item';
|
| 272 |
-
elseif ( $_current_page && $forum->ID == $_current_page->post_parent )
|
| 273 |
-
$css_class[] = 'bbp-current-forum-parent';
|
| 274 |
-
|
| 275 |
-
} elseif ( $forum->ID == get_option( 'page_for_posts' ) ) {
|
| 276 |
-
$css_class[] = 'bbp-current-forum-parent';
|
| 277 |
-
}
|
| 278 |
-
|
| 279 |
-
$css_class = implode( ' ', apply_filters( 'bbp_forum_css_class', $css_class, $forum ) );
|
| 280 |
-
$output .= $indent . '<li class="' . $css_class . '"><a href="' . bbp_get_forum_permalink( $forum->ID ) . '" title="' . esc_attr( wp_strip_all_tags( apply_filters( 'the_title', $forum->post_title, $forum->ID ) ) ) . '">' . $link_before . apply_filters( 'the_title', $forum->post_title, $forum->ID ) . $link_after . '</a>';
|
| 281 |
-
|
| 282 |
-
if ( !empty( $show_date ) ) {
|
| 283 |
-
$time = ( 'modified' == $show_date ) ? $forum->post_modified : $time = $forum->post_date;
|
| 284 |
-
$output .= " " . mysql2date( $date_format, $time );
|
| 285 |
-
}
|
| 286 |
-
}
|
| 287 |
-
|
| 288 |
-
/**
|
| 289 |
-
* @see Walker::end_el()
|
| 290 |
-
*
|
| 291 |
-
* @since bbPress (r2514)
|
| 292 |
-
*
|
| 293 |
-
* @param string $output Passed by reference. Used to append additional
|
| 294 |
-
* content.
|
| 295 |
-
* @param object $forum Page data object. Not used.
|
| 296 |
-
* @param int $depth Depth of page. Not Used.
|
| 297 |
-
*/
|
| 298 |
-
public function end_el( &$output, $forum, $depth ) {
|
| 299 |
-
$output .= "</li>\n";
|
| 300 |
-
}
|
| 301 |
-
}
|
| 302 |
-
|
| 303 |
/**
|
| 304 |
* Create HTML dropdown list of bbPress forums/topics.
|
| 305 |
*
|
| 173 |
endif; // BBP_Component
|
| 174 |
|
| 175 |
if ( class_exists( 'Walker' ) ) :
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
/**
|
| 177 |
* Create HTML dropdown list of bbPress forums/topics.
|
| 178 |
*
|
includes/common/formatting.php
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* bbPress Formatting
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Formatting
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
// Exit if accessed directly
|
| 11 |
+
if ( !defined( 'ABSPATH' ) ) exit;
|
| 12 |
+
|
| 13 |
+
/** Kses **********************************************************************/
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* Custom allowed tags for forum topics and replies
|
| 17 |
+
*
|
| 18 |
+
* Allows all users to post links, quotes, code, formatting, lists, and images
|
| 19 |
+
*
|
| 20 |
+
* @since bbPress (r4603)
|
| 21 |
+
*
|
| 22 |
+
* @return array Associative array of allowed tags and attributes
|
| 23 |
+
*/
|
| 24 |
+
function bbp_kses_allowed_tags() {
|
| 25 |
+
return apply_filters( 'bbp_kses_allowed_tags', array(
|
| 26 |
+
|
| 27 |
+
// Links
|
| 28 |
+
'a' => array(
|
| 29 |
+
'href' => array(),
|
| 30 |
+
'title' => array(),
|
| 31 |
+
'rel' => array()
|
| 32 |
+
),
|
| 33 |
+
|
| 34 |
+
// Quotes
|
| 35 |
+
'blockquote' => array(
|
| 36 |
+
'cite' => array()
|
| 37 |
+
),
|
| 38 |
+
|
| 39 |
+
// Code
|
| 40 |
+
'code' => array(),
|
| 41 |
+
'pre' => array(),
|
| 42 |
+
|
| 43 |
+
// Formatting
|
| 44 |
+
'em' => array(),
|
| 45 |
+
'strong' => array(),
|
| 46 |
+
'del' => array(
|
| 47 |
+
'datetime' => true,
|
| 48 |
+
),
|
| 49 |
+
|
| 50 |
+
// Lists
|
| 51 |
+
'ul' => array(),
|
| 52 |
+
'ol' => array(
|
| 53 |
+
'start' => true,
|
| 54 |
+
),
|
| 55 |
+
'li' => array(),
|
| 56 |
+
|
| 57 |
+
// Images
|
| 58 |
+
'img' => array(
|
| 59 |
+
'src' => true,
|
| 60 |
+
'border' => true,
|
| 61 |
+
'alt' => true,
|
| 62 |
+
'height' => true,
|
| 63 |
+
'width' => true,
|
| 64 |
+
)
|
| 65 |
+
) );
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* Custom kses filter for forum topics and replies, for filtering incoming data
|
| 70 |
+
*
|
| 71 |
+
* @since bbPress (r4603)
|
| 72 |
+
*
|
| 73 |
+
* @param string $data Content to filter, expected to be escaped with slashes
|
| 74 |
+
* @return string Filtered content
|
| 75 |
+
*/
|
| 76 |
+
function bbp_filter_kses( $data = '' ) {
|
| 77 |
+
return addslashes( wp_kses( stripslashes( $data ), bbp_kses_allowed_tags() ) );
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
/**
|
| 81 |
+
* Custom kses filter for forum topics and replies, for raw data
|
| 82 |
+
*
|
| 83 |
+
* @since bbPress (r4603)
|
| 84 |
+
*
|
| 85 |
+
* @param string $data Content to filter, expected to not be escaped
|
| 86 |
+
* @return string Filtered content
|
| 87 |
+
*/
|
| 88 |
+
function bbp_kses_data( $data = '' ) {
|
| 89 |
+
return wp_kses( $data , bbp_kses_allowed_tags() );
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
/** Formatting ****************************************************************/
|
| 93 |
+
|
| 94 |
+
/**
|
| 95 |
+
* Filter the topic or reply content and output code and pre tags
|
| 96 |
+
*
|
| 97 |
+
* @since bbPress (r4641)
|
| 98 |
+
*
|
| 99 |
+
* @param string $content Topic and reply content
|
| 100 |
+
* @return string Partially encodedd content
|
| 101 |
+
*/
|
| 102 |
+
function bbp_code_trick( $content = '' ) {
|
| 103 |
+
$content = str_replace( array( "\r\n", "\r" ), "\n", $content );
|
| 104 |
+
$content = preg_replace_callback( "|(`)(.*?)`|", 'bbp_encode_callback', $content );
|
| 105 |
+
$content = preg_replace_callback( "!(^|\n)`(.*?)`!s", 'bbp_encode_callback', $content );
|
| 106 |
+
|
| 107 |
+
return $content;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
/**
|
| 111 |
+
* When editing a topic or reply, reverse the code trick so the textarea
|
| 112 |
+
* contains the correct editable content.
|
| 113 |
+
*
|
| 114 |
+
* @since bbPress (r4641)
|
| 115 |
+
*
|
| 116 |
+
* @param string $content Topic and reply content
|
| 117 |
+
* @return string Partially encodedd content
|
| 118 |
+
*/
|
| 119 |
+
function bbp_code_trick_reverse( $content = '' ) {
|
| 120 |
+
|
| 121 |
+
// Setup variables
|
| 122 |
+
$openers = array( '<p>', '<br />' );
|
| 123 |
+
$content = preg_replace_callback( "!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s", 'bbp_decode_callback', $content );
|
| 124 |
+
|
| 125 |
+
// Do the do
|
| 126 |
+
$content = str_replace( $openers, '', $content );
|
| 127 |
+
$content = str_replace( '</p>', "\n", $content );
|
| 128 |
+
$content = str_replace( '<coded_br />', '<br />', $content );
|
| 129 |
+
$content = str_replace( '<coded_p>', '<p>', $content );
|
| 130 |
+
$content = str_replace( '</coded_p>', '</p>', $content );
|
| 131 |
+
|
| 132 |
+
return $content;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
/**
|
| 136 |
+
* Filter the content and encode any bad HTML tags
|
| 137 |
+
*
|
| 138 |
+
* @since bbPress (r4641)
|
| 139 |
+
*
|
| 140 |
+
* @param string $content Topic and reply content
|
| 141 |
+
* @return string Partially encodedd content
|
| 142 |
+
*/
|
| 143 |
+
function bbp_encode_bad( $content = '' ) {
|
| 144 |
+
|
| 145 |
+
// Setup variables
|
| 146 |
+
$content = _wp_specialchars( $content, ENT_NOQUOTES );
|
| 147 |
+
$content = preg_split( '@(`[^`]*`)@m', $content, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE );
|
| 148 |
+
$allowed = bbp_kses_allowed_tags();
|
| 149 |
+
$empty = array(
|
| 150 |
+
'br' => true,
|
| 151 |
+
'hr' => true,
|
| 152 |
+
'img' => true,
|
| 153 |
+
'input' => true,
|
| 154 |
+
'param' => true,
|
| 155 |
+
'area' => true,
|
| 156 |
+
'col' => true,
|
| 157 |
+
'embed' => true
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
// Add 'p' and 'br' tags to allowed array, so they are not encoded
|
| 161 |
+
$allowed['p'] = array();
|
| 162 |
+
$allowed['br'] = array();
|
| 163 |
+
|
| 164 |
+
// Loop through allowed tags and compare for empty and normal tags
|
| 165 |
+
foreach ( $allowed as $tag => $args ) {
|
| 166 |
+
$preg = $args ? "{$tag}(?:\s.*?)?" : $tag;
|
| 167 |
+
|
| 168 |
+
// Which walker to use based on the tag and argments
|
| 169 |
+
if ( isset( $empty[$tag] ) ) {
|
| 170 |
+
array_walk( $content, 'bbp_encode_empty_callback', $preg );
|
| 171 |
+
} else {
|
| 172 |
+
array_walk( $content, 'bbp_encode_normal_callback', $preg );
|
| 173 |
+
}
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
// Return the joined content array
|
| 177 |
+
return join( '', $content );
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
/** Code Callbacks ************************************************************/
|
| 181 |
+
|
| 182 |
+
/**
|
| 183 |
+
* Callback to encode the tags in topic or reply content
|
| 184 |
+
*
|
| 185 |
+
* @since bbPress (r4641)
|
| 186 |
+
*
|
| 187 |
+
* @param array $matches
|
| 188 |
+
* @return string
|
| 189 |
+
*/
|
| 190 |
+
function bbp_encode_callback( $matches = array() ) {
|
| 191 |
+
$content = trim( $matches[2] );
|
| 192 |
+
$content = htmlspecialchars( $content, ENT_QUOTES );
|
| 193 |
+
$content = str_replace( array( "\r\n", "\r" ), "\n", $content );
|
| 194 |
+
$content = preg_replace( "|\n\n\n+|", "\n\n", $content );
|
| 195 |
+
$content = str_replace( '&amp;', '&', $content );
|
| 196 |
+
$content = str_replace( '&lt;', '<', $content );
|
| 197 |
+
$content = str_replace( '&gt;', '>', $content );
|
| 198 |
+
$content = '<code>' . $content . '</code>';
|
| 199 |
+
|
| 200 |
+
if ( "`" != $matches[1] )
|
| 201 |
+
$content = '<pre>' . $content . '</pre>';
|
| 202 |
+
|
| 203 |
+
return $content;
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
/**
|
| 207 |
+
* Callback to decode the tags in topic or reply content
|
| 208 |
+
*
|
| 209 |
+
* @since bbPress (r4641)
|
| 210 |
+
*
|
| 211 |
+
* @param array $matches
|
| 212 |
+
* @return string
|
| 213 |
+
*/
|
| 214 |
+
function bbp_decode_callback( $matches = array() ) {
|
| 215 |
+
|
| 216 |
+
// Setup variables
|
| 217 |
+
$trans_table = array_flip( get_html_translation_table( HTML_ENTITIES ) );
|
| 218 |
+
$amps = array( '&','&' );
|
| 219 |
+
$content = $matches[2];
|
| 220 |
+
$content = strtr( $content, $trans_table );
|
| 221 |
+
|
| 222 |
+
// Do the do
|
| 223 |
+
$content = str_replace( '<br />', '<coded_br />', $content );
|
| 224 |
+
$content = str_replace( '<p>', '<coded_p>', $content );
|
| 225 |
+
$content = str_replace( '</p>', '</coded_p>', $content );
|
| 226 |
+
$content = str_replace( $amps, '&', $content );
|
| 227 |
+
$content = str_replace( ''', "'", $content );
|
| 228 |
+
|
| 229 |
+
// Return content wrapped in code tags
|
| 230 |
+
return '`' . $content . '`';
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
/**
|
| 234 |
+
* Callback to replace empty HTML tags in a content string
|
| 235 |
+
*
|
| 236 |
+
* @since bbPress (r4641)
|
| 237 |
+
*
|
| 238 |
+
* @internal Used by bbp_encode_bad()
|
| 239 |
+
* @param string $content
|
| 240 |
+
* @param string $key Not used
|
| 241 |
+
* @param string $preg
|
| 242 |
+
*/
|
| 243 |
+
function bbp_encode_empty_callback( &$content = '', $key = '', $preg = '' ) {
|
| 244 |
+
if ( strpos( $content, '`' ) !== 0 ) {
|
| 245 |
+
$content = preg_replace( "|<({$preg})\s*?/*?>|i", '<$1 />', $content );
|
| 246 |
+
}
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
/**
|
| 250 |
+
* Callback to replace normal HTML tags in a content string
|
| 251 |
+
*
|
| 252 |
+
* @since bbPress (r4641)
|
| 253 |
+
*
|
| 254 |
+
* @internal Used by bbp_encode_bad()
|
| 255 |
+
* @param type $content
|
| 256 |
+
* @param type $key
|
| 257 |
+
* @param type $preg
|
| 258 |
+
*/
|
| 259 |
+
function bbp_encode_normal_callback( &$content = '', $key = '', $preg = '') {
|
| 260 |
+
if ( strpos( $content, '`' ) !== 0 ) {
|
| 261 |
+
$content = preg_replace( "|<(/?{$preg})>|i", '<$1>', $content );
|
| 262 |
+
}
|
| 263 |
+
}
|
includes/common/functions.php
CHANGED
|
@@ -88,7 +88,7 @@ function bbp_convert_date( $time, $d = 'U', $translate = false ) {
|
|
| 88 |
* @uses bbp_get_time_since() To get the formatted time
|
| 89 |
*/
|
| 90 |
function bbp_time_since( $older_date, $newer_date = false ) {
|
| 91 |
-
echo bbp_get_time_since( $older_date, $newer_date
|
| 92 |
}
|
| 93 |
/**
|
| 94 |
* Return formatted time to display human readable time difference.
|
|
@@ -105,7 +105,7 @@ function bbp_time_since( $older_date, $newer_date = false ) {
|
|
| 105 |
* @return string Formatted time
|
| 106 |
*/
|
| 107 |
function bbp_get_time_since( $older_date, $newer_date = false ) {
|
| 108 |
-
|
| 109 |
// Setup the strings
|
| 110 |
$unknown_text = apply_filters( 'bbp_core_time_since_unknown_text', __( 'sometime', 'bbpress' ) );
|
| 111 |
$right_now_text = apply_filters( 'bbp_core_time_since_right_now_text', __( 'right now', 'bbpress' ) );
|
|
@@ -228,6 +228,19 @@ function bbp_format_revision_reason( $reason = '' ) {
|
|
| 228 |
|
| 229 |
/** Misc **********************************************************************/
|
| 230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
/**
|
| 232 |
* Append 'view=all' to query string if it's already there from referer
|
| 233 |
*
|
|
@@ -243,10 +256,11 @@ function bbp_format_revision_reason( $reason = '' ) {
|
|
| 243 |
function bbp_add_view_all( $original_link = '', $force = false ) {
|
| 244 |
|
| 245 |
// Are we appending the view=all vars?
|
| 246 |
-
if ( bbp_get_view_all() || !empty( $force ) )
|
| 247 |
$link = add_query_arg( array( 'view' => 'all' ), $original_link );
|
| 248 |
-
else
|
| 249 |
$link = $original_link;
|
|
|
|
| 250 |
|
| 251 |
return apply_filters( 'bbp_add_view_all', $link, $original_link );
|
| 252 |
}
|
|
@@ -429,7 +443,8 @@ function bbp_past_edit_lock( $post_date_gmt ) {
|
|
| 429 |
*/
|
| 430 |
function bbp_get_statistics( $args = '' ) {
|
| 431 |
|
| 432 |
-
|
|
|
|
| 433 |
'count_users' => true,
|
| 434 |
'count_forums' => true,
|
| 435 |
'count_topics' => true,
|
|
@@ -442,18 +457,26 @@ function bbp_get_statistics( $args = '' ) {
|
|
| 442 |
'count_trashed_replies' => true,
|
| 443 |
'count_tags' => true,
|
| 444 |
'count_empty_tags' => true
|
| 445 |
-
);
|
| 446 |
-
|
| 447 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 448 |
|
| 449 |
// Users
|
| 450 |
-
if ( !empty( $count_users ) )
|
| 451 |
$user_count = bbp_get_total_users();
|
|
|
|
| 452 |
|
| 453 |
// Forums
|
| 454 |
-
if ( !empty( $count_forums ) ) {
|
| 455 |
-
$forum_count = wp_count_posts( bbp_get_forum_post_type() );
|
| 456 |
-
$forum_count = $forum_count->publish;
|
| 457 |
}
|
| 458 |
|
| 459 |
// Post statuses
|
|
@@ -463,8 +486,7 @@ function bbp_get_statistics( $args = '' ) {
|
|
| 463 |
$closed = bbp_get_closed_status_id();
|
| 464 |
|
| 465 |
// Topics
|
| 466 |
-
if ( !empty( $count_topics ) ) {
|
| 467 |
-
|
| 468 |
$all_topics = wp_count_posts( bbp_get_topic_post_type() );
|
| 469 |
|
| 470 |
// Published (publish + closed)
|
|
@@ -473,13 +495,13 @@ function bbp_get_statistics( $args = '' ) {
|
|
| 473 |
if ( current_user_can( 'read_private_topics' ) || current_user_can( 'edit_others_topics' ) || current_user_can( 'view_trash' ) ) {
|
| 474 |
|
| 475 |
// Private
|
| 476 |
-
$topics['private'] = ( !empty( $count_private_topics ) && current_user_can( 'read_private_topics' ) ) ? (int) $all_topics->{$private} : 0;
|
| 477 |
|
| 478 |
// Spam
|
| 479 |
-
$topics['spammed'] = ( !empty( $count_spammed_topics ) && current_user_can( 'edit_others_topics' ) ) ? (int) $all_topics->{$spam} : 0;
|
| 480 |
|
| 481 |
// Trash
|
| 482 |
-
$topics['trashed'] = ( !empty( $count_trashed_topics ) && current_user_can( 'view_trash' ) ) ? (int) $all_topics->{$trash} : 0;
|
| 483 |
|
| 484 |
// Total hidden (private + spam + trash)
|
| 485 |
$topic_count_hidden = $topics['private'] + $topics['spammed'] + $topics['trashed'];
|
|
@@ -495,7 +517,7 @@ function bbp_get_statistics( $args = '' ) {
|
|
| 495 |
}
|
| 496 |
|
| 497 |
// Replies
|
| 498 |
-
if ( !empty( $count_replies ) ) {
|
| 499 |
|
| 500 |
$all_replies = wp_count_posts( bbp_get_reply_post_type() );
|
| 501 |
|
|
@@ -505,13 +527,13 @@ function bbp_get_statistics( $args = '' ) {
|
|
| 505 |
if ( current_user_can( 'read_private_replies' ) || current_user_can( 'edit_others_replies' ) || current_user_can( 'view_trash' ) ) {
|
| 506 |
|
| 507 |
// Private
|
| 508 |
-
$replies['private'] = ( !empty( $count_private_replies ) && current_user_can( 'read_private_replies' ) ) ? (int) $all_replies->{$private} : 0;
|
| 509 |
|
| 510 |
// Spam
|
| 511 |
-
$replies['spammed'] = ( !empty( $count_spammed_replies ) && current_user_can( 'edit_others_replies' ) ) ? (int) $all_replies->{$spam} : 0;
|
| 512 |
|
| 513 |
// Trash
|
| 514 |
-
$replies['trashed'] = ( !empty( $count_trashed_replies ) && current_user_can( 'view_trash' ) ) ? (int) $all_replies->{$trash} : 0;
|
| 515 |
|
| 516 |
// Total hidden (private + spam + trash)
|
| 517 |
$reply_count_hidden = $replies['private'] + $replies['spammed'] + $replies['trashed'];
|
|
@@ -528,28 +550,33 @@ function bbp_get_statistics( $args = '' ) {
|
|
| 528 |
}
|
| 529 |
|
| 530 |
// Topic Tags
|
| 531 |
-
if ( !empty( $count_tags ) && bbp_allow_topic_tags() ) {
|
| 532 |
|
| 533 |
// Get the count
|
| 534 |
$topic_tag_count = wp_count_terms( bbp_get_topic_tag_tax_id(), array( 'hide_empty' => true ) );
|
| 535 |
|
| 536 |
// Empty tags
|
| 537 |
-
if ( !empty( $count_empty_tags ) && current_user_can( 'edit_topic_tags' ) ) {
|
| 538 |
$empty_topic_tag_count = wp_count_terms( bbp_get_topic_tag_tax_id() ) - $topic_tag_count;
|
| 539 |
}
|
| 540 |
}
|
| 541 |
|
| 542 |
// Tally the tallies
|
| 543 |
-
$statistics =
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 553 |
|
| 554 |
return apply_filters( 'bbp_get_statistics', $statistics, $args );
|
| 555 |
}
|
|
@@ -582,31 +609,27 @@ function bbp_get_statistics( $args = '' ) {
|
|
| 582 |
*/
|
| 583 |
function bbp_filter_anonymous_post_data( $args = '' ) {
|
| 584 |
|
| 585 |
-
//
|
| 586 |
-
$
|
| 587 |
'bbp_anonymous_name' => !empty( $_POST['bbp_anonymous_name'] ) ? $_POST['bbp_anonymous_name'] : false,
|
| 588 |
'bbp_anonymous_email' => !empty( $_POST['bbp_anonymous_email'] ) ? $_POST['bbp_anonymous_email'] : false,
|
| 589 |
'bbp_anonymous_website' => !empty( $_POST['bbp_anonymous_website'] ) ? $_POST['bbp_anonymous_website'] : false,
|
| 590 |
-
);
|
| 591 |
-
$r = bbp_parse_args( $args, $defaults, 'filter_anonymous_post_data' );
|
| 592 |
-
extract( $r );
|
| 593 |
|
| 594 |
// Filter variables and add errors if necessary
|
| 595 |
-
$bbp_anonymous_name = apply_filters( 'bbp_pre_anonymous_post_author_name', $bbp_anonymous_name );
|
| 596 |
-
if ( empty( $bbp_anonymous_name ) )
|
| 597 |
bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) );
|
| 598 |
|
| 599 |
-
$bbp_anonymous_email = apply_filters( 'bbp_pre_anonymous_post_author_email', $bbp_anonymous_email );
|
| 600 |
-
if ( empty( $bbp_anonymous_email ) )
|
| 601 |
bbp_add_error( 'bbp_anonymous_email', __( '<strong>ERROR</strong>: Invalid email address submitted!', 'bbpress' ) );
|
| 602 |
|
| 603 |
// Website is optional
|
| 604 |
-
$bbp_anonymous_website = apply_filters( 'bbp_pre_anonymous_post_author_website', $bbp_anonymous_website );
|
| 605 |
|
| 606 |
-
if
|
| 607 |
-
|
| 608 |
-
else
|
| 609 |
-
$retval = false;
|
| 610 |
|
| 611 |
// Finally, return sanitized data or false
|
| 612 |
return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $args );
|
|
@@ -630,21 +653,30 @@ function bbp_filter_anonymous_post_data( $args = '' ) {
|
|
| 630 |
* it is found that it is a duplicate
|
| 631 |
* @return bool True if it is not a duplicate, false if it is
|
| 632 |
*/
|
| 633 |
-
function bbp_check_for_duplicate( $post_data ) {
|
| 634 |
|
| 635 |
// No duplicate checks for those who can throttle
|
| 636 |
if ( current_user_can( 'throttle' ) )
|
| 637 |
return true;
|
| 638 |
|
|
|
|
| 639 |
global $wpdb;
|
| 640 |
|
| 641 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 642 |
|
| 643 |
// Check for anonymous post
|
| 644 |
-
if ( empty( $post_author ) && (
|
| 645 |
$clauses = get_meta_sql( array( array(
|
| 646 |
'key' => '_bbp_anonymous_email',
|
| 647 |
-
'value' => $anonymous_data['bbp_anonymous_email']
|
| 648 |
) ), 'post', $wpdb->posts, 'ID' );
|
| 649 |
|
| 650 |
$join = $clauses['join'];
|
|
@@ -655,11 +687,10 @@ function bbp_check_for_duplicate( $post_data ) {
|
|
| 655 |
|
| 656 |
// Simple duplicate check
|
| 657 |
// Expected slashed ($post_type, $post_parent, $post_author, $post_content, $anonymous_data)
|
| 658 |
-
$
|
| 659 |
-
$
|
| 660 |
-
$
|
| 661 |
-
$dupe
|
| 662 |
-
$dupe = apply_filters( 'bbp_check_for_duplicate_query', $dupe, $post_data );
|
| 663 |
|
| 664 |
if ( $wpdb->get_var( $dupe ) ) {
|
| 665 |
do_action( 'bbp_check_for_duplicate_trigger', $post_data );
|
|
@@ -705,7 +736,7 @@ function bbp_check_for_flood( $anonymous_data = false, $author_id = 0 ) {
|
|
| 705 |
if ( !empty( $last_posted ) && time() < $last_posted + $throttle_time ) {
|
| 706 |
return false;
|
| 707 |
}
|
| 708 |
-
|
| 709 |
// User is logged in, so check their last posted time
|
| 710 |
} elseif ( !empty( $author_id ) ) {
|
| 711 |
$author_id = (int) $author_id;
|
|
@@ -737,6 +768,10 @@ function bbp_check_for_flood( $anonymous_data = false, $author_id = 0 ) {
|
|
| 737 |
*/
|
| 738 |
function bbp_check_for_moderation( $anonymous_data = false, $author_id = 0, $title = '', $content = '' ) {
|
| 739 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 740 |
// Bail if super admin is author
|
| 741 |
if ( is_super_admin( $author_id ) )
|
| 742 |
return true;
|
|
@@ -852,6 +887,10 @@ function bbp_check_for_moderation( $anonymous_data = false, $author_id = 0, $tit
|
|
| 852 |
*/
|
| 853 |
function bbp_check_for_blacklist( $anonymous_data = false, $author_id = 0, $title = '', $content = '' ) {
|
| 854 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 855 |
// Bail if super admin is author
|
| 856 |
if ( is_super_admin( $author_id ) )
|
| 857 |
return true;
|
|
@@ -1011,7 +1050,7 @@ function bbp_notify_subscribers( $reply_id = 0, $topic_id = 0, $forum_id = 0, $a
|
|
| 1011 |
$topic_title = strip_tags( bbp_get_topic_title( $topic_id ) );
|
| 1012 |
$reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
|
| 1013 |
$reply_url = bbp_get_reply_url( $reply_id );
|
| 1014 |
-
$blog_name = get_option( 'blogname' );
|
| 1015 |
|
| 1016 |
// Loop through users
|
| 1017 |
foreach ( (array) $user_ids as $user_id ) {
|
|
@@ -1024,7 +1063,7 @@ function bbp_notify_subscribers( $reply_id = 0, $topic_id = 0, $forum_id = 0, $a
|
|
| 1024 |
$message = sprintf( __( '%1$s wrote:
|
| 1025 |
|
| 1026 |
%2$s
|
| 1027 |
-
|
| 1028 |
Post Link: %3$s
|
| 1029 |
|
| 1030 |
-----------
|
|
@@ -1032,7 +1071,7 @@ Post Link: %3$s
|
|
| 1032 |
You are receiving this email because you subscribed to a forum topic.
|
| 1033 |
|
| 1034 |
Login and visit the topic to unsubscribe from these emails.', 'bbpress' ),
|
| 1035 |
-
|
| 1036 |
$reply_author_name,
|
| 1037 |
$reply_content,
|
| 1038 |
$reply_url
|
|
@@ -1406,8 +1445,10 @@ function bbp_get_global_post_field( $field = 'ID', $context = 'edit' ) {
|
|
| 1406 |
*/
|
| 1407 |
function bbp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) {
|
| 1408 |
|
| 1409 |
-
//
|
| 1410 |
-
|
|
|
|
|
|
|
| 1411 |
|
| 1412 |
// Build the currently requested URL
|
| 1413 |
$scheme = is_ssl() ? 'https://' : 'http://';
|
|
@@ -1461,21 +1502,17 @@ function bbp_request_feed_trap( $query_vars = array() ) {
|
|
| 1461 |
// Single forum
|
| 1462 |
if ( isset( $query_vars[bbp_get_forum_post_type()] ) ) {
|
| 1463 |
|
| 1464 |
-
// Get the forum by the path
|
| 1465 |
-
$forum = get_page_by_path( $query_vars[bbp_get_forum_post_type()], OBJECT, bbp_get_forum_post_type() );
|
| 1466 |
-
$forum_id = $forum->ID;
|
| 1467 |
-
|
| 1468 |
// Load up our own query
|
| 1469 |
query_posts( array(
|
| 1470 |
'post_type' => bbp_get_forum_post_type(),
|
| 1471 |
-
'
|
| 1472 |
'feed' => true
|
| 1473 |
) );
|
| 1474 |
|
| 1475 |
// Restrict to specific forum ID
|
| 1476 |
$meta_query = array( array(
|
| 1477 |
'key' => '_bbp_forum_id',
|
| 1478 |
-
'value' =>
|
| 1479 |
'type' => 'numeric',
|
| 1480 |
'compare' => '='
|
| 1481 |
) );
|
|
@@ -1507,7 +1544,7 @@ function bbp_request_feed_trap( $query_vars = array() ) {
|
|
| 1507 |
'author' => 0,
|
| 1508 |
'feed' => true,
|
| 1509 |
'post_type' => bbp_get_topic_post_type(),
|
| 1510 |
-
'post_parent' =>
|
| 1511 |
'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ),
|
| 1512 |
'posts_per_page' => bbp_get_topics_per_rss_page(),
|
| 1513 |
'order' => 'DESC'
|
| 88 |
* @uses bbp_get_time_since() To get the formatted time
|
| 89 |
*/
|
| 90 |
function bbp_time_since( $older_date, $newer_date = false ) {
|
| 91 |
+
echo bbp_get_time_since( $older_date, $newer_date );
|
| 92 |
}
|
| 93 |
/**
|
| 94 |
* Return formatted time to display human readable time difference.
|
| 105 |
* @return string Formatted time
|
| 106 |
*/
|
| 107 |
function bbp_get_time_since( $older_date, $newer_date = false ) {
|
| 108 |
+
|
| 109 |
// Setup the strings
|
| 110 |
$unknown_text = apply_filters( 'bbp_core_time_since_unknown_text', __( 'sometime', 'bbpress' ) );
|
| 111 |
$right_now_text = apply_filters( 'bbp_core_time_since_right_now_text', __( 'right now', 'bbpress' ) );
|
| 228 |
|
| 229 |
/** Misc **********************************************************************/
|
| 230 |
|
| 231 |
+
/**
|
| 232 |
+
* Return the unescaped redirect_to request value
|
| 233 |
+
*
|
| 234 |
+
* @bbPress (r4655)
|
| 235 |
+
*
|
| 236 |
+
* @return string The URL to redirect to, if set
|
| 237 |
+
*/
|
| 238 |
+
function bbp_get_redirect_to() {
|
| 239 |
+
$retval = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
|
| 240 |
+
|
| 241 |
+
return apply_filters( 'bbp_get_redirect_to', $retval );
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
/**
|
| 245 |
* Append 'view=all' to query string if it's already there from referer
|
| 246 |
*
|
| 256 |
function bbp_add_view_all( $original_link = '', $force = false ) {
|
| 257 |
|
| 258 |
// Are we appending the view=all vars?
|
| 259 |
+
if ( bbp_get_view_all() || !empty( $force ) ) {
|
| 260 |
$link = add_query_arg( array( 'view' => 'all' ), $original_link );
|
| 261 |
+
} else {
|
| 262 |
$link = $original_link;
|
| 263 |
+
}
|
| 264 |
|
| 265 |
return apply_filters( 'bbp_add_view_all', $link, $original_link );
|
| 266 |
}
|
| 443 |
*/
|
| 444 |
function bbp_get_statistics( $args = '' ) {
|
| 445 |
|
| 446 |
+
// Parse arguments against default values
|
| 447 |
+
$r = bbp_parse_args( $args, array(
|
| 448 |
'count_users' => true,
|
| 449 |
'count_forums' => true,
|
| 450 |
'count_topics' => true,
|
| 457 |
'count_trashed_replies' => true,
|
| 458 |
'count_tags' => true,
|
| 459 |
'count_empty_tags' => true
|
| 460 |
+
), 'get_statistics' );
|
| 461 |
+
|
| 462 |
+
// Defaults
|
| 463 |
+
$user_count = 0;
|
| 464 |
+
$forum_count = 0;
|
| 465 |
+
$topic_count = 0;
|
| 466 |
+
$topic_count_hidden = 0;
|
| 467 |
+
$reply_count = 0;
|
| 468 |
+
$reply_count_hidden = 0;
|
| 469 |
+
$topic_tag_count = 0;
|
| 470 |
+
$empty_topic_tag_count = 0;
|
| 471 |
|
| 472 |
// Users
|
| 473 |
+
if ( !empty( $r['count_users'] ) ) {
|
| 474 |
$user_count = bbp_get_total_users();
|
| 475 |
+
}
|
| 476 |
|
| 477 |
// Forums
|
| 478 |
+
if ( !empty( $r['count_forums'] ) ) {
|
| 479 |
+
$forum_count = wp_count_posts( bbp_get_forum_post_type() )->publish;
|
|
|
|
| 480 |
}
|
| 481 |
|
| 482 |
// Post statuses
|
| 486 |
$closed = bbp_get_closed_status_id();
|
| 487 |
|
| 488 |
// Topics
|
| 489 |
+
if ( !empty( $r['count_topics'] ) ) {
|
|
|
|
| 490 |
$all_topics = wp_count_posts( bbp_get_topic_post_type() );
|
| 491 |
|
| 492 |
// Published (publish + closed)
|
| 495 |
if ( current_user_can( 'read_private_topics' ) || current_user_can( 'edit_others_topics' ) || current_user_can( 'view_trash' ) ) {
|
| 496 |
|
| 497 |
// Private
|
| 498 |
+
$topics['private'] = ( !empty( $r['count_private_topics'] ) && current_user_can( 'read_private_topics' ) ) ? (int) $all_topics->{$private} : 0;
|
| 499 |
|
| 500 |
// Spam
|
| 501 |
+
$topics['spammed'] = ( !empty( $r['count_spammed_topics'] ) && current_user_can( 'edit_others_topics' ) ) ? (int) $all_topics->{$spam} : 0;
|
| 502 |
|
| 503 |
// Trash
|
| 504 |
+
$topics['trashed'] = ( !empty( $r['count_trashed_topics'] ) && current_user_can( 'view_trash' ) ) ? (int) $all_topics->{$trash} : 0;
|
| 505 |
|
| 506 |
// Total hidden (private + spam + trash)
|
| 507 |
$topic_count_hidden = $topics['private'] + $topics['spammed'] + $topics['trashed'];
|
| 517 |
}
|
| 518 |
|
| 519 |
// Replies
|
| 520 |
+
if ( !empty( $r['count_replies'] ) ) {
|
| 521 |
|
| 522 |
$all_replies = wp_count_posts( bbp_get_reply_post_type() );
|
| 523 |
|
| 527 |
if ( current_user_can( 'read_private_replies' ) || current_user_can( 'edit_others_replies' ) || current_user_can( 'view_trash' ) ) {
|
| 528 |
|
| 529 |
// Private
|
| 530 |
+
$replies['private'] = ( !empty( $r['count_private_replies'] ) && current_user_can( 'read_private_replies' ) ) ? (int) $all_replies->{$private} : 0;
|
| 531 |
|
| 532 |
// Spam
|
| 533 |
+
$replies['spammed'] = ( !empty( $r['count_spammed_replies'] ) && current_user_can( 'edit_others_replies' ) ) ? (int) $all_replies->{$spam} : 0;
|
| 534 |
|
| 535 |
// Trash
|
| 536 |
+
$replies['trashed'] = ( !empty( $r['count_trashed_replies'] ) && current_user_can( 'view_trash' ) ) ? (int) $all_replies->{$trash} : 0;
|
| 537 |
|
| 538 |
// Total hidden (private + spam + trash)
|
| 539 |
$reply_count_hidden = $replies['private'] + $replies['spammed'] + $replies['trashed'];
|
| 550 |
}
|
| 551 |
|
| 552 |
// Topic Tags
|
| 553 |
+
if ( !empty( $r['count_tags'] ) && bbp_allow_topic_tags() ) {
|
| 554 |
|
| 555 |
// Get the count
|
| 556 |
$topic_tag_count = wp_count_terms( bbp_get_topic_tag_tax_id(), array( 'hide_empty' => true ) );
|
| 557 |
|
| 558 |
// Empty tags
|
| 559 |
+
if ( !empty( $r['count_empty_tags'] ) && current_user_can( 'edit_topic_tags' ) ) {
|
| 560 |
$empty_topic_tag_count = wp_count_terms( bbp_get_topic_tag_tax_id() ) - $topic_tag_count;
|
| 561 |
}
|
| 562 |
}
|
| 563 |
|
| 564 |
// Tally the tallies
|
| 565 |
+
$statistics = array_map( 'number_format_i18n', array_map( 'absint', compact(
|
| 566 |
+
'user_count',
|
| 567 |
+
'forum_count',
|
| 568 |
+
'topic_count',
|
| 569 |
+
'topic_count_hidden',
|
| 570 |
+
'reply_count',
|
| 571 |
+
'reply_count_hidden',
|
| 572 |
+
'topic_tag_count',
|
| 573 |
+
'empty_topic_tag_count'
|
| 574 |
+
) ) );
|
| 575 |
+
|
| 576 |
+
// Add the hidden (topic/reply) count title attribute strings because we
|
| 577 |
+
// don't need to run the math functions on these (see above)
|
| 578 |
+
$statistics['hidden_topic_title'] = isset( $hidden_topic_title ) ? $hidden_topic_title : '';
|
| 579 |
+
$statistics['hidden_reply_title'] = isset( $hidden_reply_title ) ? $hidden_reply_title : '';
|
| 580 |
|
| 581 |
return apply_filters( 'bbp_get_statistics', $statistics, $args );
|
| 582 |
}
|
| 609 |
*/
|
| 610 |
function bbp_filter_anonymous_post_data( $args = '' ) {
|
| 611 |
|
| 612 |
+
// Parse arguments against default values
|
| 613 |
+
$r = bbp_parse_args( $args, array (
|
| 614 |
'bbp_anonymous_name' => !empty( $_POST['bbp_anonymous_name'] ) ? $_POST['bbp_anonymous_name'] : false,
|
| 615 |
'bbp_anonymous_email' => !empty( $_POST['bbp_anonymous_email'] ) ? $_POST['bbp_anonymous_email'] : false,
|
| 616 |
'bbp_anonymous_website' => !empty( $_POST['bbp_anonymous_website'] ) ? $_POST['bbp_anonymous_website'] : false,
|
| 617 |
+
), 'filter_anonymous_post_data' );
|
|
|
|
|
|
|
| 618 |
|
| 619 |
// Filter variables and add errors if necessary
|
| 620 |
+
$r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] );
|
| 621 |
+
if ( empty( $r['bbp_anonymous_name'] ) )
|
| 622 |
bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) );
|
| 623 |
|
| 624 |
+
$r['bbp_anonymous_email'] = apply_filters( 'bbp_pre_anonymous_post_author_email', $r['bbp_anonymous_email'] );
|
| 625 |
+
if ( empty( $r['bbp_anonymous_email'] ) )
|
| 626 |
bbp_add_error( 'bbp_anonymous_email', __( '<strong>ERROR</strong>: Invalid email address submitted!', 'bbpress' ) );
|
| 627 |
|
| 628 |
// Website is optional
|
| 629 |
+
$r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] );
|
| 630 |
|
| 631 |
+
// Return false if we have any errors
|
| 632 |
+
$retval = bbp_has_errors() ? false : $r;
|
|
|
|
|
|
|
| 633 |
|
| 634 |
// Finally, return sanitized data or false
|
| 635 |
return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $args );
|
| 653 |
* it is found that it is a duplicate
|
| 654 |
* @return bool True if it is not a duplicate, false if it is
|
| 655 |
*/
|
| 656 |
+
function bbp_check_for_duplicate( $post_data = array() ) {
|
| 657 |
|
| 658 |
// No duplicate checks for those who can throttle
|
| 659 |
if ( current_user_can( 'throttle' ) )
|
| 660 |
return true;
|
| 661 |
|
| 662 |
+
// Define global to use get_meta_sql() and get_var() methods
|
| 663 |
global $wpdb;
|
| 664 |
|
| 665 |
+
// Parse arguments against default values
|
| 666 |
+
$r = bbp_parse_args( $post_data, array(
|
| 667 |
+
'post_author' => 0,
|
| 668 |
+
'post_type' => array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ),
|
| 669 |
+
'post_parent' => 0,
|
| 670 |
+
'post_content' => '',
|
| 671 |
+
'post_status' => bbp_get_trash_status_id(),
|
| 672 |
+
'anonymous_data' => false
|
| 673 |
+
), 'check_for_duplicate' );
|
| 674 |
|
| 675 |
// Check for anonymous post
|
| 676 |
+
if ( empty( $r['post_author'] ) && ( !empty( $r['anonymous_data'] ) && !empty( $r['anonymous_data']['bbp_anonymous_email'] ) ) ) {
|
| 677 |
$clauses = get_meta_sql( array( array(
|
| 678 |
'key' => '_bbp_anonymous_email',
|
| 679 |
+
'value' => $r['anonymous_data']['bbp_anonymous_email']
|
| 680 |
) ), 'post', $wpdb->posts, 'ID' );
|
| 681 |
|
| 682 |
$join = $clauses['join'];
|
| 687 |
|
| 688 |
// Simple duplicate check
|
| 689 |
// Expected slashed ($post_type, $post_parent, $post_author, $post_content, $anonymous_data)
|
| 690 |
+
$query = "SELECT ID FROM {$wpdb->posts} {$join} WHERE post_type = '{$r['post_type']}' AND post_status != '{$r['post_status']}' AND post_author = {$r['post_author']} AND post_content = '{$r['post_content']}' {$where}";
|
| 691 |
+
$query .= !empty( $r['post_parent'] ) ? " AND post_parent = '{$r['post_parent']}'" : '';
|
| 692 |
+
$query .= " LIMIT 1";
|
| 693 |
+
$dupe = apply_filters( 'bbp_check_for_duplicate_query', $query, $r );
|
|
|
|
| 694 |
|
| 695 |
if ( $wpdb->get_var( $dupe ) ) {
|
| 696 |
do_action( 'bbp_check_for_duplicate_trigger', $post_data );
|
| 736 |
if ( !empty( $last_posted ) && time() < $last_posted + $throttle_time ) {
|
| 737 |
return false;
|
| 738 |
}
|
| 739 |
+
|
| 740 |
// User is logged in, so check their last posted time
|
| 741 |
} elseif ( !empty( $author_id ) ) {
|
| 742 |
$author_id = (int) $author_id;
|
| 768 |
*/
|
| 769 |
function bbp_check_for_moderation( $anonymous_data = false, $author_id = 0, $title = '', $content = '' ) {
|
| 770 |
|
| 771 |
+
// Allow for moderation check to be skipped
|
| 772 |
+
if ( apply_filters( 'bbp_bypass_check_for_moderation', false, $anonymous_data, $author_id, $title, $content ) )
|
| 773 |
+
return true;
|
| 774 |
+
|
| 775 |
// Bail if super admin is author
|
| 776 |
if ( is_super_admin( $author_id ) )
|
| 777 |
return true;
|
| 887 |
*/
|
| 888 |
function bbp_check_for_blacklist( $anonymous_data = false, $author_id = 0, $title = '', $content = '' ) {
|
| 889 |
|
| 890 |
+
// Allow for blacklist check to be skipped
|
| 891 |
+
if ( apply_filters( 'bbp_bypass_check_for_blacklist', false, $anonymous_data, $author_id, $title, $content ) )
|
| 892 |
+
return true;
|
| 893 |
+
|
| 894 |
// Bail if super admin is author
|
| 895 |
if ( is_super_admin( $author_id ) )
|
| 896 |
return true;
|
| 1050 |
$topic_title = strip_tags( bbp_get_topic_title( $topic_id ) );
|
| 1051 |
$reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
|
| 1052 |
$reply_url = bbp_get_reply_url( $reply_id );
|
| 1053 |
+
$blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
| 1054 |
|
| 1055 |
// Loop through users
|
| 1056 |
foreach ( (array) $user_ids as $user_id ) {
|
| 1063 |
$message = sprintf( __( '%1$s wrote:
|
| 1064 |
|
| 1065 |
%2$s
|
| 1066 |
+
|
| 1067 |
Post Link: %3$s
|
| 1068 |
|
| 1069 |
-----------
|
| 1071 |
You are receiving this email because you subscribed to a forum topic.
|
| 1072 |
|
| 1073 |
Login and visit the topic to unsubscribe from these emails.', 'bbpress' ),
|
| 1074 |
+
|
| 1075 |
$reply_author_name,
|
| 1076 |
$reply_content,
|
| 1077 |
$reply_url
|
| 1445 |
*/
|
| 1446 |
function bbp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) {
|
| 1447 |
|
| 1448 |
+
// Parse home_url() into pieces to remove query-strings, strange characters,
|
| 1449 |
+
// and other funny things that plugins might to do to it.
|
| 1450 |
+
$parsed_home = parse_url( home_url( '/', ( is_ssl() ? 'https://' : 'http://' ) ) );
|
| 1451 |
+
$home_url = trim( strtolower( $parsed_home['scheme'] . '://' . $parsed_home['host'] . $parsed_home['path'] ), '/' );
|
| 1452 |
|
| 1453 |
// Build the currently requested URL
|
| 1454 |
$scheme = is_ssl() ? 'https://' : 'http://';
|
| 1502 |
// Single forum
|
| 1503 |
if ( isset( $query_vars[bbp_get_forum_post_type()] ) ) {
|
| 1504 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1505 |
// Load up our own query
|
| 1506 |
query_posts( array(
|
| 1507 |
'post_type' => bbp_get_forum_post_type(),
|
| 1508 |
+
'name' => $query_vars[bbp_get_forum_post_type()],
|
| 1509 |
'feed' => true
|
| 1510 |
) );
|
| 1511 |
|
| 1512 |
// Restrict to specific forum ID
|
| 1513 |
$meta_query = array( array(
|
| 1514 |
'key' => '_bbp_forum_id',
|
| 1515 |
+
'value' => bbp_get_forum_id(),
|
| 1516 |
'type' => 'numeric',
|
| 1517 |
'compare' => '='
|
| 1518 |
) );
|
| 1544 |
'author' => 0,
|
| 1545 |
'feed' => true,
|
| 1546 |
'post_type' => bbp_get_topic_post_type(),
|
| 1547 |
+
'post_parent' => bbp_get_forum_id(),
|
| 1548 |
'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ),
|
| 1549 |
'posts_per_page' => bbp_get_topics_per_rss_page(),
|
| 1550 |
'order' => 'DESC'
|
includes/common/shortcodes.php
CHANGED
|
@@ -79,11 +79,20 @@ class BBP_Shortcodes {
|
|
| 79 |
|
| 80 |
'bbp-single-view' => array( $this, 'display_view' ), // Single view
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
/** Account *******************************************************/
|
| 83 |
|
| 84 |
'bbp-login' => array( $this, 'display_login' ), // Login
|
| 85 |
'bbp-register' => array( $this, 'display_register' ), // Register
|
| 86 |
'bbp-lost-pass' => array( $this, 'display_lost_pass' ), // Lost Password
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
) );
|
| 88 |
}
|
| 89 |
|
|
@@ -110,9 +119,10 @@ class BBP_Shortcodes {
|
|
| 110 |
$bbp = bbpress();
|
| 111 |
|
| 112 |
// Unset global queries
|
| 113 |
-
$bbp->forum_query
|
| 114 |
-
$bbp->topic_query
|
| 115 |
-
$bbp->reply_query
|
|
|
|
| 116 |
|
| 117 |
// Unset global ID's
|
| 118 |
$bbp->current_forum_id = 0;
|
|
@@ -598,6 +608,64 @@ class BBP_Shortcodes {
|
|
| 598 |
return $this->end();
|
| 599 |
}
|
| 600 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 601 |
/** Account ***************************************************************/
|
| 602 |
|
| 603 |
/**
|
|
@@ -677,6 +745,28 @@ class BBP_Shortcodes {
|
|
| 677 |
|
| 678 |
/** Other *****************************************************************/
|
| 679 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 680 |
/**
|
| 681 |
* Display a breadcrumb
|
| 682 |
*
|
| 79 |
|
| 80 |
'bbp-single-view' => array( $this, 'display_view' ), // Single view
|
| 81 |
|
| 82 |
+
/** Search ********************************************************/
|
| 83 |
+
|
| 84 |
+
'bbp-search-form' => array( $this, 'display_search_form' ), // Search form
|
| 85 |
+
'bbp-search' => array( $this, 'display_search' ), // Search
|
| 86 |
+
|
| 87 |
/** Account *******************************************************/
|
| 88 |
|
| 89 |
'bbp-login' => array( $this, 'display_login' ), // Login
|
| 90 |
'bbp-register' => array( $this, 'display_register' ), // Register
|
| 91 |
'bbp-lost-pass' => array( $this, 'display_lost_pass' ), // Lost Password
|
| 92 |
+
|
| 93 |
+
/** Others *******************************************************/
|
| 94 |
+
|
| 95 |
+
'bbp-stats' => array( $this, 'display_stats' ), // Stats
|
| 96 |
) );
|
| 97 |
}
|
| 98 |
|
| 119 |
$bbp = bbpress();
|
| 120 |
|
| 121 |
// Unset global queries
|
| 122 |
+
$bbp->forum_query = new stdClass;
|
| 123 |
+
$bbp->topic_query = new stdClass;
|
| 124 |
+
$bbp->reply_query = new stdClass;
|
| 125 |
+
$bbp->search_query = new stdClass;
|
| 126 |
|
| 127 |
// Unset global ID's
|
| 128 |
$bbp->current_forum_id = 0;
|
| 608 |
return $this->end();
|
| 609 |
}
|
| 610 |
|
| 611 |
+
/** Search ****************************************************************/
|
| 612 |
+
|
| 613 |
+
/**
|
| 614 |
+
* Display the search form in an output buffer and return to ensure
|
| 615 |
+
* post/page contents are displayed first.
|
| 616 |
+
*
|
| 617 |
+
* @since bbPress (r4585)
|
| 618 |
+
*
|
| 619 |
+
* @uses get_template_part()
|
| 620 |
+
*/
|
| 621 |
+
public function display_search_form() {
|
| 622 |
+
|
| 623 |
+
// Start output buffer
|
| 624 |
+
$this->start( 'bbp_search_form' );
|
| 625 |
+
|
| 626 |
+
// Output templates
|
| 627 |
+
bbp_get_template_part( 'form', 'search' );
|
| 628 |
+
|
| 629 |
+
// Return contents of output buffer
|
| 630 |
+
return $this->end();
|
| 631 |
+
}
|
| 632 |
+
|
| 633 |
+
/**
|
| 634 |
+
* Display the contents of search results in an output buffer and return to
|
| 635 |
+
* ensure that post/page contents are displayed first.
|
| 636 |
+
*
|
| 637 |
+
* @since bbPress (r4579)
|
| 638 |
+
*
|
| 639 |
+
* @param array $attr
|
| 640 |
+
* @param string $content
|
| 641 |
+
* @uses bbp_search_query()
|
| 642 |
+
* @uses get_template_part()
|
| 643 |
+
*/
|
| 644 |
+
public function display_search( $attr, $content = '' ) {
|
| 645 |
+
|
| 646 |
+
// Sanity check required info
|
| 647 |
+
if ( !empty( $content ) )
|
| 648 |
+
return $content;
|
| 649 |
+
|
| 650 |
+
// Set passed attribute to $search_terms for clarity
|
| 651 |
+
$search_terms = empty( $attr['search'] ) ? bbp_get_search_terms() : $attr['search'];
|
| 652 |
+
|
| 653 |
+
// Unset globals
|
| 654 |
+
$this->unset_globals();
|
| 655 |
+
|
| 656 |
+
// Set terms for query
|
| 657 |
+
set_query_var( bbp_get_search_rewrite_id(), $search_terms );
|
| 658 |
+
|
| 659 |
+
// Start output buffer
|
| 660 |
+
$this->start( 'bbp_search' );
|
| 661 |
+
|
| 662 |
+
// Output template
|
| 663 |
+
bbp_get_template_part( 'content', 'search' );
|
| 664 |
+
|
| 665 |
+
// Return contents of output buffer
|
| 666 |
+
return $this->end();
|
| 667 |
+
}
|
| 668 |
+
|
| 669 |
/** Account ***************************************************************/
|
| 670 |
|
| 671 |
/**
|
| 745 |
|
| 746 |
/** Other *****************************************************************/
|
| 747 |
|
| 748 |
+
/**
|
| 749 |
+
* Display forum statistics
|
| 750 |
+
*
|
| 751 |
+
* @since bbPress (r4509)
|
| 752 |
+
*
|
| 753 |
+
* @return shring
|
| 754 |
+
*/
|
| 755 |
+
public function display_stats() {
|
| 756 |
+
|
| 757 |
+
// Unset globals
|
| 758 |
+
$this->unset_globals();
|
| 759 |
+
|
| 760 |
+
// Start output buffer
|
| 761 |
+
$this->start();
|
| 762 |
+
|
| 763 |
+
// Output statistics
|
| 764 |
+
bbp_get_template_part( 'content', 'statistics' );
|
| 765 |
+
|
| 766 |
+
// Return contents of output buffer
|
| 767 |
+
return $this->end();
|
| 768 |
+
}
|
| 769 |
+
|
| 770 |
/**
|
| 771 |
* Display a breadcrumb
|
| 772 |
*
|
includes/common/template-tags.php
CHANGED
|
@@ -17,7 +17,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Ouput the forum URL
|
| 20 |
-
*
|
| 21 |
* @since bbPress (r3979)
|
| 22 |
*
|
| 23 |
* @uses bbp_get_forums_url() To get the forums URL
|
|
@@ -28,7 +28,7 @@ function bbp_forums_url( $path = '/' ) {
|
|
| 28 |
}
|
| 29 |
/**
|
| 30 |
* Return the forum URL
|
| 31 |
-
*
|
| 32 |
* @since bbPress (r3979)
|
| 33 |
*
|
| 34 |
* @uses home_url() To get the home URL
|
|
@@ -478,6 +478,24 @@ function bbp_is_reply_edit() {
|
|
| 478 |
return (bool) apply_filters( 'bbp_is_reply_edit', $retval );
|
| 479 |
}
|
| 480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 481 |
/**
|
| 482 |
* Viewing a single reply
|
| 483 |
*
|
|
@@ -744,7 +762,7 @@ function bbp_is_single_user_replies() {
|
|
| 744 |
*
|
| 745 |
* @since bbPress (r2789)
|
| 746 |
*
|
| 747 |
-
* @global WP_Query $wp_query To check if WP_Query::bbp_is_view is true
|
| 748 |
* @uses bbp_is_query_name() To get the query name
|
| 749 |
* @return bool Is it a view page?
|
| 750 |
*/
|
|
@@ -765,6 +783,36 @@ function bbp_is_single_view() {
|
|
| 765 |
return (bool) apply_filters( 'bbp_is_single_view', $retval );
|
| 766 |
}
|
| 767 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 768 |
/**
|
| 769 |
* Check if current page is an edit page
|
| 770 |
*
|
|
@@ -800,7 +848,7 @@ function bbp_is_edit() {
|
|
| 800 |
* @uses bbp_is_topic_split()
|
| 801 |
* @uses bbp_is_single_reply()
|
| 802 |
* @uses bbp_is_reply_edit()
|
| 803 |
-
* @uses
|
| 804 |
* @uses bbp_is_single_view()
|
| 805 |
* @uses bbp_is_single_user_edit()
|
| 806 |
* @uses bbp_is_single_user()
|
|
@@ -823,101 +871,102 @@ function bbp_body_class( $wp_classes, $custom_classes = false ) {
|
|
| 823 |
|
| 824 |
/** Archives **************************************************************/
|
| 825 |
|
| 826 |
-
if ( bbp_is_forum_archive() )
|
| 827 |
$bbp_classes[] = bbp_get_forum_post_type() . '-archive';
|
| 828 |
|
| 829 |
-
|
| 830 |
$bbp_classes[] = bbp_get_topic_post_type() . '-archive';
|
| 831 |
|
| 832 |
/** Topic Tags ************************************************************/
|
| 833 |
|
| 834 |
-
|
| 835 |
$bbp_classes[] = bbp_get_topic_tag_tax_id();
|
| 836 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-' . bbp_get_topic_tag_slug();
|
| 837 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-' . bbp_get_topic_tag_id();
|
| 838 |
-
}
|
| 839 |
-
|
| 840 |
-
if ( bbp_is_topic_tag_edit() ) {
|
| 841 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-edit';
|
| 842 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-' . bbp_get_topic_tag_slug() . '-edit';
|
| 843 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-' . bbp_get_topic_tag_id() . '-edit';
|
| 844 |
-
}
|
| 845 |
|
| 846 |
/** Components ************************************************************/
|
| 847 |
|
| 848 |
-
|
| 849 |
$bbp_classes[] = bbp_get_forum_post_type();
|
| 850 |
|
| 851 |
-
|
| 852 |
$bbp_classes[] = bbp_get_topic_post_type();
|
| 853 |
|
| 854 |
-
|
| 855 |
$bbp_classes[] = bbp_get_reply_post_type();
|
| 856 |
|
| 857 |
-
|
| 858 |
$bbp_classes[] = bbp_get_topic_post_type() . '-edit';
|
| 859 |
|
| 860 |
-
|
| 861 |
$bbp_classes[] = bbp_get_topic_post_type() . '-merge';
|
| 862 |
|
| 863 |
-
|
| 864 |
$bbp_classes[] = bbp_get_topic_post_type() . '-split';
|
| 865 |
|
| 866 |
-
|
| 867 |
$bbp_classes[] = bbp_get_reply_post_type() . '-edit';
|
| 868 |
|
| 869 |
-
|
|
|
|
|
|
|
|
|
|
| 870 |
$bbp_classes[] = 'bbp-view';
|
| 871 |
|
| 872 |
/** User ******************************************************************/
|
| 873 |
|
| 874 |
-
|
| 875 |
$bbp_classes[] = 'bbp-user-edit';
|
| 876 |
$bbp_classes[] = 'single';
|
| 877 |
$bbp_classes[] = 'singular';
|
| 878 |
-
}
|
| 879 |
|
| 880 |
-
|
| 881 |
$bbp_classes[] = 'bbp-user-page';
|
| 882 |
$bbp_classes[] = 'single';
|
| 883 |
$bbp_classes[] = 'singular';
|
| 884 |
-
}
|
| 885 |
|
| 886 |
-
|
| 887 |
$bbp_classes[] = 'bbp-user-home';
|
| 888 |
$bbp_classes[] = 'single';
|
| 889 |
$bbp_classes[] = 'singular';
|
| 890 |
-
}
|
| 891 |
|
| 892 |
-
|
| 893 |
$bbp_classes[] = 'bbp-user-home-edit';
|
| 894 |
$bbp_classes[] = 'single';
|
| 895 |
$bbp_classes[] = 'singular';
|
| 896 |
-
}
|
| 897 |
|
| 898 |
-
|
| 899 |
$bbp_classes[] = 'bbp-topics-created';
|
| 900 |
$bbp_classes[] = 'single';
|
| 901 |
$bbp_classes[] = 'singular';
|
| 902 |
-
}
|
| 903 |
|
| 904 |
-
|
| 905 |
$bbp_classes[] = 'bbp-favorites';
|
| 906 |
$bbp_classes[] = 'single';
|
| 907 |
$bbp_classes[] = 'singular';
|
| 908 |
-
}
|
| 909 |
|
| 910 |
-
|
| 911 |
$bbp_classes[] = 'bbp-subscriptions';
|
| 912 |
$bbp_classes[] = 'single';
|
| 913 |
$bbp_classes[] = 'singular';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 914 |
}
|
| 915 |
|
| 916 |
/** Clean up **************************************************************/
|
| 917 |
|
| 918 |
// Add bbPress class if we are within a bbPress page
|
| 919 |
-
if ( !empty( $bbp_classes ) )
|
| 920 |
$bbp_classes[] = 'bbPress';
|
|
|
|
| 921 |
|
| 922 |
// Merge WP classes with bbPress classes and remove any duplicates
|
| 923 |
$classes = array_unique( array_merge( (array) $bbp_classes, (array) $wp_classes ) );
|
|
@@ -937,7 +986,7 @@ function bbp_body_class( $wp_classes, $custom_classes = false ) {
|
|
| 937 |
* @uses bbp_is_topic_split()
|
| 938 |
* @uses bbp_is_single_reply()
|
| 939 |
* @uses bbp_is_reply_edit()
|
| 940 |
-
* @uses
|
| 941 |
* @uses bbp_is_single_view()
|
| 942 |
* @uses bbp_is_single_user_edit()
|
| 943 |
* @uses bbp_is_single_user()
|
|
@@ -954,68 +1003,77 @@ function is_bbpress() {
|
|
| 954 |
|
| 955 |
/** Archives **************************************************************/
|
| 956 |
|
| 957 |
-
if ( bbp_is_forum_archive() )
|
| 958 |
$retval = true;
|
| 959 |
|
| 960 |
-
elseif ( bbp_is_topic_archive() )
|
| 961 |
$retval = true;
|
| 962 |
|
| 963 |
/** Topic Tags ************************************************************/
|
| 964 |
|
| 965 |
-
elseif ( bbp_is_topic_tag() )
|
| 966 |
$retval = true;
|
| 967 |
|
| 968 |
-
elseif ( bbp_is_topic_tag_edit() )
|
| 969 |
$retval = true;
|
| 970 |
|
| 971 |
/** Components ************************************************************/
|
| 972 |
|
| 973 |
-
elseif ( bbp_is_single_forum() )
|
|
|
|
|
|
|
|
|
|
| 974 |
$retval = true;
|
| 975 |
|
| 976 |
-
elseif (
|
| 977 |
$retval = true;
|
| 978 |
|
| 979 |
-
elseif (
|
| 980 |
$retval = true;
|
| 981 |
|
| 982 |
-
elseif (
|
| 983 |
$retval = true;
|
| 984 |
|
| 985 |
-
elseif (
|
| 986 |
$retval = true;
|
| 987 |
|
| 988 |
-
elseif (
|
| 989 |
$retval = true;
|
| 990 |
|
| 991 |
-
elseif (
|
| 992 |
$retval = true;
|
| 993 |
|
| 994 |
-
elseif ( bbp_is_single_view() )
|
| 995 |
$retval = true;
|
| 996 |
|
| 997 |
/** User ******************************************************************/
|
| 998 |
|
| 999 |
-
elseif ( bbp_is_single_user_edit() )
|
| 1000 |
$retval = true;
|
| 1001 |
|
| 1002 |
-
elseif ( bbp_is_single_user() )
|
| 1003 |
$retval = true;
|
| 1004 |
|
| 1005 |
-
elseif ( bbp_is_user_home() )
|
| 1006 |
$retval = true;
|
| 1007 |
|
| 1008 |
-
elseif ( bbp_is_user_home_edit() )
|
| 1009 |
$retval = true;
|
| 1010 |
|
| 1011 |
-
elseif ( bbp_is_topics_created() )
|
| 1012 |
$retval = true;
|
| 1013 |
|
| 1014 |
-
elseif ( bbp_is_favorites() )
|
| 1015 |
$retval = true;
|
| 1016 |
|
| 1017 |
-
elseif ( bbp_is_subscriptions() )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1018 |
$retval = true;
|
|
|
|
| 1019 |
|
| 1020 |
/** Done ******************************************************************/
|
| 1021 |
|
|
@@ -1035,19 +1093,23 @@ function is_bbpress() {
|
|
| 1035 |
* @uses apply_filters() Calls 'bbp_wp_login_action' with the url and args
|
| 1036 |
*/
|
| 1037 |
function bbp_wp_login_action( $args = '' ) {
|
| 1038 |
-
|
|
|
|
|
|
|
| 1039 |
'action' => '',
|
| 1040 |
'context' => ''
|
| 1041 |
-
);
|
| 1042 |
-
|
| 1043 |
-
|
|
|
|
|
|
|
| 1044 |
|
| 1045 |
-
|
| 1046 |
-
|
| 1047 |
-
else
|
| 1048 |
$login_url = 'wp-login.php';
|
|
|
|
| 1049 |
|
| 1050 |
-
$login_url = site_url( $login_url, $context );
|
| 1051 |
|
| 1052 |
echo apply_filters( 'bbp_wp_login_action', $login_url, $args );
|
| 1053 |
}
|
|
@@ -1055,26 +1117,27 @@ function bbp_wp_login_action( $args = '' ) {
|
|
| 1055 |
/**
|
| 1056 |
* Output hidden request URI field for user forms.
|
| 1057 |
*
|
| 1058 |
-
* The referer link is the current Request URI from the server super global.
|
| 1059 |
-
*
|
| 1060 |
*
|
| 1061 |
* @since bbPress (r2815)
|
| 1062 |
*
|
| 1063 |
-
* @param string $
|
|
|
|
| 1064 |
* @uses wp_get_referer() To get the referer
|
| 1065 |
* @uses esc_attr() To escape the url
|
| 1066 |
-
* @uses apply_filters() Calls 'bbp_redirect_to_field'
|
| 1067 |
-
* and url
|
| 1068 |
*/
|
| 1069 |
function bbp_redirect_to_field( $redirect_to = '' ) {
|
| 1070 |
|
| 1071 |
-
// Rejig the $redirect_to
|
| 1072 |
-
if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( !$redirect_to == home_url( $_SERVER['REDIRECT_URL'] ) ) )
|
| 1073 |
-
$redirect_to = wp_get_referer();
|
| 1074 |
-
|
| 1075 |
// Make sure we are directing somewhere
|
| 1076 |
-
if ( empty( $redirect_to ) )
|
| 1077 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1078 |
|
| 1079 |
// Remove loggedout query arg if it's there
|
| 1080 |
$redirect_to = (string) esc_attr( remove_query_arg( 'loggedout', $redirect_to ) );
|
|
@@ -1208,7 +1271,7 @@ function bbp_dropdown( $args = '' ) {
|
|
| 1208 |
* box, the first value would of course be selected -
|
| 1209 |
* though you can have that as none (pass 'show_none' arg))
|
| 1210 |
* - sort_column: Sort by? Defaults to 'menu_order, post_title'
|
| 1211 |
-
* -
|
| 1212 |
* - post_status: Which all post_statuses to find in? Can be an array
|
| 1213 |
* or CSV of publish, category, closed, private, spam,
|
| 1214 |
* trash (based on post type) - if not set, these are
|
|
@@ -1243,11 +1306,13 @@ function bbp_dropdown( $args = '' ) {
|
|
| 1243 |
|
| 1244 |
/** Arguments *********************************************************/
|
| 1245 |
|
| 1246 |
-
|
|
|
|
| 1247 |
'post_type' => bbp_get_forum_post_type(),
|
| 1248 |
'selected' => 0,
|
| 1249 |
'sort_column' => 'menu_order',
|
| 1250 |
-
'
|
|
|
|
| 1251 |
'numberposts' => -1,
|
| 1252 |
'orderby' => 'menu_order',
|
| 1253 |
'order' => 'ASC',
|
|
@@ -1261,8 +1326,7 @@ function bbp_dropdown( $args = '' ) {
|
|
| 1261 |
'none_found' => false,
|
| 1262 |
'disable_categories' => true,
|
| 1263 |
'disabled' => ''
|
| 1264 |
-
);
|
| 1265 |
-
$r = bbp_parse_args( $args, $defaults, 'get_dropdown' );
|
| 1266 |
|
| 1267 |
if ( empty( $r['walker'] ) ) {
|
| 1268 |
$r['walker'] = new BBP_Walker_Dropdown();
|
|
@@ -1270,14 +1334,14 @@ function bbp_dropdown( $args = '' ) {
|
|
| 1270 |
}
|
| 1271 |
|
| 1272 |
// Force 0
|
| 1273 |
-
if ( is_numeric( $r['selected'] ) && $r['selected'] < 0 )
|
| 1274 |
$r['selected'] = 0;
|
|
|
|
| 1275 |
|
| 1276 |
-
|
| 1277 |
-
|
| 1278 |
-
|
| 1279 |
-
|
| 1280 |
-
unset( $r['select_id'], $r['tab'], $r['options_only'], $r['show_none'], $r['none_found'] );
|
| 1281 |
|
| 1282 |
/** Post Status *******************************************************/
|
| 1283 |
|
|
@@ -1288,7 +1352,7 @@ function bbp_dropdown( $args = '' ) {
|
|
| 1288 |
$post_stati[] = bbp_get_public_status_id();
|
| 1289 |
|
| 1290 |
// Forums
|
| 1291 |
-
if ( bbp_get_forum_post_type() == $post_type ) {
|
| 1292 |
|
| 1293 |
// Private forums
|
| 1294 |
if ( current_user_can( 'read_private_forums' ) ) {
|
|
@@ -1306,33 +1370,47 @@ function bbp_dropdown( $args = '' ) {
|
|
| 1306 |
|
| 1307 |
/** Setup variables ***************************************************/
|
| 1308 |
|
| 1309 |
-
$name = esc_attr( $select_id );
|
| 1310 |
$select_id = $name;
|
| 1311 |
-
$tab = (int) $tab;
|
| 1312 |
$retval = '';
|
| 1313 |
-
$
|
| 1314 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1315 |
|
| 1316 |
/** Drop Down *********************************************************/
|
| 1317 |
|
| 1318 |
// Items found
|
| 1319 |
if ( !empty( $posts ) ) {
|
| 1320 |
-
if ( empty( $options_only ) ) {
|
| 1321 |
$tab = !empty( $tab ) ? ' tabindex="' . $tab . '"' : '';
|
| 1322 |
$retval .= '<select name="' . $name . '" id="' . $select_id . '"' . $tab . $disabled . '>' . "\n";
|
| 1323 |
}
|
| 1324 |
|
| 1325 |
-
$retval .= !empty( $show_none ) ? "\t<option value=\"\" class=\"level-0\">" . $show_none . '</option>' : '';
|
| 1326 |
$retval .= walk_page_dropdown_tree( $posts, 0, $r );
|
| 1327 |
|
| 1328 |
-
if ( empty( $options_only ) )
|
| 1329 |
$retval .= '</select>';
|
|
|
|
| 1330 |
|
| 1331 |
// No items found - Display feedback if no custom message was passed
|
| 1332 |
-
} elseif ( empty( $none_found ) ) {
|
| 1333 |
|
| 1334 |
// Switch the response based on post type
|
| 1335 |
-
switch ( $post_type ) {
|
| 1336 |
|
| 1337 |
// Topics
|
| 1338 |
case bbp_get_topic_post_type() :
|
|
@@ -1535,7 +1613,7 @@ function bbp_merge_topic_form_fields() {
|
|
| 1535 |
*
|
| 1536 |
* @since bbPress (r2756)
|
| 1537 |
*
|
| 1538 |
-
* @uses wp_nonce_field() To
|
| 1539 |
*/
|
| 1540 |
function bbp_split_topic_form_fields() {
|
| 1541 |
?>
|
|
@@ -1546,6 +1624,22 @@ function bbp_split_topic_form_fields() {
|
|
| 1546 |
<?php wp_nonce_field( 'bbp-split-topic_' . bbp_get_topic_id() );
|
| 1547 |
}
|
| 1548 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1549 |
/**
|
| 1550 |
* Output a textarea or TinyMCE if enabled
|
| 1551 |
*
|
|
@@ -1570,54 +1664,67 @@ function bbp_the_content( $args = array() ) {
|
|
| 1570 |
* @uses bbp_is_edit() To see if we are editing something
|
| 1571 |
* @uses wp_editor() To output the WordPress editor
|
| 1572 |
*
|
| 1573 |
-
* @return string HTML from output buffer
|
| 1574 |
*/
|
| 1575 |
function bbp_get_the_content( $args = array() ) {
|
| 1576 |
|
| 1577 |
-
//
|
| 1578 |
-
$
|
| 1579 |
-
'context'
|
| 1580 |
-
'before'
|
| 1581 |
-
'after'
|
| 1582 |
-
'wpautop'
|
| 1583 |
-
'media_buttons'
|
| 1584 |
-
'textarea_rows'
|
| 1585 |
-
'tabindex'
|
| 1586 |
-
'
|
| 1587 |
-
'
|
| 1588 |
-
'
|
| 1589 |
-
'
|
| 1590 |
-
|
| 1591 |
-
|
| 1592 |
-
|
| 1593 |
|
| 1594 |
// Assume we are not editing
|
| 1595 |
-
$post_content = '';
|
| 1596 |
|
| 1597 |
// Start an output buffor
|
| 1598 |
ob_start();
|
| 1599 |
|
| 1600 |
// Output something before the editor
|
| 1601 |
-
if ( !empty( $before ) )
|
| 1602 |
-
echo $before;
|
| 1603 |
-
|
| 1604 |
-
// Get sanitized content
|
| 1605 |
-
if ( bbp_is_edit() )
|
| 1606 |
-
$post_content = call_user_func( 'bbp_get_form_' . $context . '_content' );
|
| 1607 |
|
| 1608 |
// Use TinyMCE if available
|
| 1609 |
if ( bbp_use_wp_editor() ) :
|
| 1610 |
-
|
| 1611 |
-
|
| 1612 |
-
|
| 1613 |
-
|
| 1614 |
-
|
| 1615 |
-
|
| 1616 |
-
|
| 1617 |
-
|
| 1618 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1619 |
) );
|
| 1620 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1621 |
/**
|
| 1622 |
* Fallback to normal textarea.
|
| 1623 |
*
|
|
@@ -1626,13 +1733,14 @@ function bbp_the_content( $args = array() ) {
|
|
| 1626 |
*/
|
| 1627 |
else : ?>
|
| 1628 |
|
| 1629 |
-
<textarea id="bbp_<?php echo esc_attr( $context ); ?>_content" class="<?php echo esc_attr( $editor_class ); ?>" name="bbp_<?php echo esc_attr( $context ); ?>_content" cols="60" rows="<?php echo esc_attr( $textarea_rows ); ?>" tabindex="<?php echo esc_attr( $tabindex ); ?>"><?php echo $post_content; ?></textarea>
|
| 1630 |
|
| 1631 |
<?php endif;
|
| 1632 |
|
| 1633 |
// Output something after the editor
|
| 1634 |
-
if ( !empty( $after ) )
|
| 1635 |
-
echo $after;
|
|
|
|
| 1636 |
|
| 1637 |
// Put the output into a usable variable
|
| 1638 |
$output = ob_get_contents();
|
|
@@ -1643,6 +1751,83 @@ function bbp_the_content( $args = array() ) {
|
|
| 1643 |
return apply_filters( 'bbp_get_the_content', $output, $args, $post_content );
|
| 1644 |
}
|
| 1645 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1646 |
/** Views *********************************************************************/
|
| 1647 |
|
| 1648 |
/**
|
|
@@ -1878,8 +2063,9 @@ function bbp_breadcrumb( $args = array() ) {
|
|
| 1878 |
// No custom home text
|
| 1879 |
if ( empty( $args['home_text'] ) ) {
|
| 1880 |
|
| 1881 |
-
// Set home text to page title
|
| 1882 |
$front_id = get_option( 'page_on_front' );
|
|
|
|
|
|
|
| 1883 |
if ( !empty( $front_id ) ) {
|
| 1884 |
$pre_front_text = get_the_title( $front_id );
|
| 1885 |
|
|
@@ -1903,16 +2089,19 @@ function bbp_breadcrumb( $args = array() ) {
|
|
| 1903 |
/** Includes **********************************************************/
|
| 1904 |
|
| 1905 |
// Root slug is also the front page
|
| 1906 |
-
if ( !empty( $front_id ) && ( $front_id == $root_id ) )
|
| 1907 |
$pre_include_root = false;
|
|
|
|
| 1908 |
|
| 1909 |
// Don't show root if viewing forum archive
|
| 1910 |
-
if ( bbp_is_forum_archive() )
|
| 1911 |
$pre_include_root = false;
|
|
|
|
| 1912 |
|
| 1913 |
// Don't show root if viewing page in place of forum archive
|
| 1914 |
-
if ( !empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id == get_the_ID() ) ) )
|
| 1915 |
$pre_include_root = false;
|
|
|
|
| 1916 |
|
| 1917 |
/** Current Text ******************************************************/
|
| 1918 |
|
|
@@ -1966,18 +2155,18 @@ function bbp_breadcrumb( $args = array() ) {
|
|
| 1966 |
/** Parse Args ********************************************************/
|
| 1967 |
|
| 1968 |
// Parse args
|
| 1969 |
-
$
|
| 1970 |
|
| 1971 |
// HTML
|
| 1972 |
'before' => '<div class="bbp-breadcrumb"><p>',
|
| 1973 |
'after' => '</p></div>',
|
| 1974 |
-
|
| 1975 |
// Separator
|
| 1976 |
-
'sep' => __( '›', 'bbpress' ),
|
| 1977 |
'pad_sep' => 1,
|
| 1978 |
'sep_before' => '<span class="bbp-breadcrumb-sep">',
|
| 1979 |
'sep_after' => '</span>',
|
| 1980 |
-
|
| 1981 |
// Crumbs
|
| 1982 |
'crumb_before' => '',
|
| 1983 |
'crumb_after' => '',
|
|
@@ -1995,22 +2184,22 @@ function bbp_breadcrumb( $args = array() ) {
|
|
| 1995 |
'current_text' => $pre_current_text,
|
| 1996 |
'current_before' => '<span class="bbp-breadcrumb-current">',
|
| 1997 |
'current_after' => '</span>',
|
| 1998 |
-
);
|
| 1999 |
-
$r = bbp_parse_args( $args, $defaults, 'get_breadcrumb' );
|
| 2000 |
-
extract( $r );
|
| 2001 |
|
| 2002 |
/** Ancestors *********************************************************/
|
| 2003 |
|
| 2004 |
// Get post ancestors
|
| 2005 |
-
if ( is_singular() || bbp_is_forum_edit() || bbp_is_topic_edit() || bbp_is_reply_edit() )
|
| 2006 |
$ancestors = array_reverse( (array) get_post_ancestors( get_the_ID() ) );
|
|
|
|
| 2007 |
|
| 2008 |
// Do we want to include a link to home?
|
| 2009 |
-
if ( !empty( $include_home ) || empty( $home_text ) )
|
| 2010 |
-
$crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $home_text . '</a>';
|
|
|
|
| 2011 |
|
| 2012 |
// Do we want to include a link to the forum root?
|
| 2013 |
-
if ( !empty( $include_root ) || empty( $root_text ) ) {
|
| 2014 |
|
| 2015 |
// Page exists at root slug path, so use its permalink
|
| 2016 |
$page = bbp_get_page_by_path( bbp_get_root_slug() );
|
|
@@ -2023,7 +2212,7 @@ function bbp_breadcrumb( $args = array() ) {
|
|
| 2023 |
}
|
| 2024 |
|
| 2025 |
// Add the breadcrumb
|
| 2026 |
-
$crumbs[] = '<a href="' . $root_url . '" class="bbp-breadcrumb-root">' . $root_text . '</a>';
|
| 2027 |
}
|
| 2028 |
|
| 2029 |
// Ancestors exist
|
|
@@ -2063,23 +2252,30 @@ function bbp_breadcrumb( $args = array() ) {
|
|
| 2063 |
// Edit topic tag
|
| 2064 |
} elseif ( bbp_is_topic_tag_edit() ) {
|
| 2065 |
$crumbs[] = '<a href="' . get_term_link( bbp_get_topic_tag_id(), bbp_get_topic_tag_tax_id() ) . '" class="bbp-breadcrumb-topic-tag">' . sprintf( __( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ) . '</a>';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2066 |
}
|
| 2067 |
|
| 2068 |
/** Current ***********************************************************/
|
| 2069 |
|
| 2070 |
// Add current page to breadcrumb
|
| 2071 |
-
if ( !empty( $include_current ) || empty( $pre_current_text ) )
|
| 2072 |
-
$crumbs[] = $current_before . $current_text . $current_after;
|
|
|
|
| 2073 |
|
| 2074 |
/** Separator *********************************************************/
|
| 2075 |
|
| 2076 |
// Wrap the separator in before/after before padding and filter
|
| 2077 |
-
if ( ! empty( $sep ) )
|
| 2078 |
-
$sep = $sep_before . $sep . $sep_after;
|
|
|
|
| 2079 |
|
| 2080 |
// Pad the separator
|
| 2081 |
-
if ( !empty( $pad_sep ) )
|
| 2082 |
-
$sep = str_pad( $sep, strlen( $sep ) + ( (int) $pad_sep * 2 ), ' ', STR_PAD_BOTH );
|
|
|
|
| 2083 |
|
| 2084 |
/** Finish Up *********************************************************/
|
| 2085 |
|
|
@@ -2088,7 +2284,7 @@ function bbp_breadcrumb( $args = array() ) {
|
|
| 2088 |
$crumbs = apply_filters( 'bbp_breadcrumbs', $crumbs );
|
| 2089 |
|
| 2090 |
// Build the trail
|
| 2091 |
-
$trail
|
| 2092 |
|
| 2093 |
return apply_filters( 'bbp_get_breadcrumb', $trail, $crumbs, $r );
|
| 2094 |
}
|
|
@@ -2116,12 +2312,25 @@ function bbp_allowed_tags() {
|
|
| 2116 |
*
|
| 2117 |
* @since bbPress (r2780)
|
| 2118 |
*
|
| 2119 |
-
* @uses
|
| 2120 |
* @uses apply_filters() Calls 'bbp_allowed_tags' with the tags
|
| 2121 |
* @return string HTML allowed tags entity encoded.
|
| 2122 |
*/
|
| 2123 |
function bbp_get_allowed_tags() {
|
| 2124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2125 |
}
|
| 2126 |
|
| 2127 |
/** Errors & Messages *********************************************************/
|
|
@@ -2314,6 +2523,12 @@ function bbp_title( $title = '', $sep = '»', $seplocation = '' ) {
|
|
| 2314 |
// Views
|
| 2315 |
} elseif ( bbp_is_single_view() ) {
|
| 2316 |
$title = sprintf( __( 'View: %s', 'bbpress' ), bbp_get_view_title() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2317 |
}
|
| 2318 |
|
| 2319 |
// Filter the raw title
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Ouput the forum URL
|
| 20 |
+
*
|
| 21 |
* @since bbPress (r3979)
|
| 22 |
*
|
| 23 |
* @uses bbp_get_forums_url() To get the forums URL
|
| 28 |
}
|
| 29 |
/**
|
| 30 |
* Return the forum URL
|
| 31 |
+
*
|
| 32 |
* @since bbPress (r3979)
|
| 33 |
*
|
| 34 |
* @uses home_url() To get the home URL
|
| 478 |
return (bool) apply_filters( 'bbp_is_reply_edit', $retval );
|
| 479 |
}
|
| 480 |
|
| 481 |
+
/**
|
| 482 |
+
* Check if current page is a reply move page
|
| 483 |
+
*
|
| 484 |
+
* @uses bbp_is_reply_move() To check if it's a reply move page
|
| 485 |
+
* @return bool True if it's the reply move page, false if not
|
| 486 |
+
*/
|
| 487 |
+
function bbp_is_reply_move() {
|
| 488 |
+
|
| 489 |
+
// Assume false
|
| 490 |
+
$retval = false;
|
| 491 |
+
|
| 492 |
+
// Check reply edit and GET params
|
| 493 |
+
if ( bbp_is_reply_edit() && !empty( $_GET['action'] ) && ( 'move' == $_GET['action'] ) )
|
| 494 |
+
$retval = true;
|
| 495 |
+
|
| 496 |
+
return (bool) apply_filters( 'bbp_is_reply_move', $retval );
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
/**
|
| 500 |
* Viewing a single reply
|
| 501 |
*
|
| 762 |
*
|
| 763 |
* @since bbPress (r2789)
|
| 764 |
*
|
| 765 |
+
* @global WP_Query $wp_query To check if WP_Query::bbp_is_view is true
|
| 766 |
* @uses bbp_is_query_name() To get the query name
|
| 767 |
* @return bool Is it a view page?
|
| 768 |
*/
|
| 783 |
return (bool) apply_filters( 'bbp_is_single_view', $retval );
|
| 784 |
}
|
| 785 |
|
| 786 |
+
/**
|
| 787 |
+
* Check if current page is a search page
|
| 788 |
+
*
|
| 789 |
+
* @since bbPress (r4579)
|
| 790 |
+
*
|
| 791 |
+
* @global WP_Query $wp_query To check if WP_Query::bbp_is_search is true
|
| 792 |
+
* @uses bbp_is_query_name() To get the query name
|
| 793 |
+
* @return bool Is it a search page?
|
| 794 |
+
*/
|
| 795 |
+
function bbp_is_search() {
|
| 796 |
+
global $wp_query;
|
| 797 |
+
|
| 798 |
+
// Assume false
|
| 799 |
+
$retval = false;
|
| 800 |
+
|
| 801 |
+
// Check query
|
| 802 |
+
if ( !empty( $wp_query->bbp_is_search ) && ( true == $wp_query->bbp_is_search ) )
|
| 803 |
+
$retval = true;
|
| 804 |
+
|
| 805 |
+
// Check query name
|
| 806 |
+
if ( empty( $retval ) && bbp_is_query_name( 'bbp_search' ) )
|
| 807 |
+
$retval = true;
|
| 808 |
+
|
| 809 |
+
// Check $_GET
|
| 810 |
+
if ( empty( $retval ) && isset( $_GET[bbp_get_search_rewrite_id()] ) )
|
| 811 |
+
$retval = true;
|
| 812 |
+
|
| 813 |
+
return (bool) apply_filters( 'bbp_is_search', $retval );
|
| 814 |
+
}
|
| 815 |
+
|
| 816 |
/**
|
| 817 |
* Check if current page is an edit page
|
| 818 |
*
|
| 848 |
* @uses bbp_is_topic_split()
|
| 849 |
* @uses bbp_is_single_reply()
|
| 850 |
* @uses bbp_is_reply_edit()
|
| 851 |
+
* @uses bbp_is_reply_move()
|
| 852 |
* @uses bbp_is_single_view()
|
| 853 |
* @uses bbp_is_single_user_edit()
|
| 854 |
* @uses bbp_is_single_user()
|
| 871 |
|
| 872 |
/** Archives **************************************************************/
|
| 873 |
|
| 874 |
+
if ( bbp_is_forum_archive() ) {
|
| 875 |
$bbp_classes[] = bbp_get_forum_post_type() . '-archive';
|
| 876 |
|
| 877 |
+
} elseif ( bbp_is_topic_archive() ) {
|
| 878 |
$bbp_classes[] = bbp_get_topic_post_type() . '-archive';
|
| 879 |
|
| 880 |
/** Topic Tags ************************************************************/
|
| 881 |
|
| 882 |
+
} elseif ( bbp_is_topic_tag() ) {
|
| 883 |
$bbp_classes[] = bbp_get_topic_tag_tax_id();
|
| 884 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-' . bbp_get_topic_tag_slug();
|
| 885 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-' . bbp_get_topic_tag_id();
|
| 886 |
+
} elseif ( bbp_is_topic_tag_edit() ) {
|
|
|
|
|
|
|
| 887 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-edit';
|
| 888 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-' . bbp_get_topic_tag_slug() . '-edit';
|
| 889 |
$bbp_classes[] = bbp_get_topic_tag_tax_id() . '-' . bbp_get_topic_tag_id() . '-edit';
|
|
|
|
| 890 |
|
| 891 |
/** Components ************************************************************/
|
| 892 |
|
| 893 |
+
} elseif ( bbp_is_single_forum() ) {
|
| 894 |
$bbp_classes[] = bbp_get_forum_post_type();
|
| 895 |
|
| 896 |
+
} elseif ( bbp_is_single_topic() ) {
|
| 897 |
$bbp_classes[] = bbp_get_topic_post_type();
|
| 898 |
|
| 899 |
+
} elseif ( bbp_is_single_reply() ) {
|
| 900 |
$bbp_classes[] = bbp_get_reply_post_type();
|
| 901 |
|
| 902 |
+
} elseif ( bbp_is_topic_edit() ) {
|
| 903 |
$bbp_classes[] = bbp_get_topic_post_type() . '-edit';
|
| 904 |
|
| 905 |
+
} elseif ( bbp_is_topic_merge() ) {
|
| 906 |
$bbp_classes[] = bbp_get_topic_post_type() . '-merge';
|
| 907 |
|
| 908 |
+
} elseif ( bbp_is_topic_split() ) {
|
| 909 |
$bbp_classes[] = bbp_get_topic_post_type() . '-split';
|
| 910 |
|
| 911 |
+
} elseif ( bbp_is_reply_edit() ) {
|
| 912 |
$bbp_classes[] = bbp_get_reply_post_type() . '-edit';
|
| 913 |
|
| 914 |
+
} elseif ( bbp_is_reply_move() ) {
|
| 915 |
+
$bbp_classes[] = bbp_get_reply_post_type() . '-move';
|
| 916 |
+
|
| 917 |
+
} elseif ( bbp_is_single_view() ) {
|
| 918 |
$bbp_classes[] = 'bbp-view';
|
| 919 |
|
| 920 |
/** User ******************************************************************/
|
| 921 |
|
| 922 |
+
} elseif ( bbp_is_single_user_edit() ) {
|
| 923 |
$bbp_classes[] = 'bbp-user-edit';
|
| 924 |
$bbp_classes[] = 'single';
|
| 925 |
$bbp_classes[] = 'singular';
|
|
|
|
| 926 |
|
| 927 |
+
} elseif ( bbp_is_single_user() ) {
|
| 928 |
$bbp_classes[] = 'bbp-user-page';
|
| 929 |
$bbp_classes[] = 'single';
|
| 930 |
$bbp_classes[] = 'singular';
|
|
|
|
| 931 |
|
| 932 |
+
} elseif ( bbp_is_user_home() ) {
|
| 933 |
$bbp_classes[] = 'bbp-user-home';
|
| 934 |
$bbp_classes[] = 'single';
|
| 935 |
$bbp_classes[] = 'singular';
|
|
|
|
| 936 |
|
| 937 |
+
} elseif ( bbp_is_user_home_edit() ) {
|
| 938 |
$bbp_classes[] = 'bbp-user-home-edit';
|
| 939 |
$bbp_classes[] = 'single';
|
| 940 |
$bbp_classes[] = 'singular';
|
|
|
|
| 941 |
|
| 942 |
+
} elseif ( bbp_is_topics_created() ) {
|
| 943 |
$bbp_classes[] = 'bbp-topics-created';
|
| 944 |
$bbp_classes[] = 'single';
|
| 945 |
$bbp_classes[] = 'singular';
|
|
|
|
| 946 |
|
| 947 |
+
} elseif ( bbp_is_favorites() ) {
|
| 948 |
$bbp_classes[] = 'bbp-favorites';
|
| 949 |
$bbp_classes[] = 'single';
|
| 950 |
$bbp_classes[] = 'singular';
|
|
|
|
| 951 |
|
| 952 |
+
} elseif ( bbp_is_subscriptions() ) {
|
| 953 |
$bbp_classes[] = 'bbp-subscriptions';
|
| 954 |
$bbp_classes[] = 'single';
|
| 955 |
$bbp_classes[] = 'singular';
|
| 956 |
+
|
| 957 |
+
/** Search ****************************************************************/
|
| 958 |
+
|
| 959 |
+
} elseif ( bbp_is_search() ) {
|
| 960 |
+
$bbp_classes[] = 'bbp-search';
|
| 961 |
+
$bbp_classes[] = 'forum-search';
|
| 962 |
}
|
| 963 |
|
| 964 |
/** Clean up **************************************************************/
|
| 965 |
|
| 966 |
// Add bbPress class if we are within a bbPress page
|
| 967 |
+
if ( !empty( $bbp_classes ) ) {
|
| 968 |
$bbp_classes[] = 'bbPress';
|
| 969 |
+
}
|
| 970 |
|
| 971 |
// Merge WP classes with bbPress classes and remove any duplicates
|
| 972 |
$classes = array_unique( array_merge( (array) $bbp_classes, (array) $wp_classes ) );
|
| 986 |
* @uses bbp_is_topic_split()
|
| 987 |
* @uses bbp_is_single_reply()
|
| 988 |
* @uses bbp_is_reply_edit()
|
| 989 |
+
* @uses bbp_is_reply_move()
|
| 990 |
* @uses bbp_is_single_view()
|
| 991 |
* @uses bbp_is_single_user_edit()
|
| 992 |
* @uses bbp_is_single_user()
|
| 1003 |
|
| 1004 |
/** Archives **************************************************************/
|
| 1005 |
|
| 1006 |
+
if ( bbp_is_forum_archive() ) {
|
| 1007 |
$retval = true;
|
| 1008 |
|
| 1009 |
+
} elseif ( bbp_is_topic_archive() ) {
|
| 1010 |
$retval = true;
|
| 1011 |
|
| 1012 |
/** Topic Tags ************************************************************/
|
| 1013 |
|
| 1014 |
+
} elseif ( bbp_is_topic_tag() ) {
|
| 1015 |
$retval = true;
|
| 1016 |
|
| 1017 |
+
} elseif ( bbp_is_topic_tag_edit() ) {
|
| 1018 |
$retval = true;
|
| 1019 |
|
| 1020 |
/** Components ************************************************************/
|
| 1021 |
|
| 1022 |
+
} elseif ( bbp_is_single_forum() ) {
|
| 1023 |
+
$retval = true;
|
| 1024 |
+
|
| 1025 |
+
} elseif ( bbp_is_single_topic() ) {
|
| 1026 |
$retval = true;
|
| 1027 |
|
| 1028 |
+
} elseif ( bbp_is_single_reply() ) {
|
| 1029 |
$retval = true;
|
| 1030 |
|
| 1031 |
+
} elseif ( bbp_is_topic_edit() ) {
|
| 1032 |
$retval = true;
|
| 1033 |
|
| 1034 |
+
} elseif ( bbp_is_topic_merge() ) {
|
| 1035 |
$retval = true;
|
| 1036 |
|
| 1037 |
+
} elseif ( bbp_is_topic_split() ) {
|
| 1038 |
$retval = true;
|
| 1039 |
|
| 1040 |
+
} elseif ( bbp_is_reply_edit() ) {
|
| 1041 |
$retval = true;
|
| 1042 |
|
| 1043 |
+
} elseif ( bbp_is_reply_move() ) {
|
| 1044 |
$retval = true;
|
| 1045 |
|
| 1046 |
+
} elseif ( bbp_is_single_view() ) {
|
| 1047 |
$retval = true;
|
| 1048 |
|
| 1049 |
/** User ******************************************************************/
|
| 1050 |
|
| 1051 |
+
} elseif ( bbp_is_single_user_edit() ) {
|
| 1052 |
$retval = true;
|
| 1053 |
|
| 1054 |
+
} elseif ( bbp_is_single_user() ) {
|
| 1055 |
$retval = true;
|
| 1056 |
|
| 1057 |
+
} elseif ( bbp_is_user_home() ) {
|
| 1058 |
$retval = true;
|
| 1059 |
|
| 1060 |
+
} elseif ( bbp_is_user_home_edit() ) {
|
| 1061 |
$retval = true;
|
| 1062 |
|
| 1063 |
+
} elseif ( bbp_is_topics_created() ) {
|
| 1064 |
$retval = true;
|
| 1065 |
|
| 1066 |
+
} elseif ( bbp_is_favorites() ) {
|
| 1067 |
$retval = true;
|
| 1068 |
|
| 1069 |
+
} elseif ( bbp_is_subscriptions() ) {
|
| 1070 |
+
$retval = true;
|
| 1071 |
+
|
| 1072 |
+
/** Search ****************************************************************/
|
| 1073 |
+
|
| 1074 |
+
} elseif ( bbp_is_search() ) {
|
| 1075 |
$retval = true;
|
| 1076 |
+
}
|
| 1077 |
|
| 1078 |
/** Done ******************************************************************/
|
| 1079 |
|
| 1093 |
* @uses apply_filters() Calls 'bbp_wp_login_action' with the url and args
|
| 1094 |
*/
|
| 1095 |
function bbp_wp_login_action( $args = '' ) {
|
| 1096 |
+
|
| 1097 |
+
// Parse arguments against default values
|
| 1098 |
+
$r = bbp_parse_args( $args, array(
|
| 1099 |
'action' => '',
|
| 1100 |
'context' => ''
|
| 1101 |
+
), 'login_action' );
|
| 1102 |
+
|
| 1103 |
+
// Add action as query arg
|
| 1104 |
+
if ( !empty( $r['action'] ) ) {
|
| 1105 |
+
$login_url = add_query_arg( array( 'action' => $r['action'] ), 'wp-login.php' );
|
| 1106 |
|
| 1107 |
+
// No query arg
|
| 1108 |
+
} else {
|
|
|
|
| 1109 |
$login_url = 'wp-login.php';
|
| 1110 |
+
}
|
| 1111 |
|
| 1112 |
+
$login_url = site_url( $login_url, $r['context'] );
|
| 1113 |
|
| 1114 |
echo apply_filters( 'bbp_wp_login_action', $login_url, $args );
|
| 1115 |
}
|
| 1117 |
/**
|
| 1118 |
* Output hidden request URI field for user forms.
|
| 1119 |
*
|
| 1120 |
+
* The referer link is the current Request URI from the server super global. To
|
| 1121 |
+
* check the field manually, use bbp_get_redirect_to().
|
| 1122 |
*
|
| 1123 |
* @since bbPress (r2815)
|
| 1124 |
*
|
| 1125 |
+
* @param string $redirect_to Pass a URL to redirect to
|
| 1126 |
+
*
|
| 1127 |
* @uses wp_get_referer() To get the referer
|
| 1128 |
* @uses esc_attr() To escape the url
|
| 1129 |
+
* @uses apply_filters() Calls 'bbp_redirect_to_field', passes field and to
|
|
|
|
| 1130 |
*/
|
| 1131 |
function bbp_redirect_to_field( $redirect_to = '' ) {
|
| 1132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1133 |
// Make sure we are directing somewhere
|
| 1134 |
+
if ( empty( $redirect_to ) ) {
|
| 1135 |
+
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
|
| 1136 |
+
$redirect_to = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
| 1137 |
+
} else {
|
| 1138 |
+
$redirect_to = wp_get_referer();
|
| 1139 |
+
}
|
| 1140 |
+
}
|
| 1141 |
|
| 1142 |
// Remove loggedout query arg if it's there
|
| 1143 |
$redirect_to = (string) esc_attr( remove_query_arg( 'loggedout', $redirect_to ) );
|
| 1271 |
* box, the first value would of course be selected -
|
| 1272 |
* though you can have that as none (pass 'show_none' arg))
|
| 1273 |
* - sort_column: Sort by? Defaults to 'menu_order, post_title'
|
| 1274 |
+
* - post_parent: Post parent. Defaults to 0
|
| 1275 |
* - post_status: Which all post_statuses to find in? Can be an array
|
| 1276 |
* or CSV of publish, category, closed, private, spam,
|
| 1277 |
* trash (based on post type) - if not set, these are
|
| 1306 |
|
| 1307 |
/** Arguments *********************************************************/
|
| 1308 |
|
| 1309 |
+
// Parse arguments against default values
|
| 1310 |
+
$r = bbp_parse_args( $args, array(
|
| 1311 |
'post_type' => bbp_get_forum_post_type(),
|
| 1312 |
'selected' => 0,
|
| 1313 |
'sort_column' => 'menu_order',
|
| 1314 |
+
'exclude' => array(),
|
| 1315 |
+
'post_parent' => null,
|
| 1316 |
'numberposts' => -1,
|
| 1317 |
'orderby' => 'menu_order',
|
| 1318 |
'order' => 'ASC',
|
| 1326 |
'none_found' => false,
|
| 1327 |
'disable_categories' => true,
|
| 1328 |
'disabled' => ''
|
| 1329 |
+
), 'get_dropdown' );
|
|
|
|
| 1330 |
|
| 1331 |
if ( empty( $r['walker'] ) ) {
|
| 1332 |
$r['walker'] = new BBP_Walker_Dropdown();
|
| 1334 |
}
|
| 1335 |
|
| 1336 |
// Force 0
|
| 1337 |
+
if ( is_numeric( $r['selected'] ) && $r['selected'] < 0 ) {
|
| 1338 |
$r['selected'] = 0;
|
| 1339 |
+
}
|
| 1340 |
|
| 1341 |
+
// Force array
|
| 1342 |
+
if ( !empty( $r['exclude'] ) && !is_array( $r['exclude'] ) ) {
|
| 1343 |
+
$r['exclude'] = explode( ',', $r['exclude'] );
|
| 1344 |
+
}
|
|
|
|
| 1345 |
|
| 1346 |
/** Post Status *******************************************************/
|
| 1347 |
|
| 1352 |
$post_stati[] = bbp_get_public_status_id();
|
| 1353 |
|
| 1354 |
// Forums
|
| 1355 |
+
if ( bbp_get_forum_post_type() == $r['post_type'] ) {
|
| 1356 |
|
| 1357 |
// Private forums
|
| 1358 |
if ( current_user_can( 'read_private_forums' ) ) {
|
| 1370 |
|
| 1371 |
/** Setup variables ***************************************************/
|
| 1372 |
|
| 1373 |
+
$name = esc_attr( $r['select_id'] );
|
| 1374 |
$select_id = $name;
|
| 1375 |
+
$tab = (int) $r['tab'];
|
| 1376 |
$retval = '';
|
| 1377 |
+
$disabled = disabled( isset( bbpress()->options[$r['disabled']] ), true, false );
|
| 1378 |
+
$post_arr = array(
|
| 1379 |
+
'post_type' => $r['post_type'],
|
| 1380 |
+
'post_status' => $r['post_status'],
|
| 1381 |
+
'sort_column' => $r['sort_column'],
|
| 1382 |
+
'exclude' => $r['exclude'],
|
| 1383 |
+
'post_parent' => $r['post_parent'],
|
| 1384 |
+
'numberposts' => $r['numberposts'],
|
| 1385 |
+
'orderby' => $r['orderby'],
|
| 1386 |
+
'order' => $r['order'],
|
| 1387 |
+
'walker' => $r['walker'],
|
| 1388 |
+
'disable_categories' => $r['disable_categories']
|
| 1389 |
+
);
|
| 1390 |
+
|
| 1391 |
+
$posts = get_posts( $post_arr );
|
| 1392 |
|
| 1393 |
/** Drop Down *********************************************************/
|
| 1394 |
|
| 1395 |
// Items found
|
| 1396 |
if ( !empty( $posts ) ) {
|
| 1397 |
+
if ( empty( $r['options_only'] ) ) {
|
| 1398 |
$tab = !empty( $tab ) ? ' tabindex="' . $tab . '"' : '';
|
| 1399 |
$retval .= '<select name="' . $name . '" id="' . $select_id . '"' . $tab . $disabled . '>' . "\n";
|
| 1400 |
}
|
| 1401 |
|
| 1402 |
+
$retval .= !empty( $r['show_none'] ) ? "\t<option value=\"\" class=\"level-0\">" . $r['show_none'] . '</option>' : '';
|
| 1403 |
$retval .= walk_page_dropdown_tree( $posts, 0, $r );
|
| 1404 |
|
| 1405 |
+
if ( empty( $r['options_only'] ) ) {
|
| 1406 |
$retval .= '</select>';
|
| 1407 |
+
}
|
| 1408 |
|
| 1409 |
// No items found - Display feedback if no custom message was passed
|
| 1410 |
+
} elseif ( empty( $r['none_found'] ) ) {
|
| 1411 |
|
| 1412 |
// Switch the response based on post type
|
| 1413 |
+
switch ( $r['post_type'] ) {
|
| 1414 |
|
| 1415 |
// Topics
|
| 1416 |
case bbp_get_topic_post_type() :
|
| 1613 |
*
|
| 1614 |
* @since bbPress (r2756)
|
| 1615 |
*
|
| 1616 |
+
* @uses wp_nonce_field() To generate a hidden nonce field
|
| 1617 |
*/
|
| 1618 |
function bbp_split_topic_form_fields() {
|
| 1619 |
?>
|
| 1624 |
<?php wp_nonce_field( 'bbp-split-topic_' . bbp_get_topic_id() );
|
| 1625 |
}
|
| 1626 |
|
| 1627 |
+
/**
|
| 1628 |
+
* Move reply form fields
|
| 1629 |
+
*
|
| 1630 |
+
* Output the required hidden fields when moving a reply
|
| 1631 |
+
*
|
| 1632 |
+
* @uses wp_nonce_field() To generate a hidden nonce field
|
| 1633 |
+
*/
|
| 1634 |
+
function bbp_move_reply_form_fields() {
|
| 1635 |
+
?>
|
| 1636 |
+
|
| 1637 |
+
<input type="hidden" name="action" id="bbp_post_action" value="bbp-move-reply" />
|
| 1638 |
+
<input type="hidden" name="bbp_reply_id" id="bbp_reply_id" value="<?php echo absint( $_GET['reply_id'] ); ?>" />
|
| 1639 |
+
|
| 1640 |
+
<?php wp_nonce_field( 'bbp-move-reply_' . bbp_get_reply_id() );
|
| 1641 |
+
}
|
| 1642 |
+
|
| 1643 |
/**
|
| 1644 |
* Output a textarea or TinyMCE if enabled
|
| 1645 |
*
|
| 1664 |
* @uses bbp_is_edit() To see if we are editing something
|
| 1665 |
* @uses wp_editor() To output the WordPress editor
|
| 1666 |
*
|
| 1667 |
+
* @return string HTML from output buffer
|
| 1668 |
*/
|
| 1669 |
function bbp_get_the_content( $args = array() ) {
|
| 1670 |
|
| 1671 |
+
// Parse arguments against default values
|
| 1672 |
+
$r = bbp_parse_args( $args, array(
|
| 1673 |
+
'context' => 'topic',
|
| 1674 |
+
'before' => '<div class="bbp-the-content-wrapper">',
|
| 1675 |
+
'after' => '</div>',
|
| 1676 |
+
'wpautop' => true,
|
| 1677 |
+
'media_buttons' => false,
|
| 1678 |
+
'textarea_rows' => '12',
|
| 1679 |
+
'tabindex' => bbp_get_tab_index(),
|
| 1680 |
+
'tabfocus_elements' => 'bbp_topic_title,bbp_topic_tags',
|
| 1681 |
+
'editor_class' => 'bbp-the-content',
|
| 1682 |
+
'tinymce' => true,
|
| 1683 |
+
'teeny' => true,
|
| 1684 |
+
'quicktags' => true,
|
| 1685 |
+
'dfw' => false
|
| 1686 |
+
), 'get_the_content' );
|
| 1687 |
|
| 1688 |
// Assume we are not editing
|
| 1689 |
+
$post_content = call_user_func( 'bbp_get_form_' . $r['context'] . '_content' );
|
| 1690 |
|
| 1691 |
// Start an output buffor
|
| 1692 |
ob_start();
|
| 1693 |
|
| 1694 |
// Output something before the editor
|
| 1695 |
+
if ( !empty( $r['before'] ) ) {
|
| 1696 |
+
echo $r['before'];
|
| 1697 |
+
}
|
|
|
|
|
|
|
|
|
|
| 1698 |
|
| 1699 |
// Use TinyMCE if available
|
| 1700 |
if ( bbp_use_wp_editor() ) :
|
| 1701 |
+
|
| 1702 |
+
// Enable additional TinyMCE plugins before outputting the editor
|
| 1703 |
+
add_filter( 'tiny_mce_plugins', 'bbp_get_tiny_mce_plugins' );
|
| 1704 |
+
add_filter( 'teeny_mce_plugins', 'bbp_get_tiny_mce_plugins' );
|
| 1705 |
+
add_filter( 'teeny_mce_buttons', 'bbp_get_teeny_mce_buttons' );
|
| 1706 |
+
add_filter( 'quicktags_settings', 'bbp_get_quicktags_settings' );
|
| 1707 |
+
|
| 1708 |
+
// Output the editor
|
| 1709 |
+
wp_editor( htmlspecialchars_decode( $post_content, ENT_QUOTES ), 'bbp_' . $r['context'] . '_content', array(
|
| 1710 |
+
'wpautop' => $r['wpautop'],
|
| 1711 |
+
'media_buttons' => $r['media_buttons'],
|
| 1712 |
+
'textarea_rows' => $r['textarea_rows'],
|
| 1713 |
+
'tabindex' => $r['tabindex'],
|
| 1714 |
+
'tabfocus_elements' => $r['tabfocus_elements'],
|
| 1715 |
+
'editor_class' => $r['editor_class'],
|
| 1716 |
+
'tinymce' => $r['tinymce'],
|
| 1717 |
+
'teeny' => $r['teeny'],
|
| 1718 |
+
'quicktags' => $r['quicktags'],
|
| 1719 |
+
'dfw' => $r['dfw'],
|
| 1720 |
) );
|
| 1721 |
|
| 1722 |
+
// Remove additional TinyMCE plugins after outputting the editor
|
| 1723 |
+
remove_filter( 'tiny_mce_plugins', 'bbp_get_tiny_mce_plugins' );
|
| 1724 |
+
remove_filter( 'teeny_mce_plugins', 'bbp_get_tiny_mce_plugins' );
|
| 1725 |
+
remove_filter( 'teeny_mce_buttons', 'bbp_get_teeny_mce_buttons' );
|
| 1726 |
+
remove_filter( 'quicktags_settings', 'bbp_get_quicktags_settings' );
|
| 1727 |
+
|
| 1728 |
/**
|
| 1729 |
* Fallback to normal textarea.
|
| 1730 |
*
|
| 1733 |
*/
|
| 1734 |
else : ?>
|
| 1735 |
|
| 1736 |
+
<textarea id="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" class="<?php echo esc_attr( $r['editor_class'] ); ?>" name="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" cols="60" rows="<?php echo esc_attr( $r['textarea_rows'] ); ?>" tabindex="<?php echo esc_attr( $r['tabindex'] ); ?>"><?php echo $post_content; ?></textarea>
|
| 1737 |
|
| 1738 |
<?php endif;
|
| 1739 |
|
| 1740 |
// Output something after the editor
|
| 1741 |
+
if ( !empty( $r['after'] ) ) {
|
| 1742 |
+
echo $r['after'];
|
| 1743 |
+
}
|
| 1744 |
|
| 1745 |
// Put the output into a usable variable
|
| 1746 |
$output = ob_get_contents();
|
| 1751 |
return apply_filters( 'bbp_get_the_content', $output, $args, $post_content );
|
| 1752 |
}
|
| 1753 |
|
| 1754 |
+
/**
|
| 1755 |
+
* Edit TinyMCE plugins to match core behaviour
|
| 1756 |
+
*
|
| 1757 |
+
* @since bbPress (r4574)
|
| 1758 |
+
*
|
| 1759 |
+
* @param array $plugins
|
| 1760 |
+
* @see tiny_mce_plugins, teeny_mce_plugins
|
| 1761 |
+
* @return array
|
| 1762 |
+
*/
|
| 1763 |
+
function bbp_get_tiny_mce_plugins( $plugins = array() ) {
|
| 1764 |
+
|
| 1765 |
+
// Unset fullscreen
|
| 1766 |
+
foreach ( $plugins as $key => $value ) {
|
| 1767 |
+
if ( 'fullscreen' == $value ) {
|
| 1768 |
+
unset( $plugins[$key] );
|
| 1769 |
+
break;
|
| 1770 |
+
}
|
| 1771 |
+
}
|
| 1772 |
+
|
| 1773 |
+
// Add the tabfocus plugin
|
| 1774 |
+
$plugins[] = 'tabfocus';
|
| 1775 |
+
|
| 1776 |
+
return apply_filters( 'bbp_get_tiny_mce_plugins', $plugins );
|
| 1777 |
+
}
|
| 1778 |
+
|
| 1779 |
+
/**
|
| 1780 |
+
* Edit TeenyMCE buttons to match allowedtags
|
| 1781 |
+
*
|
| 1782 |
+
* @since bbPress (r4605)
|
| 1783 |
+
*
|
| 1784 |
+
* @param array $buttons
|
| 1785 |
+
* @see teeny_mce_buttons
|
| 1786 |
+
* @return array
|
| 1787 |
+
*/
|
| 1788 |
+
function bbp_get_teeny_mce_buttons( $buttons = array() ) {
|
| 1789 |
+
|
| 1790 |
+
// Remove some buttons from TeenyMCE
|
| 1791 |
+
$buttons = array_diff( $buttons, array(
|
| 1792 |
+
'underline',
|
| 1793 |
+
'justifyleft',
|
| 1794 |
+
'justifycenter',
|
| 1795 |
+
'justifyright'
|
| 1796 |
+
) );
|
| 1797 |
+
|
| 1798 |
+
// Images
|
| 1799 |
+
array_push( $buttons, 'image' );
|
| 1800 |
+
|
| 1801 |
+
return apply_filters( 'bbp_get_teeny_mce_buttons', $buttons );
|
| 1802 |
+
}
|
| 1803 |
+
|
| 1804 |
+
/**
|
| 1805 |
+
* Edit TinyMCE quicktags buttons to match allowedtags
|
| 1806 |
+
*
|
| 1807 |
+
* @since bbPress (r4606)
|
| 1808 |
+
*
|
| 1809 |
+
* @param array $buttons
|
| 1810 |
+
* @see quicktags_settings
|
| 1811 |
+
* @return array Quicktags settings
|
| 1812 |
+
*/
|
| 1813 |
+
function bbp_get_quicktags_settings( $settings = array() ) {
|
| 1814 |
+
|
| 1815 |
+
// Get buttons out of settings
|
| 1816 |
+
$buttons_array = explode( ',', $settings['buttons'] );
|
| 1817 |
+
|
| 1818 |
+
// Diff the ones we don't want out
|
| 1819 |
+
$buttons = array_diff( $buttons_array, array(
|
| 1820 |
+
'ins',
|
| 1821 |
+
'more',
|
| 1822 |
+
'spell'
|
| 1823 |
+
) );
|
| 1824 |
+
|
| 1825 |
+
// Put them back into a string in the $settings array
|
| 1826 |
+
$settings['buttons'] = implode( ',', $buttons );
|
| 1827 |
+
|
| 1828 |
+
return apply_filters( 'bbp_get_quicktags_settings', $settings );
|
| 1829 |
+
}
|
| 1830 |
+
|
| 1831 |
/** Views *********************************************************************/
|
| 1832 |
|
| 1833 |
/**
|
| 2063 |
// No custom home text
|
| 2064 |
if ( empty( $args['home_text'] ) ) {
|
| 2065 |
|
|
|
|
| 2066 |
$front_id = get_option( 'page_on_front' );
|
| 2067 |
+
|
| 2068 |
+
// Set home text to page title
|
| 2069 |
if ( !empty( $front_id ) ) {
|
| 2070 |
$pre_front_text = get_the_title( $front_id );
|
| 2071 |
|
| 2089 |
/** Includes **********************************************************/
|
| 2090 |
|
| 2091 |
// Root slug is also the front page
|
| 2092 |
+
if ( !empty( $front_id ) && ( $front_id == $root_id ) ) {
|
| 2093 |
$pre_include_root = false;
|
| 2094 |
+
}
|
| 2095 |
|
| 2096 |
// Don't show root if viewing forum archive
|
| 2097 |
+
if ( bbp_is_forum_archive() ) {
|
| 2098 |
$pre_include_root = false;
|
| 2099 |
+
}
|
| 2100 |
|
| 2101 |
// Don't show root if viewing page in place of forum archive
|
| 2102 |
+
if ( !empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id == get_the_ID() ) ) ) {
|
| 2103 |
$pre_include_root = false;
|
| 2104 |
+
}
|
| 2105 |
|
| 2106 |
/** Current Text ******************************************************/
|
| 2107 |
|
| 2155 |
/** Parse Args ********************************************************/
|
| 2156 |
|
| 2157 |
// Parse args
|
| 2158 |
+
$r = bbp_parse_args( $args, array(
|
| 2159 |
|
| 2160 |
// HTML
|
| 2161 |
'before' => '<div class="bbp-breadcrumb"><p>',
|
| 2162 |
'after' => '</p></div>',
|
| 2163 |
+
|
| 2164 |
// Separator
|
| 2165 |
+
'sep' => is_rtl() ? __( '‹', 'bbpress' ) : __( '›', 'bbpress' ),
|
| 2166 |
'pad_sep' => 1,
|
| 2167 |
'sep_before' => '<span class="bbp-breadcrumb-sep">',
|
| 2168 |
'sep_after' => '</span>',
|
| 2169 |
+
|
| 2170 |
// Crumbs
|
| 2171 |
'crumb_before' => '',
|
| 2172 |
'crumb_after' => '',
|
| 2184 |
'current_text' => $pre_current_text,
|
| 2185 |
'current_before' => '<span class="bbp-breadcrumb-current">',
|
| 2186 |
'current_after' => '</span>',
|
| 2187 |
+
), 'get_breadcrumb' );
|
|
|
|
|
|
|
| 2188 |
|
| 2189 |
/** Ancestors *********************************************************/
|
| 2190 |
|
| 2191 |
// Get post ancestors
|
| 2192 |
+
if ( is_singular() || bbp_is_forum_edit() || bbp_is_topic_edit() || bbp_is_reply_edit() ) {
|
| 2193 |
$ancestors = array_reverse( (array) get_post_ancestors( get_the_ID() ) );
|
| 2194 |
+
}
|
| 2195 |
|
| 2196 |
// Do we want to include a link to home?
|
| 2197 |
+
if ( !empty( $r['include_home'] ) || empty( $r['home_text'] ) ) {
|
| 2198 |
+
$crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>';
|
| 2199 |
+
}
|
| 2200 |
|
| 2201 |
// Do we want to include a link to the forum root?
|
| 2202 |
+
if ( !empty( $r['include_root'] ) || empty( $r['root_text'] ) ) {
|
| 2203 |
|
| 2204 |
// Page exists at root slug path, so use its permalink
|
| 2205 |
$page = bbp_get_page_by_path( bbp_get_root_slug() );
|
| 2212 |
}
|
| 2213 |
|
| 2214 |
// Add the breadcrumb
|
| 2215 |
+
$crumbs[] = '<a href="' . $root_url . '" class="bbp-breadcrumb-root">' . $r['root_text'] . '</a>';
|
| 2216 |
}
|
| 2217 |
|
| 2218 |
// Ancestors exist
|
| 2252 |
// Edit topic tag
|
| 2253 |
} elseif ( bbp_is_topic_tag_edit() ) {
|
| 2254 |
$crumbs[] = '<a href="' . get_term_link( bbp_get_topic_tag_id(), bbp_get_topic_tag_tax_id() ) . '" class="bbp-breadcrumb-topic-tag">' . sprintf( __( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ) . '</a>';
|
| 2255 |
+
|
| 2256 |
+
// Search
|
| 2257 |
+
} elseif ( bbp_is_search() && bbp_get_search_terms() ) {
|
| 2258 |
+
$crumbs[] = '<a href="' . home_url( bbp_get_search_slug() ) . '" class="bbp-breadcrumb-search">' . __( 'Search', 'bbpress' ) . '</a>';
|
| 2259 |
}
|
| 2260 |
|
| 2261 |
/** Current ***********************************************************/
|
| 2262 |
|
| 2263 |
// Add current page to breadcrumb
|
| 2264 |
+
if ( !empty( $r['include_current'] ) || empty( $r['pre_current_text'] ) ) {
|
| 2265 |
+
$crumbs[] = $r['current_before'] . $r['current_text'] . $r['current_after'];
|
| 2266 |
+
}
|
| 2267 |
|
| 2268 |
/** Separator *********************************************************/
|
| 2269 |
|
| 2270 |
// Wrap the separator in before/after before padding and filter
|
| 2271 |
+
if ( ! empty( $r['sep'] ) ) {
|
| 2272 |
+
$sep = $r['sep_before'] . $r['sep'] . $r['sep_after'];
|
| 2273 |
+
}
|
| 2274 |
|
| 2275 |
// Pad the separator
|
| 2276 |
+
if ( !empty( $r['pad_sep'] ) ) {
|
| 2277 |
+
$sep = str_pad( $sep, strlen( $sep ) + ( (int) $r['pad_sep'] * 2 ), ' ', STR_PAD_BOTH );
|
| 2278 |
+
}
|
| 2279 |
|
| 2280 |
/** Finish Up *********************************************************/
|
| 2281 |
|
| 2284 |
$crumbs = apply_filters( 'bbp_breadcrumbs', $crumbs );
|
| 2285 |
|
| 2286 |
// Build the trail
|
| 2287 |
+
$trail = !empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'] , $crumbs ) . $r['crumb_after'] . $r['after'] ) : '';
|
| 2288 |
|
| 2289 |
return apply_filters( 'bbp_get_breadcrumb', $trail, $crumbs, $r );
|
| 2290 |
}
|
| 2312 |
*
|
| 2313 |
* @since bbPress (r2780)
|
| 2314 |
*
|
| 2315 |
+
* @uses bbp_kses_allowed_tags() To get the allowed tags
|
| 2316 |
* @uses apply_filters() Calls 'bbp_allowed_tags' with the tags
|
| 2317 |
* @return string HTML allowed tags entity encoded.
|
| 2318 |
*/
|
| 2319 |
function bbp_get_allowed_tags() {
|
| 2320 |
+
|
| 2321 |
+
$allowed = '';
|
| 2322 |
+
|
| 2323 |
+
foreach ( (array) bbp_kses_allowed_tags() as $tag => $attributes ) {
|
| 2324 |
+
$allowed .= '<' . $tag;
|
| 2325 |
+
if ( 0 < count( $attributes ) ) {
|
| 2326 |
+
foreach ( array_keys( $attributes ) as $attribute ) {
|
| 2327 |
+
$allowed .= ' ' . $attribute . '=""';
|
| 2328 |
+
}
|
| 2329 |
+
}
|
| 2330 |
+
$allowed .= '> ';
|
| 2331 |
+
}
|
| 2332 |
+
|
| 2333 |
+
return apply_filters( 'bbp_get_allowed_tags', htmlentities( $allowed ) );
|
| 2334 |
}
|
| 2335 |
|
| 2336 |
/** Errors & Messages *********************************************************/
|
| 2523 |
// Views
|
| 2524 |
} elseif ( bbp_is_single_view() ) {
|
| 2525 |
$title = sprintf( __( 'View: %s', 'bbpress' ), bbp_get_view_title() );
|
| 2526 |
+
|
| 2527 |
+
/** Search ****************************************************************/
|
| 2528 |
+
|
| 2529 |
+
// Search
|
| 2530 |
+
} elseif ( bbp_is_search() ) {
|
| 2531 |
+
$title = bbp_get_search_title();
|
| 2532 |
}
|
| 2533 |
|
| 2534 |
// Filter the raw title
|
includes/common/widgets.php
CHANGED
|
@@ -64,16 +64,19 @@ class BBP_Login_Widget extends WP_Widget {
|
|
| 64 |
* @uses get_template_part() To get the login/logged in form
|
| 65 |
*/
|
| 66 |
public function widget( $args, $instance ) {
|
| 67 |
-
extract( $args );
|
| 68 |
|
| 69 |
-
|
| 70 |
-
$
|
| 71 |
-
$lostpass = apply_filters( 'bbp_login_widget_lostpass', $instance['lostpass'] );
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
if ( !empty( $title ) )
|
| 76 |
-
echo $before_title . $title . $after_title;
|
| 77 |
|
| 78 |
if ( !is_user_logged_in() ) : ?>
|
| 79 |
|
|
@@ -140,7 +143,7 @@ class BBP_Login_Widget extends WP_Widget {
|
|
| 140 |
|
| 141 |
<?php endif;
|
| 142 |
|
| 143 |
-
echo $after_widget;
|
| 144 |
}
|
| 145 |
|
| 146 |
/**
|
|
@@ -255,16 +258,18 @@ class BBP_Views_Widget extends WP_Widget {
|
|
| 255 |
// Only output widget contents if views exist
|
| 256 |
if ( bbp_get_views() ) :
|
| 257 |
|
| 258 |
-
|
|
|
|
| 259 |
|
| 260 |
-
|
|
|
|
| 261 |
|
| 262 |
-
echo $before_widget;
|
| 263 |
-
echo $before_title . $title . $after_title; ?>
|
| 264 |
|
| 265 |
<ul>
|
| 266 |
|
| 267 |
-
<?php foreach ( bbp_get_views() as $view
|
| 268 |
|
| 269 |
<li><a class="bbp-view-title" href="<?php bbp_view_url( $view ); ?>" title="<?php bbp_view_title( $view ); ?>"><?php bbp_view_title( $view ); ?></a></li>
|
| 270 |
|
|
@@ -272,7 +277,7 @@ class BBP_Views_Widget extends WP_Widget {
|
|
| 272 |
|
| 273 |
</ul>
|
| 274 |
|
| 275 |
-
<?php echo $after_widget;
|
| 276 |
|
| 277 |
endif;
|
| 278 |
}
|
|
@@ -314,6 +319,108 @@ class BBP_Views_Widget extends WP_Widget {
|
|
| 314 |
}
|
| 315 |
}
|
| 316 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
/**
|
| 318 |
* bbPress Forum Widget
|
| 319 |
*
|
|
@@ -374,9 +481,12 @@ class BBP_Forums_Widget extends WP_Widget {
|
|
| 374 |
* @uses bbp_forum_title() To display the forum title
|
| 375 |
*/
|
| 376 |
public function widget( $args, $instance ) {
|
| 377 |
-
extract( $args );
|
| 378 |
|
| 379 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 380 |
$parent_forum = !empty( $instance['parent_forum'] ) ? $instance['parent_forum'] : '0';
|
| 381 |
|
| 382 |
// Note: private and hidden forums will be excluded via the
|
|
@@ -391,8 +501,8 @@ class BBP_Forums_Widget extends WP_Widget {
|
|
| 391 |
|
| 392 |
if ( $widget_query->have_posts() ) :
|
| 393 |
|
| 394 |
-
echo $before_widget;
|
| 395 |
-
echo $before_title . $title . $after_title; ?>
|
| 396 |
|
| 397 |
<ul>
|
| 398 |
|
|
@@ -404,7 +514,7 @@ class BBP_Forums_Widget extends WP_Widget {
|
|
| 404 |
|
| 405 |
</ul>
|
| 406 |
|
| 407 |
-
<?php echo $after_widget;
|
| 408 |
|
| 409 |
// Reset the $post global
|
| 410 |
wp_reset_postdata();
|
|
@@ -523,9 +633,11 @@ class BBP_Topics_Widget extends WP_Widget {
|
|
| 523 |
*/
|
| 524 |
public function widget( $args, $instance ) {
|
| 525 |
|
| 526 |
-
|
|
|
|
| 527 |
|
| 528 |
-
|
|
|
|
| 529 |
$max_shown = !empty( $instance['max_shown'] ) ? (int) $instance['max_shown'] : 5;
|
| 530 |
$show_date = !empty( $instance['show_date'] ) ? 'on' : false;
|
| 531 |
$show_user = !empty( $instance['show_user'] ) ? 'on' : false;
|
|
@@ -564,7 +676,7 @@ class BBP_Topics_Widget extends WP_Widget {
|
|
| 564 |
'orderby' => 'meta_value',
|
| 565 |
'order' => 'DESC',
|
| 566 |
'meta_query' => array( bbp_exclude_forum_ids( 'meta_query' ) )
|
| 567 |
-
);
|
| 568 |
break;
|
| 569 |
|
| 570 |
// Order by which topic was created most recently
|
|
@@ -579,26 +691,26 @@ class BBP_Topics_Widget extends WP_Widget {
|
|
| 579 |
'show_stickes' => false,
|
| 580 |
'order' => 'DESC',
|
| 581 |
'meta_query' => array( bbp_exclude_forum_ids( 'meta_query' ) )
|
| 582 |
-
);
|
| 583 |
break;
|
| 584 |
}
|
| 585 |
-
|
| 586 |
// Note: private and hidden forums will be excluded via the
|
| 587 |
// bbp_pre_get_posts_exclude_forums filter and function.
|
| 588 |
$widget_query = new WP_Query( $topics_query );
|
| 589 |
|
| 590 |
// Topics exist
|
| 591 |
-
if ( $widget_query->have_posts() ) :
|
| 592 |
-
|
| 593 |
-
echo $before_widget;
|
| 594 |
-
echo $before_title . $title . $after_title; ?>
|
| 595 |
|
| 596 |
<ul>
|
| 597 |
|
| 598 |
<?php while ( $widget_query->have_posts() ) :
|
| 599 |
|
| 600 |
$widget_query->the_post();
|
| 601 |
-
$topic_id = bbp_get_topic_id( $widget_query->post->ID );
|
| 602 |
$author_link = bbp_get_topic_author_link( array( 'post_id' => $topic_id, 'type' => 'both', 'size' => 14 ) ); ?>
|
| 603 |
|
| 604 |
<li>
|
|
@@ -622,7 +734,7 @@ class BBP_Topics_Widget extends WP_Widget {
|
|
| 622 |
|
| 623 |
</ul>
|
| 624 |
|
| 625 |
-
<?php echo $after_widget;
|
| 626 |
|
| 627 |
// Reset the $post global
|
| 628 |
wp_reset_postdata();
|
|
@@ -683,6 +795,111 @@ class BBP_Topics_Widget extends WP_Widget {
|
|
| 683 |
}
|
| 684 |
}
|
| 685 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 686 |
/**
|
| 687 |
* bbPress Replies Widget
|
| 688 |
*
|
|
@@ -743,9 +960,11 @@ class BBP_Replies_Widget extends WP_Widget {
|
|
| 743 |
*/
|
| 744 |
public function widget( $args, $instance ) {
|
| 745 |
|
| 746 |
-
|
|
|
|
| 747 |
|
| 748 |
-
|
|
|
|
| 749 |
$max_shown = !empty( $instance['max_shown'] ) ? $instance['max_shown'] : '5';
|
| 750 |
$show_date = !empty( $instance['show_date'] ) ? 'on' : false;
|
| 751 |
$show_user = !empty( $instance['show_user'] ) ? 'on' : false;
|
|
@@ -763,8 +982,8 @@ class BBP_Replies_Widget extends WP_Widget {
|
|
| 763 |
// Get replies and display them
|
| 764 |
if ( $widget_query->have_posts() ) :
|
| 765 |
|
| 766 |
-
echo $before_widget;
|
| 767 |
-
echo $before_title . $title . $after_title; ?>
|
| 768 |
|
| 769 |
<ul>
|
| 770 |
|
|
@@ -812,7 +1031,7 @@ class BBP_Replies_Widget extends WP_Widget {
|
|
| 812 |
|
| 813 |
</ul>
|
| 814 |
|
| 815 |
-
<?php echo $after_widget;
|
| 816 |
|
| 817 |
// Reset the $post global
|
| 818 |
wp_reset_postdata();
|
| 64 |
* @uses get_template_part() To get the login/logged in form
|
| 65 |
*/
|
| 66 |
public function widget( $args, $instance ) {
|
|
|
|
| 67 |
|
| 68 |
+
// Typical WordPress filter
|
| 69 |
+
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
|
|
|
| 70 |
|
| 71 |
+
// bbPress filters
|
| 72 |
+
$title = apply_filters( 'bbp_login_widget_title', $instance['title'], $instance, $this->id_base );
|
| 73 |
+
$register = apply_filters( 'bbp_login_widget_register', $instance['register'], $instance, $this->id_base );
|
| 74 |
+
$lostpass = apply_filters( 'bbp_login_widget_lostpass', $instance['lostpass'], $instance, $this->id_base );
|
| 75 |
+
|
| 76 |
+
echo $args['before_widget'];
|
| 77 |
|
| 78 |
if ( !empty( $title ) )
|
| 79 |
+
echo $args['before_title'] . $title . $args['after_title'];
|
| 80 |
|
| 81 |
if ( !is_user_logged_in() ) : ?>
|
| 82 |
|
| 143 |
|
| 144 |
<?php endif;
|
| 145 |
|
| 146 |
+
echo $args['after_widget'];
|
| 147 |
}
|
| 148 |
|
| 149 |
/**
|
| 258 |
// Only output widget contents if views exist
|
| 259 |
if ( bbp_get_views() ) :
|
| 260 |
|
| 261 |
+
// Typical WordPress filter
|
| 262 |
+
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
| 263 |
|
| 264 |
+
// bbPress filter
|
| 265 |
+
$title = apply_filters( 'bbp_view_widget_title', $instance['title'], $instance, $this->id_base );
|
| 266 |
|
| 267 |
+
echo $args['before_widget'];
|
| 268 |
+
echo $args['before_title'] . $title . $args['after_title']; ?>
|
| 269 |
|
| 270 |
<ul>
|
| 271 |
|
| 272 |
+
<?php foreach ( array_keys( bbp_get_views() ) as $view ) : ?>
|
| 273 |
|
| 274 |
<li><a class="bbp-view-title" href="<?php bbp_view_url( $view ); ?>" title="<?php bbp_view_title( $view ); ?>"><?php bbp_view_title( $view ); ?></a></li>
|
| 275 |
|
| 277 |
|
| 278 |
</ul>
|
| 279 |
|
| 280 |
+
<?php echo $args['after_widget'];
|
| 281 |
|
| 282 |
endif;
|
| 283 |
}
|
| 319 |
}
|
| 320 |
}
|
| 321 |
|
| 322 |
+
/**
|
| 323 |
+
* bbPress Search Widget
|
| 324 |
+
*
|
| 325 |
+
* Adds a widget which displays the forum search form
|
| 326 |
+
*
|
| 327 |
+
* @since bbPress (r4579)
|
| 328 |
+
*
|
| 329 |
+
* @uses WP_Widget
|
| 330 |
+
*/
|
| 331 |
+
class BBP_Search_Widget extends WP_Widget {
|
| 332 |
+
|
| 333 |
+
/**
|
| 334 |
+
* bbPress Search Widget
|
| 335 |
+
*
|
| 336 |
+
* Registers the search widget
|
| 337 |
+
*
|
| 338 |
+
* @since bbPress (r4579)
|
| 339 |
+
*
|
| 340 |
+
* @uses apply_filters() Calls 'bbp_search_widget_options' with the
|
| 341 |
+
* widget options
|
| 342 |
+
*/
|
| 343 |
+
public function __construct() {
|
| 344 |
+
$widget_ops = apply_filters( 'bbp_search_widget_options', array(
|
| 345 |
+
'classname' => 'widget_display_search',
|
| 346 |
+
'description' => __( 'The bbPress forum search form.', 'bbpress' )
|
| 347 |
+
) );
|
| 348 |
+
|
| 349 |
+
parent::__construct( false, __( '(bbPress) Forum Search Form', 'bbpress' ), $widget_ops );
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
/**
|
| 353 |
+
* Register the widget
|
| 354 |
+
*
|
| 355 |
+
* @since bbPress (r4579)
|
| 356 |
+
*
|
| 357 |
+
* @uses register_widget()
|
| 358 |
+
*/
|
| 359 |
+
public static function register_widget() {
|
| 360 |
+
register_widget( 'BBP_Search_Widget' );
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
/**
|
| 364 |
+
* Displays the output, the search form
|
| 365 |
+
*
|
| 366 |
+
* @since bbPress (r4579)
|
| 367 |
+
*
|
| 368 |
+
* @uses apply_filters() Calls 'bbp_search_widget_title' with the title
|
| 369 |
+
* @uses get_template_part() To get the search form
|
| 370 |
+
*/
|
| 371 |
+
public function widget( $args, $instance ) {
|
| 372 |
+
|
| 373 |
+
// Typical WordPress filter
|
| 374 |
+
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
| 375 |
+
|
| 376 |
+
// bbPress filter
|
| 377 |
+
$title = apply_filters( 'bbp_search_widget_title', $instance['title'], $instance, $this->id_base );
|
| 378 |
+
|
| 379 |
+
echo $args['before_widget'];
|
| 380 |
+
echo $args['before_title'] . $title . $args['after_title'];
|
| 381 |
+
|
| 382 |
+
bbp_get_template_part( 'form', 'search' );
|
| 383 |
+
|
| 384 |
+
echo $args['after_widget'];
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
/**
|
| 388 |
+
* Update the widget options
|
| 389 |
+
*
|
| 390 |
+
* @since bbPress (r4579)
|
| 391 |
+
*
|
| 392 |
+
* @param array $new_instance The new instance options
|
| 393 |
+
* @param array $old_instance The old instance options
|
| 394 |
+
*/
|
| 395 |
+
public function update( $new_instance, $old_instance ) {
|
| 396 |
+
$instance = $old_instance;
|
| 397 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
| 398 |
+
|
| 399 |
+
return $instance;
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
/**
|
| 403 |
+
* Output the search widget options form
|
| 404 |
+
*
|
| 405 |
+
* @since bbPress (r4579)
|
| 406 |
+
*
|
| 407 |
+
* @param $instance Instance
|
| 408 |
+
* @uses BBP_Search_Widget::get_field_id() To output the field id
|
| 409 |
+
* @uses BBP_Search_Widget::get_field_name() To output the field name
|
| 410 |
+
*/
|
| 411 |
+
public function form( $instance ) {
|
| 412 |
+
$title = !empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; ?>
|
| 413 |
+
|
| 414 |
+
<p>
|
| 415 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'bbpress' ); ?>
|
| 416 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />
|
| 417 |
+
</label>
|
| 418 |
+
</p>
|
| 419 |
+
|
| 420 |
+
<?php
|
| 421 |
+
}
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
/**
|
| 425 |
* bbPress Forum Widget
|
| 426 |
*
|
| 481 |
* @uses bbp_forum_title() To display the forum title
|
| 482 |
*/
|
| 483 |
public function widget( $args, $instance ) {
|
|
|
|
| 484 |
|
| 485 |
+
// Typical WordPress filter
|
| 486 |
+
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
| 487 |
+
|
| 488 |
+
// bbPress filter
|
| 489 |
+
$title = apply_filters( 'bbp_forum_widget_title', $instance['title'], $instance, $this->id_base );
|
| 490 |
$parent_forum = !empty( $instance['parent_forum'] ) ? $instance['parent_forum'] : '0';
|
| 491 |
|
| 492 |
// Note: private and hidden forums will be excluded via the
|
| 501 |
|
| 502 |
if ( $widget_query->have_posts() ) :
|
| 503 |
|
| 504 |
+
echo $args['before_widget'];
|
| 505 |
+
echo $args['before_title'] . $title . $args['after_title']; ?>
|
| 506 |
|
| 507 |
<ul>
|
| 508 |
|
| 514 |
|
| 515 |
</ul>
|
| 516 |
|
| 517 |
+
<?php echo $args['after_widget'];
|
| 518 |
|
| 519 |
// Reset the $post global
|
| 520 |
wp_reset_postdata();
|
| 633 |
*/
|
| 634 |
public function widget( $args, $instance ) {
|
| 635 |
|
| 636 |
+
// Typical WordPress filter
|
| 637 |
+
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
| 638 |
|
| 639 |
+
// bbPress filter
|
| 640 |
+
$title = apply_filters( 'bbp_topic_widget_title', $instance['title'], $instance, $this->id_base );
|
| 641 |
$max_shown = !empty( $instance['max_shown'] ) ? (int) $instance['max_shown'] : 5;
|
| 642 |
$show_date = !empty( $instance['show_date'] ) ? 'on' : false;
|
| 643 |
$show_user = !empty( $instance['show_user'] ) ? 'on' : false;
|
| 676 |
'orderby' => 'meta_value',
|
| 677 |
'order' => 'DESC',
|
| 678 |
'meta_query' => array( bbp_exclude_forum_ids( 'meta_query' ) )
|
| 679 |
+
);
|
| 680 |
break;
|
| 681 |
|
| 682 |
// Order by which topic was created most recently
|
| 691 |
'show_stickes' => false,
|
| 692 |
'order' => 'DESC',
|
| 693 |
'meta_query' => array( bbp_exclude_forum_ids( 'meta_query' ) )
|
| 694 |
+
);
|
| 695 |
break;
|
| 696 |
}
|
| 697 |
+
|
| 698 |
// Note: private and hidden forums will be excluded via the
|
| 699 |
// bbp_pre_get_posts_exclude_forums filter and function.
|
| 700 |
$widget_query = new WP_Query( $topics_query );
|
| 701 |
|
| 702 |
// Topics exist
|
| 703 |
+
if ( $widget_query->have_posts() ) :
|
| 704 |
+
|
| 705 |
+
echo $args['before_widget'];
|
| 706 |
+
echo $args['before_title'] . $title . $args['after_title']; ?>
|
| 707 |
|
| 708 |
<ul>
|
| 709 |
|
| 710 |
<?php while ( $widget_query->have_posts() ) :
|
| 711 |
|
| 712 |
$widget_query->the_post();
|
| 713 |
+
$topic_id = bbp_get_topic_id( $widget_query->post->ID );
|
| 714 |
$author_link = bbp_get_topic_author_link( array( 'post_id' => $topic_id, 'type' => 'both', 'size' => 14 ) ); ?>
|
| 715 |
|
| 716 |
<li>
|
| 734 |
|
| 735 |
</ul>
|
| 736 |
|
| 737 |
+
<?php echo $args['after_widget'];
|
| 738 |
|
| 739 |
// Reset the $post global
|
| 740 |
wp_reset_postdata();
|
| 795 |
}
|
| 796 |
}
|
| 797 |
|
| 798 |
+
/**
|
| 799 |
+
* bbPress Stats Widget
|
| 800 |
+
*
|
| 801 |
+
* Adds a widget which displays the forum statistics
|
| 802 |
+
*
|
| 803 |
+
* @since bbPress (r4509)
|
| 804 |
+
*
|
| 805 |
+
* @uses WP_Widget
|
| 806 |
+
*/
|
| 807 |
+
class BBP_Stats_Widget extends WP_Widget {
|
| 808 |
+
|
| 809 |
+
/**
|
| 810 |
+
* bbPress Stats Widget
|
| 811 |
+
*
|
| 812 |
+
* Registers the stats widget
|
| 813 |
+
*
|
| 814 |
+
* @since bbPress (r4509)
|
| 815 |
+
*
|
| 816 |
+
* @uses apply_filters() Calls 'bbp_stats_widget_options' with the
|
| 817 |
+
* widget options
|
| 818 |
+
*/
|
| 819 |
+
public function __construct() {
|
| 820 |
+
$widget_ops = apply_filters( 'bbp_stats_widget_options', array(
|
| 821 |
+
'classname' => 'widget_display_stats',
|
| 822 |
+
'description' => __( 'Some statistics from your forum.', 'bbpress' )
|
| 823 |
+
) );
|
| 824 |
+
|
| 825 |
+
parent::__construct( false, __( '(bbPress) Statistics', 'bbpress' ), $widget_ops );
|
| 826 |
+
}
|
| 827 |
+
|
| 828 |
+
/**
|
| 829 |
+
* Register the widget
|
| 830 |
+
*
|
| 831 |
+
* @since bbPress (r4509)
|
| 832 |
+
*
|
| 833 |
+
* @uses register_widget()
|
| 834 |
+
*/
|
| 835 |
+
public static function register_widget() {
|
| 836 |
+
register_widget( 'BBP_Stats_Widget' );
|
| 837 |
+
}
|
| 838 |
+
|
| 839 |
+
/**
|
| 840 |
+
* Displays the output, the statistics
|
| 841 |
+
*
|
| 842 |
+
* @since bbPress (r4509)
|
| 843 |
+
*
|
| 844 |
+
* @param mixed $args Arguments
|
| 845 |
+
* @param array $instance Instance
|
| 846 |
+
*
|
| 847 |
+
* @uses apply_filters() Calls 'bbp_stats_widget_title' with the title
|
| 848 |
+
* @uses bbp_get_template_part() To get the content-forum-statistics template
|
| 849 |
+
*/
|
| 850 |
+
public function widget( $args, $instance ) {
|
| 851 |
+
|
| 852 |
+
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
| 853 |
+
$title = apply_filters( 'bbp_stats_widget_title', $instance['title'], $instance, $this->id_base );
|
| 854 |
+
|
| 855 |
+
echo $args['before_widget'];
|
| 856 |
+
echo $args['before_title'] . $title . $args['after_title'];
|
| 857 |
+
|
| 858 |
+
bbp_get_template_part( 'content', 'statistics' );
|
| 859 |
+
|
| 860 |
+
echo $args['after_widget'];
|
| 861 |
+
}
|
| 862 |
+
|
| 863 |
+
/**
|
| 864 |
+
* Update the stats widget options
|
| 865 |
+
*
|
| 866 |
+
* @since bbPress (r4509)
|
| 867 |
+
*
|
| 868 |
+
* @param array $new_instance The new instance options
|
| 869 |
+
* @param array $old_instance The old instance options
|
| 870 |
+
*
|
| 871 |
+
* @return array
|
| 872 |
+
*/
|
| 873 |
+
public function update( $new_instance, $old_instance ) {
|
| 874 |
+
$instance = $old_instance;
|
| 875 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
| 876 |
+
|
| 877 |
+
return $instance;
|
| 878 |
+
}
|
| 879 |
+
|
| 880 |
+
/**
|
| 881 |
+
* Output the stats widget options form
|
| 882 |
+
*
|
| 883 |
+
* @since bbPress (r4509)
|
| 884 |
+
*
|
| 885 |
+
* @param $instance
|
| 886 |
+
*
|
| 887 |
+
* @return string|void
|
| 888 |
+
*/
|
| 889 |
+
public function form( $instance ) {
|
| 890 |
+
$title = !empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; ?>
|
| 891 |
+
|
| 892 |
+
<p>
|
| 893 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'bbpress' ); ?>
|
| 894 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>"
|
| 895 |
+
name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>"/>
|
| 896 |
+
</label>
|
| 897 |
+
</p>
|
| 898 |
+
|
| 899 |
+
<?php
|
| 900 |
+
}
|
| 901 |
+
}
|
| 902 |
+
|
| 903 |
/**
|
| 904 |
* bbPress Replies Widget
|
| 905 |
*
|
| 960 |
*/
|
| 961 |
public function widget( $args, $instance ) {
|
| 962 |
|
| 963 |
+
// Typical WordPress filter
|
| 964 |
+
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
| 965 |
|
| 966 |
+
// bbPress filter
|
| 967 |
+
$title = apply_filters( 'bbp_replies_widget_title', $instance['title'], $instance, $this->id_base );
|
| 968 |
$max_shown = !empty( $instance['max_shown'] ) ? $instance['max_shown'] : '5';
|
| 969 |
$show_date = !empty( $instance['show_date'] ) ? 'on' : false;
|
| 970 |
$show_user = !empty( $instance['show_user'] ) ? 'on' : false;
|
| 982 |
// Get replies and display them
|
| 983 |
if ( $widget_query->have_posts() ) :
|
| 984 |
|
| 985 |
+
echo $args['before_widget'];
|
| 986 |
+
echo $args['before_title'] . $title . $args['after_title']; ?>
|
| 987 |
|
| 988 |
<ul>
|
| 989 |
|
| 1031 |
|
| 1032 |
</ul>
|
| 1033 |
|
| 1034 |
+
<?php echo $args['after_widget'];
|
| 1035 |
|
| 1036 |
// Reset the $post global
|
| 1037 |
wp_reset_postdata();
|
includes/core/actions.php
CHANGED
|
@@ -76,8 +76,8 @@ add_action( 'bbp_loaded', 'bbp_filter_user_roles_option', 16 );
|
|
| 76 |
* The load order helps to execute code at the correct time.
|
| 77 |
* v---Load order
|
| 78 |
*/
|
|
|
|
| 79 |
add_action( 'bbp_init', 'bbp_register', 0 );
|
| 80 |
-
add_action( 'bbp_init', 'bbp_load_textdomain', 10 );
|
| 81 |
add_action( 'bbp_init', 'bbp_add_rewrite_tags', 20 );
|
| 82 |
add_action( 'bbp_init', 'bbp_ready', 999 );
|
| 83 |
|
|
@@ -90,19 +90,11 @@ add_action( 'bbp_init', 'bbp_ready', 999 );
|
|
| 90 |
add_action( 'bbp_setup_theme', 'bbp_add_forums_roles', 1 );
|
| 91 |
|
| 92 |
/**
|
| 93 |
-
* When
|
| 94 |
-
* WP_User::for_blog() and WP_User::_init_caps().
|
| 95 |
*
|
| 96 |
-
* This
|
| 97 |
-
*
|
| 98 |
-
*
|
| 99 |
-
* Resetting the role on blog-switch enables us to maintain the user's dynamic
|
| 100 |
-
* role between sites. Note that if a user already has a role on that site, no
|
| 101 |
-
* mapping will occur.
|
| 102 |
-
*
|
| 103 |
-
* We also hook to 'bbp_setup_current_user' -- naturally.
|
| 104 |
*/
|
| 105 |
-
add_action( 'switch_blog', 'bbp_set_current_user_default_role' );
|
| 106 |
add_action( 'bbp_setup_current_user', 'bbp_set_current_user_default_role' );
|
| 107 |
|
| 108 |
/**
|
|
@@ -138,9 +130,11 @@ add_action( 'bbp_after_setup_theme', 'bbp_load_theme_functions', 10 );
|
|
| 138 |
// Widgets
|
| 139 |
add_action( 'bbp_widgets_init', array( 'BBP_Login_Widget', 'register_widget' ), 10 );
|
| 140 |
add_action( 'bbp_widgets_init', array( 'BBP_Views_Widget', 'register_widget' ), 10 );
|
|
|
|
| 141 |
add_action( 'bbp_widgets_init', array( 'BBP_Forums_Widget', 'register_widget' ), 10 );
|
| 142 |
add_action( 'bbp_widgets_init', array( 'BBP_Topics_Widget', 'register_widget' ), 10 );
|
| 143 |
add_action( 'bbp_widgets_init', array( 'BBP_Replies_Widget', 'register_widget' ), 10 );
|
|
|
|
| 144 |
|
| 145 |
// Template - Head, foot, errors and messages
|
| 146 |
add_action( 'bbp_loaded', 'bbp_login_notices' );
|
|
@@ -202,6 +196,9 @@ add_action( 'bbp_edit_topic', 'bbp_update_topic', 10, 5 );
|
|
| 202 |
add_action( 'bbp_merged_topic', 'bbp_merge_topic_count', 1, 3 );
|
| 203 |
add_action( 'bbp_post_split_topic', 'bbp_split_topic_count', 1, 3 );
|
| 204 |
|
|
|
|
|
|
|
|
|
|
| 205 |
// Before Delete/Trash/Untrash Topic
|
| 206 |
add_action( 'wp_trash_post', 'bbp_trash_topic' );
|
| 207 |
add_action( 'trash_post', 'bbp_trash_topic' );
|
|
@@ -218,9 +215,9 @@ add_action( 'bbp_trash_topic', 'bbp_remove_topic_from_all_favorites' );
|
|
| 218 |
add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_favorites' );
|
| 219 |
|
| 220 |
// Subscriptions
|
| 221 |
-
add_action( 'bbp_trash_topic', 'bbp_remove_topic_from_all_subscriptions'
|
| 222 |
-
add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_subscriptions'
|
| 223 |
-
add_action( 'bbp_new_reply', 'bbp_notify_subscribers',
|
| 224 |
|
| 225 |
// Sticky
|
| 226 |
add_action( 'bbp_trash_topic', 'bbp_unstick_topic' );
|
|
@@ -262,32 +259,41 @@ add_action( 'bbp_new_reply_post_extras', 'bbp_clean_post_cache' );
|
|
| 262 |
/**
|
| 263 |
* bbPress needs to redirect the user around in a few different circumstances:
|
| 264 |
*
|
| 265 |
-
* 1.
|
| 266 |
* 2. Accessing private or hidden content (forums/topics/replies)
|
| 267 |
* 3. Editing forums, topics, replies, users, and tags
|
|
|
|
| 268 |
*/
|
| 269 |
-
add_action( 'bbp_template_redirect', 'bbp_forum_enforce_blocked',
|
| 270 |
-
add_action( 'bbp_template_redirect', 'bbp_forum_enforce_hidden',
|
| 271 |
-
add_action( 'bbp_template_redirect', 'bbp_forum_enforce_private',
|
| 272 |
-
add_action( 'bbp_template_redirect', '
|
| 273 |
-
add_action( 'bbp_template_redirect', '
|
| 274 |
-
add_action( 'bbp_template_redirect', '
|
| 275 |
-
add_action( 'bbp_template_redirect', '
|
| 276 |
-
add_action( 'bbp_template_redirect', '
|
| 277 |
-
add_action( 'bbp_template_redirect', '
|
| 278 |
-
add_action( 'bbp_template_redirect', '
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
add_action( '
|
| 282 |
-
add_action( '
|
| 283 |
-
add_action( '
|
| 284 |
-
add_action( '
|
| 285 |
-
add_action( '
|
| 286 |
-
add_action( '
|
| 287 |
-
add_action( '
|
| 288 |
-
add_action( '
|
| 289 |
-
add_action( '
|
| 290 |
-
add_action( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 291 |
|
| 292 |
// Maybe convert the users password
|
| 293 |
add_action( 'bbp_login_form_login', 'bbp_user_maybe_convert_pass' );
|
| 76 |
* The load order helps to execute code at the correct time.
|
| 77 |
* v---Load order
|
| 78 |
*/
|
| 79 |
+
add_action( 'bbp_init', 'bbp_load_textdomain', 0 );
|
| 80 |
add_action( 'bbp_init', 'bbp_register', 0 );
|
|
|
|
| 81 |
add_action( 'bbp_init', 'bbp_add_rewrite_tags', 20 );
|
| 82 |
add_action( 'bbp_init', 'bbp_ready', 999 );
|
| 83 |
|
| 90 |
add_action( 'bbp_setup_theme', 'bbp_add_forums_roles', 1 );
|
| 91 |
|
| 92 |
/**
|
| 93 |
+
* When setting up the current user, make sure they have a role for the forums.
|
|
|
|
| 94 |
*
|
| 95 |
+
* This is multisite aware, thanks to bbp_filter_user_roles_option(), hooked to
|
| 96 |
+
* the 'bbp_loaded' action above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
*/
|
|
|
|
| 98 |
add_action( 'bbp_setup_current_user', 'bbp_set_current_user_default_role' );
|
| 99 |
|
| 100 |
/**
|
| 130 |
// Widgets
|
| 131 |
add_action( 'bbp_widgets_init', array( 'BBP_Login_Widget', 'register_widget' ), 10 );
|
| 132 |
add_action( 'bbp_widgets_init', array( 'BBP_Views_Widget', 'register_widget' ), 10 );
|
| 133 |
+
add_action( 'bbp_widgets_init', array( 'BBP_Search_Widget', 'register_widget' ), 10 );
|
| 134 |
add_action( 'bbp_widgets_init', array( 'BBP_Forums_Widget', 'register_widget' ), 10 );
|
| 135 |
add_action( 'bbp_widgets_init', array( 'BBP_Topics_Widget', 'register_widget' ), 10 );
|
| 136 |
add_action( 'bbp_widgets_init', array( 'BBP_Replies_Widget', 'register_widget' ), 10 );
|
| 137 |
+
add_action( 'bbp_widgets_init', array( 'BBP_Stats_Widget', 'register_widget' ), 10 );
|
| 138 |
|
| 139 |
// Template - Head, foot, errors and messages
|
| 140 |
add_action( 'bbp_loaded', 'bbp_login_notices' );
|
| 196 |
add_action( 'bbp_merged_topic', 'bbp_merge_topic_count', 1, 3 );
|
| 197 |
add_action( 'bbp_post_split_topic', 'bbp_split_topic_count', 1, 3 );
|
| 198 |
|
| 199 |
+
// Move Reply
|
| 200 |
+
add_action( 'bbp_post_move_reply', 'bbp_move_reply_count', 1, 3 );
|
| 201 |
+
|
| 202 |
// Before Delete/Trash/Untrash Topic
|
| 203 |
add_action( 'wp_trash_post', 'bbp_trash_topic' );
|
| 204 |
add_action( 'trash_post', 'bbp_trash_topic' );
|
| 215 |
add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_favorites' );
|
| 216 |
|
| 217 |
// Subscriptions
|
| 218 |
+
add_action( 'bbp_trash_topic', 'bbp_remove_topic_from_all_subscriptions' );
|
| 219 |
+
add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_subscriptions' );
|
| 220 |
+
add_action( 'bbp_new_reply', 'bbp_notify_subscribers', 11, 5 );
|
| 221 |
|
| 222 |
// Sticky
|
| 223 |
add_action( 'bbp_trash_topic', 'bbp_unstick_topic' );
|
| 259 |
/**
|
| 260 |
* bbPress needs to redirect the user around in a few different circumstances:
|
| 261 |
*
|
| 262 |
+
* 1. POST and GET requests
|
| 263 |
* 2. Accessing private or hidden content (forums/topics/replies)
|
| 264 |
* 3. Editing forums, topics, replies, users, and tags
|
| 265 |
+
* 4. bbPress specific AJAX requests
|
| 266 |
*/
|
| 267 |
+
add_action( 'bbp_template_redirect', 'bbp_forum_enforce_blocked', 1 );
|
| 268 |
+
add_action( 'bbp_template_redirect', 'bbp_forum_enforce_hidden', 1 );
|
| 269 |
+
add_action( 'bbp_template_redirect', 'bbp_forum_enforce_private', 1 );
|
| 270 |
+
add_action( 'bbp_template_redirect', 'bbp_post_request', 10 );
|
| 271 |
+
add_action( 'bbp_template_redirect', 'bbp_get_request', 10 );
|
| 272 |
+
add_action( 'bbp_template_redirect', 'bbp_check_user_edit', 10 );
|
| 273 |
+
add_action( 'bbp_template_redirect', 'bbp_check_forum_edit', 10 );
|
| 274 |
+
add_action( 'bbp_template_redirect', 'bbp_check_topic_edit', 10 );
|
| 275 |
+
add_action( 'bbp_template_redirect', 'bbp_check_reply_edit', 10 );
|
| 276 |
+
add_action( 'bbp_template_redirect', 'bbp_check_topic_tag_edit', 10 );
|
| 277 |
+
|
| 278 |
+
// Theme-side POST requests
|
| 279 |
+
add_action( 'bbp_post_request', 'bbp_do_ajax', 1 );
|
| 280 |
+
add_action( 'bbp_post_request', 'bbp_edit_topic_tag_handler', 1 );
|
| 281 |
+
add_action( 'bbp_post_request', 'bbp_edit_user_handler', 1 );
|
| 282 |
+
add_action( 'bbp_post_request', 'bbp_edit_forum_handler', 1 );
|
| 283 |
+
add_action( 'bbp_post_request', 'bbp_edit_reply_handler', 1 );
|
| 284 |
+
add_action( 'bbp_post_request', 'bbp_edit_topic_handler', 1 );
|
| 285 |
+
add_action( 'bbp_post_request', 'bbp_merge_topic_handler', 1 );
|
| 286 |
+
add_action( 'bbp_post_request', 'bbp_split_topic_handler', 1 );
|
| 287 |
+
add_action( 'bbp_post_request', 'bbp_move_reply_handler', 1 );
|
| 288 |
+
add_action( 'bbp_post_request', 'bbp_new_forum_handler', 10 );
|
| 289 |
+
add_action( 'bbp_post_request', 'bbp_new_reply_handler', 10 );
|
| 290 |
+
add_action( 'bbp_post_request', 'bbp_new_topic_handler', 10 );
|
| 291 |
+
|
| 292 |
+
// Theme-side GET requests
|
| 293 |
+
add_action( 'bbp_get_request', 'bbp_toggle_topic_handler', 1 );
|
| 294 |
+
add_action( 'bbp_get_request', 'bbp_toggle_reply_handler', 1 );
|
| 295 |
+
add_action( 'bbp_get_request', 'bbp_favorites_handler', 1 );
|
| 296 |
+
add_action( 'bbp_get_request', 'bbp_subscriptions_handler', 1 );
|
| 297 |
|
| 298 |
// Maybe convert the users password
|
| 299 |
add_action( 'bbp_login_form_login', 'bbp_user_maybe_convert_pass' );
|
includes/core/capabilities.php
CHANGED
|
@@ -332,7 +332,7 @@ function bbp_add_forums_roles() {
|
|
| 332 |
|
| 333 |
foreach( bbp_get_dynamic_roles() as $role_id => $details ) {
|
| 334 |
$wp_roles->roles[$role_id] = $details;
|
| 335 |
-
$wp_roles->role_objects[$role_id] = new WP_Role( $
|
| 336 |
$wp_roles->role_names[$role_id] = $details['name'];
|
| 337 |
}
|
| 338 |
}
|
|
@@ -363,6 +363,9 @@ function bbp_filter_user_roles_option() {
|
|
| 363 |
* Because dynamic multiple roles is a new concept in WordPress, we work around
|
| 364 |
* it here for now, knowing that improvements will come to WordPress core later.
|
| 365 |
*
|
|
|
|
|
|
|
|
|
|
| 366 |
* @see switch_to_blog()
|
| 367 |
* @see restore_current_blog()
|
| 368 |
* @see WP_Roles::_init()
|
| 332 |
|
| 333 |
foreach( bbp_get_dynamic_roles() as $role_id => $details ) {
|
| 334 |
$wp_roles->roles[$role_id] = $details;
|
| 335 |
+
$wp_roles->role_objects[$role_id] = new WP_Role( $role_id, $details['capabilities'] );
|
| 336 |
$wp_roles->role_names[$role_id] = $details['name'];
|
| 337 |
}
|
| 338 |
}
|
| 363 |
* Because dynamic multiple roles is a new concept in WordPress, we work around
|
| 364 |
* it here for now, knowing that improvements will come to WordPress core later.
|
| 365 |
*
|
| 366 |
+
* Also note that if using the $wp_user_roles global non-database approach,
|
| 367 |
+
* bbPress does not have an intercept point to add its dynamic roles.
|
| 368 |
+
*
|
| 369 |
* @see switch_to_blog()
|
| 370 |
* @see restore_current_blog()
|
| 371 |
* @see WP_Roles::_init()
|
includes/core/filters.php
CHANGED
|
@@ -86,24 +86,24 @@ add_filter( 'bbp_get_reply_permalink', 'bbp_add_view_all' );
|
|
| 86 |
add_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );
|
| 87 |
|
| 88 |
// wp_filter_kses on new/edit topic/reply title
|
| 89 |
-
add_filter( 'bbp_new_reply_pre_title',
|
| 90 |
-
add_filter( 'bbp_new_topic_pre_title',
|
| 91 |
-
add_filter( 'bbp_edit_reply_pre_title',
|
| 92 |
-
add_filter( 'bbp_edit_topic_pre_title',
|
| 93 |
|
| 94 |
// balanceTags, wp_filter_kses and wp_rel_nofollow on new/edit topic/reply text
|
| 95 |
-
add_filter( 'bbp_new_reply_pre_content', '
|
| 96 |
-
add_filter( 'bbp_new_reply_pre_content', '
|
| 97 |
-
add_filter( 'bbp_new_reply_pre_content', '
|
| 98 |
-
add_filter( 'bbp_new_topic_pre_content', '
|
| 99 |
-
add_filter( 'bbp_new_topic_pre_content', '
|
| 100 |
-
add_filter( 'bbp_new_topic_pre_content', '
|
| 101 |
-
add_filter( 'bbp_edit_reply_pre_content', '
|
| 102 |
-
add_filter( 'bbp_edit_reply_pre_content', '
|
| 103 |
-
add_filter( 'bbp_edit_reply_pre_content', '
|
| 104 |
-
add_filter( 'bbp_edit_topic_pre_content', '
|
| 105 |
-
add_filter( 'bbp_edit_topic_pre_content', '
|
| 106 |
-
add_filter( 'bbp_edit_topic_pre_content', '
|
| 107 |
|
| 108 |
// No follow and stripslashes on user profile links
|
| 109 |
add_filter( 'bbp_get_reply_author_link', 'wp_rel_nofollow' );
|
|
@@ -120,22 +120,22 @@ add_filter( 'bbp_get_user_profile_edit_link', 'wp_rel_nofollow' );
|
|
| 120 |
add_filter( 'bbp_get_user_profile_edit_link', 'stripslashes' );
|
| 121 |
|
| 122 |
// Run filters on reply content
|
| 123 |
-
add_filter( 'bbp_get_reply_content', '
|
| 124 |
-
add_filter( 'bbp_get_reply_content', 'wptexturize',
|
| 125 |
-
add_filter( 'bbp_get_reply_content', 'convert_chars',
|
| 126 |
-
add_filter( 'bbp_get_reply_content', '
|
| 127 |
-
add_filter( 'bbp_get_reply_content', 'force_balance_tags', 25 );
|
| 128 |
add_filter( 'bbp_get_reply_content', 'convert_smilies', 20 );
|
|
|
|
| 129 |
add_filter( 'bbp_get_reply_content', 'wpautop', 30 );
|
| 130 |
add_filter( 'bbp_get_reply_content', 'bbp_mention_filter', 40 );
|
| 131 |
|
| 132 |
// Run filters on topic content
|
| 133 |
-
add_filter( 'bbp_get_topic_content', '
|
| 134 |
-
add_filter( 'bbp_get_topic_content', 'wptexturize',
|
| 135 |
-
add_filter( 'bbp_get_topic_content', 'convert_chars',
|
| 136 |
-
add_filter( 'bbp_get_topic_content', '
|
| 137 |
-
add_filter( 'bbp_get_topic_content', 'force_balance_tags', 25 );
|
| 138 |
add_filter( 'bbp_get_topic_content', 'convert_smilies', 20 );
|
|
|
|
| 139 |
add_filter( 'bbp_get_topic_content', 'wpautop', 30 );
|
| 140 |
add_filter( 'bbp_get_topic_content', 'bbp_mention_filter', 40 );
|
| 141 |
|
|
@@ -151,15 +151,27 @@ add_filter( 'bbp_get_topic_voice_count', 'bbp_number_format', 10 );
|
|
| 151 |
add_filter( 'bbp_get_topic_reply_count', 'bbp_number_format', 10 );
|
| 152 |
add_filter( 'bbp_get_topic_post_count', 'bbp_number_format', 10 );
|
| 153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
// Run wp_kses_data on topic/reply content in admin section
|
| 155 |
if ( is_admin() ) {
|
| 156 |
-
add_filter( 'bbp_get_reply_content', '
|
| 157 |
-
add_filter( 'bbp_get_topic_content', '
|
| 158 |
|
| 159 |
// Revisions (only when not in admin)
|
| 160 |
} else {
|
| 161 |
-
add_filter( 'bbp_get_reply_content', 'bbp_reply_content_append_revisions',
|
| 162 |
-
add_filter( 'bbp_get_topic_content', 'bbp_topic_content_append_revisions',
|
| 163 |
}
|
| 164 |
|
| 165 |
// Suppress private forum details
|
|
@@ -182,6 +194,15 @@ add_filter( 'bbp_get_topicsplit_template', 'bbp_add_template_locations' );
|
|
| 182 |
add_filter( 'bbp_get_topicmerge_template', 'bbp_add_template_locations' );
|
| 183 |
add_filter( 'bbp_get_topictag_template', 'bbp_add_template_locations' );
|
| 184 |
add_filter( 'bbp_get_topictagedit_template', 'bbp_add_template_locations' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
|
| 186 |
/**
|
| 187 |
* Add filters to anonymous post author data
|
| 86 |
add_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );
|
| 87 |
|
| 88 |
// wp_filter_kses on new/edit topic/reply title
|
| 89 |
+
add_filter( 'bbp_new_reply_pre_title', 'wp_filter_kses' );
|
| 90 |
+
add_filter( 'bbp_new_topic_pre_title', 'wp_filter_kses' );
|
| 91 |
+
add_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' );
|
| 92 |
+
add_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' );
|
| 93 |
|
| 94 |
// balanceTags, wp_filter_kses and wp_rel_nofollow on new/edit topic/reply text
|
| 95 |
+
add_filter( 'bbp_new_reply_pre_content', 'wp_rel_nofollow' );
|
| 96 |
+
add_filter( 'bbp_new_reply_pre_content', 'bbp_filter_kses' );
|
| 97 |
+
add_filter( 'bbp_new_reply_pre_content', 'balanceTags', 50 );
|
| 98 |
+
add_filter( 'bbp_new_topic_pre_content', 'wp_rel_nofollow' );
|
| 99 |
+
add_filter( 'bbp_new_topic_pre_content', 'bbp_filter_kses' );
|
| 100 |
+
add_filter( 'bbp_new_topic_pre_content', 'balanceTags', 50 );
|
| 101 |
+
add_filter( 'bbp_edit_reply_pre_content', 'wp_rel_nofollow' );
|
| 102 |
+
add_filter( 'bbp_edit_reply_pre_content', 'bbp_filter_kses' );
|
| 103 |
+
add_filter( 'bbp_edit_reply_pre_content', 'balanceTags', 50 );
|
| 104 |
+
add_filter( 'bbp_edit_topic_pre_content', 'wp_rel_nofollow' );
|
| 105 |
+
add_filter( 'bbp_edit_topic_pre_content', 'bbp_filter_kses' );
|
| 106 |
+
add_filter( 'bbp_edit_topic_pre_content', 'balanceTags', 50 );
|
| 107 |
|
| 108 |
// No follow and stripslashes on user profile links
|
| 109 |
add_filter( 'bbp_get_reply_author_link', 'wp_rel_nofollow' );
|
| 120 |
add_filter( 'bbp_get_user_profile_edit_link', 'stripslashes' );
|
| 121 |
|
| 122 |
// Run filters on reply content
|
| 123 |
+
add_filter( 'bbp_get_reply_content', 'make_clickable', 4 );
|
| 124 |
+
add_filter( 'bbp_get_reply_content', 'wptexturize', 6 );
|
| 125 |
+
add_filter( 'bbp_get_reply_content', 'convert_chars', 8 );
|
| 126 |
+
add_filter( 'bbp_get_reply_content', 'capital_P_dangit', 10 );
|
|
|
|
| 127 |
add_filter( 'bbp_get_reply_content', 'convert_smilies', 20 );
|
| 128 |
+
add_filter( 'bbp_get_reply_content', 'force_balance_tags', 25 );
|
| 129 |
add_filter( 'bbp_get_reply_content', 'wpautop', 30 );
|
| 130 |
add_filter( 'bbp_get_reply_content', 'bbp_mention_filter', 40 );
|
| 131 |
|
| 132 |
// Run filters on topic content
|
| 133 |
+
add_filter( 'bbp_get_topic_content', 'make_clickable', 4 );
|
| 134 |
+
add_filter( 'bbp_get_topic_content', 'wptexturize', 6 );
|
| 135 |
+
add_filter( 'bbp_get_topic_content', 'convert_chars', 8 );
|
| 136 |
+
add_filter( 'bbp_get_topic_content', 'capital_P_dangit', 10 );
|
|
|
|
| 137 |
add_filter( 'bbp_get_topic_content', 'convert_smilies', 20 );
|
| 138 |
+
add_filter( 'bbp_get_topic_content', 'force_balance_tags', 25 );
|
| 139 |
add_filter( 'bbp_get_topic_content', 'wpautop', 30 );
|
| 140 |
add_filter( 'bbp_get_topic_content', 'bbp_mention_filter', 40 );
|
| 141 |
|
| 151 |
add_filter( 'bbp_get_topic_reply_count', 'bbp_number_format', 10 );
|
| 152 |
add_filter( 'bbp_get_topic_post_count', 'bbp_number_format', 10 );
|
| 153 |
|
| 154 |
+
// Code filters on input
|
| 155 |
+
add_filter( 'bbp_new_reply_pre_content', 'bbp_code_trick_reverse' );
|
| 156 |
+
add_filter( 'bbp_edit_reply_pre_content', 'bbp_code_trick_reverse' );
|
| 157 |
+
add_filter( 'bbp_new_topic_pre_content', 'bbp_code_trick_reverse' );
|
| 158 |
+
add_filter( 'bbp_edit_topic_pre_content', 'bbp_code_trick_reverse' );
|
| 159 |
+
|
| 160 |
+
// Code filters on output (hooked in early for plugin compatibility)
|
| 161 |
+
add_filter( 'bbp_get_reply_content', 'bbp_code_trick', 4 );
|
| 162 |
+
add_filter( 'bbp_get_reply_content', 'bbp_encode_bad', 6 );
|
| 163 |
+
add_filter( 'bbp_get_topic_content', 'bbp_code_trick', 4 );
|
| 164 |
+
add_filter( 'bbp_get_topic_content', 'bbp_encode_bad', 6 );
|
| 165 |
+
|
| 166 |
// Run wp_kses_data on topic/reply content in admin section
|
| 167 |
if ( is_admin() ) {
|
| 168 |
+
add_filter( 'bbp_get_reply_content', 'bbp_kses_data' );
|
| 169 |
+
add_filter( 'bbp_get_topic_content', 'bbp_kses_data' );
|
| 170 |
|
| 171 |
// Revisions (only when not in admin)
|
| 172 |
} else {
|
| 173 |
+
add_filter( 'bbp_get_reply_content', 'bbp_reply_content_append_revisions', 99, 2 );
|
| 174 |
+
add_filter( 'bbp_get_topic_content', 'bbp_topic_content_append_revisions', 99, 2 );
|
| 175 |
}
|
| 176 |
|
| 177 |
// Suppress private forum details
|
| 194 |
add_filter( 'bbp_get_topicmerge_template', 'bbp_add_template_locations' );
|
| 195 |
add_filter( 'bbp_get_topictag_template', 'bbp_add_template_locations' );
|
| 196 |
add_filter( 'bbp_get_topictagedit_template', 'bbp_add_template_locations' );
|
| 197 |
+
add_filter( 'bbp_get_replymove_template', 'bbp_add_template_locations' );
|
| 198 |
+
|
| 199 |
+
// Topic and reply author display names
|
| 200 |
+
add_filter( 'bbp_get_topic_author_display_name', 'wptexturize' );
|
| 201 |
+
add_filter( 'bbp_get_topic_author_display_name', 'convert_chars' );
|
| 202 |
+
add_filter( 'bbp_get_topic_author_display_name', 'esc_html' );
|
| 203 |
+
add_filter( 'bbp_get_reply_author_display_name', 'wptexturize' );
|
| 204 |
+
add_filter( 'bbp_get_reply_author_display_name', 'convert_chars' );
|
| 205 |
+
add_filter( 'bbp_get_reply_author_display_name', 'esc_html' );
|
| 206 |
|
| 207 |
/**
|
| 208 |
* Add filters to anonymous post author data
|
includes/core/functions.php
CHANGED
|
@@ -281,6 +281,8 @@ function bbp_has_errors() {
|
|
| 281 |
return apply_filters( 'bbp_has_errors', $has_errors, bbpress()->errors );
|
| 282 |
}
|
| 283 |
|
|
|
|
|
|
|
| 284 |
/**
|
| 285 |
* Searches through the content to locate usernames, designated by an @ sign.
|
| 286 |
*
|
|
@@ -320,12 +322,12 @@ function bbp_mention_filter( $content = '' ) {
|
|
| 320 |
foreach( (array) $usernames as $username ) {
|
| 321 |
|
| 322 |
// Skip if username does not exist or user is not active
|
| 323 |
-
$
|
| 324 |
-
if ( empty( $
|
| 325 |
continue;
|
| 326 |
|
| 327 |
// Replace name in content
|
| 328 |
-
$content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bbp_get_user_profile_url( $
|
| 329 |
}
|
| 330 |
|
| 331 |
// Return modified content
|
|
@@ -435,7 +437,7 @@ function bbp_get_user_rewrite_id() {
|
|
| 435 |
}
|
| 436 |
|
| 437 |
/**
|
| 438 |
-
* Return the
|
| 439 |
*
|
| 440 |
* @since bbPress (r3762)
|
| 441 |
* @return string
|
|
@@ -444,6 +446,17 @@ function bbp_get_edit_rewrite_id() {
|
|
| 444 |
return bbpress()->edit_id;
|
| 445 |
}
|
| 446 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 447 |
/**
|
| 448 |
* Return the unique ID for user topics rewrite rules
|
| 449 |
*
|
| 281 |
return apply_filters( 'bbp_has_errors', $has_errors, bbpress()->errors );
|
| 282 |
}
|
| 283 |
|
| 284 |
+
/** Mentions ******************************************************************/
|
| 285 |
+
|
| 286 |
/**
|
| 287 |
* Searches through the content to locate usernames, designated by an @ sign.
|
| 288 |
*
|
| 322 |
foreach( (array) $usernames as $username ) {
|
| 323 |
|
| 324 |
// Skip if username does not exist or user is not active
|
| 325 |
+
$user = get_user_by( 'slug', $username );
|
| 326 |
+
if ( empty( $user->ID ) || bbp_is_user_inactive( $user->ID ) )
|
| 327 |
continue;
|
| 328 |
|
| 329 |
// Replace name in content
|
| 330 |
+
$content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bbp_get_user_profile_url( $user->ID ) . "' rel='nofollow' class='bbp-mention-link {$username}'>@{$username}</a>", $content );
|
| 331 |
}
|
| 332 |
|
| 333 |
// Return modified content
|
| 437 |
}
|
| 438 |
|
| 439 |
/**
|
| 440 |
+
* Return the unique ID for all edit rewrite rules (forum|topic|reply|tag|user)
|
| 441 |
*
|
| 442 |
* @since bbPress (r3762)
|
| 443 |
* @return string
|
| 446 |
return bbpress()->edit_id;
|
| 447 |
}
|
| 448 |
|
| 449 |
+
/**
|
| 450 |
+
* Return the unique ID for all search rewrite rules
|
| 451 |
+
*
|
| 452 |
+
* @since bbPress (r4579)
|
| 453 |
+
*
|
| 454 |
+
* @return string
|
| 455 |
+
*/
|
| 456 |
+
function bbp_get_search_rewrite_id() {
|
| 457 |
+
return bbpress()->search_id;
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
/**
|
| 461 |
* Return the unique ID for user topics rewrite rules
|
| 462 |
*
|
includes/core/options.php
CHANGED
|
@@ -79,6 +79,7 @@ function bbp_get_default_options() {
|
|
| 79 |
/** Other Slugs *******************************************************/
|
| 80 |
|
| 81 |
'_bbp_view_slug' => 'view', // View slug
|
|
|
|
| 82 |
|
| 83 |
/** Topics ************************************************************/
|
| 84 |
|
|
@@ -499,6 +500,17 @@ function bbp_get_view_slug( $default = 'view' ) {
|
|
| 499 |
return apply_filters( 'bbp_get_view_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_view_slug', $default ) );
|
| 500 |
}
|
| 501 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 502 |
/** Legacy ********************************************************************/
|
| 503 |
|
| 504 |
/**
|
| 79 |
/** Other Slugs *******************************************************/
|
| 80 |
|
| 81 |
'_bbp_view_slug' => 'view', // View slug
|
| 82 |
+
'_bbp_search_slug' => 'search', // Search slug
|
| 83 |
|
| 84 |
/** Topics ************************************************************/
|
| 85 |
|
| 500 |
return apply_filters( 'bbp_get_view_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_view_slug', $default ) );
|
| 501 |
}
|
| 502 |
|
| 503 |
+
/**
|
| 504 |
+
* Return the search slug
|
| 505 |
+
*
|
| 506 |
+
* @since bbPress (r4579)
|
| 507 |
+
*
|
| 508 |
+
* @return string
|
| 509 |
+
*/
|
| 510 |
+
function bbp_get_search_slug( $default = 'search' ) {
|
| 511 |
+
return apply_filters( 'bbp_get_search_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_search_slug', $default ) );
|
| 512 |
+
}
|
| 513 |
+
|
| 514 |
/** Legacy ********************************************************************/
|
| 515 |
|
| 516 |
/**
|
includes/core/sub-actions.php
CHANGED
|
@@ -317,6 +317,46 @@ function bbp_after_setup_theme() {
|
|
| 317 |
do_action( 'bbp_after_setup_theme' );
|
| 318 |
}
|
| 319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 320 |
/**
|
| 321 |
* Filter the plugin locale and domain.
|
| 322 |
*
|
|
@@ -329,8 +369,6 @@ function bbp_plugin_locale( $locale = '', $domain = '' ) {
|
|
| 329 |
return apply_filters( 'bbp_plugin_locale', $locale, $domain );
|
| 330 |
}
|
| 331 |
|
| 332 |
-
/** Filters *******************************************************************/
|
| 333 |
-
|
| 334 |
/**
|
| 335 |
* Piggy back filter for WordPress's 'request' filter
|
| 336 |
*
|
| 317 |
do_action( 'bbp_after_setup_theme' );
|
| 318 |
}
|
| 319 |
|
| 320 |
+
/**
|
| 321 |
+
* The main action used for handling theme-side POST requests
|
| 322 |
+
*
|
| 323 |
+
* @since bbPress (r4550)
|
| 324 |
+
* @uses do_action()
|
| 325 |
+
*/
|
| 326 |
+
function bbp_post_request() {
|
| 327 |
+
|
| 328 |
+
// Bail if not a POST action
|
| 329 |
+
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 330 |
+
return;
|
| 331 |
+
|
| 332 |
+
// Bail if action is not bbp-new-reply
|
| 333 |
+
if ( empty( $_POST['action'] ) )
|
| 334 |
+
return;
|
| 335 |
+
|
| 336 |
+
do_action( 'bbp_post_request', $_POST['action'] );
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
/**
|
| 340 |
+
* The main action used for handling theme-side GET requests
|
| 341 |
+
*
|
| 342 |
+
* @since bbPress (r4550)
|
| 343 |
+
* @uses do_action()
|
| 344 |
+
*/
|
| 345 |
+
function bbp_get_request() {
|
| 346 |
+
|
| 347 |
+
// Bail if not a POST action
|
| 348 |
+
if ( 'GET' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 349 |
+
return;
|
| 350 |
+
|
| 351 |
+
// Bail if action is not bbp-new-reply
|
| 352 |
+
if ( empty( $_GET['action'] ) )
|
| 353 |
+
return;
|
| 354 |
+
|
| 355 |
+
do_action( 'bbp_get_request', $_GET['action'] );
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
/** Filters *******************************************************************/
|
| 359 |
+
|
| 360 |
/**
|
| 361 |
* Filter the plugin locale and domain.
|
| 362 |
*
|
| 369 |
return apply_filters( 'bbp_plugin_locale', $locale, $domain );
|
| 370 |
}
|
| 371 |
|
|
|
|
|
|
|
| 372 |
/**
|
| 373 |
* Piggy back filter for WordPress's 'request' filter
|
| 374 |
*
|
includes/core/template-functions.php
CHANGED
|
@@ -116,7 +116,26 @@ function bbp_register_template_stack( $location_callback = '', $priority = 10 )
|
|
| 116 |
return false;
|
| 117 |
|
| 118 |
// Add location callback to template stack
|
| 119 |
-
add_filter( 'bbp_template_stack', $location_callback, (int) $priority );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
}
|
| 121 |
|
| 122 |
/**
|
|
@@ -257,6 +276,7 @@ function bbp_add_template_locations( $templates = array() ) {
|
|
| 257 |
* If it's a reply edit, WP_Query::bbp_is_reply_edit is set to true.
|
| 258 |
*
|
| 259 |
* If it's a view page, WP_Query::bbp_is_view is set to true
|
|
|
|
| 260 |
*
|
| 261 |
* @since bbPress (r2688)
|
| 262 |
*
|
|
@@ -299,7 +319,7 @@ function bbp_parse_query( $posts_query ) {
|
|
| 299 |
if ( !empty( $bbp_user ) ) {
|
| 300 |
|
| 301 |
// Not a user_id so try email and slug
|
| 302 |
-
if ( !is_numeric( $bbp_user ) ) {
|
| 303 |
|
| 304 |
// Email was passed
|
| 305 |
if ( is_email( $bbp_user ) ) {
|
|
@@ -421,6 +441,20 @@ function bbp_parse_query( $posts_query ) {
|
|
| 421 |
// We are in a custom topic view
|
| 422 |
$posts_query->bbp_is_view = true;
|
| 423 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 424 |
// Forum/Topic/Reply Edit Page
|
| 425 |
} elseif ( !empty( $is_edit ) ) {
|
| 426 |
|
| 116 |
return false;
|
| 117 |
|
| 118 |
// Add location callback to template stack
|
| 119 |
+
return add_filter( 'bbp_template_stack', $location_callback, (int) $priority );
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
/**
|
| 123 |
+
* Deregisters a previously registered template stack location.
|
| 124 |
+
*
|
| 125 |
+
* @since bbPress (r4652)
|
| 126 |
+
*
|
| 127 |
+
* @param string $location Callback function that returns the
|
| 128 |
+
* @param int $priority
|
| 129 |
+
* @see bbp_register_template_stack()
|
| 130 |
+
*/
|
| 131 |
+
function bbp_deregister_template_stack( $location_callback = '', $priority = 10 ) {
|
| 132 |
+
|
| 133 |
+
// Bail if no location, or function does not exist
|
| 134 |
+
if ( empty( $location_callback ) || ! function_exists( $location_callback ) )
|
| 135 |
+
return false;
|
| 136 |
+
|
| 137 |
+
// Remove location callback to template stack
|
| 138 |
+
return remove_filter( 'bbp_template_stack', $location_callback, (int) $priority );
|
| 139 |
}
|
| 140 |
|
| 141 |
/**
|
| 276 |
* If it's a reply edit, WP_Query::bbp_is_reply_edit is set to true.
|
| 277 |
*
|
| 278 |
* If it's a view page, WP_Query::bbp_is_view is set to true
|
| 279 |
+
* If it's a search page, WP_Query::bbp_is_search is set to true
|
| 280 |
*
|
| 281 |
* @since bbPress (r2688)
|
| 282 |
*
|
| 319 |
if ( !empty( $bbp_user ) ) {
|
| 320 |
|
| 321 |
// Not a user_id so try email and slug
|
| 322 |
+
if ( get_option( 'permalink_structure' ) || ! is_numeric( $bbp_user ) ) {
|
| 323 |
|
| 324 |
// Email was passed
|
| 325 |
if ( is_email( $bbp_user ) ) {
|
| 441 |
// We are in a custom topic view
|
| 442 |
$posts_query->bbp_is_view = true;
|
| 443 |
|
| 444 |
+
// Search Page
|
| 445 |
+
} elseif ( isset( $posts_query->query_vars[ bbp_get_search_rewrite_id() ] ) ) {
|
| 446 |
+
|
| 447 |
+
// Check if there are search query args set
|
| 448 |
+
$search_terms = bbp_get_search_terms();
|
| 449 |
+
if ( !empty( $search_terms ) )
|
| 450 |
+
$posts_query->bbp_search_terms = $search_terms;
|
| 451 |
+
|
| 452 |
+
// Correct is_home variable
|
| 453 |
+
$posts_query->is_home = false;
|
| 454 |
+
|
| 455 |
+
// We are in a search query
|
| 456 |
+
$posts_query->bbp_is_search = true;
|
| 457 |
+
|
| 458 |
// Forum/Topic/Reply Edit Page
|
| 459 |
} elseif ( !empty( $is_edit ) ) {
|
| 460 |
|
includes/core/template-loader.php
CHANGED
|
@@ -30,6 +30,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
| 30 |
* @uses bbp_get_single_user_edit_template() To get user edit template
|
| 31 |
* @uses bbp_is_single_view() To check if page is single view
|
| 32 |
* @uses bbp_get_single_view_template() To get view template
|
|
|
|
|
|
|
| 33 |
* @uses bbp_is_forum_edit() To check if page is forum edit
|
| 34 |
* @uses bbp_get_forum_edit_template() To get forum edit template
|
| 35 |
* @uses bbp_is_topic_merge() To check if page is topic merge
|
|
@@ -38,6 +40,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
| 38 |
* @uses bbp_get_topic_split_template() To get topic split template
|
| 39 |
* @uses bbp_is_topic_edit() To check if page is topic edit
|
| 40 |
* @uses bbp_get_topic_edit_template() To get topic edit template
|
|
|
|
|
|
|
| 41 |
* @uses bbp_is_reply_edit() To check if page is reply edit
|
| 42 |
* @uses bbp_get_reply_edit_template() To get reply edit template
|
| 43 |
* @uses bbp_set_theme_compat_template() To set the global theme compat template
|
|
@@ -61,6 +65,9 @@ function bbp_template_include_theme_supports( $template = '' ) {
|
|
| 61 |
// Single View
|
| 62 |
elseif ( bbp_is_single_view() && ( $new_template = bbp_get_single_view_template() ) ) :
|
| 63 |
|
|
|
|
|
|
|
|
|
|
| 64 |
// Forum edit
|
| 65 |
elseif ( bbp_is_forum_edit() && ( $new_template = bbp_get_forum_edit_template() ) ) :
|
| 66 |
|
|
@@ -85,6 +92,9 @@ function bbp_template_include_theme_supports( $template = '' ) {
|
|
| 85 |
// Topic Archive
|
| 86 |
elseif ( bbp_is_topic_archive() && ( $new_template = bbp_get_topic_archive_template() ) ) :
|
| 87 |
|
|
|
|
|
|
|
|
|
|
| 88 |
// Editing a reply
|
| 89 |
elseif ( bbp_is_reply_edit() && ( $new_template = bbp_get_reply_edit_template() ) ) :
|
| 90 |
|
|
@@ -245,6 +255,22 @@ function bbp_get_single_view_template() {
|
|
| 245 |
return bbp_get_query_template( 'single_view', $templates );
|
| 246 |
}
|
| 247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 248 |
/**
|
| 249 |
* Get the single forum template
|
| 250 |
*
|
|
@@ -405,6 +431,22 @@ function bbp_get_reply_edit_template() {
|
|
| 405 |
return bbp_get_query_template( 'reply_edit', $templates );
|
| 406 |
}
|
| 407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 408 |
/**
|
| 409 |
* Get the topic template
|
| 410 |
*
|
| 30 |
* @uses bbp_get_single_user_edit_template() To get user edit template
|
| 31 |
* @uses bbp_is_single_view() To check if page is single view
|
| 32 |
* @uses bbp_get_single_view_template() To get view template
|
| 33 |
+
* @uses bbp_is_search() To check if page is search
|
| 34 |
+
* @uses bbp_get_search_template() To get search template
|
| 35 |
* @uses bbp_is_forum_edit() To check if page is forum edit
|
| 36 |
* @uses bbp_get_forum_edit_template() To get forum edit template
|
| 37 |
* @uses bbp_is_topic_merge() To check if page is topic merge
|
| 40 |
* @uses bbp_get_topic_split_template() To get topic split template
|
| 41 |
* @uses bbp_is_topic_edit() To check if page is topic edit
|
| 42 |
* @uses bbp_get_topic_edit_template() To get topic edit template
|
| 43 |
+
* @uses bbp_is_reply_move() To check if page is reply move
|
| 44 |
+
* @uses bbp_get_reply_move_template() To get reply move template
|
| 45 |
* @uses bbp_is_reply_edit() To check if page is reply edit
|
| 46 |
* @uses bbp_get_reply_edit_template() To get reply edit template
|
| 47 |
* @uses bbp_set_theme_compat_template() To set the global theme compat template
|
| 65 |
// Single View
|
| 66 |
elseif ( bbp_is_single_view() && ( $new_template = bbp_get_single_view_template() ) ) :
|
| 67 |
|
| 68 |
+
// Search
|
| 69 |
+
elseif ( bbp_is_search() && ( $new_template = bbp_get_search_template() ) ) :
|
| 70 |
+
|
| 71 |
// Forum edit
|
| 72 |
elseif ( bbp_is_forum_edit() && ( $new_template = bbp_get_forum_edit_template() ) ) :
|
| 73 |
|
| 92 |
// Topic Archive
|
| 93 |
elseif ( bbp_is_topic_archive() && ( $new_template = bbp_get_topic_archive_template() ) ) :
|
| 94 |
|
| 95 |
+
// Reply move
|
| 96 |
+
elseif ( bbp_is_reply_move() && ( $new_template = bbp_get_reply_move_template() ) ) :
|
| 97 |
+
|
| 98 |
// Editing a reply
|
| 99 |
elseif ( bbp_is_reply_edit() && ( $new_template = bbp_get_reply_edit_template() ) ) :
|
| 100 |
|
| 255 |
return bbp_get_query_template( 'single_view', $templates );
|
| 256 |
}
|
| 257 |
|
| 258 |
+
/**
|
| 259 |
+
* Get the search template
|
| 260 |
+
*
|
| 261 |
+
* @since bbPress (r4579)
|
| 262 |
+
*
|
| 263 |
+
* @uses bbp_get_query_template()
|
| 264 |
+
* @return string Path to template file
|
| 265 |
+
*/
|
| 266 |
+
function bbp_get_search_template() {
|
| 267 |
+
$templates = array(
|
| 268 |
+
'page-forum-search.php', // Single Search
|
| 269 |
+
'forum-search.php', // Search
|
| 270 |
+
);
|
| 271 |
+
return bbp_get_query_template( 'single_search', $templates );
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
/**
|
| 275 |
* Get the single forum template
|
| 276 |
*
|
| 431 |
return bbp_get_query_template( 'reply_edit', $templates );
|
| 432 |
}
|
| 433 |
|
| 434 |
+
/**
|
| 435 |
+
* Get the reply move template
|
| 436 |
+
*
|
| 437 |
+
* @since bbPress (r4521)
|
| 438 |
+
*
|
| 439 |
+
* @uses bbp_get_reply_post_type()
|
| 440 |
+
* @uses bbp_get_query_template()
|
| 441 |
+
* @return string Path to template file
|
| 442 |
+
*/
|
| 443 |
+
function bbp_get_reply_move_template() {
|
| 444 |
+
$templates = array(
|
| 445 |
+
'single-' . bbp_get_reply_post_type() . '-move.php', // Reply move
|
| 446 |
+
);
|
| 447 |
+
return bbp_get_query_template( 'reply_move', $templates );
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
/**
|
| 451 |
* Get the topic template
|
| 452 |
*
|
includes/core/theme-compat.php
CHANGED
|
@@ -108,7 +108,7 @@ function bbp_setup_theme_compat( $theme = '' ) {
|
|
| 108 |
* Gets the name of the bbPress compatable theme used, in the event the
|
| 109 |
* currently active WordPress theme does not explicitly support bbPress.
|
| 110 |
* This can be filtered or set manually. Tricky theme authors can override the
|
| 111 |
-
* default and include their own bbPress
|
| 112 |
*
|
| 113 |
* @since bbPress (r3506)
|
| 114 |
* @uses apply_filters()
|
|
@@ -122,7 +122,7 @@ function bbp_get_theme_compat_id() {
|
|
| 122 |
* Gets the name of the bbPress compatable theme used, in the event the
|
| 123 |
* currently active WordPress theme does not explicitly support bbPress.
|
| 124 |
* This can be filtered or set manually. Tricky theme authors can override the
|
| 125 |
-
* default and include their own bbPress
|
| 126 |
*
|
| 127 |
* @since bbPress (r3506)
|
| 128 |
* @uses apply_filters()
|
|
@@ -136,7 +136,7 @@ function bbp_get_theme_compat_name() {
|
|
| 136 |
* Gets the version of the bbPress compatable theme used, in the event the
|
| 137 |
* currently active WordPress theme does not explicitly support bbPress.
|
| 138 |
* This can be filtered or set manually. Tricky theme authors can override the
|
| 139 |
-
* default and include their own bbPress
|
| 140 |
*
|
| 141 |
* @since bbPress (r3506)
|
| 142 |
* @uses apply_filters()
|
|
@@ -150,7 +150,7 @@ function bbp_get_theme_compat_version() {
|
|
| 150 |
* Gets the bbPress compatable theme used in the event the currently active
|
| 151 |
* WordPress theme does not explicitly support bbPress. This can be filtered,
|
| 152 |
* or set manually. Tricky theme authors can override the default and include
|
| 153 |
-
* their own bbPress
|
| 154 |
*
|
| 155 |
* @since bbPress (r3032)
|
| 156 |
* @uses apply_filters()
|
|
@@ -164,7 +164,7 @@ function bbp_get_theme_compat_dir() {
|
|
| 164 |
* Gets the bbPress compatable theme used in the event the currently active
|
| 165 |
* WordPress theme does not explicitly support bbPress. This can be filtered,
|
| 166 |
* or set manually. Tricky theme authors can override the default and include
|
| 167 |
-
* their own bbPress
|
| 168 |
*
|
| 169 |
* @since bbPress (r3032)
|
| 170 |
* @uses apply_filters()
|
|
@@ -435,6 +435,8 @@ function bbp_theme_compat_reset_post( $args = array() ) {
|
|
| 435 |
* @uses bbp_get_single_user_edit_template() To get user edit template
|
| 436 |
* @uses bbp_is_single_view() To check if page is single view
|
| 437 |
* @uses bbp_get_single_view_template() To get view template
|
|
|
|
|
|
|
| 438 |
* @uses bbp_is_forum_edit() To check if page is forum edit
|
| 439 |
* @uses bbp_get_forum_edit_template() To get forum edit template
|
| 440 |
* @uses bbp_is_topic_merge() To check if page is topic merge
|
|
@@ -443,17 +445,23 @@ function bbp_theme_compat_reset_post( $args = array() ) {
|
|
| 443 |
* @uses bbp_get_topic_split_template() To get topic split template
|
| 444 |
* @uses bbp_is_topic_edit() To check if page is topic edit
|
| 445 |
* @uses bbp_get_topic_edit_template() To get topic edit template
|
|
|
|
|
|
|
| 446 |
* @uses bbp_is_reply_edit() To check if page is reply edit
|
| 447 |
* @uses bbp_get_reply_edit_template() To get reply edit template
|
| 448 |
* @uses bbp_set_theme_compat_template() To set the global theme compat template
|
| 449 |
*/
|
| 450 |
function bbp_template_include_theme_compat( $template = '' ) {
|
| 451 |
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
return $template;
|
| 458 |
|
| 459 |
/** Users *************************************************************/
|
|
@@ -589,6 +597,22 @@ function bbp_template_include_theme_compat( $template = '' ) {
|
|
| 589 |
'comment_status' => 'closed'
|
| 590 |
) );
|
| 591 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 592 |
/** Topic Tags ********************************************************/
|
| 593 |
|
| 594 |
// Topic Tag Edit
|
|
@@ -610,6 +634,20 @@ function bbp_template_include_theme_compat( $template = '' ) {
|
|
| 610 |
) );
|
| 611 |
}
|
| 612 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
/**
|
| 614 |
* If we are relying on bbPress's built in theme compatibility to load
|
| 615 |
* the proper content, we need to intercept the_content, replace the
|
|
@@ -797,7 +835,21 @@ function bbp_replace_the_content( $content = '' ) {
|
|
| 797 |
|
| 798 |
// Reply Edit
|
| 799 |
} elseif ( bbp_is_reply_edit() ) {
|
| 800 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 801 |
|
| 802 |
// Single Reply
|
| 803 |
} elseif ( bbp_is_single_reply() ) {
|
|
@@ -808,6 +860,11 @@ function bbp_replace_the_content( $content = '' ) {
|
|
| 808 |
} elseif ( bbp_is_single_view() ) {
|
| 809 |
$new_content = $bbp->shortcodes->display_view( array( 'id' => get_query_var( 'bbp_view' ) ) );
|
| 810 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 811 |
/** Topic Tags ********************************************************/
|
| 812 |
|
| 813 |
// Show topics of tag
|
| 108 |
* Gets the name of the bbPress compatable theme used, in the event the
|
| 109 |
* currently active WordPress theme does not explicitly support bbPress.
|
| 110 |
* This can be filtered or set manually. Tricky theme authors can override the
|
| 111 |
+
* default and include their own bbPress compatibility layers for their themes.
|
| 112 |
*
|
| 113 |
* @since bbPress (r3506)
|
| 114 |
* @uses apply_filters()
|
| 122 |
* Gets the name of the bbPress compatable theme used, in the event the
|
| 123 |
* currently active WordPress theme does not explicitly support bbPress.
|
| 124 |
* This can be filtered or set manually. Tricky theme authors can override the
|
| 125 |
+
* default and include their own bbPress compatibility layers for their themes.
|
| 126 |
*
|
| 127 |
* @since bbPress (r3506)
|
| 128 |
* @uses apply_filters()
|
| 136 |
* Gets the version of the bbPress compatable theme used, in the event the
|
| 137 |
* currently active WordPress theme does not explicitly support bbPress.
|
| 138 |
* This can be filtered or set manually. Tricky theme authors can override the
|
| 139 |
+
* default and include their own bbPress compatibility layers for their themes.
|
| 140 |
*
|
| 141 |
* @since bbPress (r3506)
|
| 142 |
* @uses apply_filters()
|
| 150 |
* Gets the bbPress compatable theme used in the event the currently active
|
| 151 |
* WordPress theme does not explicitly support bbPress. This can be filtered,
|
| 152 |
* or set manually. Tricky theme authors can override the default and include
|
| 153 |
+
* their own bbPress compatibility layers for their themes.
|
| 154 |
*
|
| 155 |
* @since bbPress (r3032)
|
| 156 |
* @uses apply_filters()
|
| 164 |
* Gets the bbPress compatable theme used in the event the currently active
|
| 165 |
* WordPress theme does not explicitly support bbPress. This can be filtered,
|
| 166 |
* or set manually. Tricky theme authors can override the default and include
|
| 167 |
+
* their own bbPress compatibility layers for their themes.
|
| 168 |
*
|
| 169 |
* @since bbPress (r3032)
|
| 170 |
* @uses apply_filters()
|
| 435 |
* @uses bbp_get_single_user_edit_template() To get user edit template
|
| 436 |
* @uses bbp_is_single_view() To check if page is single view
|
| 437 |
* @uses bbp_get_single_view_template() To get view template
|
| 438 |
+
* @uses bbp_is_search() To check if page is search
|
| 439 |
+
* @uses bbp_get_search_template() To get search template
|
| 440 |
* @uses bbp_is_forum_edit() To check if page is forum edit
|
| 441 |
* @uses bbp_get_forum_edit_template() To get forum edit template
|
| 442 |
* @uses bbp_is_topic_merge() To check if page is topic merge
|
| 445 |
* @uses bbp_get_topic_split_template() To get topic split template
|
| 446 |
* @uses bbp_is_topic_edit() To check if page is topic edit
|
| 447 |
* @uses bbp_get_topic_edit_template() To get topic edit template
|
| 448 |
+
* @uses bbp_is_reply_move() To check if page is reply move
|
| 449 |
+
* @uses bbp_get_reply_move_template() To get reply move template
|
| 450 |
* @uses bbp_is_reply_edit() To check if page is reply edit
|
| 451 |
* @uses bbp_get_reply_edit_template() To get reply edit template
|
| 452 |
* @uses bbp_set_theme_compat_template() To set the global theme compat template
|
| 453 |
*/
|
| 454 |
function bbp_template_include_theme_compat( $template = '' ) {
|
| 455 |
|
| 456 |
+
/**
|
| 457 |
+
* If BuddyPress is activated at a network level, the action order is
|
| 458 |
+
* reversed, which causes the template integration to fail. If we're looking
|
| 459 |
+
* at a BuddyPress page here, bail to prevent the extra processing.
|
| 460 |
+
*
|
| 461 |
+
* This is a bit more brute-force than is probably necessary, but gets the
|
| 462 |
+
* job done while we work towards something more elegant.
|
| 463 |
+
*/
|
| 464 |
+
if ( function_exists( 'is_buddypress' ) && is_buddypress() )
|
| 465 |
return $template;
|
| 466 |
|
| 467 |
/** Users *************************************************************/
|
| 597 |
'comment_status' => 'closed'
|
| 598 |
) );
|
| 599 |
|
| 600 |
+
/** Search ************************************************************/
|
| 601 |
+
|
| 602 |
+
} elseif ( bbp_is_search() ) {
|
| 603 |
+
|
| 604 |
+
// Reset post
|
| 605 |
+
bbp_theme_compat_reset_post( array(
|
| 606 |
+
'ID' => 0,
|
| 607 |
+
'post_title' => bbp_get_search_title(),
|
| 608 |
+
'post_author' => 0,
|
| 609 |
+
'post_date' => 0,
|
| 610 |
+
'post_content' => '',
|
| 611 |
+
'post_type' => '',
|
| 612 |
+
'post_status' => bbp_get_public_status_id(),
|
| 613 |
+
'comment_status' => 'closed'
|
| 614 |
+
) );
|
| 615 |
+
|
| 616 |
/** Topic Tags ********************************************************/
|
| 617 |
|
| 618 |
// Topic Tag Edit
|
| 634 |
) );
|
| 635 |
}
|
| 636 |
|
| 637 |
+
/**
|
| 638 |
+
* Bail if the template already matches a bbPress template. This includes
|
| 639 |
+
* archive-* and single-* WordPress post_type matches (allowing
|
| 640 |
+
* themes to use the expected format) as well as all bbPress-specific
|
| 641 |
+
* template files for users, topics, forums, etc...
|
| 642 |
+
*
|
| 643 |
+
* We do this after the above checks to prevent incorrect 404 body classes
|
| 644 |
+
* and header statuses.
|
| 645 |
+
*
|
| 646 |
+
* @see http://bbpress.trac.wordpress.org/ticket/1478/
|
| 647 |
+
*/
|
| 648 |
+
if ( !empty( bbpress()->theme_compat->bbpress_template ) )
|
| 649 |
+
return $template;
|
| 650 |
+
|
| 651 |
/**
|
| 652 |
* If we are relying on bbPress's built in theme compatibility to load
|
| 653 |
* the proper content, we need to intercept the_content, replace the
|
| 835 |
|
| 836 |
// Reply Edit
|
| 837 |
} elseif ( bbp_is_reply_edit() ) {
|
| 838 |
+
|
| 839 |
+
// Move
|
| 840 |
+
if ( bbp_is_reply_move() ) {
|
| 841 |
+
ob_start();
|
| 842 |
+
|
| 843 |
+
bbp_get_template_part( 'form', 'reply-move' );
|
| 844 |
+
|
| 845 |
+
$new_content = ob_get_contents();
|
| 846 |
+
|
| 847 |
+
ob_end_clean();
|
| 848 |
+
|
| 849 |
+
// Edit
|
| 850 |
+
} else {
|
| 851 |
+
$new_content = $bbp->shortcodes->display_reply_form();
|
| 852 |
+
}
|
| 853 |
|
| 854 |
// Single Reply
|
| 855 |
} elseif ( bbp_is_single_reply() ) {
|
| 860 |
} elseif ( bbp_is_single_view() ) {
|
| 861 |
$new_content = $bbp->shortcodes->display_view( array( 'id' => get_query_var( 'bbp_view' ) ) );
|
| 862 |
|
| 863 |
+
/** Search ************************************************************/
|
| 864 |
+
|
| 865 |
+
} elseif ( bbp_is_search() ) {
|
| 866 |
+
$new_content = $bbp->shortcodes->display_search( array( 'search' => get_query_var( 'bbp_search' ) ) );
|
| 867 |
+
|
| 868 |
/** Topic Tags ********************************************************/
|
| 869 |
|
| 870 |
// Show topics of tag
|
includes/core/update.php
CHANGED
|
@@ -50,17 +50,19 @@ function bbp_is_update() {
|
|
| 50 |
* @return bool True if activating bbPress, false if not
|
| 51 |
*/
|
| 52 |
function bbp_is_activation( $basename = '' ) {
|
| 53 |
-
$bbp
|
| 54 |
-
|
| 55 |
$action = false;
|
| 56 |
-
|
|
|
|
| 57 |
$action = $_REQUEST['action'];
|
| 58 |
-
elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) )
|
| 59 |
$action = $_REQUEST['action2'];
|
|
|
|
| 60 |
|
| 61 |
// Bail if not activating
|
| 62 |
-
if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) )
|
| 63 |
return false;
|
|
|
|
| 64 |
|
| 65 |
// The plugin(s) being activated
|
| 66 |
if ( $action == 'activate' ) {
|
|
@@ -70,12 +72,14 @@ function bbp_is_activation( $basename = '' ) {
|
|
| 70 |
}
|
| 71 |
|
| 72 |
// Set basename if empty
|
| 73 |
-
if ( empty( $basename ) && !empty( $bbp->basename ) )
|
| 74 |
$basename = $bbp->basename;
|
|
|
|
| 75 |
|
| 76 |
// Bail if no basename
|
| 77 |
-
if ( empty( $basename ) )
|
| 78 |
return false;
|
|
|
|
| 79 |
|
| 80 |
// Is bbPress being activated?
|
| 81 |
return in_array( $basename, $plugins );
|
|
@@ -88,17 +92,19 @@ function bbp_is_activation( $basename = '' ) {
|
|
| 88 |
* @return bool True if deactivating bbPress, false if not
|
| 89 |
*/
|
| 90 |
function bbp_is_deactivation( $basename = '' ) {
|
| 91 |
-
$bbp
|
| 92 |
-
|
| 93 |
$action = false;
|
| 94 |
-
|
|
|
|
| 95 |
$action = $_REQUEST['action'];
|
| 96 |
-
elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) )
|
| 97 |
$action = $_REQUEST['action2'];
|
|
|
|
| 98 |
|
| 99 |
// Bail if not deactivating
|
| 100 |
-
if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) )
|
| 101 |
return false;
|
|
|
|
| 102 |
|
| 103 |
// The plugin(s) being deactivated
|
| 104 |
if ( $action == 'deactivate' ) {
|
|
@@ -108,12 +114,14 @@ function bbp_is_deactivation( $basename = '' ) {
|
|
| 108 |
}
|
| 109 |
|
| 110 |
// Set basename if empty
|
| 111 |
-
if ( empty( $basename ) && !empty( $bbp->basename ) )
|
| 112 |
$basename = $bbp->basename;
|
|
|
|
| 113 |
|
| 114 |
// Bail if no basename
|
| 115 |
-
if ( empty( $basename ) )
|
| 116 |
return false;
|
|
|
|
| 117 |
|
| 118 |
// Is bbPress being deactivated?
|
| 119 |
return in_array( $basename, $plugins );
|
|
@@ -127,8 +135,7 @@ function bbp_is_deactivation( $basename = '' ) {
|
|
| 127 |
* @uses bbp_get_db_version() To get bbPress's database version
|
| 128 |
*/
|
| 129 |
function bbp_version_bump() {
|
| 130 |
-
|
| 131 |
-
update_option( '_bbp_db_version', $db_version );
|
| 132 |
}
|
| 133 |
|
| 134 |
/**
|
|
@@ -158,7 +165,8 @@ function bbp_setup_updater() {
|
|
| 158 |
*/
|
| 159 |
function bbp_create_initial_content( $args = array() ) {
|
| 160 |
|
| 161 |
-
|
|
|
|
| 162 |
'forum_parent' => 0,
|
| 163 |
'forum_status' => 'publish',
|
| 164 |
'forum_title' => __( 'General', 'bbpress' ),
|
|
@@ -167,24 +175,22 @@ function bbp_create_initial_content( $args = array() ) {
|
|
| 167 |
'topic_content' => __( 'I am the first topic in your new forums.', 'bbpress' ),
|
| 168 |
'reply_title' => __( 'Re: Hello World!', 'bbpress' ),
|
| 169 |
'reply_content' => __( 'Oh, and this is what a reply looks like.', 'bbpress' ),
|
| 170 |
-
);
|
| 171 |
-
$r = bbp_parse_args( $args, $defaults, 'create_initial_content' );
|
| 172 |
-
extract( $r );
|
| 173 |
|
| 174 |
// Create the initial forum
|
| 175 |
$forum_id = bbp_insert_forum( array(
|
| 176 |
-
'post_parent' => $forum_parent,
|
| 177 |
-
'post_status' => $forum_status,
|
| 178 |
-
'post_title' => $forum_title,
|
| 179 |
-
'post_content' => $forum_content
|
| 180 |
) );
|
| 181 |
|
| 182 |
// Create the initial topic
|
| 183 |
$topic_id = bbp_insert_topic(
|
| 184 |
array(
|
| 185 |
'post_parent' => $forum_id,
|
| 186 |
-
'post_title' => $topic_title,
|
| 187 |
-
'post_content' => $topic_content
|
| 188 |
),
|
| 189 |
array( 'forum_id' => $forum_id )
|
| 190 |
);
|
|
@@ -193,8 +199,8 @@ function bbp_create_initial_content( $args = array() ) {
|
|
| 193 |
$reply_id = bbp_insert_reply(
|
| 194 |
array(
|
| 195 |
'post_parent' => $topic_id,
|
| 196 |
-
'post_title' => $reply_title,
|
| 197 |
-
'post_content' => $reply_content
|
| 198 |
),
|
| 199 |
array(
|
| 200 |
'forum_id' => $forum_id,
|
|
@@ -246,7 +252,7 @@ function bbp_version_updater() {
|
|
| 246 |
/** 2.2 Branch ************************************************************/
|
| 247 |
|
| 248 |
// 2.2
|
| 249 |
-
if ( $raw_db_version <
|
| 250 |
|
| 251 |
// Remove the Moderator role from the database
|
| 252 |
remove_role( bbp_get_moderator_role() );
|
|
@@ -254,7 +260,7 @@ function bbp_version_updater() {
|
|
| 254 |
// Remove the Participant role from the database
|
| 255 |
remove_role( bbp_get_participant_role() );
|
| 256 |
|
| 257 |
-
//
|
| 258 |
bbp_remove_caps();
|
| 259 |
}
|
| 260 |
|
| 50 |
* @return bool True if activating bbPress, false if not
|
| 51 |
*/
|
| 52 |
function bbp_is_activation( $basename = '' ) {
|
| 53 |
+
$bbp = bbpress();
|
|
|
|
| 54 |
$action = false;
|
| 55 |
+
|
| 56 |
+
if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
|
| 57 |
$action = $_REQUEST['action'];
|
| 58 |
+
} elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
|
| 59 |
$action = $_REQUEST['action2'];
|
| 60 |
+
}
|
| 61 |
|
| 62 |
// Bail if not activating
|
| 63 |
+
if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) {
|
| 64 |
return false;
|
| 65 |
+
}
|
| 66 |
|
| 67 |
// The plugin(s) being activated
|
| 68 |
if ( $action == 'activate' ) {
|
| 72 |
}
|
| 73 |
|
| 74 |
// Set basename if empty
|
| 75 |
+
if ( empty( $basename ) && !empty( $bbp->basename ) ) {
|
| 76 |
$basename = $bbp->basename;
|
| 77 |
+
}
|
| 78 |
|
| 79 |
// Bail if no basename
|
| 80 |
+
if ( empty( $basename ) ) {
|
| 81 |
return false;
|
| 82 |
+
}
|
| 83 |
|
| 84 |
// Is bbPress being activated?
|
| 85 |
return in_array( $basename, $plugins );
|
| 92 |
* @return bool True if deactivating bbPress, false if not
|
| 93 |
*/
|
| 94 |
function bbp_is_deactivation( $basename = '' ) {
|
| 95 |
+
$bbp = bbpress();
|
|
|
|
| 96 |
$action = false;
|
| 97 |
+
|
| 98 |
+
if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
|
| 99 |
$action = $_REQUEST['action'];
|
| 100 |
+
} elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
|
| 101 |
$action = $_REQUEST['action2'];
|
| 102 |
+
}
|
| 103 |
|
| 104 |
// Bail if not deactivating
|
| 105 |
+
if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) {
|
| 106 |
return false;
|
| 107 |
+
}
|
| 108 |
|
| 109 |
// The plugin(s) being deactivated
|
| 110 |
if ( $action == 'deactivate' ) {
|
| 114 |
}
|
| 115 |
|
| 116 |
// Set basename if empty
|
| 117 |
+
if ( empty( $basename ) && !empty( $bbp->basename ) ) {
|
| 118 |
$basename = $bbp->basename;
|
| 119 |
+
}
|
| 120 |
|
| 121 |
// Bail if no basename
|
| 122 |
+
if ( empty( $basename ) ) {
|
| 123 |
return false;
|
| 124 |
+
}
|
| 125 |
|
| 126 |
// Is bbPress being deactivated?
|
| 127 |
return in_array( $basename, $plugins );
|
| 135 |
* @uses bbp_get_db_version() To get bbPress's database version
|
| 136 |
*/
|
| 137 |
function bbp_version_bump() {
|
| 138 |
+
update_option( '_bbp_db_version', bbp_get_db_version() );
|
|
|
|
| 139 |
}
|
| 140 |
|
| 141 |
/**
|
| 165 |
*/
|
| 166 |
function bbp_create_initial_content( $args = array() ) {
|
| 167 |
|
| 168 |
+
// Parse arguments against default values
|
| 169 |
+
$r = bbp_parse_args( $args, array(
|
| 170 |
'forum_parent' => 0,
|
| 171 |
'forum_status' => 'publish',
|
| 172 |
'forum_title' => __( 'General', 'bbpress' ),
|
| 175 |
'topic_content' => __( 'I am the first topic in your new forums.', 'bbpress' ),
|
| 176 |
'reply_title' => __( 'Re: Hello World!', 'bbpress' ),
|
| 177 |
'reply_content' => __( 'Oh, and this is what a reply looks like.', 'bbpress' ),
|
| 178 |
+
), 'create_initial_content' );
|
|
|
|
|
|
|
| 179 |
|
| 180 |
// Create the initial forum
|
| 181 |
$forum_id = bbp_insert_forum( array(
|
| 182 |
+
'post_parent' => $r['forum_parent'],
|
| 183 |
+
'post_status' => $r['forum_status'],
|
| 184 |
+
'post_title' => $r['forum_title'],
|
| 185 |
+
'post_content' => $r['forum_content']
|
| 186 |
) );
|
| 187 |
|
| 188 |
// Create the initial topic
|
| 189 |
$topic_id = bbp_insert_topic(
|
| 190 |
array(
|
| 191 |
'post_parent' => $forum_id,
|
| 192 |
+
'post_title' => $r['topic_title'],
|
| 193 |
+
'post_content' => $r['topic_content']
|
| 194 |
),
|
| 195 |
array( 'forum_id' => $forum_id )
|
| 196 |
);
|
| 199 |
$reply_id = bbp_insert_reply(
|
| 200 |
array(
|
| 201 |
'post_parent' => $topic_id,
|
| 202 |
+
'post_title' => $r['reply_title'],
|
| 203 |
+
'post_content' => $r['reply_content']
|
| 204 |
),
|
| 205 |
array(
|
| 206 |
'forum_id' => $forum_id,
|
| 252 |
/** 2.2 Branch ************************************************************/
|
| 253 |
|
| 254 |
// 2.2
|
| 255 |
+
if ( $raw_db_version < 220 ) {
|
| 256 |
|
| 257 |
// Remove the Moderator role from the database
|
| 258 |
remove_role( bbp_get_moderator_role() );
|
| 260 |
// Remove the Participant role from the database
|
| 261 |
remove_role( bbp_get_participant_role() );
|
| 262 |
|
| 263 |
+
// Remove capabilities
|
| 264 |
bbp_remove_caps();
|
| 265 |
}
|
| 266 |
|
includes/extend/buddypress/activity.php
CHANGED
|
@@ -235,8 +235,10 @@ class BBP_BuddyPress_Activity {
|
|
| 235 |
* @uses bp_activity_set_action()
|
| 236 |
*/
|
| 237 |
public function register_activity_actions() {
|
| 238 |
-
|
| 239 |
-
|
|
|
|
|
|
|
| 240 |
}
|
| 241 |
|
| 242 |
/**
|
|
@@ -500,7 +502,7 @@ class BBP_BuddyPress_Activity {
|
|
| 500 |
if ( $activity_id = $this->get_activity_id( $topic_id ) )
|
| 501 |
return bp_activity_delete( array( 'id' => $activity_id ) );
|
| 502 |
|
| 503 |
-
return false;
|
| 504 |
}
|
| 505 |
|
| 506 |
/**
|
|
@@ -651,7 +653,7 @@ class BBP_BuddyPress_Activity {
|
|
| 651 |
if ( $activity_id = $this->get_activity_id( $reply_id ) )
|
| 652 |
return bp_activity_delete( array( 'id' => $activity_id ) );
|
| 653 |
|
| 654 |
-
return false;
|
| 655 |
}
|
| 656 |
|
| 657 |
/**
|
|
@@ -699,4 +701,3 @@ class BBP_BuddyPress_Activity {
|
|
| 699 |
}
|
| 700 |
}
|
| 701 |
endif;
|
| 702 |
-
|
| 235 |
* @uses bp_activity_set_action()
|
| 236 |
*/
|
| 237 |
public function register_activity_actions() {
|
| 238 |
+
|
| 239 |
+
// Sitewide activity stream items
|
| 240 |
+
bp_activity_set_action( $this->component, $this->topic_create, __( 'New forum topic', 'bbpress' ) );
|
| 241 |
+
bp_activity_set_action( $this->component, $this->reply_create, __( 'New forum reply', 'bbpress' ) );
|
| 242 |
}
|
| 243 |
|
| 244 |
/**
|
| 502 |
if ( $activity_id = $this->get_activity_id( $topic_id ) )
|
| 503 |
return bp_activity_delete( array( 'id' => $activity_id ) );
|
| 504 |
|
| 505 |
+
return false;
|
| 506 |
}
|
| 507 |
|
| 508 |
/**
|
| 653 |
if ( $activity_id = $this->get_activity_id( $reply_id ) )
|
| 654 |
return bp_activity_delete( array( 'id' => $activity_id ) );
|
| 655 |
|
| 656 |
+
return false;
|
| 657 |
}
|
| 658 |
|
| 659 |
/**
|
| 701 |
}
|
| 702 |
}
|
| 703 |
endif;
|
|
|
includes/extend/buddypress/functions.php
CHANGED
|
@@ -453,3 +453,175 @@ function bbp_remove_forum_id_from_all_groups( $forum_id = 0 ) {
|
|
| 453 |
bbp_remove_forum_id_from_group( $forum_id, $group_id );
|
| 454 |
}
|
| 455 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 453 |
bbp_remove_forum_id_from_group( $forum_id, $group_id );
|
| 454 |
}
|
| 455 |
}
|
| 456 |
+
|
| 457 |
+
/**
|
| 458 |
+
* Return true if a forum is a group forum
|
| 459 |
+
*
|
| 460 |
+
* @since bbPress (r4571)
|
| 461 |
+
*
|
| 462 |
+
* @param int $forum_id
|
| 463 |
+
* @uses bbp_get_forum_id() To get the forum id
|
| 464 |
+
* @uses bbp_get_forum_group_ids() To get the forum's group ids
|
| 465 |
+
* @uses apply_filters() Calls 'bbp_forum_is_group_forum' with the forum id
|
| 466 |
+
* @return bool True if it is a group forum, false if not
|
| 467 |
+
*/
|
| 468 |
+
function bbp_is_forum_group_forum( $forum_id = 0 ) {
|
| 469 |
+
|
| 470 |
+
// Validate
|
| 471 |
+
$forum_id = bbp_get_forum_id( $forum_id );
|
| 472 |
+
|
| 473 |
+
// Check for group ID's
|
| 474 |
+
$group_ids = bbp_get_forum_group_ids( $forum_id );
|
| 475 |
+
|
| 476 |
+
// Check if the forum has groups
|
| 477 |
+
$retval = (bool) !empty( $group_ids );
|
| 478 |
+
|
| 479 |
+
return (bool) apply_filters( 'bbp_is_forum_group_forum', $retval, $forum_id, $group_ids );
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
/*** Group Member Status ******************************************************/
|
| 483 |
+
|
| 484 |
+
/**
|
| 485 |
+
* Is the current user an admin of the current group
|
| 486 |
+
*
|
| 487 |
+
* @since bbPress (r4632)
|
| 488 |
+
*
|
| 489 |
+
* @uses is_user_logged_in()
|
| 490 |
+
* @uses bp_is_group()
|
| 491 |
+
* @uses bbpress()
|
| 492 |
+
* @uses get_current_user_id()
|
| 493 |
+
* @uses bp_get_current_group_id()
|
| 494 |
+
* @uses groups_is_user_admin()
|
| 495 |
+
* @return bool If current user is an admin of the current group
|
| 496 |
+
*/
|
| 497 |
+
function bbp_group_is_admin() {
|
| 498 |
+
|
| 499 |
+
// Bail if user is not logged in or not looking at a group
|
| 500 |
+
if ( ! is_user_logged_in() || ! bp_is_group() )
|
| 501 |
+
return false;
|
| 502 |
+
|
| 503 |
+
$bbp = bbpress();
|
| 504 |
+
|
| 505 |
+
// Set the global if not set
|
| 506 |
+
if ( ! isset( $bbp->current_user->is_group_admin ) )
|
| 507 |
+
$bbp->current_user->is_group_admin = groups_is_user_admin( get_current_user_id(), bp_get_current_group_id() );
|
| 508 |
+
|
| 509 |
+
// Return the value
|
| 510 |
+
return (bool) $bbp->current_user->is_group_admin;
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
/**
|
| 514 |
+
* Is the current user a moderator of the current group
|
| 515 |
+
*
|
| 516 |
+
* @since bbPress (r4632)
|
| 517 |
+
*
|
| 518 |
+
* @uses is_user_logged_in()
|
| 519 |
+
* @uses bp_is_group()
|
| 520 |
+
* @uses bbpress()
|
| 521 |
+
* @uses get_current_user_id()
|
| 522 |
+
* @uses bp_get_current_group_id()
|
| 523 |
+
* @uses groups_is_user_admin()
|
| 524 |
+
* @return bool If current user is a moderator of the current group
|
| 525 |
+
*/
|
| 526 |
+
function bbp_group_is_mod() {
|
| 527 |
+
|
| 528 |
+
// Bail if user is not logged in or not looking at a group
|
| 529 |
+
if ( ! is_user_logged_in() || ! bp_is_group() )
|
| 530 |
+
return false;
|
| 531 |
+
|
| 532 |
+
$bbp = bbpress();
|
| 533 |
+
|
| 534 |
+
// Set the global if not set
|
| 535 |
+
if ( ! isset( $bbp->current_user->is_group_mod ) )
|
| 536 |
+
$bbp->current_user->is_group_mod = groups_is_user_mod( get_current_user_id(), bp_get_current_group_id() );
|
| 537 |
+
|
| 538 |
+
// Return the value
|
| 539 |
+
return (bool) $bbp->current_user->is_group_mod;
|
| 540 |
+
}
|
| 541 |
+
|
| 542 |
+
/**
|
| 543 |
+
* Is the current user a member of the current group
|
| 544 |
+
*
|
| 545 |
+
* @since bbPress (r4632)
|
| 546 |
+
*
|
| 547 |
+
* @uses is_user_logged_in()
|
| 548 |
+
* @uses bp_is_group()
|
| 549 |
+
* @uses bbpress()
|
| 550 |
+
* @uses get_current_user_id()
|
| 551 |
+
* @uses bp_get_current_group_id()
|
| 552 |
+
* @uses groups_is_user_admin()
|
| 553 |
+
* @return bool If current user is a member of the current group
|
| 554 |
+
*/
|
| 555 |
+
function bbp_group_is_member() {
|
| 556 |
+
|
| 557 |
+
// Bail if user is not logged in or not looking at a group
|
| 558 |
+
if ( ! is_user_logged_in() || ! bp_is_group() )
|
| 559 |
+
return false;
|
| 560 |
+
|
| 561 |
+
$bbp = bbpress();
|
| 562 |
+
|
| 563 |
+
// Set the global if not set
|
| 564 |
+
if ( ! isset( $bbp->current_user->is_group_member ) )
|
| 565 |
+
$bbp->current_user->is_group_member = groups_is_user_member( get_current_user_id(), bp_get_current_group_id() );
|
| 566 |
+
|
| 567 |
+
// Return the value
|
| 568 |
+
return (bool) $bbp->current_user->is_group_member;
|
| 569 |
+
}
|
| 570 |
+
|
| 571 |
+
/**
|
| 572 |
+
* Is the current user banned from the current group
|
| 573 |
+
*
|
| 574 |
+
* @since bbPress (r4632)
|
| 575 |
+
*
|
| 576 |
+
* @uses is_user_logged_in()
|
| 577 |
+
* @uses bp_is_group()
|
| 578 |
+
* @uses bbpress()
|
| 579 |
+
* @uses get_current_user_id()
|
| 580 |
+
* @uses bp_get_current_group_id()
|
| 581 |
+
* @uses groups_is_user_admin()
|
| 582 |
+
* @return bool If current user is banned from the current group
|
| 583 |
+
*/
|
| 584 |
+
function bbp_group_is_banned() {
|
| 585 |
+
|
| 586 |
+
// Bail if user is not logged in or not looking at a group
|
| 587 |
+
if ( ! is_user_logged_in() || ! bp_is_group() )
|
| 588 |
+
return false;
|
| 589 |
+
|
| 590 |
+
$bbp = bbpress();
|
| 591 |
+
|
| 592 |
+
// Set the global if not set
|
| 593 |
+
if ( ! isset( $bbp->current_user->is_group_banned ) )
|
| 594 |
+
$bbp->current_user->is_group_banned = groups_is_user_banned( get_current_user_id(), bp_get_current_group_id() );
|
| 595 |
+
|
| 596 |
+
// Return the value
|
| 597 |
+
return (bool) $bbp->current_user->is_group_banned;
|
| 598 |
+
}
|
| 599 |
+
|
| 600 |
+
/**
|
| 601 |
+
* Is the current user the creator of the current group
|
| 602 |
+
*
|
| 603 |
+
* @since bbPress (r4632)
|
| 604 |
+
*
|
| 605 |
+
* @uses is_user_logged_in()
|
| 606 |
+
* @uses bp_is_group()
|
| 607 |
+
* @uses bbpress()
|
| 608 |
+
* @uses get_current_user_id()
|
| 609 |
+
* @uses bp_get_current_group_id()
|
| 610 |
+
* @uses groups_is_user_admin()
|
| 611 |
+
* @return bool If current user the creator of the current group
|
| 612 |
+
*/
|
| 613 |
+
function bbp_group_is_creator() {
|
| 614 |
+
|
| 615 |
+
// Bail if user is not logged in or not looking at a group
|
| 616 |
+
if ( ! is_user_logged_in() || ! bp_is_group() )
|
| 617 |
+
return false;
|
| 618 |
+
|
| 619 |
+
$bbp = bbpress();
|
| 620 |
+
|
| 621 |
+
// Set the global if not set
|
| 622 |
+
if ( ! isset( $bbp->current_user->is_group_creator ) )
|
| 623 |
+
$bbp->current_user->is_group_creator = groups_is_user_creator( get_current_user_id(), bp_get_current_group_id() );
|
| 624 |
+
|
| 625 |
+
// Return the value
|
| 626 |
+
return (bool) $bbp->current_user->is_group_creator;
|
| 627 |
+
}
|
includes/extend/buddypress/group.php
CHANGED
|
@@ -76,10 +76,10 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 76 |
private function setup_actions() {
|
| 77 |
|
| 78 |
// Possibly redirect
|
| 79 |
-
add_action( 'bbp_template_redirect', array( $this, 'redirect_canonical'
|
| 80 |
|
| 81 |
-
// Remove
|
| 82 |
-
add_action( 'bbp_after_group_forum_display', array( $this, '
|
| 83 |
}
|
| 84 |
|
| 85 |
/**
|
|
@@ -110,15 +110,24 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 110 |
add_filter( 'page_link', array( $this, 'page_link' ), 10, 2 );
|
| 111 |
add_filter( 'post_type_link', array( $this, 'post_type_link' ), 10, 2 );
|
| 112 |
|
| 113 |
-
// Allow group member to view private/hidden forums
|
| 114 |
-
add_filter( 'bbp_map_topic_meta_caps', array( $this, 'map_topic_meta_caps' ), 10, 4 );
|
| 115 |
-
add_filter( 'bbp_map_reply_meta_caps', array( $this, 'map_topic_meta_caps' ), 10, 4 );
|
| 116 |
-
|
| 117 |
// Map group forum activity items to groups
|
| 118 |
add_filter( 'bbp_before_record_activity_parse_args', array( $this, 'map_activity_to_group' ) );
|
| 119 |
|
| 120 |
// No subforums yet, so suppress them for now
|
| 121 |
add_filter( 'bbp_get_forum_subforum_count_int', array( $this, 'no_subforums_yet' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
}
|
| 123 |
|
| 124 |
/**
|
|
@@ -156,10 +165,10 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 156 |
return;
|
| 157 |
|
| 158 |
// Are forums enabled for this group?
|
| 159 |
-
$checked = (
|
| 160 |
|
| 161 |
// Tweak the nav item variable based on if group has forum or not
|
| 162 |
-
$this->enable_nav_item = $checked;
|
| 163 |
}
|
| 164 |
|
| 165 |
/**
|
|
@@ -173,11 +182,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 173 |
* @param array $args
|
| 174 |
* @return array
|
| 175 |
*/
|
| 176 |
-
public function
|
| 177 |
-
|
| 178 |
-
// Bail if not viewing a single topic
|
| 179 |
-
if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'forum' ) || ! bp_is_action_variable( 0, 'topic' ) )
|
| 180 |
-
return $caps;
|
| 181 |
|
| 182 |
switch ( $cap ) {
|
| 183 |
|
|
@@ -187,7 +192,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 187 |
case 'publish_topics' :
|
| 188 |
case 'read_hidden_forums' :
|
| 189 |
case 'read_private_forums' :
|
| 190 |
-
if (
|
| 191 |
$caps = array( 'participate' );
|
| 192 |
}
|
| 193 |
break;
|
|
@@ -199,7 +204,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 199 |
case 'view_trash' :
|
| 200 |
case 'edit_others_replies' :
|
| 201 |
case 'edit_others_topics' :
|
| 202 |
-
if (
|
| 203 |
$caps = array( 'participate' );
|
| 204 |
}
|
| 205 |
break;
|
|
@@ -207,7 +212,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 207 |
// If user is a group admin, allow them to delete topics and replies.
|
| 208 |
case 'delete_topic' :
|
| 209 |
case 'delete_reply' :
|
| 210 |
-
if (
|
| 211 |
$caps = array( 'participate' );
|
| 212 |
}
|
| 213 |
break;
|
|
@@ -221,9 +226,8 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 221 |
*
|
| 222 |
* @since bbPress (r4434)
|
| 223 |
*/
|
| 224 |
-
public function
|
| 225 |
-
remove_filter( '
|
| 226 |
-
remove_filter( 'bbp_map_reply_meta_caps', array( $this, 'map_topic_meta_caps' ), 10, 4 );
|
| 227 |
}
|
| 228 |
|
| 229 |
/** Edit ******************************************************************/
|
|
@@ -297,9 +301,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 297 |
}
|
| 298 |
|
| 299 |
// Update the group forum setting
|
| 300 |
-
$group
|
| 301 |
-
$group->enable_forum = $edit_forum;
|
| 302 |
-
$group->save();
|
| 303 |
|
| 304 |
// Create a new forum
|
| 305 |
if ( empty( $forum_id ) && ( true === $edit_forum ) ) {
|
|
@@ -375,6 +377,7 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 375 |
$create_forum = !empty( $_POST['bbp-create-group-forum'] ) ? true : false;
|
| 376 |
$forum_id = 0;
|
| 377 |
$forum_ids = bbp_get_group_forum_ids( bp_get_new_group_id() );
|
|
|
|
| 378 |
if ( !empty( $forum_ids ) )
|
| 379 |
$forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids;
|
| 380 |
|
|
@@ -414,14 +417,24 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 414 |
// Update forum active
|
| 415 |
groups_update_groupmeta( bp_get_new_group_id(), '_bbp_forum_enabled_' . $forum_id, true );
|
| 416 |
|
|
|
|
|
|
|
|
|
|
| 417 |
break;
|
| 418 |
case false :
|
| 419 |
|
| 420 |
// Forum was created but is now being undone
|
| 421 |
if ( !empty( $forum_id ) ) {
|
|
|
|
|
|
|
| 422 |
wp_delete_post( $forum_id, true );
|
|
|
|
|
|
|
| 423 |
groups_delete_groupmeta( bp_get_new_group_id(), 'forum_id' );
|
| 424 |
groups_delete_groupmeta( bp_get_new_group_id(), '_bbp_forum_enabled_' . $forum_id );
|
|
|
|
|
|
|
|
|
|
| 425 |
}
|
| 426 |
|
| 427 |
break;
|
|
@@ -492,6 +505,35 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 492 |
bbp_remove_group_id_from_forum( $forum_id, $group_id );
|
| 493 |
}
|
| 494 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 495 |
/** Display Methods *******************************************************/
|
| 496 |
|
| 497 |
/**
|
|
@@ -789,8 +831,17 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 789 |
$wp_query->bbp_is_reply_edit = true;
|
| 790 |
$post = $reply;
|
| 791 |
|
| 792 |
-
|
| 793 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 794 |
|
| 795 |
endif;
|
| 796 |
|
|
@@ -901,6 +952,43 @@ class BBP_Forums_Group_Extension extends BP_Group_Extension {
|
|
| 901 |
<?php
|
| 902 |
}
|
| 903 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 904 |
/** Permalink Mappers *****************************************************/
|
| 905 |
|
| 906 |
/**
|
| 76 |
private function setup_actions() {
|
| 77 |
|
| 78 |
// Possibly redirect
|
| 79 |
+
add_action( 'bbp_template_redirect', array( $this, 'redirect_canonical' ) );
|
| 80 |
|
| 81 |
+
// Remove group forum cap map when view is done
|
| 82 |
+
add_action( 'bbp_after_group_forum_display', array( $this, 'remove_group_forum_meta_cap_map' ) );
|
| 83 |
}
|
| 84 |
|
| 85 |
/**
|
| 110 |
add_filter( 'page_link', array( $this, 'page_link' ), 10, 2 );
|
| 111 |
add_filter( 'post_type_link', array( $this, 'post_type_link' ), 10, 2 );
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
// Map group forum activity items to groups
|
| 114 |
add_filter( 'bbp_before_record_activity_parse_args', array( $this, 'map_activity_to_group' ) );
|
| 115 |
|
| 116 |
// No subforums yet, so suppress them for now
|
| 117 |
add_filter( 'bbp_get_forum_subforum_count_int', array( $this, 'no_subforums_yet' ) );
|
| 118 |
+
|
| 119 |
+
/** Caps **************************************************************/
|
| 120 |
+
|
| 121 |
+
// Only add these filters if inside a group forum
|
| 122 |
+
if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) ) {
|
| 123 |
+
|
| 124 |
+
// Allow group member to view private/hidden forums
|
| 125 |
+
add_filter( 'bbp_map_meta_caps', array( $this, 'map_group_forum_meta_caps' ), 10, 4 );
|
| 126 |
+
|
| 127 |
+
// Group member permissions to view the topic and reply forms
|
| 128 |
+
add_filter( 'bbp_current_user_can_access_create_topic_form', array( $this, 'form_permissions' ) );
|
| 129 |
+
add_filter( 'bbp_current_user_can_access_create_reply_form', array( $this, 'form_permissions' ) );
|
| 130 |
+
}
|
| 131 |
}
|
| 132 |
|
| 133 |
/**
|
| 165 |
return;
|
| 166 |
|
| 167 |
// Are forums enabled for this group?
|
| 168 |
+
$checked = bp_get_new_group_enable_forum() || groups_get_groupmeta( bp_get_new_group_id(), 'forum_id' );
|
| 169 |
|
| 170 |
// Tweak the nav item variable based on if group has forum or not
|
| 171 |
+
$this->enable_nav_item = (bool) $checked;
|
| 172 |
}
|
| 173 |
|
| 174 |
/**
|
| 182 |
* @param array $args
|
| 183 |
* @return array
|
| 184 |
*/
|
| 185 |
+
public function map_group_forum_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
|
| 187 |
switch ( $cap ) {
|
| 188 |
|
| 192 |
case 'publish_topics' :
|
| 193 |
case 'read_hidden_forums' :
|
| 194 |
case 'read_private_forums' :
|
| 195 |
+
if ( bbp_group_is_member() || bbp_group_is_mod() || bbp_group_is_admin() ) {
|
| 196 |
$caps = array( 'participate' );
|
| 197 |
}
|
| 198 |
break;
|
| 204 |
case 'view_trash' :
|
| 205 |
case 'edit_others_replies' :
|
| 206 |
case 'edit_others_topics' :
|
| 207 |
+
if ( bbp_group_is_mod() || bbp_group_is_admin() ) {
|
| 208 |
$caps = array( 'participate' );
|
| 209 |
}
|
| 210 |
break;
|
| 212 |
// If user is a group admin, allow them to delete topics and replies.
|
| 213 |
case 'delete_topic' :
|
| 214 |
case 'delete_reply' :
|
| 215 |
+
if ( bbp_group_is_admin() ) {
|
| 216 |
$caps = array( 'participate' );
|
| 217 |
}
|
| 218 |
break;
|
| 226 |
*
|
| 227 |
* @since bbPress (r4434)
|
| 228 |
*/
|
| 229 |
+
public function remove_group_forum_meta_cap_map() {
|
| 230 |
+
remove_filter( 'bbp_map_meta_caps', array( $this, 'map_group_forum_meta_caps' ), 99, 4 );
|
|
|
|
| 231 |
}
|
| 232 |
|
| 233 |
/** Edit ******************************************************************/
|
| 301 |
}
|
| 302 |
|
| 303 |
// Update the group forum setting
|
| 304 |
+
$group = $this->toggle_group_forum( $group_id, $edit_forum );
|
|
|
|
|
|
|
| 305 |
|
| 306 |
// Create a new forum
|
| 307 |
if ( empty( $forum_id ) && ( true === $edit_forum ) ) {
|
| 377 |
$create_forum = !empty( $_POST['bbp-create-group-forum'] ) ? true : false;
|
| 378 |
$forum_id = 0;
|
| 379 |
$forum_ids = bbp_get_group_forum_ids( bp_get_new_group_id() );
|
| 380 |
+
|
| 381 |
if ( !empty( $forum_ids ) )
|
| 382 |
$forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids;
|
| 383 |
|
| 417 |
// Update forum active
|
| 418 |
groups_update_groupmeta( bp_get_new_group_id(), '_bbp_forum_enabled_' . $forum_id, true );
|
| 419 |
|
| 420 |
+
// Toggle forum on
|
| 421 |
+
$this->toggle_group_forum( bp_get_new_group_id(), true );
|
| 422 |
+
|
| 423 |
break;
|
| 424 |
case false :
|
| 425 |
|
| 426 |
// Forum was created but is now being undone
|
| 427 |
if ( !empty( $forum_id ) ) {
|
| 428 |
+
|
| 429 |
+
// Delete the forum
|
| 430 |
wp_delete_post( $forum_id, true );
|
| 431 |
+
|
| 432 |
+
// Delete meta values
|
| 433 |
groups_delete_groupmeta( bp_get_new_group_id(), 'forum_id' );
|
| 434 |
groups_delete_groupmeta( bp_get_new_group_id(), '_bbp_forum_enabled_' . $forum_id );
|
| 435 |
+
|
| 436 |
+
// Toggle forum off
|
| 437 |
+
$this->toggle_group_forum( bp_get_new_group_id(), false );
|
| 438 |
}
|
| 439 |
|
| 440 |
break;
|
| 505 |
bbp_remove_group_id_from_forum( $forum_id, $group_id );
|
| 506 |
}
|
| 507 |
|
| 508 |
+
/**
|
| 509 |
+
* Toggle the enable_forum group setting on or off
|
| 510 |
+
*
|
| 511 |
+
* @since bbPress (r4612)
|
| 512 |
+
*
|
| 513 |
+
* @param int $group_id The group to toggle
|
| 514 |
+
* @param bool $enabled True for on, false for off
|
| 515 |
+
* @uses groups_get_group() To get the group to toggle
|
| 516 |
+
* @return False if group is not found, otherwise return the group
|
| 517 |
+
*/
|
| 518 |
+
public function toggle_group_forum( $group_id = 0, $enabled = false ) {
|
| 519 |
+
|
| 520 |
+
// Get the group
|
| 521 |
+
$group = groups_get_group( array( 'group_id' => $group_id ) );
|
| 522 |
+
|
| 523 |
+
// Bail if group cannot be found
|
| 524 |
+
if ( empty( $group ) )
|
| 525 |
+
return false;
|
| 526 |
+
|
| 527 |
+
// Set forum enabled status
|
| 528 |
+
$group->enable_forum = (int) $enabled;
|
| 529 |
+
|
| 530 |
+
// Save the group
|
| 531 |
+
$group->save();
|
| 532 |
+
|
| 533 |
+
// Return the group
|
| 534 |
+
return $group;
|
| 535 |
+
}
|
| 536 |
+
|
| 537 |
/** Display Methods *******************************************************/
|
| 538 |
|
| 539 |
/**
|
| 831 |
$wp_query->bbp_is_reply_edit = true;
|
| 832 |
$post = $reply;
|
| 833 |
|
| 834 |
+
// Move
|
| 835 |
+
if ( !empty( $_GET['action'] ) && ( 'move' == $_GET['action'] ) ) :
|
| 836 |
+
bbp_set_query_name( 'bbp_reply_move' );
|
| 837 |
+
bbp_get_template_part( 'form', 'reply-move' );
|
| 838 |
+
|
| 839 |
+
// Edit
|
| 840 |
+
else :
|
| 841 |
+
bbp_set_query_name( 'bbp_reply_form' );
|
| 842 |
+
bbp_get_template_part( 'form', 'reply' );
|
| 843 |
+
|
| 844 |
+
endif;
|
| 845 |
|
| 846 |
endif;
|
| 847 |
|
| 952 |
<?php
|
| 953 |
}
|
| 954 |
|
| 955 |
+
/**
|
| 956 |
+
* Permissions to view the 'New Topic'/'Reply To' form in a BuddyPress group.
|
| 957 |
+
*
|
| 958 |
+
* @since bbPress (r4608)
|
| 959 |
+
*
|
| 960 |
+
* @param bool $retval Are we allowed to view the reply form?
|
| 961 |
+
* @uses bp_is_group() To determine if we're on a group page
|
| 962 |
+
* @uses bp_loggedin_user_id() To determine if a user is logged in.
|
| 963 |
+
* @uses bp_group_is_member() Is the current user a member of the group?
|
| 964 |
+
* @uses bp_group_is_user_banned() Is the current user banned from the group?
|
| 965 |
+
*
|
| 966 |
+
* @return bool
|
| 967 |
+
*/
|
| 968 |
+
public function form_permissions( $retval = false ) {
|
| 969 |
+
|
| 970 |
+
// Bail if not a group
|
| 971 |
+
if ( ! bp_is_group() ) {
|
| 972 |
+
return $retval;
|
| 973 |
+
}
|
| 974 |
+
|
| 975 |
+
// Bail if user is not logged in
|
| 976 |
+
if ( ! is_user_logged_in() ) {
|
| 977 |
+
return $retval;
|
| 978 |
+
}
|
| 979 |
+
|
| 980 |
+
// Non-members cannot see forms
|
| 981 |
+
if ( ! bbp_group_is_member() ) {
|
| 982 |
+
$retval = false;
|
| 983 |
+
|
| 984 |
+
// Banned users cannot see forms
|
| 985 |
+
} elseif ( bbp_group_is_banned() ) {
|
| 986 |
+
$retval = false;
|
| 987 |
+
}
|
| 988 |
+
|
| 989 |
+
return $retval;
|
| 990 |
+
}
|
| 991 |
+
|
| 992 |
/** Permalink Mappers *****************************************************/
|
| 993 |
|
| 994 |
/**
|
includes/extend/buddypress/loader.php
CHANGED
|
@@ -45,7 +45,6 @@ class BBP_Forums_Component extends BP_Component {
|
|
| 45 |
$this->includes();
|
| 46 |
$this->setup_globals();
|
| 47 |
$this->setup_actions();
|
| 48 |
-
$this->setup_nav();
|
| 49 |
$this->fully_loaded();
|
| 50 |
}
|
| 51 |
|
|
@@ -103,6 +102,23 @@ class BBP_Forums_Component extends BP_Component {
|
|
| 103 |
parent::setup_globals( $globals );
|
| 104 |
}
|
| 105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
/**
|
| 107 |
* Instantiate classes for BuddyPress integration
|
| 108 |
*
|
|
@@ -124,22 +140,6 @@ class BBP_Forums_Component extends BP_Component {
|
|
| 124 |
}
|
| 125 |
}
|
| 126 |
|
| 127 |
-
/**
|
| 128 |
-
* Setup the actions
|
| 129 |
-
*
|
| 130 |
-
* @since bbPress (r3395)
|
| 131 |
-
* @access private
|
| 132 |
-
* @uses add_filter() To add various filters
|
| 133 |
-
* @uses add_action() To add various actions
|
| 134 |
-
*/
|
| 135 |
-
public function setup_actions() {
|
| 136 |
-
|
| 137 |
-
// Setup the components
|
| 138 |
-
add_action( 'bp_init', array( $this, 'setup_components' ) );
|
| 139 |
-
|
| 140 |
-
parent::setup_actions();
|
| 141 |
-
}
|
| 142 |
-
|
| 143 |
/**
|
| 144 |
* Allow the variables, actions, and filters to be modified by third party
|
| 145 |
* plugins and themes.
|
| 45 |
$this->includes();
|
| 46 |
$this->setup_globals();
|
| 47 |
$this->setup_actions();
|
|
|
|
| 48 |
$this->fully_loaded();
|
| 49 |
}
|
| 50 |
|
| 102 |
parent::setup_globals( $globals );
|
| 103 |
}
|
| 104 |
|
| 105 |
+
/**
|
| 106 |
+
* Setup the actions
|
| 107 |
+
*
|
| 108 |
+
* @since bbPress (r3395)
|
| 109 |
+
* @access private
|
| 110 |
+
* @uses add_filter() To add various filters
|
| 111 |
+
* @uses add_action() To add various actions
|
| 112 |
+
* @link http://bbpress.trac.wordpress.org/ticket/2176
|
| 113 |
+
*/
|
| 114 |
+
public function setup_actions() {
|
| 115 |
+
|
| 116 |
+
// Setup the components
|
| 117 |
+
add_action( 'bp_init', array( $this, 'setup_components' ), 7 );
|
| 118 |
+
|
| 119 |
+
parent::setup_actions();
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
/**
|
| 123 |
* Instantiate classes for BuddyPress integration
|
| 124 |
*
|
| 140 |
}
|
| 141 |
}
|
| 142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
/**
|
| 144 |
* Allow the variables, actions, and filters to be modified by third party
|
| 145 |
* plugins and themes.
|
includes/extend/buddypress/members.php
CHANGED
|
@@ -42,6 +42,9 @@ class BBP_BuddyPress_Members {
|
|
| 42 |
*/
|
| 43 |
private function setup_actions() {
|
| 44 |
|
|
|
|
|
|
|
|
|
|
| 45 |
/** Favorites *********************************************************/
|
| 46 |
|
| 47 |
// Move handler to 'bp_actions' - BuddyPress bypasses template_loader
|
|
@@ -139,5 +142,32 @@ class BBP_BuddyPress_Members {
|
|
| 139 |
$url = trailingslashit( bp_core_get_user_domain( $user_id ) . 'forums/subscriptions' );
|
| 140 |
return $url;
|
| 141 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
}
|
| 143 |
endif;
|
| 42 |
*/
|
| 43 |
private function setup_actions() {
|
| 44 |
|
| 45 |
+
// Allow unsubscribe/unfavorite links to work
|
| 46 |
+
add_action( 'bp_template_redirect', array( $this, 'set_member_forum_query_vars' ) );
|
| 47 |
+
|
| 48 |
/** Favorites *********************************************************/
|
| 49 |
|
| 50 |
// Move handler to 'bp_actions' - BuddyPress bypasses template_loader
|
| 142 |
$url = trailingslashit( bp_core_get_user_domain( $user_id ) . 'forums/subscriptions' );
|
| 143 |
return $url;
|
| 144 |
}
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* Set favorites and subscriptions query variables if viewing member profile
|
| 148 |
+
* pages.
|
| 149 |
+
*
|
| 150 |
+
* @since bbPress (r4615)
|
| 151 |
+
*
|
| 152 |
+
* @global WP_Query $wp_query
|
| 153 |
+
* @return If not viewing your own profile
|
| 154 |
+
*/
|
| 155 |
+
public function set_member_forum_query_vars() {
|
| 156 |
+
|
| 157 |
+
// Special handling for forum component
|
| 158 |
+
if ( ! bp_is_my_profile() )
|
| 159 |
+
return;
|
| 160 |
+
|
| 161 |
+
global $wp_query;
|
| 162 |
+
|
| 163 |
+
// 'favorites' action
|
| 164 |
+
if ( bbp_is_favorites_active() && bp_is_current_action( 'favorites' ) ) {
|
| 165 |
+
$wp_query->bbp_is_single_user_favs = true;
|
| 166 |
+
|
| 167 |
+
// 'subscriptions' action
|
| 168 |
+
} elseif ( bbp_is_subscriptions_active() && bp_is_current_action( 'subscriptions' ) ) {
|
| 169 |
+
$wp_query->bbp_is_single_user_subs = true;
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
}
|
| 173 |
endif;
|
includes/forums/capabilities.php
CHANGED
|
@@ -176,7 +176,7 @@ function bbp_map_forum_meta_caps( $caps = array(), $cap = '', $user_id = 0, $arg
|
|
| 176 |
/** Admin *************************************************************/
|
| 177 |
|
| 178 |
case 'bbp_forums_admin' :
|
| 179 |
-
$caps = array( '
|
| 180 |
break;
|
| 181 |
}
|
| 182 |
|
| 176 |
/** Admin *************************************************************/
|
| 177 |
|
| 178 |
case 'bbp_forums_admin' :
|
| 179 |
+
$caps = array( 'keep_gate' );
|
| 180 |
break;
|
| 181 |
}
|
| 182 |
|
includes/forums/functions.php
CHANGED
|
@@ -77,6 +77,7 @@ function bbp_insert_forum( $forum_data = array(), $forum_meta = array() ) {
|
|
| 77 |
/**
|
| 78 |
* Handles the front end forum submission
|
| 79 |
*
|
|
|
|
| 80 |
* @uses bbPress:errors::add() To log various error messages
|
| 81 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 82 |
* @uses bbp_is_anonymous() To check if an anonymous post is being made
|
|
@@ -106,14 +107,10 @@ function bbp_insert_forum( $forum_data = array(), $forum_meta = array() ) {
|
|
| 106 |
* @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error
|
| 107 |
* messages
|
| 108 |
*/
|
| 109 |
-
function bbp_new_forum_handler() {
|
| 110 |
-
|
| 111 |
-
// Bail if not a POST action
|
| 112 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 113 |
-
return;
|
| 114 |
|
| 115 |
// Bail if action is not bbp-new-forum
|
| 116 |
-
if (
|
| 117 |
return;
|
| 118 |
|
| 119 |
// Nonce check
|
|
@@ -299,7 +296,7 @@ function bbp_new_forum_handler() {
|
|
| 299 |
/** Redirect **********************************************************/
|
| 300 |
|
| 301 |
// Redirect to
|
| 302 |
-
$redirect_to
|
| 303 |
|
| 304 |
// Get the forum URL
|
| 305 |
$redirect_url = bbp_get_forum_permalink( $forum_id, $redirect_to );
|
|
@@ -338,6 +335,7 @@ function bbp_new_forum_handler() {
|
|
| 338 |
/**
|
| 339 |
* Handles the front end edit forum submission
|
| 340 |
*
|
|
|
|
| 341 |
* @uses bbPress:errors::add() To log various error messages
|
| 342 |
* @uses bbp_get_forum() To get the forum
|
| 343 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
|
@@ -367,14 +365,10 @@ function bbp_new_forum_handler() {
|
|
| 367 |
* @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error
|
| 368 |
* messages
|
| 369 |
*/
|
| 370 |
-
function bbp_edit_forum_handler() {
|
| 371 |
-
|
| 372 |
-
// Bail if not a POST action
|
| 373 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 374 |
-
return;
|
| 375 |
|
| 376 |
// Bail if action is not bbp-edit-forum
|
| 377 |
-
if (
|
| 378 |
return;
|
| 379 |
|
| 380 |
// Define local variable(s)
|
|
@@ -554,7 +548,7 @@ function bbp_edit_forum_handler() {
|
|
| 554 |
/** Redirect **********************************************************/
|
| 555 |
|
| 556 |
// Redirect to
|
| 557 |
-
$redirect_to =
|
| 558 |
|
| 559 |
// View all?
|
| 560 |
$view_all = bbp_get_view_all();
|
|
@@ -663,25 +657,6 @@ function bbp_save_forum_extras( $forum_id = 0 ) {
|
|
| 663 |
}
|
| 664 |
}
|
| 665 |
|
| 666 |
-
/** Walk **********************************************************************/
|
| 667 |
-
|
| 668 |
-
/**
|
| 669 |
-
* Walk the forum tree
|
| 670 |
-
*
|
| 671 |
-
* @param object $forums Forums
|
| 672 |
-
* @param int $depth Depth
|
| 673 |
-
* @param int $current Current forum
|
| 674 |
-
* @param array $r Parsed arguments, supported by the walker. If you want to
|
| 675 |
-
* use your own walker, pass the 'walker' arg with the walker.
|
| 676 |
-
* The walker defaults to {@link BBP_Walker_Forum}
|
| 677 |
-
* @return object Walked forum tree
|
| 678 |
-
*/
|
| 679 |
-
function bbp_walk_forum( $forums, $depth, $current, $r ) {
|
| 680 |
-
$walker = empty( $r['walker'] ) ? new BBP_Walker_Forum : $r['walker'];
|
| 681 |
-
$args = array( $forums, $depth, $r, $current );
|
| 682 |
-
return call_user_func_array( array( &$walker, 'walk' ), $args );
|
| 683 |
-
}
|
| 684 |
-
|
| 685 |
/** Forum Actions *************************************************************/
|
| 686 |
|
| 687 |
/**
|
|
@@ -954,8 +929,8 @@ function bbp_bump_forum_topic_count( $forum_id = 0, $difference = 1, $update_anc
|
|
| 954 |
|
| 955 |
// Get some counts
|
| 956 |
$forum_id = bbp_get_forum_id( $forum_id );
|
| 957 |
-
$topic_count = bbp_get_forum_topic_count( $forum_id, false,
|
| 958 |
-
$total_topic_count = bbp_get_forum_topic_count( $forum_id, true,
|
| 959 |
|
| 960 |
// Update this forum id
|
| 961 |
update_post_meta( $forum_id, '_bbp_topic_count', (int) $topic_count + (int) $difference );
|
|
@@ -973,8 +948,8 @@ function bbp_bump_forum_topic_count( $forum_id = 0, $difference = 1, $update_anc
|
|
| 973 |
foreach ( (array) $ancestors as $parent_forum_id ) {
|
| 974 |
|
| 975 |
// Get forum counts
|
| 976 |
-
$parent_topic_count = bbp_get_forum_topic_count( $parent_forum_id, false,
|
| 977 |
-
$parent_total_topic_count = bbp_get_forum_topic_count( $parent_forum_id, true,
|
| 978 |
|
| 979 |
// Update counts
|
| 980 |
update_post_meta( $parent_forum_id, '_bbp_topic_count', (int) $parent_topic_count + (int) $difference );
|
|
@@ -1003,7 +978,7 @@ function bbp_bump_forum_topic_count_hidden( $forum_id = 0, $difference = 1 ) {
|
|
| 1003 |
|
| 1004 |
// Get some counts
|
| 1005 |
$forum_id = bbp_get_forum_id( $forum_id );
|
| 1006 |
-
$topic_count = bbp_get_forum_topic_count_hidden( $forum_id,
|
| 1007 |
$new_count = (int) $topic_count + (int) $difference;
|
| 1008 |
|
| 1009 |
// Update this forum id
|
|
@@ -1030,8 +1005,8 @@ function bbp_bump_forum_reply_count( $forum_id = 0, $difference = 1, $update_anc
|
|
| 1030 |
|
| 1031 |
// Get some counts
|
| 1032 |
$forum_id = bbp_get_forum_id( $forum_id );
|
| 1033 |
-
$topic_count = bbp_get_forum_reply_count( $forum_id, false );
|
| 1034 |
-
$total_reply_count = bbp_get_forum_reply_count( $forum_id, true );
|
| 1035 |
|
| 1036 |
// Update this forum id
|
| 1037 |
update_post_meta( $forum_id, '_bbp_reply_count', (int) $topic_count + (int) $difference );
|
|
@@ -1049,8 +1024,8 @@ function bbp_bump_forum_reply_count( $forum_id = 0, $difference = 1, $update_anc
|
|
| 1049 |
foreach ( (array) $ancestors as $parent_forum_id ) {
|
| 1050 |
|
| 1051 |
// Get forum counts
|
| 1052 |
-
$parent_topic_count = bbp_get_forum_reply_count( $parent_forum_id, false );
|
| 1053 |
-
$parent_total_reply_count = bbp_get_forum_reply_count( $parent_forum_id, true );
|
| 1054 |
|
| 1055 |
// Update counts
|
| 1056 |
update_post_meta( $parent_forum_id, '_bbp_reply_count', (int) $parent_topic_count + (int) $difference );
|
|
@@ -1431,10 +1406,11 @@ function bbp_update_forum_reply_count( $forum_id = 0 ) {
|
|
| 1431 |
|
| 1432 |
// Don't count replies if the forum is a category
|
| 1433 |
$topic_ids = bbp_forum_query_topic_ids( $forum_id );
|
| 1434 |
-
if ( !empty( $topic_ids ) )
|
| 1435 |
$reply_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s';", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );
|
| 1436 |
-
else
|
| 1437 |
$reply_count = 0;
|
|
|
|
| 1438 |
|
| 1439 |
// Calculate total replies in this forum
|
| 1440 |
$total_replies = (int) $reply_count + $children_reply_count;
|
|
@@ -1472,7 +1448,9 @@ function bbp_update_forum_reply_count( $forum_id = 0 ) {
|
|
| 1472 |
* @uses bbp_update_forum_topic_count_hidden() To update the hidden topic count
|
| 1473 |
*/
|
| 1474 |
function bbp_update_forum( $args = '' ) {
|
| 1475 |
-
|
|
|
|
|
|
|
| 1476 |
'forum_id' => 0,
|
| 1477 |
'post_parent' => 0,
|
| 1478 |
'last_topic_id' => 0,
|
|
@@ -1480,36 +1458,35 @@ function bbp_update_forum( $args = '' ) {
|
|
| 1480 |
'last_active_id' => 0,
|
| 1481 |
'last_active_time' => 0,
|
| 1482 |
'last_active_status' => bbp_get_public_status_id()
|
| 1483 |
-
);
|
| 1484 |
-
$r = bbp_parse_args( $args, $defaults, 'update_forum' );
|
| 1485 |
-
extract( $r );
|
| 1486 |
|
| 1487 |
// Last topic and reply ID's
|
| 1488 |
-
bbp_update_forum_last_topic_id( $forum_id, $last_topic_id );
|
| 1489 |
-
bbp_update_forum_last_reply_id( $forum_id, $last_reply_id );
|
| 1490 |
|
| 1491 |
// Active dance
|
| 1492 |
-
$last_active_id = bbp_update_forum_last_active_id( $forum_id, $last_active_id );
|
| 1493 |
|
| 1494 |
// If no active time was passed, get it from the last_active_id
|
| 1495 |
-
if ( empty( $last_active_time ) )
|
| 1496 |
-
$last_active_time = get_post_field( 'post_date', $last_active_id );
|
|
|
|
| 1497 |
|
| 1498 |
-
if ( bbp_get_public_status_id() == $last_active_status ) {
|
| 1499 |
-
bbp_update_forum_last_active_time( $forum_id, $last_active_time );
|
| 1500 |
}
|
| 1501 |
|
| 1502 |
// Counts
|
| 1503 |
-
bbp_update_forum_subforum_count ( $forum_id );
|
| 1504 |
-
bbp_update_forum_reply_count ( $forum_id );
|
| 1505 |
-
bbp_update_forum_topic_count ( $forum_id );
|
| 1506 |
-
bbp_update_forum_topic_count_hidden( $forum_id );
|
| 1507 |
|
| 1508 |
// Update the parent forum if one was passed
|
| 1509 |
-
if ( !empty( $post_parent ) && is_numeric( $post_parent ) ) {
|
| 1510 |
bbp_update_forum( array(
|
| 1511 |
-
'forum_id' => $post_parent,
|
| 1512 |
-
'post_parent' => get_post_field( 'post_parent', $post_parent )
|
| 1513 |
) );
|
| 1514 |
}
|
| 1515 |
}
|
|
@@ -1748,7 +1725,7 @@ function bbp_forum_query_topic_ids( $forum_id ) {
|
|
| 1748 |
* ids and forum id
|
| 1749 |
*/
|
| 1750 |
function bbp_forum_query_subforum_ids( $forum_id ) {
|
| 1751 |
-
$subforum_ids =
|
| 1752 |
//usort( $subforum_ids, '_bbp_forum_query_usort_subforum_ids' );
|
| 1753 |
|
| 1754 |
return apply_filters( 'bbp_get_forum_subforum_ids', $subforum_ids, $forum_id );
|
|
@@ -1960,16 +1937,21 @@ function bbp_delete_forum_topics( $forum_id = 0 ) {
|
|
| 1960 |
if ( empty( $forum_id ) )
|
| 1961 |
return;
|
| 1962 |
|
| 1963 |
-
// Forum is being permanently deleted, so its
|
| 1964 |
-
|
|
|
|
| 1965 |
'suppress_filters' => true,
|
| 1966 |
'post_type' => bbp_get_topic_post_type(),
|
| 1967 |
'post_parent' => $forum_id,
|
| 1968 |
-
'post_status' =>
|
| 1969 |
'posts_per_page' => -1,
|
| 1970 |
'nopaging' => true,
|
| 1971 |
'fields' => 'id=>parent'
|
| 1972 |
-
) )
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1973 |
foreach ( $topics->posts as $topic ) {
|
| 1974 |
wp_delete_post( $topic->ID, true );
|
| 1975 |
}
|
|
@@ -1977,6 +1959,9 @@ function bbp_delete_forum_topics( $forum_id = 0 ) {
|
|
| 1977 |
// Reset the $post global
|
| 1978 |
wp_reset_postdata();
|
| 1979 |
}
|
|
|
|
|
|
|
|
|
|
| 1980 |
}
|
| 1981 |
|
| 1982 |
/**
|
|
@@ -2009,8 +1994,8 @@ function bbp_trash_forum_topics( $forum_id = 0 ) {
|
|
| 2009 |
bbp_get_pending_status_id()
|
| 2010 |
) );
|
| 2011 |
|
| 2012 |
-
// Forum is being trashed, so its topics are trashed too
|
| 2013 |
-
|
| 2014 |
'suppress_filters' => true,
|
| 2015 |
'post_type' => bbp_get_topic_post_type(),
|
| 2016 |
'post_parent' => $forum_id,
|
|
@@ -2018,7 +2003,11 @@ function bbp_trash_forum_topics( $forum_id = 0 ) {
|
|
| 2018 |
'posts_per_page' => -1,
|
| 2019 |
'nopaging' => true,
|
| 2020 |
'fields' => 'id=>parent'
|
| 2021 |
-
) )
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2022 |
|
| 2023 |
// Prevent debug notices
|
| 2024 |
$pre_trashed_topics = array();
|
|
@@ -2037,6 +2026,9 @@ function bbp_trash_forum_topics( $forum_id = 0 ) {
|
|
| 2037 |
// Reset the $post global
|
| 2038 |
wp_reset_postdata();
|
| 2039 |
}
|
|
|
|
|
|
|
|
|
|
| 2040 |
}
|
| 2041 |
|
| 2042 |
/**
|
| 77 |
/**
|
| 78 |
* Handles the front end forum submission
|
| 79 |
*
|
| 80 |
+
* @param string $action The requested action to compare this function to
|
| 81 |
* @uses bbPress:errors::add() To log various error messages
|
| 82 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 83 |
* @uses bbp_is_anonymous() To check if an anonymous post is being made
|
| 107 |
* @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error
|
| 108 |
* messages
|
| 109 |
*/
|
| 110 |
+
function bbp_new_forum_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
// Bail if action is not bbp-new-forum
|
| 113 |
+
if ( 'bbp-new-forum' !== $action )
|
| 114 |
return;
|
| 115 |
|
| 116 |
// Nonce check
|
| 296 |
/** Redirect **********************************************************/
|
| 297 |
|
| 298 |
// Redirect to
|
| 299 |
+
$redirect_to = bbp_get_redirect_to();
|
| 300 |
|
| 301 |
// Get the forum URL
|
| 302 |
$redirect_url = bbp_get_forum_permalink( $forum_id, $redirect_to );
|
| 335 |
/**
|
| 336 |
* Handles the front end edit forum submission
|
| 337 |
*
|
| 338 |
+
* @param string $action The requested action to compare this function to
|
| 339 |
* @uses bbPress:errors::add() To log various error messages
|
| 340 |
* @uses bbp_get_forum() To get the forum
|
| 341 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 365 |
* @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error
|
| 366 |
* messages
|
| 367 |
*/
|
| 368 |
+
function bbp_edit_forum_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 369 |
|
| 370 |
// Bail if action is not bbp-edit-forum
|
| 371 |
+
if ( 'bbp-edit-forum' !== $action )
|
| 372 |
return;
|
| 373 |
|
| 374 |
// Define local variable(s)
|
| 548 |
/** Redirect **********************************************************/
|
| 549 |
|
| 550 |
// Redirect to
|
| 551 |
+
$redirect_to = bbp_get_redirect_to();
|
| 552 |
|
| 553 |
// View all?
|
| 554 |
$view_all = bbp_get_view_all();
|
| 657 |
}
|
| 658 |
}
|
| 659 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 660 |
/** Forum Actions *************************************************************/
|
| 661 |
|
| 662 |
/**
|
| 929 |
|
| 930 |
// Get some counts
|
| 931 |
$forum_id = bbp_get_forum_id( $forum_id );
|
| 932 |
+
$topic_count = bbp_get_forum_topic_count( $forum_id, false, true );
|
| 933 |
+
$total_topic_count = bbp_get_forum_topic_count( $forum_id, true, true );
|
| 934 |
|
| 935 |
// Update this forum id
|
| 936 |
update_post_meta( $forum_id, '_bbp_topic_count', (int) $topic_count + (int) $difference );
|
| 948 |
foreach ( (array) $ancestors as $parent_forum_id ) {
|
| 949 |
|
| 950 |
// Get forum counts
|
| 951 |
+
$parent_topic_count = bbp_get_forum_topic_count( $parent_forum_id, false, true );
|
| 952 |
+
$parent_total_topic_count = bbp_get_forum_topic_count( $parent_forum_id, true, true );
|
| 953 |
|
| 954 |
// Update counts
|
| 955 |
update_post_meta( $parent_forum_id, '_bbp_topic_count', (int) $parent_topic_count + (int) $difference );
|
| 978 |
|
| 979 |
// Get some counts
|
| 980 |
$forum_id = bbp_get_forum_id( $forum_id );
|
| 981 |
+
$topic_count = bbp_get_forum_topic_count_hidden( $forum_id, true );
|
| 982 |
$new_count = (int) $topic_count + (int) $difference;
|
| 983 |
|
| 984 |
// Update this forum id
|
| 1005 |
|
| 1006 |
// Get some counts
|
| 1007 |
$forum_id = bbp_get_forum_id( $forum_id );
|
| 1008 |
+
$topic_count = bbp_get_forum_reply_count( $forum_id, false, true );
|
| 1009 |
+
$total_reply_count = bbp_get_forum_reply_count( $forum_id, true, true );
|
| 1010 |
|
| 1011 |
// Update this forum id
|
| 1012 |
update_post_meta( $forum_id, '_bbp_reply_count', (int) $topic_count + (int) $difference );
|
| 1024 |
foreach ( (array) $ancestors as $parent_forum_id ) {
|
| 1025 |
|
| 1026 |
// Get forum counts
|
| 1027 |
+
$parent_topic_count = bbp_get_forum_reply_count( $parent_forum_id, false, true );
|
| 1028 |
+
$parent_total_reply_count = bbp_get_forum_reply_count( $parent_forum_id, true, true );
|
| 1029 |
|
| 1030 |
// Update counts
|
| 1031 |
update_post_meta( $parent_forum_id, '_bbp_reply_count', (int) $parent_topic_count + (int) $difference );
|
| 1406 |
|
| 1407 |
// Don't count replies if the forum is a category
|
| 1408 |
$topic_ids = bbp_forum_query_topic_ids( $forum_id );
|
| 1409 |
+
if ( !empty( $topic_ids ) ) {
|
| 1410 |
$reply_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s';", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );
|
| 1411 |
+
} else {
|
| 1412 |
$reply_count = 0;
|
| 1413 |
+
}
|
| 1414 |
|
| 1415 |
// Calculate total replies in this forum
|
| 1416 |
$total_replies = (int) $reply_count + $children_reply_count;
|
| 1448 |
* @uses bbp_update_forum_topic_count_hidden() To update the hidden topic count
|
| 1449 |
*/
|
| 1450 |
function bbp_update_forum( $args = '' ) {
|
| 1451 |
+
|
| 1452 |
+
// Parse arguments against default values
|
| 1453 |
+
$r = bbp_parse_args( $args, array(
|
| 1454 |
'forum_id' => 0,
|
| 1455 |
'post_parent' => 0,
|
| 1456 |
'last_topic_id' => 0,
|
| 1458 |
'last_active_id' => 0,
|
| 1459 |
'last_active_time' => 0,
|
| 1460 |
'last_active_status' => bbp_get_public_status_id()
|
| 1461 |
+
), 'update_forum' );
|
|
|
|
|
|
|
| 1462 |
|
| 1463 |
// Last topic and reply ID's
|
| 1464 |
+
bbp_update_forum_last_topic_id( $r['forum_id'], $r['last_topic_id'] );
|
| 1465 |
+
bbp_update_forum_last_reply_id( $r['forum_id'], $r['last_reply_id'] );
|
| 1466 |
|
| 1467 |
// Active dance
|
| 1468 |
+
$r['last_active_id'] = bbp_update_forum_last_active_id( $r['forum_id'], $r['last_active_id'] );
|
| 1469 |
|
| 1470 |
// If no active time was passed, get it from the last_active_id
|
| 1471 |
+
if ( empty( $r['last_active_time'] ) ) {
|
| 1472 |
+
$r['last_active_time'] = get_post_field( 'post_date', $r['last_active_id'] );
|
| 1473 |
+
}
|
| 1474 |
|
| 1475 |
+
if ( bbp_get_public_status_id() == $r['last_active_status'] ) {
|
| 1476 |
+
bbp_update_forum_last_active_time( $r['forum_id'], $r['last_active_time'] );
|
| 1477 |
}
|
| 1478 |
|
| 1479 |
// Counts
|
| 1480 |
+
bbp_update_forum_subforum_count ( $r['forum_id'] );
|
| 1481 |
+
bbp_update_forum_reply_count ( $r['forum_id'] );
|
| 1482 |
+
bbp_update_forum_topic_count ( $r['forum_id'] );
|
| 1483 |
+
bbp_update_forum_topic_count_hidden( $r['forum_id'] );
|
| 1484 |
|
| 1485 |
// Update the parent forum if one was passed
|
| 1486 |
+
if ( !empty( $r['post_parent'] ) && is_numeric( $r['post_parent'] ) ) {
|
| 1487 |
bbp_update_forum( array(
|
| 1488 |
+
'forum_id' => $r['post_parent'],
|
| 1489 |
+
'post_parent' => get_post_field( 'post_parent', $r['post_parent'] )
|
| 1490 |
) );
|
| 1491 |
}
|
| 1492 |
}
|
| 1725 |
* ids and forum id
|
| 1726 |
*/
|
| 1727 |
function bbp_forum_query_subforum_ids( $forum_id ) {
|
| 1728 |
+
$subforum_ids = bbp_get_all_child_ids( $forum_id, bbp_get_forum_post_type() );
|
| 1729 |
//usort( $subforum_ids, '_bbp_forum_query_usort_subforum_ids' );
|
| 1730 |
|
| 1731 |
return apply_filters( 'bbp_get_forum_subforum_ids', $subforum_ids, $forum_id );
|
| 1937 |
if ( empty( $forum_id ) )
|
| 1938 |
return;
|
| 1939 |
|
| 1940 |
+
// Forum is being permanently deleted, so its content has go too
|
| 1941 |
+
// Note that we get all post statuses here
|
| 1942 |
+
$topics = new WP_Query( array(
|
| 1943 |
'suppress_filters' => true,
|
| 1944 |
'post_type' => bbp_get_topic_post_type(),
|
| 1945 |
'post_parent' => $forum_id,
|
| 1946 |
+
'post_status' => array_keys( get_post_stati() ),
|
| 1947 |
'posts_per_page' => -1,
|
| 1948 |
'nopaging' => true,
|
| 1949 |
'fields' => 'id=>parent'
|
| 1950 |
+
) );
|
| 1951 |
+
|
| 1952 |
+
// Loop through and delete child topics. Topic replies will get deleted by
|
| 1953 |
+
// the bbp_delete_topic() action.
|
| 1954 |
+
if ( !empty( $topics->posts ) ) {
|
| 1955 |
foreach ( $topics->posts as $topic ) {
|
| 1956 |
wp_delete_post( $topic->ID, true );
|
| 1957 |
}
|
| 1959 |
// Reset the $post global
|
| 1960 |
wp_reset_postdata();
|
| 1961 |
}
|
| 1962 |
+
|
| 1963 |
+
// Cleanup
|
| 1964 |
+
unset( $topics );
|
| 1965 |
}
|
| 1966 |
|
| 1967 |
/**
|
| 1994 |
bbp_get_pending_status_id()
|
| 1995 |
) );
|
| 1996 |
|
| 1997 |
+
// Forum is being trashed, so its topics and replies are trashed too
|
| 1998 |
+
$topics = new WP_Query( array(
|
| 1999 |
'suppress_filters' => true,
|
| 2000 |
'post_type' => bbp_get_topic_post_type(),
|
| 2001 |
'post_parent' => $forum_id,
|
| 2003 |
'posts_per_page' => -1,
|
| 2004 |
'nopaging' => true,
|
| 2005 |
'fields' => 'id=>parent'
|
| 2006 |
+
) );
|
| 2007 |
+
|
| 2008 |
+
// Loop through and trash child topics. Topic replies will get trashed by
|
| 2009 |
+
// the bbp_trash_topic() action.
|
| 2010 |
+
if ( !empty( $topics->posts ) ) {
|
| 2011 |
|
| 2012 |
// Prevent debug notices
|
| 2013 |
$pre_trashed_topics = array();
|
| 2026 |
// Reset the $post global
|
| 2027 |
wp_reset_postdata();
|
| 2028 |
}
|
| 2029 |
+
|
| 2030 |
+
// Cleanup
|
| 2031 |
+
unset( $topics );
|
| 2032 |
}
|
| 2033 |
|
| 2034 |
/**
|
includes/forums/template-tags.php
CHANGED
|
@@ -56,7 +56,6 @@ function bbp_forum_post_type() {
|
|
| 56 |
* @return object Multidimensional array of forum information
|
| 57 |
*/
|
| 58 |
function bbp_has_forums( $args = '' ) {
|
| 59 |
-
$bbp = bbpress();
|
| 60 |
|
| 61 |
// Setup possible post__not_in array
|
| 62 |
$post_stati[] = bbp_get_public_status_id();
|
|
@@ -69,18 +68,18 @@ function bbp_has_forums( $args = '' ) {
|
|
| 69 |
if ( current_user_can( 'read_hidden_forums' ) )
|
| 70 |
$post_stati[] = bbp_get_hidden_status_id();
|
| 71 |
|
| 72 |
-
//
|
| 73 |
-
$
|
| 74 |
'post_type' => bbp_get_forum_post_type(),
|
| 75 |
'post_parent' => bbp_is_forum_archive() ? 0 : bbp_get_forum_id() ,
|
| 76 |
'post_status' => implode( ',', $post_stati ),
|
| 77 |
'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
|
| 78 |
'orderby' => 'menu_order',
|
| 79 |
'order' => 'ASC'
|
| 80 |
-
);
|
| 81 |
-
$bbp_f = bbp_parse_args( $args, $defaults, 'has_forums' );
|
| 82 |
|
| 83 |
// Run the query
|
|
|
|
| 84 |
$bbp->forum_query = new WP_Query( $bbp_f );
|
| 85 |
|
| 86 |
return apply_filters( 'bbp_has_forums', $bbp->forum_query->have_posts(), $bbp->forum_query );
|
|
@@ -141,6 +140,7 @@ function bbp_forum_id( $forum_id = 0 ) {
|
|
| 141 |
* @uses bbPress::forum_query::in_the_loop To check if we're in the loop
|
| 142 |
* @uses bbPress::forum_query::post::ID To get the forum id
|
| 143 |
* @uses WP_Query::post::ID To get the forum id
|
|
|
|
| 144 |
* @uses bbp_is_single_forum() To check if it's a forum page
|
| 145 |
* @uses bbp_is_single_topic() To check if it's a topic page
|
| 146 |
* @uses bbp_get_topic_forum_id() To get the topic forum id
|
|
@@ -155,28 +155,33 @@ function bbp_forum_id( $forum_id = 0 ) {
|
|
| 155 |
$bbp = bbpress();
|
| 156 |
|
| 157 |
// Easy empty checking
|
| 158 |
-
if ( !empty( $forum_id ) && is_numeric( $forum_id ) )
|
| 159 |
$bbp_forum_id = $forum_id;
|
| 160 |
|
| 161 |
// Currently inside a forum loop
|
| 162 |
-
elseif ( !empty( $bbp->forum_query->in_the_loop ) && isset( $bbp->forum_query->post->ID ) )
|
| 163 |
$bbp_forum_id = $bbp->forum_query->post->ID;
|
| 164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
// Currently viewing a forum
|
| 166 |
-
elseif ( bbp_is_single_forum() && !empty( $bbp->current_forum_id ) )
|
| 167 |
$bbp_forum_id = $bbp->current_forum_id;
|
| 168 |
|
| 169 |
// Currently viewing a forum
|
| 170 |
-
elseif ( bbp_is_single_forum() && isset( $wp_query->post->ID ) )
|
| 171 |
$bbp_forum_id = $wp_query->post->ID;
|
| 172 |
|
| 173 |
// Currently viewing a topic
|
| 174 |
-
elseif ( bbp_is_single_topic() )
|
| 175 |
$bbp_forum_id = bbp_get_topic_forum_id();
|
| 176 |
|
| 177 |
// Fallback
|
| 178 |
-
else
|
| 179 |
$bbp_forum_id = 0;
|
|
|
|
| 180 |
|
| 181 |
return (int) apply_filters( 'bbp_get_forum_id', (int) $bbp_forum_id, $forum_id );
|
| 182 |
}
|
|
@@ -450,9 +455,11 @@ function bbp_forum_last_active_time( $forum_id = 0 ) {
|
|
| 450 |
* @return string Forum last update date/time (freshness)
|
| 451 |
*/
|
| 452 |
function bbp_get_forum_last_active_time( $forum_id = 0 ) {
|
| 453 |
-
$forum_id = bbp_get_forum_id( $forum_id );
|
| 454 |
|
|
|
|
|
|
|
| 455 |
$last_active = get_post_meta( $forum_id, '_bbp_last_active_time', true );
|
|
|
|
| 456 |
if ( empty( $last_active ) ) {
|
| 457 |
$reply_id = bbp_get_forum_last_reply_id( $forum_id );
|
| 458 |
if ( !empty( $reply_id ) ) {
|
|
@@ -465,9 +472,9 @@ function bbp_forum_last_active_time( $forum_id = 0 ) {
|
|
| 465 |
}
|
| 466 |
}
|
| 467 |
|
| 468 |
-
$
|
| 469 |
|
| 470 |
-
return apply_filters( 'bbp_get_forum_last_active', $
|
| 471 |
}
|
| 472 |
|
| 473 |
/**
|
|
@@ -510,6 +517,7 @@ function bbp_forum_freshness_link( $forum_id = 0) {
|
|
| 510 |
function bbp_get_forum_freshness_link( $forum_id = 0 ) {
|
| 511 |
$forum_id = bbp_get_forum_id( $forum_id );
|
| 512 |
$active_id = bbp_get_forum_last_active_id( $forum_id );
|
|
|
|
| 513 |
|
| 514 |
if ( empty( $active_id ) )
|
| 515 |
$active_id = bbp_get_forum_last_reply_id( $forum_id );
|
|
@@ -532,7 +540,7 @@ function bbp_forum_freshness_link( $forum_id = 0) {
|
|
| 532 |
else
|
| 533 |
$anchor = __( 'No Topics', 'bbpress' );
|
| 534 |
|
| 535 |
-
return apply_filters( 'bbp_get_forum_freshness_link', $anchor, $forum_id );
|
| 536 |
}
|
| 537 |
|
| 538 |
/**
|
|
@@ -632,21 +640,26 @@ function bbp_forum_get_subforums( $args = '' ) {
|
|
| 632 |
}
|
| 633 |
}
|
| 634 |
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
'
|
| 638 |
-
'
|
| 639 |
-
'
|
| 640 |
-
'
|
| 641 |
-
'
|
| 642 |
-
|
| 643 |
-
|
|
|
|
|
|
|
| 644 |
$r['post_parent'] = bbp_get_forum_id( $r['post_parent'] );
|
| 645 |
|
|
|
|
|
|
|
|
|
|
| 646 |
// No forum passed
|
| 647 |
-
$sub_forums = !empty( $r['post_parent'] ) ? get_posts( $r ) :
|
| 648 |
|
| 649 |
-
return apply_filters( '
|
| 650 |
}
|
| 651 |
|
| 652 |
/**
|
|
@@ -675,8 +688,8 @@ function bbp_list_forums( $args = '' ) {
|
|
| 675 |
$i = 0;
|
| 676 |
$count = array();
|
| 677 |
|
| 678 |
-
//
|
| 679 |
-
$
|
| 680 |
'before' => '<ul class="bbp-forums-list">',
|
| 681 |
'after' => '</ul>',
|
| 682 |
'link_before' => '<li class="bbp-forum">',
|
|
@@ -688,16 +701,10 @@ function bbp_list_forums( $args = '' ) {
|
|
| 688 |
'forum_id' => '',
|
| 689 |
'show_topic_count' => true,
|
| 690 |
'show_reply_count' => true,
|
| 691 |
-
);
|
| 692 |
-
$r = bbp_parse_args( $args, $defaults, 'list_forums' );
|
| 693 |
-
extract( $r, EXTR_SKIP );
|
| 694 |
-
|
| 695 |
-
// Bail if there are no subforums
|
| 696 |
-
if ( !bbp_get_forum_subforum_count( $forum_id, false ) )
|
| 697 |
-
return;
|
| 698 |
|
| 699 |
// Loop through forums and create a list
|
| 700 |
-
$sub_forums = bbp_forum_get_subforums( $forum_id );
|
| 701 |
if ( !empty( $sub_forums ) ) {
|
| 702 |
|
| 703 |
// Total count (for separator)
|
|
@@ -707,31 +714,31 @@ function bbp_list_forums( $args = '' ) {
|
|
| 707 |
|
| 708 |
// Get forum details
|
| 709 |
$count = array();
|
| 710 |
-
$show_sep = $total_subs > $i ? $separator : '';
|
| 711 |
$permalink = bbp_get_forum_permalink( $sub_forum->ID );
|
| 712 |
$title = bbp_get_forum_title( $sub_forum->ID );
|
| 713 |
|
| 714 |
// Show topic count
|
| 715 |
-
if ( !empty( $show_topic_count ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
|
| 716 |
$count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );
|
| 717 |
}
|
| 718 |
|
| 719 |
// Show reply count
|
| 720 |
-
if ( !empty( $show_reply_count ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
|
| 721 |
$count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );
|
| 722 |
}
|
| 723 |
|
| 724 |
// Counts to show
|
| 725 |
if ( !empty( $count ) ) {
|
| 726 |
-
$counts = $count_before . implode( $count_sep, $count ) . $count_after;
|
| 727 |
}
|
| 728 |
|
| 729 |
// Build this sub forums link
|
| 730 |
-
$output .= $link_before . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $link_after;
|
| 731 |
}
|
| 732 |
|
| 733 |
// Output the list
|
| 734 |
-
echo apply_filters( 'bbp_list_forums', $before . $output . $after, $
|
| 735 |
}
|
| 736 |
}
|
| 737 |
|
|
@@ -1820,19 +1827,17 @@ function bbp_single_forum_description( $args = '' ) {
|
|
| 1820 |
*/
|
| 1821 |
function bbp_get_single_forum_description( $args = '' ) {
|
| 1822 |
|
| 1823 |
-
//
|
| 1824 |
-
$
|
| 1825 |
'forum_id' => 0,
|
| 1826 |
'before' => '<div class="bbp-template-notice info"><p class="bbp-forum-description">',
|
| 1827 |
'after' => '</p></div>',
|
| 1828 |
'size' => 14,
|
| 1829 |
'feed' => true
|
| 1830 |
-
);
|
| 1831 |
-
$r = bbp_parse_args( $args, $defaults, 'get_single_forum_description' );
|
| 1832 |
-
extract( $r );
|
| 1833 |
|
| 1834 |
// Validate forum_id
|
| 1835 |
-
$forum_id = bbp_get_forum_id( $forum_id );
|
| 1836 |
|
| 1837 |
// Unhook the 'view all' query var adder
|
| 1838 |
remove_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );
|
|
@@ -1853,7 +1858,7 @@ function bbp_single_forum_description( $args = '' ) {
|
|
| 1853 |
if ( !empty( $last_active ) ) {
|
| 1854 |
$topic_text = bbp_get_forum_topics_link( $forum_id );
|
| 1855 |
$time_since = bbp_get_forum_freshness_link( $forum_id );
|
| 1856 |
-
$last_updated_by = bbp_get_author_link( array( 'post_id' => $last_active, 'size' => $size ) );
|
| 1857 |
|
| 1858 |
// Forum has no last active data
|
| 1859 |
} else {
|
|
@@ -1908,13 +1913,13 @@ function bbp_single_forum_description( $args = '' ) {
|
|
| 1908 |
}
|
| 1909 |
|
| 1910 |
// Add feeds
|
| 1911 |
-
//$feed_links = ( !empty( $feed ) ) ? bbp_get_forum_topics_feed_link ( $forum_id ) . bbp_get_forum_replies_feed_link( $forum_id ) : '';
|
| 1912 |
|
| 1913 |
// Add the 'view all' filter back
|
| 1914 |
add_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );
|
| 1915 |
|
| 1916 |
// Combine the elements together
|
| 1917 |
-
$retstr = $before . $retstr . $after;
|
| 1918 |
|
| 1919 |
// Return filtered result
|
| 1920 |
return apply_filters( 'bbp_get_single_forum_description', $retstr, $args );
|
|
@@ -1944,16 +1949,17 @@ function bbp_form_forum_title() {
|
|
| 1944 |
function bbp_get_form_forum_title() {
|
| 1945 |
|
| 1946 |
// Get _POST data
|
| 1947 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_title'] ) )
|
| 1948 |
$forum_title = $_POST['bbp_forum_title'];
|
| 1949 |
|
| 1950 |
// Get edit data
|
| 1951 |
-
elseif ( bbp_is_forum_edit() )
|
| 1952 |
$forum_title = bbp_get_global_post_field( 'post_title', 'raw' );
|
| 1953 |
|
| 1954 |
// No data
|
| 1955 |
-
else
|
| 1956 |
$forum_title = '';
|
|
|
|
| 1957 |
|
| 1958 |
return apply_filters( 'bbp_get_form_forum_title', esc_attr( $forum_title ) );
|
| 1959 |
}
|
|
@@ -1980,16 +1986,17 @@ function bbp_form_forum_content() {
|
|
| 1980 |
function bbp_get_form_forum_content() {
|
| 1981 |
|
| 1982 |
// Get _POST data
|
| 1983 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_content'] ) )
|
| 1984 |
$forum_content = $_POST['bbp_forum_content'];
|
| 1985 |
|
| 1986 |
// Get edit data
|
| 1987 |
-
elseif ( bbp_is_forum_edit() )
|
| 1988 |
$forum_content = bbp_get_global_post_field( 'post_content', 'raw' );
|
| 1989 |
|
| 1990 |
// No data
|
| 1991 |
-
else
|
| 1992 |
$forum_content = '';
|
|
|
|
| 1993 |
|
| 1994 |
return apply_filters( 'bbp_get_form_forum_content', esc_textarea( $forum_content ) );
|
| 1995 |
}
|
|
@@ -2017,16 +2024,17 @@ function bbp_form_forum_parent() {
|
|
| 2017 |
function bbp_get_form_forum_parent() {
|
| 2018 |
|
| 2019 |
// Get _POST data
|
| 2020 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_id'] ) )
|
| 2021 |
$forum_parent = $_POST['bbp_forum_id'];
|
| 2022 |
|
| 2023 |
// Get edit data
|
| 2024 |
-
elseif ( bbp_is_forum_edit() )
|
| 2025 |
$forum_parent = bbp_get_forum_parent_id();
|
| 2026 |
|
| 2027 |
// No data
|
| 2028 |
-
else
|
| 2029 |
$forum_parent = 0;
|
|
|
|
| 2030 |
|
| 2031 |
return apply_filters( 'bbp_get_form_forum_parent', esc_attr( $forum_parent ) );
|
| 2032 |
}
|
|
@@ -2054,16 +2062,17 @@ function bbp_form_forum_type() {
|
|
| 2054 |
function bbp_get_form_forum_type() {
|
| 2055 |
|
| 2056 |
// Get _POST data
|
| 2057 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_type'] ) )
|
| 2058 |
$forum_type = $_POST['bbp_forum_type'];
|
| 2059 |
|
| 2060 |
// Get edit data
|
| 2061 |
-
elseif ( bbp_is_forum_edit() )
|
| 2062 |
$forum_type = bbp_get_forum_type();
|
| 2063 |
|
| 2064 |
// No data
|
| 2065 |
-
else
|
| 2066 |
$forum_type = 'forum';
|
|
|
|
| 2067 |
|
| 2068 |
return apply_filters( 'bbp_get_form_forum_type', esc_attr( $forum_type ) );
|
| 2069 |
}
|
|
@@ -2091,16 +2100,17 @@ function bbp_form_forum_visibility() {
|
|
| 2091 |
function bbp_get_form_forum_visibility() {
|
| 2092 |
|
| 2093 |
// Get _POST data
|
| 2094 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_visibility'] ) )
|
| 2095 |
$forum_visibility = $_POST['bbp_forum_visibility'];
|
| 2096 |
|
| 2097 |
// Get edit data
|
| 2098 |
-
elseif ( bbp_is_forum_edit() )
|
| 2099 |
$forum_visibility = bbp_get_forum_visibility();
|
| 2100 |
|
| 2101 |
// No data
|
| 2102 |
-
else
|
| 2103 |
$forum_visibility = bbpress()->public_status_id;
|
|
|
|
| 2104 |
|
| 2105 |
return apply_filters( 'bbp_get_form_forum_visibility', esc_attr( $forum_visibility ) );
|
| 2106 |
}
|
| 56 |
* @return object Multidimensional array of forum information
|
| 57 |
*/
|
| 58 |
function bbp_has_forums( $args = '' ) {
|
|
|
|
| 59 |
|
| 60 |
// Setup possible post__not_in array
|
| 61 |
$post_stati[] = bbp_get_public_status_id();
|
| 68 |
if ( current_user_can( 'read_hidden_forums' ) )
|
| 69 |
$post_stati[] = bbp_get_hidden_status_id();
|
| 70 |
|
| 71 |
+
// Parse arguments with default forum query for most circumstances
|
| 72 |
+
$bbp_f = bbp_parse_args( $args, array(
|
| 73 |
'post_type' => bbp_get_forum_post_type(),
|
| 74 |
'post_parent' => bbp_is_forum_archive() ? 0 : bbp_get_forum_id() ,
|
| 75 |
'post_status' => implode( ',', $post_stati ),
|
| 76 |
'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
|
| 77 |
'orderby' => 'menu_order',
|
| 78 |
'order' => 'ASC'
|
| 79 |
+
), 'has_forums' );
|
|
|
|
| 80 |
|
| 81 |
// Run the query
|
| 82 |
+
$bbp = bbpress();
|
| 83 |
$bbp->forum_query = new WP_Query( $bbp_f );
|
| 84 |
|
| 85 |
return apply_filters( 'bbp_has_forums', $bbp->forum_query->have_posts(), $bbp->forum_query );
|
| 140 |
* @uses bbPress::forum_query::in_the_loop To check if we're in the loop
|
| 141 |
* @uses bbPress::forum_query::post::ID To get the forum id
|
| 142 |
* @uses WP_Query::post::ID To get the forum id
|
| 143 |
+
* @uses bbp_is_forum() To check if the search result is a forum
|
| 144 |
* @uses bbp_is_single_forum() To check if it's a forum page
|
| 145 |
* @uses bbp_is_single_topic() To check if it's a topic page
|
| 146 |
* @uses bbp_get_topic_forum_id() To get the topic forum id
|
| 155 |
$bbp = bbpress();
|
| 156 |
|
| 157 |
// Easy empty checking
|
| 158 |
+
if ( !empty( $forum_id ) && is_numeric( $forum_id ) ) {
|
| 159 |
$bbp_forum_id = $forum_id;
|
| 160 |
|
| 161 |
// Currently inside a forum loop
|
| 162 |
+
} elseif ( !empty( $bbp->forum_query->in_the_loop ) && isset( $bbp->forum_query->post->ID ) ) {
|
| 163 |
$bbp_forum_id = $bbp->forum_query->post->ID;
|
| 164 |
|
| 165 |
+
// Currently inside a search loop
|
| 166 |
+
} elseif ( !empty( $bbp->search_query->in_the_loop ) && isset( $bbp->search_query->post->ID ) && bbp_is_forum( $bbp->search_query->post->ID ) ) {
|
| 167 |
+
$bbp_forum_id = $bbp->search_query->post->ID;
|
| 168 |
+
|
| 169 |
// Currently viewing a forum
|
| 170 |
+
} elseif ( bbp_is_single_forum() && !empty( $bbp->current_forum_id ) ) {
|
| 171 |
$bbp_forum_id = $bbp->current_forum_id;
|
| 172 |
|
| 173 |
// Currently viewing a forum
|
| 174 |
+
} elseif ( bbp_is_single_forum() && isset( $wp_query->post->ID ) ) {
|
| 175 |
$bbp_forum_id = $wp_query->post->ID;
|
| 176 |
|
| 177 |
// Currently viewing a topic
|
| 178 |
+
} elseif ( bbp_is_single_topic() ) {
|
| 179 |
$bbp_forum_id = bbp_get_topic_forum_id();
|
| 180 |
|
| 181 |
// Fallback
|
| 182 |
+
} else {
|
| 183 |
$bbp_forum_id = 0;
|
| 184 |
+
}
|
| 185 |
|
| 186 |
return (int) apply_filters( 'bbp_get_forum_id', (int) $bbp_forum_id, $forum_id );
|
| 187 |
}
|
| 455 |
* @return string Forum last update date/time (freshness)
|
| 456 |
*/
|
| 457 |
function bbp_get_forum_last_active_time( $forum_id = 0 ) {
|
|
|
|
| 458 |
|
| 459 |
+
// Verify forum and get last active meta
|
| 460 |
+
$forum_id = bbp_get_forum_id( $forum_id );
|
| 461 |
$last_active = get_post_meta( $forum_id, '_bbp_last_active_time', true );
|
| 462 |
+
|
| 463 |
if ( empty( $last_active ) ) {
|
| 464 |
$reply_id = bbp_get_forum_last_reply_id( $forum_id );
|
| 465 |
if ( !empty( $reply_id ) ) {
|
| 472 |
}
|
| 473 |
}
|
| 474 |
|
| 475 |
+
$active_time = !empty( $last_active ) ? bbp_get_time_since( bbp_convert_date( $last_active ) ) : '';
|
| 476 |
|
| 477 |
+
return apply_filters( 'bbp_get_forum_last_active', $active_time, $forum_id );
|
| 478 |
}
|
| 479 |
|
| 480 |
/**
|
| 517 |
function bbp_get_forum_freshness_link( $forum_id = 0 ) {
|
| 518 |
$forum_id = bbp_get_forum_id( $forum_id );
|
| 519 |
$active_id = bbp_get_forum_last_active_id( $forum_id );
|
| 520 |
+
$link_url = $title = '';
|
| 521 |
|
| 522 |
if ( empty( $active_id ) )
|
| 523 |
$active_id = bbp_get_forum_last_reply_id( $forum_id );
|
| 540 |
else
|
| 541 |
$anchor = __( 'No Topics', 'bbpress' );
|
| 542 |
|
| 543 |
+
return apply_filters( 'bbp_get_forum_freshness_link', $anchor, $forum_id, $time_since, $link_url, $title, $active_id );
|
| 544 |
}
|
| 545 |
|
| 546 |
/**
|
| 640 |
}
|
| 641 |
}
|
| 642 |
|
| 643 |
+
// Parse arguments against default values
|
| 644 |
+
$r = bbp_parse_args( $args, array(
|
| 645 |
+
'post_parent' => 0,
|
| 646 |
+
'post_type' => bbp_get_forum_post_type(),
|
| 647 |
+
'post_status' => implode( ',', $post_stati ),
|
| 648 |
+
'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
|
| 649 |
+
'orderby' => 'menu_order',
|
| 650 |
+
'order' => 'ASC',
|
| 651 |
+
'ignore_sticky_posts' => true,
|
| 652 |
+
'no_found_rows' => true
|
| 653 |
+
), 'forum_get_subforums' );
|
| 654 |
$r['post_parent'] = bbp_get_forum_id( $r['post_parent'] );
|
| 655 |
|
| 656 |
+
// Create a new query for the subforums
|
| 657 |
+
$get_posts = new WP_Query();
|
| 658 |
+
|
| 659 |
// No forum passed
|
| 660 |
+
$sub_forums = !empty( $r['post_parent'] ) ? $get_posts->query( $r ) : array();
|
| 661 |
|
| 662 |
+
return (array) apply_filters( 'bbp_forum_get_subforums', $sub_forums, $args );
|
| 663 |
}
|
| 664 |
|
| 665 |
/**
|
| 688 |
$i = 0;
|
| 689 |
$count = array();
|
| 690 |
|
| 691 |
+
// Parse arguments against default values
|
| 692 |
+
$r = bbp_parse_args( $args, array(
|
| 693 |
'before' => '<ul class="bbp-forums-list">',
|
| 694 |
'after' => '</ul>',
|
| 695 |
'link_before' => '<li class="bbp-forum">',
|
| 701 |
'forum_id' => '',
|
| 702 |
'show_topic_count' => true,
|
| 703 |
'show_reply_count' => true,
|
| 704 |
+
), 'list_forums' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 705 |
|
| 706 |
// Loop through forums and create a list
|
| 707 |
+
$sub_forums = bbp_forum_get_subforums( $r['forum_id'] );
|
| 708 |
if ( !empty( $sub_forums ) ) {
|
| 709 |
|
| 710 |
// Total count (for separator)
|
| 714 |
|
| 715 |
// Get forum details
|
| 716 |
$count = array();
|
| 717 |
+
$show_sep = $total_subs > $i ? $r['separator'] : '';
|
| 718 |
$permalink = bbp_get_forum_permalink( $sub_forum->ID );
|
| 719 |
$title = bbp_get_forum_title( $sub_forum->ID );
|
| 720 |
|
| 721 |
// Show topic count
|
| 722 |
+
if ( !empty( $r['show_topic_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
|
| 723 |
$count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );
|
| 724 |
}
|
| 725 |
|
| 726 |
// Show reply count
|
| 727 |
+
if ( !empty( $r['show_reply_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
|
| 728 |
$count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );
|
| 729 |
}
|
| 730 |
|
| 731 |
// Counts to show
|
| 732 |
if ( !empty( $count ) ) {
|
| 733 |
+
$counts = $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after'];
|
| 734 |
}
|
| 735 |
|
| 736 |
// Build this sub forums link
|
| 737 |
+
$output .= $r['link_before'] . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after'];
|
| 738 |
}
|
| 739 |
|
| 740 |
// Output the list
|
| 741 |
+
echo apply_filters( 'bbp_list_forums', $r['before'] . $output . $r['after'], $r );
|
| 742 |
}
|
| 743 |
}
|
| 744 |
|
| 1827 |
*/
|
| 1828 |
function bbp_get_single_forum_description( $args = '' ) {
|
| 1829 |
|
| 1830 |
+
// Parse arguments against default values
|
| 1831 |
+
$r = bbp_parse_args( $args, array(
|
| 1832 |
'forum_id' => 0,
|
| 1833 |
'before' => '<div class="bbp-template-notice info"><p class="bbp-forum-description">',
|
| 1834 |
'after' => '</p></div>',
|
| 1835 |
'size' => 14,
|
| 1836 |
'feed' => true
|
| 1837 |
+
), 'get_single_forum_description' );
|
|
|
|
|
|
|
| 1838 |
|
| 1839 |
// Validate forum_id
|
| 1840 |
+
$forum_id = bbp_get_forum_id( $r['forum_id'] );
|
| 1841 |
|
| 1842 |
// Unhook the 'view all' query var adder
|
| 1843 |
remove_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );
|
| 1858 |
if ( !empty( $last_active ) ) {
|
| 1859 |
$topic_text = bbp_get_forum_topics_link( $forum_id );
|
| 1860 |
$time_since = bbp_get_forum_freshness_link( $forum_id );
|
| 1861 |
+
$last_updated_by = bbp_get_author_link( array( 'post_id' => $last_active, 'size' => $r['size'] ) );
|
| 1862 |
|
| 1863 |
// Forum has no last active data
|
| 1864 |
} else {
|
| 1913 |
}
|
| 1914 |
|
| 1915 |
// Add feeds
|
| 1916 |
+
//$feed_links = ( !empty( $r['feed'] ) ) ? bbp_get_forum_topics_feed_link ( $forum_id ) . bbp_get_forum_replies_feed_link( $forum_id ) : '';
|
| 1917 |
|
| 1918 |
// Add the 'view all' filter back
|
| 1919 |
add_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );
|
| 1920 |
|
| 1921 |
// Combine the elements together
|
| 1922 |
+
$retstr = $r['before'] . $retstr . $r['after'];
|
| 1923 |
|
| 1924 |
// Return filtered result
|
| 1925 |
return apply_filters( 'bbp_get_single_forum_description', $retstr, $args );
|
| 1949 |
function bbp_get_form_forum_title() {
|
| 1950 |
|
| 1951 |
// Get _POST data
|
| 1952 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_title'] ) ) {
|
| 1953 |
$forum_title = $_POST['bbp_forum_title'];
|
| 1954 |
|
| 1955 |
// Get edit data
|
| 1956 |
+
} elseif ( bbp_is_forum_edit() ) {
|
| 1957 |
$forum_title = bbp_get_global_post_field( 'post_title', 'raw' );
|
| 1958 |
|
| 1959 |
// No data
|
| 1960 |
+
} else {
|
| 1961 |
$forum_title = '';
|
| 1962 |
+
}
|
| 1963 |
|
| 1964 |
return apply_filters( 'bbp_get_form_forum_title', esc_attr( $forum_title ) );
|
| 1965 |
}
|
| 1986 |
function bbp_get_form_forum_content() {
|
| 1987 |
|
| 1988 |
// Get _POST data
|
| 1989 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_content'] ) ) {
|
| 1990 |
$forum_content = $_POST['bbp_forum_content'];
|
| 1991 |
|
| 1992 |
// Get edit data
|
| 1993 |
+
} elseif ( bbp_is_forum_edit() ) {
|
| 1994 |
$forum_content = bbp_get_global_post_field( 'post_content', 'raw' );
|
| 1995 |
|
| 1996 |
// No data
|
| 1997 |
+
} else {
|
| 1998 |
$forum_content = '';
|
| 1999 |
+
}
|
| 2000 |
|
| 2001 |
return apply_filters( 'bbp_get_form_forum_content', esc_textarea( $forum_content ) );
|
| 2002 |
}
|
| 2024 |
function bbp_get_form_forum_parent() {
|
| 2025 |
|
| 2026 |
// Get _POST data
|
| 2027 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_id'] ) ) {
|
| 2028 |
$forum_parent = $_POST['bbp_forum_id'];
|
| 2029 |
|
| 2030 |
// Get edit data
|
| 2031 |
+
} elseif ( bbp_is_forum_edit() ) {
|
| 2032 |
$forum_parent = bbp_get_forum_parent_id();
|
| 2033 |
|
| 2034 |
// No data
|
| 2035 |
+
} else {
|
| 2036 |
$forum_parent = 0;
|
| 2037 |
+
}
|
| 2038 |
|
| 2039 |
return apply_filters( 'bbp_get_form_forum_parent', esc_attr( $forum_parent ) );
|
| 2040 |
}
|
| 2062 |
function bbp_get_form_forum_type() {
|
| 2063 |
|
| 2064 |
// Get _POST data
|
| 2065 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_type'] ) ) {
|
| 2066 |
$forum_type = $_POST['bbp_forum_type'];
|
| 2067 |
|
| 2068 |
// Get edit data
|
| 2069 |
+
} elseif ( bbp_is_forum_edit() ) {
|
| 2070 |
$forum_type = bbp_get_forum_type();
|
| 2071 |
|
| 2072 |
// No data
|
| 2073 |
+
} else {
|
| 2074 |
$forum_type = 'forum';
|
| 2075 |
+
}
|
| 2076 |
|
| 2077 |
return apply_filters( 'bbp_get_form_forum_type', esc_attr( $forum_type ) );
|
| 2078 |
}
|
| 2100 |
function bbp_get_form_forum_visibility() {
|
| 2101 |
|
| 2102 |
// Get _POST data
|
| 2103 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_visibility'] ) ) {
|
| 2104 |
$forum_visibility = $_POST['bbp_forum_visibility'];
|
| 2105 |
|
| 2106 |
// Get edit data
|
| 2107 |
+
} elseif ( bbp_is_forum_edit() ) {
|
| 2108 |
$forum_visibility = bbp_get_forum_visibility();
|
| 2109 |
|
| 2110 |
// No data
|
| 2111 |
+
} else {
|
| 2112 |
$forum_visibility = bbpress()->public_status_id;
|
| 2113 |
+
}
|
| 2114 |
|
| 2115 |
return apply_filters( 'bbp_get_form_forum_visibility', esc_attr( $forum_visibility ) );
|
| 2116 |
}
|
includes/replies/functions.php
CHANGED
|
@@ -77,6 +77,7 @@ function bbp_insert_reply( $reply_data = array(), $reply_meta = array() ) {
|
|
| 77 |
*
|
| 78 |
* @since bbPress (r2574)
|
| 79 |
*
|
|
|
|
| 80 |
* @uses bbp_add_error() To add an error message
|
| 81 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 82 |
* @uses bbp_is_anonymous() To check if an anonymous post is being made
|
|
@@ -102,14 +103,10 @@ function bbp_insert_reply( $reply_data = array(), $reply_meta = array() ) {
|
|
| 102 |
* @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error
|
| 103 |
* message
|
| 104 |
*/
|
| 105 |
-
function bbp_new_reply_handler() {
|
| 106 |
-
|
| 107 |
-
// Bail if not a POST action
|
| 108 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 109 |
-
return;
|
| 110 |
|
| 111 |
// Bail if action is not bbp-new-reply
|
| 112 |
-
if (
|
| 113 |
return;
|
| 114 |
|
| 115 |
// Nonce check
|
|
@@ -294,22 +291,39 @@ function bbp_new_reply_handler() {
|
|
| 294 |
// Trash the reply
|
| 295 |
wp_trash_post( $reply_id );
|
| 296 |
|
| 297 |
-
//
|
| 298 |
-
|
| 299 |
|
| 300 |
-
|
| 301 |
-
|
| 302 |
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
|
|
|
|
|
|
|
|
|
| 306 |
|
| 307 |
/** Spam Check ********************************************************/
|
| 308 |
|
| 309 |
// If reply or topic are spam, officially spam this reply
|
| 310 |
-
|
| 311 |
add_post_meta( $reply_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
|
| 312 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
/** Update counts, etc... *********************************************/
|
| 314 |
|
| 315 |
do_action( 'bbp_new_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author );
|
|
@@ -321,7 +335,7 @@ function bbp_new_reply_handler() {
|
|
| 321 |
/** Redirect **********************************************************/
|
| 322 |
|
| 323 |
// Redirect to
|
| 324 |
-
$redirect_to =
|
| 325 |
|
| 326 |
// Get the reply URL
|
| 327 |
$reply_url = bbp_get_reply_url( $reply_id, $redirect_to );
|
|
@@ -348,6 +362,7 @@ function bbp_new_reply_handler() {
|
|
| 348 |
/**
|
| 349 |
* Handles the front end edit reply submission
|
| 350 |
*
|
|
|
|
| 351 |
* @uses bbp_add_error() To add an error message
|
| 352 |
* @uses bbp_get_reply() To get the reply
|
| 353 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
|
@@ -375,14 +390,10 @@ function bbp_new_reply_handler() {
|
|
| 375 |
* @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error
|
| 376 |
* message
|
| 377 |
*/
|
| 378 |
-
function bbp_edit_reply_handler() {
|
| 379 |
-
|
| 380 |
-
// Bail if not a POST action
|
| 381 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 382 |
-
return;
|
| 383 |
|
| 384 |
// Bail if action is not bbp-edit-reply
|
| 385 |
-
if (
|
| 386 |
return;
|
| 387 |
|
| 388 |
// Define local variable(s)
|
|
@@ -559,7 +570,7 @@ function bbp_edit_reply_handler() {
|
|
| 559 |
|
| 560 |
// Toggle revisions back on
|
| 561 |
if ( true === $revisions_removed ) {
|
| 562 |
-
$revisions_removed =
|
| 563 |
add_post_type_support( bbp_get_reply_post_type(), 'revisions' );
|
| 564 |
}
|
| 565 |
|
|
@@ -584,7 +595,7 @@ function bbp_edit_reply_handler() {
|
|
| 584 |
|
| 585 |
// Update revision log
|
| 586 |
if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( 1 == $_POST['bbp_log_reply_edit'] ) ) {
|
| 587 |
-
$revision_id =
|
| 588 |
if ( !empty( $revision_id ) ) {
|
| 589 |
bbp_update_reply_revision_log( array(
|
| 590 |
'reply_id' => $reply_id,
|
|
@@ -609,7 +620,7 @@ function bbp_edit_reply_handler() {
|
|
| 609 |
/** Redirect **********************************************************/
|
| 610 |
|
| 611 |
// Redirect to
|
| 612 |
-
$redirect_to =
|
| 613 |
|
| 614 |
// Get the reply URL
|
| 615 |
$reply_url = bbp_get_reply_url( $reply_id, $redirect_to );
|
|
@@ -639,8 +650,7 @@ function bbp_edit_reply_handler() {
|
|
| 639 |
* @param int $reply_id Optional. Reply id
|
| 640 |
* @param int $topic_id Optional. Topic id
|
| 641 |
* @param int $forum_id Optional. Forum id
|
| 642 |
-
* @param bool|array $anonymous_data Optional
|
| 643 |
-
* extracted and anonymous user info is saved
|
| 644 |
* @param int $author_id Author id
|
| 645 |
* @param bool $is_edit Optional. Is the post being edited? Defaults to false.
|
| 646 |
* @uses bbp_get_reply_id() To get the reply id
|
|
@@ -689,13 +699,12 @@ function bbp_update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymo
|
|
| 689 |
// Check bbp_filter_anonymous_post_data() for sanitization.
|
| 690 |
if ( !empty( $anonymous_data ) && is_array( $anonymous_data ) ) {
|
| 691 |
|
| 692 |
-
//
|
| 693 |
-
$
|
| 694 |
'bbp_anonymous_name' => '',
|
| 695 |
'bbp_anonymous_email' => '',
|
| 696 |
'bbp_anonymous_website' => '',
|
| 697 |
-
);
|
| 698 |
-
$r = bbp_parse_args( $anonymous_data, $defaults, 'update_reply' );
|
| 699 |
|
| 700 |
// Update all anonymous metas
|
| 701 |
foreach( $r as $anon_key => $anon_value ) {
|
|
@@ -986,30 +995,321 @@ function bbp_update_reply_topic_id( $reply_id = 0, $topic_id = 0 ) {
|
|
| 986 |
* @return mixed False on failure, true on success
|
| 987 |
*/
|
| 988 |
function bbp_update_reply_revision_log( $args = '' ) {
|
| 989 |
-
|
|
|
|
|
|
|
| 990 |
'reason' => '',
|
| 991 |
'reply_id' => 0,
|
| 992 |
'author_id' => 0,
|
| 993 |
'revision_id' => 0
|
| 994 |
-
);
|
| 995 |
-
|
| 996 |
-
$r = bbp_parse_args( $args, $defaults, 'update_reply_revision_log' );
|
| 997 |
-
extract( $r );
|
| 998 |
|
| 999 |
// Populate the variables
|
| 1000 |
-
$reason = bbp_format_revision_reason( $reason );
|
| 1001 |
-
$reply_id = bbp_get_reply_id( $reply_id );
|
| 1002 |
-
$author_id = bbp_get_user_id ( $author_id, false, true );
|
| 1003 |
-
$revision_id = (int) $revision_id;
|
| 1004 |
|
| 1005 |
// Get the logs and append the new one to those
|
| 1006 |
-
$revision_log
|
| 1007 |
-
$revision_log[$revision_id] = array( 'author' => $author_id, 'reason' => $reason );
|
| 1008 |
|
| 1009 |
// Finally, update
|
| 1010 |
-
update_post_meta( $reply_id, '_bbp_revision_log', $revision_log );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1011 |
|
| 1012 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1013 |
}
|
| 1014 |
|
| 1015 |
/** Reply Actions *************************************************************/
|
|
@@ -1020,6 +1320,7 @@ function bbp_update_reply_revision_log( $args = '' ) {
|
|
| 1020 |
*
|
| 1021 |
* @since bbPress (r2740)
|
| 1022 |
*
|
|
|
|
| 1023 |
* @uses bbp_get_reply() To get the reply
|
| 1024 |
* @uses current_user_can() To check if the user is capable of editing or
|
| 1025 |
* deleting the reply
|
|
@@ -1038,14 +1339,10 @@ function bbp_update_reply_revision_log( $args = '' ) {
|
|
| 1038 |
* @uses wp_safe_redirect() To redirect to the reply
|
| 1039 |
* @uses bbPress::errors:add() To log the error messages
|
| 1040 |
*/
|
| 1041 |
-
function bbp_toggle_reply_handler() {
|
| 1042 |
-
|
| 1043 |
-
// Bail if not a GET action
|
| 1044 |
-
if ( 'GET' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 1045 |
-
return;
|
| 1046 |
|
| 1047 |
// Bail if required GET actions aren't passed
|
| 1048 |
-
if ( empty( $_GET['reply_id'] )
|
| 1049 |
return;
|
| 1050 |
|
| 1051 |
// Setup possible get actions
|
|
@@ -1055,12 +1352,11 @@ function bbp_toggle_reply_handler() {
|
|
| 1055 |
);
|
| 1056 |
|
| 1057 |
// Bail if actions aren't meant for this function
|
| 1058 |
-
if ( !in_array( $
|
| 1059 |
return;
|
| 1060 |
|
| 1061 |
$failure = ''; // Empty failure string
|
| 1062 |
$view_all = false; // Assume not viewing all
|
| 1063 |
-
$action = $_GET['action']; // What action is taking place?
|
| 1064 |
$reply_id = (int) $_GET['reply_id']; // What's the reply id?
|
| 1065 |
$success = false; // Flag
|
| 1066 |
$post_data = array( 'ID' => $reply_id ); // Prelim array
|
|
@@ -1137,7 +1433,7 @@ function bbp_toggle_reply_handler() {
|
|
| 1137 |
/** Redirect **********************************************************/
|
| 1138 |
|
| 1139 |
// Redirect to
|
| 1140 |
-
$redirect_to =
|
| 1141 |
|
| 1142 |
// Get the reply URL
|
| 1143 |
$reply_url = bbp_get_reply_url( $reply_id, $redirect_to );
|
|
@@ -1534,7 +1830,7 @@ function bbp_display_replies_feed_rss2( $replies_query = array() ) {
|
|
| 1534 |
<description><?php //?></description>
|
| 1535 |
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s O', current_time( 'mysql' ), false ); ?></pubDate>
|
| 1536 |
<generator>http://bbpress.org/?v=<?php bbp_version(); ?></generator>
|
| 1537 |
-
<language><?php
|
| 1538 |
|
| 1539 |
<?php do_action( 'bbp_feed_head' ); ?>
|
| 1540 |
|
| 77 |
*
|
| 78 |
* @since bbPress (r2574)
|
| 79 |
*
|
| 80 |
+
* @param string $action The requested action to compare this function to
|
| 81 |
* @uses bbp_add_error() To add an error message
|
| 82 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 83 |
* @uses bbp_is_anonymous() To check if an anonymous post is being made
|
| 103 |
* @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error
|
| 104 |
* message
|
| 105 |
*/
|
| 106 |
+
function bbp_new_reply_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
// Bail if action is not bbp-new-reply
|
| 109 |
+
if ( 'bbp-new-reply' !== $action )
|
| 110 |
return;
|
| 111 |
|
| 112 |
// Nonce check
|
| 291 |
// Trash the reply
|
| 292 |
wp_trash_post( $reply_id );
|
| 293 |
|
| 294 |
+
// Only add to pre-trashed array if topic is trashed
|
| 295 |
+
if ( bbp_is_topic_trash( $topic_id ) ) {
|
| 296 |
|
| 297 |
+
// Get pre_trashed_replies for topic
|
| 298 |
+
$pre_trashed_replies = get_post_meta( $topic_id, '_bbp_pre_trashed_replies', true );
|
| 299 |
|
| 300 |
+
// Add this reply to the end of the existing replies
|
| 301 |
+
$pre_trashed_replies[] = $reply_id;
|
| 302 |
+
|
| 303 |
+
// Update the pre_trashed_reply post meta
|
| 304 |
+
update_post_meta( $topic_id, '_bbp_pre_trashed_replies', $pre_trashed_replies );
|
| 305 |
+
}
|
| 306 |
|
| 307 |
/** Spam Check ********************************************************/
|
| 308 |
|
| 309 |
// If reply or topic are spam, officially spam this reply
|
| 310 |
+
} elseif ( bbp_is_topic_spam( $topic_id ) || ( $reply_data['post_status'] == bbp_get_spam_status_id() ) ) {
|
| 311 |
add_post_meta( $reply_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
|
| 312 |
|
| 313 |
+
// Only add to pre-spammed array if topic is spam
|
| 314 |
+
if ( bbp_is_topic_spam( $topic_id ) ) {
|
| 315 |
+
|
| 316 |
+
// Get pre_spammed_replies for topic
|
| 317 |
+
$pre_spammed_replies = get_post_meta( $topic_id, '_bbp_pre_spammed_replies', true );
|
| 318 |
+
|
| 319 |
+
// Add this reply to the end of the existing replies
|
| 320 |
+
$pre_spammed_replies[] = $reply_id;
|
| 321 |
+
|
| 322 |
+
// Update the pre_spammed_replies post meta
|
| 323 |
+
update_post_meta( $topic_id, '_bbp_pre_spammed_replies', $pre_spammed_replies );
|
| 324 |
+
}
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
/** Update counts, etc... *********************************************/
|
| 328 |
|
| 329 |
do_action( 'bbp_new_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author );
|
| 335 |
/** Redirect **********************************************************/
|
| 336 |
|
| 337 |
// Redirect to
|
| 338 |
+
$redirect_to = bbp_get_redirect_to();
|
| 339 |
|
| 340 |
// Get the reply URL
|
| 341 |
$reply_url = bbp_get_reply_url( $reply_id, $redirect_to );
|
| 362 |
/**
|
| 363 |
* Handles the front end edit reply submission
|
| 364 |
*
|
| 365 |
+
* @param string $action The requested action to compare this function to
|
| 366 |
* @uses bbp_add_error() To add an error message
|
| 367 |
* @uses bbp_get_reply() To get the reply
|
| 368 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 390 |
* @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error
|
| 391 |
* message
|
| 392 |
*/
|
| 393 |
+
function bbp_edit_reply_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
|
| 395 |
// Bail if action is not bbp-edit-reply
|
| 396 |
+
if ( 'bbp-edit-reply' !== $action )
|
| 397 |
return;
|
| 398 |
|
| 399 |
// Define local variable(s)
|
| 570 |
|
| 571 |
// Toggle revisions back on
|
| 572 |
if ( true === $revisions_removed ) {
|
| 573 |
+
$revisions_removed = false;
|
| 574 |
add_post_type_support( bbp_get_reply_post_type(), 'revisions' );
|
| 575 |
}
|
| 576 |
|
| 595 |
|
| 596 |
// Update revision log
|
| 597 |
if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( 1 == $_POST['bbp_log_reply_edit'] ) ) {
|
| 598 |
+
$revision_id = wp_save_post_revision( $reply_id );
|
| 599 |
if ( !empty( $revision_id ) ) {
|
| 600 |
bbp_update_reply_revision_log( array(
|
| 601 |
'reply_id' => $reply_id,
|
| 620 |
/** Redirect **********************************************************/
|
| 621 |
|
| 622 |
// Redirect to
|
| 623 |
+
$redirect_to = bbp_get_redirect_to();
|
| 624 |
|
| 625 |
// Get the reply URL
|
| 626 |
$reply_url = bbp_get_reply_url( $reply_id, $redirect_to );
|
| 650 |
* @param int $reply_id Optional. Reply id
|
| 651 |
* @param int $topic_id Optional. Topic id
|
| 652 |
* @param int $forum_id Optional. Forum id
|
| 653 |
+
* @param bool|array $anonymous_data Optional logged-out user data.
|
|
|
|
| 654 |
* @param int $author_id Author id
|
| 655 |
* @param bool $is_edit Optional. Is the post being edited? Defaults to false.
|
| 656 |
* @uses bbp_get_reply_id() To get the reply id
|
| 699 |
// Check bbp_filter_anonymous_post_data() for sanitization.
|
| 700 |
if ( !empty( $anonymous_data ) && is_array( $anonymous_data ) ) {
|
| 701 |
|
| 702 |
+
// Parse arguments against default values
|
| 703 |
+
$r = bbp_parse_args( $anonymous_data, array(
|
| 704 |
'bbp_anonymous_name' => '',
|
| 705 |
'bbp_anonymous_email' => '',
|
| 706 |
'bbp_anonymous_website' => '',
|
| 707 |
+
), 'update_reply' );
|
|
|
|
| 708 |
|
| 709 |
// Update all anonymous metas
|
| 710 |
foreach( $r as $anon_key => $anon_value ) {
|
| 995 |
* @return mixed False on failure, true on success
|
| 996 |
*/
|
| 997 |
function bbp_update_reply_revision_log( $args = '' ) {
|
| 998 |
+
|
| 999 |
+
// Parse arguments against default values
|
| 1000 |
+
$r = bbp_parse_args( $args, array(
|
| 1001 |
'reason' => '',
|
| 1002 |
'reply_id' => 0,
|
| 1003 |
'author_id' => 0,
|
| 1004 |
'revision_id' => 0
|
| 1005 |
+
), 'update_reply_revision_log' );
|
|
|
|
|
|
|
|
|
|
| 1006 |
|
| 1007 |
// Populate the variables
|
| 1008 |
+
$r['reason'] = bbp_format_revision_reason( $r['reason'] );
|
| 1009 |
+
$r['reply_id'] = bbp_get_reply_id( $r['reply_id'] );
|
| 1010 |
+
$r['author_id'] = bbp_get_user_id ( $r['author_id'], false, true );
|
| 1011 |
+
$r['revision_id'] = (int) $r['revision_id'];
|
| 1012 |
|
| 1013 |
// Get the logs and append the new one to those
|
| 1014 |
+
$revision_log = bbp_get_reply_raw_revision_log( $r['reply_id'] );
|
| 1015 |
+
$revision_log[ $r['revision_id'] ] = array( 'author' => $r['author_id'], 'reason' => $r['reason'] );
|
| 1016 |
|
| 1017 |
// Finally, update
|
| 1018 |
+
update_post_meta( $r['reply_id'], '_bbp_revision_log', $revision_log );
|
| 1019 |
+
|
| 1020 |
+
return apply_filters( 'bbp_update_reply_revision_log', $revision_log, $r['reply_id'] );
|
| 1021 |
+
}
|
| 1022 |
+
|
| 1023 |
+
/**
|
| 1024 |
+
* Move reply handler
|
| 1025 |
+
*
|
| 1026 |
+
* Handles the front end move reply submission
|
| 1027 |
+
*
|
| 1028 |
+
* @since bbPress (r4521)
|
| 1029 |
+
*
|
| 1030 |
+
* @param string $action The requested action to compare this function to
|
| 1031 |
+
* @uses bbPress:errors::add() To log various error messages
|
| 1032 |
+
* @uses bbp_get_reply() To get the reply
|
| 1033 |
+
* @uses bbp_get_topic() To get the topics
|
| 1034 |
+
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 1035 |
+
* @uses current_user_can() To check if the current user can edit the reply and topics
|
| 1036 |
+
* @uses bbp_get_topic_post_type() To get the topic post type
|
| 1037 |
+
* @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
|
| 1038 |
+
* @uses do_action() Calls 'bbp_pre_move_reply' with the from reply id, source
|
| 1039 |
+
* and destination topic ids
|
| 1040 |
+
* @uses bbp_get_reply_post_type() To get the reply post type
|
| 1041 |
+
* @uses wpdb::prepare() To prepare our sql query
|
| 1042 |
+
* @uses wpdb::get_results() To execute the sql query and get results
|
| 1043 |
+
* @uses wp_update_post() To update the replies
|
| 1044 |
+
* @uses bbp_update_reply_topic_id() To update the reply topic id
|
| 1045 |
+
* @uses bbp_get_topic_forum_id() To get the topic forum id
|
| 1046 |
+
* @uses bbp_update_reply_forum_id() To update the reply forum id
|
| 1047 |
+
* @uses do_action() Calls 'bbp_split_topic_reply' with the reply id and
|
| 1048 |
+
* destination topic id
|
| 1049 |
+
* @uses bbp_update_topic_last_reply_id() To update the topic last reply id
|
| 1050 |
+
* @uses bbp_update_topic_last_active_time() To update the topic last active meta
|
| 1051 |
+
* @uses do_action() Calls 'bbp_post_split_topic' with the destination and
|
| 1052 |
+
* source topic ids and source topic's forum id
|
| 1053 |
+
* @uses bbp_get_topic_permalink() To get the topic permalink
|
| 1054 |
+
* @uses wp_safe_redirect() To redirect to the topic link
|
| 1055 |
+
*/
|
| 1056 |
+
function bbp_move_reply_handler( $action = '' ) {
|
| 1057 |
+
|
| 1058 |
+
// Bail if action is not 'bbp-move-reply'
|
| 1059 |
+
if ( 'bbp-move-reply' !== $action )
|
| 1060 |
+
return;
|
| 1061 |
+
|
| 1062 |
+
// Prevent debug notices
|
| 1063 |
+
$move_reply_id = $destination_topic_id = 0;
|
| 1064 |
+
$destination_topic_title = '';
|
| 1065 |
+
$destination_topic = $move_reply = $source_topic = '';
|
| 1066 |
+
|
| 1067 |
+
/** Move Reply ***********************************************************/
|
| 1068 |
+
|
| 1069 |
+
if ( empty( $_POST['bbp_reply_id'] ) ) {
|
| 1070 |
+
bbp_add_error( 'bbp_move_reply_reply_id', __( '<strong>ERROR</strong>: Reply ID to move not found!', 'bbpress' ) );
|
| 1071 |
+
} else {
|
| 1072 |
+
$move_reply_id = (int) $_POST['bbp_reply_id'];
|
| 1073 |
+
}
|
| 1074 |
+
|
| 1075 |
+
$move_reply = bbp_get_reply( $move_reply_id );
|
| 1076 |
+
|
| 1077 |
+
// Reply exists
|
| 1078 |
+
if ( empty( $move_reply ) )
|
| 1079 |
+
bbp_add_error( 'bbp_mover_reply_r_not_found', __( '<strong>ERROR</strong>: The reply you want to move was not found.', 'bbpress' ) );
|
| 1080 |
+
|
| 1081 |
+
/** Topic to Move From ***************************************************/
|
| 1082 |
+
|
| 1083 |
+
// Get the reply's current topic
|
| 1084 |
+
$source_topic = bbp_get_topic( $move_reply->post_parent );
|
| 1085 |
+
|
| 1086 |
+
// No topic
|
| 1087 |
+
if ( empty( $source_topic ) ) {
|
| 1088 |
+
bbp_add_error( 'bbp_move_reply_source_not_found', __( '<strong>ERROR</strong>: The topic you want to move from was not found.', 'bbpress' ) );
|
| 1089 |
+
}
|
| 1090 |
+
|
| 1091 |
+
// Nonce check failed
|
| 1092 |
+
if ( ! bbp_verify_nonce_request( 'bbp-move-reply_' . $move_reply->ID ) ) {
|
| 1093 |
+
bbp_add_error( 'bbp_move_reply_nonce', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );
|
| 1094 |
+
return;
|
| 1095 |
+
}
|
| 1096 |
+
|
| 1097 |
+
// Use cannot edit topic
|
| 1098 |
+
if ( !current_user_can( 'edit_topic', $source_topic->ID ) ) {
|
| 1099 |
+
bbp_add_error( 'bbp_move_reply_source_permission', __( '<strong>ERROR</strong>: You do not have the permissions to edit the source topic.', 'bbpress' ) );
|
| 1100 |
+
}
|
| 1101 |
+
|
| 1102 |
+
// How to move
|
| 1103 |
+
if ( !empty( $_POST['bbp_reply_move_option'] ) ) {
|
| 1104 |
+
$move_option = (string) trim( $_POST['bbp_reply_move_option'] );
|
| 1105 |
+
}
|
| 1106 |
+
|
| 1107 |
+
// Invalid move option
|
| 1108 |
+
if ( empty( $move_option ) || !in_array( $move_option, array( 'existing', 'topic' ) ) ) {
|
| 1109 |
+
bbp_add_error( 'bbp_move_reply_option', __( '<strong>ERROR</strong>: You need to choose a valid move option.', 'bbpress' ) );
|
| 1110 |
|
| 1111 |
+
// Valid move option
|
| 1112 |
+
} else {
|
| 1113 |
+
|
| 1114 |
+
// What kind of move
|
| 1115 |
+
switch ( $move_option ) {
|
| 1116 |
+
|
| 1117 |
+
// Into an existing topic
|
| 1118 |
+
case 'existing' :
|
| 1119 |
+
|
| 1120 |
+
// Get destination topic id
|
| 1121 |
+
if ( empty( $_POST['bbp_destination_topic'] ) ) {
|
| 1122 |
+
bbp_add_error( 'bbp_move_reply_destination_id', __( '<strong>ERROR</strong>: Destination topic ID not found!', 'bbpress' ) );
|
| 1123 |
+
} else {
|
| 1124 |
+
$destination_topic_id = (int) $_POST['bbp_destination_topic'];
|
| 1125 |
+
}
|
| 1126 |
+
|
| 1127 |
+
// Get the destination topic
|
| 1128 |
+
$destination_topic = bbp_get_topic( $destination_topic_id );
|
| 1129 |
+
|
| 1130 |
+
// No destination topic
|
| 1131 |
+
if ( empty( $destination_topic ) ) {
|
| 1132 |
+
bbp_add_error( 'bbp_move_reply_destination_not_found', __( '<strong>ERROR</strong>: The topic you want to move to was not found!', 'bbpress' ) );
|
| 1133 |
+
}
|
| 1134 |
+
|
| 1135 |
+
// User cannot edit the destination topic
|
| 1136 |
+
if ( !current_user_can( 'edit_topic', $destination_topic->ID ) ) {
|
| 1137 |
+
bbp_add_error( 'bbp_move_reply_destination_permission', __( '<strong>ERROR</strong>: You do not have the permissions to edit the destination topic!', 'bbpress' ) );
|
| 1138 |
+
}
|
| 1139 |
+
|
| 1140 |
+
// Reply position
|
| 1141 |
+
$reply_position = bbp_get_topic_reply_count( $destination_topic->ID ) + 1;
|
| 1142 |
+
|
| 1143 |
+
// New reply data
|
| 1144 |
+
$postarr = array(
|
| 1145 |
+
'ID' => $move_reply->ID,
|
| 1146 |
+
'post_title' => sprintf( __( 'Reply To: %s', 'bbpress' ), $destination_topic->post_title ),
|
| 1147 |
+
'post_name' => false, // will be automatically generated
|
| 1148 |
+
'post_parent' => $destination_topic->ID,
|
| 1149 |
+
'post_position' => $reply_position,
|
| 1150 |
+
'guid' => ''
|
| 1151 |
+
);
|
| 1152 |
+
|
| 1153 |
+
// Update the reply
|
| 1154 |
+
wp_update_post( $postarr );
|
| 1155 |
+
|
| 1156 |
+
// Adjust reply meta values
|
| 1157 |
+
bbp_update_reply_topic_id( $move_reply->ID, $destination_topic->ID );
|
| 1158 |
+
bbp_update_reply_forum_id( $move_reply->ID, bbp_get_topic_forum_id( $destination_topic->ID ) );
|
| 1159 |
+
|
| 1160 |
+
break;
|
| 1161 |
+
|
| 1162 |
+
// Move reply to a new topic
|
| 1163 |
+
case 'topic' :
|
| 1164 |
+
default :
|
| 1165 |
+
|
| 1166 |
+
// User needs to be able to publish topics
|
| 1167 |
+
if ( current_user_can( 'publish_topics' ) ) {
|
| 1168 |
+
|
| 1169 |
+
// Use the new title that was passed
|
| 1170 |
+
if ( !empty( $_POST['bbp_reply_move_destination_title'] ) ) {
|
| 1171 |
+
$destination_topic_title = esc_attr( strip_tags( $_POST['bbp_reply_move_destination_title'] ) );
|
| 1172 |
+
|
| 1173 |
+
// Use the source topic title
|
| 1174 |
+
} else {
|
| 1175 |
+
$destination_topic_title = $source_topic->post_title;
|
| 1176 |
+
}
|
| 1177 |
+
|
| 1178 |
+
// Setup the updated topic parameters
|
| 1179 |
+
$postarr = array(
|
| 1180 |
+
'ID' => $move_reply->ID,
|
| 1181 |
+
'post_title' => $destination_topic_title,
|
| 1182 |
+
'post_name' => false,
|
| 1183 |
+
'post_type' => bbp_get_topic_post_type(),
|
| 1184 |
+
'post_parent' => $source_topic->post_parent,
|
| 1185 |
+
'guid' => ''
|
| 1186 |
+
);
|
| 1187 |
+
|
| 1188 |
+
// Update the topic
|
| 1189 |
+
$destination_topic_id = wp_update_post( $postarr );
|
| 1190 |
+
$destination_topic = bbp_get_topic( $destination_topic_id );
|
| 1191 |
+
|
| 1192 |
+
// Make sure the new topic knows its a topic
|
| 1193 |
+
bbp_update_topic_topic_id( $move_reply->ID );
|
| 1194 |
+
|
| 1195 |
+
// Shouldn't happen
|
| 1196 |
+
if ( false == $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) {
|
| 1197 |
+
bbp_add_error( 'bbp_move_reply_destination_reply', __( '<strong>ERROR</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) );
|
| 1198 |
+
}
|
| 1199 |
+
|
| 1200 |
+
// User cannot publish posts
|
| 1201 |
+
} else {
|
| 1202 |
+
bbp_add_error( 'bbp_move_reply_destination_permission', __( '<strong>ERROR</strong>: You do not have the permissions to create new topics. The reply could not be converted into a topic.', 'bbpress' ) );
|
| 1203 |
+
}
|
| 1204 |
+
|
| 1205 |
+
break;
|
| 1206 |
+
}
|
| 1207 |
+
}
|
| 1208 |
+
|
| 1209 |
+
// Bail if there are errors
|
| 1210 |
+
if ( bbp_has_errors() ) {
|
| 1211 |
+
return;
|
| 1212 |
+
}
|
| 1213 |
+
|
| 1214 |
+
/** No Errors - Clean Up **************************************************/
|
| 1215 |
+
|
| 1216 |
+
// Update counts, etc...
|
| 1217 |
+
do_action( 'bbp_pre_move_reply', $move_reply->ID, $source_topic->ID, $destination_topic->ID );
|
| 1218 |
+
|
| 1219 |
+
/** Date Check ************************************************************/
|
| 1220 |
+
|
| 1221 |
+
// Check if the destination topic is older than the move reply
|
| 1222 |
+
if ( strtotime( $move_reply->post_date ) < strtotime( $destination_topic->post_date ) ) {
|
| 1223 |
+
|
| 1224 |
+
// Set destination topic post_date to 1 second before from reply
|
| 1225 |
+
$destination_post_date = date( 'Y-m-d H:i:s', strtotime( $move_reply->post_date ) - 1 );
|
| 1226 |
+
|
| 1227 |
+
$postarr = array(
|
| 1228 |
+
'ID' => $destination_topic_id,
|
| 1229 |
+
'post_date' => $destination_post_date,
|
| 1230 |
+
'post_date_gmt' => get_gmt_from_date( $destination_post_date )
|
| 1231 |
+
);
|
| 1232 |
+
|
| 1233 |
+
// Update destination topic
|
| 1234 |
+
wp_update_post( $postarr );
|
| 1235 |
+
}
|
| 1236 |
+
|
| 1237 |
+
// Set the last reply ID and freshness to the move_reply
|
| 1238 |
+
$last_reply_id = $move_reply->ID;
|
| 1239 |
+
$freshness = $move_reply->post_date;
|
| 1240 |
+
|
| 1241 |
+
// It is a new topic and we need to set some default metas to make
|
| 1242 |
+
// the topic display in bbp_has_topics() list
|
| 1243 |
+
if ( 'topic' == $move_option ) {
|
| 1244 |
+
bbp_update_topic_last_reply_id ( $destination_topic->ID, $last_reply_id );
|
| 1245 |
+
bbp_update_topic_last_active_id ( $destination_topic->ID, $last_reply_id );
|
| 1246 |
+
bbp_update_topic_last_active_time( $destination_topic->ID, $freshness );
|
| 1247 |
+
|
| 1248 |
+
// Otherwise update the existing destination topic
|
| 1249 |
+
} else {
|
| 1250 |
+
bbp_update_topic_last_reply_id ( $destination_topic->ID );
|
| 1251 |
+
bbp_update_topic_last_active_id ( $destination_topic->ID );
|
| 1252 |
+
bbp_update_topic_last_active_time( $destination_topic->ID );
|
| 1253 |
+
}
|
| 1254 |
+
|
| 1255 |
+
// Update source topic ID last active
|
| 1256 |
+
bbp_update_topic_last_reply_id ( $source_topic->ID );
|
| 1257 |
+
bbp_update_topic_last_active_id ( $source_topic->ID );
|
| 1258 |
+
bbp_update_topic_last_active_time( $source_topic->ID );
|
| 1259 |
+
|
| 1260 |
+
/** Successful Move ******************************************************/
|
| 1261 |
+
|
| 1262 |
+
// Update counts, etc...
|
| 1263 |
+
do_action( 'bbp_post_move_reply', $move_reply->ID, $source_topic->ID, $destination_topic->ID );
|
| 1264 |
+
|
| 1265 |
+
// Redirect back to the topic
|
| 1266 |
+
wp_safe_redirect( bbp_get_topic_permalink( $destination_topic->ID ) );
|
| 1267 |
+
|
| 1268 |
+
// For good measure
|
| 1269 |
+
exit();
|
| 1270 |
+
}
|
| 1271 |
+
|
| 1272 |
+
/**
|
| 1273 |
+
* Fix counts on reply move
|
| 1274 |
+
*
|
| 1275 |
+
* When a reply is moved, update the counts of source and destination topic
|
| 1276 |
+
* and their forums.
|
| 1277 |
+
*
|
| 1278 |
+
* @since bbPress (r4521)
|
| 1279 |
+
*
|
| 1280 |
+
* @param int $move_reply_id Move reply id
|
| 1281 |
+
* @param int $source_topic_id Source topic id
|
| 1282 |
+
* @param int $destination_topic_id Destination topic id
|
| 1283 |
+
* @uses bbp_update_forum_topic_count() To update the forum topic counts
|
| 1284 |
+
* @uses bbp_update_forum_reply_count() To update the forum reply counts
|
| 1285 |
+
* @uses bbp_update_topic_reply_count() To update the topic reply counts
|
| 1286 |
+
* @uses bbp_update_topic_voice_count() To update the topic voice counts
|
| 1287 |
+
* @uses bbp_update_topic_reply_count_hidden() To update the topic hidden reply
|
| 1288 |
+
* count
|
| 1289 |
+
* @uses do_action() Calls 'bbp_move_reply_count' with the move reply id,
|
| 1290 |
+
* source topic id & destination topic id
|
| 1291 |
+
*/
|
| 1292 |
+
function bbp_move_reply_count( $move_reply_id, $source_topic_id, $destination_topic_id ) {
|
| 1293 |
+
|
| 1294 |
+
// Forum topic counts
|
| 1295 |
+
bbp_update_forum_topic_count( bbp_get_topic_forum_id( $destination_topic_id ) );
|
| 1296 |
+
|
| 1297 |
+
// Forum reply counts
|
| 1298 |
+
bbp_update_forum_reply_count( bbp_get_topic_forum_id( $destination_topic_id ) );
|
| 1299 |
+
|
| 1300 |
+
// Topic reply counts
|
| 1301 |
+
bbp_update_topic_reply_count( $source_topic_id );
|
| 1302 |
+
bbp_update_topic_reply_count( $destination_topic_id );
|
| 1303 |
+
|
| 1304 |
+
// Topic hidden reply counts
|
| 1305 |
+
bbp_update_topic_reply_count_hidden( $source_topic_id );
|
| 1306 |
+
bbp_update_topic_reply_count_hidden( $destination_topic_id );
|
| 1307 |
+
|
| 1308 |
+
// Topic voice counts
|
| 1309 |
+
bbp_update_topic_voice_count( $source_topic_id );
|
| 1310 |
+
bbp_update_topic_voice_count( $destination_topic_id );
|
| 1311 |
+
|
| 1312 |
+
do_action( 'bbp_move_reply_count', $move_reply_id, $source_topic_id, $destination_topic_id );
|
| 1313 |
}
|
| 1314 |
|
| 1315 |
/** Reply Actions *************************************************************/
|
| 1320 |
*
|
| 1321 |
* @since bbPress (r2740)
|
| 1322 |
*
|
| 1323 |
+
* @param string $action The requested action to compare this function to
|
| 1324 |
* @uses bbp_get_reply() To get the reply
|
| 1325 |
* @uses current_user_can() To check if the user is capable of editing or
|
| 1326 |
* deleting the reply
|
| 1339 |
* @uses wp_safe_redirect() To redirect to the reply
|
| 1340 |
* @uses bbPress::errors:add() To log the error messages
|
| 1341 |
*/
|
| 1342 |
+
function bbp_toggle_reply_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1343 |
|
| 1344 |
// Bail if required GET actions aren't passed
|
| 1345 |
+
if ( empty( $_GET['reply_id'] ) )
|
| 1346 |
return;
|
| 1347 |
|
| 1348 |
// Setup possible get actions
|
| 1352 |
);
|
| 1353 |
|
| 1354 |
// Bail if actions aren't meant for this function
|
| 1355 |
+
if ( !in_array( $action, $possible_actions ) )
|
| 1356 |
return;
|
| 1357 |
|
| 1358 |
$failure = ''; // Empty failure string
|
| 1359 |
$view_all = false; // Assume not viewing all
|
|
|
|
| 1360 |
$reply_id = (int) $_GET['reply_id']; // What's the reply id?
|
| 1361 |
$success = false; // Flag
|
| 1362 |
$post_data = array( 'ID' => $reply_id ); // Prelim array
|
| 1433 |
/** Redirect **********************************************************/
|
| 1434 |
|
| 1435 |
// Redirect to
|
| 1436 |
+
$redirect_to = bbp_get_redirect_to();
|
| 1437 |
|
| 1438 |
// Get the reply URL
|
| 1439 |
$reply_url = bbp_get_reply_url( $reply_id, $redirect_to );
|
| 1830 |
<description><?php //?></description>
|
| 1831 |
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s O', current_time( 'mysql' ), false ); ?></pubDate>
|
| 1832 |
<generator>http://bbpress.org/?v=<?php bbp_version(); ?></generator>
|
| 1833 |
+
<language><?php bloginfo_rss( 'language' ); ?></language>
|
| 1834 |
|
| 1835 |
<?php do_action( 'bbp_feed_head' ); ?>
|
| 1836 |
|
includes/replies/template-tags.php
CHANGED
|
@@ -66,23 +66,17 @@ function bbp_reply_post_type() {
|
|
| 66 |
function bbp_has_replies( $args = '' ) {
|
| 67 |
global $wp_rewrite;
|
| 68 |
|
| 69 |
-
|
| 70 |
-
if ( bbp_get_view_all( 'edit_others_replies' ) ) {
|
| 71 |
-
$post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() );
|
| 72 |
-
} else {
|
| 73 |
-
$post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() );
|
| 74 |
-
}
|
| 75 |
|
|
|
|
| 76 |
$default_reply_search = !empty( $_REQUEST['rs'] ) ? $_REQUEST['rs'] : false;
|
| 77 |
$default_post_parent = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any';
|
| 78 |
$default_post_type = ( bbp_is_single_topic() && bbp_show_lead_topic() ) ? bbp_get_reply_post_type() : array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
|
| 79 |
-
$default_post_status = join( ',', $post_statuses );
|
| 80 |
|
| 81 |
// Default query args
|
| 82 |
$default = array(
|
| 83 |
'post_type' => $default_post_type, // Only replies
|
| 84 |
'post_parent' => $default_post_parent, // Of this topic
|
| 85 |
-
'post_status' => $default_post_status, // Of this status
|
| 86 |
'posts_per_page' => bbp_get_replies_per_page(), // This many
|
| 87 |
'paged' => bbp_get_paged(), // On this page
|
| 88 |
'orderby' => 'date', // Sorted by date
|
|
@@ -90,21 +84,44 @@ function bbp_has_replies( $args = '' ) {
|
|
| 90 |
's' => $default_reply_search, // Maybe search
|
| 91 |
);
|
| 92 |
|
| 93 |
-
//
|
| 94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
| 98 |
|
| 99 |
// Get bbPress
|
| 100 |
$bbp = bbpress();
|
| 101 |
|
| 102 |
// Call the query
|
| 103 |
-
$bbp->reply_query = new WP_Query( $
|
| 104 |
|
| 105 |
// Add pagination values to query object
|
| 106 |
-
$bbp->reply_query->posts_per_page = $posts_per_page;
|
| 107 |
-
$bbp->reply_query->paged = $paged;
|
| 108 |
|
| 109 |
// Never home, regardless of what parse_query says
|
| 110 |
$bbp->reply_query->is_home = false;
|
|
@@ -145,10 +162,10 @@ function bbp_has_replies( $args = '' ) {
|
|
| 145 |
apply_filters( 'bbp_replies_pagination', array(
|
| 146 |
'base' => $base,
|
| 147 |
'format' => '',
|
| 148 |
-
'total' => ceil( (int) $bbp->reply_query->found_posts / (int) $posts_per_page ),
|
| 149 |
'current' => (int) $bbp->reply_query->paged,
|
| 150 |
-
'prev_text' => '←',
|
| 151 |
-
'next_text' => '→',
|
| 152 |
'mid_size' => 1,
|
| 153 |
'add_args' => ( bbp_get_view_all() ) ? array( 'view' => 'all' ) : false
|
| 154 |
) )
|
|
@@ -217,7 +234,8 @@ function bbp_reply_id( $reply_id = 0 ) {
|
|
| 217 |
*
|
| 218 |
* @param $reply_id Optional. Used to check emptiness
|
| 219 |
* @uses bbPress::reply_query::post::ID To get the reply id
|
| 220 |
-
* @uses bbp_is_reply() To check if
|
|
|
|
| 221 |
* @uses bbp_is_reply_edit() To check if it's a reply edit page
|
| 222 |
* @uses get_post_field() To get the post's post type
|
| 223 |
* @uses WP_Query::post::ID To get the reply id
|
|
@@ -239,6 +257,10 @@ function bbp_reply_id( $reply_id = 0 ) {
|
|
| 239 |
} elseif ( !empty( $bbp->reply_query->in_the_loop ) && isset( $bbp->reply_query->post->ID ) ) {
|
| 240 |
$bbp_reply_id = $bbp->reply_query->post->ID;
|
| 241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
// Currently viewing a forum
|
| 243 |
} elseif ( ( bbp_is_single_reply() || bbp_is_reply_edit() ) && !empty( $bbp->current_reply_id ) ) {
|
| 244 |
$bbp_reply_id = $bbp->current_reply_id;
|
|
@@ -525,7 +547,7 @@ function bbp_reply_post_date( $reply_id = 0, $humanize = false, $gmt = false ) {
|
|
| 525 |
* @param bool $gmt Optional. Use GMT
|
| 526 |
* @uses bbp_get_reply_id() To get the reply id
|
| 527 |
* @uses get_post_time() to get the reply post time
|
| 528 |
-
* @uses
|
| 529 |
* @return string
|
| 530 |
*/
|
| 531 |
function bbp_get_reply_post_date( $reply_id = 0, $humanize = false, $gmt = false ) {
|
|
@@ -533,10 +555,10 @@ function bbp_reply_post_date( $reply_id = 0, $humanize = false, $gmt = false ) {
|
|
| 533 |
|
| 534 |
// 4 days, 4 hours ago
|
| 535 |
if ( !empty( $humanize ) ) {
|
| 536 |
-
$
|
| 537 |
-
$date = get_post_time( $gmt, $reply_id );
|
| 538 |
$time = false; // For filter below
|
| 539 |
-
$result =
|
| 540 |
|
| 541 |
// August 4, 2012 at 2:37 pm
|
| 542 |
} else {
|
|
@@ -838,10 +860,11 @@ function bbp_reply_author( $reply_id = 0 ) {
|
|
| 838 |
function bbp_get_reply_author( $reply_id = 0 ) {
|
| 839 |
$reply_id = bbp_get_reply_id( $reply_id );
|
| 840 |
|
| 841 |
-
if ( !bbp_is_reply_anonymous( $reply_id ) )
|
| 842 |
$author = get_the_author_meta( 'display_name', bbp_get_reply_author_id( $reply_id ) );
|
| 843 |
-
else
|
| 844 |
$author = get_post_meta( $reply_id, '_bbp_anonymous_name', true );
|
|
|
|
| 845 |
|
| 846 |
return apply_filters( 'bbp_get_reply_author', $author, $reply_id );
|
| 847 |
}
|
|
@@ -929,7 +952,11 @@ function bbp_reply_author_display_name( $reply_id = 0 ) {
|
|
| 929 |
if ( empty( $author_name ) )
|
| 930 |
$author_name = __( 'Anonymous', 'bbpress' );
|
| 931 |
|
| 932 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 933 |
}
|
| 934 |
|
| 935 |
/**
|
|
@@ -1009,58 +1036,72 @@ function bbp_reply_author_link( $args = '' ) {
|
|
| 1009 |
* @return string Author link of reply
|
| 1010 |
*/
|
| 1011 |
function bbp_get_reply_author_link( $args = '' ) {
|
| 1012 |
-
|
|
|
|
|
|
|
| 1013 |
'post_id' => 0,
|
| 1014 |
'link_title' => '',
|
| 1015 |
'type' => 'both',
|
| 1016 |
'size' => 80,
|
| 1017 |
'sep' => ' ',
|
| 1018 |
'show_role' => false
|
| 1019 |
-
);
|
| 1020 |
-
$r = bbp_parse_args( $args, $defaults, 'get_reply_author_link' );
|
| 1021 |
-
extract( $r );
|
| 1022 |
|
| 1023 |
// Used as reply_id
|
| 1024 |
-
if ( is_numeric( $args ) )
|
| 1025 |
$reply_id = bbp_get_reply_id( $args );
|
| 1026 |
-
else
|
| 1027 |
-
$reply_id = bbp_get_reply_id( $post_id );
|
|
|
|
| 1028 |
|
|
|
|
| 1029 |
if ( !empty( $reply_id ) ) {
|
| 1030 |
-
|
|
|
|
|
|
|
| 1031 |
$link_title = sprintf( !bbp_is_reply_anonymous( $reply_id ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_reply_author_display_name( $reply_id ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1032 |
}
|
| 1033 |
|
| 1034 |
-
$link_title
|
| 1035 |
-
$author_url
|
| 1036 |
-
$anonymous
|
|
|
|
| 1037 |
|
| 1038 |
// Get avatar
|
| 1039 |
-
if ( 'avatar' == $type || 'both' == $type ) {
|
| 1040 |
-
$author_links['avatar'] = bbp_get_reply_author_avatar( $reply_id, $size );
|
| 1041 |
}
|
| 1042 |
|
| 1043 |
// Get display name
|
| 1044 |
-
if ( 'name' == $type || 'both' == $type ) {
|
| 1045 |
$author_links['name'] = bbp_get_reply_author_display_name( $reply_id );
|
| 1046 |
}
|
| 1047 |
|
|
|
|
|
|
|
|
|
|
| 1048 |
// Add links if not anonymous
|
| 1049 |
if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
|
|
|
|
|
|
|
| 1050 |
foreach ( $author_links as $link => $link_text ) {
|
| 1051 |
$link_class = ' class="bbp-author-' . $link . '"';
|
| 1052 |
$author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', $author_url, $link_title, $link_class, $link_text );
|
| 1053 |
}
|
| 1054 |
|
| 1055 |
-
if ( true === $show_role ) {
|
| 1056 |
$author_link[] = bbp_get_reply_author_role( array( 'reply_id' => $reply_id ) );
|
| 1057 |
}
|
| 1058 |
|
| 1059 |
-
$author_link = join( $sep, $author_link );
|
| 1060 |
|
| 1061 |
// No links if anonymous
|
| 1062 |
} else {
|
| 1063 |
-
$author_link = join( $sep, $author_links );
|
| 1064 |
}
|
| 1065 |
|
| 1066 |
// No replies so link is empty
|
|
@@ -1068,7 +1109,7 @@ function bbp_reply_author_link( $args = '' ) {
|
|
| 1068 |
$author_link = '';
|
| 1069 |
}
|
| 1070 |
|
| 1071 |
-
return apply_filters( 'bbp_get_reply_author_link', $author_link, $
|
| 1072 |
}
|
| 1073 |
|
| 1074 |
/**
|
|
@@ -1192,18 +1233,18 @@ function bbp_reply_author_role( $args = array() ) {
|
|
| 1192 |
* @return string Reply author role
|
| 1193 |
*/
|
| 1194 |
function bbp_get_reply_author_role( $args = array() ) {
|
| 1195 |
-
|
|
|
|
|
|
|
| 1196 |
'reply_id' => 0,
|
| 1197 |
'class' => 'bbp-author-role',
|
| 1198 |
'before' => '',
|
| 1199 |
'after' => ''
|
| 1200 |
-
);
|
| 1201 |
-
$args = bbp_parse_args( $args, $defaults, 'get_reply_author_role' );
|
| 1202 |
-
extract( $args, EXTR_SKIP );
|
| 1203 |
|
| 1204 |
-
$reply_id = bbp_get_reply_id( $reply_id );
|
| 1205 |
$role = bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) );
|
| 1206 |
-
$author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $before, $class, $role, $after );
|
| 1207 |
|
| 1208 |
return apply_filters( 'bbp_get_reply_author_role', $author_role, $args );
|
| 1209 |
}
|
|
@@ -1408,13 +1449,14 @@ function bbp_reply_admin_links( $args = '' ) {
|
|
| 1408 |
* - after: HTML after the links. Defaults to '</span>'
|
| 1409 |
* - sep: Separator. Defaults to ' | '
|
| 1410 |
* - links: Array of the links to display. By default, edit, trash,
|
| 1411 |
-
* spam and topic split links are displayed
|
| 1412 |
* @uses bbp_is_topic() To check if it's the topic page
|
| 1413 |
* @uses bbp_is_reply() To check if it's the reply page
|
| 1414 |
* @uses bbp_get_reply_id() To get the reply id
|
| 1415 |
* @uses bbp_get_reply_edit_link() To get the reply edit link
|
| 1416 |
* @uses bbp_get_reply_trash_link() To get the reply trash link
|
| 1417 |
* @uses bbp_get_reply_spam_link() To get the reply spam link
|
|
|
|
| 1418 |
* @uses bbp_get_topic_split_link() To get the topic split link
|
| 1419 |
* @uses current_user_can() To check if the current user can edit or
|
| 1420 |
* delete the reply
|
|
@@ -1424,14 +1466,14 @@ function bbp_reply_admin_links( $args = '' ) {
|
|
| 1424 |
*/
|
| 1425 |
function bbp_get_reply_admin_links( $args = '' ) {
|
| 1426 |
|
| 1427 |
-
|
|
|
|
| 1428 |
'id' => 0,
|
| 1429 |
'before' => '<span class="bbp-admin-links">',
|
| 1430 |
'after' => '</span>',
|
| 1431 |
'sep' => ' | ',
|
| 1432 |
'links' => array()
|
| 1433 |
-
);
|
| 1434 |
-
$r = bbp_parse_args( $args, $defaults, 'get_reply_admin_links' );
|
| 1435 |
|
| 1436 |
$r['id'] = bbp_get_reply_id( (int) $r['id'] );
|
| 1437 |
|
|
@@ -1453,12 +1495,13 @@ function bbp_reply_admin_links( $args = '' ) {
|
|
| 1453 |
|
| 1454 |
// If no links were passed, default to the standard
|
| 1455 |
if ( empty( $r['links'] ) ) {
|
| 1456 |
-
$r['links'] = array
|
| 1457 |
'edit' => bbp_get_reply_edit_link ( $r ),
|
|
|
|
| 1458 |
'split' => bbp_get_topic_split_link( $r ),
|
| 1459 |
'trash' => bbp_get_reply_trash_link( $r ),
|
| 1460 |
'spam' => bbp_get_reply_spam_link ( $r ),
|
| 1461 |
-
);
|
| 1462 |
}
|
| 1463 |
|
| 1464 |
// Check caps for trashing the topic
|
|
@@ -1470,7 +1513,7 @@ function bbp_reply_admin_links( $args = '' ) {
|
|
| 1470 |
if ( in_array( $reply_status, array( bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ) ) {
|
| 1471 |
|
| 1472 |
// Spam link shouldn't be visible on trashed topics
|
| 1473 |
-
if (
|
| 1474 |
unset( $r['links']['spam'] );
|
| 1475 |
|
| 1476 |
// Trash link shouldn't be visible on spam topics
|
|
@@ -1483,7 +1526,7 @@ function bbp_reply_admin_links( $args = '' ) {
|
|
| 1483 |
$links = implode( $r['sep'], array_filter( $r['links'] ) );
|
| 1484 |
$retval = $r['before'] . $links . $r['after'];
|
| 1485 |
|
| 1486 |
-
return apply_filters( 'bbp_get_reply_admin_links', $retval, $
|
| 1487 |
}
|
| 1488 |
|
| 1489 |
/**
|
|
@@ -1518,35 +1561,36 @@ function bbp_reply_edit_link( $args = '' ) {
|
|
| 1518 |
* @return string Reply edit link
|
| 1519 |
*/
|
| 1520 |
function bbp_get_reply_edit_link( $args = '' ) {
|
| 1521 |
-
|
|
|
|
|
|
|
| 1522 |
'id' => 0,
|
| 1523 |
'link_before' => '',
|
| 1524 |
'link_after' => '',
|
| 1525 |
'edit_text' => __( 'Edit', 'bbpress' )
|
| 1526 |
-
);
|
| 1527 |
-
$r = bbp_parse_args( $args, $defaults, 'get_reply_edit_link' );
|
| 1528 |
-
extract( $r );
|
| 1529 |
|
| 1530 |
-
$reply = bbp_get_reply( bbp_get_reply_id( (int) $id ) );
|
| 1531 |
|
| 1532 |
// Bypass check if user has caps
|
| 1533 |
if ( !current_user_can( 'edit_others_replies' ) ) {
|
| 1534 |
|
| 1535 |
// User cannot edit or it is past the lock time
|
| 1536 |
-
if ( empty( $reply ) || !current_user_can( 'edit_reply', $reply->ID ) || bbp_past_edit_lock( $reply->post_date_gmt ) )
|
| 1537 |
return;
|
|
|
|
| 1538 |
}
|
| 1539 |
|
| 1540 |
// Get uri
|
| 1541 |
-
$uri = bbp_get_reply_edit_url( $id );
|
| 1542 |
|
| 1543 |
// Bail if no uri
|
| 1544 |
if ( empty( $uri ) )
|
| 1545 |
return;
|
| 1546 |
|
| 1547 |
-
$retval = $link_before . '<a href="' . $uri . '">' . $edit_text . '</a>' . $link_after;
|
| 1548 |
|
| 1549 |
-
return apply_filters( 'bbp_get_reply_edit_link', $retval, $
|
| 1550 |
}
|
| 1551 |
|
| 1552 |
/**
|
|
@@ -1640,7 +1684,9 @@ function bbp_reply_trash_link( $args = '' ) {
|
|
| 1640 |
* @return string Reply trash link
|
| 1641 |
*/
|
| 1642 |
function bbp_get_reply_trash_link( $args = '' ) {
|
| 1643 |
-
|
|
|
|
|
|
|
| 1644 |
'id' => 0,
|
| 1645 |
'link_before' => '',
|
| 1646 |
'link_after' => '',
|
|
@@ -1648,31 +1694,29 @@ function bbp_reply_trash_link( $args = '' ) {
|
|
| 1648 |
'trash_text' => __( 'Trash', 'bbpress' ),
|
| 1649 |
'restore_text' => __( 'Restore', 'bbpress' ),
|
| 1650 |
'delete_text' => __( 'Delete', 'bbpress' )
|
| 1651 |
-
);
|
| 1652 |
-
$r = bbp_parse_args( $args, $defaults, 'get_reply_trash_link' );
|
| 1653 |
-
extract( $r );
|
| 1654 |
|
| 1655 |
$actions = array();
|
| 1656 |
-
$reply = bbp_get_reply( bbp_get_reply_id( (int) $id ) );
|
| 1657 |
|
| 1658 |
if ( empty( $reply ) || !current_user_can( 'delete_reply', $reply->ID ) ) {
|
| 1659 |
return;
|
| 1660 |
}
|
| 1661 |
|
| 1662 |
if ( bbp_is_reply_trash( $reply->ID ) ) {
|
| 1663 |
-
$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'untrash', 'reply_id' => $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . '">' . esc_html( $restore_text ) . '</a>';
|
| 1664 |
} elseif ( EMPTY_TRASH_DAYS ) {
|
| 1665 |
-
$actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'trash', 'reply_id' => $reply->ID ) ), 'trash-' . $reply->post_type . '_' . $reply->ID ) ) . '">' . esc_html( $trash_text ) . '</a>';
|
| 1666 |
}
|
| 1667 |
|
| 1668 |
if ( bbp_is_reply_trash( $reply->ID ) || !EMPTY_TRASH_DAYS ) {
|
| 1669 |
-
$actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'delete', 'reply_id' => $reply->ID ) ), 'delete-' . $reply->post_type . '_' . $reply->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );">' . esc_html( $delete_text ) . '</a>';
|
| 1670 |
}
|
| 1671 |
|
| 1672 |
// Process the admin links
|
| 1673 |
-
$retval = $link_before . implode( $sep, $actions ) . $link_after;
|
| 1674 |
|
| 1675 |
-
return apply_filters( 'bbp_get_reply_trash_link', $retval, $
|
| 1676 |
}
|
| 1677 |
|
| 1678 |
/**
|
|
@@ -1712,33 +1756,100 @@ function bbp_reply_spam_link( $args = '' ) {
|
|
| 1712 |
* @return string Reply spam link
|
| 1713 |
*/
|
| 1714 |
function bbp_get_reply_spam_link( $args = '' ) {
|
| 1715 |
-
|
|
|
|
|
|
|
| 1716 |
'id' => 0,
|
| 1717 |
'link_before' => '',
|
| 1718 |
'link_after' => '',
|
| 1719 |
'spam_text' => __( 'Spam', 'bbpress' ),
|
| 1720 |
'unspam_text' => __( 'Unspam', 'bbpress' )
|
| 1721 |
-
);
|
| 1722 |
-
$r = bbp_parse_args( $args, $defaults, 'get_reply_spam_link' );
|
| 1723 |
-
extract( $r );
|
| 1724 |
|
| 1725 |
-
$reply = bbp_get_reply( bbp_get_reply_id( (int) $id ) );
|
| 1726 |
|
| 1727 |
if ( empty( $reply ) || !current_user_can( 'moderate', $reply->ID ) )
|
| 1728 |
return;
|
| 1729 |
|
| 1730 |
-
$display = bbp_is_reply_spam( $reply->ID ) ? $unspam_text : $spam_text;
|
| 1731 |
$uri = add_query_arg( array( 'action' => 'bbp_toggle_reply_spam', 'reply_id' => $reply->ID ) );
|
| 1732 |
$uri = esc_url( wp_nonce_url( $uri, 'spam-reply_' . $reply->ID ) );
|
| 1733 |
-
$retval = $link_before . '<a href="' . $uri . '">' . $display . '</a>' . $link_after;
|
| 1734 |
|
| 1735 |
-
return apply_filters( 'bbp_get_reply_spam_link', $retval, $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1736 |
}
|
| 1737 |
|
| 1738 |
/**
|
| 1739 |
* Split topic link
|
| 1740 |
*
|
| 1741 |
-
* Output the split link of the topic (but is bundled with each
|
| 1742 |
*
|
| 1743 |
* @since bbPress (r2756)
|
| 1744 |
*
|
|
@@ -1773,20 +1884,20 @@ function bbp_topic_split_link( $args = '' ) {
|
|
| 1773 |
* @uses esc_url() To escape the url
|
| 1774 |
* @uses apply_filters() Calls 'bbp_get_topic_split_link' with the topic
|
| 1775 |
* split link and args
|
| 1776 |
-
* @return string
|
| 1777 |
*/
|
| 1778 |
function bbp_get_topic_split_link( $args = '' ) {
|
| 1779 |
-
|
|
|
|
|
|
|
| 1780 |
'id' => 0,
|
| 1781 |
'link_before' => '',
|
| 1782 |
'link_after' => '',
|
| 1783 |
'split_text' => __( 'Split', 'bbpress' ),
|
| 1784 |
'split_title' => __( 'Split the topic from this reply', 'bbpress' )
|
| 1785 |
-
);
|
| 1786 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_split_link' );
|
| 1787 |
-
extract( $r );
|
| 1788 |
|
| 1789 |
-
$reply_id = bbp_get_reply_id( $id );
|
| 1790 |
$topic_id = bbp_get_reply_topic_id( $reply_id );
|
| 1791 |
|
| 1792 |
if ( empty( $reply_id ) || !current_user_can( 'moderate', $topic_id ) )
|
|
@@ -1801,9 +1912,9 @@ function bbp_topic_split_link( $args = '' ) {
|
|
| 1801 |
bbp_get_topic_edit_url( $topic_id )
|
| 1802 |
) );
|
| 1803 |
|
| 1804 |
-
$retval = $link_before . '<a href="' . $uri . '" title="' . esc_attr( $split_title ) . '">' . $split_text . '</a>' . $link_after;
|
| 1805 |
|
| 1806 |
-
return apply_filters( 'bbp_get_topic_split_link', $retval, $
|
| 1807 |
}
|
| 1808 |
|
| 1809 |
/**
|
|
@@ -1964,16 +2075,17 @@ function bbp_form_reply_content() {
|
|
| 1964 |
function bbp_get_form_reply_content() {
|
| 1965 |
|
| 1966 |
// Get _POST data
|
| 1967 |
-
if ( 'POST' == strtoupper( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_reply_content'] ) )
|
| 1968 |
$reply_content = $_POST['bbp_reply_content'];
|
| 1969 |
|
| 1970 |
// Get edit data
|
| 1971 |
-
elseif ( bbp_is_reply_edit() )
|
| 1972 |
$reply_content = bbp_get_global_post_field( 'post_content', 'raw' );
|
| 1973 |
|
| 1974 |
// No data
|
| 1975 |
-
else
|
| 1976 |
$reply_content = '';
|
|
|
|
| 1977 |
|
| 1978 |
return apply_filters( 'bbp_get_form_reply_content', esc_textarea( $reply_content ) );
|
| 1979 |
}
|
|
@@ -2000,12 +2112,13 @@ function bbp_form_reply_log_edit() {
|
|
| 2000 |
function bbp_get_form_reply_log_edit() {
|
| 2001 |
|
| 2002 |
// Get _POST data
|
| 2003 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_log_reply_edit'] ) )
|
| 2004 |
$reply_revision = $_POST['bbp_log_reply_edit'];
|
| 2005 |
|
| 2006 |
// No data
|
| 2007 |
-
else
|
| 2008 |
$reply_revision = 1;
|
|
|
|
| 2009 |
|
| 2010 |
return apply_filters( 'bbp_get_form_reply_log_edit', checked( $reply_revision, true, false ) );
|
| 2011 |
}
|
|
@@ -2032,12 +2145,13 @@ function bbp_form_reply_edit_reason() {
|
|
| 2032 |
function bbp_get_form_reply_edit_reason() {
|
| 2033 |
|
| 2034 |
// Get _POST data
|
| 2035 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_reply_edit_reason'] ) )
|
| 2036 |
$reply_edit_reason = $_POST['bbp_reply_edit_reason'];
|
| 2037 |
|
| 2038 |
// No data
|
| 2039 |
-
else
|
| 2040 |
$reply_edit_reason = '';
|
|
|
|
| 2041 |
|
| 2042 |
return apply_filters( 'bbp_get_form_reply_edit_reason', esc_attr( $reply_edit_reason ) );
|
| 2043 |
}
|
| 66 |
function bbp_has_replies( $args = '' ) {
|
| 67 |
global $wp_rewrite;
|
| 68 |
|
| 69 |
+
/** Defaults **************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
// Other defaults
|
| 72 |
$default_reply_search = !empty( $_REQUEST['rs'] ) ? $_REQUEST['rs'] : false;
|
| 73 |
$default_post_parent = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any';
|
| 74 |
$default_post_type = ( bbp_is_single_topic() && bbp_show_lead_topic() ) ? bbp_get_reply_post_type() : array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
|
|
|
|
| 75 |
|
| 76 |
// Default query args
|
| 77 |
$default = array(
|
| 78 |
'post_type' => $default_post_type, // Only replies
|
| 79 |
'post_parent' => $default_post_parent, // Of this topic
|
|
|
|
| 80 |
'posts_per_page' => bbp_get_replies_per_page(), // This many
|
| 81 |
'paged' => bbp_get_paged(), // On this page
|
| 82 |
'orderby' => 'date', // Sorted by date
|
| 84 |
's' => $default_reply_search, // Maybe search
|
| 85 |
);
|
| 86 |
|
| 87 |
+
// What are the default allowed statuses (based on user caps)
|
| 88 |
+
if ( bbp_get_view_all() ) {
|
| 89 |
+
|
| 90 |
+
// Default view=all statuses
|
| 91 |
+
$post_statuses = array(
|
| 92 |
+
bbp_get_public_status_id(),
|
| 93 |
+
bbp_get_closed_status_id(),
|
| 94 |
+
bbp_get_spam_status_id(),
|
| 95 |
+
bbp_get_trash_status_id()
|
| 96 |
+
);
|
| 97 |
+
|
| 98 |
+
// Add support for private status
|
| 99 |
+
if ( current_user_can( 'read_private_replies' ) ) {
|
| 100 |
+
$post_statuses[] = bbp_get_private_status_id();
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
// Join post statuses together
|
| 104 |
+
$default['post_status'] = join( ',', $post_statuses );
|
| 105 |
+
|
| 106 |
+
// Lean on the 'perm' query var value of 'readable' to provide statuses
|
| 107 |
+
} else {
|
| 108 |
+
$default['perm'] = 'readable';
|
| 109 |
+
}
|
| 110 |
|
| 111 |
+
/** Setup *****************************************************************/
|
| 112 |
+
|
| 113 |
+
// Parse arguments against default values
|
| 114 |
+
$r = bbp_parse_args( $args, $default, 'has_replies' );
|
| 115 |
|
| 116 |
// Get bbPress
|
| 117 |
$bbp = bbpress();
|
| 118 |
|
| 119 |
// Call the query
|
| 120 |
+
$bbp->reply_query = new WP_Query( $r );
|
| 121 |
|
| 122 |
// Add pagination values to query object
|
| 123 |
+
$bbp->reply_query->posts_per_page = $r['posts_per_page'];
|
| 124 |
+
$bbp->reply_query->paged = $r['paged'];
|
| 125 |
|
| 126 |
// Never home, regardless of what parse_query says
|
| 127 |
$bbp->reply_query->is_home = false;
|
| 162 |
apply_filters( 'bbp_replies_pagination', array(
|
| 163 |
'base' => $base,
|
| 164 |
'format' => '',
|
| 165 |
+
'total' => ceil( (int) $bbp->reply_query->found_posts / (int) $r['posts_per_page'] ),
|
| 166 |
'current' => (int) $bbp->reply_query->paged,
|
| 167 |
+
'prev_text' => is_rtl() ? '→' : '←',
|
| 168 |
+
'next_text' => is_rtl() ? '←' : '→',
|
| 169 |
'mid_size' => 1,
|
| 170 |
'add_args' => ( bbp_get_view_all() ) ? array( 'view' => 'all' ) : false
|
| 171 |
) )
|
| 234 |
*
|
| 235 |
* @param $reply_id Optional. Used to check emptiness
|
| 236 |
* @uses bbPress::reply_query::post::ID To get the reply id
|
| 237 |
+
* @uses bbp_is_reply() To check if the search result is a reply
|
| 238 |
+
* @uses bbp_is_single_reply() To check if it's a reply page
|
| 239 |
* @uses bbp_is_reply_edit() To check if it's a reply edit page
|
| 240 |
* @uses get_post_field() To get the post's post type
|
| 241 |
* @uses WP_Query::post::ID To get the reply id
|
| 257 |
} elseif ( !empty( $bbp->reply_query->in_the_loop ) && isset( $bbp->reply_query->post->ID ) ) {
|
| 258 |
$bbp_reply_id = $bbp->reply_query->post->ID;
|
| 259 |
|
| 260 |
+
// Currently inside a search loop
|
| 261 |
+
} elseif ( !empty( $bbp->search_query->in_the_loop ) && isset( $bbp->search_query->post->ID ) && bbp_is_reply( $bbp->search_query->post->ID ) ) {
|
| 262 |
+
$bbp_reply_id = $bbp->search_query->post->ID;
|
| 263 |
+
|
| 264 |
// Currently viewing a forum
|
| 265 |
} elseif ( ( bbp_is_single_reply() || bbp_is_reply_edit() ) && !empty( $bbp->current_reply_id ) ) {
|
| 266 |
$bbp_reply_id = $bbp->current_reply_id;
|
| 547 |
* @param bool $gmt Optional. Use GMT
|
| 548 |
* @uses bbp_get_reply_id() To get the reply id
|
| 549 |
* @uses get_post_time() to get the reply post time
|
| 550 |
+
* @uses bbp_get_time_since() to maybe humanize the reply post time
|
| 551 |
* @return string
|
| 552 |
*/
|
| 553 |
function bbp_get_reply_post_date( $reply_id = 0, $humanize = false, $gmt = false ) {
|
| 555 |
|
| 556 |
// 4 days, 4 hours ago
|
| 557 |
if ( !empty( $humanize ) ) {
|
| 558 |
+
$gmt_s = !empty( $gmt ) ? 'G' : 'U';
|
| 559 |
+
$date = get_post_time( $gmt_s, $gmt, $reply_id );
|
| 560 |
$time = false; // For filter below
|
| 561 |
+
$result = bbp_get_time_since( $date );
|
| 562 |
|
| 563 |
// August 4, 2012 at 2:37 pm
|
| 564 |
} else {
|
| 860 |
function bbp_get_reply_author( $reply_id = 0 ) {
|
| 861 |
$reply_id = bbp_get_reply_id( $reply_id );
|
| 862 |
|
| 863 |
+
if ( !bbp_is_reply_anonymous( $reply_id ) ) {
|
| 864 |
$author = get_the_author_meta( 'display_name', bbp_get_reply_author_id( $reply_id ) );
|
| 865 |
+
} else {
|
| 866 |
$author = get_post_meta( $reply_id, '_bbp_anonymous_name', true );
|
| 867 |
+
}
|
| 868 |
|
| 869 |
return apply_filters( 'bbp_get_reply_author', $author, $reply_id );
|
| 870 |
}
|
| 952 |
if ( empty( $author_name ) )
|
| 953 |
$author_name = __( 'Anonymous', 'bbpress' );
|
| 954 |
|
| 955 |
+
// Encode possible UTF8 display names
|
| 956 |
+
if ( seems_utf8( $author_name ) === false )
|
| 957 |
+
$author_name = utf8_encode( $author_name );
|
| 958 |
+
|
| 959 |
+
return apply_filters( 'bbp_get_reply_author_display_name', $author_name, $reply_id );
|
| 960 |
}
|
| 961 |
|
| 962 |
/**
|
| 1036 |
* @return string Author link of reply
|
| 1037 |
*/
|
| 1038 |
function bbp_get_reply_author_link( $args = '' ) {
|
| 1039 |
+
|
| 1040 |
+
// Parse arguments against default values
|
| 1041 |
+
$r = bbp_parse_args( $args, array(
|
| 1042 |
'post_id' => 0,
|
| 1043 |
'link_title' => '',
|
| 1044 |
'type' => 'both',
|
| 1045 |
'size' => 80,
|
| 1046 |
'sep' => ' ',
|
| 1047 |
'show_role' => false
|
| 1048 |
+
), 'get_reply_author_link' );
|
|
|
|
|
|
|
| 1049 |
|
| 1050 |
// Used as reply_id
|
| 1051 |
+
if ( is_numeric( $args ) ) {
|
| 1052 |
$reply_id = bbp_get_reply_id( $args );
|
| 1053 |
+
} else {
|
| 1054 |
+
$reply_id = bbp_get_reply_id( $r['post_id'] );
|
| 1055 |
+
}
|
| 1056 |
|
| 1057 |
+
// Reply ID is good
|
| 1058 |
if ( !empty( $reply_id ) ) {
|
| 1059 |
+
|
| 1060 |
+
// Tweak link title if empty
|
| 1061 |
+
if ( empty( $$r['link_title'] ) ) {
|
| 1062 |
$link_title = sprintf( !bbp_is_reply_anonymous( $reply_id ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_reply_author_display_name( $reply_id ) );
|
| 1063 |
+
|
| 1064 |
+
// Use what was passed if not
|
| 1065 |
+
} else {
|
| 1066 |
+
$link_title = $r['link_title'];
|
| 1067 |
}
|
| 1068 |
|
| 1069 |
+
$link_title = !empty( $link_title ) ? ' title="' . $link_title . '"' : '';
|
| 1070 |
+
$author_url = bbp_get_reply_author_url( $reply_id );
|
| 1071 |
+
$anonymous = bbp_is_reply_anonymous( $reply_id );
|
| 1072 |
+
$author_links = array();
|
| 1073 |
|
| 1074 |
// Get avatar
|
| 1075 |
+
if ( 'avatar' == $r['type'] || 'both' == $r['type'] ) {
|
| 1076 |
+
$author_links['avatar'] = bbp_get_reply_author_avatar( $reply_id, $r['size'] );
|
| 1077 |
}
|
| 1078 |
|
| 1079 |
// Get display name
|
| 1080 |
+
if ( 'name' == $r['type'] || 'both' == $r['type'] ) {
|
| 1081 |
$author_links['name'] = bbp_get_reply_author_display_name( $reply_id );
|
| 1082 |
}
|
| 1083 |
|
| 1084 |
+
// Link class
|
| 1085 |
+
$link_class = ' class="bbp-author-' . $r['type'] . '"';
|
| 1086 |
+
|
| 1087 |
// Add links if not anonymous
|
| 1088 |
if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
|
| 1089 |
+
|
| 1090 |
+
// Assemble the links
|
| 1091 |
foreach ( $author_links as $link => $link_text ) {
|
| 1092 |
$link_class = ' class="bbp-author-' . $link . '"';
|
| 1093 |
$author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', $author_url, $link_title, $link_class, $link_text );
|
| 1094 |
}
|
| 1095 |
|
| 1096 |
+
if ( true === $r['show_role'] ) {
|
| 1097 |
$author_link[] = bbp_get_reply_author_role( array( 'reply_id' => $reply_id ) );
|
| 1098 |
}
|
| 1099 |
|
| 1100 |
+
$author_link = join( $r['sep'], $author_link );
|
| 1101 |
|
| 1102 |
// No links if anonymous
|
| 1103 |
} else {
|
| 1104 |
+
$author_link = join( $r['sep'], $author_links );
|
| 1105 |
}
|
| 1106 |
|
| 1107 |
// No replies so link is empty
|
| 1109 |
$author_link = '';
|
| 1110 |
}
|
| 1111 |
|
| 1112 |
+
return apply_filters( 'bbp_get_reply_author_link', $author_link, $r );
|
| 1113 |
}
|
| 1114 |
|
| 1115 |
/**
|
| 1233 |
* @return string Reply author role
|
| 1234 |
*/
|
| 1235 |
function bbp_get_reply_author_role( $args = array() ) {
|
| 1236 |
+
|
| 1237 |
+
// Parse arguments against default values
|
| 1238 |
+
$r = bbp_parse_args( $args, array(
|
| 1239 |
'reply_id' => 0,
|
| 1240 |
'class' => 'bbp-author-role',
|
| 1241 |
'before' => '',
|
| 1242 |
'after' => ''
|
| 1243 |
+
), 'get_reply_author_role' );
|
|
|
|
|
|
|
| 1244 |
|
| 1245 |
+
$reply_id = bbp_get_reply_id( $r['reply_id'] );
|
| 1246 |
$role = bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) );
|
| 1247 |
+
$author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $r['before'], $r['class'], $role, $r['after'] );
|
| 1248 |
|
| 1249 |
return apply_filters( 'bbp_get_reply_author_role', $author_role, $args );
|
| 1250 |
}
|
| 1449 |
* - after: HTML after the links. Defaults to '</span>'
|
| 1450 |
* - sep: Separator. Defaults to ' | '
|
| 1451 |
* - links: Array of the links to display. By default, edit, trash,
|
| 1452 |
+
* spam, reply move, and topic split links are displayed
|
| 1453 |
* @uses bbp_is_topic() To check if it's the topic page
|
| 1454 |
* @uses bbp_is_reply() To check if it's the reply page
|
| 1455 |
* @uses bbp_get_reply_id() To get the reply id
|
| 1456 |
* @uses bbp_get_reply_edit_link() To get the reply edit link
|
| 1457 |
* @uses bbp_get_reply_trash_link() To get the reply trash link
|
| 1458 |
* @uses bbp_get_reply_spam_link() To get the reply spam link
|
| 1459 |
+
* @uses bbp_get_reply_move_link() To get the reply move link
|
| 1460 |
* @uses bbp_get_topic_split_link() To get the topic split link
|
| 1461 |
* @uses current_user_can() To check if the current user can edit or
|
| 1462 |
* delete the reply
|
| 1466 |
*/
|
| 1467 |
function bbp_get_reply_admin_links( $args = '' ) {
|
| 1468 |
|
| 1469 |
+
// Parse arguments against default values
|
| 1470 |
+
$r = bbp_parse_args( $args, array(
|
| 1471 |
'id' => 0,
|
| 1472 |
'before' => '<span class="bbp-admin-links">',
|
| 1473 |
'after' => '</span>',
|
| 1474 |
'sep' => ' | ',
|
| 1475 |
'links' => array()
|
| 1476 |
+
), 'get_reply_admin_links' );
|
|
|
|
| 1477 |
|
| 1478 |
$r['id'] = bbp_get_reply_id( (int) $r['id'] );
|
| 1479 |
|
| 1495 |
|
| 1496 |
// If no links were passed, default to the standard
|
| 1497 |
if ( empty( $r['links'] ) ) {
|
| 1498 |
+
$r['links'] = apply_filters( 'bbp_reply_admin_links', array(
|
| 1499 |
'edit' => bbp_get_reply_edit_link ( $r ),
|
| 1500 |
+
'move' => bbp_get_reply_move_link ( $r ),
|
| 1501 |
'split' => bbp_get_topic_split_link( $r ),
|
| 1502 |
'trash' => bbp_get_reply_trash_link( $r ),
|
| 1503 |
'spam' => bbp_get_reply_spam_link ( $r ),
|
| 1504 |
+
), $r['id'] );
|
| 1505 |
}
|
| 1506 |
|
| 1507 |
// Check caps for trashing the topic
|
| 1513 |
if ( in_array( $reply_status, array( bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ) ) {
|
| 1514 |
|
| 1515 |
// Spam link shouldn't be visible on trashed topics
|
| 1516 |
+
if ( bbp_get_trash_status_id() == $reply_status ) {
|
| 1517 |
unset( $r['links']['spam'] );
|
| 1518 |
|
| 1519 |
// Trash link shouldn't be visible on spam topics
|
| 1526 |
$links = implode( $r['sep'], array_filter( $r['links'] ) );
|
| 1527 |
$retval = $r['before'] . $links . $r['after'];
|
| 1528 |
|
| 1529 |
+
return apply_filters( 'bbp_get_reply_admin_links', $retval, $r );
|
| 1530 |
}
|
| 1531 |
|
| 1532 |
/**
|
| 1561 |
* @return string Reply edit link
|
| 1562 |
*/
|
| 1563 |
function bbp_get_reply_edit_link( $args = '' ) {
|
| 1564 |
+
|
| 1565 |
+
// Parse arguments against default values
|
| 1566 |
+
$r = bbp_parse_args( $args, array(
|
| 1567 |
'id' => 0,
|
| 1568 |
'link_before' => '',
|
| 1569 |
'link_after' => '',
|
| 1570 |
'edit_text' => __( 'Edit', 'bbpress' )
|
| 1571 |
+
), 'get_reply_edit_link' );
|
|
|
|
|
|
|
| 1572 |
|
| 1573 |
+
$reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
|
| 1574 |
|
| 1575 |
// Bypass check if user has caps
|
| 1576 |
if ( !current_user_can( 'edit_others_replies' ) ) {
|
| 1577 |
|
| 1578 |
// User cannot edit or it is past the lock time
|
| 1579 |
+
if ( empty( $reply ) || !current_user_can( 'edit_reply', $reply->ID ) || bbp_past_edit_lock( $reply->post_date_gmt ) ) {
|
| 1580 |
return;
|
| 1581 |
+
}
|
| 1582 |
}
|
| 1583 |
|
| 1584 |
// Get uri
|
| 1585 |
+
$uri = bbp_get_reply_edit_url( $r['id'] );
|
| 1586 |
|
| 1587 |
// Bail if no uri
|
| 1588 |
if ( empty( $uri ) )
|
| 1589 |
return;
|
| 1590 |
|
| 1591 |
+
$retval = $r['link_before'] . '<a href="' . $uri . '">' . $r['edit_text'] . '</a>' . $r['link_after'];
|
| 1592 |
|
| 1593 |
+
return apply_filters( 'bbp_get_reply_edit_link', $retval, $r );
|
| 1594 |
}
|
| 1595 |
|
| 1596 |
/**
|
| 1684 |
* @return string Reply trash link
|
| 1685 |
*/
|
| 1686 |
function bbp_get_reply_trash_link( $args = '' ) {
|
| 1687 |
+
|
| 1688 |
+
// Parse arguments against default values
|
| 1689 |
+
$r = bbp_parse_args( $args, array(
|
| 1690 |
'id' => 0,
|
| 1691 |
'link_before' => '',
|
| 1692 |
'link_after' => '',
|
| 1694 |
'trash_text' => __( 'Trash', 'bbpress' ),
|
| 1695 |
'restore_text' => __( 'Restore', 'bbpress' ),
|
| 1696 |
'delete_text' => __( 'Delete', 'bbpress' )
|
| 1697 |
+
), 'get_reply_trash_link' );
|
|
|
|
|
|
|
| 1698 |
|
| 1699 |
$actions = array();
|
| 1700 |
+
$reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
|
| 1701 |
|
| 1702 |
if ( empty( $reply ) || !current_user_can( 'delete_reply', $reply->ID ) ) {
|
| 1703 |
return;
|
| 1704 |
}
|
| 1705 |
|
| 1706 |
if ( bbp_is_reply_trash( $reply->ID ) ) {
|
| 1707 |
+
$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'untrash', 'reply_id' => $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . '">' . esc_html( $r['restore_text'] ) . '</a>';
|
| 1708 |
} elseif ( EMPTY_TRASH_DAYS ) {
|
| 1709 |
+
$actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'trash', 'reply_id' => $reply->ID ) ), 'trash-' . $reply->post_type . '_' . $reply->ID ) ) . '">' . esc_html( $r['trash_text'] ) . '</a>';
|
| 1710 |
}
|
| 1711 |
|
| 1712 |
if ( bbp_is_reply_trash( $reply->ID ) || !EMPTY_TRASH_DAYS ) {
|
| 1713 |
+
$actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'delete', 'reply_id' => $reply->ID ) ), 'delete-' . $reply->post_type . '_' . $reply->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );">' . esc_html( $r['delete_text'] ) . '</a>';
|
| 1714 |
}
|
| 1715 |
|
| 1716 |
// Process the admin links
|
| 1717 |
+
$retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after'];
|
| 1718 |
|
| 1719 |
+
return apply_filters( 'bbp_get_reply_trash_link', $retval, $r );
|
| 1720 |
}
|
| 1721 |
|
| 1722 |
/**
|
| 1756 |
* @return string Reply spam link
|
| 1757 |
*/
|
| 1758 |
function bbp_get_reply_spam_link( $args = '' ) {
|
| 1759 |
+
|
| 1760 |
+
// Parse arguments against default values
|
| 1761 |
+
$r = bbp_parse_args( $args, array(
|
| 1762 |
'id' => 0,
|
| 1763 |
'link_before' => '',
|
| 1764 |
'link_after' => '',
|
| 1765 |
'spam_text' => __( 'Spam', 'bbpress' ),
|
| 1766 |
'unspam_text' => __( 'Unspam', 'bbpress' )
|
| 1767 |
+
), 'get_reply_spam_link' );
|
|
|
|
|
|
|
| 1768 |
|
| 1769 |
+
$reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
|
| 1770 |
|
| 1771 |
if ( empty( $reply ) || !current_user_can( 'moderate', $reply->ID ) )
|
| 1772 |
return;
|
| 1773 |
|
| 1774 |
+
$display = bbp_is_reply_spam( $reply->ID ) ? $r['unspam_text'] : $r['spam_text'];
|
| 1775 |
$uri = add_query_arg( array( 'action' => 'bbp_toggle_reply_spam', 'reply_id' => $reply->ID ) );
|
| 1776 |
$uri = esc_url( wp_nonce_url( $uri, 'spam-reply_' . $reply->ID ) );
|
| 1777 |
+
$retval = $r['link_before'] . '<a href="' . $uri . '">' . $display . '</a>' . $r['link_after'];
|
| 1778 |
|
| 1779 |
+
return apply_filters( 'bbp_get_reply_spam_link', $retval, $r );
|
| 1780 |
+
}
|
| 1781 |
+
|
| 1782 |
+
/**
|
| 1783 |
+
* Move reply link
|
| 1784 |
+
*
|
| 1785 |
+
* Output the move link of the reply
|
| 1786 |
+
*
|
| 1787 |
+
* @since bbPress (r4521)
|
| 1788 |
+
*
|
| 1789 |
+
* @param mixed $args See {@link bbp_get_reply_move_link()}
|
| 1790 |
+
* @uses bbp_get_reply_move_link() To get the reply move link
|
| 1791 |
+
*/
|
| 1792 |
+
function bbp_reply_move_link( $args = '' ) {
|
| 1793 |
+
echo bbp_get_reply_move_link( $args );
|
| 1794 |
+
}
|
| 1795 |
+
|
| 1796 |
+
/**
|
| 1797 |
+
* Get move reply link
|
| 1798 |
+
*
|
| 1799 |
+
* Return the move link of the reply
|
| 1800 |
+
*
|
| 1801 |
+
* @since bbPress (r4521)
|
| 1802 |
+
*
|
| 1803 |
+
* @param mixed $args This function supports these arguments:
|
| 1804 |
+
* - id: Reply id
|
| 1805 |
+
* - link_before: HTML before the link
|
| 1806 |
+
* - link_after: HTML after the link
|
| 1807 |
+
* - move_text: Move text
|
| 1808 |
+
* - move_title: Move title attribute
|
| 1809 |
+
* @uses bbp_get_reply_id() To get the reply id
|
| 1810 |
+
* @uses bbp_get_reply() To get the reply
|
| 1811 |
+
* @uses current_user_can() To check if the current user can edit the
|
| 1812 |
+
* topic
|
| 1813 |
+
* @uses bbp_get_reply_topic_id() To get the reply topic id
|
| 1814 |
+
* @uses bbp_get_reply_edit_url() To get the reply edit url
|
| 1815 |
+
* @uses add_query_arg() To add custom args to the url
|
| 1816 |
+
* @uses wp_nonce_url() To nonce the url
|
| 1817 |
+
* @uses esc_url() To escape the url
|
| 1818 |
+
* @uses apply_filters() Calls 'bbp_get_reply_move_link' with the reply
|
| 1819 |
+
* move link and args
|
| 1820 |
+
* @return string Reply move link
|
| 1821 |
+
*/
|
| 1822 |
+
function bbp_get_reply_move_link( $args = '' ) {
|
| 1823 |
+
|
| 1824 |
+
// Parse arguments against default values
|
| 1825 |
+
$r = bbp_parse_args( $args, array(
|
| 1826 |
+
'id' => 0,
|
| 1827 |
+
'link_before' => '',
|
| 1828 |
+
'link_after' => '',
|
| 1829 |
+
'split_text' => __( 'Move', 'bbpress' ),
|
| 1830 |
+
'split_title' => __( 'Move this reply', 'bbpress' )
|
| 1831 |
+
), 'get_reply_move_link' );
|
| 1832 |
+
|
| 1833 |
+
$reply_id = bbp_get_reply_id( $r['id'] );
|
| 1834 |
+
$topic_id = bbp_get_reply_topic_id( $reply_id );
|
| 1835 |
+
|
| 1836 |
+
if ( empty( $reply_id ) || !current_user_can( 'moderate', $topic_id ) )
|
| 1837 |
+
return;
|
| 1838 |
+
|
| 1839 |
+
$uri = esc_url( add_query_arg( array(
|
| 1840 |
+
'action' => 'move',
|
| 1841 |
+
'reply_id' => $reply_id
|
| 1842 |
+
), bbp_get_reply_edit_url( $reply_id ) ) );
|
| 1843 |
+
|
| 1844 |
+
$retval = $r['link_before'] . '<a href="' . $uri . '" title="' . esc_attr( $r['split_title'] ) . '">' . esc_html( $r['split_text'] ) . '</a>' . $r['link_after'];
|
| 1845 |
+
|
| 1846 |
+
return apply_filters( 'bbp_get_reply_move_link', $retval, $r );
|
| 1847 |
}
|
| 1848 |
|
| 1849 |
/**
|
| 1850 |
* Split topic link
|
| 1851 |
*
|
| 1852 |
+
* Output the split link of the topic (but is bundled with each reply)
|
| 1853 |
*
|
| 1854 |
* @since bbPress (r2756)
|
| 1855 |
*
|
| 1884 |
* @uses esc_url() To escape the url
|
| 1885 |
* @uses apply_filters() Calls 'bbp_get_topic_split_link' with the topic
|
| 1886 |
* split link and args
|
| 1887 |
+
* @return string Topic split link
|
| 1888 |
*/
|
| 1889 |
function bbp_get_topic_split_link( $args = '' ) {
|
| 1890 |
+
|
| 1891 |
+
// Parse arguments against default values
|
| 1892 |
+
$r = bbp_parse_args( $args, array(
|
| 1893 |
'id' => 0,
|
| 1894 |
'link_before' => '',
|
| 1895 |
'link_after' => '',
|
| 1896 |
'split_text' => __( 'Split', 'bbpress' ),
|
| 1897 |
'split_title' => __( 'Split the topic from this reply', 'bbpress' )
|
| 1898 |
+
), 'get_topic_split_link' );
|
|
|
|
|
|
|
| 1899 |
|
| 1900 |
+
$reply_id = bbp_get_reply_id( $r['id'] );
|
| 1901 |
$topic_id = bbp_get_reply_topic_id( $reply_id );
|
| 1902 |
|
| 1903 |
if ( empty( $reply_id ) || !current_user_can( 'moderate', $topic_id ) )
|
| 1912 |
bbp_get_topic_edit_url( $topic_id )
|
| 1913 |
) );
|
| 1914 |
|
| 1915 |
+
$retval = $r['link_before'] . '<a href="' . $uri . '" title="' . esc_attr( $r['split_title'] ) . '">' . esc_html( $r['split_text'] ) . '</a>' . $r['link_after'];
|
| 1916 |
|
| 1917 |
+
return apply_filters( 'bbp_get_topic_split_link', $retval, $r );
|
| 1918 |
}
|
| 1919 |
|
| 1920 |
/**
|
| 2075 |
function bbp_get_form_reply_content() {
|
| 2076 |
|
| 2077 |
// Get _POST data
|
| 2078 |
+
if ( 'POST' == strtoupper( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_reply_content'] ) ) {
|
| 2079 |
$reply_content = $_POST['bbp_reply_content'];
|
| 2080 |
|
| 2081 |
// Get edit data
|
| 2082 |
+
} elseif ( bbp_is_reply_edit() ) {
|
| 2083 |
$reply_content = bbp_get_global_post_field( 'post_content', 'raw' );
|
| 2084 |
|
| 2085 |
// No data
|
| 2086 |
+
} else {
|
| 2087 |
$reply_content = '';
|
| 2088 |
+
}
|
| 2089 |
|
| 2090 |
return apply_filters( 'bbp_get_form_reply_content', esc_textarea( $reply_content ) );
|
| 2091 |
}
|
| 2112 |
function bbp_get_form_reply_log_edit() {
|
| 2113 |
|
| 2114 |
// Get _POST data
|
| 2115 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_log_reply_edit'] ) ) {
|
| 2116 |
$reply_revision = $_POST['bbp_log_reply_edit'];
|
| 2117 |
|
| 2118 |
// No data
|
| 2119 |
+
} else {
|
| 2120 |
$reply_revision = 1;
|
| 2121 |
+
}
|
| 2122 |
|
| 2123 |
return apply_filters( 'bbp_get_form_reply_log_edit', checked( $reply_revision, true, false ) );
|
| 2124 |
}
|
| 2145 |
function bbp_get_form_reply_edit_reason() {
|
| 2146 |
|
| 2147 |
// Get _POST data
|
| 2148 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_reply_edit_reason'] ) ) {
|
| 2149 |
$reply_edit_reason = $_POST['bbp_reply_edit_reason'];
|
| 2150 |
|
| 2151 |
// No data
|
| 2152 |
+
} else {
|
| 2153 |
$reply_edit_reason = '';
|
| 2154 |
+
}
|
| 2155 |
|
| 2156 |
return apply_filters( 'bbp_get_form_reply_edit_reason', esc_attr( $reply_edit_reason ) );
|
| 2157 |
}
|
includes/search/functions.php
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* bbPress Search Functions
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Functions
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
// Exit if accessed directly
|
| 11 |
+
if ( !defined( 'ABSPATH' ) ) exit;
|
| 12 |
+
|
| 13 |
+
/** Query *********************************************************************/
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* Run the search query
|
| 17 |
+
*
|
| 18 |
+
* @since bbPress (r4579)
|
| 19 |
+
*
|
| 20 |
+
* @param mixed $new_args New arguments
|
| 21 |
+
* @uses bbp_get_search_query_args() To get the search query args
|
| 22 |
+
* @uses bbp_parse_args() To parse the args
|
| 23 |
+
* @uses bbp_has_search_results() To make the search query
|
| 24 |
+
* @return bool False if no results, otherwise if search results are there
|
| 25 |
+
*/
|
| 26 |
+
function bbp_search_query( $new_args = '' ) {
|
| 27 |
+
|
| 28 |
+
// Existing arguments
|
| 29 |
+
$query_args = bbp_get_search_query_args();
|
| 30 |
+
|
| 31 |
+
// Merge arguments
|
| 32 |
+
if ( !empty( $new_args ) ) {
|
| 33 |
+
$new_args = bbp_parse_args( $new_args, '', 'search_query' );
|
| 34 |
+
$query_args = array_merge( $query_args, $new_args );
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
return bbp_has_search_results( $query_args );
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* Return the search's query args
|
| 42 |
+
*
|
| 43 |
+
* @since bbPress (r4579)
|
| 44 |
+
*
|
| 45 |
+
* @uses bbp_get_search_terms() To get the search terms
|
| 46 |
+
* @return array Query arguments
|
| 47 |
+
*/
|
| 48 |
+
function bbp_get_search_query_args() {
|
| 49 |
+
|
| 50 |
+
// Get search terms
|
| 51 |
+
$search_terms = bbp_get_search_terms();
|
| 52 |
+
$retval = !empty( $search_terms ) ? array( 's' => $search_terms ) : array();
|
| 53 |
+
|
| 54 |
+
return apply_filters( 'bbp_get_search_query_args', $retval );
|
| 55 |
+
}
|
includes/search/index.php
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Do not modify the files in this folder.
|
| 5 |
+
*/
|
includes/search/template-tags.php
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* bbPress Search Template Tags
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage TemplateTags
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
// Exit if accessed directly
|
| 11 |
+
if ( !defined( 'ABSPATH' ) ) exit;
|
| 12 |
+
|
| 13 |
+
/** Search Loop Functions *****************************************************/
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* The main search loop. WordPress does the heavy lifting.
|
| 17 |
+
*
|
| 18 |
+
* @since bbPress (r4579)
|
| 19 |
+
*
|
| 20 |
+
* @param mixed $args All the arguments supported by {@link WP_Query}
|
| 21 |
+
* @uses bbp_get_view_all() Are we showing all results?
|
| 22 |
+
* @uses bbp_get_public_status_id() To get the public status id
|
| 23 |
+
* @uses bbp_get_closed_status_id() To get the closed status id
|
| 24 |
+
* @uses bbp_get_spam_status_id() To get the spam status id
|
| 25 |
+
* @uses bbp_get_trash_status_id() To get the trash status id
|
| 26 |
+
* @uses bbp_get_forum_post_type() To get the forum post type
|
| 27 |
+
* @uses bbp_get_topic_post_type() To get the topic post type
|
| 28 |
+
* @uses bbp_get_reply_post_type() To get the reply post type
|
| 29 |
+
* @uses bbp_get_replies_per_page() To get the replies per page option
|
| 30 |
+
* @uses bbp_get_paged() To get the current page value
|
| 31 |
+
* @uses bbp_get_search_terms() To get the search terms
|
| 32 |
+
* @uses WP_Query To make query and get the search results
|
| 33 |
+
* @uses WP_Rewrite::using_permalinks() To check if the blog is using permalinks
|
| 34 |
+
* @uses bbp_get_search_url() To get the forum search url
|
| 35 |
+
* @uses paginate_links() To paginate search results
|
| 36 |
+
* @uses apply_filters() Calls 'bbp_has_search_results' with
|
| 37 |
+
* bbPress::search_query::have_posts()
|
| 38 |
+
* and bbPress::reply_query
|
| 39 |
+
* @return object Multidimensional array of search information
|
| 40 |
+
*/
|
| 41 |
+
function bbp_has_search_results( $args = '' ) {
|
| 42 |
+
global $wp_rewrite;
|
| 43 |
+
|
| 44 |
+
/** Defaults **************************************************************/
|
| 45 |
+
|
| 46 |
+
// What are the default allowed statuses (based on user caps)
|
| 47 |
+
if ( bbp_get_view_all( 'edit_others_replies' ) ) {
|
| 48 |
+
$post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() );
|
| 49 |
+
} else {
|
| 50 |
+
$post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() );
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
$default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() );
|
| 54 |
+
$default_post_status = join( ',', $post_statuses );
|
| 55 |
+
|
| 56 |
+
// Default query args
|
| 57 |
+
$default = array(
|
| 58 |
+
'post_type' => $default_post_type, // Forums, topics, and replies
|
| 59 |
+
'post_status' => $default_post_status, // Of this status
|
| 60 |
+
'posts_per_page' => bbp_get_replies_per_page(), // This many
|
| 61 |
+
'paged' => bbp_get_paged(), // On this page
|
| 62 |
+
'orderby' => 'date', // Sorted by date
|
| 63 |
+
'order' => 'DESC', // Most recent first
|
| 64 |
+
's' => bbp_get_search_terms(), // This is a search
|
| 65 |
+
);
|
| 66 |
+
|
| 67 |
+
/** Setup *****************************************************************/
|
| 68 |
+
|
| 69 |
+
// Parse arguments against default values
|
| 70 |
+
$r = bbp_parse_args( $args, $default, 'has_search_results' );
|
| 71 |
+
|
| 72 |
+
// Don't bother if we don't have search terms
|
| 73 |
+
if ( empty( $r['s'] ) )
|
| 74 |
+
return false;
|
| 75 |
+
|
| 76 |
+
// Get bbPress
|
| 77 |
+
$bbp = bbpress();
|
| 78 |
+
|
| 79 |
+
// Call the query
|
| 80 |
+
$bbp->search_query = new WP_Query( $r );
|
| 81 |
+
|
| 82 |
+
// Add pagination values to query object
|
| 83 |
+
$bbp->search_query->posts_per_page = $r['posts_per_page'];
|
| 84 |
+
$bbp->search_query->paged = $r['paged'];
|
| 85 |
+
|
| 86 |
+
// Never home, regardless of what parse_query says
|
| 87 |
+
$bbp->search_query->is_home = false;
|
| 88 |
+
|
| 89 |
+
// Found posts
|
| 90 |
+
if ( !$bbp->search_query->found_posts )
|
| 91 |
+
return false;
|
| 92 |
+
|
| 93 |
+
// Only add pagination is query returned results
|
| 94 |
+
if ( (int) $bbp->search_query->found_posts && (int) $bbp->search_query->posts_per_page ) {
|
| 95 |
+
|
| 96 |
+
// If pretty permalinks are enabled, make our pagination pretty
|
| 97 |
+
if ( $wp_rewrite->using_permalinks() ) {
|
| 98 |
+
|
| 99 |
+
// Shortcode territory
|
| 100 |
+
if ( is_page() || is_single() ) {
|
| 101 |
+
$base = trailingslashit( get_permalink() );
|
| 102 |
+
|
| 103 |
+
// Default search location
|
| 104 |
+
} else {
|
| 105 |
+
$base = trailingslashit( bbp_get_search_url() );
|
| 106 |
+
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
// Add pagination base
|
| 110 |
+
$base = $base . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
|
| 111 |
+
|
| 112 |
+
// Unpretty permalinks
|
| 113 |
+
} else {
|
| 114 |
+
$base = add_query_arg( 'paged', '%#%' );
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
// Add args
|
| 118 |
+
$add_args = isset( $_GET[bbp_get_search_rewrite_id()] ) ? array( bbp_get_search_rewrite_id() => urlencode( bbp_get_search_terms() ) ) : array();
|
| 119 |
+
if ( bbp_get_view_all() )
|
| 120 |
+
$add_args['view'] = 'all';
|
| 121 |
+
|
| 122 |
+
// Add pagination to query object
|
| 123 |
+
$bbp->search_query->pagination_links = paginate_links(
|
| 124 |
+
apply_filters( 'bbp_search_results_pagination', array(
|
| 125 |
+
'base' => $base,
|
| 126 |
+
'format' => '',
|
| 127 |
+
'total' => ceil( (int) $bbp->search_query->found_posts / (int) $r['posts_per_page'] ),
|
| 128 |
+
'current' => (int) $bbp->search_query->paged,
|
| 129 |
+
'prev_text' => is_rtl() ? '→' : '←',
|
| 130 |
+
'next_text' => is_rtl() ? '←' : '→',
|
| 131 |
+
'mid_size' => 1,
|
| 132 |
+
'add_args' => $add_args,
|
| 133 |
+
) )
|
| 134 |
+
);
|
| 135 |
+
|
| 136 |
+
// Remove first page from pagination
|
| 137 |
+
if ( $wp_rewrite->using_permalinks() ) {
|
| 138 |
+
$bbp->search_query->pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $bbp->search_query->pagination_links );
|
| 139 |
+
} else {
|
| 140 |
+
$bbp->search_query->pagination_links = str_replace( '&paged=1', '', $bbp->search_query->pagination_links );
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
// Return object
|
| 145 |
+
return apply_filters( 'bbp_has_search_results', $bbp->search_query->have_posts(), $bbp->search_query );
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
/**
|
| 149 |
+
* Whether there are more search results available in the loop
|
| 150 |
+
*
|
| 151 |
+
* @since bbPress (r4579)
|
| 152 |
+
*
|
| 153 |
+
* @uses WP_Query bbPress::search_query::have_posts() To check if there are more
|
| 154 |
+
* search results available
|
| 155 |
+
* @return object Search information
|
| 156 |
+
*/
|
| 157 |
+
function bbp_search_results() {
|
| 158 |
+
|
| 159 |
+
// Put into variable to check against next
|
| 160 |
+
$have_posts = bbpress()->search_query->have_posts();
|
| 161 |
+
|
| 162 |
+
// Reset the post data when finished
|
| 163 |
+
if ( empty( $have_posts ) )
|
| 164 |
+
wp_reset_postdata();
|
| 165 |
+
|
| 166 |
+
return $have_posts;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
/**
|
| 170 |
+
* Loads up the current search result in the loop
|
| 171 |
+
*
|
| 172 |
+
* @since bbPress (r4579)
|
| 173 |
+
*
|
| 174 |
+
* @uses WP_Query bbPress::search_query::the_post() To get the current search result
|
| 175 |
+
* @return object Search information
|
| 176 |
+
*/
|
| 177 |
+
function bbp_the_search_result() {
|
| 178 |
+
$search_result = bbpress()->search_query->the_post();
|
| 179 |
+
|
| 180 |
+
// Reset each current (forum|topic|reply) id
|
| 181 |
+
bbpress()->current_forum_id = bbp_get_forum_id();
|
| 182 |
+
bbpress()->current_topic_id = bbp_get_topic_id();
|
| 183 |
+
bbpress()->current_reply_id = bbp_get_reply_id();
|
| 184 |
+
|
| 185 |
+
return $search_result;
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
/**
|
| 189 |
+
* Output the search page title
|
| 190 |
+
*
|
| 191 |
+
* @since bbPress (r4579)
|
| 192 |
+
*
|
| 193 |
+
* @uses bbp_get_search_title()
|
| 194 |
+
*/
|
| 195 |
+
function bbp_search_title() {
|
| 196 |
+
echo bbp_get_search_title();
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
/**
|
| 200 |
+
* Get the search page title
|
| 201 |
+
*
|
| 202 |
+
* @since bbPress (r4579)
|
| 203 |
+
*
|
| 204 |
+
* @uses bbp_get_search_terms()
|
| 205 |
+
*/
|
| 206 |
+
function bbp_get_search_title() {
|
| 207 |
+
|
| 208 |
+
// Get search terms
|
| 209 |
+
$search_terms = bbp_get_search_terms();
|
| 210 |
+
|
| 211 |
+
// No search terms specified
|
| 212 |
+
if ( empty( $search_terms ) ) {
|
| 213 |
+
return __( 'Search', 'bbpress' );
|
| 214 |
+
|
| 215 |
+
// Include search terms in title
|
| 216 |
+
} else {
|
| 217 |
+
return sprintf( __( "Search Results for '%s'", 'bbpress' ), esc_attr( $search_terms ) );
|
| 218 |
+
}
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
/**
|
| 222 |
+
* Output the search url
|
| 223 |
+
*
|
| 224 |
+
* @since bbPress (r4579)
|
| 225 |
+
*
|
| 226 |
+
* @uses bbp_get_search_url() To get the search url
|
| 227 |
+
*/
|
| 228 |
+
function bbp_search_url() {
|
| 229 |
+
echo bbp_get_search_url();
|
| 230 |
+
}
|
| 231 |
+
/**
|
| 232 |
+
* Return the search url
|
| 233 |
+
*
|
| 234 |
+
* @since bbPress (r4579)
|
| 235 |
+
*
|
| 236 |
+
* @uses user_trailingslashit() To fix slashes
|
| 237 |
+
* @uses trailingslashit() To fix slashes
|
| 238 |
+
* @uses bbp_get_forums_url() To get the root forums url
|
| 239 |
+
* @uses bbp_get_search_slug() To get the search slug
|
| 240 |
+
* @uses add_query_arg() To help make unpretty permalinks
|
| 241 |
+
* @return string Search url
|
| 242 |
+
*/
|
| 243 |
+
function bbp_get_search_url() {
|
| 244 |
+
global $wp_rewrite;
|
| 245 |
+
|
| 246 |
+
// Pretty permalinks
|
| 247 |
+
if ( $wp_rewrite->using_permalinks() ) {
|
| 248 |
+
$url = $wp_rewrite->root . bbp_get_search_slug();
|
| 249 |
+
$url = home_url( user_trailingslashit( $url ) );
|
| 250 |
+
|
| 251 |
+
// Unpretty permalinks
|
| 252 |
+
} else {
|
| 253 |
+
$search_terms = bbp_get_search_terms();
|
| 254 |
+
$url = add_query_arg( array( 'bbp_search' => urlencode( $search_terms ) ), home_url( '/' ) );
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
return apply_filters( 'bbp_get_search_url', $url );
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
|
| 261 |
+
/**
|
| 262 |
+
* Output the search terms
|
| 263 |
+
*
|
| 264 |
+
* @since bbPress (r4579)
|
| 265 |
+
*
|
| 266 |
+
* @param string $search_terms Optional. Search terms
|
| 267 |
+
* @uses bbp_get_search_terms() To get the search terms
|
| 268 |
+
*/
|
| 269 |
+
function bbp_search_terms( $search_terms = '' ) {
|
| 270 |
+
echo bbp_get_search_terms( $search_terms );
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
/**
|
| 274 |
+
* Get the search terms
|
| 275 |
+
*
|
| 276 |
+
* @since bbPress (r4579)
|
| 277 |
+
*
|
| 278 |
+
* If search terms are supplied, those are used. Otherwise check the
|
| 279 |
+
* search rewrite id query var.
|
| 280 |
+
*
|
| 281 |
+
* @param string $search_terms Optional. Search terms
|
| 282 |
+
* @uses sanitize_title() To sanitize the search terms
|
| 283 |
+
* @uses get_query_var*( To get the search terms from query var 'bbp_search'
|
| 284 |
+
* @return bool|string Search terms on success, false on failure
|
| 285 |
+
*/
|
| 286 |
+
function bbp_get_search_terms( $search_terms = '' ) {
|
| 287 |
+
|
| 288 |
+
$search_terms = !empty( $search_terms ) ? sanitize_title( $search_terms ) : get_query_var( bbp_get_search_rewrite_id() );
|
| 289 |
+
|
| 290 |
+
if ( !empty( $search_terms ) )
|
| 291 |
+
return $search_terms;
|
| 292 |
+
|
| 293 |
+
return false;
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
/**
|
| 297 |
+
* Output the search result pagination count
|
| 298 |
+
*
|
| 299 |
+
* @since bbPress (r4579)
|
| 300 |
+
*
|
| 301 |
+
* @uses bbp_get_search_pagination_count() To get the search result pagination count
|
| 302 |
+
*/
|
| 303 |
+
function bbp_search_pagination_count() {
|
| 304 |
+
echo bbp_get_search_pagination_count();
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
/**
|
| 308 |
+
* Return the search results pagination count
|
| 309 |
+
*
|
| 310 |
+
* @since bbPress (r4579)
|
| 311 |
+
*
|
| 312 |
+
* @uses bbp_number_format() To format the number value
|
| 313 |
+
* @uses apply_filters() Calls 'bbp_get_search_pagination_count' with the
|
| 314 |
+
* pagination count
|
| 315 |
+
* @return string Search pagination count
|
| 316 |
+
*/
|
| 317 |
+
function bbp_get_search_pagination_count() {
|
| 318 |
+
$bbp = bbpress();
|
| 319 |
+
|
| 320 |
+
// Define local variable(s)
|
| 321 |
+
$retstr = '';
|
| 322 |
+
|
| 323 |
+
// Set pagination values
|
| 324 |
+
$start_num = intval( ( $bbp->search_query->paged - 1 ) * $bbp->search_query->posts_per_page ) + 1;
|
| 325 |
+
$from_num = bbp_number_format( $start_num );
|
| 326 |
+
$to_num = bbp_number_format( ( $start_num + ( $bbp->search_query->posts_per_page - 1 ) > $bbp->search_query->found_posts ) ? $bbp->search_query->found_posts : $start_num + ( $bbp->search_query->posts_per_page - 1 ) );
|
| 327 |
+
$total_int = (int) $bbp->search_query->found_posts;
|
| 328 |
+
$total = bbp_number_format( $total_int );
|
| 329 |
+
|
| 330 |
+
// Single page of results
|
| 331 |
+
if ( empty( $to_num ) ) {
|
| 332 |
+
$retstr = sprintf( _n( 'Viewing %1$s result', 'Viewing %1$s results', $total_int, 'bbpress' ), $total );
|
| 333 |
+
|
| 334 |
+
// Several pages of results
|
| 335 |
+
} else {
|
| 336 |
+
$retstr = sprintf( _n( 'Viewing %2$s results (of %4$s total)', 'Viewing %1$s results - %2$s through %3$s (of %4$s total)', $bbp->search_query->post_count, 'bbpress' ), $bbp->search_query->post_count, $from_num, $to_num, $total );
|
| 337 |
+
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
// Filter and return
|
| 341 |
+
return apply_filters( 'bbp_get_search_pagination_count', $retstr );
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
/**
|
| 345 |
+
* Output search pagination links
|
| 346 |
+
*
|
| 347 |
+
* @since bbPress (r4579)
|
| 348 |
+
*
|
| 349 |
+
* @uses bbp_get_search_pagination_links() To get the search pagination links
|
| 350 |
+
*/
|
| 351 |
+
function bbp_search_pagination_links() {
|
| 352 |
+
echo bbp_get_search_pagination_links();
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
/**
|
| 356 |
+
* Return search pagination links
|
| 357 |
+
*
|
| 358 |
+
* @since bbPress (r4579)
|
| 359 |
+
*
|
| 360 |
+
* @uses apply_filters() Calls 'bbp_get_search_pagination_links' with the
|
| 361 |
+
* pagination links
|
| 362 |
+
* @return string Search pagination links
|
| 363 |
+
*/
|
| 364 |
+
function bbp_get_search_pagination_links() {
|
| 365 |
+
$bbp = bbpress();
|
| 366 |
+
|
| 367 |
+
if ( !isset( $bbp->search_query->pagination_links ) || empty( $bbp->search_query->pagination_links ) )
|
| 368 |
+
return false;
|
| 369 |
+
|
| 370 |
+
return apply_filters( 'bbp_get_search_pagination_links', $bbp->search_query->pagination_links );
|
| 371 |
+
}
|
includes/topics/functions.php
CHANGED
|
@@ -28,8 +28,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
| 28 |
*/
|
| 29 |
function bbp_insert_topic( $topic_data = array(), $topic_meta = array() ) {
|
| 30 |
|
| 31 |
-
//
|
| 32 |
-
$
|
| 33 |
'post_parent' => 0, // forum ID
|
| 34 |
'post_status' => bbp_get_public_status_id(),
|
| 35 |
'post_type' => bbp_get_topic_post_type(),
|
|
@@ -39,10 +39,7 @@ function bbp_insert_topic( $topic_data = array(), $topic_meta = array() ) {
|
|
| 39 |
'post_title' => '',
|
| 40 |
'comment_status' => 'closed',
|
| 41 |
'menu_order' => 0,
|
| 42 |
-
);
|
| 43 |
-
|
| 44 |
-
// Parse args
|
| 45 |
-
$topic_data = bbp_parse_args( $topic_data, $default_topic, 'insert_topic' );
|
| 46 |
|
| 47 |
// Insert topic
|
| 48 |
$topic_id = wp_insert_post( $topic_data );
|
|
@@ -51,8 +48,8 @@ function bbp_insert_topic( $topic_data = array(), $topic_meta = array() ) {
|
|
| 51 |
if ( empty( $topic_id ) )
|
| 52 |
return false;
|
| 53 |
|
| 54 |
-
//
|
| 55 |
-
$
|
| 56 |
'author_ip' => bbp_current_author_ip(),
|
| 57 |
'forum_id' => 0,
|
| 58 |
'topic_id' => $topic_id,
|
|
@@ -62,10 +59,7 @@ function bbp_insert_topic( $topic_data = array(), $topic_meta = array() ) {
|
|
| 62 |
'last_reply_id' => 0,
|
| 63 |
'last_active_id' => $topic_id,
|
| 64 |
'last_active_time' => get_post_field( 'post_date', $topic_id, 'db' ),
|
| 65 |
-
);
|
| 66 |
-
|
| 67 |
-
// Parse args
|
| 68 |
-
$topic_meta = bbp_parse_args( $topic_meta, $default_meta, 'insert_topic_meta' );
|
| 69 |
|
| 70 |
// Insert topic meta
|
| 71 |
foreach ( $topic_meta as $meta_key => $meta_value )
|
|
@@ -85,6 +79,7 @@ function bbp_insert_topic( $topic_data = array(), $topic_meta = array() ) {
|
|
| 85 |
/**
|
| 86 |
* Handles the front end topic submission
|
| 87 |
*
|
|
|
|
| 88 |
* @uses bbPress:errors::add() To log various error messages
|
| 89 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the referer
|
| 90 |
* @uses bbp_is_anonymous() To check if an anonymous post is being made
|
|
@@ -114,14 +109,10 @@ function bbp_insert_topic( $topic_data = array(), $topic_meta = array() ) {
|
|
| 114 |
* @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error
|
| 115 |
* messages
|
| 116 |
*/
|
| 117 |
-
function bbp_new_topic_handler() {
|
| 118 |
-
|
| 119 |
-
// Bail if not a POST action
|
| 120 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 121 |
-
return;
|
| 122 |
|
| 123 |
// Bail if action is not bbp-new-topic
|
| 124 |
-
if (
|
| 125 |
return;
|
| 126 |
|
| 127 |
// Nonce check
|
|
@@ -352,7 +343,7 @@ function bbp_new_topic_handler() {
|
|
| 352 |
/** Redirect **********************************************************/
|
| 353 |
|
| 354 |
// Redirect to
|
| 355 |
-
$redirect_to =
|
| 356 |
|
| 357 |
// Get the topic URL
|
| 358 |
$redirect_url = bbp_get_topic_permalink( $topic_id, $redirect_to );
|
|
@@ -391,6 +382,7 @@ function bbp_new_topic_handler() {
|
|
| 391 |
/**
|
| 392 |
* Handles the front end edit topic submission
|
| 393 |
*
|
|
|
|
| 394 |
* @uses bbPress:errors::add() To log various error messages
|
| 395 |
* @uses bbp_get_topic() To get the topic
|
| 396 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
|
@@ -422,14 +414,10 @@ function bbp_new_topic_handler() {
|
|
| 422 |
* @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error
|
| 423 |
* messages
|
| 424 |
*/
|
| 425 |
-
function bbp_edit_topic_handler() {
|
| 426 |
-
|
| 427 |
-
// Bail if not a POST action
|
| 428 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 429 |
-
return;
|
| 430 |
|
| 431 |
// Bail if action is not bbp-edit-topic
|
| 432 |
-
if (
|
| 433 |
return;
|
| 434 |
|
| 435 |
// Define local variable(s)
|
|
@@ -625,7 +613,7 @@ function bbp_edit_topic_handler() {
|
|
| 625 |
|
| 626 |
// Toggle revisions back on
|
| 627 |
if ( true === $revisions_removed ) {
|
| 628 |
-
$revisions_removed =
|
| 629 |
add_post_type_support( bbp_get_topic_post_type(), 'revisions' );
|
| 630 |
}
|
| 631 |
|
|
@@ -693,7 +681,7 @@ function bbp_edit_topic_handler() {
|
|
| 693 |
/** Redirect **********************************************************/
|
| 694 |
|
| 695 |
// Redirect to
|
| 696 |
-
$redirect_to =
|
| 697 |
|
| 698 |
// View all?
|
| 699 |
$view_all = bbp_get_view_all();
|
|
@@ -729,8 +717,7 @@ function bbp_edit_topic_handler() {
|
|
| 729 |
*
|
| 730 |
* @param int $topic_id Optional. Topic id
|
| 731 |
* @param int $forum_id Optional. Forum id
|
| 732 |
-
* @param bool|array $anonymous_data Optional
|
| 733 |
-
* extracted and anonymous user info is saved
|
| 734 |
* @param int $author_id Author id
|
| 735 |
* @param bool $is_edit Optional. Is the post being edited? Defaults to false.
|
| 736 |
* @uses bbp_get_topic_id() To get the topic id
|
|
@@ -778,13 +765,12 @@ function bbp_update_topic( $topic_id = 0, $forum_id = 0, $anonymous_data = false
|
|
| 778 |
// Check bbp_filter_anonymous_post_data() for sanitization.
|
| 779 |
if ( !empty( $anonymous_data ) && is_array( $anonymous_data ) ) {
|
| 780 |
|
| 781 |
-
//
|
| 782 |
-
$
|
| 783 |
'bbp_anonymous_name' => '',
|
| 784 |
'bbp_anonymous_email' => '',
|
| 785 |
'bbp_anonymous_website' => '',
|
| 786 |
-
);
|
| 787 |
-
$r = bbp_parse_args( $anonymous_data, $defaults, 'update_topic' );
|
| 788 |
|
| 789 |
// Update all anonymous metas
|
| 790 |
foreach( $r as $anon_key => $anon_value ) {
|
|
@@ -1039,6 +1025,7 @@ function bbp_move_topic_handler( $topic_id, $old_forum_id, $new_forum_id ) {
|
|
| 1039 |
*
|
| 1040 |
* @since bbPress (r2756)
|
| 1041 |
*
|
|
|
|
| 1042 |
* @uses bbPress:errors::add() To log various error messages
|
| 1043 |
* @uses bbp_get_topic() To get the topics
|
| 1044 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
|
@@ -1070,14 +1057,10 @@ function bbp_move_topic_handler( $topic_id, $old_forum_id, $new_forum_id ) {
|
|
| 1070 |
* @uses bbp_get_topic_permalink() To get the topic permalink
|
| 1071 |
* @uses wp_safe_redirect() To redirect to the topic link
|
| 1072 |
*/
|
| 1073 |
-
function bbp_merge_topic_handler() {
|
| 1074 |
-
|
| 1075 |
-
// Bail if not a POST action
|
| 1076 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 1077 |
-
return;
|
| 1078 |
|
| 1079 |
// Bail if action is not bbp-merge-topic
|
| 1080 |
-
if (
|
| 1081 |
return;
|
| 1082 |
|
| 1083 |
// Define local variable(s)
|
|
@@ -1324,6 +1307,7 @@ function bbp_merge_topic_count( $destination_topic_id, $source_topic_id, $source
|
|
| 1324 |
*
|
| 1325 |
* @since bbPress (r2756)
|
| 1326 |
*
|
|
|
|
| 1327 |
* @uses bbPress:errors::add() To log various error messages
|
| 1328 |
* @uses bbp_get_reply() To get the reply
|
| 1329 |
* @uses bbp_get_topic() To get the topics
|
|
@@ -1355,14 +1339,10 @@ function bbp_merge_topic_count( $destination_topic_id, $source_topic_id, $source
|
|
| 1355 |
* @uses bbp_get_topic_permalink() To get the topic permalink
|
| 1356 |
* @uses wp_safe_redirect() To redirect to the topic link
|
| 1357 |
*/
|
| 1358 |
-
function bbp_split_topic_handler() {
|
| 1359 |
-
|
| 1360 |
-
// Bail if not a POST action
|
| 1361 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 1362 |
-
return;
|
| 1363 |
|
| 1364 |
// Bail if action is not 'bbp-split-topic'
|
| 1365 |
-
if (
|
| 1366 |
return;
|
| 1367 |
|
| 1368 |
global $wpdb;
|
|
@@ -1670,10 +1650,10 @@ function bbp_split_topic_handler() {
|
|
| 1670 |
function bbp_split_topic_count( $from_reply_id, $source_topic_id, $destination_topic_id ) {
|
| 1671 |
|
| 1672 |
// Forum Topic Counts
|
| 1673 |
-
bbp_update_forum_topic_count( $destination_topic_id );
|
| 1674 |
|
| 1675 |
// Forum Reply Counts
|
| 1676 |
-
bbp_update_forum_reply_count( $destination_topic_id );
|
| 1677 |
|
| 1678 |
// Topic Reply Counts
|
| 1679 |
bbp_update_topic_reply_count( $source_topic_id );
|
|
@@ -1695,6 +1675,7 @@ function bbp_split_topic_count( $from_reply_id, $source_topic_id, $destination_t
|
|
| 1695 |
*
|
| 1696 |
* @since bbPress (r2768)
|
| 1697 |
*
|
|
|
|
| 1698 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 1699 |
* @uses current_user_can() To check if the current user can edit/delete tags
|
| 1700 |
* @uses bbPress::errors::add() To log the error messages
|
|
@@ -1708,14 +1689,10 @@ function bbp_split_topic_count( $from_reply_id, $source_topic_id, $destination_t
|
|
| 1708 |
* @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
|
| 1709 |
* @uses wp_safe_redirect() To redirect to the url
|
| 1710 |
*/
|
| 1711 |
-
function bbp_edit_topic_tag_handler() {
|
| 1712 |
-
|
| 1713 |
-
// Bail if not a POST action
|
| 1714 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 1715 |
-
return;
|
| 1716 |
|
| 1717 |
// Bail if required POST actions aren't passed
|
| 1718 |
-
if ( empty( $_POST['tag-id'] )
|
| 1719 |
return;
|
| 1720 |
|
| 1721 |
// Setup possible get actions
|
|
@@ -1726,11 +1703,10 @@ function bbp_edit_topic_tag_handler() {
|
|
| 1726 |
);
|
| 1727 |
|
| 1728 |
// Bail if actions aren't meant for this function
|
| 1729 |
-
if ( !in_array( $
|
| 1730 |
return;
|
| 1731 |
|
| 1732 |
// Setup vars
|
| 1733 |
-
$action = $_POST['action'];
|
| 1734 |
$tag_id = (int) $_POST['tag-id'];
|
| 1735 |
$tag = get_term( $tag_id, bbp_get_topic_tag_tax_id() );
|
| 1736 |
|
|
@@ -1926,6 +1902,7 @@ function bbp_get_super_stickies() {
|
|
| 1926 |
*
|
| 1927 |
* @since bbPress (r2727)
|
| 1928 |
*
|
|
|
|
| 1929 |
* @uses bbp_get_topic() To get the topic
|
| 1930 |
* @uses current_user_can() To check if the user is capable of editing or
|
| 1931 |
* deleting the topic
|
|
@@ -1951,14 +1928,10 @@ function bbp_get_super_stickies() {
|
|
| 1951 |
* @uses wp_safe_redirect() To redirect to the topic
|
| 1952 |
* @uses bbPress::errors:add() To log the error messages
|
| 1953 |
*/
|
| 1954 |
-
function bbp_toggle_topic_handler() {
|
| 1955 |
-
|
| 1956 |
-
// Bail if not a GET action
|
| 1957 |
-
if ( 'GET' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 1958 |
-
return;
|
| 1959 |
|
| 1960 |
// Bail if required GET actions aren't passed
|
| 1961 |
-
if ( empty( $_GET['topic_id'] )
|
| 1962 |
return;
|
| 1963 |
|
| 1964 |
// Setup possible get actions
|
|
@@ -1970,12 +1943,11 @@ function bbp_toggle_topic_handler() {
|
|
| 1970 |
);
|
| 1971 |
|
| 1972 |
// Bail if actions aren't meant for this function
|
| 1973 |
-
if ( !in_array( $
|
| 1974 |
return;
|
| 1975 |
|
| 1976 |
$failure = ''; // Empty failure string
|
| 1977 |
$view_all = false; // Assume not viewing all
|
| 1978 |
-
$action = $_GET['action']; // What action is taking place?
|
| 1979 |
$topic_id = (int) $_GET['topic_id']; // What's the topic id?
|
| 1980 |
$success = false; // Flag
|
| 1981 |
$post_data = array( 'ID' => $topic_id ); // Prelim array
|
|
@@ -2184,7 +2156,7 @@ function bbp_bump_topic_reply_count( $topic_id = 0, $difference = 1 ) {
|
|
| 2184 |
|
| 2185 |
// Get counts
|
| 2186 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2187 |
-
$reply_count = bbp_get_topic_reply_count( $topic_id,
|
| 2188 |
$new_count = (int) $reply_count + (int) $difference;
|
| 2189 |
|
| 2190 |
// Update this topic id's reply count
|
|
@@ -2210,7 +2182,7 @@ function bbp_bump_topic_reply_count_hidden( $topic_id = 0, $difference = 1 ) {
|
|
| 2210 |
|
| 2211 |
// Get counts
|
| 2212 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2213 |
-
$reply_count = bbp_get_topic_reply_count_hidden( $topic_id,
|
| 2214 |
$new_count = (int) $reply_count + (int) $difference;
|
| 2215 |
|
| 2216 |
// Update this topic id's hidder reply count
|
|
@@ -2241,13 +2213,15 @@ function bbp_bump_topic_reply_count_hidden( $topic_id = 0, $difference = 1 ) {
|
|
| 2241 |
function bbp_update_topic_forum_id( $topic_id = 0, $forum_id = 0 ) {
|
| 2242 |
|
| 2243 |
// If it's a reply, then get the parent (topic id)
|
| 2244 |
-
if ( bbp_is_reply( $topic_id ) )
|
| 2245 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2246 |
-
else
|
| 2247 |
$topic_id = bbp_get_topic_id( $topic_id );
|
|
|
|
| 2248 |
|
| 2249 |
-
if ( empty( $forum_id ) )
|
| 2250 |
$forum_id = get_post_field( 'post_parent', $topic_id );
|
|
|
|
| 2251 |
|
| 2252 |
update_post_meta( $topic_id, '_bbp_forum_id', (int) $forum_id );
|
| 2253 |
|
|
@@ -2293,14 +2267,16 @@ function bbp_update_topic_topic_id( $topic_id = 0 ) {
|
|
| 2293 |
function bbp_update_topic_reply_count( $topic_id = 0, $reply_count = 0 ) {
|
| 2294 |
|
| 2295 |
// If it's a reply, then get the parent (topic id)
|
| 2296 |
-
if ( bbp_is_reply( $topic_id ) )
|
| 2297 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2298 |
-
else
|
| 2299 |
$topic_id = bbp_get_topic_id( $topic_id );
|
|
|
|
| 2300 |
|
| 2301 |
// Get replies of topic if not passed
|
| 2302 |
-
if ( empty( $reply_count ) )
|
| 2303 |
$reply_count = bbp_get_public_child_count( $topic_id, bbp_get_reply_post_type() );
|
|
|
|
| 2304 |
|
| 2305 |
update_post_meta( $topic_id, '_bbp_reply_count', (int) $reply_count );
|
| 2306 |
|
|
@@ -2329,14 +2305,16 @@ function bbp_update_topic_reply_count_hidden( $topic_id = 0, $reply_count = 0 )
|
|
| 2329 |
global $wpdb;
|
| 2330 |
|
| 2331 |
// If it's a reply, then get the parent (topic id)
|
| 2332 |
-
if ( bbp_is_reply( $topic_id ) )
|
| 2333 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2334 |
-
else
|
| 2335 |
$topic_id = bbp_get_topic_id( $topic_id );
|
|
|
|
| 2336 |
|
| 2337 |
// Get replies of topic
|
| 2338 |
-
if ( empty( $reply_count ) )
|
| 2339 |
$reply_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . join( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $topic_id, bbp_get_reply_post_type() ) );
|
|
|
|
| 2340 |
|
| 2341 |
update_post_meta( $topic_id, '_bbp_reply_count_hidden', (int) $reply_count );
|
| 2342 |
|
|
@@ -2364,21 +2342,25 @@ function bbp_update_topic_reply_count_hidden( $topic_id = 0, $reply_count = 0 )
|
|
| 2364 |
function bbp_update_topic_last_active_id( $topic_id = 0, $active_id = 0 ) {
|
| 2365 |
|
| 2366 |
// If it's a reply, then get the parent (topic id)
|
| 2367 |
-
if ( bbp_is_reply( $topic_id ) )
|
| 2368 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2369 |
-
else
|
| 2370 |
$topic_id = bbp_get_topic_id( $topic_id );
|
|
|
|
| 2371 |
|
| 2372 |
-
if ( empty( $active_id ) )
|
| 2373 |
$active_id = bbp_get_public_child_last_id( $topic_id, bbp_get_reply_post_type() );
|
|
|
|
| 2374 |
|
| 2375 |
// Adjust last_id's based on last_reply post_type
|
| 2376 |
-
if ( empty( $active_id ) || !bbp_is_reply( $active_id ) )
|
| 2377 |
$active_id = $topic_id;
|
|
|
|
| 2378 |
|
| 2379 |
// Update only if published
|
| 2380 |
-
if ( bbp_get_public_status_id() == get_post_status( $active_id ) )
|
| 2381 |
update_post_meta( $topic_id, '_bbp_last_active_id', (int) $active_id );
|
|
|
|
| 2382 |
|
| 2383 |
return apply_filters( 'bbp_update_topic_last_active_id', (int) $active_id, $topic_id );
|
| 2384 |
}
|
|
@@ -2399,18 +2381,21 @@ function bbp_update_topic_last_active_id( $topic_id = 0, $active_id = 0 ) {
|
|
| 2399 |
function bbp_update_topic_last_active_time( $topic_id = 0, $new_time = '' ) {
|
| 2400 |
|
| 2401 |
// If it's a reply, then get the parent (topic id)
|
| 2402 |
-
if ( bbp_is_reply( $topic_id ) )
|
| 2403 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2404 |
-
else
|
| 2405 |
$topic_id = bbp_get_topic_id( $topic_id );
|
|
|
|
| 2406 |
|
| 2407 |
// Check time and use current if empty
|
| 2408 |
-
if ( empty( $new_time ) )
|
| 2409 |
$new_time = get_post_field( 'post_date', bbp_get_public_child_last_id( $topic_id, bbp_get_reply_post_type() ) );
|
|
|
|
| 2410 |
|
| 2411 |
// Update only if published
|
| 2412 |
-
if ( !empty( $new_time ) )
|
| 2413 |
update_post_meta( $topic_id, '_bbp_last_active_time', $new_time );
|
|
|
|
| 2414 |
|
| 2415 |
return apply_filters( 'bbp_update_topic_last_active_time', $new_time, $topic_id );
|
| 2416 |
}
|
|
@@ -2444,16 +2429,19 @@ function bbp_update_topic_last_reply_id( $topic_id = 0, $reply_id = 0 ) {
|
|
| 2444 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2445 |
}
|
| 2446 |
|
| 2447 |
-
if ( empty( $reply_id ) )
|
| 2448 |
$reply_id = bbp_get_public_child_last_id( $topic_id, bbp_get_reply_post_type() );
|
|
|
|
| 2449 |
|
| 2450 |
// Adjust last_id's based on last_reply post_type
|
| 2451 |
-
if ( empty( $reply_id ) || !bbp_is_reply( $reply_id ) )
|
| 2452 |
$reply_id = 0;
|
|
|
|
| 2453 |
|
| 2454 |
// Update if reply is published
|
| 2455 |
-
if ( bbp_is_reply_published( $reply_id ) )
|
| 2456 |
update_post_meta( $topic_id, '_bbp_last_reply_id', (int) $reply_id );
|
|
|
|
| 2457 |
|
| 2458 |
return apply_filters( 'bbp_update_topic_last_reply_id', (int) $reply_id, $topic_id );
|
| 2459 |
}
|
|
@@ -2481,12 +2469,13 @@ function bbp_update_topic_voice_count( $topic_id = 0 ) {
|
|
| 2481 |
global $wpdb;
|
| 2482 |
|
| 2483 |
// If it's a reply, then get the parent (topic id)
|
| 2484 |
-
if ( bbp_is_reply( $topic_id ) )
|
| 2485 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2486 |
-
elseif ( bbp_is_topic( $topic_id ) )
|
| 2487 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2488 |
-
else
|
| 2489 |
return;
|
|
|
|
| 2490 |
|
| 2491 |
// Query the DB to get voices in this topic
|
| 2492 |
$voices = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT( DISTINCT post_author ) FROM {$wpdb->posts} WHERE ( post_parent = %d AND post_status = '%s' AND post_type = '%s' ) OR ( ID = %d AND post_type = '%s' );", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ) );
|
|
@@ -2523,12 +2512,13 @@ function bbp_update_topic_anonymous_reply_count( $topic_id = 0 ) {
|
|
| 2523 |
global $wpdb;
|
| 2524 |
|
| 2525 |
// If it's a reply, then get the parent (topic id)
|
| 2526 |
-
if ( bbp_is_reply( $topic_id ) )
|
| 2527 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2528 |
-
elseif ( bbp_is_topic( $topic_id ) )
|
| 2529 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2530 |
-
else
|
| 2531 |
return;
|
|
|
|
| 2532 |
|
| 2533 |
$anonymous_replies = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( ID ) FROM {$wpdb->posts} WHERE ( post_parent = %d AND post_status = '%s' AND post_type = '%s' AND post_author = 0 ) OR ( ID = %d AND post_type = '%s' AND post_author = 0 );", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ) );
|
| 2534 |
|
|
@@ -2555,27 +2545,27 @@ function bbp_update_topic_anonymous_reply_count( $topic_id = 0 ) {
|
|
| 2555 |
* @return mixed False on failure, true on success
|
| 2556 |
*/
|
| 2557 |
function bbp_update_topic_revision_log( $args = '' ) {
|
| 2558 |
-
|
|
|
|
|
|
|
| 2559 |
'reason' => '',
|
| 2560 |
'topic_id' => 0,
|
| 2561 |
'author_id' => 0,
|
| 2562 |
'revision_id' => 0
|
| 2563 |
-
);
|
| 2564 |
-
$r = bbp_parse_args( $args, $defaults, 'update_topic_revision_log' );
|
| 2565 |
-
extract( $r );
|
| 2566 |
|
| 2567 |
// Populate the variables
|
| 2568 |
-
$reason = bbp_format_revision_reason( $reason );
|
| 2569 |
-
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2570 |
-
$author_id = bbp_get_user_id ( $author_id, false, true );
|
| 2571 |
-
$revision_id = (int) $revision_id;
|
| 2572 |
|
| 2573 |
// Get the logs and append the new one to those
|
| 2574 |
-
$revision_log
|
| 2575 |
-
$revision_log[$revision_id] = array( 'author' => $author_id, 'reason' => $reason );
|
| 2576 |
|
| 2577 |
// Finally, update
|
| 2578 |
-
return update_post_meta( $topic_id, '_bbp_revision_log', $revision_log );
|
| 2579 |
}
|
| 2580 |
|
| 2581 |
/** Topic Actions *************************************************************/
|
|
@@ -2700,6 +2690,44 @@ function bbp_spam_topic( $topic_id = 0 ) {
|
|
| 2700 |
// Execute pre spam code
|
| 2701 |
do_action( 'bbp_spam_topic', $topic_id );
|
| 2702 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2703 |
// Add the original post status as post meta for future restoration
|
| 2704 |
add_post_meta( $topic_id, '_bbp_spam_meta_status', $topic['post_status'] );
|
| 2705 |
|
|
@@ -2771,17 +2799,25 @@ function bbp_unspam_topic( $topic_id = 0 ) {
|
|
| 2771 |
// Execute pre unspam code
|
| 2772 |
do_action( 'bbp_unspam_topic', $topic_id );
|
| 2773 |
|
| 2774 |
-
|
| 2775 |
-
$topic_status = get_post_meta( $topic_id, '_bbp_spam_meta_status', true );
|
| 2776 |
|
| 2777 |
-
//
|
| 2778 |
-
$
|
| 2779 |
|
| 2780 |
-
//
|
| 2781 |
-
|
| 2782 |
|
| 2783 |
-
|
| 2784 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2785 |
|
| 2786 |
// Get pre-spam topic tags
|
| 2787 |
$terms = get_post_meta( $topic_id, '_bbp_spam_topic_tags', true );
|
|
@@ -2796,6 +2832,20 @@ function bbp_unspam_topic( $topic_id = 0 ) {
|
|
| 2796 |
delete_post_meta( $topic_id, '_bbp_spam_topic_tags' );
|
| 2797 |
}
|
| 2798 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2799 |
// Update the topic
|
| 2800 |
$topic_id = wp_insert_post( $topic );
|
| 2801 |
|
|
@@ -2941,15 +2991,19 @@ function bbp_delete_topic( $topic_id = 0 ) {
|
|
| 2941 |
do_action( 'bbp_delete_topic', $topic_id );
|
| 2942 |
|
| 2943 |
// Topic is being permanently deleted, so its replies gotta go too
|
| 2944 |
-
|
|
|
|
| 2945 |
'suppress_filters' => true,
|
| 2946 |
'post_type' => bbp_get_reply_post_type(),
|
| 2947 |
-
'post_status' =>
|
| 2948 |
'post_parent' => $topic_id,
|
| 2949 |
'posts_per_page' => -1,
|
| 2950 |
'nopaging' => true,
|
| 2951 |
'fields' => 'id=>parent'
|
| 2952 |
-
) )
|
|
|
|
|
|
|
|
|
|
| 2953 |
foreach ( $replies->posts as $reply ) {
|
| 2954 |
wp_delete_post( $reply->ID, true );
|
| 2955 |
}
|
|
@@ -2957,6 +3011,9 @@ function bbp_delete_topic( $topic_id = 0 ) {
|
|
| 2957 |
// Reset the $post global
|
| 2958 |
wp_reset_postdata();
|
| 2959 |
}
|
|
|
|
|
|
|
|
|
|
| 2960 |
}
|
| 2961 |
|
| 2962 |
/**
|
|
@@ -2983,7 +3040,7 @@ function bbp_trash_topic( $topic_id = 0 ) {
|
|
| 2983 |
do_action( 'bbp_trash_topic', $topic_id );
|
| 2984 |
|
| 2985 |
// Topic is being trashed, so its replies are trashed too
|
| 2986 |
-
|
| 2987 |
'suppress_filters' => true,
|
| 2988 |
'post_type' => bbp_get_reply_post_type(),
|
| 2989 |
'post_status' => bbp_get_public_status_id(),
|
|
@@ -2991,7 +3048,9 @@ function bbp_trash_topic( $topic_id = 0 ) {
|
|
| 2991 |
'posts_per_page' => -1,
|
| 2992 |
'nopaging' => true,
|
| 2993 |
'fields' => 'id=>parent'
|
| 2994 |
-
) )
|
|
|
|
|
|
|
| 2995 |
|
| 2996 |
// Prevent debug notices
|
| 2997 |
$pre_trashed_replies = array();
|
|
@@ -3010,6 +3069,9 @@ function bbp_trash_topic( $topic_id = 0 ) {
|
|
| 3010 |
// Reset the $post global
|
| 3011 |
wp_reset_postdata();
|
| 3012 |
}
|
|
|
|
|
|
|
|
|
|
| 3013 |
}
|
| 3014 |
|
| 3015 |
/**
|
|
@@ -3243,7 +3305,7 @@ function bbp_display_topics_feed_rss2( $topics_query = array() ) {
|
|
| 3243 |
<description><?php //?></description>
|
| 3244 |
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s O', current_time( 'mysql' ), false ); ?></pubDate>
|
| 3245 |
<generator>http://bbpress.org/?v=<?php bbp_version(); ?></generator>
|
| 3246 |
-
<language><?php
|
| 3247 |
|
| 3248 |
<?php do_action( 'bbp_feed_head' ); ?>
|
| 3249 |
|
| 28 |
*/
|
| 29 |
function bbp_insert_topic( $topic_data = array(), $topic_meta = array() ) {
|
| 30 |
|
| 31 |
+
// Parse arguments against default values
|
| 32 |
+
$topic_data = bbp_parse_args( $topic_data, array(
|
| 33 |
'post_parent' => 0, // forum ID
|
| 34 |
'post_status' => bbp_get_public_status_id(),
|
| 35 |
'post_type' => bbp_get_topic_post_type(),
|
| 39 |
'post_title' => '',
|
| 40 |
'comment_status' => 'closed',
|
| 41 |
'menu_order' => 0,
|
| 42 |
+
), 'insert_topic' );
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
// Insert topic
|
| 45 |
$topic_id = wp_insert_post( $topic_data );
|
| 48 |
if ( empty( $topic_id ) )
|
| 49 |
return false;
|
| 50 |
|
| 51 |
+
// Parse arguments against default values
|
| 52 |
+
$topic_meta = bbp_parse_args( $topic_meta, array(
|
| 53 |
'author_ip' => bbp_current_author_ip(),
|
| 54 |
'forum_id' => 0,
|
| 55 |
'topic_id' => $topic_id,
|
| 59 |
'last_reply_id' => 0,
|
| 60 |
'last_active_id' => $topic_id,
|
| 61 |
'last_active_time' => get_post_field( 'post_date', $topic_id, 'db' ),
|
| 62 |
+
), 'insert_topic_meta' );
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
// Insert topic meta
|
| 65 |
foreach ( $topic_meta as $meta_key => $meta_value )
|
| 79 |
/**
|
| 80 |
* Handles the front end topic submission
|
| 81 |
*
|
| 82 |
+
* @param string $action The requested action to compare this function to
|
| 83 |
* @uses bbPress:errors::add() To log various error messages
|
| 84 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the referer
|
| 85 |
* @uses bbp_is_anonymous() To check if an anonymous post is being made
|
| 109 |
* @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error
|
| 110 |
* messages
|
| 111 |
*/
|
| 112 |
+
function bbp_new_topic_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
// Bail if action is not bbp-new-topic
|
| 115 |
+
if ( 'bbp-new-topic' !== $action )
|
| 116 |
return;
|
| 117 |
|
| 118 |
// Nonce check
|
| 343 |
/** Redirect **********************************************************/
|
| 344 |
|
| 345 |
// Redirect to
|
| 346 |
+
$redirect_to = bbp_get_redirect_to();
|
| 347 |
|
| 348 |
// Get the topic URL
|
| 349 |
$redirect_url = bbp_get_topic_permalink( $topic_id, $redirect_to );
|
| 382 |
/**
|
| 383 |
* Handles the front end edit topic submission
|
| 384 |
*
|
| 385 |
+
* @param string $action The requested action to compare this function to
|
| 386 |
* @uses bbPress:errors::add() To log various error messages
|
| 387 |
* @uses bbp_get_topic() To get the topic
|
| 388 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 414 |
* @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error
|
| 415 |
* messages
|
| 416 |
*/
|
| 417 |
+
function bbp_edit_topic_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 418 |
|
| 419 |
// Bail if action is not bbp-edit-topic
|
| 420 |
+
if ( 'bbp-edit-topic' !== $action )
|
| 421 |
return;
|
| 422 |
|
| 423 |
// Define local variable(s)
|
| 613 |
|
| 614 |
// Toggle revisions back on
|
| 615 |
if ( true === $revisions_removed ) {
|
| 616 |
+
$revisions_removed = false;
|
| 617 |
add_post_type_support( bbp_get_topic_post_type(), 'revisions' );
|
| 618 |
}
|
| 619 |
|
| 681 |
/** Redirect **********************************************************/
|
| 682 |
|
| 683 |
// Redirect to
|
| 684 |
+
$redirect_to = bbp_get_redirect_to();
|
| 685 |
|
| 686 |
// View all?
|
| 687 |
$view_all = bbp_get_view_all();
|
| 717 |
*
|
| 718 |
* @param int $topic_id Optional. Topic id
|
| 719 |
* @param int $forum_id Optional. Forum id
|
| 720 |
+
* @param bool|array $anonymous_data Optional logged-out user data.
|
|
|
|
| 721 |
* @param int $author_id Author id
|
| 722 |
* @param bool $is_edit Optional. Is the post being edited? Defaults to false.
|
| 723 |
* @uses bbp_get_topic_id() To get the topic id
|
| 765 |
// Check bbp_filter_anonymous_post_data() for sanitization.
|
| 766 |
if ( !empty( $anonymous_data ) && is_array( $anonymous_data ) ) {
|
| 767 |
|
| 768 |
+
// Parse arguments against default values
|
| 769 |
+
$r = bbp_parse_args( $anonymous_data, array(
|
| 770 |
'bbp_anonymous_name' => '',
|
| 771 |
'bbp_anonymous_email' => '',
|
| 772 |
'bbp_anonymous_website' => '',
|
| 773 |
+
), 'update_topic' );
|
|
|
|
| 774 |
|
| 775 |
// Update all anonymous metas
|
| 776 |
foreach( $r as $anon_key => $anon_value ) {
|
| 1025 |
*
|
| 1026 |
* @since bbPress (r2756)
|
| 1027 |
*
|
| 1028 |
+
* @param string $action The requested action to compare this function to
|
| 1029 |
* @uses bbPress:errors::add() To log various error messages
|
| 1030 |
* @uses bbp_get_topic() To get the topics
|
| 1031 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 1057 |
* @uses bbp_get_topic_permalink() To get the topic permalink
|
| 1058 |
* @uses wp_safe_redirect() To redirect to the topic link
|
| 1059 |
*/
|
| 1060 |
+
function bbp_merge_topic_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1061 |
|
| 1062 |
// Bail if action is not bbp-merge-topic
|
| 1063 |
+
if ( 'bbp-merge-topic' !== $action )
|
| 1064 |
return;
|
| 1065 |
|
| 1066 |
// Define local variable(s)
|
| 1307 |
*
|
| 1308 |
* @since bbPress (r2756)
|
| 1309 |
*
|
| 1310 |
+
* @param string $action The requested action to compare this function to
|
| 1311 |
* @uses bbPress:errors::add() To log various error messages
|
| 1312 |
* @uses bbp_get_reply() To get the reply
|
| 1313 |
* @uses bbp_get_topic() To get the topics
|
| 1339 |
* @uses bbp_get_topic_permalink() To get the topic permalink
|
| 1340 |
* @uses wp_safe_redirect() To redirect to the topic link
|
| 1341 |
*/
|
| 1342 |
+
function bbp_split_topic_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1343 |
|
| 1344 |
// Bail if action is not 'bbp-split-topic'
|
| 1345 |
+
if ( 'bbp-split-topic' !== $action )
|
| 1346 |
return;
|
| 1347 |
|
| 1348 |
global $wpdb;
|
| 1650 |
function bbp_split_topic_count( $from_reply_id, $source_topic_id, $destination_topic_id ) {
|
| 1651 |
|
| 1652 |
// Forum Topic Counts
|
| 1653 |
+
bbp_update_forum_topic_count( bbp_get_topic_forum_id( $destination_topic_id ) );
|
| 1654 |
|
| 1655 |
// Forum Reply Counts
|
| 1656 |
+
bbp_update_forum_reply_count( bbp_get_topic_forum_id( $destination_topic_id ) );
|
| 1657 |
|
| 1658 |
// Topic Reply Counts
|
| 1659 |
bbp_update_topic_reply_count( $source_topic_id );
|
| 1675 |
*
|
| 1676 |
* @since bbPress (r2768)
|
| 1677 |
*
|
| 1678 |
+
* @param string $action The requested action to compare this function to
|
| 1679 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 1680 |
* @uses current_user_can() To check if the current user can edit/delete tags
|
| 1681 |
* @uses bbPress::errors::add() To log the error messages
|
| 1689 |
* @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
|
| 1690 |
* @uses wp_safe_redirect() To redirect to the url
|
| 1691 |
*/
|
| 1692 |
+
function bbp_edit_topic_tag_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1693 |
|
| 1694 |
// Bail if required POST actions aren't passed
|
| 1695 |
+
if ( empty( $_POST['tag-id'] ) )
|
| 1696 |
return;
|
| 1697 |
|
| 1698 |
// Setup possible get actions
|
| 1703 |
);
|
| 1704 |
|
| 1705 |
// Bail if actions aren't meant for this function
|
| 1706 |
+
if ( !in_array( $action, $possible_actions ) )
|
| 1707 |
return;
|
| 1708 |
|
| 1709 |
// Setup vars
|
|
|
|
| 1710 |
$tag_id = (int) $_POST['tag-id'];
|
| 1711 |
$tag = get_term( $tag_id, bbp_get_topic_tag_tax_id() );
|
| 1712 |
|
| 1902 |
*
|
| 1903 |
* @since bbPress (r2727)
|
| 1904 |
*
|
| 1905 |
+
* @param string $action The requested action to compare this function to
|
| 1906 |
* @uses bbp_get_topic() To get the topic
|
| 1907 |
* @uses current_user_can() To check if the user is capable of editing or
|
| 1908 |
* deleting the topic
|
| 1928 |
* @uses wp_safe_redirect() To redirect to the topic
|
| 1929 |
* @uses bbPress::errors:add() To log the error messages
|
| 1930 |
*/
|
| 1931 |
+
function bbp_toggle_topic_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1932 |
|
| 1933 |
// Bail if required GET actions aren't passed
|
| 1934 |
+
if ( empty( $_GET['topic_id'] ) )
|
| 1935 |
return;
|
| 1936 |
|
| 1937 |
// Setup possible get actions
|
| 1943 |
);
|
| 1944 |
|
| 1945 |
// Bail if actions aren't meant for this function
|
| 1946 |
+
if ( !in_array( $action, $possible_actions ) )
|
| 1947 |
return;
|
| 1948 |
|
| 1949 |
$failure = ''; // Empty failure string
|
| 1950 |
$view_all = false; // Assume not viewing all
|
|
|
|
| 1951 |
$topic_id = (int) $_GET['topic_id']; // What's the topic id?
|
| 1952 |
$success = false; // Flag
|
| 1953 |
$post_data = array( 'ID' => $topic_id ); // Prelim array
|
| 2156 |
|
| 2157 |
// Get counts
|
| 2158 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2159 |
+
$reply_count = bbp_get_topic_reply_count( $topic_id, true );
|
| 2160 |
$new_count = (int) $reply_count + (int) $difference;
|
| 2161 |
|
| 2162 |
// Update this topic id's reply count
|
| 2182 |
|
| 2183 |
// Get counts
|
| 2184 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2185 |
+
$reply_count = bbp_get_topic_reply_count_hidden( $topic_id, true );
|
| 2186 |
$new_count = (int) $reply_count + (int) $difference;
|
| 2187 |
|
| 2188 |
// Update this topic id's hidder reply count
|
| 2213 |
function bbp_update_topic_forum_id( $topic_id = 0, $forum_id = 0 ) {
|
| 2214 |
|
| 2215 |
// If it's a reply, then get the parent (topic id)
|
| 2216 |
+
if ( bbp_is_reply( $topic_id ) ) {
|
| 2217 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2218 |
+
} else {
|
| 2219 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2220 |
+
}
|
| 2221 |
|
| 2222 |
+
if ( empty( $forum_id ) ) {
|
| 2223 |
$forum_id = get_post_field( 'post_parent', $topic_id );
|
| 2224 |
+
}
|
| 2225 |
|
| 2226 |
update_post_meta( $topic_id, '_bbp_forum_id', (int) $forum_id );
|
| 2227 |
|
| 2267 |
function bbp_update_topic_reply_count( $topic_id = 0, $reply_count = 0 ) {
|
| 2268 |
|
| 2269 |
// If it's a reply, then get the parent (topic id)
|
| 2270 |
+
if ( bbp_is_reply( $topic_id ) ) {
|
| 2271 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2272 |
+
} else {
|
| 2273 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2274 |
+
}
|
| 2275 |
|
| 2276 |
// Get replies of topic if not passed
|
| 2277 |
+
if ( empty( $reply_count ) ) {
|
| 2278 |
$reply_count = bbp_get_public_child_count( $topic_id, bbp_get_reply_post_type() );
|
| 2279 |
+
}
|
| 2280 |
|
| 2281 |
update_post_meta( $topic_id, '_bbp_reply_count', (int) $reply_count );
|
| 2282 |
|
| 2305 |
global $wpdb;
|
| 2306 |
|
| 2307 |
// If it's a reply, then get the parent (topic id)
|
| 2308 |
+
if ( bbp_is_reply( $topic_id ) ) {
|
| 2309 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2310 |
+
} else {
|
| 2311 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2312 |
+
}
|
| 2313 |
|
| 2314 |
// Get replies of topic
|
| 2315 |
+
if ( empty( $reply_count ) ) {
|
| 2316 |
$reply_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . join( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $topic_id, bbp_get_reply_post_type() ) );
|
| 2317 |
+
}
|
| 2318 |
|
| 2319 |
update_post_meta( $topic_id, '_bbp_reply_count_hidden', (int) $reply_count );
|
| 2320 |
|
| 2342 |
function bbp_update_topic_last_active_id( $topic_id = 0, $active_id = 0 ) {
|
| 2343 |
|
| 2344 |
// If it's a reply, then get the parent (topic id)
|
| 2345 |
+
if ( bbp_is_reply( $topic_id ) ) {
|
| 2346 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2347 |
+
} else {
|
| 2348 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2349 |
+
}
|
| 2350 |
|
| 2351 |
+
if ( empty( $active_id ) ) {
|
| 2352 |
$active_id = bbp_get_public_child_last_id( $topic_id, bbp_get_reply_post_type() );
|
| 2353 |
+
}
|
| 2354 |
|
| 2355 |
// Adjust last_id's based on last_reply post_type
|
| 2356 |
+
if ( empty( $active_id ) || !bbp_is_reply( $active_id ) ) {
|
| 2357 |
$active_id = $topic_id;
|
| 2358 |
+
}
|
| 2359 |
|
| 2360 |
// Update only if published
|
| 2361 |
+
if ( bbp_get_public_status_id() == get_post_status( $active_id ) ) {
|
| 2362 |
update_post_meta( $topic_id, '_bbp_last_active_id', (int) $active_id );
|
| 2363 |
+
}
|
| 2364 |
|
| 2365 |
return apply_filters( 'bbp_update_topic_last_active_id', (int) $active_id, $topic_id );
|
| 2366 |
}
|
| 2381 |
function bbp_update_topic_last_active_time( $topic_id = 0, $new_time = '' ) {
|
| 2382 |
|
| 2383 |
// If it's a reply, then get the parent (topic id)
|
| 2384 |
+
if ( bbp_is_reply( $topic_id ) ) {
|
| 2385 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2386 |
+
} else {
|
| 2387 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2388 |
+
}
|
| 2389 |
|
| 2390 |
// Check time and use current if empty
|
| 2391 |
+
if ( empty( $new_time ) ) {
|
| 2392 |
$new_time = get_post_field( 'post_date', bbp_get_public_child_last_id( $topic_id, bbp_get_reply_post_type() ) );
|
| 2393 |
+
}
|
| 2394 |
|
| 2395 |
// Update only if published
|
| 2396 |
+
if ( !empty( $new_time ) ) {
|
| 2397 |
update_post_meta( $topic_id, '_bbp_last_active_time', $new_time );
|
| 2398 |
+
}
|
| 2399 |
|
| 2400 |
return apply_filters( 'bbp_update_topic_last_active_time', $new_time, $topic_id );
|
| 2401 |
}
|
| 2429 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2430 |
}
|
| 2431 |
|
| 2432 |
+
if ( empty( $reply_id ) ) {
|
| 2433 |
$reply_id = bbp_get_public_child_last_id( $topic_id, bbp_get_reply_post_type() );
|
| 2434 |
+
}
|
| 2435 |
|
| 2436 |
// Adjust last_id's based on last_reply post_type
|
| 2437 |
+
if ( empty( $reply_id ) || !bbp_is_reply( $reply_id ) ) {
|
| 2438 |
$reply_id = 0;
|
| 2439 |
+
}
|
| 2440 |
|
| 2441 |
// Update if reply is published
|
| 2442 |
+
if ( bbp_is_reply_published( $reply_id ) ) {
|
| 2443 |
update_post_meta( $topic_id, '_bbp_last_reply_id', (int) $reply_id );
|
| 2444 |
+
}
|
| 2445 |
|
| 2446 |
return apply_filters( 'bbp_update_topic_last_reply_id', (int) $reply_id, $topic_id );
|
| 2447 |
}
|
| 2469 |
global $wpdb;
|
| 2470 |
|
| 2471 |
// If it's a reply, then get the parent (topic id)
|
| 2472 |
+
if ( bbp_is_reply( $topic_id ) ) {
|
| 2473 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2474 |
+
} elseif ( bbp_is_topic( $topic_id ) ) {
|
| 2475 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2476 |
+
} else {
|
| 2477 |
return;
|
| 2478 |
+
}
|
| 2479 |
|
| 2480 |
// Query the DB to get voices in this topic
|
| 2481 |
$voices = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT( DISTINCT post_author ) FROM {$wpdb->posts} WHERE ( post_parent = %d AND post_status = '%s' AND post_type = '%s' ) OR ( ID = %d AND post_type = '%s' );", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ) );
|
| 2512 |
global $wpdb;
|
| 2513 |
|
| 2514 |
// If it's a reply, then get the parent (topic id)
|
| 2515 |
+
if ( bbp_is_reply( $topic_id ) ) {
|
| 2516 |
$topic_id = bbp_get_reply_topic_id( $topic_id );
|
| 2517 |
+
} elseif ( bbp_is_topic( $topic_id ) ) {
|
| 2518 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2519 |
+
} else {
|
| 2520 |
return;
|
| 2521 |
+
}
|
| 2522 |
|
| 2523 |
$anonymous_replies = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( ID ) FROM {$wpdb->posts} WHERE ( post_parent = %d AND post_status = '%s' AND post_type = '%s' AND post_author = 0 ) OR ( ID = %d AND post_type = '%s' AND post_author = 0 );", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ) );
|
| 2524 |
|
| 2545 |
* @return mixed False on failure, true on success
|
| 2546 |
*/
|
| 2547 |
function bbp_update_topic_revision_log( $args = '' ) {
|
| 2548 |
+
|
| 2549 |
+
// Parse arguments against default values
|
| 2550 |
+
$r = bbp_parse_args( $args, array(
|
| 2551 |
'reason' => '',
|
| 2552 |
'topic_id' => 0,
|
| 2553 |
'author_id' => 0,
|
| 2554 |
'revision_id' => 0
|
| 2555 |
+
), 'update_topic_revision_log' );
|
|
|
|
|
|
|
| 2556 |
|
| 2557 |
// Populate the variables
|
| 2558 |
+
$r['reason'] = bbp_format_revision_reason( $r['reason'] );
|
| 2559 |
+
$r['topic_id'] = bbp_get_topic_id( $r['topic_id'] );
|
| 2560 |
+
$r['author_id'] = bbp_get_user_id ( $r['author_id'], false, true );
|
| 2561 |
+
$r['revision_id'] = (int) $r['revision_id'];
|
| 2562 |
|
| 2563 |
// Get the logs and append the new one to those
|
| 2564 |
+
$revision_log = bbp_get_topic_raw_revision_log( $r['topic_id'] );
|
| 2565 |
+
$revision_log[ $r['revision_id'] ] = array( 'author' => $r['author_id'], 'reason' => $r['reason'] );
|
| 2566 |
|
| 2567 |
// Finally, update
|
| 2568 |
+
return update_post_meta( $r['topic_id'], '_bbp_revision_log', $revision_log );
|
| 2569 |
}
|
| 2570 |
|
| 2571 |
/** Topic Actions *************************************************************/
|
| 2690 |
// Execute pre spam code
|
| 2691 |
do_action( 'bbp_spam_topic', $topic_id );
|
| 2692 |
|
| 2693 |
+
/** Trash Replies *********************************************************/
|
| 2694 |
+
|
| 2695 |
+
// Topic is being spammed, so its replies are trashed
|
| 2696 |
+
$replies = new WP_Query( array(
|
| 2697 |
+
'suppress_filters' => true,
|
| 2698 |
+
'post_type' => bbp_get_reply_post_type(),
|
| 2699 |
+
'post_status' => bbp_get_public_status_id(),
|
| 2700 |
+
'post_parent' => $topic_id,
|
| 2701 |
+
'posts_per_page' => -1,
|
| 2702 |
+
'nopaging' => true,
|
| 2703 |
+
'fields' => 'id=>parent'
|
| 2704 |
+
) );
|
| 2705 |
+
|
| 2706 |
+
if ( !empty( $replies->posts ) ) {
|
| 2707 |
+
|
| 2708 |
+
// Prevent debug notices
|
| 2709 |
+
$pre_spammed_replies = array();
|
| 2710 |
+
|
| 2711 |
+
// Loop through replies, trash them, and add them to array
|
| 2712 |
+
foreach ( $replies->posts as $reply ) {
|
| 2713 |
+
wp_trash_post( $reply->ID );
|
| 2714 |
+
$pre_spammed_replies[] = $reply->ID;
|
| 2715 |
+
}
|
| 2716 |
+
|
| 2717 |
+
// Set a post_meta entry of the replies that were trashed by this action.
|
| 2718 |
+
// This is so we can possibly untrash them, without untrashing replies
|
| 2719 |
+
// that were purposefully trashed before.
|
| 2720 |
+
update_post_meta( $topic_id, '_bbp_pre_spammed_replies', $pre_spammed_replies );
|
| 2721 |
+
|
| 2722 |
+
// Reset the $post global
|
| 2723 |
+
wp_reset_postdata();
|
| 2724 |
+
}
|
| 2725 |
+
|
| 2726 |
+
// Cleanup
|
| 2727 |
+
unset( $replies );
|
| 2728 |
+
|
| 2729 |
+
/** Topic Tags ************************************************************/
|
| 2730 |
+
|
| 2731 |
// Add the original post status as post meta for future restoration
|
| 2732 |
add_post_meta( $topic_id, '_bbp_spam_meta_status', $topic['post_status'] );
|
| 2733 |
|
| 2799 |
// Execute pre unspam code
|
| 2800 |
do_action( 'bbp_unspam_topic', $topic_id );
|
| 2801 |
|
| 2802 |
+
/** Untrash Replies *******************************************************/
|
|
|
|
| 2803 |
|
| 2804 |
+
// Get the replies that were not previously trashed
|
| 2805 |
+
$pre_spammed_replies = get_post_meta( $topic_id, '_bbp_pre_spammed_replies', true );
|
| 2806 |
|
| 2807 |
+
// There are replies to untrash
|
| 2808 |
+
if ( !empty( $pre_spammed_replies ) ) {
|
| 2809 |
|
| 2810 |
+
// Maybe reverse the trashed replies array
|
| 2811 |
+
if ( is_array( $pre_spammed_replies ) )
|
| 2812 |
+
$pre_spammed_replies = array_reverse( $pre_spammed_replies );
|
| 2813 |
+
|
| 2814 |
+
// Loop through replies
|
| 2815 |
+
foreach ( (array) $pre_spammed_replies as $reply ) {
|
| 2816 |
+
wp_untrash_post( $reply );
|
| 2817 |
+
}
|
| 2818 |
+
}
|
| 2819 |
+
|
| 2820 |
+
/** Topic Tags ************************************************************/
|
| 2821 |
|
| 2822 |
// Get pre-spam topic tags
|
| 2823 |
$terms = get_post_meta( $topic_id, '_bbp_spam_topic_tags', true );
|
| 2832 |
delete_post_meta( $topic_id, '_bbp_spam_topic_tags' );
|
| 2833 |
}
|
| 2834 |
|
| 2835 |
+
/** Topic Status **********************************************************/
|
| 2836 |
+
|
| 2837 |
+
// Get pre spam status
|
| 2838 |
+
$topic_status = get_post_meta( $topic_id, '_bbp_spam_meta_status', true );
|
| 2839 |
+
|
| 2840 |
+
// Set post status to pre spam
|
| 2841 |
+
$topic['post_status'] = $topic_status;
|
| 2842 |
+
|
| 2843 |
+
// Delete pre spam meta
|
| 2844 |
+
delete_post_meta( $topic_id, '_bbp_spam_meta_status' );
|
| 2845 |
+
|
| 2846 |
+
// No revisions
|
| 2847 |
+
remove_action( 'pre_post_update', 'wp_save_post_revision' );
|
| 2848 |
+
|
| 2849 |
// Update the topic
|
| 2850 |
$topic_id = wp_insert_post( $topic );
|
| 2851 |
|
| 2991 |
do_action( 'bbp_delete_topic', $topic_id );
|
| 2992 |
|
| 2993 |
// Topic is being permanently deleted, so its replies gotta go too
|
| 2994 |
+
// Note that we get all post statuses here
|
| 2995 |
+
$replies = new WP_Query( array(
|
| 2996 |
'suppress_filters' => true,
|
| 2997 |
'post_type' => bbp_get_reply_post_type(),
|
| 2998 |
+
'post_status' => array_keys( get_post_stati() ),
|
| 2999 |
'post_parent' => $topic_id,
|
| 3000 |
'posts_per_page' => -1,
|
| 3001 |
'nopaging' => true,
|
| 3002 |
'fields' => 'id=>parent'
|
| 3003 |
+
) );
|
| 3004 |
+
|
| 3005 |
+
// Loop through and delete child replies
|
| 3006 |
+
if ( ! empty( $replies->posts ) ) {
|
| 3007 |
foreach ( $replies->posts as $reply ) {
|
| 3008 |
wp_delete_post( $reply->ID, true );
|
| 3009 |
}
|
| 3011 |
// Reset the $post global
|
| 3012 |
wp_reset_postdata();
|
| 3013 |
}
|
| 3014 |
+
|
| 3015 |
+
// Cleanup
|
| 3016 |
+
unset( $replies );
|
| 3017 |
}
|
| 3018 |
|
| 3019 |
/**
|
| 3040 |
do_action( 'bbp_trash_topic', $topic_id );
|
| 3041 |
|
| 3042 |
// Topic is being trashed, so its replies are trashed too
|
| 3043 |
+
$replies = new WP_Query( array(
|
| 3044 |
'suppress_filters' => true,
|
| 3045 |
'post_type' => bbp_get_reply_post_type(),
|
| 3046 |
'post_status' => bbp_get_public_status_id(),
|
| 3048 |
'posts_per_page' => -1,
|
| 3049 |
'nopaging' => true,
|
| 3050 |
'fields' => 'id=>parent'
|
| 3051 |
+
) );
|
| 3052 |
+
|
| 3053 |
+
if ( !empty( $replies->posts ) ) {
|
| 3054 |
|
| 3055 |
// Prevent debug notices
|
| 3056 |
$pre_trashed_replies = array();
|
| 3069 |
// Reset the $post global
|
| 3070 |
wp_reset_postdata();
|
| 3071 |
}
|
| 3072 |
+
|
| 3073 |
+
// Cleanup
|
| 3074 |
+
unset( $replies );
|
| 3075 |
}
|
| 3076 |
|
| 3077 |
/**
|
| 3305 |
<description><?php //?></description>
|
| 3306 |
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s O', current_time( 'mysql' ), false ); ?></pubDate>
|
| 3307 |
<generator>http://bbpress.org/?v=<?php bbp_version(); ?></generator>
|
| 3308 |
+
<language><?php bloginfo_rss( 'language' ); ?></language>
|
| 3309 |
|
| 3310 |
<?php do_action( 'bbp_feed_head' ); ?>
|
| 3311 |
|
includes/topics/template-tags.php
CHANGED
|
@@ -84,23 +84,17 @@ function bbp_show_lead_topic( $show_lead = false ) {
|
|
| 84 |
function bbp_has_topics( $args = '' ) {
|
| 85 |
global $wp_rewrite;
|
| 86 |
|
| 87 |
-
|
| 88 |
-
if ( bbp_get_view_all() ) {
|
| 89 |
-
$post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() );
|
| 90 |
-
} else {
|
| 91 |
-
$post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() );
|
| 92 |
-
}
|
| 93 |
|
|
|
|
| 94 |
$default_topic_search = !empty( $_REQUEST['ts'] ) ? $_REQUEST['ts'] : false;
|
| 95 |
$default_show_stickies = (bool) ( bbp_is_single_forum() || bbp_is_topic_archive() ) && ( false === $default_topic_search );
|
| 96 |
$default_post_parent = bbp_is_single_forum() ? bbp_get_forum_id() : 'any';
|
| 97 |
-
$default_post_status = join( ',', $post_statuses );
|
| 98 |
|
| 99 |
// Default argument array
|
| 100 |
$default = array(
|
| 101 |
'post_type' => bbp_get_topic_post_type(), // Narrow query down to bbPress topics
|
| 102 |
'post_parent' => $default_post_parent, // Forum ID
|
| 103 |
-
'post_status' => $default_post_status, // Post Status
|
| 104 |
'meta_key' => '_bbp_last_active_time', // Make sure topic has some last activity time
|
| 105 |
'orderby' => 'meta_value', // 'meta_value', 'author', 'date', 'title', 'modified', 'parent', rand',
|
| 106 |
'order' => 'DESC', // 'ASC', 'DESC'
|
|
@@ -111,36 +105,63 @@ function bbp_has_topics( $args = '' ) {
|
|
| 111 |
'max_num_pages' => false, // Maximum number of pages to show
|
| 112 |
);
|
| 113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
// Maybe query for topic tags
|
| 115 |
if ( bbp_is_topic_tag() ) {
|
| 116 |
$default['term'] = bbp_get_topic_tag_slug();
|
| 117 |
$default['taxonomy'] = bbp_get_topic_tag_tax_id();
|
| 118 |
}
|
| 119 |
-
$bbp_t = bbp_parse_args( $args, $default, 'has_topics' );
|
| 120 |
|
| 121 |
-
|
| 122 |
-
|
|
|
|
|
|
|
| 123 |
|
| 124 |
// Get bbPress
|
| 125 |
$bbp = bbpress();
|
| 126 |
|
| 127 |
// Call the query
|
| 128 |
-
$bbp->topic_query = new WP_Query( $
|
| 129 |
|
| 130 |
// Set post_parent back to 0 if originally set to 'any'
|
| 131 |
-
if ( 'any' == $
|
| 132 |
-
$
|
| 133 |
|
| 134 |
// Limited the number of pages shown
|
| 135 |
-
if ( !empty( $max_num_pages ) )
|
| 136 |
-
$bbp->topic_query->max_num_pages = $max_num_pages;
|
|
|
|
|
|
|
| 137 |
|
| 138 |
// Put sticky posts at the top of the posts array
|
| 139 |
-
if ( !empty( $show_stickies ) && $paged <= 1 ) {
|
| 140 |
|
| 141 |
// Get super stickies and stickies in this forum
|
| 142 |
$stickies = bbp_get_super_stickies();
|
| 143 |
-
$stickies = !empty( $post_parent ) ? array_merge( $stickies, bbp_get_stickies( $post_parent ) ) : $stickies;
|
| 144 |
$stickies = array_unique( $stickies );
|
| 145 |
|
| 146 |
// We have stickies
|
|
@@ -174,8 +195,8 @@ function bbp_has_topics( $args = '' ) {
|
|
| 174 |
}
|
| 175 |
|
| 176 |
// If any posts have been excluded specifically, Ignore those that are sticky.
|
| 177 |
-
if ( !empty( $stickies ) && !empty( $post__not_in ) ) {
|
| 178 |
-
$stickies = array_diff( $stickies, $post__not_in );
|
| 179 |
}
|
| 180 |
|
| 181 |
// Fetch sticky posts that weren't in the query results
|
|
@@ -185,13 +206,21 @@ function bbp_has_topics( $args = '' ) {
|
|
| 185 |
$sticky_query = array(
|
| 186 |
'post_type' => bbp_get_topic_post_type(),
|
| 187 |
'post_parent' => 'any',
|
| 188 |
-
'post_status' => $default_post_status,
|
| 189 |
'meta_key' => '_bbp_last_active_time',
|
| 190 |
'orderby' => 'meta_value',
|
| 191 |
'order' => 'DESC',
|
| 192 |
'include' => $stickies
|
| 193 |
);
|
| 194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
// Get all stickies
|
| 196 |
$sticky_posts = get_posts( $sticky_query );
|
| 197 |
if ( !empty( $sticky_posts ) ) {
|
|
@@ -222,18 +251,18 @@ function bbp_has_topics( $args = '' ) {
|
|
| 222 |
}
|
| 223 |
|
| 224 |
// If no limit to posts per page, set it to the current post_count
|
| 225 |
-
if ( -1 == $posts_per_page )
|
| 226 |
-
$posts_per_page = $bbp->topic_query->post_count;
|
| 227 |
|
| 228 |
// Add pagination values to query object
|
| 229 |
-
$bbp->topic_query->posts_per_page = $posts_per_page;
|
| 230 |
-
$bbp->topic_query->paged = $paged;
|
| 231 |
|
| 232 |
// Only add pagination if query returned results
|
| 233 |
if ( ( (int) $bbp->topic_query->post_count || (int) $bbp->topic_query->found_posts ) && (int) $bbp->topic_query->posts_per_page ) {
|
| 234 |
|
| 235 |
// Limit the number of topics shown based on maximum allowed pages
|
| 236 |
-
if ( ( !empty( $max_num_pages ) ) && $bbp->topic_query->found_posts > $bbp->topic_query->max_num_pages * $bbp->topic_query->post_count )
|
| 237 |
$bbp->topic_query->found_posts = $bbp->topic_query->max_num_pages * $bbp->topic_query->post_count;
|
| 238 |
|
| 239 |
// If pretty permalinks are enabled, make our pagination pretty
|
|
@@ -273,7 +302,7 @@ function bbp_has_topics( $args = '' ) {
|
|
| 273 |
|
| 274 |
// Default
|
| 275 |
} else {
|
| 276 |
-
$base = get_permalink( $post_parent );
|
| 277 |
}
|
| 278 |
|
| 279 |
// Use pagination base
|
|
@@ -288,15 +317,15 @@ function bbp_has_topics( $args = '' ) {
|
|
| 288 |
$bbp_topic_pagination = apply_filters( 'bbp_topic_pagination', array (
|
| 289 |
'base' => $base,
|
| 290 |
'format' => '',
|
| 291 |
-
'total' => $posts_per_page == $bbp->topic_query->found_posts ? 1 : ceil( (int) $bbp->topic_query->found_posts / (int) $posts_per_page ),
|
| 292 |
'current' => (int) $bbp->topic_query->paged,
|
| 293 |
-
'prev_text' => '←',
|
| 294 |
-
'next_text' => '→',
|
| 295 |
'mid_size' => 1
|
| 296 |
) );
|
| 297 |
|
| 298 |
// Add pagination to query object
|
| 299 |
-
$bbp->topic_query->pagination_links = paginate_links
|
| 300 |
|
| 301 |
// Remove first page from pagination
|
| 302 |
$bbp->topic_query->pagination_links = str_replace( $wp_rewrite->pagination_base . "/1/'", "'", $bbp->topic_query->pagination_links );
|
|
@@ -355,6 +384,7 @@ function bbp_topic_id( $topic_id = 0) {
|
|
| 355 |
*
|
| 356 |
* @param $topic_id Optional. Used to check emptiness
|
| 357 |
* @uses bbPress::topic_query::post::ID To get the topic id
|
|
|
|
| 358 |
* @uses bbp_is_single_topic() To check if it's a topic page
|
| 359 |
* @uses bbp_is_topic_edit() To check if it's a topic edit page
|
| 360 |
* @uses bbp_is_single_reply() To check if it it's a reply page
|
|
@@ -373,28 +403,33 @@ function bbp_topic_id( $topic_id = 0) {
|
|
| 373 |
$bbp = bbpress();
|
| 374 |
|
| 375 |
// Easy empty checking
|
| 376 |
-
if ( !empty( $topic_id ) && is_numeric( $topic_id ) )
|
| 377 |
$bbp_topic_id = $topic_id;
|
| 378 |
|
| 379 |
// Currently inside a topic loop
|
| 380 |
-
elseif ( !empty( $bbp->topic_query->in_the_loop ) && isset( $bbp->topic_query->post->ID ) )
|
| 381 |
$bbp_topic_id = $bbp->topic_query->post->ID;
|
| 382 |
|
| 383 |
-
// Currently
|
| 384 |
-
elseif ( (
|
|
|
|
|
|
|
|
|
|
|
|
|
| 385 |
$bbp_topic_id = $bbp->current_topic_id;
|
| 386 |
|
| 387 |
-
// Currently viewing a topic
|
| 388 |
-
elseif ( ( bbp_is_single_topic() || bbp_is_topic_edit() ) && isset( $wp_query->post->ID ) )
|
| 389 |
$bbp_topic_id = $wp_query->post->ID;
|
| 390 |
|
| 391 |
-
// Currently viewing a
|
| 392 |
-
elseif ( bbp_is_single_reply() )
|
| 393 |
$bbp_topic_id = bbp_get_reply_topic_id();
|
| 394 |
|
| 395 |
// Fallback
|
| 396 |
-
else
|
| 397 |
$bbp_topic_id = 0;
|
|
|
|
| 398 |
|
| 399 |
return (int) apply_filters( 'bbp_get_topic_id', (int) $bbp_topic_id, $topic_id );
|
| 400 |
}
|
|
@@ -668,7 +703,7 @@ function bbp_topic_post_date( $topic_id = 0, $humanize = false, $gmt = false ) {
|
|
| 668 |
* @param bool $gmt Optional. Use GMT
|
| 669 |
* @uses bbp_get_topic_id() To get the topic id
|
| 670 |
* @uses get_post_time() to get the topic post time
|
| 671 |
-
* @uses
|
| 672 |
* @return string
|
| 673 |
*/
|
| 674 |
function bbp_get_topic_post_date( $topic_id = 0, $humanize = false, $gmt = false ) {
|
|
@@ -676,10 +711,10 @@ function bbp_topic_post_date( $topic_id = 0, $humanize = false, $gmt = false ) {
|
|
| 676 |
|
| 677 |
// 4 days, 4 hours ago
|
| 678 |
if ( !empty( $humanize ) ) {
|
| 679 |
-
$
|
| 680 |
-
$date = get_post_time( $gmt, $topic_id );
|
| 681 |
$time = false; // For filter below
|
| 682 |
-
$result =
|
| 683 |
|
| 684 |
// August 4, 2012 at 2:37 pm
|
| 685 |
} else {
|
|
@@ -729,22 +764,22 @@ function bbp_topic_pagination( $args = '' ) {
|
|
| 729 |
function bbp_get_topic_pagination( $args = '' ) {
|
| 730 |
global $wp_rewrite;
|
| 731 |
|
| 732 |
-
|
|
|
|
| 733 |
'topic_id' => bbp_get_topic_id(),
|
| 734 |
'before' => '<span class="bbp-topic-pagination">',
|
| 735 |
'after' => '</span>',
|
| 736 |
-
);
|
| 737 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_pagination' );
|
| 738 |
-
extract( $r );
|
| 739 |
|
| 740 |
// If pretty permalinks are enabled, make our pagination pretty
|
| 741 |
-
if ( $wp_rewrite->using_permalinks() )
|
| 742 |
-
$base = trailingslashit( get_permalink( $topic_id ) ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
|
| 743 |
-
else
|
| 744 |
-
$base = add_query_arg( 'paged', '%#%', get_permalink( $topic_id ) );
|
|
|
|
| 745 |
|
| 746 |
// Get total and add 1 if topic is included in the reply loop
|
| 747 |
-
$total = bbp_get_topic_reply_count( $topic_id, true );
|
| 748 |
|
| 749 |
// Bump if topic is in loop
|
| 750 |
if ( !bbp_show_lead_topic() )
|
|
@@ -774,7 +809,7 @@ function bbp_topic_pagination( $args = '' ) {
|
|
| 774 |
}
|
| 775 |
|
| 776 |
// Add before and after to pagination links
|
| 777 |
-
$pagination_links = $before . $pagination_links . $after;
|
| 778 |
}
|
| 779 |
|
| 780 |
return apply_filters( 'bbp_get_topic_pagination', $pagination_links, $args );
|
|
@@ -1142,10 +1177,11 @@ function bbp_topic_author( $topic_id = 0 ) {
|
|
| 1142 |
function bbp_get_topic_author( $topic_id = 0 ) {
|
| 1143 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 1144 |
|
| 1145 |
-
if ( !bbp_is_topic_anonymous( $topic_id ) )
|
| 1146 |
$author = get_the_author_meta( 'display_name', bbp_get_topic_author_id( $topic_id ) );
|
| 1147 |
-
else
|
| 1148 |
$author = get_post_meta( $topic_id, '_bbp_anonymous_name', true );
|
|
|
|
| 1149 |
|
| 1150 |
return apply_filters( 'bbp_get_topic_author', $author, $topic_id );
|
| 1151 |
}
|
|
@@ -1234,7 +1270,11 @@ function bbp_topic_author_display_name( $topic_id = 0 ) {
|
|
| 1234 |
if ( empty( $author_name ) )
|
| 1235 |
$author_name = __( 'Anonymous', 'bbpress' );
|
| 1236 |
|
| 1237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1238 |
}
|
| 1239 |
|
| 1240 |
/**
|
|
@@ -1314,30 +1354,34 @@ function bbp_topic_author_link( $args = '' ) {
|
|
| 1314 |
* @return string Author link of topic
|
| 1315 |
*/
|
| 1316 |
function bbp_get_topic_author_link( $args = '' ) {
|
| 1317 |
-
|
|
|
|
|
|
|
| 1318 |
'post_id' => 0,
|
| 1319 |
'link_title' => '',
|
| 1320 |
'type' => 'both',
|
| 1321 |
'size' => 80,
|
| 1322 |
'sep' => ' ',
|
| 1323 |
'show_role' => false
|
| 1324 |
-
);
|
| 1325 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_author_link' );
|
| 1326 |
-
extract( $r );
|
| 1327 |
|
| 1328 |
// Used as topic_id
|
| 1329 |
if ( is_numeric( $args ) ) {
|
| 1330 |
$topic_id = bbp_get_topic_id( $args );
|
| 1331 |
} else {
|
| 1332 |
-
$topic_id = bbp_get_topic_id( $post_id );
|
| 1333 |
}
|
| 1334 |
|
| 1335 |
// Topic ID is good
|
| 1336 |
if ( !empty( $topic_id ) ) {
|
| 1337 |
|
| 1338 |
// Tweak link title if empty
|
| 1339 |
-
if ( empty( $link_title ) ) {
|
| 1340 |
$link_title = sprintf( !bbp_is_topic_anonymous( $topic_id ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_topic_author_display_name( $topic_id ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1341 |
}
|
| 1342 |
|
| 1343 |
$link_title = !empty( $link_title ) ? ' title="' . $link_title . '"' : '';
|
|
@@ -1346,17 +1390,17 @@ function bbp_topic_author_link( $args = '' ) {
|
|
| 1346 |
$author_links = array();
|
| 1347 |
|
| 1348 |
// Get avatar
|
| 1349 |
-
if ( 'avatar' == $type || 'both' == $type ) {
|
| 1350 |
-
$author_links['avatar'] = bbp_get_topic_author_avatar( $topic_id, $size );
|
| 1351 |
}
|
| 1352 |
|
| 1353 |
// Get display name
|
| 1354 |
-
if ( 'name' == $type
|
| 1355 |
$author_links['name'] = bbp_get_topic_author_display_name( $topic_id );
|
| 1356 |
}
|
| 1357 |
|
| 1358 |
// Link class
|
| 1359 |
-
$link_class = ' class="bbp-author-' . $type . '"';
|
| 1360 |
|
| 1361 |
// Add links if not anonymous
|
| 1362 |
if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_topic_author_id( $topic_id ) ) ) {
|
|
@@ -1367,15 +1411,15 @@ function bbp_topic_author_link( $args = '' ) {
|
|
| 1367 |
$author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', $author_url, $link_title, $link_class, $link_text );
|
| 1368 |
}
|
| 1369 |
|
| 1370 |
-
if ( true === $show_role ) {
|
| 1371 |
$author_link[] = bbp_get_topic_author_role( array( 'topic_id' => $topic_id ) );
|
| 1372 |
}
|
| 1373 |
|
| 1374 |
-
$author_link = join( $sep, $author_link );
|
| 1375 |
|
| 1376 |
// No links if anonymous
|
| 1377 |
} else {
|
| 1378 |
-
$author_link = join( $sep, $author_links );
|
| 1379 |
}
|
| 1380 |
|
| 1381 |
} else {
|
|
@@ -1509,20 +1553,20 @@ function bbp_topic_author_role( $args = array() ) {
|
|
| 1509 |
* @return string topic author role
|
| 1510 |
*/
|
| 1511 |
function bbp_get_topic_author_role( $args = array() ) {
|
| 1512 |
-
|
|
|
|
|
|
|
| 1513 |
'topic_id' => 0,
|
| 1514 |
'class' => 'bbp-author-role',
|
| 1515 |
'before' => '',
|
| 1516 |
'after' => ''
|
| 1517 |
-
);
|
| 1518 |
-
$args = bbp_parse_args( $args, $defaults, 'get_topic_author_role' );
|
| 1519 |
-
extract( $args, EXTR_SKIP );
|
| 1520 |
|
| 1521 |
-
$topic_id = bbp_get_topic_id( $topic_id );
|
| 1522 |
$role = bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) );
|
| 1523 |
-
$author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $before, $class, $role, $after );
|
| 1524 |
|
| 1525 |
-
return apply_filters( 'bbp_get_topic_author_role', $author_role, $
|
| 1526 |
}
|
| 1527 |
|
| 1528 |
|
|
@@ -1781,10 +1825,11 @@ function bbp_topic_last_reply_url( $topic_id = 0 ) {
|
|
| 1781 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 1782 |
$reply_id = bbp_get_topic_last_reply_id( $topic_id );
|
| 1783 |
|
| 1784 |
-
if ( !empty( $reply_id ) && ( $reply_id != $topic_id ) )
|
| 1785 |
$reply_url = bbp_get_reply_url( $reply_id );
|
| 1786 |
-
else
|
| 1787 |
$reply_url = bbp_get_topic_permalink( $topic_id );
|
|
|
|
| 1788 |
|
| 1789 |
return apply_filters( 'bbp_get_topic_last_reply_url', $reply_url );
|
| 1790 |
}
|
|
@@ -1827,7 +1872,7 @@ function bbp_topic_freshness_link( $topic_id = 0 ) {
|
|
| 1827 |
else
|
| 1828 |
$anchor = __( 'No Replies', 'bbpress' );
|
| 1829 |
|
| 1830 |
-
return apply_filters( 'bbp_get_topic_freshness_link', $anchor, $topic_id );
|
| 1831 |
}
|
| 1832 |
|
| 1833 |
/**
|
|
@@ -2056,13 +2101,12 @@ function bbp_topic_tag_list( $topic_id = 0, $args = '' ) {
|
|
| 2056 |
if ( ! bbp_allow_topic_tags() )
|
| 2057 |
return;
|
| 2058 |
|
| 2059 |
-
|
|
|
|
| 2060 |
'before' => '<div class="bbp-topic-tags"><p>' . __( 'Tagged:', 'bbpress' ) . ' ',
|
| 2061 |
'sep' => ', ',
|
| 2062 |
'after' => '</p></div>'
|
| 2063 |
-
);
|
| 2064 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_tag_list' );
|
| 2065 |
-
extract( $r );
|
| 2066 |
|
| 2067 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2068 |
|
|
@@ -2074,8 +2118,8 @@ function bbp_topic_tag_list( $topic_id = 0, $args = '' ) {
|
|
| 2074 |
|
| 2075 |
// If terms exist, explode them and compile the return value
|
| 2076 |
if ( !empty( $terms ) ) {
|
| 2077 |
-
$terms = implode( $sep, $terms );
|
| 2078 |
-
$retval = $before . $terms . $after;
|
| 2079 |
|
| 2080 |
// No terms so return emty string
|
| 2081 |
} else {
|
|
@@ -2084,7 +2128,7 @@ function bbp_topic_tag_list( $topic_id = 0, $args = '' ) {
|
|
| 2084 |
|
| 2085 |
// Topic is not spam so display a clickable term list
|
| 2086 |
} else {
|
| 2087 |
-
$retval = get_the_term_list( $topic_id, bbp_get_topic_tag_tax_id(), $before, $sep, $after );
|
| 2088 |
}
|
| 2089 |
|
| 2090 |
return $retval;
|
|
@@ -2173,27 +2217,27 @@ function bbp_topic_admin_links( $args = '' ) {
|
|
| 2173 |
if ( !bbp_is_single_topic() )
|
| 2174 |
return;
|
| 2175 |
|
| 2176 |
-
|
|
|
|
| 2177 |
'id' => bbp_get_topic_id(),
|
| 2178 |
'before' => '<span class="bbp-admin-links">',
|
| 2179 |
'after' => '</span>',
|
| 2180 |
'sep' => ' | ',
|
| 2181 |
'links' => array()
|
| 2182 |
-
);
|
| 2183 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_admin_links' );
|
| 2184 |
|
| 2185 |
if ( !current_user_can( 'edit_topic', $r['id'] ) )
|
| 2186 |
return;
|
| 2187 |
|
| 2188 |
if ( empty( $r['links'] ) ) {
|
| 2189 |
-
$r['links'] = array(
|
| 2190 |
'edit' => bbp_get_topic_edit_link ( $r ),
|
| 2191 |
'close' => bbp_get_topic_close_link( $r ),
|
| 2192 |
'stick' => bbp_get_topic_stick_link( $r ),
|
| 2193 |
'merge' => bbp_get_topic_merge_link( $r ),
|
| 2194 |
'trash' => bbp_get_topic_trash_link( $r ),
|
| 2195 |
'spam' => bbp_get_topic_spam_link ( $r ),
|
| 2196 |
-
);
|
| 2197 |
}
|
| 2198 |
|
| 2199 |
// Check caps for trashing the topic
|
|
@@ -2254,16 +2298,16 @@ function bbp_topic_edit_link( $args = '' ) {
|
|
| 2254 |
* @return string Topic edit link
|
| 2255 |
*/
|
| 2256 |
function bbp_get_topic_edit_link( $args = '' ) {
|
| 2257 |
-
|
|
|
|
|
|
|
| 2258 |
'id' => 0,
|
| 2259 |
'link_before' => '',
|
| 2260 |
'link_after' => '',
|
| 2261 |
'edit_text' => __( 'Edit', 'bbpress' )
|
| 2262 |
-
);
|
| 2263 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_edit_link' );
|
| 2264 |
-
extract( $r );
|
| 2265 |
|
| 2266 |
-
$topic = bbp_get_topic( bbp_get_topic_id( (int) $id ) );
|
| 2267 |
|
| 2268 |
// Bypass check if user has caps
|
| 2269 |
if ( !current_user_can( 'edit_others_topics' ) ) {
|
|
@@ -2275,15 +2319,15 @@ function bbp_topic_edit_link( $args = '' ) {
|
|
| 2275 |
}
|
| 2276 |
|
| 2277 |
// Get uri
|
| 2278 |
-
$uri = bbp_get_topic_edit_url( $id );
|
| 2279 |
|
| 2280 |
// Bail if no uri
|
| 2281 |
if ( empty( $uri ) )
|
| 2282 |
return;
|
| 2283 |
|
| 2284 |
-
$retval = $link_before . '<a href="' . $uri . '">' . $edit_text . '</a>' . $link_after;
|
| 2285 |
|
| 2286 |
-
return apply_filters( 'bbp_get_topic_edit_link', $retval, $
|
| 2287 |
}
|
| 2288 |
|
| 2289 |
/**
|
|
@@ -2378,7 +2422,8 @@ function bbp_topic_trash_link( $args = '' ) {
|
|
| 2378 |
*/
|
| 2379 |
function bbp_get_topic_trash_link( $args = '' ) {
|
| 2380 |
|
| 2381 |
-
|
|
|
|
| 2382 |
'id' => 0,
|
| 2383 |
'link_before' => '',
|
| 2384 |
'link_after' => '',
|
|
@@ -2386,31 +2431,29 @@ function bbp_topic_trash_link( $args = '' ) {
|
|
| 2386 |
'trash_text' => __( 'Trash', 'bbpress' ),
|
| 2387 |
'restore_text' => __( 'Restore', 'bbpress' ),
|
| 2388 |
'delete_text' => __( 'Delete', 'bbpress' )
|
| 2389 |
-
);
|
| 2390 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_trash_link' );
|
| 2391 |
-
extract( $r );
|
| 2392 |
|
| 2393 |
$actions = array();
|
| 2394 |
-
$topic = bbp_get_topic( bbp_get_topic_id( (int) $id ) );
|
| 2395 |
|
| 2396 |
if ( empty( $topic ) || !current_user_can( 'delete_topic', $topic->ID ) ) {
|
| 2397 |
return;
|
| 2398 |
}
|
| 2399 |
|
| 2400 |
if ( bbp_is_topic_trash( $topic->ID ) ) {
|
| 2401 |
-
$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'untrash', 'topic_id' => $topic->ID ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) ) . '">' . esc_html( $restore_text ) . '</a>';
|
| 2402 |
} elseif ( EMPTY_TRASH_DAYS ) {
|
| 2403 |
-
$actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'trash', 'topic_id' => $topic->ID ) ), 'trash-' . $topic->post_type . '_' . $topic->ID ) ) . '">' . esc_html( $trash_text ) . '</a>';
|
| 2404 |
}
|
| 2405 |
|
| 2406 |
if ( bbp_is_topic_trash( $topic->ID ) || !EMPTY_TRASH_DAYS ) {
|
| 2407 |
-
$actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'delete', 'topic_id' => $topic->ID ) ), 'delete-' . $topic->post_type . '_' . $topic->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );">' . esc_html( $delete_text ) . '</a>';
|
| 2408 |
}
|
| 2409 |
|
| 2410 |
// Process the admin links
|
| 2411 |
-
$retval = $link_before . implode( $sep, $actions ) . $link_after;
|
| 2412 |
|
| 2413 |
-
return apply_filters( 'bbp_get_topic_trash_link', $retval, $
|
| 2414 |
}
|
| 2415 |
|
| 2416 |
/**
|
|
@@ -2448,28 +2491,28 @@ function bbp_topic_close_link( $args = '' ) {
|
|
| 2448 |
* @return string Topic close link
|
| 2449 |
*/
|
| 2450 |
function bbp_get_topic_close_link( $args = '' ) {
|
| 2451 |
-
|
|
|
|
|
|
|
| 2452 |
'id' => 0,
|
| 2453 |
'link_before' => '',
|
| 2454 |
'link_after' => '',
|
| 2455 |
'sep' => ' | ',
|
| 2456 |
'close_text' => _x( 'Close', 'Topic Status', 'bbpress' ),
|
| 2457 |
'open_text' => _x( 'Open', 'Topic Status', 'bbpress' )
|
| 2458 |
-
);
|
| 2459 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_close_link' );
|
| 2460 |
-
extract( $r );
|
| 2461 |
|
| 2462 |
-
$topic = bbp_get_topic( bbp_get_topic_id( (int) $id ) );
|
| 2463 |
|
| 2464 |
if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
|
| 2465 |
return;
|
| 2466 |
|
| 2467 |
-
$display = bbp_is_topic_open( $topic->ID ) ? $close_text : $open_text;
|
| 2468 |
$uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_close', 'topic_id' => $topic->ID ) );
|
| 2469 |
$uri = esc_url( wp_nonce_url( $uri, 'close-topic_' . $topic->ID ) );
|
| 2470 |
-
$retval = $link_before . '<a href="' . $uri . '">' . $display . '</a>' . $link_after;
|
| 2471 |
|
| 2472 |
-
return apply_filters( 'bbp_get_topic_close_link', $retval, $
|
| 2473 |
}
|
| 2474 |
|
| 2475 |
/**
|
|
@@ -2509,18 +2552,18 @@ function bbp_topic_stick_link( $args = '' ) {
|
|
| 2509 |
* @return string Topic stick link
|
| 2510 |
*/
|
| 2511 |
function bbp_get_topic_stick_link( $args = '' ) {
|
| 2512 |
-
|
|
|
|
|
|
|
| 2513 |
'id' => 0,
|
| 2514 |
'link_before' => '',
|
| 2515 |
'link_after' => '',
|
| 2516 |
'stick_text' => __( 'Stick', 'bbpress' ),
|
| 2517 |
'unstick_text' => __( 'Unstick', 'bbpress' ),
|
| 2518 |
'super_text' => __( 'to front', 'bbpress' ),
|
| 2519 |
-
);
|
| 2520 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_stick_link' );
|
| 2521 |
-
extract( $r );
|
| 2522 |
|
| 2523 |
-
$topic = bbp_get_topic( bbp_get_topic_id( (int) $id ) );
|
| 2524 |
|
| 2525 |
if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
|
| 2526 |
return;
|
|
@@ -2530,22 +2573,22 @@ function bbp_topic_stick_link( $args = '' ) {
|
|
| 2530 |
$stick_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID ) );
|
| 2531 |
$stick_uri = esc_url( wp_nonce_url( $stick_uri, 'stick-topic_' . $topic->ID ) );
|
| 2532 |
|
| 2533 |
-
$stick_display = true == $is_sticky ? $unstick_text : $stick_text;
|
| 2534 |
$stick_display = '<a href="' . $stick_uri . '">' . $stick_display . '</a>';
|
| 2535 |
|
| 2536 |
if ( empty( $is_sticky ) ) {
|
| 2537 |
$super_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID, 'super' => 1 ) );
|
| 2538 |
$super_uri = esc_url( wp_nonce_url( $super_uri, 'stick-topic_' . $topic->ID ) );
|
| 2539 |
|
| 2540 |
-
$super_display = ' (<a href="' . $super_uri . '">' . $super_text . '</a>)';
|
| 2541 |
} else {
|
| 2542 |
$super_display = '';
|
| 2543 |
}
|
| 2544 |
|
| 2545 |
// Combine the HTML into 1 string
|
| 2546 |
-
$retval = $link_before . $stick_display . $super_display . $link_after;
|
| 2547 |
|
| 2548 |
-
return apply_filters( 'bbp_get_topic_stick_link', $retval, $
|
| 2549 |
}
|
| 2550 |
|
| 2551 |
/**
|
|
@@ -2580,22 +2623,22 @@ function bbp_topic_merge_link( $args = '' ) {
|
|
| 2580 |
* @return string Topic merge link
|
| 2581 |
*/
|
| 2582 |
function bbp_get_topic_merge_link( $args = '' ) {
|
| 2583 |
-
|
|
|
|
|
|
|
| 2584 |
'id' => 0,
|
| 2585 |
'link_before' => '',
|
| 2586 |
'link_after' => '',
|
| 2587 |
'merge_text' => __( 'Merge', 'bbpress' ),
|
| 2588 |
-
);
|
| 2589 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_merge_link' );
|
| 2590 |
-
extract( $r );
|
| 2591 |
|
| 2592 |
-
$topic = bbp_get_topic( bbp_get_topic_id( (int) $id ) );
|
| 2593 |
|
| 2594 |
if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
|
| 2595 |
return;
|
| 2596 |
|
| 2597 |
$uri = esc_url( add_query_arg( array( 'action' => 'merge' ), bbp_get_topic_edit_url( $topic->ID ) ) );
|
| 2598 |
-
$retval = $link_before . '<a href="' . $uri . '">' . $merge_text . '</a>' . $link_after;
|
| 2599 |
|
| 2600 |
return apply_filters( 'bbp_get_topic_merge_link', $retval, $args );
|
| 2601 |
}
|
|
@@ -2635,28 +2678,28 @@ function bbp_topic_spam_link( $args = '' ) {
|
|
| 2635 |
* @return string Topic spam link
|
| 2636 |
*/
|
| 2637 |
function bbp_get_topic_spam_link( $args = '' ) {
|
| 2638 |
-
|
|
|
|
|
|
|
| 2639 |
'id' => 0,
|
| 2640 |
'link_before' => '',
|
| 2641 |
'link_after' => '',
|
| 2642 |
'sep' => ' | ',
|
| 2643 |
'spam_text' => __( 'Spam', 'bbpress' ),
|
| 2644 |
'unspam_text' => __( 'Unspam', 'bbpress' )
|
| 2645 |
-
);
|
| 2646 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_spam_link' );
|
| 2647 |
-
extract( $r );
|
| 2648 |
|
| 2649 |
-
$topic = bbp_get_topic( bbp_get_topic_id( (int) $id ) );
|
| 2650 |
|
| 2651 |
if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
|
| 2652 |
return;
|
| 2653 |
|
| 2654 |
-
$display = bbp_is_topic_spam( $topic->ID ) ? $unspam_text : $spam_text;
|
| 2655 |
$uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_spam', 'topic_id' => $topic->ID ) );
|
| 2656 |
$uri = esc_url( wp_nonce_url( $uri, 'spam-topic_' . $topic->ID ) );
|
| 2657 |
-
$retval = $link_before . '<a href="' . $uri . '">' . $display . '</a>' . $link_after;
|
| 2658 |
|
| 2659 |
-
return apply_filters( 'bbp_get_topic_spam_link', $retval, $
|
| 2660 |
}
|
| 2661 |
|
| 2662 |
/** Topic Pagination **********************************************************/
|
|
@@ -2802,26 +2845,25 @@ function bbp_topic_notices() {
|
|
| 2802 |
*/
|
| 2803 |
function bbp_topic_type_select( $args = '' ) {
|
| 2804 |
|
| 2805 |
-
|
|
|
|
| 2806 |
'unstick_text' => __( 'Normal', 'bbpress' ),
|
| 2807 |
'stick_text' => __( 'Sticky', 'bbpress' ),
|
| 2808 |
'super_text' => __( 'Super Sticky', 'bbpress' ),
|
| 2809 |
'select_id' => 'bbp_stick_topic',
|
| 2810 |
'tab' => bbp_get_tab_index(),
|
| 2811 |
'topic_id' => 0
|
| 2812 |
-
);
|
| 2813 |
-
$r = bbp_parse_args( $args, $defaults, 'topic_type_select' );
|
| 2814 |
-
extract( $r );
|
| 2815 |
|
| 2816 |
// Edit topic
|
| 2817 |
if ( bbp_is_single_topic() || bbp_is_topic_edit() ) {
|
| 2818 |
|
| 2819 |
// Get current topic id
|
| 2820 |
-
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2821 |
|
| 2822 |
// Post value is passed
|
| 2823 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST[$select_id] ) ) {
|
| 2824 |
-
$sticky_current = $_POST[$select_id];
|
| 2825 |
|
| 2826 |
// Topic is super sticky
|
| 2827 |
} elseif ( bbp_is_topic_super_sticky( $topic_id ) ) {
|
|
@@ -2836,8 +2878,8 @@ function bbp_topic_type_select( $args = '' ) {
|
|
| 2836 |
} else {
|
| 2837 |
|
| 2838 |
// Post value is passed
|
| 2839 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST[$select_id] ) ) {
|
| 2840 |
-
$sticky_current = $_POST[$select_id];
|
| 2841 |
|
| 2842 |
// Default to unstick
|
| 2843 |
} else {
|
|
@@ -2846,19 +2888,19 @@ function bbp_topic_type_select( $args = '' ) {
|
|
| 2846 |
}
|
| 2847 |
|
| 2848 |
// Used variables
|
| 2849 |
-
$tab = !empty( $tab ) ? ' tabindex="' . $tab . '"' : '';
|
| 2850 |
-
$select_id = esc_attr( $select_id );
|
| 2851 |
$sticky_statuses = array (
|
| 2852 |
-
'unstick' => $unstick_text,
|
| 2853 |
-
'stick' => $stick_text,
|
| 2854 |
-
'super' => $super_text,
|
| 2855 |
); ?>
|
| 2856 |
|
| 2857 |
<select name="<?php echo $select_id; ?>" id="<?php echo $select_id; ?>"<?php echo $tab; ?>>
|
| 2858 |
|
| 2859 |
<?php foreach ( $sticky_statuses as $sticky_status => $label ) : ?>
|
| 2860 |
|
| 2861 |
-
<option value="<?php echo $sticky_status; ?>"<?php selected( $sticky_current, $sticky_status ); ?>><?php echo $label; ?></option>
|
| 2862 |
|
| 2863 |
<?php endforeach; ?>
|
| 2864 |
|
|
@@ -2904,34 +2946,33 @@ function bbp_single_topic_description( $args = '' ) {
|
|
| 2904 |
*/
|
| 2905 |
function bbp_get_single_topic_description( $args = '' ) {
|
| 2906 |
|
| 2907 |
-
//
|
| 2908 |
-
$
|
| 2909 |
'topic_id' => 0,
|
| 2910 |
'before' => '<div class="bbp-template-notice info"><p class="bbp-topic-description">',
|
| 2911 |
'after' => '</p></div>',
|
| 2912 |
'size' => 14
|
| 2913 |
-
);
|
| 2914 |
-
$r = bbp_parse_args( $args, $defaults, 'get_single_topic_description' );
|
| 2915 |
-
extract( $r );
|
| 2916 |
|
| 2917 |
// Validate topic_id
|
| 2918 |
-
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2919 |
|
| 2920 |
// Unhook the 'view all' query var adder
|
| 2921 |
remove_filter( 'bbp_get_topic_permalink', 'bbp_add_view_all' );
|
| 2922 |
|
| 2923 |
// Build the topic description
|
| 2924 |
-
$
|
| 2925 |
-
$
|
| 2926 |
-
$
|
|
|
|
| 2927 |
|
| 2928 |
// Singular/Plural
|
| 2929 |
-
$voice_count = sprintf( _n( '%s voice', '%s voices', $
|
| 2930 |
|
| 2931 |
// Topic has replies
|
| 2932 |
$last_reply = bbp_get_topic_last_active_id( $topic_id );
|
| 2933 |
if ( !empty( $last_reply ) ) {
|
| 2934 |
-
$last_updated_by = bbp_get_author_link( array( 'post_id' => $last_reply, 'size' => $size ) );
|
| 2935 |
$retstr = sprintf( __( 'This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $reply_count, $voice_count, $last_updated_by, $time_since );
|
| 2936 |
|
| 2937 |
// Topic has no replies
|
|
@@ -2947,10 +2988,10 @@ function bbp_single_topic_description( $args = '' ) {
|
|
| 2947 |
add_filter( 'bbp_get_topic_permalink', 'bbp_add_view_all' );
|
| 2948 |
|
| 2949 |
// Combine the elements together
|
| 2950 |
-
$retstr = $before . $retstr . $after;
|
| 2951 |
|
| 2952 |
// Return filtered result
|
| 2953 |
-
return apply_filters( 'bbp_get_single_topic_description', $retstr, $
|
| 2954 |
}
|
| 2955 |
|
| 2956 |
/** Topic Tags ****************************************************************/
|
|
@@ -3233,33 +3274,32 @@ function bbp_topic_tag_description( $args = array() ) {
|
|
| 3233 |
*/
|
| 3234 |
function bbp_get_topic_tag_description( $args = array() ) {
|
| 3235 |
|
| 3236 |
-
|
|
|
|
| 3237 |
'before' => '<div class="bbp-topic-tag-description"><p>',
|
| 3238 |
'after' => '</p></div>',
|
| 3239 |
'tag' => ''
|
| 3240 |
-
);
|
| 3241 |
-
$r = bbp_parse_args( $args, $defaults, 'get_topic_tag_description' );
|
| 3242 |
-
extract( $r );
|
| 3243 |
|
| 3244 |
// Get the term
|
| 3245 |
-
if ( ! empty( $tag ) ) {
|
| 3246 |
-
$term = get_term_by( 'slug', $tag, bbp_get_topic_tag_tax_id() );
|
| 3247 |
} else {
|
| 3248 |
-
$tag
|
| 3249 |
-
$
|
| 3250 |
-
$term
|
| 3251 |
}
|
| 3252 |
|
| 3253 |
// Add before and after if description exists
|
| 3254 |
if ( !empty( $term->description ) ) {
|
| 3255 |
-
$retval = $before . $term->description . $after;
|
| 3256 |
|
| 3257 |
// No description, no HTML
|
| 3258 |
} else {
|
| 3259 |
$retval = '';
|
| 3260 |
}
|
| 3261 |
|
| 3262 |
-
return apply_filters( 'bbp_get_topic_tag_description', $retval, $
|
| 3263 |
}
|
| 3264 |
|
| 3265 |
/** Forms *********************************************************************/
|
|
@@ -3286,16 +3326,17 @@ function bbp_form_topic_title() {
|
|
| 3286 |
function bbp_get_form_topic_title() {
|
| 3287 |
|
| 3288 |
// Get _POST data
|
| 3289 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_topic_title'] ) )
|
| 3290 |
$topic_title = $_POST['bbp_topic_title'];
|
| 3291 |
|
| 3292 |
// Get edit data
|
| 3293 |
-
elseif ( bbp_is_topic_edit() )
|
| 3294 |
$topic_title = bbp_get_global_post_field( 'post_title', 'raw' );
|
| 3295 |
|
| 3296 |
// No data
|
| 3297 |
-
else
|
| 3298 |
$topic_title = '';
|
|
|
|
| 3299 |
|
| 3300 |
return apply_filters( 'bbp_get_form_topic_title', esc_attr( $topic_title ) );
|
| 3301 |
}
|
|
@@ -3322,16 +3363,17 @@ function bbp_form_topic_content() {
|
|
| 3322 |
function bbp_get_form_topic_content() {
|
| 3323 |
|
| 3324 |
// Get _POST data
|
| 3325 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_topic_content'] ) )
|
| 3326 |
$topic_content = $_POST['bbp_topic_content'];
|
| 3327 |
|
| 3328 |
// Get edit data
|
| 3329 |
-
elseif ( bbp_is_topic_edit() )
|
| 3330 |
$topic_content = bbp_get_global_post_field( 'post_content', 'raw' );
|
| 3331 |
|
| 3332 |
// No data
|
| 3333 |
-
else
|
| 3334 |
$topic_content = '';
|
|
|
|
| 3335 |
|
| 3336 |
return apply_filters( 'bbp_get_form_topic_content', esc_textarea( $topic_content ) );
|
| 3337 |
}
|
|
@@ -3451,18 +3493,19 @@ function bbp_form_topic_forum() {
|
|
| 3451 |
function bbp_get_form_topic_forum() {
|
| 3452 |
|
| 3453 |
// Get _POST data
|
| 3454 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_id'] ) )
|
| 3455 |
$topic_forum = (int) $_POST['bbp_forum_id'];
|
| 3456 |
|
| 3457 |
// Get edit data
|
| 3458 |
-
elseif ( bbp_is_topic_edit() )
|
| 3459 |
$topic_forum = bbp_get_topic_forum_id();
|
| 3460 |
|
| 3461 |
// No data
|
| 3462 |
-
else
|
| 3463 |
$topic_forum = 0;
|
|
|
|
| 3464 |
|
| 3465 |
-
return apply_filters( 'bbp_get_form_topic_forum',
|
| 3466 |
}
|
| 3467 |
|
| 3468 |
/**
|
|
@@ -3545,13 +3588,15 @@ function bbp_form_topic_log_edit() {
|
|
| 3545 |
function bbp_get_form_topic_log_edit() {
|
| 3546 |
|
| 3547 |
// Get _POST data
|
| 3548 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_log_topic_edit'] ) )
|
| 3549 |
-
$topic_revision = (
|
| 3550 |
|
| 3551 |
// No data
|
| 3552 |
-
else
|
| 3553 |
-
$topic_revision =
|
|
|
|
| 3554 |
|
|
|
|
| 3555 |
$checked = checked( $topic_revision, true, false );
|
| 3556 |
|
| 3557 |
return apply_filters( 'bbp_get_form_topic_log_edit', $checked, $topic_revision );
|
|
@@ -3579,12 +3624,13 @@ function bbp_form_topic_edit_reason() {
|
|
| 3579 |
function bbp_get_form_topic_edit_reason() {
|
| 3580 |
|
| 3581 |
// Get _POST data
|
| 3582 |
-
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_topic_edit_reason'] ) )
|
| 3583 |
$topic_edit_reason = $_POST['bbp_topic_edit_reason'];
|
| 3584 |
|
| 3585 |
// No data
|
| 3586 |
-
else
|
| 3587 |
$topic_edit_reason = '';
|
|
|
|
| 3588 |
|
| 3589 |
return apply_filters( 'bbp_get_form_topic_edit_reason', esc_attr( $topic_edit_reason ) );
|
| 3590 |
}
|
| 84 |
function bbp_has_topics( $args = '' ) {
|
| 85 |
global $wp_rewrite;
|
| 86 |
|
| 87 |
+
/** Defaults **************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
+
// Other defaults
|
| 90 |
$default_topic_search = !empty( $_REQUEST['ts'] ) ? $_REQUEST['ts'] : false;
|
| 91 |
$default_show_stickies = (bool) ( bbp_is_single_forum() || bbp_is_topic_archive() ) && ( false === $default_topic_search );
|
| 92 |
$default_post_parent = bbp_is_single_forum() ? bbp_get_forum_id() : 'any';
|
|
|
|
| 93 |
|
| 94 |
// Default argument array
|
| 95 |
$default = array(
|
| 96 |
'post_type' => bbp_get_topic_post_type(), // Narrow query down to bbPress topics
|
| 97 |
'post_parent' => $default_post_parent, // Forum ID
|
|
|
|
| 98 |
'meta_key' => '_bbp_last_active_time', // Make sure topic has some last activity time
|
| 99 |
'orderby' => 'meta_value', // 'meta_value', 'author', 'date', 'title', 'modified', 'parent', rand',
|
| 100 |
'order' => 'DESC', // 'ASC', 'DESC'
|
| 105 |
'max_num_pages' => false, // Maximum number of pages to show
|
| 106 |
);
|
| 107 |
|
| 108 |
+
// What are the default allowed statuses (based on user caps)
|
| 109 |
+
if ( bbp_get_view_all() ) {
|
| 110 |
+
|
| 111 |
+
// Default view=all statuses
|
| 112 |
+
$post_statuses = array(
|
| 113 |
+
bbp_get_public_status_id(),
|
| 114 |
+
bbp_get_closed_status_id(),
|
| 115 |
+
bbp_get_spam_status_id(),
|
| 116 |
+
bbp_get_trash_status_id()
|
| 117 |
+
);
|
| 118 |
+
|
| 119 |
+
// Add support for private status
|
| 120 |
+
if ( current_user_can( 'read_private_topics' ) ) {
|
| 121 |
+
$post_statuses[] = bbp_get_private_status_id();
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
// Join post statuses together
|
| 125 |
+
$default['post_status'] = join( ',', $post_statuses );
|
| 126 |
+
|
| 127 |
+
// Lean on the 'perm' query var value of 'readable' to provide statuses
|
| 128 |
+
} else {
|
| 129 |
+
$default['perm'] = 'readable';
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
// Maybe query for topic tags
|
| 133 |
if ( bbp_is_topic_tag() ) {
|
| 134 |
$default['term'] = bbp_get_topic_tag_slug();
|
| 135 |
$default['taxonomy'] = bbp_get_topic_tag_tax_id();
|
| 136 |
}
|
|
|
|
| 137 |
|
| 138 |
+
/** Setup *****************************************************************/
|
| 139 |
+
|
| 140 |
+
// Parse arguments against default values
|
| 141 |
+
$r = bbp_parse_args( $args, $default, 'has_topics' );
|
| 142 |
|
| 143 |
// Get bbPress
|
| 144 |
$bbp = bbpress();
|
| 145 |
|
| 146 |
// Call the query
|
| 147 |
+
$bbp->topic_query = new WP_Query( $r );
|
| 148 |
|
| 149 |
// Set post_parent back to 0 if originally set to 'any'
|
| 150 |
+
if ( 'any' == $r['post_parent'] )
|
| 151 |
+
$r['post_parent'] = 0;
|
| 152 |
|
| 153 |
// Limited the number of pages shown
|
| 154 |
+
if ( !empty( $r['max_num_pages'] ) )
|
| 155 |
+
$bbp->topic_query->max_num_pages = $r['max_num_pages'];
|
| 156 |
+
|
| 157 |
+
/** Stickies **************************************************************/
|
| 158 |
|
| 159 |
// Put sticky posts at the top of the posts array
|
| 160 |
+
if ( !empty( $r['show_stickies'] ) && $r['paged'] <= 1 ) {
|
| 161 |
|
| 162 |
// Get super stickies and stickies in this forum
|
| 163 |
$stickies = bbp_get_super_stickies();
|
| 164 |
+
$stickies = !empty( $r['post_parent'] ) ? array_merge( $stickies, bbp_get_stickies( $r['post_parent'] ) ) : $stickies;
|
| 165 |
$stickies = array_unique( $stickies );
|
| 166 |
|
| 167 |
// We have stickies
|
| 195 |
}
|
| 196 |
|
| 197 |
// If any posts have been excluded specifically, Ignore those that are sticky.
|
| 198 |
+
if ( !empty( $stickies ) && !empty( $r['post__not_in'] ) ) {
|
| 199 |
+
$stickies = array_diff( $stickies, $r['post__not_in'] );
|
| 200 |
}
|
| 201 |
|
| 202 |
// Fetch sticky posts that weren't in the query results
|
| 206 |
$sticky_query = array(
|
| 207 |
'post_type' => bbp_get_topic_post_type(),
|
| 208 |
'post_parent' => 'any',
|
|
|
|
| 209 |
'meta_key' => '_bbp_last_active_time',
|
| 210 |
'orderby' => 'meta_value',
|
| 211 |
'order' => 'DESC',
|
| 212 |
'include' => $stickies
|
| 213 |
);
|
| 214 |
|
| 215 |
+
// What are the default allowed statuses (based on user caps)
|
| 216 |
+
if ( bbp_get_view_all() ) {
|
| 217 |
+
$sticky_query['post_status'] = $r['post_status'];
|
| 218 |
+
|
| 219 |
+
// Lean on the 'perm' query var value of 'readable' to provide statuses
|
| 220 |
+
} else {
|
| 221 |
+
$sticky_query['post_status'] = $r['perm'];
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
// Get all stickies
|
| 225 |
$sticky_posts = get_posts( $sticky_query );
|
| 226 |
if ( !empty( $sticky_posts ) ) {
|
| 251 |
}
|
| 252 |
|
| 253 |
// If no limit to posts per page, set it to the current post_count
|
| 254 |
+
if ( -1 == $r['posts_per_page'] )
|
| 255 |
+
$r['posts_per_page'] = $bbp->topic_query->post_count;
|
| 256 |
|
| 257 |
// Add pagination values to query object
|
| 258 |
+
$bbp->topic_query->posts_per_page = $r['posts_per_page'];
|
| 259 |
+
$bbp->topic_query->paged = $r['paged'];
|
| 260 |
|
| 261 |
// Only add pagination if query returned results
|
| 262 |
if ( ( (int) $bbp->topic_query->post_count || (int) $bbp->topic_query->found_posts ) && (int) $bbp->topic_query->posts_per_page ) {
|
| 263 |
|
| 264 |
// Limit the number of topics shown based on maximum allowed pages
|
| 265 |
+
if ( ( !empty( $r['max_num_pages'] ) ) && $bbp->topic_query->found_posts > $bbp->topic_query->max_num_pages * $bbp->topic_query->post_count )
|
| 266 |
$bbp->topic_query->found_posts = $bbp->topic_query->max_num_pages * $bbp->topic_query->post_count;
|
| 267 |
|
| 268 |
// If pretty permalinks are enabled, make our pagination pretty
|
| 302 |
|
| 303 |
// Default
|
| 304 |
} else {
|
| 305 |
+
$base = get_permalink( (int) $r['post_parent'] );
|
| 306 |
}
|
| 307 |
|
| 308 |
// Use pagination base
|
| 317 |
$bbp_topic_pagination = apply_filters( 'bbp_topic_pagination', array (
|
| 318 |
'base' => $base,
|
| 319 |
'format' => '',
|
| 320 |
+
'total' => $r['posts_per_page'] == $bbp->topic_query->found_posts ? 1 : ceil( (int) $bbp->topic_query->found_posts / (int) $r['posts_per_page'] ),
|
| 321 |
'current' => (int) $bbp->topic_query->paged,
|
| 322 |
+
'prev_text' => is_rtl() ? '→' : '←',
|
| 323 |
+
'next_text' => is_rtl() ? '←' : '→',
|
| 324 |
'mid_size' => 1
|
| 325 |
) );
|
| 326 |
|
| 327 |
// Add pagination to query object
|
| 328 |
+
$bbp->topic_query->pagination_links = paginate_links( $bbp_topic_pagination );
|
| 329 |
|
| 330 |
// Remove first page from pagination
|
| 331 |
$bbp->topic_query->pagination_links = str_replace( $wp_rewrite->pagination_base . "/1/'", "'", $bbp->topic_query->pagination_links );
|
| 384 |
*
|
| 385 |
* @param $topic_id Optional. Used to check emptiness
|
| 386 |
* @uses bbPress::topic_query::post::ID To get the topic id
|
| 387 |
+
* @uses bbp_is_topic() To check if the search result is a topic
|
| 388 |
* @uses bbp_is_single_topic() To check if it's a topic page
|
| 389 |
* @uses bbp_is_topic_edit() To check if it's a topic edit page
|
| 390 |
* @uses bbp_is_single_reply() To check if it it's a reply page
|
| 403 |
$bbp = bbpress();
|
| 404 |
|
| 405 |
// Easy empty checking
|
| 406 |
+
if ( !empty( $topic_id ) && is_numeric( $topic_id ) ) {
|
| 407 |
$bbp_topic_id = $topic_id;
|
| 408 |
|
| 409 |
// Currently inside a topic loop
|
| 410 |
+
} elseif ( !empty( $bbp->topic_query->in_the_loop ) && isset( $bbp->topic_query->post->ID ) ) {
|
| 411 |
$bbp_topic_id = $bbp->topic_query->post->ID;
|
| 412 |
|
| 413 |
+
// Currently inside a search loop
|
| 414 |
+
} elseif ( !empty( $bbp->search_query->in_the_loop ) && isset( $bbp->search_query->post->ID ) && bbp_is_topic( $bbp->search_query->post->ID ) ) {
|
| 415 |
+
$bbp_topic_id = $bbp->search_query->post->ID;
|
| 416 |
+
|
| 417 |
+
// Currently viewing/editing a topic, likely alone
|
| 418 |
+
} elseif ( ( bbp_is_single_topic() || bbp_is_topic_edit() ) && !empty( $bbp->current_topic_id ) ) {
|
| 419 |
$bbp_topic_id = $bbp->current_topic_id;
|
| 420 |
|
| 421 |
+
// Currently viewing/editing a topic, likely in a loop
|
| 422 |
+
} elseif ( ( bbp_is_single_topic() || bbp_is_topic_edit() ) && isset( $wp_query->post->ID ) ) {
|
| 423 |
$bbp_topic_id = $wp_query->post->ID;
|
| 424 |
|
| 425 |
+
// Currently viewing/editing a reply
|
| 426 |
+
} elseif ( bbp_is_single_reply() || bbp_is_reply_edit() ) {
|
| 427 |
$bbp_topic_id = bbp_get_reply_topic_id();
|
| 428 |
|
| 429 |
// Fallback
|
| 430 |
+
} else {
|
| 431 |
$bbp_topic_id = 0;
|
| 432 |
+
}
|
| 433 |
|
| 434 |
return (int) apply_filters( 'bbp_get_topic_id', (int) $bbp_topic_id, $topic_id );
|
| 435 |
}
|
| 703 |
* @param bool $gmt Optional. Use GMT
|
| 704 |
* @uses bbp_get_topic_id() To get the topic id
|
| 705 |
* @uses get_post_time() to get the topic post time
|
| 706 |
+
* @uses bbp_get_time_since() to maybe humanize the topic post time
|
| 707 |
* @return string
|
| 708 |
*/
|
| 709 |
function bbp_get_topic_post_date( $topic_id = 0, $humanize = false, $gmt = false ) {
|
| 711 |
|
| 712 |
// 4 days, 4 hours ago
|
| 713 |
if ( !empty( $humanize ) ) {
|
| 714 |
+
$gmt_s = !empty( $gmt ) ? 'U' : 'G';
|
| 715 |
+
$date = get_post_time( $gmt_s, $gmt, $topic_id );
|
| 716 |
$time = false; // For filter below
|
| 717 |
+
$result = bbp_get_time_since( $date );
|
| 718 |
|
| 719 |
// August 4, 2012 at 2:37 pm
|
| 720 |
} else {
|
| 764 |
function bbp_get_topic_pagination( $args = '' ) {
|
| 765 |
global $wp_rewrite;
|
| 766 |
|
| 767 |
+
// Parse arguments against default values
|
| 768 |
+
$r = bbp_parse_args( $args, array(
|
| 769 |
'topic_id' => bbp_get_topic_id(),
|
| 770 |
'before' => '<span class="bbp-topic-pagination">',
|
| 771 |
'after' => '</span>',
|
| 772 |
+
), 'get_topic_pagination' );
|
|
|
|
|
|
|
| 773 |
|
| 774 |
// If pretty permalinks are enabled, make our pagination pretty
|
| 775 |
+
if ( $wp_rewrite->using_permalinks() ) {
|
| 776 |
+
$base = trailingslashit( get_permalink( $r['topic_id'] ) ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
|
| 777 |
+
} else {
|
| 778 |
+
$base = add_query_arg( 'paged', '%#%', get_permalink( $r['topic_id'] ) );
|
| 779 |
+
}
|
| 780 |
|
| 781 |
// Get total and add 1 if topic is included in the reply loop
|
| 782 |
+
$total = bbp_get_topic_reply_count( $r['topic_id'], true );
|
| 783 |
|
| 784 |
// Bump if topic is in loop
|
| 785 |
if ( !bbp_show_lead_topic() )
|
| 809 |
}
|
| 810 |
|
| 811 |
// Add before and after to pagination links
|
| 812 |
+
$pagination_links = $r['before'] . $pagination_links . $r['after'];
|
| 813 |
}
|
| 814 |
|
| 815 |
return apply_filters( 'bbp_get_topic_pagination', $pagination_links, $args );
|
| 1177 |
function bbp_get_topic_author( $topic_id = 0 ) {
|
| 1178 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 1179 |
|
| 1180 |
+
if ( !bbp_is_topic_anonymous( $topic_id ) ) {
|
| 1181 |
$author = get_the_author_meta( 'display_name', bbp_get_topic_author_id( $topic_id ) );
|
| 1182 |
+
} else {
|
| 1183 |
$author = get_post_meta( $topic_id, '_bbp_anonymous_name', true );
|
| 1184 |
+
}
|
| 1185 |
|
| 1186 |
return apply_filters( 'bbp_get_topic_author', $author, $topic_id );
|
| 1187 |
}
|
| 1270 |
if ( empty( $author_name ) )
|
| 1271 |
$author_name = __( 'Anonymous', 'bbpress' );
|
| 1272 |
|
| 1273 |
+
// Encode possible UTF8 display names
|
| 1274 |
+
if ( seems_utf8( $author_name ) === false )
|
| 1275 |
+
$author_name = utf8_encode( $author_name );
|
| 1276 |
+
|
| 1277 |
+
return apply_filters( 'bbp_get_topic_author_display_name', $author_name, $topic_id );
|
| 1278 |
}
|
| 1279 |
|
| 1280 |
/**
|
| 1354 |
* @return string Author link of topic
|
| 1355 |
*/
|
| 1356 |
function bbp_get_topic_author_link( $args = '' ) {
|
| 1357 |
+
|
| 1358 |
+
// Parse arguments against default values
|
| 1359 |
+
$r = bbp_parse_args( $args, array(
|
| 1360 |
'post_id' => 0,
|
| 1361 |
'link_title' => '',
|
| 1362 |
'type' => 'both',
|
| 1363 |
'size' => 80,
|
| 1364 |
'sep' => ' ',
|
| 1365 |
'show_role' => false
|
| 1366 |
+
), 'get_topic_author_link' );
|
|
|
|
|
|
|
| 1367 |
|
| 1368 |
// Used as topic_id
|
| 1369 |
if ( is_numeric( $args ) ) {
|
| 1370 |
$topic_id = bbp_get_topic_id( $args );
|
| 1371 |
} else {
|
| 1372 |
+
$topic_id = bbp_get_topic_id( $r['post_id'] );
|
| 1373 |
}
|
| 1374 |
|
| 1375 |
// Topic ID is good
|
| 1376 |
if ( !empty( $topic_id ) ) {
|
| 1377 |
|
| 1378 |
// Tweak link title if empty
|
| 1379 |
+
if ( empty( $r['link_title'] ) ) {
|
| 1380 |
$link_title = sprintf( !bbp_is_topic_anonymous( $topic_id ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_topic_author_display_name( $topic_id ) );
|
| 1381 |
+
|
| 1382 |
+
// Use what was passed if not
|
| 1383 |
+
} else {
|
| 1384 |
+
$link_title = $r['link_title'];
|
| 1385 |
}
|
| 1386 |
|
| 1387 |
$link_title = !empty( $link_title ) ? ' title="' . $link_title . '"' : '';
|
| 1390 |
$author_links = array();
|
| 1391 |
|
| 1392 |
// Get avatar
|
| 1393 |
+
if ( 'avatar' == $r['type'] || 'both' == $r['type'] ) {
|
| 1394 |
+
$author_links['avatar'] = bbp_get_topic_author_avatar( $topic_id, $r['size'] );
|
| 1395 |
}
|
| 1396 |
|
| 1397 |
// Get display name
|
| 1398 |
+
if ( 'name' == $r['type'] || 'both' == $r['type'] ) {
|
| 1399 |
$author_links['name'] = bbp_get_topic_author_display_name( $topic_id );
|
| 1400 |
}
|
| 1401 |
|
| 1402 |
// Link class
|
| 1403 |
+
$link_class = ' class="bbp-author-' . $r['type'] . '"';
|
| 1404 |
|
| 1405 |
// Add links if not anonymous
|
| 1406 |
if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_topic_author_id( $topic_id ) ) ) {
|
| 1411 |
$author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', $author_url, $link_title, $link_class, $link_text );
|
| 1412 |
}
|
| 1413 |
|
| 1414 |
+
if ( true === $r['show_role'] ) {
|
| 1415 |
$author_link[] = bbp_get_topic_author_role( array( 'topic_id' => $topic_id ) );
|
| 1416 |
}
|
| 1417 |
|
| 1418 |
+
$author_link = join( $r['sep'], $author_link );
|
| 1419 |
|
| 1420 |
// No links if anonymous
|
| 1421 |
} else {
|
| 1422 |
+
$author_link = join( $r['sep'], $author_links );
|
| 1423 |
}
|
| 1424 |
|
| 1425 |
} else {
|
| 1553 |
* @return string topic author role
|
| 1554 |
*/
|
| 1555 |
function bbp_get_topic_author_role( $args = array() ) {
|
| 1556 |
+
|
| 1557 |
+
// Parse arguments against default values
|
| 1558 |
+
$r = bbp_parse_args( $args, array(
|
| 1559 |
'topic_id' => 0,
|
| 1560 |
'class' => 'bbp-author-role',
|
| 1561 |
'before' => '',
|
| 1562 |
'after' => ''
|
| 1563 |
+
), 'get_topic_author_role' );
|
|
|
|
|
|
|
| 1564 |
|
| 1565 |
+
$topic_id = bbp_get_topic_id( $r['topic_id'] );
|
| 1566 |
$role = bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) );
|
| 1567 |
+
$author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $r['before'], $r['class'], $role, $r['after'] );
|
| 1568 |
|
| 1569 |
+
return apply_filters( 'bbp_get_topic_author_role', $author_role, $r );
|
| 1570 |
}
|
| 1571 |
|
| 1572 |
|
| 1825 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 1826 |
$reply_id = bbp_get_topic_last_reply_id( $topic_id );
|
| 1827 |
|
| 1828 |
+
if ( !empty( $reply_id ) && ( $reply_id != $topic_id ) ) {
|
| 1829 |
$reply_url = bbp_get_reply_url( $reply_id );
|
| 1830 |
+
} else {
|
| 1831 |
$reply_url = bbp_get_topic_permalink( $topic_id );
|
| 1832 |
+
}
|
| 1833 |
|
| 1834 |
return apply_filters( 'bbp_get_topic_last_reply_url', $reply_url );
|
| 1835 |
}
|
| 1872 |
else
|
| 1873 |
$anchor = __( 'No Replies', 'bbpress' );
|
| 1874 |
|
| 1875 |
+
return apply_filters( 'bbp_get_topic_freshness_link', $anchor, $topic_id, $time_since, $link_url, $title );
|
| 1876 |
}
|
| 1877 |
|
| 1878 |
/**
|
| 2101 |
if ( ! bbp_allow_topic_tags() )
|
| 2102 |
return;
|
| 2103 |
|
| 2104 |
+
// Parse arguments against default values
|
| 2105 |
+
$r = bbp_parse_args( $args, array(
|
| 2106 |
'before' => '<div class="bbp-topic-tags"><p>' . __( 'Tagged:', 'bbpress' ) . ' ',
|
| 2107 |
'sep' => ', ',
|
| 2108 |
'after' => '</p></div>'
|
| 2109 |
+
), 'get_topic_tag_list' );
|
|
|
|
|
|
|
| 2110 |
|
| 2111 |
$topic_id = bbp_get_topic_id( $topic_id );
|
| 2112 |
|
| 2118 |
|
| 2119 |
// If terms exist, explode them and compile the return value
|
| 2120 |
if ( !empty( $terms ) ) {
|
| 2121 |
+
$terms = implode( $r['sep'], $terms );
|
| 2122 |
+
$retval = $r['before'] . $terms . $r['after'];
|
| 2123 |
|
| 2124 |
// No terms so return emty string
|
| 2125 |
} else {
|
| 2128 |
|
| 2129 |
// Topic is not spam so display a clickable term list
|
| 2130 |
} else {
|
| 2131 |
+
$retval = get_the_term_list( $topic_id, bbp_get_topic_tag_tax_id(), $r['before'], $r['sep'], $r['after'] );
|
| 2132 |
}
|
| 2133 |
|
| 2134 |
return $retval;
|
| 2217 |
if ( !bbp_is_single_topic() )
|
| 2218 |
return;
|
| 2219 |
|
| 2220 |
+
// Parse arguments against default values
|
| 2221 |
+
$r = bbp_parse_args( $args, array (
|
| 2222 |
'id' => bbp_get_topic_id(),
|
| 2223 |
'before' => '<span class="bbp-admin-links">',
|
| 2224 |
'after' => '</span>',
|
| 2225 |
'sep' => ' | ',
|
| 2226 |
'links' => array()
|
| 2227 |
+
), 'get_topic_admin_links' );
|
|
|
|
| 2228 |
|
| 2229 |
if ( !current_user_can( 'edit_topic', $r['id'] ) )
|
| 2230 |
return;
|
| 2231 |
|
| 2232 |
if ( empty( $r['links'] ) ) {
|
| 2233 |
+
$r['links'] = apply_filters( 'bbp_topic_admin_links', array(
|
| 2234 |
'edit' => bbp_get_topic_edit_link ( $r ),
|
| 2235 |
'close' => bbp_get_topic_close_link( $r ),
|
| 2236 |
'stick' => bbp_get_topic_stick_link( $r ),
|
| 2237 |
'merge' => bbp_get_topic_merge_link( $r ),
|
| 2238 |
'trash' => bbp_get_topic_trash_link( $r ),
|
| 2239 |
'spam' => bbp_get_topic_spam_link ( $r ),
|
| 2240 |
+
), $r['id'] );
|
| 2241 |
}
|
| 2242 |
|
| 2243 |
// Check caps for trashing the topic
|
| 2298 |
* @return string Topic edit link
|
| 2299 |
*/
|
| 2300 |
function bbp_get_topic_edit_link( $args = '' ) {
|
| 2301 |
+
|
| 2302 |
+
// Parse arguments against default values
|
| 2303 |
+
$r = bbp_parse_args( $args, array(
|
| 2304 |
'id' => 0,
|
| 2305 |
'link_before' => '',
|
| 2306 |
'link_after' => '',
|
| 2307 |
'edit_text' => __( 'Edit', 'bbpress' )
|
| 2308 |
+
), 'get_topic_edit_link' );
|
|
|
|
|
|
|
| 2309 |
|
| 2310 |
+
$topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
|
| 2311 |
|
| 2312 |
// Bypass check if user has caps
|
| 2313 |
if ( !current_user_can( 'edit_others_topics' ) ) {
|
| 2319 |
}
|
| 2320 |
|
| 2321 |
// Get uri
|
| 2322 |
+
$uri = bbp_get_topic_edit_url( $r['id'] );
|
| 2323 |
|
| 2324 |
// Bail if no uri
|
| 2325 |
if ( empty( $uri ) )
|
| 2326 |
return;
|
| 2327 |
|
| 2328 |
+
$retval = $r['link_before'] . '<a href="' . $uri . '">' . $r['edit_text'] . '</a>' . $r['link_after'];
|
| 2329 |
|
| 2330 |
+
return apply_filters( 'bbp_get_topic_edit_link', $retval, $r );
|
| 2331 |
}
|
| 2332 |
|
| 2333 |
/**
|
| 2422 |
*/
|
| 2423 |
function bbp_get_topic_trash_link( $args = '' ) {
|
| 2424 |
|
| 2425 |
+
// Parse arguments against default values
|
| 2426 |
+
$r = bbp_parse_args( $args, array(
|
| 2427 |
'id' => 0,
|
| 2428 |
'link_before' => '',
|
| 2429 |
'link_after' => '',
|
| 2431 |
'trash_text' => __( 'Trash', 'bbpress' ),
|
| 2432 |
'restore_text' => __( 'Restore', 'bbpress' ),
|
| 2433 |
'delete_text' => __( 'Delete', 'bbpress' )
|
| 2434 |
+
), 'get_topic_trash_link' );
|
|
|
|
|
|
|
| 2435 |
|
| 2436 |
$actions = array();
|
| 2437 |
+
$topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
|
| 2438 |
|
| 2439 |
if ( empty( $topic ) || !current_user_can( 'delete_topic', $topic->ID ) ) {
|
| 2440 |
return;
|
| 2441 |
}
|
| 2442 |
|
| 2443 |
if ( bbp_is_topic_trash( $topic->ID ) ) {
|
| 2444 |
+
$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'untrash', 'topic_id' => $topic->ID ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) ) . '">' . esc_html( $r['restore_text'] ) . '</a>';
|
| 2445 |
} elseif ( EMPTY_TRASH_DAYS ) {
|
| 2446 |
+
$actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'trash', 'topic_id' => $topic->ID ) ), 'trash-' . $topic->post_type . '_' . $topic->ID ) ) . '">' . esc_html( $r['trash_text'] ) . '</a>';
|
| 2447 |
}
|
| 2448 |
|
| 2449 |
if ( bbp_is_topic_trash( $topic->ID ) || !EMPTY_TRASH_DAYS ) {
|
| 2450 |
+
$actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'delete', 'topic_id' => $topic->ID ) ), 'delete-' . $topic->post_type . '_' . $topic->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );">' . esc_html( $r['delete_text'] ) . '</a>';
|
| 2451 |
}
|
| 2452 |
|
| 2453 |
// Process the admin links
|
| 2454 |
+
$retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after'];
|
| 2455 |
|
| 2456 |
+
return apply_filters( 'bbp_get_topic_trash_link', $retval, $r );
|
| 2457 |
}
|
| 2458 |
|
| 2459 |
/**
|
| 2491 |
* @return string Topic close link
|
| 2492 |
*/
|
| 2493 |
function bbp_get_topic_close_link( $args = '' ) {
|
| 2494 |
+
|
| 2495 |
+
// Parse arguments against default values
|
| 2496 |
+
$r = bbp_parse_args( $args, array(
|
| 2497 |
'id' => 0,
|
| 2498 |
'link_before' => '',
|
| 2499 |
'link_after' => '',
|
| 2500 |
'sep' => ' | ',
|
| 2501 |
'close_text' => _x( 'Close', 'Topic Status', 'bbpress' ),
|
| 2502 |
'open_text' => _x( 'Open', 'Topic Status', 'bbpress' )
|
| 2503 |
+
), 'get_topic_close_link' );
|
|
|
|
|
|
|
| 2504 |
|
| 2505 |
+
$topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
|
| 2506 |
|
| 2507 |
if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
|
| 2508 |
return;
|
| 2509 |
|
| 2510 |
+
$display = bbp_is_topic_open( $topic->ID ) ? $r['close_text'] : $r['open_text'];
|
| 2511 |
$uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_close', 'topic_id' => $topic->ID ) );
|
| 2512 |
$uri = esc_url( wp_nonce_url( $uri, 'close-topic_' . $topic->ID ) );
|
| 2513 |
+
$retval = $r['link_before'] . '<a href="' . $uri . '">' . $display . '</a>' . $r['link_after'];
|
| 2514 |
|
| 2515 |
+
return apply_filters( 'bbp_get_topic_close_link', $retval, $r );
|
| 2516 |
}
|
| 2517 |
|
| 2518 |
/**
|
| 2552 |
* @return string Topic stick link
|
| 2553 |
*/
|
| 2554 |
function bbp_get_topic_stick_link( $args = '' ) {
|
| 2555 |
+
|
| 2556 |
+
// Parse arguments against default values
|
| 2557 |
+
$r = bbp_parse_args( $args, array(
|
| 2558 |
'id' => 0,
|
| 2559 |
'link_before' => '',
|
| 2560 |
'link_after' => '',
|
| 2561 |
'stick_text' => __( 'Stick', 'bbpress' ),
|
| 2562 |
'unstick_text' => __( 'Unstick', 'bbpress' ),
|
| 2563 |
'super_text' => __( 'to front', 'bbpress' ),
|
| 2564 |
+
), 'get_topic_stick_link' );
|
|
|
|
|
|
|
| 2565 |
|
| 2566 |
+
$topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
|
| 2567 |
|
| 2568 |
if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
|
| 2569 |
return;
|
| 2573 |
$stick_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID ) );
|
| 2574 |
$stick_uri = esc_url( wp_nonce_url( $stick_uri, 'stick-topic_' . $topic->ID ) );
|
| 2575 |
|
| 2576 |
+
$stick_display = true == $is_sticky ? $r['unstick_text'] : $r['stick_text'];
|
| 2577 |
$stick_display = '<a href="' . $stick_uri . '">' . $stick_display . '</a>';
|
| 2578 |
|
| 2579 |
if ( empty( $is_sticky ) ) {
|
| 2580 |
$super_uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_stick', 'topic_id' => $topic->ID, 'super' => 1 ) );
|
| 2581 |
$super_uri = esc_url( wp_nonce_url( $super_uri, 'stick-topic_' . $topic->ID ) );
|
| 2582 |
|
| 2583 |
+
$super_display = ' (<a href="' . $super_uri . '">' . $r['super_text'] . '</a>)';
|
| 2584 |
} else {
|
| 2585 |
$super_display = '';
|
| 2586 |
}
|
| 2587 |
|
| 2588 |
// Combine the HTML into 1 string
|
| 2589 |
+
$retval = $r['link_before'] . $stick_display . $super_display . $r['link_after'];
|
| 2590 |
|
| 2591 |
+
return apply_filters( 'bbp_get_topic_stick_link', $retval, $r );
|
| 2592 |
}
|
| 2593 |
|
| 2594 |
/**
|
| 2623 |
* @return string Topic merge link
|
| 2624 |
*/
|
| 2625 |
function bbp_get_topic_merge_link( $args = '' ) {
|
| 2626 |
+
|
| 2627 |
+
// Parse arguments against default values
|
| 2628 |
+
$r = bbp_parse_args( $args, array(
|
| 2629 |
'id' => 0,
|
| 2630 |
'link_before' => '',
|
| 2631 |
'link_after' => '',
|
| 2632 |
'merge_text' => __( 'Merge', 'bbpress' ),
|
| 2633 |
+
), 'get_topic_merge_link' );
|
|
|
|
|
|
|
| 2634 |
|
| 2635 |
+
$topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
|
| 2636 |
|
| 2637 |
if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
|
| 2638 |
return;
|
| 2639 |
|
| 2640 |
$uri = esc_url( add_query_arg( array( 'action' => 'merge' ), bbp_get_topic_edit_url( $topic->ID ) ) );
|
| 2641 |
+
$retval = $r['link_before'] . '<a href="' . $uri . '">' . $r['merge_text'] . '</a>' . $r['link_after'];
|
| 2642 |
|
| 2643 |
return apply_filters( 'bbp_get_topic_merge_link', $retval, $args );
|
| 2644 |
}
|
| 2678 |
* @return string Topic spam link
|
| 2679 |
*/
|
| 2680 |
function bbp_get_topic_spam_link( $args = '' ) {
|
| 2681 |
+
|
| 2682 |
+
// Parse arguments against default values
|
| 2683 |
+
$r = bbp_parse_args( $args, array(
|
| 2684 |
'id' => 0,
|
| 2685 |
'link_before' => '',
|
| 2686 |
'link_after' => '',
|
| 2687 |
'sep' => ' | ',
|
| 2688 |
'spam_text' => __( 'Spam', 'bbpress' ),
|
| 2689 |
'unspam_text' => __( 'Unspam', 'bbpress' )
|
| 2690 |
+
), 'get_topic_spam_link' );
|
|
|
|
|
|
|
| 2691 |
|
| 2692 |
+
$topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
|
| 2693 |
|
| 2694 |
if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
|
| 2695 |
return;
|
| 2696 |
|
| 2697 |
+
$display = bbp_is_topic_spam( $topic->ID ) ? $r['unspam_text'] : $r['spam_text'];
|
| 2698 |
$uri = add_query_arg( array( 'action' => 'bbp_toggle_topic_spam', 'topic_id' => $topic->ID ) );
|
| 2699 |
$uri = esc_url( wp_nonce_url( $uri, 'spam-topic_' . $topic->ID ) );
|
| 2700 |
+
$retval = $r['link_before'] . '<a href="' . $uri . '">' . $display . '</a>' . $r['link_after'];
|
| 2701 |
|
| 2702 |
+
return apply_filters( 'bbp_get_topic_spam_link', $retval, $r );
|
| 2703 |
}
|
| 2704 |
|
| 2705 |
/** Topic Pagination **********************************************************/
|
| 2845 |
*/
|
| 2846 |
function bbp_topic_type_select( $args = '' ) {
|
| 2847 |
|
| 2848 |
+
// Parse arguments against default values
|
| 2849 |
+
$r = bbp_parse_args( $args, array(
|
| 2850 |
'unstick_text' => __( 'Normal', 'bbpress' ),
|
| 2851 |
'stick_text' => __( 'Sticky', 'bbpress' ),
|
| 2852 |
'super_text' => __( 'Super Sticky', 'bbpress' ),
|
| 2853 |
'select_id' => 'bbp_stick_topic',
|
| 2854 |
'tab' => bbp_get_tab_index(),
|
| 2855 |
'topic_id' => 0
|
| 2856 |
+
), 'topic_type_select' );
|
|
|
|
|
|
|
| 2857 |
|
| 2858 |
// Edit topic
|
| 2859 |
if ( bbp_is_single_topic() || bbp_is_topic_edit() ) {
|
| 2860 |
|
| 2861 |
// Get current topic id
|
| 2862 |
+
$topic_id = bbp_get_topic_id( $r['topic_id'] );
|
| 2863 |
|
| 2864 |
// Post value is passed
|
| 2865 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST[ $r['select_id'] ] ) ) {
|
| 2866 |
+
$sticky_current = $_POST[ $r['select_id'] ];
|
| 2867 |
|
| 2868 |
// Topic is super sticky
|
| 2869 |
} elseif ( bbp_is_topic_super_sticky( $topic_id ) ) {
|
| 2878 |
} else {
|
| 2879 |
|
| 2880 |
// Post value is passed
|
| 2881 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST[ $r['select_id'] ] ) ) {
|
| 2882 |
+
$sticky_current = $_POST[ $r['select_id'] ];
|
| 2883 |
|
| 2884 |
// Default to unstick
|
| 2885 |
} else {
|
| 2888 |
}
|
| 2889 |
|
| 2890 |
// Used variables
|
| 2891 |
+
$tab = !empty( $r['tab'] ) ? ' tabindex="' . $r['tab'] . '"' : '';
|
| 2892 |
+
$select_id = esc_attr( $r['select_id'] );
|
| 2893 |
$sticky_statuses = array (
|
| 2894 |
+
'unstick' => $r['unstick_text'],
|
| 2895 |
+
'stick' => $r['stick_text'],
|
| 2896 |
+
'super' => $r['super_text'],
|
| 2897 |
); ?>
|
| 2898 |
|
| 2899 |
<select name="<?php echo $select_id; ?>" id="<?php echo $select_id; ?>"<?php echo $tab; ?>>
|
| 2900 |
|
| 2901 |
<?php foreach ( $sticky_statuses as $sticky_status => $label ) : ?>
|
| 2902 |
|
| 2903 |
+
<option value="<?php echo esc_attr( $sticky_status ); ?>"<?php selected( $sticky_current, $sticky_status ); ?>><?php echo esc_html( $label ); ?></option>
|
| 2904 |
|
| 2905 |
<?php endforeach; ?>
|
| 2906 |
|
| 2946 |
*/
|
| 2947 |
function bbp_get_single_topic_description( $args = '' ) {
|
| 2948 |
|
| 2949 |
+
// Parse arguments against default values
|
| 2950 |
+
$r = bbp_parse_args( $args, array(
|
| 2951 |
'topic_id' => 0,
|
| 2952 |
'before' => '<div class="bbp-template-notice info"><p class="bbp-topic-description">',
|
| 2953 |
'after' => '</p></div>',
|
| 2954 |
'size' => 14
|
| 2955 |
+
), 'get_single_topic_description' );
|
|
|
|
|
|
|
| 2956 |
|
| 2957 |
// Validate topic_id
|
| 2958 |
+
$topic_id = bbp_get_topic_id( $r['topic_id'] );
|
| 2959 |
|
| 2960 |
// Unhook the 'view all' query var adder
|
| 2961 |
remove_filter( 'bbp_get_topic_permalink', 'bbp_add_view_all' );
|
| 2962 |
|
| 2963 |
// Build the topic description
|
| 2964 |
+
$vc_int = bbp_get_topic_voice_count ( $topic_id, true );
|
| 2965 |
+
$voice_count = bbp_get_topic_voice_count ( $topic_id, false );
|
| 2966 |
+
$reply_count = bbp_get_topic_replies_link ( $topic_id );
|
| 2967 |
+
$time_since = bbp_get_topic_freshness_link( $topic_id );
|
| 2968 |
|
| 2969 |
// Singular/Plural
|
| 2970 |
+
$voice_count = sprintf( _n( '%s voice', '%s voices', $vc_int, 'bbpress' ), $voice_count );
|
| 2971 |
|
| 2972 |
// Topic has replies
|
| 2973 |
$last_reply = bbp_get_topic_last_active_id( $topic_id );
|
| 2974 |
if ( !empty( $last_reply ) ) {
|
| 2975 |
+
$last_updated_by = bbp_get_author_link( array( 'post_id' => $last_reply, 'size' => $r['size'] ) );
|
| 2976 |
$retstr = sprintf( __( 'This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $reply_count, $voice_count, $last_updated_by, $time_since );
|
| 2977 |
|
| 2978 |
// Topic has no replies
|
| 2988 |
add_filter( 'bbp_get_topic_permalink', 'bbp_add_view_all' );
|
| 2989 |
|
| 2990 |
// Combine the elements together
|
| 2991 |
+
$retstr = $r['before'] . $retstr . $r['after'];
|
| 2992 |
|
| 2993 |
// Return filtered result
|
| 2994 |
+
return apply_filters( 'bbp_get_single_topic_description', $retstr, $r );
|
| 2995 |
}
|
| 2996 |
|
| 2997 |
/** Topic Tags ****************************************************************/
|
| 3274 |
*/
|
| 3275 |
function bbp_get_topic_tag_description( $args = array() ) {
|
| 3276 |
|
| 3277 |
+
// Parse arguments against default values
|
| 3278 |
+
$r = bbp_parse_args( $args, array(
|
| 3279 |
'before' => '<div class="bbp-topic-tag-description"><p>',
|
| 3280 |
'after' => '</p></div>',
|
| 3281 |
'tag' => ''
|
| 3282 |
+
), 'get_topic_tag_description' );
|
|
|
|
|
|
|
| 3283 |
|
| 3284 |
// Get the term
|
| 3285 |
+
if ( ! empty( $r['tag'] ) ) {
|
| 3286 |
+
$term = get_term_by( 'slug', $r['tag'], bbp_get_topic_tag_tax_id() );
|
| 3287 |
} else {
|
| 3288 |
+
$tag = get_query_var( 'term' );
|
| 3289 |
+
$r['tag'] = $tag;
|
| 3290 |
+
$term = get_queried_object();
|
| 3291 |
}
|
| 3292 |
|
| 3293 |
// Add before and after if description exists
|
| 3294 |
if ( !empty( $term->description ) ) {
|
| 3295 |
+
$retval = $r['before'] . $term->description . $r['after'];
|
| 3296 |
|
| 3297 |
// No description, no HTML
|
| 3298 |
} else {
|
| 3299 |
$retval = '';
|
| 3300 |
}
|
| 3301 |
|
| 3302 |
+
return apply_filters( 'bbp_get_topic_tag_description', $retval, $r );
|
| 3303 |
}
|
| 3304 |
|
| 3305 |
/** Forms *********************************************************************/
|
| 3326 |
function bbp_get_form_topic_title() {
|
| 3327 |
|
| 3328 |
// Get _POST data
|
| 3329 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_topic_title'] ) ) {
|
| 3330 |
$topic_title = $_POST['bbp_topic_title'];
|
| 3331 |
|
| 3332 |
// Get edit data
|
| 3333 |
+
} elseif ( bbp_is_topic_edit() ) {
|
| 3334 |
$topic_title = bbp_get_global_post_field( 'post_title', 'raw' );
|
| 3335 |
|
| 3336 |
// No data
|
| 3337 |
+
} else {
|
| 3338 |
$topic_title = '';
|
| 3339 |
+
}
|
| 3340 |
|
| 3341 |
return apply_filters( 'bbp_get_form_topic_title', esc_attr( $topic_title ) );
|
| 3342 |
}
|
| 3363 |
function bbp_get_form_topic_content() {
|
| 3364 |
|
| 3365 |
// Get _POST data
|
| 3366 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_topic_content'] ) ) {
|
| 3367 |
$topic_content = $_POST['bbp_topic_content'];
|
| 3368 |
|
| 3369 |
// Get edit data
|
| 3370 |
+
} elseif ( bbp_is_topic_edit() ) {
|
| 3371 |
$topic_content = bbp_get_global_post_field( 'post_content', 'raw' );
|
| 3372 |
|
| 3373 |
// No data
|
| 3374 |
+
} else {
|
| 3375 |
$topic_content = '';
|
| 3376 |
+
}
|
| 3377 |
|
| 3378 |
return apply_filters( 'bbp_get_form_topic_content', esc_textarea( $topic_content ) );
|
| 3379 |
}
|
| 3493 |
function bbp_get_form_topic_forum() {
|
| 3494 |
|
| 3495 |
// Get _POST data
|
| 3496 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_forum_id'] ) ) {
|
| 3497 |
$topic_forum = (int) $_POST['bbp_forum_id'];
|
| 3498 |
|
| 3499 |
// Get edit data
|
| 3500 |
+
} elseif ( bbp_is_topic_edit() ) {
|
| 3501 |
$topic_forum = bbp_get_topic_forum_id();
|
| 3502 |
|
| 3503 |
// No data
|
| 3504 |
+
} else {
|
| 3505 |
$topic_forum = 0;
|
| 3506 |
+
}
|
| 3507 |
|
| 3508 |
+
return apply_filters( 'bbp_get_form_topic_forum', $topic_forum );
|
| 3509 |
}
|
| 3510 |
|
| 3511 |
/**
|
| 3588 |
function bbp_get_form_topic_log_edit() {
|
| 3589 |
|
| 3590 |
// Get _POST data
|
| 3591 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_log_topic_edit'] ) ) {
|
| 3592 |
+
$topic_revision = (int) $_POST['bbp_log_topic_edit'];
|
| 3593 |
|
| 3594 |
// No data
|
| 3595 |
+
} else {
|
| 3596 |
+
$topic_revision = 1;
|
| 3597 |
+
}
|
| 3598 |
|
| 3599 |
+
// Get checked output
|
| 3600 |
$checked = checked( $topic_revision, true, false );
|
| 3601 |
|
| 3602 |
return apply_filters( 'bbp_get_form_topic_log_edit', $checked, $topic_revision );
|
| 3624 |
function bbp_get_form_topic_edit_reason() {
|
| 3625 |
|
| 3626 |
// Get _POST data
|
| 3627 |
+
if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['bbp_topic_edit_reason'] ) ) {
|
| 3628 |
$topic_edit_reason = $_POST['bbp_topic_edit_reason'];
|
| 3629 |
|
| 3630 |
// No data
|
| 3631 |
+
} else {
|
| 3632 |
$topic_edit_reason = '';
|
| 3633 |
+
}
|
| 3634 |
|
| 3635 |
return apply_filters( 'bbp_get_form_topic_edit_reason', esc_attr( $topic_edit_reason ) );
|
| 3636 |
}
|
includes/users/capabilities.php
CHANGED
|
@@ -369,11 +369,11 @@ function bbp_make_spam_user( $user_id = 0 ) {
|
|
| 369 |
|
| 370 |
// Bail if no user ID
|
| 371 |
if ( empty( $user_id ) )
|
| 372 |
-
return;
|
| 373 |
|
| 374 |
// Bail if user ID is super admin
|
| 375 |
if ( is_super_admin( $user_id ) )
|
| 376 |
-
return;
|
| 377 |
|
| 378 |
// Arm the torpedos
|
| 379 |
global $wpdb;
|
|
@@ -421,6 +421,9 @@ function bbp_make_spam_user( $user_id = 0 ) {
|
|
| 421 |
// Switch back to current blog
|
| 422 |
restore_current_blog();
|
| 423 |
}
|
|
|
|
|
|
|
|
|
|
| 424 |
}
|
| 425 |
|
| 426 |
/**
|
|
@@ -454,11 +457,11 @@ function bbp_make_ham_user( $user_id = 0 ) {
|
|
| 454 |
|
| 455 |
// Bail if no user ID
|
| 456 |
if ( empty( $user_id ) )
|
| 457 |
-
return;
|
| 458 |
|
| 459 |
// Bail if user ID is super admin
|
| 460 |
if ( is_super_admin( $user_id ) )
|
| 461 |
-
return;
|
| 462 |
|
| 463 |
// Arm the torpedos
|
| 464 |
global $wpdb;
|
|
@@ -506,6 +509,9 @@ function bbp_make_ham_user( $user_id = 0 ) {
|
|
| 506 |
// Switch back to current blog
|
| 507 |
restore_current_blog();
|
| 508 |
}
|
|
|
|
|
|
|
|
|
|
| 509 |
}
|
| 510 |
|
| 511 |
/**
|
| 369 |
|
| 370 |
// Bail if no user ID
|
| 371 |
if ( empty( $user_id ) )
|
| 372 |
+
return false;
|
| 373 |
|
| 374 |
// Bail if user ID is super admin
|
| 375 |
if ( is_super_admin( $user_id ) )
|
| 376 |
+
return false;
|
| 377 |
|
| 378 |
// Arm the torpedos
|
| 379 |
global $wpdb;
|
| 421 |
// Switch back to current blog
|
| 422 |
restore_current_blog();
|
| 423 |
}
|
| 424 |
+
|
| 425 |
+
// Success
|
| 426 |
+
return true;
|
| 427 |
}
|
| 428 |
|
| 429 |
/**
|
| 457 |
|
| 458 |
// Bail if no user ID
|
| 459 |
if ( empty( $user_id ) )
|
| 460 |
+
return false;
|
| 461 |
|
| 462 |
// Bail if user ID is super admin
|
| 463 |
if ( is_super_admin( $user_id ) )
|
| 464 |
+
return false;
|
| 465 |
|
| 466 |
// Arm the torpedos
|
| 467 |
global $wpdb;
|
| 509 |
// Switch back to current blog
|
| 510 |
restore_current_blog();
|
| 511 |
}
|
| 512 |
+
|
| 513 |
+
// Success
|
| 514 |
+
return true;
|
| 515 |
}
|
| 516 |
|
| 517 |
/**
|
includes/users/functions.php
CHANGED
|
@@ -416,6 +416,7 @@ function bbp_remove_user_favorite( $user_id, $topic_id ) {
|
|
| 416 |
/**
|
| 417 |
* Handles the front end adding and removing of favorite topics
|
| 418 |
*
|
|
|
|
| 419 |
* @uses bbp_get_user_id() To get the user id
|
| 420 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 421 |
* @uses current_user_can() To check if the current user can edit the user
|
|
@@ -430,17 +431,13 @@ function bbp_remove_user_favorite( $user_id, $topic_id ) {
|
|
| 430 |
* @uses bbp_get_topic_permalink() To get the topic permalink
|
| 431 |
* @uses wp_safe_redirect() To redirect to the url
|
| 432 |
*/
|
| 433 |
-
function bbp_favorites_handler() {
|
| 434 |
|
| 435 |
if ( !bbp_is_favorites_active() )
|
| 436 |
return false;
|
| 437 |
|
| 438 |
-
// Bail if
|
| 439 |
-
if (
|
| 440 |
-
return;
|
| 441 |
-
|
| 442 |
-
// Bail if required GET actions aren't passed
|
| 443 |
-
if ( empty( $_GET['topic_id'] ) || empty( $_GET['action'] ) )
|
| 444 |
return;
|
| 445 |
|
| 446 |
// Setup possible get actions
|
|
@@ -450,11 +447,10 @@ function bbp_favorites_handler() {
|
|
| 450 |
);
|
| 451 |
|
| 452 |
// Bail if actions aren't meant for this function
|
| 453 |
-
if ( !in_array( $
|
| 454 |
return;
|
| 455 |
|
| 456 |
// What action is taking place?
|
| 457 |
-
$action = $_GET['action'];
|
| 458 |
$topic_id = intval( $_GET['topic_id'] );
|
| 459 |
$user_id = bbp_get_user_id( 0, true, true );
|
| 460 |
|
|
@@ -500,6 +496,8 @@ function bbp_favorites_handler() {
|
|
| 500 |
$redirect = bbp_get_topic_permalink( $topic_id );
|
| 501 |
} elseif ( is_single() || is_page() ) {
|
| 502 |
$redirect = get_permalink();
|
|
|
|
|
|
|
| 503 |
}
|
| 504 |
|
| 505 |
wp_safe_redirect( $redirect );
|
|
@@ -734,6 +732,7 @@ function bbp_remove_user_subscription( $user_id, $topic_id ) {
|
|
| 734 |
/**
|
| 735 |
* Handles the front end subscribing and unsubscribing topics
|
| 736 |
*
|
|
|
|
| 737 |
* @uses bbp_is_subscriptions_active() To check if the subscriptions are active
|
| 738 |
* @uses bbp_get_user_id() To get the user id
|
| 739 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
|
@@ -750,17 +749,13 @@ function bbp_remove_user_subscription( $user_id, $topic_id ) {
|
|
| 750 |
* @uses bbp_get_topic_permalink() To get the topic permalink
|
| 751 |
* @uses wp_safe_redirect() To redirect to the url
|
| 752 |
*/
|
| 753 |
-
function bbp_subscriptions_handler() {
|
| 754 |
|
| 755 |
if ( !bbp_is_subscriptions_active() )
|
| 756 |
return false;
|
| 757 |
|
| 758 |
-
// Bail if
|
| 759 |
-
if (
|
| 760 |
-
return;
|
| 761 |
-
|
| 762 |
-
// Bail if required GET actions aren't passed
|
| 763 |
-
if ( empty( $_GET['topic_id'] ) || empty( $_GET['action'] ) )
|
| 764 |
return;
|
| 765 |
|
| 766 |
// Setup possible get actions
|
|
@@ -770,11 +765,10 @@ function bbp_subscriptions_handler() {
|
|
| 770 |
);
|
| 771 |
|
| 772 |
// Bail if actions aren't meant for this function
|
| 773 |
-
if ( !in_array( $
|
| 774 |
return;
|
| 775 |
|
| 776 |
// Get required data
|
| 777 |
-
$action = $_GET['action'];
|
| 778 |
$user_id = bbp_get_user_id( 0, true, true );
|
| 779 |
$topic_id = intval( $_GET['topic_id'] );
|
| 780 |
|
|
@@ -820,6 +814,8 @@ function bbp_subscriptions_handler() {
|
|
| 820 |
$redirect = bbp_get_topic_permalink( $topic_id );
|
| 821 |
} elseif ( is_single() || is_page() ) {
|
| 822 |
$redirect = get_permalink();
|
|
|
|
|
|
|
| 823 |
}
|
| 824 |
|
| 825 |
wp_safe_redirect( $redirect );
|
|
@@ -840,6 +836,7 @@ function bbp_subscriptions_handler() {
|
|
| 840 |
/**
|
| 841 |
* Handles the front end user editing
|
| 842 |
*
|
|
|
|
| 843 |
* @uses is_multisite() To check if it's a multisite
|
| 844 |
* @uses bbp_is_user_home() To check if the user is at home (the display page
|
| 845 |
* is the one of the logged in user)
|
|
@@ -866,14 +863,10 @@ function bbp_subscriptions_handler() {
|
|
| 866 |
* @uses grant_super_admin() To grant super admin priviledges
|
| 867 |
* @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
|
| 868 |
*/
|
| 869 |
-
function bbp_edit_user_handler() {
|
| 870 |
-
|
| 871 |
-
// Bail if not a POST action
|
| 872 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
|
| 873 |
-
return;
|
| 874 |
|
| 875 |
// Bail if action is not 'bbp-update-user'
|
| 876 |
-
if (
|
| 877 |
return;
|
| 878 |
|
| 879 |
// Get the displayed user ID
|
|
@@ -1020,7 +1013,7 @@ function bbp_get_user_replies_created( $user_id = 0 ) {
|
|
| 1020 |
|
| 1021 |
// Try to get the topics
|
| 1022 |
$query = bbp_has_replies( array(
|
| 1023 |
-
'post_type' =>
|
| 1024 |
'post_parent' => 'any',
|
| 1025 |
'posts_per_page' => bbp_get_replies_per_page(),
|
| 1026 |
'paged' => bbp_get_paged(),
|
|
@@ -1037,9 +1030,7 @@ function bbp_get_user_replies_created( $user_id = 0 ) {
|
|
| 1037 |
* Get the total number of users on the forums
|
| 1038 |
*
|
| 1039 |
* @since bbPress (r2769)
|
| 1040 |
-
* @uses
|
| 1041 |
-
* @uses get_users() To execute our query and get the var back
|
| 1042 |
-
* @uses wp_cache_set() Set the query in the cache
|
| 1043 |
* @uses apply_filters() Calls 'bbp_get_total_users' with number of users
|
| 1044 |
* @return int Total number of users
|
| 1045 |
*/
|
| 416 |
/**
|
| 417 |
* Handles the front end adding and removing of favorite topics
|
| 418 |
*
|
| 419 |
+
* @param string $action The requested action to compare this function to
|
| 420 |
* @uses bbp_get_user_id() To get the user id
|
| 421 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 422 |
* @uses current_user_can() To check if the current user can edit the user
|
| 431 |
* @uses bbp_get_topic_permalink() To get the topic permalink
|
| 432 |
* @uses wp_safe_redirect() To redirect to the url
|
| 433 |
*/
|
| 434 |
+
function bbp_favorites_handler( $action = '' ) {
|
| 435 |
|
| 436 |
if ( !bbp_is_favorites_active() )
|
| 437 |
return false;
|
| 438 |
|
| 439 |
+
// Bail if no topic ID is passed
|
| 440 |
+
if ( empty( $_GET['topic_id'] ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
| 441 |
return;
|
| 442 |
|
| 443 |
// Setup possible get actions
|
| 447 |
);
|
| 448 |
|
| 449 |
// Bail if actions aren't meant for this function
|
| 450 |
+
if ( !in_array( $action, $possible_actions ) )
|
| 451 |
return;
|
| 452 |
|
| 453 |
// What action is taking place?
|
|
|
|
| 454 |
$topic_id = intval( $_GET['topic_id'] );
|
| 455 |
$user_id = bbp_get_user_id( 0, true, true );
|
| 456 |
|
| 496 |
$redirect = bbp_get_topic_permalink( $topic_id );
|
| 497 |
} elseif ( is_single() || is_page() ) {
|
| 498 |
$redirect = get_permalink();
|
| 499 |
+
} else {
|
| 500 |
+
$redirect = get_permalink( $topic_id );
|
| 501 |
}
|
| 502 |
|
| 503 |
wp_safe_redirect( $redirect );
|
| 732 |
/**
|
| 733 |
* Handles the front end subscribing and unsubscribing topics
|
| 734 |
*
|
| 735 |
+
* @param string $action The requested action to compare this function to
|
| 736 |
* @uses bbp_is_subscriptions_active() To check if the subscriptions are active
|
| 737 |
* @uses bbp_get_user_id() To get the user id
|
| 738 |
* @uses bbp_verify_nonce_request() To verify the nonce and check the request
|
| 749 |
* @uses bbp_get_topic_permalink() To get the topic permalink
|
| 750 |
* @uses wp_safe_redirect() To redirect to the url
|
| 751 |
*/
|
| 752 |
+
function bbp_subscriptions_handler( $action = '' ) {
|
| 753 |
|
| 754 |
if ( !bbp_is_subscriptions_active() )
|
| 755 |
return false;
|
| 756 |
|
| 757 |
+
// Bail if no topic ID is passed
|
| 758 |
+
if ( empty( $_GET['topic_id'] ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
| 759 |
return;
|
| 760 |
|
| 761 |
// Setup possible get actions
|
| 765 |
);
|
| 766 |
|
| 767 |
// Bail if actions aren't meant for this function
|
| 768 |
+
if ( !in_array( $action, $possible_actions ) )
|
| 769 |
return;
|
| 770 |
|
| 771 |
// Get required data
|
|
|
|
| 772 |
$user_id = bbp_get_user_id( 0, true, true );
|
| 773 |
$topic_id = intval( $_GET['topic_id'] );
|
| 774 |
|
| 814 |
$redirect = bbp_get_topic_permalink( $topic_id );
|
| 815 |
} elseif ( is_single() || is_page() ) {
|
| 816 |
$redirect = get_permalink();
|
| 817 |
+
} else {
|
| 818 |
+
$redirect = get_permalink( $topic_id );
|
| 819 |
}
|
| 820 |
|
| 821 |
wp_safe_redirect( $redirect );
|
| 836 |
/**
|
| 837 |
* Handles the front end user editing
|
| 838 |
*
|
| 839 |
+
* @param string $action The requested action to compare this function to
|
| 840 |
* @uses is_multisite() To check if it's a multisite
|
| 841 |
* @uses bbp_is_user_home() To check if the user is at home (the display page
|
| 842 |
* is the one of the logged in user)
|
| 863 |
* @uses grant_super_admin() To grant super admin priviledges
|
| 864 |
* @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
|
| 865 |
*/
|
| 866 |
+
function bbp_edit_user_handler( $action = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 867 |
|
| 868 |
// Bail if action is not 'bbp-update-user'
|
| 869 |
+
if ( 'bbp-update-user' !== $action )
|
| 870 |
return;
|
| 871 |
|
| 872 |
// Get the displayed user ID
|
| 1013 |
|
| 1014 |
// Try to get the topics
|
| 1015 |
$query = bbp_has_replies( array(
|
| 1016 |
+
'post_type' => bbp_get_reply_post_type(),
|
| 1017 |
'post_parent' => 'any',
|
| 1018 |
'posts_per_page' => bbp_get_replies_per_page(),
|
| 1019 |
'paged' => bbp_get_paged(),
|
| 1030 |
* Get the total number of users on the forums
|
| 1031 |
*
|
| 1032 |
* @since bbPress (r2769)
|
| 1033 |
+
* @uses count_users() To execute our query and get the var back
|
|
|
|
|
|
|
| 1034 |
* @uses apply_filters() Calls 'bbp_get_total_users' with number of users
|
| 1035 |
* @return int Total number of users
|
| 1036 |
*/
|
includes/users/template-tags.php
CHANGED
|
@@ -242,6 +242,58 @@ function bbp_user_profile_link( $user_id = 0 ) {
|
|
| 242 |
return apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id );
|
| 243 |
}
|
| 244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
/**
|
| 246 |
* Output URL to the profile page of a user
|
| 247 |
*
|
|
@@ -289,10 +341,7 @@ function bbp_user_profile_url( $user_id = 0, $user_nicename = '' ) {
|
|
| 289 |
|
| 290 |
// Get username if not passed
|
| 291 |
if ( empty( $user_nicename ) ) {
|
| 292 |
-
$
|
| 293 |
-
if ( !empty( $user->user_nicename ) ) {
|
| 294 |
-
$user_nicename = $user->user_nicename;
|
| 295 |
-
}
|
| 296 |
}
|
| 297 |
|
| 298 |
$url = str_replace( '%' . bbp_get_user_rewrite_id() . '%', $user_nicename, $url );
|
|
@@ -493,18 +542,16 @@ function bbp_admin_link( $args = '' ) {
|
|
| 493 |
if ( !empty( $args ) && is_string( $args ) && ( false === strpos( $args, '=' ) ) )
|
| 494 |
$args = array( 'text' => $args );
|
| 495 |
|
| 496 |
-
|
|
|
|
| 497 |
'text' => __( 'Admin', 'bbpress' ),
|
| 498 |
'before' => '',
|
| 499 |
'after' => ''
|
| 500 |
-
);
|
| 501 |
-
$args = bbp_parse_args( $args, $defaults, 'get_admin_link' );
|
| 502 |
-
extract( $args, EXTR_SKIP );
|
| 503 |
|
| 504 |
-
$
|
| 505 |
-
$retval = $before . '<a href="' . $uri . '">' . $text . '</a>' . $after;
|
| 506 |
|
| 507 |
-
return apply_filters( 'bbp_get_admin_link', $retval, $
|
| 508 |
}
|
| 509 |
|
| 510 |
/** User IP *******************************************************************/
|
|
@@ -531,31 +578,27 @@ function bbp_author_ip( $args = '' ) {
|
|
| 531 |
*/
|
| 532 |
function bbp_get_author_ip( $args = '' ) {
|
| 533 |
|
| 534 |
-
//
|
| 535 |
-
$
|
| 536 |
-
|
|
|
|
|
|
|
|
|
|
| 537 |
'before' => '<span class="bbp-author-ip">(',
|
| 538 |
'after' => ')</span>'
|
| 539 |
-
);
|
| 540 |
-
|
| 541 |
-
$r = bbp_parse_args( $args, $defaults, 'get_author_ip' );
|
| 542 |
-
extract( $r );
|
| 543 |
-
|
| 544 |
-
// Used as post id
|
| 545 |
-
if ( is_numeric( $args ) )
|
| 546 |
-
$post_id = $args;
|
| 547 |
|
| 548 |
// Get the author IP meta value
|
| 549 |
-
$author_ip = get_post_meta( $post_id, '_bbp_author_ip', true );
|
| 550 |
if ( !empty( $author_ip ) ) {
|
| 551 |
-
$author_ip = $before . $author_ip . $after;
|
| 552 |
|
| 553 |
// No IP address
|
| 554 |
} else {
|
| 555 |
$author_ip = '';
|
| 556 |
}
|
| 557 |
|
| 558 |
-
return apply_filters( 'bbp_get_author_ip', $author_ip, $
|
| 559 |
}
|
| 560 |
|
| 561 |
/** Favorites *****************************************************************/
|
|
@@ -624,14 +667,13 @@ function bbp_favorites_permalink( $user_id = 0 ) {
|
|
| 624 |
*
|
| 625 |
* @since bbPress (r2652)
|
| 626 |
*
|
| 627 |
-
* @param
|
| 628 |
-
* @param array $rem Optional. Remove from favorites args
|
| 629 |
* @param int $user_id Optional. User id
|
| 630 |
-
* @param
|
| 631 |
* @uses bbp_get_user_favorites_link() To get the user favorites link
|
| 632 |
*/
|
| 633 |
-
function bbp_user_favorites_link( $
|
| 634 |
-
echo bbp_get_user_favorites_link( $
|
| 635 |
}
|
| 636 |
/**
|
| 637 |
* User favorites link
|
|
@@ -641,10 +683,16 @@ function bbp_user_favorites_link( $add = array(), $rem = array(), $user_id = 0,
|
|
| 641 |
*
|
| 642 |
* @since bbPress (r2652)
|
| 643 |
*
|
| 644 |
-
* @param
|
| 645 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 646 |
* @param int $user_id Optional. User id
|
| 647 |
* @param int $topic_id Optional. Topic id
|
|
|
|
| 648 |
* @uses bbp_get_user_id() To get the user id
|
| 649 |
* @uses current_user_can() If the current user can edit the user
|
| 650 |
* @uses bbp_get_topic_id() To get the topic id
|
|
@@ -656,69 +704,63 @@ function bbp_user_favorites_link( $add = array(), $rem = array(), $user_id = 0,
|
|
| 656 |
* html, add args, remove args, user & topic id
|
| 657 |
* @return string User favorites link
|
| 658 |
*/
|
| 659 |
-
function bbp_get_user_favorites_link( $
|
| 660 |
if ( !bbp_is_favorites_active() )
|
| 661 |
return false;
|
| 662 |
|
| 663 |
-
//
|
| 664 |
-
$
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 668 |
|
| 669 |
-
|
|
|
|
|
|
|
|
|
|
| 670 |
return false;
|
| 671 |
-
|
| 672 |
-
if ( empty( $add ) || !is_array( $add ) ) {
|
| 673 |
-
$add = array(
|
| 674 |
-
'mid' => __( 'Add this topic to your favorites', 'bbpress' ),
|
| 675 |
-
'post' => __( ' (%?%)', 'bbpress' )
|
| 676 |
-
);
|
| 677 |
}
|
| 678 |
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
'mid' => __( '×', 'bbpress' ),
|
| 683 |
-
'post' => __( ']', 'bbpress' )
|
| 684 |
-
);
|
| 685 |
}
|
| 686 |
|
|
|
|
| 687 |
$is_fav = bbp_is_user_favorite( $user_id, $topic_id );
|
| 688 |
if ( !empty( $is_fav ) ) {
|
| 689 |
-
$
|
| 690 |
-
$
|
| 691 |
-
$favs = array( 'action' => 'bbp_favorite_remove', 'topic_id' => $topic_id );
|
| 692 |
-
$pre = ( is_array( $rem ) && isset( $rem['pre'] ) ) ? $rem['pre'] : '';
|
| 693 |
-
$mid = ( is_array( $rem ) && isset( $rem['mid'] ) ) ? $rem['mid'] : ( is_string( $rem ) ? $rem : '' );
|
| 694 |
-
$_post = ( is_array( $rem ) && isset( $rem['post'] ) ) ? $rem['post'] : '';
|
| 695 |
} else {
|
| 696 |
-
$
|
| 697 |
-
$
|
| 698 |
-
$favs = array( 'action' => 'bbp_favorite_add', 'topic_id' => $topic_id );
|
| 699 |
-
$pre = ( is_array( $add ) && isset( $add['pre'] ) ) ? $add['pre'] : '';
|
| 700 |
-
$mid = ( is_array( $add ) && isset( $add['mid'] ) ) ? $add['mid'] : ( is_string( $add ) ? $add : '' );
|
| 701 |
-
$_post = ( is_array( $add ) && isset( $add['post'] ) ) ? $add['post'] : '';
|
| 702 |
}
|
| 703 |
|
| 704 |
// Create the link based where the user is and if the topic is
|
| 705 |
// already the user's favorite
|
| 706 |
if ( bbp_is_favorites() ) {
|
| 707 |
$permalink = bbp_get_favorites_permalink( $user_id );
|
| 708 |
-
} elseif (
|
| 709 |
$permalink = bbp_get_topic_permalink( $topic_id );
|
| 710 |
-
}
|
| 711 |
-
$permalink = bbp_get_topic_permalink( $topic_id );
|
| 712 |
-
} elseif ( bbp_is_query_name( 'bbp_single_topic' ) ) {
|
| 713 |
$permalink = get_permalink();
|
| 714 |
}
|
| 715 |
|
| 716 |
-
$url
|
| 717 |
-
$
|
| 718 |
-
$html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 719 |
|
| 720 |
// Return the link
|
| 721 |
-
return apply_filters( 'bbp_get_user_favorites_link', $html, $
|
| 722 |
}
|
| 723 |
|
| 724 |
/** Subscriptions *************************************************************/
|
|
@@ -788,10 +830,12 @@ function bbp_subscriptions_permalink( $user_id = 0 ) {
|
|
| 788 |
* @since bbPress (r2668)
|
| 789 |
*
|
| 790 |
* @param mixed $args See {@link bbp_get_user_subscribe_link()}
|
|
|
|
|
|
|
| 791 |
* @uses bbp_get_user_subscribe_link() To get the subscribe link
|
| 792 |
*/
|
| 793 |
-
function bbp_user_subscribe_link( $args = '' ) {
|
| 794 |
-
echo bbp_get_user_subscribe_link( $args );
|
| 795 |
}
|
| 796 |
/**
|
| 797 |
* Return the link to subscribe/unsubscribe from a topic
|
|
@@ -806,6 +850,7 @@ function bbp_user_subscribe_link( $args = '' ) {
|
|
| 806 |
* - before: Before the link
|
| 807 |
* - after: After the link
|
| 808 |
* @param int $user_id Optional. User id
|
|
|
|
| 809 |
* @uses bbp_get_user_id() To get the user id
|
| 810 |
* @uses current_user_can() To check if the current user can edit user
|
| 811 |
* @uses bbp_get_topic_id() To get the topic id
|
|
@@ -817,24 +862,23 @@ function bbp_user_subscribe_link( $args = '' ) {
|
|
| 817 |
* link, args, user id & topic id
|
| 818 |
* @return string Permanent link to topic
|
| 819 |
*/
|
| 820 |
-
function bbp_get_user_subscribe_link( $args = '', $user_id = 0 ) {
|
| 821 |
if ( !bbp_is_subscriptions_active() )
|
| 822 |
return;
|
| 823 |
|
| 824 |
-
|
|
|
|
| 825 |
'subscribe' => __( 'Subscribe', 'bbpress' ),
|
| 826 |
'unsubscribe' => __( 'Unsubscribe', 'bbpress' ),
|
| 827 |
'user_id' => 0,
|
| 828 |
'topic_id' => 0,
|
| 829 |
'before' => ' | ',
|
| 830 |
'after' => ''
|
| 831 |
-
);
|
| 832 |
-
$args = bbp_parse_args( $args, $defaults, 'get_user_subscribe_link' );
|
| 833 |
-
extract( $args );
|
| 834 |
|
| 835 |
// Validate user and topic ID's
|
| 836 |
-
$user_id = bbp_get_user_id( $user_id, true, true );
|
| 837 |
-
$topic_id = bbp_get_topic_id( $topic_id );
|
| 838 |
if ( empty( $user_id ) || empty( $topic_id ) ) {
|
| 839 |
return false;
|
| 840 |
}
|
|
@@ -847,10 +891,10 @@ function bbp_user_subscribe_link( $args = '' ) {
|
|
| 847 |
// Decine which link to show
|
| 848 |
$is_subscribed = bbp_is_user_subscribed( $user_id, $topic_id );
|
| 849 |
if ( !empty( $is_subscribed ) ) {
|
| 850 |
-
$text = $unsubscribe;
|
| 851 |
$query_args = array( 'action' => 'bbp_unsubscribe', 'topic_id' => $topic_id );
|
| 852 |
} else {
|
| 853 |
-
$text = $subscribe;
|
| 854 |
$query_args = array( 'action' => 'bbp_subscribe', 'topic_id' => $topic_id );
|
| 855 |
}
|
| 856 |
|
|
@@ -858,20 +902,23 @@ function bbp_user_subscribe_link( $args = '' ) {
|
|
| 858 |
// subscribed already
|
| 859 |
if ( bbp_is_subscriptions() ) {
|
| 860 |
$permalink = bbp_get_subscriptions_permalink( $user_id );
|
| 861 |
-
} elseif (
|
| 862 |
-
$permalink = bbp_get_topic_permalink( $topic_id );
|
| 863 |
-
} elseif ( is_singular( bbp_get_reply_post_type() ) ) {
|
| 864 |
$permalink = bbp_get_topic_permalink( $topic_id );
|
| 865 |
-
}
|
| 866 |
$permalink = get_permalink();
|
| 867 |
}
|
| 868 |
|
| 869 |
-
$url
|
| 870 |
-
$
|
| 871 |
-
$html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 872 |
|
| 873 |
// Return the link
|
| 874 |
-
return apply_filters( 'bbp_get_user_subscribe_link', $html, $
|
| 875 |
}
|
| 876 |
|
| 877 |
|
|
@@ -1348,53 +1395,48 @@ function bbp_author_link( $args = '' ) {
|
|
| 1348 |
*/
|
| 1349 |
function bbp_get_author_link( $args = '' ) {
|
| 1350 |
|
| 1351 |
-
|
| 1352 |
-
|
| 1353 |
-
|
|
|
|
|
|
|
| 1354 |
'link_title' => '',
|
| 1355 |
'type' => 'both',
|
| 1356 |
'size' => 80
|
| 1357 |
-
);
|
| 1358 |
-
$r = bbp_parse_args( $args, $defaults, 'get_author_link' );
|
| 1359 |
-
extract( $r );
|
| 1360 |
-
|
| 1361 |
-
// Used as reply_id
|
| 1362 |
-
if ( is_numeric( $args ) )
|
| 1363 |
-
$post_id = $args;
|
| 1364 |
|
| 1365 |
// Confirmed topic
|
| 1366 |
-
if ( bbp_is_topic( $post_id ) ) {
|
| 1367 |
-
return bbp_get_topic_author_link( $
|
| 1368 |
|
| 1369 |
// Confirmed reply
|
| 1370 |
-
} elseif ( bbp_is_reply( $post_id ) ) {
|
| 1371 |
-
return bbp_get_reply_author_link( $
|
|
|
|
| 1372 |
|
| 1373 |
// Get the post author and proceed
|
| 1374 |
-
|
| 1375 |
-
$user_id = get_post_field( 'post_author', $post_id );
|
| 1376 |
-
}
|
| 1377 |
|
| 1378 |
// Neither a reply nor a topic, so could be a revision
|
| 1379 |
-
if ( !empty( $post_id ) ) {
|
| 1380 |
|
| 1381 |
// Generate title with the display name of the author
|
| 1382 |
-
if ( empty( $link_title ) ) {
|
| 1383 |
-
$link_title = sprintf( !bbp_is_reply_anonymous( $post_id ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), get_the_author_meta( 'display_name', $user_id ) );
|
| 1384 |
}
|
| 1385 |
|
| 1386 |
// Assemble some link bits
|
| 1387 |
-
$link_title = !empty( $link_title ) ? ' title="' . $link_title . '"' : '';
|
| 1388 |
$author_url = bbp_get_user_profile_url( $user_id );
|
| 1389 |
-
$anonymous = bbp_is_reply_anonymous( $post_id );
|
| 1390 |
|
| 1391 |
// Get avatar
|
| 1392 |
-
if ( 'avatar' == $type || 'both' == $type ) {
|
| 1393 |
-
$author_links[] = get_avatar( $user_id, $size );
|
| 1394 |
}
|
| 1395 |
|
| 1396 |
// Get display name
|
| 1397 |
-
if ( 'name' == $type
|
| 1398 |
$author_links[] = get_the_author_meta( 'display_name', $user_id );
|
| 1399 |
}
|
| 1400 |
|
|
@@ -1415,7 +1457,7 @@ function bbp_author_link( $args = '' ) {
|
|
| 1415 |
$author_link = '';
|
| 1416 |
}
|
| 1417 |
|
| 1418 |
-
return apply_filters( 'bbp_get_author_link', $author_link, $
|
| 1419 |
}
|
| 1420 |
|
| 1421 |
/** Capabilities **************************************************************/
|
|
@@ -1442,18 +1484,16 @@ function bbp_author_link( $args = '' ) {
|
|
| 1442 |
*/
|
| 1443 |
function bbp_user_can_view_forum( $args = '' ) {
|
| 1444 |
|
| 1445 |
-
//
|
| 1446 |
-
$
|
| 1447 |
'user_id' => bbp_get_current_user_id(),
|
| 1448 |
'forum_id' => bbp_get_forum_id(),
|
| 1449 |
'check_ancestors' => false
|
| 1450 |
-
);
|
| 1451 |
-
$r = bbp_parse_args( $args, $defaults, 'user_can_view_forum' );
|
| 1452 |
-
extract( $r );
|
| 1453 |
|
| 1454 |
// Validate parsed values
|
| 1455 |
-
$user_id = bbp_get_user_id ( $user_id, false, false );
|
| 1456 |
-
$forum_id = bbp_get_forum_id( $forum_id );
|
| 1457 |
$retval = false;
|
| 1458 |
|
| 1459 |
// User is a super admin
|
|
@@ -1461,15 +1501,15 @@ function bbp_user_can_view_forum( $args = '' ) {
|
|
| 1461 |
$retval = true;
|
| 1462 |
|
| 1463 |
// Forum is public, and user can read forums or is not logged in
|
| 1464 |
-
} elseif ( bbp_is_forum_public ( $forum_id, $check_ancestors ) ) {
|
| 1465 |
$retval = true;
|
| 1466 |
|
| 1467 |
// Forum is private, and user can see it
|
| 1468 |
-
} elseif ( bbp_is_forum_private( $forum_id, $check_ancestors ) &&
|
| 1469 |
$retval = true;
|
| 1470 |
|
| 1471 |
// Forum is hidden, and user can see it
|
| 1472 |
-
} elseif ( bbp_is_forum_hidden ( $forum_id, $check_ancestors ) &&
|
| 1473 |
$retval = true;
|
| 1474 |
}
|
| 1475 |
|
|
@@ -1611,13 +1651,13 @@ function bbp_get_forums_for_current_user( $args = array() ) {
|
|
| 1611 |
if ( !empty( $forum_ids ) )
|
| 1612 |
$post__not_in = implode( ',', $forum_ids );
|
| 1613 |
|
| 1614 |
-
|
|
|
|
| 1615 |
'post_type' => bbp_get_forum_post_type(),
|
| 1616 |
'post_status' => bbp_get_public_status_id(),
|
| 1617 |
'numberposts' => -1,
|
| 1618 |
'exclude' => $post__not_in
|
| 1619 |
-
);
|
| 1620 |
-
$r = bbp_parse_args( $args, $defaults, 'get_forums_for_current_user' );
|
| 1621 |
|
| 1622 |
// Get the forums
|
| 1623 |
$forums = get_posts( $r );
|
| 242 |
return apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id );
|
| 243 |
}
|
| 244 |
|
| 245 |
+
/**
|
| 246 |
+
* Output a users nicename to the screen
|
| 247 |
+
*
|
| 248 |
+
* @since bbPress (r4671)
|
| 249 |
+
*
|
| 250 |
+
* @param int $user_id User ID whose nicename to get
|
| 251 |
+
* @param array $args before|after|user_id|force
|
| 252 |
+
*/
|
| 253 |
+
function bbp_user_nicename( $user_id = 0, $args = array() ) {
|
| 254 |
+
echo bbp_get_user_nicename( $user_id, $args );
|
| 255 |
+
}
|
| 256 |
+
/**
|
| 257 |
+
* Return a users nicename to the screen
|
| 258 |
+
*
|
| 259 |
+
* @since bbPress (r4671)
|
| 260 |
+
*
|
| 261 |
+
* @param int $user_id User ID whose nicename to get
|
| 262 |
+
* @param array $args before|after|user_id|force
|
| 263 |
+
* @return string User nicename, maybe wrapped in before/after strings
|
| 264 |
+
*/
|
| 265 |
+
function bbp_get_user_nicename( $user_id = 0, $args = array() ) {
|
| 266 |
+
|
| 267 |
+
// Bail if no user ID passed
|
| 268 |
+
$user_id = bbp_get_user_id( $user_id, false, false );
|
| 269 |
+
if ( empty( $user_id ) )
|
| 270 |
+
return false;
|
| 271 |
+
|
| 272 |
+
// Parse default arguments
|
| 273 |
+
$r = bbp_parse_args( $args, array(
|
| 274 |
+
'user_id' => $user_id,
|
| 275 |
+
'before' => '',
|
| 276 |
+
'after' => '',
|
| 277 |
+
'force' => ''
|
| 278 |
+
), 'get_user_nicename' );
|
| 279 |
+
|
| 280 |
+
// Get the user data and nicename
|
| 281 |
+
if ( empty( $r['force'] ) ) {
|
| 282 |
+
$user = get_userdata( $user_id );
|
| 283 |
+
$nicename = $user->user_nicename;
|
| 284 |
+
|
| 285 |
+
// Force the nicename to something else
|
| 286 |
+
} else {
|
| 287 |
+
$nicename = (string) $r['force'];
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
// Maybe wrap the nicename
|
| 291 |
+
$retval = !empty( $nicename ) ? ( $r['before'] . $nicename . $r['after'] ) : '';
|
| 292 |
+
|
| 293 |
+
// Filter and return
|
| 294 |
+
return (string) apply_filters( 'bbp_get_user_nicename', $retval, $user_id, $args );
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
/**
|
| 298 |
* Output URL to the profile page of a user
|
| 299 |
*
|
| 341 |
|
| 342 |
// Get username if not passed
|
| 343 |
if ( empty( $user_nicename ) ) {
|
| 344 |
+
$user_nicename = bbp_get_user_nicename( $user_id );
|
|
|
|
|
|
|
|
|
|
| 345 |
}
|
| 346 |
|
| 347 |
$url = str_replace( '%' . bbp_get_user_rewrite_id() . '%', $user_nicename, $url );
|
| 542 |
if ( !empty( $args ) && is_string( $args ) && ( false === strpos( $args, '=' ) ) )
|
| 543 |
$args = array( 'text' => $args );
|
| 544 |
|
| 545 |
+
// Parse arguments against default values
|
| 546 |
+
$r = bbp_parse_args( $args, array(
|
| 547 |
'text' => __( 'Admin', 'bbpress' ),
|
| 548 |
'before' => '',
|
| 549 |
'after' => ''
|
| 550 |
+
), 'get_admin_link' );
|
|
|
|
|
|
|
| 551 |
|
| 552 |
+
$retval = $r['before'] . '<a href="' . admin_url() . '">' . $r['text'] . '</a>' . $r['after'];
|
|
|
|
| 553 |
|
| 554 |
+
return apply_filters( 'bbp_get_admin_link', $retval, $r );
|
| 555 |
}
|
| 556 |
|
| 557 |
/** User IP *******************************************************************/
|
| 578 |
*/
|
| 579 |
function bbp_get_author_ip( $args = '' ) {
|
| 580 |
|
| 581 |
+
// Used as post id
|
| 582 |
+
$post_id = is_numeric( $args ) ? (int) $args : 0;
|
| 583 |
+
|
| 584 |
+
// Parse arguments against default values
|
| 585 |
+
$r = bbp_parse_args( $args, array(
|
| 586 |
+
'post_id' => $post_id,
|
| 587 |
'before' => '<span class="bbp-author-ip">(',
|
| 588 |
'after' => ')</span>'
|
| 589 |
+
), 'get_author_ip' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 590 |
|
| 591 |
// Get the author IP meta value
|
| 592 |
+
$author_ip = get_post_meta( $r['post_id'], '_bbp_author_ip', true );
|
| 593 |
if ( !empty( $author_ip ) ) {
|
| 594 |
+
$author_ip = $r['before'] . $author_ip . $r['after'];
|
| 595 |
|
| 596 |
// No IP address
|
| 597 |
} else {
|
| 598 |
$author_ip = '';
|
| 599 |
}
|
| 600 |
|
| 601 |
+
return apply_filters( 'bbp_get_author_ip', $author_ip, $r );
|
| 602 |
}
|
| 603 |
|
| 604 |
/** Favorites *****************************************************************/
|
| 667 |
*
|
| 668 |
* @since bbPress (r2652)
|
| 669 |
*
|
| 670 |
+
* @param mixed $args See {@link bbp_get_user_favorites_link()}
|
|
|
|
| 671 |
* @param int $user_id Optional. User id
|
| 672 |
+
* @param bool $wrap Optional. If you want to wrap the link in <span id="favorite-toggle">.
|
| 673 |
* @uses bbp_get_user_favorites_link() To get the user favorites link
|
| 674 |
*/
|
| 675 |
+
function bbp_user_favorites_link( $args = array(), $user_id = 0, $wrap = true ) {
|
| 676 |
+
echo bbp_get_user_favorites_link( $args, $user_id, $wrap );
|
| 677 |
}
|
| 678 |
/**
|
| 679 |
* User favorites link
|
| 683 |
*
|
| 684 |
* @since bbPress (r2652)
|
| 685 |
*
|
| 686 |
+
* @param mixed $args This function supports these arguments:
|
| 687 |
+
* - subscribe: Favorite text
|
| 688 |
+
* - unsubscribe: Unfavorite text
|
| 689 |
+
* - user_id: User id
|
| 690 |
+
* - topic_id: Topic id
|
| 691 |
+
* - before: Before the link
|
| 692 |
+
* - after: After the link
|
| 693 |
* @param int $user_id Optional. User id
|
| 694 |
* @param int $topic_id Optional. Topic id
|
| 695 |
+
* @param bool $wrap Optional. If you want to wrap the link in <span id="favorite-toggle">. See ajax_favorite()
|
| 696 |
* @uses bbp_get_user_id() To get the user id
|
| 697 |
* @uses current_user_can() If the current user can edit the user
|
| 698 |
* @uses bbp_get_topic_id() To get the topic id
|
| 704 |
* html, add args, remove args, user & topic id
|
| 705 |
* @return string User favorites link
|
| 706 |
*/
|
| 707 |
+
function bbp_get_user_favorites_link( $args = '', $user_id = 0, $wrap = true ) {
|
| 708 |
if ( !bbp_is_favorites_active() )
|
| 709 |
return false;
|
| 710 |
|
| 711 |
+
// Parse arguments against default values
|
| 712 |
+
$r = bbp_parse_args( $args, array(
|
| 713 |
+
'favorite' => __( 'Favorite', 'bbpress' ),
|
| 714 |
+
'favorited' => __( 'Favorited', 'bbpress' ),
|
| 715 |
+
'user_id' => 0,
|
| 716 |
+
'topic_id' => 0,
|
| 717 |
+
'before' => '',
|
| 718 |
+
'after' => ''
|
| 719 |
+
), 'get_user_favorites_link' );
|
| 720 |
|
| 721 |
+
// Validate user and topic ID's
|
| 722 |
+
$user_id = bbp_get_user_id( $r['user_id'], true, true );
|
| 723 |
+
$topic_id = bbp_get_topic_id( $r['topic_id'] );
|
| 724 |
+
if ( empty( $user_id ) || empty( $topic_id ) ) {
|
| 725 |
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 726 |
}
|
| 727 |
|
| 728 |
+
// No link if you can't edit yourself
|
| 729 |
+
if ( !current_user_can( 'edit_user', (int) $user_id ) ) {
|
| 730 |
+
return false;
|
|
|
|
|
|
|
|
|
|
| 731 |
}
|
| 732 |
|
| 733 |
+
// Decine which link to show
|
| 734 |
$is_fav = bbp_is_user_favorite( $user_id, $topic_id );
|
| 735 |
if ( !empty( $is_fav ) ) {
|
| 736 |
+
$text = $r['favorited'];
|
| 737 |
+
$query_args = array( 'action' => 'bbp_favorite_remove', 'topic_id' => $topic_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
| 738 |
} else {
|
| 739 |
+
$text = $r['favorite'];
|
| 740 |
+
$query_args = array( 'action' => 'bbp_favorite_add', 'topic_id' => $topic_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
| 741 |
}
|
| 742 |
|
| 743 |
// Create the link based where the user is and if the topic is
|
| 744 |
// already the user's favorite
|
| 745 |
if ( bbp_is_favorites() ) {
|
| 746 |
$permalink = bbp_get_favorites_permalink( $user_id );
|
| 747 |
+
} elseif ( bbp_is_single_topic() || bbp_is_single_reply() ) {
|
| 748 |
$permalink = bbp_get_topic_permalink( $topic_id );
|
| 749 |
+
} else {
|
|
|
|
|
|
|
| 750 |
$permalink = get_permalink();
|
| 751 |
}
|
| 752 |
|
| 753 |
+
$url = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-favorite_' . $topic_id ) );
|
| 754 |
+
$sub = $is_fav ? ' class="is-favorite"' : '';
|
| 755 |
+
$html = sprintf( '%s<span id="favorite-%d" %s><a href="%s" class="favorite-toggle" data-topic="%d">%s</a></span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
|
| 756 |
+
|
| 757 |
+
// Initial output is wrapped in a span, ajax output is hooked to this
|
| 758 |
+
if ( !empty( $wrap ) ) {
|
| 759 |
+
$html = '<span id="favorite-toggle">' . $html . '</span>';
|
| 760 |
+
}
|
| 761 |
|
| 762 |
// Return the link
|
| 763 |
+
return apply_filters( 'bbp_get_user_favorites_link', $html, $r, $user_id, $topic_id );
|
| 764 |
}
|
| 765 |
|
| 766 |
/** Subscriptions *************************************************************/
|
| 830 |
* @since bbPress (r2668)
|
| 831 |
*
|
| 832 |
* @param mixed $args See {@link bbp_get_user_subscribe_link()}
|
| 833 |
+
* @param int $user_id Optional. User id
|
| 834 |
+
* @param bool $wrap Optional. If you want to wrap the link in <span id="subscription-toggle">.
|
| 835 |
* @uses bbp_get_user_subscribe_link() To get the subscribe link
|
| 836 |
*/
|
| 837 |
+
function bbp_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
|
| 838 |
+
echo bbp_get_user_subscribe_link( $args, $user_id, $wrap );
|
| 839 |
}
|
| 840 |
/**
|
| 841 |
* Return the link to subscribe/unsubscribe from a topic
|
| 850 |
* - before: Before the link
|
| 851 |
* - after: After the link
|
| 852 |
* @param int $user_id Optional. User id
|
| 853 |
+
* @param bool $wrap Optional. If you want to wrap the link in <span id="subscription-toggle">.
|
| 854 |
* @uses bbp_get_user_id() To get the user id
|
| 855 |
* @uses current_user_can() To check if the current user can edit user
|
| 856 |
* @uses bbp_get_topic_id() To get the topic id
|
| 862 |
* link, args, user id & topic id
|
| 863 |
* @return string Permanent link to topic
|
| 864 |
*/
|
| 865 |
+
function bbp_get_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
|
| 866 |
if ( !bbp_is_subscriptions_active() )
|
| 867 |
return;
|
| 868 |
|
| 869 |
+
// Parse arguments against default values
|
| 870 |
+
$r = bbp_parse_args( $args, array(
|
| 871 |
'subscribe' => __( 'Subscribe', 'bbpress' ),
|
| 872 |
'unsubscribe' => __( 'Unsubscribe', 'bbpress' ),
|
| 873 |
'user_id' => 0,
|
| 874 |
'topic_id' => 0,
|
| 875 |
'before' => ' | ',
|
| 876 |
'after' => ''
|
| 877 |
+
), 'get_user_subscribe_link' );
|
|
|
|
|
|
|
| 878 |
|
| 879 |
// Validate user and topic ID's
|
| 880 |
+
$user_id = bbp_get_user_id( $r['user_id'], true, true );
|
| 881 |
+
$topic_id = bbp_get_topic_id( $r['topic_id'] );
|
| 882 |
if ( empty( $user_id ) || empty( $topic_id ) ) {
|
| 883 |
return false;
|
| 884 |
}
|
| 891 |
// Decine which link to show
|
| 892 |
$is_subscribed = bbp_is_user_subscribed( $user_id, $topic_id );
|
| 893 |
if ( !empty( $is_subscribed ) ) {
|
| 894 |
+
$text = $r['unsubscribe'];
|
| 895 |
$query_args = array( 'action' => 'bbp_unsubscribe', 'topic_id' => $topic_id );
|
| 896 |
} else {
|
| 897 |
+
$text = $r['subscribe'];
|
| 898 |
$query_args = array( 'action' => 'bbp_subscribe', 'topic_id' => $topic_id );
|
| 899 |
}
|
| 900 |
|
| 902 |
// subscribed already
|
| 903 |
if ( bbp_is_subscriptions() ) {
|
| 904 |
$permalink = bbp_get_subscriptions_permalink( $user_id );
|
| 905 |
+
} elseif ( bbp_is_single_topic() || bbp_is_single_reply() ) {
|
|
|
|
|
|
|
| 906 |
$permalink = bbp_get_topic_permalink( $topic_id );
|
| 907 |
+
} else {
|
| 908 |
$permalink = get_permalink();
|
| 909 |
}
|
| 910 |
|
| 911 |
+
$url = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-subscription_' . $topic_id ) );
|
| 912 |
+
$sub = $is_subscribed ? ' class="is-subscribed"' : '';
|
| 913 |
+
$html = sprintf( '%s<span id="subscribe-%d" %s><a href="%s" class="subscription-toggle" data-topic="%d">%s</a></span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
|
| 914 |
+
|
| 915 |
+
// Initial output is wrapped in a span, ajax output is hooked to this
|
| 916 |
+
if ( !empty( $wrap ) ) {
|
| 917 |
+
$html = '<span id="subscription-toggle">' . $html . '</span>';
|
| 918 |
+
}
|
| 919 |
|
| 920 |
// Return the link
|
| 921 |
+
return apply_filters( 'bbp_get_user_subscribe_link', $html, $r, $user_id, $topic_id );
|
| 922 |
}
|
| 923 |
|
| 924 |
|
| 1395 |
*/
|
| 1396 |
function bbp_get_author_link( $args = '' ) {
|
| 1397 |
|
| 1398 |
+
$post_id = is_numeric( $args ) ? (int) $args : 0;
|
| 1399 |
+
|
| 1400 |
+
// Parse arguments against default values
|
| 1401 |
+
$r = bbp_parse_args( $args, array(
|
| 1402 |
+
'post_id' => $post_id,
|
| 1403 |
'link_title' => '',
|
| 1404 |
'type' => 'both',
|
| 1405 |
'size' => 80
|
| 1406 |
+
), 'get_author_link' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1407 |
|
| 1408 |
// Confirmed topic
|
| 1409 |
+
if ( bbp_is_topic( $r['post_id'] ) ) {
|
| 1410 |
+
return bbp_get_topic_author_link( $r );
|
| 1411 |
|
| 1412 |
// Confirmed reply
|
| 1413 |
+
} elseif ( bbp_is_reply( $r['post_id'] ) ) {
|
| 1414 |
+
return bbp_get_reply_author_link( $r );
|
| 1415 |
+
}
|
| 1416 |
|
| 1417 |
// Get the post author and proceed
|
| 1418 |
+
$user_id = get_post_field( 'post_author', $r['post_id'] );
|
|
|
|
|
|
|
| 1419 |
|
| 1420 |
// Neither a reply nor a topic, so could be a revision
|
| 1421 |
+
if ( !empty( $r['post_id'] ) ) {
|
| 1422 |
|
| 1423 |
// Generate title with the display name of the author
|
| 1424 |
+
if ( empty( $r['link_title'] ) ) {
|
| 1425 |
+
$r['link_title'] = sprintf( !bbp_is_reply_anonymous( $r['post_id'] ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), get_the_author_meta( 'display_name', $user_id ) );
|
| 1426 |
}
|
| 1427 |
|
| 1428 |
// Assemble some link bits
|
| 1429 |
+
$link_title = !empty( $r['link_title'] ) ? ' title="' . $r['link_title'] . '"' : '';
|
| 1430 |
$author_url = bbp_get_user_profile_url( $user_id );
|
| 1431 |
+
$anonymous = bbp_is_reply_anonymous( $r['post_id'] );
|
| 1432 |
|
| 1433 |
// Get avatar
|
| 1434 |
+
if ( 'avatar' == $r['type'] || 'both' == $r['type'] ) {
|
| 1435 |
+
$author_links[] = get_avatar( $user_id, $r['size'] );
|
| 1436 |
}
|
| 1437 |
|
| 1438 |
// Get display name
|
| 1439 |
+
if ( 'name' == $r['type'] || 'both' == $r['type'] ) {
|
| 1440 |
$author_links[] = get_the_author_meta( 'display_name', $user_id );
|
| 1441 |
}
|
| 1442 |
|
| 1457 |
$author_link = '';
|
| 1458 |
}
|
| 1459 |
|
| 1460 |
+
return apply_filters( 'bbp_get_author_link', $author_link, $r );
|
| 1461 |
}
|
| 1462 |
|
| 1463 |
/** Capabilities **************************************************************/
|
| 1484 |
*/
|
| 1485 |
function bbp_user_can_view_forum( $args = '' ) {
|
| 1486 |
|
| 1487 |
+
// Parse arguments against default values
|
| 1488 |
+
$r = bbp_parse_args( $args, array(
|
| 1489 |
'user_id' => bbp_get_current_user_id(),
|
| 1490 |
'forum_id' => bbp_get_forum_id(),
|
| 1491 |
'check_ancestors' => false
|
| 1492 |
+
), 'user_can_view_forum' );
|
|
|
|
|
|
|
| 1493 |
|
| 1494 |
// Validate parsed values
|
| 1495 |
+
$user_id = bbp_get_user_id ( $r['user_id'], false, false );
|
| 1496 |
+
$forum_id = bbp_get_forum_id( $r['forum_id'] );
|
| 1497 |
$retval = false;
|
| 1498 |
|
| 1499 |
// User is a super admin
|
| 1501 |
$retval = true;
|
| 1502 |
|
| 1503 |
// Forum is public, and user can read forums or is not logged in
|
| 1504 |
+
} elseif ( bbp_is_forum_public ( $forum_id, $r['check_ancestors'] ) ) {
|
| 1505 |
$retval = true;
|
| 1506 |
|
| 1507 |
// Forum is private, and user can see it
|
| 1508 |
+
} elseif ( bbp_is_forum_private( $forum_id, $r['check_ancestors'] ) && user_can( $user_id, 'read_private_forums' ) ) {
|
| 1509 |
$retval = true;
|
| 1510 |
|
| 1511 |
// Forum is hidden, and user can see it
|
| 1512 |
+
} elseif ( bbp_is_forum_hidden ( $forum_id, $r['check_ancestors'] ) && user_can( $user_id, 'read_hidden_forums' ) ) {
|
| 1513 |
$retval = true;
|
| 1514 |
}
|
| 1515 |
|
| 1651 |
if ( !empty( $forum_ids ) )
|
| 1652 |
$post__not_in = implode( ',', $forum_ids );
|
| 1653 |
|
| 1654 |
+
// Parse arguments against default values
|
| 1655 |
+
$r = bbp_parse_args( $args, array(
|
| 1656 |
'post_type' => bbp_get_forum_post_type(),
|
| 1657 |
'post_status' => bbp_get_public_status_id(),
|
| 1658 |
'numberposts' => -1,
|
| 1659 |
'exclude' => $post__not_in
|
| 1660 |
+
), 'get_forums_for_current_user' );
|
|
|
|
| 1661 |
|
| 1662 |
// Get the forums
|
| 1663 |
$forums = get_posts( $r );
|
languages/bbpress.pot
CHANGED
|
@@ -1,106 +1,106 @@
|
|
| 1 |
-
# Copyright (C)
|
| 2 |
# This file is distributed under the same license as the bbPress package.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
-
"Project-Id-Version: bbPress 2.
|
| 6 |
-
"Report-Msgid-Bugs-To: http://
|
| 7 |
-
"POT-Creation-Date:
|
| 8 |
"MIME-Version: 1.0\n"
|
| 9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
| 10 |
"Content-Transfer-Encoding: 8bit\n"
|
| 11 |
-
"PO-Revision-Date:
|
| 12 |
"Last-Translator: JOHN JAMES JACOBY <jjj@bbpress.org>\n"
|
| 13 |
"Language-Team: ENGLISH <jjj@bbpress.org>\n"
|
| 14 |
|
| 15 |
-
#: bbpress.php:
|
| 16 |
msgid "Cheatin’ huh?"
|
| 17 |
msgstr ""
|
| 18 |
|
| 19 |
-
#: bbpress.php:
|
| 20 |
msgid "bbPress Default"
|
| 21 |
msgstr ""
|
| 22 |
|
| 23 |
-
#: bbpress.php:
|
| 24 |
-
#: includes/admin/admin.php:
|
| 25 |
-
#: includes/admin/admin.php:
|
| 26 |
-
#: includes/extend/buddypress/group.php:
|
| 27 |
#: includes/extend/buddypress/loader.php:42
|
| 28 |
#: includes/extend/buddypress/loader.php:170
|
| 29 |
#: includes/extend/buddypress/loader.php:259
|
| 30 |
#: includes/extend/buddypress/loader.php:310
|
| 31 |
-
#: templates/default/
|
| 32 |
msgid "Forums"
|
| 33 |
msgstr ""
|
| 34 |
|
| 35 |
-
#: bbpress.php:
|
| 36 |
#: includes/admin/metaboxes.php:50 includes/admin/metaboxes.php:358
|
| 37 |
#: includes/admin/metaboxes.php:411 includes/admin/replies.php:621
|
| 38 |
-
#: includes/admin/topics.php:686 includes/extend/buddypress/group.php:
|
| 39 |
-
#: includes/extend/buddypress/group.php:
|
| 40 |
-
#: includes/forums/template-tags.php:
|
| 41 |
#: templates/default/bbpress/loop-forums.php:19
|
| 42 |
msgid "Forum"
|
| 43 |
msgstr ""
|
| 44 |
|
| 45 |
-
#: bbpress.php:
|
| 46 |
msgid "All Forums"
|
| 47 |
msgstr ""
|
| 48 |
|
| 49 |
-
#: bbpress.php:
|
| 50 |
msgid "New Forum"
|
| 51 |
msgstr ""
|
| 52 |
|
| 53 |
-
#: bbpress.php:
|
| 54 |
msgid "Create New Forum"
|
| 55 |
msgstr ""
|
| 56 |
|
| 57 |
-
#: bbpress.php:
|
| 58 |
-
#: includes/common/template-tags.php:
|
| 59 |
-
#: includes/replies/template-tags.php:
|
| 60 |
-
#: includes/topics/template-tags.php:
|
| 61 |
#: templates/default/bbpress/user-details.php:65
|
| 62 |
msgid "Edit"
|
| 63 |
msgstr ""
|
| 64 |
|
| 65 |
-
#: bbpress.php:
|
| 66 |
msgid "Edit Forum"
|
| 67 |
msgstr ""
|
| 68 |
|
| 69 |
-
#: bbpress.php:
|
| 70 |
msgid "View Forum"
|
| 71 |
msgstr ""
|
| 72 |
|
| 73 |
-
#: bbpress.php:
|
| 74 |
msgid "Search Forums"
|
| 75 |
msgstr ""
|
| 76 |
|
| 77 |
-
#: bbpress.php:
|
| 78 |
msgid "No forums found"
|
| 79 |
msgstr ""
|
| 80 |
|
| 81 |
-
#: bbpress.php:
|
| 82 |
msgid "No forums found in Trash"
|
| 83 |
msgstr ""
|
| 84 |
|
| 85 |
-
#: bbpress.php:
|
| 86 |
msgid "Parent Forum:"
|
| 87 |
msgstr ""
|
| 88 |
|
| 89 |
-
#: bbpress.php:
|
| 90 |
msgid "bbPress Forums"
|
| 91 |
msgstr ""
|
| 92 |
|
| 93 |
-
#: bbpress.php:
|
| 94 |
#: includes/admin/settings.php:187 includes/admin/settings.php:208
|
| 95 |
-
#: includes/admin/topics.php:685 includes/extend/buddypress/activity.php:
|
| 96 |
-
#: includes/extend/buddypress/group.php:
|
| 97 |
-
#: includes/forums/template-tags.php:
|
|
|
|
| 98 |
#: templates/default/bbpress/loop-forums.php:20
|
| 99 |
-
#: templates/default/extras/page-forum-statistics.php:44
|
| 100 |
msgid "Topics"
|
| 101 |
msgstr ""
|
| 102 |
|
| 103 |
-
#: bbpress.php:
|
| 104 |
#: includes/admin/metaboxes.php:437 includes/admin/replies.php:622
|
| 105 |
#: templates/default/bbpress/content-single-topic-lead.php:22
|
| 106 |
#: templates/default/bbpress/content-single-topic-lead.php:94
|
|
@@ -108,351 +108,351 @@ msgstr ""
|
|
| 108 |
msgid "Topic"
|
| 109 |
msgstr ""
|
| 110 |
|
| 111 |
-
#: bbpress.php:
|
| 112 |
-
#: includes/topics/functions.php:
|
| 113 |
msgid "All Topics"
|
| 114 |
msgstr ""
|
| 115 |
|
| 116 |
-
#: bbpress.php:
|
| 117 |
msgid "New Topic"
|
| 118 |
msgstr ""
|
| 119 |
|
| 120 |
-
#: bbpress.php:
|
| 121 |
msgid "Create New Topic"
|
| 122 |
msgstr ""
|
| 123 |
|
| 124 |
-
#: bbpress.php:
|
| 125 |
msgid "Edit Topic"
|
| 126 |
msgstr ""
|
| 127 |
|
| 128 |
-
#: bbpress.php:
|
| 129 |
msgid "View Topic"
|
| 130 |
msgstr ""
|
| 131 |
|
| 132 |
-
#: bbpress.php:
|
| 133 |
msgid "Search Topics"
|
| 134 |
msgstr ""
|
| 135 |
|
| 136 |
-
#: bbpress.php:
|
| 137 |
msgid "No topics found"
|
| 138 |
msgstr ""
|
| 139 |
|
| 140 |
-
#: bbpress.php:
|
| 141 |
msgid "No topics found in Trash"
|
| 142 |
msgstr ""
|
| 143 |
|
| 144 |
-
#: bbpress.php:
|
| 145 |
-
#: includes/admin/metaboxes.php:410 includes/extend/buddypress/group.php:
|
| 146 |
#: templates/default/bbpress/form-topic.php:125
|
| 147 |
msgid "Forum:"
|
| 148 |
msgstr ""
|
| 149 |
|
| 150 |
-
#: bbpress.php:
|
| 151 |
msgid "bbPress Topics"
|
| 152 |
msgstr ""
|
| 153 |
|
| 154 |
-
#: bbpress.php:
|
| 155 |
#: includes/admin/settings.php:195 includes/admin/settings.php:216
|
| 156 |
-
#: includes/admin/topics.php:687 includes/core/theme-compat.php:
|
| 157 |
-
#: includes/extend/buddypress/activity.php:
|
| 158 |
-
#: includes/forums/template-tags.php:
|
|
|
|
| 159 |
#: templates/default/bbpress/loop-forums.php:21
|
| 160 |
#: templates/default/bbpress/loop-replies.php:32
|
| 161 |
#: templates/default/bbpress/loop-replies.php:62
|
| 162 |
#: templates/default/bbpress/loop-topics.php:21
|
| 163 |
-
#: templates/default/extras/page-forum-statistics.php:49
|
| 164 |
msgid "Replies"
|
| 165 |
msgstr ""
|
| 166 |
|
| 167 |
-
#: bbpress.php:
|
| 168 |
msgid "Reply"
|
| 169 |
msgstr ""
|
| 170 |
|
| 171 |
-
#: bbpress.php:
|
| 172 |
-
#: includes/replies/functions.php:
|
| 173 |
msgid "All Replies"
|
| 174 |
msgstr ""
|
| 175 |
|
| 176 |
-
#: bbpress.php:
|
| 177 |
msgid "New Reply"
|
| 178 |
msgstr ""
|
| 179 |
|
| 180 |
-
#: bbpress.php:
|
| 181 |
msgid "Create New Reply"
|
| 182 |
msgstr ""
|
| 183 |
|
| 184 |
-
#: bbpress.php:
|
| 185 |
msgid "Edit Reply"
|
| 186 |
msgstr ""
|
| 187 |
|
| 188 |
-
#: bbpress.php:
|
| 189 |
msgid "View Reply"
|
| 190 |
msgstr ""
|
| 191 |
|
| 192 |
-
#: bbpress.php:
|
| 193 |
msgid "Search Replies"
|
| 194 |
msgstr ""
|
| 195 |
|
| 196 |
-
#: bbpress.php:
|
| 197 |
msgid "No replies found"
|
| 198 |
msgstr ""
|
| 199 |
|
| 200 |
-
#: bbpress.php:
|
| 201 |
msgid "No replies found in Trash"
|
| 202 |
msgstr ""
|
| 203 |
|
| 204 |
-
#: bbpress.php:
|
| 205 |
msgid "Topic:"
|
| 206 |
msgstr ""
|
| 207 |
|
| 208 |
-
#: bbpress.php:
|
| 209 |
msgid "bbPress Replies"
|
| 210 |
msgstr ""
|
| 211 |
|
| 212 |
-
#: bbpress.php:
|
| 213 |
msgctxt "post"
|
| 214 |
msgid "Closed"
|
| 215 |
msgstr ""
|
| 216 |
|
| 217 |
-
#: bbpress.php:
|
| 218 |
msgctxt "bbpress"
|
| 219 |
msgid "Closed <span class=\"count\">(%s)</span>"
|
| 220 |
msgid_plural "Closed <span class=\"count\">(%s)</span>"
|
| 221 |
msgstr[0] ""
|
| 222 |
msgstr[1] ""
|
| 223 |
|
| 224 |
-
#: bbpress.php:
|
| 225 |
msgctxt "post"
|
| 226 |
msgid "Spam"
|
| 227 |
msgstr ""
|
| 228 |
|
| 229 |
-
#: bbpress.php:
|
| 230 |
msgctxt "bbpress"
|
| 231 |
msgid "Spam <span class=\"count\">(%s)</span>"
|
| 232 |
msgid_plural "Spam <span class=\"count\">(%s)</span>"
|
| 233 |
msgstr[0] ""
|
| 234 |
msgstr[1] ""
|
| 235 |
|
| 236 |
-
#: bbpress.php:
|
| 237 |
msgctxt "post"
|
| 238 |
msgid "Orphan"
|
| 239 |
msgstr ""
|
| 240 |
|
| 241 |
-
#: bbpress.php:
|
| 242 |
msgctxt "bbpress"
|
| 243 |
msgid "Orphan <span class=\"count\">(%s)</span>"
|
| 244 |
msgid_plural "Orphans <span class=\"count\">(%s)</span>"
|
| 245 |
msgstr[0] ""
|
| 246 |
msgstr[1] ""
|
| 247 |
|
| 248 |
-
#: bbpress.php:
|
| 249 |
msgctxt "post"
|
| 250 |
msgid "Hidden"
|
| 251 |
msgstr ""
|
| 252 |
|
| 253 |
-
#: bbpress.php:
|
| 254 |
msgctxt "bbpress"
|
| 255 |
msgid "Hidden <span class=\"count\">(%s)</span>"
|
| 256 |
msgid_plural "Hidden <span class=\"count\">(%s)</span>"
|
| 257 |
msgstr[0] ""
|
| 258 |
msgstr[1] ""
|
| 259 |
|
| 260 |
-
#: bbpress.php:
|
| 261 |
msgid "Topic Tags"
|
| 262 |
msgstr ""
|
| 263 |
|
| 264 |
-
#: bbpress.php:
|
| 265 |
msgid "Topic Tag"
|
| 266 |
msgstr ""
|
| 267 |
|
| 268 |
-
#: bbpress.php:
|
| 269 |
msgid "Search Tags"
|
| 270 |
msgstr ""
|
| 271 |
|
| 272 |
-
#: bbpress.php:
|
| 273 |
msgid "Popular Tags"
|
| 274 |
msgstr ""
|
| 275 |
|
| 276 |
-
#: bbpress.php:
|
| 277 |
msgid "All Tags"
|
| 278 |
msgstr ""
|
| 279 |
|
| 280 |
-
#: bbpress.php:
|
| 281 |
msgid "Edit Tag"
|
| 282 |
msgstr ""
|
| 283 |
|
| 284 |
-
#: bbpress.php:
|
| 285 |
msgid "Update Tag"
|
| 286 |
msgstr ""
|
| 287 |
|
| 288 |
-
#: bbpress.php:
|
| 289 |
msgid "Add New Tag"
|
| 290 |
msgstr ""
|
| 291 |
|
| 292 |
-
#: bbpress.php:
|
| 293 |
msgid "New Tag Name"
|
| 294 |
msgstr ""
|
| 295 |
|
| 296 |
-
#: bbpress.php:
|
| 297 |
msgid "View Topic Tag"
|
| 298 |
msgstr ""
|
| 299 |
|
| 300 |
-
#: bbpress.php:
|
| 301 |
msgid "Topics with no replies"
|
| 302 |
msgstr ""
|
| 303 |
|
| 304 |
-
#: includes/admin/admin.php:
|
| 305 |
#: includes/admin/tools.php:34
|
| 306 |
msgid "Repair Forums"
|
| 307 |
msgstr ""
|
| 308 |
|
| 309 |
-
#: includes/admin/admin.php:
|
| 310 |
msgid "Forum Repair"
|
| 311 |
msgstr ""
|
| 312 |
|
| 313 |
-
#: includes/admin/admin.php:
|
| 314 |
-
#: includes/admin/settings.php:
|
| 315 |
msgid "Import Forums"
|
| 316 |
msgstr ""
|
| 317 |
|
| 318 |
-
#: includes/admin/admin.php:
|
| 319 |
msgid "Forum Import"
|
| 320 |
msgstr ""
|
| 321 |
|
| 322 |
-
#: includes/admin/admin.php:
|
| 323 |
-
#: includes/admin/tools.php:
|
| 324 |
msgid "Reset Forums"
|
| 325 |
msgstr ""
|
| 326 |
|
| 327 |
-
#: includes/admin/admin.php:
|
| 328 |
msgid "Forum Reset"
|
| 329 |
msgstr ""
|
| 330 |
|
| 331 |
-
#: includes/admin/admin.php:
|
| 332 |
-
#: includes/admin/admin.php:
|
| 333 |
msgid "Welcome to bbPress"
|
| 334 |
msgstr ""
|
| 335 |
|
| 336 |
-
#: includes/admin/admin.php:
|
| 337 |
-
#: includes/admin/admin.php:
|
| 338 |
-
#: includes/admin/admin.php:
|
| 339 |
msgid "Update Forums"
|
| 340 |
msgstr ""
|
| 341 |
|
| 342 |
-
#: includes/admin/admin.php:
|
| 343 |
msgid "Settings"
|
| 344 |
msgstr ""
|
| 345 |
|
| 346 |
-
#: includes/admin/admin.php:
|
| 347 |
msgid "About"
|
| 348 |
msgstr ""
|
| 349 |
|
| 350 |
-
#: includes/admin/admin.php:
|
| 351 |
msgid "Right Now in Forums"
|
| 352 |
msgstr ""
|
| 353 |
|
| 354 |
-
#: includes/admin/admin.php:
|
| 355 |
msgctxt "admin color scheme"
|
| 356 |
msgid "Green"
|
| 357 |
msgstr ""
|
| 358 |
|
| 359 |
-
#: includes/admin/admin.php:
|
| 360 |
msgid "%s - %s"
|
| 361 |
msgstr ""
|
| 362 |
|
| 363 |
-
#: includes/admin/admin.php:
|
| 364 |
msgid "Welcome to bbPress %s"
|
| 365 |
msgstr ""
|
| 366 |
|
| 367 |
-
#: includes/admin/admin.php:
|
| 368 |
msgid ""
|
| 369 |
"Thank you for updating to the latest version! bbPress %s is ready to make "
|
| 370 |
"your community a safer, faster, and better looking place to hang out!"
|
| 371 |
msgstr ""
|
| 372 |
|
| 373 |
-
#: includes/admin/admin.php:
|
| 374 |
msgid "Version %s"
|
| 375 |
msgstr ""
|
| 376 |
|
| 377 |
-
#: includes/admin/admin.php:
|
| 378 |
msgid "What’s New"
|
| 379 |
msgstr ""
|
| 380 |
|
| 381 |
-
#: includes/admin/admin.php:
|
| 382 |
msgid "Credits"
|
| 383 |
msgstr ""
|
| 384 |
|
| 385 |
-
#: includes/admin/admin.php:
|
| 386 |
msgid "In-depth User Profiles"
|
| 387 |
msgstr ""
|
| 388 |
|
| 389 |
-
#: includes/admin/admin.php:
|
| 390 |
msgid "User Details"
|
| 391 |
msgstr ""
|
| 392 |
|
| 393 |
-
#: includes/admin/admin.php:
|
| 394 |
msgid ""
|
| 395 |
"Forum profiles include the details of your forum activity, including your "
|
| 396 |
"topics and replies, subscriptions, and favorites."
|
| 397 |
msgstr ""
|
| 398 |
|
| 399 |
-
#: includes/admin/admin.php:
|
| 400 |
msgid "Easy Updating"
|
| 401 |
msgstr ""
|
| 402 |
|
| 403 |
-
#: includes/admin/admin.php:
|
| 404 |
msgid "You can easily update your profile without leaving bbPress."
|
| 405 |
msgstr ""
|
| 406 |
|
| 407 |
-
#: includes/admin/admin.php:
|
| 408 |
-
msgid "Theme
|
| 409 |
msgstr ""
|
| 410 |
|
| 411 |
-
#: includes/admin/admin.php:
|
| 412 |
msgid "Twenty Twelve"
|
| 413 |
msgstr ""
|
| 414 |
|
| 415 |
-
#: includes/admin/admin.php:
|
| 416 |
msgid ""
|
| 417 |
"Updated default templates are now Twenty Twelve compatible, and we refreshed "
|
| 418 |
"our CSS to better integrate with other popular themes, too."
|
| 419 |
msgstr ""
|
| 420 |
|
| 421 |
-
#: includes/admin/admin.php:
|
| 422 |
msgid "Improved User Management"
|
| 423 |
msgstr ""
|
| 424 |
|
| 425 |
-
#: includes/admin/admin.php:
|
| 426 |
msgid "Dynamic User Roles and Capabilities"
|
| 427 |
msgstr ""
|
| 428 |
|
| 429 |
-
#: includes/admin/admin.php:
|
| 430 |
msgid ""
|
| 431 |
"bbPress now includes some fancy user-roles with smart default capabilities "
|
| 432 |
"to help you manage your forums. New roles include Key Master (for complete "
|
| 433 |
"administrative access), Moderator, and Participant for regular forum users."
|
| 434 |
msgstr ""
|
| 435 |
|
| 436 |
-
#: includes/admin/admin.php:
|
| 437 |
msgid "Manage Forum Users from WordPress"
|
| 438 |
msgstr ""
|
| 439 |
|
| 440 |
-
#: includes/admin/admin.php:
|
| 441 |
msgid ""
|
| 442 |
"You can assign Forums roles to users individually, or bulk update them from "
|
| 443 |
"the WordPress Users page. Users automatically start out as forum "
|
| 444 |
"participants."
|
| 445 |
msgstr ""
|
| 446 |
|
| 447 |
-
#: includes/admin/admin.php:
|
| 448 |
msgid "Better BuddyPress Integration"
|
| 449 |
msgstr ""
|
| 450 |
|
| 451 |
-
#: includes/admin/admin.php:
|
| 452 |
msgid "Use bbPress for Your BuddyPress Group Forums"
|
| 453 |
msgstr ""
|
| 454 |
|
| 455 |
-
#: includes/admin/admin.php:
|
| 456 |
msgid ""
|
| 457 |
"You can now use bbPress to manage your BuddyPress Group Forums, allowing for "
|
| 458 |
"seamless integration and improved plugin performance. Plugins developed for "
|
|
@@ -460,136 +460,136 @@ msgid ""
|
|
| 460 |
"experience."
|
| 461 |
msgstr ""
|
| 462 |
|
| 463 |
-
#: includes/admin/admin.php:
|
| 464 |
msgid "Activity Stream Syncing"
|
| 465 |
msgstr ""
|
| 466 |
|
| 467 |
-
#: includes/admin/admin.php:
|
| 468 |
msgid ""
|
| 469 |
"bbPress now keeps track of changes to topics and replies and keeps their "
|
| 470 |
"corresponding BuddyPress Activity Stream updates synced."
|
| 471 |
msgstr ""
|
| 472 |
|
| 473 |
-
#: includes/admin/admin.php:
|
| 474 |
msgid "Under the Hood"
|
| 475 |
msgstr ""
|
| 476 |
|
| 477 |
-
#: includes/admin/admin.php:
|
| 478 |
msgid "Template Logic"
|
| 479 |
msgstr ""
|
| 480 |
|
| 481 |
-
#: includes/admin/admin.php:
|
| 482 |
msgid ""
|
| 483 |
"New functions and template stacks are in place to help plugin developers "
|
| 484 |
"extend bbPress further."
|
| 485 |
msgstr ""
|
| 486 |
|
| 487 |
-
#: includes/admin/admin.php:
|
| 488 |
msgid "Plugin Directory Structure"
|
| 489 |
msgstr ""
|
| 490 |
|
| 491 |
-
#: includes/admin/admin.php:
|
| 492 |
msgid ""
|
| 493 |
"We simplified the bbPress plugin directory structure, making it easier for "
|
| 494 |
"plugin developers to find the relevant code."
|
| 495 |
msgstr ""
|
| 496 |
|
| 497 |
-
#: includes/admin/admin.php:
|
| 498 |
msgid "Autocomplete"
|
| 499 |
msgstr ""
|
| 500 |
|
| 501 |
-
#: includes/admin/admin.php:
|
| 502 |
msgid ""
|
| 503 |
"In WordPress Admin, you now select a parent forum or topic via autocomplete "
|
| 504 |
"rather than a dropdown."
|
| 505 |
msgstr ""
|
| 506 |
|
| 507 |
-
#: includes/admin/admin.php:
|
| 508 |
msgid "Fancy Editor Support"
|
| 509 |
msgstr ""
|
| 510 |
|
| 511 |
-
#: includes/admin/admin.php:
|
| 512 |
msgid ""
|
| 513 |
"We improved our support of the Fancy Editor, giving forum users a better "
|
| 514 |
"experience."
|
| 515 |
msgstr ""
|
| 516 |
|
| 517 |
-
#: includes/admin/admin.php:
|
| 518 |
msgid "WordPress 3.5-ready"
|
| 519 |
msgstr ""
|
| 520 |
|
| 521 |
-
#: includes/admin/admin.php:
|
| 522 |
msgid ""
|
| 523 |
"bbPress 2.2 has been thoroughly tested against the ongoing development of "
|
| 524 |
"WordPress 3.5."
|
| 525 |
msgstr ""
|
| 526 |
|
| 527 |
-
#: includes/admin/admin.php:
|
| 528 |
msgid "Go to Forum Settings"
|
| 529 |
msgstr ""
|
| 530 |
|
| 531 |
-
#: includes/admin/admin.php:
|
| 532 |
msgid "bbPress is created by a worldwide swarm of busy, busy bees."
|
| 533 |
msgstr ""
|
| 534 |
|
| 535 |
-
#: includes/admin/admin.php:
|
| 536 |
msgid "Project Leaders"
|
| 537 |
msgstr ""
|
| 538 |
|
| 539 |
-
#: includes/admin/admin.php:
|
| 540 |
msgid "Founding Developer"
|
| 541 |
msgstr ""
|
| 542 |
|
| 543 |
-
#: includes/admin/admin.php:
|
| 544 |
msgid "Lead Developer"
|
| 545 |
msgstr ""
|
| 546 |
|
| 547 |
-
#: includes/admin/admin.php:
|
| 548 |
msgid "Contributing Developers"
|
| 549 |
msgstr ""
|
| 550 |
|
| 551 |
-
#: includes/admin/admin.php:
|
| 552 |
msgid "Codex Rockstars"
|
| 553 |
msgstr ""
|
| 554 |
|
| 555 |
-
#: includes/admin/admin.php:
|
| 556 |
msgid "Core Contributors to bbPress 2.2"
|
| 557 |
msgstr ""
|
| 558 |
|
| 559 |
-
#: includes/admin/admin.php:
|
| 560 |
msgid "Update Forum"
|
| 561 |
msgstr ""
|
| 562 |
|
| 563 |
-
#: includes/admin/admin.php:
|
| 564 |
msgid "All done!"
|
| 565 |
msgstr ""
|
| 566 |
|
| 567 |
-
#: includes/admin/admin.php:
|
| 568 |
msgid "Go Back"
|
| 569 |
msgstr ""
|
| 570 |
|
| 571 |
-
#: includes/admin/admin.php:
|
| 572 |
msgid ""
|
| 573 |
"You can update your forum through this page. Hit the link below to update."
|
| 574 |
msgstr ""
|
| 575 |
|
| 576 |
-
#: includes/admin/admin.php:
|
| 577 |
msgid ""
|
| 578 |
"Warning! Problem updating %1$s. Your server may not be able to connect to "
|
| 579 |
"sites running on it. Error message: <em>%2$s</em>"
|
| 580 |
msgstr ""
|
| 581 |
|
| 582 |
-
#: includes/admin/admin.php:
|
| 583 |
msgid ""
|
| 584 |
"If your browser doesn’t start loading the next page automatically, "
|
| 585 |
"click this link:"
|
| 586 |
msgstr ""
|
| 587 |
|
| 588 |
-
#: includes/admin/admin.php:
|
| 589 |
msgid "Next Forums"
|
| 590 |
msgstr ""
|
| 591 |
|
| 592 |
-
#: includes/admin/admin.php:
|
| 593 |
msgid ""
|
| 594 |
"You can update all the forums on your network through this page. It works by "
|
| 595 |
"calling the update script of each site automatically. Hit the link below to "
|
|
@@ -724,12 +724,16 @@ msgstr ""
|
|
| 724 |
msgid "Converting replies (%1$s - %2$s)"
|
| 725 |
msgstr ""
|
| 726 |
|
| 727 |
-
#: includes/admin/converters/
|
|
|
|
|
|
|
|
|
|
|
|
|
| 728 |
msgid "Re: "
|
| 729 |
msgstr ""
|
| 730 |
|
| 731 |
#: includes/admin/forums.php:120 includes/admin/replies.php:132
|
| 732 |
-
#: includes/admin/settings.php:
|
| 733 |
msgid "Overview"
|
| 734 |
msgstr ""
|
| 735 |
|
|
@@ -823,14 +827,14 @@ msgstr ""
|
|
| 823 |
|
| 824 |
#: includes/admin/forums.php:162 includes/admin/forums.php:233
|
| 825 |
#: includes/admin/replies.php:177 includes/admin/replies.php:245
|
| 826 |
-
#: includes/admin/settings.php:
|
| 827 |
#: includes/admin/topics.php:246
|
| 828 |
msgid "For more information:"
|
| 829 |
msgstr ""
|
| 830 |
|
| 831 |
#: includes/admin/forums.php:163 includes/admin/forums.php:234
|
| 832 |
#: includes/admin/replies.php:178 includes/admin/replies.php:246
|
| 833 |
-
#: includes/admin/settings.php:
|
| 834 |
#: includes/admin/topics.php:247
|
| 835 |
msgid ""
|
| 836 |
"<a href=\"http://codex.bbpress.org\" target=\"_blank\">bbPress "
|
|
@@ -839,7 +843,7 @@ msgstr ""
|
|
| 839 |
|
| 840 |
#: includes/admin/forums.php:164 includes/admin/forums.php:235
|
| 841 |
#: includes/admin/replies.php:179 includes/admin/replies.php:247
|
| 842 |
-
#: includes/admin/settings.php:
|
| 843 |
#: includes/admin/topics.php:248
|
| 844 |
msgid ""
|
| 845 |
"<a href=\"http://bbpress.org/forums/\" target=\"_blank\">bbPress Support "
|
|
@@ -998,7 +1002,7 @@ msgstr ""
|
|
| 998 |
msgid "%1$s <br /> %2$s"
|
| 999 |
msgstr ""
|
| 1000 |
|
| 1001 |
-
#: includes/admin/forums.php:474 includes/forums/template-tags.php:
|
| 1002 |
msgid "No Topics"
|
| 1003 |
msgstr ""
|
| 1004 |
|
|
@@ -1145,7 +1149,7 @@ msgid "Email:"
|
|
| 1145 |
msgstr ""
|
| 1146 |
|
| 1147 |
#: includes/admin/metaboxes.php:474
|
| 1148 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 1149 |
#: templates/default/bbpress/form-user-register.php:28
|
| 1150 |
msgid "Email"
|
| 1151 |
msgstr ""
|
|
@@ -1372,6 +1376,8 @@ msgstr ""
|
|
| 1372 |
#: includes/admin/replies.php:623 includes/admin/topics.php:689
|
| 1373 |
#: templates/default/bbpress/loop-replies.php:18
|
| 1374 |
#: templates/default/bbpress/loop-replies.php:52
|
|
|
|
|
|
|
| 1375 |
msgid "Author"
|
| 1376 |
msgstr ""
|
| 1377 |
|
|
@@ -1409,38 +1415,38 @@ msgid "Mark this reply as spam"
|
|
| 1409 |
msgstr ""
|
| 1410 |
|
| 1411 |
#: includes/admin/replies.php:790 includes/admin/topics.php:863
|
| 1412 |
-
#: includes/replies/template-tags.php:
|
| 1413 |
-
#: includes/topics/template-tags.php:
|
| 1414 |
msgid "Spam"
|
| 1415 |
msgstr ""
|
| 1416 |
|
| 1417 |
#: includes/admin/replies.php:799 includes/admin/topics.php:871
|
| 1418 |
-
#: includes/replies/template-tags.php:
|
| 1419 |
-
#: includes/topics/template-tags.php:
|
| 1420 |
msgid "Restore this item from the Trash"
|
| 1421 |
msgstr ""
|
| 1422 |
|
| 1423 |
#: includes/admin/replies.php:799 includes/admin/topics.php:871
|
| 1424 |
-
#: includes/replies/template-tags.php:
|
| 1425 |
-
#: includes/topics/template-tags.php:
|
| 1426 |
msgid "Restore"
|
| 1427 |
msgstr ""
|
| 1428 |
|
| 1429 |
#: includes/admin/replies.php:801 includes/admin/topics.php:873
|
| 1430 |
-
#: includes/replies/template-tags.php:
|
| 1431 |
-
#: includes/topics/template-tags.php:
|
| 1432 |
msgid "Move this item to the Trash"
|
| 1433 |
msgstr ""
|
| 1434 |
|
| 1435 |
#: includes/admin/replies.php:801 includes/admin/topics.php:873
|
| 1436 |
-
#: includes/replies/template-tags.php:
|
| 1437 |
-
#: includes/topics/template-tags.php:
|
| 1438 |
msgid "Trash"
|
| 1439 |
msgstr ""
|
| 1440 |
|
| 1441 |
#: includes/admin/replies.php:805 includes/admin/topics.php:877
|
| 1442 |
-
#: includes/replies/template-tags.php:
|
| 1443 |
-
#: includes/topics/template-tags.php:
|
| 1444 |
msgid "Delete this item permanently"
|
| 1445 |
msgstr ""
|
| 1446 |
|
|
@@ -1491,7 +1497,7 @@ msgstr ""
|
|
| 1491 |
msgid "Reply draft updated. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
|
| 1492 |
msgstr ""
|
| 1493 |
|
| 1494 |
-
#: includes/admin/settings.php:24 includes/admin/settings.php:
|
| 1495 |
msgid "Main Settings"
|
| 1496 |
msgstr ""
|
| 1497 |
|
|
@@ -1499,7 +1505,7 @@ msgstr ""
|
|
| 1499 |
msgid "Theme Packages"
|
| 1500 |
msgstr ""
|
| 1501 |
|
| 1502 |
-
#: includes/admin/settings.php:34 includes/admin/settings.php:
|
| 1503 |
msgid "Per Page"
|
| 1504 |
msgstr ""
|
| 1505 |
|
|
@@ -1531,7 +1537,7 @@ msgstr ""
|
|
| 1531 |
msgid "Throttle posting every"
|
| 1532 |
msgstr ""
|
| 1533 |
|
| 1534 |
-
#: includes/admin/settings.php:97 includes/admin/settings.php:
|
| 1535 |
msgid "Revisions"
|
| 1536 |
msgstr ""
|
| 1537 |
|
|
@@ -1573,11 +1579,11 @@ msgstr ""
|
|
| 1573 |
msgid "Current Package"
|
| 1574 |
msgstr ""
|
| 1575 |
|
| 1576 |
-
#: includes/admin/settings.php:229 includes/admin/settings.php:
|
| 1577 |
msgid "Forums base"
|
| 1578 |
msgstr ""
|
| 1579 |
|
| 1580 |
-
#: includes/admin/settings.php:237 includes/admin/settings.php:
|
| 1581 |
msgid "Topics base"
|
| 1582 |
msgstr ""
|
| 1583 |
|
|
@@ -1585,19 +1591,19 @@ msgstr ""
|
|
| 1585 |
msgid "Forum Prefix"
|
| 1586 |
msgstr ""
|
| 1587 |
|
| 1588 |
-
#: includes/admin/settings.php:258 includes/admin/settings.php:
|
| 1589 |
msgid "Forum slug"
|
| 1590 |
msgstr ""
|
| 1591 |
|
| 1592 |
-
#: includes/admin/settings.php:266 includes/admin/settings.php:
|
| 1593 |
msgid "Topic slug"
|
| 1594 |
msgstr ""
|
| 1595 |
|
| 1596 |
-
#: includes/admin/settings.php:274 includes/admin/settings.php:
|
| 1597 |
msgid "Topic tag slug"
|
| 1598 |
msgstr ""
|
| 1599 |
|
| 1600 |
-
#: includes/admin/settings.php:282 includes/admin/settings.php:
|
| 1601 |
msgid "Reply slug"
|
| 1602 |
msgstr ""
|
| 1603 |
|
|
@@ -1609,358 +1615,362 @@ msgstr ""
|
|
| 1609 |
msgid "Topic view slug"
|
| 1610 |
msgstr ""
|
| 1611 |
|
| 1612 |
-
#: includes/admin/settings.php:
|
| 1613 |
-
msgid "
|
| 1614 |
msgstr ""
|
| 1615 |
|
| 1616 |
#: includes/admin/settings.php:319
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1617 |
msgid "Group Forums Parent"
|
| 1618 |
msgstr ""
|
| 1619 |
|
| 1620 |
-
#: includes/admin/settings.php:
|
| 1621 |
msgid "Use Akismet"
|
| 1622 |
msgstr ""
|
| 1623 |
|
| 1624 |
-
#: includes/admin/settings.php:
|
| 1625 |
msgid "Main forum settings for enabling features and setting time limits"
|
| 1626 |
msgstr ""
|
| 1627 |
|
| 1628 |
-
#: includes/admin/settings.php:
|
| 1629 |
msgid "minutes"
|
| 1630 |
msgstr ""
|
| 1631 |
|
| 1632 |
-
#: includes/admin/settings.php:
|
| 1633 |
msgid "seconds"
|
| 1634 |
msgstr ""
|
| 1635 |
|
| 1636 |
-
#: includes/admin/settings.php:
|
| 1637 |
msgid "Allow users to mark topics as favorites"
|
| 1638 |
msgstr ""
|
| 1639 |
|
| 1640 |
-
#: includes/admin/settings.php:
|
| 1641 |
msgid "Allow users to subscribe to topics"
|
| 1642 |
msgstr ""
|
| 1643 |
|
| 1644 |
-
#: includes/admin/settings.php:
|
| 1645 |
msgid "Allow topics to have tags"
|
| 1646 |
msgstr ""
|
| 1647 |
|
| 1648 |
-
#: includes/admin/settings.php:
|
| 1649 |
msgid "Allow topic and reply revision logging"
|
| 1650 |
msgstr ""
|
| 1651 |
|
| 1652 |
-
#: includes/admin/settings.php:
|
| 1653 |
msgid "Allow guest users without accounts to create topics and replies"
|
| 1654 |
msgstr ""
|
| 1655 |
|
| 1656 |
-
#: includes/admin/settings.php:
|
| 1657 |
msgid ""
|
| 1658 |
"Automatically assign default role to new, registered users upon visiting the "
|
| 1659 |
"site."
|
| 1660 |
msgstr ""
|
| 1661 |
|
| 1662 |
-
#: includes/admin/settings.php:
|
| 1663 |
msgid "Use the fancy WordPress editor to create and edit topics and replies"
|
| 1664 |
msgstr ""
|
| 1665 |
|
| 1666 |
-
#: includes/admin/settings.php:
|
| 1667 |
msgid "How your forum content is displayed within your existing theme."
|
| 1668 |
msgstr ""
|
| 1669 |
|
| 1670 |
-
#: includes/admin/settings.php:
|
| 1671 |
msgid "%1$s - %2$s"
|
| 1672 |
msgstr ""
|
| 1673 |
|
| 1674 |
-
#: includes/admin/settings.php:
|
| 1675 |
msgid "will serve all bbPress templates"
|
| 1676 |
msgstr ""
|
| 1677 |
|
| 1678 |
-
#: includes/admin/settings.php:
|
| 1679 |
msgid "No template packages available."
|
| 1680 |
msgstr ""
|
| 1681 |
|
| 1682 |
-
#: includes/admin/settings.php:
|
| 1683 |
msgid ""
|
| 1684 |
"Embed media (YouTube, Twitter, Flickr, etc...) directly into topics and "
|
| 1685 |
"replies"
|
| 1686 |
msgstr ""
|
| 1687 |
|
| 1688 |
-
#: includes/admin/settings.php:
|
| 1689 |
msgid "How many topics and replies to show per page"
|
| 1690 |
msgstr ""
|
| 1691 |
|
| 1692 |
-
#: includes/admin/settings.php:
|
| 1693 |
-
#: includes/admin/settings.php:
|
| 1694 |
msgid "per page"
|
| 1695 |
msgstr ""
|
| 1696 |
|
| 1697 |
-
#: includes/admin/settings.php:
|
| 1698 |
msgid "How many topics and replies to show per RSS page"
|
| 1699 |
msgstr ""
|
| 1700 |
|
| 1701 |
-
#: includes/admin/settings.php:
|
| 1702 |
msgid ""
|
| 1703 |
"Custom root slugs to prefix your forums and topics with. These can be "
|
| 1704 |
"partnered with WordPress pages to allow more flexibility."
|
| 1705 |
msgstr ""
|
| 1706 |
|
| 1707 |
-
#: includes/admin/settings.php:
|
| 1708 |
msgid ""
|
| 1709 |
"Custom slugs for single forums, topics, replies, tags, users, and views "
|
| 1710 |
"here. If you change these, existing permalinks will also change."
|
| 1711 |
msgstr ""
|
| 1712 |
|
| 1713 |
-
#: includes/admin/settings.php:
|
| 1714 |
msgid "Prefix your forum area with the Forum Base slug (Recommended)"
|
| 1715 |
msgstr ""
|
| 1716 |
|
| 1717 |
-
#: includes/admin/settings.php:
|
| 1718 |
msgid "Forum settings for BuddyPress"
|
| 1719 |
msgstr ""
|
| 1720 |
|
| 1721 |
-
#: includes/admin/settings.php:
|
| 1722 |
msgid "Allow BuddyPress Groups to have their own forums"
|
| 1723 |
msgstr ""
|
| 1724 |
|
| 1725 |
-
#: includes/admin/settings.php:
|
| 1726 |
msgid "— Forum root —"
|
| 1727 |
msgstr ""
|
| 1728 |
|
| 1729 |
-
#: includes/admin/settings.php:
|
| 1730 |
msgid "is the parent for all group forums"
|
| 1731 |
msgstr ""
|
| 1732 |
|
| 1733 |
-
#: includes/admin/settings.php:
|
| 1734 |
msgid ""
|
| 1735 |
"Using the Forum Root is not recommended. Changing this does not move "
|
| 1736 |
"existing forums."
|
| 1737 |
msgstr ""
|
| 1738 |
|
| 1739 |
-
#: includes/admin/settings.php:
|
| 1740 |
msgid "Forum settings for Akismet"
|
| 1741 |
msgstr ""
|
| 1742 |
|
| 1743 |
-
#: includes/admin/settings.php:
|
| 1744 |
msgid "Allow Akismet to actively prevent forum spam."
|
| 1745 |
msgstr ""
|
| 1746 |
|
| 1747 |
-
#: includes/admin/settings.php:
|
| 1748 |
msgid "Forums Settings"
|
| 1749 |
msgstr ""
|
| 1750 |
|
| 1751 |
-
#: includes/admin/settings.php:
|
| 1752 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 1753 |
msgid "Save Changes"
|
| 1754 |
msgstr ""
|
| 1755 |
|
| 1756 |
-
#: includes/admin/settings.php:
|
| 1757 |
msgid ""
|
| 1758 |
"Information about your previous forums database so that they can be "
|
| 1759 |
"converted. <strong>Backup your database before proceeding.</strong>"
|
| 1760 |
msgstr ""
|
| 1761 |
|
| 1762 |
-
#: includes/admin/settings.php:
|
| 1763 |
msgid "is the previous forum software"
|
| 1764 |
msgstr ""
|
| 1765 |
|
| 1766 |
-
#: includes/admin/settings.php:
|
| 1767 |
msgid "IP or hostname"
|
| 1768 |
msgstr ""
|
| 1769 |
|
| 1770 |
-
#: includes/admin/settings.php:
|
| 1771 |
msgid "Use default 3306 if unsure"
|
| 1772 |
msgstr ""
|
| 1773 |
|
| 1774 |
-
#: includes/admin/settings.php:
|
| 1775 |
msgid "User for your database connection"
|
| 1776 |
msgstr ""
|
| 1777 |
|
| 1778 |
-
#: includes/admin/settings.php:
|
| 1779 |
msgid "Password to access the database"
|
| 1780 |
msgstr ""
|
| 1781 |
|
| 1782 |
-
#: includes/admin/settings.php:
|
| 1783 |
msgid "Name of the database with your old forum data"
|
| 1784 |
msgstr ""
|
| 1785 |
|
| 1786 |
-
#: includes/admin/settings.php:
|
| 1787 |
msgid "Some optional parameters to help tune the conversion process."
|
| 1788 |
msgstr ""
|
| 1789 |
|
| 1790 |
-
#: includes/admin/settings.php:
|
| 1791 |
msgid ""
|
| 1792 |
"(If converting from BuddyPress Forums, use \"wp_bb_\" or your custom prefix)"
|
| 1793 |
msgstr ""
|
| 1794 |
|
| 1795 |
-
#: includes/admin/settings.php:
|
| 1796 |
msgid "rows to process at a time"
|
| 1797 |
msgstr ""
|
| 1798 |
|
| 1799 |
-
#: includes/admin/settings.php:
|
| 1800 |
msgid "Keep this low if you experience out-of-memory issues."
|
| 1801 |
msgstr ""
|
| 1802 |
|
| 1803 |
-
#: includes/admin/settings.php:
|
| 1804 |
msgid "second(s) delay between each group of rows"
|
| 1805 |
msgstr ""
|
| 1806 |
|
| 1807 |
-
#: includes/admin/settings.php:
|
| 1808 |
msgid "Keep this high to prevent too-many-connection issues."
|
| 1809 |
msgstr ""
|
| 1810 |
|
| 1811 |
-
#: includes/admin/settings.php:
|
| 1812 |
msgid "Start a fresh conversion from the beginning"
|
| 1813 |
msgstr ""
|
| 1814 |
|
| 1815 |
-
#: includes/admin/settings.php:
|
| 1816 |
msgid "You should clean old conversion information before starting over."
|
| 1817 |
msgstr ""
|
| 1818 |
|
| 1819 |
-
#: includes/admin/settings.php:
|
| 1820 |
msgid "Purge all information from a previously attempted import"
|
| 1821 |
msgstr ""
|
| 1822 |
|
| 1823 |
-
#: includes/admin/settings.php:
|
| 1824 |
msgid ""
|
| 1825 |
"Use this if an import failed and you want to remove that incomplete data."
|
| 1826 |
msgstr ""
|
| 1827 |
|
| 1828 |
-
#: includes/admin/settings.php:
|
| 1829 |
msgid "Attempt to import user accounts from previous forums"
|
| 1830 |
msgstr ""
|
| 1831 |
|
| 1832 |
-
#: includes/admin/settings.php:
|
| 1833 |
msgid ""
|
| 1834 |
"Non-bbPress passwords cannot be automatically converted. They will be "
|
| 1835 |
"converted as each user logs in."
|
| 1836 |
msgstr ""
|
| 1837 |
|
| 1838 |
-
#: includes/admin/settings.php:
|
| 1839 |
msgid "Start"
|
| 1840 |
msgstr ""
|
| 1841 |
|
| 1842 |
-
#: includes/admin/settings.php:
|
| 1843 |
msgid "Stop"
|
| 1844 |
msgstr ""
|
| 1845 |
|
| 1846 |
-
#: includes/admin/settings.php:
|
| 1847 |
msgid "This screen provides access to all of the Forums settings."
|
| 1848 |
msgstr ""
|
| 1849 |
|
| 1850 |
-
#: includes/admin/settings.php:
|
| 1851 |
msgid ""
|
| 1852 |
"Please see the additional help tabs for more information on each indiviual "
|
| 1853 |
"section."
|
| 1854 |
msgstr ""
|
| 1855 |
|
| 1856 |
-
#: includes/admin/settings.php:
|
| 1857 |
msgid "In the Main Settings you have a number of options:"
|
| 1858 |
msgstr ""
|
| 1859 |
|
| 1860 |
-
#: includes/admin/settings.php:
|
| 1861 |
msgid ""
|
| 1862 |
"You can choose to lock a post after a certain number of minutes. \"Locking "
|
| 1863 |
"post editing\" will prevent the author from editing some amount of time "
|
| 1864 |
"after saving a post."
|
| 1865 |
msgstr ""
|
| 1866 |
|
| 1867 |
-
#: includes/admin/settings.php:
|
| 1868 |
msgid ""
|
| 1869 |
"\"Throttle time\" is the amount of time required between posts from a single "
|
| 1870 |
"author. The higher the throttle time, the longer a user will need to wait "
|
| 1871 |
"between posting to the forum."
|
| 1872 |
msgstr ""
|
| 1873 |
|
| 1874 |
-
#: includes/admin/settings.php:
|
| 1875 |
msgid ""
|
| 1876 |
"Favorites are a way for users to save and later return to topics they favor. "
|
| 1877 |
"This is enabled by default."
|
| 1878 |
msgstr ""
|
| 1879 |
|
| 1880 |
-
#: includes/admin/settings.php:
|
| 1881 |
msgid ""
|
| 1882 |
"Subscriptions allow users to subscribe for notifications to topics that "
|
| 1883 |
"interest them. This is enabled by default."
|
| 1884 |
msgstr ""
|
| 1885 |
|
| 1886 |
-
#: includes/admin/settings.php:
|
| 1887 |
msgid ""
|
| 1888 |
"Topic-Tags allow users to filter topics between forums. This is enabled by "
|
| 1889 |
"default."
|
| 1890 |
msgstr ""
|
| 1891 |
|
| 1892 |
-
#: includes/admin/settings.php:
|
| 1893 |
msgid ""
|
| 1894 |
"\"Anonymous Posting\" allows guest users who do not have accounts on your "
|
| 1895 |
"site to both create topics as well as replies."
|
| 1896 |
msgstr ""
|
| 1897 |
|
| 1898 |
-
#: includes/admin/settings.php:
|
| 1899 |
msgid ""
|
| 1900 |
"The Fancy Editor brings the luxury of the Visual editor and HTML editor from "
|
| 1901 |
"the traditional WordPress dashboard into your theme."
|
| 1902 |
msgstr ""
|
| 1903 |
|
| 1904 |
-
#: includes/admin/settings.php:
|
| 1905 |
msgid ""
|
| 1906 |
"Auto-embed will embed the media content from a URL directly into the "
|
| 1907 |
"replies. For example: links to Flickr and YouTube."
|
| 1908 |
msgstr ""
|
| 1909 |
|
| 1910 |
-
#: includes/admin/settings.php:
|
| 1911 |
msgid ""
|
| 1912 |
"You must click the Save Changes button at the bottom of the screen for new "
|
| 1913 |
"settings to take effect."
|
| 1914 |
msgstr ""
|
| 1915 |
|
| 1916 |
-
#: includes/admin/settings.php:
|
| 1917 |
msgid ""
|
| 1918 |
"Per Page settings allow you to control the number of topics and replies "
|
| 1919 |
"appear on each page."
|
| 1920 |
msgstr ""
|
| 1921 |
|
| 1922 |
-
#: includes/admin/settings.php:
|
| 1923 |
msgid ""
|
| 1924 |
"This is comparable to the WordPress \"Reading Settings\" page, where you can "
|
| 1925 |
"set the number of posts that should show on blog pages and in feeds."
|
| 1926 |
msgstr ""
|
| 1927 |
|
| 1928 |
-
#: includes/admin/settings.php:
|
| 1929 |
msgid ""
|
| 1930 |
"These are broken up into two separate groups: one for what appears in your "
|
| 1931 |
"theme, another for RSS feeds."
|
| 1932 |
msgstr ""
|
| 1933 |
|
| 1934 |
-
#: includes/admin/settings.php:
|
| 1935 |
msgid "Slugs"
|
| 1936 |
msgstr ""
|
| 1937 |
|
| 1938 |
-
#: includes/admin/settings.php:
|
| 1939 |
msgid ""
|
| 1940 |
"The Slugs section allows you to control the permalink structure for your "
|
| 1941 |
"forums."
|
| 1942 |
msgstr ""
|
| 1943 |
|
| 1944 |
-
#: includes/admin/settings.php:
|
| 1945 |
msgid ""
|
| 1946 |
"\"Archive Slugs\" are used as the \"root\" for your forums and topics. If "
|
| 1947 |
"you combine these values with existing page slugs, bbPress will attempt to "
|
| 1948 |
"output the most correct title and content."
|
| 1949 |
msgstr ""
|
| 1950 |
|
| 1951 |
-
#: includes/admin/settings.php:
|
| 1952 |
msgid ""
|
| 1953 |
"\"Single Slugs\" are used as a prefix when viewing an individual forum, "
|
| 1954 |
"topic, reply, user, or view."
|
| 1955 |
msgstr ""
|
| 1956 |
|
| 1957 |
-
#: includes/admin/settings.php:
|
| 1958 |
msgid ""
|
| 1959 |
"In the event of a slug collision with WordPress or BuddyPress, a warning "
|
| 1960 |
"will appear next to the problem slug(s)."
|
| 1961 |
msgstr ""
|
| 1962 |
|
| 1963 |
-
#: includes/admin/settings.php:
|
| 1964 |
#: templates/default/bbpress/loop-forums.php:21
|
| 1965 |
#: templates/default/bbpress/loop-replies.php:24
|
| 1966 |
#: templates/default/bbpress/loop-replies.php:58
|
|
@@ -1968,39 +1978,39 @@ msgstr ""
|
|
| 1968 |
msgid "Posts"
|
| 1969 |
msgstr ""
|
| 1970 |
|
| 1971 |
-
#: includes/admin/settings.php:
|
| 1972 |
msgid "Pages"
|
| 1973 |
msgstr ""
|
| 1974 |
|
| 1975 |
-
#: includes/admin/settings.php:
|
| 1976 |
msgid "Attachments"
|
| 1977 |
msgstr ""
|
| 1978 |
|
| 1979 |
-
#: includes/admin/settings.php:
|
| 1980 |
msgid "Menus"
|
| 1981 |
msgstr ""
|
| 1982 |
|
| 1983 |
-
#: includes/admin/settings.php:
|
| 1984 |
msgid "Tag base"
|
| 1985 |
msgstr ""
|
| 1986 |
|
| 1987 |
-
#: includes/admin/settings.php:
|
| 1988 |
msgid "Category base"
|
| 1989 |
msgstr ""
|
| 1990 |
|
| 1991 |
-
#: includes/admin/settings.php:
|
| 1992 |
msgid "User base"
|
| 1993 |
msgstr ""
|
| 1994 |
|
| 1995 |
-
#: includes/admin/settings.php:
|
| 1996 |
msgid "View base"
|
| 1997 |
msgstr ""
|
| 1998 |
|
| 1999 |
-
#: includes/admin/settings.php:
|
| 2000 |
msgid "%s page"
|
| 2001 |
msgstr ""
|
| 2002 |
|
| 2003 |
-
#: includes/admin/settings.php:
|
| 2004 |
msgid "Possible %1$s conflict: <strong>%2$s</strong>"
|
| 2005 |
msgstr ""
|
| 2006 |
|
|
@@ -2047,226 +2057,239 @@ msgid "Recalculate last activity in each topic and forum"
|
|
| 2047 |
msgstr ""
|
| 2048 |
|
| 2049 |
#: includes/admin/tools.php:164
|
| 2050 |
-
msgid "
|
| 2051 |
msgstr ""
|
| 2052 |
|
| 2053 |
#: includes/admin/tools.php:165
|
| 2054 |
-
msgid "
|
| 2055 |
msgstr ""
|
| 2056 |
|
| 2057 |
#: includes/admin/tools.php:166
|
| 2058 |
-
msgid "Count
|
| 2059 |
msgstr ""
|
| 2060 |
|
| 2061 |
#: includes/admin/tools.php:167
|
| 2062 |
-
msgid "Count replies in each
|
| 2063 |
msgstr ""
|
| 2064 |
|
| 2065 |
#: includes/admin/tools.php:168
|
| 2066 |
-
msgid "Count
|
| 2067 |
msgstr ""
|
| 2068 |
|
| 2069 |
#: includes/admin/tools.php:169
|
| 2070 |
-
msgid "Count
|
| 2071 |
msgstr ""
|
| 2072 |
|
| 2073 |
#: includes/admin/tools.php:170
|
| 2074 |
-
msgid "Count
|
| 2075 |
msgstr ""
|
| 2076 |
|
| 2077 |
#: includes/admin/tools.php:171
|
| 2078 |
-
msgid "Count
|
| 2079 |
msgstr ""
|
| 2080 |
|
| 2081 |
#: includes/admin/tools.php:172
|
| 2082 |
-
msgid "
|
| 2083 |
msgstr ""
|
| 2084 |
|
| 2085 |
#: includes/admin/tools.php:173
|
| 2086 |
-
msgid "Remove trashed topics from user
|
| 2087 |
msgstr ""
|
| 2088 |
|
| 2089 |
#: includes/admin/tools.php:174
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2090 |
msgid "Remap existing users to default forum roles"
|
| 2091 |
msgstr ""
|
| 2092 |
|
| 2093 |
-
#: includes/admin/tools.php:
|
| 2094 |
msgid "Counting the number of replies in each topic… %s"
|
| 2095 |
msgstr ""
|
| 2096 |
|
| 2097 |
-
#: includes/admin/tools.php:
|
| 2098 |
-
#: includes/admin/tools.php:
|
| 2099 |
-
#: includes/admin/tools.php:
|
| 2100 |
-
#: includes/admin/tools.php:
|
| 2101 |
-
#: includes/admin/tools.php:
|
| 2102 |
-
#: includes/admin/tools.php:
|
| 2103 |
-
#: includes/admin/tools.php:
|
| 2104 |
-
#: includes/admin/tools.php:
|
| 2105 |
msgid "Failed!"
|
| 2106 |
msgstr ""
|
| 2107 |
|
| 2108 |
-
#: includes/admin/tools.php:
|
| 2109 |
-
#: includes/admin/tools.php:
|
| 2110 |
-
#: includes/admin/tools.php:
|
| 2111 |
-
#: includes/admin/tools.php:
|
| 2112 |
-
#: includes/admin/tools.php:
|
| 2113 |
-
#: includes/admin/tools.php:
|
| 2114 |
-
#: includes/admin/tools.php:
|
| 2115 |
msgid "Complete!"
|
| 2116 |
msgstr ""
|
| 2117 |
|
| 2118 |
-
#: includes/admin/tools.php:
|
| 2119 |
msgid "Counting the number of voices in each topic… %s"
|
| 2120 |
msgstr ""
|
| 2121 |
|
| 2122 |
-
#: includes/admin/tools.php:
|
| 2123 |
msgid ""
|
| 2124 |
"Counting the number of spammed and trashed replies in each topic… %s"
|
| 2125 |
msgstr ""
|
| 2126 |
|
| 2127 |
-
#: includes/admin/tools.php:
|
| 2128 |
msgid "Repairing BuddyPress group-forum relationships… %s"
|
| 2129 |
msgstr ""
|
| 2130 |
|
| 2131 |
-
#: includes/admin/tools.php:
|
| 2132 |
msgid "Group Forums"
|
| 2133 |
msgstr ""
|
| 2134 |
|
| 2135 |
-
#: includes/admin/tools.php:
|
| 2136 |
-
msgid "
|
|
|
|
| 2137 |
msgstr ""
|
| 2138 |
|
| 2139 |
-
#: includes/admin/tools.php:
|
| 2140 |
msgid "Counting the number of topics in each forum… %s"
|
| 2141 |
msgstr ""
|
| 2142 |
|
| 2143 |
-
#: includes/admin/tools.php:
|
| 2144 |
msgid "Counting the number of replies in each forum… %s"
|
| 2145 |
msgstr ""
|
| 2146 |
|
| 2147 |
-
#: includes/admin/tools.php:
|
| 2148 |
msgid "Counting the number of topics each user has created… %s"
|
| 2149 |
msgstr ""
|
| 2150 |
|
| 2151 |
-
#: includes/admin/tools.php:
|
| 2152 |
msgid "Counting the number of topics to which each user has replied… %s"
|
| 2153 |
msgstr ""
|
| 2154 |
|
| 2155 |
-
#: includes/admin/tools.php:
|
| 2156 |
msgid "Removing trashed topics from user favorites… %s"
|
| 2157 |
msgstr ""
|
| 2158 |
|
| 2159 |
-
#: includes/admin/tools.php:
|
| 2160 |
msgid "Nothing to remove!"
|
| 2161 |
msgstr ""
|
| 2162 |
|
| 2163 |
-
#: includes/admin/tools.php:
|
| 2164 |
msgid "Removing trashed topics from user subscriptions… %s"
|
| 2165 |
msgstr ""
|
| 2166 |
|
| 2167 |
-
#: includes/admin/tools.php:
|
| 2168 |
msgid "Remapping forum role for each user on this site… %s"
|
| 2169 |
msgstr ""
|
| 2170 |
|
| 2171 |
-
#: includes/admin/tools.php:
|
| 2172 |
msgid "Complete! %s users updated."
|
| 2173 |
msgstr ""
|
| 2174 |
|
| 2175 |
-
#: includes/admin/tools.php:
|
| 2176 |
msgid "Recomputing latest post in every topic and forum… %s"
|
| 2177 |
msgstr ""
|
| 2178 |
|
| 2179 |
-
#: includes/admin/tools.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2180 |
msgid "Recalculating forum visibility … %s"
|
| 2181 |
msgstr ""
|
| 2182 |
|
| 2183 |
-
#: includes/admin/tools.php:
|
| 2184 |
msgid "Recalculating the forum for each post … %s"
|
| 2185 |
msgstr ""
|
| 2186 |
|
| 2187 |
-
#: includes/admin/tools.php:
|
| 2188 |
msgid "Recalculating the topic for each post … %s"
|
| 2189 |
msgstr ""
|
| 2190 |
|
| 2191 |
-
#: includes/admin/tools.php:
|
| 2192 |
msgid ""
|
| 2193 |
"This will revert your forums back to a brand new installation. This process "
|
| 2194 |
"cannot be undone. <strong>Backup your database before proceeding</strong>."
|
| 2195 |
msgstr ""
|
| 2196 |
|
| 2197 |
-
#: includes/admin/tools.php:
|
| 2198 |
msgid "The following data will be removed:"
|
| 2199 |
msgstr ""
|
| 2200 |
|
| 2201 |
-
#: includes/admin/tools.php:
|
| 2202 |
msgid "All Topic Tags"
|
| 2203 |
msgstr ""
|
| 2204 |
|
| 2205 |
-
#: includes/admin/tools.php:
|
| 2206 |
msgid "Related Meta Data"
|
| 2207 |
msgstr ""
|
| 2208 |
|
| 2209 |
-
#: includes/admin/tools.php:
|
| 2210 |
msgid "Forum Settings"
|
| 2211 |
msgstr ""
|
| 2212 |
|
| 2213 |
-
#: includes/admin/tools.php:
|
| 2214 |
msgid "Forum Activity"
|
| 2215 |
msgstr ""
|
| 2216 |
|
| 2217 |
-
#: includes/admin/tools.php:
|
| 2218 |
msgid "Forum User Roles"
|
| 2219 |
msgstr ""
|
| 2220 |
|
| 2221 |
-
#: includes/admin/tools.php:
|
| 2222 |
msgid "Importer Helper Data"
|
| 2223 |
msgstr ""
|
| 2224 |
|
| 2225 |
-
#: includes/admin/tools.php:
|
| 2226 |
msgid "Are you sure you want to do this?"
|
| 2227 |
msgstr ""
|
| 2228 |
|
| 2229 |
-
#: includes/admin/tools.php:
|
| 2230 |
msgid "Say it ain't so!"
|
| 2231 |
msgstr ""
|
| 2232 |
|
| 2233 |
-
#: includes/admin/tools.php:
|
| 2234 |
msgid "This process cannot be undone."
|
| 2235 |
msgstr ""
|
| 2236 |
|
| 2237 |
-
#: includes/admin/tools.php:
|
| 2238 |
msgid "Reset bbPress"
|
| 2239 |
msgstr ""
|
| 2240 |
|
| 2241 |
-
#: includes/admin/tools.php:
|
| 2242 |
msgid "Failed"
|
| 2243 |
msgstr ""
|
| 2244 |
|
| 2245 |
-
#: includes/admin/tools.php:
|
| 2246 |
msgid "Success!"
|
| 2247 |
msgstr ""
|
| 2248 |
|
| 2249 |
-
#: includes/admin/tools.php:
|
| 2250 |
msgid "Deleting Posts… %s"
|
| 2251 |
msgstr ""
|
| 2252 |
|
| 2253 |
-
#: includes/admin/tools.php:
|
| 2254 |
msgid "Deleting Post Meta… %s"
|
| 2255 |
msgstr ""
|
| 2256 |
|
| 2257 |
-
#: includes/admin/tools.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2258 |
msgid "Deleting User Meta… %s"
|
| 2259 |
msgstr ""
|
| 2260 |
|
| 2261 |
-
#: includes/admin/tools.php:
|
| 2262 |
msgid "Deleting Conversion Table… %s"
|
| 2263 |
msgstr ""
|
| 2264 |
|
| 2265 |
-
#: includes/admin/tools.php:
|
| 2266 |
msgid "Deleting Settings… %s"
|
| 2267 |
msgstr ""
|
| 2268 |
|
| 2269 |
-
#: includes/admin/tools.php:
|
| 2270 |
msgid "Deleting Roles and Capabilities… %s"
|
| 2271 |
msgstr ""
|
| 2272 |
|
|
@@ -2522,7 +2545,7 @@ msgstr ""
|
|
| 2522 |
msgid "(No Forum)"
|
| 2523 |
msgstr ""
|
| 2524 |
|
| 2525 |
-
#: includes/admin/topics.php:783 includes/topics/template-tags.php:
|
| 2526 |
msgid "No Replies"
|
| 2527 |
msgstr ""
|
| 2528 |
|
|
@@ -2548,7 +2571,7 @@ msgstr ""
|
|
| 2548 |
msgid "Unstick this topic"
|
| 2549 |
msgstr ""
|
| 2550 |
|
| 2551 |
-
#: includes/admin/topics.php:851 includes/topics/template-tags.php:
|
| 2552 |
msgid "Unstick"
|
| 2553 |
msgstr ""
|
| 2554 |
|
|
@@ -2556,7 +2579,7 @@ msgstr ""
|
|
| 2556 |
msgid "Stick this topic to its forum"
|
| 2557 |
msgstr ""
|
| 2558 |
|
| 2559 |
-
#: includes/admin/topics.php:854 includes/topics/template-tags.php:
|
| 2560 |
msgid "Stick"
|
| 2561 |
msgstr ""
|
| 2562 |
|
|
@@ -2564,7 +2587,7 @@ msgstr ""
|
|
| 2564 |
msgid "Stick this topic to front"
|
| 2565 |
msgstr ""
|
| 2566 |
|
| 2567 |
-
#: includes/admin/topics.php:854 includes/topics/template-tags.php:
|
| 2568 |
msgid "to front"
|
| 2569 |
msgstr ""
|
| 2570 |
|
|
@@ -2611,25 +2634,25 @@ msgstr ""
|
|
| 2611 |
msgid "Topic draft updated. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
|
| 2612 |
msgstr ""
|
| 2613 |
|
| 2614 |
-
#: includes/admin/users.php:87 includes/admin/users.php:
|
| 2615 |
#: templates/default/bbpress/form-user-roles.php:9
|
| 2616 |
msgid "Forum Role"
|
| 2617 |
msgstr ""
|
| 2618 |
|
| 2619 |
#: includes/admin/users.php:96 includes/admin/users.php:100
|
| 2620 |
-
#: includes/users/template-tags.php:
|
| 2621 |
-
msgid "— No role for
|
| 2622 |
msgstr ""
|
| 2623 |
|
| 2624 |
#: includes/admin/users.php:138 includes/admin/users.php:140
|
| 2625 |
msgid "Change forum role to…"
|
| 2626 |
msgstr ""
|
| 2627 |
|
| 2628 |
-
#: includes/admin/users.php:
|
| 2629 |
msgid "Change"
|
| 2630 |
msgstr ""
|
| 2631 |
|
| 2632 |
-
#: includes/admin/users.php:
|
| 2633 |
msgid "Site Role"
|
| 2634 |
msgstr ""
|
| 2635 |
|
|
@@ -2698,32 +2721,32 @@ msgctxt "Separator in time since"
|
|
| 2698 |
msgid ","
|
| 2699 |
msgstr ""
|
| 2700 |
|
| 2701 |
-
#: includes/common/functions.php:
|
| 2702 |
msgid "Private: %s"
|
| 2703 |
msgstr ""
|
| 2704 |
|
| 2705 |
-
#: includes/common/functions.php:
|
| 2706 |
msgid "Spammed: %s"
|
| 2707 |
msgstr ""
|
| 2708 |
|
| 2709 |
-
#: includes/common/functions.php:
|
| 2710 |
msgid "Trashed: %s"
|
| 2711 |
msgstr ""
|
| 2712 |
|
| 2713 |
-
#: includes/common/functions.php:
|
| 2714 |
msgid "<strong>ERROR</strong>: Invalid author name submitted!"
|
| 2715 |
msgstr ""
|
| 2716 |
|
| 2717 |
-
#: includes/common/functions.php:
|
| 2718 |
msgid "<strong>ERROR</strong>: Invalid email address submitted!"
|
| 2719 |
msgstr ""
|
| 2720 |
|
| 2721 |
-
#: includes/common/functions.php:
|
| 2722 |
msgid ""
|
| 2723 |
"%1$s wrote:\n"
|
| 2724 |
"\n"
|
| 2725 |
"%2$s\n"
|
| 2726 |
-
"\
|
| 2727 |
"Post Link: %3$s\n"
|
| 2728 |
"\n"
|
| 2729 |
"-----------\n"
|
|
@@ -2733,81 +2756,90 @@ msgid ""
|
|
| 2733 |
"Login and visit the topic to unsubscribe from these emails."
|
| 2734 |
msgstr ""
|
| 2735 |
|
| 2736 |
-
#: includes/common/functions.php:
|
| 2737 |
msgid ""
|
| 2738 |
"Conditional query tags do not work before the query is run. Before then, "
|
| 2739 |
"they always return false."
|
| 2740 |
msgstr ""
|
| 2741 |
|
| 2742 |
-
#: includes/common/template-tags.php:
|
| 2743 |
msgid "No topics available"
|
| 2744 |
msgstr ""
|
| 2745 |
|
| 2746 |
-
#: includes/common/template-tags.php:
|
| 2747 |
msgid "No forums available"
|
| 2748 |
msgstr ""
|
| 2749 |
|
| 2750 |
-
#: includes/common/template-tags.php:
|
| 2751 |
msgid "None available"
|
| 2752 |
msgstr ""
|
| 2753 |
|
| 2754 |
-
#: includes/common/template-tags.php:
|
| 2755 |
-
#: includes/
|
| 2756 |
-
#: includes/topics/functions.php:1597
|
| 2757 |
#: templates/default/bbpress/form-reply.php:29
|
| 2758 |
msgid "Reply To: %s"
|
| 2759 |
msgstr ""
|
| 2760 |
|
| 2761 |
-
#: includes/common/template-tags.php:
|
| 2762 |
msgid "Home"
|
| 2763 |
msgstr ""
|
| 2764 |
|
| 2765 |
-
#: includes/common/template-tags.php:
|
| 2766 |
msgid "(Edit)"
|
| 2767 |
msgstr ""
|
| 2768 |
|
| 2769 |
-
#: includes/common/template-tags.php:
|
| 2770 |
-
#: includes/common/template-tags.php:
|
| 2771 |
-
#: includes/common/template-tags.php:
|
| 2772 |
#: templates/default/extras/taxonomy-topic-tag-edit.php:17
|
| 2773 |
#: templates/default/extras/taxonomy-topic-tag.php:17
|
| 2774 |
msgid "Topic Tag: %s"
|
| 2775 |
msgstr ""
|
| 2776 |
|
| 2777 |
-
#: includes/common/template-tags.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2778 |
msgid "›"
|
| 2779 |
msgstr ""
|
| 2780 |
|
| 2781 |
-
#: includes/common/template-tags.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2782 |
msgid "Log Out"
|
| 2783 |
msgstr ""
|
| 2784 |
|
| 2785 |
-
#: includes/common/template-tags.php:
|
| 2786 |
msgid "Forum: %s"
|
| 2787 |
msgstr ""
|
| 2788 |
|
| 2789 |
-
#: includes/common/template-tags.php:
|
| 2790 |
msgid "Topic: %s"
|
| 2791 |
msgstr ""
|
| 2792 |
|
| 2793 |
-
#: includes/common/template-tags.php:
|
| 2794 |
msgid "Your Profile"
|
| 2795 |
msgstr ""
|
| 2796 |
|
| 2797 |
-
#: includes/common/template-tags.php:
|
| 2798 |
#: templates/default/bbpress/user-details.php:29
|
| 2799 |
msgid "%s's Profile"
|
| 2800 |
msgstr ""
|
| 2801 |
|
| 2802 |
-
#: includes/common/template-tags.php:
|
| 2803 |
msgid "Edit Your Profile"
|
| 2804 |
msgstr ""
|
| 2805 |
|
| 2806 |
-
#: includes/common/template-tags.php:
|
| 2807 |
msgid "Edit %s's Profile"
|
| 2808 |
msgstr ""
|
| 2809 |
|
| 2810 |
-
#: includes/common/template-tags.php:
|
| 2811 |
msgid "View: %s"
|
| 2812 |
msgstr ""
|
| 2813 |
|
|
@@ -2820,207 +2852,220 @@ msgstr ""
|
|
| 2820 |
msgid "(bbPress) Login Widget"
|
| 2821 |
msgstr ""
|
| 2822 |
|
| 2823 |
-
#: includes/common/widgets.php:
|
| 2824 |
#: templates/default/bbpress/form-user-login.php:14
|
| 2825 |
#: templates/default/bbpress/form-user-login.php:35
|
| 2826 |
msgid "Log In"
|
| 2827 |
msgstr ""
|
| 2828 |
|
| 2829 |
-
#: includes/common/widgets.php:
|
| 2830 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 2831 |
#: templates/default/bbpress/form-user-login.php:17
|
| 2832 |
#: templates/default/bbpress/form-user-register.php:23
|
| 2833 |
msgid "Username"
|
| 2834 |
msgstr ""
|
| 2835 |
|
| 2836 |
-
#: includes/common/widgets.php:
|
| 2837 |
#: templates/default/bbpress/form-user-login.php:22
|
| 2838 |
msgid "Password"
|
| 2839 |
msgstr ""
|
| 2840 |
|
| 2841 |
-
#: includes/common/widgets.php:
|
| 2842 |
msgid "Remember Me"
|
| 2843 |
msgstr ""
|
| 2844 |
|
| 2845 |
-
#: includes/common/widgets.php:
|
| 2846 |
#: templates/default/bbpress/form-user-register.php:36
|
| 2847 |
msgid "Register"
|
| 2848 |
msgstr ""
|
| 2849 |
|
| 2850 |
-
#: includes/common/widgets.php:
|
| 2851 |
#: templates/default/bbpress/form-user-lost-pass.php:14
|
| 2852 |
msgid "Lost Password"
|
| 2853 |
msgstr ""
|
| 2854 |
|
| 2855 |
-
#: includes/common/widgets.php:
|
| 2856 |
-
#: includes/common/widgets.php:
|
| 2857 |
-
#: includes/common/widgets.php:
|
|
|
|
| 2858 |
msgid "Title:"
|
| 2859 |
msgstr ""
|
| 2860 |
|
| 2861 |
-
#: includes/common/widgets.php:
|
| 2862 |
msgid "Register URI:"
|
| 2863 |
msgstr ""
|
| 2864 |
|
| 2865 |
-
#: includes/common/widgets.php:
|
| 2866 |
msgid "Lost Password URI:"
|
| 2867 |
msgstr ""
|
| 2868 |
|
| 2869 |
-
#: includes/common/widgets.php:
|
| 2870 |
msgid "A list of registered optional topic views."
|
| 2871 |
msgstr ""
|
| 2872 |
|
| 2873 |
-
#: includes/common/widgets.php:
|
| 2874 |
msgid "(bbPress) Topic Views List"
|
| 2875 |
msgstr ""
|
| 2876 |
|
| 2877 |
-
#: includes/common/widgets.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2878 |
msgid "A list of forums with an option to set the parent."
|
| 2879 |
msgstr ""
|
| 2880 |
|
| 2881 |
-
#: includes/common/widgets.php:
|
| 2882 |
msgid "(bbPress) Forums List"
|
| 2883 |
msgstr ""
|
| 2884 |
|
| 2885 |
-
#: includes/common/widgets.php:
|
| 2886 |
msgid "Parent Forum ID:"
|
| 2887 |
msgstr ""
|
| 2888 |
|
| 2889 |
-
#: includes/common/widgets.php:
|
| 2890 |
msgid "\"0\" to show only root - \"any\" to show all"
|
| 2891 |
msgstr ""
|
| 2892 |
|
| 2893 |
-
#: includes/common/widgets.php:
|
| 2894 |
msgid "A list of recent topics, sorted by popularity or freshness."
|
| 2895 |
msgstr ""
|
| 2896 |
|
| 2897 |
-
#: includes/common/widgets.php:
|
| 2898 |
msgid "(bbPress) Recent Topics"
|
| 2899 |
msgstr ""
|
| 2900 |
|
| 2901 |
-
#: includes/common/widgets.php:
|
| 2902 |
msgctxt "widgets"
|
| 2903 |
msgid "by %1$s"
|
| 2904 |
msgstr ""
|
| 2905 |
|
| 2906 |
-
#: includes/common/widgets.php:
|
| 2907 |
msgid "Maximum topics to show:"
|
| 2908 |
msgstr ""
|
| 2909 |
|
| 2910 |
-
#: includes/common/widgets.php:
|
| 2911 |
msgid "Show post date:"
|
| 2912 |
msgstr ""
|
| 2913 |
|
| 2914 |
-
#: includes/common/widgets.php:
|
| 2915 |
msgid "Show topic author:"
|
| 2916 |
msgstr ""
|
| 2917 |
|
| 2918 |
-
#: includes/common/widgets.php:
|
| 2919 |
msgid "Order By:"
|
| 2920 |
msgstr ""
|
| 2921 |
|
| 2922 |
-
#: includes/common/widgets.php:
|
| 2923 |
msgid "Newest Topics"
|
| 2924 |
msgstr ""
|
| 2925 |
|
| 2926 |
-
#: includes/common/widgets.php:
|
| 2927 |
-
#: templates/default/extras/page-forum-statistics.php:
|
| 2928 |
msgid "Popular Topics"
|
| 2929 |
msgstr ""
|
| 2930 |
|
| 2931 |
-
#: includes/common/widgets.php:
|
| 2932 |
msgid "Topics With Recent Replies"
|
| 2933 |
msgstr ""
|
| 2934 |
|
| 2935 |
-
#: includes/common/widgets.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2936 |
msgid "A list of the most recent replies."
|
| 2937 |
msgstr ""
|
| 2938 |
|
| 2939 |
-
#: includes/common/widgets.php:
|
| 2940 |
msgid "(bbPress) Recent Replies"
|
| 2941 |
msgstr ""
|
| 2942 |
|
| 2943 |
#. translators: 1: reply author, 2: reply link, 3: reply timestamp
|
| 2944 |
-
#: includes/common/widgets.php:
|
| 2945 |
msgctxt "widgets"
|
| 2946 |
msgid "%1$s on %2$s %3$s"
|
| 2947 |
msgstr ""
|
| 2948 |
|
| 2949 |
#. translators: 1: reply link, 2: reply timestamp
|
| 2950 |
-
#: includes/common/widgets.php:
|
| 2951 |
msgctxt "widgets"
|
| 2952 |
msgid "%1$s %2$s"
|
| 2953 |
msgstr ""
|
| 2954 |
|
| 2955 |
#. translators: 1: reply author, 2: reply link
|
| 2956 |
-
#: includes/common/widgets.php:
|
| 2957 |
msgctxt "widgets"
|
| 2958 |
msgid "%1$s on %2$s"
|
| 2959 |
msgstr ""
|
| 2960 |
|
| 2961 |
#. translators: 1: reply link
|
| 2962 |
-
#: includes/common/widgets.php:
|
| 2963 |
msgctxt "widgets"
|
| 2964 |
msgid "%1$s"
|
| 2965 |
msgstr ""
|
| 2966 |
|
| 2967 |
-
#: includes/common/widgets.php:
|
| 2968 |
msgid "Maximum replies to show:"
|
| 2969 |
msgstr ""
|
| 2970 |
|
| 2971 |
-
#: includes/common/widgets.php:
|
| 2972 |
msgid "Show reply author:"
|
| 2973 |
msgstr ""
|
| 2974 |
|
| 2975 |
-
#: includes/core/capabilities.php:
|
| 2976 |
msgid "Keymaster"
|
| 2977 |
msgstr ""
|
| 2978 |
|
| 2979 |
-
#: includes/core/capabilities.php:
|
| 2980 |
msgid "Moderator"
|
| 2981 |
msgstr ""
|
| 2982 |
|
| 2983 |
-
#: includes/core/capabilities.php:
|
| 2984 |
msgid "Participant"
|
| 2985 |
msgstr ""
|
| 2986 |
|
| 2987 |
-
#: includes/core/capabilities.php:
|
| 2988 |
msgid "Spectator"
|
| 2989 |
msgstr ""
|
| 2990 |
|
| 2991 |
-
#: includes/core/capabilities.php:
|
| 2992 |
-
msgid "Visitor"
|
| 2993 |
-
msgstr ""
|
| 2994 |
-
|
| 2995 |
-
#: includes/core/capabilities.php:437
|
| 2996 |
msgid "Blocked"
|
| 2997 |
msgstr ""
|
| 2998 |
|
| 2999 |
-
#: includes/core/capabilities.php:
|
| 3000 |
msgid "Editable forum roles no longer exist."
|
| 3001 |
msgstr ""
|
| 3002 |
|
| 3003 |
-
#: includes/core/update.php:
|
| 3004 |
msgid "General"
|
| 3005 |
msgstr ""
|
| 3006 |
|
| 3007 |
-
#: includes/core/update.php:
|
| 3008 |
msgid "General chit-chat"
|
| 3009 |
msgstr ""
|
| 3010 |
|
| 3011 |
-
#: includes/core/update.php:
|
| 3012 |
msgid "Hello World!"
|
| 3013 |
msgstr ""
|
| 3014 |
|
| 3015 |
-
#: includes/core/update.php:
|
| 3016 |
msgid "I am the first topic in your new forums."
|
| 3017 |
msgstr ""
|
| 3018 |
|
| 3019 |
-
#: includes/core/update.php:
|
| 3020 |
msgid "Re: Hello World!"
|
| 3021 |
msgstr ""
|
| 3022 |
|
| 3023 |
-
#: includes/core/update.php:
|
| 3024 |
msgid "Oh, and this is what a reply looks like."
|
| 3025 |
msgstr ""
|
| 3026 |
|
|
@@ -3054,56 +3099,56 @@ msgid ""
|
|
| 3054 |
"retry again later."
|
| 3055 |
msgstr ""
|
| 3056 |
|
| 3057 |
-
#: includes/extend/buddypress/activity.php:
|
| 3058 |
-
msgid "New topic
|
| 3059 |
msgstr ""
|
| 3060 |
|
| 3061 |
-
#: includes/extend/buddypress/activity.php:
|
| 3062 |
-
msgid "New reply
|
| 3063 |
msgstr ""
|
| 3064 |
|
| 3065 |
-
#: includes/extend/buddypress/activity.php:
|
| 3066 |
msgid "%1$s started the topic %2$s in the forum %3$s"
|
| 3067 |
msgstr ""
|
| 3068 |
|
| 3069 |
-
#: includes/extend/buddypress/activity.php:
|
| 3070 |
msgid "%1$s replied to the topic %2$s in the forum %3$s"
|
| 3071 |
msgstr ""
|
| 3072 |
|
| 3073 |
-
#: includes/extend/buddypress/group.php:
|
| 3074 |
msgid "Enable Group Forum"
|
| 3075 |
msgstr ""
|
| 3076 |
|
| 3077 |
-
#: includes/extend/buddypress/group.php:
|
| 3078 |
-
#: includes/extend/buddypress/group.php:
|
| 3079 |
msgid ""
|
| 3080 |
"Create a discussion forum to allow members of this group to communicate in a "
|
| 3081 |
"structured, bulletin-board style fashion."
|
| 3082 |
msgstr ""
|
| 3083 |
|
| 3084 |
-
#: includes/extend/buddypress/group.php:
|
| 3085 |
-
#: includes/extend/buddypress/group.php:
|
| 3086 |
msgid "Yes. I want this group to have a forum."
|
| 3087 |
msgstr ""
|
| 3088 |
|
| 3089 |
-
#: includes/extend/buddypress/group.php:
|
| 3090 |
msgid "Saying no will not delete existing forum content."
|
| 3091 |
msgstr ""
|
| 3092 |
|
| 3093 |
-
#: includes/extend/buddypress/group.php:
|
| 3094 |
msgid "Save Settings"
|
| 3095 |
msgstr ""
|
| 3096 |
|
| 3097 |
-
#: includes/extend/buddypress/group.php:
|
| 3098 |
msgid "Group Forum"
|
| 3099 |
msgstr ""
|
| 3100 |
|
| 3101 |
-
#: includes/extend/buddypress/group.php:
|
| 3102 |
-
#: includes/extend/buddypress/group.php:
|
| 3103 |
msgid "This group does not currently have any forums."
|
| 3104 |
msgstr ""
|
| 3105 |
|
| 3106 |
-
#: includes/extend/buddypress/loader.php:
|
| 3107 |
msgid "Search Forums..."
|
| 3108 |
msgstr ""
|
| 3109 |
|
|
@@ -3127,778 +3172,823 @@ msgstr ""
|
|
| 3127 |
msgid "Subscribed Topics"
|
| 3128 |
msgstr ""
|
| 3129 |
|
| 3130 |
-
#: includes/forums/functions.php:
|
| 3131 |
-
#: includes/replies/functions.php:
|
| 3132 |
-
#: includes/
|
| 3133 |
-
#: includes/topics/functions.php:
|
| 3134 |
-
#: includes/topics/functions.php:
|
| 3135 |
-
#: includes/topics/functions.php:
|
| 3136 |
-
#: includes/users/functions.php:
|
| 3137 |
-
#: includes/users/functions.php:
|
| 3138 |
msgid "<strong>ERROR</strong>: Are you sure you wanted to do that?"
|
| 3139 |
msgstr ""
|
| 3140 |
|
| 3141 |
-
#: includes/forums/functions.php:
|
| 3142 |
msgid ""
|
| 3143 |
"<strong>ERROR</strong>: You do not have permission to create new forums."
|
| 3144 |
msgstr ""
|
| 3145 |
|
| 3146 |
-
#: includes/forums/functions.php:
|
| 3147 |
msgid "<strong>ERROR</strong>: Your forum needs a title."
|
| 3148 |
msgstr ""
|
| 3149 |
|
| 3150 |
-
#: includes/forums/functions.php:
|
| 3151 |
msgid "<strong>ERROR</strong>: Your forum description cannot be empty."
|
| 3152 |
msgstr ""
|
| 3153 |
|
| 3154 |
-
#: includes/forums/functions.php:
|
| 3155 |
msgid "<strong>ERROR</strong>: Your forum must have a parent."
|
| 3156 |
msgstr ""
|
| 3157 |
|
| 3158 |
-
#: includes/forums/functions.php:
|
| 3159 |
msgid ""
|
| 3160 |
"<strong>ERROR</strong>: This forum is a category. No forums can be created "
|
| 3161 |
"in this forum."
|
| 3162 |
msgstr ""
|
| 3163 |
|
| 3164 |
-
#: includes/forums/functions.php:
|
| 3165 |
msgid "<strong>ERROR</strong>: This forum has been closed to new forums."
|
| 3166 |
msgstr ""
|
| 3167 |
|
| 3168 |
-
#: includes/forums/functions.php:
|
| 3169 |
msgid ""
|
| 3170 |
"<strong>ERROR</strong>: This forum is private and you do not have the "
|
| 3171 |
"capability to read or create new forums in it."
|
| 3172 |
msgstr ""
|
| 3173 |
|
| 3174 |
-
#: includes/forums/functions.php:
|
| 3175 |
msgid ""
|
| 3176 |
"<strong>ERROR</strong>: This forum is hidden and you do not have the "
|
| 3177 |
"capability to read or create new forums in it."
|
| 3178 |
msgstr ""
|
| 3179 |
|
| 3180 |
-
#: includes/forums/functions.php:
|
| 3181 |
-
#: includes/topics/functions.php:
|
| 3182 |
msgid "<strong>ERROR</strong>: Slow down; you move too fast."
|
| 3183 |
msgstr ""
|
| 3184 |
|
| 3185 |
-
#: includes/forums/functions.php:
|
| 3186 |
msgid "<strong>ERROR</strong>: This forum already exists."
|
| 3187 |
msgstr ""
|
| 3188 |
|
| 3189 |
-
#: includes/forums/functions.php:
|
| 3190 |
msgid "<strong>ERROR</strong>: Your forum cannot be created at this time."
|
| 3191 |
msgstr ""
|
| 3192 |
|
| 3193 |
-
#: includes/forums/functions.php:
|
| 3194 |
msgid "<strong>ERROR</strong>: Forum ID not found."
|
| 3195 |
msgstr ""
|
| 3196 |
|
| 3197 |
-
#: includes/forums/functions.php:
|
| 3198 |
msgid "<strong>ERROR</strong>: The forum you want to edit was not found."
|
| 3199 |
msgstr ""
|
| 3200 |
|
| 3201 |
-
#: includes/forums/functions.php:
|
| 3202 |
msgid "<strong>ERROR</strong>: You do not have permission to edit that forum."
|
| 3203 |
msgstr ""
|
| 3204 |
|
| 3205 |
-
#: includes/forums/functions.php:
|
| 3206 |
msgid "<strong>ERROR</strong>: Your forum cannot be edited at this time."
|
| 3207 |
msgstr ""
|
| 3208 |
|
| 3209 |
-
#: includes/forums/template-tags.php:
|
| 3210 |
-
#: includes/forums/template-tags.php:
|
| 3211 |
msgid "%s topic"
|
| 3212 |
msgid_plural "%s topics"
|
| 3213 |
msgstr[0] ""
|
| 3214 |
msgstr[1] ""
|
| 3215 |
|
| 3216 |
-
#: includes/forums/template-tags.php:
|
| 3217 |
-
#: includes/topics/template-tags.php:
|
| 3218 |
msgid " (+ %d hidden)"
|
| 3219 |
msgstr ""
|
| 3220 |
|
| 3221 |
-
#: includes/forums/template-tags.php:
|
| 3222 |
-
#: includes/topics/template-tags.php:
|
| 3223 |
msgid "%s reply"
|
| 3224 |
msgid_plural "%s replies"
|
| 3225 |
msgstr[0] ""
|
| 3226 |
msgstr[1] ""
|
| 3227 |
|
| 3228 |
-
#: includes/forums/template-tags.php:
|
| 3229 |
msgid ""
|
| 3230 |
"This category contains %1$s and %2$s, and was last updated by %3$s %4$s."
|
| 3231 |
msgstr ""
|
| 3232 |
|
| 3233 |
-
#: includes/forums/template-tags.php:
|
| 3234 |
msgid "This forum contains %1$s and %2$s, and was last updated by %3$s %4$s."
|
| 3235 |
msgstr ""
|
| 3236 |
|
| 3237 |
-
#: includes/forums/template-tags.php:
|
| 3238 |
msgid "This category contains %1$s, and was last updated by %2$s %3$s."
|
| 3239 |
msgstr ""
|
| 3240 |
|
| 3241 |
-
#: includes/forums/template-tags.php:
|
| 3242 |
msgid "This forum contains %1$s, and was last updated by %2$s %3$s."
|
| 3243 |
msgstr ""
|
| 3244 |
|
| 3245 |
-
#: includes/forums/template-tags.php:
|
| 3246 |
msgid "This category contains %1$s and %2$s."
|
| 3247 |
msgstr ""
|
| 3248 |
|
| 3249 |
-
#: includes/forums/template-tags.php:
|
| 3250 |
msgid "This forum contains %1$s and %2$s."
|
| 3251 |
msgstr ""
|
| 3252 |
|
| 3253 |
-
#: includes/forums/template-tags.php:
|
| 3254 |
msgid "This category contains %1$s."
|
| 3255 |
msgstr ""
|
| 3256 |
|
| 3257 |
-
#: includes/forums/template-tags.php:
|
| 3258 |
msgid "This forum contains %1$s."
|
| 3259 |
msgstr ""
|
| 3260 |
|
| 3261 |
-
#: includes/forums/template-tags.php:
|
| 3262 |
msgid "This forum is empty."
|
| 3263 |
msgstr ""
|
| 3264 |
|
| 3265 |
-
#: includes/forums/template-tags.php:
|
| 3266 |
msgid "Category"
|
| 3267 |
msgstr ""
|
| 3268 |
|
| 3269 |
-
#: includes/forums/template-tags.php:
|
| 3270 |
msgctxt "Forum Status"
|
| 3271 |
msgid "Open"
|
| 3272 |
msgstr ""
|
| 3273 |
|
| 3274 |
-
#: includes/forums/template-tags.php:
|
| 3275 |
msgctxt "Forum Status"
|
| 3276 |
msgid "Closed"
|
| 3277 |
msgstr ""
|
| 3278 |
|
| 3279 |
-
#: includes/forums/template-tags.php:
|
| 3280 |
msgid "Public"
|
| 3281 |
msgstr ""
|
| 3282 |
|
| 3283 |
-
#: includes/forums/template-tags.php:
|
| 3284 |
#: templates/default/bbpress/feedback-no-access.php:13
|
| 3285 |
msgid "Private"
|
| 3286 |
msgstr ""
|
| 3287 |
|
| 3288 |
-
#: includes/forums/template-tags.php:
|
| 3289 |
msgid "Hidden"
|
| 3290 |
msgstr ""
|
| 3291 |
|
| 3292 |
-
#: includes/replies/functions.php:
|
| 3293 |
msgid "<strong>ERROR</strong>: You do not have permission to reply."
|
| 3294 |
msgstr ""
|
| 3295 |
|
| 3296 |
-
#: includes/replies/functions.php:
|
| 3297 |
msgid "<strong>ERROR</strong>: Topic ID is missing."
|
| 3298 |
msgstr ""
|
| 3299 |
|
| 3300 |
-
#: includes/replies/functions.php:
|
| 3301 |
-
#: includes/topics/functions.php:
|
| 3302 |
msgid "<strong>ERROR</strong>: Forum ID is missing."
|
| 3303 |
msgstr ""
|
| 3304 |
|
| 3305 |
-
#: includes/replies/functions.php:
|
| 3306 |
msgid "<strong>ERROR</strong>: Your reply needs a title."
|
| 3307 |
msgstr ""
|
| 3308 |
|
| 3309 |
-
#: includes/replies/functions.php:
|
| 3310 |
msgid "<strong>ERROR</strong>: Your reply cannot be empty."
|
| 3311 |
msgstr ""
|
| 3312 |
|
| 3313 |
-
#: includes/replies/functions.php:
|
| 3314 |
msgid ""
|
| 3315 |
"<strong>ERROR</strong>: Duplicate reply detected; it looks as though "
|
| 3316 |
"you’ve already said that!"
|
| 3317 |
msgstr ""
|
| 3318 |
|
| 3319 |
-
#: includes/replies/functions.php:
|
| 3320 |
msgid "<strong>ERROR</strong>: Your reply cannot be created at this time."
|
| 3321 |
msgstr ""
|
| 3322 |
|
| 3323 |
-
#: includes/replies/functions.php:
|
| 3324 |
msgid ""
|
| 3325 |
"<strong>ERROR</strong>: There was a problem adding the tags to the topic."
|
| 3326 |
msgstr ""
|
| 3327 |
|
| 3328 |
-
#: includes/replies/functions.php:
|
| 3329 |
msgid "<strong>ERROR</strong>: Reply ID not found."
|
| 3330 |
msgstr ""
|
| 3331 |
|
| 3332 |
-
#: includes/replies/functions.php:
|
| 3333 |
msgid "<strong>ERROR</strong>: The reply you want to edit was not found."
|
| 3334 |
msgstr ""
|
| 3335 |
|
| 3336 |
-
#: includes/replies/functions.php:
|
| 3337 |
msgid "<strong>ERROR</strong>: You do not have permission to edit that reply."
|
| 3338 |
msgstr ""
|
| 3339 |
|
| 3340 |
-
#: includes/replies/functions.php:
|
| 3341 |
msgid ""
|
| 3342 |
"<strong>ERROR</strong>: This forum is a category. No topics or replies can "
|
| 3343 |
"be created in it."
|
| 3344 |
msgstr ""
|
| 3345 |
|
| 3346 |
-
#: includes/replies/functions.php:
|
| 3347 |
msgid ""
|
| 3348 |
"<strong>ERROR</strong>: This forum has been closed to new topics and replies."
|
| 3349 |
msgstr ""
|
| 3350 |
|
| 3351 |
-
#: includes/replies/functions.php:
|
| 3352 |
msgid ""
|
| 3353 |
"<strong>ERROR</strong>: This forum is private and you do not have the "
|
| 3354 |
"capability to read or create new replies in it."
|
| 3355 |
msgstr ""
|
| 3356 |
|
| 3357 |
-
#: includes/replies/functions.php:
|
| 3358 |
msgid ""
|
| 3359 |
"<strong>ERROR</strong>: This forum is hidden and you do not have the "
|
| 3360 |
"capability to read or create new replies in it."
|
| 3361 |
msgstr ""
|
| 3362 |
|
| 3363 |
-
#: includes/replies/functions.php:
|
| 3364 |
msgid "<strong>ERROR</strong>: Your reply cannot be edited at this time."
|
| 3365 |
msgstr ""
|
| 3366 |
|
| 3367 |
-
#: includes/replies/functions.php:
|
| 3368 |
-
msgid "<strong>ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3369 |
msgstr ""
|
| 3370 |
|
| 3371 |
#: includes/replies/functions.php:1088
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3372 |
msgid ""
|
| 3373 |
"<strong>ERROR</strong>: There was a problem unmarking the reply as spam!"
|
| 3374 |
msgstr ""
|
| 3375 |
|
| 3376 |
-
#: includes/replies/functions.php:
|
| 3377 |
msgid "<strong>ERROR</strong>: There was a problem marking the reply as spam!"
|
| 3378 |
msgstr ""
|
| 3379 |
|
| 3380 |
-
#: includes/replies/functions.php:
|
| 3381 |
msgid "<strong>ERROR</strong>: There was a problem trashing the reply!"
|
| 3382 |
msgstr ""
|
| 3383 |
|
| 3384 |
-
#: includes/replies/functions.php:
|
| 3385 |
msgid "<strong>ERROR</strong>: There was a problem untrashing the reply!"
|
| 3386 |
msgstr ""
|
| 3387 |
|
| 3388 |
-
#: includes/replies/functions.php:
|
| 3389 |
msgid "<strong>ERROR</strong>: There was a problem deleting the reply!"
|
| 3390 |
msgstr ""
|
| 3391 |
|
| 3392 |
-
#: includes/replies/functions.php:
|
| 3393 |
msgid "All Posts"
|
| 3394 |
msgstr ""
|
| 3395 |
|
| 3396 |
-
#: includes/replies/functions.php:
|
| 3397 |
msgid "Replies: %s"
|
| 3398 |
msgstr ""
|
| 3399 |
|
| 3400 |
-
#: includes/replies/template-tags.php:
|
| 3401 |
-
#: includes/topics/template-tags.php:
|
| 3402 |
msgctxt "date at time"
|
| 3403 |
msgid "%1$s at %2$s"
|
| 3404 |
msgstr ""
|
| 3405 |
|
| 3406 |
-
#: includes/replies/template-tags.php:
|
| 3407 |
msgid "This reply was modified %1$s by %2$s. Reason: %3$s"
|
| 3408 |
msgstr ""
|
| 3409 |
|
| 3410 |
-
#: includes/replies/template-tags.php:
|
| 3411 |
msgid "This reply was modified %1$s by %2$s."
|
| 3412 |
msgstr ""
|
| 3413 |
|
| 3414 |
-
#: includes/replies/template-tags.php:
|
| 3415 |
-
#: includes/topics/template-tags.php:
|
| 3416 |
msgid "Anonymous"
|
| 3417 |
msgstr ""
|
| 3418 |
|
| 3419 |
-
#: includes/replies/template-tags.php:
|
| 3420 |
-
#: includes/topics/template-tags.php:
|
| 3421 |
-
#: includes/users/template-tags.php:
|
| 3422 |
msgid "View %s's profile"
|
| 3423 |
msgstr ""
|
| 3424 |
|
| 3425 |
-
#: includes/replies/template-tags.php:
|
| 3426 |
-
#: includes/topics/template-tags.php:
|
| 3427 |
-
#: includes/users/template-tags.php:
|
| 3428 |
msgid "Visit %s's website"
|
| 3429 |
msgstr ""
|
| 3430 |
|
| 3431 |
-
#: includes/replies/template-tags.php:
|
| 3432 |
-
#: includes/topics/template-tags.php:
|
| 3433 |
#: templates/default/bbpress/form-topic-tag.php:88
|
| 3434 |
#: templates/default/bbpress/form-topic-tag.php:101
|
| 3435 |
msgid "Delete"
|
| 3436 |
msgstr ""
|
| 3437 |
|
| 3438 |
-
#: includes/replies/template-tags.php:
|
| 3439 |
-
#: includes/topics/template-tags.php:
|
| 3440 |
msgid "Are you sure you want to delete that permanently?"
|
| 3441 |
msgstr ""
|
| 3442 |
|
| 3443 |
-
#: includes/replies/template-tags.php:
|
| 3444 |
-
#: includes/topics/template-tags.php:
|
| 3445 |
msgid "Unspam"
|
| 3446 |
msgstr ""
|
| 3447 |
|
| 3448 |
-
#: includes/replies/template-tags.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3449 |
msgid "Split"
|
| 3450 |
msgstr ""
|
| 3451 |
|
| 3452 |
-
#: includes/replies/template-tags.php:
|
| 3453 |
msgid "Split the topic from this reply"
|
| 3454 |
msgstr ""
|
| 3455 |
|
| 3456 |
-
#: includes/replies/template-tags.php:
|
| 3457 |
msgid "Viewing %1$s reply"
|
| 3458 |
msgid_plural "Viewing %1$s replies"
|
| 3459 |
msgstr[0] ""
|
| 3460 |
msgstr[1] ""
|
| 3461 |
|
| 3462 |
-
#: includes/replies/template-tags.php:
|
| 3463 |
msgid "Viewing %2$s replies (of %4$s total)"
|
| 3464 |
msgid_plural "Viewing %1$s replies - %2$s through %3$s (of %4$s total)"
|
| 3465 |
msgstr[0] ""
|
| 3466 |
msgstr[1] ""
|
| 3467 |
|
| 3468 |
-
#: includes/replies/template-tags.php:
|
| 3469 |
msgid "Viewing %1$s post"
|
| 3470 |
msgid_plural "Viewing %1$s posts"
|
| 3471 |
msgstr[0] ""
|
| 3472 |
msgstr[1] ""
|
| 3473 |
|
| 3474 |
-
#: includes/replies/template-tags.php:
|
| 3475 |
msgid "Viewing %2$s post (of %4$s total)"
|
| 3476 |
msgid_plural "Viewing %1$s posts - %2$s through %3$s (of %4$s total)"
|
| 3477 |
msgstr[0] ""
|
| 3478 |
msgstr[1] ""
|
| 3479 |
|
| 3480 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3481 |
msgid ""
|
| 3482 |
"<strong>ERROR</strong>: You do not have permission to create new topics."
|
| 3483 |
msgstr ""
|
| 3484 |
|
| 3485 |
-
#: includes/topics/functions.php:
|
| 3486 |
msgid "<strong>ERROR</strong>: Your topic needs a title."
|
| 3487 |
msgstr ""
|
| 3488 |
|
| 3489 |
-
#: includes/topics/functions.php:
|
| 3490 |
msgid "<strong>ERROR</strong>: Your topic cannot be empty."
|
| 3491 |
msgstr ""
|
| 3492 |
|
| 3493 |
-
#: includes/topics/functions.php:
|
| 3494 |
msgid ""
|
| 3495 |
"<strong>ERROR</strong>: This forum is a category. No topics can be created "
|
| 3496 |
"in this forum."
|
| 3497 |
msgstr ""
|
| 3498 |
|
| 3499 |
-
#: includes/topics/functions.php:
|
| 3500 |
msgid "<strong>ERROR</strong>: This forum has been closed to new topics."
|
| 3501 |
msgstr ""
|
| 3502 |
|
| 3503 |
-
#: includes/topics/functions.php:
|
| 3504 |
msgid ""
|
| 3505 |
"<strong>ERROR</strong>: This forum is private and you do not have the "
|
| 3506 |
"capability to read or create new topics in it."
|
| 3507 |
msgstr ""
|
| 3508 |
|
| 3509 |
-
#: includes/topics/functions.php:
|
| 3510 |
msgid ""
|
| 3511 |
"<strong>ERROR</strong>: This forum is hidden and you do not have the "
|
| 3512 |
"capability to read or create new topics in it."
|
| 3513 |
msgstr ""
|
| 3514 |
|
| 3515 |
-
#: includes/topics/functions.php:
|
| 3516 |
msgid ""
|
| 3517 |
"<strong>ERROR</strong>: Duplicate topic detected; it looks as though "
|
| 3518 |
"you’ve already said that!"
|
| 3519 |
msgstr ""
|
| 3520 |
|
| 3521 |
-
#: includes/topics/functions.php:
|
| 3522 |
msgid "<strong>ERROR</strong>: Your topic cannot be created at this time."
|
| 3523 |
msgstr ""
|
| 3524 |
|
| 3525 |
-
#: includes/topics/functions.php:
|
| 3526 |
msgid "<strong>ERROR</strong>: Topic ID not found."
|
| 3527 |
msgstr ""
|
| 3528 |
|
| 3529 |
-
#: includes/topics/functions.php:
|
| 3530 |
msgid "<strong>ERROR</strong>: The topic you want to edit was not found."
|
| 3531 |
msgstr ""
|
| 3532 |
|
| 3533 |
-
#: includes/topics/functions.php:
|
| 3534 |
msgid "<strong>ERROR</strong>: You do not have permission to edit that topic."
|
| 3535 |
msgstr ""
|
| 3536 |
|
| 3537 |
-
#: includes/topics/functions.php:
|
| 3538 |
msgid ""
|
| 3539 |
"<strong>ERROR</strong>: This forum is a category. No topics can be created "
|
| 3540 |
"in it."
|
| 3541 |
msgstr ""
|
| 3542 |
|
| 3543 |
-
#: includes/topics/functions.php:
|
| 3544 |
msgid "<strong>ERROR</strong>: Your topic cannot be edited at this time."
|
| 3545 |
msgstr ""
|
| 3546 |
|
| 3547 |
-
#: includes/topics/functions.php:
|
| 3548 |
msgid "<strong>ERROR</strong>: The topic you want to merge was not found."
|
| 3549 |
msgstr ""
|
| 3550 |
|
| 3551 |
-
#: includes/topics/functions.php:
|
| 3552 |
-
msgid ""
|
| 3553 |
-
"<strong>ERROR</strong>: You do not have the permissions to edit the source "
|
| 3554 |
-
"topic."
|
| 3555 |
-
msgstr ""
|
| 3556 |
-
|
| 3557 |
-
#: includes/topics/functions.php:1117
|
| 3558 |
msgid "<strong>ERROR</strong>: Destination topic ID not found."
|
| 3559 |
msgstr ""
|
| 3560 |
|
| 3561 |
-
#: includes/topics/functions.php:
|
| 3562 |
msgid "<strong>ERROR</strong>: The topic you want to merge to was not found."
|
| 3563 |
msgstr ""
|
| 3564 |
|
| 3565 |
-
#: includes/topics/functions.php:
|
| 3566 |
msgid ""
|
| 3567 |
"<strong>ERROR</strong>: You do not have the permissions to edit the "
|
| 3568 |
"destination topic."
|
| 3569 |
msgstr ""
|
| 3570 |
|
| 3571 |
-
#: includes/topics/functions.php:
|
| 3572 |
msgid "<strong>ERROR</strong>: Reply ID to split the topic from not found!"
|
| 3573 |
msgstr ""
|
| 3574 |
|
| 3575 |
-
#: includes/topics/functions.php:
|
| 3576 |
msgid "<strong>ERROR</strong>: The reply you want to split from was not found."
|
| 3577 |
msgstr ""
|
| 3578 |
|
| 3579 |
-
#: includes/topics/functions.php:
|
| 3580 |
msgid "<strong>ERROR</strong>: The topic you want to split was not found."
|
| 3581 |
msgstr ""
|
| 3582 |
|
| 3583 |
-
#: includes/topics/functions.php:
|
| 3584 |
msgid "<strong>ERROR</strong>: You need to choose a valid split option."
|
| 3585 |
msgstr ""
|
| 3586 |
|
| 3587 |
-
#: includes/topics/functions.php:
|
| 3588 |
-
msgid "<strong>ERROR</strong>: Destination topic ID not found!"
|
| 3589 |
-
msgstr ""
|
| 3590 |
-
|
| 3591 |
-
#: includes/topics/functions.php:1436
|
| 3592 |
msgid "<strong>ERROR</strong>: The topic you want to split to was not found!"
|
| 3593 |
msgstr ""
|
| 3594 |
|
| 3595 |
-
#: includes/topics/functions.php:
|
| 3596 |
-
msgid ""
|
| 3597 |
-
"<strong>ERROR</strong>: You do not have the permissions to edit the "
|
| 3598 |
-
"destination topic!"
|
| 3599 |
-
msgstr ""
|
| 3600 |
-
|
| 3601 |
-
#: includes/topics/functions.php:1479
|
| 3602 |
-
msgid ""
|
| 3603 |
-
"<strong>ERROR</strong>: There was a problem converting the reply into the "
|
| 3604 |
-
"topic. Please try again."
|
| 3605 |
-
msgstr ""
|
| 3606 |
-
|
| 3607 |
-
#: includes/topics/functions.php:1484
|
| 3608 |
-
msgid ""
|
| 3609 |
-
"<strong>ERROR</strong>: You do not have the permissions to create new "
|
| 3610 |
-
"topics. The reply could not be converted into a topic."
|
| 3611 |
-
msgstr ""
|
| 3612 |
-
|
| 3613 |
-
#: includes/topics/functions.php:1739
|
| 3614 |
msgid ""
|
| 3615 |
"<strong>ERROR</strong>: The following problem(s) have been found while "
|
| 3616 |
"getting the tag: %s"
|
| 3617 |
msgstr ""
|
| 3618 |
|
| 3619 |
-
#: includes/topics/functions.php:
|
| 3620 |
msgid ""
|
| 3621 |
"<strong>ERROR</strong>: You do not have the permissions to edit the topic "
|
| 3622 |
"tags."
|
| 3623 |
msgstr ""
|
| 3624 |
|
| 3625 |
-
#: includes/topics/functions.php:
|
| 3626 |
msgid "<strong>ERROR</strong>: You need to enter a tag name."
|
| 3627 |
msgstr ""
|
| 3628 |
|
| 3629 |
-
#: includes/topics/functions.php:
|
| 3630 |
msgid ""
|
| 3631 |
"<strong>ERROR</strong>: The following problem(s) have been found while "
|
| 3632 |
"updating the tag: %s"
|
| 3633 |
msgstr ""
|
| 3634 |
|
| 3635 |
-
#: includes/topics/functions.php:
|
| 3636 |
msgid ""
|
| 3637 |
"<strong>ERROR</strong>: The following problem(s) have been found while "
|
| 3638 |
"merging the tags: %s"
|
| 3639 |
msgstr ""
|
| 3640 |
|
| 3641 |
-
#: includes/topics/functions.php:
|
| 3642 |
msgid ""
|
| 3643 |
"<strong>ERROR</strong>: The tags which are being merged can not be the same."
|
| 3644 |
msgstr ""
|
| 3645 |
|
| 3646 |
-
#: includes/topics/functions.php:
|
| 3647 |
msgid ""
|
| 3648 |
"<strong>ERROR</strong>: You do not have the permissions to delete the topic "
|
| 3649 |
"tags."
|
| 3650 |
msgstr ""
|
| 3651 |
|
| 3652 |
-
#: includes/topics/functions.php:
|
| 3653 |
msgid ""
|
| 3654 |
"<strong>ERROR</strong>: The following problem(s) have been found while "
|
| 3655 |
"deleting the tag: %s"
|
| 3656 |
msgstr ""
|
| 3657 |
|
| 3658 |
-
#: includes/topics/functions.php:
|
| 3659 |
msgid "<strong>ERROR:</strong> You do not have the permission to do that."
|
| 3660 |
msgstr ""
|
| 3661 |
|
| 3662 |
-
#: includes/topics/functions.php:
|
| 3663 |
msgid "<strong>ERROR</strong>: There was a problem closing the topic."
|
| 3664 |
msgstr ""
|
| 3665 |
|
| 3666 |
-
#: includes/topics/functions.php:
|
| 3667 |
msgid "<strong>ERROR</strong>: There was a problem opening the topic."
|
| 3668 |
msgstr ""
|
| 3669 |
|
| 3670 |
-
#: includes/topics/functions.php:
|
| 3671 |
msgid "<strong>ERROR</strong>: There was a problem unsticking the topic."
|
| 3672 |
msgstr ""
|
| 3673 |
|
| 3674 |
-
#: includes/topics/functions.php:
|
| 3675 |
msgid "<strong>ERROR</strong>: There was a problem sticking the topic."
|
| 3676 |
msgstr ""
|
| 3677 |
|
| 3678 |
-
#: includes/topics/functions.php:
|
| 3679 |
msgid ""
|
| 3680 |
"<strong>ERROR</strong>: There was a problem unmarking the topic as spam."
|
| 3681 |
msgstr ""
|
| 3682 |
|
| 3683 |
-
#: includes/topics/functions.php:
|
| 3684 |
msgid "<strong>ERROR</strong>: There was a problem marking the topic as spam."
|
| 3685 |
msgstr ""
|
| 3686 |
|
| 3687 |
-
#: includes/topics/functions.php:
|
| 3688 |
msgid "<strong>ERROR</strong>: There was a problem trashing the topic."
|
| 3689 |
msgstr ""
|
| 3690 |
|
| 3691 |
-
#: includes/topics/functions.php:
|
| 3692 |
msgid "<strong>ERROR</strong>: There was a problem untrashing the topic."
|
| 3693 |
msgstr ""
|
| 3694 |
|
| 3695 |
-
#: includes/topics/functions.php:
|
| 3696 |
msgid "<strong>ERROR</strong>: There was a problem deleting the topic."
|
| 3697 |
msgstr ""
|
| 3698 |
|
| 3699 |
-
#: includes/topics/template-tags.php:
|
| 3700 |
msgid "This topic was modified %1$s by %2$s. Reason: %3$s"
|
| 3701 |
msgstr ""
|
| 3702 |
|
| 3703 |
-
#: includes/topics/template-tags.php:
|
| 3704 |
msgid "This topic was modified %1$s by %2$s."
|
| 3705 |
msgstr ""
|
| 3706 |
|
| 3707 |
-
#: includes/topics/template-tags.php:
|
| 3708 |
msgid "Tagged:"
|
| 3709 |
msgstr ""
|
| 3710 |
|
| 3711 |
-
#: includes/topics/template-tags.php:
|
| 3712 |
msgctxt "Topic Status"
|
| 3713 |
msgid "Close"
|
| 3714 |
msgstr ""
|
| 3715 |
|
| 3716 |
-
#: includes/topics/template-tags.php:
|
| 3717 |
msgctxt "Topic Status"
|
| 3718 |
msgid "Open"
|
| 3719 |
msgstr ""
|
| 3720 |
|
| 3721 |
-
#: includes/topics/template-tags.php:
|
| 3722 |
#: templates/default/bbpress/form-topic-tag.php:59
|
| 3723 |
#: templates/default/bbpress/form-topic-tag.php:73
|
| 3724 |
msgid "Merge"
|
| 3725 |
msgstr ""
|
| 3726 |
|
| 3727 |
-
#: includes/topics/template-tags.php:
|
| 3728 |
msgid "Viewing %1$s topic"
|
| 3729 |
msgid_plural "Viewing %1$s topics"
|
| 3730 |
msgstr[0] ""
|
| 3731 |
msgstr[1] ""
|
| 3732 |
|
| 3733 |
-
#: includes/topics/template-tags.php:
|
| 3734 |
msgid "Viewing topic %2$s (of %4$s total)"
|
| 3735 |
msgid_plural "Viewing %1$s topics - %2$s through %3$s (of %4$s total)"
|
| 3736 |
msgstr[0] ""
|
| 3737 |
msgstr[1] ""
|
| 3738 |
|
| 3739 |
-
#: includes/topics/template-tags.php:
|
| 3740 |
msgid "This topic is marked as spam."
|
| 3741 |
msgstr ""
|
| 3742 |
|
| 3743 |
-
#: includes/topics/template-tags.php:
|
| 3744 |
msgid "This topic is in the trash."
|
| 3745 |
msgstr ""
|
| 3746 |
|
| 3747 |
-
#: includes/topics/template-tags.php:
|
| 3748 |
msgid "Normal"
|
| 3749 |
msgstr ""
|
| 3750 |
|
| 3751 |
-
#: includes/topics/template-tags.php:
|
| 3752 |
msgid "Sticky"
|
| 3753 |
msgstr ""
|
| 3754 |
|
| 3755 |
-
#: includes/topics/template-tags.php:
|
| 3756 |
msgid "Super Sticky"
|
| 3757 |
msgstr ""
|
| 3758 |
|
| 3759 |
-
#: includes/topics/template-tags.php:
|
| 3760 |
msgid "%s voice"
|
| 3761 |
msgid_plural "%s voices"
|
| 3762 |
msgstr[0] ""
|
| 3763 |
msgstr[1] ""
|
| 3764 |
|
| 3765 |
-
#: includes/topics/template-tags.php:
|
| 3766 |
msgid "This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s."
|
| 3767 |
msgstr ""
|
| 3768 |
|
| 3769 |
-
#: includes/topics/template-tags.php:
|
| 3770 |
msgid "This topic contains %1$s and has %2$s."
|
| 3771 |
msgstr ""
|
| 3772 |
|
| 3773 |
-
#: includes/topics/template-tags.php:
|
| 3774 |
msgid "This topic has no replies."
|
| 3775 |
msgstr ""
|
| 3776 |
|
| 3777 |
-
#: includes/users/functions.php:
|
| 3778 |
msgid ""
|
| 3779 |
"<strong>ERROR</strong>: No topic was found! Which topic are you marking/"
|
| 3780 |
"unmarking as favorite?"
|
| 3781 |
msgstr ""
|
| 3782 |
|
| 3783 |
-
#: includes/users/functions.php:
|
| 3784 |
msgid ""
|
| 3785 |
"<strong>ERROR</strong>: You don't have the permission to edit favorites of "
|
| 3786 |
"that user!"
|
| 3787 |
msgstr ""
|
| 3788 |
|
| 3789 |
-
#: includes/users/functions.php:
|
| 3790 |
msgid ""
|
| 3791 |
"<strong>ERROR</strong>: There was a problem removing that topic from "
|
| 3792 |
"favorites!"
|
| 3793 |
msgstr ""
|
| 3794 |
|
| 3795 |
-
#: includes/users/functions.php:
|
| 3796 |
msgid "<strong>ERROR</strong>: There was a problem favoriting that topic!"
|
| 3797 |
msgstr ""
|
| 3798 |
|
| 3799 |
-
#: includes/users/functions.php:
|
| 3800 |
msgid ""
|
| 3801 |
"<strong>ERROR</strong>: No topic was found! Which topic are you subscribing/"
|
| 3802 |
"unsubscribing to?"
|
| 3803 |
msgstr ""
|
| 3804 |
|
| 3805 |
-
#: includes/users/functions.php:
|
| 3806 |
msgid ""
|
| 3807 |
"<strong>ERROR</strong>: There was a problem unsubscribing from that topic!"
|
| 3808 |
msgstr ""
|
| 3809 |
|
| 3810 |
-
#: includes/users/functions.php:
|
| 3811 |
msgid "<strong>ERROR</strong>: There was a problem subscribing to that topic!"
|
| 3812 |
msgstr ""
|
| 3813 |
|
| 3814 |
-
#: includes/users/template-tags.php:
|
| 3815 |
msgid "Key Master"
|
| 3816 |
msgstr ""
|
| 3817 |
|
| 3818 |
-
#: includes/users/template-tags.php:
|
| 3819 |
msgid "Inactive"
|
| 3820 |
msgstr ""
|
| 3821 |
|
| 3822 |
-
#: includes/users/template-tags.php:
|
| 3823 |
msgid "Guest"
|
| 3824 |
msgstr ""
|
| 3825 |
|
| 3826 |
-
#: includes/users/template-tags.php:
|
| 3827 |
msgid "Member"
|
| 3828 |
msgstr ""
|
| 3829 |
|
| 3830 |
-
#: includes/users/template-tags.php:
|
| 3831 |
msgid "Admin"
|
| 3832 |
msgstr ""
|
| 3833 |
|
| 3834 |
-
#: includes/users/template-tags.php:
|
| 3835 |
-
|
| 3836 |
-
msgid "Add this topic to your favorites"
|
| 3837 |
msgstr ""
|
| 3838 |
|
| 3839 |
-
#: includes/users/template-tags.php:
|
| 3840 |
-
msgid "
|
| 3841 |
msgstr ""
|
| 3842 |
|
| 3843 |
-
#: includes/users/template-tags.php:
|
| 3844 |
-
msgid "This topic is one of your %favorites% ["
|
| 3845 |
-
msgstr ""
|
| 3846 |
-
|
| 3847 |
-
#: includes/users/template-tags.php:682
|
| 3848 |
-
#: templates/default/bbpress-functions.php:255
|
| 3849 |
-
msgid "×"
|
| 3850 |
-
msgstr ""
|
| 3851 |
-
|
| 3852 |
-
#: includes/users/template-tags.php:683
|
| 3853 |
-
msgid "]"
|
| 3854 |
-
msgstr ""
|
| 3855 |
-
|
| 3856 |
-
#: includes/users/template-tags.php:825
|
| 3857 |
-
#: templates/default/bbpress-functions.php:265
|
| 3858 |
msgid "Subscribe"
|
| 3859 |
msgstr ""
|
| 3860 |
|
| 3861 |
-
#: includes/users/template-tags.php:
|
| 3862 |
-
#: templates/default/bbpress-functions.php:266
|
| 3863 |
msgid "Unsubscribe"
|
| 3864 |
msgstr ""
|
| 3865 |
|
| 3866 |
-
#: includes/users/template-tags.php:
|
| 3867 |
msgid "User updated."
|
| 3868 |
msgstr ""
|
| 3869 |
|
| 3870 |
-
#: includes/users/template-tags.php:
|
| 3871 |
msgid "You have super admin privileges."
|
| 3872 |
msgstr ""
|
| 3873 |
|
| 3874 |
-
#: includes/users/template-tags.php:
|
| 3875 |
msgid "This user has super admin privileges."
|
| 3876 |
msgstr ""
|
| 3877 |
|
| 3878 |
-
#: includes/users/template-tags.php:
|
| 3879 |
msgid "— No role for this site —"
|
| 3880 |
msgstr ""
|
| 3881 |
|
| 3882 |
-
#: includes/users/template-tags.php:
|
| 3883 |
msgid "You are now logged out."
|
| 3884 |
msgstr ""
|
| 3885 |
|
| 3886 |
-
#: includes/users/template-tags.php:
|
| 3887 |
msgid "New user registration is currently not allowed."
|
| 3888 |
msgstr ""
|
| 3889 |
|
| 3890 |
-
#: includes/users/template-tags.php:
|
| 3891 |
msgid "Check your e-mail for the confirmation link."
|
| 3892 |
msgstr ""
|
| 3893 |
|
| 3894 |
-
#: includes/users/template-tags.php:
|
| 3895 |
msgid "Check your e-mail for your new password."
|
| 3896 |
msgstr ""
|
| 3897 |
|
| 3898 |
-
#: includes/users/template-tags.php:
|
| 3899 |
msgid "Registration complete. Please check your e-mail."
|
| 3900 |
msgstr ""
|
| 3901 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3902 |
#: templates/default/bbpress/feedback-logged-in.php:13
|
| 3903 |
msgid "You are already logged in."
|
| 3904 |
msgstr ""
|
|
@@ -3915,6 +4005,10 @@ msgstr ""
|
|
| 3915 |
msgid "Oh bother! No replies were found here!"
|
| 3916 |
msgstr ""
|
| 3917 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3918 |
#: templates/default/bbpress/feedback-no-topics.php:13
|
| 3919 |
msgid "Oh bother! No topics were found here!"
|
| 3920 |
msgstr ""
|
|
@@ -3977,7 +4071,8 @@ msgid "(No Parent)"
|
|
| 3977 |
msgstr ""
|
| 3978 |
|
| 3979 |
#: templates/default/bbpress/form-forum.php:149
|
| 3980 |
-
#: templates/default/bbpress/form-reply.php:
|
|
|
|
| 3981 |
#: templates/default/bbpress/form-topic-merge.php:94
|
| 3982 |
#: templates/default/bbpress/form-topic-split.php:98
|
| 3983 |
#: templates/default/bbpress/form-topic.php:198
|
|
@@ -4000,6 +4095,59 @@ msgstr ""
|
|
| 4000 |
msgid "Protected"
|
| 4001 |
msgstr ""
|
| 4002 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4003 |
#: templates/default/bbpress/form-reply.php:36
|
| 4004 |
msgid ""
|
| 4005 |
"This topic is marked as closed to new replies, however your posting "
|
|
@@ -4040,23 +4188,27 @@ msgstr ""
|
|
| 4040 |
msgid "Optional reason for editing:"
|
| 4041 |
msgstr ""
|
| 4042 |
|
| 4043 |
-
#: templates/default/bbpress/form-reply.php:
|
| 4044 |
msgid "The topic ‘%s’ is closed to new replies."
|
| 4045 |
msgstr ""
|
| 4046 |
|
| 4047 |
-
#: templates/default/bbpress/form-reply.php:
|
| 4048 |
#: templates/default/bbpress/form-topic.php:221
|
| 4049 |
msgid "The forum ‘%s’ is closed to new topics and replies."
|
| 4050 |
msgstr ""
|
| 4051 |
|
| 4052 |
-
#: templates/default/bbpress/form-reply.php:
|
| 4053 |
msgid "You cannot reply to this topic."
|
| 4054 |
msgstr ""
|
| 4055 |
|
| 4056 |
-
#: templates/default/bbpress/form-reply.php:
|
| 4057 |
msgid "You must be logged in to reply to this topic."
|
| 4058 |
msgstr ""
|
| 4059 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4060 |
#: templates/default/bbpress/form-topic-merge.php:24
|
| 4061 |
msgid "Merge topic \"%s\""
|
| 4062 |
msgstr ""
|
|
@@ -4114,11 +4266,6 @@ msgstr ""
|
|
| 4114 |
msgid "Merge topic tags"
|
| 4115 |
msgstr ""
|
| 4116 |
|
| 4117 |
-
#: templates/default/bbpress/form-topic-merge.php:90
|
| 4118 |
-
#: templates/default/bbpress/form-topic-split.php:94
|
| 4119 |
-
msgid "<strong>WARNING:</strong> This process cannot be undone."
|
| 4120 |
-
msgstr ""
|
| 4121 |
-
|
| 4122 |
#: templates/default/bbpress/form-topic-merge.php:107
|
| 4123 |
#: templates/default/bbpress/form-topic-split.php:111
|
| 4124 |
msgid "You do not have the permissions to edit this topic!"
|
|
@@ -4151,22 +4298,10 @@ msgstr ""
|
|
| 4151 |
msgid "Split Method"
|
| 4152 |
msgstr ""
|
| 4153 |
|
| 4154 |
-
#: templates/default/bbpress/form-topic-split.php:41
|
| 4155 |
-
msgid "New topic in <strong>%s</strong> titled:"
|
| 4156 |
-
msgstr ""
|
| 4157 |
-
|
| 4158 |
#: templates/default/bbpress/form-topic-split.php:42
|
| 4159 |
msgid "Split: %s"
|
| 4160 |
msgstr ""
|
| 4161 |
|
| 4162 |
-
#: templates/default/bbpress/form-topic-split.php:49
|
| 4163 |
-
msgid "Use an existing topic in this forum:"
|
| 4164 |
-
msgstr ""
|
| 4165 |
-
|
| 4166 |
-
#: templates/default/bbpress/form-topic-split.php:58
|
| 4167 |
-
msgid "No other topics found!"
|
| 4168 |
-
msgstr ""
|
| 4169 |
-
|
| 4170 |
#: templates/default/bbpress/form-topic-split.php:76
|
| 4171 |
msgid "Copy subscribers to the new topic"
|
| 4172 |
msgstr ""
|
|
@@ -4301,65 +4436,55 @@ msgstr ""
|
|
| 4301 |
msgid "Biographical Info"
|
| 4302 |
msgstr ""
|
| 4303 |
|
| 4304 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4305 |
-
|
| 4306 |
-
"Share a little biographical information to fill out your profile. This may "
|
| 4307 |
-
"be shown publicly."
|
| 4308 |
-
msgstr ""
|
| 4309 |
-
|
| 4310 |
-
#: templates/default/bbpress/form-user-edit.php:91
|
| 4311 |
-
#: templates/default/bbpress/form-user-edit.php:94
|
| 4312 |
msgid "Account"
|
| 4313 |
msgstr ""
|
| 4314 |
|
| 4315 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4316 |
-
msgid "Usernames cannot be changed."
|
| 4317 |
-
msgstr ""
|
| 4318 |
-
|
| 4319 |
-
#: templates/default/bbpress/form-user-edit.php:117
|
| 4320 |
msgid ""
|
| 4321 |
"There is a pending email address change to <code>%1$s</code>. <a href=\"%2$s"
|
| 4322 |
"\">Cancel</a>"
|
| 4323 |
msgstr ""
|
| 4324 |
|
| 4325 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4326 |
msgid "New Password"
|
| 4327 |
msgstr ""
|
| 4328 |
|
| 4329 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4330 |
msgid ""
|
| 4331 |
"If you would like to change the password type a new one. Otherwise leave "
|
| 4332 |
"this blank."
|
| 4333 |
msgstr ""
|
| 4334 |
|
| 4335 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4336 |
msgid "Type your new password again."
|
| 4337 |
msgstr ""
|
| 4338 |
|
| 4339 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4340 |
msgid ""
|
| 4341 |
"Your password should be at least ten characters long. Use upper and lower "
|
| 4342 |
"case letters, numbers, and symbols to make it even stronger."
|
| 4343 |
msgstr ""
|
| 4344 |
|
| 4345 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4346 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4347 |
msgid "User Role"
|
| 4348 |
msgstr ""
|
| 4349 |
|
| 4350 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4351 |
msgid "Network Role"
|
| 4352 |
msgstr ""
|
| 4353 |
|
| 4354 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4355 |
msgid "Grant this user super admin privileges for the Network."
|
| 4356 |
msgstr ""
|
| 4357 |
|
| 4358 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4359 |
msgid "Update Profile"
|
| 4360 |
msgstr ""
|
| 4361 |
|
| 4362 |
-
#: templates/default/bbpress/form-user-edit.php:
|
| 4363 |
msgid "Update User"
|
| 4364 |
msgstr ""
|
| 4365 |
|
|
@@ -4393,15 +4518,44 @@ msgstr ""
|
|
| 4393 |
msgid "Blog Role"
|
| 4394 |
msgstr ""
|
| 4395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4396 |
#: templates/default/bbpress/loop-single-reply.php:21
|
| 4397 |
msgid "in reply to: "
|
| 4398 |
msgstr ""
|
| 4399 |
|
| 4400 |
-
#: templates/default/bbpress/loop-single-topic.php:
|
| 4401 |
msgid "Started by: %1$s"
|
| 4402 |
msgstr ""
|
| 4403 |
|
| 4404 |
-
#: templates/default/bbpress/loop-single-topic.php:
|
| 4405 |
msgid "in: <a href=\"%1$s\">%2$s</a>"
|
| 4406 |
msgstr ""
|
| 4407 |
|
|
@@ -4490,40 +4644,48 @@ msgstr ""
|
|
| 4490 |
msgid "This user has not created any topics."
|
| 4491 |
msgstr ""
|
| 4492 |
|
| 4493 |
-
#: templates/default/bbpress-functions.php:
|
| 4494 |
-
msgid "
|
| 4495 |
msgstr ""
|
| 4496 |
|
| 4497 |
-
#: templates/default/bbpress-functions.php:
|
| 4498 |
-
msgid "
|
| 4499 |
msgstr ""
|
| 4500 |
|
| 4501 |
-
#: templates/default/bbpress-functions.php:
|
| 4502 |
-
msgid "
|
| 4503 |
msgstr ""
|
| 4504 |
|
| 4505 |
-
#: templates/default/bbpress-functions.php:
|
| 4506 |
-
|
|
|
|
| 4507 |
msgstr ""
|
| 4508 |
|
| 4509 |
-
#: templates/default/
|
| 4510 |
-
|
|
|
|
| 4511 |
msgstr ""
|
| 4512 |
|
| 4513 |
-
#: templates/default/
|
| 4514 |
-
|
|
|
|
| 4515 |
msgstr ""
|
| 4516 |
|
| 4517 |
-
#: templates/default/
|
| 4518 |
-
|
|
|
|
| 4519 |
msgstr ""
|
| 4520 |
|
| 4521 |
-
#: templates/default/
|
| 4522 |
-
msgid "
|
| 4523 |
msgstr ""
|
| 4524 |
|
| 4525 |
-
#: templates/default/
|
| 4526 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4527 |
msgstr ""
|
| 4528 |
|
| 4529 |
#: templates/default/extras/page-topic-tags.php:22
|
|
@@ -4535,9 +4697,9 @@ msgstr ""
|
|
| 4535 |
msgid "bbPress"
|
| 4536 |
msgstr ""
|
| 4537 |
|
| 4538 |
-
#. #-#-#-#-# plugin.pot (bbPress 2.
|
| 4539 |
#. Plugin URI of the plugin/theme
|
| 4540 |
-
#. #-#-#-#-# plugin.pot (bbPress 2.
|
| 4541 |
#. Author URI of the plugin/theme
|
| 4542 |
msgid "http://bbpress.org"
|
| 4543 |
msgstr ""
|
| 1 |
+
# Copyright (C) 2013 bbPress
|
| 2 |
# This file is distributed under the same license as the bbPress package.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
+
"Project-Id-Version: bbPress 2.3\n"
|
| 6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/bbpress\n"
|
| 7 |
+
"POT-Creation-Date: 2013-01-28 18:51:15+00:00\n"
|
| 8 |
"MIME-Version: 1.0\n"
|
| 9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
| 10 |
"Content-Transfer-Encoding: 8bit\n"
|
| 11 |
+
"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
|
| 12 |
"Last-Translator: JOHN JAMES JACOBY <jjj@bbpress.org>\n"
|
| 13 |
"Language-Team: ENGLISH <jjj@bbpress.org>\n"
|
| 14 |
|
| 15 |
+
#: bbpress.php:131 bbpress.php:138
|
| 16 |
msgid "Cheatin’ huh?"
|
| 17 |
msgstr ""
|
| 18 |
|
| 19 |
+
#: bbpress.php:404 templates/default/bbpress-functions.php:68
|
| 20 |
msgid "bbPress Default"
|
| 21 |
msgstr ""
|
| 22 |
|
| 23 |
+
#: bbpress.php:487 bbpress.php:488 includes/admin/admin.php:211
|
| 24 |
+
#: includes/admin/admin.php:212 includes/admin/admin.php:222
|
| 25 |
+
#: includes/admin/admin.php:223 includes/admin/users.php:82
|
| 26 |
+
#: includes/extend/buddypress/group.php:638
|
| 27 |
#: includes/extend/buddypress/loader.php:42
|
| 28 |
#: includes/extend/buddypress/loader.php:170
|
| 29 |
#: includes/extend/buddypress/loader.php:259
|
| 30 |
#: includes/extend/buddypress/loader.php:310
|
| 31 |
+
#: templates/default/bbpress/content-statistics.php:22
|
| 32 |
msgid "Forums"
|
| 33 |
msgstr ""
|
| 34 |
|
| 35 |
+
#: bbpress.php:489 includes/admin/forums.php:420
|
| 36 |
#: includes/admin/metaboxes.php:50 includes/admin/metaboxes.php:358
|
| 37 |
#: includes/admin/metaboxes.php:411 includes/admin/replies.php:621
|
| 38 |
+
#: includes/admin/topics.php:686 includes/extend/buddypress/group.php:48
|
| 39 |
+
#: includes/extend/buddypress/group.php:49
|
| 40 |
+
#: includes/forums/template-tags.php:2145
|
| 41 |
#: templates/default/bbpress/loop-forums.php:19
|
| 42 |
msgid "Forum"
|
| 43 |
msgstr ""
|
| 44 |
|
| 45 |
+
#: bbpress.php:490 includes/admin/tools.php:1103
|
| 46 |
msgid "All Forums"
|
| 47 |
msgstr ""
|
| 48 |
|
| 49 |
+
#: bbpress.php:491 bbpress.php:495
|
| 50 |
msgid "New Forum"
|
| 51 |
msgstr ""
|
| 52 |
|
| 53 |
+
#: bbpress.php:492 templates/default/bbpress/form-forum.php:37
|
| 54 |
msgid "Create New Forum"
|
| 55 |
msgstr ""
|
| 56 |
|
| 57 |
+
#: bbpress.php:493 bbpress.php:550 bbpress.php:607
|
| 58 |
+
#: includes/common/template-tags.php:2148
|
| 59 |
+
#: includes/replies/template-tags.php:1570
|
| 60 |
+
#: includes/topics/template-tags.php:2307
|
| 61 |
#: templates/default/bbpress/user-details.php:65
|
| 62 |
msgid "Edit"
|
| 63 |
msgstr ""
|
| 64 |
|
| 65 |
+
#: bbpress.php:494
|
| 66 |
msgid "Edit Forum"
|
| 67 |
msgstr ""
|
| 68 |
|
| 69 |
+
#: bbpress.php:496 bbpress.php:497
|
| 70 |
msgid "View Forum"
|
| 71 |
msgstr ""
|
| 72 |
|
| 73 |
+
#: bbpress.php:498
|
| 74 |
msgid "Search Forums"
|
| 75 |
msgstr ""
|
| 76 |
|
| 77 |
+
#: bbpress.php:499
|
| 78 |
msgid "No forums found"
|
| 79 |
msgstr ""
|
| 80 |
|
| 81 |
+
#: bbpress.php:500
|
| 82 |
msgid "No forums found in Trash"
|
| 83 |
msgstr ""
|
| 84 |
|
| 85 |
+
#: bbpress.php:501 templates/default/bbpress/form-forum.php:129
|
| 86 |
msgid "Parent Forum:"
|
| 87 |
msgstr ""
|
| 88 |
|
| 89 |
+
#: bbpress.php:524
|
| 90 |
msgid "bbPress Forums"
|
| 91 |
msgstr ""
|
| 92 |
|
| 93 |
+
#: bbpress.php:544 bbpress.php:545 includes/admin/forums.php:421
|
| 94 |
#: includes/admin/settings.php:187 includes/admin/settings.php:208
|
| 95 |
+
#: includes/admin/topics.php:685 includes/extend/buddypress/activity.php:400
|
| 96 |
+
#: includes/extend/buddypress/group.php:642
|
| 97 |
+
#: includes/forums/template-tags.php:2293
|
| 98 |
+
#: templates/default/bbpress/content-statistics.php:27
|
| 99 |
#: templates/default/bbpress/loop-forums.php:20
|
|
|
|
| 100 |
msgid "Topics"
|
| 101 |
msgstr ""
|
| 102 |
|
| 103 |
+
#: bbpress.php:546 includes/admin/metaboxes.php:67
|
| 104 |
#: includes/admin/metaboxes.php:437 includes/admin/replies.php:622
|
| 105 |
#: templates/default/bbpress/content-single-topic-lead.php:22
|
| 106 |
#: templates/default/bbpress/content-single-topic-lead.php:94
|
| 108 |
msgid "Topic"
|
| 109 |
msgstr ""
|
| 110 |
|
| 111 |
+
#: bbpress.php:547 includes/admin/tools.php:1104
|
| 112 |
+
#: includes/topics/functions.php:3302
|
| 113 |
msgid "All Topics"
|
| 114 |
msgstr ""
|
| 115 |
|
| 116 |
+
#: bbpress.php:548 bbpress.php:552
|
| 117 |
msgid "New Topic"
|
| 118 |
msgstr ""
|
| 119 |
|
| 120 |
+
#: bbpress.php:549 templates/default/bbpress/form-topic.php:43
|
| 121 |
msgid "Create New Topic"
|
| 122 |
msgstr ""
|
| 123 |
|
| 124 |
+
#: bbpress.php:551
|
| 125 |
msgid "Edit Topic"
|
| 126 |
msgstr ""
|
| 127 |
|
| 128 |
+
#: bbpress.php:553 bbpress.php:554
|
| 129 |
msgid "View Topic"
|
| 130 |
msgstr ""
|
| 131 |
|
| 132 |
+
#: bbpress.php:555
|
| 133 |
msgid "Search Topics"
|
| 134 |
msgstr ""
|
| 135 |
|
| 136 |
+
#: bbpress.php:556
|
| 137 |
msgid "No topics found"
|
| 138 |
msgstr ""
|
| 139 |
|
| 140 |
+
#: bbpress.php:557
|
| 141 |
msgid "No topics found in Trash"
|
| 142 |
msgstr ""
|
| 143 |
|
| 144 |
+
#: bbpress.php:558 includes/admin/metaboxes.php:357
|
| 145 |
+
#: includes/admin/metaboxes.php:410 includes/extend/buddypress/group.php:948
|
| 146 |
#: templates/default/bbpress/form-topic.php:125
|
| 147 |
msgid "Forum:"
|
| 148 |
msgstr ""
|
| 149 |
|
| 150 |
+
#: bbpress.php:581
|
| 151 |
msgid "bbPress Topics"
|
| 152 |
msgstr ""
|
| 153 |
|
| 154 |
+
#: bbpress.php:601 bbpress.php:602 includes/admin/forums.php:422
|
| 155 |
#: includes/admin/settings.php:195 includes/admin/settings.php:216
|
| 156 |
+
#: includes/admin/topics.php:687 includes/core/theme-compat.php:560
|
| 157 |
+
#: includes/extend/buddypress/activity.php:401
|
| 158 |
+
#: includes/forums/template-tags.php:2357
|
| 159 |
+
#: templates/default/bbpress/content-statistics.php:32
|
| 160 |
#: templates/default/bbpress/loop-forums.php:21
|
| 161 |
#: templates/default/bbpress/loop-replies.php:32
|
| 162 |
#: templates/default/bbpress/loop-replies.php:62
|
| 163 |
#: templates/default/bbpress/loop-topics.php:21
|
|
|
|
| 164 |
msgid "Replies"
|
| 165 |
msgstr ""
|
| 166 |
|
| 167 |
+
#: bbpress.php:603 includes/admin/metaboxes.php:84
|
| 168 |
msgid "Reply"
|
| 169 |
msgstr ""
|
| 170 |
|
| 171 |
+
#: bbpress.php:604 includes/admin/tools.php:1105
|
| 172 |
+
#: includes/replies/functions.php:1810
|
| 173 |
msgid "All Replies"
|
| 174 |
msgstr ""
|
| 175 |
|
| 176 |
+
#: bbpress.php:605 bbpress.php:609
|
| 177 |
msgid "New Reply"
|
| 178 |
msgstr ""
|
| 179 |
|
| 180 |
+
#: bbpress.php:606
|
| 181 |
msgid "Create New Reply"
|
| 182 |
msgstr ""
|
| 183 |
|
| 184 |
+
#: bbpress.php:608
|
| 185 |
msgid "Edit Reply"
|
| 186 |
msgstr ""
|
| 187 |
|
| 188 |
+
#: bbpress.php:610 bbpress.php:611
|
| 189 |
msgid "View Reply"
|
| 190 |
msgstr ""
|
| 191 |
|
| 192 |
+
#: bbpress.php:612
|
| 193 |
msgid "Search Replies"
|
| 194 |
msgstr ""
|
| 195 |
|
| 196 |
+
#: bbpress.php:613
|
| 197 |
msgid "No replies found"
|
| 198 |
msgstr ""
|
| 199 |
|
| 200 |
+
#: bbpress.php:614
|
| 201 |
msgid "No replies found in Trash"
|
| 202 |
msgstr ""
|
| 203 |
|
| 204 |
+
#: bbpress.php:615 includes/admin/metaboxes.php:436
|
| 205 |
msgid "Topic:"
|
| 206 |
msgstr ""
|
| 207 |
|
| 208 |
+
#: bbpress.php:638
|
| 209 |
msgid "bbPress Replies"
|
| 210 |
msgstr ""
|
| 211 |
|
| 212 |
+
#: bbpress.php:673
|
| 213 |
msgctxt "post"
|
| 214 |
msgid "Closed"
|
| 215 |
msgstr ""
|
| 216 |
|
| 217 |
+
#: bbpress.php:674
|
| 218 |
msgctxt "bbpress"
|
| 219 |
msgid "Closed <span class=\"count\">(%s)</span>"
|
| 220 |
msgid_plural "Closed <span class=\"count\">(%s)</span>"
|
| 221 |
msgstr[0] ""
|
| 222 |
msgstr[1] ""
|
| 223 |
|
| 224 |
+
#: bbpress.php:684
|
| 225 |
msgctxt "post"
|
| 226 |
msgid "Spam"
|
| 227 |
msgstr ""
|
| 228 |
|
| 229 |
+
#: bbpress.php:685
|
| 230 |
msgctxt "bbpress"
|
| 231 |
msgid "Spam <span class=\"count\">(%s)</span>"
|
| 232 |
msgid_plural "Spam <span class=\"count\">(%s)</span>"
|
| 233 |
msgstr[0] ""
|
| 234 |
msgstr[1] ""
|
| 235 |
|
| 236 |
+
#: bbpress.php:697
|
| 237 |
msgctxt "post"
|
| 238 |
msgid "Orphan"
|
| 239 |
msgstr ""
|
| 240 |
|
| 241 |
+
#: bbpress.php:698
|
| 242 |
msgctxt "bbpress"
|
| 243 |
msgid "Orphan <span class=\"count\">(%s)</span>"
|
| 244 |
msgid_plural "Orphans <span class=\"count\">(%s)</span>"
|
| 245 |
msgstr[0] ""
|
| 246 |
msgstr[1] ""
|
| 247 |
|
| 248 |
+
#: bbpress.php:710
|
| 249 |
msgctxt "post"
|
| 250 |
msgid "Hidden"
|
| 251 |
msgstr ""
|
| 252 |
|
| 253 |
+
#: bbpress.php:711
|
| 254 |
msgctxt "bbpress"
|
| 255 |
msgid "Hidden <span class=\"count\">(%s)</span>"
|
| 256 |
msgid_plural "Hidden <span class=\"count\">(%s)</span>"
|
| 257 |
msgstr[0] ""
|
| 258 |
msgstr[1] ""
|
| 259 |
|
| 260 |
+
#: bbpress.php:756 templates/default/bbpress/content-statistics.php:37
|
| 261 |
msgid "Topic Tags"
|
| 262 |
msgstr ""
|
| 263 |
|
| 264 |
+
#: bbpress.php:757 includes/admin/metaboxes.php:103
|
| 265 |
msgid "Topic Tag"
|
| 266 |
msgstr ""
|
| 267 |
|
| 268 |
+
#: bbpress.php:758
|
| 269 |
msgid "Search Tags"
|
| 270 |
msgstr ""
|
| 271 |
|
| 272 |
+
#: bbpress.php:759
|
| 273 |
msgid "Popular Tags"
|
| 274 |
msgstr ""
|
| 275 |
|
| 276 |
+
#: bbpress.php:760
|
| 277 |
msgid "All Tags"
|
| 278 |
msgstr ""
|
| 279 |
|
| 280 |
+
#: bbpress.php:761
|
| 281 |
msgid "Edit Tag"
|
| 282 |
msgstr ""
|
| 283 |
|
| 284 |
+
#: bbpress.php:762
|
| 285 |
msgid "Update Tag"
|
| 286 |
msgstr ""
|
| 287 |
|
| 288 |
+
#: bbpress.php:763
|
| 289 |
msgid "Add New Tag"
|
| 290 |
msgstr ""
|
| 291 |
|
| 292 |
+
#: bbpress.php:764
|
| 293 |
msgid "New Tag Name"
|
| 294 |
msgstr ""
|
| 295 |
|
| 296 |
+
#: bbpress.php:765
|
| 297 |
msgid "View Topic Tag"
|
| 298 |
msgstr ""
|
| 299 |
|
| 300 |
+
#: bbpress.php:803
|
| 301 |
msgid "Topics with no replies"
|
| 302 |
msgstr ""
|
| 303 |
|
| 304 |
+
#: includes/admin/admin.php:176 includes/admin/functions.php:224
|
| 305 |
#: includes/admin/tools.php:34
|
| 306 |
msgid "Repair Forums"
|
| 307 |
msgstr ""
|
| 308 |
|
| 309 |
+
#: includes/admin/admin.php:177
|
| 310 |
msgid "Forum Repair"
|
| 311 |
msgstr ""
|
| 312 |
|
| 313 |
+
#: includes/admin/admin.php:186 includes/admin/functions.php:228
|
| 314 |
+
#: includes/admin/settings.php:1269
|
| 315 |
msgid "Import Forums"
|
| 316 |
msgstr ""
|
| 317 |
|
| 318 |
+
#: includes/admin/admin.php:187
|
| 319 |
msgid "Forum Import"
|
| 320 |
msgstr ""
|
| 321 |
|
| 322 |
+
#: includes/admin/admin.php:196 includes/admin/functions.php:232
|
| 323 |
+
#: includes/admin/tools.php:1094
|
| 324 |
msgid "Reset Forums"
|
| 325 |
msgstr ""
|
| 326 |
|
| 327 |
+
#: includes/admin/admin.php:197
|
| 328 |
msgid "Forum Reset"
|
| 329 |
msgstr ""
|
| 330 |
|
| 331 |
+
#: includes/admin/admin.php:235 includes/admin/admin.php:236
|
| 332 |
+
#: includes/admin/admin.php:244 includes/admin/admin.php:245
|
| 333 |
msgid "Welcome to bbPress"
|
| 334 |
msgstr ""
|
| 335 |
|
| 336 |
+
#: includes/admin/admin.php:258 includes/admin/admin.php:259
|
| 337 |
+
#: includes/admin/admin.php:280 includes/admin/admin.php:281
|
| 338 |
+
#: includes/admin/admin.php:1607 includes/admin/admin.php:1696
|
| 339 |
msgid "Update Forums"
|
| 340 |
msgstr ""
|
| 341 |
|
| 342 |
+
#: includes/admin/admin.php:471
|
| 343 |
msgid "Settings"
|
| 344 |
msgstr ""
|
| 345 |
|
| 346 |
+
#: includes/admin/admin.php:472
|
| 347 |
msgid "About"
|
| 348 |
msgstr ""
|
| 349 |
|
| 350 |
+
#: includes/admin/admin.php:484
|
| 351 |
msgid "Right Now in Forums"
|
| 352 |
msgstr ""
|
| 353 |
|
| 354 |
+
#: includes/admin/admin.php:1248
|
| 355 |
msgctxt "admin color scheme"
|
| 356 |
msgid "Green"
|
| 357 |
msgstr ""
|
| 358 |
|
| 359 |
+
#: includes/admin/admin.php:1302
|
| 360 |
msgid "%s - %s"
|
| 361 |
msgstr ""
|
| 362 |
|
| 363 |
+
#: includes/admin/admin.php:1320 includes/admin/admin.php:1426
|
| 364 |
msgid "Welcome to bbPress %s"
|
| 365 |
msgstr ""
|
| 366 |
|
| 367 |
+
#: includes/admin/admin.php:1321 includes/admin/admin.php:1427
|
| 368 |
msgid ""
|
| 369 |
"Thank you for updating to the latest version! bbPress %s is ready to make "
|
| 370 |
"your community a safer, faster, and better looking place to hang out!"
|
| 371 |
msgstr ""
|
| 372 |
|
| 373 |
+
#: includes/admin/admin.php:1322 includes/admin/admin.php:1428
|
| 374 |
msgid "Version %s"
|
| 375 |
msgstr ""
|
| 376 |
|
| 377 |
+
#: includes/admin/admin.php:1326 includes/admin/admin.php:1432
|
| 378 |
msgid "What’s New"
|
| 379 |
msgstr ""
|
| 380 |
|
| 381 |
+
#: includes/admin/admin.php:1328 includes/admin/admin.php:1434
|
| 382 |
msgid "Credits"
|
| 383 |
msgstr ""
|
| 384 |
|
| 385 |
+
#: includes/admin/admin.php:1333
|
| 386 |
msgid "In-depth User Profiles"
|
| 387 |
msgstr ""
|
| 388 |
|
| 389 |
+
#: includes/admin/admin.php:1336
|
| 390 |
msgid "User Details"
|
| 391 |
msgstr ""
|
| 392 |
|
| 393 |
+
#: includes/admin/admin.php:1337
|
| 394 |
msgid ""
|
| 395 |
"Forum profiles include the details of your forum activity, including your "
|
| 396 |
"topics and replies, subscriptions, and favorites."
|
| 397 |
msgstr ""
|
| 398 |
|
| 399 |
+
#: includes/admin/admin.php:1339
|
| 400 |
msgid "Easy Updating"
|
| 401 |
msgstr ""
|
| 402 |
|
| 403 |
+
#: includes/admin/admin.php:1340
|
| 404 |
msgid "You can easily update your profile without leaving bbPress."
|
| 405 |
msgstr ""
|
| 406 |
|
| 407 |
+
#: includes/admin/admin.php:1345
|
| 408 |
+
msgid "Theme Compatibility"
|
| 409 |
msgstr ""
|
| 410 |
|
| 411 |
+
#: includes/admin/admin.php:1348
|
| 412 |
msgid "Twenty Twelve"
|
| 413 |
msgstr ""
|
| 414 |
|
| 415 |
+
#: includes/admin/admin.php:1349
|
| 416 |
msgid ""
|
| 417 |
"Updated default templates are now Twenty Twelve compatible, and we refreshed "
|
| 418 |
"our CSS to better integrate with other popular themes, too."
|
| 419 |
msgstr ""
|
| 420 |
|
| 421 |
+
#: includes/admin/admin.php:1354
|
| 422 |
msgid "Improved User Management"
|
| 423 |
msgstr ""
|
| 424 |
|
| 425 |
+
#: includes/admin/admin.php:1357
|
| 426 |
msgid "Dynamic User Roles and Capabilities"
|
| 427 |
msgstr ""
|
| 428 |
|
| 429 |
+
#: includes/admin/admin.php:1358
|
| 430 |
msgid ""
|
| 431 |
"bbPress now includes some fancy user-roles with smart default capabilities "
|
| 432 |
"to help you manage your forums. New roles include Key Master (for complete "
|
| 433 |
"administrative access), Moderator, and Participant for regular forum users."
|
| 434 |
msgstr ""
|
| 435 |
|
| 436 |
+
#: includes/admin/admin.php:1360
|
| 437 |
msgid "Manage Forum Users from WordPress"
|
| 438 |
msgstr ""
|
| 439 |
|
| 440 |
+
#: includes/admin/admin.php:1361
|
| 441 |
msgid ""
|
| 442 |
"You can assign Forums roles to users individually, or bulk update them from "
|
| 443 |
"the WordPress Users page. Users automatically start out as forum "
|
| 444 |
"participants."
|
| 445 |
msgstr ""
|
| 446 |
|
| 447 |
+
#: includes/admin/admin.php:1366
|
| 448 |
msgid "Better BuddyPress Integration"
|
| 449 |
msgstr ""
|
| 450 |
|
| 451 |
+
#: includes/admin/admin.php:1369
|
| 452 |
msgid "Use bbPress for Your BuddyPress Group Forums"
|
| 453 |
msgstr ""
|
| 454 |
|
| 455 |
+
#: includes/admin/admin.php:1370
|
| 456 |
msgid ""
|
| 457 |
"You can now use bbPress to manage your BuddyPress Group Forums, allowing for "
|
| 458 |
"seamless integration and improved plugin performance. Plugins developed for "
|
| 460 |
"experience."
|
| 461 |
msgstr ""
|
| 462 |
|
| 463 |
+
#: includes/admin/admin.php:1372
|
| 464 |
msgid "Activity Stream Syncing"
|
| 465 |
msgstr ""
|
| 466 |
|
| 467 |
+
#: includes/admin/admin.php:1373
|
| 468 |
msgid ""
|
| 469 |
"bbPress now keeps track of changes to topics and replies and keeps their "
|
| 470 |
"corresponding BuddyPress Activity Stream updates synced."
|
| 471 |
msgstr ""
|
| 472 |
|
| 473 |
+
#: includes/admin/admin.php:1378
|
| 474 |
msgid "Under the Hood"
|
| 475 |
msgstr ""
|
| 476 |
|
| 477 |
+
#: includes/admin/admin.php:1382
|
| 478 |
msgid "Template Logic"
|
| 479 |
msgstr ""
|
| 480 |
|
| 481 |
+
#: includes/admin/admin.php:1383
|
| 482 |
msgid ""
|
| 483 |
"New functions and template stacks are in place to help plugin developers "
|
| 484 |
"extend bbPress further."
|
| 485 |
msgstr ""
|
| 486 |
|
| 487 |
+
#: includes/admin/admin.php:1385
|
| 488 |
msgid "Plugin Directory Structure"
|
| 489 |
msgstr ""
|
| 490 |
|
| 491 |
+
#: includes/admin/admin.php:1386
|
| 492 |
msgid ""
|
| 493 |
"We simplified the bbPress plugin directory structure, making it easier for "
|
| 494 |
"plugin developers to find the relevant code."
|
| 495 |
msgstr ""
|
| 496 |
|
| 497 |
+
#: includes/admin/admin.php:1390
|
| 498 |
msgid "Autocomplete"
|
| 499 |
msgstr ""
|
| 500 |
|
| 501 |
+
#: includes/admin/admin.php:1391
|
| 502 |
msgid ""
|
| 503 |
"In WordPress Admin, you now select a parent forum or topic via autocomplete "
|
| 504 |
"rather than a dropdown."
|
| 505 |
msgstr ""
|
| 506 |
|
| 507 |
+
#: includes/admin/admin.php:1393
|
| 508 |
msgid "Fancy Editor Support"
|
| 509 |
msgstr ""
|
| 510 |
|
| 511 |
+
#: includes/admin/admin.php:1394
|
| 512 |
msgid ""
|
| 513 |
"We improved our support of the Fancy Editor, giving forum users a better "
|
| 514 |
"experience."
|
| 515 |
msgstr ""
|
| 516 |
|
| 517 |
+
#: includes/admin/admin.php:1398
|
| 518 |
msgid "WordPress 3.5-ready"
|
| 519 |
msgstr ""
|
| 520 |
|
| 521 |
+
#: includes/admin/admin.php:1399
|
| 522 |
msgid ""
|
| 523 |
"bbPress 2.2 has been thoroughly tested against the ongoing development of "
|
| 524 |
"WordPress 3.5."
|
| 525 |
msgstr ""
|
| 526 |
|
| 527 |
+
#: includes/admin/admin.php:1405 includes/admin/admin.php:1533
|
| 528 |
msgid "Go to Forum Settings"
|
| 529 |
msgstr ""
|
| 530 |
|
| 531 |
+
#: includes/admin/admin.php:1438
|
| 532 |
msgid "bbPress is created by a worldwide swarm of busy, busy bees."
|
| 533 |
msgstr ""
|
| 534 |
|
| 535 |
+
#: includes/admin/admin.php:1440
|
| 536 |
msgid "Project Leaders"
|
| 537 |
msgstr ""
|
| 538 |
|
| 539 |
+
#: includes/admin/admin.php:1445
|
| 540 |
msgid "Founding Developer"
|
| 541 |
msgstr ""
|
| 542 |
|
| 543 |
+
#: includes/admin/admin.php:1450
|
| 544 |
msgid "Lead Developer"
|
| 545 |
msgstr ""
|
| 546 |
|
| 547 |
+
#: includes/admin/admin.php:1454
|
| 548 |
msgid "Contributing Developers"
|
| 549 |
msgstr ""
|
| 550 |
|
| 551 |
+
#: includes/admin/admin.php:1473
|
| 552 |
msgid "Codex Rockstars"
|
| 553 |
msgstr ""
|
| 554 |
|
| 555 |
+
#: includes/admin/admin.php:1492
|
| 556 |
msgid "Core Contributors to bbPress 2.2"
|
| 557 |
msgstr ""
|
| 558 |
|
| 559 |
+
#: includes/admin/admin.php:1559 includes/admin/admin.php:1581
|
| 560 |
msgid "Update Forum"
|
| 561 |
msgstr ""
|
| 562 |
|
| 563 |
+
#: includes/admin/admin.php:1570 includes/admin/admin.php:1624
|
| 564 |
msgid "All done!"
|
| 565 |
msgstr ""
|
| 566 |
|
| 567 |
+
#: includes/admin/admin.php:1571 includes/admin/admin.php:1625
|
| 568 |
msgid "Go Back"
|
| 569 |
msgstr ""
|
| 570 |
|
| 571 |
+
#: includes/admin/admin.php:1580
|
| 572 |
msgid ""
|
| 573 |
"You can update your forum through this page. Hit the link below to update."
|
| 574 |
msgstr ""
|
| 575 |
|
| 576 |
+
#: includes/admin/admin.php:1652
|
| 577 |
msgid ""
|
| 578 |
"Warning! Problem updating %1$s. Your server may not be able to connect to "
|
| 579 |
"sites running on it. Error message: <em>%2$s</em>"
|
| 580 |
msgstr ""
|
| 581 |
|
| 582 |
+
#: includes/admin/admin.php:1676
|
| 583 |
msgid ""
|
| 584 |
"If your browser doesn’t start loading the next page automatically, "
|
| 585 |
"click this link:"
|
| 586 |
msgstr ""
|
| 587 |
|
| 588 |
+
#: includes/admin/admin.php:1677
|
| 589 |
msgid "Next Forums"
|
| 590 |
msgstr ""
|
| 591 |
|
| 592 |
+
#: includes/admin/admin.php:1695
|
| 593 |
msgid ""
|
| 594 |
"You can update all the forums on your network through this page. It works by "
|
| 595 |
"calling the update script of each site automatically. Hit the link below to "
|
| 724 |
msgid "Converting replies (%1$s - %2$s)"
|
| 725 |
msgstr ""
|
| 726 |
|
| 727 |
+
#: includes/admin/converters/Invision.php:502
|
| 728 |
+
#: includes/admin/converters/SimplePress5.php:495
|
| 729 |
+
#: includes/admin/converters/Vanilla.php:514
|
| 730 |
+
#: includes/admin/converters/bbPress1.php:539
|
| 731 |
+
#: includes/admin/converters/vBulletin.php:536
|
| 732 |
msgid "Re: "
|
| 733 |
msgstr ""
|
| 734 |
|
| 735 |
#: includes/admin/forums.php:120 includes/admin/replies.php:132
|
| 736 |
+
#: includes/admin/settings.php:1309 includes/admin/topics.php:132
|
| 737 |
msgid "Overview"
|
| 738 |
msgstr ""
|
| 739 |
|
| 827 |
|
| 828 |
#: includes/admin/forums.php:162 includes/admin/forums.php:233
|
| 829 |
#: includes/admin/replies.php:177 includes/admin/replies.php:245
|
| 830 |
+
#: includes/admin/settings.php:1355 includes/admin/topics.php:178
|
| 831 |
#: includes/admin/topics.php:246
|
| 832 |
msgid "For more information:"
|
| 833 |
msgstr ""
|
| 834 |
|
| 835 |
#: includes/admin/forums.php:163 includes/admin/forums.php:234
|
| 836 |
#: includes/admin/replies.php:178 includes/admin/replies.php:246
|
| 837 |
+
#: includes/admin/settings.php:1356 includes/admin/topics.php:179
|
| 838 |
#: includes/admin/topics.php:247
|
| 839 |
msgid ""
|
| 840 |
"<a href=\"http://codex.bbpress.org\" target=\"_blank\">bbPress "
|
| 843 |
|
| 844 |
#: includes/admin/forums.php:164 includes/admin/forums.php:235
|
| 845 |
#: includes/admin/replies.php:179 includes/admin/replies.php:247
|
| 846 |
+
#: includes/admin/settings.php:1357 includes/admin/topics.php:180
|
| 847 |
#: includes/admin/topics.php:248
|
| 848 |
msgid ""
|
| 849 |
"<a href=\"http://bbpress.org/forums/\" target=\"_blank\">bbPress Support "
|
| 1002 |
msgid "%1$s <br /> %2$s"
|
| 1003 |
msgstr ""
|
| 1004 |
|
| 1005 |
+
#: includes/admin/forums.php:474 includes/forums/template-tags.php:541
|
| 1006 |
msgid "No Topics"
|
| 1007 |
msgstr ""
|
| 1008 |
|
| 1149 |
msgstr ""
|
| 1150 |
|
| 1151 |
#: includes/admin/metaboxes.php:474
|
| 1152 |
+
#: templates/default/bbpress/form-user-edit.php:103
|
| 1153 |
#: templates/default/bbpress/form-user-register.php:28
|
| 1154 |
msgid "Email"
|
| 1155 |
msgstr ""
|
| 1376 |
#: includes/admin/replies.php:623 includes/admin/topics.php:689
|
| 1377 |
#: templates/default/bbpress/loop-replies.php:18
|
| 1378 |
#: templates/default/bbpress/loop-replies.php:52
|
| 1379 |
+
#: templates/default/bbpress/loop-search.php:18
|
| 1380 |
+
#: templates/default/bbpress/loop-search.php:40
|
| 1381 |
msgid "Author"
|
| 1382 |
msgstr ""
|
| 1383 |
|
| 1415 |
msgstr ""
|
| 1416 |
|
| 1417 |
#: includes/admin/replies.php:790 includes/admin/topics.php:863
|
| 1418 |
+
#: includes/replies/template-tags.php:1765
|
| 1419 |
+
#: includes/topics/template-tags.php:2688
|
| 1420 |
msgid "Spam"
|
| 1421 |
msgstr ""
|
| 1422 |
|
| 1423 |
#: includes/admin/replies.php:799 includes/admin/topics.php:871
|
| 1424 |
+
#: includes/replies/template-tags.php:1707
|
| 1425 |
+
#: includes/topics/template-tags.php:2444
|
| 1426 |
msgid "Restore this item from the Trash"
|
| 1427 |
msgstr ""
|
| 1428 |
|
| 1429 |
#: includes/admin/replies.php:799 includes/admin/topics.php:871
|
| 1430 |
+
#: includes/replies/template-tags.php:1695
|
| 1431 |
+
#: includes/topics/template-tags.php:2432
|
| 1432 |
msgid "Restore"
|
| 1433 |
msgstr ""
|
| 1434 |
|
| 1435 |
#: includes/admin/replies.php:801 includes/admin/topics.php:873
|
| 1436 |
+
#: includes/replies/template-tags.php:1709
|
| 1437 |
+
#: includes/topics/template-tags.php:2446
|
| 1438 |
msgid "Move this item to the Trash"
|
| 1439 |
msgstr ""
|
| 1440 |
|
| 1441 |
#: includes/admin/replies.php:801 includes/admin/topics.php:873
|
| 1442 |
+
#: includes/replies/template-tags.php:1694
|
| 1443 |
+
#: includes/topics/template-tags.php:2431
|
| 1444 |
msgid "Trash"
|
| 1445 |
msgstr ""
|
| 1446 |
|
| 1447 |
#: includes/admin/replies.php:805 includes/admin/topics.php:877
|
| 1448 |
+
#: includes/replies/template-tags.php:1713
|
| 1449 |
+
#: includes/topics/template-tags.php:2450
|
| 1450 |
msgid "Delete this item permanently"
|
| 1451 |
msgstr ""
|
| 1452 |
|
| 1497 |
msgid "Reply draft updated. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
|
| 1498 |
msgstr ""
|
| 1499 |
|
| 1500 |
+
#: includes/admin/settings.php:24 includes/admin/settings.php:1317
|
| 1501 |
msgid "Main Settings"
|
| 1502 |
msgstr ""
|
| 1503 |
|
| 1505 |
msgid "Theme Packages"
|
| 1506 |
msgstr ""
|
| 1507 |
|
| 1508 |
+
#: includes/admin/settings.php:34 includes/admin/settings.php:1337
|
| 1509 |
msgid "Per Page"
|
| 1510 |
msgstr ""
|
| 1511 |
|
| 1537 |
msgid "Throttle posting every"
|
| 1538 |
msgstr ""
|
| 1539 |
|
| 1540 |
+
#: includes/admin/settings.php:97 includes/admin/settings.php:1450
|
| 1541 |
msgid "Revisions"
|
| 1542 |
msgstr ""
|
| 1543 |
|
| 1579 |
msgid "Current Package"
|
| 1580 |
msgstr ""
|
| 1581 |
|
| 1582 |
+
#: includes/admin/settings.php:229 includes/admin/settings.php:1463
|
| 1583 |
msgid "Forums base"
|
| 1584 |
msgstr ""
|
| 1585 |
|
| 1586 |
+
#: includes/admin/settings.php:237 includes/admin/settings.php:1466
|
| 1587 |
msgid "Topics base"
|
| 1588 |
msgstr ""
|
| 1589 |
|
| 1591 |
msgid "Forum Prefix"
|
| 1592 |
msgstr ""
|
| 1593 |
|
| 1594 |
+
#: includes/admin/settings.php:258 includes/admin/settings.php:1469
|
| 1595 |
msgid "Forum slug"
|
| 1596 |
msgstr ""
|
| 1597 |
|
| 1598 |
+
#: includes/admin/settings.php:266 includes/admin/settings.php:1472
|
| 1599 |
msgid "Topic slug"
|
| 1600 |
msgstr ""
|
| 1601 |
|
| 1602 |
+
#: includes/admin/settings.php:274 includes/admin/settings.php:1484
|
| 1603 |
msgid "Topic tag slug"
|
| 1604 |
msgstr ""
|
| 1605 |
|
| 1606 |
+
#: includes/admin/settings.php:282 includes/admin/settings.php:1475
|
| 1607 |
msgid "Reply slug"
|
| 1608 |
msgstr ""
|
| 1609 |
|
| 1615 |
msgid "Topic view slug"
|
| 1616 |
msgstr ""
|
| 1617 |
|
| 1618 |
+
#: includes/admin/settings.php:306
|
| 1619 |
+
msgid "Search slug"
|
| 1620 |
msgstr ""
|
| 1621 |
|
| 1622 |
#: includes/admin/settings.php:319
|
| 1623 |
+
msgid "Enable Group Forums"
|
| 1624 |
+
msgstr ""
|
| 1625 |
+
|
| 1626 |
+
#: includes/admin/settings.php:327
|
| 1627 |
msgid "Group Forums Parent"
|
| 1628 |
msgstr ""
|
| 1629 |
|
| 1630 |
+
#: includes/admin/settings.php:340
|
| 1631 |
msgid "Use Akismet"
|
| 1632 |
msgstr ""
|
| 1633 |
|
| 1634 |
+
#: includes/admin/settings.php:378
|
| 1635 |
msgid "Main forum settings for enabling features and setting time limits"
|
| 1636 |
msgstr ""
|
| 1637 |
|
| 1638 |
+
#: includes/admin/settings.php:394 includes/common/functions.php:121
|
| 1639 |
msgid "minutes"
|
| 1640 |
msgstr ""
|
| 1641 |
|
| 1642 |
+
#: includes/admin/settings.php:410 includes/common/functions.php:122
|
| 1643 |
msgid "seconds"
|
| 1644 |
msgstr ""
|
| 1645 |
|
| 1646 |
+
#: includes/admin/settings.php:426
|
| 1647 |
msgid "Allow users to mark topics as favorites"
|
| 1648 |
msgstr ""
|
| 1649 |
|
| 1650 |
+
#: includes/admin/settings.php:442
|
| 1651 |
msgid "Allow users to subscribe to topics"
|
| 1652 |
msgstr ""
|
| 1653 |
|
| 1654 |
+
#: includes/admin/settings.php:458
|
| 1655 |
msgid "Allow topics to have tags"
|
| 1656 |
msgstr ""
|
| 1657 |
|
| 1658 |
+
#: includes/admin/settings.php:474
|
| 1659 |
msgid "Allow topic and reply revision logging"
|
| 1660 |
msgstr ""
|
| 1661 |
|
| 1662 |
+
#: includes/admin/settings.php:490
|
| 1663 |
msgid "Allow guest users without accounts to create topics and replies"
|
| 1664 |
msgstr ""
|
| 1665 |
|
| 1666 |
+
#: includes/admin/settings.php:506
|
| 1667 |
msgid ""
|
| 1668 |
"Automatically assign default role to new, registered users upon visiting the "
|
| 1669 |
"site."
|
| 1670 |
msgstr ""
|
| 1671 |
|
| 1672 |
+
#: includes/admin/settings.php:544
|
| 1673 |
msgid "Use the fancy WordPress editor to create and edit topics and replies"
|
| 1674 |
msgstr ""
|
| 1675 |
|
| 1676 |
+
#: includes/admin/settings.php:557
|
| 1677 |
msgid "How your forum content is displayed within your existing theme."
|
| 1678 |
msgstr ""
|
| 1679 |
|
| 1680 |
+
#: includes/admin/settings.php:581
|
| 1681 |
msgid "%1$s - %2$s"
|
| 1682 |
msgstr ""
|
| 1683 |
|
| 1684 |
+
#: includes/admin/settings.php:587
|
| 1685 |
msgid "will serve all bbPress templates"
|
| 1686 |
msgstr ""
|
| 1687 |
|
| 1688 |
+
#: includes/admin/settings.php:591
|
| 1689 |
msgid "No template packages available."
|
| 1690 |
msgstr ""
|
| 1691 |
|
| 1692 |
+
#: includes/admin/settings.php:607
|
| 1693 |
msgid ""
|
| 1694 |
"Embed media (YouTube, Twitter, Flickr, etc...) directly into topics and "
|
| 1695 |
"replies"
|
| 1696 |
msgstr ""
|
| 1697 |
|
| 1698 |
+
#: includes/admin/settings.php:622
|
| 1699 |
msgid "How many topics and replies to show per page"
|
| 1700 |
msgstr ""
|
| 1701 |
|
| 1702 |
+
#: includes/admin/settings.php:638 includes/admin/settings.php:654
|
| 1703 |
+
#: includes/admin/settings.php:685 includes/admin/settings.php:701
|
| 1704 |
msgid "per page"
|
| 1705 |
msgstr ""
|
| 1706 |
|
| 1707 |
+
#: includes/admin/settings.php:669
|
| 1708 |
msgid "How many topics and replies to show per RSS page"
|
| 1709 |
msgstr ""
|
| 1710 |
|
| 1711 |
+
#: includes/admin/settings.php:719
|
| 1712 |
msgid ""
|
| 1713 |
"Custom root slugs to prefix your forums and topics with. These can be "
|
| 1714 |
"partnered with WordPress pages to allow more flexibility."
|
| 1715 |
msgstr ""
|
| 1716 |
|
| 1717 |
+
#: includes/admin/settings.php:768
|
| 1718 |
msgid ""
|
| 1719 |
"Custom slugs for single forums, topics, replies, tags, users, and views "
|
| 1720 |
"here. If you change these, existing permalinks will also change."
|
| 1721 |
msgstr ""
|
| 1722 |
|
| 1723 |
+
#: includes/admin/settings.php:784
|
| 1724 |
msgid "Prefix your forum area with the Forum Base slug (Recommended)"
|
| 1725 |
msgstr ""
|
| 1726 |
|
| 1727 |
+
#: includes/admin/settings.php:921
|
| 1728 |
msgid "Forum settings for BuddyPress"
|
| 1729 |
msgstr ""
|
| 1730 |
|
| 1731 |
+
#: includes/admin/settings.php:937
|
| 1732 |
msgid "Allow BuddyPress Groups to have their own forums"
|
| 1733 |
msgstr ""
|
| 1734 |
|
| 1735 |
+
#: includes/admin/settings.php:954
|
| 1736 |
msgid "— Forum root —"
|
| 1737 |
msgstr ""
|
| 1738 |
|
| 1739 |
+
#: includes/admin/settings.php:962
|
| 1740 |
msgid "is the parent for all group forums"
|
| 1741 |
msgstr ""
|
| 1742 |
|
| 1743 |
+
#: includes/admin/settings.php:963
|
| 1744 |
msgid ""
|
| 1745 |
"Using the Forum Root is not recommended. Changing this does not move "
|
| 1746 |
"existing forums."
|
| 1747 |
msgstr ""
|
| 1748 |
|
| 1749 |
+
#: includes/admin/settings.php:978
|
| 1750 |
msgid "Forum settings for Akismet"
|
| 1751 |
msgstr ""
|
| 1752 |
|
| 1753 |
+
#: includes/admin/settings.php:995
|
| 1754 |
msgid "Allow Akismet to actively prevent forum spam."
|
| 1755 |
msgstr ""
|
| 1756 |
|
| 1757 |
+
#: includes/admin/settings.php:1018
|
| 1758 |
msgid "Forums Settings"
|
| 1759 |
msgstr ""
|
| 1760 |
|
| 1761 |
+
#: includes/admin/settings.php:1027
|
| 1762 |
+
#: templates/default/bbpress/form-user-edit.php:173
|
| 1763 |
msgid "Save Changes"
|
| 1764 |
msgstr ""
|
| 1765 |
|
| 1766 |
+
#: includes/admin/settings.php:1046
|
| 1767 |
msgid ""
|
| 1768 |
"Information about your previous forums database so that they can be "
|
| 1769 |
"converted. <strong>Backup your database before proceeding.</strong>"
|
| 1770 |
msgstr ""
|
| 1771 |
|
| 1772 |
+
#: includes/admin/settings.php:1076
|
| 1773 |
msgid "is the previous forum software"
|
| 1774 |
msgstr ""
|
| 1775 |
|
| 1776 |
+
#: includes/admin/settings.php:1090
|
| 1777 |
msgid "IP or hostname"
|
| 1778 |
msgstr ""
|
| 1779 |
|
| 1780 |
+
#: includes/admin/settings.php:1104
|
| 1781 |
msgid "Use default 3306 if unsure"
|
| 1782 |
msgstr ""
|
| 1783 |
|
| 1784 |
+
#: includes/admin/settings.php:1118
|
| 1785 |
msgid "User for your database connection"
|
| 1786 |
msgstr ""
|
| 1787 |
|
| 1788 |
+
#: includes/admin/settings.php:1132
|
| 1789 |
msgid "Password to access the database"
|
| 1790 |
msgstr ""
|
| 1791 |
|
| 1792 |
+
#: includes/admin/settings.php:1146
|
| 1793 |
msgid "Name of the database with your old forum data"
|
| 1794 |
msgstr ""
|
| 1795 |
|
| 1796 |
+
#: includes/admin/settings.php:1159
|
| 1797 |
msgid "Some optional parameters to help tune the conversion process."
|
| 1798 |
msgstr ""
|
| 1799 |
|
| 1800 |
+
#: includes/admin/settings.php:1173
|
| 1801 |
msgid ""
|
| 1802 |
"(If converting from BuddyPress Forums, use \"wp_bb_\" or your custom prefix)"
|
| 1803 |
msgstr ""
|
| 1804 |
|
| 1805 |
+
#: includes/admin/settings.php:1187
|
| 1806 |
msgid "rows to process at a time"
|
| 1807 |
msgstr ""
|
| 1808 |
|
| 1809 |
+
#: includes/admin/settings.php:1188
|
| 1810 |
msgid "Keep this low if you experience out-of-memory issues."
|
| 1811 |
msgstr ""
|
| 1812 |
|
| 1813 |
+
#: includes/admin/settings.php:1202
|
| 1814 |
msgid "second(s) delay between each group of rows"
|
| 1815 |
msgstr ""
|
| 1816 |
|
| 1817 |
+
#: includes/admin/settings.php:1203
|
| 1818 |
msgid "Keep this high to prevent too-many-connection issues."
|
| 1819 |
msgstr ""
|
| 1820 |
|
| 1821 |
+
#: includes/admin/settings.php:1217
|
| 1822 |
msgid "Start a fresh conversion from the beginning"
|
| 1823 |
msgstr ""
|
| 1824 |
|
| 1825 |
+
#: includes/admin/settings.php:1218
|
| 1826 |
msgid "You should clean old conversion information before starting over."
|
| 1827 |
msgstr ""
|
| 1828 |
|
| 1829 |
+
#: includes/admin/settings.php:1232
|
| 1830 |
msgid "Purge all information from a previously attempted import"
|
| 1831 |
msgstr ""
|
| 1832 |
|
| 1833 |
+
#: includes/admin/settings.php:1233
|
| 1834 |
msgid ""
|
| 1835 |
"Use this if an import failed and you want to remove that incomplete data."
|
| 1836 |
msgstr ""
|
| 1837 |
|
| 1838 |
+
#: includes/admin/settings.php:1247
|
| 1839 |
msgid "Attempt to import user accounts from previous forums"
|
| 1840 |
msgstr ""
|
| 1841 |
|
| 1842 |
+
#: includes/admin/settings.php:1248
|
| 1843 |
msgid ""
|
| 1844 |
"Non-bbPress passwords cannot be automatically converted. They will be "
|
| 1845 |
"converted as each user logs in."
|
| 1846 |
msgstr ""
|
| 1847 |
|
| 1848 |
+
#: includes/admin/settings.php:1278
|
| 1849 |
msgid "Start"
|
| 1850 |
msgstr ""
|
| 1851 |
|
| 1852 |
+
#: includes/admin/settings.php:1279
|
| 1853 |
msgid "Stop"
|
| 1854 |
msgstr ""
|
| 1855 |
|
| 1856 |
+
#: includes/admin/settings.php:1310
|
| 1857 |
msgid "This screen provides access to all of the Forums settings."
|
| 1858 |
msgstr ""
|
| 1859 |
|
| 1860 |
+
#: includes/admin/settings.php:1311
|
| 1861 |
msgid ""
|
| 1862 |
"Please see the additional help tabs for more information on each indiviual "
|
| 1863 |
"section."
|
| 1864 |
msgstr ""
|
| 1865 |
|
| 1866 |
+
#: includes/admin/settings.php:1318
|
| 1867 |
msgid "In the Main Settings you have a number of options:"
|
| 1868 |
msgstr ""
|
| 1869 |
|
| 1870 |
+
#: includes/admin/settings.php:1321
|
| 1871 |
msgid ""
|
| 1872 |
"You can choose to lock a post after a certain number of minutes. \"Locking "
|
| 1873 |
"post editing\" will prevent the author from editing some amount of time "
|
| 1874 |
"after saving a post."
|
| 1875 |
msgstr ""
|
| 1876 |
|
| 1877 |
+
#: includes/admin/settings.php:1322
|
| 1878 |
msgid ""
|
| 1879 |
"\"Throttle time\" is the amount of time required between posts from a single "
|
| 1880 |
"author. The higher the throttle time, the longer a user will need to wait "
|
| 1881 |
"between posting to the forum."
|
| 1882 |
msgstr ""
|
| 1883 |
|
| 1884 |
+
#: includes/admin/settings.php:1323
|
| 1885 |
msgid ""
|
| 1886 |
"Favorites are a way for users to save and later return to topics they favor. "
|
| 1887 |
"This is enabled by default."
|
| 1888 |
msgstr ""
|
| 1889 |
|
| 1890 |
+
#: includes/admin/settings.php:1324
|
| 1891 |
msgid ""
|
| 1892 |
"Subscriptions allow users to subscribe for notifications to topics that "
|
| 1893 |
"interest them. This is enabled by default."
|
| 1894 |
msgstr ""
|
| 1895 |
|
| 1896 |
+
#: includes/admin/settings.php:1325
|
| 1897 |
msgid ""
|
| 1898 |
"Topic-Tags allow users to filter topics between forums. This is enabled by "
|
| 1899 |
"default."
|
| 1900 |
msgstr ""
|
| 1901 |
|
| 1902 |
+
#: includes/admin/settings.php:1326
|
| 1903 |
msgid ""
|
| 1904 |
"\"Anonymous Posting\" allows guest users who do not have accounts on your "
|
| 1905 |
"site to both create topics as well as replies."
|
| 1906 |
msgstr ""
|
| 1907 |
|
| 1908 |
+
#: includes/admin/settings.php:1327
|
| 1909 |
msgid ""
|
| 1910 |
"The Fancy Editor brings the luxury of the Visual editor and HTML editor from "
|
| 1911 |
"the traditional WordPress dashboard into your theme."
|
| 1912 |
msgstr ""
|
| 1913 |
|
| 1914 |
+
#: includes/admin/settings.php:1328
|
| 1915 |
msgid ""
|
| 1916 |
"Auto-embed will embed the media content from a URL directly into the "
|
| 1917 |
"replies. For example: links to Flickr and YouTube."
|
| 1918 |
msgstr ""
|
| 1919 |
|
| 1920 |
+
#: includes/admin/settings.php:1331
|
| 1921 |
msgid ""
|
| 1922 |
"You must click the Save Changes button at the bottom of the screen for new "
|
| 1923 |
"settings to take effect."
|
| 1924 |
msgstr ""
|
| 1925 |
|
| 1926 |
+
#: includes/admin/settings.php:1338
|
| 1927 |
msgid ""
|
| 1928 |
"Per Page settings allow you to control the number of topics and replies "
|
| 1929 |
"appear on each page."
|
| 1930 |
msgstr ""
|
| 1931 |
|
| 1932 |
+
#: includes/admin/settings.php:1339
|
| 1933 |
msgid ""
|
| 1934 |
"This is comparable to the WordPress \"Reading Settings\" page, where you can "
|
| 1935 |
"set the number of posts that should show on blog pages and in feeds."
|
| 1936 |
msgstr ""
|
| 1937 |
|
| 1938 |
+
#: includes/admin/settings.php:1340
|
| 1939 |
msgid ""
|
| 1940 |
"These are broken up into two separate groups: one for what appears in your "
|
| 1941 |
"theme, another for RSS feeds."
|
| 1942 |
msgstr ""
|
| 1943 |
|
| 1944 |
+
#: includes/admin/settings.php:1346
|
| 1945 |
msgid "Slugs"
|
| 1946 |
msgstr ""
|
| 1947 |
|
| 1948 |
+
#: includes/admin/settings.php:1347
|
| 1949 |
msgid ""
|
| 1950 |
"The Slugs section allows you to control the permalink structure for your "
|
| 1951 |
"forums."
|
| 1952 |
msgstr ""
|
| 1953 |
|
| 1954 |
+
#: includes/admin/settings.php:1348
|
| 1955 |
msgid ""
|
| 1956 |
"\"Archive Slugs\" are used as the \"root\" for your forums and topics. If "
|
| 1957 |
"you combine these values with existing page slugs, bbPress will attempt to "
|
| 1958 |
"output the most correct title and content."
|
| 1959 |
msgstr ""
|
| 1960 |
|
| 1961 |
+
#: includes/admin/settings.php:1349
|
| 1962 |
msgid ""
|
| 1963 |
"\"Single Slugs\" are used as a prefix when viewing an individual forum, "
|
| 1964 |
"topic, reply, user, or view."
|
| 1965 |
msgstr ""
|
| 1966 |
|
| 1967 |
+
#: includes/admin/settings.php:1350
|
| 1968 |
msgid ""
|
| 1969 |
"In the event of a slug collision with WordPress or BuddyPress, a warning "
|
| 1970 |
"will appear next to the problem slug(s)."
|
| 1971 |
msgstr ""
|
| 1972 |
|
| 1973 |
+
#: includes/admin/settings.php:1448
|
| 1974 |
#: templates/default/bbpress/loop-forums.php:21
|
| 1975 |
#: templates/default/bbpress/loop-replies.php:24
|
| 1976 |
#: templates/default/bbpress/loop-replies.php:58
|
| 1978 |
msgid "Posts"
|
| 1979 |
msgstr ""
|
| 1980 |
|
| 1981 |
+
#: includes/admin/settings.php:1449
|
| 1982 |
msgid "Pages"
|
| 1983 |
msgstr ""
|
| 1984 |
|
| 1985 |
+
#: includes/admin/settings.php:1451
|
| 1986 |
msgid "Attachments"
|
| 1987 |
msgstr ""
|
| 1988 |
|
| 1989 |
+
#: includes/admin/settings.php:1452
|
| 1990 |
msgid "Menus"
|
| 1991 |
msgstr ""
|
| 1992 |
|
| 1993 |
+
#: includes/admin/settings.php:1455
|
| 1994 |
msgid "Tag base"
|
| 1995 |
msgstr ""
|
| 1996 |
|
| 1997 |
+
#: includes/admin/settings.php:1458
|
| 1998 |
msgid "Category base"
|
| 1999 |
msgstr ""
|
| 2000 |
|
| 2001 |
+
#: includes/admin/settings.php:1478
|
| 2002 |
msgid "User base"
|
| 2003 |
msgstr ""
|
| 2004 |
|
| 2005 |
+
#: includes/admin/settings.php:1481
|
| 2006 |
msgid "View base"
|
| 2007 |
msgstr ""
|
| 2008 |
|
| 2009 |
+
#: includes/admin/settings.php:1496
|
| 2010 |
msgid "%s page"
|
| 2011 |
msgstr ""
|
| 2012 |
|
| 2013 |
+
#: includes/admin/settings.php:1515
|
| 2014 |
msgid "Possible %1$s conflict: <strong>%2$s</strong>"
|
| 2015 |
msgstr ""
|
| 2016 |
|
| 2057 |
msgstr ""
|
| 2058 |
|
| 2059 |
#: includes/admin/tools.php:164
|
| 2060 |
+
msgid "Recalculate the sticky replationship of each topic"
|
| 2061 |
msgstr ""
|
| 2062 |
|
| 2063 |
#: includes/admin/tools.php:165
|
| 2064 |
+
msgid "Repair BuddyPress Group Forum relationships"
|
| 2065 |
msgstr ""
|
| 2066 |
|
| 2067 |
#: includes/admin/tools.php:166
|
| 2068 |
+
msgid "Count topics in each forum"
|
| 2069 |
msgstr ""
|
| 2070 |
|
| 2071 |
#: includes/admin/tools.php:167
|
| 2072 |
+
msgid "Count replies in each forum"
|
| 2073 |
msgstr ""
|
| 2074 |
|
| 2075 |
#: includes/admin/tools.php:168
|
| 2076 |
+
msgid "Count replies in each topic"
|
| 2077 |
msgstr ""
|
| 2078 |
|
| 2079 |
#: includes/admin/tools.php:169
|
| 2080 |
+
msgid "Count voices in each topic"
|
| 2081 |
msgstr ""
|
| 2082 |
|
| 2083 |
#: includes/admin/tools.php:170
|
| 2084 |
+
msgid "Count spammed & trashed replies in each topic"
|
| 2085 |
msgstr ""
|
| 2086 |
|
| 2087 |
#: includes/admin/tools.php:171
|
| 2088 |
+
msgid "Count topics for each user"
|
| 2089 |
msgstr ""
|
| 2090 |
|
| 2091 |
#: includes/admin/tools.php:172
|
| 2092 |
+
msgid "Count replies for each user"
|
| 2093 |
msgstr ""
|
| 2094 |
|
| 2095 |
#: includes/admin/tools.php:173
|
| 2096 |
+
msgid "Remove trashed topics from user favorites"
|
| 2097 |
msgstr ""
|
| 2098 |
|
| 2099 |
#: includes/admin/tools.php:174
|
| 2100 |
+
msgid "Remove trashed topics from user subscriptions"
|
| 2101 |
+
msgstr ""
|
| 2102 |
+
|
| 2103 |
+
#: includes/admin/tools.php:175
|
| 2104 |
msgid "Remap existing users to default forum roles"
|
| 2105 |
msgstr ""
|
| 2106 |
|
| 2107 |
+
#: includes/admin/tools.php:195
|
| 2108 |
msgid "Counting the number of replies in each topic… %s"
|
| 2109 |
msgstr ""
|
| 2110 |
|
| 2111 |
+
#: includes/admin/tools.php:196 includes/admin/tools.php:239
|
| 2112 |
+
#: includes/admin/tools.php:281 includes/admin/tools.php:326
|
| 2113 |
+
#: includes/admin/tools.php:442 includes/admin/tools.php:476
|
| 2114 |
+
#: includes/admin/tools.php:508 includes/admin/tools.php:553
|
| 2115 |
+
#: includes/admin/tools.php:598 includes/admin/tools.php:660
|
| 2116 |
+
#: includes/admin/tools.php:728 includes/admin/tools.php:776
|
| 2117 |
+
#: includes/admin/tools.php:882 includes/admin/tools.php:940
|
| 2118 |
+
#: includes/admin/tools.php:989 includes/admin/tools.php:1043
|
| 2119 |
msgid "Failed!"
|
| 2120 |
msgstr ""
|
| 2121 |
|
| 2122 |
+
#: includes/admin/tools.php:222 includes/admin/tools.php:265
|
| 2123 |
+
#: includes/admin/tools.php:291 includes/admin/tools.php:457
|
| 2124 |
+
#: includes/admin/tools.php:491 includes/admin/tools.php:536
|
| 2125 |
+
#: includes/admin/tools.php:581 includes/admin/tools.php:643
|
| 2126 |
+
#: includes/admin/tools.php:704 includes/admin/tools.php:866
|
| 2127 |
+
#: includes/admin/tools.php:923 includes/admin/tools.php:973
|
| 2128 |
+
#: includes/admin/tools.php:1027 includes/admin/tools.php:1072
|
| 2129 |
msgid "Complete!"
|
| 2130 |
msgstr ""
|
| 2131 |
|
| 2132 |
+
#: includes/admin/tools.php:238
|
| 2133 |
msgid "Counting the number of voices in each topic… %s"
|
| 2134 |
msgstr ""
|
| 2135 |
|
| 2136 |
+
#: includes/admin/tools.php:280
|
| 2137 |
msgid ""
|
| 2138 |
"Counting the number of spammed and trashed replies in each topic… %s"
|
| 2139 |
msgstr ""
|
| 2140 |
|
| 2141 |
+
#: includes/admin/tools.php:305
|
| 2142 |
msgid "Repairing BuddyPress group-forum relationships… %s"
|
| 2143 |
msgstr ""
|
| 2144 |
|
| 2145 |
+
#: includes/admin/tools.php:406
|
| 2146 |
msgid "Group Forums"
|
| 2147 |
msgstr ""
|
| 2148 |
|
| 2149 |
+
#: includes/admin/tools.php:422
|
| 2150 |
+
msgid ""
|
| 2151 |
+
"Complete! %s groups updated; %s forums updated; %s forum statuses synced."
|
| 2152 |
msgstr ""
|
| 2153 |
|
| 2154 |
+
#: includes/admin/tools.php:441
|
| 2155 |
msgid "Counting the number of topics in each forum… %s"
|
| 2156 |
msgstr ""
|
| 2157 |
|
| 2158 |
+
#: includes/admin/tools.php:475
|
| 2159 |
msgid "Counting the number of replies in each forum… %s"
|
| 2160 |
msgstr ""
|
| 2161 |
|
| 2162 |
+
#: includes/admin/tools.php:507
|
| 2163 |
msgid "Counting the number of topics each user has created… %s"
|
| 2164 |
msgstr ""
|
| 2165 |
|
| 2166 |
+
#: includes/admin/tools.php:552
|
| 2167 |
msgid "Counting the number of topics to which each user has replied… %s"
|
| 2168 |
msgstr ""
|
| 2169 |
|
| 2170 |
+
#: includes/admin/tools.php:597
|
| 2171 |
msgid "Removing trashed topics from user favorites… %s"
|
| 2172 |
msgstr ""
|
| 2173 |
|
| 2174 |
+
#: includes/admin/tools.php:627 includes/admin/tools.php:688
|
| 2175 |
msgid "Nothing to remove!"
|
| 2176 |
msgstr ""
|
| 2177 |
|
| 2178 |
+
#: includes/admin/tools.php:659
|
| 2179 |
msgid "Removing trashed topics from user subscriptions… %s"
|
| 2180 |
msgstr ""
|
| 2181 |
|
| 2182 |
+
#: includes/admin/tools.php:721
|
| 2183 |
msgid "Remapping forum role for each user on this site… %s"
|
| 2184 |
msgstr ""
|
| 2185 |
|
| 2186 |
+
#: includes/admin/tools.php:759
|
| 2187 |
msgid "Complete! %s users updated."
|
| 2188 |
msgstr ""
|
| 2189 |
|
| 2190 |
+
#: includes/admin/tools.php:775
|
| 2191 |
msgid "Recomputing latest post in every topic and forum… %s"
|
| 2192 |
msgstr ""
|
| 2193 |
|
| 2194 |
+
#: includes/admin/tools.php:881
|
| 2195 |
+
msgid "Repairing the sticky topic to the parent forum relationships… %s"
|
| 2196 |
+
msgstr ""
|
| 2197 |
+
|
| 2198 |
+
#: includes/admin/tools.php:939
|
| 2199 |
msgid "Recalculating forum visibility … %s"
|
| 2200 |
msgstr ""
|
| 2201 |
|
| 2202 |
+
#: includes/admin/tools.php:988
|
| 2203 |
msgid "Recalculating the forum for each post … %s"
|
| 2204 |
msgstr ""
|
| 2205 |
|
| 2206 |
+
#: includes/admin/tools.php:1042
|
| 2207 |
msgid "Recalculating the topic for each post … %s"
|
| 2208 |
msgstr ""
|
| 2209 |
|
| 2210 |
+
#: includes/admin/tools.php:1095
|
| 2211 |
msgid ""
|
| 2212 |
"This will revert your forums back to a brand new installation. This process "
|
| 2213 |
"cannot be undone. <strong>Backup your database before proceeding</strong>."
|
| 2214 |
msgstr ""
|
| 2215 |
|
| 2216 |
+
#: includes/admin/tools.php:1101
|
| 2217 |
msgid "The following data will be removed:"
|
| 2218 |
msgstr ""
|
| 2219 |
|
| 2220 |
+
#: includes/admin/tools.php:1106
|
| 2221 |
msgid "All Topic Tags"
|
| 2222 |
msgstr ""
|
| 2223 |
|
| 2224 |
+
#: includes/admin/tools.php:1107
|
| 2225 |
msgid "Related Meta Data"
|
| 2226 |
msgstr ""
|
| 2227 |
|
| 2228 |
+
#: includes/admin/tools.php:1108
|
| 2229 |
msgid "Forum Settings"
|
| 2230 |
msgstr ""
|
| 2231 |
|
| 2232 |
+
#: includes/admin/tools.php:1109
|
| 2233 |
msgid "Forum Activity"
|
| 2234 |
msgstr ""
|
| 2235 |
|
| 2236 |
+
#: includes/admin/tools.php:1110
|
| 2237 |
msgid "Forum User Roles"
|
| 2238 |
msgstr ""
|
| 2239 |
|
| 2240 |
+
#: includes/admin/tools.php:1111
|
| 2241 |
msgid "Importer Helper Data"
|
| 2242 |
msgstr ""
|
| 2243 |
|
| 2244 |
+
#: includes/admin/tools.php:1115
|
| 2245 |
msgid "Are you sure you want to do this?"
|
| 2246 |
msgstr ""
|
| 2247 |
|
| 2248 |
+
#: includes/admin/tools.php:1118
|
| 2249 |
msgid "Say it ain't so!"
|
| 2250 |
msgstr ""
|
| 2251 |
|
| 2252 |
+
#: includes/admin/tools.php:1119
|
| 2253 |
msgid "This process cannot be undone."
|
| 2254 |
msgstr ""
|
| 2255 |
|
| 2256 |
+
#: includes/admin/tools.php:1127
|
| 2257 |
msgid "Reset bbPress"
|
| 2258 |
msgstr ""
|
| 2259 |
|
| 2260 |
+
#: includes/admin/tools.php:1152
|
| 2261 |
msgid "Failed"
|
| 2262 |
msgstr ""
|
| 2263 |
|
| 2264 |
+
#: includes/admin/tools.php:1153
|
| 2265 |
msgid "Success!"
|
| 2266 |
msgstr ""
|
| 2267 |
|
| 2268 |
+
#: includes/admin/tools.php:1160
|
| 2269 |
msgid "Deleting Posts… %s"
|
| 2270 |
msgstr ""
|
| 2271 |
|
| 2272 |
+
#: includes/admin/tools.php:1173
|
| 2273 |
msgid "Deleting Post Meta… %s"
|
| 2274 |
msgstr ""
|
| 2275 |
|
| 2276 |
+
#: includes/admin/tools.php:1182
|
| 2277 |
+
msgid "Deleting Topic Tags… %s"
|
| 2278 |
+
msgstr ""
|
| 2279 |
+
|
| 2280 |
+
#: includes/admin/tools.php:1189
|
| 2281 |
msgid "Deleting User Meta… %s"
|
| 2282 |
msgstr ""
|
| 2283 |
|
| 2284 |
+
#: includes/admin/tools.php:1196
|
| 2285 |
msgid "Deleting Conversion Table… %s"
|
| 2286 |
msgstr ""
|
| 2287 |
|
| 2288 |
+
#: includes/admin/tools.php:1208
|
| 2289 |
msgid "Deleting Settings… %s"
|
| 2290 |
msgstr ""
|
| 2291 |
|
| 2292 |
+
#: includes/admin/tools.php:1214
|
| 2293 |
msgid "Deleting Roles and Capabilities… %s"
|
| 2294 |
msgstr ""
|
| 2295 |
|
| 2545 |
msgid "(No Forum)"
|
| 2546 |
msgstr ""
|
| 2547 |
|
| 2548 |
+
#: includes/admin/topics.php:783 includes/topics/template-tags.php:1873
|
| 2549 |
msgid "No Replies"
|
| 2550 |
msgstr ""
|
| 2551 |
|
| 2571 |
msgid "Unstick this topic"
|
| 2572 |
msgstr ""
|
| 2573 |
|
| 2574 |
+
#: includes/admin/topics.php:851 includes/topics/template-tags.php:2562
|
| 2575 |
msgid "Unstick"
|
| 2576 |
msgstr ""
|
| 2577 |
|
| 2579 |
msgid "Stick this topic to its forum"
|
| 2580 |
msgstr ""
|
| 2581 |
|
| 2582 |
+
#: includes/admin/topics.php:854 includes/topics/template-tags.php:2561
|
| 2583 |
msgid "Stick"
|
| 2584 |
msgstr ""
|
| 2585 |
|
| 2587 |
msgid "Stick this topic to front"
|
| 2588 |
msgstr ""
|
| 2589 |
|
| 2590 |
+
#: includes/admin/topics.php:854 includes/topics/template-tags.php:2563
|
| 2591 |
msgid "to front"
|
| 2592 |
msgstr ""
|
| 2593 |
|
| 2634 |
msgid "Topic draft updated. <a target=\"_blank\" href=\"%s\">Preview topic</a>"
|
| 2635 |
msgstr ""
|
| 2636 |
|
| 2637 |
+
#: includes/admin/users.php:87 includes/admin/users.php:213
|
| 2638 |
#: templates/default/bbpress/form-user-roles.php:9
|
| 2639 |
msgid "Forum Role"
|
| 2640 |
msgstr ""
|
| 2641 |
|
| 2642 |
#: includes/admin/users.php:96 includes/admin/users.php:100
|
| 2643 |
+
#: includes/users/template-tags.php:1064
|
| 2644 |
+
msgid "— No role for these forums —"
|
| 2645 |
msgstr ""
|
| 2646 |
|
| 2647 |
#: includes/admin/users.php:138 includes/admin/users.php:140
|
| 2648 |
msgid "Change forum role to…"
|
| 2649 |
msgstr ""
|
| 2650 |
|
| 2651 |
+
#: includes/admin/users.php:144
|
| 2652 |
msgid "Change"
|
| 2653 |
msgstr ""
|
| 2654 |
|
| 2655 |
+
#: includes/admin/users.php:212
|
| 2656 |
msgid "Site Role"
|
| 2657 |
msgstr ""
|
| 2658 |
|
| 2721 |
msgid ","
|
| 2722 |
msgstr ""
|
| 2723 |
|
| 2724 |
+
#: includes/common/functions.php:510 includes/common/functions.php:542
|
| 2725 |
msgid "Private: %s"
|
| 2726 |
msgstr ""
|
| 2727 |
|
| 2728 |
+
#: includes/common/functions.php:511 includes/common/functions.php:543
|
| 2729 |
msgid "Spammed: %s"
|
| 2730 |
msgstr ""
|
| 2731 |
|
| 2732 |
+
#: includes/common/functions.php:512 includes/common/functions.php:544
|
| 2733 |
msgid "Trashed: %s"
|
| 2734 |
msgstr ""
|
| 2735 |
|
| 2736 |
+
#: includes/common/functions.php:622
|
| 2737 |
msgid "<strong>ERROR</strong>: Invalid author name submitted!"
|
| 2738 |
msgstr ""
|
| 2739 |
|
| 2740 |
+
#: includes/common/functions.php:626
|
| 2741 |
msgid "<strong>ERROR</strong>: Invalid email address submitted!"
|
| 2742 |
msgstr ""
|
| 2743 |
|
| 2744 |
+
#: includes/common/functions.php:1063
|
| 2745 |
msgid ""
|
| 2746 |
"%1$s wrote:\n"
|
| 2747 |
"\n"
|
| 2748 |
"%2$s\n"
|
| 2749 |
+
"\n"
|
| 2750 |
"Post Link: %3$s\n"
|
| 2751 |
"\n"
|
| 2752 |
"-----------\n"
|
| 2756 |
"Login and visit the topic to unsubscribe from these emails."
|
| 2757 |
msgstr ""
|
| 2758 |
|
| 2759 |
+
#: includes/common/functions.php:1701
|
| 2760 |
msgid ""
|
| 2761 |
"Conditional query tags do not work before the query is run. Before then, "
|
| 2762 |
"they always return false."
|
| 2763 |
msgstr ""
|
| 2764 |
|
| 2765 |
+
#: includes/common/template-tags.php:1417
|
| 2766 |
msgid "No topics available"
|
| 2767 |
msgstr ""
|
| 2768 |
|
| 2769 |
+
#: includes/common/template-tags.php:1422
|
| 2770 |
msgid "No forums available"
|
| 2771 |
msgstr ""
|
| 2772 |
|
| 2773 |
+
#: includes/common/template-tags.php:1427
|
| 2774 |
msgid "None available"
|
| 2775 |
msgstr ""
|
| 2776 |
|
| 2777 |
+
#: includes/common/template-tags.php:1555 includes/replies/functions.php:1146
|
| 2778 |
+
#: includes/topics/functions.php:1222 includes/topics/functions.php:1577
|
|
|
|
| 2779 |
#: templates/default/bbpress/form-reply.php:29
|
| 2780 |
msgid "Reply To: %s"
|
| 2781 |
msgstr ""
|
| 2782 |
|
| 2783 |
+
#: includes/common/template-tags.php:2074
|
| 2784 |
msgid "Home"
|
| 2785 |
msgstr ""
|
| 2786 |
|
| 2787 |
+
#: includes/common/template-tags.php:2140
|
| 2788 |
msgid "(Edit)"
|
| 2789 |
msgstr ""
|
| 2790 |
|
| 2791 |
+
#: includes/common/template-tags.php:2144
|
| 2792 |
+
#: includes/common/template-tags.php:2254
|
| 2793 |
+
#: includes/common/template-tags.php:2491 includes/core/theme-compat.php:631
|
| 2794 |
#: templates/default/extras/taxonomy-topic-tag-edit.php:17
|
| 2795 |
#: templates/default/extras/taxonomy-topic-tag.php:17
|
| 2796 |
msgid "Topic Tag: %s"
|
| 2797 |
msgstr ""
|
| 2798 |
|
| 2799 |
+
#: includes/common/template-tags.php:2165
|
| 2800 |
+
msgid "‹"
|
| 2801 |
+
msgstr ""
|
| 2802 |
+
|
| 2803 |
+
#: includes/common/template-tags.php:2165
|
| 2804 |
msgid "›"
|
| 2805 |
msgstr ""
|
| 2806 |
|
| 2807 |
+
#: includes/common/template-tags.php:2258
|
| 2808 |
+
#: includes/search/template-tags.php:213
|
| 2809 |
+
#: templates/default/bbpress/form-search.php:16
|
| 2810 |
+
msgid "Search"
|
| 2811 |
+
msgstr ""
|
| 2812 |
+
|
| 2813 |
+
#: includes/common/template-tags.php:2425
|
| 2814 |
msgid "Log Out"
|
| 2815 |
msgstr ""
|
| 2816 |
|
| 2817 |
+
#: includes/common/template-tags.php:2478
|
| 2818 |
msgid "Forum: %s"
|
| 2819 |
msgstr ""
|
| 2820 |
|
| 2821 |
+
#: includes/common/template-tags.php:2482
|
| 2822 |
msgid "Topic: %s"
|
| 2823 |
msgstr ""
|
| 2824 |
|
| 2825 |
+
#: includes/common/template-tags.php:2500
|
| 2826 |
msgid "Your Profile"
|
| 2827 |
msgstr ""
|
| 2828 |
|
| 2829 |
+
#: includes/common/template-tags.php:2505
|
| 2830 |
#: templates/default/bbpress/user-details.php:29
|
| 2831 |
msgid "%s's Profile"
|
| 2832 |
msgstr ""
|
| 2833 |
|
| 2834 |
+
#: includes/common/template-tags.php:2513
|
| 2835 |
msgid "Edit Your Profile"
|
| 2836 |
msgstr ""
|
| 2837 |
|
| 2838 |
+
#: includes/common/template-tags.php:2518
|
| 2839 |
msgid "Edit %s's Profile"
|
| 2840 |
msgstr ""
|
| 2841 |
|
| 2842 |
+
#: includes/common/template-tags.php:2525
|
| 2843 |
msgid "View: %s"
|
| 2844 |
msgstr ""
|
| 2845 |
|
| 2852 |
msgid "(bbPress) Login Widget"
|
| 2853 |
msgstr ""
|
| 2854 |
|
| 2855 |
+
#: includes/common/widgets.php:85 includes/common/widgets.php:106
|
| 2856 |
#: templates/default/bbpress/form-user-login.php:14
|
| 2857 |
#: templates/default/bbpress/form-user-login.php:35
|
| 2858 |
msgid "Log In"
|
| 2859 |
msgstr ""
|
| 2860 |
|
| 2861 |
+
#: includes/common/widgets.php:88
|
| 2862 |
+
#: templates/default/bbpress/form-user-edit.php:98
|
| 2863 |
#: templates/default/bbpress/form-user-login.php:17
|
| 2864 |
#: templates/default/bbpress/form-user-register.php:23
|
| 2865 |
msgid "Username"
|
| 2866 |
msgstr ""
|
| 2867 |
|
| 2868 |
+
#: includes/common/widgets.php:93
|
| 2869 |
#: templates/default/bbpress/form-user-login.php:22
|
| 2870 |
msgid "Password"
|
| 2871 |
msgstr ""
|
| 2872 |
|
| 2873 |
+
#: includes/common/widgets.php:99
|
| 2874 |
msgid "Remember Me"
|
| 2875 |
msgstr ""
|
| 2876 |
|
| 2877 |
+
#: includes/common/widgets.php:118
|
| 2878 |
#: templates/default/bbpress/form-user-register.php:36
|
| 2879 |
msgid "Register"
|
| 2880 |
msgstr ""
|
| 2881 |
|
| 2882 |
+
#: includes/common/widgets.php:124
|
| 2883 |
#: templates/default/bbpress/form-user-lost-pass.php:14
|
| 2884 |
msgid "Lost Password"
|
| 2885 |
msgstr ""
|
| 2886 |
|
| 2887 |
+
#: includes/common/widgets.php:185 includes/common/widgets.php:313
|
| 2888 |
+
#: includes/common/widgets.php:415 includes/common/widgets.php:560
|
| 2889 |
+
#: includes/common/widgets.php:780 includes/common/widgets.php:893
|
| 2890 |
+
#: includes/common/widgets.php:1075
|
| 2891 |
msgid "Title:"
|
| 2892 |
msgstr ""
|
| 2893 |
|
| 2894 |
+
#: includes/common/widgets.php:190
|
| 2895 |
msgid "Register URI:"
|
| 2896 |
msgstr ""
|
| 2897 |
|
| 2898 |
+
#: includes/common/widgets.php:195
|
| 2899 |
msgid "Lost Password URI:"
|
| 2900 |
msgstr ""
|
| 2901 |
|
| 2902 |
+
#: includes/common/widgets.php:227
|
| 2903 |
msgid "A list of registered optional topic views."
|
| 2904 |
msgstr ""
|
| 2905 |
|
| 2906 |
+
#: includes/common/widgets.php:230
|
| 2907 |
msgid "(bbPress) Topic Views List"
|
| 2908 |
msgstr ""
|
| 2909 |
|
| 2910 |
+
#: includes/common/widgets.php:346
|
| 2911 |
+
msgid "The bbPress forum search form."
|
| 2912 |
+
msgstr ""
|
| 2913 |
+
|
| 2914 |
+
#: includes/common/widgets.php:349
|
| 2915 |
+
msgid "(bbPress) Forum Search Form"
|
| 2916 |
+
msgstr ""
|
| 2917 |
+
|
| 2918 |
+
#: includes/common/widgets.php:448
|
| 2919 |
msgid "A list of forums with an option to set the parent."
|
| 2920 |
msgstr ""
|
| 2921 |
|
| 2922 |
+
#: includes/common/widgets.php:451
|
| 2923 |
msgid "(bbPress) Forums List"
|
| 2924 |
msgstr ""
|
| 2925 |
|
| 2926 |
+
#: includes/common/widgets.php:566
|
| 2927 |
msgid "Parent Forum ID:"
|
| 2928 |
msgstr ""
|
| 2929 |
|
| 2930 |
+
#: includes/common/widgets.php:572
|
| 2931 |
msgid "\"0\" to show only root - \"any\" to show all"
|
| 2932 |
msgstr ""
|
| 2933 |
|
| 2934 |
+
#: includes/common/widgets.php:603
|
| 2935 |
msgid "A list of recent topics, sorted by popularity or freshness."
|
| 2936 |
msgstr ""
|
| 2937 |
|
| 2938 |
+
#: includes/common/widgets.php:606
|
| 2939 |
msgid "(bbPress) Recent Topics"
|
| 2940 |
msgstr ""
|
| 2941 |
|
| 2942 |
+
#: includes/common/widgets.php:721
|
| 2943 |
msgctxt "widgets"
|
| 2944 |
msgid "by %1$s"
|
| 2945 |
msgstr ""
|
| 2946 |
|
| 2947 |
+
#: includes/common/widgets.php:781
|
| 2948 |
msgid "Maximum topics to show:"
|
| 2949 |
msgstr ""
|
| 2950 |
|
| 2951 |
+
#: includes/common/widgets.php:782 includes/common/widgets.php:1077
|
| 2952 |
msgid "Show post date:"
|
| 2953 |
msgstr ""
|
| 2954 |
|
| 2955 |
+
#: includes/common/widgets.php:783
|
| 2956 |
msgid "Show topic author:"
|
| 2957 |
msgstr ""
|
| 2958 |
|
| 2959 |
+
#: includes/common/widgets.php:786
|
| 2960 |
msgid "Order By:"
|
| 2961 |
msgstr ""
|
| 2962 |
|
| 2963 |
+
#: includes/common/widgets.php:788
|
| 2964 |
msgid "Newest Topics"
|
| 2965 |
msgstr ""
|
| 2966 |
|
| 2967 |
+
#: includes/common/widgets.php:789
|
| 2968 |
+
#: templates/default/extras/page-forum-statistics.php:34
|
| 2969 |
msgid "Popular Topics"
|
| 2970 |
msgstr ""
|
| 2971 |
|
| 2972 |
+
#: includes/common/widgets.php:790
|
| 2973 |
msgid "Topics With Recent Replies"
|
| 2974 |
msgstr ""
|
| 2975 |
|
| 2976 |
+
#: includes/common/widgets.php:822
|
| 2977 |
+
msgid "Some statistics from your forum."
|
| 2978 |
+
msgstr ""
|
| 2979 |
+
|
| 2980 |
+
#: includes/common/widgets.php:825
|
| 2981 |
+
msgid "(bbPress) Statistics"
|
| 2982 |
+
msgstr ""
|
| 2983 |
+
|
| 2984 |
+
#: includes/common/widgets.php:927
|
| 2985 |
msgid "A list of the most recent replies."
|
| 2986 |
msgstr ""
|
| 2987 |
|
| 2988 |
+
#: includes/common/widgets.php:930
|
| 2989 |
msgid "(bbPress) Recent Replies"
|
| 2990 |
msgstr ""
|
| 2991 |
|
| 2992 |
#. translators: 1: reply author, 2: reply link, 3: reply timestamp
|
| 2993 |
+
#: includes/common/widgets.php:1004
|
| 2994 |
msgctxt "widgets"
|
| 2995 |
msgid "%1$s on %2$s %3$s"
|
| 2996 |
msgstr ""
|
| 2997 |
|
| 2998 |
#. translators: 1: reply link, 2: reply timestamp
|
| 2999 |
+
#: includes/common/widgets.php:1010
|
| 3000 |
msgctxt "widgets"
|
| 3001 |
msgid "%1$s %2$s"
|
| 3002 |
msgstr ""
|
| 3003 |
|
| 3004 |
#. translators: 1: reply author, 2: reply link
|
| 3005 |
+
#: includes/common/widgets.php:1016
|
| 3006 |
msgctxt "widgets"
|
| 3007 |
msgid "%1$s on %2$s"
|
| 3008 |
msgstr ""
|
| 3009 |
|
| 3010 |
#. translators: 1: reply link
|
| 3011 |
+
#: includes/common/widgets.php:1022
|
| 3012 |
msgctxt "widgets"
|
| 3013 |
msgid "%1$s"
|
| 3014 |
msgstr ""
|
| 3015 |
|
| 3016 |
+
#: includes/common/widgets.php:1076
|
| 3017 |
msgid "Maximum replies to show:"
|
| 3018 |
msgstr ""
|
| 3019 |
|
| 3020 |
+
#: includes/common/widgets.php:1078
|
| 3021 |
msgid "Show reply author:"
|
| 3022 |
msgstr ""
|
| 3023 |
|
| 3024 |
+
#: includes/core/capabilities.php:409
|
| 3025 |
msgid "Keymaster"
|
| 3026 |
msgstr ""
|
| 3027 |
|
| 3028 |
+
#: includes/core/capabilities.php:415 includes/users/template-tags.php:499
|
| 3029 |
msgid "Moderator"
|
| 3030 |
msgstr ""
|
| 3031 |
|
| 3032 |
+
#: includes/core/capabilities.php:421 includes/users/template-tags.php:503
|
| 3033 |
msgid "Participant"
|
| 3034 |
msgstr ""
|
| 3035 |
|
| 3036 |
+
#: includes/core/capabilities.php:427
|
| 3037 |
msgid "Spectator"
|
| 3038 |
msgstr ""
|
| 3039 |
|
| 3040 |
+
#: includes/core/capabilities.php:433
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3041 |
msgid "Blocked"
|
| 3042 |
msgstr ""
|
| 3043 |
|
| 3044 |
+
#: includes/core/capabilities.php:537 includes/core/capabilities.php:547
|
| 3045 |
msgid "Editable forum roles no longer exist."
|
| 3046 |
msgstr ""
|
| 3047 |
|
| 3048 |
+
#: includes/core/update.php:172
|
| 3049 |
msgid "General"
|
| 3050 |
msgstr ""
|
| 3051 |
|
| 3052 |
+
#: includes/core/update.php:173
|
| 3053 |
msgid "General chit-chat"
|
| 3054 |
msgstr ""
|
| 3055 |
|
| 3056 |
+
#: includes/core/update.php:174
|
| 3057 |
msgid "Hello World!"
|
| 3058 |
msgstr ""
|
| 3059 |
|
| 3060 |
+
#: includes/core/update.php:175
|
| 3061 |
msgid "I am the first topic in your new forums."
|
| 3062 |
msgstr ""
|
| 3063 |
|
| 3064 |
+
#: includes/core/update.php:176
|
| 3065 |
msgid "Re: Hello World!"
|
| 3066 |
msgstr ""
|
| 3067 |
|
| 3068 |
+
#: includes/core/update.php:177
|
| 3069 |
msgid "Oh, and this is what a reply looks like."
|
| 3070 |
msgstr ""
|
| 3071 |
|
| 3099 |
"retry again later."
|
| 3100 |
msgstr ""
|
| 3101 |
|
| 3102 |
+
#: includes/extend/buddypress/activity.php:240
|
| 3103 |
+
msgid "New forum topic"
|
| 3104 |
msgstr ""
|
| 3105 |
|
| 3106 |
+
#: includes/extend/buddypress/activity.php:241
|
| 3107 |
+
msgid "New forum reply"
|
| 3108 |
msgstr ""
|
| 3109 |
|
| 3110 |
+
#: includes/extend/buddypress/activity.php:466
|
| 3111 |
msgid "%1$s started the topic %2$s in the forum %3$s"
|
| 3112 |
msgstr ""
|
| 3113 |
|
| 3114 |
+
#: includes/extend/buddypress/activity.php:616
|
| 3115 |
msgid "%1$s replied to the topic %2$s in the forum %3$s"
|
| 3116 |
msgstr ""
|
| 3117 |
|
| 3118 |
+
#: includes/extend/buddypress/group.php:245
|
| 3119 |
msgid "Enable Group Forum"
|
| 3120 |
msgstr ""
|
| 3121 |
|
| 3122 |
+
#: includes/extend/buddypress/group.php:247
|
| 3123 |
+
#: includes/extend/buddypress/group.php:356
|
| 3124 |
msgid ""
|
| 3125 |
"Create a discussion forum to allow members of this group to communicate in a "
|
| 3126 |
"structured, bulletin-board style fashion."
|
| 3127 |
msgstr ""
|
| 3128 |
|
| 3129 |
+
#: includes/extend/buddypress/group.php:250
|
| 3130 |
+
#: includes/extend/buddypress/group.php:359
|
| 3131 |
msgid "Yes. I want this group to have a forum."
|
| 3132 |
msgstr ""
|
| 3133 |
|
| 3134 |
+
#: includes/extend/buddypress/group.php:253
|
| 3135 |
msgid "Saying no will not delete existing forum content."
|
| 3136 |
msgstr ""
|
| 3137 |
|
| 3138 |
+
#: includes/extend/buddypress/group.php:255
|
| 3139 |
msgid "Save Settings"
|
| 3140 |
msgstr ""
|
| 3141 |
|
| 3142 |
+
#: includes/extend/buddypress/group.php:354
|
| 3143 |
msgid "Group Forum"
|
| 3144 |
msgstr ""
|
| 3145 |
|
| 3146 |
+
#: includes/extend/buddypress/group.php:666
|
| 3147 |
+
#: includes/extend/buddypress/group.php:675
|
| 3148 |
msgid "This group does not currently have any forums."
|
| 3149 |
msgstr ""
|
| 3150 |
|
| 3151 |
+
#: includes/extend/buddypress/loader.php:99
|
| 3152 |
msgid "Search Forums..."
|
| 3153 |
msgstr ""
|
| 3154 |
|
| 3172 |
msgid "Subscribed Topics"
|
| 3173 |
msgstr ""
|
| 3174 |
|
| 3175 |
+
#: includes/forums/functions.php:118 includes/forums/functions.php:394
|
| 3176 |
+
#: includes/replies/functions.php:114 includes/replies/functions.php:419
|
| 3177 |
+
#: includes/replies/functions.php:1093 includes/topics/functions.php:120
|
| 3178 |
+
#: includes/topics/functions.php:470 includes/topics/functions.php:1081
|
| 3179 |
+
#: includes/topics/functions.php:1380 includes/topics/functions.php:1727
|
| 3180 |
+
#: includes/topics/functions.php:1766 includes/topics/functions.php:1823
|
| 3181 |
+
#: includes/users/functions.php:463 includes/users/functions.php:781
|
| 3182 |
+
#: includes/users/functions.php:907 includes/users/functions.php:913
|
| 3183 |
msgid "<strong>ERROR</strong>: Are you sure you wanted to do that?"
|
| 3184 |
msgstr ""
|
| 3185 |
|
| 3186 |
+
#: includes/forums/functions.php:131
|
| 3187 |
msgid ""
|
| 3188 |
"<strong>ERROR</strong>: You do not have permission to create new forums."
|
| 3189 |
msgstr ""
|
| 3190 |
|
| 3191 |
+
#: includes/forums/functions.php:154 includes/forums/functions.php:453
|
| 3192 |
msgid "<strong>ERROR</strong>: Your forum needs a title."
|
| 3193 |
msgstr ""
|
| 3194 |
|
| 3195 |
+
#: includes/forums/functions.php:166 includes/forums/functions.php:465
|
| 3196 |
msgid "<strong>ERROR</strong>: Your forum description cannot be empty."
|
| 3197 |
msgstr ""
|
| 3198 |
|
| 3199 |
+
#: includes/forums/functions.php:179
|
| 3200 |
msgid "<strong>ERROR</strong>: Your forum must have a parent."
|
| 3201 |
msgstr ""
|
| 3202 |
|
| 3203 |
+
#: includes/forums/functions.php:186
|
| 3204 |
msgid ""
|
| 3205 |
"<strong>ERROR</strong>: This forum is a category. No forums can be created "
|
| 3206 |
"in this forum."
|
| 3207 |
msgstr ""
|
| 3208 |
|
| 3209 |
+
#: includes/forums/functions.php:191 includes/forums/functions.php:429
|
| 3210 |
msgid "<strong>ERROR</strong>: This forum has been closed to new forums."
|
| 3211 |
msgstr ""
|
| 3212 |
|
| 3213 |
+
#: includes/forums/functions.php:196 includes/forums/functions.php:434
|
| 3214 |
msgid ""
|
| 3215 |
"<strong>ERROR</strong>: This forum is private and you do not have the "
|
| 3216 |
"capability to read or create new forums in it."
|
| 3217 |
msgstr ""
|
| 3218 |
|
| 3219 |
+
#: includes/forums/functions.php:201 includes/forums/functions.php:439
|
| 3220 |
msgid ""
|
| 3221 |
"<strong>ERROR</strong>: This forum is hidden and you do not have the "
|
| 3222 |
"capability to read or create new forums in it."
|
| 3223 |
msgstr ""
|
| 3224 |
|
| 3225 |
+
#: includes/forums/functions.php:208 includes/replies/functions.php:203
|
| 3226 |
+
#: includes/topics/functions.php:219
|
| 3227 |
msgid "<strong>ERROR</strong>: Slow down; you move too fast."
|
| 3228 |
msgstr ""
|
| 3229 |
|
| 3230 |
+
#: includes/forums/functions.php:213
|
| 3231 |
msgid "<strong>ERROR</strong>: This forum already exists."
|
| 3232 |
msgstr ""
|
| 3233 |
|
| 3234 |
+
#: includes/forums/functions.php:218
|
| 3235 |
msgid "<strong>ERROR</strong>: Your forum cannot be created at this time."
|
| 3236 |
msgstr ""
|
| 3237 |
|
| 3238 |
+
#: includes/forums/functions.php:383
|
| 3239 |
msgid "<strong>ERROR</strong>: Forum ID not found."
|
| 3240 |
msgstr ""
|
| 3241 |
|
| 3242 |
+
#: includes/forums/functions.php:399
|
| 3243 |
msgid "<strong>ERROR</strong>: The forum you want to edit was not found."
|
| 3244 |
msgstr ""
|
| 3245 |
|
| 3246 |
+
#: includes/forums/functions.php:404
|
| 3247 |
msgid "<strong>ERROR</strong>: You do not have permission to edit that forum."
|
| 3248 |
msgstr ""
|
| 3249 |
|
| 3250 |
+
#: includes/forums/functions.php:470
|
| 3251 |
msgid "<strong>ERROR</strong>: Your forum cannot be edited at this time."
|
| 3252 |
msgstr ""
|
| 3253 |
|
| 3254 |
+
#: includes/forums/template-tags.php:1128
|
| 3255 |
+
#: includes/forums/template-tags.php:1865
|
| 3256 |
msgid "%s topic"
|
| 3257 |
msgid_plural "%s topics"
|
| 3258 |
msgstr[0] ""
|
| 3259 |
msgstr[1] ""
|
| 3260 |
|
| 3261 |
+
#: includes/forums/template-tags.php:1144
|
| 3262 |
+
#: includes/topics/template-tags.php:1929
|
| 3263 |
msgid " (+ %d hidden)"
|
| 3264 |
msgstr ""
|
| 3265 |
|
| 3266 |
+
#: includes/forums/template-tags.php:1854
|
| 3267 |
+
#: includes/topics/template-tags.php:1913
|
| 3268 |
msgid "%s reply"
|
| 3269 |
msgid_plural "%s replies"
|
| 3270 |
msgstr[0] ""
|
| 3271 |
msgstr[1] ""
|
| 3272 |
|
| 3273 |
+
#: includes/forums/template-tags.php:1874
|
| 3274 |
msgid ""
|
| 3275 |
"This category contains %1$s and %2$s, and was last updated by %3$s %4$s."
|
| 3276 |
msgstr ""
|
| 3277 |
|
| 3278 |
+
#: includes/forums/template-tags.php:1876
|
| 3279 |
msgid "This forum contains %1$s and %2$s, and was last updated by %3$s %4$s."
|
| 3280 |
msgstr ""
|
| 3281 |
|
| 3282 |
+
#: includes/forums/template-tags.php:1882
|
| 3283 |
msgid "This category contains %1$s, and was last updated by %2$s %3$s."
|
| 3284 |
msgstr ""
|
| 3285 |
|
| 3286 |
+
#: includes/forums/template-tags.php:1884
|
| 3287 |
msgid "This forum contains %1$s, and was last updated by %2$s %3$s."
|
| 3288 |
msgstr ""
|
| 3289 |
|
| 3290 |
+
#: includes/forums/template-tags.php:1894
|
| 3291 |
msgid "This category contains %1$s and %2$s."
|
| 3292 |
msgstr ""
|
| 3293 |
|
| 3294 |
+
#: includes/forums/template-tags.php:1896
|
| 3295 |
msgid "This forum contains %1$s and %2$s."
|
| 3296 |
msgstr ""
|
| 3297 |
|
| 3298 |
+
#: includes/forums/template-tags.php:1904
|
| 3299 |
msgid "This category contains %1$s."
|
| 3300 |
msgstr ""
|
| 3301 |
|
| 3302 |
+
#: includes/forums/template-tags.php:1906
|
| 3303 |
msgid "This forum contains %1$s."
|
| 3304 |
msgstr ""
|
| 3305 |
|
| 3306 |
+
#: includes/forums/template-tags.php:1910
|
| 3307 |
msgid "This forum is empty."
|
| 3308 |
msgstr ""
|
| 3309 |
|
| 3310 |
+
#: includes/forums/template-tags.php:2146
|
| 3311 |
msgid "Category"
|
| 3312 |
msgstr ""
|
| 3313 |
|
| 3314 |
+
#: includes/forums/template-tags.php:2183
|
| 3315 |
msgctxt "Forum Status"
|
| 3316 |
msgid "Open"
|
| 3317 |
msgstr ""
|
| 3318 |
|
| 3319 |
+
#: includes/forums/template-tags.php:2184
|
| 3320 |
msgctxt "Forum Status"
|
| 3321 |
msgid "Closed"
|
| 3322 |
msgstr ""
|
| 3323 |
|
| 3324 |
+
#: includes/forums/template-tags.php:2221
|
| 3325 |
msgid "Public"
|
| 3326 |
msgstr ""
|
| 3327 |
|
| 3328 |
+
#: includes/forums/template-tags.php:2222
|
| 3329 |
#: templates/default/bbpress/feedback-no-access.php:13
|
| 3330 |
msgid "Private"
|
| 3331 |
msgstr ""
|
| 3332 |
|
| 3333 |
+
#: includes/forums/template-tags.php:2223
|
| 3334 |
msgid "Hidden"
|
| 3335 |
msgstr ""
|
| 3336 |
|
| 3337 |
+
#: includes/replies/functions.php:140
|
| 3338 |
msgid "<strong>ERROR</strong>: You do not have permission to reply."
|
| 3339 |
msgstr ""
|
| 3340 |
|
| 3341 |
+
#: includes/replies/functions.php:154
|
| 3342 |
msgid "<strong>ERROR</strong>: Topic ID is missing."
|
| 3343 |
msgstr ""
|
| 3344 |
|
| 3345 |
+
#: includes/replies/functions.php:165 includes/topics/functions.php:190
|
| 3346 |
+
#: includes/topics/functions.php:484
|
| 3347 |
msgid "<strong>ERROR</strong>: Forum ID is missing."
|
| 3348 |
msgstr ""
|
| 3349 |
|
| 3350 |
+
#: includes/replies/functions.php:186
|
| 3351 |
msgid "<strong>ERROR</strong>: Your reply needs a title."
|
| 3352 |
msgstr ""
|
| 3353 |
|
| 3354 |
+
#: includes/replies/functions.php:198 includes/replies/functions.php:503
|
| 3355 |
msgid "<strong>ERROR</strong>: Your reply cannot be empty."
|
| 3356 |
msgstr ""
|
| 3357 |
|
| 3358 |
+
#: includes/replies/functions.php:208
|
| 3359 |
msgid ""
|
| 3360 |
"<strong>ERROR</strong>: Duplicate reply detected; it looks as though "
|
| 3361 |
"you’ve already said that!"
|
| 3362 |
msgstr ""
|
| 3363 |
|
| 3364 |
+
#: includes/replies/functions.php:213
|
| 3365 |
msgid "<strong>ERROR</strong>: Your reply cannot be created at this time."
|
| 3366 |
msgstr ""
|
| 3367 |
|
| 3368 |
+
#: includes/replies/functions.php:282 includes/replies/functions.php:587
|
| 3369 |
msgid ""
|
| 3370 |
"<strong>ERROR</strong>: There was a problem adding the tags to the topic."
|
| 3371 |
msgstr ""
|
| 3372 |
|
| 3373 |
+
#: includes/replies/functions.php:408
|
| 3374 |
msgid "<strong>ERROR</strong>: Reply ID not found."
|
| 3375 |
msgstr ""
|
| 3376 |
|
| 3377 |
+
#: includes/replies/functions.php:425
|
| 3378 |
msgid "<strong>ERROR</strong>: The reply you want to edit was not found."
|
| 3379 |
msgstr ""
|
| 3380 |
|
| 3381 |
+
#: includes/replies/functions.php:436
|
| 3382 |
msgid "<strong>ERROR</strong>: You do not have permission to edit that reply."
|
| 3383 |
msgstr ""
|
| 3384 |
|
| 3385 |
+
#: includes/replies/functions.php:470
|
| 3386 |
msgid ""
|
| 3387 |
"<strong>ERROR</strong>: This forum is a category. No topics or replies can "
|
| 3388 |
"be created in it."
|
| 3389 |
msgstr ""
|
| 3390 |
|
| 3391 |
+
#: includes/replies/functions.php:474
|
| 3392 |
msgid ""
|
| 3393 |
"<strong>ERROR</strong>: This forum has been closed to new topics and replies."
|
| 3394 |
msgstr ""
|
| 3395 |
|
| 3396 |
+
#: includes/replies/functions.php:478
|
| 3397 |
msgid ""
|
| 3398 |
"<strong>ERROR</strong>: This forum is private and you do not have the "
|
| 3399 |
"capability to read or create new replies in it."
|
| 3400 |
msgstr ""
|
| 3401 |
|
| 3402 |
+
#: includes/replies/functions.php:482
|
| 3403 |
msgid ""
|
| 3404 |
"<strong>ERROR</strong>: This forum is hidden and you do not have the "
|
| 3405 |
"capability to read or create new replies in it."
|
| 3406 |
msgstr ""
|
| 3407 |
|
| 3408 |
+
#: includes/replies/functions.php:508
|
| 3409 |
msgid "<strong>ERROR</strong>: Your reply cannot be edited at this time."
|
| 3410 |
msgstr ""
|
| 3411 |
|
| 3412 |
+
#: includes/replies/functions.php:1070
|
| 3413 |
+
msgid "<strong>ERROR</strong>: Reply ID to move not found!"
|
| 3414 |
+
msgstr ""
|
| 3415 |
+
|
| 3416 |
+
#: includes/replies/functions.php:1079
|
| 3417 |
+
msgid "<strong>ERROR</strong>: The reply you want to move was not found."
|
| 3418 |
msgstr ""
|
| 3419 |
|
| 3420 |
#: includes/replies/functions.php:1088
|
| 3421 |
+
msgid "<strong>ERROR</strong>: The topic you want to move from was not found."
|
| 3422 |
+
msgstr ""
|
| 3423 |
+
|
| 3424 |
+
#: includes/replies/functions.php:1099 includes/topics/functions.php:1092
|
| 3425 |
+
#: includes/topics/functions.php:1386
|
| 3426 |
+
msgid ""
|
| 3427 |
+
"<strong>ERROR</strong>: You do not have the permissions to edit the source "
|
| 3428 |
+
"topic."
|
| 3429 |
+
msgstr ""
|
| 3430 |
+
|
| 3431 |
+
#: includes/replies/functions.php:1109
|
| 3432 |
+
msgid "<strong>ERROR</strong>: You need to choose a valid move option."
|
| 3433 |
+
msgstr ""
|
| 3434 |
+
|
| 3435 |
+
#: includes/replies/functions.php:1122 includes/topics/functions.php:1407
|
| 3436 |
+
msgid "<strong>ERROR</strong>: Destination topic ID not found!"
|
| 3437 |
+
msgstr ""
|
| 3438 |
+
|
| 3439 |
+
#: includes/replies/functions.php:1132
|
| 3440 |
+
msgid "<strong>ERROR</strong>: The topic you want to move to was not found!"
|
| 3441 |
+
msgstr ""
|
| 3442 |
+
|
| 3443 |
+
#: includes/replies/functions.php:1137 includes/topics/functions.php:1420
|
| 3444 |
+
msgid ""
|
| 3445 |
+
"<strong>ERROR</strong>: You do not have the permissions to edit the "
|
| 3446 |
+
"destination topic!"
|
| 3447 |
+
msgstr ""
|
| 3448 |
+
|
| 3449 |
+
#: includes/replies/functions.php:1197 includes/topics/functions.php:1459
|
| 3450 |
+
msgid ""
|
| 3451 |
+
"<strong>ERROR</strong>: There was a problem converting the reply into the "
|
| 3452 |
+
"topic. Please try again."
|
| 3453 |
+
msgstr ""
|
| 3454 |
+
|
| 3455 |
+
#: includes/replies/functions.php:1202 includes/topics/functions.php:1464
|
| 3456 |
+
msgid ""
|
| 3457 |
+
"<strong>ERROR</strong>: You do not have the permissions to create new "
|
| 3458 |
+
"topics. The reply could not be converted into a topic."
|
| 3459 |
+
msgstr ""
|
| 3460 |
+
|
| 3461 |
+
#: includes/replies/functions.php:1371
|
| 3462 |
+
msgid "<strong>ERROR:</strong> You do not have the permission to do that!"
|
| 3463 |
+
msgstr ""
|
| 3464 |
+
|
| 3465 |
+
#: includes/replies/functions.php:1384
|
| 3466 |
msgid ""
|
| 3467 |
"<strong>ERROR</strong>: There was a problem unmarking the reply as spam!"
|
| 3468 |
msgstr ""
|
| 3469 |
|
| 3470 |
+
#: includes/replies/functions.php:1384
|
| 3471 |
msgid "<strong>ERROR</strong>: There was a problem marking the reply as spam!"
|
| 3472 |
msgstr ""
|
| 3473 |
|
| 3474 |
+
#: includes/replies/functions.php:1403
|
| 3475 |
msgid "<strong>ERROR</strong>: There was a problem trashing the reply!"
|
| 3476 |
msgstr ""
|
| 3477 |
|
| 3478 |
+
#: includes/replies/functions.php:1411
|
| 3479 |
msgid "<strong>ERROR</strong>: There was a problem untrashing the reply!"
|
| 3480 |
msgstr ""
|
| 3481 |
|
| 3482 |
+
#: includes/replies/functions.php:1419
|
| 3483 |
msgid "<strong>ERROR</strong>: There was a problem deleting the reply!"
|
| 3484 |
msgstr ""
|
| 3485 |
|
| 3486 |
+
#: includes/replies/functions.php:1808
|
| 3487 |
msgid "All Posts"
|
| 3488 |
msgstr ""
|
| 3489 |
|
| 3490 |
+
#: includes/replies/functions.php:1850 includes/topics/functions.php:3327
|
| 3491 |
msgid "Replies: %s"
|
| 3492 |
msgstr ""
|
| 3493 |
|
| 3494 |
+
#: includes/replies/template-tags.php:567
|
| 3495 |
+
#: includes/topics/template-tags.php:723
|
| 3496 |
msgctxt "date at time"
|
| 3497 |
msgid "%1$s at %2$s"
|
| 3498 |
msgstr ""
|
| 3499 |
|
| 3500 |
+
#: includes/replies/template-tags.php:665
|
| 3501 |
msgid "This reply was modified %1$s by %2$s. Reason: %3$s"
|
| 3502 |
msgstr ""
|
| 3503 |
|
| 3504 |
+
#: includes/replies/template-tags.php:667
|
| 3505 |
msgid "This reply was modified %1$s by %2$s."
|
| 3506 |
msgstr ""
|
| 3507 |
|
| 3508 |
+
#: includes/replies/template-tags.php:953
|
| 3509 |
+
#: includes/topics/template-tags.php:1271 includes/users/template-tags.php:165
|
| 3510 |
msgid "Anonymous"
|
| 3511 |
msgstr ""
|
| 3512 |
|
| 3513 |
+
#: includes/replies/template-tags.php:1062
|
| 3514 |
+
#: includes/topics/template-tags.php:1380
|
| 3515 |
+
#: includes/users/template-tags.php:1425
|
| 3516 |
msgid "View %s's profile"
|
| 3517 |
msgstr ""
|
| 3518 |
|
| 3519 |
+
#: includes/replies/template-tags.php:1062
|
| 3520 |
+
#: includes/topics/template-tags.php:1380
|
| 3521 |
+
#: includes/users/template-tags.php:1425
|
| 3522 |
msgid "Visit %s's website"
|
| 3523 |
msgstr ""
|
| 3524 |
|
| 3525 |
+
#: includes/replies/template-tags.php:1696
|
| 3526 |
+
#: includes/topics/template-tags.php:2433
|
| 3527 |
#: templates/default/bbpress/form-topic-tag.php:88
|
| 3528 |
#: templates/default/bbpress/form-topic-tag.php:101
|
| 3529 |
msgid "Delete"
|
| 3530 |
msgstr ""
|
| 3531 |
|
| 3532 |
+
#: includes/replies/template-tags.php:1713
|
| 3533 |
+
#: includes/topics/template-tags.php:2450
|
| 3534 |
msgid "Are you sure you want to delete that permanently?"
|
| 3535 |
msgstr ""
|
| 3536 |
|
| 3537 |
+
#: includes/replies/template-tags.php:1766
|
| 3538 |
+
#: includes/topics/template-tags.php:2689
|
| 3539 |
msgid "Unspam"
|
| 3540 |
msgstr ""
|
| 3541 |
|
| 3542 |
+
#: includes/replies/template-tags.php:1829
|
| 3543 |
+
msgid "Move"
|
| 3544 |
+
msgstr ""
|
| 3545 |
+
|
| 3546 |
+
#: includes/replies/template-tags.php:1830
|
| 3547 |
+
msgid "Move this reply"
|
| 3548 |
+
msgstr ""
|
| 3549 |
+
|
| 3550 |
+
#: includes/replies/template-tags.php:1896
|
| 3551 |
msgid "Split"
|
| 3552 |
msgstr ""
|
| 3553 |
|
| 3554 |
+
#: includes/replies/template-tags.php:1897
|
| 3555 |
msgid "Split the topic from this reply"
|
| 3556 |
msgstr ""
|
| 3557 |
|
| 3558 |
+
#: includes/replies/template-tags.php:2002
|
| 3559 |
msgid "Viewing %1$s reply"
|
| 3560 |
msgid_plural "Viewing %1$s replies"
|
| 3561 |
msgstr[0] ""
|
| 3562 |
msgstr[1] ""
|
| 3563 |
|
| 3564 |
+
#: includes/replies/template-tags.php:2006
|
| 3565 |
msgid "Viewing %2$s replies (of %4$s total)"
|
| 3566 |
msgid_plural "Viewing %1$s replies - %2$s through %3$s (of %4$s total)"
|
| 3567 |
msgstr[0] ""
|
| 3568 |
msgstr[1] ""
|
| 3569 |
|
| 3570 |
+
#: includes/replies/template-tags.php:2014
|
| 3571 |
msgid "Viewing %1$s post"
|
| 3572 |
msgid_plural "Viewing %1$s posts"
|
| 3573 |
msgstr[0] ""
|
| 3574 |
msgstr[1] ""
|
| 3575 |
|
| 3576 |
+
#: includes/replies/template-tags.php:2018
|
| 3577 |
msgid "Viewing %2$s post (of %4$s total)"
|
| 3578 |
msgid_plural "Viewing %1$s posts - %2$s through %3$s (of %4$s total)"
|
| 3579 |
msgstr[0] ""
|
| 3580 |
msgstr[1] ""
|
| 3581 |
|
| 3582 |
+
#: includes/search/template-tags.php:217
|
| 3583 |
+
msgid "Search Results for '%s'"
|
| 3584 |
+
msgstr ""
|
| 3585 |
+
|
| 3586 |
+
#: includes/search/template-tags.php:332
|
| 3587 |
+
msgid "Viewing %1$s result"
|
| 3588 |
+
msgid_plural "Viewing %1$s results"
|
| 3589 |
+
msgstr[0] ""
|
| 3590 |
+
msgstr[1] ""
|
| 3591 |
+
|
| 3592 |
+
#: includes/search/template-tags.php:336
|
| 3593 |
+
msgid "Viewing %2$s results (of %4$s total)"
|
| 3594 |
+
msgid_plural "Viewing %1$s results - %2$s through %3$s (of %4$s total)"
|
| 3595 |
+
msgstr[0] ""
|
| 3596 |
+
msgstr[1] ""
|
| 3597 |
+
|
| 3598 |
+
#: includes/topics/functions.php:148
|
| 3599 |
msgid ""
|
| 3600 |
"<strong>ERROR</strong>: You do not have permission to create new topics."
|
| 3601 |
msgstr ""
|
| 3602 |
|
| 3603 |
+
#: includes/topics/functions.php:172 includes/topics/functions.php:524
|
| 3604 |
msgid "<strong>ERROR</strong>: Your topic needs a title."
|
| 3605 |
msgstr ""
|
| 3606 |
|
| 3607 |
+
#: includes/topics/functions.php:184 includes/topics/functions.php:536
|
| 3608 |
msgid "<strong>ERROR</strong>: Your topic cannot be empty."
|
| 3609 |
msgstr ""
|
| 3610 |
|
| 3611 |
+
#: includes/topics/functions.php:201
|
| 3612 |
msgid ""
|
| 3613 |
"<strong>ERROR</strong>: This forum is a category. No topics can be created "
|
| 3614 |
"in this forum."
|
| 3615 |
msgstr ""
|
| 3616 |
|
| 3617 |
+
#: includes/topics/functions.php:205 includes/topics/functions.php:503
|
| 3618 |
msgid "<strong>ERROR</strong>: This forum has been closed to new topics."
|
| 3619 |
msgstr ""
|
| 3620 |
|
| 3621 |
+
#: includes/topics/functions.php:209 includes/topics/functions.php:507
|
| 3622 |
msgid ""
|
| 3623 |
"<strong>ERROR</strong>: This forum is private and you do not have the "
|
| 3624 |
"capability to read or create new topics in it."
|
| 3625 |
msgstr ""
|
| 3626 |
|
| 3627 |
+
#: includes/topics/functions.php:213 includes/topics/functions.php:511
|
| 3628 |
msgid ""
|
| 3629 |
"<strong>ERROR</strong>: This forum is hidden and you do not have the "
|
| 3630 |
"capability to read or create new topics in it."
|
| 3631 |
msgstr ""
|
| 3632 |
|
| 3633 |
+
#: includes/topics/functions.php:224
|
| 3634 |
msgid ""
|
| 3635 |
"<strong>ERROR</strong>: Duplicate topic detected; it looks as though "
|
| 3636 |
"you’ve already said that!"
|
| 3637 |
msgstr ""
|
| 3638 |
|
| 3639 |
+
#: includes/topics/functions.php:229
|
| 3640 |
msgid "<strong>ERROR</strong>: Your topic cannot be created at this time."
|
| 3641 |
msgstr ""
|
| 3642 |
|
| 3643 |
+
#: includes/topics/functions.php:432 includes/topics/functions.php:1075
|
| 3644 |
msgid "<strong>ERROR</strong>: Topic ID not found."
|
| 3645 |
msgstr ""
|
| 3646 |
|
| 3647 |
+
#: includes/topics/functions.php:443
|
| 3648 |
msgid "<strong>ERROR</strong>: The topic you want to edit was not found."
|
| 3649 |
msgstr ""
|
| 3650 |
|
| 3651 |
+
#: includes/topics/functions.php:454
|
| 3652 |
msgid "<strong>ERROR</strong>: You do not have permission to edit that topic."
|
| 3653 |
msgstr ""
|
| 3654 |
|
| 3655 |
+
#: includes/topics/functions.php:499
|
| 3656 |
msgid ""
|
| 3657 |
"<strong>ERROR</strong>: This forum is a category. No topics can be created "
|
| 3658 |
"in it."
|
| 3659 |
msgstr ""
|
| 3660 |
|
| 3661 |
+
#: includes/topics/functions.php:541
|
| 3662 |
msgid "<strong>ERROR</strong>: Your topic cannot be edited at this time."
|
| 3663 |
msgstr ""
|
| 3664 |
|
| 3665 |
+
#: includes/topics/functions.php:1086
|
| 3666 |
msgid "<strong>ERROR</strong>: The topic you want to merge was not found."
|
| 3667 |
msgstr ""
|
| 3668 |
|
| 3669 |
+
#: includes/topics/functions.php:1100
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3670 |
msgid "<strong>ERROR</strong>: Destination topic ID not found."
|
| 3671 |
msgstr ""
|
| 3672 |
|
| 3673 |
+
#: includes/topics/functions.php:1106
|
| 3674 |
msgid "<strong>ERROR</strong>: The topic you want to merge to was not found."
|
| 3675 |
msgstr ""
|
| 3676 |
|
| 3677 |
+
#: includes/topics/functions.php:1110
|
| 3678 |
msgid ""
|
| 3679 |
"<strong>ERROR</strong>: You do not have the permissions to edit the "
|
| 3680 |
"destination topic."
|
| 3681 |
msgstr ""
|
| 3682 |
|
| 3683 |
+
#: includes/topics/functions.php:1359
|
| 3684 |
msgid "<strong>ERROR</strong>: Reply ID to split the topic from not found!"
|
| 3685 |
msgstr ""
|
| 3686 |
|
| 3687 |
+
#: includes/topics/functions.php:1367
|
| 3688 |
msgid "<strong>ERROR</strong>: The reply you want to split from was not found."
|
| 3689 |
msgstr ""
|
| 3690 |
|
| 3691 |
+
#: includes/topics/functions.php:1376
|
| 3692 |
msgid "<strong>ERROR</strong>: The topic you want to split was not found."
|
| 3693 |
msgstr ""
|
| 3694 |
|
| 3695 |
+
#: includes/topics/functions.php:1394
|
| 3696 |
msgid "<strong>ERROR</strong>: You need to choose a valid split option."
|
| 3697 |
msgstr ""
|
| 3698 |
|
| 3699 |
+
#: includes/topics/functions.php:1416
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3700 |
msgid "<strong>ERROR</strong>: The topic you want to split to was not found!"
|
| 3701 |
msgstr ""
|
| 3702 |
|
| 3703 |
+
#: includes/topics/functions.php:1715
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3704 |
msgid ""
|
| 3705 |
"<strong>ERROR</strong>: The following problem(s) have been found while "
|
| 3706 |
"getting the tag: %s"
|
| 3707 |
msgstr ""
|
| 3708 |
|
| 3709 |
+
#: includes/topics/functions.php:1733 includes/topics/functions.php:1772
|
| 3710 |
msgid ""
|
| 3711 |
"<strong>ERROR</strong>: You do not have the permissions to edit the topic "
|
| 3712 |
"tags."
|
| 3713 |
msgstr ""
|
| 3714 |
|
| 3715 |
+
#: includes/topics/functions.php:1739 includes/topics/functions.php:1778
|
| 3716 |
msgid "<strong>ERROR</strong>: You need to enter a tag name."
|
| 3717 |
msgstr ""
|
| 3718 |
|
| 3719 |
+
#: includes/topics/functions.php:1749
|
| 3720 |
msgid ""
|
| 3721 |
"<strong>ERROR</strong>: The following problem(s) have been found while "
|
| 3722 |
"updating the tag: %s"
|
| 3723 |
msgstr ""
|
| 3724 |
|
| 3725 |
+
#: includes/topics/functions.php:1788 includes/topics/functions.php:1806
|
| 3726 |
msgid ""
|
| 3727 |
"<strong>ERROR</strong>: The following problem(s) have been found while "
|
| 3728 |
"merging the tags: %s"
|
| 3729 |
msgstr ""
|
| 3730 |
|
| 3731 |
+
#: includes/topics/functions.php:1797
|
| 3732 |
msgid ""
|
| 3733 |
"<strong>ERROR</strong>: The tags which are being merged can not be the same."
|
| 3734 |
msgstr ""
|
| 3735 |
|
| 3736 |
+
#: includes/topics/functions.php:1829
|
| 3737 |
msgid ""
|
| 3738 |
"<strong>ERROR</strong>: You do not have the permissions to delete the topic "
|
| 3739 |
"tags."
|
| 3740 |
msgstr ""
|
| 3741 |
|
| 3742 |
+
#: includes/topics/functions.php:1838
|
| 3743 |
msgid ""
|
| 3744 |
"<strong>ERROR</strong>: The following problem(s) have been found while "
|
| 3745 |
"deleting the tag: %s"
|
| 3746 |
msgstr ""
|
| 3747 |
|
| 3748 |
+
#: includes/topics/functions.php:1963
|
| 3749 |
msgid "<strong>ERROR:</strong> You do not have the permission to do that."
|
| 3750 |
msgstr ""
|
| 3751 |
|
| 3752 |
+
#: includes/topics/functions.php:1976
|
| 3753 |
msgid "<strong>ERROR</strong>: There was a problem closing the topic."
|
| 3754 |
msgstr ""
|
| 3755 |
|
| 3756 |
+
#: includes/topics/functions.php:1976
|
| 3757 |
msgid "<strong>ERROR</strong>: There was a problem opening the topic."
|
| 3758 |
msgstr ""
|
| 3759 |
|
| 3760 |
+
#: includes/topics/functions.php:1987
|
| 3761 |
msgid "<strong>ERROR</strong>: There was a problem unsticking the topic."
|
| 3762 |
msgstr ""
|
| 3763 |
|
| 3764 |
+
#: includes/topics/functions.php:1987
|
| 3765 |
msgid "<strong>ERROR</strong>: There was a problem sticking the topic."
|
| 3766 |
msgstr ""
|
| 3767 |
|
| 3768 |
+
#: includes/topics/functions.php:1997
|
| 3769 |
msgid ""
|
| 3770 |
"<strong>ERROR</strong>: There was a problem unmarking the topic as spam."
|
| 3771 |
msgstr ""
|
| 3772 |
|
| 3773 |
+
#: includes/topics/functions.php:1997
|
| 3774 |
msgid "<strong>ERROR</strong>: There was a problem marking the topic as spam."
|
| 3775 |
msgstr ""
|
| 3776 |
|
| 3777 |
+
#: includes/topics/functions.php:2016
|
| 3778 |
msgid "<strong>ERROR</strong>: There was a problem trashing the topic."
|
| 3779 |
msgstr ""
|
| 3780 |
|
| 3781 |
+
#: includes/topics/functions.php:2024
|
| 3782 |
msgid "<strong>ERROR</strong>: There was a problem untrashing the topic."
|
| 3783 |
msgstr ""
|
| 3784 |
|
| 3785 |
+
#: includes/topics/functions.php:2032
|
| 3786 |
msgid "<strong>ERROR</strong>: There was a problem deleting the topic."
|
| 3787 |
msgstr ""
|
| 3788 |
|
| 3789 |
+
#: includes/topics/template-tags.php:900
|
| 3790 |
msgid "This topic was modified %1$s by %2$s. Reason: %3$s"
|
| 3791 |
msgstr ""
|
| 3792 |
|
| 3793 |
+
#: includes/topics/template-tags.php:902
|
| 3794 |
msgid "This topic was modified %1$s by %2$s."
|
| 3795 |
msgstr ""
|
| 3796 |
|
| 3797 |
+
#: includes/topics/template-tags.php:2106
|
| 3798 |
msgid "Tagged:"
|
| 3799 |
msgstr ""
|
| 3800 |
|
| 3801 |
+
#: includes/topics/template-tags.php:2501
|
| 3802 |
msgctxt "Topic Status"
|
| 3803 |
msgid "Close"
|
| 3804 |
msgstr ""
|
| 3805 |
|
| 3806 |
+
#: includes/topics/template-tags.php:2502
|
| 3807 |
msgctxt "Topic Status"
|
| 3808 |
msgid "Open"
|
| 3809 |
msgstr ""
|
| 3810 |
|
| 3811 |
+
#: includes/topics/template-tags.php:2632
|
| 3812 |
#: templates/default/bbpress/form-topic-tag.php:59
|
| 3813 |
#: templates/default/bbpress/form-topic-tag.php:73
|
| 3814 |
msgid "Merge"
|
| 3815 |
msgstr ""
|
| 3816 |
|
| 3817 |
+
#: includes/topics/template-tags.php:2742
|
| 3818 |
msgid "Viewing %1$s topic"
|
| 3819 |
msgid_plural "Viewing %1$s topics"
|
| 3820 |
msgstr[0] ""
|
| 3821 |
msgstr[1] ""
|
| 3822 |
|
| 3823 |
+
#: includes/topics/template-tags.php:2746
|
| 3824 |
msgid "Viewing topic %2$s (of %4$s total)"
|
| 3825 |
msgid_plural "Viewing %1$s topics - %2$s through %3$s (of %4$s total)"
|
| 3826 |
msgstr[0] ""
|
| 3827 |
msgstr[1] ""
|
| 3828 |
|
| 3829 |
+
#: includes/topics/template-tags.php:2806
|
| 3830 |
msgid "This topic is marked as spam."
|
| 3831 |
msgstr ""
|
| 3832 |
|
| 3833 |
+
#: includes/topics/template-tags.php:2811
|
| 3834 |
msgid "This topic is in the trash."
|
| 3835 |
msgstr ""
|
| 3836 |
|
| 3837 |
+
#: includes/topics/template-tags.php:2850
|
| 3838 |
msgid "Normal"
|
| 3839 |
msgstr ""
|
| 3840 |
|
| 3841 |
+
#: includes/topics/template-tags.php:2851
|
| 3842 |
msgid "Sticky"
|
| 3843 |
msgstr ""
|
| 3844 |
|
| 3845 |
+
#: includes/topics/template-tags.php:2852
|
| 3846 |
msgid "Super Sticky"
|
| 3847 |
msgstr ""
|
| 3848 |
|
| 3849 |
+
#: includes/topics/template-tags.php:2970
|
| 3850 |
msgid "%s voice"
|
| 3851 |
msgid_plural "%s voices"
|
| 3852 |
msgstr[0] ""
|
| 3853 |
msgstr[1] ""
|
| 3854 |
|
| 3855 |
+
#: includes/topics/template-tags.php:2976
|
| 3856 |
msgid "This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s."
|
| 3857 |
msgstr ""
|
| 3858 |
|
| 3859 |
+
#: includes/topics/template-tags.php:2980
|
| 3860 |
msgid "This topic contains %1$s and has %2$s."
|
| 3861 |
msgstr ""
|
| 3862 |
|
| 3863 |
+
#: includes/topics/template-tags.php:2984
|
| 3864 |
msgid "This topic has no replies."
|
| 3865 |
msgstr ""
|
| 3866 |
|
| 3867 |
+
#: includes/users/functions.php:459
|
| 3868 |
msgid ""
|
| 3869 |
"<strong>ERROR</strong>: No topic was found! Which topic are you marking/"
|
| 3870 |
"unmarking as favorite?"
|
| 3871 |
msgstr ""
|
| 3872 |
|
| 3873 |
+
#: includes/users/functions.php:467 includes/users/functions.php:785
|
| 3874 |
msgid ""
|
| 3875 |
"<strong>ERROR</strong>: You don't have the permission to edit favorites of "
|
| 3876 |
"that user!"
|
| 3877 |
msgstr ""
|
| 3878 |
|
| 3879 |
+
#: includes/users/functions.php:510
|
| 3880 |
msgid ""
|
| 3881 |
"<strong>ERROR</strong>: There was a problem removing that topic from "
|
| 3882 |
"favorites!"
|
| 3883 |
msgstr ""
|
| 3884 |
|
| 3885 |
+
#: includes/users/functions.php:512
|
| 3886 |
msgid "<strong>ERROR</strong>: There was a problem favoriting that topic!"
|
| 3887 |
msgstr ""
|
| 3888 |
|
| 3889 |
+
#: includes/users/functions.php:777
|
| 3890 |
msgid ""
|
| 3891 |
"<strong>ERROR</strong>: No topic was found! Which topic are you subscribing/"
|
| 3892 |
"unsubscribing to?"
|
| 3893 |
msgstr ""
|
| 3894 |
|
| 3895 |
+
#: includes/users/functions.php:828
|
| 3896 |
msgid ""
|
| 3897 |
"<strong>ERROR</strong>: There was a problem unsubscribing from that topic!"
|
| 3898 |
msgstr ""
|
| 3899 |
|
| 3900 |
+
#: includes/users/functions.php:830
|
| 3901 |
msgid "<strong>ERROR</strong>: There was a problem subscribing to that topic!"
|
| 3902 |
msgstr ""
|
| 3903 |
|
| 3904 |
+
#: includes/users/template-tags.php:487
|
| 3905 |
msgid "Key Master"
|
| 3906 |
msgstr ""
|
| 3907 |
|
| 3908 |
+
#: includes/users/template-tags.php:491
|
| 3909 |
msgid "Inactive"
|
| 3910 |
msgstr ""
|
| 3911 |
|
| 3912 |
+
#: includes/users/template-tags.php:495
|
| 3913 |
msgid "Guest"
|
| 3914 |
msgstr ""
|
| 3915 |
|
| 3916 |
+
#: includes/users/template-tags.php:507
|
| 3917 |
msgid "Member"
|
| 3918 |
msgstr ""
|
| 3919 |
|
| 3920 |
+
#: includes/users/template-tags.php:547
|
| 3921 |
msgid "Admin"
|
| 3922 |
msgstr ""
|
| 3923 |
|
| 3924 |
+
#: includes/users/template-tags.php:713
|
| 3925 |
+
msgid "Favorite"
|
|
|
|
| 3926 |
msgstr ""
|
| 3927 |
|
| 3928 |
+
#: includes/users/template-tags.php:714
|
| 3929 |
+
msgid "Favorited"
|
| 3930 |
msgstr ""
|
| 3931 |
|
| 3932 |
+
#: includes/users/template-tags.php:871
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3933 |
msgid "Subscribe"
|
| 3934 |
msgstr ""
|
| 3935 |
|
| 3936 |
+
#: includes/users/template-tags.php:872
|
|
|
|
| 3937 |
msgid "Unsubscribe"
|
| 3938 |
msgstr ""
|
| 3939 |
|
| 3940 |
+
#: includes/users/template-tags.php:939
|
| 3941 |
msgid "User updated."
|
| 3942 |
msgstr ""
|
| 3943 |
|
| 3944 |
+
#: includes/users/template-tags.php:964
|
| 3945 |
msgid "You have super admin privileges."
|
| 3946 |
msgstr ""
|
| 3947 |
|
| 3948 |
+
#: includes/users/template-tags.php:964
|
| 3949 |
msgid "This user has super admin privileges."
|
| 3950 |
msgstr ""
|
| 3951 |
|
| 3952 |
+
#: includes/users/template-tags.php:1029
|
| 3953 |
msgid "— No role for this site —"
|
| 3954 |
msgstr ""
|
| 3955 |
|
| 3956 |
+
#: includes/users/template-tags.php:1227
|
| 3957 |
msgid "You are now logged out."
|
| 3958 |
msgstr ""
|
| 3959 |
|
| 3960 |
+
#: includes/users/template-tags.php:1231
|
| 3961 |
msgid "New user registration is currently not allowed."
|
| 3962 |
msgstr ""
|
| 3963 |
|
| 3964 |
+
#: includes/users/template-tags.php:1240
|
| 3965 |
msgid "Check your e-mail for the confirmation link."
|
| 3966 |
msgstr ""
|
| 3967 |
|
| 3968 |
+
#: includes/users/template-tags.php:1245
|
| 3969 |
msgid "Check your e-mail for your new password."
|
| 3970 |
msgstr ""
|
| 3971 |
|
| 3972 |
+
#: includes/users/template-tags.php:1250
|
| 3973 |
msgid "Registration complete. Please check your e-mail."
|
| 3974 |
msgstr ""
|
| 3975 |
|
| 3976 |
+
#: templates/default/bbpress/content-statistics.php:17
|
| 3977 |
+
msgid "Registered Users"
|
| 3978 |
+
msgstr ""
|
| 3979 |
+
|
| 3980 |
+
#: templates/default/bbpress/content-statistics.php:44
|
| 3981 |
+
msgid "Empty Topic Tags"
|
| 3982 |
+
msgstr ""
|
| 3983 |
+
|
| 3984 |
+
#: templates/default/bbpress/content-statistics.php:53
|
| 3985 |
+
msgid "Hidden Topics"
|
| 3986 |
+
msgstr ""
|
| 3987 |
+
|
| 3988 |
+
#: templates/default/bbpress/content-statistics.php:64
|
| 3989 |
+
msgid "Hidden Replies"
|
| 3990 |
+
msgstr ""
|
| 3991 |
+
|
| 3992 |
#: templates/default/bbpress/feedback-logged-in.php:13
|
| 3993 |
msgid "You are already logged in."
|
| 3994 |
msgstr ""
|
| 4005 |
msgid "Oh bother! No replies were found here!"
|
| 4006 |
msgstr ""
|
| 4007 |
|
| 4008 |
+
#: templates/default/bbpress/feedback-no-search.php:13
|
| 4009 |
+
msgid "Oh bother! No search results were found here!"
|
| 4010 |
+
msgstr ""
|
| 4011 |
+
|
| 4012 |
#: templates/default/bbpress/feedback-no-topics.php:13
|
| 4013 |
msgid "Oh bother! No topics were found here!"
|
| 4014 |
msgstr ""
|
| 4071 |
msgstr ""
|
| 4072 |
|
| 4073 |
#: templates/default/bbpress/form-forum.php:149
|
| 4074 |
+
#: templates/default/bbpress/form-reply-move.php:73
|
| 4075 |
+
#: templates/default/bbpress/form-reply.php:145
|
| 4076 |
#: templates/default/bbpress/form-topic-merge.php:94
|
| 4077 |
#: templates/default/bbpress/form-topic-split.php:98
|
| 4078 |
#: templates/default/bbpress/form-topic.php:198
|
| 4095 |
msgid "Protected"
|
| 4096 |
msgstr ""
|
| 4097 |
|
| 4098 |
+
#: templates/default/bbpress/form-reply-move.php:24
|
| 4099 |
+
msgid "Move reply \"%s\""
|
| 4100 |
+
msgstr ""
|
| 4101 |
+
|
| 4102 |
+
#: templates/default/bbpress/form-reply-move.php:29
|
| 4103 |
+
msgid ""
|
| 4104 |
+
"You can either make this reply a new topic with a new title, or merge it "
|
| 4105 |
+
"into an existing topic."
|
| 4106 |
+
msgstr ""
|
| 4107 |
+
|
| 4108 |
+
#: templates/default/bbpress/form-reply-move.php:33
|
| 4109 |
+
msgid ""
|
| 4110 |
+
"If you choose an existing topic, replies will be ordered by the time and "
|
| 4111 |
+
"date they were created."
|
| 4112 |
+
msgstr ""
|
| 4113 |
+
|
| 4114 |
+
#: templates/default/bbpress/form-reply-move.php:37
|
| 4115 |
+
msgid "Move Method"
|
| 4116 |
+
msgstr ""
|
| 4117 |
+
|
| 4118 |
+
#: templates/default/bbpress/form-reply-move.php:41
|
| 4119 |
+
#: templates/default/bbpress/form-topic-split.php:41
|
| 4120 |
+
msgid "New topic in <strong>%s</strong> titled:"
|
| 4121 |
+
msgstr ""
|
| 4122 |
+
|
| 4123 |
+
#: templates/default/bbpress/form-reply-move.php:42
|
| 4124 |
+
msgid "Moved: %s"
|
| 4125 |
+
msgstr ""
|
| 4126 |
+
|
| 4127 |
+
#: templates/default/bbpress/form-reply-move.php:49
|
| 4128 |
+
#: templates/default/bbpress/form-topic-split.php:49
|
| 4129 |
+
msgid "Use an existing topic in this forum:"
|
| 4130 |
+
msgstr ""
|
| 4131 |
+
|
| 4132 |
+
#: templates/default/bbpress/form-reply-move.php:58
|
| 4133 |
+
#: templates/default/bbpress/form-topic-split.php:58
|
| 4134 |
+
msgid "No other topics found!"
|
| 4135 |
+
msgstr ""
|
| 4136 |
+
|
| 4137 |
+
#: templates/default/bbpress/form-reply-move.php:69
|
| 4138 |
+
#: templates/default/bbpress/form-topic-merge.php:90
|
| 4139 |
+
#: templates/default/bbpress/form-topic-split.php:94
|
| 4140 |
+
msgid "<strong>WARNING:</strong> This process cannot be undone."
|
| 4141 |
+
msgstr ""
|
| 4142 |
+
|
| 4143 |
+
#: templates/default/bbpress/form-reply-move.php:86
|
| 4144 |
+
msgid "You do not have the permissions to edit this reply!"
|
| 4145 |
+
msgstr ""
|
| 4146 |
+
|
| 4147 |
+
#: templates/default/bbpress/form-reply-move.php:86
|
| 4148 |
+
msgid "You cannot edit this reply."
|
| 4149 |
+
msgstr ""
|
| 4150 |
+
|
| 4151 |
#: templates/default/bbpress/form-reply.php:36
|
| 4152 |
msgid ""
|
| 4153 |
"This topic is marked as closed to new replies, however your posting "
|
| 4188 |
msgid "Optional reason for editing:"
|
| 4189 |
msgstr ""
|
| 4190 |
|
| 4191 |
+
#: templates/default/bbpress/form-reply.php:168
|
| 4192 |
msgid "The topic ‘%s’ is closed to new replies."
|
| 4193 |
msgstr ""
|
| 4194 |
|
| 4195 |
+
#: templates/default/bbpress/form-reply.php:176
|
| 4196 |
#: templates/default/bbpress/form-topic.php:221
|
| 4197 |
msgid "The forum ‘%s’ is closed to new topics and replies."
|
| 4198 |
msgstr ""
|
| 4199 |
|
| 4200 |
+
#: templates/default/bbpress/form-reply.php:184
|
| 4201 |
msgid "You cannot reply to this topic."
|
| 4202 |
msgstr ""
|
| 4203 |
|
| 4204 |
+
#: templates/default/bbpress/form-reply.php:184
|
| 4205 |
msgid "You must be logged in to reply to this topic."
|
| 4206 |
msgstr ""
|
| 4207 |
|
| 4208 |
+
#: templates/default/bbpress/form-search.php:14
|
| 4209 |
+
msgid "Search for:"
|
| 4210 |
+
msgstr ""
|
| 4211 |
+
|
| 4212 |
#: templates/default/bbpress/form-topic-merge.php:24
|
| 4213 |
msgid "Merge topic \"%s\""
|
| 4214 |
msgstr ""
|
| 4266 |
msgid "Merge topic tags"
|
| 4267 |
msgstr ""
|
| 4268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4269 |
#: templates/default/bbpress/form-topic-merge.php:107
|
| 4270 |
#: templates/default/bbpress/form-topic-split.php:111
|
| 4271 |
msgid "You do not have the permissions to edit this topic!"
|
| 4298 |
msgid "Split Method"
|
| 4299 |
msgstr ""
|
| 4300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4301 |
#: templates/default/bbpress/form-topic-split.php:42
|
| 4302 |
msgid "Split: %s"
|
| 4303 |
msgstr ""
|
| 4304 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4305 |
#: templates/default/bbpress/form-topic-split.php:76
|
| 4306 |
msgid "Copy subscribers to the new topic"
|
| 4307 |
msgstr ""
|
| 4436 |
msgid "Biographical Info"
|
| 4437 |
msgstr ""
|
| 4438 |
|
| 4439 |
+
#: templates/default/bbpress/form-user-edit.php:90
|
| 4440 |
+
#: templates/default/bbpress/form-user-edit.php:93
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4441 |
msgid "Account"
|
| 4442 |
msgstr ""
|
| 4443 |
|
| 4444 |
+
#: templates/default/bbpress/form-user-edit.php:115
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4445 |
msgid ""
|
| 4446 |
"There is a pending email address change to <code>%1$s</code>. <a href=\"%2$s"
|
| 4447 |
"\">Cancel</a>"
|
| 4448 |
msgstr ""
|
| 4449 |
|
| 4450 |
+
#: templates/default/bbpress/form-user-edit.php:124
|
| 4451 |
msgid "New Password"
|
| 4452 |
msgstr ""
|
| 4453 |
|
| 4454 |
+
#: templates/default/bbpress/form-user-edit.php:127
|
| 4455 |
msgid ""
|
| 4456 |
"If you would like to change the password type a new one. Otherwise leave "
|
| 4457 |
"this blank."
|
| 4458 |
msgstr ""
|
| 4459 |
|
| 4460 |
+
#: templates/default/bbpress/form-user-edit.php:130
|
| 4461 |
msgid "Type your new password again."
|
| 4462 |
msgstr ""
|
| 4463 |
|
| 4464 |
+
#: templates/default/bbpress/form-user-edit.php:133
|
| 4465 |
msgid ""
|
| 4466 |
"Your password should be at least ten characters long. Use upper and lower "
|
| 4467 |
"case letters, numbers, and symbols to make it even stronger."
|
| 4468 |
msgstr ""
|
| 4469 |
|
| 4470 |
+
#: templates/default/bbpress/form-user-edit.php:143
|
| 4471 |
+
#: templates/default/bbpress/form-user-edit.php:146
|
| 4472 |
msgid "User Role"
|
| 4473 |
msgstr ""
|
| 4474 |
|
| 4475 |
+
#: templates/default/bbpress/form-user-edit.php:153
|
| 4476 |
msgid "Network Role"
|
| 4477 |
msgstr ""
|
| 4478 |
|
| 4479 |
+
#: templates/default/bbpress/form-user-edit.php:156
|
| 4480 |
msgid "Grant this user super admin privileges for the Network."
|
| 4481 |
msgstr ""
|
| 4482 |
|
| 4483 |
+
#: templates/default/bbpress/form-user-edit.php:178
|
| 4484 |
msgid "Update Profile"
|
| 4485 |
msgstr ""
|
| 4486 |
|
| 4487 |
+
#: templates/default/bbpress/form-user-edit.php:178
|
| 4488 |
msgid "Update User"
|
| 4489 |
msgstr ""
|
| 4490 |
|
| 4518 |
msgid "Blog Role"
|
| 4519 |
msgstr ""
|
| 4520 |
|
| 4521 |
+
#: templates/default/bbpress/loop-search-forum.php:16
|
| 4522 |
+
msgid "Last updated %s"
|
| 4523 |
+
msgstr ""
|
| 4524 |
+
|
| 4525 |
+
#: templates/default/bbpress/loop-search-forum.php:26
|
| 4526 |
+
msgid "Forum: "
|
| 4527 |
+
msgstr ""
|
| 4528 |
+
|
| 4529 |
+
#: templates/default/bbpress/loop-search-reply.php:30
|
| 4530 |
+
msgid "In reply to: "
|
| 4531 |
+
msgstr ""
|
| 4532 |
+
|
| 4533 |
+
#: templates/default/bbpress/loop-search-topic.php:32
|
| 4534 |
+
msgid "Topic: "
|
| 4535 |
+
msgstr ""
|
| 4536 |
+
|
| 4537 |
+
#: templates/default/bbpress/loop-search-topic.php:39
|
| 4538 |
+
msgid "in group forum "
|
| 4539 |
+
msgstr ""
|
| 4540 |
+
|
| 4541 |
+
#: templates/default/bbpress/loop-search-topic.php:43
|
| 4542 |
+
msgid "in forum "
|
| 4543 |
+
msgstr ""
|
| 4544 |
+
|
| 4545 |
+
#: templates/default/bbpress/loop-search.php:22
|
| 4546 |
+
#: templates/default/bbpress/loop-search.php:44
|
| 4547 |
+
msgid "Search Results"
|
| 4548 |
+
msgstr ""
|
| 4549 |
+
|
| 4550 |
#: templates/default/bbpress/loop-single-reply.php:21
|
| 4551 |
msgid "in reply to: "
|
| 4552 |
msgstr ""
|
| 4553 |
|
| 4554 |
+
#: templates/default/bbpress/loop-single-topic.php:60
|
| 4555 |
msgid "Started by: %1$s"
|
| 4556 |
msgstr ""
|
| 4557 |
|
| 4558 |
+
#: templates/default/bbpress/loop-single-topic.php:68
|
| 4559 |
msgid "in: <a href=\"%1$s\">%2$s</a>"
|
| 4560 |
msgstr ""
|
| 4561 |
|
| 4644 |
msgid "This user has not created any topics."
|
| 4645 |
msgstr ""
|
| 4646 |
|
| 4647 |
+
#: templates/default/bbpress-functions.php:294
|
| 4648 |
+
msgid "Something went wrong. Refresh your browser and try again."
|
| 4649 |
msgstr ""
|
| 4650 |
|
| 4651 |
+
#: templates/default/bbpress-functions.php:319
|
| 4652 |
+
msgid "Favorites are no longer active."
|
| 4653 |
msgstr ""
|
| 4654 |
|
| 4655 |
+
#: templates/default/bbpress-functions.php:324
|
| 4656 |
+
msgid "Please login to make this topic a favorite."
|
| 4657 |
msgstr ""
|
| 4658 |
|
| 4659 |
+
#: templates/default/bbpress-functions.php:333
|
| 4660 |
+
#: templates/default/bbpress-functions.php:400
|
| 4661 |
+
msgid "You do not have permission to do this."
|
| 4662 |
msgstr ""
|
| 4663 |
|
| 4664 |
+
#: templates/default/bbpress-functions.php:341
|
| 4665 |
+
#: templates/default/bbpress-functions.php:408
|
| 4666 |
+
msgid "The topic could not be found."
|
| 4667 |
msgstr ""
|
| 4668 |
|
| 4669 |
+
#: templates/default/bbpress-functions.php:346
|
| 4670 |
+
#: templates/default/bbpress-functions.php:413
|
| 4671 |
+
msgid "Are you sure you meant to do that?"
|
| 4672 |
msgstr ""
|
| 4673 |
|
| 4674 |
+
#: templates/default/bbpress-functions.php:354
|
| 4675 |
+
#: templates/default/bbpress-functions.php:421
|
| 4676 |
+
msgid "The request was unsuccessful. Please try again."
|
| 4677 |
msgstr ""
|
| 4678 |
|
| 4679 |
+
#: templates/default/bbpress-functions.php:386
|
| 4680 |
+
msgid "Subscriptions are no longer active."
|
| 4681 |
msgstr ""
|
| 4682 |
|
| 4683 |
+
#: templates/default/bbpress-functions.php:391
|
| 4684 |
+
msgid "Please login to subscribe to this topic."
|
| 4685 |
+
msgstr ""
|
| 4686 |
+
|
| 4687 |
+
#: templates/default/extras/page-forum-statistics.php:22
|
| 4688 |
+
msgid "<p>Here are the statistics and popular topics of our forums.</p>"
|
| 4689 |
msgstr ""
|
| 4690 |
|
| 4691 |
#: templates/default/extras/page-topic-tags.php:22
|
| 4697 |
msgid "bbPress"
|
| 4698 |
msgstr ""
|
| 4699 |
|
| 4700 |
+
#. #-#-#-#-# plugin.pot (bbPress 2.3-beta1) #-#-#-#-#
|
| 4701 |
#. Plugin URI of the plugin/theme
|
| 4702 |
+
#. #-#-#-#-# plugin.pot (bbPress 2.3-beta1) #-#-#-#-#
|
| 4703 |
#. Author URI of the plugin/theme
|
| 4704 |
msgid "http://bbpress.org"
|
| 4705 |
msgstr ""
|
readme.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
=== bbPress ===
|
| 2 |
-
Contributors: matt, johnjamesjacoby
|
| 3 |
Tags: forums, discussion, support, theme, akismet, multisite
|
| 4 |
-
Requires at least: 3.
|
| 5 |
Tested up to: 3.5
|
| 6 |
Stable tag: 2.2.4
|
| 7 |
License: GPLv2 or later
|
| 1 |
=== bbPress ===
|
| 2 |
+
Contributors: matt, johnjamesjacoby, jmdodd
|
| 3 |
Tags: forums, discussion, support, theme, akismet, multisite
|
| 4 |
+
Requires at least: 3.5
|
| 5 |
Tested up to: 3.5
|
| 6 |
Stable tag: 2.2.4
|
| 7 |
License: GPLv2 or later
|
templates/default/bbpress-functions.php
CHANGED
|
@@ -84,12 +84,12 @@ class BBP_Default extends BBP_Theme_Compat {
|
|
| 84 |
|
| 85 |
/** Scripts ***********************************************************/
|
| 86 |
|
| 87 |
-
add_action( 'bbp_enqueue_scripts',
|
| 88 |
-
add_action( 'bbp_enqueue_scripts',
|
| 89 |
-
add_filter( 'bbp_enqueue_scripts',
|
| 90 |
-
add_action( 'bbp_head',
|
| 91 |
-
add_action( '
|
| 92 |
-
add_action( '
|
| 93 |
|
| 94 |
/** Template Wrappers *************************************************/
|
| 95 |
|
|
@@ -174,11 +174,20 @@ class BBP_Default extends BBP_Theme_Compat {
|
|
| 174 |
*/
|
| 175 |
public function enqueue_scripts() {
|
| 176 |
|
| 177 |
-
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
|
| 180 |
-
|
|
|
|
| 181 |
wp_enqueue_script( 'user-profile' );
|
|
|
|
| 182 |
}
|
| 183 |
|
| 184 |
/**
|
|
@@ -191,17 +200,65 @@ class BBP_Default extends BBP_Theme_Compat {
|
|
| 191 |
* @uses bbp_is_single_user_edit() To check if it's the profile edit page
|
| 192 |
*/
|
| 193 |
public function head_scripts() {
|
| 194 |
-
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
<script type="text/javascript">
|
| 197 |
/* <![CDATA[ */
|
| 198 |
-
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
|
| 199 |
-
|
| 200 |
<?php if ( bbp_is_single_user_edit() ) : ?>
|
| 201 |
if ( window.location.hash == '#password' ) {
|
| 202 |
document.getElementById('pass1').focus();
|
| 203 |
}
|
| 204 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
/* ]]> */
|
| 206 |
</script>
|
| 207 |
|
|
@@ -232,88 +289,83 @@ class BBP_Default extends BBP_Theme_Compat {
|
|
| 232 |
if ( !bbp_is_single_topic() )
|
| 233 |
return;
|
| 234 |
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
'currentUserId' => $user_id,
|
| 243 |
-
'topicId' => bbp_get_topic_id(),
|
| 244 |
-
);
|
| 245 |
-
|
| 246 |
-
// Favorites
|
| 247 |
-
if ( bbp_is_favorites_active() ) {
|
| 248 |
-
$localizations['favoritesActive'] = 1;
|
| 249 |
-
$localizations['favoritesLink'] = bbp_get_favorites_permalink( $user_id );
|
| 250 |
-
$localizations['isFav'] = (int) bbp_is_user_favorite( $user_id );
|
| 251 |
-
$localizations['favLinkYes'] = __( 'favorites', 'bbpress' );
|
| 252 |
-
$localizations['favLinkNo'] = __( '?', 'bbpress' );
|
| 253 |
-
$localizations['favYes'] = __( 'This topic is one of your %favLinkYes% [%favDel%]', 'bbpress' );
|
| 254 |
-
$localizations['favNo'] = __( '%favAdd% (%favLinkNo%)', 'bbpress' );
|
| 255 |
-
$localizations['favDel'] = __( '×', 'bbpress' );
|
| 256 |
-
$localizations['favAdd'] = __( 'Add this topic to your favorites', 'bbpress' );
|
| 257 |
-
} else {
|
| 258 |
-
$localizations['favoritesActive'] = 0;
|
| 259 |
-
}
|
| 260 |
-
|
| 261 |
-
// Subscriptions
|
| 262 |
-
if ( bbp_is_subscriptions_active() ) {
|
| 263 |
-
$localizations['subsActive'] = 1;
|
| 264 |
-
$localizations['isSubscribed'] = (int) bbp_is_user_subscribed( $user_id );
|
| 265 |
-
$localizations['subsSub'] = __( 'Subscribe', 'bbpress' );
|
| 266 |
-
$localizations['subsUns'] = __( 'Unsubscribe', 'bbpress' );
|
| 267 |
-
$localizations['subsLink'] = bbp_get_topic_permalink();
|
| 268 |
-
} else {
|
| 269 |
-
$localizations['subsActive'] = 0;
|
| 270 |
-
}
|
| 271 |
-
|
| 272 |
-
wp_localize_script( 'bbpress-topic', 'bbpTopicJS', $localizations );
|
| 273 |
}
|
| 274 |
|
| 275 |
/**
|
| 276 |
-
*
|
| 277 |
*
|
| 278 |
* @since bbPress (r3732)
|
| 279 |
*
|
| 280 |
* @uses bbp_get_current_user_id() To get the current user id
|
| 281 |
* @uses current_user_can() To check if the current user can edit the user
|
| 282 |
* @uses bbp_get_topic() To get the topic
|
| 283 |
-
* @uses
|
| 284 |
* @uses bbp_is_user_favorite() To check if the topic is user's favorite
|
| 285 |
* @uses bbp_remove_user_favorite() To remove the topic from user's favorites
|
| 286 |
* @uses bbp_add_user_favorite() To add the topic from user's favorites
|
|
|
|
| 287 |
*/
|
| 288 |
public function ajax_favorite() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 289 |
$user_id = bbp_get_current_user_id();
|
| 290 |
-
$id = intval( $_POST['id'] );
|
| 291 |
|
| 292 |
-
if
|
| 293 |
-
|
|
|
|
|
|
|
| 294 |
|
|
|
|
| 295 |
$topic = bbp_get_topic( $id );
|
| 296 |
|
| 297 |
-
|
| 298 |
-
|
|
|
|
|
|
|
| 299 |
|
| 300 |
-
|
|
|
|
|
|
|
|
|
|
| 301 |
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
die( '1' );
|
| 309 |
-
}
|
| 310 |
}
|
| 311 |
|
| 312 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
}
|
| 314 |
|
| 315 |
/**
|
| 316 |
-
* Subscribe/Unsubscribe a user from a topic
|
| 317 |
*
|
| 318 |
* @since bbPress (r3732)
|
| 319 |
*
|
|
@@ -321,41 +373,62 @@ class BBP_Default extends BBP_Theme_Compat {
|
|
| 321 |
* @uses bbp_get_current_user_id() To get the current user id
|
| 322 |
* @uses current_user_can() To check if the current user can edit the user
|
| 323 |
* @uses bbp_get_topic() To get the topic
|
| 324 |
-
* @uses
|
| 325 |
-
* @uses bbp_is_user_subscribed() To check if the topic is in user's
|
| 326 |
-
*
|
| 327 |
-
* @uses bbp_remove_user_subscriptions() To remove the topic from user's
|
| 328 |
-
* subscriptions
|
| 329 |
* @uses bbp_add_user_subscriptions() To add the topic from user's subscriptions
|
|
|
|
| 330 |
*/
|
| 331 |
public function ajax_subscription() {
|
| 332 |
-
if ( !bbp_is_subscriptions_active() )
|
| 333 |
-
return;
|
| 334 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 335 |
$user_id = bbp_get_current_user_id();
|
| 336 |
$id = intval( $_POST['id'] );
|
| 337 |
|
| 338 |
-
if
|
| 339 |
-
|
|
|
|
|
|
|
| 340 |
|
|
|
|
| 341 |
$topic = bbp_get_topic( $id );
|
| 342 |
|
| 343 |
-
|
| 344 |
-
|
|
|
|
|
|
|
| 345 |
|
| 346 |
-
|
|
|
|
|
|
|
|
|
|
| 347 |
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
die( '1' );
|
| 355 |
-
}
|
| 356 |
}
|
| 357 |
|
| 358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
}
|
| 360 |
}
|
| 361 |
new BBP_Default();
|
| 84 |
|
| 85 |
/** Scripts ***********************************************************/
|
| 86 |
|
| 87 |
+
add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS
|
| 88 |
+
add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS
|
| 89 |
+
add_filter( 'bbp_enqueue_scripts', array( $this, 'localize_topic_script' ) ); // Enqueue theme script localization
|
| 90 |
+
add_action( 'bbp_head', array( $this, 'head_scripts' ) ); // Output some extra JS in the <head>
|
| 91 |
+
add_action( 'bbp_ajax_favorite', array( $this, 'ajax_favorite' ) ); // Handles the ajax favorite/unfavorite
|
| 92 |
+
add_action( 'bbp_ajax_subscription', array( $this, 'ajax_subscription' ) ); // Handles the ajax subscribe/unsubscribe
|
| 93 |
|
| 94 |
/** Template Wrappers *************************************************/
|
| 95 |
|
| 174 |
*/
|
| 175 |
public function enqueue_scripts() {
|
| 176 |
|
| 177 |
+
// Always pull in jQuery for TinyMCE shortcode usage
|
| 178 |
+
if ( bbp_use_wp_editor() ) {
|
| 179 |
+
wp_enqueue_script( 'jquery' );
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
// Topic favorite/subscribe
|
| 183 |
+
if ( bbp_is_single_topic() ) {
|
| 184 |
+
wp_enqueue_script( 'bbpress-topic', $this->url . 'js/topic.js', array( 'jquery' ), $this->version );
|
| 185 |
+
}
|
| 186 |
|
| 187 |
+
// User Profile edit
|
| 188 |
+
if ( bbp_is_single_user_edit() ) {
|
| 189 |
wp_enqueue_script( 'user-profile' );
|
| 190 |
+
}
|
| 191 |
}
|
| 192 |
|
| 193 |
/**
|
| 200 |
* @uses bbp_is_single_user_edit() To check if it's the profile edit page
|
| 201 |
*/
|
| 202 |
public function head_scripts() {
|
| 203 |
+
|
| 204 |
+
// Bail if no extra JS is needed
|
| 205 |
+
if ( ! bbp_is_single_user_edit() && ! bbp_use_wp_editor() )
|
| 206 |
+
return; ?>
|
| 207 |
|
| 208 |
<script type="text/javascript">
|
| 209 |
/* <![CDATA[ */
|
|
|
|
|
|
|
| 210 |
<?php if ( bbp_is_single_user_edit() ) : ?>
|
| 211 |
if ( window.location.hash == '#password' ) {
|
| 212 |
document.getElementById('pass1').focus();
|
| 213 |
}
|
| 214 |
<?php endif; ?>
|
| 215 |
+
|
| 216 |
+
<?php if ( bbp_use_wp_editor() ) : ?>
|
| 217 |
+
jQuery(document).ready( function() {
|
| 218 |
+
|
| 219 |
+
/* Tab from topic title */
|
| 220 |
+
jQuery( '#bbp_topic_title' ).bind( 'keydown.editor-focus', function(e) {
|
| 221 |
+
if ( e.which != 9 )
|
| 222 |
+
return;
|
| 223 |
+
|
| 224 |
+
if ( !e.ctrlKey && !e.altKey && !e.shiftKey ) {
|
| 225 |
+
if ( typeof( tinymce ) != 'undefined' ) {
|
| 226 |
+
if ( ! tinymce.activeEditor.isHidden() ) {
|
| 227 |
+
var editor = tinymce.activeEditor.editorContainer;
|
| 228 |
+
jQuery( '#' + editor + ' td.mceToolbar > a' ).focus();
|
| 229 |
+
} else {
|
| 230 |
+
jQuery( 'textarea.bbp-the-content' ).focus();
|
| 231 |
+
}
|
| 232 |
+
} else {
|
| 233 |
+
jQuery( 'textarea.bbp-the-content' ).focus();
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
e.preventDefault();
|
| 237 |
+
}
|
| 238 |
+
});
|
| 239 |
+
|
| 240 |
+
/* Shift + tab from topic tags */
|
| 241 |
+
jQuery( '#bbp_topic_tags' ).bind( 'keydown.editor-focus', function(e) {
|
| 242 |
+
if ( e.which != 9 )
|
| 243 |
+
return;
|
| 244 |
+
|
| 245 |
+
if ( e.shiftKey && !e.ctrlKey && !e.altKey ) {
|
| 246 |
+
if ( typeof( tinymce ) != 'undefined' ) {
|
| 247 |
+
if ( ! tinymce.activeEditor.isHidden() ) {
|
| 248 |
+
var editor = tinymce.activeEditor.editorContainer;
|
| 249 |
+
jQuery( '#' + editor + ' td.mceToolbar > a' ).focus();
|
| 250 |
+
} else {
|
| 251 |
+
jQuery( 'textarea.bbp-the-content' ).focus();
|
| 252 |
+
}
|
| 253 |
+
} else {
|
| 254 |
+
jQuery( 'textarea.bbp-the-content' ).focus();
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
e.preventDefault();
|
| 258 |
+
}
|
| 259 |
+
});
|
| 260 |
+
});
|
| 261 |
+
<?php endif; ?>
|
| 262 |
/* ]]> */
|
| 263 |
</script>
|
| 264 |
|
| 289 |
if ( !bbp_is_single_topic() )
|
| 290 |
return;
|
| 291 |
|
| 292 |
+
wp_localize_script( 'bbpress-topic', 'bbpTopicJS', array(
|
| 293 |
+
'bbp_ajaxurl' => bbp_get_ajax_url(),
|
| 294 |
+
'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ),
|
| 295 |
+
'is_user_logged_in' => is_user_logged_in(),
|
| 296 |
+
'fav_nonce' => wp_create_nonce( 'toggle-favorite_' . get_the_ID() ),
|
| 297 |
+
'subs_nonce' => wp_create_nonce( 'toggle-subscription_' . get_the_ID() )
|
| 298 |
+
) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 299 |
}
|
| 300 |
|
| 301 |
/**
|
| 302 |
+
* AJAX handler to add or remove a topic from a user's favorites
|
| 303 |
*
|
| 304 |
* @since bbPress (r3732)
|
| 305 |
*
|
| 306 |
* @uses bbp_get_current_user_id() To get the current user id
|
| 307 |
* @uses current_user_can() To check if the current user can edit the user
|
| 308 |
* @uses bbp_get_topic() To get the topic
|
| 309 |
+
* @uses wp_verify_nonce() To verify the nonce & check the referer
|
| 310 |
* @uses bbp_is_user_favorite() To check if the topic is user's favorite
|
| 311 |
* @uses bbp_remove_user_favorite() To remove the topic from user's favorites
|
| 312 |
* @uses bbp_add_user_favorite() To add the topic from user's favorites
|
| 313 |
+
* @uses bbp_ajax_response() To return JSON
|
| 314 |
*/
|
| 315 |
public function ajax_favorite() {
|
| 316 |
+
|
| 317 |
+
// Bail if favorites are not active
|
| 318 |
+
if ( ! bbp_is_favorites_active() ) {
|
| 319 |
+
bbp_ajax_response( false, __( 'Favorites are no longer active.', 'bbpress' ), 300 );
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
// Bail if user is not logged in
|
| 323 |
+
if ( !is_user_logged_in() ) {
|
| 324 |
+
bbp_ajax_response( false, __( 'Please login to make this topic a favorite.', 'bbpress' ), 301 );
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
// Get user and topic data
|
| 328 |
$user_id = bbp_get_current_user_id();
|
| 329 |
+
$id = !empty( $_POST['id'] ) ? intval( $_POST['id'] ) : 0;
|
| 330 |
|
| 331 |
+
// Bail if user cannot add favorites for this user
|
| 332 |
+
if ( !current_user_can( 'edit_user', $user_id ) ) {
|
| 333 |
+
bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );
|
| 334 |
+
}
|
| 335 |
|
| 336 |
+
// Get the topic
|
| 337 |
$topic = bbp_get_topic( $id );
|
| 338 |
|
| 339 |
+
// Bail if topic cannot be found
|
| 340 |
+
if ( empty( $topic ) ) {
|
| 341 |
+
bbp_ajax_response( false, __( 'The topic could not be found.', 'bbpress' ), 303 );
|
| 342 |
+
}
|
| 343 |
|
| 344 |
+
// Bail if user did not take this action
|
| 345 |
+
if ( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'toggle-favorite_' . $topic->ID ) ) {
|
| 346 |
+
bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
|
| 347 |
+
}
|
| 348 |
|
| 349 |
+
// Take action
|
| 350 |
+
$status = bbp_is_user_favorite( $user_id, $topic->ID ) ? bbp_remove_user_favorite( $user_id, $topic->ID ) : bbp_add_user_favorite( $user_id, $topic->ID );
|
| 351 |
+
|
| 352 |
+
// Bail if action failed
|
| 353 |
+
if ( empty( $status ) ) {
|
| 354 |
+
bbp_ajax_response( false, __( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );
|
|
|
|
|
|
|
| 355 |
}
|
| 356 |
|
| 357 |
+
// Put subscription attributes in convenient array
|
| 358 |
+
$attrs = array(
|
| 359 |
+
'topic_id' => $topic->ID,
|
| 360 |
+
'user_id' => $user_id
|
| 361 |
+
);
|
| 362 |
+
|
| 363 |
+
// Action succeeded
|
| 364 |
+
bbp_ajax_response( true, bbp_get_user_favorites_link( $attrs, $user_id, false ), 200 );
|
| 365 |
}
|
| 366 |
|
| 367 |
/**
|
| 368 |
+
* AJAX handler to Subscribe/Unsubscribe a user from a topic
|
| 369 |
*
|
| 370 |
* @since bbPress (r3732)
|
| 371 |
*
|
| 373 |
* @uses bbp_get_current_user_id() To get the current user id
|
| 374 |
* @uses current_user_can() To check if the current user can edit the user
|
| 375 |
* @uses bbp_get_topic() To get the topic
|
| 376 |
+
* @uses wp_verify_nonce() To verify the nonce
|
| 377 |
+
* @uses bbp_is_user_subscribed() To check if the topic is in user's subscriptions
|
| 378 |
+
* @uses bbp_remove_user_subscriptions() To remove the topic from user's subscriptions
|
|
|
|
|
|
|
| 379 |
* @uses bbp_add_user_subscriptions() To add the topic from user's subscriptions
|
| 380 |
+
* @uses bbp_ajax_response() To return JSON
|
| 381 |
*/
|
| 382 |
public function ajax_subscription() {
|
|
|
|
|
|
|
| 383 |
|
| 384 |
+
// Bail if subscriptions are not active
|
| 385 |
+
if ( !bbp_is_subscriptions_active() ) {
|
| 386 |
+
bbp_ajax_response( false, __( 'Subscriptions are no longer active.', 'bbpress' ), 300 );
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
// Bail if user is not logged in
|
| 390 |
+
if ( !is_user_logged_in() ) {
|
| 391 |
+
bbp_ajax_response( false, __( 'Please login to subscribe to this topic.', 'bbpress' ), 301 );
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
// Get user and topic data
|
| 395 |
$user_id = bbp_get_current_user_id();
|
| 396 |
$id = intval( $_POST['id'] );
|
| 397 |
|
| 398 |
+
// Bail if user cannot add favorites for this user
|
| 399 |
+
if ( !current_user_can( 'edit_user', $user_id ) ) {
|
| 400 |
+
bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );
|
| 401 |
+
}
|
| 402 |
|
| 403 |
+
// Get the topic
|
| 404 |
$topic = bbp_get_topic( $id );
|
| 405 |
|
| 406 |
+
// Bail if topic cannot be found
|
| 407 |
+
if ( empty( $topic ) ) {
|
| 408 |
+
bbp_ajax_response( false, __( 'The topic could not be found.', 'bbpress' ), 303 );
|
| 409 |
+
}
|
| 410 |
|
| 411 |
+
// Bail if user did not take this action
|
| 412 |
+
if ( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $topic->ID ) ) {
|
| 413 |
+
bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
|
| 414 |
+
}
|
| 415 |
|
| 416 |
+
// Take action
|
| 417 |
+
$status = bbp_is_user_subscribed( $user_id, $topic->ID ) ? bbp_remove_user_subscription( $user_id, $topic->ID ) : bbp_add_user_subscription( $user_id, $topic->ID );
|
| 418 |
+
|
| 419 |
+
// Bail if action failed
|
| 420 |
+
if ( empty( $status ) ) {
|
| 421 |
+
bbp_ajax_response( false, __( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );
|
|
|
|
|
|
|
| 422 |
}
|
| 423 |
|
| 424 |
+
// Put subscription attributes in convenient array
|
| 425 |
+
$attrs = array(
|
| 426 |
+
'topic_id' => $topic->ID,
|
| 427 |
+
'user_id' => $user_id
|
| 428 |
+
);
|
| 429 |
+
|
| 430 |
+
// Action succeeded
|
| 431 |
+
bbp_ajax_response( true, bbp_get_user_subscribe_link( $attrs, $user_id, false ), 200 );
|
| 432 |
}
|
| 433 |
}
|
| 434 |
new BBP_Default();
|
templates/default/bbpress/content-archive-forum.php
CHANGED
|
@@ -11,6 +11,12 @@
|
|
| 11 |
|
| 12 |
<div id="bbpress-forums">
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
<?php bbp_breadcrumb(); ?>
|
| 15 |
|
| 16 |
<?php do_action( 'bbp_template_before_forums_index' ); ?>
|
| 11 |
|
| 12 |
<div id="bbpress-forums">
|
| 13 |
|
| 14 |
+
<div class="bbp-search-form">
|
| 15 |
+
|
| 16 |
+
<?php bbp_get_template_part( 'form', 'search' ); ?>
|
| 17 |
+
|
| 18 |
+
</div>
|
| 19 |
+
|
| 20 |
<?php bbp_breadcrumb(); ?>
|
| 21 |
|
| 22 |
<?php do_action( 'bbp_template_before_forums_index' ); ?>
|
templates/default/bbpress/content-search.php
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Search Content Part
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<div id="bbpress-forums">
|
| 13 |
+
|
| 14 |
+
<?php bbp_breadcrumb(); ?>
|
| 15 |
+
|
| 16 |
+
<?php bbp_set_query_name( 'bbp_search' ); ?>
|
| 17 |
+
|
| 18 |
+
<?php do_action( 'bbp_template_before_search' ); ?>
|
| 19 |
+
|
| 20 |
+
<?php if ( bbp_has_search_results() ) : ?>
|
| 21 |
+
|
| 22 |
+
<?php bbp_get_template_part( 'pagination', 'search' ); ?>
|
| 23 |
+
|
| 24 |
+
<?php bbp_get_template_part( 'loop', 'search' ); ?>
|
| 25 |
+
|
| 26 |
+
<?php bbp_get_template_part( 'pagination', 'search' ); ?>
|
| 27 |
+
|
| 28 |
+
<?php elseif ( bbp_get_search_terms() ) : ?>
|
| 29 |
+
|
| 30 |
+
<?php bbp_get_template_part( 'feedback', 'no-search' ); ?>
|
| 31 |
+
|
| 32 |
+
<?php else : ?>
|
| 33 |
+
|
| 34 |
+
<?php bbp_get_template_part( 'form', 'search' ); ?>
|
| 35 |
+
|
| 36 |
+
<?php endif; ?>
|
| 37 |
+
|
| 38 |
+
<?php do_action( 'bbp_template_after_search_results' ); ?>
|
| 39 |
+
|
| 40 |
+
</div>
|
| 41 |
+
|
templates/default/bbpress/content-single-forum.php
CHANGED
|
@@ -23,7 +23,7 @@
|
|
| 23 |
|
| 24 |
<?php bbp_single_forum_description(); ?>
|
| 25 |
|
| 26 |
-
<?php if (
|
| 27 |
|
| 28 |
<?php bbp_get_template_part( 'loop', 'forums' ); ?>
|
| 29 |
|
| 23 |
|
| 24 |
<?php bbp_single_forum_description(); ?>
|
| 25 |
|
| 26 |
+
<?php if ( bbp_has_forums() ) : ?>
|
| 27 |
|
| 28 |
<?php bbp_get_template_part( 'loop', 'forums' ); ?>
|
| 29 |
|
templates/default/bbpress/content-statistics.php
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Template Name: bbPress - Statistics
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
// Get the statistics
|
| 11 |
+
$stats = bbp_get_statistics(); ?>
|
| 12 |
+
|
| 13 |
+
<dl role="main">
|
| 14 |
+
|
| 15 |
+
<?php do_action( 'bbp_before_statistics' ); ?>
|
| 16 |
+
|
| 17 |
+
<dt><?php _e( 'Registered Users', 'bbpress' ); ?></dt>
|
| 18 |
+
<dd>
|
| 19 |
+
<strong><?php echo esc_html( $stats['user_count'] ); ?></strong>
|
| 20 |
+
</dd>
|
| 21 |
+
|
| 22 |
+
<dt><?php _e( 'Forums', 'bbpress' ); ?></dt>
|
| 23 |
+
<dd>
|
| 24 |
+
<strong><?php echo esc_html( $stats['forum_count'] ); ?></strong>
|
| 25 |
+
</dd>
|
| 26 |
+
|
| 27 |
+
<dt><?php _e( 'Topics', 'bbpress' ); ?></dt>
|
| 28 |
+
<dd>
|
| 29 |
+
<strong><?php echo esc_html( $stats['topic_count'] ); ?></strong>
|
| 30 |
+
</dd>
|
| 31 |
+
|
| 32 |
+
<dt><?php _e( 'Replies', 'bbpress' ); ?></dt>
|
| 33 |
+
<dd>
|
| 34 |
+
<strong><?php echo esc_html( $stats['reply_count'] ); ?></strong>
|
| 35 |
+
</dd>
|
| 36 |
+
|
| 37 |
+
<dt><?php _e( 'Topic Tags', 'bbpress' ); ?></dt>
|
| 38 |
+
<dd>
|
| 39 |
+
<strong><?php echo esc_html( $stats['topic_tag_count'] ); ?></strong>
|
| 40 |
+
</dd>
|
| 41 |
+
|
| 42 |
+
<?php if ( !empty( $stats['empty_topic_tag_count'] ) ) : ?>
|
| 43 |
+
|
| 44 |
+
<dt><?php _e( 'Empty Topic Tags', 'bbpress' ); ?></dt>
|
| 45 |
+
<dd>
|
| 46 |
+
<strong><?php echo esc_html( $stats['empty_topic_tag_count'] ); ?></strong>
|
| 47 |
+
</dd>
|
| 48 |
+
|
| 49 |
+
<?php endif; ?>
|
| 50 |
+
|
| 51 |
+
<?php if ( !empty( $stats['topic_count_hidden'] ) ) : ?>
|
| 52 |
+
|
| 53 |
+
<dt><?php _e( 'Hidden Topics', 'bbpress' ); ?></dt>
|
| 54 |
+
<dd>
|
| 55 |
+
<strong>
|
| 56 |
+
<abbr title="<?php echo esc_attr( $stats['hidden_topic_title'] ); ?>"><?php echo esc_html( $stats['topic_count_hidden'] ); ?></abbr>
|
| 57 |
+
</strong>
|
| 58 |
+
</dd>
|
| 59 |
+
|
| 60 |
+
<?php endif; ?>
|
| 61 |
+
|
| 62 |
+
<?php if ( !empty( $stats['reply_count_hidden'] ) ) : ?>
|
| 63 |
+
|
| 64 |
+
<dt><?php _e( 'Hidden Replies', 'bbpress' ); ?></dt>
|
| 65 |
+
<dd>
|
| 66 |
+
<strong>
|
| 67 |
+
<abbr title="<?php echo esc_attr( $stats['hidden_reply_title'] ); ?>"><?php echo esc_html( $stats['reply_count_hidden'] ); ?></abbr>
|
| 68 |
+
</strong>
|
| 69 |
+
</dd>
|
| 70 |
+
|
| 71 |
+
<?php endif; ?>
|
| 72 |
+
|
| 73 |
+
<?php do_action( 'bbp_after_statistics' ); ?>
|
| 74 |
+
|
| 75 |
+
</dl>
|
| 76 |
+
|
| 77 |
+
<?php unset( $stats );
|
templates/default/bbpress/feedback-no-search.php
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Oh bother!
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<div class="bbp-template-notice">
|
| 13 |
+
<p><?php _e( 'Oh bother! No search results were found here!', 'bbpress' ); ?></p>
|
| 14 |
+
</div>
|
templates/default/bbpress/form-reply-move.php
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Move Reply
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<div id="bbpress-forums">
|
| 13 |
+
|
| 14 |
+
<?php bbp_breadcrumb(); ?>
|
| 15 |
+
|
| 16 |
+
<?php if ( is_user_logged_in() && current_user_can( 'edit_topic', bbp_get_topic_id() ) ) : ?>
|
| 17 |
+
|
| 18 |
+
<div id="move-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-move">
|
| 19 |
+
|
| 20 |
+
<form id="move_reply" name="move_reply" method="post" action="<?php the_permalink(); ?>">
|
| 21 |
+
|
| 22 |
+
<fieldset class="bbp-form">
|
| 23 |
+
|
| 24 |
+
<legend><?php printf( __( 'Move reply "%s"', 'bbpress' ), bbp_get_reply_title() ); ?></legend>
|
| 25 |
+
|
| 26 |
+
<div>
|
| 27 |
+
|
| 28 |
+
<div class="bbp-template-notice info">
|
| 29 |
+
<p><?php _e( 'You can either make this reply a new topic with a new title, or merge it into an existing topic.', 'bbpress' ); ?></p>
|
| 30 |
+
</div>
|
| 31 |
+
|
| 32 |
+
<div class="bbp-template-notice">
|
| 33 |
+
<p><?php _e( 'If you choose an existing topic, replies will be ordered by the time and date they were created.', 'bbpress' ); ?></p>
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<fieldset class="bbp-form">
|
| 37 |
+
<legend><?php _e( 'Move Method', 'bbpress' ); ?></legend>
|
| 38 |
+
|
| 39 |
+
<div>
|
| 40 |
+
<input name="bbp_reply_move_option" id="bbp_reply_move_option_reply" type="radio" checked="checked" value="topic" tabindex="<?php bbp_tab_index(); ?>" />
|
| 41 |
+
<label for="bbp_reply_move_option_reply"><?php printf( __( 'New topic in <strong>%s</strong> titled:', 'bbpress' ), bbp_get_forum_title( bbp_get_reply_forum_id( bbp_get_reply_id() ) ) ); ?></label>
|
| 42 |
+
<input type="text" id="bbp_reply_move_destination_title" value="<?php printf( __( 'Moved: %s', 'bbpress' ), bbp_get_reply_title() ); ?>" tabindex="<?php bbp_tab_index(); ?>" size="35" name="bbp_reply_move_destination_title" />
|
| 43 |
+
</div>
|
| 44 |
+
|
| 45 |
+
<?php if ( bbp_has_topics( array( 'show_stickies' => false, 'post_parent' => bbp_get_reply_forum_id( bbp_get_reply_id() ), 'post__not_in' => array( bbp_get_reply_topic_id( bbp_get_reply_id() ) ) ) ) ) : ?>
|
| 46 |
+
|
| 47 |
+
<div>
|
| 48 |
+
<input name="bbp_reply_move_option" id="bbp_reply_move_option_existing" type="radio" value="existing" tabindex="<?php bbp_tab_index(); ?>" />
|
| 49 |
+
<label for="bbp_reply_move_option_existing"><?php _e( 'Use an existing topic in this forum:', 'bbpress' ); ?></label>
|
| 50 |
+
|
| 51 |
+
<?php
|
| 52 |
+
bbp_dropdown( array(
|
| 53 |
+
'post_type' => bbp_get_topic_post_type(),
|
| 54 |
+
'post_parent' => bbp_get_reply_forum_id( bbp_get_reply_id() ),
|
| 55 |
+
'selected' => -1,
|
| 56 |
+
'exclude' => bbp_get_reply_topic_id( bbp_get_reply_id() ),
|
| 57 |
+
'select_id' => 'bbp_destination_topic',
|
| 58 |
+
'none_found' => __( 'No other topics found!', 'bbpress' )
|
| 59 |
+
) );
|
| 60 |
+
?>
|
| 61 |
+
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
<?php endif; ?>
|
| 65 |
+
|
| 66 |
+
</fieldset>
|
| 67 |
+
|
| 68 |
+
<div class="bbp-template-notice error">
|
| 69 |
+
<p><?php _e( '<strong>WARNING:</strong> This process cannot be undone.', 'bbpress' ); ?></p>
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
<div class="bbp-submit-wrapper">
|
| 73 |
+
<button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_move_reply_submit" name="bbp_move_reply_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
|
| 74 |
+
</div>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<?php bbp_move_reply_form_fields(); ?>
|
| 78 |
+
|
| 79 |
+
</fieldset>
|
| 80 |
+
</form>
|
| 81 |
+
</div>
|
| 82 |
+
|
| 83 |
+
<?php else : ?>
|
| 84 |
+
|
| 85 |
+
<div id="no-reply-<?php bbp_reply_id(); ?>" class="bbp-no-reply">
|
| 86 |
+
<div class="entry-content"><?php is_user_logged_in() ? _e( 'You do not have the permissions to edit this reply!', 'bbpress' ) : _e( 'You cannot edit this reply.', 'bbpress' ); ?></div>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
<?php endif; ?>
|
| 90 |
+
|
| 91 |
+
</div>
|
templates/default/bbpress/form-reply.php
CHANGED
|
@@ -134,10 +134,6 @@
|
|
| 134 |
|
| 135 |
<?php do_action( 'bbp_theme_after_reply_form_revisions' ); ?>
|
| 136 |
|
| 137 |
-
<?php else : ?>
|
| 138 |
-
|
| 139 |
-
<?php bbp_topic_admin_links(); ?>
|
| 140 |
-
|
| 141 |
<?php endif; ?>
|
| 142 |
|
| 143 |
<?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?>
|
| 134 |
|
| 135 |
<?php do_action( 'bbp_theme_after_reply_form_revisions' ); ?>
|
| 136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
<?php endif; ?>
|
| 138 |
|
| 139 |
<?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?>
|
templates/default/bbpress/form-search.php
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Search
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<form role="search" method="get" id="bbp-search-form" action="<?php bbp_search_url(); ?>">
|
| 13 |
+
<div>
|
| 14 |
+
<label class="screen-reader-text hidden" for="bbp_search"><?php _e( 'Search for:', 'bbpress' ); ?></label>
|
| 15 |
+
<input tabindex="<?php bbp_tab_index(); ?>" type="text" value="<?php echo esc_attr( bbp_get_search_terms() ); ?>" name="bbp_search" id="bbp_search" />
|
| 16 |
+
<input tabindex="<?php bbp_tab_index(); ?>" class="button" type="submit" id="bbp_search_submit" value="<?php _e( 'Search', 'bbpress' ); ?>" />
|
| 17 |
+
</div>
|
| 18 |
+
</form>
|
templates/default/bbpress/loop-search-forum.php
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Search Loop - Single Forum
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<div class="bbp-forum-header">
|
| 13 |
+
|
| 14 |
+
<div class="bbp-meta">
|
| 15 |
+
|
| 16 |
+
<span class="bbp-forum-post-date"><?php printf( __( 'Last updated %s', 'bbpress' ), bbp_get_forum_last_active_time() ); ?></span>
|
| 17 |
+
|
| 18 |
+
<a href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>" class="bbp-forum-permalink">#<?php bbp_forum_id(); ?></a>
|
| 19 |
+
|
| 20 |
+
</div><!-- .bbp-meta -->
|
| 21 |
+
|
| 22 |
+
<div class="bbp-forum-title">
|
| 23 |
+
|
| 24 |
+
<?php do_action( 'bbp_theme_before_forum_title' ); ?>
|
| 25 |
+
|
| 26 |
+
<h3><?php _e( 'Forum: ', 'bbpress' ); ?><a href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>"><?php bbp_forum_title(); ?></a></h3>
|
| 27 |
+
|
| 28 |
+
<?php do_action( 'bbp_theme_after_forum_title' ); ?>
|
| 29 |
+
|
| 30 |
+
</div><!-- .bbp-forum-title -->
|
| 31 |
+
|
| 32 |
+
</div><!-- .bbp-forum-header -->
|
| 33 |
+
|
| 34 |
+
<div id="post-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>
|
| 35 |
+
|
| 36 |
+
<div class="bbp-forum-content">
|
| 37 |
+
|
| 38 |
+
<?php do_action( 'bbp_theme_before_forum_content' ); ?>
|
| 39 |
+
|
| 40 |
+
<?php the_excerpt(); ?>
|
| 41 |
+
|
| 42 |
+
<?php do_action( 'bbp_theme_after_forum_content' ); ?>
|
| 43 |
+
|
| 44 |
+
</div><!-- .bbp-forum-content -->
|
| 45 |
+
|
| 46 |
+
</div><!-- #post-<?php bbp_forum_id(); ?> -->
|
templates/default/bbpress/loop-search-reply.php
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Search Loop - Single Reply
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<div class="bbp-reply-header">
|
| 13 |
+
|
| 14 |
+
<div class="bbp-meta">
|
| 15 |
+
|
| 16 |
+
<span class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></span>
|
| 17 |
+
|
| 18 |
+
<a href="<?php bbp_reply_url(); ?>" title="<?php bbp_reply_title(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a>
|
| 19 |
+
|
| 20 |
+
<?php do_action( 'bbp_theme_before_reply_admin_links' ); ?>
|
| 21 |
+
|
| 22 |
+
<?php bbp_reply_admin_links(); ?>
|
| 23 |
+
|
| 24 |
+
<?php do_action( 'bbp_theme_after_reply_admin_links' ); ?>
|
| 25 |
+
|
| 26 |
+
</div><!-- .bbp-meta -->
|
| 27 |
+
|
| 28 |
+
<div class="bbp-reply-title">
|
| 29 |
+
|
| 30 |
+
<h3><?php _e( 'In reply to: ', 'bbpress' ); ?>
|
| 31 |
+
<a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>" title="<?php bbp_topic_title( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a></h3>
|
| 32 |
+
|
| 33 |
+
</div><!-- .bbp-reply-title -->
|
| 34 |
+
|
| 35 |
+
</div><!-- .bbp-reply-header -->
|
| 36 |
+
|
| 37 |
+
<div id="post-<?php bbp_reply_id(); ?>" <?php bbp_reply_class(); ?>>
|
| 38 |
+
|
| 39 |
+
<div class="bbp-reply-author">
|
| 40 |
+
|
| 41 |
+
<?php do_action( 'bbp_theme_before_reply_author_details' ); ?>
|
| 42 |
+
|
| 43 |
+
<?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => true ) ); ?>
|
| 44 |
+
|
| 45 |
+
<?php if ( is_super_admin() ) : ?>
|
| 46 |
+
|
| 47 |
+
<?php do_action( 'bbp_theme_before_reply_author_admin_details' ); ?>
|
| 48 |
+
|
| 49 |
+
<div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
|
| 50 |
+
|
| 51 |
+
<?php do_action( 'bbp_theme_after_reply_author_admin_details' ); ?>
|
| 52 |
+
|
| 53 |
+
<?php endif; ?>
|
| 54 |
+
|
| 55 |
+
<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
|
| 56 |
+
|
| 57 |
+
</div><!-- .bbp-reply-author -->
|
| 58 |
+
|
| 59 |
+
<div class="bbp-reply-content">
|
| 60 |
+
|
| 61 |
+
<?php do_action( 'bbp_theme_before_reply_content' ); ?>
|
| 62 |
+
|
| 63 |
+
<?php bbp_reply_content(); ?>
|
| 64 |
+
|
| 65 |
+
<?php do_action( 'bbp_theme_after_reply_content' ); ?>
|
| 66 |
+
|
| 67 |
+
</div><!-- .bbp-reply-content -->
|
| 68 |
+
|
| 69 |
+
</div><!-- #post-<?php bbp_reply_id(); ?> -->
|
| 70 |
+
|
templates/default/bbpress/loop-search-topic.php
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Search Loop - Single Topic
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<div class="bbp-topic-header">
|
| 13 |
+
|
| 14 |
+
<div class="bbp-meta">
|
| 15 |
+
|
| 16 |
+
<span class="bbp-topic-post-date"><?php bbp_topic_post_date( bbp_get_topic_id() ); ?></span>
|
| 17 |
+
|
| 18 |
+
<a href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>" class="bbp-topic-permalink">#<?php bbp_topic_id(); ?></a>
|
| 19 |
+
|
| 20 |
+
<?php do_action( 'bbp_theme_before_topic_admin_links' ); ?>
|
| 21 |
+
|
| 22 |
+
<?php bbp_topic_admin_links( bbp_get_topic_id() ); ?>
|
| 23 |
+
|
| 24 |
+
<?php do_action( 'bbp_theme_after_topic_admin_links' ); ?>
|
| 25 |
+
|
| 26 |
+
</div><!-- .bbp-meta -->
|
| 27 |
+
|
| 28 |
+
<div class="bbp-topic-title">
|
| 29 |
+
|
| 30 |
+
<?php do_action( 'bbp_theme_before_topic_title' ); ?>
|
| 31 |
+
|
| 32 |
+
<h3><?php _e( 'Topic: ', 'bbpress' ); ?>
|
| 33 |
+
<a href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>"><?php bbp_topic_title(); ?></a></h3>
|
| 34 |
+
|
| 35 |
+
<div class="bbp-topic-title-meta">
|
| 36 |
+
|
| 37 |
+
<?php if ( function_exists( 'bbp_is_forum_group_forum' ) && bbp_is_forum_group_forum( bbp_get_topic_forum_id() ) ) : ?>
|
| 38 |
+
|
| 39 |
+
<?php _e( 'in group forum ', 'bbpress' ); ?>
|
| 40 |
+
|
| 41 |
+
<?php else : ?>
|
| 42 |
+
|
| 43 |
+
<?php _e( 'in forum ', 'bbpress' ); ?>
|
| 44 |
+
|
| 45 |
+
<?php endif; ?>
|
| 46 |
+
|
| 47 |
+
<a href="<?php bbp_forum_permalink( bbp_get_topic_forum_id() ); ?>" title="<?php bbp_forum_title( bbp_get_topic_forum_id() ); ?>"><?php bbp_forum_title( bbp_get_topic_forum_id() ); ?></a>
|
| 48 |
+
|
| 49 |
+
</div><!-- .bbp-topic-title-meta -->
|
| 50 |
+
|
| 51 |
+
<?php do_action( 'bbp_theme_after_topic_title' ); ?>
|
| 52 |
+
|
| 53 |
+
</div><!-- .bbp-topic-title -->
|
| 54 |
+
|
| 55 |
+
</div><!-- .bbp-topic-header -->
|
| 56 |
+
|
| 57 |
+
<div id="post-<?php bbp_topic_id(); ?>" <?php bbp_topic_class(); ?>>
|
| 58 |
+
|
| 59 |
+
<div class="bbp-topic-author">
|
| 60 |
+
|
| 61 |
+
<?php do_action( 'bbp_theme_before_topic_author_details' ); ?>
|
| 62 |
+
|
| 63 |
+
<?php bbp_topic_author_link( array( 'sep' => '<br />', 'show_role' => true ) ); ?>
|
| 64 |
+
|
| 65 |
+
<?php if ( is_super_admin() ) : ?>
|
| 66 |
+
|
| 67 |
+
<?php do_action( 'bbp_theme_before_topic_author_admin_details' ); ?>
|
| 68 |
+
|
| 69 |
+
<div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_topic_id() ); ?></div>
|
| 70 |
+
|
| 71 |
+
<?php do_action( 'bbp_theme_after_topic_author_admin_details' ); ?>
|
| 72 |
+
|
| 73 |
+
<?php endif; ?>
|
| 74 |
+
|
| 75 |
+
<?php do_action( 'bbp_theme_after_topic_author_details' ); ?>
|
| 76 |
+
|
| 77 |
+
</div><!-- .bbp-topic-author -->
|
| 78 |
+
|
| 79 |
+
<div class="bbp-topic-content">
|
| 80 |
+
|
| 81 |
+
<?php do_action( 'bbp_theme_before_topic_content' ); ?>
|
| 82 |
+
|
| 83 |
+
<?php bbp_topic_content(); ?>
|
| 84 |
+
|
| 85 |
+
<?php do_action( 'bbp_theme_after_topic_content' ); ?>
|
| 86 |
+
|
| 87 |
+
</div><!-- .bbp-topic-content -->
|
| 88 |
+
|
| 89 |
+
</div><!-- #post-<?php bbp_topic_id(); ?> -->
|
templates/default/bbpress/loop-search.php
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Search Loop
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<?php do_action( 'bbp_template_before_search_results_loop' ); ?>
|
| 13 |
+
|
| 14 |
+
<ul id="bbp-search-results" class="forums bbp-search-results">
|
| 15 |
+
|
| 16 |
+
<li class="bbp-header">
|
| 17 |
+
|
| 18 |
+
<div class="bbp-search-author"><?php _e( 'Author', 'bbpress' ); ?></div><!-- .bbp-reply-author -->
|
| 19 |
+
|
| 20 |
+
<div class="bbp-search-content">
|
| 21 |
+
|
| 22 |
+
<?php _e( 'Search Results', 'bbpress' ); ?>
|
| 23 |
+
|
| 24 |
+
</div><!-- .bbp-search-content -->
|
| 25 |
+
|
| 26 |
+
</li><!-- .bbp-header -->
|
| 27 |
+
|
| 28 |
+
<li class="bbp-body">
|
| 29 |
+
|
| 30 |
+
<?php while ( bbp_search_results() ) : bbp_the_search_result(); ?>
|
| 31 |
+
|
| 32 |
+
<?php bbp_get_template_part( 'loop', 'search-' . get_post_type() ); ?>
|
| 33 |
+
|
| 34 |
+
<?php endwhile; ?>
|
| 35 |
+
|
| 36 |
+
</li><!-- .bbp-body -->
|
| 37 |
+
|
| 38 |
+
<li class="bbp-footer">
|
| 39 |
+
|
| 40 |
+
<div class="bbp-search-author"><?php _e( 'Author', 'bbpress' ); ?></div>
|
| 41 |
+
|
| 42 |
+
<div class="bbp-search-content">
|
| 43 |
+
|
| 44 |
+
<?php _e( 'Search Results', 'bbpress' ); ?>
|
| 45 |
+
|
| 46 |
+
</div><!-- .bbp-search-content -->
|
| 47 |
+
|
| 48 |
+
</li><!-- .bbp-footer -->
|
| 49 |
+
|
| 50 |
+
</ul><!-- #bbp-search-results -->
|
| 51 |
+
|
| 52 |
+
<?php do_action( 'bbp_template_after_search_results_loop' ); ?>
|
templates/default/bbpress/loop-single-forum.php
CHANGED
|
@@ -19,18 +19,18 @@
|
|
| 19 |
|
| 20 |
<?php do_action( 'bbp_theme_after_forum_title' ); ?>
|
| 21 |
|
| 22 |
-
<?php do_action( 'bbp_theme_before_forum_sub_forums' ); ?>
|
| 23 |
-
|
| 24 |
-
<?php bbp_list_forums(); ?>
|
| 25 |
-
|
| 26 |
-
<?php do_action( 'bbp_theme_after_forum_sub_forums' ); ?>
|
| 27 |
-
|
| 28 |
<?php do_action( 'bbp_theme_before_forum_description' ); ?>
|
| 29 |
|
| 30 |
<div class="bbp-forum-content"><?php the_content(); ?></div>
|
| 31 |
|
| 32 |
<?php do_action( 'bbp_theme_after_forum_description' ); ?>
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
<?php bbp_forum_row_actions(); ?>
|
| 35 |
|
| 36 |
</li>
|
| 19 |
|
| 20 |
<?php do_action( 'bbp_theme_after_forum_title' ); ?>
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
<?php do_action( 'bbp_theme_before_forum_description' ); ?>
|
| 23 |
|
| 24 |
<div class="bbp-forum-content"><?php the_content(); ?></div>
|
| 25 |
|
| 26 |
<?php do_action( 'bbp_theme_after_forum_description' ); ?>
|
| 27 |
|
| 28 |
+
<?php do_action( 'bbp_theme_before_forum_sub_forums' ); ?>
|
| 29 |
+
|
| 30 |
+
<?php bbp_list_forums(); ?>
|
| 31 |
+
|
| 32 |
+
<?php do_action( 'bbp_theme_after_forum_sub_forums' ); ?>
|
| 33 |
+
|
| 34 |
<?php bbp_forum_row_actions(); ?>
|
| 35 |
|
| 36 |
</li>
|
templates/default/bbpress/loop-single-reply.php
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
|
| 10 |
?>
|
| 11 |
|
| 12 |
-
<div class="bbp-reply-header">
|
| 13 |
|
| 14 |
<div class="bbp-meta">
|
| 15 |
|
|
@@ -34,9 +34,9 @@
|
|
| 34 |
|
| 35 |
</div><!-- .bbp-meta -->
|
| 36 |
|
| 37 |
-
</div><!--
|
| 38 |
|
| 39 |
-
<div
|
| 40 |
|
| 41 |
<div class="bbp-reply-author">
|
| 42 |
|
|
@@ -68,4 +68,4 @@
|
|
| 68 |
|
| 69 |
</div><!-- .bbp-reply-content -->
|
| 70 |
|
| 71 |
-
</div><!--
|
| 9 |
|
| 10 |
?>
|
| 11 |
|
| 12 |
+
<div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
|
| 13 |
|
| 14 |
<div class="bbp-meta">
|
| 15 |
|
| 34 |
|
| 35 |
</div><!-- .bbp-meta -->
|
| 36 |
|
| 37 |
+
</div><!-- #post-<?php bbp_reply_id(); ?> -->
|
| 38 |
|
| 39 |
+
<div <?php bbp_reply_class(); ?>>
|
| 40 |
|
| 41 |
<div class="bbp-reply-author">
|
| 42 |
|
| 68 |
|
| 69 |
</div><!-- .bbp-reply-content -->
|
| 70 |
|
| 71 |
+
</div><!-- .reply -->
|
templates/default/bbpress/loop-single-topic.php
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
|
| 10 |
?>
|
| 11 |
|
| 12 |
-
<ul id="topic-<?php bbp_topic_id(); ?>" <?php bbp_topic_class(); ?>>
|
| 13 |
|
| 14 |
<li class="bbp-topic-title">
|
| 15 |
|
|
@@ -21,7 +21,7 @@
|
|
| 21 |
|
| 22 |
<?php do_action( 'bbp_theme_before_topic_favorites_action' ); ?>
|
| 23 |
|
| 24 |
-
<?php bbp_user_favorites_link( array( '
|
| 25 |
|
| 26 |
<?php do_action( 'bbp_theme_after_topic_favorites_action' ); ?>
|
| 27 |
|
|
@@ -102,4 +102,4 @@
|
|
| 102 |
</p>
|
| 103 |
</li>
|
| 104 |
|
| 105 |
-
</ul><!-- #topic-<?php bbp_topic_id(); ?> -->
|
| 9 |
|
| 10 |
?>
|
| 11 |
|
| 12 |
+
<ul id="bbp-topic-<?php bbp_topic_id(); ?>" <?php bbp_topic_class(); ?>>
|
| 13 |
|
| 14 |
<li class="bbp-topic-title">
|
| 15 |
|
| 21 |
|
| 22 |
<?php do_action( 'bbp_theme_before_topic_favorites_action' ); ?>
|
| 23 |
|
| 24 |
+
<?php bbp_user_favorites_link( array( 'before' => '', 'favorite' => '+', 'favorited' => '×' ) ); ?>
|
| 25 |
|
| 26 |
<?php do_action( 'bbp_theme_after_topic_favorites_action' ); ?>
|
| 27 |
|
| 102 |
</p>
|
| 103 |
</li>
|
| 104 |
|
| 105 |
+
</ul><!-- #bbp-topic-<?php bbp_topic_id(); ?> -->
|
templates/default/bbpress/pagination-search.php
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Pagination for pages of search results
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
?>
|
| 11 |
+
|
| 12 |
+
<?php do_action( 'bbp_template_before_pagination_loop' ); ?>
|
| 13 |
+
|
| 14 |
+
<div class="bbp-pagination">
|
| 15 |
+
<div class="bbp-pagination-count">
|
| 16 |
+
|
| 17 |
+
<?php bbp_search_pagination_count(); ?>
|
| 18 |
+
|
| 19 |
+
</div>
|
| 20 |
+
|
| 21 |
+
<div class="bbp-pagination-links">
|
| 22 |
+
|
| 23 |
+
<?php bbp_search_pagination_links(); ?>
|
| 24 |
+
|
| 25 |
+
</div>
|
| 26 |
+
</div>
|
| 27 |
+
|
| 28 |
+
<?php do_action( 'bbp_template_after_pagination_loop' ); ?>
|
templates/default/css/bbpress-rtl.css
CHANGED
|
@@ -34,6 +34,7 @@
|
|
| 34 |
height: auto;
|
| 35 |
}
|
| 36 |
|
|
|
|
| 37 |
#bbpress-forums div.bbp-topic-header,
|
| 38 |
#bbpress-forums div.bbp-reply-header {
|
| 39 |
background-color: #f4f4f4;
|
|
@@ -67,7 +68,8 @@
|
|
| 67 |
#bbpress-forums ul.bbp-lead-topic,
|
| 68 |
#bbpress-forums ul.bbp-topics,
|
| 69 |
#bbpress-forums ul.bbp-forums,
|
| 70 |
-
#bbpress-forums ul.bbp-replies
|
|
|
|
| 71 |
font-size: 12px;
|
| 72 |
overflow: hidden;
|
| 73 |
border: 1px solid #eee;
|
|
@@ -114,22 +116,6 @@
|
|
| 114 |
line-height: 1em;
|
| 115 |
}
|
| 116 |
|
| 117 |
-
#bbpress-forums .bbp-topic-content img,
|
| 118 |
-
#bbpress-forums .bbp-reply-content img {
|
| 119 |
-
max-width: 100%;
|
| 120 |
-
}
|
| 121 |
-
|
| 122 |
-
#bbpress-forums .bbp-topic-content ul,
|
| 123 |
-
#bbpress-forums .bbp-reply-content ul {
|
| 124 |
-
list-style: square;
|
| 125 |
-
padding-right: 15px;
|
| 126 |
-
}
|
| 127 |
-
|
| 128 |
-
#bbpress-forums .bbp-forum-content p {
|
| 129 |
-
margin: 5px 0 0;
|
| 130 |
-
font-style: italic;
|
| 131 |
-
}
|
| 132 |
-
|
| 133 |
li.bbp-forum-info,
|
| 134 |
li.bbp-topic-title {
|
| 135 |
float: right;
|
|
@@ -166,6 +152,14 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 166 |
float: left;
|
| 167 |
}
|
| 168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
#bbpress-forums div.bbp-topic-author,
|
| 170 |
#bbpress-forums div.bbp-reply-author {
|
| 171 |
float: right;
|
|
@@ -173,6 +167,7 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 173 |
width: 115px;
|
| 174 |
}
|
| 175 |
|
|
|
|
| 176 |
#bbpress-forums div.bbp-topic-author img.avatar,
|
| 177 |
#bbpress-forums div.bbp-reply-author img.avatar {
|
| 178 |
border: none;
|
|
@@ -182,24 +177,25 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 182 |
float: none;
|
| 183 |
}
|
| 184 |
|
|
|
|
| 185 |
#bbpress-forums div.bbp-topic-author a.bbp-author-name,
|
| 186 |
#bbpress-forums div.bbp-reply-author a.bbp-author-name {
|
|
|
|
| 187 |
word-break: break-word;
|
|
|
|
| 188 |
}
|
| 189 |
|
|
|
|
| 190 |
#bbpress-forums div.bbp-topic-author .bbp-author-role,
|
| 191 |
#bbpress-forums div.bbp-reply-author .bbp-author-role {
|
| 192 |
font-size: 11px;
|
| 193 |
font-style: italic;
|
| 194 |
}
|
| 195 |
|
| 196 |
-
#bbpress-forums
|
| 197 |
-
#bbpress-forums
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
text-align: right;
|
| 201 |
-
}
|
| 202 |
-
|
| 203 |
#bbpress-forums li.bbp-header .bbp-topic-author,
|
| 204 |
#bbpress-forums li.bbp-footer .bbp-topic-author,
|
| 205 |
#bbpress-forums li.bbp-header .bbp-reply-author,
|
|
@@ -210,6 +206,10 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 210 |
width: 120px;
|
| 211 |
}
|
| 212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
#bbpress-forums li.bbp-header .bbp-topic-content,
|
| 214 |
#bbpress-forums li.bbp-footer .bbp-topic-content,
|
| 215 |
#bbpress-forums li.bbp-header .bbp-reply-content,
|
|
@@ -219,6 +219,7 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 219 |
text-align: right;
|
| 220 |
}
|
| 221 |
|
|
|
|
| 222 |
div.bbp-topic-header,
|
| 223 |
div.bbp-reply-header,
|
| 224 |
li.bbp-body div.hentry {
|
|
@@ -227,6 +228,7 @@ li.bbp-body div.hentry {
|
|
| 227 |
padding: 8px;
|
| 228 |
}
|
| 229 |
|
|
|
|
| 230 |
div.bbp-topic-header,
|
| 231 |
div.bbp-reply-header {
|
| 232 |
border-top: 1px solid #ddd;
|
|
@@ -240,6 +242,109 @@ span.bbp-author-ip {
|
|
| 240 |
color: #aaa;
|
| 241 |
}
|
| 242 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
/* =Breadcrumb and Tags
|
| 244 |
-------------------------------------------------------------- */
|
| 245 |
|
|
@@ -257,7 +362,22 @@ div.bbp-topic-tags {
|
|
| 257 |
margin-bottom: 10px
|
| 258 |
}
|
| 259 |
|
| 260 |
-
div.bbp-topic-tags {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
float: left;
|
| 262 |
}
|
| 263 |
|
|
@@ -286,6 +406,7 @@ td.bbp-topic-counts {
|
|
| 286 |
width: 50%;
|
| 287 |
}
|
| 288 |
|
|
|
|
| 289 |
.bbp-topic-header a.bbp-topic-permalink,
|
| 290 |
.bbp-reply-header a.bbp-reply-permalink {
|
| 291 |
float: left;
|
|
@@ -346,8 +467,10 @@ td.bbp-topic-counts {
|
|
| 346 |
background-color: #fdd;
|
| 347 |
}
|
| 348 |
|
|
|
|
| 349 |
#bbpress-forums p.bbp-topic-meta {
|
| 350 |
margin: 5px 0 5px;
|
|
|
|
| 351 |
font-size: 11px;
|
| 352 |
}
|
| 353 |
|
|
@@ -360,10 +483,37 @@ td.bbp-topic-counts {
|
|
| 360 |
|
| 361 |
.bbp-pagination-count {
|
| 362 |
float: right;
|
|
|
|
| 363 |
}
|
|
|
|
| 364 |
.bbp-pagination-links {
|
| 365 |
float: left;
|
| 366 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
.bbp-pagination {
|
| 368 |
float: right;
|
| 369 |
width: 100%;
|
|
@@ -383,6 +533,7 @@ td.bbp-topic-counts {
|
|
| 383 |
text-decoration: none;
|
| 384 |
}
|
| 385 |
|
|
|
|
| 386 |
/* =Forms
|
| 387 |
-------------------------------------------------------------- */
|
| 388 |
|
|
@@ -516,9 +667,8 @@ p.form-allowed-tags {
|
|
| 516 |
#bbpress-forums div.bbp-the-content-wrapper input {
|
| 517 |
font-size: 12px;
|
| 518 |
padding: 5px;
|
| 519 |
-
margin:
|
| 520 |
line-height: 1em;
|
| 521 |
-
margin: 0;
|
| 522 |
}
|
| 523 |
|
| 524 |
#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar {
|
|
@@ -685,10 +835,11 @@ div.bbp-template-notice a {
|
|
| 685 |
|
| 686 |
/* =Revisions
|
| 687 |
-------------------------------------------------------------- */
|
| 688 |
-
|
| 689 |
-
#bbpress-forums .bbp-
|
|
|
|
|
|
|
| 690 |
border-top: 1px dotted #ddd;
|
| 691 |
-
list-style: none;
|
| 692 |
width: 100%;
|
| 693 |
margin: 0;
|
| 694 |
padding: 8px 0 0 0;
|
|
@@ -696,6 +847,12 @@ div.bbp-template-notice a {
|
|
| 696 |
color: #aaa;
|
| 697 |
}
|
| 698 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 699 |
/* =Widgets
|
| 700 |
-------------------------------------------------------------- */
|
| 701 |
|
|
@@ -798,6 +955,10 @@ fieldset div.avatar {
|
|
| 798 |
width: 100%;
|
| 799 |
}
|
| 800 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 801 |
#bbpress-forums #bbp-user-wrapper h2.entry-title {
|
| 802 |
font-size: 1.4em;
|
| 803 |
margin: 0;
|
| 34 |
height: auto;
|
| 35 |
}
|
| 36 |
|
| 37 |
+
#bbpress-forums div.bbp-forum-header,
|
| 38 |
#bbpress-forums div.bbp-topic-header,
|
| 39 |
#bbpress-forums div.bbp-reply-header {
|
| 40 |
background-color: #f4f4f4;
|
| 68 |
#bbpress-forums ul.bbp-lead-topic,
|
| 69 |
#bbpress-forums ul.bbp-topics,
|
| 70 |
#bbpress-forums ul.bbp-forums,
|
| 71 |
+
#bbpress-forums ul.bbp-replies,
|
| 72 |
+
#bbpress-forums ul.bbp-search-results {
|
| 73 |
font-size: 12px;
|
| 74 |
overflow: hidden;
|
| 75 |
border: 1px solid #eee;
|
| 116 |
line-height: 1em;
|
| 117 |
}
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
li.bbp-forum-info,
|
| 120 |
li.bbp-topic-title {
|
| 121 |
float: right;
|
| 152 |
float: left;
|
| 153 |
}
|
| 154 |
|
| 155 |
+
#bbpress-forums div.bbp-forum-title h3,
|
| 156 |
+
#bbpress-forums div.bbp-topic-title h3,
|
| 157 |
+
#bbpress-forums div.bbp-reply-title h3 {
|
| 158 |
+
line-height: 1em;
|
| 159 |
+
margin: 8px 0;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
#bbpress-forums div.bbp-forum-author,
|
| 163 |
#bbpress-forums div.bbp-topic-author,
|
| 164 |
#bbpress-forums div.bbp-reply-author {
|
| 165 |
float: right;
|
| 167 |
width: 115px;
|
| 168 |
}
|
| 169 |
|
| 170 |
+
#bbpress-forums div.bbp-forum-author img.avatar,
|
| 171 |
#bbpress-forums div.bbp-topic-author img.avatar,
|
| 172 |
#bbpress-forums div.bbp-reply-author img.avatar {
|
| 173 |
border: none;
|
| 177 |
float: none;
|
| 178 |
}
|
| 179 |
|
| 180 |
+
#bbpress-forums div.bbp-forum-author a.bbp-author-name,
|
| 181 |
#bbpress-forums div.bbp-topic-author a.bbp-author-name,
|
| 182 |
#bbpress-forums div.bbp-reply-author a.bbp-author-name {
|
| 183 |
+
margin: 0 12px;
|
| 184 |
word-break: break-word;
|
| 185 |
+
display: inline-block;
|
| 186 |
}
|
| 187 |
|
| 188 |
+
#bbpress-forums div.bbp-forum-author .bbp-author-role,
|
| 189 |
#bbpress-forums div.bbp-topic-author .bbp-author-role,
|
| 190 |
#bbpress-forums div.bbp-reply-author .bbp-author-role {
|
| 191 |
font-size: 11px;
|
| 192 |
font-style: italic;
|
| 193 |
}
|
| 194 |
|
| 195 |
+
#bbpress-forums li.bbp-header .bbp-search-author,
|
| 196 |
+
#bbpress-forums li.bbp-footer .bbp-search-author,
|
| 197 |
+
#bbpress-forums li.bbp-header .bbp-forum-author,
|
| 198 |
+
#bbpress-forums li.bbp-footer .bbp-forum-author,
|
|
|
|
|
|
|
|
|
|
| 199 |
#bbpress-forums li.bbp-header .bbp-topic-author,
|
| 200 |
#bbpress-forums li.bbp-footer .bbp-topic-author,
|
| 201 |
#bbpress-forums li.bbp-header .bbp-reply-author,
|
| 206 |
width: 120px;
|
| 207 |
}
|
| 208 |
|
| 209 |
+
#bbpress-forums li.bbp-header .bbp-search-content,
|
| 210 |
+
#bbpress-forums li.bbp-footer .bbp-search-content,
|
| 211 |
+
#bbpress-forums li.bbp-header .bbp-forum-content,
|
| 212 |
+
#bbpress-forums li.bbp-footer .bbp-forum-content,
|
| 213 |
#bbpress-forums li.bbp-header .bbp-topic-content,
|
| 214 |
#bbpress-forums li.bbp-footer .bbp-topic-content,
|
| 215 |
#bbpress-forums li.bbp-header .bbp-reply-content,
|
| 219 |
text-align: right;
|
| 220 |
}
|
| 221 |
|
| 222 |
+
div.bbp-forum-header,
|
| 223 |
div.bbp-topic-header,
|
| 224 |
div.bbp-reply-header,
|
| 225 |
li.bbp-body div.hentry {
|
| 228 |
padding: 8px;
|
| 229 |
}
|
| 230 |
|
| 231 |
+
div.bbp-forum-header,
|
| 232 |
div.bbp-topic-header,
|
| 233 |
div.bbp-reply-header {
|
| 234 |
border-top: 1px solid #ddd;
|
| 242 |
color: #aaa;
|
| 243 |
}
|
| 244 |
|
| 245 |
+
/* =Topic and reply content
|
| 246 |
+
-------------------------------------------------------------- */
|
| 247 |
+
|
| 248 |
+
#bbpress-forums div.bbp-forum-content,
|
| 249 |
+
#bbpress-forums div.bbp-topic-content,
|
| 250 |
+
#bbpress-forums div.bbp-reply-content {
|
| 251 |
+
margin-right: 130px;
|
| 252 |
+
padding: 12px 0 12px 12px;
|
| 253 |
+
text-align: right;
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
#bbpress-forums div.bbp-topic-content a,
|
| 257 |
+
#bbpress-forums div.bbp-reply-content a {
|
| 258 |
+
background: none;
|
| 259 |
+
border: none;
|
| 260 |
+
display: inline;
|
| 261 |
+
font-weight: normal;
|
| 262 |
+
margin: 0;
|
| 263 |
+
padding: 0;
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
#bbpress-forums div.bbp-topic-content h1,
|
| 267 |
+
#bbpress-forums div.bbp-reply-content h1,
|
| 268 |
+
#bbpress-forums div.bbp-topic-content h2,
|
| 269 |
+
#bbpress-forums div.bbp-reply-content h2,
|
| 270 |
+
#bbpress-forums div.bbp-topic-content h3,
|
| 271 |
+
#bbpress-forums div.bbp-reply-content h3,
|
| 272 |
+
#bbpress-forums div.bbp-topic-content h4,
|
| 273 |
+
#bbpress-forums div.bbp-reply-content h4,
|
| 274 |
+
#bbpress-forums div.bbp-topic-content h5,
|
| 275 |
+
#bbpress-forums div.bbp-reply-content h5,
|
| 276 |
+
#bbpress-forums div.bbp-topic-content h6,
|
| 277 |
+
#bbpress-forums div.bbp-reply-content h6 {
|
| 278 |
+
clear: none;
|
| 279 |
+
line-height: 1em;
|
| 280 |
+
margin: 24px 0;
|
| 281 |
+
padding: 0;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
#bbpress-forums div.bbp-topic-content img,
|
| 285 |
+
#bbpress-forums div.bbp-reply-content img {
|
| 286 |
+
max-width: 100%;
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
#bbpress-forums div.bbp-topic-content ul,
|
| 290 |
+
#bbpress-forums div.bbp-reply-content ul,
|
| 291 |
+
#bbpress-forums div.bbp-topic-content ol,
|
| 292 |
+
#bbpress-forums div.bbp-reply-content ol {
|
| 293 |
+
margin: 0 15px 15px;
|
| 294 |
+
padding: 0;
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
#bbpress-forums div.bbp-topic-content ul li,
|
| 298 |
+
#bbpress-forums div.bbp-reply-content ul li {
|
| 299 |
+
list-style-type: disc;
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
#bbpress-forums div.bbp-topic-content ol li,
|
| 303 |
+
#bbpress-forums div.bbp-reply-content ol li {
|
| 304 |
+
list-style-type: decimal;
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
#bbpress-forums div.bbp-topic-content ol li li,
|
| 308 |
+
#bbpress-forums div.bbp-reply-content ol li li {
|
| 309 |
+
list-style-type: lower-alpha;
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
#bbpress-forums div.bbp-topic-content ol li li li,
|
| 313 |
+
#bbpress-forums div.bbp-reply-content ol li li li {
|
| 314 |
+
list-style-type: upper-roman;
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
#bbpress-forums div.bbp-topic-content code,
|
| 318 |
+
#bbpress-forums div.bbp-reply-content code,
|
| 319 |
+
#bbpress-forums div.bbp-topic-content pre,
|
| 320 |
+
#bbpress-forums div.bbp-reply-content pre {
|
| 321 |
+
font-family: Inconsolata, Consolas, Monaco, Lucida Console, monospace;
|
| 322 |
+
display: inline;
|
| 323 |
+
background-color: #f9f9f9;
|
| 324 |
+
border: 1px solid #ddd;
|
| 325 |
+
padding: 2px;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
#bbpress-forums div.bbp-topic-content pre,
|
| 329 |
+
#bbpress-forums div.bbp-reply-content pre {
|
| 330 |
+
display: block;
|
| 331 |
+
line-height: 18px;
|
| 332 |
+
margin: 0 0 24px;
|
| 333 |
+
padding: 5px 10px;
|
| 334 |
+
white-space: pre;
|
| 335 |
+
white-space: pre-wrap;
|
| 336 |
+
word-wrap: break-word;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
#bbpress-forums div.bbp-topic-content pre code,
|
| 340 |
+
#bbpress-forums div.bbp-reply-content pre code {
|
| 341 |
+
display: block;
|
| 342 |
+
border: none;
|
| 343 |
+
padding: 0;
|
| 344 |
+
margin: 0;
|
| 345 |
+
background-color: transparent;
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
/* =Breadcrumb and Tags
|
| 349 |
-------------------------------------------------------------- */
|
| 350 |
|
| 362 |
margin-bottom: 10px
|
| 363 |
}
|
| 364 |
|
| 365 |
+
#bbpress-forums div.bbp-topic-tags {
|
| 366 |
+
float: left;
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
#bbp-topic-hot-tags {
|
| 370 |
+
clear: both;
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
/* =Search
|
| 374 |
+
-------------------------------------------------------------- */
|
| 375 |
+
|
| 376 |
+
#bbpress-forums #bbp-search-form {
|
| 377 |
+
clear: right;
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
#bbpress-forums div.bbp-search-form {
|
| 381 |
float: left;
|
| 382 |
}
|
| 383 |
|
| 406 |
width: 50%;
|
| 407 |
}
|
| 408 |
|
| 409 |
+
.bbp-forum-header a.bbp-forum-permalink,
|
| 410 |
.bbp-topic-header a.bbp-topic-permalink,
|
| 411 |
.bbp-reply-header a.bbp-reply-permalink {
|
| 412 |
float: left;
|
| 467 |
background-color: #fdd;
|
| 468 |
}
|
| 469 |
|
| 470 |
+
#bbpress-forums .bbp-forum-info .bbp-forum-content,
|
| 471 |
#bbpress-forums p.bbp-topic-meta {
|
| 472 |
margin: 5px 0 5px;
|
| 473 |
+
padding: 0;
|
| 474 |
font-size: 11px;
|
| 475 |
}
|
| 476 |
|
| 483 |
|
| 484 |
.bbp-pagination-count {
|
| 485 |
float: right;
|
| 486 |
+
border: 1px solid transparent;
|
| 487 |
}
|
| 488 |
+
|
| 489 |
.bbp-pagination-links {
|
| 490 |
float: left;
|
| 491 |
+
list-style: none;
|
| 492 |
+
display: inline;
|
| 493 |
+
}
|
| 494 |
+
.bbp-pagination-links a,
|
| 495 |
+
.bbp-pagination-links span.current {
|
| 496 |
+
display: block;
|
| 497 |
+
float: right;
|
| 498 |
+
padding: 0px 5px;
|
| 499 |
+
margin-right: 5px;
|
| 500 |
+
border: 1px solid #efefef;
|
| 501 |
+
text-decoration: none;
|
| 502 |
+
}
|
| 503 |
+
.bbp-pagination-links a:hover,
|
| 504 |
+
.bbp-pagination-links span.current {
|
| 505 |
+
background: #eee;
|
| 506 |
+
opacity: 0.8;
|
| 507 |
+
border: 1px solid #ddd;
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
.bbp-pagination-links span.dots {
|
| 511 |
+
display: block;
|
| 512 |
+
float: right;
|
| 513 |
+
padding: 1px 4px;
|
| 514 |
+
margin-right: 5px;
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
.bbp-pagination {
|
| 518 |
float: right;
|
| 519 |
width: 100%;
|
| 533 |
text-decoration: none;
|
| 534 |
}
|
| 535 |
|
| 536 |
+
|
| 537 |
/* =Forms
|
| 538 |
-------------------------------------------------------------- */
|
| 539 |
|
| 667 |
#bbpress-forums div.bbp-the-content-wrapper input {
|
| 668 |
font-size: 12px;
|
| 669 |
padding: 5px;
|
| 670 |
+
margin: 0 0 0 2px;
|
| 671 |
line-height: 1em;
|
|
|
|
| 672 |
}
|
| 673 |
|
| 674 |
#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar {
|
| 835 |
|
| 836 |
/* =Revisions
|
| 837 |
-------------------------------------------------------------- */
|
| 838 |
+
|
| 839 |
+
#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,
|
| 840 |
+
#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,
|
| 841 |
+
#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log {
|
| 842 |
border-top: 1px dotted #ddd;
|
|
|
|
| 843 |
width: 100%;
|
| 844 |
margin: 0;
|
| 845 |
padding: 8px 0 0 0;
|
| 847 |
color: #aaa;
|
| 848 |
}
|
| 849 |
|
| 850 |
+
#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,
|
| 851 |
+
#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,
|
| 852 |
+
#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li {
|
| 853 |
+
list-style-type: none;
|
| 854 |
+
}
|
| 855 |
+
|
| 856 |
/* =Widgets
|
| 857 |
-------------------------------------------------------------- */
|
| 858 |
|
| 955 |
width: 100%;
|
| 956 |
}
|
| 957 |
|
| 958 |
+
#bbpress-forums .bbp-user-section {
|
| 959 |
+
overflow: auto;
|
| 960 |
+
}
|
| 961 |
+
|
| 962 |
#bbpress-forums #bbp-user-wrapper h2.entry-title {
|
| 963 |
font-size: 1.4em;
|
| 964 |
margin: 0;
|
templates/default/css/bbpress-rtl.min.css
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
#bbpress-forums hr{margin:0 0 24px 0}#bbpress-forums{background:transparent;clear:both;margin-bottom:20px;overflow:hidden;font-size:12px}#bbpress-forums div.even,#bbpress-forums ul.even{background-color:#fff}#bbpress-forums div.odd,#bbpress-forums ul.odd{background-color:#fbfbfb}#bbpress-forums div.reply{height:auto}#bbpress-forums div.bbp-topic-header,#bbpress-forums div.bbp-reply-header{background-color:#f4f4f4}#bbpress-forums .status-trash.even,#bbpress-forums .status-spam.even{background-color:#fee}#bbpress-forums .status-trash.odd,#bbpress-forums .status-spam.odd{background-color:#fdd}#bbpress-forums .status-closed,#bbpress-forums .status-closed a{color:#ccc}#bbpress-forums ul{list-style:none;margin:0;padding:0}#bbpress-forums li{margin:0;list-style:none}#bbpress-forums ul.bbp-lead-topic,#bbpress-forums ul.bbp-topics,#bbpress-forums ul.bbp-forums,#bbpress-forums ul.bbp-replies{font-size:12px;overflow:hidden;border:1px solid #eee;margin-bottom:20px;clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-body,#bbpress-forums li.bbp-footer{clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{background:#f3f3f3;border-top:1px solid #eee;font-weight:bold;padding:8px;text-align:center}#bbpress-forums li.bbp-header{background:#eaeaea}#bbpress-forums li.bbp-header ul{overflow:hidden}#bbpress-forums .bbp-forums-list{margin:0 5px 0 0;padding-right:15px;border-right:1px solid #ddd}#bbpress-forums .bbp-forums-list li{display:inline;font-size:11px}#bbpress-forums li.bbp-footer p{margin:0;line-height:1em}#bbpress-forums .bbp-topic-content img,#bbpress-forums .bbp-reply-content img{max-width:100%}#bbpress-forums .bbp-topic-content ul,#bbpress-forums .bbp-reply-content ul{list-style:square;padding-right:15px}#bbpress-forums .bbp-forum-content p{margin:5px 0 0;font-style:italic}li.bbp-forum-info,li.bbp-topic-title{float:right;text-align:right;width:55%}li.bbp-forum-topic-count,li.bbp-topic-voice-count,li.bbp-forum-reply-count,li.bbp-topic-reply-count{float:right;text-align:center;width:10%}li.bbp-forum-freshness,li.bbp-topic-freshness{text-align:center;float:right;width:22%}#bbpress-forums li.bbp-body ul.forum,#bbpress-forums li.bbp-body ul.topic{border-top:1px solid #eee;overflow:hidden;padding:8px}li.bbp-header div.bbp-topic-content span#subscription-toggle,li.bbp-header div.bbp-topic-content span#favorite-toggle,li.bbp-header div.bbp-reply-content span#subscription-toggle,li.bbp-header div.bbp-reply-content span#favorite-toggle{float:left}#bbpress-forums div.bbp-topic-author,#bbpress-forums div.bbp-reply-author{float:right;text-align:center;width:115px}#bbpress-forums div.bbp-topic-author img.avatar,#bbpress-forums div.bbp-reply-author img.avatar{border:0;max-width:80px;padding:0;margin:12px auto 0 auto;float:none}#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{word-wrap:break-word}#bbpress-forums div.bbp-topic-content,#bbpress-forums div.bbp-reply-content{margin-right:140px;padding:12px 12px 12px 0;text-align:right}#bbpress-forums li.bbp-header .bbp-topic-author,#bbpress-forums li.bbp-footer .bbp-topic-author,#bbpress-forums li.bbp-header .bbp-reply-author,#bbpress-forums li.bbp-footer .bbp-reply-author{float:right;padding:0;width:120px}#bbpress-forums li.bbp-header .bbp-topic-content,#bbpress-forums li.bbp-footer .bbp-topic-content,#bbpress-forums li.bbp-header .bbp-reply-content,#bbpress-forums li.bbp-footer .bbp-reply-content{margin-right:140px;padding:0;text-align:right}div.bbp-topic-header,div.bbp-reply-header,li.bbp-body div.hentry{margin-bottom:0;overflow:hidden;padding:8px}div.bbp-topic-header,div.bbp-reply-header{border-top:1px solid #ddd;clear:both}span.bbp-author-ip{font-family:'Helvetica Neue',Arial,Helvetica,'Nimbus Sans L',sans-serif;font-size:11px;font-weight:bold;color:#aaa}div.bbp-breadcrumb{float:right}div.bbp-breadcrumb,div.bbp-topic-tags{font-size:12px}#content div.bbp-breadcrumb p,#content div.bbp-topic-tags p{margin-bottom:10px}div.bbp-topic-tags{float:left}span.bbp-admin-links{float:left;color:#ddd}span.bbp-admin-links a{color:#bbb;font-weight:normal;font-size:10px;text-transform:uppercase;text-decoration:none}fieldset span.bbp-admin-links{float:right}tr td span.bbp-admin-links a:hover{color:#ff4b33}td.bbp-topic-admin-links,td.bbp-topic-counts{width:50%}.bbp-topic-header a.bbp-topic-permalink,.bbp-reply-header a.bbp-reply-permalink{float:left;margin-right:10px;color:#ccc}.bbp-topic-action #favorite-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #favorite-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #favorite-toggle span.is-favorite a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #favorite-toggle span.is-favorite a:hover{color:#c88;border-color:#c88;background-color:#fdd}.bbp-topic-action #subscription-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #subscription-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #subscription-toggle span.is-subscribed a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #subscription-toggle span.is-subscribed a:hover{color:#c88;border-color:#c88;background-color:#fdd}#content p.bbp-topic-meta{margin-bottom:0;font-size:11px}#content p.bbp-topic-meta span{white-space:nowrap}.bbp-pagination-count{float:right}.bbp-pagination-links{float:left}.bbp-pagination{float:right;width:100%;margin-bottom:20px}.bbp-topic-pagination{display:inline-block;margin-right:5px;margin-bottom:2px}.bbp-topic-pagination a{font-size:10px;line-height:10px;padding:1px 3px;border:1px solid #ddd;text-decoration:none}#content fieldset.bbp-form,#container fieldset.bbp-form,#wrapper fieldset.bbp-form{clear:right}#content fieldset.bbp-form,#container fieldset.bbp-form,#wrapper fieldset.bbp-form{border:1px solid #eee;padding:10px 20px;margin-bottom:10px}#content fieldset.bbp-form legend,#container fieldset.bbp-form legend,#wrapper fieldset.bbp-form legend{padding:5px}#content fieldset.bbp-form label,#container fieldset.bbp-form label,#wrapper fieldset.bbp-form label{margin:0;display:inline-block}#bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,#bbp-login fieldset label,#bbp-register fieldset label,#bbp-lost-pass fieldset label{width:100px}#content fieldset.bbp-form p,#container fieldset.bbp-form p,#wrapper fieldset.bbp-form p,#content fieldset.bbp-form textarea,#container fieldset.bbp-form textarea,#wrapper fieldset.bbp-form textarea,#content fieldset.bbp-form select,#container fieldset.bbp-form select,#wrapper fieldset.bbp-form select,#content fieldset.bbp-form input,#container fieldset.bbp-form input,#wrapper fieldset.bbp-form input{margin:0 0 10px}textarea#bbp_reply_content,textarea#bbp_topic_content,textarea#bbp_forum_content{width:97%;box-sizing:border-box}textarea#bbp_forum_content{height:210px}#content fieldset.bbp-forum-form-attributes,#container fieldset.bbp-forum-form-attributes,#wrapper fieldset.bbp-forum-form-attributes{width:200px;float:left;clear:none;margin-right:25px}#bbpress-forums fieldset select#bbp_forum_id{max-width:200px}.bbp-topic-form,.bbp-reply-form,.bbp-topic-tag-form{clear:right}body.topic-edit .bbp-topic-form div.avatar img,body.reply-edit .bbp-reply-form div.avatar img,body.single-forum .bbp-topic-form div.avatar img,body.single-reply .bbp-reply-form div.avatar img{margin-left:0;padding:10px;border:1px solid #ddd;line-height:0;background-color:#efefef}body.page .bbp-reply-form code,body.page .bbp-topic-form code,body.single-topic .bbp-reply-form code,body.single-forum .bbp-topic-form code,body.topic-edit .bbp-topic-form code,body.reply-edit .bbp-reply-form code{font-size:10px;background-color:#f0fff8;border:1px solid #ceefe1;display:block;padding:8px;margin-top:5px;width:369px}#merge_tag,#delete_tag{display:inline}div.bbp-submit-wrapper{margin-top:15px;float:left;clear:both}p.form-allowed-tags{width:462px}input[type="password"]{background:#f9f9f9;border:1px solid #ccc;box-shadow:inset 1px 1px 1px rgba(0,0,0,0.1);padding:2px}#content div.bbp-the-content-wrapper{margin-bottom:10px}#content div.bbp-the-content-wrapper textarea.bbp-the-content{width:100%;margin:0;font-size:12px}#content div.bbp-the-content-wrapper table,#content div.bbp-the-content-wrapper tbody,#content div.bbp-the-content-wrapper tr,#content div.bbp-the-content-wrapper td{border:0;padding:0;margin:0;width:auto;line-height:1em}#content div.bbp-the-content-wrapper input{font-size:12px;padding:5px;margin:3px 0 0;line-height:1em;margin:0}#content div.bbp-the-content-wrapper div.quicktags-toolbar{padding:5px;min-height:26px}#content div.bbp-the-content-wrapper td.mceToolbar{padding:4px 4px 8px}#content div.wp-editor-container{margin:0;padding:0;line-height:0}#content div.bbp-the-content-wrapper td.mceStatusbar{line-height:16px}#bbp-your-profile fieldset{margin-top:20px;padding:20px 20px 0 20px}#bbp-your-profile fieldset div{margin-bottom:20px;float:right;width:100%;clear:right}#bbp-your-profile fieldset select{margin-bottom:0}#bbp-your-profile fieldset input,#bbp-your-profile fieldset textarea{margin-bottom:0;width:400px;background:#f9f9f9;border:1px solid #ccc;box-shadow:inset 1px 1px 1px rgba(0,0,0,0.1);padding:2px}#bbp-your-profile fieldset legend{display:none}#content #bbp-your-profile fieldset label,#container #bbp-your-profile fieldset label{float:right;width:150px;padding-left:20px;text-align:left}#bbp-your-profile fieldset span.description{margin:5px 0 0 170px;font-size:12px;font-style:italic;float:right;clear:right;width:383px;padding:5px 10px;border:#cee1ef 1px solid;background-color:#f0f8ff}#content #bbp-your-profile fieldset fieldset,#container #bbp-your-profile fieldset fieldset{margin:0;width:260px;border:0;padding:0;clear:none;float:none}#bbp-your-profile fieldset fieldset span.description{margin-right:0;margin-bottom:20px}#bbp-your-profile fieldset.submit button{float:left}div.bbp-template-notice{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 0 15px;border-radius:3px;background-color:#ffffe0;border-color:#e6db55;color:#000;clear:both}div.bbp-template-notice a{color:#555;text-decoration:none}div.bbp-template-notice a:hover{color:#000}div.bbp-template-notice.info{border:#cee1ef 1px solid;background-color:#f0f8ff}div.bbp-template-notice.important{border:#e6db55 1px solid;background-color:#fffbcc}div.bbp-template-notice.error,div.bbp-template-notice.warning{background-color:#ffebe8;border-color:#c00}div.bbp-template-notice.error a,div.bbp-template-notice.warning a{color:#c00}div.bbp-template-notice p{margin:.5em 0 6px 0!important;padding:2px;font-size:12px;line-height:140%}.bbp-topics-front ul.super-sticky,.bbp-topics ul.super-sticky,.bbp-topics ul.sticky,.bbp-forum-content ul.sticky{background-color:#ffffe0!important;font-size:1.1em}#content .bbp-topic-revision-log,#content .bbp-reply-revision-log,#main .bbp-topic-revision-log,#main .bbp-reply-revision-log,#container .bbp-topic-revision-log,#container .bbp-reply-revision-log{border-top:1px dotted #ddd;list-style:none;width:100%;margin:0;padding:8px 0 0 0;font-size:11px;color:#aaa}.bbp-login-form fieldset legend{display:none}.bbp-login-form .bbp-username input,.bbp-login-form .bbp-email input,.bbp-login-form .bbp-password input{padding:5px}.bbp-login-form .bbp-username label,.bbp-login-form .bbp-password label{width:70px;display:inline-block}.bbp-login-form .bbp-username,.bbp-login-form .bbp-password,.bbp-login-form .bbp-remember-me,.bbp-login-form .bbp-submit-wrapper{margin-top:10px}.bbp-login-form .bbp-submit-wrapper{text-align:left}.bbp-login-form .bbp-login-links a{float:right;clear:right}.bbp-logged-in img.avatar{float:right;margin-left:15px}.bbp-logged-in h4{font-weight:bold;font-size:1.3em;clear:none;margin-bottom:10px}#bbpress-forums p.bbp-topic-meta img.avatar,#bbpress-forums ul.bbp-reply-revision-log img.avatar,#bbpress-forums ul.bbp-topic-revision-log img.avatar,#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums .widget_display_topics img.avatar,#bbpress-forums .widget_display_replies img.avatar,#bbpress-forums p.bbp-topic-meta img.avatar{float:none;margin-bottom:-7px;border:3px double #ddd}fieldset div.avatar{float:left}.activity-list li.bbp_topic_create .activity-content .activity-inner,.activity-list li.bbp_reply_create .activity-content .activity-inner{border-right:2px solid #eaeaea;margin-right:5px;padding-right:10px}#bbpress-forums h1{clear:none;font-size:1.8em;line-height:1em;padding-bottom:10px}#bbpress-forums h2.entry-title{font-size:1.4em;margin-bottom:0;padding-bottom:10px;padding-top:0}#bbpress-forums #bbp-single-user-details{display:inline-block;margin:0;width:150px;vertical-align:top;overflow:hidden}#bbpress-forums #bbp-single-user-details #bbp-user-avatar{margin:0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar{border:0;height:150px;padding:0;margin:0 0 20px 0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-description{float:none;margin:0 180px 0 0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation{float:none;margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li{margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation a{padding:5px 8px;display:block;border:1px solid transparent;text-decoration:none;text-align:right}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li.current a{background:#eee;opacity:.8}#bbpress-forums #bbp-user-body{display:inline-block;vertical-align:top;margin:0 30px 0 0;width:80%;float:left;text-align:right}body.my-account #bbpress-forums{border-top:0;padding-top:0;margin-bottom:0}body.my-account #bbpress-forums,body.my-account #bbp-author-subscriptions,body.my-account #bbp-author-favorites,body.my-account #bbp-author-topics-started{border-top:0;padding-top:0;margin-bottom:0}#bbpress-forums dl.bbp-user-capabilities{display:inline-block;vertical-align:top}#bbpress-forums dl.bbp-user-capabilities dt{margin:0 0 10px;text-transform:capitalize}#bbpress-forums dl.bbp-user-capabilities dd{margin:0;padding:0}#bbpress-forums div.row-actions{font-size:11px;visibility:hidden}#bbpress-forums li:hover>div.row-actions{visibility:visible}
|
| 1 |
+
#bbpress-forums hr{margin:0 0 24px 0}#bbpress-forums{background:transparent;clear:both;margin-bottom:20px;overflow:hidden;font-size:12px}#bbpress-forums div.even,#bbpress-forums ul.even{background-color:#fff}#bbpress-forums div.odd,#bbpress-forums ul.odd{background-color:#fbfbfb}#bbpress-forums div.reply{height:auto}#bbpress-forums div.bbp-forum-header,#bbpress-forums div.bbp-topic-header,#bbpress-forums div.bbp-reply-header{background-color:#f4f4f4}#bbpress-forums .status-trash.even,#bbpress-forums .status-spam.even{background-color:#fee}#bbpress-forums .status-trash.odd,#bbpress-forums .status-spam.odd{background-color:#fdd}#bbpress-forums .status-closed,#bbpress-forums .status-closed a{color:#ccc}#bbpress-forums ul{list-style:none;margin:0;padding:0}#bbpress-forums li{margin:0;list-style:none}#bbpress-forums ul.bbp-lead-topic,#bbpress-forums ul.bbp-topics,#bbpress-forums ul.bbp-forums,#bbpress-forums ul.bbp-replies,#bbpress-forums ul.bbp-search-results{font-size:12px;overflow:hidden;border:1px solid #eee;margin-bottom:20px;clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-body,#bbpress-forums li.bbp-footer{clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{background:#f3f3f3;border-top:1px solid #eee;font-weight:bold;padding:8px;text-align:center}#bbpress-forums li.bbp-header{background:#eaeaea}#bbpress-forums li.bbp-header ul{overflow:hidden}#bbpress-forums .bbp-forums-list{margin:0 5px 0 0;padding-right:15px;border-right:1px solid #ddd}#bbpress-forums .bbp-forums-list li{display:inline;font-size:11px}#bbpress-forums li.bbp-footer p{margin:0;line-height:1em}li.bbp-forum-info,li.bbp-topic-title{float:right;text-align:right;width:55%}li.bbp-forum-topic-count,li.bbp-topic-voice-count,li.bbp-forum-reply-count,li.bbp-topic-reply-count{float:right;text-align:center;width:10%}li.bbp-forum-freshness,li.bbp-topic-freshness{text-align:center;float:right;width:22%}#bbpress-forums li.bbp-body ul.forum,#bbpress-forums li.bbp-body ul.topic{border-top:1px solid #eee;overflow:hidden;padding:8px}li.bbp-header div.bbp-topic-content span#subscription-toggle,li.bbp-header div.bbp-topic-content span#favorite-toggle,li.bbp-header div.bbp-reply-content span#subscription-toggle,li.bbp-header div.bbp-reply-content span#favorite-toggle{float:left}#bbpress-forums div.bbp-forum-title h3,#bbpress-forums div.bbp-topic-title h3,#bbpress-forums div.bbp-reply-title h3{line-height:1em;margin:8px 0}#bbpress-forums div.bbp-forum-author,#bbpress-forums div.bbp-topic-author,#bbpress-forums div.bbp-reply-author{float:right;text-align:center;width:115px}#bbpress-forums div.bbp-forum-author img.avatar,#bbpress-forums div.bbp-topic-author img.avatar,#bbpress-forums div.bbp-reply-author img.avatar{border:0;max-width:80px;padding:0;margin:12px auto 0 auto;float:none}#bbpress-forums div.bbp-forum-author a.bbp-author-name,#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{margin:0 12px;word-break:break-word;display:inline-block}#bbpress-forums div.bbp-forum-author .bbp-author-role,#bbpress-forums div.bbp-topic-author .bbp-author-role,#bbpress-forums div.bbp-reply-author .bbp-author-role{font-size:11px;font-style:italic}#bbpress-forums li.bbp-header .bbp-search-author,#bbpress-forums li.bbp-footer .bbp-search-author,#bbpress-forums li.bbp-header .bbp-forum-author,#bbpress-forums li.bbp-footer .bbp-forum-author,#bbpress-forums li.bbp-header .bbp-topic-author,#bbpress-forums li.bbp-footer .bbp-topic-author,#bbpress-forums li.bbp-header .bbp-reply-author,#bbpress-forums li.bbp-footer .bbp-reply-author{float:right;margin:0;padding:0;width:120px}#bbpress-forums li.bbp-header .bbp-search-content,#bbpress-forums li.bbp-footer .bbp-search-content,#bbpress-forums li.bbp-header .bbp-forum-content,#bbpress-forums li.bbp-footer .bbp-forum-content,#bbpress-forums li.bbp-header .bbp-topic-content,#bbpress-forums li.bbp-footer .bbp-topic-content,#bbpress-forums li.bbp-header .bbp-reply-content,#bbpress-forums li.bbp-footer .bbp-reply-content{margin-right:140px;padding:0;text-align:right}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header,li.bbp-body div.hentry{margin-bottom:0;overflow:hidden;padding:8px}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header{border-top:1px solid #ddd;clear:both}span.bbp-author-ip{font-family:'Helvetica Neue',Arial,Helvetica,'Nimbus Sans L',sans-serif;font-size:11px;font-weight:bold;color:#aaa}#bbpress-forums div.bbp-forum-content,#bbpress-forums div.bbp-topic-content,#bbpress-forums div.bbp-reply-content{margin-right:130px;padding:12px 0 12px 12px;text-align:right}#bbpress-forums div.bbp-topic-content a,#bbpress-forums div.bbp-reply-content a{background:0;border:0;display:inline;font-weight:normal;margin:0;padding:0}#bbpress-forums div.bbp-topic-content h1,#bbpress-forums div.bbp-reply-content h1,#bbpress-forums div.bbp-topic-content h2,#bbpress-forums div.bbp-reply-content h2,#bbpress-forums div.bbp-topic-content h3,#bbpress-forums div.bbp-reply-content h3,#bbpress-forums div.bbp-topic-content h4,#bbpress-forums div.bbp-reply-content h4,#bbpress-forums div.bbp-topic-content h5,#bbpress-forums div.bbp-reply-content h5,#bbpress-forums div.bbp-topic-content h6,#bbpress-forums div.bbp-reply-content h6{clear:none;line-height:1em;margin:24px 0;padding:0}#bbpress-forums div.bbp-topic-content img,#bbpress-forums div.bbp-reply-content img{max-width:100%}#bbpress-forums div.bbp-topic-content ul,#bbpress-forums div.bbp-reply-content ul,#bbpress-forums div.bbp-topic-content ol,#bbpress-forums div.bbp-reply-content ol{margin:0 15px 15px;padding:0}#bbpress-forums div.bbp-topic-content ul li,#bbpress-forums div.bbp-reply-content ul li{list-style-type:disc}#bbpress-forums div.bbp-topic-content ol li,#bbpress-forums div.bbp-reply-content ol li{list-style-type:decimal}#bbpress-forums div.bbp-topic-content ol li li,#bbpress-forums div.bbp-reply-content ol li li{list-style-type:lower-alpha}#bbpress-forums div.bbp-topic-content ol li li li,#bbpress-forums div.bbp-reply-content ol li li li{list-style-type:upper-roman}#bbpress-forums div.bbp-topic-content code,#bbpress-forums div.bbp-reply-content code,#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{font-family:Inconsolata,Consolas,Monaco,Lucida Console,monospace;display:inline;background-color:#f9f9f9;border:1px solid #ddd;padding:2px}#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{display:block;line-height:18px;margin:0 0 24px;padding:5px 10px;white-space:pre;white-space:pre-wrap;word-wrap:break-word}#bbpress-forums div.bbp-topic-content pre code,#bbpress-forums div.bbp-reply-content pre code{display:block;border:0;padding:0;margin:0;background-color:transparent}div.bbp-breadcrumb{float:right}div.bbp-breadcrumb,div.bbp-topic-tags{font-size:12px}#bbpress-forums div.bbp-breadcrumb p,#bbpress-forums div.bbp-topic-tags p{margin-bottom:10px}#bbpress-forums div.bbp-topic-tags{float:left}#bbp-topic-hot-tags{clear:both}#bbpress-forums #bbp-search-form{clear:right}#bbpress-forums div.bbp-search-form{float:left}span.bbp-admin-links{float:left;color:#ddd}span.bbp-admin-links a{color:#bbb;font-weight:normal;font-size:10px;text-transform:uppercase;text-decoration:none}fieldset span.bbp-admin-links{float:right}tr td span.bbp-admin-links a:hover{color:#ff4b33}td.bbp-topic-admin-links,td.bbp-topic-counts{width:50%}.bbp-forum-header a.bbp-forum-permalink,.bbp-topic-header a.bbp-topic-permalink,.bbp-reply-header a.bbp-reply-permalink{float:left;margin-right:10px;color:#ccc}.bbp-topic-action #favorite-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #favorite-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #favorite-toggle span.is-favorite a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #favorite-toggle span.is-favorite a:hover{color:#c88;border-color:#c88;background-color:#fdd}.bbp-topic-action #subscription-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #subscription-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #subscription-toggle span.is-subscribed a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #subscription-toggle span.is-subscribed a:hover{color:#c88;border-color:#c88;background-color:#fdd}#bbpress-forums .bbp-forum-info .bbp-forum-content,#bbpress-forums p.bbp-topic-meta{margin:5px 0 5px;padding:0;font-size:11px}#bbpress-forums p.bbp-topic-meta span{white-space:nowrap}.bbp-pagination-count{float:right;border:1px solid transparent}.bbp-pagination-links{float:left;list-style:none;display:inline}.bbp-pagination-links a,.bbp-pagination-links span.current{display:block;float:right;padding:0 5px;margin-right:5px;border:1px solid #efefef;text-decoration:none}.bbp-pagination-links a:hover,.bbp-pagination-links span.current{background:#eee;opacity:.8;border:1px solid #ddd}.bbp-pagination-links span.dots{display:block;float:right;padding:1px 4px;margin-right:5px}.bbp-pagination{float:right;width:100%;margin-bottom:15px}.bbp-topic-pagination{display:inline-block;margin-right:5px;margin-bottom:2px}.bbp-topic-pagination a{font-size:10px;line-height:10px;padding:1px 3px;border:1px solid #ddd;text-decoration:none}#bbpress-forums fieldset.bbp-form{clear:right}#bbpress-forums fieldset.bbp-form{border:1px solid #eee;padding:10px 20px;margin-bottom:10px}#bbpress-forums fieldset.bbp-form legend{padding:5px}#bbpress-forums fieldset.bbp-form label{margin:0;display:inline-block}#bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,#bbp-login fieldset label,#bbp-register fieldset label,#bbp-lost-pass fieldset label{width:100px}#bbpress-forums fieldset.bbp-form p,#bbpress-forums fieldset.bbp-form textarea,#bbpress-forums fieldset.bbp-form select,#bbpress-forums fieldset.bbp-form input{margin:0 0 8px}textarea#bbp_reply_content,textarea#bbp_topic_content,textarea#bbp_forum_content{width:97%;box-sizing:border-box}textarea#bbp_forum_content{height:210px}#bbpress-forums fieldset.bbp-forum-form-attributes{width:200px;float:left;clear:none;margin-right:25px}#bbpress-forums fieldset select#bbp_forum_id{max-width:200px}.bbp-topic-form,.bbp-reply-form,.bbp-topic-tag-form{clear:right}body.topic-edit .bbp-topic-form div.avatar img,body.reply-edit .bbp-reply-form div.avatar img,body.single-forum .bbp-topic-form div.avatar img,body.single-reply .bbp-reply-form div.avatar img{margin-left:0;padding:10px;border:1px solid #ddd;line-height:0;background-color:#efefef}body.page .bbp-reply-form code,body.page .bbp-topic-form code,body.single-topic .bbp-reply-form code,body.single-forum .bbp-topic-form code,body.topic-edit .bbp-topic-form code,body.reply-edit .bbp-reply-form code{font-size:10px;background-color:#f0fff8;border:1px solid #ceefe1;display:block;padding:8px;margin-top:5px;width:369px}#merge_tag,#delete_tag{display:inline}div.bbp-submit-wrapper{margin-top:15px;float:left;clear:both}p.form-allowed-tags{width:462px}#bbpress-forums div.bbp-the-content-wrapper{margin-bottom:10px}#bbpress-forums div.bbp-the-content-wrapper textarea.bbp-the-content{width:100%;margin:0;font-size:12px}#bbpress-forums div.bbp-the-content-wrapper table,#bbpress-forums div.bbp-the-content-wrapper tbody,#bbpress-forums div.bbp-the-content-wrapper tr,#bbpress-forums div.bbp-the-content-wrapper td{border:0;padding:0;margin:0;width:auto;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper input{font-size:12px;padding:5px;margin:0 0 0 2px;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar{padding:5px;min-height:26px}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar{padding:4px 4px 8px}#bbpress-forums div.wp-editor-container{margin:0;padding:0;line-height:0}#bbpress-forums div.bbp-the-content-wrapper td.mceStatusbar{line-height:16px}#bbpress-forums #bbp-your-profile fieldset{padding:20px 20px 0 20px}#bbpress-forums #bbp-your-profile fieldset div{margin-bottom:20px;float:right;width:100%;clear:right}#bbpress-forums #bbp-your-profile fieldset select{margin-bottom:0}#bbpress-forums #bbp-your-profile fieldset input,#bbpress-forums #bbp-your-profile fieldset textarea{margin-bottom:0;width:60%;background:#f9f9f9;border:1px solid #ddd;box-shadow:none;padding:5px 8px;border-radius:0}#bbpress-forums #bbp-your-profile fieldset input:focus,#bbpress-forums #bbp-your-profile fieldset textarea:focus{border:1px solid #ccc;box-shadow:inset 1px 1px 1px rgba(0,0,0,0.1);outline-color:rgba(240,255,240,0.1)}#bbpress-forums #bbp-your-profile fieldset.bbp-form input.checkbox{width:auto}#bbpress-forums #bbp-your-profile fieldset legend{display:none}#bbpress-forums #bbp-your-profile fieldset label[for]{float:right;width:20%;padding:5px 5px 5px 20px;text-align:left;cursor:pointer}#bbpress-forums #bbp-your-profile fieldset dl label[for]{text-align:right;width:60%}#bbpress-forums #bbp-your-profile fieldset span.description{margin:5px 0 0 20%;font-size:12px;font-style:italic;float:right;clear:right;width:60%;padding:5px 8px;border:#cee1ef 1px solid;background-color:#f0f8ff}#bbpress-forums #bbp-your-profile fieldset fieldset{margin:0;border:0;padding:0;clear:none;float:none}#bbpress-forums #bbp-your-profile fieldset fieldset.password{width:60%;display:inline}#bbpress-forums #bbp-your-profile fieldset fieldset.password input,#bbpress-forums #bbp-your-profile fieldset fieldset.password span{width:100%}#bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl{margin:0}#bbpress-forums #bbp-your-profile fieldset fieldset.password span.description{margin-right:0;margin-bottom:20px}#bbpress-forums #bbp-your-profile fieldset.submit button{float:left}div.bbp-template-notice,div.indicator-hint{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 0 15px;border-radius:3px;background-color:#ffffe0;border-color:#e6db55;color:#000;clear:both}div.bbp-template-notice a{color:#555;text-decoration:none}div.bbp-template-notice a:hover{color:#000}div.bbp-template-notice.info{border:#cee1ef 1px solid;background-color:#f0f8ff}div.bbp-template-notice.important{border:#e6db55 1px solid;background-color:#fffbcc}div.bbp-template-notice.error,div.bbp-template-notice.warning{background-color:#ffebe8;border-color:#c00}div.bbp-template-notice.error a,div.bbp-template-notice.warning a{color:#c00}div.bbp-template-notice p{margin:.5em 0 6px 0!important;padding:2px;font-size:12px;line-height:140%}.bbp-topics-front ul.super-sticky,.bbp-topics ul.super-sticky,.bbp-topics ul.sticky,.bbp-forum-content ul.sticky{background-color:#ffffe0!important;font-size:1.1em}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log{border-top:1px dotted #ddd;width:100%;margin:0;padding:8px 0 0 0;font-size:11px;color:#aaa}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li{list-style-type:none}.bbp-login-form fieldset legend{display:none}.bbp-login-form .bbp-username input,.bbp-login-form .bbp-email input,.bbp-login-form .bbp-password input{padding:5px}.bbp-login-form label{width:140px;display:inline-block}#sidebar .bbp-login-form label{width:70px}.bbp-login-form .bbp-username,.bbp-login-form .bbp-email,.bbp-login-form .bbp-password,.bbp-login-form .bbp-remember-me,.bbp-login-form .bbp-submit-wrapper{margin-top:10px}.bbp-login-form .bbp-submit-wrapper{text-align:left}.bbp-login-form .bbp-login-links a{float:right;clear:right}.bbp-logged-in img.avatar{float:right;margin:0 0 0 15px}.bbp-logged-in h4{font-weight:bold;font-size:1.3em;clear:none;margin-bottom:10px}#bbpress-forums p.bbp-topic-meta img.avatar,#bbpress-forums ul.bbp-reply-revision-log img.avatar,#bbpress-forums ul.bbp-topic-revision-log img.avatar,#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums .widget_display_topics img.avatar,#bbpress-forums .widget_display_replies img.avatar,#bbpress-forums p.bbp-topic-meta img.avatar{float:none;margin-bottom:-7px;border:3px double #ddd}fieldset div.avatar{float:left}.activity-list li.bbp_topic_create .activity-content .activity-inner,.activity-list li.bbp_reply_create .activity-content .activity-inner{border-right:2px solid #eaeaea;margin-right:5px;padding-right:10px}#bbpress-forums h1{clear:none;font-size:1.8em;line-height:1em;padding-bottom:10px}#bbpress-forums #bbp-user-wrapper{float:right;width:100%}#bbpress-forums .bbp-user-section{overflow:auto}#bbpress-forums #bbp-user-wrapper h2.entry-title{font-size:1.4em;margin:0;padding-bottom:10px;padding-top:0;clear:none}#bbpress-forums #bbp-user-wrapper ul.bbp-lead-topic,#bbpress-forums #bbp-user-wrapper ul.bbp-topics,#bbpress-forums #bbp-user-wrapper ul.bbp-forums,#bbpress-forums #bbp-user-wrapper ul.bbp-replies,#bbpress-forums #bbp-user-wrapper fieldset.bbp-form{clear:none}#bbpress-forums #bbp-single-user-details{margin:0;width:150px;float:right;overflow:hidden}#bbpress-forums #bbp-single-user-details #bbp-user-avatar{margin:0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar{border:0;height:150px;padding:0;margin:0 0 20px 0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-description{float:none;margin-right:180px}#bbpress-forums #bbp-single-user-details #bbp-user-navigation{float:none;margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li{margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation a{padding:5px 8px;display:block;border:1px solid transparent;text-decoration:none}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li.current a{background:#eee;opacity:.8}#bbpress-forums #bbp-user-body{margin-right:180px}body.my-account #bbpress-forums{border-top:0;padding-top:0;margin-bottom:0}#bbpress-forums dl.bbp-user-capabilities{display:inline-block;vertical-align:top}#bbpress-forums dl.bbp-user-capabilities dt{margin:0 0 10px;text-transform:capitalize}#bbpress-forums dl.bbp-user-capabilities dd{margin:0;padding:0}#bbpress-forums div.row-actions{font-size:11px;visibility:hidden}#bbpress-forums li:hover>div.row-actions{visibility:visible}
|
templates/default/css/bbpress.css
CHANGED
|
@@ -34,6 +34,7 @@
|
|
| 34 |
height: auto;
|
| 35 |
}
|
| 36 |
|
|
|
|
| 37 |
#bbpress-forums div.bbp-topic-header,
|
| 38 |
#bbpress-forums div.bbp-reply-header {
|
| 39 |
background-color: #f4f4f4;
|
|
@@ -67,7 +68,8 @@
|
|
| 67 |
#bbpress-forums ul.bbp-lead-topic,
|
| 68 |
#bbpress-forums ul.bbp-topics,
|
| 69 |
#bbpress-forums ul.bbp-forums,
|
| 70 |
-
#bbpress-forums ul.bbp-replies
|
|
|
|
| 71 |
font-size: 12px;
|
| 72 |
overflow: hidden;
|
| 73 |
border: 1px solid #eee;
|
|
@@ -114,22 +116,6 @@
|
|
| 114 |
line-height: 1em;
|
| 115 |
}
|
| 116 |
|
| 117 |
-
#bbpress-forums .bbp-topic-content img,
|
| 118 |
-
#bbpress-forums .bbp-reply-content img {
|
| 119 |
-
max-width: 100%;
|
| 120 |
-
}
|
| 121 |
-
|
| 122 |
-
#bbpress-forums .bbp-topic-content ul,
|
| 123 |
-
#bbpress-forums .bbp-reply-content ul {
|
| 124 |
-
list-style: square;
|
| 125 |
-
padding-left: 15px;
|
| 126 |
-
}
|
| 127 |
-
|
| 128 |
-
#bbpress-forums .bbp-forum-content p {
|
| 129 |
-
margin: 5px 0 0;
|
| 130 |
-
font-style: italic;
|
| 131 |
-
}
|
| 132 |
-
|
| 133 |
li.bbp-forum-info,
|
| 134 |
li.bbp-topic-title {
|
| 135 |
float: left;
|
|
@@ -166,6 +152,14 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 166 |
float: right;
|
| 167 |
}
|
| 168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
#bbpress-forums div.bbp-topic-author,
|
| 170 |
#bbpress-forums div.bbp-reply-author {
|
| 171 |
float: left;
|
|
@@ -173,6 +167,7 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 173 |
width: 115px;
|
| 174 |
}
|
| 175 |
|
|
|
|
| 176 |
#bbpress-forums div.bbp-topic-author img.avatar,
|
| 177 |
#bbpress-forums div.bbp-reply-author img.avatar {
|
| 178 |
border: none;
|
|
@@ -182,25 +177,25 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 182 |
float: none;
|
| 183 |
}
|
| 184 |
|
|
|
|
| 185 |
#bbpress-forums div.bbp-topic-author a.bbp-author-name,
|
| 186 |
#bbpress-forums div.bbp-reply-author a.bbp-author-name {
|
| 187 |
margin: 0 12px;
|
| 188 |
word-break: break-word;
|
|
|
|
| 189 |
}
|
| 190 |
|
|
|
|
| 191 |
#bbpress-forums div.bbp-topic-author .bbp-author-role,
|
| 192 |
#bbpress-forums div.bbp-reply-author .bbp-author-role {
|
| 193 |
font-size: 11px;
|
| 194 |
font-style: italic;
|
| 195 |
}
|
| 196 |
|
| 197 |
-
#bbpress-forums
|
| 198 |
-
#bbpress-forums
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
text-align: left;
|
| 202 |
-
}
|
| 203 |
-
|
| 204 |
#bbpress-forums li.bbp-header .bbp-topic-author,
|
| 205 |
#bbpress-forums li.bbp-footer .bbp-topic-author,
|
| 206 |
#bbpress-forums li.bbp-header .bbp-reply-author,
|
|
@@ -211,6 +206,10 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 211 |
width: 120px;
|
| 212 |
}
|
| 213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
#bbpress-forums li.bbp-header .bbp-topic-content,
|
| 215 |
#bbpress-forums li.bbp-footer .bbp-topic-content,
|
| 216 |
#bbpress-forums li.bbp-header .bbp-reply-content,
|
|
@@ -220,6 +219,7 @@ li.bbp-header div.bbp-reply-content span#favorite-toggle {
|
|
| 220 |
text-align: left;
|
| 221 |
}
|
| 222 |
|
|
|
|
| 223 |
div.bbp-topic-header,
|
| 224 |
div.bbp-reply-header,
|
| 225 |
li.bbp-body div.hentry {
|
|
@@ -228,6 +228,7 @@ li.bbp-body div.hentry {
|
|
| 228 |
padding: 8px;
|
| 229 |
}
|
| 230 |
|
|
|
|
| 231 |
div.bbp-topic-header,
|
| 232 |
div.bbp-reply-header {
|
| 233 |
border-top: 1px solid #ddd;
|
|
@@ -241,6 +242,109 @@ span.bbp-author-ip {
|
|
| 241 |
color: #aaa;
|
| 242 |
}
|
| 243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
/* =Breadcrumb and Tags
|
| 245 |
-------------------------------------------------------------- */
|
| 246 |
|
|
@@ -258,10 +362,26 @@ div.bbp-topic-tags {
|
|
| 258 |
margin-bottom: 10px
|
| 259 |
}
|
| 260 |
|
| 261 |
-
div.bbp-topic-tags {
|
| 262 |
float: right;
|
| 263 |
}
|
| 264 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
/* =Admin Links
|
| 266 |
-------------------------------------------------------------- */
|
| 267 |
|
|
@@ -287,6 +407,7 @@ td.bbp-topic-counts {
|
|
| 287 |
width: 50%;
|
| 288 |
}
|
| 289 |
|
|
|
|
| 290 |
.bbp-topic-header a.bbp-topic-permalink,
|
| 291 |
.bbp-reply-header a.bbp-reply-permalink {
|
| 292 |
float: right;
|
|
@@ -347,8 +468,10 @@ td.bbp-topic-counts {
|
|
| 347 |
background-color: #fdd;
|
| 348 |
}
|
| 349 |
|
|
|
|
| 350 |
#bbpress-forums p.bbp-topic-meta {
|
| 351 |
margin: 5px 0 5px;
|
|
|
|
| 352 |
font-size: 11px;
|
| 353 |
}
|
| 354 |
|
|
@@ -361,10 +484,37 @@ td.bbp-topic-counts {
|
|
| 361 |
|
| 362 |
.bbp-pagination-count {
|
| 363 |
float: left;
|
|
|
|
| 364 |
}
|
|
|
|
| 365 |
.bbp-pagination-links {
|
| 366 |
float: right;
|
| 367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
.bbp-pagination {
|
| 369 |
float: left;
|
| 370 |
width: 100%;
|
|
@@ -384,6 +534,7 @@ td.bbp-topic-counts {
|
|
| 384 |
text-decoration: none;
|
| 385 |
}
|
| 386 |
|
|
|
|
| 387 |
/* =Forms
|
| 388 |
-------------------------------------------------------------- */
|
| 389 |
|
|
@@ -517,9 +668,8 @@ p.form-allowed-tags {
|
|
| 517 |
#bbpress-forums div.bbp-the-content-wrapper input {
|
| 518 |
font-size: 12px;
|
| 519 |
padding: 5px;
|
| 520 |
-
margin:
|
| 521 |
line-height: 1em;
|
| 522 |
-
margin: 0;
|
| 523 |
}
|
| 524 |
|
| 525 |
#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar {
|
|
@@ -686,10 +836,11 @@ div.bbp-template-notice a {
|
|
| 686 |
|
| 687 |
/* =Revisions
|
| 688 |
-------------------------------------------------------------- */
|
| 689 |
-
|
| 690 |
-
#bbpress-forums .bbp-
|
|
|
|
|
|
|
| 691 |
border-top: 1px dotted #ddd;
|
| 692 |
-
list-style: none;
|
| 693 |
width: 100%;
|
| 694 |
margin: 0;
|
| 695 |
padding: 8px 0 0 0;
|
|
@@ -697,6 +848,12 @@ div.bbp-template-notice a {
|
|
| 697 |
color: #aaa;
|
| 698 |
}
|
| 699 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 700 |
/* =Widgets
|
| 701 |
-------------------------------------------------------------- */
|
| 702 |
|
|
@@ -799,6 +956,10 @@ fieldset div.avatar {
|
|
| 799 |
width: 100%;
|
| 800 |
}
|
| 801 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 802 |
#bbpress-forums #bbp-user-wrapper h2.entry-title {
|
| 803 |
font-size: 1.4em;
|
| 804 |
margin: 0;
|
| 34 |
height: auto;
|
| 35 |
}
|
| 36 |
|
| 37 |
+
#bbpress-forums div.bbp-forum-header,
|
| 38 |
#bbpress-forums div.bbp-topic-header,
|
| 39 |
#bbpress-forums div.bbp-reply-header {
|
| 40 |
background-color: #f4f4f4;
|
| 68 |
#bbpress-forums ul.bbp-lead-topic,
|
| 69 |
#bbpress-forums ul.bbp-topics,
|
| 70 |
#bbpress-forums ul.bbp-forums,
|
| 71 |
+
#bbpress-forums ul.bbp-replies,
|
| 72 |
+
#bbpress-forums ul.bbp-search-results {
|
| 73 |
font-size: 12px;
|
| 74 |
overflow: hidden;
|
| 75 |
border: 1px solid #eee;
|
| 116 |
line-height: 1em;
|
| 117 |
}
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
li.bbp-forum-info,
|
| 120 |
li.bbp-topic-title {
|
| 121 |
float: left;
|
| 152 |
float: right;
|
| 153 |
}
|
| 154 |
|
| 155 |
+
#bbpress-forums div.bbp-forum-title h3,
|
| 156 |
+
#bbpress-forums div.bbp-topic-title h3,
|
| 157 |
+
#bbpress-forums div.bbp-reply-title h3 {
|
| 158 |
+
line-height: 1em;
|
| 159 |
+
margin: 8px 0;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
#bbpress-forums div.bbp-forum-author,
|
| 163 |
#bbpress-forums div.bbp-topic-author,
|
| 164 |
#bbpress-forums div.bbp-reply-author {
|
| 165 |
float: left;
|
| 167 |
width: 115px;
|
| 168 |
}
|
| 169 |
|
| 170 |
+
#bbpress-forums div.bbp-forum-author img.avatar,
|
| 171 |
#bbpress-forums div.bbp-topic-author img.avatar,
|
| 172 |
#bbpress-forums div.bbp-reply-author img.avatar {
|
| 173 |
border: none;
|
| 177 |
float: none;
|
| 178 |
}
|
| 179 |
|
| 180 |
+
#bbpress-forums div.bbp-forum-author a.bbp-author-name,
|
| 181 |
#bbpress-forums div.bbp-topic-author a.bbp-author-name,
|
| 182 |
#bbpress-forums div.bbp-reply-author a.bbp-author-name {
|
| 183 |
margin: 0 12px;
|
| 184 |
word-break: break-word;
|
| 185 |
+
display: inline-block;
|
| 186 |
}
|
| 187 |
|
| 188 |
+
#bbpress-forums div.bbp-forum-author .bbp-author-role,
|
| 189 |
#bbpress-forums div.bbp-topic-author .bbp-author-role,
|
| 190 |
#bbpress-forums div.bbp-reply-author .bbp-author-role {
|
| 191 |
font-size: 11px;
|
| 192 |
font-style: italic;
|
| 193 |
}
|
| 194 |
|
| 195 |
+
#bbpress-forums li.bbp-header .bbp-search-author,
|
| 196 |
+
#bbpress-forums li.bbp-footer .bbp-search-author,
|
| 197 |
+
#bbpress-forums li.bbp-header .bbp-forum-author,
|
| 198 |
+
#bbpress-forums li.bbp-footer .bbp-forum-author,
|
|
|
|
|
|
|
|
|
|
| 199 |
#bbpress-forums li.bbp-header .bbp-topic-author,
|
| 200 |
#bbpress-forums li.bbp-footer .bbp-topic-author,
|
| 201 |
#bbpress-forums li.bbp-header .bbp-reply-author,
|
| 206 |
width: 120px;
|
| 207 |
}
|
| 208 |
|
| 209 |
+
#bbpress-forums li.bbp-header .bbp-search-content,
|
| 210 |
+
#bbpress-forums li.bbp-footer .bbp-search-content,
|
| 211 |
+
#bbpress-forums li.bbp-header .bbp-forum-content,
|
| 212 |
+
#bbpress-forums li.bbp-footer .bbp-forum-content,
|
| 213 |
#bbpress-forums li.bbp-header .bbp-topic-content,
|
| 214 |
#bbpress-forums li.bbp-footer .bbp-topic-content,
|
| 215 |
#bbpress-forums li.bbp-header .bbp-reply-content,
|
| 219 |
text-align: left;
|
| 220 |
}
|
| 221 |
|
| 222 |
+
div.bbp-forum-header,
|
| 223 |
div.bbp-topic-header,
|
| 224 |
div.bbp-reply-header,
|
| 225 |
li.bbp-body div.hentry {
|
| 228 |
padding: 8px;
|
| 229 |
}
|
| 230 |
|
| 231 |
+
div.bbp-forum-header,
|
| 232 |
div.bbp-topic-header,
|
| 233 |
div.bbp-reply-header {
|
| 234 |
border-top: 1px solid #ddd;
|
| 242 |
color: #aaa;
|
| 243 |
}
|
| 244 |
|
| 245 |
+
/* =Topic and reply content
|
| 246 |
+
-------------------------------------------------------------- */
|
| 247 |
+
|
| 248 |
+
#bbpress-forums div.bbp-forum-content,
|
| 249 |
+
#bbpress-forums div.bbp-topic-content,
|
| 250 |
+
#bbpress-forums div.bbp-reply-content {
|
| 251 |
+
margin-left: 130px;
|
| 252 |
+
padding: 12px 12px 12px 0;
|
| 253 |
+
text-align: left;
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
#bbpress-forums div.bbp-topic-content a,
|
| 257 |
+
#bbpress-forums div.bbp-reply-content a {
|
| 258 |
+
background: none;
|
| 259 |
+
border: none;
|
| 260 |
+
display: inline;
|
| 261 |
+
font-weight: normal;
|
| 262 |
+
margin: 0;
|
| 263 |
+
padding: 0;
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
#bbpress-forums div.bbp-topic-content h1,
|
| 267 |
+
#bbpress-forums div.bbp-reply-content h1,
|
| 268 |
+
#bbpress-forums div.bbp-topic-content h2,
|
| 269 |
+
#bbpress-forums div.bbp-reply-content h2,
|
| 270 |
+
#bbpress-forums div.bbp-topic-content h3,
|
| 271 |
+
#bbpress-forums div.bbp-reply-content h3,
|
| 272 |
+
#bbpress-forums div.bbp-topic-content h4,
|
| 273 |
+
#bbpress-forums div.bbp-reply-content h4,
|
| 274 |
+
#bbpress-forums div.bbp-topic-content h5,
|
| 275 |
+
#bbpress-forums div.bbp-reply-content h5,
|
| 276 |
+
#bbpress-forums div.bbp-topic-content h6,
|
| 277 |
+
#bbpress-forums div.bbp-reply-content h6 {
|
| 278 |
+
clear: none;
|
| 279 |
+
line-height: 1em;
|
| 280 |
+
margin: 24px 0;
|
| 281 |
+
padding: 0;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
#bbpress-forums div.bbp-topic-content img,
|
| 285 |
+
#bbpress-forums div.bbp-reply-content img {
|
| 286 |
+
max-width: 100%;
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
#bbpress-forums div.bbp-topic-content ul,
|
| 290 |
+
#bbpress-forums div.bbp-reply-content ul,
|
| 291 |
+
#bbpress-forums div.bbp-topic-content ol,
|
| 292 |
+
#bbpress-forums div.bbp-reply-content ol {
|
| 293 |
+
margin: 0 15px 15px;
|
| 294 |
+
padding: 0;
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
#bbpress-forums div.bbp-topic-content ul li,
|
| 298 |
+
#bbpress-forums div.bbp-reply-content ul li {
|
| 299 |
+
list-style-type: disc;
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
#bbpress-forums div.bbp-topic-content ol li,
|
| 303 |
+
#bbpress-forums div.bbp-reply-content ol li {
|
| 304 |
+
list-style-type: decimal;
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
#bbpress-forums div.bbp-topic-content ol li li,
|
| 308 |
+
#bbpress-forums div.bbp-reply-content ol li li {
|
| 309 |
+
list-style-type: lower-alpha;
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
#bbpress-forums div.bbp-topic-content ol li li li,
|
| 313 |
+
#bbpress-forums div.bbp-reply-content ol li li li {
|
| 314 |
+
list-style-type: upper-roman;
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
#bbpress-forums div.bbp-topic-content code,
|
| 318 |
+
#bbpress-forums div.bbp-reply-content code,
|
| 319 |
+
#bbpress-forums div.bbp-topic-content pre,
|
| 320 |
+
#bbpress-forums div.bbp-reply-content pre {
|
| 321 |
+
font-family: Inconsolata, Consolas, Monaco, Lucida Console, monospace;
|
| 322 |
+
display: inline;
|
| 323 |
+
background-color: #f9f9f9;
|
| 324 |
+
border: 1px solid #ddd;
|
| 325 |
+
padding: 2px;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
#bbpress-forums div.bbp-topic-content pre,
|
| 329 |
+
#bbpress-forums div.bbp-reply-content pre {
|
| 330 |
+
display: block;
|
| 331 |
+
line-height: 18px;
|
| 332 |
+
margin: 0 0 24px;
|
| 333 |
+
padding: 5px 10px;
|
| 334 |
+
white-space: pre;
|
| 335 |
+
white-space: pre-wrap;
|
| 336 |
+
word-wrap: break-word;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
#bbpress-forums div.bbp-topic-content pre code,
|
| 340 |
+
#bbpress-forums div.bbp-reply-content pre code {
|
| 341 |
+
display: block;
|
| 342 |
+
border: none;
|
| 343 |
+
padding: 0;
|
| 344 |
+
margin: 0;
|
| 345 |
+
background-color: transparent;
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
/* =Breadcrumb and Tags
|
| 349 |
-------------------------------------------------------------- */
|
| 350 |
|
| 362 |
margin-bottom: 10px
|
| 363 |
}
|
| 364 |
|
| 365 |
+
#bbpress-forums div.bbp-topic-tags {
|
| 366 |
float: right;
|
| 367 |
}
|
| 368 |
|
| 369 |
+
#bbp-topic-hot-tags {
|
| 370 |
+
clear: both;
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
/* =Search
|
| 374 |
+
-------------------------------------------------------------- */
|
| 375 |
+
|
| 376 |
+
#bbpress-forums #bbp-search-form {
|
| 377 |
+
clear: left;
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
#bbpress-forums div.bbp-search-form {
|
| 381 |
+
float: right;
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
|
| 385 |
/* =Admin Links
|
| 386 |
-------------------------------------------------------------- */
|
| 387 |
|
| 407 |
width: 50%;
|
| 408 |
}
|
| 409 |
|
| 410 |
+
.bbp-forum-header a.bbp-forum-permalink,
|
| 411 |
.bbp-topic-header a.bbp-topic-permalink,
|
| 412 |
.bbp-reply-header a.bbp-reply-permalink {
|
| 413 |
float: right;
|
| 468 |
background-color: #fdd;
|
| 469 |
}
|
| 470 |
|
| 471 |
+
#bbpress-forums .bbp-forum-info .bbp-forum-content,
|
| 472 |
#bbpress-forums p.bbp-topic-meta {
|
| 473 |
margin: 5px 0 5px;
|
| 474 |
+
padding: 0;
|
| 475 |
font-size: 11px;
|
| 476 |
}
|
| 477 |
|
| 484 |
|
| 485 |
.bbp-pagination-count {
|
| 486 |
float: left;
|
| 487 |
+
border: 1px solid transparent;
|
| 488 |
}
|
| 489 |
+
|
| 490 |
.bbp-pagination-links {
|
| 491 |
float: right;
|
| 492 |
+
list-style: none;
|
| 493 |
+
display: inline;
|
| 494 |
+
}
|
| 495 |
+
.bbp-pagination-links a,
|
| 496 |
+
.bbp-pagination-links span.current {
|
| 497 |
+
display: block;
|
| 498 |
+
float: left;
|
| 499 |
+
padding: 0px 5px;
|
| 500 |
+
margin-left: 5px;
|
| 501 |
+
border: 1px solid #efefef;
|
| 502 |
+
text-decoration: none;
|
| 503 |
+
}
|
| 504 |
+
.bbp-pagination-links a:hover,
|
| 505 |
+
.bbp-pagination-links span.current {
|
| 506 |
+
background: #eee;
|
| 507 |
+
opacity: 0.8;
|
| 508 |
+
border: 1px solid #ddd;
|
| 509 |
+
}
|
| 510 |
+
|
| 511 |
+
.bbp-pagination-links span.dots {
|
| 512 |
+
display: block;
|
| 513 |
+
float: left;
|
| 514 |
+
padding: 1px 4px;
|
| 515 |
+
margin-left: 5px;
|
| 516 |
+
}
|
| 517 |
+
|
| 518 |
.bbp-pagination {
|
| 519 |
float: left;
|
| 520 |
width: 100%;
|
| 534 |
text-decoration: none;
|
| 535 |
}
|
| 536 |
|
| 537 |
+
|
| 538 |
/* =Forms
|
| 539 |
-------------------------------------------------------------- */
|
| 540 |
|
| 668 |
#bbpress-forums div.bbp-the-content-wrapper input {
|
| 669 |
font-size: 12px;
|
| 670 |
padding: 5px;
|
| 671 |
+
margin: 0 2px 0 0;
|
| 672 |
line-height: 1em;
|
|
|
|
| 673 |
}
|
| 674 |
|
| 675 |
#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar {
|
| 836 |
|
| 837 |
/* =Revisions
|
| 838 |
-------------------------------------------------------------- */
|
| 839 |
+
|
| 840 |
+
#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,
|
| 841 |
+
#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,
|
| 842 |
+
#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log {
|
| 843 |
border-top: 1px dotted #ddd;
|
|
|
|
| 844 |
width: 100%;
|
| 845 |
margin: 0;
|
| 846 |
padding: 8px 0 0 0;
|
| 848 |
color: #aaa;
|
| 849 |
}
|
| 850 |
|
| 851 |
+
#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,
|
| 852 |
+
#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,
|
| 853 |
+
#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li {
|
| 854 |
+
list-style-type: none;
|
| 855 |
+
}
|
| 856 |
+
|
| 857 |
/* =Widgets
|
| 858 |
-------------------------------------------------------------- */
|
| 859 |
|
| 956 |
width: 100%;
|
| 957 |
}
|
| 958 |
|
| 959 |
+
#bbpress-forums .bbp-user-section {
|
| 960 |
+
overflow: auto;
|
| 961 |
+
}
|
| 962 |
+
|
| 963 |
#bbpress-forums #bbp-user-wrapper h2.entry-title {
|
| 964 |
font-size: 1.4em;
|
| 965 |
margin: 0;
|
templates/default/css/bbpress.min.css
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
#bbpress-forums hr{margin:0 0 24px 0}#bbpress-forums{background:transparent;clear:both;margin-bottom:20px;overflow:hidden;font-size:12px}#bbpress-forums div.even,#bbpress-forums ul.even{background-color:#fff}#bbpress-forums div.odd,#bbpress-forums ul.odd{background-color:#fbfbfb}#bbpress-forums div.reply{height:auto}#bbpress-forums div.bbp-topic-header,#bbpress-forums div.bbp-reply-header{background-color:#f4f4f4}#bbpress-forums .status-trash.even,#bbpress-forums .status-spam.even{background-color:#fee}#bbpress-forums .status-trash.odd,#bbpress-forums .status-spam.odd{background-color:#fdd}#bbpress-forums .status-closed,#bbpress-forums .status-closed a{color:#ccc}#bbpress-forums ul{list-style:none;margin:0;padding:0}#bbpress-forums li{margin:0;list-style:none}#bbpress-forums ul.bbp-lead-topic,#bbpress-forums ul.bbp-topics,#bbpress-forums ul.bbp-forums,#bbpress-forums ul.bbp-replies{font-size:12px;overflow:hidden;border:1px solid #eee;margin-bottom:20px;clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-body,#bbpress-forums li.bbp-footer{clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{background:#f3f3f3;border-top:1px solid #eee;font-weight:bold;padding:8px;text-align:center}#bbpress-forums li.bbp-header{background:#eaeaea}#bbpress-forums li.bbp-header ul{overflow:hidden}#bbpress-forums .bbp-forums-list{margin:0 0 0 5px;padding-left:15px;border-left:1px solid #ddd}#bbpress-forums .bbp-forums-list li{display:inline;font-size:11px}#bbpress-forums li.bbp-footer p{margin:0;line-height:1em}#bbpress-forums .bbp-topic-content img,#bbpress-forums .bbp-reply-content img{max-width:100%}#bbpress-forums .bbp-topic-content ul,#bbpress-forums .bbp-reply-content ul{list-style:square;padding-left:15px}#bbpress-forums .bbp-forum-content p{margin:5px 0 0;font-style:italic}li.bbp-forum-info,li.bbp-topic-title{float:left;text-align:left;width:55%}li.bbp-forum-topic-count,li.bbp-topic-voice-count,li.bbp-forum-reply-count,li.bbp-topic-reply-count{float:left;text-align:center;width:10%}li.bbp-forum-freshness,li.bbp-topic-freshness{text-align:center;float:left;width:22%}#bbpress-forums li.bbp-body ul.forum,#bbpress-forums li.bbp-body ul.topic{border-top:1px solid #eee;overflow:hidden;padding:8px}li.bbp-header div.bbp-topic-content span#subscription-toggle,li.bbp-header div.bbp-topic-content span#favorite-toggle,li.bbp-header div.bbp-reply-content span#subscription-toggle,li.bbp-header div.bbp-reply-content span#favorite-toggle{float:right}#bbpress-forums div.bbp-topic-author,#bbpress-forums div.bbp-reply-author{float:left;text-align:center;width:115px}#bbpress-forums div.bbp-topic-author img.avatar,#bbpress-forums div.bbp-reply-author img.avatar{border:0;max-width:80px;padding:0;margin:12px auto 0 auto;float:none}#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{margin:0 12px;word-break:break-word}#bbpress-forums div.bbp-topic-author .bbp-author-role,#bbpress-forums div.bbp-reply-author .bbp-author-role{font-size:11px;font-style:italic}#bbpress-forums div.bbp-topic-content,#bbpress-forums div.bbp-reply-content{margin-left:140px;padding:12px 12px 12px 0;text-align:left}#bbpress-forums li.bbp-header .bbp-topic-author,#bbpress-forums li.bbp-footer .bbp-topic-author,#bbpress-forums li.bbp-header .bbp-reply-author,#bbpress-forums li.bbp-footer .bbp-reply-author{float:left;margin:0;padding:0;width:120px}#bbpress-forums li.bbp-header .bbp-topic-content,#bbpress-forums li.bbp-footer .bbp-topic-content,#bbpress-forums li.bbp-header .bbp-reply-content,#bbpress-forums li.bbp-footer .bbp-reply-content{margin-left:140px;padding:0;text-align:left}div.bbp-topic-header,div.bbp-reply-header,li.bbp-body div.hentry{margin-bottom:0;overflow:hidden;padding:8px}div.bbp-topic-header,div.bbp-reply-header{border-top:1px solid #ddd;clear:both}span.bbp-author-ip{font-family:'Helvetica Neue',Arial,Helvetica,'Nimbus Sans L',sans-serif;font-size:11px;font-weight:bold;color:#aaa}div.bbp-breadcrumb{float:left}div.bbp-breadcrumb,div.bbp-topic-tags{font-size:12px}#bbpress-forums div.bbp-breadcrumb p,#bbpress-forums div.bbp-topic-tags p{margin-bottom:10px}div.bbp-topic-tags{float:right}span.bbp-admin-links{float:right;color:#ddd}span.bbp-admin-links a{color:#bbb;font-weight:normal;font-size:10px;text-transform:uppercase;text-decoration:none}fieldset span.bbp-admin-links{float:left}tr td span.bbp-admin-links a:hover{color:#ff4b33}td.bbp-topic-admin-links,td.bbp-topic-counts{width:50%}.bbp-topic-header a.bbp-topic-permalink,.bbp-reply-header a.bbp-reply-permalink{float:right;margin-left:10px;color:#ccc}.bbp-topic-action #favorite-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #favorite-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #favorite-toggle span.is-favorite a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #favorite-toggle span.is-favorite a:hover{color:#c88;border-color:#c88;background-color:#fdd}.bbp-topic-action #subscription-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #subscription-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #subscription-toggle span.is-subscribed a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #subscription-toggle span.is-subscribed a:hover{color:#c88;border-color:#c88;background-color:#fdd}#bbpress-forums p.bbp-topic-meta{margin:5px 0 5px;font-size:11px}#bbpress-forums p.bbp-topic-meta span{white-space:nowrap}.bbp-pagination-count{float:left}.bbp-pagination-links{float:right}.bbp-pagination{float:left;width:100%;margin-bottom:15px}.bbp-topic-pagination{display:inline-block;margin-left:5px;margin-bottom:2px}.bbp-topic-pagination a{font-size:10px;line-height:10px;padding:1px 3px;border:1px solid #ddd;text-decoration:none}#bbpress-forums fieldset.bbp-form{clear:left}#bbpress-forums fieldset.bbp-form{border:1px solid #eee;padding:10px 20px;margin-bottom:10px}#bbpress-forums fieldset.bbp-form legend{padding:5px}#bbpress-forums fieldset.bbp-form label{margin:0;display:inline-block}#bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,#bbp-login fieldset label,#bbp-register fieldset label,#bbp-lost-pass fieldset label{width:100px}#bbpress-forums fieldset.bbp-form p,#bbpress-forums fieldset.bbp-form textarea,#bbpress-forums fieldset.bbp-form select,#bbpress-forums fieldset.bbp-form input{margin:0 0 8px}textarea#bbp_reply_content,textarea#bbp_topic_content,textarea#bbp_forum_content{width:97%;box-sizing:border-box}textarea#bbp_forum_content{height:210px}#bbpress-forums fieldset.bbp-forum-form-attributes{width:200px;float:right;clear:none;margin-left:25px}#bbpress-forums fieldset select#bbp_forum_id{max-width:200px}.bbp-topic-form,.bbp-reply-form,.bbp-topic-tag-form{clear:left}body.topic-edit .bbp-topic-form div.avatar img,body.reply-edit .bbp-reply-form div.avatar img,body.single-forum .bbp-topic-form div.avatar img,body.single-reply .bbp-reply-form div.avatar img{margin-right:0;padding:10px;border:1px solid #ddd;line-height:0;background-color:#efefef}body.page .bbp-reply-form code,body.page .bbp-topic-form code,body.single-topic .bbp-reply-form code,body.single-forum .bbp-topic-form code,body.topic-edit .bbp-topic-form code,body.reply-edit .bbp-reply-form code{font-size:10px;background-color:#f0fff8;border:1px solid #ceefe1;display:block;padding:8px;margin-top:5px;width:369px}#merge_tag,#delete_tag{display:inline}div.bbp-submit-wrapper{margin-top:15px;float:right;clear:both}p.form-allowed-tags{width:462px}#bbpress-forums div.bbp-the-content-wrapper{margin-bottom:10px}#bbpress-forums div.bbp-the-content-wrapper textarea.bbp-the-content{width:100%;margin:0;font-size:12px}#bbpress-forums div.bbp-the-content-wrapper table,#bbpress-forums div.bbp-the-content-wrapper tbody,#bbpress-forums div.bbp-the-content-wrapper tr,#bbpress-forums div.bbp-the-content-wrapper td{border:0;padding:0;margin:0;width:auto;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper input{font-size:12px;padding:5px;margin:3px 0 0;line-height:1em;margin:0}#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar{padding:5px;min-height:26px}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar{padding:4px 4px 8px}#bbpress-forums div.wp-editor-container{margin:0;padding:0;line-height:0}#bbpress-forums div.bbp-the-content-wrapper td.mceStatusbar{line-height:16px}#bbpress-forums #bbp-your-profile fieldset{padding:20px 20px 0 20px}#bbpress-forums #bbp-your-profile fieldset div{margin-bottom:20px;float:left;width:100%;clear:left}#bbpress-forums #bbp-your-profile fieldset select{margin-bottom:0}#bbpress-forums #bbp-your-profile fieldset input,#bbpress-forums #bbp-your-profile fieldset textarea{margin-bottom:0;width:300px;background:#f9f9f9;border:1px solid #ddd;box-shadow:none;padding:4px;border-radius:0}#bbpress-forums #bbp-your-profile fieldset input:focus,#bbpress-forums #bbp-your-profile fieldset textarea:focus{border:1px solid #ccc;box-shadow:inset 1px 1px 1px rgba(0,0,0,0.1);outline-color:rgba(240,255,240,0.1)}#bbpress-forums #bbp-your-profile fieldset.bbp-form input.checkbox{width:auto}#bbpress-forums #bbp-your-profile fieldset legend{display:none}#bbpress-forums #bbp-your-profile fieldset label[for]{float:left;width:150px;padding-right:20px;text-align:right;cursor:pointer}#bbpress-forums #bbp-your-profile fieldset dl label[for]{text-align:left;width:160px}#bbpress-forums #bbp-your-profile fieldset span.description{margin:5px 0 0 170px;font-size:12px;font-style:italic;float:left;clear:left;width:288px;padding:5px 10px;border:#cee1ef 1px solid;background-color:#f0f8ff}#bbpress-forums #bbp-your-profile fieldset fieldset{margin:0;border:0;padding:0;clear:none;float:none}#bbpress-forums #bbp-your-profile fieldset fieldset.password{width:260px}#bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl{margin:0}#bbpress-forums #bbp-your-profile fieldset fieldset.password span.description{margin-left:0;margin-bottom:20px}#bbpress-forums #bbp-your-profile fieldset.submit button{float:right}div.bbp-template-notice,div.indicator-hint{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 0 15px;border-radius:3px;background-color:#ffffe0;border-color:#e6db55;color:#000;clear:both}div.bbp-template-notice a{color:#555;text-decoration:none}div.bbp-template-notice a:hover{color:#000}div.bbp-template-notice.info{border:#cee1ef 1px solid;background-color:#f0f8ff}div.bbp-template-notice.important{border:#e6db55 1px solid;background-color:#fffbcc}div.bbp-template-notice.error,div.bbp-template-notice.warning{background-color:#ffebe8;border-color:#c00}div.bbp-template-notice.error a,div.bbp-template-notice.warning a{color:#c00}div.bbp-template-notice p{margin:.5em 0 6px 0!important;padding:2px;font-size:12px;line-height:140%}.bbp-topics-front ul.super-sticky,.bbp-topics ul.super-sticky,.bbp-topics ul.sticky,.bbp-forum-content ul.sticky{background-color:#ffffe0!important;font-size:1.1em}#bbpress-forums .bbp-topic-revision-log,#bbpress-forums .bbp-reply-revision-log{border-top:1px dotted #ddd;list-style:none;width:100%;margin:0;padding:8px 0 0 0;font-size:11px;color:#aaa}.bbp-login-form fieldset legend{display:none}.bbp-login-form .bbp-username input,.bbp-login-form .bbp-email input,.bbp-login-form .bbp-password input{padding:5px}.bbp-login-form label{width:140px;display:inline-block}#sidebar .bbp-login-form label{width:70px}.bbp-login-form .bbp-username,.bbp-login-form .bbp-email,.bbp-login-form .bbp-password,.bbp-login-form .bbp-remember-me,.bbp-login-form .bbp-submit-wrapper{margin-top:10px}.bbp-login-form .bbp-submit-wrapper{text-align:right}.bbp-login-form .bbp-login-links a{float:left;clear:left}.bbp-logged-in img.avatar{float:left;margin:0 15px 0 0}.bbp-logged-in h4{font-weight:bold;font-size:1.3em;clear:none;margin-bottom:10px}#bbpress-forums p.bbp-topic-meta img.avatar,#bbpress-forums ul.bbp-reply-revision-log img.avatar,#bbpress-forums ul.bbp-topic-revision-log img.avatar,#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums .widget_display_topics img.avatar,#bbpress-forums .widget_display_replies img.avatar,#bbpress-forums p.bbp-topic-meta img.avatar{float:none;margin-bottom:-7px;border:3px double #ddd}fieldset div.avatar{float:right}.activity-list li.bbp_topic_create .activity-content .activity-inner,.activity-list li.bbp_reply_create .activity-content .activity-inner{border-left:2px solid #eaeaea;margin-left:5px;padding-left:10px}#bbpress-forums h1{clear:none;font-size:1.8em;line-height:1em;padding-bottom:10px}#bbpress-forums h2.entry-title{font-size:1.4em;margin:0;padding-bottom:10px;padding-top:0}#bbpress-forums #bbp-single-user-details{display:inline-block;margin:0;width:150px;vertical-align:top;overflow:hidden}#bbpress-forums #bbp-single-user-details #bbp-user-avatar{margin:0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar{border:0;height:150px;padding:0;margin:0 0 20px 0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-description{float:none;margin-left:180px}#bbpress-forums #bbp-single-user-details #bbp-user-navigation{float:none;margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li{margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation a{padding:5px 8px;display:block;border:1px solid transparent;text-decoration:none}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li.current a{background:#eee;opacity:.8}#bbpress-forums #bbp-user-body{display:inline-block;vertical-align:top;margin:0 0 0 30px;width:80%}body.my-account #bbpress-forums{border-top:0;padding-top:0;margin-bottom:0}#bbpress-forums dl.bbp-user-capabilities{display:inline-block;vertical-align:top}#bbpress-forums dl.bbp-user-capabilities dt{margin:0 0 10px;text-transform:capitalize}#bbpress-forums dl.bbp-user-capabilities dd{margin:0;padding:0}#bbpress-forums div.row-actions{font-size:11px;visibility:hidden}#bbpress-forums li:hover>div.row-actions{visibility:visible}
|
| 1 |
+
#bbpress-forums hr{margin:0 0 24px 0}#bbpress-forums{background:transparent;clear:both;margin-bottom:20px;overflow:hidden;font-size:12px}#bbpress-forums div.even,#bbpress-forums ul.even{background-color:#fff}#bbpress-forums div.odd,#bbpress-forums ul.odd{background-color:#fbfbfb}#bbpress-forums div.reply{height:auto}#bbpress-forums div.bbp-forum-header,#bbpress-forums div.bbp-topic-header,#bbpress-forums div.bbp-reply-header{background-color:#f4f4f4}#bbpress-forums .status-trash.even,#bbpress-forums .status-spam.even{background-color:#fee}#bbpress-forums .status-trash.odd,#bbpress-forums .status-spam.odd{background-color:#fdd}#bbpress-forums .status-closed,#bbpress-forums .status-closed a{color:#ccc}#bbpress-forums ul{list-style:none;margin:0;padding:0}#bbpress-forums li{margin:0;list-style:none}#bbpress-forums ul.bbp-lead-topic,#bbpress-forums ul.bbp-topics,#bbpress-forums ul.bbp-forums,#bbpress-forums ul.bbp-replies,#bbpress-forums ul.bbp-search-results{font-size:12px;overflow:hidden;border:1px solid #eee;margin-bottom:20px;clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-body,#bbpress-forums li.bbp-footer{clear:both}#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{background:#f3f3f3;border-top:1px solid #eee;font-weight:bold;padding:8px;text-align:center}#bbpress-forums li.bbp-header{background:#eaeaea}#bbpress-forums li.bbp-header ul{overflow:hidden}#bbpress-forums .bbp-forums-list{margin:0 0 0 5px;padding-left:15px;border-left:1px solid #ddd}#bbpress-forums .bbp-forums-list li{display:inline;font-size:11px}#bbpress-forums li.bbp-footer p{margin:0;line-height:1em}li.bbp-forum-info,li.bbp-topic-title{float:left;text-align:left;width:55%}li.bbp-forum-topic-count,li.bbp-topic-voice-count,li.bbp-forum-reply-count,li.bbp-topic-reply-count{float:left;text-align:center;width:10%}li.bbp-forum-freshness,li.bbp-topic-freshness{text-align:center;float:left;width:22%}#bbpress-forums li.bbp-body ul.forum,#bbpress-forums li.bbp-body ul.topic{border-top:1px solid #eee;overflow:hidden;padding:8px}li.bbp-header div.bbp-topic-content span#subscription-toggle,li.bbp-header div.bbp-topic-content span#favorite-toggle,li.bbp-header div.bbp-reply-content span#subscription-toggle,li.bbp-header div.bbp-reply-content span#favorite-toggle{float:right}#bbpress-forums div.bbp-forum-title h3,#bbpress-forums div.bbp-topic-title h3,#bbpress-forums div.bbp-reply-title h3{line-height:1em;margin:8px 0}#bbpress-forums div.bbp-forum-author,#bbpress-forums div.bbp-topic-author,#bbpress-forums div.bbp-reply-author{float:left;text-align:center;width:115px}#bbpress-forums div.bbp-forum-author img.avatar,#bbpress-forums div.bbp-topic-author img.avatar,#bbpress-forums div.bbp-reply-author img.avatar{border:0;max-width:80px;padding:0;margin:12px auto 0 auto;float:none}#bbpress-forums div.bbp-forum-author a.bbp-author-name,#bbpress-forums div.bbp-topic-author a.bbp-author-name,#bbpress-forums div.bbp-reply-author a.bbp-author-name{margin:0 12px;word-break:break-word;display:inline-block}#bbpress-forums div.bbp-forum-author .bbp-author-role,#bbpress-forums div.bbp-topic-author .bbp-author-role,#bbpress-forums div.bbp-reply-author .bbp-author-role{font-size:11px;font-style:italic}#bbpress-forums li.bbp-header .bbp-search-author,#bbpress-forums li.bbp-footer .bbp-search-author,#bbpress-forums li.bbp-header .bbp-forum-author,#bbpress-forums li.bbp-footer .bbp-forum-author,#bbpress-forums li.bbp-header .bbp-topic-author,#bbpress-forums li.bbp-footer .bbp-topic-author,#bbpress-forums li.bbp-header .bbp-reply-author,#bbpress-forums li.bbp-footer .bbp-reply-author{float:left;margin:0;padding:0;width:120px}#bbpress-forums li.bbp-header .bbp-search-content,#bbpress-forums li.bbp-footer .bbp-search-content,#bbpress-forums li.bbp-header .bbp-forum-content,#bbpress-forums li.bbp-footer .bbp-forum-content,#bbpress-forums li.bbp-header .bbp-topic-content,#bbpress-forums li.bbp-footer .bbp-topic-content,#bbpress-forums li.bbp-header .bbp-reply-content,#bbpress-forums li.bbp-footer .bbp-reply-content{margin-left:140px;padding:0;text-align:left}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header,li.bbp-body div.hentry{margin-bottom:0;overflow:hidden;padding:8px}div.bbp-forum-header,div.bbp-topic-header,div.bbp-reply-header{border-top:1px solid #ddd;clear:both}span.bbp-author-ip{font-family:'Helvetica Neue',Arial,Helvetica,'Nimbus Sans L',sans-serif;font-size:11px;font-weight:bold;color:#aaa}#bbpress-forums div.bbp-forum-content,#bbpress-forums div.bbp-topic-content,#bbpress-forums div.bbp-reply-content{margin-left:130px;padding:12px 12px 12px 0;text-align:left}#bbpress-forums div.bbp-topic-content a,#bbpress-forums div.bbp-reply-content a{background:0;border:0;display:inline;font-weight:normal;margin:0;padding:0}#bbpress-forums div.bbp-topic-content h1,#bbpress-forums div.bbp-reply-content h1,#bbpress-forums div.bbp-topic-content h2,#bbpress-forums div.bbp-reply-content h2,#bbpress-forums div.bbp-topic-content h3,#bbpress-forums div.bbp-reply-content h3,#bbpress-forums div.bbp-topic-content h4,#bbpress-forums div.bbp-reply-content h4,#bbpress-forums div.bbp-topic-content h5,#bbpress-forums div.bbp-reply-content h5,#bbpress-forums div.bbp-topic-content h6,#bbpress-forums div.bbp-reply-content h6{clear:none;line-height:1em;margin:24px 0;padding:0}#bbpress-forums div.bbp-topic-content img,#bbpress-forums div.bbp-reply-content img{max-width:100%}#bbpress-forums div.bbp-topic-content ul,#bbpress-forums div.bbp-reply-content ul,#bbpress-forums div.bbp-topic-content ol,#bbpress-forums div.bbp-reply-content ol{margin:0 15px 15px;padding:0}#bbpress-forums div.bbp-topic-content ul li,#bbpress-forums div.bbp-reply-content ul li{list-style-type:disc}#bbpress-forums div.bbp-topic-content ol li,#bbpress-forums div.bbp-reply-content ol li{list-style-type:decimal}#bbpress-forums div.bbp-topic-content ol li li,#bbpress-forums div.bbp-reply-content ol li li{list-style-type:lower-alpha}#bbpress-forums div.bbp-topic-content ol li li li,#bbpress-forums div.bbp-reply-content ol li li li{list-style-type:upper-roman}#bbpress-forums div.bbp-topic-content code,#bbpress-forums div.bbp-reply-content code,#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{font-family:Inconsolata,Consolas,Monaco,Lucida Console,monospace;display:inline;background-color:#f9f9f9;border:1px solid #ddd;padding:2px}#bbpress-forums div.bbp-topic-content pre,#bbpress-forums div.bbp-reply-content pre{display:block;line-height:18px;margin:0 0 24px;padding:5px 10px;white-space:pre;white-space:pre-wrap;word-wrap:break-word}#bbpress-forums div.bbp-topic-content pre code,#bbpress-forums div.bbp-reply-content pre code{display:block;border:0;padding:0;margin:0;background-color:transparent}div.bbp-breadcrumb{float:left}div.bbp-breadcrumb,div.bbp-topic-tags{font-size:12px}#bbpress-forums div.bbp-breadcrumb p,#bbpress-forums div.bbp-topic-tags p{margin-bottom:10px}#bbpress-forums div.bbp-topic-tags{float:right}#bbp-topic-hot-tags{clear:both}#bbpress-forums #bbp-search-form{clear:left}#bbpress-forums div.bbp-search-form{float:right}span.bbp-admin-links{float:right;color:#ddd}span.bbp-admin-links a{color:#bbb;font-weight:normal;font-size:10px;text-transform:uppercase;text-decoration:none}fieldset span.bbp-admin-links{float:left}tr td span.bbp-admin-links a:hover{color:#ff4b33}td.bbp-topic-admin-links,td.bbp-topic-counts{width:50%}.bbp-forum-header a.bbp-forum-permalink,.bbp-topic-header a.bbp-topic-permalink,.bbp-reply-header a.bbp-reply-permalink{float:right;margin-left:10px;color:#ccc}.bbp-topic-action #favorite-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #favorite-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #favorite-toggle span.is-favorite a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #favorite-toggle span.is-favorite a:hover{color:#c88;border-color:#c88;background-color:#fdd}.bbp-topic-action #subscription-toggle a{text-decoration:none;padding:0 3px 1px;color:#7c7;border:1px solid #aca;background-color:#dfd;font-weight:bold;font-size:13px}.bbp-topic-action #subscription-toggle a:hover{color:#5a5;border-color:#7c7;background-color:#beb}.bbp-topic-action #subscription-toggle span.is-subscribed a{color:#faa;border:1px solid #faa;background-color:#fee}.bbp-topic-action #subscription-toggle span.is-subscribed a:hover{color:#c88;border-color:#c88;background-color:#fdd}#bbpress-forums .bbp-forum-info .bbp-forum-content,#bbpress-forums p.bbp-topic-meta{margin:5px 0 5px;padding:0;font-size:11px}#bbpress-forums p.bbp-topic-meta span{white-space:nowrap}.bbp-pagination-count{float:left;border:1px solid transparent}.bbp-pagination-links{float:right;list-style:none;display:inline}.bbp-pagination-links a,.bbp-pagination-links span.current{display:block;float:left;padding:0 5px;margin-left:5px;border:1px solid #efefef;text-decoration:none}.bbp-pagination-links a:hover,.bbp-pagination-links span.current{background:#eee;opacity:.8;border:1px solid #ddd}.bbp-pagination-links span.dots{display:block;float:left;padding:1px 4px;margin-left:5px}.bbp-pagination{float:left;width:100%;margin-bottom:15px}.bbp-topic-pagination{display:inline-block;margin-left:5px;margin-bottom:2px}.bbp-topic-pagination a{font-size:10px;line-height:10px;padding:1px 3px;border:1px solid #ddd;text-decoration:none}#bbpress-forums fieldset.bbp-form{clear:left}#bbpress-forums fieldset.bbp-form{border:1px solid #eee;padding:10px 20px;margin-bottom:10px}#bbpress-forums fieldset.bbp-form legend{padding:5px}#bbpress-forums fieldset.bbp-form label{margin:0;display:inline-block}#bbp-edit-topic-tag.bbp-form fieldset.bbp-form label,#bbp-login fieldset label,#bbp-register fieldset label,#bbp-lost-pass fieldset label{width:100px}#bbpress-forums fieldset.bbp-form p,#bbpress-forums fieldset.bbp-form textarea,#bbpress-forums fieldset.bbp-form select,#bbpress-forums fieldset.bbp-form input{margin:0 0 8px}textarea#bbp_reply_content,textarea#bbp_topic_content,textarea#bbp_forum_content{width:97%;box-sizing:border-box}textarea#bbp_forum_content{height:210px}#bbpress-forums fieldset.bbp-forum-form-attributes{width:200px;float:right;clear:none;margin-left:25px}#bbpress-forums fieldset select#bbp_forum_id{max-width:200px}.bbp-topic-form,.bbp-reply-form,.bbp-topic-tag-form{clear:left}body.topic-edit .bbp-topic-form div.avatar img,body.reply-edit .bbp-reply-form div.avatar img,body.single-forum .bbp-topic-form div.avatar img,body.single-reply .bbp-reply-form div.avatar img{margin-right:0;padding:10px;border:1px solid #ddd;line-height:0;background-color:#efefef}body.page .bbp-reply-form code,body.page .bbp-topic-form code,body.single-topic .bbp-reply-form code,body.single-forum .bbp-topic-form code,body.topic-edit .bbp-topic-form code,body.reply-edit .bbp-reply-form code{font-size:10px;background-color:#f0fff8;border:1px solid #ceefe1;display:block;padding:8px;margin-top:5px;width:369px}#merge_tag,#delete_tag{display:inline}div.bbp-submit-wrapper{margin-top:15px;float:right;clear:both}p.form-allowed-tags{width:462px}#bbpress-forums div.bbp-the-content-wrapper{margin-bottom:10px}#bbpress-forums div.bbp-the-content-wrapper textarea.bbp-the-content{width:100%;margin:0;font-size:12px}#bbpress-forums div.bbp-the-content-wrapper table,#bbpress-forums div.bbp-the-content-wrapper tbody,#bbpress-forums div.bbp-the-content-wrapper tr,#bbpress-forums div.bbp-the-content-wrapper td{border:0;padding:0;margin:0;width:auto;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper input{font-size:12px;padding:5px;margin:0 2px 0 0;line-height:1em}#bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar{padding:5px;min-height:26px}#bbpress-forums div.bbp-the-content-wrapper td.mceToolbar{padding:4px 4px 8px}#bbpress-forums div.wp-editor-container{margin:0;padding:0;line-height:0}#bbpress-forums div.bbp-the-content-wrapper td.mceStatusbar{line-height:16px}#bbpress-forums #bbp-your-profile fieldset{padding:20px 20px 0 20px}#bbpress-forums #bbp-your-profile fieldset div{margin-bottom:20px;float:left;width:100%;clear:left}#bbpress-forums #bbp-your-profile fieldset select{margin-bottom:0}#bbpress-forums #bbp-your-profile fieldset input,#bbpress-forums #bbp-your-profile fieldset textarea{margin-bottom:0;width:60%;background:#f9f9f9;border:1px solid #ddd;box-shadow:none;padding:5px 8px;border-radius:0}#bbpress-forums #bbp-your-profile fieldset input:focus,#bbpress-forums #bbp-your-profile fieldset textarea:focus{border:1px solid #ccc;box-shadow:inset 1px 1px 1px rgba(0,0,0,0.1);outline-color:rgba(240,255,240,0.1)}#bbpress-forums #bbp-your-profile fieldset.bbp-form input.checkbox{width:auto}#bbpress-forums #bbp-your-profile fieldset legend{display:none}#bbpress-forums #bbp-your-profile fieldset label[for]{float:left;width:20%;padding:5px 20px 5px 0;text-align:right;cursor:pointer}#bbpress-forums #bbp-your-profile fieldset dl label[for]{text-align:left;width:60%}#bbpress-forums #bbp-your-profile fieldset span.description{margin:5px 0 0 20%;font-size:12px;font-style:italic;float:left;clear:left;width:60%;padding:5px 8px;border:#cee1ef 1px solid;background-color:#f0f8ff}#bbpress-forums #bbp-your-profile fieldset fieldset{margin:0;border:0;padding:0;clear:none;float:none}#bbpress-forums #bbp-your-profile fieldset fieldset.password{width:60%;display:inline}#bbpress-forums #bbp-your-profile fieldset fieldset.password input,#bbpress-forums #bbp-your-profile fieldset fieldset.password span{width:100%}#bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl{margin:0}#bbpress-forums #bbp-your-profile fieldset fieldset.password span.description{margin-left:0;margin-bottom:20px}#bbpress-forums #bbp-your-profile fieldset.submit button{float:right}div.bbp-template-notice,div.indicator-hint{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 0 15px;border-radius:3px;background-color:#ffffe0;border-color:#e6db55;color:#000;clear:both}div.bbp-template-notice a{color:#555;text-decoration:none}div.bbp-template-notice a:hover{color:#000}div.bbp-template-notice.info{border:#cee1ef 1px solid;background-color:#f0f8ff}div.bbp-template-notice.important{border:#e6db55 1px solid;background-color:#fffbcc}div.bbp-template-notice.error,div.bbp-template-notice.warning{background-color:#ffebe8;border-color:#c00}div.bbp-template-notice.error a,div.bbp-template-notice.warning a{color:#c00}div.bbp-template-notice p{margin:.5em 0 6px 0!important;padding:2px;font-size:12px;line-height:140%}.bbp-topics-front ul.super-sticky,.bbp-topics ul.super-sticky,.bbp-topics ul.sticky,.bbp-forum-content ul.sticky{background-color:#ffffe0!important;font-size:1.1em}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log{border-top:1px dotted #ddd;width:100%;margin:0;padding:8px 0 0 0;font-size:11px;color:#aaa}#bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,#bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li{list-style-type:none}.bbp-login-form fieldset legend{display:none}.bbp-login-form .bbp-username input,.bbp-login-form .bbp-email input,.bbp-login-form .bbp-password input{padding:5px}.bbp-login-form label{width:140px;display:inline-block}#sidebar .bbp-login-form label{width:70px}.bbp-login-form .bbp-username,.bbp-login-form .bbp-email,.bbp-login-form .bbp-password,.bbp-login-form .bbp-remember-me,.bbp-login-form .bbp-submit-wrapper{margin-top:10px}.bbp-login-form .bbp-submit-wrapper{text-align:right}.bbp-login-form .bbp-login-links a{float:left;clear:left}.bbp-logged-in img.avatar{float:left;margin:0 15px 0 0}.bbp-logged-in h4{font-weight:bold;font-size:1.3em;clear:none;margin-bottom:10px}#bbpress-forums p.bbp-topic-meta img.avatar,#bbpress-forums ul.bbp-reply-revision-log img.avatar,#bbpress-forums ul.bbp-topic-revision-log img.avatar,#bbpress-forums div.bbp-template-notice img.avatar,#bbpress-forums .widget_display_topics img.avatar,#bbpress-forums .widget_display_replies img.avatar,#bbpress-forums p.bbp-topic-meta img.avatar{float:none;margin-bottom:-7px;border:3px double #ddd}fieldset div.avatar{float:right}.activity-list li.bbp_topic_create .activity-content .activity-inner,.activity-list li.bbp_reply_create .activity-content .activity-inner{border-left:2px solid #eaeaea;margin-left:5px;padding-left:10px}#bbpress-forums h1{clear:none;font-size:1.8em;line-height:1em;padding-bottom:10px}#bbpress-forums #bbp-user-wrapper{float:left;width:100%}#bbpress-forums .bbp-user-section{overflow:auto}#bbpress-forums #bbp-user-wrapper h2.entry-title{font-size:1.4em;margin:0;padding-bottom:10px;padding-top:0;clear:none}#bbpress-forums #bbp-user-wrapper ul.bbp-lead-topic,#bbpress-forums #bbp-user-wrapper ul.bbp-topics,#bbpress-forums #bbp-user-wrapper ul.bbp-forums,#bbpress-forums #bbp-user-wrapper ul.bbp-replies,#bbpress-forums #bbp-user-wrapper fieldset.bbp-form{clear:none}#bbpress-forums #bbp-single-user-details{margin:0;width:150px;float:left;overflow:hidden}#bbpress-forums #bbp-single-user-details #bbp-user-avatar{margin:0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar{border:0;height:150px;padding:0;margin:0 0 20px 0;width:150px}#bbpress-forums #bbp-single-user-details #bbp-user-description{float:none;margin-left:180px}#bbpress-forums #bbp-single-user-details #bbp-user-navigation{float:none;margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li{margin:0}#bbpress-forums #bbp-single-user-details #bbp-user-navigation a{padding:5px 8px;display:block;border:1px solid transparent;text-decoration:none}#bbpress-forums #bbp-single-user-details #bbp-user-navigation li.current a{background:#eee;opacity:.8}#bbpress-forums #bbp-user-body{margin-left:180px}body.my-account #bbpress-forums{border-top:0;padding-top:0;margin-bottom:0}#bbpress-forums dl.bbp-user-capabilities{display:inline-block;vertical-align:top}#bbpress-forums dl.bbp-user-capabilities dt{margin:0 0 10px;text-transform:capitalize}#bbpress-forums dl.bbp-user-capabilities dd{margin:0;padding:0}#bbpress-forums div.row-actions{font-size:11px;visibility:hidden}#bbpress-forums li:hover>div.row-actions{visibility:visible}
|
templates/default/extras/page-forum-statistics.php
CHANGED
|
@@ -7,10 +7,6 @@
|
|
| 7 |
* @subpackage Theme
|
| 8 |
*/
|
| 9 |
|
| 10 |
-
// Get the statistics and extract them for later use in this template
|
| 11 |
-
// @todo - remove variable references
|
| 12 |
-
extract( bbp_get_statistics(), EXTR_SKIP );
|
| 13 |
-
|
| 14 |
get_header(); ?>
|
| 15 |
|
| 16 |
<?php do_action( 'bbp_before_main_content' ); ?>
|
|
@@ -27,69 +23,7 @@ get_header(); ?>
|
|
| 27 |
|
| 28 |
<div id="bbpress-forums">
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
<?php do_action( 'bbp_before_statistics' ); ?>
|
| 33 |
-
|
| 34 |
-
<dt><?php _e( 'Registered Users', 'bbpress' ); ?></dt>
|
| 35 |
-
<dd>
|
| 36 |
-
<strong><?php echo $user_count; ?></strong>
|
| 37 |
-
</dd>
|
| 38 |
-
|
| 39 |
-
<dt><?php _e( 'Forums', 'bbpress' ); ?></dt>
|
| 40 |
-
<dd>
|
| 41 |
-
<strong><?php echo $forum_count; ?></strong>
|
| 42 |
-
</dd>
|
| 43 |
-
|
| 44 |
-
<dt><?php _e( 'Topics', 'bbpress' ); ?></dt>
|
| 45 |
-
<dd>
|
| 46 |
-
<strong><?php echo $topic_count; ?></strong>
|
| 47 |
-
</dd>
|
| 48 |
-
|
| 49 |
-
<dt><?php _e( 'Replies', 'bbpress' ); ?></dt>
|
| 50 |
-
<dd>
|
| 51 |
-
<strong><?php echo $reply_count; ?></strong>
|
| 52 |
-
</dd>
|
| 53 |
-
|
| 54 |
-
<dt><?php _e( 'Topic Tags', 'bbpress' ); ?></dt>
|
| 55 |
-
<dd>
|
| 56 |
-
<strong><?php echo $topic_tag_count; ?></strong>
|
| 57 |
-
</dd>
|
| 58 |
-
|
| 59 |
-
<?php if ( !empty( $empty_topic_tag_count ) ) : ?>
|
| 60 |
-
|
| 61 |
-
<dt><?php _e( 'Empty Topic Tags', 'bbpress' ); ?></dt>
|
| 62 |
-
<dd>
|
| 63 |
-
<strong><?php echo $empty_topic_tag_count; ?></strong>
|
| 64 |
-
</dd>
|
| 65 |
-
|
| 66 |
-
<?php endif; ?>
|
| 67 |
-
|
| 68 |
-
<?php if ( !empty( $topic_count_hidden ) ) : ?>
|
| 69 |
-
|
| 70 |
-
<dt><?php _e( 'Hidden Topics', 'bbpress' ); ?></dt>
|
| 71 |
-
<dd>
|
| 72 |
-
<strong>
|
| 73 |
-
<abbr title="<?php echo esc_attr( $hidden_topic_title ); ?>"><?php echo $topic_count_hidden; ?></abbr>
|
| 74 |
-
</strong>
|
| 75 |
-
</dd>
|
| 76 |
-
|
| 77 |
-
<?php endif; ?>
|
| 78 |
-
|
| 79 |
-
<?php if ( !empty( $reply_count_hidden ) ) : ?>
|
| 80 |
-
|
| 81 |
-
<dt><?php _e( 'Hidden Replies', 'bbpress' ); ?></dt>
|
| 82 |
-
<dd>
|
| 83 |
-
<strong>
|
| 84 |
-
<abbr title="<?php echo esc_attr( $hidden_reply_title ); ?>"><?php echo $reply_count_hidden; ?></abbr>
|
| 85 |
-
</strong>
|
| 86 |
-
</dd>
|
| 87 |
-
|
| 88 |
-
<?php endif; ?>
|
| 89 |
-
|
| 90 |
-
<?php do_action( 'bbp_after_statistics' ); ?>
|
| 91 |
-
|
| 92 |
-
</dl>
|
| 93 |
|
| 94 |
<?php do_action( 'bbp_before_popular_topics' ); ?>
|
| 95 |
|
|
@@ -120,4 +54,5 @@ get_header(); ?>
|
|
| 120 |
<?php do_action( 'bbp_after_main_content' ); ?>
|
| 121 |
|
| 122 |
<?php get_sidebar(); ?>
|
| 123 |
-
|
|
|
| 7 |
* @subpackage Theme
|
| 8 |
*/
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
get_header(); ?>
|
| 11 |
|
| 12 |
<?php do_action( 'bbp_before_main_content' ); ?>
|
| 23 |
|
| 24 |
<div id="bbpress-forums">
|
| 25 |
|
| 26 |
+
<?php bbp_get_template_part( 'content', 'statistics' ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
<?php do_action( 'bbp_before_popular_topics' ); ?>
|
| 29 |
|
| 54 |
<?php do_action( 'bbp_after_main_content' ); ?>
|
| 55 |
|
| 56 |
<?php get_sidebar(); ?>
|
| 57 |
+
|
| 58 |
+
<?php get_footer();
|
templates/default/extras/single-reply-move.php
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Move reply page
|
| 5 |
+
*
|
| 6 |
+
* @package bbPress
|
| 7 |
+
* @subpackage Theme
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
get_header(); ?>
|
| 11 |
+
|
| 12 |
+
<?php do_action( 'bbp_before_main_content' ); ?>
|
| 13 |
+
|
| 14 |
+
<?php do_action( 'bbp_template_notices' ); ?>
|
| 15 |
+
|
| 16 |
+
<?php while ( have_posts() ) : the_post(); ?>
|
| 17 |
+
|
| 18 |
+
<div id="bbp-edit-page" class="bbp-edit-page">
|
| 19 |
+
<h1 class="entry-title"><?php the_title(); ?></h1>
|
| 20 |
+
<div class="entry-content">
|
| 21 |
+
|
| 22 |
+
<?php bbp_get_template_part( 'form', 'reply-move' ); ?>
|
| 23 |
+
|
| 24 |
+
</div>
|
| 25 |
+
</div><!-- #bbp-edit-page -->
|
| 26 |
+
|
| 27 |
+
<?php endwhile; ?>
|
| 28 |
+
|
| 29 |
+
<?php do_action( 'bbp_after_main_content' ); ?>
|
| 30 |
+
|
| 31 |
+
<?php get_sidebar(); ?>
|
| 32 |
+
<?php get_footer();
|
templates/default/js/topic.js
CHANGED
|
@@ -1,87 +1,31 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
isSubscribed: 0,
|
| 21 |
-
subsSub: 'Subscribe',
|
| 22 |
-
subsUns: 'Unsubscribe'
|
| 23 |
-
}, bbpTopicJS );
|
| 24 |
-
|
| 25 |
-
// Topic Global
|
| 26 |
-
bbpTopicJS.favoritesActive = parseInt( bbpTopicJS.favoritesActive );
|
| 27 |
-
bbpTopicJS.isFav = parseInt( bbpTopicJS.isFav );
|
| 28 |
-
bbpTopicJS.subsActive = parseInt( bbpTopicJS.subsActive );
|
| 29 |
-
bbpTopicJS.isSubscribed = parseInt( bbpTopicJS.isSubscribed );
|
| 30 |
-
|
| 31 |
-
// Run it
|
| 32 |
-
jQuery(document).ready( function() {
|
| 33 |
-
|
| 34 |
-
/** Favorites *************************************************************/
|
| 35 |
-
|
| 36 |
-
if ( 1 == bbpTopicJS.favoritesActive ) {
|
| 37 |
-
var favoritesToggle = jQuery( '#favorite-toggle' )
|
| 38 |
-
.addClass( 'list:favorite' )
|
| 39 |
-
.wpList( { alt: '', dimAfter: favLinkSetup } );
|
| 40 |
-
|
| 41 |
-
var favoritesToggleSpan = favoritesToggle.children( 'span' )
|
| 42 |
-
[bbpTopicJS.isFav ? 'addClass' : 'removeClass' ]( 'is-favorite' );
|
| 43 |
}
|
| 44 |
|
| 45 |
-
function
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
if ( bbpTopicJS.isFav ) {
|
| 50 |
-
html = bbpTopicJS.favYes
|
| 51 |
-
.replace( /%favLinkYes%/, aLink + bbpTopicJS.favLinkYes + "</a>" )
|
| 52 |
-
.replace( /%favDel%/, aDim + bbpTopicJS.favDel + "</a>" );
|
| 53 |
-
} else {
|
| 54 |
-
html = bbpTopicJS.favNo
|
| 55 |
-
.replace( /%favLinkNo%/, aLink + bbpTopicJS.favLinkNo + "</a>" )
|
| 56 |
-
.replace( /%favAdd%/, aDim + bbpTopicJS.favAdd + "</a>" );
|
| 57 |
-
}
|
| 58 |
-
favoritesToggleSpan.html( html );
|
| 59 |
-
favoritesToggle.get(0).wpList.process( favoritesToggle );
|
| 60 |
-
}
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
.addClass( 'list:subscription' )
|
| 67 |
-
.wpList( { alt: '', dimAfter: subsLinkSetup } );
|
| 68 |
-
|
| 69 |
-
var subscriptionToggleSpan = subscriptionToggle.children( 'span' )
|
| 70 |
-
[bbpTopicJS.isSubscribed ? 'addClass' : 'removeClass' ]( 'is-subscribed' );
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
function subsLinkSetup() {
|
| 74 |
-
bbpTopicJS.isSubscribed = subscriptionToggleSpan.is( '.is-subscribed' );
|
| 75 |
-
var aLink = "<a href='" + bbpTopicJS.subsLink + "'>";
|
| 76 |
-
var aDim = "<a href='" + subscriptionToggleSpan.find( 'a[class^="dim:"]' ).attr( 'href' ) + "' class='dim:subscription-toggle:" + subscriptionToggleSpan.attr( 'id' ) + ":is-subscribed'>";
|
| 77 |
-
|
| 78 |
-
if ( bbpTopicJS.isSubscribed ) {
|
| 79 |
-
html = aDim + bbpTopicJS.subsUns + '</a>';
|
| 80 |
-
} else {
|
| 81 |
-
html = aDim + bbpTopicJS.subsSub + '</a>';
|
| 82 |
-
}
|
| 83 |
-
|
| 84 |
-
subscriptionToggleSpan.html( html );
|
| 85 |
-
subscriptionToggle.get(0).wpList.process( subscriptionToggle );
|
| 86 |
-
}
|
| 87 |
} );
|
| 1 |
+
jQuery( document ).ready( function ( $ ) {
|
| 2 |
+
|
| 3 |
+
function bbp_ajax_call( action, topic_id, nonce, update_selector ) {
|
| 4 |
+
var $data = {
|
| 5 |
+
action : action,
|
| 6 |
+
id : topic_id,
|
| 7 |
+
nonce : nonce
|
| 8 |
+
};
|
| 9 |
+
|
| 10 |
+
$.post( bbpTopicJS.bbp_ajaxurl, $data, function ( response ) {
|
| 11 |
+
if ( response.success ) {
|
| 12 |
+
$( update_selector ).html( response.content );
|
| 13 |
+
} else {
|
| 14 |
+
if ( !response.content ) {
|
| 15 |
+
response.content = bbpTopicJS.generic_ajax_error;
|
| 16 |
+
}
|
| 17 |
+
alert( response.content );
|
| 18 |
+
}
|
| 19 |
+
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
}
|
| 21 |
|
| 22 |
+
$( '#favorite-toggle' ).on( 'click', 'span a.favorite-toggle', function( e ) {
|
| 23 |
+
e.preventDefault();
|
| 24 |
+
bbp_ajax_call( 'favorite', $( this ).attr( 'data-topic' ), bbpTopicJS.fav_nonce, '#favorite-toggle' );
|
| 25 |
+
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
$( '#subscription-toggle' ).on( 'click', 'span a.subscription-toggle', function( e ) {
|
| 28 |
+
e.preventDefault();
|
| 29 |
+
bbp_ajax_call( 'subscription', $( this ).attr( 'data-topic' ), bbpTopicJS.subs_nonce, '#subscription-toggle' );
|
| 30 |
+
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
} );
|
templates/default/js/topic.min.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
| 1 |
+
jQuery(document).ready(function(b){function a(g,d,f,c){var e={action:g,id:d,nonce:f};b.post(bbpTopicJS.bbp_ajaxurl,e,function(h){if(h.success){b(c).html(h.content)}else{if(!h.content){h.content=bbpTopicJS.generic_ajax_error}alert(h.content)}})}b("#favorite-toggle").on("click","span a.favorite-toggle",function(c){c.preventDefault();a("favorite",b(this).attr("data-topic"),bbpTopicJS.fav_nonce,"#favorite-toggle")});b("#subscription-toggle").on("click","span a.subscription-toggle",function(c){c.preventDefault();a("subscription",b(this).attr("data-topic"),bbpTopicJS.subs_nonce,"#subscription-toggle")})});
|
