PluginProbe
wpForo Forum / beta-4
wpForo Forum vbeta-4
3.1.7 3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 139 releases
← All changes | wpforo.php +104 -195 1.3.1beta-4 View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2 /*
3 -* Plugin Name: Forums - wpForo
4 -* Plugin URI: https://wpforo.com
5 -* Description: Forums wpForo is a new generation of forum plugins. It's full-fledged forum solution for your community. Comes with multiple modern forum layouts.
3 +* Plugin Name: Forum - wpForo
4 +* Plugin URI: http://wpforo.com
5 +* Description: Next Generation of WordPress Forum Softwares. Everything you need to run an efficient and professional community. Powerful and beautiful bulletin board with unique features.
6 6 * Author: gVectors Team (A. Chakhoyan, R. Hovhannisyan)
7 -* Author URI: https://gvectors.com/
8 -* Version: 1.3.1
7 +* Author URI: http://gvectors.com/
8 +* Version: beta-4
9 9 * Text Domain: wpforo
10 10 * Domain Path: /wpf-languages
11 11 */
12 12
@@ -11,20 +11,21 @@
11 11 */
12 12
13 13 // Exit if accessed directly
14 14 if( !defined( 'ABSPATH' ) ) exit;
15 -if( !defined( 'WPFORO_VERSION' ) ) define('WPFORO_VERSION', '1.3.1');
16 15
17 -function wpforo_load_plugin_textdomain() { load_plugin_textdomain( 'wpforo', FALSE, basename( dirname( __FILE__ ) ) . '/wpf-languages/' ); }
16 +function wpforo_load_plugin_textdomain() {
17 + load_plugin_textdomain( 'wpforo', FALSE, basename( dirname( __FILE__ ) ) . '/wpf-languages/' );
18 +}
18 19 add_action( 'plugins_loaded', 'wpforo_load_plugin_textdomain' );
19 20
20 21 if( !class_exists( 'wpForo' ) ) {
21 22
22 - define('WPFORO_DIR', rtrim( plugin_dir_path( __FILE__ ), '/' ));
23 - define('WPFORO_URL', rtrim( plugins_url( '', __FILE__ ), '/' ));
23 + define('WPFORO_DIR', rtrim( plugin_dir_path( __FILE__ ), '/'));
24 + define('WPFORO_URL', rtrim( plugins_url( plugin_basename(dirname(__FILE__))), '/'));
24 25 define('WPFORO_FOLDER', rtrim( plugin_basename(dirname(__FILE__)), '/'));
25 26 define('WPFORO_BASENAME', plugin_basename(__FILE__)); //wpforo/wpforo.php
26 -
27 +
27 28 define('WPFORO_THEME_DIR', WPFORO_DIR . '/wpf-themes' );
28 29 define('WPFORO_THEME_URL', WPFORO_URL . '/wpf-themes' );
29 30
30 31 include( WPFORO_DIR . '/wpf-includes/wpf-hooks.php' );
@@ -29,14 +30,13 @@
29 30
30 31 include( WPFORO_DIR . '/wpf-includes/wpf-hooks.php' );
31 32 include( WPFORO_DIR . '/wpf-includes/wpf-actions.php');
32 33 include( WPFORO_DIR . '/wpf-includes/functions.php' );
33 - if(wpforo_is_admin()) {
34 + if(is_admin()) {
34 35 include( WPFORO_DIR . '/wpf-includes/functions-installation.php' );
35 36 }
36 37 include( WPFORO_DIR . '/wpf-includes/functions-integration.php' );
37 38 include( WPFORO_DIR . '/wpf-includes/functions-template.php' );
38 - include( WPFORO_DIR . '/wpf-includes/class-cache.php' );
39 39 include( WPFORO_DIR . '/wpf-includes/class-forums.php' );
40 40 include( WPFORO_DIR . '/wpf-includes/class-topics.php' );
41 41 include( WPFORO_DIR . '/wpf-includes/class-posts.php' );
42 42 include( WPFORO_DIR . '/wpf-includes/class-usergroups.php' );
@@ -46,35 +46,30 @@
46 46 include( WPFORO_DIR . '/wpf-includes/class-subscribes.php' );
47 47 include( WPFORO_DIR . '/wpf-includes/class-template.php' );
48 48 include( WPFORO_DIR . '/wpf-includes/class-notices.php' );
49 49 include( WPFORO_DIR . '/wpf-includes/class-feed.php' );
50 - include( WPFORO_DIR . '/wpf-includes/class-moderation.php' );
51 -
50 +
52 51 class wpForo{
53 52
53 + public $version = 'Beta-4';
54 54 public $options = array();
55 55 public $db;
56 56 public $phrases;
57 - public $access;
58 - public $usergroup;
59 57 public $theme;
60 - public $addons = array();
61 58 public $current_object;
62 59 public $menu = array();
63 60
64 61 public function __construct(){
65 62 $this->options();
66 - $this->setup();
67 - }
63 + $this->setup();
64 + }
68 65
69 66 public function init(){
70 - $this->cache->init();
71 67 $this->member->init_current_user();
72 68 $this->init_current_object();
73 - $this->moderation->init();
74 69 $this->tpl->init_member_templates();
75 70 $this->tpl->init_nav_menu();
76 - add_action( 'wp_loaded', 'wpforo_actions');
71 + wpforo_actions();
77 72 }
78 73
79 74 private function options(){
80 75 global $wpdb;
@@ -81,42 +76,27 @@
81 76 $this->db = $wpdb;
82 77 $this->file = __FILE__;
83 78 $this->error = NULL;
84 79 $this->basename = plugin_basename( $this->file );
85 -
86 - $permalink_structure = get_option('permalink_structure');
87 80
88 - $this->use_trailing_slashes = ( '/' == substr($permalink_structure, -1, 1) );
89 -
90 81 //OPTIONS
91 - $this->use_home_url = get_wpf_option('wpforo_use_home_url');
92 - $this->excld_urls = get_wpf_option('wpforo_excld_urls');
93 -
94 - $this->permastruct = trim( get_wpf_option('wpforo_permastruct'), '/' );
95 - $this->permastruct = preg_replace('#^/?index\.php/?#isu', '', $this->permastruct);
96 - $this->permastruct = trim($this->permastruct, '/');
97 -
98 - $this->base_permastruct = (!$this->use_home_url ? $this->permastruct : '');
99 - $this->base_permastruct = rtrim( ( strpos($permalink_structure, 'index.php') !== FALSE ? '/index.php/' . $this->base_permastruct : '/' . $this->base_permastruct ), '/\\' );
100 - $this->url = esc_url( home_url( $this->user_trailingslashit($this->base_permastruct) ) );
101 - $this->general_options = get_wpf_option( 'wpforo_general_options');
102 - $this->pageid = get_wpf_option( 'wpforo_pageid');
103 - $this->default_groupid = get_wpf_option('wpforo_default_groupid') ? get_option('wpforo_default_groupid') : 3;
104 - $this->usergroup_cans = get_wpf_option('wpforo_usergroup_cans');
105 - $this->forum_options = get_wpf_option('wpforo_forum_options');
106 - $this->forum_cans = get_wpf_option('wpforo_forum_cans');
107 - $this->post_options = get_wpf_option('wpforo_post_options');
108 - $this->member_options = get_wpf_option('wpforo_member_options');
109 - $this->subscribe_options = get_wpf_option('wpforo_subscribe_options');
110 - $this->countries = get_wpf_option('wpforo_countries');
111 - $this->features = get_wpf_option('wpforo_features');
112 - $this->tools_antispam = get_wpf_option('wpforo_tools_antispam');
113 - $this->tools_cleanup = get_wpf_option('wpforo_tools_cleanup');
114 - $this->style_options = get_wpf_option('wpforo_style_options');
115 - $this->theme_options = get_wpf_option('wpforo_theme_options');
82 + $this->url = trim( get_option('wpforo_url'), '/' ) . "/";
83 + $this->general_options = get_option( 'wpforo_general_options');
84 + $this->notices = get_option( 'wpforo_notices');
85 + $this->pageid = get_option( 'wpforo_pageid');
86 + $this->default_groupid = get_option('wpforo_default_groupid') ? get_option('wpforo_default_groupid') : 3;
87 + $this->usergroup_cans = get_option('wpforo_usergroup_cans');
88 + $this->forum_options = get_option('wpforo_forum_options');
89 + $this->forum_cans = get_option('wpforo_forum_cans');
90 + $this->post_options = get_option('wpforo_post_options');
91 + $this->member_options = get_option('wpforo_member_options');
92 + $this->subscribe_options = get_option('wpforo_subscribe_options');
93 + $this->countries = get_option('wpforo_countries');
94 + $this->features = get_option('wpforo_features');
95 + $this->style_options = get_option('wpforo_style_options');
96 + $this->theme_options = get_option('wpforo_theme_options');
116 97 $this->theme = $this->theme_options['folder'];
117 98 //CONSTANTS
118 - define('WPFORO_BASE_PERMASTRUCT', $this->base_permastruct );
119 99 define('WPFORO_BASE_URL', $this->url );
120 100 define('WPFORO_THEME', $this->theme );
121 101 define('WPFORO_TEMPLATE_DIR', WPFORO_THEME_DIR . '/' . $this->theme );
122 102 define('WPFORO_TEMPLATE_URL', WPFORO_THEME_URL . '/' . $this->theme );
@@ -122,18 +102,10 @@
122 102 define('WPFORO_TEMPLATE_URL', WPFORO_THEME_URL . '/' . $this->theme );
123 103 }
124 104
125 105 private function setup(){
126 - if( wpforo_is_admin() ){
127 - register_activation_hook($this->basename, 'do_wpforo_activation');
128 - if( !wpforo_feature('user-synch') && get_option('wpforo_version') ){
129 - $users = $this->db->get_var("SELECT COUNT(*) FROM `" . $this->db->prefix . "users`");
130 - $profiles = $this->db->get_var("SELECT COUNT(*) FROM `" . $this->db->prefix . "wpforo_profiles`");
131 - $delta = $users - $profiles;
132 - if( $users > 100 && $delta > 2 ){ add_action( 'admin_notices', 'wpforo_profile_notice' ); }
133 - }
134 - register_deactivation_hook($this->basename, 'do_wpforo_deactivation');
135 - }
106 + add_action( 'activate_' . $this->basename, 'wpforo_activation' );
107 + add_action( 'deactivate_' . $this->basename, 'wpforo_deactivation' );
136 108 }
137 109
138 110 public function phrases(){
139 111 if($this->general_options){
@@ -142,105 +114,55 @@
142 114 $this->phrases[addslashes(strtolower($phrase['phrase_key']))] = $phrase['phrase_value'];
143 115 }
144 116 }
145 117 }
146 -
147 - public function user_trailingslashit($url) {
148 - $rtrimed_url = '';
149 - $url_append_vars = '';
150 - if( preg_match('#(^.+?)(/?\?.*$|$)#isu', $url, $match) ){
151 - if(isset($match[1]) && $match[1]) $rtrimed_url = rtrim($match[1], '/\\');
152 - if(isset($match[2]) && $match[2]) $url_append_vars = trim($match[2], '/\\');
153 - if( $rtrimed_url ) {
154 - $home_url = rtrim( preg_replace('#/?\?.*$#isu', '', home_url()), '/\\' );
155 - if( $rtrimed_url == $home_url ){
156 - $url = $rtrimed_url . '/';
157 - }else{
158 - $url = ( $this->use_trailing_slashes ? $rtrimed_url . '/' : $rtrimed_url );
159 - }
160 - }
161 - }
162 - return $url . $url_append_vars;
163 - }
164 118
165 119 public function get_statistic(){
166 - return $this->statistic();
167 - }
168 -
169 - public function statistic( $mode = 'get' ){
170 -
171 - if( $mode == 'get' ){
172 - $cached_stat = get_option( 'wpforo_stat' );
173 - if( !empty($cached_stat) ){
174 - if( isset($cached_stat['members']) && $cached_stat['members'] ) return $cached_stat;
175 - }
176 - }
177 -
120 + $stats = array();
178 121 $stats['forums'] = $this->forum->get_count();
179 122 $stats['topics'] = $this->topic->get_count();
180 123 $stats['posts'] = $this->post->get_count();
181 124 $stats['members'] = $this->member->get_count();
182 125 $stats['online_members_count'] = $this->member->online_members_count();
126 +
183 127 $stats['last_post_title'] = '';
184 128 $stats['last_post_url'] = '';
129 +
185 130 $posts = $this->topic->get_topics( array( 'orderby' => 'modified', 'order' => 'DESC', 'row_count' => 1 ) );
186 131 if(isset($posts[0]) && !empty($posts[0])){
187 - if( $this->perm->forum_can( 'vf', $posts[0]['forumid'] ) ){
188 - $stats['last_post_title'] = $posts[0]['title'];
189 - $stats['last_post_url'] = $this->post->get_post_url($posts[0]['last_post']);
190 - }
191 - else{
192 - $stats['last_post_title'] = '';
193 - $stats['last_post_url'] = '';
194 - }
132 + $stats['last_post_title'] = $posts[0]['title'];
133 + $stats['last_post_url'] = $this->post->get_post_url($posts[0]['last_post']);
195 134 }
135 +
196 136 $stats['newest_member_dname'] = '';
197 137 $stats['newest_member_profile_url'] = '';
138 +
198 139 $members = $this->member->get_members( array( 'orderby' => 'userid', 'order' => 'DESC', 'row_count' => 1 ) );
199 140 if(isset($members[0]) && !empty($members[0])){
200 - $stats['newest_member_dname'] = $members[0]['display_name'] ? $members[0]['display_name'] : urldecode($members[0]['user_nicename']);
141 + $stats['newest_member_dname'] = $members[0]['display_name'] ? $members[0]['display_name'] : $members[0]['user_nicename'];
201 142 $stats['newest_member_profile_url'] = $this->member->get_profile_url($members[0]['ID']);
202 143 }
203 - if( !empty($stats) && $stats['members'] ) update_option( 'wpforo_stat', $stats );
144 +
204 145 return apply_filters('wpforo_get_statistic_array_filter', $stats);
205 146 }
206 147
207 - public function init_current_object($url = ''){
208 - $this->current_object = array('template' => '', 'paged' => 1, 'is_404' => false);
209 - if(!$url) $url = wpforo_get_request_uri();
148 + private function init_current_object($url = ''){
149 + $this->current_object = array('template' => '', 'paged' => 1);
150 + if(!$url) $url = wpforo_full_url();
210 151
211 - if( !is_wpforo_page($url) ) return;
152 + $url = preg_replace('#https?://(www\.|)#isu', '', $url);
153 + $wpforo_base_url = preg_replace('#https?://(www\.|)#isu', '', WPFORO_BASE_URL);
212 154
213 - $current_url = wpforo_get_url_query_vars_str($url);
155 + if( strpos($url, $wpforo_base_url) === FALSE || strpos($url, $wpforo_base_url) != 0 ) return;
214 156
215 - if( $this->use_home_url ) $this->permastruct = '';
216 -
217 157 $current_object = array();
218 158 $current_object['template'] = '';
219 - $current_object['is_404'] = false;
220 159
221 - if(isset($_GET['wpfs'])) $current_object['template'] = 'search';
222 - if( isset($_GET['wpforo']) ){
223 - switch($_GET['wpforo']){
224 - case 'signup':
225 - if(!is_user_logged_in()) $current_object['template'] = 'register';
226 - break;
227 - case 'signin':
228 - if(!is_user_logged_in()) $current_object['template'] = 'login';
229 - break;
230 - case 'logout':
231 - wp_logout();
232 - wp_redirect( wpforo_home_url( preg_replace('#\?.*$#is', '', wpforo_get_request_uri()) ) );
233 - exit();
234 - break;
235 - }
236 - }
160 + $wpf_url = str_replace( $wpforo_base_url, '' , $url );
161 + $wpf_url = preg_replace('#\/?\?.*$#is', '', $wpf_url);
162 + $wpf_url_parse = explode('/', trim($wpf_url, '/'));
163 + $wpf_url_parse = array_reverse($wpf_url_parse);
237 164
238 - $wpf_url = preg_replace( '#^/?'.preg_quote($this->permastruct).'#isu', '' , $current_url, 1 );
239 - $wpf_url = preg_replace('#/?\?.*$#isu', '', $wpf_url);
240 - $wpf_url_parse = array_filter( explode('/', trim($wpf_url, '/')) );
241 - $wpf_url_parse = array_reverse($wpf_url_parse);
242 -
243 165 if(in_array('paged', $wpf_url_parse)){
244 166 foreach($wpf_url_parse as $key => $value){
245 167 if( $value == 'paged'){
246 168 unset($wpf_url_parse[$key]);
@@ -255,50 +177,52 @@
255 177 $current_object['paged'] = (isset($paged) && $paged) ? $paged : 1;
256 178
257 179 $wpf_url_parse = array_values($wpf_url_parse);
258 180
259 - if( !isset($current_object['template']) || !$current_object['template'] )
260 - $current_object = apply_filters('wpforo_before_init_current_object', $current_object, $wpf_url_parse);
261 -
262 - if( !isset($current_object['template']) || !$current_object['template'] ) {
263 - if(in_array('members', $wpf_url_parse) && $wpf_url_parse[0] == 'members'){
264 - $current_object['template'] = 'members';
265 - }elseif(in_array('profile', $wpf_url_parse)){
266 - $current_object['template'] = 'profile';
267 - foreach($wpf_url_parse as $value){
268 - if( $value == 'profile') break;
269 - if(is_numeric($value)) $current_object['userid'] = $value; else $current_object['username'] = $value;
181 + if(in_array('members', $wpf_url_parse) && $wpf_url_parse[0] == 'members'){
182 + $current_object['template'] = 'members';
183 + }elseif(in_array('profile', $wpf_url_parse)){
184 + $current_object['template'] = 'profile';
185 + foreach($wpf_url_parse as $value){
186 + if( $value == 'profile') break;
187 + if(is_numeric($value)) $current_object['userid'] = $value; else $current_object['username'] = $value;
188 + }
189 + }elseif(in_array('messages', $wpf_url_parse)){
190 + $current_object['template'] = 'messages';
191 + foreach($wpf_url_parse as $value){
192 + if( $value == 'messages') break;
193 + if(is_numeric($value)) $current_object['userid'] = $value; else $current_object['username'] = $value;
194 + }
195 + }elseif(in_array('account', $wpf_url_parse)){
196 + $current_object['template'] = 'account';
197 + foreach($wpf_url_parse as $value){
198 + if( $value == 'account') break;
199 + if(is_numeric($value)) $current_object['userid'] = $value; else $current_object['username'] = $value;
200 + }
201 + }elseif(in_array('activity', $wpf_url_parse)){
202 + $current_object['template'] = 'activity';
203 + foreach($wpf_url_parse as $value){
204 + if( $value == 'activity') break;
205 + if(is_numeric($value)) $current_object['userid'] = $value; else $current_object['username'] = $value;
206 + }
207 + }elseif(in_array('subscriptions', $wpf_url_parse)){
208 + $current_object['template'] = 'subscriptions';
209 + foreach($wpf_url_parse as $value){
210 + if( $value == 'subscriptions') break;
211 + if(is_numeric($value)) $current_object['userid'] = $value; else $current_object['username'] = $value;
212 + }
213 + }else{
214 + $current_object['template'] = 'forum';
215 + if($wpf_url_parse[0] && $wpf_url_parse[0] != 'wpforo'){
216 +
217 + if(isset($wpf_url_parse[1])){
218 + $current_object['topic_slug'] = $wpf_url_parse[0];
219 + $current_object['forum_slug'] = $wpf_url_parse[1];
220 + $current_object['template'] = 'post';
221 + }else{
222 + $current_object['forum_slug'] = $wpf_url_parse[0];
223 + $current_object['template'] = 'topic';
270 224 }
271 - }elseif(in_array('account', $wpf_url_parse)){
272 - $current_object['template'] = 'account';
273 - foreach($wpf_url_parse as $value){
274 - if( $value == 'account') break;
275 - if(is_numeric($value)) $current_object['userid'] = $value; else $current_object['username'] = $value;
276 - }
277 - }elseif(in_array('activity', $wpf_url_parse)){
278 - $current_object['template'] = 'activity';
279 - foreach($wpf_url_parse as $value){
280 - if( $value == 'activity') break;
281 - if(is_numeric($value)) $current_object['userid'] = $value; else $current_object['username'] = $value;
282 - }
283 - }elseif(in_array('subscriptions', $wpf_url_parse)){
284 - $current_object['template'] = 'subscriptions';
285 - foreach($wpf_url_parse as $value){
286 - if( $value == 'subscriptions') break;
287 - if(is_numeric($value)) $current_object['userid'] = $value; else $current_object['username'] = $value;
288 - }
289 - }else{
290 - $current_object['template'] = 'forum';
291 - if( isset($wpf_url_parse[0]) ){
292 - if( isset($wpf_url_parse[1]) ){
293 - $current_object['topic_slug'] = $wpf_url_parse[0];
294 - $current_object['forum_slug'] = $wpf_url_parse[1];
295 - $current_object['template'] = 'post';
296 - }else{
297 - $current_object['forum_slug'] = $wpf_url_parse[0];
298 - $current_object['template'] = 'topic';
299 - }
300 - }
301 225 }
302 226 }
303 227
304 228 if( isset($current_object['userid']) || isset($current_object['username']) ){
@@ -317,10 +241,9 @@
317 241 $args = array(
318 242 'offset' => ($current_object['paged'] - 1) * $this->post_options['posts_per_page'],
319 243 'row_count' => $this->post_options['posts_per_page'],
320 244 'userid' => $current_object['userid'],
321 - 'order' => 'DESC',
322 - 'check_private' => true
245 + 'order' => 'DESC'
323 246 );
324 247 $current_object['items_count'] = 0;
325 248 $current_object['activities'] = $this->post->get_posts( $args, $current_object['items_count']);
326 249 break;
@@ -336,9 +259,8 @@
336 259 break;
337 260 }
338 261
339 262 }else{
340 - $current_object['is_404'] = true;
341 263 $current_object['user'] = array();
342 264 $current_object['userid'] = 0;
343 265 $current_object['username'] = '';
344 266 }
@@ -344,9 +266,9 @@
344 266 }
345 267 }
346 268
347 269 if(isset($current_object['forum_slug']) && $current_object['forum_slug']){
348 - $forum = $this->forum->get_forum(array('slug' => $current_object['forum_slug']), TRUE);
270 + $forum = $this->forum->get_forum(array('slug' => $current_object['forum_slug']));
349 271 if(!empty($forum)){
350 272 $current_object['forum'] = $forum;
351 273 $current_object['forumid'] = $forum['forumid'];
352 274 $current_object['forum_desc'] = $forum['description'];
@@ -352,9 +274,8 @@
352 274 $current_object['forum_desc'] = $forum['description'];
353 275 $current_object['forum_meta_key'] = $forum['meta_key'];
354 276 $current_object['forum_meta_desc'] = $forum['meta_desc'];
355 277 }else{
356 - $current_object['is_404'] = true;
357 278 $current_object['forum'] = array();
358 279 $current_object['forumid'] = 0;
359 280 $current_object['forum_desc'] = '';
360 281 $current_object['forum_meta_key'] = '';
@@ -367,21 +288,20 @@
367 288 if(!empty($topic)){
368 289 $current_object['topic'] = $topic;
369 290 $current_object['topicid'] = $topic['topicid'];
370 291 }else{
371 - $current_object['is_404'] = true;
372 292 $current_object['topic'] = array();
373 293 $current_object['topicid'] = 0;
374 294 }
375 295 }
376 296
377 - $this->current_object = apply_filters('wpforo_after_init_current_object', $current_object, $wpf_url_parse);
297 + $this->current_object = apply_filters('wpforo_current_object_filter', $current_object);
378 298 }
379 299 }
380 300
381 301 $wpforo = new wpForo();
382 - $wpforo->cache = new wpForoCache( $wpforo );
383 - $wpforo->phrase = new wpForoPhrase( $wpforo ); $wpforo->phrases();
302 + $wpforo->phrase = new wpForoPhrase( $wpforo );
303 + $wpforo->phrases();
384 304 $wpforo->forum = new wpForoForum( $wpforo );
385 305 $wpforo->topic = new wpForoTopic( $wpforo );
386 306 $wpforo->post = new wpForoPost( $wpforo );
387 307 $wpforo->usergroup = new wpForoUsergroup( $wpforo );
@@ -390,20 +310,9 @@
390 310 $wpforo->sbscrb = new wpForoSubscribe( $wpforo );
391 311 $wpforo->tpl = new wpForoTemplate( $wpforo );
392 312 $wpforo->notice = new wpForoNotices( $wpforo );
393 313 $wpforo->feed = new wpForoFeed( $wpforo );
394 - $wpforo->moderation = new wpForoModeration( $wpforo );
395 - if(wpforo_is_admin()) include( WPFORO_DIR .'/wpf-admin/admin.php' );
314 + if(is_admin()) include( WPFORO_DIR .'/wpf-admin/admin.php' );
396 315 $GLOBALS['wpforo'] = $wpforo;
397 316 add_action('init', array($wpforo, 'init'));
398 -
399 - //ADDONS/////////////////////////////////////////////////////
400 - $wpforo->addons = array(
401 - 'pm' => array('version' => '1.0.0', 'requires' => '1.1.2', 'class' => 'wpForoPMs', 'title' => 'Private Messages', 'thumb' => WPFORO_URL . '/wpf-assets/addons/' . 'pm' . '/header.png', 'desc' => __('Provides a safe way to communicate directly with other members. Messages are private and can only be viewed by conversation participants.', 'wpforo'), 'url' => 'https://gvectors.com/product/wpforo-private-messages/'),
402 - 'cross' => array('version' => '1.0.0', 'requires' => '1.3.1', 'class' => 'wpForoCrossPosting', 'title' => '"Forum - Blog" Cross Posting', 'thumb' => WPFORO_URL . '/wpf-assets/addons/' . 'cross' . '/header.png', 'desc' => __('Blog to Forum and Forum to Blog content synchronization. Blog posts with Forum topics and Blog comments with Forum replies.', 'wpforo'), 'url' => 'https://gvectors.com/product/wpforo-cross-posting/'),
403 - 'attachments' => array('version' => '1.0.0', 'requires' => '1.1.0', 'class' => 'wpForoAttachments', 'title' => 'Advanced Attachments', 'thumb' => WPFORO_URL . '/wpf-assets/addons/' . 'attachments' . '/header.png', 'desc' => __('Adds an advanced file attachment system to forum topics and posts. AJAX powered media uploading and displaying system with user specific library.', 'wpforo'), 'url' => 'https://gvectors.com/product/wpforo-advanced-attachments/'),
404 - 'embeds' => array('version' => '1.0.2', 'requires' => '1.1.0', 'class' => 'wpForoEmbeds', 'title' => 'Embeds', 'thumb' => WPFORO_URL . '/wpf-assets/addons/' . 'embeds' . '/header.png', 'desc' => __('Allows to embed hundreds of video, social network, audio and photo content providers in forum topics and posts.', 'wpforo'), 'url' => 'https://gvectors.com/product/wpforo-embeds/'),
405 - 'ad-manager' => array('version' => '1.0.0', 'requires' => '1.2.0', 'class' => 'wpForoAD', 'title' => 'Ads Manager', 'thumb' => WPFORO_URL . '/wpf-assets/addons/' . 'ad-manager' . '/header.png', 'desc' => __('Ads Manager is a powerful yet simple advertisement management system, that allows you to add adverting banners between forums, topics and posts.', 'wpforo'), 'url' => 'https://gvectors.com/product/wpforo-ad-manager/'),
406 - );
407 - $wp_version = get_bloginfo('version'); if (version_compare($wp_version, '4.2.0', '>=')) { add_action('wp_ajax_dismiss_wpforo_addon_note', array($wpforo->notice, 'dismissAddonNote')); add_action('admin_notices', array($wpforo->notice, 'addonNote'));}
408 - /////////////////////////////////////////////////////////////
409 -}
317 +}
318 +?>