ElkArte Community

Extending Elk => Addons => Topic started by: emanuele on November 11, 2014, 08:16:05 am

Title: Temporary hooks listing/documentation
Post by: emanuele on November 11, 2014, 08:16:05 am
Proper documentation of hooks is still not yet in place, so for the moment I'll post here a quick and dirty grep of the code, it will at least be a reference to know there is "something", if you have any question, feel free to ask, it will be an opportunity to write down some lines and that will become part of the documentation! ;D
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on November 11, 2014, 08:16:22 am
index.php:call_integration_hook('integrate_pre_log_stats', array(&$no_stat_actions));
sources/Session.php:call_integration_hook('integrate_session_handlers');
sources/Load.php:call_integration_hook('integrate_load_average', array($modSettings['load_average']));
sources/Load.php:call_integration_hook('integrate_pre_load');
sources/Load.php:if (count($integration_ids = call_integration_hook('integrate_verify_user')) > 0)
sources/Load.php:call_integration_hook('integrate_user_info');
sources/Load.php:call_integration_hook('integrate_load_board_query', array(&$select_columns, &$select_tables));
sources/Load.php:call_integration_hook('integrate_loaded_board', array(&$board_info, &$row));
sources/Load.php:call_integration_hook('integrate_load_member_data', array(&$select_columns, &$select_tables, $set));
sources/Load.php:call_integration_hook('integrate_add_member_data', array($new_loaded_ids, $set));
sources/Load.php:call_integration_hook('integrate_member_context', array($user, $display_custom_fields));
sources/Load.php:call_integration_hook('integrate_simple_actions', array(&$simpleActions));
sources/Load.php:call_integration_hook('integrate_init_theme', array($id_theme, &$settings));
sources/Load.php:call_integration_hook('integrate_load_theme');
sources/SiteDispatcher.class.php:call_integration_hook('integrate_action_frontpage', array(&$default_action));
sources/SiteDispatcher.class.php:call_integration_hook('integrate_actions', array(&$actionArray, &$adminActions));
sources/SiteDispatcher.class.php:call_integration_hook('integrate_action_' . $hook . '_before', array($this->_function_name));
sources/SiteDispatcher.class.php:call_integration_hook('integrate_action_boardindex_before');
sources/SiteDispatcher.class.php:call_integration_hook('integrate_action_boardindex_after');
sources/SiteDispatcher.class.php:call_integration_hook('integrate_action_' . $hook . '_after', array($this->_function_name));
sources/controllers/Stats.controller.php:call_integration_hook('integrate_forum_stats');
sources/controllers/ProfileInfo.controller.php:call_integration_hook('integrate_profile_summary', array($memID));
sources/controllers/ProfileInfo.controller.php:call_integration_hook('integrate_profile_stats', array($memID));
sources/controllers/Display.controller.php:call_integration_hook('integrate_topic_query', array(&$topic_selects, &$topic_tables, &$topic_parameters));
sources/controllers/Display.controller.php:call_integration_hook('integrate_display_topic', array($topicinfo));
sources/controllers/Display.controller.php:call_integration_hook('integrate_poll_buttons');
sources/controllers/Display.controller.php:call_integration_hook('integrate_display_message_list', array(&$messages, &$posters));
sources/controllers/Display.controller.php:call_integration_hook('integrate_message_query', array(&$msg_selects, &$msg_tables, &$msg_parameters));
sources/controllers/Display.controller.php:call_integration_hook('integrate_display_buttons');
sources/controllers/Display.controller.php:call_integration_hook('integrate_mod_buttons');
sources/controllers/Display.controller.php:call_integration_hook('integrate_prepare_display_context', array(&$output, &$message));
sources/controllers/Register.controller.php:call_integration_hook('integrate_activate', array($regOptions['username']));
sources/controllers/Register.controller.php:call_integration_hook('integrate_activate', array($row['member_name']));
sources/controllers/Reminder.controller.php:call_integration_hook('integrate_reset_pass', array($member['member_name'], $member['member_name'], $_POST['passwrd1']));
sources/controllers/Reminder.controller.php:call_integration_hook('integrate_reset_pass', array($member['member_name'], $member['member_name'], $_POST['passwrd1']));
sources/controllers/Emailpost.controller.php:call_integration_hook('integrate_mailist_checks_before', array($email_message, $pbe));
sources/controllers/Emailpost.controller.php:call_integration_hook('integrate_mailist_checks_before', array($email_message, $pbe));
sources/controllers/Poll.controller.php:call_integration_hook('integrate_poll_vote', array(&$row['id_poll'], &$pollOptions));
sources/controllers/Poll.controller.php:call_integration_hook('integrate_poll_add_edit', array($bcinfo['id_poll'], $isEdit));
sources/controllers/Poll.controller.php:call_integration_hook('integrate_poll_remove', array($pollID));
sources/controllers/ProfileAccount.controller.php:call_integration_hook('integrate_activate', array($user_profile[$memID]['member_name']));
sources/controllers/Mentions.controller.php:call_integration_hook('integrate_add_mention', array(&$this->_known_mentions));
sources/controllers/BoardIndex.controller.php:call_integration_hook('integrate_mark_read_button');
sources/controllers/Calendar.controller.php:call_integration_hook('integrate_calendar_buttons');
sources/controllers/Profile.controller.php:$good_password = in_array(true, call_integration_hook('integrate_verify_password', array($cur_profile['member_name'], $_POST['oldpasswrd'], false)), true);
sources/controllers/Profile.controller.php:call_integration_hook('integrate_profile_save', array(&$profile_vars, &$post_errors, $memID));
sources/controllers/Profile.controller.php:call_integration_hook('integrate_reset_pass', array($cur_profile['member_name'], $cur_profile['member_name'], $_POST['passwrd2']));
sources/controllers/Help.controller.php:call_integration_hook('integrate_quickhelp');
sources/controllers/Auth.controller.php:if (in_array('retry', call_integration_hook('integrate_validate_login', array($_POST['user'], isset($_POST['hash_passwrd']) && strlen($_POST['hash_passwrd']) == 40 ? $_POST['hash_passwrd'] : null, $modSettings['cookieTime'])), true))
sources/controllers/Auth.controller.php:call_integration_hook('integrate_logout', array($user_settings['member_name']));
sources/controllers/Auth.controller.php:call_integration_hook('integrate_validateSession', array(&$types));
sources/controllers/Auth.controller.php:call_integration_hook('integrate_other_passwords', array(&$other_passwords));
sources/controllers/Auth.controller.php:call_integration_hook('integrate_login', array($user_settings['member_name'], isset($_POST['hash_passwrd']) && strlen($_POST['hash_passwrd']) == 64 ? $_POST['hash_passwrd'] : null, $modSettings['cookieTime']));
sources/controllers/Search.controller.php:call_integration_hook('integrate_search');
sources/controllers/Search.controller.php:call_integration_hook('integrate_search_sort_columns', array(&$sort_columns));
sources/controllers/Search.controller.php:call_integration_hook('integrate_search_params', array(&$search_params));
sources/controllers/Search.controller.php:call_integration_hook('integrate_search_blacklisted_words', array(&$blacklisted_words));
sources/controllers/Search.controller.php:call_integration_hook('integrate_search_errors');
sources/controllers/Search.controller.php:call_integration_hook('integrate_subject_only_search_query', array(&$subject_query, &$subject_query_params));
sources/controllers/Search.controller.php:call_integration_hook('integrate_subject_search_query', array(&$subject_query));
sources/controllers/Search.controller.php:call_integration_hook('integrate_main_search_query', array(&$main_query));
sources/controllers/Search.controller.php:call_integration_hook('integrate_search_message_list', array(&$msg_list, &$posters));
sources/controllers/Search.controller.php:call_integration_hook('integrate_quick_mod_actions_search');
sources/controllers/Search.controller.php:call_integration_hook('integrate_search_message_context', array($counter, &$output));
sources/controllers/Search.controller.php:call_integration_hook('integrate_search_weights', array(&$this->_weight_factors));
sources/controllers/Members.controller.php:call_integration_hook('integrate_add_buddies', array($user_info['id'], &$user));
sources/controllers/Members.controller.php:call_integration_hook('integrate_remove_buddy', array($user_info['id']));
sources/controllers/MessageIndex.controller.php:call_integration_hook('integrate_messageindex_topics', array(&$sort_column, &$indexOptions));
sources/controllers/MessageIndex.controller.php:call_integration_hook('integrate_messageindex_listing', array($topics_info));
sources/controllers/MessageIndex.controller.php:call_integration_hook('integrate_quick_mod_actions');
sources/controllers/MessageIndex.controller.php:call_integration_hook('integrate_messageindex_buttons');
sources/controllers/Memberlist.controller.php:call_integration_hook('integrate_memberlist_buttons');
sources/controllers/Suggest.controller.php:call_integration_hook('integrate_autosuggest', array(&$searchTypes));
sources/controllers/ProfileOptions.controller.php:call_integration_hook('integrate_remove_buddy', array($memID));
sources/controllers/ProfileOptions.controller.php:call_integration_hook('integrate_add_buddies', array($memID, &$new_buddies));
sources/controllers/ProfileOptions.controller.php:call_integration_hook('integrate_view_buddies', array($memID));
sources/controllers/ProfileOptions.controller.php:call_integration_hook('integrate_reset_pass', array($cur_profile['member_name'], $cur_profile['member_name'], $_POST['passwrd1']));
sources/controllers/Recent.controller.php:call_integration_hook('integrate_recent_message_list', array($messages, &$permissions));
sources/controllers/Recent.controller.php:call_integration_hook('integrate_recent_buttons');
sources/controllers/Recent.controller.php:call_integration_hook('integrate_unread_list');
sources/controllers/PersonalMessage.controller.php:call_integration_hook('integrate_conversation_buttons');
sources/controllers/News.controller.php:call_integration_hook('integrate_xmlfeeds', array(&$subActions));
sources/controllers/News.controller.php:call_integration_hook('integrate_fix_url', array(&$val));
sources/Security.php:call_integration_hook('integrate_validateSession', array(&$types));
sources/Security.php:$good_password = in_array(true, call_integration_hook('integrate_verify_password', array($user_info['username'], $_POST[$type . '_hash_pass'], true)), true);
sources/Security.php:$good_password = in_array(true, call_integration_hook('integrate_verify_password', array($user_info['username'], $_POST[$type . '_pass'], false)), true);
sources/Security.php:call_integration_hook('integrate_post_ban_permissions', array(&$denied_permissions));
sources/Security.php:call_integration_hook('integrate_warn_permissions', array(&$permission_change));
sources/Security.php:call_integration_hook('integrate_spam_protection', array(&$timeOverrides));
sources/Subs.php:call_integration_hook('integrate_change_member_data', array($member_names, &$var, &$data[$var], &$knownInts, &$knownFloats));
sources/Subs.php:call_integration_hook('integrate_pre_parsebbc', array(&$message, &$smileys, &$cache_id, &$parse_tags));
sources/Subs.php:call_integration_hook('integrate_bbc_codes', array(&$codes, &$no_autolink_tags, &$itemcodes));
sources/Subs.php:call_integration_hook('integrate_post_parsebbc', array(&$message, &$smileys, &$cache_id, &$parse_tags));
sources/Subs.php:call_integration_hook('integrate_redirect', array(&$setLocation, &$refresh));
sources/Subs.php:call_integration_hook('integrate_exit', array($do_footer));
sources/Subs.php:call_integration_hook('pre_javascript_output');
sources/Subs.php:call_integration_hook('pre_css_output');
sources/Subs.php:call_integration_hook('integrate_menu_buttons', array(&$buttons, &$menu_count));
sources/Subs.php:call_integration_hook('integrate_current_action', array(&$current_action));
sources/Subs.php:call_integration_hook('integrate_basic_url_replacement', array(&$find, &$replace));
sources/ErrorContext.class.php:call_integration_hook('integrate_' . $this->_name . '_errors', array(&$this->_errors, &$this->_severity_levels));
sources/Logging.php:call_integration_hook('integrate_log_types', array(&$log_types));
sources/Errors.php:call_integration_hook('integrate_error_types', array(&$other_error_types));
sources/Errors.php:call_integration_hook('integrate_output_error', array($message, $error_type, $error_level, $file, $line));
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on November 11, 2014, 08:16:55 am
sources/subs/ManagePermissions.subs.php:call_integration_hook('integrate_load_permissions', array(&$permissionGroups, &$permissionList, &$leftPermissionGroups, &$hiddenPermissions, &$relabelPermissions));
sources/subs/Menu.subs.php:call_integration_hook('integrate_' . $menuOptions['hook'] . '_areas', array(&$menuData, &$menuOptions));
sources/subs/Profile.subs.php:call_integration_hook('integrate_' . $hook . '_profile_fields', array(&$fields));
sources/subs/Profile.subs.php:call_integration_hook('integrate_load_custom_profile_fields', array($memID, $area));
sources/subs/Profile.subs.php:call_integration_hook('integrate_load_profile_fields', array(&$profile_fields));
sources/subs/Profile.subs.php:call_integration_hook('integrate_save_custom_profile_fields', array(&$changes, &$log_changes, $memID, $area, $sanitize));
sources/subs/Permission.subs.php:call_integration_hook('integrate_load_illegal_permissions');
sources/subs/Permission.subs.php:call_integration_hook('integrate_load_illegal_guest_permissions');
sources/subs/MessageIndex.subs.php:call_integration_hook('integrate_messageindex_sort', array(&$sort_methods));
sources/subs/MessageIndex.subs.php:call_integration_hook('integrate_messageindex_icons', array(&$stable_icons));
sources/subs/GenericList.class.php:call_integration_hook('integrate_list_' . $listOptions['id'], array(&$listOptions));
sources/subs/Themes.subs.php:call_integration_hook('integrate_init_theme', array($id_theme, &$settings));
sources/subs/VerificationControls.class.php:call_integration_hook('integrate_control_verification', array(&$known_verifications));
sources/subs/Categories.subs.php:call_integration_hook('integrate_pre_modify_category', array($cat_id, &$catOptions));
sources/subs/Categories.subs.php:call_integration_hook('integrate_modify_category', array($cat_id, &$catUpdates, &$catParameters));
sources/subs/Categories.subs.php:call_integration_hook('integrate_create_category', array(&$catOptions, &$cat_columns, &$cat_parameters));
sources/subs/Categories.subs.php:call_integration_hook('integrate_delete_category', array($categories, &$moveBoardsTo));
sources/subs/Who.subs.php:call_integration_hook('integrate_whos_online_allowed', array(&$allowedActions));
sources/subs/Who.subs.php:if (count($integrate_actions = call_integration_hook('integrate_whos_online', array($actions))) > 0)
sources/subs/Who.subs.php:call_integration_hook('integrate_credits', array(&$credits));
sources/subs/ManageAttachments.subs.php:call_integration_hook('integrate_approve_attachments', array($attachments));
sources/subs/ManageAttachments.subs.php:call_integration_hook('integrate_remove_attachments', array($attach));
sources/subs/Attachments.subs.php:call_integration_hook('integrate_attachment_upload');
sources/subs/Bans.subs.php:call_integration_hook('integrate_load_additional_ip_ban', array(&$search_list));
sources/subs/Mail.subs.php:if (in_array(false, call_integration_hook('integrate_outgoing_email', array(&$subject, &$message, &$headers)), true))
sources/subs/Poll.subs.php:call_integration_hook('integrate_poll_add_edit', array($id_poll, false));
sources/subs/Poll.subs.php:call_integration_hook('integrate_poll_add_edit', array($id_poll, true));
sources/subs/Cache.subs.php:call_integration_hook('pre_cache_quick_get', array(&$key, &$file, &$function, &$params, &$level));
sources/subs/Cache.subs.php:call_integration_hook('post_cache_quick_get', array($cache_block));
sources/subs/Cache.subs.php:call_integration_hook('cache_put_data', array($key, $value, $ttl));
sources/subs/Cache.subs.php:call_integration_hook('cache_get_data', array($key, $ttl, $value));
sources/subs/Cache.subs.php:call_integration_hook('integrate_clean_cache');
sources/subs/Post.subs.php:call_integration_hook('integrate_preparse_code', array(&$parts[$i], $i, $previewing));
sources/subs/Post.subs.php:call_integration_hook('integrate_unpreparse_code', array(&$message, &$parts, &$i));
sources/subs/Post.subs.php:call_integration_hook('integrate_fixtags', array(&$fixArray, &$message));
sources/subs/Post.subs.php:call_integration_hook('integrate_before_create_post', array(&$msgOptions, &$topicOptions, &$posterOptions, &$message_columns, &$message_parameters));
sources/subs/Post.subs.php:call_integration_hook('integrate_create_post', array($msgOptions, $topicOptions, $posterOptions, $message_columns, $message_parameters));
sources/subs/Post.subs.php:call_integration_hook('integrate_before_create_topic', array(&$msgOptions, &$topicOptions, &$posterOptions, &$topic_columns, &$topic_parameters));
sources/subs/Post.subs.php:call_integration_hook('integrate_create_topic', array($msgOptions, $topicOptions, $posterOptions));
sources/subs/Post.subs.php:call_integration_hook('integrate_before_modify_topic', array(&$topics_columns, &$update_parameters, &$msgOptions, &$topicOptions, &$posterOptions));
sources/subs/Post.subs.php:call_integration_hook('integrate_before_modify_post', array(&$messages_columns, &$update_parameters, &$msgOptions, &$topicOptions, &$posterOptions, &$messageInts));
sources/subs/Emailpost.subs.php:call_integration_hook('integrate_mailist_pre_markdown', array(&$message));
sources/subs/Members.subs.php:call_integration_hook('integrate_delete_members', array($users));
sources/subs/Members.subs.php:call_integration_hook('integrate_register_check', array(&$regOptions, &$reg_errors));
sources/subs/Members.subs.php:call_integration_hook('integrate_register', array(&$regOptions, &$theme_vars, &$knownInts, &$knownFloats));
sources/subs/Members.subs.php:call_integration_hook('integrate_register_after', array($regOptions, $memberID));
sources/subs/Members.subs.php:call_integration_hook('integrate_reattribute_posts', array($memID, $email, $membername, $post_count));
sources/subs/Auth.subs.php:call_integration_hook('integrate_validateSession', array(&$types));
sources/subs/Auth.subs.php:call_integration_hook('integrate_reset_pass', array($old_user, $user, $newPassword));
sources/subs/Auth.subs.php:call_integration_hook('integrate_mod_cache');
sources/subs/Auth.subs.php:call_integration_hook('integrate_cookie', array($name, $value, $expire, $path, $domain, $secure, $httponly));
sources/subs/Notification.subs.php:call_integration_hook('integrate_notification_replacements', array(&$replacements, $row, $type, $current_language));
sources/subs/Boards.subs.php:call_integration_hook('integrate_modify_board', array($board_id, $boardOptions, &$boardUpdates, &$boardUpdateParameters));
sources/subs/Boards.subs.php:call_integration_hook('integrate_delete_board', array($boards_to_remove, &$moveChildrenTo));
sources/subs/Boards.subs.php:call_integration_hook('integrate_board_fields', array(&$knownInts));
sources/subs/Boards.subs.php:call_integration_hook('integrate_board_fields', array(&$knownInts));
sources/subs/Action.class.php:call_integration_hook('integrate_sa_' . $this->_name, array(&$subactions));
sources/subs/Calendar.subs.php:call_integration_hook('integrate_create_event', array(&$eventOptions, &$event_columns, &$event_parameters));
sources/subs/Calendar.subs.php:call_integration_hook('integrate_modify_event', array($event_id, &$eventOptions, &$event_columns));
sources/subs/Calendar.subs.php:call_integration_hook('integrate_remove_event', array($event_id));
sources/subs/SettingsForm.class.php:call_integration_hook('integrate_prepare_db_settings', array(&$config_vars));
sources/subs/Messages.subs.php:call_integration_hook('integrate_remove_message', array($message));
sources/subs/Membergroups.subs.php:call_integration_hook('integrate_delete_membergroups', array($groups));
sources/subs/Membergroups.subs.php:call_integration_hook('integrate_add_members_to_group', array($members, $group_details, &$group_names));
sources/subs/Topic.subs.php:call_integration_hook('integrate_remove_topics', array($topics));
sources/subs/Editor.subs.php:call_integration_hook('integrate_editor_plugins', array($editorOptions['id']));
sources/subs/Editor.subs.php:call_integration_hook('integrate_bbc_buttons', array(&$bbc_tags));
sources/subs/PersonalMessage.subs.php:call_integration_hook('integrate_personal_message', array(&$recipients, &$from, &$subject, &$message));
sources/subs/PersonalMessage.subs.php:call_integration_hook('integrate_personal_message_after', array(&$id_pm, &$log, &$recipients, &$from, &$subject, &$message));
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on November 11, 2014, 08:17:21 am
sources/admin/ManageSearchEngines.controller.php:call_integration_hook('integrate_save_search_engine_settings');
sources/admin/ManageSearchEngines.controller.php:call_integration_hook('integrate_modify_search_engine_settings', array(&$config_vars));
sources/admin/ManagePosts.controller.php:call_integration_hook('integrate_save_censors', array(&$updates));
sources/admin/ManagePosts.controller.php:call_integration_hook('integrate_censors');
sources/admin/ManagePosts.controller.php:call_integration_hook('integrate_save_post_settings');
sources/admin/ManagePosts.controller.php:call_integration_hook('integrate_modify_post_settings', array(&$config_vars));
sources/admin/ManageLanguages.controller.php:call_integration_hook('integrate_save_language_settings');
sources/admin/ManageLanguages.controller.php:call_integration_hook('integrate_modify_language_settings', array(&$config_vars));
sources/admin/Reports.controller.php:call_integration_hook('integrate_report_types');
sources/admin/Reports.controller.php:call_integration_hook('integrate_report_buttons');
sources/admin/AdminLog.controller.php:call_integration_hook('integrate_manage_logs', array(&$log_functions));
sources/admin/AdminLog.controller.php:call_integration_hook('integrate_prune_settings');
sources/admin/ManagePermissions.controller.php:call_integration_hook('integrate_save_permission_settings');
sources/admin/ManagePermissions.controller.php:call_integration_hook('integrate_modify_permission_settings', array(&$config_vars));
sources/admin/ManagePermissions.controller.php:call_integration_hook('integrate_post_moderation_mapping', array(&$mappings));
sources/admin/ManageMaillist.controller.php:call_integration_hook('integrate_save_filter_settings');
sources/admin/ManageMaillist.controller.php:call_integration_hook('integrate_modify_maillist_filter_settings', array(&$config_vars));
sources/admin/ManageMaillist.controller.php:call_integration_hook('integrate_save_parser_settings');
sources/admin/ManageMaillist.controller.php:call_integration_hook('integrate_modify_maillist_parser_settings', array(&$config_vars));
sources/admin/ManageMaillist.controller.php:call_integration_hook('integrate_save_maillist_settings');
sources/admin/ManageMaillist.controller.php:call_integration_hook('integrate_modify_maillist_settings', array(&$config_vars));
sources/admin/Admin.controller.php:call_integration_hook('integrate_admin_search', array(&$language_files, &$include_files, &$settings_search));
sources/admin/ManageAvatars.controller.php:call_integration_hook('integrate_save_avatar_settings');
sources/admin/ManageAvatars.controller.php:call_integration_hook('integrate_modify_avatar_settings', array(&$config_vars));
sources/admin/ManageRegistration.controller.php:call_integration_hook('integrate_save_registration_settings');
sources/admin/ManageRegistration.controller.php:call_integration_hook('integrate_modify_registration_settings', array(&$config_vars));
sources/admin/ManageSearch.controller.php:call_integration_hook('integrate_save_search_settings');
sources/admin/ManageSearch.controller.php:call_integration_hook('integrate_modify_search_settings', array(&$config_vars));
sources/admin/ManageSearch.controller.php:call_integration_hook('integrate_modify_search_weights', array(&$factors));
sources/admin/ManageSearch.controller.php:call_integration_hook('integrate_save_search_weights');
sources/admin/ManageDrafts.controller.php:call_integration_hook('integrate_save_drafts_settings');
sources/admin/ManageDrafts.controller.php:call_integration_hook('integrate_modify_drafts_settings', array(&$config_vars));
sources/admin/Maintenance.controller.php:call_integration_hook('integrate_routine_maintenance');
sources/admin/ManageTopics.controller.php:call_integration_hook('integrate_save_topic_settings');
sources/admin/ManageTopics.controller.php:call_integration_hook('integrate_modify_topic_settings', array(&$config_vars));
sources/admin/ManageBBC.controller.php:call_integration_hook('integrate_save_bbc_settings', array($bbcTags));
sources/admin/ManageBBC.controller.php:call_integration_hook('integrate_modify_bbc_settings', array(&$config_vars));
sources/admin/ManageThemes.controller.php:call_integration_hook('integrate_init_theme', array($theme, &$settings));
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_save_general_settings');
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_save_database_settings');
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_save_cookie_settings');
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_save_cache_settings');
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_loadavg_settings');
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_save_loadavg_settings');
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_modify_general_settings', array(&$config_vars));
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_modify_database_settings', array(&$config_vars));
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_modify_cookie_settings', array(&$config_vars));
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_modify_cache_settings', array(&$config_vars));
sources/admin/ManageServer.controller.php:call_integration_hook('integrate_modify_loadavg_settings', array(&$config_vars));
sources/admin/AddonSettings.controller.php:call_integration_hook('integrate_save_general_mod_settings');
sources/admin/AddonSettings.controller.php:call_integration_hook('integrate_general_mod_settings', array(&$config_vars));
sources/admin/ManageAttachments.controller.php:call_integration_hook('integrate_save_attachment_settings');
sources/admin/ManageAttachments.controller.php:call_integration_hook('integrate_modify_attachment_settings', array(&$config_vars));
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_save_basic_settings');
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_save_layout_settings');
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_save_karma_settings');
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_save_likes_settings');
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_apply_signature_settings', array(&$sig, $sig_limits, $disabledTags));
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_save_signature_settings', array(&$sig_limits, &$bbcTags));
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_save_pmsettings_settings');
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_modify_basic_settings', array(&$config_vars));
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_modify_layout_settings', array(&$config_vars));
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_modify_karma_settings', array(&$config_vars));
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_modify_likes_settings', array(&$config_vars));
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_modify_mention_settings', array(&$config_vars));
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_modify_signature_settings', array(&$config_vars));
sources/admin/ManageFeatures.controller.php:call_integration_hook('integrate_modify_pmsettings_settings', array(&$config_vars));
sources/admin/ManageCalendar.controller.php:call_integration_hook('integrate_save_calendar_settings');
sources/admin/ManageCalendar.controller.php:call_integration_hook('integrate_modify_calendar_settings', array(&$config_vars));
sources/admin/ManageSecurity.controller.php:call_integration_hook('integrate_save_general_security_settings');
sources/admin/ManageSecurity.controller.php:call_integration_hook('integratesave_moderation_settings', array(&$config_vars));
sources/admin/ManageSecurity.controller.php:call_integration_hook('integrate_save_moderation_settings');
sources/admin/ManageSecurity.controller.php:call_integration_hook('integrate_save_spam_settings');
sources/admin/ManageSecurity.controller.php:call_integration_hook('integrate_modify_moderation_settings', array(&$config_vars));
sources/admin/ManageSecurity.controller.php:call_integration_hook('integrate_general_security_settings', array(&$config_vars));
sources/admin/ManageSecurity.controller.php:call_integration_hook('integrate_spam_settings', array(&$config_vars));
sources/admin/CoreFeatures.controller.php:call_integration_hook('integrate_core_features', array(&$core_features));
sources/admin/ManageNews.controller.php:call_integration_hook('integrate_save_news_settings');
sources/admin/ManageNews.controller.php:call_integration_hook('integrate_modify_news_settings', array(&$config_vars));
sources/admin/ManageMembergroups.controller.php:call_integration_hook('integrate_add_membergroup', array($id_group, $postCountBasedGroup));
sources/admin/ManageMembergroups.controller.php:call_integration_hook('integrate_save_membergroup', array($current_group['id_group']));
sources/admin/ManageMembergroups.controller.php:call_integration_hook('integrate_view_membergroup');
sources/admin/ManageMembergroups.controller.php:call_integration_hook('integrate_save_membergroup_settings');
sources/admin/ManageMembergroups.controller.php:call_integration_hook('integrate_modify_membergroup_settings', array(&$config_vars));
sources/admin/ManageSmileys.controller.php:call_integration_hook('integrate_save_smiley_settings');
sources/admin/ManageSmileys.controller.php:call_integration_hook('integrate_modify_smiley_settings', array(&$config_vars));
sources/admin/ManageMembers.controller.php:call_integration_hook('integrate_manage_members', array(&$subActions));
sources/admin/ManageMembers.controller.php:call_integration_hook('integrate_view_members_params', array(&$params));
sources/admin/ManageMembers.controller.php:call_integration_hook('integrate_activate', array($member['username']));
sources/admin/ManageBoards.controller.php:call_integration_hook('integrate_boards_main');
sources/admin/ManageBoards.controller.php:call_integration_hook('integrate_edit_category');
sources/admin/ManageBoards.controller.php:call_integration_hook('integrate_edit_board');
sources/admin/ManageBoards.controller.php:call_integration_hook('integrate_save_board', array($board_id, &$boardOptions));
sources/admin/ManageBoards.controller.php:call_integration_hook('integrate_save_board_settings');
sources/admin/ManageBoards.controller.php:call_integration_hook('integrate_modify_board_settings', array(&$config_vars));
sources/admin/ManageMail.controller.php:call_integration_hook('integrate_save_mail_settings');
sources/admin/ManageMail.controller.php:call_integration_hook('integrate_modify_mail_settings', array(&$config_vars));
sources/admin/ManagePaid.controller.php:call_integration_hook('integrate_save_subscription_settings');
sources/admin/ManagePaid.controller.php:call_integration_hook('integrate_modify_subscription_settings', array(&$config_vars));
sources/admin/ManagePaid.controller.php:call_integration_hook('integrate_delete_subscription', array($context['sub_id']));
sources/admin/ManagePaid.controller.php:call_integration_hook('integrate_save_subscription', array(($context['action_type'] == 'add' ? $sub_id : $context['sub_id']), $_POST['name'], $_POST['desc'], $isActive, $span, $cost, $_POST['prim_group'], $addgroups, $isRepeatable, $allowpartial, $emailComplete, $reminder));
sources/admin/ManageBans.controller.php:call_integration_hook('integrate_manage_bans', array(&$subActions));
SSI.php:call_integration_hook('integrate_SSI');
Title: Re: Temporary hooks listing/documentation
Post by: Joshua Dickerson on November 11, 2014, 03:21:47 pm
Why not just use GH wiki?
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on November 11, 2014, 03:52:30 pm
Because is too messy at the moment.
I don't even have an exact idea of how to organize it... :-\
Title: Re: Temporary hooks listing/documentation
Post by: Spuds on November 11, 2014, 04:52:12 pm
I think that is the goal, well at least to use that as our wiki for docs etc ... but like eman said, its a bit messy right now, needs some top level nav pages or something so it can be used.  Right now its a dumping ground of sorts, not sure how to organize it.

