wpForo Forum - Version 1.6.2

Version Description

Download this release

Release Info

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

Code changes from version 1.6.1 to 1.6.2

Files changed (77) hide show
  1. readme.txt +91 -42
  2. wpf-admin/css/admin.css +7 -4
  3. wpf-admin/options-tabs/emails.php +73 -10
  4. wpf-admin/options-tabs/features.php +2 -2
  5. wpf-admin/options-tabs/general.php +2 -2
  6. wpf-admin/options-tabs/members.php +13 -0
  7. wpf-admin/options-tabs/posts.php +34 -0
  8. wpf-admin/tools.php +1 -1
  9. wpf-admin/usergroup.php +1 -1
  10. wpf-admin/xml/english.xml +1 -0
  11. wpf-assets/images/icons/eye-dark.png +0 -0
  12. wpf-assets/images/icons/eye.png +0 -0
  13. wpf-assets/images/icons/pencil-dark.png +0 -0
  14. wpf-assets/images/icons/pencil.png +0 -0
  15. wpf-assets/images/icons/plus-dark.png +0 -0
  16. wpf-assets/images/icons/plus.png +0 -0
  17. wpf-assets/images/icons/trash-dark.png +0 -0
  18. wpf-assets/images/icons/trash.png +0 -0
  19. wpf-assets/js/ajax.js +59 -29
  20. wpf-assets/js/frontend.js +451 -109
  21. wpf-assets/js/tinymce-code.js +3 -3
  22. wpf-assets/js/tinymce-link.js +1 -1
  23. wpf-assets/js/tinymce-pre.js +1 -1
  24. wpf-assets/js/tinymce-spoiler.js +41 -0
  25. wpf-includes/class-api.php +15 -16
  26. wpf-includes/class-cache.php +6 -2
  27. wpf-includes/class-forms.php +7 -1
  28. wpf-includes/class-forums.php +35 -14
  29. wpf-includes/class-members.php +17 -10
  30. wpf-includes/class-moderation.php +1 -1
  31. wpf-includes/class-permissions.php +21 -3
  32. wpf-includes/class-phrases.php +7 -0
  33. wpf-includes/class-posts.php +87 -108
  34. wpf-includes/class-subscribes.php +1 -1
  35. wpf-includes/class-template.php +279 -134
  36. wpf-includes/class-topics.php +10 -3
  37. wpf-includes/functions-installation.php +6 -1
  38. wpf-includes/functions-integration.php +4 -0
  39. wpf-includes/functions-template.php +33 -18
  40. wpf-includes/functions.php +189 -182
  41. wpf-includes/install-sql.php +1 -0
  42. wpf-includes/integration/ultimate-member.php +1 -1
  43. wpf-includes/wpf-actions.php +1 -0
  44. wpf-includes/wpf-hooks.php +292 -169
  45. wpf-includes/wpf-phrases.php +2 -0
  46. wpf-languages/wpforo-fr_FR.mo +0 -0
  47. wpf-languages/wpforo-fr_FR.po +4105 -2619
  48. wpf-languages/wpforo-zh_CN.mo +0 -0
  49. wpf-languages/wpforo-zh_CN.po +7256 -0
  50. wpf-languages/wpforo.pot +459 -294
  51. wpf-themes/classic/.gitignore +1 -0
  52. wpf-themes/classic/colors.css +450 -395
  53. wpf-themes/classic/forum.php +22 -1
  54. wpf-themes/classic/functions.php +30 -4
  55. wpf-themes/classic/index.php +12 -12
  56. wpf-themes/classic/layouts/1/forum.php +1 -1
  57. wpf-themes/classic/layouts/1/post.php +1 -1
  58. wpf-themes/classic/layouts/2/forum.php +2 -9
  59. wpf-themes/classic/layouts/2/post.php +1 -1
  60. wpf-themes/classic/layouts/3/comment.php +1 -1
  61. wpf-themes/classic/layouts/3/forum.php +1 -1
  62. wpf-themes/classic/layouts/3/post.php +1 -1
  63. wpf-themes/classic/layouts/4/forum-thread.php +0 -1
  64. wpf-themes/classic/layouts/4/forum.php +3 -17
  65. wpf-themes/classic/layouts/4/post-thread.php +1 -1
  66. wpf-themes/classic/layouts/4/post.php +1 -1
  67. wpf-themes/classic/members.php +1 -1
  68. wpf-themes/classic/profile-account.php +1 -1
  69. wpf-themes/classic/profile-activity.php +1 -1
  70. wpf-themes/classic/profile-subscriptions.php +2 -4
  71. wpf-themes/classic/profile.php +6 -3
  72. wpf-themes/classic/recent.php +1 -1
  73. wpf-themes/classic/search.php +1 -1
  74. wpf-themes/classic/style-rtl.css +34 -11
  75. wpf-themes/classic/style.css +34 -11
  76. wpf-themes/classic/styles/matrix.css +26 -11
  77. wpforo.php +34 -11
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
3
Tags: forum, forums, forum plugin, WordPress forum plugin, community, discussion
4
Requires at least: 4.1
5
Tested up to: 5.2
6
- Stable tag: 1.6.1
7
Requires PHP: 5.5 and higher
8
License: GPLv2 or later
9
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -39,6 +39,10 @@ GDPR Compliance: [https://wpforo.com/gdpr/](https://wpforo.com/gdpr/)
39
40
wpForo forum plugin is well integrated with many Profile Builder and Membership plugins, such as **BuddyPress** and **Ultimate Members** plugins.
41
42
43
= FORUM FEATURES =
44
@@ -139,30 +143,84 @@ Find wpForo forum plugin addons on [gVectors Team website...](https://gvectors.c
139
140
141
== Screenshots ==
142
-
143
- 1. Forum list - "Extended" layout (layout #1) | Screenshot #1
144
- 2. Forum list - "Simplified" layout (layout #2) | Screenshot #2
145
- 3. Forum list - "Question & Answer" layout (layout #3) | Screenshot #3
146
- 4. Forum list - "Threaded" layout (layout #4) | Screenshot #4
147
- 5. Forum Topic list - "Simplified" layout | Screenshot #5
148
- 6. Forum Topic list - "Question & Answer" layout | Screenshot #6
149
- 7. Forum Post list - "Extended" layout | Screenshot #7
150
- 8. Forum Post list - "Simplified" layout | Screenshot #8
151
- 9. Forum Post list - "Question & Answer" layout | Screenshot #9
152
- 10. Forum Post list - "Threaded" layout | Screenshot #10
153
- 11. Forum Profile Page - integrated with Shop and Profile plugins | Screenshot #10
154
- 12. Forum Member List | Screenshot #11
155
- 13. Dashboard > Forums - Drag and Drop forum management system. Easy to set Parent-Child relationship and forum order. | Screenshot #12
156
- 14. Dashboard > Forums - Members Settings | Screenshot #14
157
- 15. Dashboard > Forums - Forum Styles, Colors | Screenshot #15
158
- 16. Dashboard > Forums - Forum Accesses / Can's | Screenshot #16
159
160
161
== Changelog ==
162
163
= wpForo Forum 1.6.1 | 10.03.2019 =
164
165
- [wpForo v1.6.1 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-6-1-is-released/)
166
167
* Added: Ordering of Threaded Layout forum list based on forum order in dashboard
168
* Added: Option to control thread replies depth (set 0 to disable reply nesting)
@@ -183,18 +241,9 @@ Find wpForo forum plugin addons on [gVectors Team website...](https://gvectors.c
183
* Fixed Bug: Many CSS issues and small bugs
184
185
186
- IMPORTANT NOTES for UPDATE
187
-
188
- - If you're updating from wpForo versions less than 1.6.0, please read the "Important notes and update" section of 1.6.0 version below.
189
- - Forum template files are modified. If you have an old customized copies of forum template files in your WP theme /wpforo/ folder please update them.
190
- - To load your customized colors please refresh forum front-end page twice.
191
- - If you have a Cache Plugin, please delete all caches after wpForo update.
192
- - If you use CDN and found some issue please purge it.
193
-
194
-
195
= wpForo Forum 1.6.0 | 01.03.2019 =
196
197
- [wpForo v1.6.0 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-6-0-is-released/)
198
199
* Added: Threaded Forum Layout
200
* Added: Threaded Layout | Topics list under threaded layout category
@@ -253,7 +302,7 @@ IMPORTANT NOTES for UPDATE
253
254
= wpForo Forum 1.5.5 | 18.11.2018 =
255
256
- [wpForo v1.5.5 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-5-is-released/)
257
258
* Optimization: Faster forum search
259
* Optimization: Remove extra conditions and extra counts in SQLs
@@ -280,7 +329,7 @@ IMPORTANT NOTES for UPDATE
280
281
= wpForo Forum 1.5.4 | 05.10.2018 =
282
283
- [wpForo v1.5.4 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-4-is-released/)
284
285
* Added: Current and recent visitors tracking in forums and topics
286
* Added: Debug Tools in Forums > Tools > Debug admin page
@@ -298,7 +347,7 @@ IMPORTANT NOTES for UPDATE
298
299
= wpForo Forum 1.5.3 | 13.09.2018 =
300
301
- [wpForo v1.5.3 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-3-is-released/)
302
303
* Changed: Change all "Topic" phrases to "Question" in Q&A layout
304
* Changed: Display topic last post date in related topics area
@@ -316,7 +365,7 @@ IMPORTANT NOTES for UPDATE
316
317
= wpForo Forum 1.5.2 | 05.09.2018 =
318
319
- [wpForo v1.5.2 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-2-is-released/)
320
321
* Added: Topic Tags
322
* Added: Topic Tags | Widget with topic count
@@ -362,7 +411,7 @@ IMPORTANT NOTES for UPDATE
362
363
= wpForo Forum 1.5.0 / 1.5.1 | 11.07.2018 =
364
365
- [wpForo v1.5.0 and 1.5.1 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-0-is-released/)
366
367
* wpForo Forum v1.5.1
368
* Added: Options to manage topic/post editing logs
@@ -414,8 +463,8 @@ IMPORTANT NOTES for UPDATE
414
415
= wpForo Forum 1.4.8 / 1.4.9 | 04.05.2018 =
416
417
- [wpForo v1.4.9 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-9-is-released/)
418
- [wpForo v1.4.8 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-8-is-released/)
419
420
* wpForo Forum v1.4.8
421
* Added: GDPR Compliance / [Doc](https://wpforo.com/docs/root/gdpr/right-to-be-informed/)
@@ -469,8 +518,8 @@ IMPORTANT NOTES for UPDATE
469
470
= wpForo Forum 1.4.6 / 1.4.7 | 09.03.2018 =
471
472
- [wpForo v1.4.7 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-7-is-released/)
473
- [wpForo v1.4.6 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-6-is-released/)
474
475
IMPORTANT: wpForo Font Awesome lib is updated to version 5. If your theme doesn't have v5 and you've disabled wpForo Font Awesome lib, please enable it back in Settings > Features admin page. If you've changed forum icons, member fields and reputation icons, please edit and insert new values using [Font Awesome 5](https://fontawesome.com/icons?d=gallery&m=free) new classes.
476
@@ -521,7 +570,7 @@ IMPORTANT: wpForo Font Awesome lib is updated to version 5. If your theme doesn'
521
522
NOTE: IF YOU UPDATE FROM 1.4.x
523
524
- - If you're updating from 1.4.2 or lower versions and you have customized wpforo template files in WordPress active theme's /wpforo/ folder, please remove those before updating. Current wpForo version doesn't support old template files.
525
- After wpForo update, if you see a message "wpForo - Update Database". Please click on [Update Database] button to complete update process. This is a data synchronization action, it doesn't delete forum data.
526
- If you have a Cache Plugin, please delete all caches after wpForo update.
527
- If you use CDN and found some issue please purge it.
@@ -531,8 +580,8 @@ NOTE: IF YOU UPDATE FROM 1.4.x
531
532
= wpForo Forum 1.4.4 / 1.4.4.1 / 1.4.5 | 11.01.2018 =
533
534
- [wpForo v1.4.5 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-5-is-released/)
535
- [wpForo v1.4.4 / 1.4.4.1 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-4-is-released/)
536
537
538
* 1.4.5
@@ -570,7 +619,7 @@ NOTE: IF YOU UPDATE FROM 1.4.x
570
571
= wpForo Forum 1.4.3 | 09.12.2017 =
572
573
- [wpForo v1.4.3 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-3-is-released/)
574
575
* Added: Boosted forum core. Works many folds faster. Forum OOP optimization.
576
* Added: Facebook Login on Forum Login and Registration page
3
Tags: forum, forums, forum plugin, WordPress forum plugin, community, discussion
4
Requires at least: 4.1
5
Tested up to: 5.2
6
+ Stable tag: 1.6.2
7
Requires PHP: 5.5 and higher
8
License: GPLv2 or later
9
License URI: https://www.gnu.org/licenses/gpl-2.0.html
39
40
wpForo forum plugin is well integrated with many Profile Builder and Membership plugins, such as **BuddyPress** and **Ultimate Members** plugins.
41
42
+ = Forum Translation =
43
+
44
+ wpForo is a WordPress forum plugin with all possibilities of plugin translation. We'd really appreciate if you could help [translating wpForo forum plugin to your language here](https://translate.wordpress.org/projects/wp-plugins/wpforo/).
45
+
46
47
= FORUM FEATURES =
48
143
144
145
== Screenshots ==
146
+ 2. Forum threads | Screenshot #1
147
+ 2. Forum list - "Extended" layout (layout #1) | Screenshot #2
148
+ 3. Forum list - "Simplified" layout (layout #2) | Screenshot #3
149
+ 4. Forum list - "Question & Answer" layout (layout #3) | Screenshot #4
150
+ 5. Forum list - "Threaded" layout (layout #4) | Screenshot #5
151
+ 6. Forum Topic list - "Simplified" layout | Screenshot #6
152
+ 7. Forum Topic list - "Question & Answer" layout | Screenshot #7
153
+ 8. Forum Post list - "Extended" layout | Screenshot #8
154
+ 9. Forum Post list - "Simplified" layout | Screenshot #9
155
+ 10. Forum Post list - "Question & Answer" layout | Screenshot #10
156
+ 11. Forum Post list - "Threaded" layout | Screenshot #11
157
+ 12. Forum Profile Page - integrated with Shop and Profile plugins | Screenshot #12
158
+ 13. Forum Member List | Screenshot #13
159
+ 14. Dashboard > Forums - Drag and Drop forum management system. Easy to set Parent-Child relationship and forum order. | Screenshot #14
160
+ 15. Dashboard > Forums - Members Settings | Screenshot #15
161
+ 16. Dashboard > Forums - Forum Styles, Colors | Screenshot #16
162
+ 17. Dashboard > Forums - Forum Accesses / Can's | Screenshot #17
163
164
165
== Changelog ==
166
167
+ = wpForo Forum 1.6.2 | 11.07.2019 =
168
+
169
+ [wpForo Forum v1.6.2 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-6-2-is-released/)
170
+
171
+ * Added: Multi-quotes by selecting certain content from different posts
172
+ * Added: Option to change user forum rating in Dashboard > Edit User page
173
+ * Added: Auto-grow (auto-resize) feature for forum topic/post editors
174
+ * Added: Reply button automatically adds post author @nickname in editor
175
+ * Added: Prevent closing forum window if topic/post editor is not empty
176
+ * Added: New shortcode [post_author_name] in forum email templates.
177
+ * Added: Option to create spoilers (hidden, expandable content) in editor
178
+ * Added: Option to limit forum search result count, optimizing db usage
179
+ * Added: Option to set max/min characters number in forum topic/post editor
180
+ * Added: Ctrl + Enter to submit forum topic/post editor
181
+ * Added: wpForo SEO optimization, Twitter Image SEO Tag for forum pages
182
+ * Added: Display category (top parent forum) description in category page
183
+ * Added: Display Secondary Usergroups with user information and in profile
184
+ * Added: Enabled Subscribe Manager in forum profile > subscription tab
185
+ * Added: Redirect to forum login page if visitor has no access to a topic
186
+ * Added: Forum compatible with Rank Math SEO plugin
187
+ * Added: Forum filter hook 'wpforo_search_results_body_length'
188
+ * Fixed Bug: Wrong last info on parent forums
189
+ * Fixed Bug: Forum attachment button issue in Threaded Layout topic editor
190
+ * Fixed Bug: Problem using WordPress date-time type in forum
191
+ * Fixed Bug: Problem with reset password URL
192
+ * Fixed Bug: Problem with style customization using Custom CSS Codes option
193
+ * Fixed Bug: Forum meta description doesn't work
194
+ * Fixed Bug: 404 Not Found error on Microsoft Servers
195
+ * Fixed Bug: BuddyPress integration issues with Forum Profile URL
196
+ * Fixed Bug: Ultimate Member integration issues with Forum Profile URL
197
+ * Fixed Bug: Can't delete reply in large Threaded Layout topic
198
+ * Fixed Bug: Can't see own replies in forum private topics
199
+ * Fixed Bug: No forum breadcrumb home icon in category pages
200
+ * Fixed Bug: Forum breadcrumb structured data error
201
+ * Fixed Bug: Issue with deleting Q&A forum layout answer
202
+ * Fixed Bug: "jQuery is not defined" on non-forum pages
203
+ * Fixed Bug: Database error with some forum topic tags
204
+ * Fixed Bug: Timezone issues on some servers
205
+ * Fixed Bug: Database error "Duplicate entry" on post liking
206
+ * Fixed Bug: Approved posts counting issue for guests
207
+ * Fixed Bug: Remove inaccessible content from search result
208
+ * Fixed Bug: Dozens of other small bugs
209
+ * Optimization: Better performance, lower database queries...
210
+
211
+
212
+ IMPORTANT NOTES for UPDATE
213
+
214
+ - If you're updating from wpForo Forum versions less than 1.6.0, please read the "Important notes and update" section of 1.6.0 version below.
215
+ - Forum template files are modified. If you have an old customized copies of forum template files in your WP theme /wpforo/ folder please update them.
216
+ - To load your customized colors please refresh forum front-end page twice.
217
+ - If you have a Cache Plugin, please delete all caches after wpForo update.
218
+ - If you use CDN and found some issue please purge it.
219
+
220
+
221
= wpForo Forum 1.6.1 | 10.03.2019 =
222
223
+ [wpForo Forum v1.6.1 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-6-1-is-released/)
224
225
* Added: Ordering of Threaded Layout forum list based on forum order in dashboard
226
* Added: Option to control thread replies depth (set 0 to disable reply nesting)
241
* Fixed Bug: Many CSS issues and small bugs
242
243
244
= wpForo Forum 1.6.0 | 01.03.2019 =
245
246
+ [wpForo Forum v1.6.0 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-6-0-is-released/)
247
248
* Added: Threaded Forum Layout
249
* Added: Threaded Layout | Topics list under threaded layout category
302
303
= wpForo Forum 1.5.5 | 18.11.2018 =
304
305
+ [wpForo Forum v1.5.5 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-5-is-released/)
306
307
* Optimization: Faster forum search
308
* Optimization: Remove extra conditions and extra counts in SQLs
329
330
= wpForo Forum 1.5.4 | 05.10.2018 =
331
332
+ [wpForo Forum v1.5.4 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-4-is-released/)
333
334
* Added: Current and recent visitors tracking in forums and topics
335
* Added: Debug Tools in Forums > Tools > Debug admin page
347
348
= wpForo Forum 1.5.3 | 13.09.2018 =
349
350
+ [wpForo Forum v1.5.3 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-3-is-released/)
351
352
* Changed: Change all "Topic" phrases to "Question" in Q&A layout
353
* Changed: Display topic last post date in related topics area
365
366
= wpForo Forum 1.5.2 | 05.09.2018 =
367
368
+ [wpForo Forum v1.5.2 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-2-is-released/)
369
370
* Added: Topic Tags
371
* Added: Topic Tags | Widget with topic count
411
412
= wpForo Forum 1.5.0 / 1.5.1 | 11.07.2018 =
413
414
+ [wpForo Forum v1.5.0 and 1.5.1 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-5-0-is-released/)
415
416
* wpForo Forum v1.5.1
417
* Added: Options to manage topic/post editing logs
463
464
= wpForo Forum 1.4.8 / 1.4.9 | 04.05.2018 =
465
466
+ [wpForo Forum v1.4.9 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-9-is-released/)
467
+ [wpForo Forum v1.4.8 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-8-is-released/)
468
469
* wpForo Forum v1.4.8
470
* Added: GDPR Compliance / [Doc](https://wpforo.com/docs/root/gdpr/right-to-be-informed/)
518
519
= wpForo Forum 1.4.6 / 1.4.7 | 09.03.2018 =
520
521
+ [wpForo Forum v1.4.7 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-7-is-released/)
522
+ [wpForo Forum v1.4.6 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-6-is-released/)
523
524
IMPORTANT: wpForo Font Awesome lib is updated to version 5. If your theme doesn't have v5 and you've disabled wpForo Font Awesome lib, please enable it back in Settings > Features admin page. If you've changed forum icons, member fields and reputation icons, please edit and insert new values using [Font Awesome 5](https://fontawesome.com/icons?d=gallery&m=free) new classes.
525
570
571
NOTE: IF YOU UPDATE FROM 1.4.x
572
573
+ - If you're updating from 1.4.2 or lower versions and you have customized wpforo template files in WordPress active theme's /wpforo/ folder, please remove those before updating. Current wpForo Forum version doesn't support old template files.
574
- After wpForo update, if you see a message "wpForo - Update Database". Please click on [Update Database] button to complete update process. This is a data synchronization action, it doesn't delete forum data.
575
- If you have a Cache Plugin, please delete all caches after wpForo update.
576
- If you use CDN and found some issue please purge it.
580
581
= wpForo Forum 1.4.4 / 1.4.4.1 / 1.4.5 | 11.01.2018 =
582
583
+ [wpForo Forum v1.4.5 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-5-is-released/)
584
+ [wpForo Forum v1.4.4 / 1.4.4.1 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-4-is-released/)
585
586
587
* 1.4.5
619
620
= wpForo Forum 1.4.3 | 09.12.2017 =
621
622
+ [wpForo Forum v1.4.3 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-3-is-released/)
623
624
* Added: Boosted forum core. Works many folds faster. Forum OOP optimization.
625
* Added: Facebook Login on Forum Login and Registration page
wpf-admin/css/admin.css CHANGED
@@ -101,16 +101,19 @@
101
/**************************/
102
/* Forums *****************/
103
/**************************/
104
#wpf-admin-wrap .menu-item-bar > .forum_width{ background: #F6F6F6; border-left: 1px dotted #666666; border-right: 1px dotted #666666}
105
- #wpf-admin-wrap .menu-item-depth-0 > .menu-item-bar > .forum_width .item-controls{ border-left: 1px dotted white; padding-left: 22px}
106
- #wpf-admin-wrap .menu-item-bar > .forum_width .item-controls{ border-left: 1px dotted #666666; padding-left: 22px; font-size:16px;}
107
#wpf-admin-wrap .menu-item-depth-0 > .menu-item-bar > .forum_width{ background: #43A6DF; color: white}
108
#wpf-admin-wrap .menu-item-bar > .forum_width:hover{ border: 1px solid #666666}
109
#wpf-admin-wrap .menu-item-depth-0 > .menu-item-bar > .forum_width a{ color: white; font-size:16px; padding:0px 2px; border-radius:10%;}
110
#wpf-admin-wrap .menu-item-bar > .forum_width .wpforo-cat-layout { font-size:12px;}
111
- /* #wpf-admin-wrap .menu-item-bar > .forum_width .menu_edit a:hover{ color:#FF8A18; background:#fff;} #wpf-admin-wrap .menu-item-bar > .forum_width .menu_delete a:hover{ color: red; background:#fff;} #wpf-admin-wrap .menu-item-bar > .forum_width .menu_view a:hover{ color:#4278F7; background:#fff;} #wpf-admin-wrap .menu-item-bar > .forum_width .menu_add a:hover{ color:#129E15; background:#fff;} */
112
#wpf-admin-wrap .inside .main .wpforo-dashboard-logo{ width:220px; height:auto;}
113
- #wpf-admin-wrap .vert_tab{ display: block; margin: 1px 0px 0px 0px;}
114
#wpf-admin-wrap .nav-tab-wrapper.vert_tab{ display: inline-block; width: 17%; border: none; vertical-align: top; margin: 0 !important; padding: 0 !important; float: left; position:relative; z-index:9;}
115
#wpf-admin-wrap .nav-tab.vert_tab{ border-bottom: 1px solid #ccc}
116
#wpf-admin-wrap .nav-tab-wrapper.vert_tab > a:first-child{ margin-top: 0}
101
/**************************/
102
/* Forums *****************/
103
/**************************/
104
+ #wpf-admin-wrap #forum-hierarchy .dashicons{ vertical-align: middle; transition: none; font-size: 18px; }
105
+ #wpf-admin-wrap #forum-hierarchy .item-controls{ border-left: 1px dotted; padding-left: 22px; display: flex; justify-content: center; align-items: center;}
106
+ #wpf-admin-wrap #forum-hierarchy .item-controls a{ opacity: 0.8; }
107
+ #wpf-admin-wrap #forum-hierarchy .item-controls a:hover{ opacity: 1; }
108
#wpf-admin-wrap .menu-item-bar > .forum_width{ background: #F6F6F6; border-left: 1px dotted #666666; border-right: 1px dotted #666666}
109
+ #wpf-admin-wrap .menu-item-depth-0 > .menu-item-bar > .forum_width .item-controls{ border-color: #FFFFFF;}
110
+ #wpf-admin-wrap .menu-item-bar > .forum_width .item-controls{ border-color: #666666; font-size:16px;}
111
#wpf-admin-wrap .menu-item-depth-0 > .menu-item-bar > .forum_width{ background: #43A6DF; color: white}
112
#wpf-admin-wrap .menu-item-bar > .forum_width:hover{ border: 1px solid #666666}
113
#wpf-admin-wrap .menu-item-depth-0 > .menu-item-bar > .forum_width a{ color: white; font-size:16px; padding:0px 2px; border-radius:10%;}
114
#wpf-admin-wrap .menu-item-bar > .forum_width .wpforo-cat-layout { font-size:12px;}
115
#wpf-admin-wrap .inside .main .wpforo-dashboard-logo{ width:220px; height:auto;}
116
+ #wpf-admin-wrap .vert_tab{ display: block; margin-top: 1px;}
117
#wpf-admin-wrap .nav-tab-wrapper.vert_tab{ display: inline-block; width: 17%; border: none; vertical-align: top; margin: 0 !important; padding: 0 !important; float: left; position:relative; z-index:9;}
118
#wpf-admin-wrap .nav-tab.vert_tab{ border-bottom: 1px solid #ccc}
119
#wpf-admin-wrap .nav-tab-wrapper.vert_tab > a:first-child{ margin-top: 0}
wpf-admin/options-tabs/emails.php CHANGED
@@ -12,7 +12,7 @@ $wpe_args = array(
12
'default_editor' => 'tinymce'
13
);
14
?>
15
-
16
<form action="" method="POST" class="validate">
17
<?php wp_nonce_field( 'wpforo-settings-emails' ); ?>
18
<table class="wpforo_settings_table">
@@ -62,11 +62,20 @@ $wpe_args = array(
62
</td>
63
</tr>
64
<tr>
65
- <th><label for="confirmation_email_subject"><?php _e('Subscribe confirmation email subject', 'wpforo'); ?>:</label></th>
66
<td><input id="confirmation_email_subject" name="wpforo_subscribe_options[confirmation_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['confirmation_email_subject']); ?>" required></td>
67
</tr>
68
<tr>
69
- <th><label for="confirmation_email_message"><?php _e('Subscribe confirmation email message', 'wpforo'); ?>:</label></th>
70
<td>
71
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[confirmation_email_message]';
72
wp_editor( wp_unslash( WPF()->sbscrb->options['confirmation_email_message'] ), 'confirmation_email_message', $wpe_args ); ?>
@@ -77,7 +86,17 @@ $wpe_args = array(
77
<td><input id="new_topic_notification_email_subject" name="wpforo_subscribe_options[new_topic_notification_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['new_topic_notification_email_subject']); ?>" required></td>
78
</tr>
79
<tr>
80
- <th><label for="new_topic_notification_email_message"><?php _e('New topic notification email message', 'wpforo'); ?>:</label></th>
81
<td>
82
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[new_topic_notification_email_message]';
83
wp_editor( wp_unslash( WPF()->sbscrb->options['new_topic_notification_email_message'] ), 'new_topic_notification_email_message', $wpe_args ); ?>
@@ -88,7 +107,17 @@ $wpe_args = array(
88
<td><input id="new_post_notification_email_subject" name="wpforo_subscribe_options[new_post_notification_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['new_post_notification_email_subject']); ?>" required></td>
89
</tr>
90
<tr>
91
- <th><label for="new_post_notification_email_message"><?php _e('New reply notification email message', 'wpforo'); ?>:</label></th>
92
<td>
93
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[new_post_notification_email_message]';
94
wp_editor( wp_unslash( WPF()->sbscrb->options['new_post_notification_email_message'] ), 'new_post_notification_email_message', $wpe_args ); ?>
@@ -107,7 +136,14 @@ $wpe_args = array(
107
<td><input id="report_email_subject" name="wpforo_subscribe_options[report_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['report_email_subject']); ?>" required></td>
108
</tr>
109
<tr>
110
- <th><label for="report_email_message"><?php _e('Report message body', 'wpforo'); ?>:</label></th>
111
<td>
112
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[report_email_message]';
113
wp_editor( wp_unslash( WPF()->sbscrb->options['report_email_message'] ), 'report_email_message', $wpe_args ); ?>
@@ -126,7 +162,14 @@ $wpe_args = array(
126
<td><input id="wp_new_user_notification_email_admin_subject" name="wpforo_subscribe_options[wp_new_user_notification_email_admin_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['wp_new_user_notification_email_admin_subject']); ?>" required></td>
127
</tr>
128
<tr>
129
- <th><label for="wp_new_user_notification_email_admin_message"><?php _e('Message Body', 'wpforo'); ?>:</label></th>
130
<td>
131
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[wp_new_user_notification_email_admin_message]';
132
wp_editor( wp_unslash( WPF()->sbscrb->options['wp_new_user_notification_email_admin_message'] ), 'wp_new_user_notification_email_admin_message', $wpe_args ); ?>
@@ -145,7 +188,13 @@ $wpe_args = array(
145
<td><input id="wp_new_user_notification_email_subject" name="wpforo_subscribe_options[wp_new_user_notification_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['wp_new_user_notification_email_subject']); ?>" required></td>
146
</tr>
147
<tr>
148
- <th><label for="wp_new_user_notification_email_message"><?php _e('Message Body', 'wpforo'); ?>:</label></th>
149
<td>
150
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[wp_new_user_notification_email_message]';
151
wp_editor( wp_unslash( WPF()->sbscrb->options['wp_new_user_notification_email_message'] ), 'wp_new_user_notification_email_message', $wpe_args ); ?>
@@ -158,7 +207,13 @@ $wpe_args = array(
158
</td>
159
</tr>
160
<tr>
161
- <th><label for="reset_password_email_message"><?php _e('Reset Password message body', 'wpforo'); ?>:</label></th>
162
<td>
163
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[reset_password_email_message]';
164
wp_editor( wp_unslash( WPF()->sbscrb->options['reset_password_email_message'] ), 'reset_password_email_message', $wpe_args ); ?>
@@ -185,7 +240,15 @@ $wpe_args = array(
185
<td><input id="user_mention_email_subject" name="wpforo_subscribe_options[user_mention_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['user_mention_email_subject']); ?>" required></td>
186
</tr>
187
<tr>
188
- <th><label for="user_mention_email_message"><?php _e('User Mention message body', 'wpforo'); ?>:</label></th>
189
<td>
190
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[user_mention_email_message]';
191
wp_editor( wp_unslash( WPF()->sbscrb->options['user_mention_email_message'] ), 'user_mention_email_message', $wpe_args ); ?>
12
'default_editor' => 'tinymce'
13
);
14
?>
15
+ <style>.wpf-email-shortcodes{font-weight: normal; font-size: 12px; color: #666666; list-style: disc; margin-left: 20px;} .wpf-email-shortcodes li{padding: 0px; margin: 0px; line-height: 18px;}</style>
16
<form action="" method="POST" class="validate">
17
<?php wp_nonce_field( 'wpforo-settings-emails' ); ?>
18
<table class="wpforo_settings_table">
62
</td>
63
</tr>
64
<tr>
65
+ <th>
66
+ <label for="confirmation_email_subject"><?php _e('Subscribe confirmation email subject', 'wpforo'); ?>:</label>
67
+ </th>
68
<td><input id="confirmation_email_subject" name="wpforo_subscribe_options[confirmation_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['confirmation_email_subject']); ?>" required></td>
69
</tr>
70
<tr>
71
+ <th>
72
+ <label for="confirmation_email_message"><?php _e('Subscribe confirmation email message', 'wpforo'); ?>:</label>
73
+ <ul class="wpf-email-shortcodes">
74
+ <li>[entry_title] - <?php _e('Subscribed forum or topic title', 'wpforo') ?></li>
75
+ <li>[member_name] - <?php _e('Subscriber display name', 'wpforo') ?></li>
76
+ <li>[confirm_link] - <?php _e('Link to confirm subscription', 'wpforo') ?></li>
77
+ </ul>
78
+ </th>
79
<td>
80
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[confirmation_email_message]';
81
wp_editor( wp_unslash( WPF()->sbscrb->options['confirmation_email_message'] ), 'confirmation_email_message', $wpe_args ); ?>
86
<td><input id="new_topic_notification_email_subject" name="wpforo_subscribe_options[new_topic_notification_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['new_topic_notification_email_subject']); ?>" required></td>
87
</tr>
88
<tr>
89
+ <th>
90
+ <label for="new_topic_notification_email_message"><?php _e('New topic notification email message', 'wpforo'); ?>:</label>
91
+ <ul class="wpf-email-shortcodes">
92
+ <li>[member_name] - <?php _e('Subscriber display name', 'wpforo') ?></li>
93
+ <li>[post_author_name] - <?php _e('New topic author display name', 'wpforo') ?></li>
94
+ <li>[forum] - <?php _e('Forum title / link', 'wpforo') ?></li>
95
+ <li>[topic_title] - <?php _e('New topic title', 'wpforo') ?></li>
96
+ <li>[topic_desc] - <?php _e('New topic excerpt', 'wpforo') ?></li>
97
+ <li>[unsubscribe_link] - <?php _e('Link to unsubscribe', 'wpforo') ?></li>
98
+ </ul>
99
+ </th>
100
<td>
101
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[new_topic_notification_email_message]';
102
wp_editor( wp_unslash( WPF()->sbscrb->options['new_topic_notification_email_message'] ), 'new_topic_notification_email_message', $wpe_args ); ?>
107
<td><input id="new_post_notification_email_subject" name="wpforo_subscribe_options[new_post_notification_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['new_post_notification_email_subject']); ?>" required></td>
108
</tr>
109
<tr>
110
+ <th>
111
+ <label for="new_post_notification_email_message"><?php _e('New reply notification email message', 'wpforo'); ?>:</label>
112
+ <ul class="wpf-email-shortcodes">
113
+ <li>[member_name] - <?php _e('Subscriber display name', 'wpforo') ?></li>
114
+ <li>[post_author_name] - <?php _e('New reply author display name', 'wpforo') ?></li>
115
+ <li>[topic] - <?php _e('Topic title / link', 'wpforo') ?></li>
116
+ <li>[reply_title] - <?php _e('New reply title', 'wpforo') ?></li>
117
+ <li>[reply_desc] - <?php _e('New reply excerpt', 'wpforo') ?></li>
118
+ <li>[unsubscribe_link] - <?php _e('Link to unsubscribe', 'wpforo') ?></li>
119
+ </ul>
120
+ </th>
121
<td>
122
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[new_post_notification_email_message]';
123
wp_editor( wp_unslash( WPF()->sbscrb->options['new_post_notification_email_message'] ), 'new_post_notification_email_message', $wpe_args ); ?>
136
<td><input id="report_email_subject" name="wpforo_subscribe_options[report_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['report_email_subject']); ?>" required></td>
137
</tr>
138
<tr>
139
+ <th>
140
+ <label for="report_email_message"><?php _e('Report message body', 'wpforo'); ?>:</label>
141
+ <ul class="wpf-email-shortcodes">
142
+ <li>[reporter] - <?php _e('Reporter user display name', 'wpforo') ?></li>
143
+ <li>[message] - <?php _e('Reporter user message', 'wpforo') ?></li>
144
+ <li>[post_url] - <?php _e('Reported post URL', 'wpforo') ?></li>
145
+ </ul>
146
+ </th>
147
<td>
148
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[report_email_message]';
149
wp_editor( wp_unslash( WPF()->sbscrb->options['report_email_message'] ), 'report_email_message', $wpe_args ); ?>
162
<td><input id="wp_new_user_notification_email_admin_subject" name="wpforo_subscribe_options[wp_new_user_notification_email_admin_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['wp_new_user_notification_email_admin_subject']); ?>" required></td>
163
</tr>
164
<tr>
165
+ <th>
166
+ <label for="wp_new_user_notification_email_admin_message"><?php _e('Message Body', 'wpforo'); ?>:</label>
167
+ <ul class="wpf-email-shortcodes">
168
+ <li>[blogname] - <?php _e('Website name', 'wpforo') ?></li>
169
+ <li>[user_login] - <?php _e('Registered user login', 'wpforo') ?></li>
170
+ <li>[user_email] - <?php _e('Registered user email', 'wpforo') ?></li>
171
+ </ul>
172
+ </th>
173
<td>
174
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[wp_new_user_notification_email_admin_message]';
175
wp_editor( wp_unslash( WPF()->sbscrb->options['wp_new_user_notification_email_admin_message'] ), 'wp_new_user_notification_email_admin_message', $wpe_args ); ?>
188
<td><input id="wp_new_user_notification_email_subject" name="wpforo_subscribe_options[wp_new_user_notification_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['wp_new_user_notification_email_subject']); ?>" required></td>
189
</tr>
190
<tr>
191
+ <th>
192
+ <label for="wp_new_user_notification_email_message"><?php _e('Message Body', 'wpforo'); ?>:</label>
193
+ <ul class="wpf-email-shortcodes">
194
+ <li>[user_login] - <?php _e('Registered user login', 'wpforo') ?></li>
195
+ <li>[set_password_url] - <?php _e('Link to open password reset form', 'wpforo') ?></li>
196
+ </ul>
197
+ </th>
198
<td>
199
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[wp_new_user_notification_email_message]';
200
wp_editor( wp_unslash( WPF()->sbscrb->options['wp_new_user_notification_email_message'] ), 'wp_new_user_notification_email_message', $wpe_args ); ?>
207
</td>
208
</tr>
209
<tr>
210
+ <th>
211
+ <label for="reset_password_email_message"><?php _e('Reset Password message body', 'wpforo'); ?>:</label>
212
+ <ul class="wpf-email-shortcodes">
213
+ <li>[user_login] - <?php _e('Registered user login', 'wpforo') ?></li>
214
+ <li>[reset_password_url] - <?php _e('Link to open password reset form', 'wpforo') ?></li>
215
+ </ul>
216
+ </th>
217
<td>
218
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[reset_password_email_message]';
219
wp_editor( wp_unslash( WPF()->sbscrb->options['reset_password_email_message'] ), 'reset_password_email_message', $wpe_args ); ?>
240
<td><input id="user_mention_email_subject" name="wpforo_subscribe_options[user_mention_email_subject]" type="text" value="<?php wpfo(WPF()->sbscrb->options['user_mention_email_subject']); ?>" required></td>
241
</tr>
242
<tr>
243
+ <th>
244
+ <label for="user_mention_email_message"><?php _e('User Mention message body', 'wpforo'); ?>:</label>
245
+ <ul class="wpf-email-shortcodes">
246
+ <li>[mentioned-user-name] - <?php _e('Mentioned user display name', 'wpforo') ?></li>
247
+ <li>[author-user-name] - <?php _e('Post author display name', 'wpforo') ?></li>
248
+ <li>[topic-title] - <?php _e('Topic title', 'wpforo') ?></li>
249
+ <li>[post-url] - <?php _e('Link to the post', 'wpforo') ?></li>
250
+ </ul>
251
+ </th>
252
<td>
253
<?php $wpe_args['textarea_name'] = 'wpforo_subscribe_options[user_mention_email_message]';
254
wp_editor( wp_unslash( WPF()->sbscrb->options['user_mention_email_message'] ), 'user_mention_email_message', $wpe_args ); ?>
wpf-admin/options-tabs/features.php CHANGED
@@ -62,8 +62,8 @@ $options = array(
62
<?php wp_nonce_field( 'wpforo-features' ); ?>
63
<table class="wpforo_settings_table">
64
<tbody>
65
- <?php foreach($options as $key => $option): ?>
66
- <?php if( !isset(WPF()->features[$key]) ){ WPF()->features[$key] = ''; } ?>
67
<tr>
68
<th>
69
<label><?php echo esc_html($option['label']); ?> <?php if(wpfval($option, 'help')): ?><a href="<?php echo esc_url($option['help']) ?>" title="<?php _e('Read the documentation', 'wpforo') ?>" target="_blank"><i class="far fa-question-circle"></i></a><?php endif; ?></label>
62
<?php wp_nonce_field( 'wpforo-features' ); ?>
63
<table class="wpforo_settings_table">
64
<tbody>
65
+ <?php foreach($options as $key => $option): if( $key === 'html_cashe' ) continue; ?>
66
+ <?php if( !isset(WPF()->features[$key]) ){ WPF()->features[$key] = ''; } ?>
67
<tr>
68
<th>
69
<label><?php echo esc_html($option['label']); ?> <?php if(wpfval($option, 'help')): ?><a href="<?php echo esc_url($option['help']) ?>" title="<?php _e('Read the documentation', 'wpforo') ?>" target="_blank"><i class="far fa-question-circle"></i></a><?php endif; ?></label>
wpf-admin/options-tabs/general.php CHANGED
@@ -21,7 +21,7 @@
21
<tr>
22
<th>
23
<label for="wpforourl"><?php _e('Forum Base URL', 'wpforo'); ?> <a href="https://wpforo.com/docs/root/getting-started/forum-page/change-forum-page/" title="<?php _e('Read the documentation', 'wpforo') ?>" target="_blank"><i class="far fa-question-circle"></i></a></label>
24
- <p class="wpf-info"><?php _e('If you want to set forum on home page, please do not use the "Turn WordPress to wpForo" option. The correct instruction can be found in documentation here') ?> <a href="https://wpforo.com/docs/root/getting-started/forum-page/set-forum-on-home-page/" target="_blank" title="<?php _e('Set Forum on Home Page', 'wpforo') ?>">&raquo;&raquo;</a></p>
25
</th>
26
<td align="left">
27
<?php if(!WPF()->use_home_url): ?>
@@ -58,7 +58,7 @@
58
<tr>
59
<th>
60
<label><?php _e('Forum Page Slugs (URL Paths)', 'wpforo'); ?></label>
61
- <p class="wpf-info"><?php _e('Here you can set custom base paths for forum pages. For example the default Profile URL base path is /profile/, if this conflicts with other plugins you can change it to /user/ or so...') ?></p>
62
</th>
63
<td>
64
<table width="100%">
21
<tr>
22
<th>
23
<label for="wpforourl"><?php _e('Forum Base URL', 'wpforo'); ?> <a href="https://wpforo.com/docs/root/getting-started/forum-page/change-forum-page/" title="<?php _e('Read the documentation', 'wpforo') ?>" target="_blank"><i class="far fa-question-circle"></i></a></label>
24
+ <p class="wpf-info"><?php _e('If you want to set forum on home page, please do not use the "Turn WordPress to wpForo" option. The correct instruction can be found in documentation here', 'wpforo') ?> <a href="https://wpforo.com/docs/root/getting-started/forum-page/set-forum-on-home-page/" target="_blank" title="<?php _e('Set Forum on Home Page', 'wpforo') ?>">&raquo;&raquo;</a></p>
25
</th>
26
<td align="left">
27
<?php if(!WPF()->use_home_url): ?>
58
<tr>
59
<th>
60
<label><?php _e('Forum Page Slugs (URL Paths)', 'wpforo'); ?></label>
61
+ <p class="wpf-info"><?php _e('Here you can set custom base paths for forum pages. For example the default Profile URL base path is /profile/, if this conflicts with other plugins you can change it to /user/ or so...', 'wpforo') ?></p>
62
</th>
63
<td>
64
<table width="100%">
wpf-admin/options-tabs/members.php CHANGED
@@ -169,6 +169,19 @@
169
?>
170
</td>
171
</tr>
172
</tbody>
173
</table>
174
169
?>
170
</td>
171
</tr>
172
+ <tr>
173
+ <td colspan="3">
174
+ <label style="text-transform:none;font-size: 14px; font-weight: 500; line-height:20px;"><?php _e('Display Secondary Usergroups under Post Author Avatar', 'wpforo'); ?></label>
175
+ </td>
176
+ <td colspan="4">
177
+ <?php
178
+ foreach($ugroups as $ugroup){
179
+ $value = ( isset(WPF()->member->options['title_second_usergroup'][$ugroup['groupid']]) ) ? WPF()->member->options['title_second_usergroup'][$ugroup['groupid']] : 0;
180
+ echo '<label style="display:inline-block; text-align:center; padding: 0px 10px;"><input name="wpforo_member_options[title_second_usergroup]['.intval($ugroup['groupid']).']" value="1" type="checkbox" ' . wpfo_check(1, $value, 'checked', false) . ' /> '.esc_html($ugroup['name']).'</label>';
181
+ }
182
+ ?>
183
+ </td>
184
+ </tr>
185
</tbody>
186
</table>
187
wpf-admin/options-tabs/posts.php CHANGED
@@ -10,6 +10,33 @@
10
<table class="wpforo_settings_table">
11
<tbody>
12
<?php do_action( 'wpforo_settings_post_top'); ?>
13
<tr>
14
<th><label><?php _e('Recent Posts Display Type','wpforo'); ?></label></th>
15
<td>
@@ -143,6 +170,13 @@
143
</th>
144
<td><input id="dor_durr" type="number" name="wpforo_post_options[dor_durr]" value="<?php wpfo(WPF()->post->options['dor_durr']/60) ?>" class="wpf-field-small" />&nbsp; <?php _e('minutes', 'wpforo') ?></td>
145
</tr>
146
147
<tr>
148
<th>
10
<table class="wpforo_settings_table">
11
<tbody>
12
<?php do_action( 'wpforo_settings_post_top'); ?>
13
+ <tr>
14
+ <th>
15
+ <label for="topic_body_min_length"><?php _e('Topic content minimum length', 'wpforo'); ?></label>
16
+ </th>
17
+ <td><input id="topic_body_min_length" type="number" min="2" name="wpforo_post_options[topic_body_min_length]" value="<?php wpfo(WPF()->post->options['topic_body_min_length']) ?>" class="wpf-field-small" /></td>
18
+ </tr>
19
+ <tr>
20
+ <th>
21
+ <label for="topic_body_max_length"><?php _e('Topic content maximum length', 'wpforo'); ?></label>
22
+ <p class="wpf-info"><?php _e('Set this option value 0 if you want to remove this limit.', 'wpforo') ?></p>
23
+ </th>
24
+ <td><input id="topic_body_max_length" type="number" min="0" name="wpforo_post_options[topic_body_max_length]" value="<?php wpfo(WPF()->post->options['topic_body_max_length']) ?>" class="wpf-field-small" /></td>
25
+ </tr>
26
+ <tr>
27
+ <th>
28
+ <label for="post_body_min_length"><?php _e('Post content minimum length', 'wpforo'); ?></label>
29
+ </th>
30
+ <td><input id="post_body_min_length" type="number" min="2" name="wpforo_post_options[post_body_min_length]" value="<?php wpfo(WPF()->post->options['post_body_min_length']) ?>" class="wpf-field-small" /></td>
31
+ </tr>
32
+ <tr>
33
+ <th>
34
+ <label for="post_body_max_length"><?php _e('Post content maximum length', 'wpforo'); ?></label>
35
+ <p class="wpf-info"><?php _e('Set this option value 0 if you want to remove this limit.', 'wpforo') ?></p>
36
+ </th>
37
+ <td><input id="post_body_max_length" type="number" min="0" name="wpforo_post_options[post_body_max_length]" value="<?php wpfo(WPF()->post->options['post_body_max_length']) ?>" class="wpf-field-small" /></td>
38
+ </tr>
39
+
40
<tr>
41
<th><label><?php _e('Recent Posts Display Type','wpforo'); ?></label></th>
42
<td>
170
</th>
171
<td><input id="dor_durr" type="number" name="wpforo_post_options[dor_durr]" value="<?php wpfo(WPF()->post->options['dor_durr']/60) ?>" class="wpf-field-small" />&nbsp; <?php _e('minutes', 'wpforo') ?></td>
172
</tr>
173
+ <tr>
174
+ <th>
175
+ <label for="search_max_results"><?php _e('Number of maximum search results', 'wpforo'); ?></label>
176
+ <p class="wpf-info"><?php _e('Set this option value 0 if you want to remove this limit.', 'wpforo') ?></p>
177
+ </th>
178
+ <td><input id="search_max_results" type="number" min="0" name="wpforo_post_options[search_max_results]" value="<?php wpfo(WPF()->post->options['search_max_results']) ?>" class="wpf-field-small" /></td>
179
+ </tr>
180
181
<tr>
182
<th>
wpf-admin/tools.php CHANGED
@@ -5,7 +5,7 @@
5
?>
6
7
<?php $plugins = true; ?>
8
- <div class="wrap"><h2 style="padding:0px 0px 30px 0px;line-height: 20px;"><?php _e('Forum Tools') ?></h2></div>
9
<?php WPF()->notice->show(FALSE) ?>
10
<?php do_action('wpforo_tools_page_top') ?>
11
<div id="wpf-admin-wrap" class="wrap"><div id="icon-users" class="icon32"><br /></div>
5
?>
6
7
<?php $plugins = true; ?>
8
+ <div class="wrap"><h2 style="padding:0px 0px 30px 0px;line-height: 20px;"><?php _e('Forum Tools', 'wpforo') ?></h2></div>
9
<?php WPF()->notice->show(FALSE) ?>
10
<?php do_action('wpforo_tools_page_top') ?>
11
<div id="wpf-admin-wrap" class="wrap"><div id="icon-users" class="icon32"><br /></div>
wpf-admin/usergroup.php CHANGED
@@ -47,7 +47,7 @@
47
?>
48
<span style="font-size: 16px; vertical-align: middle;"><?php echo $ug_role; ?></span> &nbsp;
49
<?php if( $ugroup['groupid'] != 4 && $ugroup['groupid'] != 1) : ?>
50
- <select name="wpf_synch_roles[<?php echo $ugroup['groupid'] ?>]" style="background:#FDFDFD; display:inline;">
51
<?php $selected = ( wpfval($ugroup, 'role') ) ? $ugroup['role'] : 'subscriber'; ?>
52
<?php wp_dropdown_roles( $selected ); ?>
53
</select>
47
?>
48
<span style="font-size: 16px; vertical-align: middle;"><?php echo $ug_role; ?></span> &nbsp;
49
<?php if( $ugroup['groupid'] != 4 && $ugroup['groupid'] != 1) : ?>
50
+ <select name="wpf_synch_roles[<?php echo $ugroup['groupid'] ?>]" style="background:#FDFDFD; display:inline; max-width: 80%;">
51
<?php $selected = ( wpfval($ugroup, 'role') ) ? $ugroup['role'] : 'subscriber'; ?>
52
<?php wp_dropdown_roles( $selected ); ?>
53
</select>
wpf-admin/xml/english.xml CHANGED
@@ -670,4 +670,5 @@
670
<phrase name="Tag"><![CDATA[Tag]]></phrase>
671
<phrase name="%s Replies"><![CDATA[%s Replies]]></phrase>
672
<phrase name="%s Reply"><![CDATA[%s Reply]]></phrase>
673
</language>
670
<phrase name="Tag"><![CDATA[Tag]]></phrase>
671
<phrase name="%s Replies"><![CDATA[%s Replies]]></phrase>
672
<phrase name="%s Reply"><![CDATA[%s Reply]]></phrase>
673
+ <phrase name="Quote this text"><![CDATA[Quote this text]]>
674
</language>
wpf-assets/images/icons/eye-dark.png DELETED
Binary file
wpf-assets/images/icons/eye.png DELETED
Binary file
wpf-assets/images/icons/pencil-dark.png DELETED
Binary file
wpf-assets/images/icons/pencil.png DELETED
Binary file
wpf-assets/images/icons/plus-dark.png DELETED
Binary file
wpf-assets/images/icons/plus.png DELETED
Binary file
wpf-assets/images/icons/trash-dark.png DELETED
Binary file
wpf-assets/images/icons/trash.png DELETED
Binary file
wpf-assets/js/ajax.js CHANGED
@@ -243,6 +243,8 @@ jQuery(document).ready(function ($) {
243
244
$('#wpf-form-wrapper').show();
245
246
var postid = $(this).data('postid');
247
$("#wpf_postparentid").val( postid );
248
$.ajax({
@@ -253,9 +255,6 @@ jQuery(document).ready(function ($) {
253
action: 'wpforo_quote_ajax'
254
}
255
}).done(function (response) {
256
- tinyMCE.setActive(tinyMCE.get()[0]);
257
- tinyMCE.activeEditor.setContent(response);
258
-
259
var phrase = wpforo_phrase('Reply with quote');
260
phrase = phrase.charAt(0).toUpperCase() + phrase.slice(1);
261
$("#wpf-reply-form-title").html(phrase);
@@ -278,12 +277,10 @@ jQuery(document).ready(function ($) {
278
wpf_formaction.val( 'add' );
279
$( "#wpf_formpostid" ).val( '' );
280
wpf_title.val(wpforo_phrase('re') + ": " + wpf_title.attr('placeholder').replace(wpforo_phrase('re') + ": ", "").replace(wpforo_phrase('answer to') + ": ", ""));
281
- $('html, body').animate({scrollTop: $("#wpf-form-wrapper").offset().top}, 1000);
282
283
- // tinymce.execCommand('mceFocus', false, tinyMCE.activeEditor);
284
- tinyMCE.activeEditor.focus();
285
- tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.getBody(), true);
286
- tinyMCE.activeEditor.selection.collapse(false);
287
$('#wpforo-load').invisible();
288
});
289
});
@@ -686,15 +683,11 @@ jQuery(document).ready(function ($) {
686
console.log(e);
687
}
688
689
- tinyMCE.setActive(tinyMCE.get()[0]);
690
-
691
- tinyMCE.activeEditor.setContent( response.body );
692
$( ".wpf-topic-sbs" ).hide();
693
$( "#wpf-topic-sbs" ).prop("disabled", true);
694
$( "#wpf_formaction" ).val( 'edit' );
695
$( "#wpf_formpostid" ).val( postid );
696
$( "#wpf_formbutton" ).val( wpforo_phrase('Update') );
697
- $( 'html, body' ).animate({scrollTop: $("#wpf-form-wrapper").offset().top}, 1000);
698
if(is_topic == -1){
699
$( ".wpf-topic-tags" ).hide();
700
$( "#wpf_title").val( response.post_title );
@@ -719,10 +712,9 @@ jQuery(document).ready(function ($) {
719
if( $( "#wpf_user_email" ).length ) { $( "#wpf_user_email" ).attr('name', 'topic[email]'); }
720
}
721
722
- // tinyMCE.execCommand('mceFocus',false,tinyMCE.activeEditor);
723
- tinyMCE.activeEditor.focus();
724
- tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.getBody(), true);
725
- tinyMCE.activeEditor.selection.collapse(false);
726
}
727
728
$('#wpforo-load').invisible();
@@ -732,21 +724,22 @@ jQuery(document).ready(function ($) {
732
733
734
// Delete
735
- wpforo_wrap.on('click','.wpforo-delete', function(){
736
$("#wpf-msg-box").hide(); $('#wpforo-load').visible();
737
738
var ok = confirm(wpforo_ucwords( wpforo_phrase('are you sure you want to delete?') ));
739
740
- if (ok == true){
741
var postid_value = $(this).attr('id');
742
var is_topic = postid_value.indexOf("topic");
743
-
744
- if(is_topic == -1){
745
- var postid = postid_value.replace("wpfreplydelete", "");
746
- var status_value = 'reply';
747
}else{
748
- var postid = postid_value.replace("wpftopicdelete", "");
749
- var status_value = 'topic';
750
}
751
752
var forumid = $("input[type='hidden']#wpf_parent").val();
@@ -766,12 +759,16 @@ jQuery(document).ready(function ($) {
766
} catch (e) {
767
console.log(e);
768
}
769
- if( response.stat == 1 ){
770
- if(is_topic == -1){
771
- $('#post-'+response.postid).fadeOut().delay(200);
772
- $('#wpf-post-replies-'+response.postid).fadeOut().delay(100);
773
$('#wpf-ttgg-'+response.root+' .wpf-post-replies-count').text( response.root_count );
774
-
775
}else{
776
window.location.assign(response.location);
777
}
@@ -908,6 +905,39 @@ jQuery(document).ready(function ($) {
908
$(this).addClass('wpf-active');
909
});
910
911
wpforo_wrap.on('click', '.wpf-more-topics > a', function () {
912
var $this = $(this);
913
var wrap = $this.parents('div.wpfl-4');
243
244
$('#wpf-form-wrapper').show();
245
246
+ var that = $(this);
247
+
248
var postid = $(this).data('postid');
249
$("#wpf_postparentid").val( postid );
250
$.ajax({
255
action: 'wpforo_quote_ajax'
256
}
257
}).done(function (response) {
258
var phrase = wpforo_phrase('Reply with quote');
259
phrase = phrase.charAt(0).toUpperCase() + phrase.slice(1);
260
$("#wpf-reply-form-title").html(phrase);
277
wpf_formaction.val( 'add' );
278
$( "#wpf_formpostid" ).val( '' );
279
wpf_title.val(wpforo_phrase('re') + ": " + wpf_title.attr('placeholder').replace(wpforo_phrase('re') + ": ", "").replace(wpforo_phrase('answer to') + ": ", ""));
280
281
+ wpforo_editor.set_content( response, wpforo_editor.get_main() );
282
+
283
+ $('html, body').animate({scrollTop: $("#wpf-form-wrapper").offset().top}, 1000);
284
$('#wpforo-load').invisible();
285
});
286
});
683
console.log(e);
684
}
685
686
$( ".wpf-topic-sbs" ).hide();
687
$( "#wpf-topic-sbs" ).prop("disabled", true);
688
$( "#wpf_formaction" ).val( 'edit' );
689
$( "#wpf_formpostid" ).val( postid );
690
$( "#wpf_formbutton" ).val( wpforo_phrase('Update') );
691
if(is_topic == -1){
692
$( ".wpf-topic-tags" ).hide();
693
$( "#wpf_title").val( response.post_title );
712
if( $( "#wpf_user_email" ).length ) { $( "#wpf_user_email" ).attr('name', 'topic[email]'); }
713
}
714
715
+ wpforo_editor.set_content( response.body, wpforo_editor.get_main() );
716
+
717
+ $( 'html, body' ).animate({scrollTop: $("#wpf-form-wrapper").offset().top}, 1000);
718
}
719
720
$('#wpforo-load').invisible();
724
725
726
// Delete
727
+ wpforo_wrap.on('click', '.wpforo-delete', function(){
728
$("#wpf-msg-box").hide(); $('#wpforo-load').visible();
729
730
var ok = confirm(wpforo_ucwords( wpforo_phrase('are you sure you want to delete?') ));
731
732
+ if (ok){
733
var postid_value = $(this).attr('id');
734
var is_topic = postid_value.indexOf("topic");
735
+
736
+ var postid, status_value;
737
+ if(is_topic === -1){
738
+ postid = postid_value.replace("wpfreplydelete", "");
739
+ status_value = 'reply';
740
}else{
741
+ postid = postid_value.replace("wpftopicdelete", "");
742
+ status_value = 'topic';
743
}
744
745
var forumid = $("input[type='hidden']#wpf_parent").val();
759
} catch (e) {
760
console.log(e);
761
}
762
+ if( response.stat === 1 ){
763
+ if(is_topic === -1){
764
+ var to_be_removed = $('#post-' + response.postid);
765
+ if( to_be_removed.hasClass('wpf-answer-wrap') ){
766
+ var qa_item_wrap = to_be_removed.parents('.wpforo-qa-item-wrap');
767
+ if( qa_item_wrap.length ) to_be_removed = qa_item_wrap;
768
+ }
769
+ to_be_removed.remove().delay(200);
770
+ $('#wpf-post-replies-'+response.postid).remove().delay(100);
771
$('#wpf-ttgg-'+response.root+' .wpf-post-replies-count').text( response.root_count );
772
}else{
773
window.location.assign(response.location);
774
}
905
$(this).addClass('wpf-active');
906
});
907
908
+ wpforo_wrap.on('change', '.wpf-topic-form-forumid', function () {
909
+ var form_wrap = $(this).parents('.wpf-topic-form-extra-wrap');
910
+ $('.wpf-topic-form-ajax-wrap', form_wrap).html('<i class="fas fa-spinner fa-spin wpf-icon-spinner"></i>');
911
+ $('.wpf-topic-form-no-selected-forum', form_wrap).hide();
912
+
913
+ var forumid = $(this).val();
914
+ if( forumid ){
915
+ $.ajax({
916
+ type: 'POST',
917
+ data: {
918
+ forumid: forumid,
919
+ action: 'wpforo_topic_portable_form'
920
+ }
921
+ }).done(function (response) {
922
+ if( response ){
923
+ $('.wpf-topic-form-ajax-wrap', form_wrap).html(response);
924
+ $('.wpf-topic-create', form_wrap).show();
925
+ var form = $('form', form_wrap);
926
+ if( form.length ){
927
+ var textareaid = form.data('textareaid');
928
+ if( textareaid ){
929
+ wpforo_tinymce_initializeIt( '#' + textareaid, true );
930
+ $('input.wpf-subject', form_wrap).focus();
931
+ }
932
+ }
933
+
934
+ var event = new Event('wpforo_topic_portable_form');
935
+ document.dispatchEvent(event);
936
+ }
937
+ })
938
+ }
939
+ });
940
+
941
wpforo_wrap.on('click', '.wpf-more-topics > a', function () {
942
var $this = $(this);
943
var wrap = $this.parents('div.wpfl-4');
wpf-assets/js/frontend.js CHANGED
@@ -1,81 +1,394 @@
1
- jQuery.fn.visible = function() {
2
- return this.css('visibility', 'visible');
3
- };
4
-
5
- jQuery.fn.invisible = function() {
6
- return this.css('visibility', 'hidden');
7
- };
8
-
9
- jQuery.fn.visibilityToggle = function() {
10
- return this.css('visibility', function(i, visibility) {
11
- return (visibility === 'visible') ? 'hidden' : 'visible';
12
- });
13
- };
14
15
- function wpforo_tinymce_initializeIt(selector) {
16
tinyMCE.init({
17
forced_root_block: "",
18
force_br_newlines: false,
19
force_p_newlines: true,
20
selector: selector,
21
- plugins: "hr,lists,textcolor,paste,wpforo_pre_button,wpforo_link_button,wpforo_source_code_button,emoticons",
22
menubar: "",
23
- toolbar: "fontsizeselect,bold,italic,underline,forecolor,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,blockquote,pre,source_code,emoticons",
24
content_style: 'p{color:#333333; font-weight: normal;} blockquote{border: #cccccc 1px dotted; background: #F7F7F7; padding:10px;font-size:12px; font-style:italic; margin: 20px 10px;}',
25
branding: false,
26
elementpath: false,
27
min_height: 100,
28
height: 100,
29
statusbar: true,
30
fix_list_elements: true,
31
- browser_spellcheck: true
32
}).then(function (e) {
33
- e[0].focus();
34
});
35
}
36
37
function wpforo_notice_clear() {
38
var msg_box = jQuery("#wpf-msg-box");
39
msg_box.hide();
40
msg_box.empty();
41
}
42
43
- function wpforo_notice_show(notice){
44
- if( notice === undefined || notice === '' ) return;
45
46
var n = notice.search(/<p(?:\s[^<>]*?)?>/i);
47
- if( n < 0 ) notice = '<p>' + wpforo_phrase(notice) + '</p>';
48
49
var msg_box = jQuery("#wpf-msg-box");
50
- msg_box.hide();
51
- msg_box.html(notice);
52
- msg_box.show(150).delay(1000);
53
- setTimeout(function(){ jQuery("#wpf-msg-box > p.error").remove(); }, 6500);
54
- setTimeout(function(){ jQuery("#wpf-msg-box > p.success").remove(); }, 2500);
55
}
56
57
function wpforo_phrase(phrase_key){
58
- if( typeof wpforo_phrases !== 'undefined' ){
59
phrase_key = phrase_key.toLowerCase();
60
if( wpforo_phrases[phrase_key] !== undefined ) phrase_key = wpforo_phrases[phrase_key];
61
}
62
- return phrase_key;
63
}
64
65
jQuery(document).ready(function($){
66
var wpforo_wrap = $('#wpforo-wrap');
67
68
/**
69
* prevent multi submitting
70
* disable form elements for 10 seconds
71
*/
72
var wpforo_prev_submit_time = 0;
73
- $( 'form', wpforo_wrap ).submit(function () {
74
if( wpforo_prev_submit_time ){
75
if( Date.now() - wpforo_prev_submit_time < 10000 ) return false;
76
}else{
77
$("#wpf-msg-box").hide(); $('#wpforo-load').visible();
78
wpforo_prev_submit_time = Date.now();
79
setTimeout(function () {
80
wpforo_prev_submit_time = 0;
81
$('#wpforo-load').invisible();
@@ -83,48 +396,82 @@ jQuery(document).ready(function($){
83
}
84
});
85
86
var _m = $("#m_");
87
if( _m !== undefined && _m.length ){
88
$('html, body').scrollTop(_m.offset().top - 25);
89
}
90
91
- $(document).on('click', '#add_wpftopic:not(.not_reg_user)', function(){
92
var stat = $( ".wpf-topic-create" ).is( ":hidden" );
93
$( ".wpf-topic-create" ).slideToggle( "slow" );
94
var add_wpftopic = '<i class="fas fa-times" aria-hidden="true"></i>';
95
if( !stat ) add_wpftopic = $("#wpf_formbutton").val();
96
$( "#add_wpftopic" ).html(add_wpftopic);
97
$('html, body').animate({ scrollTop: ($("#add_wpftopic").offset().top - 35) }, 415);
98
});
99
100
- $(document).on('click', '.wpf-answer-button .wpf-button:not(.not_reg_user)', function(){
101
$(this).closest('.wpf-bottom-bar').hide();
102
});
103
104
- $(document).on('click', '.wpfl-4 .add_wpftopic:not(.not_reg_user)', function(){
105
var wrap = $(this).parents('div.wpfl-4');
106
- var form_wrap = $( ".wpf-topic-create", wrap );
107
var stat = form_wrap.is( ":hidden" );
108
- form_wrap.slideToggle( "slow" );
109
- var add_wpftopic = '<i class="fas fa-times" aria-hidden="true"></i>';
110
- if( !stat ) add_wpftopic = $('input[type="submit"]', form_wrap).val();
111
$( this ).html(add_wpftopic);
112
$('html, body').animate({ scrollTop: (wrap.offset().top -30 ) }, 415);
113
});
114
-
115
- $(document).on('click','.not_reg_user', function(){
116
$("#wpf-msg-box").hide();
117
$('#wpforo-load').visible();
118
$('#wpf-msg-box').show(150).delay(1000);
119
$('#wpforo-load').invisible();
120
});
121
122
- $(document).on('click','#wpf-msg-box', function(){
123
$(this).hide();
124
});
125
126
/* Home page loyouts toipcs toglle */
127
- $( ".topictoggle" ).click(function(){
128
var wpfload = $('#wpforo-load');
129
wpfload.visible();
130
@@ -150,7 +497,7 @@ jQuery(document).ready(function($){
150
});
151
152
/* Home page loyouts toipcs toglle */
153
- $( ".wpforo-membertoggle" ).click(function(){
154
var id = $(this).attr( 'id' );
155
id = id.replace( "wpforo-memberinfo-toggle-", "" );
156
$( "#wpforo-memberinfo-" + id ).slideToggle( "slow" );
@@ -162,7 +509,7 @@ jQuery(document).ready(function($){
162
});
163
164
/* Threaded Layout Hide Replies */
165
- $( ".wpf-post-replies-bar" ).click(function(){
166
var id = $(this).attr( 'id' );
167
id = id.replace( "wpf-ttgg-", "" );
168
$( "#wpf-post-replies-" + id ).slideToggle( "slow" );
@@ -177,8 +524,7 @@ jQuery(document).ready(function($){
177
178
179
//Reply
180
- $( ".wpforo-reply:not(.wpforo_layout_4)" ).click(function(){
181
-
182
$("#wpf-msg-box").hide(); $('#wpforo-load').visible();
183
$('#wpf-form-wrapper').show();
184
@@ -187,8 +533,6 @@ jQuery(document).ready(function($){
187
var parentpostid = $(this).attr('id');
188
parentpostid = parentpostid.replace("parentpostid", "");
189
$("#wpf_postparentid").val( parentpostid );
190
- tinyMCE.setActive(tinyMCE.get()[0]);
191
- tinyMCE.activeEditor.setContent('');
192
$( ".wpf-topic-sbs" ).show();
193
$( "#wpf-topic-sbs" ).prop("disabled", false);
194
@@ -201,19 +545,20 @@ jQuery(document).ready(function($){
201
$( "#wpf_formpostid" ).val( '' );
202
$( "#wpf_formbutton" ).val( wpforo_phrase('Save') );
203
$( "#wpf_title").val( wpforo_phrase('re') + ": " + $("#wpf_title").attr('placeholder').replace( wpforo_phrase('re') + ": ", ""));
204
-
205
- $('html, body').animate({ scrollTop: $("#wpf-form-wrapper").offset().top }, 500);
206
-
207
- tinymce.execCommand('mceFocus',false,tinyMCE.activeEditor);
208
- tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.getBody(), true);
209
- tinyMCE.activeEditor.selection.collapse(false);
210
-
211
$('#wpforo-load').invisible();
212
213
});
214
215
//Answer
216
- $( ".wpforo-answer" ).click(function(){
217
var phrase = wpforo_phrase('Save') ;
218
if( $(this).data('phrase') !== undefined ) phrase = $(this).data('phrase');
219
@@ -222,8 +567,7 @@ jQuery(document).ready(function($){
222
$('#wpf-form-wrapper').show();
223
224
$("#wpf-reply-form-title").html( wpforo_phrase('Your answer') );
225
- tinyMCE.setActive(tinyMCE.get()[0]);
226
- tinyMCE.activeEditor.setContent('');
227
$( "#wpf_formaction" ).attr('name', 'post[action]');
228
$( "#wpf_formbutton" ).attr('name', 'post[save]');
229
$( "#wpf_formtopicid" ).attr('name', 'post[topicid]');
@@ -233,18 +577,20 @@ jQuery(document).ready(function($){
233
$( "#wpf_formpostid" ).val( '' );
234
$( "#wpf_formbutton" ).val( phrase );
235
$( "#wpf_title").val( wpforo_phrase('Answer to') + ": " + $("#wpf_title").attr('placeholder').replace( wpforo_phrase('re') + ": ", "").replace( wpforo_phrase('Answer to') + ": ", ""));
236
- $('html, body').animate({ scrollTop: $("#wpf-form-wrapper").offset().top }, 500);
237
-
238
- tinymce.execCommand('mceFocus',false,tinyMCE.activeEditor);
239
- tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.getBody(), true);
240
- tinyMCE.activeEditor.selection.collapse(false);
241
-
242
$('#wpforo-load').invisible();
243
244
});
245
246
//Comment
247
- $( ".wpforo-childreply" ).click(function(){
248
var phrase = wpforo_phrase('Save') ;
249
if( $(this).data('phrase') !== undefined ) phrase = $(this).data('phrase');
250
@@ -257,8 +603,6 @@ jQuery(document).ready(function($){
257
var parentpostid = $(this).attr('id');
258
var postid = parentpostid.replace("parentpostid", "");
259
$("#wpf_postparentid").val( postid );
260
- tinyMCE.setActive(tinyMCE.get()[0]);
261
- tinyMCE.activeEditor.setContent('');
262
$( ".wpf-topic-sbs" ).show();
263
$( "#wpf-topic-sbs" ).prop("disabled", false);
264
@@ -271,16 +615,18 @@ jQuery(document).ready(function($){
271
$( "#wpf_formpostid" ).val( '' );
272
$( "#wpf_formbutton" ).val( phrase );
273
$( "#wpf_title").val( wpforo_phrase('re') + ": " + $("#wpf_title").attr('placeholder').replace( wpforo_phrase('re') + ": ", "").replace( wpforo_phrase('Answer to') + ": ", "") );
274
- $('html, body').animate({ scrollTop: $("#wpf-form-wrapper").offset().top }, 800);
275
-
276
- tinymce.execCommand('mceFocus',false,tinyMCE.activeEditor);
277
- tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.getBody(), true);
278
- tinyMCE.activeEditor.selection.collapse(false);
279
-
280
$('#wpforo-load').invisible();
281
});
282
283
- $('.wpforo-qa-comment, .wpforo-reply.wpf-action.wpforo_layout_4').click(function () {
284
var wrap = $(this).parents('.reply-wrap,.wpforo-qa-item-wrap');
285
var post_wrap = $('.post-wrap', wrap);
286
if( !post_wrap.length ) post_wrap = wrap;
@@ -288,45 +634,51 @@ jQuery(document).ready(function($){
288
if (!parentid) parentid = post_wrap.attr('id').replace('post-', '');
289
if (!parentid) parentid = 0;
290
var form = $('.wpforo-post-form');
291
var textarea_wrap = $('.wpf_post_form_textarea_wrap', form);
292
- var textarea = $('textarea.wpf_post_body', textarea_wrap);
293
- var textaretype = textarea_wrap.data('textaretype');
294
$('.wpf_post_parentid').val(parentid);
295
$('.wpforo-qa-comment,.wpforo-reply.wpf-action.wpforo_layout_4').show();
296
$(this).hide();
297
$('.wpforo-portable-form-wrap', wrap).show();
298
- form.appendTo($('.wpforo-portable-form-wrap', wrap));
299
300
form.show();
301
- if( textaretype && textaretype === 'rich_editor' ){
302
- textarea_wrap.html('<textarea class="wpf_post_body" name="post[body]"></textarea>');
303
- wpforo_tinymce_initializeIt( '.wpf_post_form_textarea_wrap textarea.wpf_post_body' );
304
}else{
305
textarea.val('');
306
textarea.focus();
307
}
308
309
});
310
311
wpforo_wrap.on('click', '.wpf-button-close-form', function () {
312
$(this).parents('.wpforo-portable-form-wrap').hide();
313
$('.wpforo-post-form').hide();
314
$('.wpforo-qa-comment,.wpforo-reply.wpf-action.wpforo_layout_4').show();
315
});
316
317
//mobile menu responsive toggle
318
- $("#wpforo-menu .wpf-res-menu").click(function(){
319
$("#wpforo-menu .wpf-menu").toggle();
320
});
321
var wpfwin = $(window).width();
322
var wpfwrap = wpforo_wrap.width();
323
if( wpfwin >= 602 && wpfwrap < 700 ){
324
- $("#wpforo-menu .wpf-search-field").focus(function(){
325
$("#wpforo-menu .wpf-menu li").hide();
326
wpforo_wrap.find("#wpforo-menu .wpf-res-menu").show();
327
$("#wpforo-menu .wpf-search-field").css('transition-duration', '0s');
328
});
329
- $("#wpforo-menu .wpf-search-field").blur(function(){
330
wpforo_wrap.find("#wpforo-menu .wpf-res-menu").hide();
331
$("#wpforo-menu .wpf-menu li").show();
332
$("#wpforo-menu .wpf-search-field").css('transition-duration', '0.4s');
@@ -334,11 +686,11 @@ jQuery(document).ready(function($){
334
}
335
336
// password show/hide switcher */
337
- $(document).delegate('.wpf-show-password', 'click', function () {
338
var btn = $(this);
339
var parent = btn.parents('.wpf-field-wrap');
340
var input = $(':input', parent);
341
- if (input.attr('type') == 'password') {
342
input.attr('type', 'text');
343
btn.removeClass('fa-eye-slash');
344
btn.addClass('fa-eye');
@@ -379,73 +731,69 @@ jQuery(document).ready(function($){
379
}
380
});
381
382
- });
383
-
384
-
385
- jQuery(document).ready(function($){
386
-
387
//Facebook Share Buttons
388
- $(document).on('click','.wpf-fb', function(){
389
var item_url = $(this).data('wpfurl');
390
var item_quote = $(this).parents('.post-wrap').find('.wpforo-post-content').text();
391
FB.ui({
392
method: 'share',
393
href: item_url,
394
quote: item_quote,
395
- hashtag: null,
396
}, function (response) {});
397
});
398
-
399
//Share Buttons Toggle
400
- $('.wpf-sb').mouseover(function(){
401
$(this).find(".wpf-sb-toggle").find("i").addClass("wpfsa");
402
$(this).find(".wpf-sb-buttons").show();
403
- }).mouseout(function() {
404
$(this).find(".wpf-sb-toggle").find("i").removeClass("wpfsa");
405
$(this).find(".wpf-sb-buttons").hide();
406
});
407
- $('.wpf-sb-toggle').mouseover(function(){
408
$(this).next().filter('.wpf-sb-buttons').parent().find("i").addClass("wpfsa");
409
- }).mouseout(function() {
410
$(this).next().filter('.wpf-sb-buttons').parent().find("i").removeClass("wpfsa");
411
});
412
413
//Forum Rules
414
- $("#wpf-open-rules").click(function(){
415
$(".wpforo-legal-rules").toggle();
416
return false;
417
});
418
- $(document).on('click','#wpflegal-rules-yes', function(){
419
$('#wpflegal_rules').prop('checked', true);
420
$('#wpflegal-rules-not').removeClass('wpflb-active-not');
421
$(this).addClass('wpflb-active-yes');
422
setTimeout(function(){ $(".wpforo-legal-rules").slideToggle( "slow" ); }, 500);
423
});
424
- $(document).on('click','#wpflegal-rules-not', function(){
425
$('#wpflegal_rules').prop('checked', false);
426
$('#wpflegal-rules-yes').removeClass('wpflb-active-yes');
427
$(this).addClass('wpflb-active-not');
428
});
429
430
//Forum Privacy Buttons
431
- $("#wpf-open-privacy").click(function(){
432
$(".wpforo-legal-privacy").toggle();
433
return false;
434
});
435
- $(document).on('click','#wpflegal-privacy-yes', function(){
436
$('#wpflegal_privacy').prop('checked', true);
437
$('#wpflegal-privacy-not').removeClass('wpflb-active-not');
438
$(this).addClass('wpflb-active-yes');
439
setTimeout(function(){ $(".wpforo-legal-privacy").slideToggle( "slow" ); }, 500);
440
});
441
- $(document).on('click','#wpflegal-privacy-not', function(){
442
$('#wpflegal_privacy').prop('checked', false);
443
$('#wpflegal-privacy-yes').removeClass('wpflb-active-yes');
444
$(this).addClass('wpflb-active-not');
445
});
446
447
//Facebook Login Button
448
- $('#wpflegal_fblogin').on('click', function() {
449
if( $(this).is(':checked') ){
450
$('.wpforo_fb-button').attr('style','pointer-events:auto; opacity:1;');
451
} else{
@@ -453,13 +801,7 @@ jQuery(document).ready(function($){
453
}
454
});
455
456
- $('.wpf-topic-form-forumid').change(function () {
457
- var form_wrap = $(this).parents('.wpf-topic-create');
458
- $('.wpf-topic-form-no-selected-forum', form_wrap).remove();
459
- $('.wpf-topic-form-wrap', form_wrap).slideDown('slow');
460
- });
461
-
462
- $('.wpf-load-threads .wpf-forums').click(function () {
463
$( '.wpf-cat-forums', $(this).parents('div.wpfl-4') ).slideToggle('slow');
464
$('i', $(this)).toggleClass('fa-chevron-down fa-chevron-up');
465
});
1
+ jQuery.fn.extend({
2
+ visible: function() {
3
+ return this.css('visibility', 'visible');
4
+ },
5
+ invisible: function() {
6
+ return this.css('visibility', 'hidden');
7
+ },
8
+ visibilityToggle: function() {
9
+ return this.css('visibility', function(i, visibility) {
10
+ return (visibility === 'visible') ? 'hidden' : 'visible';
11
+ });
12
+ },
13
+ showFlex: function() {
14
+ return this.css('display', 'flex');
15
+ },
16
+ wpfInsertAtCaret: function (myValue) {
17
+ return this.each(function (i) {
18
+ if (document.selection) {
19
+ //For browsers like Internet Explorer
20
+ this.focus();
21
+ var sel = document.selection.createRange();
22
+ sel.text = myValue;
23
+ this.focus();
24
+ } else if ( this.selectionStart || this.selectionStart == '0' ) {
25
+ //For browsers like Firefox and Webkit based
26
+ var startPos = this.selectionStart;
27
+ var endPos = this.selectionEnd;
28
+ var scrollTop = this.scrollTop;
29
+ this.value = this.value.substring(0, startPos) + myValue + this.value.substring(endPos, this.value.length);
30
+ this.focus();
31
+ this.selectionStart = startPos + myValue.length;
32
+ this.selectionEnd = startPos + myValue.length;
33
+ this.scrollTop = scrollTop;
34
+ } else {
35
+ this.value += myValue;
36
+ this.focus();
37
+ }
38
+ });
39
+ }
40
+ });
41
42
+ function wpforo_tinymce_initializeIt(selector, do_not_focus) {
43
tinyMCE.init({
44
forced_root_block: "",
45
force_br_newlines: false,
46
force_p_newlines: true,
47
selector: selector,
48
+ plugins: "hr,lists,textcolor,paste,wpautoresize,fullscreen,wpforo_pre_button,wpforo_link_button,wpforo_spoiler_button,wpforo_source_code_button,emoticons",
49
menubar: "",
50
+ toolbar: "fontsizeselect,bold,italic,underline,forecolor,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,blockquote,pre,wpf_spoil,source_code,emoticons,fullscreen",
51
content_style: 'p{color:#333333; font-weight: normal;} blockquote{border: #cccccc 1px dotted; background: #F7F7F7; padding:10px;font-size:12px; font-style:italic; margin: 20px 10px;}',
52
branding: false,
53
elementpath: false,
54
+ autoresize_on_init: true,
55
+ wp_autoresize_on: true,
56
min_height: 100,
57
height: 100,
58
statusbar: true,
59
fix_list_elements: true,
60
+ browser_spellcheck: true,
61
+ setup: 'wpforo_tinymce_setup'
62
}).then(function (e) {
63
+ if(!do_not_focus && e.length) {
64
+ wpforo_editor.focus(e[0].id);
65
+ wpforo_editor.set_active(e[0].id);
66
+ }
67
});
68
}
69
70
+ function wpforo_tinymce_setup(editor) {
71
+ editor.on('focus', function(e) {
72
+ wpforo_editor.set_active(editor.id);
73
+ });
74
+ editor.on('paste', function(e) {
75
+ jQuery('form[data-textareaid='+editor.id+']').trigger({type: 'paste', delegatedEvent: {originalEvent: {clipboardData: e.clipboardData}},originalEvent: {clipboardData: e.clipboardData}});
76
+ });
77
+ editor.shortcuts.add('ctrl+13', 'submit', function(){jQuery('form[data-textareaid='+editor.id+']').find('[type=submit]').click();});
78
+ }
79
+
80
+ var wpforo_editor = {
81
+ active_textareaid: '',
82
+ main_textareaid: '',
83
+ fix_textareaid: function (textareaid) {
84
+ if( typeof textareaid !== 'undefined' ){
85
+ return textareaid;
86
+ }else if( this.active_textareaid ){
87
+ return this.active_textareaid;
88
+ }else{
89
+ var tinymce_active_editor_id = this.get_tinymce_active_editor_id();
90
+ if( tinymce_active_editor_id ){
91
+ this.active_textareaid = tinymce_active_editor_id;
92
+ return tinymce_active_editor_id;
93
+ }
94
+ }
95
+ return '';
96
+ },
97
+ set_active: function(textareaid){
98
+ if( this.is_exists(textareaid) ){
99
+ this.active_textareaid = textareaid;
100
+ if( this.is_tinymce(textareaid) ) tinymce.setActive( tinymce.get(textareaid) );
101
+ }
102
+ },
103
+ clear_active: function(){
104
+ this.active_textareaid = '';
105
+ },
106
+ set_main: function(textareaid, also_set_active){
107
+ if( !textareaid ){
108
+ var wpforo_main_form = jQuery( 'form.wpforo-main-form[data-textareaid]' );
109
+ if( wpforo_main_form.length ) textareaid = wpforo_main_form.data('textareaid');
110
+ }
111
+ if( this.is_exists(textareaid) ){
112
+ this.main_textareaid = textareaid;
113
+ if(also_set_active) this.set_active(textareaid);
114
+ }
115
+ },
116
+ get_main: function(){
117
+ if( !this.main_textareaid ) this.set_main();
118
+ return this.main_textareaid;
119
+ },
120
+ clear_main: function(){
121
+ this.main_textareaid = '';
122
+ },
123
+ get_tinymce_active_editor_id: function(){
124
+ if( this.is_tinymce_loaded() && typeof tinymce.activeEditor === "object" && tinymce.activeEditor.id ){
125
+ return tinymce.activeEditor.id;
126
+ }
127
+ return '';
128
+ },
129
+ is_tinymce_loaded: function (){
130
+ return typeof tinymce !== "undefined";
131
+ },
132
+ is_tinymce: function (textareaid){
133
+ textareaid = this.fix_textareaid(textareaid);
134
+ return !!( textareaid && this.is_tinymce_loaded() && tinymce.get(textareaid) );
135
+ },
136
+ is_textarea: function (textareaid){
137
+ textareaid = this.fix_textareaid(textareaid);
138
+ return !!( textareaid && !this.is_tinymce(textareaid) && jQuery( 'textarea#' + textareaid ).length );
139
+ },
140
+ is_exists: function(textareaid){
141
+ return !!( textareaid && this.is_tinymce(textareaid) || this.is_textarea(textareaid) );
142
+ },
143
+ tinymce_focus: function(textareaid, caret_to_end){
144
+ textareaid = this.fix_textareaid(textareaid);
145
+ if( this.is_tinymce(textareaid) ){
146
+ var focus_mce = tinymce.get(textareaid);
147
+ focus_mce.focus();
148
+ if(caret_to_end){
149
+ focus_mce.selection.select(focus_mce.getBody(), true);
150
+ focus_mce.selection.collapse(false);
151
+ }
152
+ }
153
+ },
154
+ textarea_focus: function(textareaid, caret_to_end){
155
+ textareaid = this.fix_textareaid(textareaid);
156
+ if( this.is_textarea(textareaid) ){
157
+ var textarea = jQuery( 'textarea#' + textareaid );
158
+ var textarea_val = textarea.val();
159
+ textarea.focus();
160
+ if( caret_to_end ){
161
+ textarea.val('');
162
+ textarea.val(textarea_val);
163
+ }
164
+ }
165
+ },
166
+ focus: function(textareaid, caret_to_end){
167
+ textareaid = this.fix_textareaid(textareaid);
168
+ if( this.is_tinymce(textareaid) ){
169
+ this.tinymce_focus(textareaid, caret_to_end)
170
+ }else if( this.is_textarea(textareaid) ){
171
+ this.textarea_focus(textareaid, caret_to_end);
172
+ }
173
+ },
174
+ insert_content: function (content, textareaid){
175
+ textareaid = this.fix_textareaid(textareaid);
176
+ if( this.is_tinymce(textareaid) ){
177
+ tinymce.get(textareaid).insertContent(content);
178
+ this.tinymce_focus(textareaid);
179
+ }else if( this.is_textarea(textareaid) ){
180
+ jQuery( 'textarea#' + textareaid ).wpfInsertAtCaret(content);
181
+ this.textarea_focus(textareaid);
182
+ }
183
+ },
184
+ set_content: function (content, textareaid){
185
+ textareaid = this.fix_textareaid(textareaid);
186
+ if( this.is_tinymce(textareaid) ){
187
+ tinymce.get(textareaid).setContent(content);
188
+ this.tinymce_focus(textareaid, true);
189
+ }else if( this.is_textarea(textareaid) ){
190
+ jQuery( 'textarea#' + textareaid ).val(content);
191
+ this.textarea_focus(textareaid, true);
192
+ }
193
+ },
194
+ get_content: function (format, textareaid){
195
+ textareaid = this.fix_textareaid(textareaid);
196
+ format = format ? format : 'text';
197
+ var content = '';
198
+ if( this.is_tinymce(textareaid) ){
199
+ content = tinymce.get(textareaid).getContent({format: format});
200
+ }else if( this.is_textarea(textareaid) ){
201
+ content = jQuery( 'textarea#' + textareaid ).val();
202
+ if( format === 'text' && content ) {
203
+ content = content.replace(/<(iframe|embed)[^<>]*?>.*?<\/\1>/gi, "");
204
+ content = content.replace(/(<([^<>]+?)>)/gi, "");
205
+ }
206
+ }
207
+ return content.trim();
208
+ },
209
+ get_stats: function (textareaid){
210
+ textareaid = this.fix_textareaid(textareaid);
211
+
212
+ var text = this.get_content('text', textareaid);
213
+ var raw_text = this.get_content('raw', textareaid);
214
+
215
+ return {
216
+ chars: text.length,
217
+ words: text.split(/[\w\u2019'-]+/).length - 1,
218
+ imgs: (raw_text.match(/<img[^<>]*?src=['"][^'"]+?['"][^<>]*?>/gi) || []).length,
219
+ links: (raw_text.match(/<a[^<>]*?href=['"][^'"]+?['"][^<>]*?>.+?<\/a>/gi) || []).length,
220
+ embeds: (raw_text.match(/<(iframe|embed)[^<>]*?>.*?<\/\1>/gi) || []).length
221
+ };
222
+ }
223
+ };
224
+
225
function wpforo_notice_clear() {
226
var msg_box = jQuery("#wpf-msg-box");
227
msg_box.hide();
228
msg_box.empty();
229
}
230
231
+ function wpforo_notice_show(notice, type){
232
+ if( !notice ) return;
233
+ type = ( type === 'success' || type === 'error' ? type : 'neutral' );
234
235
var n = notice.search(/<p(?:\s[^<>]*?)?>/i);
236
+ if( n < 0 ){
237
+ var phrase = wpforo_phrase(notice);
238
+ if( arguments.length > 2 ){
239
+ var i;
240
+ for( i = 2; i < arguments.length; i++ ){
241
+ if( arguments[i] !== undefined ) phrase = phrase.replace(/%[dfs]/, arguments[i]);
242
+ }
243
+ }
244
+ notice = '<p class="'+ type +'">' + phrase + '</p>';
245
+ }
246
247
+ notice = jQuery(notice);
248
var msg_box = jQuery("#wpf-msg-box");
249
+ msg_box.append(notice);
250
+ msg_box.show(150);
251
+ notice.delay(type === 'error' ? 6500 : 2500).fadeOut(200, function () {
252
+ jQuery(this).remove();
253
+ });
254
}
255
256
function wpforo_phrase(phrase_key){
257
+ if( typeof wpforo_phrases === 'object' && Object.keys(wpforo_phrases).length ){
258
phrase_key = phrase_key.toLowerCase();
259
if( wpforo_phrases[phrase_key] !== undefined ) phrase_key = wpforo_phrases[phrase_key];
260
}
261
+ return phrase_key;
262
+ }
263
+
264
+ function wpforo_getTextSelection(){
265
+ jQuery("#wpf_multi_quote").remove();
266
+ if (window.getSelection) {
267
+ var sel = window.getSelection();
268
+ if ( sel && sel.anchorNode && sel.anchorNode.parentNode && sel.anchorNode.parentNode.tagName !== 'A' ) {
269
+ var selectedText = sel.toString().trim();
270
+ if ( sel.rangeCount && selectedText.length ) {
271
+ var getRangeAt_0 = sel.getRangeAt(0);
272
+ var rangeBounding = getRangeAt_0.getBoundingClientRect();
273
+ var bodyBounding = document.documentElement.getBoundingClientRect();
274
+ var left = rangeBounding.left + rangeBounding.width/2 + Math.abs( bodyBounding.left ) - 15;
275
+ var top = rangeBounding.bottom + Math.abs( bodyBounding.top ) + 50;
276
+
277
+ var parent = jQuery(getRangeAt_0.commonAncestorContainer).closest('.wpforo-post-content, .wpforo-comment-content');
278
+ var noNeedParent = jQuery(getRangeAt_0.commonAncestorContainer).closest('.wpforo-post-signature, .wpforo-post-content-bottom, .wpf-post-button-actions');
279
+ var noNeedChild = jQuery(getRangeAt_0.endContainer).closest('.wpforo-post-signature, .wpforo-post-content-bottom, .wpf-post-button-actions');
280
+
281
+ if( parent.length && !noNeedParent.length && !noNeedChild.length ){
282
+ var toolTip = jQuery('<div id="wpf_multi_quote"></div>');
283
+ toolTip.css({top: top, left: left});
284
+ var link = jQuery('<span class="wpf-multi-quote" title="'+ wpforo_phrase('Quote this text') +'"><i class="fas fa-quote-left"></i></span>').on('mousedown touchstart', function () {
285
+ var container = document.createElement("div");
286
+ for (var i = 0; i < sel.rangeCount; ++i) container.appendChild(sel.getRangeAt(i).cloneContents());
287
+ var post_wrap = jQuery(getRangeAt_0.startContainer).parents('[data-postid]');
288
+ var userid = post_wrap.data('userid');
289
+ if( !userid ) userid = 0;
290
+ var postid = post_wrap.data('postid');
291
+ if( !postid ) postid = 0;
292
+ var mention_html = '';
293
+ var mention = post_wrap.data('mention');
294
+ if( mention ){
295
+ mention_html = '<div class="wpforo-post-quote-author"><strong> '+ wpforo_phrase('Posted by') +': @' + mention +' </strong></div>';
296
+ }else{
297
+ mention = '';
298
+ }
299
+ var editorContent = '<blockquote data-userid="'+ userid +'" data-postid="'+ postid +'" data-mention="'+ mention +'">'+ mention_html +'<p>' + container.innerHTML + '</p></blockquote><p></p>';
300
+ wpforo_editor.insert_content( editorContent, wpforo_editor.get_main() );
301
+ jQuery('html, body').animate({ scrollTop: jQuery("form.wpforo-main-form").offset().top }, 500);
302
+ jQuery(this).remove();
303
+ });
304
+ toolTip.append(link);
305
+ jQuery('body').append(toolTip);
306
+ }
307
+ }
308
+
309
+ }
310
+ }
311
}
312
313
jQuery(document).ready(function($){
314
var wpforo_wrap = $('#wpforo-wrap');
315
316
+ if ($('form.wpforo-main-form').length) {
317
+ document.onselectionchange = function () {
318
+ wpforo_getTextSelection();
319
+ };
320
+ }
321
+
322
+ window.onbeforeunload = function(e) {
323
+ var forms = $('form[data-textareaid]');
324
+ if( forms.length ){
325
+ var i, textareaid, textarea_stat;
326
+ for( i = 0; i < forms.length; i++ ){
327
+ textareaid = $( forms[i] ).data('textareaid');
328
+ textarea_stat = wpforo_editor.get_stats(textareaid);
329
+ if( textarea_stat.chars || textarea_stat.imgs || textarea_stat.links || textarea_stat.embeds ){
330
+ e = e || window.event;
331
+ e.returnValue = wpforo_phrase("Write something clever here..");
332
+ return wpforo_phrase("Write something clever here..");
333
+ }
334
+ }
335
+ }
336
+ };
337
+
338
+ setTimeout(function () {
339
+ wpforo_editor.fix_textareaid();
340
+ wpforo_editor.set_main('', true);
341
+ }, 1000);
342
+
343
+ wpforo_wrap.on('click drop', 'form[data-textareaid]', function () {
344
+ var textareaid = $(this).data('textareaid');
345
+ wpforo_editor.set_active(textareaid);
346
+ });
347
+
348
+ wpforo_wrap.on('focus', 'form[data-textareaid] textarea', function () {
349
+ var textareaid = $(this).parents('form[data-textareaid]').data('textareaid');
350
+ if( textareaid === this.id ) wpforo_editor.set_active(this.id);
351
+ });
352
+
353
+ wpforo_wrap.on('keydown', 'form[data-textareaid]', function (e) {
354
+ if (e.ctrlKey && e.keyCode === 13) {
355
+ $('[type=submit]', $(this)).click();
356
+ }
357
+ });
358
+
359
/**
360
* prevent multi submitting
361
* disable form elements for 10 seconds
362
*/
363
var wpforo_prev_submit_time = 0;
364
+ wpforo_wrap.on('submit', 'form', function () {
365
if( wpforo_prev_submit_time ){
366
if( Date.now() - wpforo_prev_submit_time < 10000 ) return false;
367
}else{
368
+ var textareaid = $(this).data('textareaid');
369
+ if( textareaid ){
370
+ var bodyminlength = $(this).data('bodyminlength');
371
+ var bodymaxlength = $(this).data('bodymaxlength');
372
+ if( bodyminlength || bodymaxlength ){
373
+ var body_stat = wpforo_editor.get_stats(textareaid);
374
+ if( bodyminlength ){
375
+ if( body_stat.chars < bodyminlength && !body_stat.embeds && !body_stat.links && !body_stat.imgs ){
376
+ wpforo_notice_show('Content characters length must be greater than %d', 'error', bodyminlength);
377
+ return false;
378
+ }
379
+ }
380
+ if( bodymaxlength ){
381
+ if( body_stat.chars > bodymaxlength ){
382
+ wpforo_notice_show('Content characters length must be smaller than %d', 'error', bodymaxlength);
383
+ return false;
384
+ }
385
+ }
386
+ }
387
+ }
388
+
389
$("#wpf-msg-box").hide(); $('#wpforo-load').visible();
390
wpforo_prev_submit_time = Date.now();
391
+ window.onbeforeunload = null;
392
setTimeout(function () {
393
wpforo_prev_submit_time = 0;
394
$('#wpforo-load').invisible();
396
}
397
});
398
399
+ wpforo_wrap.on('click', '.wpf-spoiler-head', function(){
400
+ var spoiler_wrap = $(this).parents('.wpf-spoiler-wrap');
401
+ if( spoiler_wrap.length ){
402
+ spoiler_wrap = $(spoiler_wrap[0]);
403
+ if( !spoiler_wrap.hasClass('wpf-spoiler-processing') ){
404
+ spoiler_wrap.toggleClass("wpf-spoiler-open").addClass("wpf-spoiler-processing");
405
+ var spoiler_body = $('.wpf-spoiler-body', spoiler_wrap);
406
+ if( spoiler_body.length ){
407
+ var spoiler_chevron = $('.wpf-spoiler-chevron', spoiler_wrap);
408
+ $(spoiler_chevron[0]).toggleClass('fa-chevron-down fa-chevron-up');
409
+ $(spoiler_body[0]).slideToggle(500, function () {
410
+ spoiler_wrap.removeClass("wpf-spoiler-processing");
411
+ if( !spoiler_wrap.hasClass('wpf-spoiler-open') ){
412
+ $('.wpf-spoiler-wrap.wpf-spoiler-open .wpf-spoiler-head', spoiler_wrap).click();
413
+ }
414
+ });
415
+ }
416
+ }
417
+ }
418
+ });
419
+
420
var _m = $("#m_");
421
if( _m !== undefined && _m.length ){
422
$('html, body').scrollTop(_m.offset().top - 25);
423
}
424
425
+ wpforo_wrap.on('click', '#add_wpftopic:not(.not_reg_user)', function(){
426
var stat = $( ".wpf-topic-create" ).is( ":hidden" );
427
$( ".wpf-topic-create" ).slideToggle( "slow" );
428
+ $('#wpf_title').focus();
429
+ wpforo_editor.set_content('');
430
var add_wpftopic = '<i class="fas fa-times" aria-hidden="true"></i>';
431
if( !stat ) add_wpftopic = $("#wpf_formbutton").val();
432
$( "#add_wpftopic" ).html(add_wpftopic);
433
$('html, body').animate({ scrollTop: ($("#add_wpftopic").offset().top - 35) }, 415);
434
});
435
436
+ wpforo_wrap.on('click', '.wpf-answer-button .wpf-button:not(.not_reg_user)', function(){
437
$(this).closest('.wpf-bottom-bar').hide();
438
});
439
440
+ wpforo_wrap.on('click', '.wpfl-4 .add_wpftopic:not(.not_reg_user)', function(){
441
var wrap = $(this).parents('div.wpfl-4');
442
+ var form_wrap = $( ".wpf-topic-form-extra-wrap", wrap );
443
var stat = form_wrap.is( ":hidden" );
444
+ $(".wpfl-4 .add_wpftopic").html($(".wpfl-4 .add_wpftopic").data('phrase'));
445
+ $(".wpf-topic-form-extra-wrap").slideUp("slow");
446
+ var add_wpftopic = '';
447
+ if( stat ){
448
+ add_wpftopic = '<i class="fas fa-times" aria-hidden="true"></i>';
449
+ form_wrap.slideDown("slow");
450
+ }else{
451
+ add_wpftopic = $(this).data('phrase');
452
+ form_wrap.slideUp("slow");
453
+ }
454
+ var option_no_selected = $( 'option.wpf-topic-form-no-selected-forum' );
455
+ option_no_selected.show();
456
+ option_no_selected.prop('selected', true);
457
+ $( '.wpf-topic-form-ajax-wrap').empty();
458
$( this ).html(add_wpftopic);
459
$('html, body').animate({ scrollTop: (wrap.offset().top -30 ) }, 415);
460
});
461
+
462
+ wpforo_wrap.on('click', '.not_reg_user', function(){
463
$("#wpf-msg-box").hide();
464
$('#wpforo-load').visible();
465
$('#wpf-msg-box').show(150).delay(1000);
466
$('#wpforo-load').invisible();
467
});
468
469
+ $(document).on('click', '#wpf-msg-box', function(){
470
$(this).hide();
471
});
472
473
/* Home page loyouts toipcs toglle */
474
+ wpforo_wrap.on('click', ".topictoggle", function(){
475
var wpfload = $('#wpforo-load');
476
wpfload.visible();
477
497
});
498
499
/* Home page loyouts toipcs toglle */
500
+ wpforo_wrap.on('click', ".wpforo-membertoggle", function(){
501
var id = $(this).attr( 'id' );
502
id = id.replace( "wpforo-memberinfo-toggle-", "" );
503
$( "#wpforo-memberinfo-" + id ).slideToggle( "slow" );
509
});
510
511
/* Threaded Layout Hide Replies */
512
+ wpforo_wrap.on('click', ".wpf-post-replies-bar", function(){
513
var id = $(this).attr( 'id' );
514
id = id.replace( "wpf-ttgg-", "" );
515
$( "#wpf-post-replies-" + id ).slideToggle( "slow" );
524
525
526
//Reply
527
+ wpforo_wrap.on('click', ".wpforo-reply:not(.wpforo_layout_4)", function(){
528
$("#wpf-msg-box").hide(); $('#wpforo-load').visible();
529
$('#wpf-form-wrapper').show();
530
533
var parentpostid = $(this).attr('id');
534
parentpostid = parentpostid.replace("parentpostid", "");
535
$("#wpf_postparentid").val( parentpostid );
536
$( ".wpf-topic-sbs" ).show();
537
$( "#wpf-topic-sbs" ).prop("disabled", false);
538
545
$( "#wpf_formpostid" ).val( '' );
546
$( "#wpf_formbutton" ).val( wpforo_phrase('Save') );
547
$( "#wpf_title").val( wpforo_phrase('re') + ": " + $("#wpf_title").attr('placeholder').replace( wpforo_phrase('re') + ": ", ""));
548
+
549
+ var mention = $(this).data('mention');
550
+ var content = ( mention ? '<p>@' + mention + '</p><p></p>' : '' );
551
+
552
+ wpforo_editor.set_content( content, wpforo_editor.get_main() );
553
+
554
+ $('html, body').animate({ scrollTop: $("#wpf-form-wrapper").offset().top }, 500);
555
+
556
$('#wpforo-load').invisible();
557
558
});
559
560
//Answer
561
+ wpforo_wrap.on('click', ".wpforo-answer", function(){
562
var phrase = wpforo_phrase('Save') ;
563
if( $(this).data('phrase') !== undefined ) phrase = $(this).data('phrase');
564
567
$('#wpf-form-wrapper').show();
568
569
$("#wpf-reply-form-title").html( wpforo_phrase('Your answer') );
570
+
571
$( "#wpf_formaction" ).attr('name', 'post[action]');
572
$( "#wpf_formbutton" ).attr('name', 'post[save]');
573
$( "#wpf_formtopicid" ).attr('name', 'post[topicid]');
577
$( "#wpf_formpostid" ).val( '' );
578
$( "#wpf_formbutton" ).val( phrase );
579
$( "#wpf_title").val( wpforo_phrase('Answer to') + ": " + $("#wpf_title").attr('placeholder').replace( wpforo_phrase('re') + ": ", "").replace( wpforo_phrase('Answer to') + ": ", ""));
580
+
581
+ var mention = $(this).data('mention');
582
+ var content = ( mention ? '<p>@' + mention + '</p><p></p>' : '' );
583
+
584
+ wpforo_editor.set_content( content, wpforo_editor.get_main() );
585
+
586
+ $('html, body').animate({ scrollTop: $("#wpf-form-wrapper").offset().top }, 500);
587
+
588
$('#wpforo-load').invisible();
589
590
});
591
592
//Comment
593
+ wpforo_wrap.on('click', ".wpforo-childreply", function(){
594
var phrase = wpforo_phrase('Save') ;
595
if( $(this).data('phrase') !== undefined ) phrase = $(this).data('phrase');
596
603
var parentpostid = $(this).attr('id');
604
var postid = parentpostid.replace("parentpostid", "");
605
$("#wpf_postparentid").val( postid );
606
$( ".wpf-topic-sbs" ).show();
607
$( "#wpf-topic-sbs" ).prop("disabled", false);
608
615
$( "#wpf_formpostid" ).val( '' );
616
$( "#wpf_formbutton" ).val( phrase );
617
$( "#wpf_title").val( wpforo_phrase('re') + ": " + $("#wpf_title").attr('placeholder').replace( wpforo_phrase('re') + ": ", "").replace( wpforo_phrase('Answer to') + ": ", "") );
618
+
619
+ var mention = $(this).data('mention');
620
+ var content = ( mention ? '<p>@' + mention + '</p><p></p>' : '' );
621
+
622
+ wpforo_editor.set_content( content, wpforo_editor.get_main() );
623
+
624
+ $('html, body').animate({ scrollTop: $("#wpf-form-wrapper").offset().top }, 800);
625
+
626
$('#wpforo-load').invisible();
627
});
628
629
+ wpforo_wrap.on('click', '.wpforo-qa-comment, .wpforo-reply.wpf-action.wpforo_layout_4', function () {
630
var wrap = $(this).parents('.reply-wrap,.wpforo-qa-item-wrap');
631
var post_wrap = $('.post-wrap', wrap);
632
if( !post_wrap.length ) post_wrap = wrap;
634
if (!parentid) parentid = post_wrap.attr('id').replace('post-', '');
635
if (!parentid) parentid = 0;
636
var form = $('.wpforo-post-form');
637
+ var textareaid = form.data('textareaid');
638
var textarea_wrap = $('.wpf_post_form_textarea_wrap', form);
639
+ var textarea = $('#' + textareaid, textarea_wrap);
640
+ var textareatype = textarea_wrap.data('textareatype');
641
$('.wpf_post_parentid').val(parentid);
642
$('.wpforo-qa-comment,.wpforo-reply.wpf-action.wpforo_layout_4').show();
643
$(this).hide();
644
$('.wpforo-portable-form-wrap', wrap).show();
645
+ if( ! $('.wpforo-post-form', wrap).length ) form.appendTo($('.wpforo-portable-form-wrap', wrap));
646
647
form.show();
648
+ if( textareatype && textareatype === 'rich_editor' ){
649
+ textarea_wrap.html('<textarea id="' + textareaid + '" class="wpf_post_body" name="post[body]"></textarea>');
650
+ wpforo_tinymce_initializeIt( '#' + textareaid );
651
}else{
652
textarea.val('');
653
textarea.focus();
654
}
655
656
+ var mention = $(this).data('mention');
657
+ var content = ( mention ? '<p>@' + mention + '</p><p></p>' : '' );
658
+
659
+ wpforo_editor.set_content( content, textareaid );
660
});
661
662
wpforo_wrap.on('click', '.wpf-button-close-form', function () {
663
$(this).parents('.wpforo-portable-form-wrap').hide();
664
$('.wpforo-post-form').hide();
665
$('.wpforo-qa-comment,.wpforo-reply.wpf-action.wpforo_layout_4').show();
666
+ wpforo_editor.set_content('');
667
});
668
669
//mobile menu responsive toggle
670
+ wpforo_wrap.on('click', "#wpforo-menu .wpf-res-menu", function(){
671
$("#wpforo-menu .wpf-menu").toggle();
672
});
673
var wpfwin = $(window).width();
674
var wpfwrap = wpforo_wrap.width();
675
if( wpfwin >= 602 && wpfwrap < 700 ){
676
+ wpforo_wrap.on('focus', "#wpforo-menu .wpf-search-field", function(){
677
$("#wpforo-menu .wpf-menu li").hide();
678
wpforo_wrap.find("#wpforo-menu .wpf-res-menu").show();
679
$("#wpforo-menu .wpf-search-field").css('transition-duration', '0s');
680
});
681
+ wpforo_wrap.on('blur', "#wpforo-menu .wpf-search-field", function(){
682
wpforo_wrap.find("#wpforo-menu .wpf-res-menu").hide();
683
$("#wpforo-menu .wpf-menu li").show();
684
$("#wpforo-menu .wpf-search-field").css('transition-duration', '0.4s');
686
}
687
688
// password show/hide switcher */
689
+ wpforo_wrap.on('click', '.wpf-show-password', function () {
690
var btn = $(this);
691
var parent = btn.parents('.wpf-field-wrap');
692
var input = $(':input', parent);
693
+ if (input.attr('type') === 'password') {
694
input.attr('type', 'text');
695
btn.removeClass('fa-eye-slash');
696
btn.addClass('fa-eye');
731
}
732
});
733
734
//Facebook Share Buttons
735
+ wpforo_wrap.on('click','.wpf-fb', function(){
736
var item_url = $(this).data('wpfurl');
737
var item_quote = $(this).parents('.post-wrap').find('.wpforo-post-content').text();
738
FB.ui({
739
method: 'share',
740
href: item_url,
741
quote: item_quote,
742
+ hashtag: null
743
}, function (response) {});
744
});
745
//Share Buttons Toggle
746
+ wpforo_wrap.on('mouseover', '.wpf-sb', function(){
747
$(this).find(".wpf-sb-toggle").find("i").addClass("wpfsa");
748
$(this).find(".wpf-sb-buttons").show();
749
+ });
750
+ wpforo_wrap.on('mouseout', '.wpf-sb', function() {
751
$(this).find(".wpf-sb-toggle").find("i").removeClass("wpfsa");
752
$(this).find(".wpf-sb-buttons").hide();
753
});
754
+ wpforo_wrap.on('mouseover', '.wpf-sb-toggle', function(){
755
$(this).next().filter('.wpf-sb-buttons').parent().find("i").addClass("wpfsa");
756
+ });
757
+ wpforo_wrap.on('mouseout', '.wpf-sb-toggle', function(){
758
$(this).next().filter('.wpf-sb-buttons').parent().find("i").removeClass("wpfsa");
759
});
760
761
//Forum Rules
762
+ wpforo_wrap.on('click', "#wpf-open-rules", function(){
763
$(".wpforo-legal-rules").toggle();
764
return false;
765
});
766
+ wpforo_wrap.on('click','#wpflegal-rules-yes', function(){
767
$('#wpflegal_rules').prop('checked', true);
768
$('#wpflegal-rules-not').removeClass('wpflb-active-not');
769
$(this).addClass('wpflb-active-yes');
770
setTimeout(function(){ $(".wpforo-legal-rules").slideToggle( "slow" ); }, 500);
771
});
772
+ wpforo_wrap.on('click','#wpflegal-rules-not', function(){
773
$('#wpflegal_rules').prop('checked', false);
774
$('#wpflegal-rules-yes').removeClass('wpflb-active-yes');
775
$(this).addClass('wpflb-active-not');
776
});
777
778
//Forum Privacy Buttons
779
+ wpforo_wrap.on('click', "#wpf-open-privacy", function(){
780
$(".wpforo-legal-privacy").toggle();
781
return false;
782
});
783
+ wpforo_wrap.on('click','#wpflegal-privacy-yes', function(){
784
$('#wpflegal_privacy').prop('checked', true);
785
$('#wpflegal-privacy-not').removeClass('wpflb-active-not');
786
$(this).addClass('wpflb-active-yes');
787
setTimeout(function(){ $(".wpforo-legal-privacy").slideToggle( "slow" ); }, 500);
788
});
789
+ wpforo_wrap.on('click','#wpflegal-privacy-not', function(){
790
$('#wpflegal_privacy').prop('checked', false);
791
$('#wpflegal-privacy-yes').removeClass('wpflb-active-yes');
792
$(this).addClass('wpflb-active-not');
793
});
794
795
//Facebook Login Button
796
+ wpforo_wrap.on('click', '#wpflegal_fblogin', function() {
797
if( $(this).is(':checked') ){
798
$('.wpforo_fb-button').attr('style','pointer-events:auto; opacity:1;');
799
} else{
801
}
802
});
803
804
+ wpforo_wrap.on('click', '.wpf-load-threads .wpf-forums', function () {
805
$( '.wpf-cat-forums', $(this).parents('div.wpfl-4') ).slideToggle('slow');
806
$('i', $(this)).toggleClass('fa-chevron-down fa-chevron-up');
807
});
wpf-assets/js/tinymce-code.js CHANGED
@@ -11,8 +11,8 @@
11
*/
12
init : function(ed, url) {
13
14
- function showDialog() {
15
- var win = ed.windowManager.open({
16
title: "Source code",
17
body: {
18
type: 'textbox',
@@ -58,7 +58,7 @@
58
onclick: showDialog
59
});
60
61
- },
62
});
63
64
// Register plugin
11
*/
12
init : function(ed, url) {
13
14
+ function showDialog() {
15
+ var win = ed.windowManager.open({
16
title: "Source code",
17
body: {
18
type: 'textbox',
58
onclick: showDialog
59
});
60
61
+ }
62
});
63
64
// Register plugin
wpf-assets/js/tinymce-link.js CHANGED
@@ -399,7 +399,7 @@
399
});
400
401
402
- },
403
});
404
405
// Register plugin
399
});
400
401
402
+ }
403
});
404
405
// Register plugin
wpf-assets/js/tinymce-pre.js CHANGED
@@ -21,7 +21,7 @@
21
});
22
23
ed.addShortcut('ctrl+0','pre','preFormat')
24
- },
25
});
26
27
// Register plugin
21
});
22
23
ed.addShortcut('ctrl+0','pre','preFormat')
24
+ }
25
});
26
27
// Register plugin
wpf-assets/js/tinymce-spoiler.js ADDED
@@ -0,0 +1,41 @@
1
+ (function () {
2
+ tinymce.create('tinymce.plugins.wpforo_spoiler_button', {
3
+ /**
4
+ * Initializes the plugin, this will be executed after the plugin has been created.
5
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
6
+ * of the editor instance to intercept that event.
7
+ *
8
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
9
+ * @param {string} url Absolute URL to where the plugin is located.
10
+ */
11
+ init: function (ed, url) {
12
+
13
+ function showDialog() {
14
+ var data = {text: ed.selection.getContent({format: 'raw'})};
15
+
16
+ ed.windowManager.open({
17
+ title: 'Insert Spoiler',
18
+ data: data,
19
+ body: [{
20
+ name: 'title',
21
+ type: 'textbox',
22
+ label: 'Title'
23
+ }],
24
+ onSubmit: function (e) {
25
+ data = tinymce.extend(data, e.data);
26
+ ed.insertContent('[spoiler' + (data.title ? ' title="' + data.title + '"' : '') + ']' + data.text + '[/spoiler]');
27
+ }
28
+ });
29
+ }
30
+
31
+ ed.addButton('wpf_spoil', {
32
+ icon: 'pluscircle',
33
+ tooltip: 'Spoiler',
34
+ onclick: showDialog
35
+ });
36
+ }
37
+ });
38
+
39
+ // Register plugin
40
+ tinymce.PluginManager.add('wpforo_spoiler_button', tinymce.plugins.wpforo_spoiler_button);
41
+ })();
wpf-includes/class-api.php CHANGED
@@ -539,10 +539,21 @@ class wpForoAPI{
539
$theme = WPF()->tools_antispam['rc_theme'];
540
$site_key = WPF()->tools_antispam['rc_site_key'];
541
wp_register_script( 'wpforo_recaptcha', 'https://www.google.com/recaptcha/api.js?onload=wpForoReCallback&render=explicit' );
542
wp_enqueue_script( 'wpforo_recaptcha' );
543
- wp_localize_script('wpforo_recaptcha', 'wpForoRC',
544
- array( 'wpforo_rc_site_key' => $site_key, 'wpforo_rc_theme' => $theme )
545
- );
546
}
547
548
public function rc_enqueue_async( $tag, $handle, $src ) {
@@ -561,19 +572,7 @@ class wpForoAPI{
561
$site_key = WPF()->tools_antispam['rc_site_key'];
562
if( $site_key ){
563
echo '<div class="wpforo_recaptcha_widget"></div><div class="wpf-cl"></div>';
564
- echo "\r\n<script>
565
- var wpForoReCallback = function () {
566
- var rc_widgets = document.getElementsByClassName('wpforo_recaptcha_widget');
567
- if( rc_widgets.length ){
568
- var i;
569
- for (i = 0; i < rc_widgets.length; i++) {
570
- grecaptcha.render(
571
- rc_widgets[i], { 'sitekey': wpForoRC.wpforo_rc_site_key, 'theme': wpForoRC.wpforo_rc_theme }
572
- );
573
- }
574
- }
575
- };
576
- </script>";
577
}
578
}
579
539
$theme = WPF()->tools_antispam['rc_theme'];
540
$site_key = WPF()->tools_antispam['rc_site_key'];
541
wp_register_script( 'wpforo_recaptcha', 'https://www.google.com/recaptcha/api.js?onload=wpForoReCallback&render=explicit' );
542
+ wp_add_inline_script('wpforo_recaptcha', "var wpForoReCallback = function () {
543
+ if( typeof grecaptcha !== 'undefined'){
544
+ var rc_widgets = document.getElementsByClassName('wpforo_recaptcha_widget');
545
+ if( rc_widgets.length ){
546
+ var i;
547
+ for (i = 0; i < rc_widgets.length; i++) {
548
+ grecaptcha.render(
549
+ rc_widgets[i], { 'sitekey': '". $site_key ."', 'theme': '". $theme ."' }
550
+ );
551
+ }
552
+ }
553
+ }
554
+ }"
555
+ );
556
wp_enqueue_script( 'wpforo_recaptcha' );
557
}
558
559
public function rc_enqueue_async( $tag, $handle, $src ) {
572
$site_key = WPF()->tools_antispam['rc_site_key'];
573
if( $site_key ){
574
echo '<div class="wpforo_recaptcha_widget"></div><div class="wpf-cl"></div>';
575
+ echo "\r\n<script>wpForoReCallback();</script>";
576
}
577
}
578
wpf-includes/class-cache.php CHANGED
@@ -295,12 +295,16 @@ class wpForoCache{
295
$glob = glob( $directory_ns ); if( empty($glob) ) $glob = glob( $directory_ws );
296
foreach( $glob as $item ) {
297
if( strpos($item, 'index.html') !== FALSE || strpos($item, '.htaccess') !== FALSE ) continue;
298
- if( !is_dir($item) && file_exists($item) ) unlink( $item );
299
}
300
}
301
302
public function clean_file( $file ) {
303
- if( !is_dir($file) && file_exists($file) ) unlink( $file );
304
}
305
306
public function exists( $key, $template, $type = '' ){
295
$glob = glob( $directory_ns ); if( empty($glob) ) $glob = glob( $directory_ws );
296
foreach( $glob as $item ) {
297
if( strpos($item, 'index.html') !== FALSE || strpos($item, '.htaccess') !== FALSE ) continue;
298
+ if( !is_dir($item) && file_exists($item) ) {
299
+ @unlink( $item );
300
+ }
301
}
302
}
303
304
public function clean_file( $file ) {
305
+ if( !is_dir($file) && file_exists($file) ) {
306
+ @unlink( $file );
307
+ }
308
}
309
310
public function exists( $key, $template, $type = '' ){
wpf-includes/class-forms.php CHANGED
@@ -608,7 +608,7 @@ class wpForoForm{
608
* @return string field HTML
609
*/
610
public function field_html( $f ){
611
- return stripslashes( $f['html'] );
612
}
613
614
/**
@@ -668,6 +668,12 @@ class wpForoForm{
668
case 'textarea':
669
$f['value'] = wpforo_kses(wpforo_decode($f['value']));
670
break;
671
case 'url':
672
$f['value'] = sprintf('<a href="%s" target="_blank" rel="nofollow">%s</a>', $f['value'], $f['value']);
673
break;
608
* @return string field HTML
609
*/
610
public function field_html( $f ){
611
+ return stripslashes( do_shortcode( $f['html'] ) );
612
}
613
614
/**
668
case 'textarea':
669
$f['value'] = wpforo_kses(wpforo_decode($f['value']));
670
break;
671
+ case 'date':
672
+ $f['value'] = wpforo_date($f['value'], 'date', false);
673
+ break;
674
+ case 'datetime':
675
+ $f['value'] = wpforo_date($f['value'], 'datetime', false);
676
+ break;
677
case 'url':
678
$f['value'] = sprintf('<a href="%s" target="_blank" rel="nofollow">%s</a>', $f['value'], $f['value']);
679
break;
wpf-includes/class-forums.php CHANGED
@@ -386,15 +386,20 @@ class wpForoForum{
386
$last_postid = 0;
387
}
388
389
- WPF()->db->update(
390
- WPF()->tables->forums,
391
- array('last_topicid' => $last_topicid, 'last_postid' => $last_postid, 'last_userid' => $last_userid, 'last_post_date' => $last_post_date),
392
- array('forumid' => $forumid),
393
- array('%d','%d','%d','%s'),
394
- array('%d')
395
- );
396
397
- wpforo_clean_cache('forum');
398
}
399
400
public function rebuild_stats($forumid){
@@ -717,12 +722,28 @@ class wpForoForum{
717
<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>
718
<span class="item-controls">
719
<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>
720
- <span class="menu_add"><a href="<?php echo admin_url( 'admin.php?page=wpforo-forums&action=add&parentid=' . intval($forumid) ) ?>" > <img src="<?php echo WPFORO_URL ?>/wpf-assets/images/icons/plus<?php echo ((!$depth) ? '-dark' : ''); ?>.png" title="<?php if( $depth ) : _e('Add a new Subforum', 'wpforo'); else: _e('Add a new Forum in this Category', 'wpforo'); endif; ?>"/></a></span> &nbsp;|&nbsp;
721
- <span class="menu_edit"><a href="<?php echo admin_url( 'admin.php?page=wpforo-forums&id=' . intval($forumid) . '&action=edit' ) ?>"><img src="<?php echo WPFORO_URL ?>/wpf-assets/images/icons/pencil<?php echo ((!$depth) ? '-dark' : ''); ?>.png" title="<?php _e('edit', 'wpforo') ?>"/></a></span>&nbsp;|&nbsp;
722
<?php if( WPF()->forum->manage() ): ?>
723
- <span class="menu_delete"><a href="<?php echo admin_url( 'admin.php?page=wpforo-forums&id=' . intval($forumid) . '&action=del' ) ?>"><img src="<?php echo WPFORO_URL ?>/wpf-assets/images/icons/trash<?php echo ((!$depth) ? '-dark' : ''); ?>.png" title="<?php _e('delete', 'wpforo') ?>"/></a></span>&nbsp;|&nbsp;
724
<?php endif; ?>
725
- <span class="menu_view"><a href="<?php echo esc_url(wpforo_forum($forumid, 'url')); ?>" > <img src="<?php echo WPFORO_URL ?>/wpf-assets/images/icons/eye<?php echo ((!$depth) ? '-dark' : ''); ?>.png" title="<?php _e('View', 'wpforo') ?>"/> </a> </span>
726
727
</span>
728
</dt>
@@ -968,12 +989,12 @@ class wpForoForum{
968
}
969
}
970
971
- function get_all_relative_ids($forumid, &$relative_ids){
972
$forum = WPF()->db->get_row("SELECT `parentid`, `forumid` FROM `".WPF()->tables->forums."` WHERE `forumid` = ".intval($forumid), ARRAY_A);
973
974
if($forum['parentid']){
975
$relative_ids[] = $forum['forumid'];
976
- $this->get_all_relative_ids($forum['parentid'], $relative_ids);
977
}else{
978
$relative_ids[] = $forum['forumid'];
979
$relative_ids = array_reverse($relative_ids);
386
$last_postid = 0;
387
}
388
389
+ $parent_ids = array();
390
+ $this->get_parents($forumid, $parent_ids);
391
+ $parent_ids = array_unique(array_filter(array_map('wpforo_bigintval', (array) $parent_ids)));