/** * function action_plugin_activation * adds the optional options to configure Spamspan **/ public function action_plugin_activation($file) { if (realpath($file) == __FILE__) { Options::set('spamspan__at', '[@]'); Options::set('spamspan__graphics', 0); } }
public function testRequires_upgrade() { Options::set('db_version', Version::DB_VERSION - 1); $this->assertEquals(true, Version::requires_upgrade()); Options::set('db_version', Version::DB_VERSION); $this->assertEquals(false, Version::requires_upgrade()); }
/** * function action_plugin_activation * adds the "deleted" status type to the poststatus table * when this plugin is activated. **/ public function action_plugin_activation($file) { if (realpath($file) == __FILE__) { Post::add_new_status('deleted', true); Options::set('undelete__style', '#primarycontent .deleted { background-color: #933; text-decoration: line-through; }'); } }
/** * action: plugin_activation * * @access public * @param string $file * @return void */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) { return; } Options::set('calendar__week_start', 0); }
/** * When Plugin is activated insert default options */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) { Options::set('syntax__default_lang', 'php'); Options::set('syntax__line_numbers', ''); } }
public function filter_default_rewrite_rules($rules) { if ($this->current_load() > self::KILL_LOAD) { foreach ($rules as $key => $rule) { if (strpos($rule['build_str'], 'admin') !== false) { $rules[$key]['handler'] = 'UserThemeHandler'; $rules[$key]['action'] = 'display_throttle'; } } if (Options::get('throttle') == '') { EventLog::log(sprintf(_t('Kill - Load is %s'), $this->current_load())); Options::set('throttle', 'kill'); } } elseif ($this->current_load() > self::MAX_LOAD) { foreach ($rules as $key => $rule) { if ($rule['name'] == 'search') { unset($rules[$key]); } } $rules[] = array('name' => 'search', 'parse_regex' => '%^search(?:/(?P<criteria>[^/]+))?(?:/page/(?P<page>\\d+))?/?$%i', 'build_str' => 'search(/{$criteria})(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_throttle', 'priority' => 8, 'description' => 'Searches posts'); if (Options::get('throttle') == '') { EventLog::log(sprintf(_t('Restrict - Load is %s'), $this->current_load())); Options::set('throttle', 'restrict'); } } else { if (Options::get('throttle') != '') { EventLog::log(sprintf(_t('Normal - Load is %s'), $this->current_load())); Options::set('throttle', ''); } } return $rules; }
/** * action: plugin_activation * * @access public * @param string $file * @return void */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) { return; } Options::set('socialink__link_pos', 'top'); Options::set('socialink__services', serialize(array('digg', 'delicious', 'technorati', 'google', 'yahoo', 'furl', 'reddit', 'magnolia'))); }
/** * action: plugin_activation * * @access public * @param string $file */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) { return; } Options::set('photozousilo__username', ''); Options::set('photozousilo__password', ''); }
public function action_plugin_activation($file) { if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) { return; } Options::set('woopra__tag_registered', false); Options::set('woopra__display_avatar', 'no'); }
/** * On plugin activation, pick a random quote file. **/ public function action_plugin_activation($file) { if (Options::get(self::OPTION_NAME) == null) { $files = array(); $files = glob($this->get_path() . "/files/*.xml"); Options::set(self::OPTION_NAME, basename($files[rand(0, count($files) - 1)], ".xml")); } }
public function action_plugin_activation($file) { if (realpath($file) == __FILE__) { Modules::add('Technorati'); Session::notice(_t('Please set your Technorati API Key in the configuration.')); Options::set('technorati__apikey', ''); } }
public function update_settings() { $allowed = array('base_url', 'theme_path', 'timezone', 'log_path', 'pagination'); $options = array_intersect_key($_POST, array_fill_keys($allowed, true)); foreach ($options as $name => $value) { Options::set($name, $value); } }
public function action_plugin_activation($file) { if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) { if (Options::get('dateyurl__format') == null) { Options::set('dateyurl__format', 'date'); } } }
/** * On activation, check and set default options */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) { foreach (self::default_options() as $name => $value) { Options::set('jambo__' . $name, $value); } } }
public function action_plugin_activation($file) { if (realpath($file) == __FILE__) { Modules::add('GetClicky'); Options::set('getclicky__cachetime', '300'); Options::set('getclicky__loggedin', 1); } }
/** * Set default options **/ public function action_plugin_activation($file) { if (realpath($file) == __FILE__) { Options::set('key_nav_paging_error', '100'); Options::set('key_nav_delay', '100'); Options::set('key_nav_selector', 'div.post'); } }
/** * Set options when the plugin is activated */ public function action_plugin_activation($file) { if (realpath($file) == __FILE__) { Options::set(self::OPTION_NAME . '__text', _t("We're down for maintenance. Please return later.")); Options::set(self::OPTION_NAME . '__in_maintenance', FALSE); Options::set(self::OPTION_NAME . '__display_feeds', FALSE); } }
/** * Sets default to always show themeswitcher in footer if not using $theme->swithcer(); **/ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) { if (Options::get('themeswitcher__show') == null) { Options::set('themeswitcher__show', 1); } } }
/** * Sets default values for notify_all options and userinfo * Users will receive email notifications of new posts and comments by default */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) { Options::set('notify_all__notify_posts', 1); Options::set('notify_all__notify_comments', 1); Options::set('notify_all__user_can_override', 1); } }
/** * Set the default packages on plugin activation. */ public function action_plugin_activation($file) { if ($file == $this->get_file()) { if (!Options::get(self::OPTION_NAME)) { Options::set(self::OPTION_NAME, self::DEFAULT_PACKAGE); } } }
/** * action: plugin_activation * * @access public * @param string $file * @return void */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) { return; } Options::set('dnsbl__ipbl', "dnsbl.spam-champuru.livedoor.com"); // URL blacklist not implemented, perhaps for the future? // Options::set('dnsbl__urlbl', "bsb.spamlookup.net"); }
/** * action: plugin_activation * * @access public * @param string $file * @return void */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) { return; } Options::set('amazon__country', 'com'); Options::set('amazon__associate_tag', ''); Options::set('amazon__template', 'reviewsummary'); }
/** * action: plugin_activation * * @access public * @param string $file * @return void */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) { return; } Options::set('dropiosilo__api_key', ''); Options::set('dropiosilo__drop_name', ''); Options::set('dropiosilo__password', ''); }
public function action_plugin_activation($file) { // set the default options Options::set('lipsum__num_posts', 20); Options::set('lipsum__num_comments', 6); Options::set('lipsum__num_tags', 10); // and create the default number of posts $this->update_num_posts(20); }
public function action_plugin_activation($file) { $option = array(); foreach ($this->acronyms as $acronym => $text) { $option[] = $acronym . '||' . $text; } $option = implode("\n", $option); Options::set('acronyms__acronyms', $option); }
public function action_plugin_activation($file) { if (realpath($file) == __FILE__) { EventLog::register_type('PreApproved'); if (!Options::get('preapproved__approved_count')) { Options::set('preapproved__approved_count', 1); } } }
/** * action: plugin_activation * * @access public * @param string $file * @return void */ public function action_plugin_activation($file) { if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) { return; } Options::set('twitter_avatar__cache_expire', 24); Options::set('twitter_avatar__default_icon', ''); Options::set('twitter_avatar__fallback_gravatar', true); }
/** * Initialization, useful to check for options * * @return void **/ public function action_init() { if (Options::get('spamview__spambutton') === NULL) { Options::set('spamview__spambutton', true); } if (Options::get('spamview__logbutton') === NULL) { Options::set('spamview__logbutton', false); } }
/** * action_plugin_activation * Registers the core modules with the Modules class. * @param string $file plugin file */ function action_plugin_activation($file) { if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) { Modules::add('My Tickets'); if (Options::get('tracdashmodule__trac_query') == null) { Options::set('tracdashmodule__trac_query', 'enter query'); } } }
/** * install various stuff we need */ public static function install() { Post::add_new_type('link'); // Give anonymous users access $group = UserGroup::get_by_name('anonymous'); $group->grant('post_link', 'read'); // Set default settings Options::set('linkblog__original', '<p><a href="{permalink}">Permalink</a></p>'); Options::set('linkblog__atom_permalink', false); self::database(); }