PS damn, thats a lot of hooks :D
Title: Re: Temporary hooks listing/documentation
Post by: ahrasis on November 13, 2014, 02:14:45 am
I like...
Title: Re: Temporary hooks listing/documentation
Post by: Jorin on November 13, 2014, 05:20:42 am
Quote from: Spuds – ...needs some top level nav pages or something so it can be used.

Good point. It needs a good structure. I would try to make a few main categories, a few sub categories, and at last one page for one topic. Maybe something like this:

- Administration
--- Installation
--- Update & Upgrade
----- Update (f.e. 10.0 to 1.0.1)
----- Upgrade (f.e. 1.0.0 to 2.0.0)
--- Migration
--- Server Settings
--- Forum Settings
--- Permissions
--- ...and all the other functions of ElkArte
- Customization
--- Installation of Addons
--- Installation of Themes
- Coding
--- Coding ElkArte (?)
--- Coding Addons
--- Coding Themes
- Languages
--- Installation
--- Translation
- Anything else?
- Glossary

And every main and sub category page would have a link list of the sub categories and pages inside.
Title: Re: Temporary hooks listing/documentation
Post by: wintstar on September 13, 2015, 03:28:05 pm
How is this hook used?

call_integration_hook('integrate_action_' . $hook . '_before', array($this->_function_name));
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on September 13, 2015, 03:32:13 pm
It calls a different hook depending on the action, for example:
http://www.elkarte.net/community/index.php?topic=2192.0 => integrate_action_display_before
http://www.elkarte.net/community/index.php?board=12.0 => integrate_action_messageindex_before
http://www.elkarte.net/community/index.php?action=admin => integrate_action_admin_before
http://my-localhost:8080/beta_21/index.php?action=pm => integrate_action_pm_before
etc.

