Version 3.4.6
This commit is contained in:
1 parent
e4478369d8
commit
b45ea0dffb
1568 files changed
+155104
-161665
No files matched your search
@@ -3,7 +3,7 @@
|
||||
* <pre>
|
||||
* Status Updates Class
|
||||
* Holds various functions
|
||||
* Last Updated: $Date: 2013-02-13 11:25:39 -0500 (Wed, 13 Feb 2013) $
|
||||
* Last Updated: $Date: 2013-10-16 12:57:41 -0400 (Wed, 16 Oct 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
@@ -12,7 +12,7 @@
|
||||
* @package IP.Board
|
||||
* @author MattMecham
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 11985 $
|
||||
* @version $Rev: 12380 $
|
||||
*
|
||||
* Example: Create new status update
|
||||
* <code>
|
||||
@@ -59,7 +59,7 @@ class memberStatus
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
@@ -90,7 +90,7 @@ class memberStatus
|
||||
* Bypass all permission checks
|
||||
*
|
||||
* Use with care, this will allow the class to be used within an API
|
||||
*
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_bypassPermChecks = false;
|
||||
@@ -194,7 +194,7 @@ class memberStatus
|
||||
* Fetch status actions
|
||||
* Default filters are last 10 status actions from everyone sorted in desc date order.
|
||||
* 'not_theirs' pulls all actions that are not on their own statuses
|
||||
* @param mixed [Array of member data OR member ID INT for member updating their status - will use ->getAuthor() if null]
|
||||
* @param mixed [Array of member data OR member ID INT for member updating their status - will use ->getAuthor() if null]
|
||||
* @param array Array of sort/filter data ( member_id [int], status_id [int], offset [int], limit [int], unix_cutoff [int], sort_dir [asc,desc], sort_field [string], 'not_theirs' [0,1] )
|
||||
*/
|
||||
public function fetchActions( $author=null, $filters=array() )
|
||||
@@ -302,8 +302,8 @@ class memberStatus
|
||||
* The 'isApproved' flag can contain true, false or null (true, approved only, false, unapproved only, null both)
|
||||
* The 'ignorePermissions' flag can be set to true (do not verify we can view) or false (pull only statuses we can see based on other filters), defaulting to false
|
||||
* getCount - returns a count of all matches without the limit
|
||||
*
|
||||
* @param mixed [Array of member data OR member ID INT for member updating their status - will use ->getAuthor() if null]
|
||||
*
|
||||
* @param mixed [Array of member data OR member ID INT for member updating their status - will use ->getAuthor() if null]
|
||||
* @param array Array of sort/filter data ( member_id [int], latest_only [0,1], offset [int], limit [int], unix_cutoff [int], sort_dir [asc,desc], sort_field [string], type [string] )
|
||||
*/
|
||||
public function fetch( $author=null, $filters=array() )
|
||||
@@ -330,7 +330,7 @@ class memberStatus
|
||||
|
||||
if ( isset( $filters['relatedTo'] ) && ! empty( $filters['relatedTo'] ) )
|
||||
{
|
||||
$where[] = "s.status_member_id=" . intval( $filters['relatedTo'] ) . ' OR s.status_author_id=' . intval( $filters['relatedTo'] );
|
||||
$where[] = "s.status_member_id=" . intval( $filters['relatedTo'] ) . ' OR s.status_author_id=' . intval( $filters['relatedTo'] );
|
||||
}
|
||||
|
||||
if ( isset( $filters['ownerOnly'] ) )
|
||||
@@ -418,7 +418,7 @@ class memberStatus
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=s.status_author_id',
|
||||
'type' => 'left' ),
|
||||
array(
|
||||
array(
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'pp.pp_member_id=m.member_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
@@ -508,7 +508,7 @@ class memberStatus
|
||||
if ( is_array( $row['replies'] ) )
|
||||
{
|
||||
foreach( $row['replies'] as $rid => $r )
|
||||
{
|
||||
{
|
||||
if ( $members[ $r['reply_member_id'] ] )
|
||||
{
|
||||
if ( ! isset( $members[ $r['reply_member_id'] ]['_done'] ) )
|
||||
@@ -532,7 +532,7 @@ class memberStatus
|
||||
* Fetch all replies to a status
|
||||
* Default filters are sorted on reply_date ASC
|
||||
*
|
||||
* @param mixed [Array of member data OR member ID INT for member updating their status - will use ->getAuthor() if null]
|
||||
* @param mixed [Array of member data OR member ID INT for member updating their status - will use ->getAuthor() if null]
|
||||
* @param array Array of sort/filter data ( member_id [int], latest_only [0,1], offset [int], limit [int], unix_cutoff [int], sort_dir [asc,desc], sort_field [string] )
|
||||
*/
|
||||
public function fetchAllReplies( $status=null, $filters=array() )
|
||||
@@ -697,7 +697,7 @@ class memberStatus
|
||||
IPSText::getTextClass('email')->getTemplate( 'new_status', $friend['language'] );
|
||||
IPSText::getTextClass('email')->buildMessage( $ndata );
|
||||
|
||||
$_subject = sprintf( IPSText::getTextClass('email')->subject,
|
||||
$_subject = sprintf( IPSText::getTextClass('email')->subject,
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $owner['member_id'], 'publicNoSession', $owner['members_seo_name'], 'showuser' ),
|
||||
$owner['members_display_name'],
|
||||
$statusUrl );
|
||||
@@ -765,7 +765,7 @@ class memberStatus
|
||||
|
||||
$this->_recordAction( 'reply', $author, $status, $data );
|
||||
|
||||
$this->rebuildStatus( $status );
|
||||
$this->rebuildStatus( $status );
|
||||
$this->rebuildOwnerLatest( $author );
|
||||
|
||||
$this->_sendNotification( $author, $status, $data );
|
||||
@@ -784,10 +784,10 @@ class memberStatus
|
||||
* @param int Status ID just posted
|
||||
* @param array [Array of member data for member updating their status - will use ->getAuthor() if null]
|
||||
* @param string [Content to update]
|
||||
* @todo [Future] At some point it could be expanded into a mini framework with plugins
|
||||
* @todo [Future] At some point it could be expanded into a mini framework with plugins
|
||||
*/
|
||||
protected function _triggerExternalUpdates( $updates, $status_id=0, $author=null, $content=null )
|
||||
{
|
||||
{
|
||||
$author = ( $author === null ) ? $this->getAuthor() : $author;
|
||||
$content = ( $content ) ? $this->_cleanContent( $content ) : $this->_cleanContent( $this->getContent() );
|
||||
|
||||
@@ -815,7 +815,7 @@ class memberStatus
|
||||
if ( $updates['facebook'] )
|
||||
{
|
||||
if ( IPSLib::fbc_enabled() AND $author['fb_uid'] )
|
||||
{
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' );
|
||||
$facebook = new $classToLoad( $this->registry );
|
||||
$facebook->updateStatusWithUrl( $content, $url, FALSE );
|
||||
@@ -874,9 +874,9 @@ class memberStatus
|
||||
|
||||
IPSText::getTextClass('email')->buildMessage( $data );
|
||||
|
||||
IPSText::getTextClass('email')->subject = sprintf(
|
||||
IPSText::getTextClass('email')->subject,
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $_replier['member_id'], 'public', $_replier['members_seo_name'], 'showuser' ),
|
||||
IPSText::getTextClass('email')->subject = sprintf(
|
||||
IPSText::getTextClass('email')->subject,
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $_replier['member_id'], 'public', $_replier['members_seo_name'], 'showuser' ),
|
||||
$_replier['members_display_name'],
|
||||
$statusUrl
|
||||
);
|
||||
@@ -904,7 +904,7 @@ class memberStatus
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$_ids[ $row['reply_member_id'] ] = $row['reply_member_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $_ids ) )
|
||||
{
|
||||
@@ -951,20 +951,20 @@ class memberStatus
|
||||
|
||||
if ( $_replier['member_id'] == $_owner['member_id'] )
|
||||
{
|
||||
IPSText::getTextClass('email')->subject = sprintf(
|
||||
$this->lang->words['subject__their_status_reply'],
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $_replier['member_id'], 'public', $_replier['members_seo_name'], 'showuser' ),
|
||||
IPSText::getTextClass('email')->subject = sprintf(
|
||||
$this->lang->words['subject__their_status_reply'],
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $_replier['member_id'], 'public', $_replier['members_seo_name'], 'showuser' ),
|
||||
$_replier['members_display_name'],
|
||||
$statusUrl
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
IPSText::getTextClass('email')->subject = sprintf(
|
||||
$this->lang->words['subject__other_status_reply'],
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $_replier['member_id'], 'public', $_replier['members_seo_name'], 'showuser' ),
|
||||
IPSText::getTextClass('email')->subject = sprintf(
|
||||
$this->lang->words['subject__other_status_reply'],
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $_replier['member_id'], 'public', $_replier['members_seo_name'], 'showuser' ),
|
||||
$_replier['members_display_name'],
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $_owner['member_id'], 'public', $_owner['members_seo_name'], 'showuser' ),
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $_owner['member_id'], 'public', $_owner['members_seo_name'], 'showuser' ),
|
||||
$_owner['members_display_name'],
|
||||
$statusUrl
|
||||
);
|
||||
@@ -1017,9 +1017,9 @@ class memberStatus
|
||||
'LINK' => $memberUrl
|
||||
) );
|
||||
|
||||
IPSText::getTextClass('email')->subject = sprintf( IPSText::getTextClass('email')->subject,
|
||||
IPSText::getTextClass('email')->subject = sprintf( IPSText::getTextClass('email')->subject,
|
||||
$memberUrl,
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $author['member_id'], 'public', $author['members_seo_name'], 'showuser' ),
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $author['member_id'], 'public', $author['members_seo_name'], 'showuser' ),
|
||||
$author['members_display_name'] );
|
||||
|
||||
$notifyLibrary->setMember( $owner );
|
||||
@@ -1125,7 +1125,7 @@ class memberStatus
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all user's status'
|
||||
@@ -1229,7 +1229,7 @@ class memberStatus
|
||||
foreach( $statusIds as $sid )
|
||||
{
|
||||
/* Rebuild this status */
|
||||
$this->rebuildStatus( $sid );
|
||||
$this->rebuildStatus( $sid );
|
||||
|
||||
/* Rebuild latest */
|
||||
$this->rebuildOwnerLatest( $members[ $stom[ $sid ] ] );
|
||||
@@ -1296,7 +1296,7 @@ class memberStatus
|
||||
$this->DB->delete( 'member_status_actions', 'action_reply_id=' . $reply['reply_id'] );
|
||||
|
||||
/* Rebuild this status */
|
||||
$this->rebuildStatus( $status );
|
||||
$this->rebuildStatus( $status );
|
||||
|
||||
/* Rebuild latest */
|
||||
$this->rebuildOwnerLatest( $author );
|
||||
@@ -1565,7 +1565,7 @@ class memberStatus
|
||||
* @return bool
|
||||
*/
|
||||
public function canComment( $author=null, $owner=null, $status=null )
|
||||
{
|
||||
{
|
||||
$author = ( $author === null ) ? $this->getAuthor() : $author;
|
||||
$owner = ( $owner === null ) ? $this->_internalData['StatusOwner'] : $owner;
|
||||
|
||||
@@ -1890,7 +1890,7 @@ class memberStatus
|
||||
$author = ( $author === null ) ? $this->getAuthor() : $author;
|
||||
|
||||
if ( $author['member_id'] AND $custom['text'] )
|
||||
{
|
||||
{
|
||||
$this->DB->insert( 'member_status_actions', array( 'action_member_id' => $author['member_id'],
|
||||
'action_date' => time(),
|
||||
'action_custom' => 1,
|
||||
@@ -1916,7 +1916,7 @@ class memberStatus
|
||||
$reply = ( $reply === null ) ? $this->_internalData['ReplyData'] : ( ( is_array( $reply ) ) ? $reply : $this->_loadReply( $reply ) );
|
||||
|
||||
if ( $author['member_id'] AND $status['status_id'] )
|
||||
{
|
||||
{
|
||||
$this->DB->insert( 'member_status_actions', array( 'action_status_id' => $status['status_id'],
|
||||
'action_reply_id' => intval( $reply['reply_id'] ),
|
||||
'action_member_id' => $author['member_id'],
|
||||
@@ -2069,7 +2069,7 @@ class memberStatus
|
||||
|
||||
/**
|
||||
* Callback to auto-parse @names
|
||||
*
|
||||
*
|
||||
* @param array Matches from the regular expression
|
||||
* @return string Converted text
|
||||
*/
|
||||
@@ -2080,19 +2080,19 @@ class memberStatus
|
||||
|
||||
/**
|
||||
* Callback to auto-parse #tags
|
||||
*
|
||||
*
|
||||
* @param array Matches from the regular expression
|
||||
* @return string Converted text
|
||||
*/
|
||||
protected function _autoParseTags( $matches )
|
||||
{
|
||||
return $this->_autoParseUrls( array( '', $matches[1], 'http://search.twitter.com/search?q=%23' . urlencode( $matches[3] ), $matches[2] ) );
|
||||
return $this->_autoParseUrls( array( '', $matches[1], 'http://twitter.com/search?q=%23' . urlencode( $matches[3] ), $matches[2] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to auto-parse urls
|
||||
* I totally stole this from Brandon's code but do NOT tell him.
|
||||
*
|
||||
*
|
||||
* @param array Matches from the regular expression
|
||||
* @return string Converted text
|
||||
*/
|
||||
@@ -2159,7 +2159,7 @@ class memberStatus
|
||||
}
|
||||
}
|
||||
|
||||
/* Moderated Posting */
|
||||
/* Moderated Posting */
|
||||
if ( $author['mod_posts'] )
|
||||
{
|
||||
if ( $author['mod_posts'] == 1 )
|
||||
|
||||
Reference in new issue
Block a user