Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -49,14 +49,15 @@ class _Albums
|
||||
/**
|
||||
* Permission check for attachments
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param array $attachment The attachment data
|
||||
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -49,14 +49,15 @@ class _Categories
|
||||
/**
|
||||
* Permission check for attachments
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param array $attachment The attachment data
|
||||
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -49,14 +49,15 @@ class _Images
|
||||
/**
|
||||
* Permission check for attachments
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param array $attachment The attachment data
|
||||
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ class _Images
|
||||
foreach ( \IPS\Db::i()->select( '*', 'gallery_images', $where, 'image_date DESC', array( ( $page - 1 ) * $limit, $limit ) ) as $row )
|
||||
{
|
||||
$image = \IPS\gallery\Image::load( $row['image_id'] );
|
||||
$obj = \IPS\File::get( 'gallery_Images', $row['image_original_file_name'] );
|
||||
$obj = \IPS\File::get( 'gallery_Images', $image->masked_file_name );
|
||||
$obj->contextInfo = $image->caption;
|
||||
$return[ (string) $image->url() ] = $obj;
|
||||
}
|
||||
|
||||
@@ -35,12 +35,11 @@ class _Gallery
|
||||
if( $group->g_id != \IPS\Settings::i()->guest_group )
|
||||
{
|
||||
$form->addHeader( 'gallery_album_permissions' );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'g_create_albums', $group->g_create_albums, FALSE, array( 'togglesOn' => array( 'g_create_albums_private', 'g_create_albums_fo', 'g_delete_own_albums', 'g_album_limit', 'g_img_album_limit' ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'g_create_albums', $group->g_create_albums, FALSE, array( 'togglesOn' => array( 'g_create_albums_private', 'g_create_albums_fo', 'g_album_limit', 'g_img_album_limit' ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'g_create_albums_private', $group->g_create_albums_private, FALSE, array(), NULL, NULL, NULL, 'g_create_albums_private' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'g_create_albums_fo', $group->g_create_albums_fo, FALSE, array(), NULL, NULL, NULL, 'g_create_albums_fo' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'g_album_limit', $group->g_album_limit, FALSE, array( 'unlimited' => 0 ), NULL, NULL, NULL, 'g_album_limit' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'g_img_album_limit', $group->g_img_album_limit, FALSE, array( 'unlimited' => 0 ), NULL, NULL, NULL, 'g_img_album_limit' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'g_delete_own_albums', $group->g_delete_own_albums, FALSE, array(), NULL, NULL, NULL, 'g_delete_own_albums' ) );
|
||||
}
|
||||
|
||||
$form->addHeader( 'gallery_restrictions' );
|
||||
@@ -69,7 +68,6 @@ class _Gallery
|
||||
$group->g_create_albums_fo = $values['g_create_albums_fo'];
|
||||
$group->g_album_limit = $values['g_album_limit'];
|
||||
$group->g_img_album_limit = $values['g_img_album_limit'];
|
||||
$group->g_delete_own_albums = $values['g_delete_own_albums'];
|
||||
}
|
||||
|
||||
$group->g_movies = $values['g_movies'];
|
||||
|
||||
@@ -37,7 +37,7 @@ class _Album
|
||||
'exclude' => array(),
|
||||
'lessIsMore' => array(),
|
||||
'neg1IsBest' => array(),
|
||||
'zeroIsBest' => array( 'g_album_limit', 'g_img_album_limit', 'g_max_upload', 'g_max_transfer', 'g_max_views' ),
|
||||
'zeroIsBest' => array( 'g_album_limit', 'g_img_album_limit', 'g_max_upload', 'g_max_transfer', 'g_max_views', 'g_movie_size' ),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ class _Gallery extends \IPS\core\MemberACPProfile\Block
|
||||
$bandwidthChart = new \IPS\Helpers\Chart\Database( \IPS\Http\Url::internal( "app=core&module=members&controller=members&do=editBlock&block=IPS\\gallery\\extensions\\core\\MemberACPProfileContentTab\\Gallery&id={$this->member->member_id}&chart=downloads&_graph=1" ), 'gallery_bandwidth', 'bdate', '', array( 'vAxis' => array( 'title' => \IPS\Member::loggedIn()->language()->addToStack( 'filesize_raw_k' ) ) ), 'LineChart', 'daily' );
|
||||
$bandwidthChart->groupBy = 'bdate';
|
||||
$bandwidthChart->where[] = array( 'member_id=?', $this->member->member_id );
|
||||
$bandwidthChart->addSeries( \IPS\Member::loggedIn()->language()->addToStack('bandwidth_use'), 'number', 'ROUND((SUM(bsize)/1024),2)', FALSE );
|
||||
$bandwidthChart->addSeries( \IPS\Member::loggedIn()->language()->addToStack('bandwidth_use_gallery'), 'number', 'ROUND((SUM(bsize)/1024),2)', FALSE );
|
||||
return ( \IPS\Request::i()->isAjax() and isset( \IPS\Request::i()->_graph ) ) ? (string) $bandwidthChart : \IPS\Theme::i()->getTemplate( 'stats', 'gallery' )->graphs( (string) $bandwidthChart );
|
||||
}
|
||||
}
|
||||
@@ -70,13 +70,13 @@ class _Album
|
||||
* Get where clause to add to the member retrieval database query
|
||||
*
|
||||
* @param mixed $data The array returned from the save() method
|
||||
* @return string|array|NULL Where clause
|
||||
* @return array|NULL Where clause - must be a single array( "clause", ...binds )
|
||||
*/
|
||||
public function getQueryWhereClause( $data )
|
||||
{
|
||||
if( isset( $data['has_album'] ) )
|
||||
{
|
||||
return ( $data['has_album'] == 'yes' ) ? array( array( "gallery_albums.album_id IS NOT NULL" ) ) : array( array( "gallery_albums.album_id IS NULL" ) );
|
||||
return ( $data['has_album'] == 'yes' ) ? array( "gallery_albums.album_id IS NOT NULL" ) : array( "gallery_albums.album_id IS NULL" );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -1,3 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Member Form Extension
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @subpackage Gallery
|
||||
* @since 23 Mar 2017
|
||||
*/
|
||||
|
||||
// Removed
|
||||
namespace IPS\gallery\extensions\core\MemberForm;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
class _Images
|
||||
{
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
final public function deprecated()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class _CleanUpGalleryImages
|
||||
{
|
||||
try
|
||||
{
|
||||
$data['count'] = \IPS\Db::i()->select( 'COUNT(*)', 'gallery_images' )->first();
|
||||
$data['count'] = \IPS\Db::i()->select( 'COUNT(*)', 'gallery_images', array( 'image_media=?', 0 ) )->first();
|
||||
}
|
||||
catch( \Exception $ex )
|
||||
{
|
||||
@@ -66,7 +66,7 @@ class _CleanUpGalleryImages
|
||||
}
|
||||
|
||||
$last = NULL;
|
||||
foreach( \IPS\Db::i()->select( '*', 'gallery_images', NULL, 'image_id ASC', array( $offset, 100 ) ) as $image )
|
||||
foreach( \IPS\Db::i()->select( '*', 'gallery_images', array( 'image_media=?', 0 ), 'image_id ASC', array( $offset, 100 ) ) as $image )
|
||||
{
|
||||
$data['did']++;
|
||||
|
||||
@@ -85,8 +85,19 @@ class _CleanUpGalleryImages
|
||||
|
||||
$update = array( 'image_data' => json_encode( $sizes ) );
|
||||
|
||||
/* If we have a medium but no large image, or a thumb but no small image, adapt as appropriate */
|
||||
/* If we have a medium but no large image, or a thumb but no small image, adapt as appropriate. Also if one image is mapped for
|
||||
multiple columns be sure we don't remove it if we still need it. */
|
||||
$keepMedium = FALSE;
|
||||
if( $image['image_medium_file_name'] == $image['image_masked_file_name'] )
|
||||
{
|
||||
$keepMedium = TRUE;
|
||||
}
|
||||
$keepThumb = FALSE;
|
||||
if( $image['image_thumb_file_name'] == $image['image_masked_file_name'] )
|
||||
{
|
||||
$keepThumb = TRUE;
|
||||
}
|
||||
|
||||
if( !$image['image_masked_file_name'] AND $image['image_medium_file_name'] )
|
||||
{
|
||||
$image['image_masked_file_name'] = $image['image_medium_file_name'];
|
||||
@@ -94,7 +105,6 @@ class _CleanUpGalleryImages
|
||||
$keepMedium = TRUE;
|
||||
}
|
||||
|
||||
$keepThumb = FALSE;
|
||||
if( !$image['image_small_file_name'] AND $image['image_thumb_file_name'] )
|
||||
{
|
||||
$image['image_small_file_name'] = $image['image_thumb_file_name'];
|
||||
|
||||
@@ -76,7 +76,6 @@ class _Follow
|
||||
|
||||
$directContainer = ( !is_null( $data['album_id'] ) ) ? \IPS\gallery\Album::load( $data['album_id'] ) : \IPS\gallery\Category::load( $data['category_id'] );
|
||||
|
||||
$title = $directContainer->_title;
|
||||
return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack('backgroundQueue_follow', FALSE, array( 'htmlsprintf' => array( "<a href='{$directContainer->url()}' target='_blank'>{$title}</a>" ) ) ), 'complete' => $complete );
|
||||
return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack('backgroundQueue_follow', FALSE, array( 'htmlsprintf' => array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->basicUrl( $directContainer->url(), TRUE, $directContainer->_title, FALSE ) ) ) ), 'complete' => $complete );
|
||||
}
|
||||
}
|
||||
@@ -89,8 +89,6 @@ class _RebuildGalleryImages
|
||||
|
||||
if( $last === NULL )
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplogs__gallery_rebuilt' );
|
||||
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class _Images
|
||||
*/
|
||||
public function getFilenames()
|
||||
{
|
||||
$count = \IPS\gallery\Image::getItemsWithPermission( array( 'image_media=?', 0 ), NULL, 10, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, NULL, FALSE, FALSE, FALSE, TRUE );
|
||||
$count = \IPS\gallery\Image::getItemsWithPermission( array( 'image_media=?', 0 ), NULL, 10, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, new \IPS\Member, FALSE, FALSE, FALSE, TRUE );
|
||||
$files = array();
|
||||
|
||||
$count = ceil( $count / \IPS\Sitemap::MAX_PER_FILE );
|
||||
@@ -77,7 +77,12 @@ class _Images
|
||||
$totalLimit = isset( $settings["sitemap_{$class::$title}_count"] ) AND $settings["sitemap_{$class::$title}_count"] ? $settings["sitemap_{$class::$title}_count"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_LIMIT;
|
||||
$offset = ( $block - 1 ) * \IPS\Sitemap::MAX_PER_FILE;
|
||||
$limit = \IPS\Sitemap::MAX_PER_FILE;
|
||||
|
||||
|
||||
if ( ! $totalLimit )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( $totalLimit > -1 and ( $offset + $limit ) > $totalLimit )
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
@@ -136,7 +141,7 @@ class _Images
|
||||
|
||||
/* Image sitemap data */
|
||||
$data['image:image'] = array(
|
||||
'image:loc' => (string) \IPS\File::get( 'gallery_Images', $item->masked_file_name )->url,
|
||||
'image:loc' => (string) \IPS\File::get( 'gallery_Images', $item->masked_file_name )->url->setScheme( ( mb_substr( \IPS\Settings::i()->base_url, 0, 5 ) === 'https' ) ? 'https' : 'http' ),
|
||||
'image:caption' => $item->mapped('title'),
|
||||
'image:title' => $item->mapped('title')
|
||||
);
|
||||
|
||||
@@ -45,7 +45,7 @@ class _Videos
|
||||
*/
|
||||
public function getFilenames()
|
||||
{
|
||||
$count = \IPS\gallery\Image::getItemsWithPermission( array( 'image_media=?', 1 ), NULL, 10, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, NULL, FALSE, FALSE, FALSE, TRUE );
|
||||
$count = \IPS\gallery\Image::getItemsWithPermission( array( 'image_media=?', 1 ), NULL, 10, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, new \IPS\Member, FALSE, FALSE, FALSE, TRUE );
|
||||
$files = array();
|
||||
|
||||
$count = ceil( $count / \IPS\Sitemap::MAX_PER_FILE );
|
||||
@@ -77,7 +77,12 @@ class _Videos
|
||||
$totalLimit = isset( $settings["sitemap_{$class::$title}_count"] ) AND $settings["sitemap_{$class::$title}_count"] ? $settings["sitemap_{$class::$title}_count"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_LIMIT;
|
||||
$offset = ( $block - 1 ) * \IPS\Sitemap::MAX_PER_FILE;
|
||||
$limit = \IPS\Sitemap::MAX_PER_FILE;
|
||||
|
||||
|
||||
if ( ! $totalLimit )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( $totalLimit > -1 and ( $offset + $limit ) > $totalLimit )
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
@@ -136,7 +141,7 @@ class _Videos
|
||||
|
||||
/* Video sitemap data */
|
||||
$data['video:video'] = array(
|
||||
'video:content_loc' => (string) \IPS\File::get( 'gallery_Images', $item->original_file_name )->url,
|
||||
'video:content_loc' => (string) \IPS\File::get( 'gallery_Images', $item->original_file_name )->url->setScheme( ( mb_substr( \IPS\Settings::i()->base_url, 0, 5 ) === 'https' ) ? 'https' : 'http' ),
|
||||
'video:description' => $item->mapped('content'),
|
||||
'video:title' => $item->mapped('title'),
|
||||
'video:rating' => $item->mapped('rating_average'),
|
||||
@@ -149,7 +154,7 @@ class _Videos
|
||||
|
||||
if( $item->masked_file_name )
|
||||
{
|
||||
$data['video:video']['video:thumbnail_loc'] = (string) \IPS\File::get( 'gallery_Images', $item->masked_file_name )->url;
|
||||
$data['video:video']['video:thumbnail_loc'] = (string) \IPS\File::get( 'gallery_Images', $item->masked_file_name )->url->setScheme( ( mb_substr( \IPS\Settings::i()->base_url, 0, 5 ) === 'https' ) ? 'https' : 'http' );
|
||||
}
|
||||
|
||||
$priority = ( $item->sitemapPriority() ?: ( intval( isset( $settings["sitemap_{$class::$title}_priority"] ) ? $settings["sitemap_{$class::$title}_priority"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_PRIORITY ) ) );
|
||||
|
||||
Reference in new issue
Block a user