If you have a testing environment, I'd suggest you to add:
Code: [Select]
$db_show_debug = true;
to your Settings.php (do not use it on live sites!), this will add a debug output at the end of each page that contains also a list of hooks called during the page load. ;D
Title: Re: Temporary hooks listing/documentation
Post by: wintstar on September 13, 2015, 03:35:13 pm
Thanks :) 


Title: Re: Temporary hooks listing/documentation
Post by: emanuele on September 13, 2015, 03:37:57 pm
yw! :)
Title: Re: Temporary hooks listing/documentation
Post by: wintstar on September 13, 2015, 04:09:10 pm
This
Code: (php) [Select]
$db_show_debug = true;
is great!

Seeking a hook which I can insert einTemplate function (template_inc_talk_belowIndex(); & template_inc_talk_aboveIndex() ;  )  under the breadcrumbs and the Info Center.
sample
Code: (php) [Select]
function template_info_center()
{
    global $context, $txt;
   
    template_inc_talk_belowIndex();  







Title: Re: Temporary hooks listing/documentation
Post by: emanuele on September 13, 2015, 04:26:40 pm
You could use integrate_action_boardindex_after
But add something before the info center is not easy...
Without code edits you can add it before template_boardindex_outer_below (that is before the board index legend, the three icons explaining "new posts", "no new posts" and "redirect")... that actually is quite wrong, I'd call it a bug.
Title: Re: Temporary hooks listing/documentation
Post by: wintstar on September 13, 2015, 04:39:55 pm
Then I would have the shoutbox without hooks Insert.Tthis would be inserted here:

above
Code: (php) [Select]
function template_boardindex_outer_above()
{
    global $context, $settings, $txt;
    
    template_inc_talk_aboveIndex();

below
Code: (php) [Select]
function template_info_center()
{
    global $context, $txt;
    
    template_inc_talk_belowIndex();

Here you can watch it in my SMF modification =>http://experiri.scaricare.de/index.php?topic=3.msg3#msg3




Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on March 26, 2016, 10:23:30 am
One thing I can't easily quite figure out from this massive list of hooks is if there is a straightforward way to add something underneath the poster info. Specifically I mean something like in the attached screenshot.

Of course I could tap into integrate_buffer, but that's not really terribly different from source modification.
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on March 26, 2016, 11:05:13 am
That's an SMF screen, so it may depend if you want to add stuff to the dropdown or directly under the avatar.
Anyway you could either borrow the custom fields "space" (i.e. integrate_prepare_display_context) and use placement equal to 0 or 1) or actually use a custom field (that from the screenshot looks like what you would take more advantage from).
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on March 26, 2016, 11:41:46 am
It's a per-post thing (like IP address), so integrate_prepare_display_context is probably what I'm looking for. It's my own take on this mod (http://custom.simplemachines.org/mods/index.php?mod=1515), with mostly importantly a different detection mechanism and full user agent.
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on March 26, 2016, 01:47:25 pm
Makes sense. :D
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on April 02, 2016, 04:19:49 pm
I must be missing something. I enabled Advanced Profile Fields, but while they're showing up for editing in my profile, they don't seem to show on the board like they do here. Is there a switch somewhere that I'm missing? Besides that I haven't quite been able to figure out how to tap into these custom fields, 'cause there doesn't seem to be a $message['member']['custom_fields'] or $output['member']['custom_fields'] or some such.[1] Could you maybe give me a little hint in the right direction? Of course it wouldn't be the worst thing to have to do a little source modification in the theme given how I was able to stick everything else in hooks, but it'd be pretty cool to go hooks only. ;)
For this purpose I tend to find the easiest way to gain some quick insight is by sticking in something like error_log(print_r($output, TRUE), 0), rather than necessarily by perusing the code.
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on April 03, 2016, 08:14:23 am
Okay, I found the problem. The icons show up only after you enter their editing space and explicitly click save. That in turn also fills up the $output['member']['custom_fields'] array. Reported as #2479 (https://github.com/ElkArte/ElkArte/issues/2479).
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on September 19, 2016, 01:30:00 pm
Today I was in "coding fancy stuff" mood and wrote this:
https://gist.github.com/emanuele45/4924876bb2b4d32f1ed6f9d38989a27f
the idea is parse any file, find all the instances of call_integration_hook, grab any "doc block" before it and parse the resulting stuff the same way any normal DocBlock is parsed, for example:
Code: [Select]
		/**
* This hook allows to alter the content of the arrays containing the data
* for each message.
*
* @param mixed[] $output Data ready to be sent to the template
* @param mixed[] $message Data coming from the database
*/
call_integration_hook('integrate_prepare_display_context', array(&$output, &$message));
at the moment, the code in the gist creates an array with all the elements, what is left is to actually create the documentation similarly to documentor (or whatever is currently used :P).

What do you think?
Title: Re: Temporary hooks listing/documentation
Post by: Spuds on September 19, 2016, 01:43:19 pm
Pretty cool idea  :)  ... may require us to add some docblocks for some of the hooks, I'd imagine some are not documented well or at all.   Could do the same thing for the events as well.

