Guest User

Untitled

a guest
Jun 2nd, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. #################### activate function ##########################
  2. function sb_activate_plugin(){ //runs only after MANUAL activation!
  3.     global $wpdb, $sb_ip_log, $sb_banned_message_default;
  4.     add_action('admin_notices', 'sb_activation_notice'); //show activation message
  5.  
  6.     add_option('sb_plugin_version', sb_get_plugin_version(), '', 'yes');
  7.     add_option('sb_detection_of_spammers_method', '1', '', 'yes');
  8.     add_option('sb_detection_of_spammers_time', '2592000', '', 'yes');
  9.     add_option('sb_banned_message', "$sb_banned_message_default", '', 'yes');
  10.         //v1.4:
  11.     add_option('sb_automatic_ip_address_duplication', '0', '', 'yes');
  12.     add_option('sb_automatic_ip_address_duplication_recurrence', 'twicedaily', '', 'yes');
  13.     add_option('sb_spam_comment_automatic_elimination', '1', '', 'yes');
  14.     add_option('sb_automatic_ip_address_duplication_last_cron_run_time', '', '', 'yes');
  15.         //v1.5
  16.     add_option('sb_access_restrictions', '1', '', 'yes'); //automatic using comments posting restriction
  17.  
  18.     sb_create_db_table();
  19.  
  20.     $wpdb->query("INSERT IGNORE INTO $sb_ip_log (id, ip, last_visit, hits) SELECT comment_ID, comment_author_IP, comment_date, 1 FROM $wpdb->comments WHERE comment_approved='spam'"); //copies all IP addresses to $sb_ip_log
  21. }
Advertisement
Add Comment
Please, Sign In to add comment