Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -318,8 +318,9 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
$path = trim( $path , '/');
|
||||
$bits = explode( '/', $path );
|
||||
$root = $bits[0];
|
||||
|
||||
if ( in_array( $root, array( 'submit' ) ) )
|
||||
|
||||
/* _ is here due to IP.Board 3.x using that to denote the articles database (eg. articles.html/_/category/record-r1/), which we need to redirect from for records and articles. */
|
||||
if ( in_array( $root, array( 'submit', '_' ) ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -829,11 +830,6 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
*/
|
||||
protected $_catTitle = NULL;
|
||||
|
||||
/**
|
||||
* @brief Cached title for strip tags version
|
||||
*/
|
||||
protected $_stripTagsCatTitle = NULL;
|
||||
|
||||
/**
|
||||
* @brief Cached title for strip tags version
|
||||
*/
|
||||
@@ -883,7 +879,14 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
}
|
||||
}
|
||||
|
||||
$guestGroup = \IPS\Member\Group::load( \IPS\Settings::i()->guest_group );
|
||||
try
|
||||
{
|
||||
$guestGroup = \IPS\Member\Group::load( \IPS\Settings::i()->guest_group );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \UnderflowException( 'invalid_guestgroup_admin', 199 );
|
||||
}
|
||||
|
||||
if( !$this->can_view_others )
|
||||
{
|
||||
@@ -1168,37 +1171,6 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
return parent::get__titleLanguageKey();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Node titles can contain HTML. Apparently.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get__stripTagsTitle()
|
||||
{
|
||||
/* If the DB is in a page, and we're not using categories, then return the page title, not the category title for continuity */
|
||||
if ( ! \IPS\cms\Databases::load( $this->database_id )->use_categories )
|
||||
{
|
||||
if ( ! $this->_stripTagsCatTitle )
|
||||
{
|
||||
try
|
||||
{
|
||||
$page = \IPS\cms\Pages\Page::loadByDatabaseId( $this->database_id );
|
||||
$this->_stripTagsCatTitle = $page->_stripTagsTitle;
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
$this->_stripTagsCatTitle = parent::get__stripTagsTitle();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_stripTagsCatTitle;
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent::get__stripTagsTitle();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [Node] Get Description
|
||||
@@ -1432,7 +1404,10 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
'cms_custom_database_' . $this->database_id,
|
||||
array( 'category_id=? AND record_approved=1 AND record_future_date=0', $this->id ),
|
||||
'record_last_comment DESC',
|
||||
array( 0, 1 )
|
||||
array( 0, 1 ),
|
||||
NULL,
|
||||
NULL,
|
||||
\IPS\Db::SELECT_FROM_WRITE_SERVER
|
||||
)->first()
|
||||
);
|
||||
}
|
||||
@@ -1455,7 +1430,7 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
{
|
||||
try
|
||||
{
|
||||
$comment = $commentClass::constructFromData( \IPS\Db::i()->select( '*', 'cms_database_comments', array( 'comment_record_id=? AND comment_approved=1', \IPS\Db::i()->select( 'primary_id_field', 'cms_custom_database_' . $this->database_id, array( 'category_id=? AND record_approved=1', $this->id ), 'record_last_comment DESC', 1 )->first() ), 'comment_date DESC', 1 )->first() );
|
||||
$comment = $commentClass::constructFromData( \IPS\Db::i()->select( '*', 'cms_database_comments', array( 'comment_record_id=? AND comment_approved=1', \IPS\Db::i()->select( 'primary_id_field', 'cms_custom_database_' . $this->database_id, array( 'category_id=? AND record_approved=1', $this->id ), 'record_last_comment DESC', 1 )->first() ), 'comment_date DESC', 1, NULL, NULL, \IPS\Db::SELECT_FROM_WRITE_SERVER )->first() );
|
||||
}
|
||||
catch( \UnderflowException $e ) { }
|
||||
}
|
||||
@@ -1499,9 +1474,9 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
$this->last_record_id = static::$latestRecordAdded->_id;
|
||||
}
|
||||
|
||||
$this->records = \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $this->database_id, array( 'record_approved=1 AND record_future_date=0 AND category_id=?', $this->id ) )->first();
|
||||
$this->records_queued = \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $this->database_id, array( 'record_approved=0 AND category_id=?', $this->id ) )->first();
|
||||
$this->records_future = \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $this->database_id, array( 'record_future_date=1 AND category_id=?', $this->id ) )->first();
|
||||
$this->records = \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $this->database_id, array( 'record_approved=1 AND record_future_date=0 AND category_id=?', $this->id ), NULL, NULL, NULL, NULL, \IPS\Db::SELECT_FROM_WRITE_SERVER )->first();
|
||||
$this->records_queued = \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $this->database_id, array( 'record_approved=0 AND category_id=?', $this->id ), NULL, NULL, NULL, NULL, \IPS\Db::SELECT_FROM_WRITE_SERVER )->first();
|
||||
$this->records_future = \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $this->database_id, array( 'record_future_date=1 AND category_id=?', $this->id ), NULL, NULL, NULL, NULL, \IPS\Db::SELECT_FROM_WRITE_SERVER )->first();
|
||||
|
||||
static::$latestRecordAdded = NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user