Version 4.7.8

This commit is contained in:
Neo committed 2025-12-19 16:10:42 -08:00
1 parent 7b7404e741
commit fd22d99e69
688 files changed
+19814 -10890

No files matched your search

+77 -2
View File
@@ -382,6 +382,14 @@ class _Controller extends \IPS\Helpers\CoverPhoto\Controller
return;
}
/* If we're filtering the topic (live topic questions) then the max commentID in the source will not be the max commentID possible
as not all comments will be shown */
if ( isset( \IPS\Request::i()->ltqid ) )
{
\IPS\Output::i()->json( array( 'error' => 'auto_polling_disabled' ) );
return;
}
/* If guest page caching is on, and we're a guest, disable polling */
if ( !\IPS\Member::loggedIn()->member_id and \IPS\CACHE_PAGE_TIMEOUT )
{
@@ -1271,10 +1279,40 @@ class _Controller extends \IPS\Helpers\CoverPhoto\Controller
\IPS\Output::i()->error( 'node_error', '2S136/1Q', 404, '' );
}
$idColumn = $class::$databaseColumnId;
$where = array( array( 'class=? AND comment_id=?', $class, $item->$idColumn ) );
if ( !\IPS\Member::loggedIn()->modPermission( 'can_view_editlog' ) )
{
$where[] = array( '`member`=? AND public=1', $item->author()->member_id );
}
$table = new \IPS\Helpers\Table\Db( 'core_edit_history', $item->url()->setQueryString( array( 'do' => 'editlog' ) ), $where );
$table->sortBy = 'time';
$table->sortDirection = 'desc';
$table->limit = 10;
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' ), 'commentEditHistoryTable' );
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' ), 'commentEditHistoryRows' );
$table->parsers = array(
'new' => function( $val )
{
return $val;
},
'old' => function( $val )
{
return $val;
}
);
$table->extra = $item;
$pageParam = $table->getPaginationKey();
if( \IPS\Request::i()->isAjax() AND isset( \IPS\Request::i()->$pageParam ) )
{
\IPS\Output::i()->sendOutput( (string) $table );
}
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack( 'edit_history_title' ) );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'edit_history_title' );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' )->commentEditHistory( $item->editHistory( \IPS\Member::loggedIn()->modPermission( 'can_view_editlog' ) ), $item );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' )->commentEditHistory( (string) $table, $item );
}
/**
@@ -2963,6 +3001,37 @@ class _Controller extends \IPS\Helpers\CoverPhoto\Controller
{
throw new \DomainException;
}
$idColumn = $commentClass::$databaseColumnId;
$where = array( array( 'class=? AND comment_id=?', $commentClass, $comment->$idColumn ) );
if ( !\IPS\Member::loggedIn()->modPermission( 'can_view_editlog' ) )
{
$where[] = array( '`member`=? AND public=1', $comment->author()->member_id );
}
$table = new \IPS\Helpers\Table\Db( 'core_edit_history', $item->url()->setQueryString( array( 'do' => 'editlogComment', 'comment' => $comment->$idColumn ) ), $where );
$table->sortBy = 'time';
$table->sortDirection = 'desc';
$table->limit = 10;
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' ), 'commentEditHistoryTable' );
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' ), 'commentEditHistoryRows' );
$table->parsers = array(
'new' => function( $val )
{
return $val;
},
'old' => function( $val )
{
return $val;
}
);
$table->extra = $comment;
$pageParam = $table->getPaginationKey();
if( \IPS\Request::i()->isAjax() AND isset( \IPS\Request::i()->$pageParam ) )
{
\IPS\Output::i()->sendOutput( (string) $table );
}
/* Display */
$container = NULL;
@@ -2979,7 +3048,7 @@ class _Controller extends \IPS\Helpers\CoverPhoto\Controller
\IPS\Output::i()->breadcrumb[] = array( $comment->url(), $item->mapped( 'title' ) );
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack( 'edit_history_title' ) );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'edit_history_title' );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' )->commentEditHistory( $comment->editHistory( \IPS\Member::loggedIn()->modPermission( 'can_view_editlog' ) ), $comment );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' )->commentEditHistory( (string) $table, $comment );
}
/**
@@ -3529,6 +3598,12 @@ class _Controller extends \IPS\Helpers\CoverPhoto\Controller
$oldItem->rebuildPopularTime();
}
/* Option to do some post split stuff */
if ( method_exists( $item, 'splitComplete' ) )
{
$item->splitComplete( $oldItem, $item, $comments );
}
/* Now reindex all of the comments - we do this last to prevent the "is last comment" flag continously bouncing around while the comments are still being moved */
foreach( $comments as $comment )
{