diff options
Diffstat (limited to 'includes')
| -rwxr-xr-x | includes/bit_setup_inc.php | 1 | ||||
| -rwxr-xr-x | includes/classes/FeedStatus.php | 11 | ||||
| -rw-r--r-- | includes/feed_lib.php | 23 |
3 files changed, 17 insertions, 18 deletions
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php index 65525f5..958e0fa 100755 --- a/includes/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -12,7 +12,6 @@ define( 'FEED_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path' define( 'FEED_PKG_INCLUDE_URL', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); $gBitSystem->registerPackage( $pRegisterHash ); - if( $gBitSystem->isPackageActive( 'feed' ) ) { if( $gBitUser->hasPermission( 'p_feed_view' )) { $menuHash = [ diff --git a/includes/classes/FeedStatus.php b/includes/classes/FeedStatus.php index 07d4b97..fb5f34a 100755 --- a/includes/classes/FeedStatus.php +++ b/includes/classes/FeedStatus.php @@ -12,6 +12,7 @@ * required setup */ namespace Bitweaver\Feed; + use Bitweaver\Liberty\LibertyComment; use Bitweaver\Users\RoleUser; @@ -27,15 +28,15 @@ class FeedStatus extends LibertyComment { * During initialisation, be sure to call our base constructors **/ public function FeedStatus($pCommentId = null, $pContentId = null, $pInfo = null) { - + LibertyComment::LibertyComment($pCommentId,$pContentId,$pInfo); - + /* // Permission setup $this->mViewContentPerm = 'p_boards_read'; $this->mUpdateContentPerm = 'p_boards_post_update'; $this->mAdminContentPerm = 'p_boards_admin'; */ - + $this->mContentTypeGuid = FEEDSTATUS_CONTENT_TYPE_GUID; $this->registerContentType( FEEDSTATUS_CONTENT_TYPE_GUID, [ 'content_type_guid' => FEEDSTATUS_CONTENT_TYPE_GUID, @@ -43,7 +44,7 @@ class FeedStatus extends LibertyComment { 'handler_class' => 'FeedStatus', 'handler_package' => 'feed', 'handler_file' => 'FeedStatus.php', - 'maintainer_url' => 'https://www.bitweaver.org' + 'maintainer_url' => 'https://www.bitweaver.org', ] ); /* $this->mViewContentPerm = 'p_loc_view'; @@ -52,7 +53,7 @@ class FeedStatus extends LibertyComment { $this->mAdminContentPerm = 'p_loc_admin'; */ } - + public function getThumbnailUrl( string $pSize = 'avatar', ?array $pInfoHash = null, ?int $pSecondaryId = null, ?int $pDefault = null ): string|null { $rootUser = new RoleUser(null,$this->mInfo['root_id']); $rootUser->load(); diff --git a/includes/feed_lib.php b/includes/feed_lib.php index e4766c2..aafa5ba 100644 --- a/includes/feed_lib.php +++ b/includes/feed_lib.php @@ -13,6 +13,7 @@ * feed_get_actions */ namespace Bitweaver\Feed; + use Bitweaver\BitBase; use Bitweaver\KernelTools; use Bitweaver\Liberty\LibertyContent; @@ -46,7 +47,7 @@ function feed_get_actions( $pListHash ) { $overrides = $gBitDb->getAssoc( $conjugationQuery ); $actions = []; - + //loop through directed actions while ( $action = $res->fetchRow() ){ if( !empty($action['content_id']) ) { //indicates that this isn't a direct action, more of a "status update" ex. "Ronald is pleased with his artwork" @@ -63,7 +64,7 @@ function feed_get_actions( $pListHash ) { } }else{ $action['real_log'] .= KernelTools::tra( 'edited' ).' <a href="'.$content->getDisplayUrl().'">'.$content->getTitle().'</a>'; - } + } } else { unset( $action ); //invalid content_id } @@ -106,22 +107,21 @@ function feed_get_status( $pListHash ){ $res = $gBitDb->query( $query, $bindVars, $pListHash['max_records'] ); - $user = new RoleUser($pListHash['user_id']); + $user = new RoleUser($pListHash['user_id']); $user->load(); - - + while ( $status = $res->fetchRow() ){ $avatarUrl = $user->getThumbnailUrl(); if(empty($avatarUrl)){ $avatarUrl = USERS_PKG_URI."icons/silhouette.png"; } - + $status['feed_icon_url'] = $avatarUrl; - + $comment = new LibertyComment(null,$status['content_id']); $replies = $comment->getComments($status['content_id'],null,null,'commentDate_asc'); $status['replies'] = $replies; - + foreach ( $status['replies'] as &$reply ){ $replyUser = new RoleUser($reply['user_id']); $replyUser->load(); @@ -145,9 +145,9 @@ function feed_get_status( $pListHash ){ break; } $i++; - } + } } - $statuses[] = $status; + $statuses[] = $status; } return $statuses; @@ -155,13 +155,12 @@ function feed_get_status( $pListHash ){ function feed_get_status_and_actions( $pParamHash ) { - } function feed_set_status( $pParamHash ){ global $gBitDb; - + $status = new FeedStatus(); global $gBitUser; |
