Core event trigger

From e107 Wiki
Jump to: navigation, search

e107 Wiki: English | Русский | Deutsch | Français | Magyar | Português | Български | Česky | Nederlands | Ελληνικά | Italiano | Norske | Polska | Slovenščina | Español | Svenska | Translate: Wiki | Page

logo_wiki.png

Current Release 1.0.4 | e107.org | Download | Changelog | Forum | Plugins | Themes | RSS Feed of Latest Changes | Atom Feed of Latest Changes


How to write a plugin
Main page > I : First Aid > II : Development > III : Administration > IV : How To's > V : Plugin Writing > VI : Theming & Shortcodes



Contents

Core Event Triggers

The following describes the event triggers that are available and the data that they make available.

All the data items are indexes of the array $data, e.g. $data['cat_id'].

News

News item posted

This event is triggered when a news item is posted to the database.

Trigger Location e107_handlers/news_class.php
Trigger ID newspost
cat_id News items ID
news_title News items headline
data News items body text
helpb News items headline
fontcol News items font colour
fontsiz News items font size
thumbps News items thumbnail image
imageps News items image
fileps News items file attachment
news_extended News items extended text
uploadtype News items file attachment file type
news_allow_comments Comments enabled or not (1 = enabled, 0 = not enabled)
news_rendertype
startday News items start day
startmonth News items start month
startyear News items start year
endday News items end day
endmonth News items end month
endyear News items end year
news_class User class news item is viewable by
submit
news_id
active_start
active_end
admin_id ID of admin who posted news item
admin_name Name of admin who posted news item
news_datestamp Time news item was posted in unix time

News item updated

This event is triggered when a news item is updated in the database.

Trigger Location e107_handlers/news_class.php
Trigger ID newsupd
cat_id News items ID
news_title News items headline
data News items body text
helpb News items headline
fontcol News items font colour
fontsiz News items font size
thumbps News items thumbnail image
imageps News items image
fileps News items file attachment
news_extended News items extended text
uploadtype News items file attachment file type
news_allow_comments Comments enabled or not (1 = enabled, 0 = not enabled)
news_rendertype
startday News items start day
startmonth News items start month
startyear News items start year
endday News items end day
endmonth News items end month
endyear News items end year
news_class User class news item is viewable by
submit
news_id
active_start
active_end
admin_id ID of admin who posted news item
admin_name Name of admin who posted news item
news_datestamp Time news item was posted in unix time

News item deleted

This event is triggered when a news item is deleted from the database.

Trigger Location e107_admin/newspost.php
Trigger ID newsdel
$data News items ID (note, this is the data varaible itself, it is not an array index)

News category deleted

This event is triggered when a news category is deleted from the database.

Trigger Location e107_admin/newspost.php
Trigger ID newscatdel
$data News category ID (note, this is the data varaible itself, it is not an array index)


Uploads

File uploaded

Trigger Location upload.php
Trigger ID fileupload
upload_user Uploading user in the form userid.username
upload_email Uploading users email, unless emails are hidden
upload_name Name of file uploaded as entered by user
upload_file Name of file uploaded (actual file name on disk)
upload_version File version as input by user
upload_description File description as input by user
upload_size Size of uploaded file in bytes
upload_category Download category ID of the download category selected by user
upload_website Website URL input by user
upload_image Name of image file uploaded
upload_demo URL of demo as entered by user
upload_time The time of the upload (server time)

Downloads

Download item posted

Trigger Location e107_admin/download.php
Trigger ID dlpost
$data array.

Download item updated

Trigger Location e107_admin/download.php
Trigger ID dlupdate
$data array

Download item deleted

Trigger Location e107_admin/download.php
Trigger ID dldelete
$data id of the deleted item.

User

User signup

This event is triggered when a user signs up to the site but is at yet unverified. See the user signup verification event for that event.

Trigger Location signup.php
Trigger ID usersup
xupexist
loginnamexup
password1xup
password2xup
loginname Users loginname
realname Users realname
password1
password2
email Users email address
email_confirm
hideemail
signature Users signature
preimageselect
image Users image
timezone Users timezone
register
name
user_id The Users ID

User signup verification

