Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -291,6 +291,11 @@ class _Status extends \IPS\Content\Item implements \IPS\Content\Lockable, \IPS\C
|
||||
$return = TRUE;
|
||||
|
||||
/* Can we access the module? */
|
||||
if( !( $member->canAccessModule( \IPS\Application\Module::get( 'core', 'status' ) ) and \IPS\Settings::i()->profile_comments ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( !parent::canCreate( $member, $container, $showError ) )
|
||||
{
|
||||
$return = FALSE;
|
||||
@@ -378,6 +383,21 @@ class _Status extends \IPS\Content\Item implements \IPS\Content\Lockable, \IPS\C
|
||||
return $formElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the comment form object
|
||||
*
|
||||
* @return \IPS\Helpers\Form
|
||||
*/
|
||||
protected function _commentForm()
|
||||
{
|
||||
$idColumn = static::$databaseColumnId;
|
||||
$form = new \IPS\Helpers\Form( 'commentform' . '_' . $this->$idColumn, static::$formLangPrefix . 'submit_comment', $this->url() );
|
||||
$form->class = 'ipsForm_vertical';
|
||||
$form->hiddenValues['_contentReply'] = TRUE;
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the comment form elements
|
||||
*
|
||||
@@ -419,7 +439,7 @@ class _Status extends \IPS\Content\Item implements \IPS\Content\Lockable, \IPS\C
|
||||
{
|
||||
/* Create */
|
||||
$status = parent::createFromForm( $values, $container, $sendNotification );
|
||||
\IPS\File::claimAttachments( 'status', $status->id, NULL, $status->member_id );
|
||||
\IPS\File::claimAttachments( 'status' . $status->member_id, $status->id, NULL, $status->member_id );
|
||||
|
||||
/* Return */
|
||||
return $status;
|
||||
@@ -528,23 +548,37 @@ class _Status extends \IPS\Content\Item implements \IPS\Content\Lockable, \IPS\C
|
||||
|
||||
$notification->send();
|
||||
}
|
||||
|
||||
/* Notify when a follower posts a status update */
|
||||
if ( $this->author()->member_id == $this->member_id )
|
||||
}
|
||||
|
||||
/**
|
||||
* Users to receive immediate notifications
|
||||
*
|
||||
* @param int|array $limit LIMIT clause
|
||||
* @param string|NULL $extra Additional data
|
||||
* @param boolean $countOnly Just return the count
|
||||
* @return \IPS\Db\Select
|
||||
*/
|
||||
public function notificationRecipients( $limit=array( 0, 25 ), $extra=NULL, $countOnly=FALSE )
|
||||
{
|
||||
if( $countOnly )
|
||||
{
|
||||
$notification = new \IPS\Notification( \IPS\Application::load( 'core' ), 'new_status', $this, array( $this ) );
|
||||
$followers = \IPS\Member::load( $this->member_id )->followers( 3, array( 'immediate' ), $this->mapped('date'), NULL );
|
||||
|
||||
if( $followers !== NULL and \count( $followers ) )
|
||||
{
|
||||
foreach( $followers AS $follower )
|
||||
{
|
||||
$notification->recipients->attach( \IPS\Member::load( $follower['follow_member_id'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
$notification->send( $sentTo );
|
||||
return $this->author()->followersCount( 3, array( 'immediate' ), $this->mapped('date') );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->author()->followers( 3, array( 'immediate' ), $this->mapped('date'), $limit );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Notification
|
||||
*
|
||||
* @param string|NULL $extra Additional data
|
||||
* @return \IPS\Notification
|
||||
*/
|
||||
protected function createNotification( $extra=NULL )
|
||||
{
|
||||
return new \IPS\Notification( \IPS\Application::load( 'core' ), 'new_status', $this, array( $this ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -692,8 +726,7 @@ class _Status extends \IPS\Content\Item implements \IPS\Content\Lockable, \IPS\C
|
||||
if ( $numberOfComments >= $limit )
|
||||
{
|
||||
/* Work out what page we're looking at, but only if we are actually paginating through comments */
|
||||
/* @future we should probably remove the dependancy on \IPS\Request::i()->page here, as the status may be display on a page that isn't necessarily the profile (ex: My Activity) */
|
||||
$page = ( isset( \IPS\Request::i()->page ) AND isset( \IPS\Request::i()->status ) ) ? \intval( \IPS\Request::i()->page ) : 1;
|
||||
$page = ( isset( \IPS\Request::i()->commentPage ) AND isset( \IPS\Request::i()->status ) ) ? \intval( \IPS\Request::i()->commentPage ) : 1;
|
||||
if( $page < 1 )
|
||||
{
|
||||
$page = 1;
|
||||
@@ -757,7 +790,7 @@ class _Status extends \IPS\Content\Item implements \IPS\Content\Lockable, \IPS\C
|
||||
* @param array $reactions Reaction Data
|
||||
* @return string
|
||||
*/
|
||||
public static function searchResult( array $indexData, array $authorData, array $itemData, array $containerData = NULL, array $reputationData, $reviewRating, $iPostedIn, $view, $asItem, $canIgnoreComments=FALSE, $template=NULL, $reactions=array() )
|
||||
public static function searchResult( array $indexData, array $authorData, array $itemData, ?array $containerData, array $reputationData, $reviewRating, $iPostedIn, $view, $asItem, $canIgnoreComments=FALSE, $template=NULL, $reactions=array() )
|
||||
{
|
||||
if ( $template !== NULL )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user