Version Description
Download this release
Release Info
Developer | Tomdever |
Plugin | wpForo Forum |
Version | 1.4.9 |
Comparing to | |
See all releases |
Code changes from version 1.4.8 to 1.4.9
- readme.txt +12 -4
- wpf-admin/dashboard.php +10 -5
- wpf-includes/class-moderation.php +2 -7
- wpf-includes/class-posts.php +2 -2
- wpf-includes/class-topics.php +24 -8
- wpf-includes/functions-template.php +4 -4
- wpf-includes/functions.php +2 -2
- wpf-includes/wpf-actions.php +34 -3
- wpf-includes/wpf-hooks.php +2 -6
- wpf-themes/classic/recent.php +1 -1
- wpforo.php +2 -2
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: 4.9
|
6 |
-
Stable tag: 1.4.
|
7 |
Requires PHP: 5.4 and higher
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -152,10 +152,12 @@ Find wpForo forum plugin addons on [gVectors Team website...](https://gvectors.c
|
|
152 |
|
153 |
== Changelog ==
|
154 |
|
155 |
-
= wpForo Forum 1.4.8 |
|
156 |
|
|
|
157 |
[wpForo v1.4.8 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-8-is-released/)
|
158 |
|
|
|
159 |
* Added: GDPR Compliance / [Doc](https://wpforo.com/docs/root/gdpr/right-to-be-informed/)
|
160 |
* Added: GDPR | Checkbox - Accept Forum Privacy Policy
|
161 |
* Added: GDPR | Checkbox - Accept Website Privacy Policy
|
@@ -171,10 +173,10 @@ Find wpForo forum plugin addons on [gVectors Team website...](https://gvectors.c
|
|
171 |
* Added: Share Buttons
|
172 |
* Added: Share | Post specific share buttons (3 locations)
|
173 |
* Added: Share | General share buttons (2 locations)
|
174 |
-
* Added: Share | Different share button
|
175 |
* Added: BuddyPress Integration
|
176 |
* Added: BuddyPress | Forums Menu
|
177 |
-
* Added: BuddyPress | Profile Tab Forums >
|
178 |
* Added: BuddyPress | Profile Tab Forums > Posted forum replies,
|
179 |
* Added: BuddyPress | Profile Tab Forums > Liked Posts,
|
180 |
* Added: BuddyPress | Profile Tab Forums > Subscriptions,
|
@@ -199,6 +201,12 @@ Find wpForo forum plugin addons on [gVectors Team website...](https://gvectors.c
|
|
199 |
* Fixed Bug: Subforum topic doesn't update parent forums information
|
200 |
* Fixed Bug: Yoast Deprecated function
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
= wpForo Forum 1.4.6 / 1.4.7 | 09.03.2018 =
|
203 |
|
204 |
[wpForo v1.4.7 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-7-is-released/)
|
3 |
Tags: forum, forums, forum plugin, WordPress forum plugin, community, discussion
|
4 |
Requires at least: 4.1
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 1.4.9
|
7 |
Requires PHP: 5.4 and higher
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
152 |
|
153 |
== Changelog ==
|
154 |
|
155 |
+
= wpForo Forum 1.4.8 / 1.4.9 | 04.05.2018 =
|
156 |
|
157 |
+
[wpForo v1.4.9 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-9-is-released/)
|
158 |
[wpForo v1.4.8 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-8-is-released/)
|
159 |
|
160 |
+
* wpForo Forum v1.4.8
|
161 |
* Added: GDPR Compliance / [Doc](https://wpforo.com/docs/root/gdpr/right-to-be-informed/)
|
162 |
* Added: GDPR | Checkbox - Accept Forum Privacy Policy
|
163 |
* Added: GDPR | Checkbox - Accept Website Privacy Policy
|
173 |
* Added: Share Buttons
|
174 |
* Added: Share | Post specific share buttons (3 locations)
|
175 |
* Added: Share | General share buttons (2 locations)
|
176 |
+
* Added: Share | Different share button styles and types
|
177 |
* Added: BuddyPress Integration
|
178 |
* Added: BuddyPress | Forums Menu
|
179 |
+
* Added: BuddyPress | Profile Tab Forums > Created forum topics,
|
180 |
* Added: BuddyPress | Profile Tab Forums > Posted forum replies,
|
181 |
* Added: BuddyPress | Profile Tab Forums > Liked Posts,
|
182 |
* Added: BuddyPress | Profile Tab Forums > Subscriptions,
|
201 |
* Fixed Bug: Subforum topic doesn't update parent forums information
|
202 |
* Fixed Bug: Yoast Deprecated function
|
203 |
|
204 |
+
* wpForo Forum v1.4.9
|
205 |
+
* Fixed Bug: Missing Reset Password URL in Email
|
206 |
+
* Fixed Bug: Unapproved topics for Moderators on Recent Posts page
|
207 |
+
* Fixed Bug: Private topics for guests
|
208 |
+
|
209 |
+
|
210 |
= wpForo Forum 1.4.6 / 1.4.7 | 09.03.2018 =
|
211 |
|
212 |
[wpForo v1.4.7 Release Summary](https://wpforo.com/community/wpforo-announcements/wpforo-1-4-7-is-released/)
|
wpf-admin/dashboard.php
CHANGED
@@ -106,7 +106,8 @@
|
|
106 |
</tr>
|
107 |
<tr class="wpf-dw-tr">
|
108 |
<td class="wpf-dw-td">PHP DateTime Class</td>
|
109 |
-
<td class="wpf-dw-td-value"
|
|
|
110 |
</tr>
|
111 |
<?php do_action('wpforo_dashboard_widget_server') ?>
|
112 |
</table>
|
@@ -192,16 +193,20 @@
|
|
192 |
<div style="width:100%; padding:7px 0px;">
|
193 |
<?php
|
194 |
$reset_cache = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_cache' ), 'wpforo_reset_cache' );
|
195 |
-
|
|
|
196 |
$reset_users_stat_url = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_ustat' ), 'wpforo_reset_users_stat' );
|
197 |
-
|
198 |
-
|
|
|
199 |
?>
|
200 |
<a href="<?php echo esc_url($reset_cache); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Delete All Caches', 'wpforo'); ?></a>
|
201 |
<a href="<?php echo esc_url($reset_forums_stat_url); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Update Forums Statistic', 'wpforo'); ?></a>
|
|
|
202 |
<a href="<?php echo esc_url($reset_users_stat_url); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Update Users Statistic', 'wpforo'); ?></a>
|
203 |
<a href="<?php echo esc_url($reset_phrase_cache); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Delete Phrase Cache', 'wpforo'); ?></a>
|
204 |
-
<a href="<?php echo esc_url($reset_user_cache); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Delete User Cache', 'wpforo'); ?></a
|
|
|
205 |
</div>
|
206 |
</td>
|
207 |
</tr>
|
106 |
</tr>
|
107 |
<tr class="wpf-dw-tr">
|
108 |
<td class="wpf-dw-td">PHP DateTime Class</td>
|
109 |
+
<td class="wpf-dw-td-value" style="line-height: 18px!important;">
|
110 |
+
<?php echo (class_exists('DateTime') && class_exists('DateTimeZone') && method_exists('DateTime', 'setTimestamp')) ? '<span class="wpf-green">' . __('Available', 'wpforo') . '</span>' : '<span class="wpf-red">' . __('The setTimestamp() method of PHP DateTime class is not available. Please make sure you use PHP 5.4 and higher version on your hosting service.', 'wpforo') . '</span> | <a href="http://php.net/manual/en/datetime.settimestamp.php" target="_blank">more info»</a>'; ?> </td>
|
111 |
</tr>
|
112 |
<?php do_action('wpforo_dashboard_widget_server') ?>
|
113 |
</table>
|
193 |
<div style="width:100%; padding:7px 0px;">
|
194 |
<?php
|
195 |
$reset_cache = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_cache' ), 'wpforo_reset_cache' );
|
196 |
+
$reset_forums_stat_url = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_fstat' ), 'wpforo_reset_forums_stat' );
|
197 |
+
$reset_topics_stat_url = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_tstat' ), 'wpforo_reset_topics_stat' );
|
198 |
$reset_users_stat_url = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_ustat' ), 'wpforo_reset_users_stat' );
|
199 |
+
$reset_phrase_cache = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_phrase_cache' ), 'wpforo_reset_phrase_cache' );
|
200 |
+
$reset_user_cache = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=reset_user_cache' ), 'wpforo_reset_user_cache' );
|
201 |
+
$synch_user_profile = wp_nonce_url( admin_url( 'admin.php?page=wpforo-community&action=synch_user_profile' ), 'wpforo_synch_user_profile' );
|
202 |
?>
|
203 |
<a href="<?php echo esc_url($reset_cache); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Delete All Caches', 'wpforo'); ?></a>
|
204 |
<a href="<?php echo esc_url($reset_forums_stat_url); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Update Forums Statistic', 'wpforo'); ?></a>
|
205 |
+
<a href="<?php echo esc_url($reset_topics_stat_url); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Update Topics Statistic', 'wpforo'); ?></a>
|
206 |
<a href="<?php echo esc_url($reset_users_stat_url); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Update Users Statistic', 'wpforo'); ?></a>
|
207 |
<a href="<?php echo esc_url($reset_phrase_cache); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Delete Phrase Cache', 'wpforo'); ?></a>
|
208 |
+
<a href="<?php echo esc_url($reset_user_cache); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Delete User Cache', 'wpforo'); ?></a>
|
209 |
+
<a href="<?php echo esc_url($synch_user_profile); ?>" style="min-width:160px; margin-bottom:10px; text-align:center;" class="button button-secondary"><?php _e('Synch User Profiles', 'wpforo'); ?></a>
|
210 |
</div>
|
211 |
</td>
|
212 |
</tr>
|
wpf-includes/class-moderation.php
CHANGED
@@ -310,17 +310,12 @@ class wpForoModeration
|
|
310 |
$item['status'] = 1;
|
311 |
}
|
312 |
}
|
313 |
-
|
314 |
-
if( !$this->has_approved( WPF()->current_userid ) ){
|
315 |
-
$item['status'] = 1;
|
316 |
-
}
|
317 |
-
}
|
318 |
-
|
319 |
return $item;
|
320 |
}
|
321 |
|
322 |
public function has_approved($user){
|
323 |
-
if(
|
324 |
if( isset($user['ID']) ){
|
325 |
$userid = intval($user['ID']);
|
326 |
}
|
310 |
$item['status'] = 1;
|
311 |
}
|
312 |
}
|
313 |
+
|
|
|
|
|
|
|
|
|
|
|
314 |
return $item;
|
315 |
}
|
316 |
|
317 |
public function has_approved($user){
|
318 |
+
if( !$user ) return false;
|
319 |
if( isset($user['ID']) ){
|
320 |
$userid = intval($user['ID']);
|
321 |
}
|
wpf-includes/class-posts.php
CHANGED
@@ -154,7 +154,7 @@ class wpForoPost{
|
|
154 |
|
155 |
if( !$status ) {
|
156 |
WPF()->topic->rebuild_first_last($topic);
|
157 |
-
WPF()->topic->rebuild_stats($topic
|
158 |
WPF()->forum->rebuild_last_infos($forum['forumid']);
|
159 |
WPF()->forum->rebuild_stats($forum['forumid']);
|
160 |
}
|
@@ -478,7 +478,7 @@ class wpForoPost{
|
|
478 |
elseif( isset(WPF()->current_userid) && WPF()->current_userid ){
|
479 |
$wheres[] = " ( " . $table_as_prefix . "`status` = 0 OR (" . $table_as_prefix . "`status` = 1 AND " . $table_as_prefix . "`userid` = " .intval(WPF()->current_userid). ") )";
|
480 |
}
|
481 |
-
elseif(
|
482 |
$wheres[] = " ( " . $table_as_prefix . "`status` = 0 OR (" . $table_as_prefix . "`status` = 1 AND " . $table_as_prefix . "`email` = '" . sanitize_email($guest['email']) . "') )";
|
483 |
}
|
484 |
else{
|
154 |
|
155 |
if( !$status ) {
|
156 |
WPF()->topic->rebuild_first_last($topic);
|
157 |
+
WPF()->topic->rebuild_stats($topic);
|
158 |
WPF()->forum->rebuild_last_infos($forum['forumid']);
|
159 |
WPF()->forum->rebuild_stats($forum['forumid']);
|
160 |
}
|
478 |
elseif( isset(WPF()->current_userid) && WPF()->current_userid ){
|
479 |
$wheres[] = " ( " . $table_as_prefix . "`status` = 0 OR (" . $table_as_prefix . "`status` = 1 AND " . $table_as_prefix . "`userid` = " .intval(WPF()->current_userid). ") )";
|
480 |
}
|
481 |
+
elseif( wpfval($guest, 'email') ){
|
482 |
$wheres[] = " ( " . $table_as_prefix . "`status` = 0 OR (" . $table_as_prefix . "`status` = 1 AND " . $table_as_prefix . "`email` = '" . sanitize_email($guest['email']) . "') )";
|
483 |
}
|
484 |
else{
|
wpf-includes/class-topics.php
CHANGED
@@ -602,7 +602,7 @@ class wpForoTopic{
|
|
602 |
'permgroup' => NULL, //Тreat permissions based on attribute value not on current user usergroup
|
603 |
'where' => NULL,
|
604 |
);
|
605 |
-
|
606 |
$args = wpforo_parse_args( $args, $default );
|
607 |
|
608 |
if(is_array($args) && !empty($args)){
|
@@ -642,7 +642,7 @@ class wpForoTopic{
|
|
642 |
elseif( isset(WPF()->current_userid) && WPF()->current_userid ){
|
643 |
$wheres[] = " ( `private` = 0 OR (`private` = 1 AND `userid` = " .intval(WPF()->current_userid). ") )";
|
644 |
}
|
645 |
-
elseif(
|
646 |
$wheres[] = " ( `private` = 0 OR (`private` = 1 AND `email` = '" . sanitize_email($guest['email']) . "') )";
|
647 |
}
|
648 |
else{
|
@@ -660,7 +660,7 @@ class wpForoTopic{
|
|
660 |
elseif( isset(WPF()->current_userid) && WPF()->current_userid ){
|
661 |
$wheres[] = " ( `status` = 0 OR (`status` = 1 AND `userid` = " .intval(WPF()->current_userid). ") )";
|
662 |
}
|
663 |
-
elseif(
|
664 |
$wheres[] = " ( `status` = 0 OR (`status` = 1 AND `email` = '" . sanitize_email($guest['email']) . "') )";
|
665 |
}
|
666 |
else{
|
@@ -694,7 +694,7 @@ class wpForoTopic{
|
|
694 |
}
|
695 |
|
696 |
if( $cache ){ $object_key = md5( $sql . WPF()->current_user_groupid ); $object_cache = WPF()->cache->get( $object_key ); if( !empty($object_cache) ){ $items_count = $object_cache['items_count']; return $object_cache['items']; }}
|
697 |
-
|
698 |
$topics = WPF()->db->get_results($sql, ARRAY_A);
|
699 |
$topics = apply_filters('wpforo_get_topics', $topics);
|
700 |
|
@@ -1131,14 +1131,30 @@ class wpForoTopic{
|
|
1131 |
}
|
1132 |
}
|
1133 |
|
1134 |
-
public function rebuild_stats($topic
|
1135 |
if(!$topic) return false;
|
1136 |
if(is_numeric($topic)) $topic = $this->get_topic($topic);
|
1137 |
if( !is_array($topic) || !$topic ) return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
1138 |
$layout = WPF()->forum->get_layout($topic['forumid']);
|
1139 |
-
if($layout == 3
|
1140 |
-
|
1141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1142 |
wpforo_clean_cache('topic', $topic['topicid'], $topic);
|
1143 |
return true;
|
1144 |
}
|
602 |
'permgroup' => NULL, //Тreat permissions based on attribute value not on current user usergroup
|
603 |
'where' => NULL,
|
604 |
);
|
605 |
+
|
606 |
$args = wpforo_parse_args( $args, $default );
|
607 |
|
608 |
if(is_array($args) && !empty($args)){
|
642 |
elseif( isset(WPF()->current_userid) && WPF()->current_userid ){
|
643 |
$wheres[] = " ( `private` = 0 OR (`private` = 1 AND `userid` = " .intval(WPF()->current_userid). ") )";
|
644 |
}
|
645 |
+
elseif( wpfval($guest, 'email') ){
|
646 |
$wheres[] = " ( `private` = 0 OR (`private` = 1 AND `email` = '" . sanitize_email($guest['email']) . "') )";
|
647 |
}
|
648 |
else{
|
660 |
elseif( isset(WPF()->current_userid) && WPF()->current_userid ){
|
661 |
$wheres[] = " ( `status` = 0 OR (`status` = 1 AND `userid` = " .intval(WPF()->current_userid). ") )";
|
662 |
}
|
663 |
+
elseif( wpfval($guest, 'email') ){
|
664 |
$wheres[] = " ( `status` = 0 OR (`status` = 1 AND `email` = '" . sanitize_email($guest['email']) . "') )";
|
665 |
}
|
666 |
else{
|
694 |
}
|
695 |
|
696 |
if( $cache ){ $object_key = md5( $sql . WPF()->current_user_groupid ); $object_cache = WPF()->cache->get( $object_key ); if( !empty($object_cache) ){ $items_count = $object_cache['items_count']; return $object_cache['items']; }}
|
697 |
+
|
698 |
$topics = WPF()->db->get_results($sql, ARRAY_A);
|
699 |
$topics = apply_filters('wpforo_get_topics', $topics);
|
700 |
|
1131 |
}
|
1132 |
}
|
1133 |
|
1134 |
+
public function rebuild_stats($topic){
|
1135 |
if(!$topic) return false;
|
1136 |
if(is_numeric($topic)) $topic = $this->get_topic($topic);
|
1137 |
if( !is_array($topic) || !$topic ) return false;
|
1138 |
+
|
1139 |
+
$posts = WPF()->post->get_count( array('topicid' => $topic['topicid'], 'status' => 0) );
|
1140 |
+
|
1141 |
+
$data = array('posts' => $posts);
|
1142 |
+
$data_format = array('%d');
|
1143 |
+
|
1144 |
$layout = WPF()->forum->get_layout($topic['forumid']);
|
1145 |
+
if($layout == 3){
|
1146 |
+
$data['answers'] = WPF()->post->get_count( array('topicid' => $topic['topicid'], 'status' => 0, 'parentid' => 0, 'is_first_post' => 0) );
|
1147 |
+
$data_format[] = '%d';
|
1148 |
+
$data['posts'] = $posts - 1;
|
1149 |
+
}
|
1150 |
+
|
1151 |
+
if( false !== WPF()->db->update(
|
1152 |
+
WPF()->tables->topics,
|
1153 |
+
$data,
|
1154 |
+
array('topicid' => $topic['topicid']),
|
1155 |
+
$data_format,
|
1156 |
+
array('%d')
|
1157 |
+
) ) {
|
1158 |
wpforo_clean_cache('topic', $topic['topicid'], $topic);
|
1159 |
return true;
|
1160 |
}
|
wpf-includes/functions-template.php
CHANGED
@@ -414,8 +414,8 @@ class wpForo_Widget_recent_topics extends WP_Widget {
|
|
414 |
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title'];//This is a HTML content//
|
415 |
}
|
416 |
// widget content from front end
|
417 |
-
$private = (!is_user_logged_in() || !WPF()->perm->usergroup_can('
|
418 |
-
$status = (!is_user_logged_in() || !WPF()->perm->usergroup_can('
|
419 |
$topic_args = array( // forumid, order, parentid
|
420 |
'orderby' => (key_exists($instance['orderby'], $this->orderby_fields) ? $instance['orderby'] : 'created' ),
|
421 |
'order' => (key_exists($instance['order'], $this->order_fields) ? $instance['order'] : 'DESC' ), // ASC DESC
|
@@ -513,8 +513,8 @@ class wpForo_Widget_recent_replies extends WP_Widget {
|
|
513 |
if ( ! empty( $instance['title'] ) ) {
|
514 |
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title'];//This is a HTML content//
|
515 |
}
|
516 |
-
$private = (!is_user_logged_in() || !WPF()->perm->usergroup_can('
|
517 |
-
$status = (!is_user_logged_in() || !WPF()->perm->usergroup_can('
|
518 |
// widget content from front end
|
519 |
$posts_args = array(
|
520 |
'orderby' => 'created',
|
414 |
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title'];//This is a HTML content//
|
415 |
}
|
416 |
// widget content from front end
|
417 |
+
$private = (!is_user_logged_in() || !WPF()->perm->usergroup_can('aum')) ? 0 : NULL;
|
418 |
+
$status = (!is_user_logged_in() || !WPF()->perm->usergroup_can('aum')) ? 0 : NULL;
|
419 |
$topic_args = array( // forumid, order, parentid
|
420 |
'orderby' => (key_exists($instance['orderby'], $this->orderby_fields) ? $instance['orderby'] : 'created' ),
|
421 |
'order' => (key_exists($instance['order'], $this->order_fields) ? $instance['order'] : 'DESC' ), // ASC DESC
|
513 |
if ( ! empty( $instance['title'] ) ) {
|
514 |
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title'];//This is a HTML content//
|
515 |
}
|
516 |
+
$private = (!is_user_logged_in() || !WPF()->perm->usergroup_can('aum')) ? 0 : NULL;
|
517 |
+
$status = (!is_user_logged_in() || !WPF()->perm->usergroup_can('aum')) ? 0 : NULL;
|
518 |
// widget content from front end
|
519 |
$posts_args = array(
|
520 |
'orderby' => 'created',
|
wpf-includes/functions.php
CHANGED
@@ -1691,7 +1691,7 @@ function wpforo_is_owner( $userid, $email = '' ){
|
|
1691 |
}
|
1692 |
elseif( !is_user_logged_in() && $email ){
|
1693 |
$guest = WPF()->member->get_guest_cookies();
|
1694 |
-
if(
|
1695 |
return true;
|
1696 |
}
|
1697 |
return false;
|
@@ -1898,7 +1898,7 @@ function wpforo_is_session_started(){
|
|
1898 |
|
1899 |
function wpforo_current_guest( $email ){
|
1900 |
$guest = WPF()->member->get_guest_cookies();
|
1901 |
-
if(!
|
1902 |
if( $email == $guest['email']){
|
1903 |
return true;
|
1904 |
}else{
|
1691 |
}
|
1692 |
elseif( !is_user_logged_in() && $email ){
|
1693 |
$guest = WPF()->member->get_guest_cookies();
|
1694 |
+
if( wpfval($guest, 'email') && $guest['email'] == $email ) {
|
1695 |
return true;
|
1696 |
}
|
1697 |
return false;
|
1898 |
|
1899 |
function wpforo_current_guest( $email ){
|
1900 |
$guest = WPF()->member->get_guest_cookies();
|
1901 |
+
if(!wpfval($guest, 'email') || !$guest['email']) return false;
|
1902 |
if( $email == $guest['email']){
|
1903 |
return true;
|
1904 |
}else{
|
wpf-includes/wpf-actions.php
CHANGED
@@ -258,11 +258,28 @@ function wpforo_actions(){
|
|
258 |
wp_redirect(admin_url());
|
259 |
exit();
|
260 |
}
|
261 |
-
|
262 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
wp_redirect(admin_url('admin.php?page=wpforo-community'));
|
264 |
exit();
|
265 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
if( $_GET['action'] == 'wpfdb' ){
|
267 |
if( function_exists('set_time_limit') ) set_time_limit( 3600 ); wpforo_update_db();
|
268 |
wp_redirect(admin_url('admin.php?page=wpforo-community'));
|
@@ -273,12 +290,24 @@ function wpforo_actions(){
|
|
273 |
if(!empty($forumids)){
|
274 |
foreach($forumids as $forumid){
|
275 |
WPF()->forum->rebuild_stats($forumid);
|
276 |
-
WPF()->db->query("DELETE FROM `" . WPF()->db->options."` WHERE `option_name` LIKE 'wpforo_stat%'" );
|
277 |
}
|
|
|
278 |
WPF()->forum->delete_tree_cache();
|
279 |
WPF()->notice->add('Updated Successfully!', 'success');
|
280 |
}
|
281 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
if( $_GET['action'] == 'reset_ustat' && check_admin_referer( 'wpforo_reset_users_stat' ) ){
|
283 |
$users = WPF()->db->get_results("SELECT `userid` FROM ".WPF()->tables->profiles." ORDER BY `posts` DESC", ARRAY_A);
|
284 |
if(!empty($users)){
|
@@ -311,6 +340,8 @@ function wpforo_actions(){
|
|
311 |
WPF()->db->query("DELETE FROM `".WPF()->tables->views."` WHERE `created` < " . intval($month_ago) );
|
312 |
WPF()->notice->add('Deleted Successfully!', 'success');
|
313 |
}
|
|
|
|
|
314 |
}
|
315 |
|
316 |
if( wpforo_is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpforo-settings' ){
|
258 |
wp_redirect(admin_url());
|
259 |
exit();
|
260 |
}
|
261 |
+
|
262 |
+
// -- START -- set unlimited time limits
|
263 |
+
set_time_limit(0);
|
264 |
+
ini_set('max_execution_time', 0);
|
265 |
+
ini_set('memory_limit', '-1');
|
266 |
+
// -- END -- set unlimited time limits
|
267 |
+
|
268 |
+
if( $_GET['action'] == 'synch' ){
|
269 |
+
if( function_exists('set_time_limit') ) set_time_limit( 3600 );
|
270 |
+
WPF()->member->synchronize_users();
|
271 |
+
WPF()->member->clear_db_cache();
|
272 |
wp_redirect(admin_url('admin.php?page=wpforo-community'));
|
273 |
exit();
|
274 |
}
|
275 |
+
|
276 |
+
if( $_GET['action'] == 'synch_user_profile' && check_admin_referer( 'wpforo_synch_user_profile' ) ){
|
277 |
+
if( function_exists('set_time_limit') ) set_time_limit( 3600 );
|
278 |
+
WPF()->member->synchronize_users();
|
279 |
+
WPF()->member->clear_db_cache();
|
280 |
+
WPF()->notice->add('Synched Successfully!', 'success');
|
281 |
+
}
|
282 |
+
|
283 |
if( $_GET['action'] == 'wpfdb' ){
|
284 |
if( function_exists('set_time_limit') ) set_time_limit( 3600 ); wpforo_update_db();
|
285 |
wp_redirect(admin_url('admin.php?page=wpforo-community'));
|
290 |
if(!empty($forumids)){
|
291 |
foreach($forumids as $forumid){
|
292 |
WPF()->forum->rebuild_stats($forumid);
|
|
|
293 |
}
|
294 |
+
WPF()->db->query("DELETE FROM `" . WPF()->db->options."` WHERE `option_name` LIKE 'wpforo_stat%'" );
|
295 |
WPF()->forum->delete_tree_cache();
|
296 |
WPF()->notice->add('Updated Successfully!', 'success');
|
297 |
}
|
298 |
}
|
299 |
+
if( $_GET['action'] == 'reset_tstat' && check_admin_referer( 'wpforo_reset_topics_stat' ) ){
|
300 |
+
$topicids = WPF()->db->get_col("SELECT `topicid` FROM ".WPF()->tables->topics." ORDER BY `topicid` ASC");
|
301 |
+
if(!empty($topicids)){
|
302 |
+
foreach($topicids as $topicid){
|
303 |
+
$topic = WPF()->topic->get_topic($topicid);
|
304 |
+
WPF()->topic->rebuild_first_last($topic);
|
305 |
+
WPF()->topic->rebuild_stats($topic);
|
306 |
+
}
|
307 |
+
WPF()->db->query("DELETE FROM `" . WPF()->db->options."` WHERE `option_name` LIKE 'wpforo_stat%'" );
|
308 |
+
WPF()->notice->add('Updated Successfully!', 'success');
|
309 |
+
}
|
310 |
+
}
|
311 |
if( $_GET['action'] == 'reset_ustat' && check_admin_referer( 'wpforo_reset_users_stat' ) ){
|
312 |
$users = WPF()->db->get_results("SELECT `userid` FROM ".WPF()->tables->profiles." ORDER BY `posts` DESC", ARRAY_A);
|
313 |
if(!empty($users)){
|
340 |
WPF()->db->query("DELETE FROM `".WPF()->tables->views."` WHERE `created` < " . intval($month_ago) );
|
341 |
WPF()->notice->add('Deleted Successfully!', 'success');
|
342 |
}
|
343 |
+
wp_redirect(admin_url('admin.php?page=wpforo-community'));
|
344 |
+
exit();
|
345 |
}
|
346 |
|
347 |
if( wpforo_is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpforo-settings' ){
|
wpf-includes/wpf-hooks.php
CHANGED
@@ -1539,8 +1539,6 @@ function wpforo_forum_subscribers_mail_sender( $topic ){
|
|
1539 |
}
|
1540 |
add_action( 'wpforo_after_add_topic', 'wpforo_forum_subscribers_mail_sender', 12);
|
1541 |
|
1542 |
-
|
1543 |
-
|
1544 |
function wpforo_topic_subscribers_mail_sender( $post ){
|
1545 |
|
1546 |
if( defined('IS_GO2WPFORO') && IS_GO2WPFORO ) return;
|
@@ -1634,7 +1632,6 @@ function wpforo_topic_subscribers_mail_sender( $post ){
|
|
1634 |
}
|
1635 |
add_action( 'wpforo_after_add_post', 'wpforo_topic_subscribers_mail_sender', 13, 1 );
|
1636 |
|
1637 |
-
|
1638 |
function wpforo_add_default_attachment($args){
|
1639 |
if( !empty($_FILES['attachfile']) && !empty($_FILES['attachfile']['name']) ){
|
1640 |
if( WPF()->perm->can_attach() ){
|
@@ -2048,14 +2045,13 @@ add_action( 'login_form_resetpass', 'wpforo_do_password_reset' );
|
|
2048 |
|
2049 |
function wpforo_replace_retrieve_password_message( $message, $key, $user_login, $user_data ) {
|
2050 |
if( wpforo_feature('resetpass-url') ){
|
2051 |
-
$reset_password_url = wpforo_home_url( '?wpforo=resetpassword&rp_key='.esc_attr( $key ).'&rp_login='.
|
2052 |
if( empty(WPF()->sbscrb->options['reset_password_email_message']) ){
|
2053 |
$message = preg_replace('#<?http[^\r\n\t\s]+wp-login\.php[^\r\n\t\s]+#isu', "<$reset_password_url>", $message);
|
2054 |
}else{
|
2055 |
-
$message = str_replace(array('[user_login]', '[reset_password_url]'), array($user_login, "<$reset_password_url>"), WPF()->sbscrb->options['reset_password_email_message']);
|
2056 |
}
|
2057 |
}
|
2058 |
-
add_filter( 'wp_mail_content_type', 'wpforo_set_html_content_type' );
|
2059 |
return $message;
|
2060 |
}
|
2061 |
add_filter( 'retrieve_password_message', 'wpforo_replace_retrieve_password_message', 10, 4 );
|
1539 |
}
|
1540 |
add_action( 'wpforo_after_add_topic', 'wpforo_forum_subscribers_mail_sender', 12);
|
1541 |
|
|
|
|
|
1542 |
function wpforo_topic_subscribers_mail_sender( $post ){
|
1543 |
|
1544 |
if( defined('IS_GO2WPFORO') && IS_GO2WPFORO ) return;
|
1632 |
}
|
1633 |
add_action( 'wpforo_after_add_post', 'wpforo_topic_subscribers_mail_sender', 13, 1 );
|
1634 |
|
|
|
1635 |
function wpforo_add_default_attachment($args){
|
1636 |
if( !empty($_FILES['attachfile']) && !empty($_FILES['attachfile']['name']) ){
|
1637 |
if( WPF()->perm->can_attach() ){
|
2045 |
|
2046 |
function wpforo_replace_retrieve_password_message( $message, $key, $user_login, $user_data ) {
|
2047 |
if( wpforo_feature('resetpass-url') ){
|
2048 |
+
$reset_password_url = wpforo_home_url( '?wpforo=resetpassword&rp_key='.esc_attr( $key ).'&rp_login='.rawurlencode( $user_login ) );
|
2049 |
if( empty(WPF()->sbscrb->options['reset_password_email_message']) ){
|
2050 |
$message = preg_replace('#<?http[^\r\n\t\s]+wp-login\.php[^\r\n\t\s]+#isu', "<$reset_password_url>", $message);
|
2051 |
}else{
|
2052 |
+
$message = str_replace(array('[user_login]', '[reset_password_url]'), array($user_login, "<$reset_password_url>"), strip_tags(WPF()->sbscrb->options['reset_password_email_message']));
|
2053 |
}
|
2054 |
}
|
|
|
2055 |
return $message;
|
2056 |
}
|
2057 |
add_filter( 'retrieve_password_message', 'wpforo_replace_retrieve_password_message', 10, 4 );
|
wpf-themes/classic/recent.php
CHANGED
@@ -8,7 +8,7 @@ if(!empty($_GET['wpfpaged'])) $paged = intval($_GET['wpfpaged']);
|
|
8 |
if(!empty($_GET['wpff'])) $args['forumid'] = intval($_GET['wpff']);
|
9 |
|
10 |
$type = WPF()->post->options['recent_posts_type'];
|
11 |
-
if(!is_user_logged_in() || !WPF()->perm->usergroup_can('
|
12 |
|
13 |
if( $type == 'topics' ){
|
14 |
$end_date = time() - (14 * 24 * 60 * 60);
|
8 |
if(!empty($_GET['wpff'])) $args['forumid'] = intval($_GET['wpff']);
|
9 |
|
10 |
$type = WPF()->post->options['recent_posts_type'];
|
11 |
+
if(!is_user_logged_in() || !WPF()->perm->usergroup_can('aum')){ $args['private'] = 0; $args['status'] = 0; }
|
12 |
|
13 |
if( $type == 'topics' ){
|
14 |
$end_date = time() - (14 * 24 * 60 * 60);
|
wpforo.php
CHANGED
@@ -5,14 +5,14 @@
|
|
5 |
* Description: WordPress Forum plugin. wpForo is a full-fledged forum solution for your community. Comes with multiple modern forum layouts.
|
6 |
* Author: gVectors Team (A. Chakhoyan, R. Hovhannisyan)
|
7 |
* Author URI: https://gvectors.com/
|
8 |
-
* Version: 1.4.
|
9 |
* Text Domain: wpforo
|
10 |
* Domain Path: /wpf-languages
|
11 |
*/
|
12 |
|
13 |
//Exit if accessed directly
|
14 |
if( !defined( 'ABSPATH' ) ) exit;
|
15 |
-
if( !defined( 'WPFORO_VERSION' ) ) define('WPFORO_VERSION', '1.4.
|
16 |
|
17 |
function wpforo_load_plugin_textdomain() { load_plugin_textdomain( 'wpforo', FALSE, basename( dirname( __FILE__ ) ) . '/wpf-languages/' ); }
|
18 |
add_action( 'plugins_loaded', 'wpforo_load_plugin_textdomain' );
|
5 |
* Description: WordPress Forum plugin. wpForo is a full-fledged forum solution for your community. Comes with multiple modern forum layouts.
|
6 |
* Author: gVectors Team (A. Chakhoyan, R. Hovhannisyan)
|
7 |
* Author URI: https://gvectors.com/
|
8 |
+
* Version: 1.4.9
|
9 |
* Text Domain: wpforo
|
10 |
* Domain Path: /wpf-languages
|
11 |
*/
|
12 |
|
13 |
//Exit if accessed directly
|
14 |
if( !defined( 'ABSPATH' ) ) exit;
|
15 |
+
if( !defined( 'WPFORO_VERSION' ) ) define('WPFORO_VERSION', '1.4.9');
|
16 |
|
17 |
function wpforo_load_plugin_textdomain() { load_plugin_textdomain( 'wpforo', FALSE, basename( dirname( __FILE__ ) ) . '/wpf-languages/' ); }
|
18 |
add_action( 'plugins_loaded', 'wpforo_load_plugin_textdomain' );
|