Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -132,8 +132,8 @@ class _browse extends \IPS\Content\Controller
|
||||
protected function _index()
|
||||
{
|
||||
/* Get stuff */
|
||||
$featured = iterator_to_array( \IPS\gallery\Image::featured( 20, '_rand' ) );
|
||||
$new = iterator_to_array( \IPS\gallery\Image::getItemsWithPermission( array(), NULL, 30 ) );
|
||||
$featured = iterator_to_array( \IPS\gallery\Image::featured( 20, NULL ) );
|
||||
$new = iterator_to_array( \IPS\gallery\Image::getItemsWithPermission( ( \IPS\Settings::i()->club_nodes_in_apps ? array() : array( array( 'category_club_id IS NULL' ) ) ), NULL, 30, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 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' );
|
||||
@@ -153,7 +153,7 @@ class _browse extends \IPS\Content\Controller
|
||||
/* Online User Location */
|
||||
\IPS\Session::i()->setLocation( \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse&do=categories', 'front', 'gallery_categories' ), array(), 'loc_gallery_browsing_categories' );
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('__app_gallery');
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('gallery_title');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->categories();
|
||||
}
|
||||
|
||||
@@ -209,6 +209,14 @@ class _browse extends \IPS\Content\Controller
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'browse' ), $this->getTableRowsTemplate() );
|
||||
$table->title = \IPS\Member::loggedIn()->language()->pluralize( \IPS\Member::loggedIn()->language()->get('num_images'), array( $category->count_imgs ) );
|
||||
|
||||
$table->sortBy = \IPS\Request::i()->sortby ? $table->sortBy : $category->sort_options_img;
|
||||
|
||||
/* Make sure captions are sorted in the right order */
|
||||
if ( $table->sortBy == "title" )
|
||||
{
|
||||
$table->sortDirection = "asc";
|
||||
}
|
||||
|
||||
if( !$category->allow_comments )
|
||||
{
|
||||
unset( $table->sortOptions['num_comments'] );
|
||||
@@ -267,7 +275,7 @@ class _browse extends \IPS\Content\Controller
|
||||
|
||||
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'browse' ), 'imageTable' );
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'browse' ), $this->getTableRowsTemplate() );
|
||||
$table->title = \IPS\Member::loggedIn()->language()->pluralize( \IPS\Member::loggedIn()->language()->get('num_images'), array( $album->count_imgs ) );
|
||||
$table->title = \IPS\Member::loggedIn()->language()->addToStack( 'num_images', FALSE, array( 'pluralize' => array( $album->count_imgs ) ) );
|
||||
|
||||
if( !$album->allow_comments )
|
||||
{
|
||||
@@ -284,6 +292,11 @@ class _browse extends \IPS\Content\Controller
|
||||
/* Load the item */
|
||||
$asItem = $album->asItem();
|
||||
|
||||
/* Mark the album as read - we don't bother tracking page number because albums are sorted in all different manners so the
|
||||
page parameter is unreliable for determining if the album is read. By default, typically, new images show at the beginning
|
||||
of the album anyways */
|
||||
$asItem->markRead();
|
||||
|
||||
/* Sort out comments and reviews */
|
||||
$tabs = $asItem->commentReviewTabs();
|
||||
$_tabs = array_keys( $tabs );
|
||||
@@ -300,7 +313,7 @@ class _browse extends \IPS\Content\Controller
|
||||
}
|
||||
|
||||
/* Fetching comments/reviews */
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
if( \IPS\Request::i()->isAjax() AND !isset( \IPS\Request::i()->listResort ) )
|
||||
{
|
||||
\IPS\Output::i()->output = $activeTabContents;
|
||||
return;
|
||||
@@ -341,10 +354,18 @@ class _browse extends \IPS\Content\Controller
|
||||
\IPS\Output::i()->breadcrumb[] = array( $album->category()->url(), $album->category()->_title );
|
||||
}
|
||||
|
||||
if( $album->coverPhoto('medium') )
|
||||
if( $album->coverPhoto('masked') )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['og:image'] = $album->coverPhoto('medium');
|
||||
\IPS\Output::i()->metaTags['og:image'] = $album->coverPhoto('masked');
|
||||
}
|
||||
|
||||
$albumItem = $album->asItem();
|
||||
\IPS\core\Facebook\Pixel::i()->PageView = array(
|
||||
'item_id' => $album->id,
|
||||
'item_name' => $albumItem->mapped('title'),
|
||||
'item_type' => isset( $albumItem::$contentType ) ? $albumItem::$contentType : $albumItem::$title,
|
||||
'category_name' => $albumItem->container()->_title
|
||||
);
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( NULL, $album->_title );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->album( $album, (string) $table, $commentsAndReviews );
|
||||
@@ -371,51 +392,6 @@ class _browse extends \IPS\Content\Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve some images, used for the slider on the image view page
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getImages()
|
||||
{
|
||||
try
|
||||
{
|
||||
$startingPoint = \IPS\gallery\Image::load( \IPS\Request::i()->image );
|
||||
}
|
||||
catch ( \OutOfRangeException $e)
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2G189/C', 404, '' );
|
||||
}
|
||||
|
||||
$count = intval( \IPS\Request::i()->count );
|
||||
|
||||
if( \IPS\Request::i()->direction == 'next' )
|
||||
{
|
||||
$results = $startingPoint->nextImages( $count );
|
||||
}
|
||||
else
|
||||
{
|
||||
$results = $startingPoint->previousImages( $count );
|
||||
}
|
||||
|
||||
$toSend = array();
|
||||
|
||||
foreach( $results as $result )
|
||||
{
|
||||
$toSend[] = \IPS\Theme::i()->getTemplate( 'view' )->imageThumbnail( $result );
|
||||
}
|
||||
|
||||
/* Respond or redirect */
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( $toSend );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( $startingPoint->url() );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Latest images RSS
|
||||
*
|
||||
@@ -484,7 +460,7 @@ class _browse extends \IPS\Content\Controller
|
||||
\IPS\Output::i()->error( 'node_error', '2G189/5', 404, '' );
|
||||
}
|
||||
|
||||
if( !$album->canEdit() )
|
||||
if( !$album->asItem()->canEdit() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2G189/4', 403, '' );
|
||||
}
|
||||
@@ -597,7 +573,7 @@ class _browse extends \IPS\Content\Controller
|
||||
$category->save();
|
||||
|
||||
/* Hide the album */
|
||||
$album->type = 4;
|
||||
$album->type = \IPS\gallery\Album::AUTH_TYPE_DELETED;
|
||||
$album->save();
|
||||
|
||||
/* Are we moving the images? */
|
||||
|
||||
Reference in new issue
Block a user