blob: a73bc4ffb8a26ad0a9efdad766a4444047c0c0a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<?php
function feed_get_actions( $pListHash ) {
global $gBitDb;
$query = "SELECT lal.content_id, lal.user_id, MAX(lal.last_modified) AS last_modified, uu.login, uu.real_name, uu.email
FROM liberty_action_log lal
INNER JOIN liberty_content lc ON (lc.content_id=lal.content_id)
INNER JOIN users_users uu ON (uu.user_id=lal.user_id)
WHERE lal.user_id = ?
GROUP BY lal.content_id, lal.user_id, uu.login, uu.real_name, uu.email
ORDER BY MAX(lal.last_modified) DESC";
$res = $gBitDb->query( $query, array( $pListHash['user_id'] ), 10 );
$conjugationQuery = "SELECT * FROM feed_conjugation";
$overrides = $gBitDb->getAssoc( $conjugationQuery );
$actions = array();
while ( $action = $res->fetchRow() ){
if( $content = LibertyContent::getLibertyObject($action['content_id']) ) {
$contentType = $content->getContentType();
$action['real_log'] = BitUser::getDisplayName( empty( $pParams['nolink'] ), $action ).' ';
if(!empty($overrides[strtolower($contentType)])){
$action['real_log'] .= $overrides[$contentType]['conjugation_phrase'];
if($overrides[$contentType]['is_target_linked'] == 'y'){
$action['real_log'] .= ' <a href="'.$content->getDisplayUrl().'">'.$content->getTitle().'</a>';
}
if( !empty( $overrides[$contentType]['feed_icon_url'] ) ) {
$action['feed_icon_url'] = $overrides[$contentType]['feed_icon_url'];
}
}else{
$action['real_log'] .= tra( 'edited' ).' <a href="'.$content->getDisplayUrl().'">'.$content->getTitle().'</a>';
}
if( empty( $action['feed_icon_url'] ) ) {
$action['feed_icon_url'] = FEED_PKG_URL.'icons/pixelmixerbasic/pencil_16.png';
}
$actions[] = $action;
} else {
unset( $action );
}
}
return $actions;
}
?>
|