wpForo Forum - Version 1.0.0

Version Description

| 06.09.2016 =

  • Security: User-can-manage-user control based on user level and group
  • Security: Own and other user Usergroup secure management
  • Security: Edit profile issues, multi-level control
  • Security: Custom avatar uploading file control
  • Added: Using wpForo on home page. Insturction here.
  • Added: Use wpForo without shortcode and page. Set any slug for forum Base URL.
  • Added: Option to turn WordPress to wpForo (Disable WordPress on front-end)
  • Added: Dynamic recent topic icons on forum list
  • Added: New Stat Boxes on member profile page (Topics, Blog Posts, Comments)
  • Added: Option to integrate wpForo default attachments with WP Media Library
  • Added: Delete User Cache button on Forums > Dashboard admin page
  • Added: Option to disable forum user registration
  • Added: "Forums" > "Member" menu access in dashboard based on usergroup CAN's.
  • Added: Missing last post info on parent forum, when post located in subForum
  • Added: Update all forum usergroup-access sets when adding a new usergroup
  • Added: Russian and Hebrew translations update.
  • Added: rel="nofolow" for external links in post content
  • Added: Different welcome messages on first and other logins
  • Fixed Bug: Text color picker doesn't work on topic and post editor.
  • Fixed Bug: Custom CSS code and Style/Color saving problem
  • Fixed Bug: Not centered avatars
  • Fixed Bug: Avatar size issue on posts and widgets
  • Fixed Bug: Avatar source URL protocol problem when changing http to https
  • Fixed Bug: Bullet-ed list shows all left *{ margin:0; } issue
  • Fixed Bug: Widget permission error for users with new usergroup
  • Fixed Bug: Foum SEO title. Warning: Missing argument 2 for wpforo_hide_title()
  • Fixed Bug: Fatal error on forum search when Debug Mode is enabled
  • Shortcode: Changed [wpforo-index] to [wpforo]
  • Shortcode: wpForo new shortcodes. More info.
  • SEO Optimization: Duplicated meta data on Member Profile pages

NOTE! Make sure you've deleted all caches after updating this plugin

Download this release

Release Info

Developer Tomdever
Plugin Icon 128x128 wpForo Forum
Version 1.0.0
Comparing to
See all releases

Code changes from version beta-6 to 1.0.0

