summaryrefslogtreecommitdiff
path: root/feed_lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'feed_lib.php')
-rw-r--r--feed_lib.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/feed_lib.php b/feed_lib.php
index a73bc4f..18a82f5 100644
--- a/feed_lib.php
+++ b/feed_lib.php
@@ -3,15 +3,24 @@
function feed_get_actions( $pListHash ) {
global $gBitDb;
+ $whereSql = '';
+ $bindVars = array();
+
+ BitBase::prepGetList( $pListHash );
+ if( !empty( $pListHash['user_id'] ) ) {
+ $whereSql = " WHERE lal.user_id = ? ";
+ $bindVars[] = $pListHash['user_id'];
+ }
+
$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 = ?
+ $whereSql
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 );
+ $res = $gBitDb->query( $query, $bindVars, $pListHash['max_records'] );
$conjugationQuery = "SELECT * FROM feed_conjugation";
$overrides = $gBitDb->getAssoc( $conjugationQuery );
@@ -20,7 +29,7 @@ function feed_get_actions( $pListHash ) {
while ( $action = $res->fetchRow() ){
if( $content = LibertyContent::getLibertyObject($action['content_id']) ) {
$contentType = $content->getContentType();
- $action['real_log'] = BitUser::getDisplayName( empty( $pParams['nolink'] ), $action ).' ';
+ $action['real_log'] = BitUser::getDisplayName( empty( $pListHash['no_link_user'] ), $action ).' ';
if(!empty($overrides[strtolower($contentType)])){
$action['real_log'] .= $overrides[$contentType]['conjugation_phrase'];
if($overrides[$contentType]['is_target_linked'] == 'y'){