Oh, I see. You want content shown before the activity header. The best way to do that is act on the stream trigger and not the activity display trigger. Specifically activity_onBeforeDisplayActivityStream. Directly returning HTML in a Code action will insert it to the top of the stream. Its variables are as follows.
Code:
$_PLUGINS->trigger( 'activity_onBeforeDisplayActivityStream', array( &$rows, &$pageNav, &$searching, $viewer, &$stream, $output ) );
Below example for inserting HTML at the top.
Global
Triggers: activity_onBeforeDisplayActivityStream
Type: Code
User: Automatic
Access: Everybody
Action
Method: HTML
Code:
Output
Display: return
Now lets take this a step further and output data from the first activity entry.
Global
Triggers: activity_onBeforeDisplayActivityStream
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
Code:
echo array_values( $variables['var1'] )[0]->get( 'message' );
Output
Display: return
That will output the first message in the array. Now lets make sure there's activity to display AND that we're only looking at 1 filtered activity entry.
Global
Triggers: activity_onBeforeDisplayActivityStream
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Custom > Code
Custom Code:
Code:
return ( $variables['var5']->getInt( 'id' ) && $variables['var1'] ? 1 : 0 );
Operator: Equal To
Value: 1
Action
Method: PHP
Code:
Code:
$activity = array_values( $variables['var1'] )[0];
echo $activity->get( 'message' );
Output
Display: return
Now you can insert whatever you want at the top of directly accessed activity entries and still have access to that activity entries data.