Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -128,6 +128,8 @@ class _browse extends \IPS\Content\Controller
|
||||
$album = \IPS\gallery\Album::loadAndCheckPerms( \IPS\Request::i()->album, 'view' );
|
||||
|
||||
$album->category()->clubCheckRules();
|
||||
|
||||
$album->asItem()->updateViews();
|
||||
|
||||
/* Add RSS feed */
|
||||
if ( \IPS\Settings::i()->gallery_rss_enabled )
|
||||
@@ -195,18 +197,43 @@ class _browse extends \IPS\Content\Controller
|
||||
protected function _index()
|
||||
{
|
||||
/* Get stuff */
|
||||
$featured = iterator_to_array( \IPS\gallery\Image::featured( 20, NULL ) );
|
||||
/* If there aren't any featured images grab some recent instead */
|
||||
if( !\count( $featured ) )
|
||||
$featured = array();
|
||||
if( \IPS\Settings::i()->gallery_overview_show_carousel )
|
||||
{
|
||||
$featured = \IPS\gallery\Image::getItemsWithPermission( \IPS\gallery\Image::clubImageExclusion(), 'image_updated DESC', 5, 'view' );
|
||||
switch( \IPS\Settings::i()->gallery_overview_carousel_type )
|
||||
{
|
||||
case 'featured':
|
||||
$featured = iterator_to_array( \IPS\gallery\Image::featured( \IPS\Settings::i()->gallery_overview_carousel_count, NULL ) );
|
||||
break;
|
||||
|
||||
case 'new':
|
||||
$featured = \IPS\gallery\Image::getItemsWithPermission( \IPS\gallery\Image::clubImageExclusion(), 'image_updated DESC', \IPS\Settings::i()->gallery_overview_carousel_count, 'view' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$new = iterator_to_array( \IPS\gallery\Image::getItemsWithPermission( \IPS\gallery\Image::clubImageExclusion(), NULL, 16, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, NULL, !\IPS\Settings::i()->club_nodes_in_apps ) );
|
||||
$recentlyUpdatedAlbums = \IPS\gallery\Album\Item::getItemsWithPermission( \IPS\gallery\Album\Item::clubAlbumExclusion(), 'album_last_img_date DESC', 4, 'view' );
|
||||
$commentWhere = \IPS\gallery\Image::clubImageExclusion();
|
||||
$commentWhere[] = array( 'image_comments > 0' );
|
||||
$recentComments = \IPS\gallery\Image::getItemsWithPermission( $commentWhere, 'image_last_comment DESC', 10, 'read', \IPS\Content\Hideable::FILTER_PUBLIC_ONLY, 0, NULL, !\IPS\Settings::i()->club_nodes_in_apps );
|
||||
/* New images */
|
||||
$new = array();
|
||||
if( \IPS\Settings::i()->gallery_show_new_images )
|
||||
{
|
||||
$new = iterator_to_array( \IPS\gallery\Image::getItemsWithPermission( \IPS\gallery\Image::clubImageExclusion(), NULL, \IPS\Settings::i()->gallery_new_images_count, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, NULL, !\IPS\Settings::i()->club_nodes_in_apps ) );
|
||||
}
|
||||
|
||||
/* Recently updated albums */
|
||||
$recentlyUpdatedAlbums = array();
|
||||
if( \IPS\Settings::i()->gallery_show_recent_updated_albums )
|
||||
{
|
||||
$recentlyUpdatedAlbums = \IPS\gallery\Album\Item::getItemsWithPermission( \IPS\gallery\Album\Item::clubAlbumExclusion(), 'album_last_img_date DESC', \IPS\Settings::i()->gallery_recent_updated_albums_count, 'view' );
|
||||
}
|
||||
|
||||
/* Recently commented */
|
||||
$recentComments = array();
|
||||
if( \IPS\Settings::i()->gallery_show_recent_comments )
|
||||
{
|
||||
$commentWhere = \IPS\gallery\Image::clubImageExclusion();
|
||||
$commentWhere[] = array( 'image_comments > 0' );
|
||||
$recentComments = \IPS\gallery\Image::getItemsWithPermission( $commentWhere, 'image_last_comment DESC', 10, 'read', \IPS\Content\Hideable::FILTER_PUBLIC_ONLY, 0, NULL, !\IPS\Settings::i()->club_nodes_in_apps );
|
||||
}
|
||||
|
||||
/* Online User Location */
|
||||
\IPS\Session::i()->setLocation( \IPS\Http\Url::internal( 'app=gallery', 'front', 'gallery' ), array(), 'loc_gallery_browsing' );
|
||||
@@ -322,6 +349,11 @@ class _browse extends \IPS\Content\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ( !\IPS\Request::i()->isAjax() )
|
||||
{
|
||||
$category->updateViews();
|
||||
}
|
||||
|
||||
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item_categories' ) ] = array( 'type' => 'gallery_image', 'nodes' => $category->_id );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->category( $category, $albums, (string) $table );
|
||||
}
|
||||
@@ -452,6 +484,11 @@ class _browse extends \IPS\Content\Controller
|
||||
'item_type' => isset( $albumItem::$contentType ) ? $albumItem::$contentType : $albumItem::$title,
|
||||
'category_name' => $albumItem->container()->_title
|
||||
);
|
||||
|
||||
if ( !\IPS\Request::i()->isAjax() )
|
||||
{
|
||||
$albumItem->updateViews();
|
||||
}
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( NULL, $album->_title );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->album( $album, (string) $table, $commentsAndReviews );
|
||||
|
||||
@@ -810,7 +810,7 @@ class _view extends \IPS\Content\Controller
|
||||
{
|
||||
foreach ( \IPS\Request::i()->url()->queryString as $k => $v )
|
||||
{
|
||||
if ( $k != 'do' )
|
||||
if ( !in_array( $k, array( 'id', 'do' ) ) )
|
||||
{
|
||||
$url = $url->setQueryString( $k, $v );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user