Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -58,6 +58,7 @@ use function get_class;
|
||||
use function in_array;
|
||||
use function intval;
|
||||
use function is_array;
|
||||
use function method_exists;
|
||||
use function substr;
|
||||
use function ucfirst;
|
||||
|
||||
@@ -595,6 +596,15 @@ abstract class Comment extends Content
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Rebuild club stats? */
|
||||
if( $container = $item->containerWrapper() )
|
||||
{
|
||||
if ( IPS::classUsesTrait( $container, 'IPS\Content\ClubContainer' ) and $club = $container->club() )
|
||||
{
|
||||
$club->updateLastActivityAndItemCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1119,7 +1129,7 @@ abstract class Comment extends Content
|
||||
|
||||
/* Reduce the number of comment/reviews count on the item but only if the item is unapproved or visible
|
||||
* - hidden as opposed to unapproved items do not get included in either of the unapproved_comments/num_comments columns */
|
||||
if( IPS::classUsesTrait( $item, Hideable::class ) )
|
||||
if( $item and IPS::classUsesTrait( $item, Hideable::class ) )
|
||||
{
|
||||
if( $this->hidden() !== -1 AND $this->hidden() !== -2 AND $this->hidden() !== -3 )
|
||||
{
|
||||
@@ -1382,7 +1392,7 @@ abstract class Comment extends Content
|
||||
}
|
||||
|
||||
/* Work out the order */
|
||||
$order = $order ?: ( static::$databasePrefix . static::$databaseColumnMap['date'] . ' DESC' );
|
||||
$order = $order ?: ( static::$databaseTable . '.' . static::$databasePrefix . static::$databaseColumnMap['date'] . ' DESC' );
|
||||
|
||||
/* Exclude hidden comments */
|
||||
if( $includeHiddenComments === Filter::FILTER_AUTOMATIC )
|
||||
@@ -1407,22 +1417,22 @@ abstract class Comment extends Content
|
||||
|
||||
if ( isset( static::$databaseColumnMap['approved'] ) )
|
||||
{
|
||||
$where[] = array( static::$databasePrefix . static::$databaseColumnMap['approved'] . '=?', 0 );
|
||||
$where[] = array( static::$databaseTable . '.' . static::$databasePrefix . static::$databaseColumnMap['approved'] . '=?', 0 );
|
||||
}
|
||||
elseif ( isset( static::$databaseColumnMap['hidden'] ) )
|
||||
{
|
||||
$where[] = array( static::$databasePrefix . static::$databaseColumnMap['hidden'] . '=?', 1 );
|
||||
$where[] = array( static::$databaseTable . '.' . static::$databasePrefix . static::$databaseColumnMap['hidden'] . '=?', 1 );
|
||||
}
|
||||
}
|
||||
elseif ( IPS::classUsesTrait( get_called_class(), 'IPS\Content\Hideable' ) and ( $includeHiddenComments === Filter::FILTER_OWN_HIDDEN OR $includeHiddenComments === Filter::FILTER_PUBLIC_ONLY ) )
|
||||
{
|
||||
if ( isset( static::$databaseColumnMap['approved'] ) )
|
||||
{
|
||||
$where[] = array( static::$databasePrefix . static::$databaseColumnMap['approved'] . '=?', 1 );
|
||||
$where[] = array( static::$databaseTable . '.' . static::$databasePrefix . static::$databaseColumnMap['approved'] . '=?', 1 );
|
||||
}
|
||||
elseif ( isset( static::$databaseColumnMap['hidden'] ) )
|
||||
{
|
||||
$where[] = array( static::$databasePrefix . static::$databaseColumnMap['hidden'] . '=?', 0 );
|
||||
$where[] = array( static::$databaseTable . '.' . static::$databasePrefix . static::$databaseColumnMap['hidden'] . '=?', 0 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1904,7 +1914,7 @@ abstract class Comment extends Content
|
||||
$menu->add( $share );
|
||||
}
|
||||
|
||||
if( method_exists( $this, 'canRecognize') )
|
||||
if( IPS::classUsesTrait( $this, Recognizable::class ) )
|
||||
{
|
||||
if( $this->canRecognize() === TRUE )
|
||||
{
|
||||
@@ -2015,10 +2025,11 @@ abstract class Comment extends Content
|
||||
}
|
||||
}
|
||||
|
||||
if( $this->ip_address AND $member->modPermission('can_use_ip_tools') AND $member->canAccessModule( Module::get( 'core', 'modcp' ) ) )
|
||||
if( isset( static::$databaseColumnMap['ip_address'] ) AND $member->modPermission('can_use_ip_tools') AND $member->canAccessModule( Module::get( 'core', 'modcp' ) ) )
|
||||
{
|
||||
$ipAddressColumn = static::$databaseColumnMap['ip_address'];
|
||||
$menu->addSeparator();
|
||||
$menu->add( new ContentMenuLink( url: Url::internal( 'app=core&module=modcp&controller=modcp&tab=ip_tools&ip=' . $this->ip_address), languageString: Member::loggedIn()->language()->addToStack( 'ip_address' ) . ' ' . $this->ip_address ) );
|
||||
$menu->add( new ContentMenuLink( url: Url::internal( 'app=core&module=modcp&controller=modcp&tab=ip_tools&ip=' . $this->$ipAddressColumn ), languageString: Member::loggedIn()->language()->addToStack( 'ip_address' ) . ' ' . $this->$ipAddressColumn ) );
|
||||
}
|
||||
|
||||
foreach( $this->ui( 'menuItems', array(), TRUE ) as $key => $link )
|
||||
|
||||
Reference in new issue
Block a user