Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

@@ -79,6 +79,10 @@ class _forums extends \IPS\Dispatcher\Controller
\IPS\Output::i()->redirect( $forum->url(), '', 302 );
}
}
/* Theme */
$forum->setTheme();
$this->themeGroup = \IPS\Theme::i()->getTemplate( 'forums', 'forums', 'front' );
/* Password protected */
if ( $form = $forum->passwordForm() )
@@ -87,16 +91,12 @@ class _forums extends \IPS\Dispatcher\Controller
\IPS\Output::i()->output = $form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'forums', 'forums', 'front' ), 'forumPasswordPopup' ), $forum );
return;
}
/* We can read? */
if ( $forum->sub_can_post and !$forum->permission_showtopic and !$forum->can('read') )
{
\IPS\Output::i()->error( $forum->errorMessage(), '1F176/3', 403, '' );
}
/* Theme */
$forum->setTheme();
$this->themeGroup = \IPS\Theme::i()->getTemplate( 'forums', 'forums', 'front' );
/* Users can see topics posted by other users? */
$where = array();
@@ -242,11 +242,18 @@ class _forums extends \IPS\Dispatcher\Controller
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item_forums' ) ] = array( 'type' => 'forums_topic', 'nodes' => $forum->_id );
}
/* If there's only one forum and we're not in a club, we actually don't want the nav */
if ( \IPS\forums\Forum::theOnlyForum() and !$forum->club() )
/* If there's only one forum and we're not in a club, and we're not in a sub-forum, we actually don't want the nav */
if ( $theOnlyForum = \IPS\forums\Forum::theOnlyForum() AND $theOnlyForum->_id == $forum->_id and !$forum->club() )
{
\IPS\Output::i()->breadcrumb = isset( \IPS\Output::i()->breadcrumb['module'] ) ? array('module' => \IPS\Output::i()->breadcrumb['module']) : array();
}
/* We need to shift the breadcrumb if we are in a sub-forum and we have $theOnlyForum */
if ( $theOnlyForum AND $theOnlyForum->_id != $forum->_id )
{
array_shift( \IPS\Output::i()->breadcrumb );
array_shift( \IPS\Output::i()->breadcrumb );
}
$table->hover = TRUE;
if ( isset( $table->sortOptions['num_comments'] ) )
@@ -563,6 +570,9 @@ class _forums extends \IPS\Dispatcher\Controller
$table = $this->postProcessTable( $table );
/* Set default search to this forum */
\IPS\Output::i()->defaultSearchOption = array( 'forums_topic', 'forums_topic_el' );
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_forum.js', 'forums' ) );
\IPS\Output::i()->output = $this->themeGroup->forumDisplay( $forum, $forumOutput );
}
@@ -86,14 +86,22 @@ class _topic extends \IPS\Content\Controller
$topic->container()->clubCheckRules();
/* If there's only one forum and we're not in a club, we actually don't want the nav */
if ( !$topic->container()->club() AND ( \IPS\forums\Forum::theOnlyForum() or \IPS\forums\Forum::isSimpleView() ) )
/* If there's only one forum and we're not in a club, and we're not in a sub-forum, we actually don't want the nav */
$theOnlyForum = NULL;
if ( !$topic->container()->club() AND ( ( $theOnlyForum = \IPS\forums\Forum::theOnlyForum() AND $theOnlyForum->_id == $topic->container()->_id ) or \IPS\forums\Forum::isSimpleView() ) )
{
$topicBreadcrumb = array_pop( \IPS\Output::i()->breadcrumb );
\IPS\Output::i()->breadcrumb = isset( \IPS\Output::i()->breadcrumb['module'] ) ? array( 'module' => \IPS\Output::i()->breadcrumb['module'] ) : array();
\IPS\Output::i()->breadcrumb[] = $topicBreadcrumb;
}
/* We need to shift the breadcrumb if we are in a sub-forum and we have $theOnlyForum */
if ( $theOnlyForum AND $theOnlyForum->_id != $topic->container()->_id )
{
array_shift( \IPS\Output::i()->breadcrumb );
array_shift( \IPS\Output::i()->breadcrumb );
}
/* Legacy findpost redirect */
if ( \IPS\Request::i()->findpost )
{
@@ -560,6 +568,9 @@ class _topic extends \IPS\Content\Controller
)
), \IPS\Output::i()->jsonLd['topic'] );
/* Set default search to this topic */
\IPS\Output::i()->defaultSearchOption = array( 'forums_topic', 'forums_topic_el' );
/* Show topic */
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'topics.css', 'forums' ) );
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'topics' )->topic( $topic, $comments, $question, $votes, $nextUnread, $pagination, $topicVotes );
@@ -1259,9 +1270,9 @@ class _topic extends \IPS\Content\Controller
* @param \IPS\Content\Item $item The item
* @return \IPS\Helpers\Form
*/
protected function _splitForm( \IPS\Content\Item $item )
protected function _splitForm( \IPS\Content\Item $item, $comment = NULL )
{
$form = parent::_splitForm( $item );
$form = parent::_splitForm( $item, $comment );
if ( isset( $form->elements['']['topic_create_state'] ) )
{