This event is triggered when a user verifies their account from the verification email.

Trigger Location signup.php
Trigger ID userveri
$data The row from DB table user

User logs in

This event is triggered when a user logs into the site.

Trigger Location e107_handlers/login.php
Trigger ID login
user_id The users ID
user_name The users username

Pre-User login

This event is triggered just before a user logs into the site.

It's not clear from the code but it looks like the purpose of this trigger is to allow denial of login after e107 has undergone all checks and approved the login. So, you could register as a listener of this trigger and then prevent logon based on the 'username' value (which seems a little odd, unless you are simply banning by username, but then you could just ban them in the admin area).

Trigger Location e107_handlers/login.php
Trigger ID preuserlogin
user_id The users ID

User logs out

This event is triggered when a user logs out of the site.

Trigger Location class2.php
Trigger ID logout
Data none

User banned for flooding

This event is triggered when a user gets banned for flooding.

Trigger Location class2.php
Trigger ID flood
$data The users IP address

User deleted

This event is triggered when a user gets deleted by Administrator. Available since e107 v0.7.19 (0.7.18 SVN).

Trigger Location users.php (Administration)
Trigger ID userdel
(integer) $data The users ID

User submits a news item

This event is triggered when a user submits a news item.

Trigger Location submitnews.php
Trigger ID subnews
user The users username
email The users email address
itemtitle The news items title
catid The news category the news item is being submitted too
item The news items text
ip The IP address of the user who submitted the item
newname =>

User submits a link

This event is triggered when a user submits a link.

Trigger Location e107_plugins/links_page/links.php
Trigger ID linksub
link_name The name of the submitted link
link_url The url of the submitted link
link_description The description of the submitted link
link_button The button image url of the submitted link
username The username of the user who submitted the link
submitted_link =>

Pre user settings changed

This event is triggered prior to updating the user settings in the database. Any return value will halt the update and display the return value.

Trigger Location usersettings.php
Trigger ID preuserset
Data the complete from, with all the extended_fields, apart from the password.

Post user settings changed

This event is triggered after the user settings are updated in the database.

Trigger Location usersettings.php
Trigger ID postuserset
Data the complete from, with all the extended_fields, apart from the password.

User page displayed

This event is triggered when the user page is displayed for a specific user.

Trigger Location user.php
Trigger ID showuser
Data the user ID being displayed.

Admin User

Admin changes their password

This event is triggered when an admin changes / updates their password.

Trigger Location e107_admin/updateadmin.php
Trigger ID adpword
Data none

Head Admin login as another user (v0.8 only)

This event is triggered when a main administrator starts a session of 'Login As' feature.

Trigger Location e107_admin/users.php
Trigger ID loginas
Data Array
user_id The ID of target user
admin_id The ID of currently logged in Main admin

Head Admin logout from another user account (v0.8 only)

This event is triggered when a main administrator ends currently running session of 'Login As' feature.

Trigger Location e107_admin/users.php
Trigger ID logoutas
Data Array
user_id The ID of target user
admin_id The ID of currently logged in Main admin

Comments

Comment posted

This event is triggered when a comment is posted.

Trigger Location e107_handlers/comment_class.php
Trigger ID postcomment
comment_type The type of comment posted, relates to a specific part of e107 or a plugin (e.g. 'news')
comment_subject The subject line of the comment
comment_item id The ID of the item being commented in the database, the table that this refers to depends on the 'comment type'
comment_nick The comment poster in the format userid.username, e.g. 1.bugrain
comment_time The time the comment was posted as a UNIX timestamp (i.e. as returned by time())
comment_comment The comment text.

Chatbox

Chatbox post

This event is triggered when a user posts to the chatbox.

Trigger Location e107_plugins/chatbox_menu/chatbox_menu.php
Trigger ID cboxpost
cmessage The posted message text
cmessage The user who posted the message's IP adddress

Content Manager

Content added

This event is triggered when content page is added.

The comment in the code for this is "trigger event for notify", so it looks like it's designed for the Content Manager plugin's notification functionality.

Trigger Location e107_handlers/content_db_class.php
Trigger ID content
content heading Content page heading
content subheading Content page sub-heading
content_author The authors name