PluginProbe
wpForo Forum / 1.3.1
wpForo Forum v1.3.1
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 1.4.13 1.4.2 All 137 releases
wpforo / wpf-includes / functions-installation.php

functions-installation.php in wpForo Forum 1.3.1, at wpf-includes/functions-installation.php

828 lines 39.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly
3 if( !defined( 'ABSPATH' ) ) exit;
4
5 function do_wpforo_activation($network_wide){
6 if ( is_multisite() && $network_wide ) {
7 global $wpdb;
8
9 $old_blogid = $wpdb->blogid;
10 $blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
11 foreach ($blogids as $blogid){
12 switch_to_blog($blogid);
13 wpforo_activation();
14 }
15 switch_to_blog($old_blogid);
16 }else{
17 wpforo_activation();
18 }
19 }
20
21 function do_wpforo_deactivation($network_wide){
22 if ( is_multisite() && $network_wide ) {
23 global $wpdb;
24
25 $old_blogid = $wpdb->blogid;
26 $blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
27 foreach ($blogids as $blogid){
28 switch_to_blog($blogid);
29 wpforo_deactivation();
30 }
31 switch_to_blog($old_blogid);
32 }else{
33 wpforo_deactivation();
34 }
35 }
36
37 function wpforo_activation(){
38 global $wpforo, $wpdb;
39 if( ! wpforo_is_admin() ) return;
40 if( ! current_user_can( 'activate_plugins' ) ) return;
41 add_option('wpforo_default_groupid', 3);
42 require( WPFORO_DIR . '/wpf-includes/install-sql.php' );
43 foreach( $wpforo_sql as $sql ) if( FALSE === @$wpforo->db->query($sql) ) @$wpforo->db->query( preg_replace('#)[\r\n\t\s]*ENGINE.*$#isu', ')', $sql) );
44 $users = $wpforo->db->get_var("SELECT COUNT(*) FROM `" . $wpforo->db->prefix . "users`");
45 if( $users <= 100 ) $wpforo->member->synchronize_users();
46 $wpforo->member->init_current_user();
47 $blogname = get_option('blogname');
48 $adminemail = get_option('admin_email');
49 add_option( 'wpforo_count_per_page', 10 );
50
51 ###################################################################
52 // General Options ////////////////////////////////////////////////
53 $general_options = array(
54 'title' => $blogname . ' ' . __('Forum', 'wpforo'),
55 'description' => $blogname . ' ' . __('Discussion Board', 'wpforo'),
56 'lang' => 1,
57 );
58 wpforo_update_options( 'wpforo_general_options', $general_options );
59
60 ###################################################################
61 // Forums /////////////////////////////////////////////////////////
62 $wpforo_forum = array(
63 'layout_qa_intro_topics_toggle' => 1,
64 'layout_extended_intro_topics_toggle' => 1,
65 'layout_qa_intro_topics_count' => 3,
66 'layout_extended_intro_topics_count' => 5,
67 );
68 wpforo_update_options( 'wpforo_forum_options', $wpforo_forum );
69
70 ##################################################################
71 // Topics & Posts ////////////////////////////////////////////////
72 $upload_max_filesize = @ini_get('upload_max_filesize');
73 $upload_max_filesize = wpforo_human_size_to_bytes($upload_max_filesize);
74 if( !$upload_max_filesize || $upload_max_filesize > 10485760 ) $upload_max_filesize = 10485760;
75 $wpforo_post = array(
76 'layout_extended_intro_posts_toggle' => 1,
77 'layout_extended_intro_posts_count' => 4,
78 'topics_per_page' => 10,
79 'eot_durr' => 300,
80 'dot_durr' => 300,
81 'posts_per_page' => 15,
82 'eor_durr' => 300,
83 'dor_durr' => 300,
84 'max_upload_size' => $upload_max_filesize,
85 'attach_cant_view_msg' => __("You are not permitted to view this attachment", 'wpforo')
86 );
87 wpforo_update_options( 'wpforo_post_options', $wpforo_post );
88
89 #################################################################
90 // Features /////////////////////////////////////////////////////
91 $wpforo_features = array(
92 'user-admin-bar' => 0,
93 'page-title' => 1,
94 'top-bar' => 1,
95 'top-bar-search' => 1,
96 'breadcrumb' => 1,
97 'footer-stat' => 1,
98 'author-link' => 0,
99 'comment-author-link' => 0,
100 'user-register' => 1,
101 'user-register-email-confirm' => 0,
102 'register-url' => 0,
103 'login-url' => 0,
104 'replace-avatar' => 1,
105 'avatars' => 1,
106 'custom-avatars' => 1,
107 'signature' => 1,
108 'rating' => 1,
109 'rating_title' => 1,
110 'member_cashe' => 1,
111 'object_cashe' => 1,
112 'html_cashe' => 0,
113 'memory_cashe' => 1,
114 'seo-title' => 1,
115 'seo-meta' => 1,
116 'seo-profile' => 1,
117 'font-awesome' => 1,
118 'user-synch' => 0,
119 'output-buffer' => 1,
120 'wp-date-format' => 0,
121 'subscribe_conf' => 1,
122 'subscribe_checkbox_on_post_editor' => 1,
123 'subscribe_checkbox_default_status' => 0,
124 'attach-media-lib' => 1,
125 'debug-mode' => 0,
126 'copyright' => 1
127 );
128 wpforo_update_options( 'wpforo_features', $wpforo_features );
129
130 #################################################################
131 // Theme & Style ////////////////////////////////////////////////
132 $wpforo_style = array(
133 'font_size_forum' => 17,
134 'font_size_topic' => 16,
135 'font_size_post_content' => 14,
136 'custom_css' => "#wpforo-wrap {\r\n font-size: 13px; width: 100%; padding:10px 20px; margin:0px;\r\n}\r\n",
137 );
138 wpforo_update_options( 'wpforo_style_options', $wpforo_style );
139
140 $defaut_theme = 'classic';
141 $theme = $wpforo->tpl->find_theme( $defaut_theme );
142 $current_theme = get_option( 'wpforo_theme_options' );
143 if(!empty($current_theme)) {
144 $theme = wpforo_deep_merge($theme, $current_theme);
145 update_option( 'wpforo_theme_options', $theme );
146 }
147 add_option( 'wpforo_theme_options', $theme );
148
149 #################################################################
150 // Members //////////////////////////////////////////////////////
151 $wpforo_member = array(
152 'online_status_timeout' => 240,
153 'url_structure' => 'nicename',
154 'login_url' => '',
155 'register_url' => '',
156 'lost_password_url' => '',
157 'rating_title_ug' => array ( 1 => '0', 5 => '1', 4 => '1', 2 => '0', 3 => '1' ),
158 'rating_badge_ug' => array ( 1 => '1', 5 => '1', 4 => '1', 2 => '1', 3 => '1' ),
159 'title_usergroup' => array ( 1 => '1', 5 => '1', 4 => '1', 2 => '1', 3 => '0' ),
160 );
161 $exlude = array('rating_title_ug', 'rating_badge_ug');
162 wpforo_update_options( 'wpforo_member_options', $wpforo_member, $exlude);
163
164 #################################################################
165 // Subscribe Options ////////////////////////////////////////////
166 $subscriptions_options = array (
167 'from_name' => $blogname . ' - Forum',
168 'from_email' => $adminemail,
169 'admin_emails' => $adminemail,
170 'new_topic_notify' => 1,
171 'new_reply_notify' => 0,
172 'confirmation_email_subject' => "Please confirm subscription to [entry_title]",
173 'confirmation_email_message' => "Hello [member_name]!<br>\r\n Thank you for subscribing.<br>\r\n This is an automated response.<br>\r\n We are glad to inform you that after confirmation you will get updates from - [entry_title].<br>\r\n Please click on link below to complete this step.<br>\r\n [confirm_link]" ,
174 'new_topic_notification_email_subject' => "New Topic" ,
175 'new_topic_notification_email_message' => "Hello [member_name]!<br>\r\n New topic has been created on your subscribed forum - [forum].\r\n <br><br>\r\n <strong>[topic_title]</strong>\r\n <blockquote>\r\n [topic_desc]\r\n </blockquote>\r\n <br><hr>\r\n If you want to unsubscribe from this forum please use the link below.<br>\r\n [unsubscribe_link]" ,
176 'new_post_notification_email_subject' => "New Reply" ,
177 'new_post_notification_email_message' => "Hello [member_name]!<br>\r\n New reply has been posted on your subscribed topic - [topic].\r\n <br><br>\r\n <strong>[reply_title]</strong>\r\n <blockquote >\r\n [reply_desc]\r\n </blockquote>\r\n <br><hr>\r\n If you want to unsubscribe from this topic please use the link below.<br>\r\n [unsubscribe_link]" ,
178 'report_email_subject' => "Forum Post Report",
179 'report_email_message' => "<strong>Report details:</strong>\r\n Reporter: [reporter], <br>\r\n Message: [message],<br>\r\n <br>\r\n [post_url]",
180 //'spam_notification_email_subject' => 'New Banned User',
181 //'spam_notification_email_message' => "Hello [member_name]!<br>\r\n Please check this user's topics/posts and consider to Delete or Unban.<br>\r\n User Activity: [profile_activity_url]",
182 'update' => '1'
183 );
184 wpforo_update_options( 'wpforo_subscribe_options', $subscriptions_options );
185
186 #################################################################
187 // Tool Options - Antispam ///////////////////////////////////////
188 $topic_level = mt_rand(30, 60);
189 $post_level = mt_rand(30, 60);
190 $wpforo_tools_antispam = array(
191 'spam_filter' => 1,
192 'spam_filter_level_topic' => $topic_level,
193 'spam_filter_level_post' => $post_level,
194 'spam_user_ban' => 0,
195 'new_user_max_posts' => 5,
196 'spam_user_ban_notification' => 1,
197 'min_number_post_to_attach' => 3,
198 'min_number_post_to_link' => 0,
199 'limited_file_ext' => 'pdf|doc|docx|txt|htm|html|rtf|xml|xls|xlsx|zip|rar|tar|gz|bzip|7z',
200 );
201 wpforo_update_options( 'wpforo_tools_antispam', $wpforo_tools_antispam);
202
203 #################################################################
204 // Tool Options - Cleanup ///////////////////////////////////////
205 $wpforo_tools_cleanup = array(
206 'user_reg_days_ago' => 7,
207 'auto_cleanup_users' => 0,
208 'usergroup' => array ( 1 => '0', 5 => '0', 2 => '1', 3 => '0' ),
209 );
210 wpforo_update_options( 'wpforo_tools_cleanup', $wpforo_tools_cleanup);
211
212
213
214 #################################################################
215 // Countries ////////////////////////////////////////////////////
216 $countries = array( "Afghanistan","�
217 land Islands","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica",
218 "Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain",
219 "Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina",
220 "Botswana","Bouvet Island","Brazil","British Indian Ocean Territory","Brunei Darussalam","Bulgaria","Burkina Faso",
221 "Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central African Republic","Chad","Chile",
222 "China","Christmas Island","Cocos (Keeling) Islands","Colombia","Comoros","Congo","Congo, The Democratic Republic of The",
223 "Cook Islands","Costa Rica","Cote D'ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica",
224 "Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Falkland Islands (Malvinas)",
225 "Faroe Islands","Fiji","Finland","France","French Guiana","French Polynesia","French Southern Territories","Gabon",
226 "Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala",
227 "Guernsey","Guinea","Guinea-bissau","Guyana","Haiti","Heard Island and Mcdonald Islands","Holy See (Vatican City State)",
228 "Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran, Islamic Republic of","Iraq","Ireland",
229 "Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Korea, Democratic People's Republic of",
230 "Korea, Republic of","Kuwait","Kyrgyzstan","Lao People's Democratic Republic","Latvia","Lebanon","Lesotho","Liberia",
231 "Libyan Arab Jamahiriya","Liechtenstein","Lithuania","Luxembourg","Macao","Macedonia, The Former Yugoslav Republic of",
232 "Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius",
233 "Mayotte","Mexico","Micronesia, Federated States of","Moldova, Republic of","Monaco","Mongolia","Montenegro","Montserrat",
234 "Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","Netherlands Antilles","New Caledonia",
235 "New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","Northern Mariana Islands","Norway","Oman",
236 "Pakistan","Palau","Palestinian Territory, Occupied","Panama","Papua New Guinea","Paraguay","Peru","Philippines",
237 "Pitcairn","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saint Helena",
238 "Saint Kitts and Nevis","Saint Lucia","Saint Pierre and Miquelon","Saint Vincent and The Grenadines","Samoa",
239 "San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore",
240 "Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Georgia and The South Sandwich Islands",
241 "Spain","Sri Lanka","Sudan","Suriname","Svalbard and Jan Mayen","Swaziland","Sweden","Switzerland","Syrian Arab Republic",
242 "Taiwan, Province of China","Tajikistan","Tanzania, United Republic of","Thailand","Timor-leste","Togo","Tokelau",
243 "Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Turks and Caicos Islands","Tuvalu","Uganda","Ukraine",
244 "United Arab Emirates","United Kingdom","United States","United States Minor Outlying Islands","Uruguay","Uzbekistan",
245 "Vanuatu","Venezuela","Viet Nam","Virgin Islands, British","Virgin Islands, U.S.","Wallis and Futuna","Western Sahara",
246 "Yemen","Zambia","Zimbabwe" );
247
248 add_option( 'wpforo_countries', $countries );
249
250 #################################################################
251 // Forum Navigation and Menu ////////////////////////////////////
252 $menu_name = wpforo_phrase('wpForo Navigation', false, 'orig');
253 $menu_location = 'wpforo-menu';
254 $menu_exists = wp_get_nav_menu_object( $menu_name );
255 if(!$menu_exists){
256 $id = array();
257 $menu_id = wp_create_nav_menu($menu_name);
258 $id['wpforo-home'] = wp_update_nav_menu_item($menu_id, 0, array(
259 'menu-item-title' => wpforo_phrase('Forums', false),
260 'menu-item-classes' => 'wpforo-home',
261 'menu-item-url' => '/%wpforo-home%/',
262 'menu-item-status' => 'publish',
263 'menu-item-parent-id' => 0,
264 'menu-item-position' => 0));
265
266 $id['wpforo-members'] = wp_update_nav_menu_item($menu_id, 0, array(
267 'menu-item-title' => wpforo_phrase('Members', false),
268 'menu-item-classes' => 'wpforo-members',
269 'menu-item-url' => '/%wpforo-members%/',
270 'menu-item-status' => 'publish',
271 'menu-item-parent-id' => 0,
272 'menu-item-position' => 0));
273
274 $id['wpforo-profile'] = wp_update_nav_menu_item($menu_id, 0, array(
275 'menu-item-title' => wpforo_phrase('My Profile', false),
276 'menu-item-classes' => 'wpforo-profile',
277 'menu-item-url' => '/%wpforo-profile-home%/',
278 'menu-item-status' => 'publish',
279 'menu-item-parent-id' => 0,
280 'menu-item-position' => 0));
281
282 if(isset($id['wpforo-profile']) && $id['wpforo-profile']){
283 $id['wpforo-profile-account'] = wp_update_nav_menu_item($menu_id, 0, array(
284 'menu-item-title' => wpforo_phrase('Account', false),
285 'menu-item-classes' => 'wpforo-profile-account',
286 'menu-item-url' => '/%wpforo-profile-account%/',
287 'menu-item-status' => 'publish',
288 'menu-item-parent-id' => $id['wpforo-profile'],
289 'menu-item-position' => 1)
290 );
291 $id['wpforo-profile-activity'] = wp_update_nav_menu_item($menu_id, 0, array(
292 'menu-item-title' => wpforo_phrase('Activity', false),
293 'menu-item-classes' => 'wpforo-profile-activity',
294 'menu-item-url' => '/%wpforo-profile-activity%/',
295 'menu-item-status' => 'publish',
296 'menu-item-parent-id' => $id['wpforo-profile'],
297 'menu-item-position' => 1)
298 );
299 $id['wpforo-profile-subscriptions'] = wp_update_nav_menu_item($menu_id, 0, array(
300 'menu-item-title' => wpforo_phrase('Subscriptions', false),
301 'menu-item-classes' => 'wpforo-profile-subscriptions',
302 'menu-item-url' => '/%wpforo-profile-subscriptions%/',
303 'menu-item-status' => 'publish',
304 'menu-item-parent-id' => $id['wpforo-profile'],
305 'menu-item-position' => 2)
306 );
307 }
308
309 $id['wpforo-register'] = wp_update_nav_menu_item($menu_id, 0, array(
310 'menu-item-title' => wpforo_phrase('Register', false),
311 'menu-item-classes' => 'wpforo-register',
312 'menu-item-url' => '/%wpforo-register%/',
313 'menu-item-status' => 'publish',
314 'menu-item-parent-id' => 0,
315 'menu-item-position' => 0));
316
317 $id['wpforo-login'] = wp_update_nav_menu_item($menu_id, 0, array(
318 'menu-item-title' => wpforo_phrase('Login', false),
319 'menu-item-classes' => 'wpforo-login',
320 'menu-item-url' => '/%wpforo-login%/',
321 'menu-item-status' => 'publish',
322 'menu-item-parent-id' => 0,
323 'menu-item-position' => 0));
324
325 $id['wpforo-logout'] = wp_update_nav_menu_item($menu_id, 0, array(
326 'menu-item-title' => wpforo_phrase('Logout', false),
327 'menu-item-classes' => 'wpforo-logout',
328 'menu-item-url' => '/%wpforo-logout%/',
329 'menu-item-status' => 'publish',
330 'menu-item-parent-id' => 0,
331 'menu-item-position' => 0));
332
333 if( !has_nav_menu( $menu_location ) ){
334 $locations = get_theme_mod('nav_menu_locations');
335 if(empty($locations)) $locations = array();
336 $locations[$menu_location] = $menu_id;
337 set_theme_mod( 'nav_menu_locations', $locations );
338 }
339 }
340
341 #################################################################
342 // Forum Access Array ///////////////////////////////////////////
343 $forum_cans = array (
344 'vf' => 'Can view forum',
345 'ct' => 'Can create topic',
346 'vt' => 'Can view topic',
347 'et' => 'Can edit topic',
348 'dt' => 'Can delete topic',
349 'cr' => 'Can post reply',
350 'vr' => 'Can view replies',
351 'er' => 'Can edit replies',
352 'dr' => 'Can delete replies',
353 'eot' => 'Can edit own topic',
354 'eor' => 'Can edit own reply',
355 'dot' => 'Can delete own topic',
356 'dor' => 'Can delete own reply',
357 'l' => 'Can like',
358 'r' => 'Can report',
359 's' => 'Can set topic sticky',
360 'p' => 'Can set topic private',
361 'op' => 'Can set own topic private',
362 'vp' => 'Can view private topic',
363 'au' => 'Can approve/unapprove content',
364 'sv' => 'Can set topic solved',
365 'osv' => 'Can set own topic solved',
366 'v' => 'Can vote',
367 'a' => 'Can attach file',
368 'va' => 'Can view attached files',
369 'at' => 'Can set topic answered',
370 'oat' => 'Can set own topic answered',
371 'cot' => 'Can close topic',
372 'mt' => 'Can move topic'
373 );
374 wpforo_update_options( 'wpforo_forum_cans', $forum_cans);
375
376 #################################################################
377 // Access Sets //////////////////////////////////////////////////
378 $cans_n = array('vf' => 0, 'ct' => 0, 'vt' => 0, 'et' => 0, 'dt' => 0,
379 'cr' => 0, 'vr' => 0, 'er' => 0, 'dr' => 0,
380 'eot' => 0, 'eor' => 0, 'dot' => 0, 'dor' => 0,
381 'l' => 0, 'r' => 0, 's' => 0, 'au' => 0, 'p' => 0, 'op' => 0, 'vp' => 0, 'sv' => 0, 'osv' => 0, 'v' => 0, 'a' => 0, 'va' => 0,
382 'at' => 0, 'oat' => 0, 'cot' => 0, 'mt' => 0);
383 $cans_r = array('vf' => 1, 'ct' => 0, 'vt' => 1, 'et' => 0, 'dt' => 0,
384 'cr' => 0, 'vr' => 1, 'er' => 0, 'dr' => 0,
385 'eot' => 0, 'eor' => 0, 'dot' => 0, 'dor' => 0,
386 'l' => 0, 'r' => 0, 's' => 0, 'au' => 0, 'p' => 0, 'op' => 0, 'vp' => 0, 'sv' => 0, 'osv' => 0, 'v' => 0, 'a' => 0, 'va' => 1,
387 'at' => 0, 'oat' => 0, 'cot' => 0, 'mt' => 0);
388 $cans_s = array('vf' => 1, 'ct' => 1, 'vt' => 1, 'et' => 0, 'dt' => 0,
389 'cr' => 1, 'vr' => 1, 'er' => 0, 'dr' => 0,
390 'eot' => 1, 'eor' => 1, 'dot' => 1, 'dor' => 1,
391 'l' => 1, 'r' => 1, 's' => 0, 'au' => 0, 'p' => 0, 'op' => 1, 'vp' => 0, 'sv' => 0, 'osv' => 1, 'v' => 1, 'a' => 1, 'va' => 1,
392 'at' => 0, 'oat' => 1, 'cot' => 0, 'mt' => 0);
393 $cans_m = array('vf' => 1, 'ct' => 1, 'vt' => 1, 'et' => 1, 'dt' => 1,
394 'cr' => 1, 'vr' => 1, 'er' => 1, 'dr' => 1,
395 'eot' => 1, 'eor' => 1, 'dot' => 1, 'dor' => 1,
396 'l' => 1, 'r' => 1, 's' => 1, 'au' => 1, 'p' => 1, 'op' => 1, 'vp' => 1, 'sv' => 1, 'osv' => 1, 'v' => 1, 'a' => 1, 'va' => 1,
397 'at' => 1, 'oat' => 1, 'cot' => 1, 'mt' => 1);
398 $cans_a = array('vf' => 1, 'ct' => 1, 'vt' => 1, 'et' => 1, 'dt' => 1,
399 'cr' => 1, 'vr' => 1, 'er' => 1, 'dr' => 1,
400 'eot' => 1, 'eor' => 1, 'dot' => 1, 'dor' => 1,
401 'l' => 1, 'r' => 1, 's' => 1, 'au' => 1, 'p' => 1, 'op' => 1, 'vp' => 1, 'sv' => 1, 'osv' => 1, 'v' => 1, 'a' => 1, 'va' => 1,
402 'at' => 1, 'oat' => 1, 'cot' => 1, 'mt' => 1);
403
404 $sql = "SELECT * FROM `".$wpforo->db->prefix."wpforo_accesses`";
405 $accesses = $wpforo->db->get_results($sql, ARRAY_A);
406 if( empty($accesses) ){
407
408 $cans_n = serialize($cans_n);
409 $cans_r = serialize($cans_r);
410 $cans_s = serialize($cans_s);
411 $cans_m = serialize($cans_m);
412 $cans_a = serialize($cans_a);
413
414 $sql = "INSERT IGNORE INTO `".$wpforo->db->prefix."wpforo_accesses`
415 (`access`, `title`, cans) VALUES
416 ('no_access', 'No access', '". $cans_n ."'),
417 ('read_only', 'Read only access', '". $cans_r ."'),
418 ('standard', 'Standard access', '". $cans_s ."'),
419 ('moderator', 'Moderator access', '".$cans_m."'),
420 ('full', 'Full access', '".$cans_a."')";
421
422 $wpforo->db->query( $sql );
423 }
424 else{
425 foreach($accesses as $access){
426 $default = array();
427 $data_update = array();
428 $current = unserialize($access['cans']);
429 if( strtolower($access['access']) == 'no_access' ) $default = $cans_n;
430 elseif( strtolower($access['access']) == 'read_only' ) $default = $cans_r;
431 elseif( strtolower($access['access']) == 'standard' ) $default = $cans_s;
432 elseif( strtolower($access['access']) == 'moderator' ) $default = $cans_m;
433 elseif( strtolower($access['access']) == 'full' ) $default = $cans_a;
434 if( !empty($default) ){
435 $data_update = array_merge($default, $current);
436 if( !empty($data_update) ){
437 $data_update = serialize($data_update);
438 $wpforo->db->query("UPDATE `".$wpforo->db->prefix."wpforo_accesses` SET `cans` = '" . $wpforo->db->_real_escape($data_update) . "' WHERE `accessid` = " . intval($access['accessid']) );
439 }
440 }
441 }
442 }
443
444
445 #################################################################
446 // Usergroup Cans ///////////////////////////////////////////////
447 $usergroup_cans = array (
448 'cf' => 'Dashboard - Can create forum',
449 'ef' => 'Dashboard - Can edit forum',
450 'df' => 'Dashboard - Can delete forum',
451 'vm' => 'Dashboard - Members Menu',
452 'aum' => 'Dashboard - Moderation Menu',
453 'em' => 'Dashboard - Can edit member',
454 'bm' => 'Dashboard - Can ban member',
455 'dm' => 'Dashboard - Can delete member',
456 'vmg' => 'Dashboard - Usergroup Menu',
457 'aup' => 'Front - Can pass moderation',
458 'vmem' => 'Front - Can view members',
459 'vprf' => 'Front - Can view profiles',
460 'upa' => 'Front - Can upload avatar',
461 'ups' => 'Front - Can have signature',
462 'va' => 'Front - Can view avatars',
463 'vmu' => 'Front - Can view member username',
464 'vmm' => 'Front - Can view member email',
465 'vmt' => 'Front - Can view member title',
466 'vmct' => 'Front - Can view member custom title',
467 'vmr' => 'Front - Can view member reputation',
468 'vmw' => 'Front - Can view member website',
469 'vmsn' => 'Front - Can view member social networks',
470 'vmrd' => 'Front - Can view member reg. date',
471 'vmlad'=> 'Front - Can view member last active date',
472 'vip' => 'Front - Can view member ip address',
473 'vml' => 'Front - Can view member location',
474 'vmo' => 'Front - Can view member occupation',
475 'vms' => 'Front - Can view member signature',
476 'vmam' => 'Front - Can view member about me',
477 'vmpn' => 'Front - Can view member phone number',
478 'vwpm' => 'Front - Can write PM'
479 );
480 wpforo_update_options( 'wpforo_usergroup_cans', $usergroup_cans );
481
482 #################################################################
483 // Usergroup ////////////////////////////////////////////////////
484 $cans_admin = array('cf' => '1', 'ef' => '1', 'df' => '1', 'vm' => '1', 'aum' => '1', 'em' => '1', 'vmg' => '1', 'aup' => '1', 'vmem' => '1', 'vprf' => '1',
485 'bm' => '1', 'dm' => '1', 'upa' => '1', 'ups' => '1', 'va' => '1',
486 'vmu' => '1', 'vmm' => '1', 'vmt' => '1', 'vmct' => '1',
487 'vmr' => '1', 'vmw' => '1', 'vmsn' => '1', 'vmrd' => '1',
488 'vmlad' => '1', 'vip' => '1', 'vml' => '1', 'vmo' => '1',
489 'vms' => '1', 'vmam' => '1', 'vmpn' => '1', 'vwpm' => '1');
490 $cans_moder = array('cf' => '0', 'ef' => '0', 'df' => '0', 'vm' => '0', 'aum' => '1', 'em' => '0', 'vmg' => '0', 'aup' => '1', 'vmem' => '1', 'vprf' => '1',
491 'bm' => '1', 'dm' => '1', 'upa' => '1', 'ups' => '1', 'va' => '1',
492 'vmu' => '1', 'vmm' => '1', 'vmt' => '1', 'vmct' => '1',
493 'vmr' => '1', 'vmw' => '1', 'vmsn' => '1', 'vmrd' => '1',
494 'vmlad' => '1', 'vip' => '1', 'vml' => '1', 'vmo' => '1',
495 'vms' => '1', 'vmam' => '1', 'vmpn' => '1', 'vwpm' => '1');
496 $cans_reg = array( 'cf' => '0', 'ef' => '0', 'df' => '0', 'vm' => '0', 'aum' => '0', 'em' => '0', 'vmg' => '0', 'aup' => '1', 'vmem' => '1', 'vprf' => '1',
497 'bm' => '0', 'dm' => '0', 'upa' => '1', 'ups' => '1', 'va' => '1',
498 'vmu' => '1', 'vmm' => '0', 'vmt' => '1', 'vmct' => '1',
499 'vmr' => '1', 'vmw' => '1', 'vmsn' => '1', 'vmrd' => '1',
500 'vmlad' => '1', 'vip' => '0', 'vml' => '1', 'vmo' => '1',
501 'vms' => '1', 'vmam' => '1', 'vmpn' => '0', 'vwpm' => '1');
502 $cans_guest = array('cf' => '0', 'ef' => '0', 'df' => '0', 'vm' => '0', 'aum' => '0', 'em' => '0', 'vmg' => '0', 'aup' => '0', 'vmem' => '1', 'vprf' => '1',
503 'bm' => '0', 'dm' => '0', 'upa' => '0', 'ups' => '0', 'va' => '0',
504 'vmu' => '0', 'vmm' => '0', 'vmt' => '0', 'vmct' => '0',
505 'vmr' => '1', 'vmw' => '0', 'vmsn' => '1', 'vmrd' => '0',
506 'vmlad' => '1', 'vip' => '0', 'vml' => '1', 'vmo' => '1',
507 'vms' => '0', 'vmam' => '1', 'vmpn' => '0', 'vwpm' => '0');
508 $cans_customer = array( 'cf' => '0', 'ef' => '0', 'df' => '0', 'vm' => '0', 'aum' => '0', 'em' => '0', 'vmg' => '0', 'aup' => '0', 'vmem' => '1', 'vprf' => '1',
509 'bm' => '0', 'dm' => '0', 'upa' => '1', 'ups' => '1', 'va' => '1',
510 'vmu' => '1', 'vmm' => '0', 'vmt' => '1', 'vmct' => '1',
511 'vmr' => '1', 'vmw' => '1', 'vmsn' => '1', 'vmrd' => '1',
512 'vmlad' => '1', 'vip' => '0', 'vml' => '1', 'vmo' => '1',
513 'vms' => '1', 'vmam' => '1', 'vmpn' => '0', 'vwpm' => '1');
514
515
516 $sql = "SELECT * FROM `".$wpforo->db->prefix."wpforo_usergroups`";
517 $usergroups = $wpforo->db->get_results($sql, ARRAY_A);
518 if( empty($usergroups) ){
519 $cans_admin = serialize( $cans_admin );
520 $cans_moder = serialize( $cans_moder );
521 $cans_reg = serialize( $cans_reg );
522 $cans_guest = serialize( $cans_guest );
523 $cans_customer = serialize( $cans_customer );
524 $sql = "INSERT IGNORE INTO `".$wpforo->db->prefix."wpforo_usergroups`
525 (`name`, `cans`) VALUES ('Admin', '$cans_admin'),('Moderator', '$cans_moder'),('Registered', '$cans_reg'),('Guest', '$cans_guest'),('Customer', '$cans_customer')";
526 $wpforo->db->query($sql);
527 }
528 else{
529 foreach($usergroups as $usergroup){
530 $default = array();
531 $data_update = array();
532 $current = unserialize($usergroup['cans']);
533 if( strtolower($usergroup['name']) == 'admin' ) $default = $cans_admin;
534 elseif( strtolower($usergroup['name']) == 'moderator' ) $default = $cans_moder;
535 elseif( strtolower($usergroup['name']) == 'registered' ) $default = $cans_reg;
536 elseif( strtolower($usergroup['name']) == 'guest' ) $default = $cans_guest;
537 elseif( strtolower($usergroup['name']) == 'customer' ) $default = $cans_customer;
538 if( !empty($default) ){
539 $data_update = array_merge($default, $current);
540 if( !empty($data_update) ){
541 $data_update = serialize($data_update);
542 $wpforo->db->query("UPDATE `".$wpforo->db->prefix."wpforo_usergroups` SET `cans` = '" . $wpforo->db->_real_escape($data_update) . "' WHERE `groupid` = " . intval($usergroup['groupid']) );
543 }
544 }
545 }
546 }
547 $sql = "SELECT COUNT(*) FROM `".$wpforo->db->prefix."wpforo_forums`";
548 $count = $wpforo->db->get_var($sql);
549 if(!$count){
550 if( $parentid = $wpforo->forum->add( array( 'title' => 'Main Category', 'description' => 'This is a simple category / section' ), FALSE ) ){
551 $wpforo->forum->add( array( 'title' => 'Main Forum', 'description' => 'This is a simple parent forum', 'parentid' => $parentid, 'icon' => 'fa-comments' ), FALSE );
552 }
553 }
554
555 #################################################################
556 // Permalink Settings ///////////////////////////////////////////
557 $permalink_structure = get_option( 'permalink_structure' );
558 if( !$permalink_structure ){
559 global $wp_rewrite;
560 $wp_rewrite->set_permalink_structure( '/%postname%/' );
561 }
562
563 #################################################################
564 // Creating Forum Page //////////////////////////////////////////
565 if( !$wpforo->pageid ||
566 !$wpforo->db->get_var("SELECT `ID` FROM `{$wpforo->db->prefix}posts` WHERE `ID` = '".intval($wpforo->pageid)."' AND ( `post_content` LIKE '%[wpforo]%' OR `post_content` LIKE '%[wpforo-index]%' ) AND `post_status` LIKE 'publish' AND `post_type` IN('post', 'page')") ){
567 if( !$page_id = $wpforo->db->get_var("SELECT `ID` FROM `{$wpforo->db->prefix}posts` WHERE `post_content` LIKE '%[wpforo]%' AND `post_status` LIKE 'publish' AND `post_type` IN('post', 'page')") ){
568 $wpforo_page = array(
569 'post_date' => current_time( 'mysql', 1 ),
570 'post_date_gmt' => current_time( 'mysql', 1 ),
571 'post_content' => '[wpforo]',
572 'post_title' => 'Forum',
573 'post_status' => 'publish',
574 'comment_status' => 'close',
575 'ping_status' => 'close',
576 'post_name' => 'community',
577 'post_modified' => current_time( 'mysql', 1 ),
578 'post_modified_gmt' => current_time( 'mysql', 1 ),
579 'post_parent' => 0,
580 'menu_order' => 0,
581 'post_type' => 'page'
582 );
583 $page_id = wp_insert_post( $wpforo_page );
584 }
585 if( $page_id && !is_wp_error($page_id) ){
586 update_option( 'wpforo_pageid', $page_id );
587 update_option( 'wpforo_use_home_url', '0' );
588 $wpforo_url = get_wpf_option('wpforo_url');
589 if( !$wpforo_url ){
590 update_option( 'wpforo_permastruct', 'community' );
591 update_option( 'wpforo_url', esc_url( home_url('/') ) . "community/" );
592 }else{
593 if( !$wpforo->permastruct ){
594 update_option( 'wpforo_permastruct', basename($wpforo_url) );
595 update_option( 'wpforo_url', esc_url( home_url('/') ) . basename($wpforo_url) . "/" );
596 }else{
597 update_option( 'wpforo_url', esc_url( home_url('/') ) . $wpforo->permastruct . "/" );
598 }
599 }
600 }
601 }else{
602 if( !$wpforo->use_home_url ) update_option( 'wpforo_use_home_url', '0' );
603 if( !$wpforo->permastruct ) update_option( 'wpforo_permastruct', basename( get_wpf_option('wpforo_url') ) );
604 $wpforo->db->query("UPDATE `{$wpforo->db->prefix}posts` SET `post_content` = REPLACE(`post_content`, '[wpforo-index]', '[wpforo]') WHERE `ID` = '{$wpforo->pageid}'");
605 }
606
607 $wpforo->pageid = get_wpf_option( 'wpforo_pageid');
608 $wpforo->permastruct = trim( get_wpf_option('wpforo_permastruct'), '/' );
609 flush_rewrite_rules(FALSE);
610 nocache_headers();
611
612
613 #################################################################
614 // Importing Language Packs and Phrases /////////////////////////
615 $wpforo->phrase->xml_import('english.xml', 'install');
616
617 #################################################################
618 // Creating wpforo folders //////////////////////////////////////
619 $upload_array = wp_upload_dir();
620 $wpforo_upload_dir = $upload_array['basedir'].'/wpforo/';
621 if (!is_dir($wpforo_upload_dir)) {
622 wp_mkdir_p($wpforo_upload_dir);
623 }
624 $avatars_upload_dir=$upload_array['basedir'].'/wpforo/avatars/';
625 if (!is_dir($avatars_upload_dir)) {
626 wp_mkdir_p($avatars_upload_dir);
627 }
628
629 #################################################################
630 // RESET USER CACHE /////////////////////////////////////////////
631 $wpforo->member->clear_db_cache();
632
633 #################################################################
634 // RESET FUNCTIONS //////////////////////////////////////////////
635 $sql = "SHOW COLUMNS FROM `".$wpdb->prefix."wpforo_phrases` WHERE `Field` LIKE 'package'";
636 if( !$wpdb->get_row($sql, ARRAY_A) ){
637 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_phrases` ADD COLUMN `package` VARCHAR(255) NOT NULL DEFAULT 'wpforo'";
638 @$wpdb->query( $sql );
639 }
640 $wpforo->phrase->clear_cache();
641
642 #################################################################
643 // ADD `private` field in TOPIC TABLE ///////////////////////////
644 $args = array( 'table' => $wpdb->prefix . 'wpforo_topics', 'col' => 'private', 'check' => 'col_exists' );
645 if( !wpforo_db_check( $args ) ){
646 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_topics` ADD `private` TINYINT(1) NOT NULL DEFAULT '0', ADD INDEX `is_private` (`private`);";
647 @$wpdb->query( $sql );
648 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_topics` ADD INDEX `own_private` ( `userid`, `private`);";
649 @$wpdb->query( $sql );
650 }
651 // ADD INDEXES in wpforo_views TABLE///////////////////////////
652 $args = array( 'table' => $wpdb->prefix . 'wpforo_views', 'col' => 'topicid', 'check' => 'key_exists' );
653 if( !wpforo_db_check( $args ) ){
654 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_views` ADD INDEX(`userid`);";
655 @$wpdb->query( $sql );
656 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_views` ADD INDEX(`topicid`);";
657 @$wpdb->query( $sql );
658 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_views` ADD UNIQUE( `userid`, `topicid`);";
659 @$wpdb->query( $sql );
660 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_likes` ADD UNIQUE( `userid`, `postid`);";
661 @$wpdb->query( $sql );
662 }
663 $args = array( 'table' => $wpdb->prefix . 'wpforo_views', 'col' => 'created', 'check' => 'col_type' );
664 $col_type = wpforo_db_check( $args );
665 if( $col_type != 'int(11)' ){
666 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_views` CHANGE `created` `created` INT(11) NOT NULL;";
667 @$wpdb->query( $sql );
668 }
669
670 // ADD `status` field in TOPICS & POSTS TABLE ///////////////////////////
671 $args = array( 'table' => $wpdb->prefix . 'wpforo_topics', 'col' => 'status', 'check' => 'col_exists' );
672 if( !wpforo_db_check( $args ) ){
673 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_topics` ADD `status` TINYINT(1) NOT NULL DEFAULT '0', ADD INDEX `status` (`status`);";
674 @$wpdb->query( $sql );
675 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_topics` ADD INDEX `forumid_status` ( `forumid`, `status`);";
676 @$wpdb->query( $sql );
677 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_posts` ADD `status` TINYINT(1) NOT NULL DEFAULT '0', ADD INDEX `status` (`status`);";
678 @$wpdb->query( $sql );
679 $sql = "ALTER TABLE `".$wpdb->prefix."wpforo_posts` ADD INDEX `topicid_status` ( `topicid`, `status`);";
680 @$wpdb->query( $sql );
681 }
682 // ADD `name` and `email` field in TOPIC TABLE ///////////////////////////
683 $args = array( 'table' => $wpdb->prefix . 'wpforo_topics', 'col' => 'name', 'check' => 'col_exists' );
684 if( !wpforo_db_check( $args ) ){
685 $sql = "ALTER TABLE `" . $wpdb->prefix . "wpforo_topics` ADD `name` VARCHAR(50) NOT NULL AFTER `status`, ADD `email` VARCHAR(50) NOT NULL AFTER `name`";
686 @$wpdb->query( $sql );
687 $sql = "ALTER TABLE `" . $wpdb->prefix . "wpforo_posts` ADD `name` VARCHAR(50) NOT NULL AFTER `status`, ADD `email` VARCHAR(50) NOT NULL AFTER `name`";
688 @$wpdb->query( $sql );
689 $sql = "ALTER TABLE `" . $wpdb->prefix . "wpforo_topics` ADD KEY `email` (`email`)";
690 @$wpdb->query( $sql );
691 $sql = "ALTER TABLE `" . $wpdb->prefix . "wpforo_posts` ADD KEY `email` (`email`)";
692 @$wpdb->query( $sql );
693 }
694 #################################################################
695 // UPDATE VERSION - END /////////////////////////////////////////
696 update_option('wpforo_version', WPFORO_VERSION);
697 $wpforo->notice->clear();
698 wpforo_clean_cache();
699 }
700
701
702 function wpforo_update() {
703 if ( get_option('wpforo_version') && WPFORO_VERSION !== get_option('wpforo_version') ) wpforo_activation();
704 }
705 add_action('wp_loaded', 'wpforo_update');
706
707
708 function wpforo_update_options( $option_key, $default, $exlude = array() ) {
709
710 $option = get_option( $option_key, array() );
711
712 if( !empty($option) ){
713 if( !empty($exlude) ){
714 foreach( $exlude as $key ){
715 if( isset($default[$key]) ) unset($default[$key]);
716 }
717 }
718 $option_update = array_merge($default, $option);
719 }
720 else{
721 $option_update = $default;
722 }
723
724 update_option( $option_key, $option_update );
725 }
726
727
728 function wpforo_deactivation() {}
729
730
731 function wpforo_uninstall() {
732
733 global $wpforo, $wpdb;
734
735 if( ! wpforo_is_admin() ) return;
736 if( ! current_user_can( 'activate_plugins' ) ) return;
737 $QUERY_STRING = trim(preg_replace('|_wpnonce=[^\&\?\=]*|is', '', $_SERVER['QUERY_STRING']), '&');
738
739 if( 'action=wpforo-uninstall' == trim($QUERY_STRING) ){
740
741 $tables = array( $wpdb->prefix . 'wpforo_accesses',
742 $wpdb->prefix . 'wpforo_forums',
743 $wpdb->prefix . 'wpforo_languages',
744 $wpdb->prefix . 'wpforo_likes',
745 $wpdb->prefix . 'wpforo_phrases',
746 $wpdb->prefix . 'wpforo_profiles',
747 $wpdb->prefix . 'wpforo_posts',
748 $wpdb->prefix . 'wpforo_subscribes',
749 $wpdb->prefix . 'wpforo_topics',
750 $wpdb->prefix . 'wpforo_usergroups',
751 $wpdb->prefix . 'wpforo_views',
752 $wpdb->prefix . 'wpforo_votes');
753
754 foreach($tables as $table){
755 if( strpos( $table, '_wpforo_' ) !== FALSE){
756 $sql = "DROP TABLE IF EXISTS `$table`;";
757 $wpdb->query( $sql );
758 }
759 }
760
761 if( isset($wpforo->pageid) && $wpforo->pageid ){
762 wp_delete_post( $wpforo->pageid, true );
763 }
764
765 $options = array( 'wpforo_version',
766 'wpforo_url',
767 'wpforo_stat',
768 'wpforo_general_options',
769 'wpforo_pageid',
770 'wpforo_count_per_page',
771 'wpforo_default_groupid',
772 'wpforo_usergroup_cans',
773 'wpforo_forum_options',
774 'wpforo_forum_cans',
775 'wpforo_post_options',
776 'wpforo_member_options',
777 'wpforo_subscribe_options',
778 'wpforo_countries',
779 'wpforo_theme_options',
780 'wpforo_features',
781 'wpforo_style_options',
782 'wpforo_permastruct',
783 'wpforo_use_home_url',
784 'wpforo_excld_urls',
785 'wpforo_tools_antispam',
786 'wpforo_tools_cleanup'
787 );
788
789 foreach($options as $option){
790 if( strpos( $option, 'wpforo_' ) !== FALSE){
791 delete_option( $option );
792 }
793 }
794
795 $wpdb->query( "DELETE FROM `" . $wpdb->base_prefix ."usermeta` WHERE `meta_key` = '_wpf_member_obj'" );
796 $wpdb->query( "DELETE FROM `" . $wpdb->prefix ."options` WHERE option_name LIKE 'widget_wpforo_widget_%'" );
797
798 $menu = wp_get_nav_menu_object( 'wpforo-navigation' );
799 wp_delete_nav_menu( $menu->term_id );
800 wp_delete_post($wpforo->pageid, TRUE);
801
802 deactivate_plugins( WPFORO_BASENAME );
803
804 }
805 else{
806 return;
807 }
808 }
809
810 function wpforo_profile_notice(){
811 global $wpdb;
812 $button = '';
813 $users = $wpdb->get_var("SELECT COUNT(*) FROM `" . $wpdb->prefix . "users`");
814 $profiles = $wpdb->get_var("SELECT COUNT(*) FROM `" . $wpdb->prefix . "wpforo_profiles`");
815 $delta = $users - $profiles;
816 $status = ( $delta > 2 ) ? round((( $profiles * 100 ) / $users ), 1) . '% (' . $profiles . ' / ' . $users . ') ' : '100%';
817 $btext = ( $profiles == 0 ) ? __( 'Start Profile Synchronization', 'wpforo') : __( 'Continue Synchronization', 'wpforo');
818 $url = admin_url('admin.php?page=wpforo-community&action=synch');
819 $class = 'wpforo-mnote notice notice-warning is-dismissible';
820 $note = __( 'This process may take a few seconds or dozens of minutes, please be patient and don\'t close this page.', 'wpforo');
821 $info = __( 'You can permanently disable this message in Dashboard > Forums > Features admin page.', 'wpforo');
822 $button = '<a href="' . $url . '" class="button button-primary button-large" style="font-size:14px;">' . $btext . ' &gt;&gt;</a>';
823 $header = __( 'wpForo Forum Installation | ', 'wpforo' );
824 $message = __( 'Forum users\' profile data are not synchronized yet, this step is required! Please click the button below to complete installation.', 'wpforo' );
825 echo '<div class="' . $class . '" style="padding:15px 20px;"><h2 style="margin:0px;">' . esc_html($header) . $status . ' </h2><p style="font-size:15px;margin:5px 0px;">' . $message . '</p><p style="margin:0px 0px 10px 0px;">' . $button . '</p><hr /><p style="margin:0px;color:#dd0000;">' . $note . '</p><p style="margin:0px;color:#999; font-size:12px;">' . $info . '</p></div>';
826 }
827
828 ?>