Version 5.0.0 beta 9
This commit is contained in:
1 parent
214f649f1d
commit
56979f8ee8
202 files changed
+4403
-1123
No files matched your search
@@ -56,7 +56,7 @@ class FacebookPixel extends CommunityEnhancementsAbstract
|
||||
/**
|
||||
* @brief Icon data
|
||||
*/
|
||||
public string $icon = "facebook.png";
|
||||
public string $icon = "meta.png";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@@ -58,7 +58,7 @@ class GoogleMaps extends CommunityEnhancementsAbstract
|
||||
/**
|
||||
* @brief Icon data
|
||||
*/
|
||||
public string $icon = "google_maps.jpeg";
|
||||
public string $icon = "google_maps.png";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@@ -791,10 +791,23 @@ class Core extends MemberHistoryAbstract
|
||||
$club = Club::load( $jsonValue['club_id'] );
|
||||
switch( $jsonValue['type'] )
|
||||
{
|
||||
case Club::STATUS_INVITED:
|
||||
case Club::STATUS_INVITED_BYPASSING_PAYMENT:
|
||||
if( isset( $jsonValue['remove'] ) and $jsonValue['remove'] )
|
||||
{
|
||||
return Member::loggedIn()->language()->addToStack( 'history_invite_club_canceled', false, [ 'htmlsprintf' => [ $club->name, $byStaff ] ] );
|
||||
}
|
||||
return Member::loggedIn()->language()->addToStack( 'history_invited_to_club', false, array( 'htmlsprintf' => array( $club->name, $byStaff ) ) );
|
||||
case Club::STATUS_BANNED:
|
||||
return Member::loggedIn()->language()->addToStack( 'history_removed_from_club', FALSE, array('htmlsprintf' => array( $club->name, $byStaff ) ) );
|
||||
case Club::STATUS_MEMBER:
|
||||
return Member::loggedIn()->language()->addToStack( 'history_added_to_club', FALSE, array('htmlsprintf' => array( $club->name, $byStaff ) ) );
|
||||
case Club::STATUS_LEFT:
|
||||
return Member::loggedIn()->language()->addToStack( 'history_left_club', false, [ 'htmlsprintf' => [ $club->name ] ] );
|
||||
case Club::STATUS_REQUESTED:
|
||||
return Member::loggedIn()->language()->addToStack( 'history_request_club', false, [ 'htmlsprintf' => [ $club->name ] ] );
|
||||
case Club::STATUS_DECLINED:
|
||||
return Member::loggedIn()->language()->addToStack( 'history_decline_club', false, [ 'htmlsprintf' => [ $club->name ] ] );
|
||||
}
|
||||
}
|
||||
catch ( Exception $e ) { }
|
||||
|
||||
@@ -75,18 +75,21 @@ class FeaturedComments
|
||||
{
|
||||
$member = $member ?: Member::loggedIn();
|
||||
$commentIdField = $comment::$databaseColumnId;
|
||||
|
||||
$idToRemove = FALSE;
|
||||
foreach( $item->getMeta()['core_FeaturedComments'] AS $key => $data )
|
||||
|
||||
$metaData = $item->getMeta();
|
||||
if( isset( $metaData['core_FeaturedComments'] ) )
|
||||
{
|
||||
if ( $data['comment'] == $comment->$commentIdField )
|
||||
$idToRemove = FALSE;
|
||||
foreach( $metaData['core_FeaturedComments'] AS $key => $data )
|
||||
{
|
||||
$idToRemove = $key;
|
||||
break;
|
||||
if ( $data['comment'] == $comment->$commentIdField )
|
||||
{
|
||||
$idToRemove = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$item->deleteMeta( $idToRemove );
|
||||
}
|
||||
|
||||
$item->deleteMeta( $idToRemove );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ use IPS\Member;
|
||||
use IPS\Patterns\ActiveRecordIterator;
|
||||
use OutOfRangeException;
|
||||
use function defined;
|
||||
use const IPS\REBUILD_NORMAL;
|
||||
use const IPS\REBUILD_SLOW;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
@@ -60,6 +60,8 @@ class MemberContent extends QueueAbstract
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$data['last_id'] = 0;
|
||||
|
||||
/* Get count - only do this if we're deleting member content, not guest content */
|
||||
if ( $data['member_id'] )
|
||||
@@ -93,18 +95,22 @@ class MemberContent extends QueueAbstract
|
||||
public function run( array &$data, int $offset ): int
|
||||
{
|
||||
$classname = $data['class'];
|
||||
$idColumn = $classname::$databaseColumnId;
|
||||
$exploded = explode( '\\', $classname );
|
||||
if ( !class_exists( $classname ) or !Application::appIsEnabled( $exploded[1] ) )
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
|
||||
$select = $classname::db()->select( '*', $classname::$databaseTable, static::_getWhere( $data ), $classname::$databasePrefix.$classname::$databaseColumnId, array( 0, REBUILD_NORMAL ) );
|
||||
$select = $classname::db()->select( '*', $classname::$databaseTable, static::_getWhere( $data ), $classname::$databasePrefix.$classname::$databaseColumnId, REBUILD_SLOW );
|
||||
|
||||
/* Keep track of how many we did since we cannot rely on the count for guests */
|
||||
$did = 0;
|
||||
foreach ( new ActiveRecordIterator( $select, $classname ) as $item )
|
||||
{
|
||||
$did++;
|
||||
$data['last_id'] = $item->$idColumn;
|
||||
|
||||
/* If this is the first comment on an item where a first comment is required (e.g. posts) do nothing, as when we get to the item, that will handle it */
|
||||
if ( $item instanceof Comment )
|
||||
{
|
||||
@@ -158,7 +164,7 @@ class MemberContent extends QueueAbstract
|
||||
|
||||
$did++;
|
||||
}
|
||||
catch( OutOfRangeException |ErrorException $e )
|
||||
catch( OutOfRangeException | ErrorException $e )
|
||||
{
|
||||
$did++;
|
||||
}
|
||||
@@ -168,12 +174,8 @@ class MemberContent extends QueueAbstract
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
else if( isset( $data['count'] ) AND ( $offset + REBUILD_NORMAL >= $data['count'] ) )
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
|
||||
return ( $offset + REBUILD_NORMAL );
|
||||
|
||||
return ( $offset + $did );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,11 +228,19 @@ class MemberContent extends QueueAbstract
|
||||
{
|
||||
/* @var array $databaseColumnMap */
|
||||
$classname = $data['class'];
|
||||
$where = array( array( $classname::$databasePrefix . $classname::$databaseColumnMap['author'] . '=?', $data['member_id'] ) );
|
||||
$where = [
|
||||
[
|
||||
$classname::$databasePrefix . $classname::$databaseColumnId . '>?', $data['last_id']
|
||||
]
|
||||
];
|
||||
|
||||
if ( !$data['member_id'] )
|
||||
{
|
||||
$where = array( $classname::$databasePrefix . $classname::$databaseColumnMap['author_name'] . '=?', $data['name'] );
|
||||
$where[] = [ $classname::$databasePrefix . $classname::$databaseColumnMap['author_name'] . '=?', $data['name'] ];
|
||||
}
|
||||
else
|
||||
{
|
||||
$where[] = [ $classname::$databasePrefix . $classname::$databaseColumnMap['author'] . '=?', $data['member_id'] ];
|
||||
}
|
||||
|
||||
if ( $data['action'] == 'hide' )
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace IPS\core\extensions\core\Queue;
|
||||
|
||||
use IPS\Content;
|
||||
use IPS\Content\Item;
|
||||
use IPS\Content\Search\Index;
|
||||
use IPS\Content\Search\SearchContent;
|
||||
use IPS\Db;
|
||||
use IPS\Extensions\QueueAbstract;
|
||||
use IPS\Member;
|
||||
@@ -109,6 +111,19 @@ class UpdateTaggedItems extends QueueAbstract
|
||||
}
|
||||
|
||||
$item->setTags( $currentTags );
|
||||
|
||||
/* Update the search index */
|
||||
if( SearchContent::isSearchable( $item ) )
|
||||
{
|
||||
if( $item::$firstCommentRequired )
|
||||
{
|
||||
Index::i()->index( $item->firstComment() );
|
||||
}
|
||||
else
|
||||
{
|
||||
Index::i()->index( $item );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( OutOfRangeException ){}
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user