Docs are done with apigen
Title: Re: Temporary hooks listing/documentation
Post by: Joshua Dickerson on September 19, 2016, 01:47:39 pm
I wonder if you could just use the doc block parser but I imagine this is much faster. Good idea to lessen the workload on documentation
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on September 19, 2016, 02:22:49 pm
Quote from: Spuds – Could do the same thing for the events as well.
Yep, I started with hooks because are easier. O:-)

Quote from: Joshua Dickerson – I wonder if you could just use the doc block parser but I imagine this is much faster.
I looked into this a couple of times (or three), though as far as I understood, all the documentation generators are geared towards collecting only stuff that is outside the functions in very specific places and are not able and not easy to persuade to grab comments in other places. :-\
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 05, 2017, 09:51:40 am
I seem to be missing an integrate_profile_buttons or something along those lines here (https://github.com/elkarte/Elkarte/blob/5fe7f404bb3b4c5e9a570edc48207c6cde663429/sources/controllers/Profile.controller.php#L506)?
Title: Re: Temporary hooks listing/documentation
Post by: ahrasis on February 05, 2017, 10:53:42 am
I think it should be integrate_profile_areas.

Debug the profile site if you are not sure. $db_show_debug = true;
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 05, 2017, 12:08:31 pm
Huh, how about that. https://github.com/elkarte/Elkarte/blob/5fe7f404bb3b4c5e9a570edc48207c6cde663429/sources/subs/Menu.subs.php#L81-L83

Where should I stick the debug variable, btw?
Title: Re: Temporary hooks listing/documentation
Post by: ahrasis on February 05, 2017, 12:41:52 pm
It ends with _areas and there is only one with that in profile page. I also do use a similar integrate_admin_areas for admin menu. So I think it is correct (if by button you mean the menu button that is :))).
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 05, 2017, 12:45:32 pm
Yes, I do. It wasn't my first word choice, but it seemed consistent with the other integrate_bla_buttons functions. ;)
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on February 05, 2017, 12:48:25 pm
Quote from: Frenzie – Where should I stick the debug variable, btw?
Settings.php
Title: Re: Temporary hooks listing/documentation
Post by: ahrasis on February 05, 2017, 12:55:07 pm
I myself don't comprehend most of them especially where there exist other methods that are not even using the word call_integration_hook or integrate_bla_bla in the codes.  I am trying to learn them, though it will take me some longer times.  :-[
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 05, 2017, 02:51:20 pm
Alrighty, it's working! :)

Code: [Select]
	public static function profile_areas(&$profile_areas)
{
global $txt, $scripturl, $memID, $modSettings;
loadLanguage('StopSpammer');

$profile_areas['profile_action']['areas'] = elk_array_insert($profile_areas['profile_action']['areas'], 'activateaccount', array(
'checkmember' => array(
'label' => $txt['stopspammer_profilecheck'],
'custom_url' => $scripturl . '?action=admin;area=viewmembers;sa=query;params=' . base64_encode(serialize(array('mem_id' => $memID, 'types' => array('mem_id' => '=')))),
'enabled' => !empty($modSettings['stopspammer_enable']),
'sc' => 'get',
'permission' => array(
'own' => array('profile_remove_any', 'profile_remove_own'),
'any' => array('profile_remove_any', 'moderate_forum'),
),
)), 'after');
}

I might have to reacquaint myself with templates, but that's for another day.

To put some pressure on myself, here's what I've been working on today: https://github.com/Frenzie/elk-stop-spammer It's been going a bit slower than I would've liked but could be worse.
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 06, 2017, 06:17:57 am
I'm having some trouble understanding how to modify lists. In ManageMembers.controller.php there's a list we can hook into: https://github.com/elkarte/Elkarte/blob/5fe7f404bb3b4c5e9a570edc48207c6cde663429/sources/admin/ManageMembers.controller.php#L586

