function izap_bridge_init() { global $CONFIG; //including venders directory in default include paths. set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/vendors/'); // initializes the bridge plugin izap_plugin_init(GLOBAL_IZAP_ELGG_BRIDGE); //registering tab view javascript elgg_register_js('jquery.md5', 'mod/izap-elgg-bridge/vendors/tabs_view.js'); //load library for the bridge(using bridge) IzapBase::loadLib(array('plugin' => GLOBAL_IZAP_ELGG_BRIDGE, 'lib' => 'init')); // over-ride "admin" pagehandler elgg_register_page_handler('admin', GLOBAL_IZAP_PAGEHANDLER); // register some basic hooks elgg_register_plugin_hook_handler('register', 'user', 'izap_registration_sniffer'); elgg_register_event_handler('login', 'user', 'izap_login_sniffer'); elgg_register_event_handler('create', 'all', 'izap_entity_creation_sniffer'); elgg_register_event_handler('update', 'all', 'izap_entity_updation_sniffer'); elgg_register_event_handler('delete', 'all', 'izap_entity_deletion_sniffer'); elgg_register_event_handler('ready', 'system', 'system_ready_hook'); elgg_register_plugin_hook_handler('config', 'htmlawed', 'izap_htmlawed_hook'); // set pages for the admin elgg_register_admin_menu_item('administer', 'marked-spammers', 'users'); // @todo: merge to izap menu elgg_register_admin_menu_item('administer', 'suspected-spammers', 'users'); // @todo: merge to izap menu /** * common horizontal control menu hook registration for all plugins dependent * on izap-elgg-bridge */ elgg_register_plugin_hook_handler('register', 'menu:entity', 'izap_entity_menu_setup'); elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'izap_mark_spammer'); elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'izap_unmark_spammer'); elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'izap_suspected_spammer'); elgg_extend_view('page/elements/footer', GLOBAL_IZAP_ELGG_BRIDGE . '/our_link'); if (elgg_is_admin_logged_in()) { if (IzapBase::pluginSetting(array('name' => 'izap_api_key', 'plugin' => GLOBAL_IZAP_ELGG_BRIDGE)) == '') { elgg_add_admin_notice('api_key', elgg_echo('izap-bridge:add_api')); } } $global_currency = IzapBase::pluginSetting(array('name' => 'izap_site_currency', 'plugin' => GLOBAL_IZAP_ELGG_BRIDGE)); if ($global_currency == '') { $CONFIG->site_currency_name = 'USD'; $CONFIG->SITE_CURRENCY_SIGN = '$'; } else { $site_currency = explode(':', $global_currency); $CONFIG->site_currency_name = $site_currency[0]; $CONFIG->site_currency_sign = $site_currency[1]; } // regiter antispam with elgg elgg_register_ajax_view('/js/antispam/userstats'); }
<p> <label> <?php echo elgg_echo('izap-bridge:maximum_pings_for_spammer'); echo '<br />'; echo elgg_view('input/text', array('name' => 'params[izap_maximum_pings_for_spammer]', 'value' => IzapBase::pluginSetting(array('name' => 'izap_maximum_pings_for_spammer', 'value' => '3', 'plugin' => GLOBAL_IZAP_ELGG_BRIDGE)))); ?> </label> <br /> <?php echo elgg_echo('izap-bridge:maximum_pings_for_spammer_msg'); ?> </p> <p> <label> <?php echo elgg_echo('izap-bridge:action_to_spammers'); ?> </label> <?php echo elgg_view('input/radio', array('name' => 'params[izap_take_action_to_spammer]', 'options' => array(elgg_echo('izap-bridge:spammer_act_yes') => 'yes', elgg_echo('izap-bridge:spammer_act_no') => 'no'), 'value' => IzapBase::pluginSetting(array('name' => 'izap_take_action_to_spammer', 'value' => 'no', 'plugin' => GLOBAL_IZAP_ELGG_BRIDGE)))); ?> </p> <?php } ?> </fieldset>
public function markSpammer() { register_error(elgg_echo('izap-antispam:spammer_notice')); $this->user->izap_is_spammer = 'yes'; if (IzapBase::pluginSetting(array('name' => 'izap_take_action_to_spammer', 'value' => 'no', 'plugin' => GLOBAL_IZAP_ELGG_BRIDGE)) == 'yes') { set_input('guid', $this->user->guid); include $this->action_file; } }