Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function activate_old($network_wide){
- $actKey = $this->slug.'_activat';
- $show_die=isset($_GET['action']) && $_GET['action']=='error_scrape';
- //if activation allowed from only on multisite or singlesite or Both?
- if(!$show_die)
- {
- if (get_site_option($actKey))
- {
- $show_die=true;
- delete_site_option($actKey);
- }
- else
- {
- $show_die= ! $this->if_correct_activable($network_wide) ;
- if($show_die)
- {
- //update_site_option($actKey,true);
- }
- }
- }
- if($show_die) {
- $text= '<h2>('.$this->opts['name'].') '. $this->static_settings['menu_text']['activated_only_from']. ' <b style="color:red;">'.strtoupper($this->opts['allowed_on']).'</b> </h2>';
- //$text .= '<script>alert("'.strip_tags($text).'");</script>';
- die($text);
- }
- //$this->plugin_updated_hook();
- if(method_exists($this, 'activation_funcs') ) { $this->activation_funcs(); }
- }
- public function if_correct_activable($network_wide=false)
- {
- return !is_multisite() ? true : ( $this->initial_static_options['allowed_on'] == 'both' ? true : ( ($this->initial_static_options['allowed_on'] =='network' && is_network_admin() ) || ( $this->initial_static_options['allowed_on'] =='singlesite' && (!$network_wide && !is_network_admin()) ) ) );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement