Using e107's built-in classes and methods.

Events

Plugin developers can hook into various e107 core events and trigger functions of their own. Typically, an e_module.php file is used to store this information since it is loaded with every page.

Variable Description
name The event you wish to hook into. (see table below)
function Your function or class/method to trigger when this event occurs. string for function, or for classes use an array(class,method) .
include include[/code] (optional) path a file to include if required.

		e107::getEvent()->register(name, function, include);


Example 1: trigger myFunction() on user login.

		//
e107::getEvent()->register('login', 'myFunction'); 

function myFunction($data)
{
   // do something    
}


Example 2: trigger myFunction() on user login. Function in external file.

		e107::getEvent()->register('login', 'myFunction',  e_PLUGIN."myplugin/myFunctions.php");


Example 3: trigger a class and method on user login.

		e107::getEvent()->register('login', array('myClass', 'myMethod'),  e_PLUGIN."myplugin/myClass.php");

User Event Triggers

Trigger Name Description Data
login User login/signin Array of user data
logout User logout/signout Notice event
user_file_upload User uploads a file Array of file information
user_signup_submitted User submits signup form Array of user data
user_signup_activated User activates newly created account. (email link) Array of user data
user_xup_login User signs in via a social media account. eg. Facebook, Twitter etc. Array of user data
user_xup_signup User creates an account using their social media login. Facebook, Twitter etc. Array of user data
user_profile_display User has viewed a profile Array of data
user_profile_edit User has edited their profile Array of data

Custom page

Trigger function Description Data
user_page_item_viewed User has viewed a custom page Array of data

News

Trigger Name Description Data
user_news_item_viewed User viewed a news item Array of data
user_news_submit User submitted a news item Array of data

Private Messenger

Trigger name Description Data
user_pm_sent User has sent a private message Array of data
user_pm_read User has read a private message Array of data

Forum

Trigger Name Description Data
user_forum_topic_created User creates a forum topic Array of data
user_forum_topic_updated User updates a forum topic Array of data
user_forum_topic_deleted User deletes a forum topic Array of data
user_forum_post_created User creates a forum post/reply Array of data
user_forum_post_updated User updates a forum post/reply Array of data
user_forum_post_deleted User deletes a forum post/reply Array of data

Chatbox

Trigger function Description Data
user_chatbox_post_created User has posted a chatbox message Array of data (ip and message)

Admin Event Triggers

Admin changes their password

Trigger Name Description Data
admin_password_update Admin updates their password Array containing user_id and time of change.

Comments Manager

Trigger Name Description Data
admin_comment_update Admin updates a comment Array of comment data
admin_comment_delete Admin deletes a comment Array of comment data

Downloads

Trigger Name Description Data
admin_download_create Admin creates a download item Array of download data
admin_download_update Admin updates a download item Array of download data
admin_download_delete Admin deletes a download item Array of download data

News

Trigger Name Description Data
admin_news_create Admin creates a news item Array of news data
admin_news_update Admin updates a news item Array of news data
admin_news_delete Admin deletes a news item Array of news data
admin_news_category_create Admin creates a news category Array of news data
admin_news__category_update Admin updates a news category Array of news data
admin_news_category_delete Admin deletes a news category Array of news data

Pages

Trigger Name Description Data
admin_page_create Admin creates a page/menu item Array of page data
admin_page_update Admin updates a page/menu item Array of page data (new and old)
admin_page_delete Admin deletes a page/menu item Array of page data

Users

Trigger Name Description Data
admin_user_create Admin creates a new user Array of user data
admin_user_update Admin modifies user data Array of user data (new and old)
admin_user_delete Admin deletes a user Array of user data
admin_user_activate Admin activates an unverified user Array of user data
admin_user_loginas Admin logs in as another user Array of user data
admin_user_logoutas Admin logs out as another user Array of user data


Friday 27 January 2017 - 15:35:59 Tijn Kuyper,

Social Links