Files changed (55) hide show
  1. readme.txt +41 -4
  2. wpf-admin/admin.php +8 -6
  3. wpf-admin/css/admin.css +4 -1
  4. wpf-admin/dashboard.php +7 -6
  5. wpf-admin/member.php +1 -1
  6. wpf-admin/options-tabs/features.php +4 -2
  7. wpf-admin/options-tabs/general.php +17 -4
  8. wpf-admin/options-tabs/styles.php +1 -1
  9. wpf-admin/xml/english.xml +9 -1
  10. wpf-assets/css/jquery-ui.css +0 -2
  11. wpf-includes/class-forums.php +26 -8
  12. wpf-includes/class-members.php +53 -6
  13. wpf-includes/class-permissions.php +66 -4
  14. wpf-includes/class-template.php +28 -12
  15. wpf-includes/class-topics.php +1 -1
  16. wpf-includes/class-usergroups.php +25 -0
  17. wpf-includes/functions-installation.php +16 -13
  18. wpf-includes/functions-template.php +3 -3
  19. wpf-includes/functions.php +205 -25
  20. wpf-includes/wpf-actions.php +42 -21
  21. wpf-includes/wpf-hooks.php +117 -50
  22. wpf-includes/wpf-phrases.php +20 -4
  23. wpf-languages/wpforo-cs_CZ.mo +0 -0
  24. wpf-languages/wpforo-cs_CZ.po +2972 -2707
  25. wpf-languages/wpforo-de_DE.mo +0 -0
  26. wpf-languages/wpforo-de_DE.po +0 -2694
  27. wpf-languages/wpforo-es_MX.mo +0 -0
  28. wpf-languages/wpforo-es_MX.po +3043 -2759
  29. wpf-languages/wpforo-fr_FR.mo +0 -0
  30. wpf-languages/wpforo-fr_FR.po +3050 -2826
  31. wpf-languages/wpforo-he_IL.mo +0 -0
  32. wpf-languages/wpforo-he_IL.po +390 -318
  33. wpf-languages/wpforo-ko_KR.mo +0 -0
  34. wpf-languages/wpforo-ko_KR.po +3014 -2775
  35. wpf-languages/wpforo-nl_NL.mo +0 -0
  36. wpf-languages/wpforo-nl_NL.po +387 -282
  37. wpf-languages/wpforo-ru_RU.mo +0 -0
  38. wpf-languages/wpforo-ru_RU.po +328 -248
  39. wpf-languages/wpforo.pot +320 -250
  40. wpf-themes/classic/footer.php +2 -10
  41. wpf-themes/classic/index.php +5 -3
  42. wpf-themes/classic/layouts/1/forum.php +1 -1
  43. wpf-themes/classic/layouts/1/topic.php +1 -1
  44. wpf-themes/classic/layouts/2/forum.php +4 -0
  45. wpf-themes/classic/layouts/2/topic.php +1 -1
  46. wpf-themes/classic/layouts/3/topic.php +1 -1
  47. wpf-themes/classic/profile-account.php +8 -3
  48. wpf-themes/classic/profile-home.php +22 -1
  49. wpf-themes/classic/profile.php +1 -1
  50. wpf-themes/classic/register.php +48 -41
  51. wpf-themes/classic/style-rtl.css +16 -55
  52. wpf-themes/classic/style.css +33 -65
  53. wpf-themes/classic/widgets-rtl.css +44 -0
  54. wpf-themes/classic/widgets.css +45 -0
  55. wpforo.php +24 -23
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
Tags: forum, community, discussion, bulletin board, question and answers, qa, support, foro
5
Requires at least: 4.1
6
Tested up to: 4.6
7
- Stable tag: beta-6
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -15,7 +15,7 @@ New Forum plugin. Everything you need to run an efficient and professional commu
15
New Generation of WordPress forum plugins made by [gVectors Team](http://gvectors.com/). Everything you need to run an efficient and professional community. Powerful and beautiful bulletin board with unique features.
16
17
<blockquote>
18
- It's on the Beta stage and we're working hard to reach the Gold 1.0.0 version as soon as possible. If you found some issue or bug please open a support topic in plugin page or in our support forum: http://wpforo.com/community/.
19
<br/><br/>
20
</blockquote>
21
@@ -111,6 +111,8 @@ You can download [Go2wpForo](http://wpforo.com/community/migrate-to-wpforo-from-
111
112
9. **Forums don't show up on the main page** Please read this FAQ topic: http://wpforo.com/community/faq/forums-dont-show-up-on-the-main-page/
113
114
wpForo Support Forum: <http://wpforo.com/community/>
115
116
== Screenshots ==
@@ -135,6 +137,43 @@ wpForo Support Forum: <http://wpforo.com/community/>
135
136
== Changelog ==
137
138
= Beta-6 | 06.08.2016 =
139
140
* Added: Dark Style
@@ -160,8 +199,6 @@ wpForo Support Forum: <http://wpforo.com/community/>
160
* Fixed Bug: Missing phrase issues
161
* Fixed Bug: Lots of small problems
162
163
- NOTE! Make sure you've deleted all caches after updating this plugin
164
-
165
166
= Beta-5 | 23.07.2016 =
167
4
Tags: forum, community, discussion, bulletin board, question and answers, qa, support, foro
5
Requires at least: 4.1
6
Tested up to: 4.6
7
+ Stable tag: 1.0.0
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
15
New Generation of WordPress forum plugins made by [gVectors Team](http://gvectors.com/). Everything you need to run an efficient and professional community. Powerful and beautiful bulletin board with unique features.
16
17
<blockquote>
18
+ This is a new forum plugin. If you found some issue or bug please open a support topic in plugin page or in our support forum: http://wpforo.com/community/.
19
<br/><br/>
20
</blockquote>
21
111
112
9. **Forums don't show up on the main page** Please read this FAQ topic: http://wpforo.com/community/faq/forums-dont-show-up-on-the-main-page/
113
114
+ 10. **wpForo Shortcodes** - http://wpforo.com/community/faq/wpforo-shortcodes/
115
+
116
wpForo Support Forum: <http://wpforo.com/community/>
117
118
== Screenshots ==
137
138
== Changelog ==
139
140
+ = 1.0.0 | 06.09.2016 =
141
+
142
+ * Security: User-can-manage-user control based on user level and group
143
+ * Security: Own and other user Usergroup secure management
144
+ * Security: Edit profile issues, multi-level control
145
+ * Security: Custom avatar uploading file control
146
+ * Added: Using wpForo on home page. [Insturction here.](http://wpforo.com/community/faq/how-to-load-forum-on-home-page/)
147
+ * Added: Use wpForo without shortcode and page. Set any slug for forum Base URL.
148
+ * Added: Option to turn WordPress to wpForo (Disable WordPress on front-end)
149
+ * Added: Dynamic recent topic icons on forum list
150
+ * Added: New Stat Boxes on member profile page (Topics, Blog Posts, Comments)
151
+ * Added: Option to integrate wpForo default attachments with WP Media Library
152
+ * Added: Delete User Cache button on Forums > Dashboard admin page
153
+ * Added: Option to disable forum user registration
154
+ * Added: "Forums" > "Member" menu access in dashboard based on usergroup CAN's.
155
+ * Added: Missing last post info on parent forum, when post located in subForum
156
+ * Added: Update all forum usergroup-access sets when adding a new usergroup
157
+ * Added: Russian and Hebrew translations update.
158
+ * Added: rel="nofolow" for external links in post content
159
+ * Added: Different welcome messages on first and other logins
160
+ * Fixed Bug: Text color picker doesn't work on topic and post editor.
161
+ * Fixed Bug: Custom CSS code and Style/Color saving problem
162
+ * Fixed Bug: Not centered avatars
163
+ * Fixed Bug: Avatar size issue on posts and widgets
164
+ * Fixed Bug: Avatar source URL protocol problem when changing http to https
165
+ * Fixed Bug: Bullet-ed list shows all left *{ margin:0; } issue
166
+ * Fixed Bug: Widget permission error for users with new usergroup
167
+ * Fixed Bug: Foum SEO title. Warning: Missing argument 2 for wpforo_hide_title()
168
+ * Fixed Bug: Fatal error on forum search when Debug Mode is enabled
169
+ * Shortcode: Changed [wpforo-index] to [wpforo]
170
+ * Shortcode: wpForo new shortcodes. [More info.](http://wpforo.com/community/faq/wpforo-shortcodes/)
171
+ * SEO Optimization: Duplicated meta data on Member Profile pages
172
+
173
+
174
+ NOTE! Make sure you've deleted all caches after updating this plugin
175
+
176
+
177
= Beta-6 | 06.08.2016 =
178
179
* Added: Dark Style
199
* Fixed Bug: Missing phrase issues
200
* Fixed Bug: Lots of small problems
201
202
203
= Beta-5 | 23.07.2016 =
204
wpf-admin/admin.php CHANGED
@@ -1,4 +1,5 @@
1
<?php
2
// Exit if accessed directly
3
if( !defined( 'ABSPATH' ) ) exit;
4
@@ -7,12 +8,13 @@
7
$position = ( isset($wpforo->general_options['menu_position']) && $wpforo->general_options['menu_position'] > 0 ) ? $wpforo->general_options['menu_position'] : 23;
8
add_menu_page(__('Dashboard', 'wpforo'), __('Forums', 'wpforo'), 'read', 'wpforo-community', 'wpforo_toplevel_page', 'dashicons-format-chat', $position);
9
add_submenu_page('wpforo-community', __('Dashboard', 'wpforo'), __('Dashboard', 'wpforo'), 'read', 'wpforo-community', 'wpforo_toplevel_page' );
10
- if( $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'cf' ) && $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'ef' ) && $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'df' ) ) add_submenu_page('wpforo-community', __('Forums', 'wpforo'), __('Forums', 'wpforo'), 'read', 'wpforo-forums', 'wpforo_forum_menu');
11
- if( $wpforo->current_user_groupid == 1 ) add_submenu_page('wpforo-community', __('Settings', 'wpforo'), __('Settings', 'wpforo'), 'read', 'wpforo-settings', 'wpforo_settings');
12
- if( $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'vm' ) && ( $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'em') || $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'dm') ) ) add_submenu_page('wpforo-community', __('Members', 'wpforo'), __('Members', 'wpforo'), 'read', 'wpforo-members', 'wpforo_member_menu');
13
- if( $wpforo->current_user_groupid == 1 ) add_submenu_page('wpforo-community', __('Usergroups', 'wpforo'), __('Usergroups', 'wpforo'), 'read', 'wpforo-usergroups', 'wpforo_usergroups_menu');
14
- if( $wpforo->current_user_groupid == 1 ) add_submenu_page('wpforo-community', __('Phrases', 'wpforo'), __('Phrases', 'wpforo'), 'read', 'wpforo-phrases', 'wpforo_phrases');
15
- if( $wpforo->current_user_groupid == 1 ) add_submenu_page('wpforo-community', __('Themes', 'wpforo'), __('Themes', 'wpforo'), 'read', 'wpforo-themes', 'wpforo_themes');
16
}
17
add_action('admin_menu', 'wpforo_add_menu', 39);
18
1
<?php
2
+
3
// Exit if accessed directly
4
if( !defined( 'ABSPATH' ) ) exit;
5
8
$position = ( isset($wpforo->general_options['menu_position']) && $wpforo->general_options['menu_position'] > 0 ) ? $wpforo->general_options['menu_position'] : 23;
9
add_menu_page(__('Dashboard', 'wpforo'), __('Forums', 'wpforo'), 'read', 'wpforo-community', 'wpforo_toplevel_page', 'dashicons-format-chat', $position);
10
add_submenu_page('wpforo-community', __('Dashboard', 'wpforo'), __('Dashboard', 'wpforo'), 'read', 'wpforo-community', 'wpforo_toplevel_page' );
11
+ if( $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'cf' ) && $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'ef' ) && $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'df' ) ) add_submenu_page('wpforo-community', __('Forums', 'wpforo'), __('Forums', 'wpforo'), 'read', 'wpforo-forums', 'wpforo_forum_menu');
12
+ if( $wpforo->current_user_groupid == 1 ) add_submenu_page('wpforo-community', __('Settings', 'wpforo'), __('Settings', 'wpforo'), 'read', 'wpforo-settings', 'wpforo_settings');
13
+ if( $wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'vm' ) ) add_submenu_page('wpforo-community', __('Members', 'wpforo'), __('Members', 'wpforo'), 'read', 'wpforo-members', 'wpforo_member_menu');
14
+ if( $wpforo->current_user_groupid == 1 ) add_submenu_page('wpforo-community', __('Usergroups', 'wpforo'), __('Usergroups', 'wpforo'), 'read', 'wpforo-usergroups', 'wpforo_usergroups_menu');
15
+ if( $wpforo->current_user_groupid == 1 ) add_submenu_page('wpforo-community', __('Phrases', 'wpforo'), __('Phrases', 'wpforo'), 'read', 'wpforo-phrases', 'wpforo_phrases');
16
+ if( $wpforo->current_user_groupid == 1 ) add_submenu_page('wpforo-community', __('Themes', 'wpforo'), __('Themes', 'wpforo'), 'read', 'wpforo-themes', 'wpforo_themes');
17
+ //exit();
18
}
19
add_action('admin_menu', 'wpforo_add_menu', 39);
20
wpf-admin/css/admin.css CHANGED
@@ -187,7 +187,10 @@
187
.wpforo-style-field input{}
188
.wp-picker-container input.wp-color-picker[type="text"]{ vertical-align:top; }
189
.wpforo-style-color{ display:block; color:#333333; font-weight:bold; text-align:center; float:left; width:23px; padding:0px 5px; margin-right:5px; border:#CCCCCC 1px solid; text-align:center; }
190
-
191
192
/**************************/
193
/* THEMES *****************/
187
.wpforo-style-field input{}
188
.wp-picker-container input.wp-color-picker[type="text"]{ vertical-align:top; }
189
.wpforo-style-color{ display:block; color:#333333; font-weight:bold; text-align:center; float:left; width:23px; padding:0px 5px; margin-right:5px; border:#CCCCCC 1px solid; text-align:center; }
190
+ #wpf-admin-wrap .iris-picker{
191
+ z-index: 1;
192
+ position: absolute;
193
+ }
194
195
/**************************/
196
/* THEMES *****************/
wpf-admin/dashboard.php CHANGED
@@ -26,8 +26,7 @@
26
<div style="float:left; vertical-align:top; width:calc(100% - 300px);;">
27
<p style="font-size:30px; margin:0px 0px 10px 0px; font-family:Constantia, 'Lucida Bright', 'DejaVu Serif', Georgia, serif">Welcome to wpForo <?php echo esc_html(WPFORO_VERSION) ?></p>
28
<p style="margin:0px; font-size:14px;font-family:'Lucida Bright', 'DejaVu Serif', Georgia, serif"">
29
- <?php _e('Thank you for trying wpForo! It\'s on the Beta stage and we\'re working hard to reach the Gold 1.0.0 version as soon as possible.
30
- wpForo is a professional bulletin board for WorPress, and the only forum software which comes with Multi-layout template system.
31
The "Extended", "Simplified" and "Question &amp Answer" layouts fit almost all type of discussions needs. You can use wpForo for small and extremely large communities.
32
<br />If you found some issue or bug please open a support topic in plugin page or in our support forum at gVectors.com. If you liked wpForo please leave some good review for this plugin. We really need your good reviews.
33
If you didn\'t like wpForo please leave a list of issues and requirements you\'d like us to fix and add in near future. We\'re here to help you and improve wpForo as much as possible.', 'wpforo'); ?></p>
@@ -171,11 +170,13 @@
171
<?php
172
$reset_forums_stat_url = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_fstat' ), 'wpforo_reset_forums_stat' );
173
$reset_users_stat_url = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_ustat' ), 'wpforo_reset_users_stat' );
174
- $reset_reset_phrase_cache = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_phrase_cache' ), 'wpforo_reset_phrase_cache' );
175
?>
176
- <a href="<?php echo esc_url($reset_forums_stat_url); ?>" class="button button-secondary"><?php _e('Update Forums Statistic', 'wpforo'); ?></a>&nbsp;
177
- <a href="<?php echo esc_url($reset_users_stat_url); ?>" class="button button-secondary"><?php _e('Update Users Statistic', 'wpforo'); ?></a>&nbsp;
178
- <a href="<?php echo esc_url($reset_reset_phrase_cache); ?>" class="button button-secondary"><?php _e('Delete Phrase Cache', 'wpforo'); ?></a>
179
</div>
180
</td>
181
</tr>
26
<div style="float:left; vertical-align:top; width:calc(100% - 300px);;">
27
<p style="font-size:30px; margin:0px 0px 10px 0px; font-family:Constantia, 'Lucida Bright', 'DejaVu Serif', Georgia, serif">Welcome to wpForo <?php echo esc_html(WPFORO_VERSION) ?></p>
28
<p style="margin:0px; font-size:14px;font-family:'Lucida Bright', 'DejaVu Serif', Georgia, serif"">
29
+ <?php _e('Thank you for using wpForo! wpForo is a professional bulletin board for WorPress, and the only forum software which comes with Multi-layout template system.
30
The "Extended", "Simplified" and "Question &amp Answer" layouts fit almost all type of discussions needs. You can use wpForo for small and extremely large communities.
31
<br />If you found some issue or bug please open a support topic in plugin page or in our support forum at gVectors.com. If you liked wpForo please leave some good review for this plugin. We really need your good reviews.
32
If you didn\'t like wpForo please leave a list of issues and requirements you\'d like us to fix and add in near future. We\'re here to help you and improve wpForo as much as possible.', 'wpforo'); ?></p>
170
<?php
171
$reset_forums_stat_url = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_fstat' ), 'wpforo_reset_forums_stat' );
172
$reset_users_stat_url = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_ustat' ), 'wpforo_reset_users_stat' );
173
+ $reset_phrase_cache = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_phrase_cache' ), 'wpforo_reset_phrase_cache' );
174
+ $reset_user_cache = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_user_cache' ), 'wpforo_reset_user_cache' );
175
?>
176
+ <a href="<?php echo esc_url($reset_forums_stat_url); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Update Forums Statistic', 'wpforo'); ?></a>&nbsp;
177
+ <a href="<?php echo esc_url($reset_users_stat_url); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Update Users Statistic', 'wpforo'); ?></a>&nbsp;
178
+ <a href="<?php echo esc_url($reset_phrase_cache); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Delete Phrase Cache', 'wpforo'); ?></a>&nbsp;
179
+ <a href="<?php echo esc_url($reset_user_cache); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Delete User Cache', 'wpforo'); ?></a>
180
</div>
181
</td>
182
</tr>
wpf-admin/member.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
// Exit if accessed directly
3
if( !defined( 'ABSPATH' ) ) exit;
4
- if( !current_user_can('administrator') ) exit;
5
?>
6
7
<div id="wpf-admin-wrap" class="wrap">
1
<?php
2
// Exit if accessed directly
3
if( !defined( 'ABSPATH' ) ) exit;
4
+ if( !$wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'vm') ) exit;
5
?>
6
7
<div id="wpf-admin-wrap" class="wrap">
wpf-admin/options-tabs/features.php CHANGED
@@ -14,7 +14,8 @@ $options = array(
14
'footer-stat' => array( 'label' => __('Show Forum Statistic', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
15
'author-link' => array( 'label' => __('Replace Author Link to Forum Profile', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0 ),
16
'comment-author-link' => array( 'label' => __('Replace Comment Author Link to Forum Profile', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0 ),
17
- 'register-url' => array( 'label' => __('Replace Registration Page URL to Forum URL', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1 ),
18
'login-url' => array( 'label' => __('Replace Login Page URL to Forum URL', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0 ),
19
'replace-avatar' => array( 'label' => __('Replace Author Avatar with Forum Profile Avatar', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
20
'avatars' => array( 'label' => __('Enable Avatars', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
@@ -26,9 +27,10 @@ $options = array(
26
'seo-title' => array( 'label' => __('Enable wpForo SEO for Meta Titles', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
27
'seo-meta' => array( 'label' => __('Enable wpForo SEO for Meta Tags', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
28
'font-awesome' => array( 'label' => __('Enable wpForo Font-Awesome Lib', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
29
- 'output-buffer' => array( 'label' => __('Enable Output Buffer', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1, 'description' => __('This feature is useful if you\'re adding content before or after [wpforo-index] shortcode in page content. Also it useful if forum is loaded before website header, on top of the front-end.', 'wpforo')),
30
'wp-date-format' => array( 'label' => __('Enable WordPress Date/Time Format', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0, 'description' => __('You can manage WordPress date and time format in WordPress Settings > General admin page.', 'wpforo')),
31
'subscribe_conf' => array( 'label' => __('Enable Subscription Confirmation', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1, 'description' => __('Forum and Topic subscription with double opt-in/confirmation system.', 'wpforo') ),
32
'debug-mode' => array( 'label' => __('Enable Debug Mode', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0, 'description' => __('If you got some issue with wpForo, please enable this option before asking for support, this outputs hidden important information to help us debug your issue.', 'wpforo')),
33
'copyright' => array( 'label' => __('Help wpForo to grow, show plugin info', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1, 'description' => __('Please enable this option to help wpForo get more popularity as your thank to the hard work we do for you totally free. This option adds a very small icon in forum footer, which will allow your site visitors recognize the name of forum solution you use.', 'wpforo')),
34
);
14
'footer-stat' => array( 'label' => __('Show Forum Statistic', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
15
'author-link' => array( 'label' => __('Replace Author Link to Forum Profile', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0 ),
16
'comment-author-link' => array( 'label' => __('Replace Comment Author Link to Forum Profile', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0 ),
17
+ 'user-register' => array( 'label' => __('Enable User Registration', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1, 'description' => __('This option is not synced with WordPress "Anyone can register" option in Dashboard > Settings > General admin page. If this option is enabled new users will always be able to register.', 'wpforo') ),
18
+ 'register-url' => array( 'label' => __('Replace Registration Page URL to Forum URL', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0 ),
19
'login-url' => array( 'label' => __('Replace Login Page URL to Forum URL', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0 ),
20
'replace-avatar' => array( 'label' => __('Replace Author Avatar with Forum Profile Avatar', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
21
'avatars' => array( 'label' => __('Enable Avatars', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
27
'seo-title' => array( 'label' => __('Enable wpForo SEO for Meta Titles', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
28
'seo-meta' => array( 'label' => __('Enable wpForo SEO for Meta Tags', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
29
'font-awesome' => array( 'label' => __('Enable wpForo Font-Awesome Lib', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1),
30
+ 'output-buffer' => array( 'label' => __('Enable Output Buffer', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1, 'description' => __('This feature is useful if you\'re adding content before or after [wpforo] shortcode in page content. Also it useful if forum is loaded before website header, on top of the front-end.', 'wpforo')),
31
'wp-date-format' => array( 'label' => __('Enable WordPress Date/Time Format', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0, 'description' => __('You can manage WordPress date and time format in WordPress Settings > General admin page.', 'wpforo')),
32
'subscribe_conf' => array( 'label' => __('Enable Subscription Confirmation', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1, 'description' => __('Forum and Topic subscription with double opt-in/confirmation system.', 'wpforo') ),
33
+ 'attach-media-lib' => array( 'label' => __('Insert Forum Attachments to Media Library', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1, 'description' => __('Enable this option to be able manage forum attachments in Dashboard > Media > Library admin page.', 'wpforo') ),
34
'debug-mode' => array( 'label' => __('Enable Debug Mode', 'wpforo'), 'type' => '', 'required' => '', 'value' => 0, 'description' => __('If you got some issue with wpForo, please enable this option before asking for support, this outputs hidden important information to help us debug your issue.', 'wpforo')),
35
'copyright' => array( 'label' => __('Help wpForo to grow, show plugin info', 'wpforo'), 'type' => '', 'required' => '', 'value' => 1, 'description' => __('Please enable this option to help wpForo get more popularity as your thank to the hard work we do for you totally free. This option adds a very small icon in forum footer, which will allow your site visitors recognize the name of forum solution you use.', 'wpforo')),
36
);
wpf-admin/options-tabs/general.php CHANGED
@@ -10,6 +10,23 @@
10
<?php wp_nonce_field( 'wpforo-settings-general' ); ?>
11
<table class="wpforo_settings_table">
12
<tbody>
13
<tr>
14
<th><label for="forum_title"><?php _e('Forum Title', 'wpforo'); ?></label></th>
15
<td><input id="forum_title" type="text" name="wpforo_general_options[title]" value="<?php if(isset($wpforo->general_options['title'])) wpfo( $wpforo->general_options['title'] ); ?>" required></td>
@@ -18,10 +35,6 @@
18
<th><label for="forum_description"><?php _e('Forum Description', 'wpforo'); ?></label></th>
19
<td><input id="forum_description" type="text" name="wpforo_general_options[description]" value="<?php if(isset($wpforo->general_options['description'])) wpfo( $wpforo->general_options['description'] ); ?>" required></td>
20
</tr>
21
- <tr>
22
- <th><label for="wpforourl"><?php _e('Forum Base URL', 'wpforo'); ?></label></th>
23
- <td><input id="wpforourl" type="text" name="wpforo_url" value="<?php echo urldecode( WPFORO_BASE_URL ) ?>"/></td>
24
- </tr>
25
<tr>
26
<th>
27
<label><?php _e('Dashboard Menu Position', 'wpforo'); ?></label>
10
<?php wp_nonce_field( 'wpforo-settings-general' ); ?>
11
<table class="wpforo_settings_table">
12
<tbody>
13
+ <tr>
14
+ <th>
15
+ <label for="wpforourl"><?php _e('Forum Base URL', 'wpforo'); ?></label>
16
+ </th>
17
+ <td align="left">
18
+ <?php if(!$wpforo->use_home_url): ?>
19
+ <span style="font-size:14px;"><?php echo site_url('/') ?></span>
20
+ <input required id="wpforourl" type="text" name="wpforo_url" value="<?php echo urldecode( $wpforo->permastruct ) ?>" style="width:47%;"/>/<br>
21
+ <?php endif; ?>
22
+ <label for="wpforo_use_home_url">
23
+ <input id="wpforo_use_home_url" type="checkbox" name="wpforo_use_home_url" value="1" <?php echo ($wpforo->use_home_url ? 'checked' : '') ?>/>
24
+ <?php _e('Turn WordPress to wpForo', 'wpforo') ?>
25
+ <p class="wpf-info"><?php _e('This option will disable WordPress on front-end. Only forum pages will be available. wpForo will look like as a stand-alone forum.', 'wpforo') ?></p>
26
+ </label>
27
+ <a href="<?php echo WPFORO_BASE_URL ?>" target="_blank"><?php _e('Visit Forum', 'wpforo') ?></a>
28
+ </td>
29
+ </tr>
30
<tr>
31
<th><label for="forum_title"><?php _e('Forum Title', 'wpforo'); ?></label></th>
32
<td><input id="forum_title" type="text" name="wpforo_general_options[title]" value="<?php if(isset($wpforo->general_options['title'])) wpfo( $wpforo->general_options['title'] ); ?>" required></td>
35
<th><label for="forum_description"><?php _e('Forum Description', 'wpforo'); ?></label></th>
36
<td><input id="forum_description" type="text" name="wpforo_general_options[description]" value="<?php if(isset($wpforo->general_options['description'])) wpfo( $wpforo->general_options['description'] ); ?>" required></td>
37
</tr>
38
<tr>
39
<th>
40
<label><?php _e('Dashboard Menu Position', 'wpforo'); ?></label>
wpf-admin/options-tabs/styles.php CHANGED
@@ -60,7 +60,7 @@
60
<?php endforeach; ?>
61
</table>
62
<?php foreach( $wpforo->theme_options['styles'] as $style => $colors ): ?>
63
- <table class="wpforo-style-color-wrapper" style="border-right:2px solid #eee; margin-right:10px; padding-left:5px; background:<?php echo ( $style == $wpforo->theme_options['style'] ) ? '#E8FFE5' : 'transparent'; ?>">
64
<tr>
65
<td>
66
<div style="float:left; text-align:center; width:27px;"><input style="margin:0px;" <?php if( $style == $wpforo->theme_options['style'] ) echo ' checked="checked"'; ?> type="radio" name="wpforo_theme_options[style]" value="<?php wpfo($style) ?>" id="wpforo_stle_<?php wpfo($style) ?>" /></div>
60
<?php endforeach; ?>
61
</table>
62
<?php foreach( $wpforo->theme_options['styles'] as $style => $colors ): ?>
63
+ <table class="wpforo-style-color-wrapper" style="border-right:2px solid #eee; margin-right:10px; padding-left:5px; <?php echo ( $style == $wpforo->theme_options['style'] ) ? 'background: #E8FFE5; width: 185px; text-align: center;' : 'background: transparent'; ?>">
64
<tr>
65
<td>
66
<div style="float:left; text-align:center; width:27px;"><input style="margin:0px;" <?php if( $style == $wpforo->theme_options['style'] ) echo ' checked="checked"'; ?> type="radio" name="wpforo_theme_options[style]" value="<?php wpfo($style) ?>" id="wpforo_stle_<?php wpfo($style) ?>" /></div>
wpf-admin/xml/english.xml CHANGED
@@ -227,7 +227,6 @@
227
<phrase name="The uploaded file size is too big"><![CDATA[The uploaded file size is too big]]></phrase>
228
<phrase name="The uploaded file was only partially uploaded"><![CDATA[The uploaded file was only partially uploaded]]></phrase>
229
<phrase name="Theme options successfully updated"><![CDATA[Theme options successfully updated]]></phrase>
230
- <phrase name="Theme options successfully updated, but previous value not changed"><![CDATA[Theme options successfully updated, but previous value not changed]]></phrase>
231
<phrase name="This email address is already registered. Please insert another."><![CDATA[This email address is already registered. Please insert another.]]></phrase>
232
<phrase name="This post successfully deleted"><![CDATA[This post successfully deleted]]></phrase>
233
<phrase name="This post successfully edited"><![CDATA[This post successfully edited]]></phrase>
@@ -356,4 +355,13 @@
356
<phrase name="Registered"><![CDATA[Registered]]></phrase>
357
<phrase name="Customer"><![CDATA[Customer]]></phrase>
358
<phrase name="Profile"><![CDATA[Profile]]></phrase>
359
</language>
227
<phrase name="The uploaded file size is too big"><![CDATA[The uploaded file size is too big]]></phrase>
228
<phrase name="The uploaded file was only partially uploaded"><![CDATA[The uploaded file was only partially uploaded]]></phrase>
229
<phrase name="Theme options successfully updated"><![CDATA[Theme options successfully updated]]></phrase>
230
<phrase name="This email address is already registered. Please insert another."><![CDATA[This email address is already registered. Please insert another.]]></phrase>
231
<phrase name="This post successfully deleted"><![CDATA[This post successfully deleted]]></phrase>
232
<phrase name="This post successfully edited"><![CDATA[This post successfully edited]]></phrase>
355
<phrase name="Registered"><![CDATA[Registered]]></phrase>
356
<phrase name="Customer"><![CDATA[Customer]]></phrase>
357
<phrase name="Profile"><![CDATA[Profile]]></phrase>
358
+ <phrase name="Incorrect file format. Allowed formats: jpeg, jpg, png, gif."><![CDATA[Incorrect file format. Allowed formats: jpeg, jpg, png, gif.]]></phrase>
359
+ <phrase name="User registration is disabled"><![CDATA[User registration is disabled]]></phrase>
360
+ <phrase name="Attachment removed"><![CDATA[Attachment removed]]></phrase>
361
+ <phrase name="Forum Posts"><![CDATA[Forum Posts]]></phrase>
362
+ <phrase name="Blog Posts"><![CDATA[Blog Posts]]></phrase>
363
+ <phrase name="Blog Comments"><![CDATA[Blog Comments]]></phrase>
364
+ <phrase name="Welcome back %s!"><![CDATA[Welcome back %s!]]></phrase>
365
+ <phrase name="Member Profile"><![CDATA[Member Profile]]></phrase>
366
+ <phrase name="Member"><![CDATA[Member]]></phrase>
367
</language>
wpf-assets/css/jquery-ui.css CHANGED
@@ -1,7 +1,5 @@
1
/*! jQuery UI - v1.11.0 - 2014-06-26
2
* http://jqueryui.com
3
- * Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
6
7
/* Layout helpers
1
/*! jQuery UI - v1.11.0 - 2014-06-26
2
* http://jqueryui.com
3
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
4
5
/* Layout helpers
wpf-includes/class-forums.php CHANGED
@@ -534,7 +534,7 @@ class wpForoForum{
534
<input id="order-<?php echo intval($forumid) ?>" type="hidden" name="forum[<?php echo intval($forumid) ?>][order]"/>
535
<dl class="menu-item-bar">
536
<dt class="menu-item-handle forum_width">
537
- <span class="item-title forumtitle"><?php echo esc_html($name) ?></span>
538
<span class="item-controls">
539
<span class="wpforo-cat-layout"><?php echo ( $depth != 0 ? __('Topics', 'wpforo') . '&nbsp;(' . intval($cur_forum['topics']) . ')&nbsp;,&nbsp;' . __('Posts', 'wpforo') . '&nbsp;(' . intval($cur_forum['posts']) . ')&nbsp; | &nbsp;' : '' ) ?><?php echo ( $depth == 0 ? '(&nbsp;<i>' . esc_html($cat_layout_name) . '</i>&nbsp;)&nbsp; | &nbsp;' : '' ); ?></span>
540
<span class="menu_edit"><a href="<?php echo admin_url( 'admin.php?page=wpforo-forums&id=' . intval($forumid) . '&action=edit' ) ?>"><i class="fa fa-pencil" aria-hidden="true" title="<?php _e('edit', 'wpforo') ?>"></i></a></span>&nbsp;|&nbsp;
@@ -615,13 +615,16 @@ class wpForoForum{
615
<td>
616
<select name="forum[permission]['.intval($groupid).']">';
617
foreach($access_arr as $value){
618
echo '<option value="'.esc_attr($value['access']).'" '.
619
((isset($permissions_arr[$groupid]) && $value['access'] == $permissions_arr[$groupid])
620
- || (!isset($permissions_arr[$groupid]) && (($name == 'Guest' && $value['access'] == 'read_only')
621
- || ($name == 'Registered' && $value['access'] == 'standard')
622
- || ($name == 'Customer' && $value['access'] == 'standard')
623
- || ($name == 'Moderator' && $value['access'] == 'moderator')
624
- || ($name == 'Admin' && $value['access'] == 'full'))) ? 'selected' : '').'>'.esc_html( __( $value['title'], 'wpforo') ).'</option>';
625
}
626
echo'
627
</select>
@@ -711,10 +714,16 @@ class wpForoForum{
711
712
function get_forum_url($forum){
713
714
- if( !is_array($forum) ) $forum = $this->get_forum($forum);
715
716
if( is_array($forum) && !empty($forum) ){
717
- return WPFORO_BASE_URL . $forum['slug'];
718
}else{
719
return WPFORO_BASE_URL;
720
}
@@ -735,6 +744,15 @@ class wpForoForum{
735
function get_count(){
736
return $this->wpforo->db->get_var( "SELECT COUNT(`forumid`) FROM `".$this->wpforo->db->prefix."wpforo_forums`" );
737
}
738
}
739
740
?>
534
<input id="order-<?php echo intval($forumid) ?>" type="hidden" name="forum[<?php echo intval($forumid) ?>][order]"/>
535
<dl class="menu-item-bar">
536
<dt class="menu-item-handle forum_width">
537
+ <span class="item-title forumtitle"><span style="font-weight:400; cursor:help;" title="Forum ID"><?php echo $forumid; ?> &nbsp;|&nbsp;</span> <?php echo esc_html($name) ?></span>
538
<span class="item-controls">
539
<span class="wpforo-cat-layout"><?php echo ( $depth != 0 ? __('Topics', 'wpforo') . '&nbsp;(' . intval($cur_forum['topics']) . ')&nbsp;,&nbsp;' . __('Posts', 'wpforo') . '&nbsp;(' . intval($cur_forum['posts']) . ')&nbsp; | &nbsp;' : '' ) ?><?php echo ( $depth == 0 ? '(&nbsp;<i>' . esc_html($cat_layout_name) . '</i>&nbsp;)&nbsp; | &nbsp;' : '' ); ?></span>
540
<span class="menu_edit"><a href="<?php echo admin_url( 'admin.php?page=wpforo-forums&id=' . intval($forumid) . '&action=edit' ) ?>"><i class="fa fa-pencil" aria-hidden="true" title="<?php _e('edit', 'wpforo') ?>"></i></a></span>&nbsp;|&nbsp;
615
<td>
616
<select name="forum[permission]['.intval($groupid).']">';
617
foreach($access_arr as $value){
618
+
619
echo '<option value="'.esc_attr($value['access']).'" '.
620
((isset($permissions_arr[$groupid]) && $value['access'] == $permissions_arr[$groupid])
621
+ || (!isset($permissions_arr[$groupid])
622
+ && (($name == 'Guest' && $value['access'] == 'read_only')
623
+ || ($name == 'Registered' && $value['access'] == 'standard')
624
+ || ($name == 'Customer' && $value['access'] == 'standard')
625
+ || ($name == 'Moderator' && $value['access'] == 'moderator')
626
+ || ($name == 'Admin' && $value['access'] == 'full')
627
+ || ($name != 'Guest' && $name != 'Registered' && $name != 'Customer' && $name != 'Moderator' && $name != 'Admin' && $value['access'] == 'standard') )) ? 'selected' : '').'>'.esc_html( __( $value['title'], 'wpforo') ).'</option>';
628
}
629
echo'
630
</select>
714
715
function get_forum_url($forum){
716
717
+ if( !is_array($forum) ){
718
+ if(is_numeric($forum)){
719
+ $forum = $this->get_forum($forum);
720
+ }else{
721
+ $forum = array('slug' => $forum);
722
+ }
723
+ }
724
725
if( is_array($forum) && !empty($forum) ){
726
+ return WPFORO_BASE_URL . utf8_uri_encode($forum['slug']);
727
}else{
728
return WPFORO_BASE_URL;
729
}
744
function get_count(){
745
return $this->wpforo->db->get_var( "SELECT COUNT(`forumid`) FROM `".$this->wpforo->db->prefix."wpforo_forums`" );
746
}
747
+
748
+ function get_lastinfo( $ids = array() ){
749
+ $lastinfo = array();
750
+ if(!empty($ids)){
751
+ $ids = implode(',', array_map('intval', $ids));
752
+ $lastinfo = $this->wpforo->db->get_row( "SELECT `userid` as last_userid, `topicid` as last_topicid, `postid` as last_postid, `created` as last_post_date FROM `" . $this->wpforo->db->prefix . "wpforo_posts` WHERE forumid IN(" . $ids .") ORDER BY `created` DESC LIMIT 1", ARRAY_A);
753
+ }
754
+ return $lastinfo;
755
+ }
756
}
757
758
?>
wpf-includes/class-members.php CHANGED
@@ -44,8 +44,10 @@ class wpForoMember{
44
}
45
46
if(isset($groupid) && $groupid){
47
- $fields['groupid'] = intval($groupid);
48
- $fields_types[] = '%d';
49
}
50
51
if(isset($title) && $title){
@@ -129,6 +131,10 @@ class wpForoMember{
129
}
130
131
function create($args){
132
if(!empty($args) && is_array($args)){
133
extract($args, EXTR_OVERWRITE);
134
$user_login = sanitize_user( $user_login );
@@ -177,14 +183,15 @@ class wpForoMember{
177
if(!empty($user_id->errors)){
178
$args = array();
179
foreach($user_id->errors as $u_err) $args[] = $u_err[0];
180
- $wpforo->notice->add($args, 'error');
181
return FALSE;
182
}
183
- $wpforo->notice->add('Registration Error', 'error');
184
return FALSE;
185
}
186
187
function edit( $args = array() ){
188
if( empty($args) && empty($_REQUEST['member']) ) return FALSE;
189
if( empty($args) && !empty($_REQUEST['member']) ) $args = $_REQUEST['member'];
190
extract($args, EXTR_OVERWRITE);
@@ -193,7 +200,6 @@ class wpForoMember{
193
$userid = intval($userid);
194
$display_name = sanitize_text_field($display_name);
195
$user_email = sanitize_email($user_email);
196
- $user_email = apply_filters( 'user_registration_email', $user_email );
197
if ( ! is_email( $user_email ) ) {
198
$this->wpforo->notice->add('Invalid Email address', 'error');
199
$user_email = '';
@@ -203,6 +209,18 @@ class wpForoMember{
203
return FALSE;
204
}
205
206
if( $display_name && $user_email ){
207
$this->wpforo->db->update(
208
$this->wpforo->db->prefix.'users',
@@ -244,6 +262,7 @@ class wpForoMember{
244
245
if( $error ){
246
$error = wpforo_file_upload_error($error);
247
$this->wpforo->notice->add($error, 'error');
248
return FALSE;
249
}
@@ -259,6 +278,11 @@ class wpForoMember{
259
}
260
261
$ext = pathinfo($name, PATHINFO_EXTENSION);
262
$avatar_fname = $username."_".$userid.".".$ext;
263
$avatar_path = $avatar_dir."/".$avatar_fname;
264
@@ -269,7 +293,8 @@ class wpForoMember{
269
$image->resize( 150, 150, true );
270
$image->save( $avatar_path );
271
}
272
- $this->wpforo->db->update($this->wpforo->db->prefix.'wpforo_profiles', array('avatar' => $upload_dir['baseurl']."/wpforo/avatars/".$avatar_fname), array('userid' => intval($userid)), array('%s'), array('%d'));
273
$this->reset($userid);
274
}
275
}
@@ -578,6 +603,11 @@ class wpForoMember{
578
return $this->wpforo->db->get_var("SELECT `avatar` FROM `".$this->wpforo->db->prefix."wpforo_profiles` WHERE `userid` = ".intval($userid));
579
}
580
581
function get_questions_count( $userid ){
582
$count = $this->wpforo->db->get_var("SELECT count(topicid) FROM `".$this->wpforo->db->prefix."wpforo_topics` WHERE `userid` = ".intval($userid));
583
return $count;
@@ -654,6 +684,7 @@ class wpForoMember{
654
'color' => $this->rating(0, 'color'),
655
'badge' => $this->rating(0, 'icon'),
656
'posts' => 0,
657
'questions' => 0,
658
'answers' => 0,
659
'question_comments' => 0,
@@ -669,12 +700,14 @@ class wpForoMember{
669
670
if( is_array($args) && isset($args['userid']) ){
671
$userid = $args['userid'];
672
if(isset($args['questions'])) $stat['questions'] = intval($args['questions']);
673
if(isset($args['answers'])) $stat['answers'] = intval($args['answers']);
674
if(isset($args['posts'])) $stat['posts'] = intval($args['posts']);
675
if(isset($args['comments'])) $stat['question_comments'] = intval($args['comments']);
676
}
677
elseif($userid = wpforo_bigintval($args)){
678
if($live_count){
679
if($questions = $this->get_questions_count( $userid )) $stat['questions'] = $questions;
680
if($answers = $this->get_answers_count( $userid )) $stat['answers'] = $answers;
@@ -874,6 +907,10 @@ class wpForoMember{
874
$this->wpforo->db->query( "DELETE FROM `" . $this->wpforo->db->prefix ."usermeta` WHERE `meta_key` = '_wpf_member_obj' AND `user_id` = " . intval($userid) );
875
}
876
877
public function init_current_user(){
878
if(is_user_logged_in()){
879
$current_user = wp_get_current_user();
@@ -894,6 +931,16 @@ class wpForoMember{
894
}
895
}
896
897
}
898
899
?>
44
}
45
46
if(isset($groupid) && $groupid){
47
+ if( $this->wpforo->current_user_groupid == 1 || current_user_can('administrator') ){
48
+ $fields['groupid'] = intval($groupid);
49
+ $fields_types[] = '%d';
50
+ }
51
}
52
53
if(isset($title) && $title){
131
}
132
133
function create($args){
134
+ if(!wpforo_feature('user-register', $this->wpforo)){
135
+ $this->wpforo->notice->add('User registration is disabled.', 'error');
136
+ return FALSE;
137
+ }
138
if(!empty($args) && is_array($args)){
139
extract($args, EXTR_OVERWRITE);
140
$user_login = sanitize_user( $user_login );
183
if(!empty($user_id->errors)){
184
$args = array();
185
foreach($user_id->errors as $u_err) $args[] = $u_err[0];
186
+ $this->wpforo->notice->add($args, 'error');
187
return FALSE;
188
}
189
+ $this->wpforo->notice->add('Registration Error', 'error');
190
return FALSE;
191
}
192
193
function edit( $args = array() ){
194
+
195
if( empty($args) && empty($_REQUEST['member']) ) return FALSE;
196
if( empty($args) && !empty($_REQUEST['member']) ) $args = $_REQUEST['member'];
197
extract($args, EXTR_OVERWRITE);
200
$userid = intval($userid);
201
$display_name = sanitize_text_field($display_name);
202
$user_email = sanitize_email($user_email);
203
if ( ! is_email( $user_email ) ) {
204
$this->wpforo->notice->add('Invalid Email address', 'error');
205
$user_email = '';
209
return FALSE;
210
}
211
212
+ if ( is_user_logged_in() ) {
213
+ $current_user_id = get_current_user_id();
214
+ if(!$this->wpforo->perm->user_can_manage_user( $current_user_id, $userid )){
215
+ $this->wpforo->notice->add('Permission denied', 'error');
216
+ return FALSE;
217
+ }
218
+ }
219
+ else{
220
+ $this->wpforo->notice->add('Permission denied', 'error');
221
+ return FALSE;
222
+ }
223
+
224
if( $display_name && $user_email ){
225
$this->wpforo->db->update(
226
$this->wpforo->db->prefix.'users',
262
263
if( $error ){
264
$error = wpforo_file_upload_error($error);
265
+ $this->wpforo->notice->clear();
266
$this->wpforo->notice->add($error, 'error');
267
return FALSE;
268
}
278
}
279
280
$ext = pathinfo($name, PATHINFO_EXTENSION);
281
+ if( !wpforo_is_image($ext) ){
282
+ $this->wpforo->notice->clear();
283
+ $this->wpforo->notice->add('Incorrect file format. Allowed formats: jpeg, jpg, png, gif.', 'error');
284
+ return false;
285
+ }
286
$avatar_fname = $username."_".$userid.".".$ext;
287
$avatar_path = $avatar_dir."/".$avatar_fname;
288
293
$image->resize( 150, 150, true );
294
$image->save( $avatar_path );
295
}
296
+ $blog_url = preg_replace('|^https?\:|is', '', $upload_dir['baseurl']);
297
+ $this->wpforo->db->update($this->wpforo->db->prefix.'wpforo_profiles', array('avatar' => $blog_url . "/wpforo/avatars/" . $avatar_fname), array('userid' => intval($userid)), array('%s'), array('%d'));
298
$this->reset($userid);
299
}
300
}
603
return $this->wpforo->db->get_var("SELECT `avatar` FROM `".$this->wpforo->db->prefix."wpforo_profiles` WHERE `userid` = ".intval($userid));
604
}
605
606
+ function get_topics_count( $userid ){
607
+ $count = $this->wpforo->db->get_var("SELECT count(topicid) FROM `".$this->wpforo->db->prefix."wpforo_topics` WHERE `userid` = ".intval($userid));
608
+ return $count;
609
+ }
610
+
611
function get_questions_count( $userid ){
612
$count = $this->wpforo->db->get_var("SELECT count(topicid) FROM `".$this->wpforo->db->prefix."wpforo_topics` WHERE `userid` = ".intval($userid));
613
return $count;
684
'color' => $this->rating(0, 'color'),
685
'badge' => $this->rating(0, 'icon'),
686
'posts' => 0,
687
+ 'topics' => 0,
688
'questions' => 0,
689
'answers' => 0,
690
'question_comments' => 0,
700
701
if( is_array($args) && isset($args['userid']) ){
702
$userid = $args['userid'];
703
+ $stat['topics'] = (int)$this->get_topics_count( $userid );
704
if(isset($args['questions'])) $stat['questions'] = intval($args['questions']);
705
if(isset($args['answers'])) $stat['answers'] = intval($args['answers']);
706
if(isset($args['posts'])) $stat['posts'] = intval($args['posts']);
707
if(isset($args['comments'])) $stat['question_comments'] = intval($args['comments']);
708
}
709
elseif($userid = wpforo_bigintval($args)){
710
+ $stat['topics'] = (int)$this->get_topics_count( $userid );
711
if($live_count){
712
if($questions = $this->get_questions_count( $userid )) $stat['questions'] = $questions;
713
if($answers = $this->get_answers_count( $userid )) $stat['answers'] = $answers;
907
$this->wpforo->db->query( "DELETE FROM `" . $this->wpforo->db->prefix ."usermeta` WHERE `meta_key` = '_wpf_member_obj' AND `user_id` = " . intval($userid) );
908
}
909
910
+ public function clear_db_cache(){
911
+ $this->wpforo->db->query( "DELETE FROM `" . $this->wpforo->db->prefix ."usermeta` WHERE `meta_key` = '_wpf_member_obj'" );
912
+ }
913
+
914
public function init_current_user(){
915
if(is_user_logged_in()){
916
$current_user = wp_get_current_user();
931
}
932
}
933
934
+ public function blog_posts( $userid ){
935
+ if( isset($userid) && $userid ) return count_user_posts( $userid , 'post' );
936
+ }
937
+
938
+ public function blog_comments($userid, $user_email){
939
+ global $wpdb;
940
+ if( !$userid || !$user_email ) return 0;
941
+ return (int) $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->comments. " WHERE `user_id` = " . intval($userid) . " OR `comment_author_email` = '" . esc_sql($user_email) . "'");
942
+ }
943
+
944
}
945
946
?>
wpf-includes/class-permissions.php CHANGED
@@ -165,14 +165,17 @@ class wpForoPermissions{
165
}
166
167
function forum_can( $forumid, $do ){
168
$forumid = intval($forumid);
169
if( !$this->wpforo->current_user_groupid ) return 0;
170
$forum = $this->wpforo->forum->get_forum($forumid, true);
171
$permissions = unserialize($forum['permissions']);
172
- $access = $permissions[$this->wpforo->current_user_groupid];
173
- $access_arr = $this->get_access($access);
174
- $cans = unserialize($access_arr['cans']);
175
- $can = ( isset($cans[$do]) ? $cans[$do] : 0 );
176
return $can;
177
}
178
@@ -183,6 +186,65 @@ class wpForoPermissions{
183
return ( isset($cans[$do]) ? $cans[$do] : 0 );
184
}
185
186
}
187
188
?>
165
}
166
167
function forum_can( $forumid, $do ){
168
+ $can = 0;
169
$forumid = intval($forumid);
170
if( !$this->wpforo->current_user_groupid ) return 0;
171
$forum = $this->wpforo->forum->get_forum($forumid, true);
172
$permissions = unserialize($forum['permissions']);
173
+ if( isset($permissions[$this->wpforo->current_user_groupid]) ){
174
+ $access = $permissions[$this->wpforo->current_user_groupid];
175
+ $access_arr = $this->get_access($access);
176
+ $cans = unserialize($access_arr['cans']);
177
+ $can = ( isset($cans[$do]) ? $cans[$do] : 0 );
178
+ }
179
return $can;
180
}
181
186
return ( isset($cans[$do]) ? $cans[$do] : 0 );
187
}
188
189
+ function user_can_manage_user( $user_id, $managing_user_id ){
190
+
191
+ if( !$user_id || !$managing_user_id ) return false;
192
+ if( $user_id == $managing_user_id ) return true;
193
+
194
+ $user = new WP_User( $user_id );
195
+ $user_level = $this->user_wp_level( $user );
196
+ if( !empty($user->roles) && is_array($user->roles) ) $user_role = array_shift($user->roles);
197
+
198
+ $managing_user = new WP_User( $managing_user_id );
199
+ $managing_user_level = $this->user_wp_level( $managing_user );
200
+ if( !empty($managing_user->roles) && is_array($managing_user->roles) ) $managing_user_role = array_shift($managing_user->roles);
201
+
202
+ if( (int)$user_level > (int)$managing_user_level ){
203
+ return true;
204
+ }
205
+ elseif( $user_id == 1 && $user_role == 'administrator' ){
206
+ return true;
207
+ }
208
+ elseif( (int)$user_level == (int)$managing_user_level ){
209
+ $member = $this->wpforo->member->get_member( $user_id );
210
+ $managing_member = $this->wpforo->member->get_member( $managing_user_id );
211
+ $user_wpforo_can = $this->usergroup_can( $member['groupid'], 'em' );
212
+ $managing_user_wpforo_can = $this->usergroup_can( $managing_member['groupid'], 'em' );
213
+ if( $user_wpforo_can && !$managing_user_wpforo_can ){
214
+ return true;
215
+ }
216
+ else{
217
+ return false;
218
+ }
219
+ }
220
+ elseif( $user_id != 1 && $managing_user_id == 1 && $managing_user_role == 'administrator' ){
221
+ return false;
222
+ }
223
+ else{
224
+ return false;
225
+ }
226
+ }
227
+
228
+ function user_wp_level( $user_object ){
229
+ $level = 0;
230
+ $levels = array();
231
+ if( is_int($user_object) ){
232
+ $user_object = new WP_User( $user_object );
233
+ }
234
+ if( isset($user_object->allcaps) && is_array($user_object->allcaps) && !empty($user_object->allcaps) ){
235
+ foreach($user_object->allcaps as $level_key => $level_value){
236
+ if( strpos($level_key, 'level_') !== FALSE && $level_value == 1 ){
237
+ $levels[] = intval(str_replace('level_', '', $level_key));
238
+ }
239
+ }
240
+ if(!empty($levels)){
241
+ $level = max($levels);
242
+ }
243
+ }
244
+ return $level;
245
+ }
246
+
247
+
248
}
249
250
?>
wpf-includes/class-template.php CHANGED
@@ -596,7 +596,7 @@ class wpForoTemplate{
596
597
}
598
599
- function icon($type, $item = array(), $echo = true, $layout = 1 ){
600
601
$icon = array();
602
$status = false;
@@ -606,24 +606,33 @@ class wpForoTemplate{
606
if($this->wpforo->topic->is_solved($item['topicid'])){
607
$icon['class'] = 'fa-check-circle';
608
$icon['color'] = 'wpfcl-8';
609
- if($echo) { $status = true; echo implode(' ', $icon); } else{ return implode(' ', $icon); }
610
}
611
}
612
613
if( $item['closed'] && $item['type'] == 1 ){
614
$icon['class'] = 'fa-lock';
615
$icon['color'] = 'wpfcl-1';
616
- if($echo) { $status = true; echo implode(' ', $icon); } else{ return implode(' ', $icon); }
617
}
618
elseif( $item['closed'] && $item['type'] != 1 ){
619
$icon['class'] = 'fa-lock';
620
$icon['color'] = 'wpfcl-1';
621
- if($echo) { $status = true; echo implode(' ', $icon); } else{ return implode(' ', $icon); }
622
}
623
elseif( !$item['closed'] && $item['type'] == 1 ){
624
$icon['class'] = 'fa-thumb-tack';
625
$icon['color'] = 'wpfcl-5';
626
- if($echo) { $status = true; echo implode(' ', $icon); } else{ return implode(' ', $icon); }
627
}
628
629
if( $status ){
@@ -638,25 +647,30 @@ class wpForoTemplate{
638
if( $item['posts'] == 1 ){
639
$icon['class'] = 'fa-file-o';
640
$icon['color'] = 'wpfcl-2';
641
}
642
elseif( $item['posts'] > 1 && $item['posts'] <= 5 ){
643
$icon['class'] = 'fa-file-text-o';
644
$icon['color'] = 'wpfcl-2';
645
}
646
elseif( $item['posts'] > 5 && $item['posts'] <= 20 ){
647
$icon['class'] = 'fa-file-text';
648
$icon['color'] = 'wpfcl-2';
649
}
650
elseif( $item['posts'] > 20 ){
651
$icon['class'] = 'fa-file-text';
652
$icon['color'] = 'wpfcl-5';
653
}
654
else{
655
$icon['class'] = 'fa-file-o';
656
$icon['color'] = 'wpfcl-2';
657
}
658
}
659
- if($echo) { echo implode(' ', $icon); } else{ return implode(' ', $icon); }
660
}
661
662
}
@@ -758,12 +772,14 @@ class wpForoTemplate{
758
759
}else{
760
761
- $this->wpforo->menu['wpforo-register'] = array(
762
- 'href' => wpforo_register_url(),
763
- 'label' => wpforo_phrase('register', FALSE),
764
- 'attr' => ( isset($_GET['wpforo']) && $_GET['wpforo'] == 'signup' ? ' class="wpforo-active"' : '' ),
765
- 'submenues' => array()
766
- );
767
$this->wpforo->menu['wpforo-login'] = array(
768
'href' => wpforo_login_url(),
769
'label' => wpforo_phrase('login', FALSE),
596
597
}
598
599
+ function icon($type, $item = array(), $echo = true, $data = 'icon' ){
600
601
$icon = array();
602
$status = false;
606
if($this->wpforo->topic->is_solved($item['topicid'])){
607
$icon['class'] = 'fa-check-circle';
608
$icon['color'] = 'wpfcl-8';
609
+ $icon['title'] = wpforo_phrase('Solved', false);
610
+ if($echo) {
611
+ $status = true; echo ($data == 'icon') ? implode(' ', $icon) : $icon['title'];
612
+ }
613
+ else{
614
+ return ($data == 'icon') ? implode(' ', $icon) : $icon['title'];
615
+ }
616
}
617
}
618
619
if( $item['closed'] && $item['type'] == 1 ){
620
$icon['class'] = 'fa-lock';
621
$icon['color'] = 'wpfcl-1';
622
+ $icon['title'] = wpforo_phrase('Closed', false);
623
+ if($echo) { $status = true; echo ($data == 'icon') ? implode(' ', $icon) : $icon['title']; } else{ return ($data == 'icon') ? implode(' ', $icon) : $icon['title']; }
624
}
625
elseif( $item['closed'] && $item['type'] != 1 ){
626
$icon['class'] = 'fa-lock';
627
$icon['color'] = 'wpfcl-1';
628
+ $icon['title'] = wpforo_phrase('Closed', false);
629
+ if($echo) { $status = true; echo ($data == 'icon') ? implode(' ', $icon) : $icon['title']; } else{ return ($data == 'icon') ? implode(' ', $icon) : $icon['title']; }
630
}
631
elseif( !$item['closed'] && $item['type'] == 1 ){
632
$icon['class'] = 'fa-thumb-tack';
633
$icon['color'] = 'wpfcl-5';
634
+ $icon['title'] = wpforo_phrase('Sticky', false);
635
+ if($echo) { $status = true; echo ($data == 'icon') ? implode(' ', $icon) : $icon['title']; } else{ return ($data == 'icon') ? implode(' ', $icon) : $icon['title']; }
636
}
637
638
if( $status ){
647
if( $item['posts'] == 1 ){
648
$icon['class'] = 'fa-file-o';
649
$icon['color'] = 'wpfcl-2';
650
+ $icon['title'] = '';
651
}
652
elseif( $item['posts'] > 1 && $item['posts'] <= 5 ){
653
$icon['class'] = 'fa-file-text-o';
654
$icon['color'] = 'wpfcl-2';
655
+ $icon['title'] = '';
656
}
657
elseif( $item['posts'] > 5 && $item['posts'] <= 20 ){
658
$icon['class'] = 'fa-file-text';
659
$icon['color'] = 'wpfcl-2';
660
+ $icon['title'] = '';
661
}
662
elseif( $item['posts'] > 20 ){
663
$icon['class'] = 'fa-file-text';
664
$icon['color'] = 'wpfcl-5';
665
+ $icon['title'] = '';
666
}
667
else{
668
$icon['class'] = 'fa-file-o';
669
$icon['color'] = 'wpfcl-2';
670
+ $icon['title'] = '';
671
}
672
}
673
+ if($echo) { echo ($data == 'icon') ? implode(' ', $icon) : $icon['title']; } else{ return ($data == 'icon') ? implode(' ', $icon) : $icon['title']; }
674
}
675
676
}
772
773
}else{
774
775
+ if( wpforo_feature('user-register', $this->wpforo) ){
776
+ $this->wpforo->menu['wpforo-register'] = array(
777
+ 'href' => wpforo_register_url(),
778
+ 'label' => wpforo_phrase('register', FALSE),
779
+ 'attr' => ( isset($_GET['wpforo']) && $_GET['wpforo'] == 'signup' ? ' class="wpforo-active"' : '' ),
780
+ 'submenues' => array()
781
+ );
782
+ }
783
$this->wpforo->menu['wpforo-login'] = array(
784
'href' => wpforo_login_url(),
785
'label' => wpforo_phrase('login', FALSE),
wpf-includes/class-topics.php CHANGED
@@ -581,7 +581,7 @@ class wpForoTopic{
581
582
function get_topic_url($topic, $forum = array()){
583
584
- if( !is_array($topic) ) $topic = $this->get_topic( intval($topic) );
585
586
if( is_array($topic) && !empty($topic) ){
587
581
582
function get_topic_url($topic, $forum = array()){
583
584
+ if( !is_array($topic) ) $topic = $this->get_topic( $topic );
585
586
if( is_array($topic) && !empty($topic) ){
587
wpf-includes/class-usergroups.php CHANGED
@@ -54,6 +54,21 @@ class wpForoUsergroup{
54
)
55
)
56
){
57
$this->wpforo->notice->add('User group successfully added', 'success');
58
return $this->wpforo->db->insert_id;
59
}
@@ -65,6 +80,10 @@ class wpForoUsergroup{
65
function edit( $groupid, $title, $cans ){
66
67
if( $groupid == 1 ) return false;
68
69
$default = array('cf' => '0', 'ef' => '0', 'df' => '0', 'vm' => '0', 'em' => 0, 'vmg' => 0, 'vmem' => '0', 'vprf' => '0',
70
'dm' => '0', 'upa' => '0', 'ups' => '0', 'va' => '0',
@@ -99,6 +118,12 @@ class wpForoUsergroup{
99
}
100
101
function delete(){
102
if( isset($_GET['action']) && $_GET['action'] == 'del' && isset($_GET['gid']) && $_GET['gid'] != 1 && $_GET['gid'] != 4 ){
103
$status = FALSE;
104
extract($_POST['usergroup'], EXTR_OVERWRITE);
54
)
55
)
56
){
57
+ $ugid = $this->wpforo->db->insert_id;
58
+ $forums = $this->wpforo->forum->get_forums();
59
+ if(!empty($forums) && $ugid){
60
+ $new_permission = array();
61
+ foreach($forums as $forum){
62
+ if(isset($forum['permissions'])){
63
+ $permissions = unserialize($forum['permissions']);
64
+ if(!empty($permissions)){
65
+ $permissions[$ugid] = 'standard';
66
+ $permissions = serialize($permissions);
67
+ $this->wpforo->db->update( $this->wpforo->db->prefix . 'wpforo_forums', array('permissions' => $permissions), array('forumid' => $forum['forumid']), array('%s'), array('%d') );
68
+ }
69
+ }
70
+ }
71
+ }
72
$this->wpforo->notice->add('User group successfully added', 'success');
73
return $this->wpforo->db->insert_id;
74
}
80
function edit( $groupid, $title, $cans ){
81
82
if( $groupid == 1 ) return false;
83
+ if( !current_user_can('administrator') ){
84
+ $this->wpforo->notice->add('Permission denied', 'error');
85
+ return FALSE;
86
+ }
87
88
$default = array('cf' => '0', 'ef' => '0', 'df' => '0', 'vm' => '0', 'em' => 0, 'vmg' => 0, 'vmem' => '0', 'vprf' => '0',
89
'dm' => '0', 'upa' => '0', 'ups' => '0', 'va' => '0',
118
}
119
120
function delete(){
121
+
122
+ if( !current_user_can('administrator') ){
123
+ $this->wpforo->notice->add('Permission denied', 'error');
124
+ return FALSE;
125
+ }
126
+
127
if( isset($_GET['action']) && $_GET['action'] == 'del' && isset($_GET['gid']) && $_GET['gid'] != 1 && $_GET['gid'] != 4 ){
128
$status = FALSE;
129
extract($_POST['usergroup'], EXTR_OVERWRITE);
wpf-includes/functions-installation.php CHANGED
@@ -65,6 +65,7 @@ function wpforo_activation(){
65
'footer-stat' => 1,
66
'author-link' => 0,
67
'comment-author-link' => 0,
68
'register-url' => 0,
69
'login-url' => 0,
70
'replace-avatar' => 1,
@@ -80,6 +81,7 @@ function wpforo_activation(){
80
'output-buffer' => 0,
81
'wp-date-format' => 0,
82
'subscribe_conf' => 1,
83
'debug-mode' => 0,
84
'copyright' => 1
85
);
@@ -470,27 +472,19 @@ function wpforo_activation(){
470
#################################################################
471
// Permalink Settings ///////////////////////////////////////////
472
$permalink_structure = get_option( 'permalink_structure' );
473
- if( $permalink_structure == '' ){
474
global $wp_rewrite;
475
$wp_rewrite->set_permalink_structure( '/%postname%/' );
476
- if( file_exists( ABSPATH.'.htaccess' )){
477
- $htaccesssize = filesize( ABSPATH.'.htaccess' );
478
- if( $htaccesssize == 0 ){
479
- wpforo_add_notice( 'permalink_notice' );
480
- }
481
- }else{
482
- wpforo_add_notice( 'permalink_notice' );
483
- }
484
}
485
486
#################################################################
487
// Creating Forum Page //////////////////////////////////////////
488
if( !$wpforo->pageid ){
489
- if( !$page_id = $wpforo->db->get_var("SELECT `ID` FROM `{$wpforo->db->prefix}posts` WHERE `post_content` LIKE '%[wpforo-index]%' AND `post_status` LIKE 'publish' AND `post_type` IN('post', 'page')") ){
490
$wpforo_page = array(
491
'post_date' => current_time( 'mysql', 1 ),
492
'post_date_gmt' => current_time( 'mysql', 1 ),
493
- 'post_content' => '[wpforo-index]',
494
'post_title' => 'Forum',
495
'post_status' => 'publish',
496
'comment_status' => 'close',
@@ -506,8 +500,14 @@ function wpforo_activation(){
506
}
507
if( $page_id && !is_wp_error($page_id) ){
508
update_option( 'wpforo_pageid', $page_id );
509
- update_option( 'wpforo_url', trim(get_permalink($page_id), '/') . '/' );
510
}
511
}
512
513
#################################################################
@@ -526,6 +526,10 @@ function wpforo_activation(){
526
wp_mkdir_p($avatars_upload_dir);
527
}
528
529
#################################################################
530
// RESET FUNCTIONS //////////////////////////////////////////////
531
$wpforo->db->query("DELETE FROM " . $wpforo->db->prefix . "options WHERE `option_name` LIKE '%_transient_wpforo_get_phrases_%' OR `option_name` LIKE '%_transient_timeout_wpforo_get_phrases_%'");
@@ -598,7 +602,6 @@ function wpforo_uninstall() {
598
$options = array( 'wpforo_version',
599
'wpforo_url',
600
'wpforo_general_options',
601
- 'wpforo_notices',
602
'wpforo_pageid',
603
'wpforo_count_per_page',
604
'wpforo_default_groupid',
65
'footer-stat' => 1,
66
'author-link' => 0,
67
'comment-author-link' => 0,
68
+ 'user-register' => 1,
69
'register-url' => 0,
70
'login-url' => 0,
71
'replace-avatar' => 1,
81
'output-buffer' => 0,
82
'wp-date-format' => 0,
83
'subscribe_conf' => 1,
84
+ 'attach-media-lib' => 1,
85
'debug-mode' => 0,
86
'copyright' => 1
87
);
472
#################################################################
473
// Permalink Settings ///////////////////////////////////////////
474
$permalink_structure = get_option( 'permalink_structure' );
475
+ if( !$permalink_structure ){
476
global $wp_rewrite;
477
$wp_rewrite->set_permalink_structure( '/%postname%/' );
478
}
479
480
#################################################################
481
// Creating Forum Page //////////////////////////////////////////
482
if( !$wpforo->pageid ){
483
+ if( !$page_id = $wpforo->db->get_var("SELECT `ID` FROM `{$wpforo->db->prefix}posts` WHERE `post_content` LIKE '%[wpforo%' AND `post_status` LIKE 'publish' AND `post_type` IN('post', 'page')") ){
484
$wpforo_page = array(
485
'post_date' => current_time( 'mysql', 1 ),
486
'post_date_gmt' => current_time( 'mysql', 1 ),
487
+ 'post_content' => '[wpforo]',
488
'post_title' => 'Forum',
489
'post_status' => 'publish',
490
'comment_status' => 'close',
500
}
501
if( $page_id && !is_wp_error($page_id) ){
502
update_option( 'wpforo_pageid', $page_id );
503
+ update_option( 'wpforo_use_home_url', '0' );
504
+ update_option( 'wpforo_permastruct', 'community' );
505
+ update_option( 'wpforo_url', site_url('/') . "community/" );
506
}
507
+ }else{
508
+ if( !$wpforo->use_home_url ) update_option( 'wpforo_use_home_url', '0' );
509
+ if( !$wpforo->permastruct ) update_option( 'wpforo_permastruct', basename( get_wpf_option('wpforo_url') ) );
510
+ $wpforo->db->query("UPDATE `{$wpforo->db->prefix}posts` SET `post_content` = REPLACE(`post_content`, '[wpforo-index]', '[wpforo]') WHERE `ID` = '{$wpforo->pageid}'");
511
}
512
513
#################################################################
526
wp_mkdir_p($avatars_upload_dir);
527
}
528
529
+ #################################################################
530
+ // RESET USER CACHE /////////////////////////////////////////////
531
+ $wpforo->member->clear_db_cache();
532
+
533
#################################################################
534
// RESET FUNCTIONS //////////////////////////////////////////////
535
$wpforo->db->query("DELETE FROM " . $wpforo->db->prefix . "options WHERE `option_name` LIKE '%_transient_wpforo_get_phrases_%' OR `option_name` LIKE '%_transient_timeout_wpforo_get_phrases_%'");
602
$options = array( 'wpforo_version',
603
'wpforo_url',
604
'wpforo_general_options',
605
'wpforo_pageid',
606
'wpforo_count_per_page',
607
'wpforo_default_groupid',
wpf-includes/functions-template.php CHANGED
@@ -417,7 +417,7 @@ class wpForo_Widget_recent_topics extends WP_Widget {
417
<div class="wpforo-list-item">
418
<?php if( $instance['display_avatar'] ): ?>
419
<div class="wpforo-list-item-left">
420
- <?php echo $wpforo->member->get_avatar( $topic['userid'], 'style="width:95%;"'); ?>
421
</div>
422
<?php endif; ?>
423
<div class="wpforo-list-item-right" <?php if( !$instance['display_avatar'] ): ?> style="width:100%"<?php endif; ?>>
@@ -492,7 +492,7 @@ class wpForo_Widget_recent_replies extends WP_Widget {
492
<div class="wpforo-list-item">
493
<?php if( $instance['display_avatar'] ): ?>
494
<div class="wpforo-list-item-left">
495
- <?php echo $wpforo->member->get_avatar( $post['userid'], 'style="width:95%;"'); ?>
496
</div>
497
<?php endif; ?>
498
<div class="wpforo-list-item-right" <?php if( !$instance['display_avatar'] ): ?> style="width:100%"<?php endif; ?>>
@@ -624,7 +624,7 @@ function wpforo_post_edited($post, $echo = true){
624
}
625
}
626
627
- function wpforo_hide_title($title, $id) {
628
global $wpforo;
629
if( !wpforo_feature('page-title', $wpforo) ){
630
if( $wpforo_base_slug = basename(WPFORO_BASE_URL) ) $wpforo_page = get_page_by_path($wpforo_base_slug);
417
<div class="wpforo-list-item">
418
<?php if( $instance['display_avatar'] ): ?>
419
<div class="wpforo-list-item-left">
420
+ <?php echo $wpforo->member->get_avatar( $topic['userid']); ?>
421
</div>
422
<?php endif; ?>
423
<div class="wpforo-list-item-right" <?php if( !$instance['display_avatar'] ): ?> style="width:100%"<?php endif; ?>>
492
<div class="wpforo-list-item">
493
<?php if( $instance['display_avatar'] ): ?>
494
<div class="wpforo-list-item-left">
495
+ <?php echo $wpforo->member->get_avatar( $post['userid']); ?>
496
</div>
497
<?php endif; ?>
498
<div class="wpforo-list-item-right" <?php if( !$instance['display_avatar'] ): ?> style="width:100%"<?php endif; ?>>
624
}
625
}
626
627
+ function wpforo_hide_title($title, $id = 0) {
628
global $wpforo;
629
if( !wpforo_feature('page-title', $wpforo) ){
630
if( $wpforo_base_slug = basename(WPFORO_BASE_URL) ) $wpforo_page = get_page_by_path($wpforo_base_slug);
wpf-includes/functions.php CHANGED
@@ -6,10 +6,51 @@ function wpforo_verify_form(){
6
if(!isset($_POST['wpforo_form']) || !wp_verify_nonce( $_POST['wpforo_form'], 'wpforo_verify_form' )) { wpforo_phrase('Sorry, something wrong with your data.'); exit(); }
7
}
8
9
- function is_wpforo_page(){
10
global $wpforo;
11
- if(isset($wpforo->current_object) && $wpforo->current_object['template'] && !is_admin()) return true;
12
- return false;
13
}
14
15
function is_wpforo_home(){
@@ -46,17 +87,6 @@ function wpforo_feature( $option, $wpforo = NULL ){
46
}
47
}
48
49
- function wpforo_add_notice( $phrase_key ){
50
- global $wpforo;
51
- $wpforo_noticies = $wpforo->notices;
52
- if( is_array($wpforo_noticies) && !empty( $wpforo_noticies ) ){
53
- $wpforo_noticies[] = $phrase_key;
54
- update_option( 'wpforo_notices', array_unique( $wpforo_noticies ) );
55
- }else{
56
- update_option( 'wpforo_notices', array( $phrase_key ));
57
- }
58
- }
59
-
60
#################################################################################
61
/**
62
* Returns merged arguments array from defined and default arguments.
@@ -616,20 +646,23 @@ function wpforo_content_filter( $content ){
616
}
617
}
618
$content = preg_replace('#(<a[^<>]*>[^<>]*)<a[^<>]*class=[\'"]wpforo-auto-embeded-link[\'"][^<>]*href=[\'"]([^\'"]*)[\'"][^<>]*>[^<>]*</a>([^<>]*</a>)#isu', '$1$2$3', $content);
619
return wpautop($content);
620
}
621
622
- add_action('wp_ajax_wpf_admin_notice_ajax', 'wpf_admin_notice_ajax_hide');
623
- function wpf_admin_notice_ajax_hide(){
624
- global $wpforo;
625
- $wpforo_noticies = $wpforo->notices;
626
- $phrase = esc_html($_POST['phrase']);
627
- if(($key = array_search($phrase, $wpforo_noticies)) !== false) {
628
- unset($wpforo_noticies[$key]);
629
- update_option( 'wpforo_notices', $wpforo_noticies );
630
- echo $phrase;
631
- }
632
- exit;
633
}
634
635
add_action('wpforo_bottom_hook', 'wpforo_page_logging');
@@ -1060,4 +1093,151 @@ function wpforo_deep_merge($default, $current = array()){
1060
}
1061
return $default;
1062
}
1063
?>
6
if(!isset($_POST['wpforo_form']) || !wp_verify_nonce( $_POST['wpforo_form'], 'wpforo_verify_form' )) { wpforo_phrase('Sorry, something wrong with your data.'); exit(); }
7
}
8
9
+ function is_wpforo_page($url = ''){
10
+ if( is_admin() ) return FALSE;
11
+ if( is_wpforo_shortcode_page() ) return TRUE;
12
+ return is_wpforo_url($url);
13
+ }
14
+
15
+ function is_wpforo_url($url = ''){
16
+ if( is_admin() ) return FALSE;
17
+ if(!$url) $url = wpforo_full_url();
18
+ global $wpforo;
19
+
20
+ if( $wpforo->use_home_url ) return TRUE;
21
+
22
+ $current_url = wpforo_get_url_query_vars_str($url);
23
+
24
+ if( $wpforo->permastruct && strpos($current_url, $wpforo->permastruct) !== FALSE
25
+ && strpos($current_url, $wpforo->permastruct) == 0
26
+ && !is_admin() ) return TRUE;
27
+
28
+ return FALSE;
29
+ }
30
+
31
+ function is_wpforo_shortcode_page(){
32
+ if( is_admin() ) return FALSE;
33
+ global $wpforo, $post;
34
+ if( $post && isset($post->post_content) && has_shortcode( $post->post_content, 'wpforo' ) && !is_wpforo_url() ) return TRUE;
35
+ return FALSE;
36
+ }
37
+
38
+ function wpforo_get_url_query_vars_str($url = ''){
39
+ if(!$url) $url = wpforo_full_url();
40
+
41
+ $current_url = preg_replace('#https?://[^/\?]+\.[^/\?]+/?#isu', '', $url);
42
+ $site_url = preg_replace('#https?://[^/\?]+\.[^/\?]+/?#isu', '', site_url('/'));
43
+ $current_url = trim( trim( preg_replace( '#^/?'.preg_quote($site_url).'#isu', '' , $current_url, 1 ), '/' ) );
44
+
45
+ return $current_url;
46
+ }
47
+
48
+ function wpforo_use_home_url(){
49
global $wpforo;
50
+
51
+ $current_url = wpforo_get_url_query_vars_str();
52
+ if( !$current_url && $wpforo->use_home_url ) return TRUE;
53
+ return FALSE;
54
}
55
56
function is_wpforo_home(){
87
}
88
}
89
90
#################################################################################
91
/**
92
* Returns merged arguments array from defined and default arguments.
646
}
647
}
648
$content = preg_replace('#(<a[^<>]*>[^<>]*)<a[^<>]*class=[\'"]wpforo-auto-embeded-link[\'"][^<>]*href=[\'"]([^\'"]*)[\'"][^<>]*>[^<>]*</a>([^<>]*</a>)#isu', '$1$2$3', $content);
649
+ $content = apply_filters('wpforo_content_filter', $content);
650
return wpautop($content);
651
}
652
653
+ add_filter('wpforo_content_filter', 'wpforo_nofollow_tag', 20);
654
+ function wpforo_nofollow_tag( $content ){
655
+ $content = preg_replace_callback('|<a[^><]*href=[\'\"]+([^\'\"]+)[\'\"]+[^><]*>.+?</a>|is', 'wpforo_nofollow', $content);
656
+ return $content;
657
+ }
658
+ function wpforo_nofollow($match){
659
+ $url = get_bloginfo('url');
660
+ $parse = parse_url($url);
661
+ if( isset($match[0]) ) $link = $match[0];
662
+ if( isset($match[1]) && strpos($match[1], $parse['host']) === FALSE ){
663
+ $link = preg_replace('|(<a[^><]+)>|is', '$1 rel="nofollow">', $match[0]);
664
+ }
665
+ return $link;
666
}
667
668
add_action('wpforo_bottom_hook', 'wpforo_page_logging');
1093
}
1094
return $default;
1095
}
1096
+
1097
+
1098
+ function wpforo_is_image($e){
1099
+ $is_image = false;
1100
+ $e = strtolower($e);
1101
+ if( $e == 'jpg' || $e == 'jpeg' || $e == 'png' || $e == 'gif' ){
1102
+ $is_image = true;
1103
+ }
1104
+ return $is_image;
1105
+ }
1106
+
1107
+ function get_wpf_option( $key ){
1108
+ global $wpdb;
1109
+ $value = get_option($key);
1110
+ if( $value ){
1111
+ $value = maybe_unserialize( $value );
1112
+ }
1113
+ else{
1114
+ $value = $wpdb->get_var("SELECT `option_value` FROM `".$wpdb->prefix."options` WHERE `option_name` = '". esc_sql($key) . "'");
1115
+ if(is_serialized( $value )) {
1116
+ $check = @unserialize($value);
1117
+ if( !$check ) $value = wpforo_fixSerializedArray($value);
1118
+ if( !$value && $value !== 0 ) return NULL;
1119
+ }
1120
+ }
1121
+ return $value;
1122
+ }
1123
+
1124
+ /**
1125
+ * Extract what remains from an unintentionally truncated serialized string
1126
+ * $data contains your original array (or what remains of it).
1127
+ * @param string The serialized array
1128
+ */
1129
+ function wpforo_fixSerializedArray($serialized){
1130
+ $tmp = preg_replace('/^a:\d+:\{/', '', $serialized);
1131
+ return wpforo_fixSerializedArray_R($tmp);
1132
+ }
1133
+ /**
1134
+ * The recursive function that does all of the heavy lifing. Do not call directly.
1135
+ * @param string The broken serialzized array
1136
+ * @return string Returns the repaired string
1137
+ */
1138
+ function wpforo_fixSerializedArray_R(&$broken){
1139
+ $data = array();
1140
+ $index = NULL;
1141
+ $len = strlen($broken);
1142
+ $i = 0;
1143
+ while(strlen($broken)) {
1144
+ $i++;
1145
+ if ($i > $len) { break; }
1146
+ if (substr($broken, 0, 1) == '}') {
1147
+ $broken = substr($broken, 1); return $data;
1148
+ }
1149
+ else{
1150
+ $bite = substr($broken, 0, 2);
1151
+ switch($bite) {
1152
+ case 's:':
1153
+ $re = '/^s:\d+:"([^\"]*)";/';
1154
+ if (preg_match($re, $broken, $m)){
1155
+ if ($index === NULL){ $index = $m[1]; }
1156
+ else{$data[$index] = $m[1]; $index = NULL;}
1157
+ $broken = preg_replace($re, '', $broken);
1158
+ }
1159
+ break;
1160
+ case 'i:':
1161
+ $re = '/^i:(\d+);/';
1162
+ if (preg_match($re, $broken, $m)){
1163
+ if ($index === NULL){$index = (int) $m[1]; }
1164
+ else{$data[$index] = (int) $m[1]; $index = NULL; }
1165
+ $broken = preg_replace($re, '', $broken);
1166
+ }
1167
+ break;
1168
+ case 'b:':
1169
+ $re = '/^b:[01];/';
1170
+ if (preg_match($re, $broken, $m)){
1171
+ $data[$index] = (bool) $m[1]; $index = NULL; $broken = preg_replace($re, '', $broken);
1172
+ }
1173
+ break;
1174
+ case 'a:':
1175
+ $re = '/^a:\d+:\{/';
1176
+ if (preg_match($re, $broken, $m)){
1177
+ $broken = preg_replace('/^a:\d+:\{/', '', $broken); $data[$index] = wpforo_fixSerializedArray_R($broken); $index = NULL;
1178
+ }
1179
+ break;
1180
+ case 'N;':
1181
+ $broken = substr($broken, 2); $data[$index] = NULL; $index = NULL;
1182
+ break;
1183
+ }
1184
+ }
1185
+ }
1186
+ return $data;
1187
+ }
1188
+
1189
+ function wpforo_insert_to_media_library( $attach_path, $title = '' ){
1190
+ if( wpforo_feature('attach-media-lib') ){
1191
+ if(!$attach_path ) return 0;
1192
+ $attach_fname = basename($attach_path);
1193
+ if(!$title) $title = $attach_fname;
1194
+ require_once(ABSPATH . 'wp-admin/includes/media.php');
1195
+ require_once(ABSPATH . 'wp-admin/includes/file.php');
1196
+ require_once(ABSPATH . 'wp-admin/includes/image.php');
1197
+ $wp_upload_dir = wp_upload_dir();
1198
+ $filetype = wp_check_filetype( $attach_fname, NULL );
1199
+ $attachment = array( 'guid' => $attach_path, 'post_mime_type' => $filetype['type'], 'post_title' => $title, 'post_content' => '', 'post_status' => 'inherit');
1200
+ $attach_id = wp_insert_attachment( $attachment, $attach_path );
1201
+ add_filter( 'intermediate_image_sizes', 'wpforo_attachment_sizes' );
1202
+ $attach_data = wp_generate_attachment_metadata( $attach_id, $attach_path );
1203
+ wp_update_attachment_metadata( $attach_id, $attach_data );
1204
+ remove_filter( 'intermediate_image_sizes', 'wpforo_attachment_sizes' );
1205
+ return $attach_id;
1206
+ }
1207
+ }
1208
+
1209
+ function wpforo_attachment_sizes( $sizes ){
1210
+ return array('thumbnail');
1211
+ }
1212
+
1213
+ function wpforo_debug( $wpforo ){
1214
+ ?>
1215
+ <div id="wpforo-debug" style="display:none">
1216
+ <h4>Current Object</h4>
1217
+ <p><?php @print_r($wpforo->current_object); ?></p>
1218
+ <h4>Super Globals</h4>
1219
+ <p>Requests: <?php print_r($_REQUEST); ?></p>
1220
+ <p>Server: <?php print_r($_REQUEST); ?></p>
1221
+ <h4>Options and Features</h4>
1222
+ <textarea style="width:500px; height:300px;"><?php echo @ 'permastruct: ' . $wpforo->permastruct . "\r\n";
1223
+ echo @ 'use_home_url: ' . $wpforo->use_home_url . "\r\n";
1224
+ echo @ 'url: ' . $wpforo->url . "\r\n";
1225
+ @print_r($wpforo->general_options) . "\r\n";
1226
+ echo @ 'pageid:' . $wpforo->pageid . "\r\n";
1227
+ echo @ 'default_groupid: ' . $wpforo->default_groupid . "\r\n";
1228
+ @print_r($wpforo->usergroup_cans) . "\r\n";
1229
+ @print_r($wpforo->forum_options) . "\r\n";
1230
+ @print_r($wpforo->forum_cans) . "\r\n";
1231
+ @print_r($wpforo->post_options) . "\r\n";
1232
+ @print_r($wpforo->member_options) . "\r\n";
1233
+ @print_r($wpforo->subscribe_options) . "\r\n";
1234
+ @print_r($wpforo->features) . "\r\n";
1235
+ @print_r($wpforo->style_options) . "\r\n";
1236
+ @print_r($wpforo->theme_options) . "\r\n";
1237
+ @print_r($wpforo->theme) . "\r\n";
1238
+ ?>
1239
+ </textarea>
1240
+ </div>
1241
+ <?php
1242
+ }
1243
?>
wpf-includes/wpf-actions.php CHANGED
@@ -15,7 +15,16 @@ function wpforo_actions(){
15
16
if(isset($_POST['wpforologin']) && isset($_POST['log']) && isset($_POST['pwd'])){
17
if ( !is_wp_error( $user = wp_signon() ) ) {
18
- $wpforo->notice->add('Welcome to our Community!', 'success');
19
wp_redirect( preg_replace('#\?.*$#is', '', wpforo_full_url()) );
20
exit();
21
}else{
@@ -37,6 +46,14 @@ function wpforo_actions(){
37
if(isset($_POST['wpforo_member_submit'])){
38
if(isset($_POST['member']['userid']) && $_POST['member']['userid']){
39
wpforo_verify_form();
40
$wpforo->member->edit();
41
if( isset($_POST['member']['avatar_type']) && $_POST['member']['avatar_type'] == 'custom' ) $wpforo->member->upload_avatar();
42
@@ -184,6 +201,10 @@ function wpforo_actions(){
184
$wpforo->db->query("DELETE FROM " . $wpforo->db->prefix . "options WHERE `option_name` LIKE '%_transient_wpforo_get_phrases_%' OR `option_name` LIKE '%_transient_timeout_wpforo_get_phrases_%'");
185
$wpforo->notice->add('Deleted Successfully!', 'success');
186
}
187
}
188
189
if( is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpforo-settings' ){
@@ -197,14 +218,19 @@ function wpforo_actions(){
197
##General options
198
if( isset($_POST['wpforo_general_options']) ){
199
check_admin_referer( 'wpforo-settings-general' );
200
- if( isset($_POST['wpforo_url']) && $wpforo_page_slug = sanitize_title_with_dashes( basename($_POST['wpforo_url']) ) )
201
- $sql = "UPDATE `".$wpforo->db->prefix."posts` SET `post_name` = '" . esc_sql($wpforo_page_slug) . "' WHERE `ID` = " . intval($wpforo->pageid);
202
- if(FALSE !== $wpforo->db->query($sql)){
203
- if( update_option('wpforo_url', trim(get_permalink($wpforo->pageid), '/') . '/') ){
204
- $wpforo->notice->add('Forum Base URL successfully updated', 'success');
205
- }else{
206
- $wpforo->notice->add('Successfully updated', 'success');
207
- }
208
}
209
210
if( update_option('wpforo_general_options', $_POST['wpforo_general_options']) ){
@@ -213,6 +239,8 @@ function wpforo_actions(){
213
$wpforo->notice->add('Successfully updated', 'success');
214
}
215
216
wp_redirect( admin_url( 'admin.php?page=wpforo-settings&tab=general' ) );
217
exit();
218
}
@@ -284,11 +312,9 @@ function wpforo_actions(){
284
check_admin_referer( 'wpforo-settings-styles' );
285
$wpforo->theme_options['style'] = sanitize_text_field($_POST['wpforo_theme_options']['style']);
286
$wpforo->theme_options['styles'] = $_POST['wpforo_theme_options']['styles'];
287
- if( update_option('wpforo_theme_options', $wpforo->theme_options) || update_option('wpforo_style_options', $_POST['wpforo_style_options']) ){
288
- $wpforo->notice->add('Theme options successfully updated', 'success');
289
- }else{
290
- $wpforo->notice->add('Theme options successfully updated, but previous value not changed', 'success');
291
- }
292
wp_redirect( admin_url( 'admin.php?page=wpforo-settings&tab=styles' ) );
293
exit();
294
}
@@ -374,12 +400,6 @@ function wpforo_actions(){
374
##Members
375
if( is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpforo-members' ){
376
377
- if(!current_user_can('administrator')){
378
- $wpforo->notice->add('Permission denied', 'error');
379
- wp_redirect(admin_url());
380
- exit();
381
- }
382
-
383
if( isset( $_GET['action'] ) && $_GET['action'] == 'del' && isset( $_GET['id'] ) && $_GET['id'] ){
384
385
if(!check_admin_referer( 'wpforo_admin_table_action_delete' )){
@@ -388,11 +408,12 @@ function wpforo_actions(){
388
exit();
389
}
390
391
- if( !$wpforo->perm->usergroup_can( $wpforo->current_user_groupid , 'dm' )){
392
$wpforo->notice->add('Permission denied for this action', 'error');
393
wp_redirect( admin_url( 'admin.php?page=wpforo-members' ) );
394
exit();
395
}
396
$wpforo->member->delete( intval($_GET['id']) );
397
wp_redirect( admin_url( 'admin.php?page=wpforo-members' ) );
398
exit();
15
16
if(isset($_POST['wpforologin']) && isset($_POST['log']) && isset($_POST['pwd'])){
17
if ( !is_wp_error( $user = wp_signon() ) ) {
18
+ $wpf_login_times = get_user_meta($user->ID, '_wpf_login_times', true);
19
+ if( isset($user->ID) && $wpf_login_times >= 1) {
20
+ $name = ( isset($user->data->display_name) ) ? $user->data->display_name : '';
21
+ $wpforo->notice->add( sprintf( 'Welcome back %s!', esc_html($name) ) , 'success');
22
+ }
23
+ else{
24
+ $wpforo->notice->add('Welcome to our Community!', 'success');
25
+ }
26
+ (int)$wpf_login_times++;
27
+ update_user_meta( $user->ID, '_wpf_login_times', $wpf_login_times );
28
wp_redirect( preg_replace('#\?.*$#is', '', wpforo_full_url()) );
29
exit();
30
}else{
46
if(isset($_POST['wpforo_member_submit'])){
47
if(isset($_POST['member']['userid']) && $_POST['member']['userid']){
48
wpforo_verify_form();
49
+
50
+ if(!$wpforo->perm->user_can_manage_user( $wpforo->current_userid, intval($_POST['member']['userid']))){
51
+ $wpforo->notice->clear();
52
+ $wpforo->notice->add('Permission denied', 'error');
53
+ wp_redirect(wpforo_full_url());
54
+ exit();
55
+ }
56
+
57
$wpforo->member->edit();
58
if( isset($_POST['member']['avatar_type']) && $_POST['member']['avatar_type'] == 'custom' ) $wpforo->member->upload_avatar();
59
201
$wpforo->db->query("DELETE FROM " . $wpforo->db->prefix . "options WHERE `option_name` LIKE '%_transient_wpforo_get_phrases_%' OR `option_name` LIKE '%_transient_timeout_wpforo_get_phrases_%'");
202
$wpforo->notice->add('Deleted Successfully!', 'success');
203
}
204
+ if( $_GET['action'] == 'reset_user_cache' && check_admin_referer( 'wpforo_reset_user_cache' ) ){
205
+ $wpforo->member->clear_db_cache();
206
+ $wpforo->notice->add('Deleted Successfully!', 'success');
207
+ }
208
}
209
210
if( is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpforo-settings' ){
218
##General options
219
if( isset($_POST['wpforo_general_options']) ){
220
check_admin_referer( 'wpforo-settings-general' );
221
+
222
+ if( isset($_POST['wpforo_use_home_url']) && $_POST['wpforo_use_home_url'] ){
223
+ update_option('wpforo_use_home_url', 1);
224
+ }else{
225
+ update_option('wpforo_use_home_url', 0);
226
+ }
227
+
228
+ if( isset($_POST['wpforo_url']) && $permastruct = utf8_uri_encode( $_POST['wpforo_url'] ) )
229
+ if( update_option('wpforo_url', site_url('/') . trim($permastruct, '/') . "/")
230
+ && update_option('wpforo_permastruct', trim($permastruct, '/')) ){
231
+ $wpforo->notice->add('Forum Base URL successfully updated', 'success');
232
+ }else{
233
+ $wpforo->notice->add('Successfully updated', 'success');
234
}
235
236
if( update_option('wpforo_general_options', $_POST['wpforo_general_options']) ){
239
$wpforo->notice->add('Successfully updated', 'success');
240
}
241
242
+ $wpforo->member->clear_db_cache();
243
+
244
wp_redirect( admin_url( 'admin.php?page=wpforo-settings&tab=general' ) );
245
exit();
246
}
312
check_admin_referer( 'wpforo-settings-styles' );
313
$wpforo->theme_options['style'] = sanitize_text_field($_POST['wpforo_theme_options']['style']);
314
$wpforo->theme_options['styles'] = $_POST['wpforo_theme_options']['styles'];
315
+ update_option('wpforo_style_options', $_POST['wpforo_style_options']);
316
+ update_option('wpforo_theme_options', $wpforo->theme_options);
317
+ $wpforo->notice->add('Theme options successfully updated', 'success');
318
wp_redirect( admin_url( 'admin.php?page=wpforo-settings&tab=styles' ) );
319
exit();
320
}
400
##Members
401
if( is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpforo-members' ){
402
403
if( isset( $_GET['action'] ) && $_GET['action'] == 'del' && isset( $_GET['id'] ) && $_GET['id'] ){
404
405
if(!check_admin_referer( 'wpforo_admin_table_action_delete' )){
408
exit();
409
}
410
411
+ if( !$wpforo->perm->usergroup_can( $wpforo->current_user_groupid , 'dm' ) || !$wpforo->perm->user_can_manage_user( $wpforo->current_userid, intval($_GET['id']) ) ){
412
$wpforo->notice->add('Permission denied for this action', 'error');
413
wp_redirect( admin_url( 'admin.php?page=wpforo-members' ) );
414
exit();
415
}
416
+
417
$wpforo->member->delete( intval($_GET['id']) );
418
wp_redirect( admin_url( 'admin.php?page=wpforo-members' ) );
419
exit();
wpf-includes/wpf-hooks.php CHANGED
@@ -131,26 +131,73 @@ function wpforo_init_template(){
131
include_once( wpftpl('index.php') );
132
}
133
134
- add_shortcode( 'wpforo-index', 'wpforo_load' );
135
- function wpforo_load( $content ){
136
- global $post;
137
if(is_admin()) return;
138
- $wpforo_url = WPFORO_BASE_URL;
139
- $wpforo_pageslug = basename($wpforo_url);
140
- if( $post->post_name == $wpforo_pageslug ){
141
- if(wpforo_feature('output-buffer') && function_exists('ob_start')){
142
- ob_start();
143
- wpforo_init_template();
144
- return ob_get_clean();
145
- }
146
- else{
147
- wpforo_init_template();
148
}
149
- }else{
150
- return false;
151
}
152
}
153
154
function wpforo_theme_functions(){
155
$path = wpftpl('functions.php');
156
if( file_exists($path) ){
@@ -167,13 +214,6 @@ function wpforo_theme_functions_wp(){
167
}
168
add_action('after_setup_theme', 'wpforo_theme_functions_wp');
169
170
- function wpforo_do_rewrite(){
171
- $wpforo_pageslug = basename(WPFORO_BASE_URL);
172
- add_rewrite_rule($wpforo_pageslug.'/(.+)#x27;, 'index.php?pagename='.$wpforo_pageslug, 'top');
173
- flush_rewrite_rules();
174
- }
175
- add_action('init', 'wpforo_do_rewrite');
176
-
177
function wpforo_meta_title($title) {
178
global $wpforo;
179
$is404 = false;
@@ -222,6 +262,9 @@ function wpforo_meta_title($title) {
222
$meta_title = array(wpforo_phrase('Forum', false), get_bloginfo('name'));
223
}
224
}
225
elseif($title){
226
$meta_title = (is_array($title)) ? $title : array($title);
227
}
@@ -259,11 +302,15 @@ function wpforo_add_meta_tags(){
259
260
if(is_wpforo_page()){
261
$title = '';
262
$description = '';
263
$canonical = wpforo_full_url();
264
$paged = ( $wpforo->current_object['paged'] > 1 ) ? wpforo_phrase( 'page', false) . ' ' . $wpforo->current_object['paged'] .' | ' : '';
265
if(!empty($wpforo->current_object['forum'])) $forum = $wpforo->current_object['forum'];
266
if(!empty($wpforo->current_object['topic'])) $topic = $wpforo->current_object['topic'];
267
if(isset($wpforo->current_object)){
268
if( isset($wpforo->current_object['forumid']) && !isset($wpforo->current_object['topicid']) ){
269
if(isset($forum['title'])) $title = $forum['title'];
@@ -276,7 +323,13 @@ function wpforo_add_meta_tags(){
276
}elseif( isset($wpforo->current_object['topicid']) && isset($topic['first_postid']) ){
277
$post = $wpforo->post->get_post($topic['first_postid']);
278
if(isset($post['title'])) $title = wpforo_text($paged . $post['title'], 60, false);
279
- if(isset($post['body'])) $description = wpforo_text($paged . $post['body'], 155, false);
280
}elseif(isset($wpforo->current_object['template']) && $wpforo->current_object['template'] == 'member'){
281
$wpfpaged = ( isset($_GET['wpfpaged']) && $_GET['wpfpaged'] > 1 ) ? wpforo_phrase( 'Page', false) . ' ' . $_GET['wpfpaged'] .' | ' : '';
282
$description = $wpfpaged . wpforo_phrase( 'Forum Members List', false);
@@ -814,20 +867,27 @@ function wpforo_frontend_enqueue(){
814
wp_enqueue_script('wpforo-ajax');
815
wp_localize_script('wpforo-ajax', 'wpf_ajax_obj', array( 'url' => admin_url('admin-ajax.php'), 'phrases' => $wpforo->phrases ));
816
}
817
}
818
819
if (is_rtl()) {
820
- wp_register_style('wpforo-style-rtl', WPFORO_TEMPLATE_URL . '/style-rtl.css', false, WPFORO_VERSION );
821
- wp_enqueue_style('wpforo-style-rtl');
822
}
823
else{
824
- wp_register_style('wpforo-style', WPFORO_TEMPLATE_URL . '/style.css', false, WPFORO_VERSION );
825
- wp_enqueue_style('wpforo-style');
826
- }
827
-
828
- if( file_exists(WPFORO_TEMPLATE_DIR . '/colors.css') ){
829
- wp_register_style( 'wpforo-dynamic-style', WPFORO_TEMPLATE_URL . '/colors.css', false, WPFORO_VERSION );
830
- wp_enqueue_style('wpforo-dynamic-style');
831
}
832
}
833
add_action('wp_enqueue_scripts', 'wpforo_frontend_enqueue');
@@ -970,28 +1030,20 @@ function wpforo_admin_enqueue(){
970
wp_register_script( 'wpforo-basic_js', WPFORO_URL . '/wpf-admin/js/functions.js', array('jquery'), WPFORO_VERSION, false );
971
wp_enqueue_script( 'wpforo-basic_js' );
972
wp_localize_script( 'wpforo-basic_js', 'wpforo_admin', array('phrases' => $phrases) );
973
- wp_register_script( 'wpforo-admin_notice', WPFORO_URL . '/wpf-admin/js/admin_notice.js', array('jquery'), WPFORO_VERSION, false );
974
- wp_enqueue_script( 'wpforo-admin_notice' );
975
- wp_localize_script('wpforo-admin_notice', 'wpf_admin_notice_obj', array('url' => admin_url('admin-ajax.php')));
976
}
977
}
978
add_action( 'admin_enqueue_scripts', 'wpforo_admin_enqueue' );
979
980
- function wpforo_admin_display_notice() {
981
- global $wpforo;
982
- $wpforo_notices = $wpforo->notices;
983
- if(is_array($wpforo_notices)){
984
- foreach($wpforo_notices as $notice){
985
- echo '<div id="' . esc_attr($notice) . '" class="update-nag">' . wpforo_phrase( $notice, FALSE ) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a id="' . esc_attr($notice) . '" class="wpfadmin_notice">' . __( 'Dismiss', 'wpforo' ) . '</a></div>';
986
- }
987
- }
988
- $permalink_structure = get_option( 'permalink_structure' );
989
- if( $permalink_structure == '' ){
990
- wpforo_add_notice( 'default_permalink_notice' );
991
}
992
993
}
994
- add_action( 'admin_notices', 'wpforo_admin_display_notice' );
995
996
function wpforo_userform_to_wpuser_html_form($wp_user){
997
if( is_super_admin() ){
@@ -1223,11 +1275,12 @@ function wpforo_add_default_attachment($args){
1223
1224
$file_name = $fnm . "." . $ext;
1225
1226
- $attach_fname = current_time( 'timestamp', 1 ).( !$fnm_empty ? '-' : '' ).$file_name;
1227
- $attach_path = $attach_dir."/".$attach_fname;
1228
1229
if( is_dir($attach_dir) && move_uploaded_file($tmp_name, $attach_path) ){
1230
- $args['body'] .= "\r\n" . '<div class="wpforo-attached-file"><a class="wpforo-default-attachment" href="' . esc_url($attach_url.'/'.$attach_fname) . '" target="_blank"><i class="fa fa-paperclip"></i>' . esc_html(basename($name)) . '</a></div>';
1231
$args['has_attach'] = 1;
1232
}else{
1233
$wpforo->notice->add('Can`t upload file', 'error');
@@ -1236,6 +1289,20 @@ function wpforo_add_default_attachment($args){
1236
}
1237
return $args;
1238
}
1239
add_filter( 'wpforo_add_topic_data_filter', 'wpforo_add_default_attachment' );
1240
add_filter( 'wpforo_edit_topic_data_filter', 'wpforo_add_default_attachment' );
1241
add_filter( 'wpforo_add_post_data_filter', 'wpforo_add_default_attachment' );
131
include_once( wpftpl('index.php') );
132
}
133
134
+ add_shortcode( 'wpforo', 'wpforo_load' );
135
+ function wpforo_load( $atts ){
136
if(is_admin()) return;
137
+ global $wpforo, $post;
138
+
139
+ if( is_wpforo_shortcode_page() ){
140
+ $url = WPFORO_BASE_URL;
141
+
142
+ $args = shortcode_atts( array(
143
+ 'item' => 'forum',
144
+ 'id' => 0,
145
+ 'slug' => '',
146
+ ), $atts );
147
+
148
+ if( $args['id'] || $args['slug'] ){
149
+ $getid = ( $args['slug'] ? $args['slug'] : $args['id'] );
150
+ if( $args['item'] == 'topic' ){
151
+ $url = $wpforo->topic->get_topic_url($getid);
152
+ }elseif( $args['item'] == 'profile' ){
153
+ $url = $wpforo->member->get_profile_url($getid);
154
+ }else{
155
+ $url = $wpforo->forum->get_forum_url($getid);
156
+ }
157
}
158
+
159
+ $wpforo->init_current_object($url);
160
+ $wpforo->tpl->init_nav_menu();
161
+ }
162
+
163
+ if(wpforo_feature('output-buffer') && function_exists('ob_start')){
164
+ ob_start();
165
+ wpforo_init_template();
166
+ return ob_get_clean();
167
+ }
168
+ else{
169
+ wpforo_init_template();
170
}
171
+
172
+ }
173
+
174
+
175
+ function wpforo_template_include($template){
176
+ if( is_wpforo_page() && !is_wpforo_shortcode_page() && ($wpforo_template = wpftpl('index.php')) ) return $wpforo_template;
177
+ return $template;
178
}
179
180
+ add_action('wp', 'wpforo_set_404_to_false');
181
+ function wpforo_set_404_to_false(){
182
+ if( is_wpforo_page() ){
183
+ global $wp_query;
184
+ $wp_query->is_404 = FALSE;
185
+ }
186
+ }
187
+
188
+ function wpforo_do_rewrite(){
189
+ if(!is_wpforo_page()) return;
190
+
191
+ global $wpforo;
192
+ $pattern = ($wpforo->use_home_url ? '(.*)' : '('.preg_quote($wpforo->permastruct).'(?:/|$).*)#x27;);
193
+ add_rewrite_rule($pattern, 'index.php?page_id=' . $wpforo->pageid, 'top');
194
+ flush_rewrite_rules();
195
+ nocache_headers();
196
+ if( $wpforo->use_home_url )
197
+ add_filter('template_include', 'wpforo_template_include');
198
+ }
199
+ add_action('init', 'wpforo_do_rewrite');
200
+
201
function wpforo_theme_functions(){
202
$path = wpftpl('functions.php');
203
if( file_exists($path) ){
214
}
215
add_action('after_setup_theme', 'wpforo_theme_functions_wp');
216
217
function wpforo_meta_title($title) {
218
global $wpforo;
219
$is404 = false;
262
$meta_title = array(wpforo_phrase('Forum', false), get_bloginfo('name'));
263
}
264
}
265
+ elseif( isset($wpforo->general_options['title']) && $wpforo->general_options['title'] ){
266
+ $meta_title = array($wpforo->general_options['title'], get_bloginfo('name'));
267
+ }
268
elseif($title){
269
$meta_title = (is_array($title)) ? $title : array($title);
270
}
302
303
if(is_wpforo_page()){
304
$title = '';
305
+ $template = '';
306
$description = '';
307
+ $udata = array();
308
$canonical = wpforo_full_url();
309
$paged = ( $wpforo->current_object['paged'] > 1 ) ? wpforo_phrase( 'page', false) . ' ' . $wpforo->current_object['paged'] .' | ' : '';
310
+ if(isset($wpforo->current_object['template'])) $template = $wpforo->current_object['template'];
311
if(!empty($wpforo->current_object['forum'])) $forum = $wpforo->current_object['forum'];
312
if(!empty($wpforo->current_object['topic'])) $topic = $wpforo->current_object['topic'];
313
+ if(!empty($wpforo->current_object['user'])) $user = $wpforo->current_object['user'];
314
if(isset($wpforo->current_object)){
315
if( isset($wpforo->current_object['forumid']) && !isset($wpforo->current_object['topicid']) ){
316
if(isset($forum['title'])) $title = $forum['title'];
323
}elseif( isset($wpforo->current_object['topicid']) && isset($topic['first_postid']) ){
324
$post = $wpforo->post->get_post($topic['first_postid']);
325
if(isset($post['title'])) $title = wpforo_text($paged . $post['title'], 60, false);
326
+ if(isset($post['body'])) $description = wpforo_text($paged . $post['body'], 150, false);
327
+ }elseif( $template == 'profile' || $template == 'account' || $template == 'activity' || $template == 'subscriptions' ){
328
+ if( isset($wpforo->general_options['title']) ) $title = $paged . $wpforo->general_options['title'];
329
+ $udata['name'] = (isset($user['display_name']) && $user['display_name']) ? wpforo_phrase( 'User', false ) . ': ' . $user['display_name'] : '';
330
+ $udata['title'] = (isset($user['stat']['title']) && $user['stat']['title']) ? wpforo_phrase( 'Title', false ) . ': ' . $user['stat']['title'] : '';
331
+ $udata['about'] = (isset($user['about']) && $user['about']) ? wpforo_phrase( 'About', false ) . ': ' . wpforo_text($user['about'], 150, false) : '';
332
+ $description = $title . ' - ' . wpforo_phrase('Member Profile', false) . ' &gt; ' . wpforo_phrase( ucfirst($template), false ) . ' ' . wpforo_phrase( 'Page', false ) . '. ' . implode(', ', $udata);
333
}elseif(isset($wpforo->current_object['template']) && $wpforo->current_object['template'] == 'member'){
334
$wpfpaged = ( isset($_GET['wpfpaged']) && $_GET['wpfpaged'] > 1 ) ? wpforo_phrase( 'Page', false) . ' ' . $_GET['wpfpaged'] .' | ' : '';
335
$description = $wpfpaged . wpforo_phrase( 'Forum Members List', false);
867
wp_enqueue_script('wpforo-ajax');
868
wp_localize_script('wpforo-ajax', 'wpf_ajax_obj', array( 'url' => admin_url('admin-ajax.php'), 'phrases' => $wpforo->phrases ));
869
}
870
+ if (is_rtl()) {
871
+ wp_register_style('wpforo-style-rtl', WPFORO_TEMPLATE_URL . '/style-rtl.css', false, WPFORO_VERSION );
872
+ wp_enqueue_style('wpforo-style-rtl');
873
+ }
874
+ else{
875
+ wp_register_style('wpforo-style', WPFORO_TEMPLATE_URL . '/style.css', false, WPFORO_VERSION );
876
+ wp_enqueue_style('wpforo-style');
877
+ }
878
+ if( file_exists(WPFORO_TEMPLATE_DIR . '/colors.css') ){
879
+ wp_register_style( 'wpforo-dynamic-style', WPFORO_TEMPLATE_URL . '/colors.css', false, WPFORO_VERSION );
880
+ wp_enqueue_style('wpforo-dynamic-style');
881
+ }
882
}
883
884
if (is_rtl()) {
885
+ wp_register_style('wpforo-widgets-rtl', WPFORO_TEMPLATE_URL . '/widgets-rtl.css', false, WPFORO_VERSION );
886
+ wp_enqueue_style('wpforo-widgets-rtl');
887
}
888
else{
889
+ wp_register_style('wpforo-widgets', WPFORO_TEMPLATE_URL . '/widgets.css', false, WPFORO_VERSION );
890
+ wp_enqueue_style('wpforo-widgets');
891
}
892
}
893
add_action('wp_enqueue_scripts', 'wpforo_frontend_enqueue');
1030
wp_register_script( 'wpforo-basic_js', WPFORO_URL . '/wpf-admin/js/functions.js', array('jquery'), WPFORO_VERSION, false );
1031
wp_enqueue_script( 'wpforo-basic_js' );
1032
wp_localize_script( 'wpforo-basic_js', 'wpforo_admin', array('phrases' => $phrases) );
1033
}
1034
}
1035
add_action( 'admin_enqueue_scripts', 'wpforo_admin_enqueue' );
1036
1037
+ function wpforo_admin_permalink_notice() {
1038
+ $permalink_structure = get_option( 'permalink_structure' );
1039
+ if( !$permalink_structure ){
1040
+ $class = 'notice notice-warning';
1041
+ $message = __( 'IMPORTANT: wpForo can\'t work with default permalink, please change permalink structure', 'wpforo' );
1042
+ printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
1043
}
1044
1045
}
1046
+ add_action( 'admin_notices', 'wpforo_admin_permalink_notice' );
1047
1048
function wpforo_userform_to_wpuser_html_form($wp_user){
1049
if( is_super_admin() ){
1275
1276
$file_name = $fnm . "." . $ext;
1277
1278
+ $attach_fname = current_time( 'timestamp', 1 ).( !$fnm_empty ? '-' : '' ) . $file_name;
1279
+ $attach_path = $attach_dir . "/" . $attach_fname;
1280
1281
if( is_dir($attach_dir) && move_uploaded_file($tmp_name, $attach_path) ){
1282
+ $attach_id = wpforo_insert_to_media_library( $attach_path, $fnm );
1283
+ $args['body'] .= "\r\n" . '<div id="wpfa-' . $attach_id . '" class="wpforo-attached-file"><a class="wpforo-default-attachment" href="' . esc_url($attach_url.'/'.$attach_fname) . '" target="_blank"><i class="fa fa-paperclip"></i>' . esc_html(basename($name)) . '</a></div>';
1284
$args['has_attach'] = 1;
1285
}else{
1286
$wpforo->notice->add('Can`t upload file', 'error');
1289
}
1290
return $args;
1291
}
1292
+
1293
+ function wpforo_delete_attachment( $attach_post_id ){
1294
+ global $wpdb;
1295
+ if(!$attach_post_id) return;
1296
+ $posts = $wpdb->get_results("SELECT `postid`, `body` FROM `" . $wpdb->prefix . "wpforo_posts` WHERE `body` LIKE '%wpfa-" . intval( $attach_post_id ) . "%'", ARRAY_A );
1297
+ if(!empty($posts) || is_array($posts)){
1298
+ foreach( $posts as $post ){
1299
+ $body = preg_replace('|<div[^><]*id=[\'\"]+wpfa-' . $attach_post_id . '[\'\"]+[^><]*>.+?</div>|is', '<div class="wpforo-attached-file wpfa-deleted">' . wpforo_phrase('Attachment removed', FALSE) . '</div>', $post['body'] );
1300
+ if( $body ) $wpdb->query("UPDATE `" . $wpdb->prefix . "wpforo_posts` SET `body` = '" . esc_sql( $body ) . "' WHERE `postid` = " . intval($post['postid']));
1301
+ }
1302
+ }
1303
+ }
1304
+
1305
+ add_action( 'delete_attachment', 'wpforo_delete_attachment', 10 );
1306
add_filter( 'wpforo_add_topic_data_filter', 'wpforo_add_default_attachment' );
1307
add_filter( 'wpforo_edit_topic_data_filter', 'wpforo_add_default_attachment' );
1308
add_filter( 'wpforo_add_post_data_filter', 'wpforo_add_default_attachment' );
wpf-includes/wpf-phrases.php CHANGED
@@ -316,7 +316,7 @@ $wpforo_phrases = array(
316
'Subscription Emails' => __('Subscription Emails', 'wpforo'),
317
'Subscriptions' => __('Subscriptions', 'wpforo'),
318
'Support Forum' => __('Support Forum', 'wpforo'),
319
- 'Thank you for trying wpForo! It\'s on the Beta stage and we\'re working hard to reach the Gold 1.0.0 version as soon as possible. wpForo is a professional bulletin board for WorPress, and the only forum software which comes with Multi-layout template system. The "Extended' => __('Thank you for trying wpForo! It\'s on the Beta stage and we\'re working hard to reach the Gold 1.0.0 version as soon as possible. wpForo is a professional bulletin board for WorPress, and the only forum software which comes with Multi-layout template system. The "Extended', 'wpforo'),
320
'Thank you for using wpForo. wpForo is a premium forum plugin which will always be available for free. There will never be paid and pro versions of this forum board. However this is a very large and hard project so we also develop paid addons (extensions), which will financially help us to keep improving and adding new features to the free wpForo plugin. Forum addons will also be actively developed. The first addons "Advanced Media Uploader' => __('Thank you for using wpForo. wpForo is a premium forum plugin which will always be available for free. There will never be paid and pro versions of this forum board. However this is a very large and hard project so we also develop paid addons (extensions), which will financially help us to keep improving and adding new features to the free wpForo plugin. Forum addons will also be actively developed. The first addons "Advanced Media Uploader', 'wpforo'),
321
'The "slug" is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' => __('The "slug" is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'wpforo'),
322
'The position in the menu order wpForo should appear.' => __('The position in the menu order wpForo should appear.', 'wpforo'),
@@ -326,7 +326,7 @@ $wpforo_phrases = array(
326
'Theme file not readable' => __('Theme file not readable', 'wpforo'),
327
'This action will also delete all sub-forums, topics and replies.' => __('This action will also delete all sub-forums, topics and replies.', 'wpforo'),
328
'This is a forum description. This content will be displayed under forum title on the forum list.' => __('This is a forum description. This content will be displayed under forum title on the forum list.', 'wpforo'),
329
- 'This feature is useful if you\'re adding content before or after [wpforo-index] shortcode in page content. Also it useful if forum is loaded before website header, on top of the front-end.' => __('This feature is useful if you\'re adding content before or after [wpforo-index] shortcode in page content. Also it useful if forum is loaded before website header, on top of the front-end.', 'wpforo'),
330
'This message comes from post reporting pop-up form.' => __('This message comes from post reporting pop-up form.', 'wpforo'),
331
'This option doesn\'t affect website admins.' => __('This option doesn\'t affect website admins.', 'wpforo'),
332
'Timezone' => __('Timezone', 'wpforo'),
@@ -489,7 +489,6 @@ $wpforo_phrases = array(
489
'Successfully voted' => __('Successfully voted', 'wpforo'),
490
'The uploaded file size is too big' => __('The uploaded file size is too big', 'wpforo'),
491
'Theme options successfully updated' => __('Theme options successfully updated', 'wpforo'),
492
- 'Theme options successfully updated, but previous value not changed' => __('Theme options successfully updated, but previous value not changed', 'wpforo'),
493
'This email address is already registered. Please insert another.' => __('This email address is already registered. Please insert another.', 'wpforo'),
494
'This post successfully deleted' => __('This post successfully deleted', 'wpforo'),
495
'This post successfully edited' => __('This post successfully edited', 'wpforo'),
@@ -624,5 +623,22 @@ $wpforo_phrases = array(
624
'Standard access' => __('Standard access', 'wpforo'),
625
'Moderator access' => __('Moderator access', 'wpforo'),
626
'Full access' => __('Full access', 'wpforo'),
627
- 'Profile' => __('Profile', 'wpforo')
628
);
316
'Subscription Emails' => __('Subscription Emails', 'wpforo'),
317
'Subscriptions' => __('Subscriptions', 'wpforo'),
318
'Support Forum' => __('Support Forum', 'wpforo'),
319
+ 'Thank you for using wpForo! wpForo is a professional bulletin board for WorPress, and the only forum software which comes with Multi-layout template system. The "Extended' => __('Thank you for using wpForo! wpForo is a professional bulletin board for WorPress, and the only forum software which comes with Multi-layout template system. The "Extended', 'wpforo'),
320
'Thank you for using wpForo. wpForo is a premium forum plugin which will always be available for free. There will never be paid and pro versions of this forum board. However this is a very large and hard project so we also develop paid addons (extensions), which will financially help us to keep improving and adding new features to the free wpForo plugin. Forum addons will also be actively developed. The first addons "Advanced Media Uploader' => __('Thank you for using wpForo. wpForo is a premium forum plugin which will always be available for free. There will never be paid and pro versions of this forum board. However this is a very large and hard project so we also develop paid addons (extensions), which will financially help us to keep improving and adding new features to the free wpForo plugin. Forum addons will also be actively developed. The first addons "Advanced Media Uploader', 'wpforo'),
321
'The "slug" is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' => __('The "slug" is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'wpforo'),
322
'The position in the menu order wpForo should appear.' => __('The position in the menu order wpForo should appear.', 'wpforo'),
326
'Theme file not readable' => __('Theme file not readable', 'wpforo'),
327
'This action will also delete all sub-forums, topics and replies.' => __('This action will also delete all sub-forums, topics and replies.', 'wpforo'),
328
'This is a forum description. This content will be displayed under forum title on the forum list.' => __('This is a forum description. This content will be displayed under forum title on the forum list.', 'wpforo'),
329
+ 'This feature is useful if you\'re adding content before or after [wpforo] shortcode in page content. Also it useful if forum is loaded before website header, on top of the front-end.' => __('This feature is useful if you\'re adding content before or after [wpforo] shortcode in page content. Also it useful if forum is loaded before website header, on top of the front-end.', 'wpforo'),
330
'This message comes from post reporting pop-up form.' => __('This message comes from post reporting pop-up form.', 'wpforo'),
331
'This option doesn\'t affect website admins.' => __('This option doesn\'t affect website admins.', 'wpforo'),
332
'Timezone' => __('Timezone', 'wpforo'),
489
'Successfully voted' => __('Successfully voted', 'wpforo'),
490
'The uploaded file size is too big' => __('The uploaded file size is too big', 'wpforo'),
491
'Theme options successfully updated' => __('Theme options successfully updated', 'wpforo'),
492
'This email address is already registered. Please insert another.' => __('This email address is already registered. Please insert another.', 'wpforo'),
493
'This post successfully deleted' => __('This post successfully deleted', 'wpforo'),
494
'This post successfully edited' => __('This post successfully edited', 'wpforo'),
623
'Standard access' => __('Standard access', 'wpforo'),
624
'Moderator access' => __('Moderator access', 'wpforo'),
625
'Full access' => __('Full access', 'wpforo'),
626
+ 'Profile' => __('Profile', 'wpforo'),
627
+ // 1.0.0 //
628
+ 'Incorrect file format. Allowed formats: jpeg, jpg, png, gif.' => __('Incorrect file format. Allowed formats: jpeg, jpg, png, gif.', 'wpforo'),
629
+ 'Enable User Registration' => __('Enable User Registration', 'wpforo'),
630
+ 'This option is not synced with WordPress "Anyone can register" option in Dashboard > Settings > General admin page. If this option is enabled new users will always be able to register.' => __('This option is not synced with WordPress "Anyone can register" option in Dashboard > Settings > General admin page. If this option is enabled new users will always be able to register.', 'wpforo'),
631
+ 'User registration is disabled' => __('User registration is disabled', 'wpforo'),
632
+ 'Delete User Cache' => __('Delete User Cache', 'wpforo'),
633
+ 'Insert Forum Attachments to Media Library' => __('Insert Forum Attachments to Media Library', 'wpforo'),
634
+ 'Enable this option to be able manage forum attachments in Dashboard > Media > Library admin page.' => __('Enable this option to be able manage forum attachments in Dashboard > Media > Library admin page.', 'wpforo'),
635
+ 'Attachment removed' => __('Attachment removed', 'wpforo'),
636
+ 'Forum Posts' => __('Forum Posts', 'wpforo'),
637
+ 'Blog Posts' => __('Blog Posts', 'wpforo'),
638
+ 'Blog Comments' => __('Blog Comments', 'wpforo'),
639
+ 'Welcome back %s!' => __('Welcome back %s!', 'wpforo'),
640
+ 'Member Profile' => __('Member Profile', 'wpforo'),
641
+ 'Member' => __('Member', 'wpforo'),
642
+ 'Turn WordPress to wpForo' => __('Turn WordPress to wpForo', 'wpforo'),
643
+ 'This option will disable WordPress on front-end. Only forum pages will be available. wpForo will look like as a stand-alone forum.' => __('This option will disable WordPress on front-end. Only forum pages will be available. wpForo will look like as a stand-alone forum.', 'wpforo'),
644
);
wpf-languages/wpforo-cs_CZ.mo CHANGED
Binary file
wpf-languages/wpforo-cs_CZ.po CHANGED
@@ -1,2707 +1,2972 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Forum - wpForo\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2016-07-20 22:14+0400\n"
6
- "PO-Revision-Date: 2016-07-20 22:15+0400\n"
7
- "Last-Translator: Glados <witcheur1338@gmail.com>\n"
8
- "Language-Team: \n"
9
- "Language: cs\n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "Plural-Forms: nplurals=3; plural=( n == 1 ) ? 0 : ( n >= 2 && n <= 4 ) ? 1 : "
14
- "2;\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Generator: Poedit 1.8.6\n"
17
- "X-Poedit-Basepath: ..\n"
18
- "X-Poedit-WPHeader: wpforo.php\n"
19
- "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
20
- "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
21
- "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
22
- "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
23
- "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
24
- "X-Loco-Target-Locale: cs_CZ\n"
25
- "X-Poedit-SearchPath-0: .\n"
26
- "X-Poedit-SearchPathExcluded-0: *.js\n"
27
-
28
- #: wpf-admin/dashboard.php:7 wpf-includes/wpf-phrases.php:407
29
- msgid "wpForo Dashboard"
30
- msgstr "wpFóro Nástěnka"
31
-
32
- #: wpf-admin/dashboard.php:23 wpf-includes/wpf-phrases.php:359
33
- msgid "Welcome Message"
34
- msgstr "Uvítací Zpráva"
35
-
36
- #: wpf-admin/dashboard.php:29
37
- msgid ""
38
- "Thank you for trying wpForo! This forum development was started on 2013 and "
39
- "we were using it for our support community. Now it's ready for WordPress "
40
- "community as well. \n"
41
- " It's on the Beta stage and we're working "
42
- "hard to reach the Gold 1.0.0 version as soon as possible. \n"
43
- " wpForo is a professional bulletin board "
44
- "for WorPress, and the only forum software which comes with Multi-layout "
45
- "template system.\n"
46
- " The \"Extended\", \"Simplified\" and "
47
- "\"Question &amp Answer\" layouts fit almost all type of discussions needs. "
48
- "You can use wpForo for small and extremely large communities. \n"
49
- " <br />If you found some issue or bug "
50
- "please open a support topic in plugin page or in our support forum at "
51
- "gVectors.com. If you liked wpForo please leave some good review for this "
52
- "plugin. We really need your good reviews. \n"
53
- " If you didn't like wpForo please leave a "
54
- "list of issues and requirements you'd like us to fix and add in near future. "
55
- "We're here to help you and improve wpForo as much as possible."
56
- msgstr ""
57
- "Děkujeme za vyzkoušení wpFóra! Tohle fórum se začalo vyvíjet již v roce 2013 "
58
- "a používáme ho k podpoře komunity. Nyní je vše připraveno pro Wordress "
59
- "komunitu.\n"
60
- " Jedná se o Beta verzi a tvrdě "
61
- "pracujeme k dosažení Gold 1.0.0 verze jakmile to bdue možné.\n"
62
- " wpFóro je profesionální "
63
- "bulletin fórum pro Wordpress, a jediné fórum z podporou \"Multi-Layout\".\n"
64
- " \"Rozšířené\", \"Klasické\" a "
65
- "\"Otázky & Odpovědi\" je vše co potřebujete. Fórum můžete použít jak pro "
66
- "malé komunity tak i pro velké!\n"
67
- " Pokud najdete chybu či "
68
- "jiný problém tak nás kontaktujte na našem fóru gVectors.com. Pokud se Vám "
69
- "fórum líbí nezapomeňte napsat recenzi, každá dobrá recenze nás podpoří.\n"
70
- " Pokud vám wpForo "
71
- "nevyhovuje, zanechte nám vaše poznámky a mi se pokusíme do budoucna vše "
72
- "napravit a vylepšit."
73
-
74
- #: wpf-admin/dashboard.php:60 wpf-includes/wpf-phrases.php:130
75
- msgid "General Information"
76
- msgstr "Hlavní Informace"
77
-
78
- #: wpf-admin/dashboard.php:64 wpf-includes/wpf-phrases.php:366
79
- msgid "You are currently running"
80
- msgstr "V současné době běží"
81
-
82
- #: wpf-admin/dashboard.php:65 wpf-includes/wpf-phrases.php:18
83
- msgid "Active Theme"
84
- msgstr "Aktivní Šablona"
85
-
86
- #: wpf-admin/dashboard.php:66 wpf-includes/wpf-phrases.php:412
87
- msgid "wpForo Website"
88
- msgstr "wpFóro Webové stránky"
89
-
90
- #: wpf-admin/dashboard.php:67 wpf-includes/wpf-phrases.php:318
91
- msgid "Support Forum"
92
- msgstr "Fórum Podpory"
93
-
94
- #: wpf-admin/dashboard.php:78 wpf-includes/wpf-phrases.php:288
95
- msgid "Server Information"
96
- msgstr "Informační Server"
97
-
98
- #: wpf-admin/dashboard.php:108 wpf-includes/wpf-phrases.php:46
99
- msgid "Available"
100
- msgstr "K dispozici"
101
-
102
- #: wpf-admin/dashboard.php:108 wpf-includes/wpf-phrases.php:207
103
- msgid "Not available"
104
- msgstr "Není k dispozici"
105
-
106
- #: wpf-admin/dashboard.php:126 wpf-includes/wpf-phrases.php:49
107
- msgid "Board Statistic"
108
- msgstr "Přehled"
109
-
110
- #: wpf-admin/dashboard.php:132 wpf-admin/options-tabs/styles.php:16
111
- #: wpf-admin/options.php:14 wpf-includes/wpf-phrases.php:123
112
- msgid "Forums"
113
- msgstr "Fóra"
114
-
115
- #: wpf-admin/dashboard.php:136 wpf-admin/options-tabs/styles.php:22
116
- #: wpf-includes/class-forums.php:537 wpf-includes/wpf-phrases.php:337
117
- msgid "Topics"
118
- msgstr "Témata"
119
-
120
- #: wpf-admin/dashboard.php:140 wpf-includes/class-forums.php:537
121
- #: wpf-includes/wpf-phrases.php:231
122
- msgid "Posts"
123
- msgstr "Příspěvky"
124
-
125
- #: wpf-admin/dashboard.php:144 wpf-admin/member.php:10 wpf-admin/options.php:17
126
- #: wpf-includes/wpf-phrases.php:177
127
- msgid "Members"
128
- msgstr "Uživatelé"
129
-
130
- #: wpf-admin/dashboard.php:148 wpf-includes/wpf-phrases.php:178
131
- msgid "Members Online"
132
- msgstr "Uživatelé Online"
133
-
134
- #: wpf-admin/dashboard.php:155 wpf-includes/wpf-phrases.php:44
135
- msgid "Attachments"
136
- msgstr "Přílohy"
137
-
138
- #: wpf-admin/dashboard.php:159 wpf-includes/wpf-phrases.php:45
139
- msgid "Attachments Size"
140
- msgstr "Velikost příloh"
141
-
142
- #: wpf-admin/forum.php:13 wpf-includes/functions.php:548
143
- #: wpf-includes/wpf-phrases.php:300
144
- msgid "Show on screen"
145
- msgstr "Zobrazit na obrazovce"
146
-
147
- #: wpf-admin/forum.php:15 wpf-admin/forum.php:114
148
- #: wpf-includes/wpf-phrases.php:113
149
- msgid "Forum Options"
150
- msgstr "Nastavení Fóra"
151
-
152
- #: wpf-admin/forum.php:16 wpf-includes/wpf-phrases.php:222
153
- msgid "Permissions"
154
- msgstr "Opravnění"
155
-
156
- #: wpf-admin/forum.php:17 wpf-includes/wpf-phrases.php:305
157
- msgid "Slug"
158
- msgstr "Slug"
159
-
160
- #: wpf-admin/forum.php:18 wpf-includes/wpf-phrases.php:112
161
- msgid "Forum Meta"
162
- msgstr "Fórum Meta"
163
-
164
- #: wpf-admin/forum.php:21 wpf-includes/wpf-phrases.php:272
165
- msgid "Screen Layout"
166
- msgstr "Rozvržení Obrazovky"
167
-
168
- #: wpf-admin/forum.php:22 wpf-includes/wpf-phrases.php:208
169
- msgid "Number of Columns"
170
- msgstr "Počet Sloupců"
171
-
172
- #: wpf-admin/forum.php:32 wpf-includes/functions.php:562
173
- #: wpf-includes/wpf-phrases.php:273
174
- msgid "Screen Options"
175
- msgstr "Nastavení obrazovky"
176
-
177
- #: wpf-admin/forum.php:43 wpf-includes/wpf-phrases.php:51
178
- msgid "Categories and Forums"
179
- msgstr "Kategorie a Fóra"
180
-
181
- #: wpf-admin/forum.php:44 wpf-admin/options-tabs/general.php:42
182
- #: wpf-admin/themes.php:10 wpf-admin/usergroup.php:8
183
- #: wpf-includes/wpf-phrases.php:20
184
- msgid "Add New"
185
- msgstr "Přidat nový"
186
-
187
- #: wpf-admin/forum.php:55 wpf-includes/wpf-phrases.php:224
188
- msgid "Please drag and drop forum panels to set parent-child hierarchy."
189
- msgstr "Prosím přetáhněte fórum v panelu na nastavení child hierarchie."
190
-
191
- #: wpf-admin/forum.php:69 wpf-includes/wpf-phrases.php:271
192
- msgid "Save forums order and hierarchy"
193
- msgstr "Uložit fórum a hierarchii."
194
-
195
- #: wpf-admin/forum.php:96 wpf-includes/wpf-phrases.php:87
196
- msgid "Enter forum title here"
197
- msgstr "Zadejte název fóra zde"
198
-
199
- #: wpf-admin/forum.php:101 wpf-includes/wpf-phrases.php:86
200
- msgid "Enter description here . . ."
201
- msgstr "Zadejte popis zde..."
202
-
203
- #: wpf-admin/forum.php:102 wpf-includes/wpf-phrases.php:328
204
- msgid ""
205
- "This is a forum description. This content will be displayed under forum "
206
- "title on the forum list."
207
- msgstr ""
208
- "Tohle je popis fóra. Tento popis bude zobrazen pod názvem fóra v přehledu "
209
- "fór."
210
-
211
- #: wpf-admin/forum.php:117 wpf-includes/wpf-phrases.php:220
212
- msgid "Parent Forum"
213
- msgstr "Nadřazené Fórum"
214
-
215
- #: wpf-admin/forum.php:120 wpf-includes/wpf-phrases.php:203
216
- msgid "No parent"
217
- msgstr "Žádné nadřazené"
218
-
219
- #: wpf-admin/forum.php:125 wpf-includes/wpf-phrases.php:345
220
- msgid "Use as Category"
221
- msgstr "Použít jako Kategorii"
222
-
223
- #: wpf-admin/forum.php:127 wpf-includes/wpf-phrases.php:52
224
- msgid "Category Layout"
225
- msgstr "Rozvržení Kategorie"
226
-
227
- #: wpf-admin/forum.php:135 wpf-includes/wpf-phrases.php:201
228
- msgid "No layout found."
229
- msgstr "Žádné rozvržení nebylo nalezeno."
230
-
231
- #: wpf-admin/forum.php:144 wpf-admin/forum.php:151
232
- #: wpf-includes/wpf-phrases.php:233
233
- msgid "Publish"
234
- msgstr "Publikovat"
235
-
236
- #: wpf-admin/forum.php:148 wpf-includes/wpf-phrases.php:37
237
- msgid "Are you sure you want to delete this forum?"
238
- msgstr "Jste si jistí že chcete smazat toto fórum?"
239
-
240
- #: wpf-admin/forum.php:148 wpf-admin/themes.php:73 wpf-admin/usergroup.php:37
241
- #: wpf-admin/usergroup.php:133 wpf-includes/functions.php:256
242
- #: wpf-includes/functions.php:469 wpf-includes/wpf-hooks.php:889
243
- #: wpf-includes/wpf-phrases.php:66
244
- msgid "Delete"
245
- msgstr "Smazat"
246
-
247
- #: wpf-admin/forum.php:149 wpf-admin/usergroup.php:39
248
- #: wpf-includes/class-forums.php:543 wpf-includes/wpf-phrases.php:353
249
- msgid "View"
250
- msgstr "Zobrazit"
251
-
252
- #: wpf-admin/forum.php:219 wpf-includes/wpf-phrases.php:118
253
- msgid "Forum Slug"
254
- msgstr "Fórum Slug"
255
-
256
- #: wpf-admin/forum.php:222 wpf-includes/wpf-phrases.php:321
257
- msgid ""
258
- "The \"slug\" is the URL-friendly version of the name. It is usually all "
259
- "lowercase and contains only letters, numbers, and hyphens."
260
- msgstr "\"Slug\" je přátelská URL verze názvu."
261
-
262
- #: wpf-admin/forum.php:228 wpf-includes/wpf-phrases.php:116
263
- msgid "Forum SEO"
264
- msgstr "Fórum SEO"
265
-
266
- #: wpf-admin/forum.php:231 wpf-includes/wpf-phrases.php:182
267
- msgid "Meta Description"
268
- msgstr "Meta Popis"
269
-
270