Version 5.0.0 beta 7
This commit is contained in:
1 parent
fa2a720105
commit
54d5dcd0a0
156 files changed
+4337
-2995
No files matched your search
@@ -31,6 +31,7 @@ use IPS\Db;
|
||||
use IPS\Dispatcher;
|
||||
use IPS\File;
|
||||
use IPS\downloads\Category;
|
||||
use IPS\forums\Topic\Post;
|
||||
use IPS\Helpers\Form;
|
||||
use IPS\Helpers\Form\CheckboxSet;
|
||||
use IPS\Helpers\Form\Color;
|
||||
@@ -691,7 +692,10 @@ class Forum extends Model implements Permissions
|
||||
try
|
||||
{
|
||||
$results = [];
|
||||
foreach( Db::i()->select( '*', 'forums_posts', array( 'topic_id=? AND queued=0', Db::i()->select( 'tid', 'forums_topics', array( 'forum_id=? AND approved=1 AND starter_id=? AND is_future_entry=0', $this->_id, Member::loggedIn()->member_id ), 'last_post DESC', 1 )->first() ), 'post_date DESC', $count ) as $post )
|
||||
foreach(
|
||||
new ActiveRecordIterator(
|
||||
Db::i()->select( '*', 'forums_posts', array( 'topic_id=? AND queued=0', Db::i()->select( 'tid', 'forums_topics', array( 'forum_id=? AND approved=1 AND starter_id=? AND is_future_entry=0', $this->_id, Member::loggedIn()->member_id ), 'last_post DESC', 1 )->first() ), 'post_date DESC', $count ),
|
||||
Post::class ) as $post )
|
||||
{
|
||||
$results[ $post->post_date ] = [
|
||||
'author' => $post->author(),
|
||||
|
||||
@@ -380,7 +380,7 @@ class Post extends Comment implements Embeddable,
|
||||
/* If we feature the first post, then pagination is all wrong */
|
||||
if( Member::loggedIn()->getLayoutValue( 'forum_topic_view_firstpost' ) )
|
||||
{
|
||||
return [ 'new_topic=?', 0 ];
|
||||
return [ static::$databasePrefix . static::$databaseColumnMap['first'] . '=?', 0 ];
|
||||
}
|
||||
|
||||
return parent::findCommentWhere();
|
||||
|
||||
@@ -597,16 +597,6 @@ class Topic extends Item implements Embeddable,
|
||||
$current[] = 'hide';
|
||||
}
|
||||
}
|
||||
|
||||
if ( static::modPermission( 'feature', NULL, $container ) )
|
||||
{
|
||||
$options['feature'] = 'create_topic_featured';
|
||||
$toggles['feature'] = array( 'create_topic_featured' );
|
||||
if( $item and $item->mapped('featured') )
|
||||
{
|
||||
$current[] = 'feature';
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $options ) or count( $toggles ) )
|
||||
{
|
||||
@@ -666,11 +656,6 @@ class Topic extends Item implements Embeddable,
|
||||
{
|
||||
$this->pinned = ( in_array( 'pin', $values['topic_create_state'] ) ) ? 1 : 0;
|
||||
}
|
||||
|
||||
if ( static::modPermission( 'feature', NULL, $this->container() ) )
|
||||
{
|
||||
$this->featured = ( in_array( 'feature', $values['topic_create_state'] ) ) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( static::modPermission( 'lock', NULL, $this->container() ) )
|
||||
|
||||
Reference in new issue
Block a user