So I did, and the $listOptions adjusts fine, but the output stays the same.
Code: [Select]
	public static function list_member_list($listOptions)
{
//print_r($listOptions);
$listOptions['columns']['user_name']['data']['sprintf']['format'] .= 'asdf';
//print_r($listOptions);
}

Edit: Doh! I noticed the typo as soon as I posted this. I forgot the &.  :-[
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 06, 2017, 11:03:12 am
@emanuele

I don't think I'm missing a hook to affect this DB query because there's no variable: https://github.com/elkarte/Elkarte/blob/5fe7f404bb3b4c5e9a570edc48207c6cde663429/sources/subs/Members.subs.php#L1160-L1164

In other words, I don't think I can convert this source mod into a hook:
Code: [Select]
		<operation>
<search position="replace"><![CDATA[
mem.id_member, mem.member_name, mem.real_name, mem.email_address, mem.icq, mem.aim, mem.yim, mem.msn, mem.member_ip, mem.member_ip2, mem.last_login,]]></search>
<add><![CDATA[
mem.id_member, mem.member_name, mem.real_name, mem.email_address, mem.icq, mem.aim, mem.yim, mem.msn, mem.member_ip, mem.member_ip2, mem.last_login, mem.is_spammer,]]></add>
</operation>

Here it is updated for Elk:
Code: [Select]
		<operation>
<search position="before"><![CDATA[
mem.id_member, mem.member_name, mem.real_name, mem.email_address, mem.member_ip, mem.member_ip2, mem.last_login,
mem.posts, mem.is_activated, mem.date_registered, mem.id_group, mem.additional_groups, mg.group_name]]></search>
<add><![CDATA[, mem.is_spammer]]></add>
</operation>
https://github.com/Frenzie/elk-stop-spammer/blob/19cb36458059393ede9fa7635ec6c6a1526d84e4/install_2.xml#L54-L72

Given that this only affects admins and moderators I suppose adding a whole extra query wouldn't really matter, but still. :P
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on February 06, 2017, 12:22:41 pm
Lists are somehow tricky.
There are hooks, but there is no direct way to change the queries, so it's basically always a "DIY-and-append-the-results".
It's sub-optimal for sure, but with the current tools that's the best we can do.

I guess, in 2.0, we could have each column of the list as an object allowed to define the tables to query, the fields to fetch, the transformations to apply, etc.
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 06, 2017, 12:51:48 pm
Do you happen to know of an example somewhere? But for now I'll probably just stick with the source mod. :)
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on February 06, 2017, 01:23:10 pm
No, at the moment I don't have any example handy, even though I think I did something like that at some point... no idea where and when. lol
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 08, 2017, 03:23:35 am
@emanuele How do you use integrate_manage_members exactly?

Code: [Select]
$subActions['check'] = array(
'controller' => new StopSpammer_controller(),
'function' => 'action_list',
'permission' => 'moderate_forum');

Code: [Select]
PHP Fatal error: Uncaught exception 'Error' with message 'Class 'StopSpammer_controller' not found' in /home/frans/www/public_html/elkarte-1.1/sources/addons/StopSpammer/StopSpammer_hooks.php:233

StopSpammer.controller.php is present in CONTROLLERDIR.

What I want to do is add two new actions, namely Check these members and Report these members. See screenshot for the old style imported from the SMF addon, but although adding the buttons themselves is no problem making them work requires source edits, which I'd like to avoid as much as possible.

Edit: hm, why does posting here result in me realizing I hadn't tried a simple
Code: [Select]
require_once(CONTROLLERDIR .'/StopSpammer.controller.php');
Although for integrate_actions that doesn't seem to be necessary.

Not quite there yet, but I think I probably got past my obstacle. :P
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 08, 2017, 06:13:29 am
Hm, I think I have to admit defeat in not understanding how this stuff works.

I can add things to maction by simply using a button instead of an input type=button:
Code: [Select]
<button name="maction" value="spammers_check" type="submit">checkcheck</button>

Code: [Select]
require_once(CONTROLLERDIR .'/StopSpammer.controller.php');

$subActions['spammers_check'] = array(
'controller' => new StopSpammer_controller(),
'function' => 'action_list',
'permission' => 'moderate_forum');

But clearly I've got this controller thing set up all wrong:

Code: [Select]
class StopSpammer_Controller extends ManageMembers_Controller
{
public function action_list()
{
global $txt, $scripturl, $context, $modSettings;
print_r($this->_req->post);
// Set the current sub action.
$context['sub_action'] = $this->_req->getPost('sa', 'strval', 'all');
//print_r($context['sub_action']);
// Are we performing a mass action?
if (isset($this->_req->post->spammers_checks) && !empty($this->_req->post->members))
$this->_multiMembersAction();
}

protected function _multiMembersAction()
{
global $txt, $user_info;

// @todo add a token too?
checkSession();

// Clean the input.
$members = array();
foreach ($this->_req->post->members as $value)
{
// Don't delete yourself, idiot.
if ($this->_req->post->maction === 'delete' && $value == $user_info['id'])
continue;

$members[] = (int) $value;
}
$members = array_filter($members);

// No members, nothing to do.
if (empty($members))
return;

// Are we performing a check or report?
if ($this->_req->post->maction == 'spammers_checks' || $this->_req->post->maction == 'spammers_report')
{
checkreportMembers($members, $this->_req->post->maction == 'spammers_report');
}


}
}
Title: Re: Temporary hooks listing/documentation
Post by: ahrasis on February 08, 2017, 08:03:31 am
Quote from: Frenzie –
Code: [Select]
PHP Fatal error: Uncaught exception 'Error' with message 'Class 'StopSpammer_controller' not found' in /home/frans/www/public_html/elkarte-1.1/sources/addons/StopSpammer/StopSpammer_hooks.php:233
StopSpammer.controller.php is present in CONTROLLERDIR.
Hook error says it is not found in sources addon folder, not in sources controller folder, right?
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 08, 2017, 08:15:16 am
You are quite right, but honestly I don't even really understand what I'm trying to modify. I mean, I know how I could affect what I want using source edits, but I don't really know what the stuff you can modify with integrate_manage_members does in the first place. I'll await @emanuele 's explanation. :)
Title: Re: Temporary hooks listing/documentation
Post by: ahrasis on February 08, 2017, 08:21:25 am
My advice this hook only as far as you know and understand. Others you can modify first. Convert to hook later.

I also don't know that much. I think I learn more through copy and paste and trial and error.

What I may remember is once @emanuele did say you have to check the output or something for each integration for you to know how to use it properly. I can't remember which post though.

Edited: I think I found it.

Quote from: emanuele – You are using "integrate_prepare_display_context", so, where is it called?
In Display.controller.php at:
https://github.com/elkarte/Elkarte/blob/e7e6d32ca24365a11dde18f936dc2ff86dd52dc7/sources/controllers/Display.controller.php#L1004
So, what are the two variables you have available?
$output and $message.
What do they contain?
First read:
https://github.com/elkarte/Elkarte/blob/e7e6d32ca24365a11dde18f936dc2ff86dd52dc7/sources/controllers/Display.controller.php#L955
https://github.com/elkarte/Elkarte/blob/d210298c7a53f0ed94ecd04b291f4ab0240528f6/sources/subs/Messages.subs.php#L605

And then, in your function can use:
Code: [Select]
print_r($output);
Well, for better reading experience:
Code: [Select]
echo '<pre>';
print_r($output);
echo '</pre>';
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 08, 2017, 10:37:14 am
Well yeah, but those are regular hooks. They're simple and print_r tells you all you need to know. ;)
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on February 09, 2017, 07:45:33 am
Sorry, but yesterday I missed this topic because I was so sleepy I fell asleep in front of the computer... xD
Can you remind me if you are using 1.0 or 1.1?

Being the subaction an admin sub-action, it will probably look by default in ADMINDIR, so the controller in CONTROLLERDIR is overlooked.
Probably the require once is the only way, unless you define a namespace and a custom auto-loading path (to the addon dir, for example).

All off the top of my head and without checking (and while looking at a script running on the other computer).
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 09, 2017, 07:50:06 am
Quote from: emanuele – Can you remind me if you are using 1.0 or 1.1?
Both but let's say 1.1.

Anyway, the problem is I don't understand how to do this without a source mod. It's very simple with one:

Code: [Select]
		// Are we performing a check or report?
if ($this->_req->post->maction == 'spammers_check' || $this->_req->post->maction == 'spammers_report')
{
require_once(SOURCEDIR .'/addons/StopSpammer/StopSpammer.php');
checkreportMembers($members, $this->_req->post->maction == 'spammers_report');
}
I add that above "Are we performing a delete?" in ManageMembers.controller.php and it works.

Ideally of course I'd do it without a source mod, but I can't quite wrap my head around how I'd parse the form or anything with one of those controllers. Anyway, I'm ignoring the problem for now. A couple of minimal source mods is a lot better than the almost entirely source-mod-based approach that was required in SMF. :)
Title: Re: Temporary hooks listing/documentation
Post by: emanuele on February 09, 2017, 07:57:37 am
If you added a new button, it's likely maction is "overwritten" by the select box, try using another name for the button, stopspam.
Title: Re: Temporary hooks listing/documentation
Post by: Frenzie on February 09, 2017, 08:42:33 am
Actually that's not a problem. All you need is something like this:

Code: [Select]
<input type="hidden" id="stop_spammer_maction_on_members">
<button name="maction" value="spammers_check" type="submit" onclick="$(\'#stop_spammer_maction_on_members\').attr(\'name\',\'maction_on_members\').attr(\'value\',true);">checkcheck</button>

My problem is entirely with the controller. It just doesn't seem to fire unless I perform one of the built-in actions. But anyway, like I said I'll fix up my stuff first so it's working (nearly there) and I'll worry about doing it right later. :)