Activities
Activities are recorded instances of events
Events are not automatically recorded as an activity, activity rules must be set for events that should be recorded.
Events are executed even if there is no activity rule linked to them.
Activities can be displayed in activity streams
Basic activities
//Basic activities defined in lib/activity/activitylib.php array( 'activity_basic_tracker_create' => 'tiki.trackeritem.create', 'activity_basic_tracker_update' => 'tiki.trackeritem.update', 'activity_basic_user_follow_add' => 'tiki.user.follow.add', 'activity_basic_user_follow_incoming' => 'tiki.user.follow.incoming', 'activity_basic_user_friend_add' => 'tiki.user.friend.add', );
It is possible to enabled/disable recording of basic events using the Social Networks tab at Community control panel (tiki-admin.php?page=community)
Custom activities
It is possible to record custom activity rules using the Social Networks tab at Community control panel (tiki-admin.php?page=community)
//to record an event place this in to the rule (event-record event args)
Rule type | Description |
sample | Sample events are not recorded as an activity. Use this if you want to disable a rule. |
basic | Recorded as an activity, but the arguments can not be changed. Use this if you want use a rule "as it is". |
advanced | Recorded as an activity and you can modify the arguments as you like. Get familiar with advanced rating language. Use this to customize an event |
notify | Recorded as an activity and also available for notifications. Use this if you want to allow users to subscribe to event related notifications |
Database
Activities are stored in tiki_activity_stream table
Activity rules are stored in tiki_activity_stream_rules table
Display
Activities are displayed using smarty tpl files (see templates/activity/ folder)
//sample tpl file used for displaying tiki.comment.post event type {activityframe activity=$activity heading="{tr _0=$activity.user|userlink}%0 posted a comment to{/tr}"} <p>{object_link type=$activity.type id=$activity.object}</p> {if is_array($activity.aggregate)} <small>{$activity.aggregate.user|userlink}</small> {/if} {/activityframe}