For custom source parsing you'd use the activity_onAssetSource trigger. Source parsing lets CB Activity know what object is in relation to the activity. So for example GJ uses it to tell CB Activity we've a group object as the source for group activity. Example of its usage as follows.
Global
Triggers: activity_onAssetSource
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var1]
Operator: Is REGEX
Value: /hotspot\.\d+/
Action
Method: PHP
Code:
Code:
$variables['var2'] = SOURCE_OBJECT_HERE;
Parameters
References: Variable 2
You'll need to write the necessary PHP and set var2 to it. I've no idea what that might be for whatever your hotspots are, but you'd replace SOURCE_OBJECT_HERE with that source object. This is typically done by pulling the id from the asset using REGEXP then preparing an object from that. This has the benefit of all CB Activity API when calling the source API it knows the object already. That includes the activity_onAfterCreateStreamActivity trigger where var2 is the source object. That triggers variables are as follows.
Code:
$_PLUGINS->trigger( 'activity_onAssetSource', array( $asset, &$source ) );
The above isn't necessary for custom activity display parsing, but I'm just describing the process that CB GroupJive goes through.
As for display parsing you'd use the activity_onDisplayStreamActivity trigger as its name suggests. Same concept as above. We need to modify the data by references. Example as follows.
Global
Triggers: activity_onDisplayStreamActivity
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var1_asset]
Operator: Is REGEX
Value: /hotspot\.\d+/
Action
Method: PHP
Code:
Code:
$variables['var4'] = 'ACTIVITY MESSAGE HERE';
Parameters
References: Variable 2, Variable 4, Variable 5
Variables 2 and 4 are the activity title and message. If you need to insert custom HTML content use variable 5. This triggers variables are as follows.
Code:
$_PLUGINS->trigger( 'activity_onDisplayStreamActivity', array( &$row, &$title, &$date, &$message, &$insert, &$footer, &$menu, $stream, $output ) );
If you implemented the source parsing then you can use $variables->source() to get your hotspot object otherwise you'll have to add the code at this time in your display parsing PHP.