summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2025-08-28 16:19:05 +0100
committerlsces <lester@lsces.co.uk>2025-08-28 16:19:05 +0100
commit2140176e21e83d3779460277a31bcc7adaf9d3fe (patch)
treef7e1d27e3428e63c2b635a4474e57cf14158241a
parentd4cf8eb6b69ff23eedcba9359ce9a1ed4e2a7d9c (diff)
downloadfisheye-2140176e21e83d3779460277a31bcc7adaf9d3fe.tar.gz
fisheye-2140176e21e83d3779460277a31bcc7adaf9d3fe.tar.bz2
fisheye-2140176e21e83d3779460277a31bcc7adaf9d3fe.zip
General code updated to PHP8.4 and namespace ... work in progress on updating some third party code
-rwxr-xr-x[-rw-r--r--]browse.php11
-rwxr-xr-x[-rw-r--r--]edit.php60
-rwxr-xr-x[-rw-r--r--]edit_gallery_perms.php29
-rwxr-xr-x[-rw-r--r--]edit_image.php61
-rwxr-xr-x[-rw-r--r--]find_user.php10
-rwxr-xr-x[-rw-r--r--]fisheye_rss.php31
-rwxr-xr-x[-rw-r--r--]gallery_tree.php10
-rwxr-xr-x[-rw-r--r--]image_order.php69
-rwxr-xr-x[-rw-r--r--]index.php3
-rwxr-xr-x[-rw-r--r--]list_galleries.php24
-rwxr-xr-x[-rw-r--r--]main.php22
-rwxr-xr-x[-rw-r--r--]thumbnailer.php33
-rwxr-xr-x[-rw-r--r--]upload.php33
-rwxr-xr-x[-rw-r--r--]view.php20
-rwxr-xr-x[-rw-r--r--]view_image.php24
-rwxr-xr-x[-rw-r--r--]view_image_details.php12
16 files changed, 213 insertions, 239 deletions
diff --git a/browse.php b/browse.php
index 1feb94c..57c8306 100644..100755
--- a/browse.php
+++ b/browse.php
@@ -8,16 +8,13 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+namespace Bitweaver\Fisheye;
+require_once '../kernel/includes/setup_inc.php';
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
global $gBitSystem, $gBitSmarty;
$gFisheyeGallery = new FisheyeGallery();
$galleryList = $gFisheyeGallery->getList( $_REQUEST );
-$gBitSmarty->assignByRef( 'galleryList', $galleryList );
+$gBitSmarty->assign( 'galleryList', $galleryList );
-$gBitSystem->display( "bitpackage:fisheye/browse_galleries.tpl" , NULL, array( 'display_mode' => 'display' ));
-
-?>
+$gBitSystem->display( "bitpackage:fisheye/browse_galleries.tpl" , null, [ 'display_mode' => 'display' ] );
diff --git a/edit.php b/edit.php
index 8b555ca..05c1a20 100644..100755
--- a/edit.php
+++ b/edit.php
@@ -7,14 +7,14 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
-
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
+namespace Bitweaver\Fisheye;
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\KernelTools;
global $gBitSystem;
-include_once( FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php' );
+include_once LIBERTY_PKG_INCLUDE_PATH.'liberty_lib.php';
+include_once FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php';
// Ensure the user has the permission to create new image galleries
if( $gContent->isValid() ){
@@ -24,7 +24,7 @@ if( $gContent->isValid() ){
}
if( $gBitUser->hasPermission( 'p_fisheye_change_thumb_size' ) ) {
- $gBitSmarty->assign( 'thumbnailSizes', get_image_size_options( NULL ));
+ $gBitSmarty->assign( 'thumbnailSizes', \Bitweaver\Liberty\get_image_size_options( null ));
}
$gBitSmarty->assign( 'galleryPaginationTypes', $gContent::getAllLayouts() );
@@ -41,14 +41,14 @@ if( !empty( $_REQUEST['savegallery'] ) ) {
$_REQUEST['cols_per_page'] = '1';
}
if( $gContent->store( $_REQUEST ) ) {
- $gContent->storePreference( 'is_public', !empty( $_REQUEST['is_public'] ) ? $_REQUEST['is_public'] : NULL );
- $gContent->storePreference( 'allow_comments', !empty( $_REQUEST['allow_comments'] ) ? $_REQUEST['allow_comments'] : NULL );
- $gContent->storePreference( 'gallery_pagination', !empty( $_REQUEST['gallery_pagination'] ) ? $_REQUEST['gallery_pagination'] : NULL );
- $gContent->storePreference( 'link_original_images', !empty( $_REQUEST['link_original_images'] ) ? $_REQUEST['link_original_images'] : NULL );
+ $gContent->storePreference( 'is_public', !empty( $_REQUEST['is_public'] ) ? $_REQUEST['is_public'] : null );
+ $gContent->storePreference( 'allow_comments', !empty( $_REQUEST['allow_comments'] ) ? $_REQUEST['allow_comments'] : null );
+ $gContent->storePreference( 'gallery_pagination', !empty( $_REQUEST['gallery_pagination'] ) ? $_REQUEST['gallery_pagination'] : null );
+ $gContent->storePreference( 'link_original_images', !empty( $_REQUEST['link_original_images'] ) ? $_REQUEST['link_original_images'] : null );
// make sure var is fully stuffed with current data
$gContent->load();
// set the mappings, or if nothing checked, nuke them all
- $gContent->addToGalleries( !empty( $_REQUEST['gallery_additions'] ) ? $_REQUEST['gallery_additions'] : NULL );
+ $gContent->addToGalleries( !empty( $_REQUEST['gallery_additions'] ) ? $_REQUEST['gallery_additions'] : null );
if( !empty( $_REQUEST['generate_thumbnails'] ) ) {
$gContent->generateThumbnails();
@@ -57,29 +57,29 @@ if( !empty( $_REQUEST['savegallery'] ) ) {
die();
}
} elseif( !empty( $_REQUEST['delete'] ) ) {
- $gContent->hasUserPermission( 'p_fisheye_admin', TRUE, tra( "You do not have permission to delete this image gallery" ) );
+ $gContent->hasUserPermission( 'p_fisheye_admin', true); // , KernelTools::tra( "You do not have permission to delete this image gallery" ) );
if( !empty( $_REQUEST['cancel'] ) ) {
// user cancelled - just continue on, doing nothing
} elseif( empty( $_REQUEST['confirm'] ) ) {
- $formHash['delete'] = TRUE;
+ $formHash['delete'] = true;
$formHash['gallery_id'] = $gContent->mGalleryId;
$formHash['input'] = array(
- '<label><input name="recurse" value="" type="radio" checked="checked" /> '.tra( 'Delete only images in this gallery. Sub-galleries will not be removed.' ).'</label>',
- '<label><input name="recurse" value="all" type="radio" /> '.tra( 'Permanently delete all contents, even if they appear in other galleries.' ).'</label>',
+ '<label><input name="recurse" value="" type="radio" checked="checked" /> '.KernelTools::tra( 'Delete only images in this gallery. Sub-galleries will not be removed.' ).'</label>',
+ '<label><input name="recurse" value="all" type="radio" /> '.KernelTools::tra( 'Permanently delete all contents, even if they appear in other galleries.' ).'</label>',
);
$gBitSystem->confirmDialog( $formHash,
array(
- 'warning' => tra('Are you sure you want to delete this gallery?') . ' ' . $gContent->getTitle(),
- 'error' => tra('This cannot be undone!'),
+ 'warning' => KernelTools::tra('Are you sure you want to delete this gallery?') . ' ' . $gContent->getTitle(),
+ 'error' => KernelTools::tra('This cannot be undone!'),
)
);
} else {
$userId = $gContent->getField( 'user_id' );
- $recurseDelete = (!empty( $_REQUEST['recurse'] ) && ($_REQUEST['recurse'] == 'all') );
-
- if( $gContent->expunge( $recurseDelete ) ) {
+ $gContent->pRecursiveDelete = !empty( $_REQUEST['recurse'] ) && ($_REQUEST['recurse'] == 'all');
+
+ if( $gContent->expunge() ) {
header( "Location: ".FISHEYE_PKG_URL.'?user_id='.$userId );
}
}
@@ -90,19 +90,19 @@ if( !empty( $_REQUEST['savegallery'] ) ) {
}
// Initalize the errors list which contains any errors which occured during storage
-$errors = (!empty($gContent->mErrors) ? $gContent->mErrors : array());
-$gBitSmarty->assignByRef('errors', $errors);
+$errors = !empty($gContent->mErrors) ? $gContent->mErrors : [];
+$gBitSmarty->assign('errors', $errors);
$gBitSystem->setOnloadScript( 'updateGalleryPagination();' );
$gallery = $gContent->getParentGalleries();
-$gBitSmarty->assignByRef( 'parentGalleries', $gallery );
+$gBitSmarty->assign( 'parentGalleries', $gallery );
$getHash = array(
'user_id' => $gBitUser->mUserId,
// 'max_records' => -1,
-// 'no_thumbnails' => TRUE,
+// 'no_thumbnails' => true,
// 'sort_mode' => 'title_asc',
-// 'show_empty' => TRUE,
+// 'show_empty' => true,
);
if( $gContent->mContentId ) {
$getHash['contain_item'] = $gContent->mContentId;
@@ -111,13 +111,11 @@ if( $gContent->mContentId ) {
if( $gBitSystem->isFeatureActive( 'fisheye_show_all_to_admins' ) && $gBitUser->hasPermission( 'p_fisheye_admin' ) ) {
unset( $getHash['user_id'] );
} elseif( $gBitSystem->isFeatureActive( 'fisheye_show_public_on_upload' ) ) {
-// $getHash['show_public'] = TRUE;
+// $getHash['show_public'] = true;
}
-$galleryTree = $gContent->generateList( $getHash, array( 'name' => "gallery_id", 'id' => "gallerylist", 'item_attributes' => array( 'class'=>'listingtitle'), 'radio_checkbox' => TRUE, ) );
-$gBitSmarty->assignByRef( 'galleryTree', $galleryTree );
+$galleryTree = $gContent->generateList( $getHash, array( 'name' => "gallery_id", 'id' => "gallerylist", 'item_attributes' => array( 'class'=>'listingtitle'), 'radio_checkbox' => true, ) );
+$gBitSmarty->assign( 'galleryTree', $galleryTree );
$gContent->invokeServices( 'content_edit_function' );
-$gBitSystem->display( 'bitpackage:fisheye/edit_gallery.tpl', tra('Edit Gallery: ').$gContent->getTitle() , array( 'display_mode' => 'edit' ));
-
-?>
+$gBitSystem->display( 'bitpackage:fisheye/edit_gallery.tpl', KernelTools::tra('Edit Gallery: ').$gContent->getTitle() , array( 'display_mode' => 'edit' ));
diff --git a/edit_gallery_perms.php b/edit_gallery_perms.php
index 16c21a8..55d1cac 100644..100755
--- a/edit_gallery_perms.php
+++ b/edit_gallery_perms.php
@@ -8,30 +8,29 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
-
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
+namespace Bitweaver\Fisheye;
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\KernelTools;
global $gBitSystem, $fisheyePermNameMap;
// Make sure an gallery has been specified
if (empty($_REQUEST['gallery_id'])) {
- $gBitSmarty->assign('msg', tra("No gallery specified"));
- $gBitSystem->display( "error.tpl" , NULL, array( 'display_mode' => 'edit' ));
+ $gBitSmarty->assign('msg', KernelTools::tra("No gallery specified") );
+ $gBitSystem->display( "error.tpl" , null, [ 'display_mode' => 'edit' ] );
die;
}
-include_once( FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php' );
+include_once FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php';
if (empty($gContent->mContentId)) {
- $gBitSmarty->assign( 'msg', tra( "The specified gallery does not exist" ));
- $gBitSystem->display("error.tpl", NULL, array( 'display_mode' => 'edit' ));
+ $gBitSmarty->assign( 'msg', KernelTools::tra( "The specified gallery does not exist" ));
+ $gBitSystem->display("error.tpl", null, [ 'display_mode' => 'edit' ] );
die;
} elseif ($gContent->mInfo['user_id'] != $gBitUser->mUserId && $gContent->mInfo['perm_level'] < FISHEYE_PERM_ADMIN) {
// This user does not own this gallery and they have not been granted the permission to edit user permissions for this gallery
- $gBitSmarty->assign( 'msg', tra( "You cannot edit this image gallery" ) );
- $gBitSystem->display( "error.tpl" , NULL, array( 'display_mode' => 'edit' ));
+ $gBitSmarty->assign( 'msg', KernelTools::tra( "You cannot edit this image gallery" ) );
+ $gBitSystem->display( "error.tpl" , null, [ 'display_mode' => 'edit' ]);
die;
}
@@ -40,11 +39,11 @@ if (!empty($_REQUEST['submitNewPermissions'])) {
$fisheyeSuccess[] = $_REQUEST['found_username']." given ".$fisheyePermNameMap[$_REQUEST['name_perm_level']]." permissions";
}elseif (!empty($_REQUEST['remove_perm_user_id'])) {
$gContent->revokeUserPermission($_REQUEST['remove_perm_user_id']);
- $fisheyeSuccess[] = tra("User permissions successfully revoked");
+ $fisheyeSuccess[] = KernelTools::tra("User permissions successfully revoked");
}
$userPerms = $gContent->loadPermissions();
-$gBitSmarty->assignByRef('userPerms', $gContent->mPerms);
+$gBitSmarty->assign('userPerms', $gContent->mPerms);
if (!empty($_REQUEST['submitUpdatePerms'])) {
$existingPerms = $_REQUEST['existingPerms'];
@@ -58,6 +57,4 @@ if (!empty($_REQUEST['submitUpdatePerms'])) {
$userPerms = $gContent->getAllUserPermissions();
}
-$gBitSystem->display('bitpackage:fisheye/edit_gallery_perms.tpl', NULL, array( 'display_mode' => 'edit' ));
-
-?>
+$gBitSystem->display('bitpackage:fisheye/edit_gallery_perms.tpl', null, [ 'display_mode' => 'edit' ] );
diff --git a/edit_image.php b/edit_image.php
index 29329cf..de1b444 100644..100755
--- a/edit_image.php
+++ b/edit_image.php
@@ -7,33 +7,33 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+namespace Bitweaver\Fisheye;
+use Bitweaver\KernelTools;
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
+require_once '../kernel/includes/setup_inc.php';
global $gBitSystem;
-include_once( FISHEYE_PKG_INCLUDE_PATH.'image_lookup_inc.php' );
+include_once FISHEYE_PKG_INCLUDE_PATH.'image_lookup_inc.php';
if( $gContent->isValid() ) {
$gContent->verifyUpdatePermission();
} else {
- bit_redirect( FISHEYE_PKG_URL.'?user_id='.$gBitUser->mUserId );
+ KernelTools::bit_redirect( FISHEYE_PKG_URL.'?user_id='.$gBitUser->mUserId );
}
//Utility function, maybe should be moved for use elsewhere. Seems like it has a multitude of possible hook points
function convertSmartQuotes($string)
{
//UTF-8
-$search = array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6");
-$replace= array("'", "'", '"', '"', '-', '--', '...');
+$search = ["\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6" ];
+$replace= ["'", "'", '"', '"', '-', '--', '...' ];
$string = str_replace($search, $replace, $string);
//Windows
-$search = array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133));
-$replace= array("'", "'", '"', '"', '-', '--', '...');
+$search = [chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133) ];
+$replace= ["'", "'", '"', '"', '-', '--', '...' ];
$string = str_replace($search, $replace, $string);
@@ -48,14 +48,14 @@ if( !empty($_REQUEST['saveImage']) || !empty($_REQUEST['regenerateThumbnails'] )
if (empty($_REQUEST['gallery_id']) && empty($_REQUEST['image_id'])) {
// We have no way to know what gallery to add an image to or what image to edit!
- $gBitSmarty->assign( 'msg', tra( "No gallery or image was specified" ) );
- $gBitSystem->display( "error.tpl" , NULL, array( 'display_mode' => 'edit' ));
+ $gBitSmarty->assign( 'msg', KernelTools::tra( "No gallery or image was specified" ) );
+ $gBitSystem->display( "error.tpl" , null, [ 'display_mode' => 'edit' ]);
die;
}
// Store/Update the image
if (isset($_FILES['imageFile']) && is_uploaded_file($_FILES['imageFile']['tmp_name'])) {
- $_REQUEST['_files_override'] = array( $_FILES['imageFile'] );
+ $_REQUEST['_files_override'] = [ $_FILES['imageFile'] ];
$_REQUEST['_files_override']['process_storage'] = STORAGE_IMAGE;
$replaceOriginal=$gContent->getSourceFile();
if( file_exists( dirname( $replaceOriginal ).'/original.jpg' ) ) {
@@ -63,7 +63,7 @@ if( !empty($_REQUEST['saveImage']) || !empty($_REQUEST['regenerateThumbnails'] )
}
}
- $_REQUEST['purge_from_galleries'] = TRUE;
+ $_REQUEST['purge_from_galleries'] = true;
if( $gContent->store($_REQUEST) ) {
// refresh all hashes
$gContent->load();
@@ -100,40 +100,40 @@ if( !empty($_REQUEST['saveImage']) || !empty($_REQUEST['regenerateThumbnails'] )
}
} elseif( !empty($_REQUEST['ajax_edit']) ) {
if( !empty( $_REQUEST['rotate_image'] ) ) {
- $gContent->rotateImage( $_REQUEST['rotate_image'], TRUE );
+ $gContent->rotateImage( $_REQUEST['rotate_image'], true );
}
} elseif( !empty($_REQUEST['delete']) ) {
- $gContent->verifyUserPermission( tra( "You do not have permission to delete this image." ) );
+ $gContent->verifyUserPermission( KernelTools::tra( "You do not have permission to delete this image." ) );
if( !empty( $_REQUEST['cancel'] ) ) {
// user cancelled - just continue on, doing nothing
} elseif( empty( $_REQUEST['confirm'] ) ) {
- $formHash['delete'] = TRUE;
+ $formHash['delete'] = true;
$formHash['image_id'] = $gContent->mImageId;
$gBitSystem->confirmDialog( $formHash,
- array(
- 'warning' => tra('Are you sure you want to delete this image?') . ' (' . $gContent->getTitle() . ') ' . tra('It will be removed from all galleries to which it belongs.'),
- 'error' => tra('This cannot be undone!'),
- )
+ [
+ 'warning' => KernelTools::tra('Are you sure you want to delete this image?') . ' (' . $gContent->getTitle() . ') ' . KernelTools::tra('It will be removed from all galleries to which it belongs.'),
+ 'error' => KernelTools::tra('This cannot be undone!'),
+ ]
);
} else {
if( $gContent->expunge() ) {
- $url = ( is_object( $gGallery ) ? $gGallery->getDisplayUrl() : FISHEYE_PKG_URL );
+ $url = '/'; // is_object( $gGallery ) ? $gGallery->getDisplayUrl() : FISHEYE_PKG_URL;
header( "Location: $url" );
}
}
}
$errors = $gContent->mErrors;
-$gBitSmarty->assignByRef('errors', $errors);
+$gBitSmarty->assign('errors', $errors);
$gContent->loadParentGalleries();
// Get a list of all existing galleries
$gFisheyeGallery = new FisheyeGallery();
-$getHash = array(
+$getHash = [
'user_id' => $gBitUser->mUserId,
-);
+];
if( $gContent->mContentId ) {
$getHash['contain_item'] = $gContent->mContentId;
}
@@ -141,18 +141,17 @@ if( $gContent->mContentId ) {
if( $gBitSystem->isFeatureActive( 'fisheye_show_all_to_admins' ) && $gBitUser->hasPermission( 'p_fisheye_admin' ) ) {
unset( $getHash['user_id'] );
} elseif( $gBitSystem->isFeatureActive( 'fisheye_show_public_on_upload' ) ) {
-// $getHash['show_public'] = TRUE;
+// $getHash['show_public'] = true;
}
-$galleryTree = $gFisheyeGallery->generateList( $getHash, array( 'name' => "gallery_id", 'id' => "gallerylist", 'item_attributes' => array( 'class'=>'listingtitle'), 'radio_checkbox' => TRUE, ), true );
-$gBitSmarty->assignByRef( 'galleryTree', $galleryTree );
+$galleryTree = $gFisheyeGallery->generateList( $getHash, [ 'name' => "gallery_id", 'id' => "gallerylist", 'item_attributes' => [ 'class'=>'listingtitle' ], 'radio_checkbox' => true, ], true );
+$gBitSmarty->assign( 'galleryTree', $galleryTree );
-$gBitSmarty->assign('requested_gallery', !empty($_REQUEST['gallery_id']) ? $_REQUEST['gallery_id'] : NULL);
+$gBitSmarty->assign('requested_gallery', !empty($_REQUEST['gallery_id']) ? $_REQUEST['gallery_id'] : null);
$gContent->invokeServices( 'content_edit_function' );
if( !empty( $_REQUEST['ajax'] ) ) {
- echo $gBitSmarty->fetch( 'bitpackage:fisheye/edit_image_inc.tpl', tra('Edit Image: ').$gContent->getTitle() );
+ echo $gBitSmarty->fetch( 'bitpackage:fisheye/edit_image_inc.tpl', KernelTools::tra('Edit Image: ').$gContent->getTitle() );
} else {
- $gBitSystem->display( 'bitpackage:fisheye/edit_image.tpl', tra('Edit Image: ').$gContent->getTitle() , array( 'display_mode' => 'edit' ));
+ $gBitSystem->display( 'bitpackage:fisheye/edit_image.tpl', KernelTools::tra('Edit Image: ').$gContent->getTitle() , [ 'display_mode' => 'edit' ]);
}
-?>
diff --git a/find_user.php b/find_user.php
index 57a628d..19ab42c 100644..100755
--- a/find_user.php
+++ b/find_user.php
@@ -8,7 +8,7 @@
/**
* required setup
*/
-include_once( "../kernel/includes/setup_inc.php" );
+include_once "../kernel/includes/setup_inc.php";
if (empty($gBitThemes->mStyles['styleSheet'])) {
$gBitThemes->mStyles['styleSheet'] = $gBitThemes->getStyleCss();
@@ -18,13 +18,13 @@ if( !defined( 'THEMES_STYLE_URL' ) ) {
}
if (!empty($_REQUEST['submitUserSearch'])) {
- $searchParams = array('find' => $_REQUEST['find']);
+ $searchParams = [ 'find' => $_REQUEST['find'] ];
$gBitUser->getList($searchParams);
$foundUsers = $searchParams['data'];
} else {
- $foundUsers = NULL;
+ $foundUsers = null;
}
-$gBitSmarty->assignByRef('foundUsers', $foundUsers);
+$gBitSmarty->assign('foundUsers', $foundUsers);
$gBitSmarty->display('bitpackage:fisheye/find_user.tpl');
-?>
+
diff --git a/fisheye_rss.php b/fisheye_rss.php
index d70f047..e5f90e9 100644..100755
--- a/fisheye_rss.php
+++ b/fisheye_rss.php
@@ -8,35 +8,39 @@
/**
* Initialization
*/
-require_once( "../kernel/includes/setup_inc.php" );
+namespace Bitweaver\Fisheye;
+use Bitweaver\KernelTools;
+use Bitweaver\BitBase;
+use Bitweaver\Rss\FeedItem;
+
+require_once "../kernel/includes/setup_inc.php";
$gBitSystem->verifyPackage( 'fisheye' );
$gBitSystem->verifyPackage( 'rss' );
$gBitSystem->verifyFeature( 'fisheye_rss' );
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php' );
-require_once( RSS_PKG_INCLUDE_PATH.'rss_inc.php' );
+require_once RSS_PKG_INCLUDE_PATH.'rss_inc.php';
-$rss->title = $gBitSystem->getConfig( 'fisheye_rss_title', $gBitSystem->getConfig( 'site_title' ).' - '.tra( 'Image Galleries' ) );
-$rss->description = $gBitSystem->getConfig( 'fisheye_rss_description', $gBitSystem->getConfig( 'site_title' ).' - '.tra( 'RSS Feed' ) );
+$rss->title = $gBitSystem->getConfig( 'fisheye_rss_title', $gBitSystem->getConfig( 'site_title' ).' - '.KernelTools::tra( 'Image Galleries' ) );
+$rss->description = $gBitSystem->getConfig( 'fisheye_rss_description', $gBitSystem->getConfig( 'site_title' ).' - '.KernelTools::tra( 'RSS Feed' ) );
// check permission to view fisheye images
if( !$gBitUser->hasPermission( 'p_fisheye_view' ) ) {
- require_once( RSS_PKG_PATH."rss_error.php" );
+ require_once RSS_PKG_PATH."rss_error.php";
} else {
- $listHash = array(
+ $listHash = [
'max_records' => $gBitSystem->getConfig( 'fisheye_rss_max_records', 10 ),
'sort_mode' => 'last_modified_desc',
- 'gallery_id' => !empty( $_REQUEST['gallery_id'] ) ? $_REQUEST['gallery_id'] : NULL,
- 'user_id' => !empty( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : NULL,
- );
+ 'gallery_id' => !empty( $_REQUEST['gallery_id'] ) ? $_REQUEST['gallery_id'] : null,
+ 'user_id' => !empty( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : null,
+ ];
// check if we want to use the cache file
$cacheFile = TEMP_PKG_PATH.RSS_PKG_NAME.'/'.FISHEYE_PKG_NAME.'/'."g{$listHash['gallery_id']}u{$listHash['user_id']}".$cacheFileTail;
$rss->useCached( $rss_version_name, $cacheFile, $gBitSystem->getConfig( 'rssfeed_cache_time' ));
// if we have a gallery we can work with - load it
- if( @BitBase::verifyId( $_REQUEST['gallery_id'] ) ) {
+ if( BitBase::verifyId( $_REQUEST['gallery_id'] ?? 0 ) ) {
$gallery = new FisheyeGallery( $_REQUEST['gallery_id'] );
$gallery->load();
$rss->title .= " - {$gallery->getTitle()}";
@@ -59,10 +63,10 @@ if( !$gBitUser->hasPermission( 'p_fisheye_view' ) ) {
$item->date = ( int )$feed['last_modified'];
$item->source = 'http://'.$_SERVER['HTTP_HOST'].BIT_ROOT_URL;
- $item->author = $gBitUser->getDisplayName( FALSE, $feed );
+ $item->author = $gBitUser->getDisplayName( false, $feed );
$item->descriptionTruncSize = $gBitSystem->getConfig( 'rssfeed_truncate', 5000 );
- $item->descriptionHtmlSyndicated = FALSE;
+ $item->descriptionHtmlSyndicated = false;
// pass the item on to the rss feed creator
$rss->addItem( $item );
@@ -71,4 +75,3 @@ if( !$gBitUser->hasPermission( 'p_fisheye_view' ) ) {
// finally we are ready to serve the data
echo $rss->saveFeed( $rss_version_name, $cacheFile );
}
-?>
diff --git a/gallery_tree.php b/gallery_tree.php
index dafa975..ebedb71 100644..100755
--- a/gallery_tree.php
+++ b/gallery_tree.php
@@ -8,12 +8,8 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
-global $gBitSystem, $gBitSmarty;
+global $gBitSystem;
-$gBitSystem->display("bitpackage:fisheye/gallery_tree.tpl", NULL, array( 'display_mode' => 'display' ));
-
-?>
+$gBitSystem->display("bitpackage:fisheye/gallery_tree.tpl", null, [ 'display_mode' => 'display' ] );
diff --git a/image_order.php b/image_order.php
index 8473752..897a215 100644..100755
--- a/image_order.php
+++ b/image_order.php
@@ -8,14 +8,14 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
-
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
+namespace Bitweaver\Fisheye;
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\KernelTools;
+use Bitweaver\Liberty\LibertyBase;
global $gBitSystem;
-include_once( FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php' );
+include_once FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php';
if( $gBitSystem->isPackageActive( 'gatekeeper' ) ) {
global $gGatekeeper;
@@ -34,7 +34,7 @@ if (!empty($_REQUEST['cancel'])) {
$batchCon = array_flip( $_REQUEST['batch'] );
// increment the first element from 0 to 1 (element 0 index before flip) so any conditional tests will pass, particularly in the .tpl
$batchCon[key($batchCon)]++;
- $gBitSmarty->assignByRef( 'batchEdit', $batchCon );
+ $gBitSmarty->assign( 'batchEdit', $batchCon );
}
if( !empty( $_REQUEST['is_favorite'] ) ) {
@@ -46,7 +46,7 @@ if (!empty($_REQUEST['cancel'])) {
$gContent->loadImages();
- $feedback = NULL;
+ $feedback = null;
if( !empty( $_REQUEST['reorder_gallery'] ) ) {
switch( $_REQUEST['reorder_gallery'] ){
@@ -104,7 +104,7 @@ if (!empty($_REQUEST['cancel'])) {
switch( $batchCommand ) {
case 'delete':
$galleryItem->expunge();
- $galleryItem = NULL;
+ $galleryItem = null;
break;
case 'remove':
$parents = $galleryItem->getParentGalleries();
@@ -113,28 +113,28 @@ if (!empty($_REQUEST['cancel'])) {
} else {
$galleryItem->expunge();
}
- $galleryItem = NULL;
+ $galleryItem = null;
break;
case 'rotate':
if( is_a( $galleryItem, 'FisheyeImage' ) ) {
$galleryItem->rotateImage( $batchParam );
- $feedback['success'] = tra( "Images rotated" );
+ $feedback['success'] = KernelTools::tra( "Images rotated" );
}
break;
case 'thumbnail':
- $galleryItem->generateThumbnails();
- $feedback['success'] = tra( "Thumbnail regeneration queued" );
+ $galleryItem->generateGalleryThumbnails();
+ $feedback['success'] = KernelTools::tra( "Thumbnail regeneration queued" );
break;
case 'grayscale':
$galleryItem->convertColorspace( 'grayscale' );
break;
case 'security':
$storageHash['security_id'] = $batchParam;
- $feedback['success'] = tra( "Items security assigned" );
+ $feedback['success'] = KernelTools::tra( "Items security assigned" );
break;
case 'gallerymove':
if( empty( $destGallery ) ) {
- $destGallery = new FisheyeGallery( NULL, $batchParam );
+ $destGallery = new FisheyeGallery( null, $batchParam );
$destGallery->load();
}
if( $batchParam != $contentId ) {
@@ -142,19 +142,19 @@ if (!empty($_REQUEST['cancel'])) {
}
case 'gallerycopy':
if( empty( $destGallery ) ) {
- $destGallery = new FisheyeGallery( NULL, $batchParam );
+ $destGallery = new FisheyeGallery( null, $batchParam );
$destGallery->load();
}
if( $destGallery->addItem( $contentId ) ) {
- $feedback['success'][] = $galleryItem->getTitle().' '.tra( "added to" ).' '.$destGallery->getTitle();
+ $feedback['success'][] = $galleryItem->getTitle().' '.KernelTools::tra( "added to" ).' '.$destGallery->getTitle();
} else {
- $feedback['error'][] = $galleryItem->getTitle().' '.tra( "could not be added to" ).' '.$destGallery->getTitle();
+ $feedback['error'][] = $galleryItem->getTitle().' '.KernelTools::tra( "could not be added to" ).' '.$destGallery->getTitle();
}
break;
case 'filenametoimagename':
- $renameHash = array();
+ $renameHash = [];
if( !empty( $galleryItem->mInfo['filename'] ) ) {
- $renameHash['title'] = file_name_to_title( $galleryItem->mInfo['filename'] );
+ $renameHash['title'] = KernelTools::file_name_to_title( $galleryItem->mInfo['filename'] );
$galleryItem->store( $renameHash );
// update to prevent renaming value in text input
$_REQUEST['image_title'][$contentId] = $renameHash['title'];
@@ -167,10 +167,10 @@ if (!empty($_REQUEST['cancel'])) {
if( !empty( $_REQUEST['batch_security_id'] ) ) {
}
// if we are reordered, that takes precident
- $newPos = preg_replace( '/[^\d\.]/', '', (!empty( $newOrder[$contentId] ) ? $newOrder[$contentId] : $newPos) );
+ $newPos = preg_replace( '/[^\d\.]/', '', !empty( $newOrder[$contentId] ) ? $newOrder[$contentId] : $newPos);
if ($galleryItem->mInfo['title'] != $_REQUEST['image_title'][$contentId]) {
- $storageHash = array('title' => $_REQUEST['image_title'][$contentId]);
+ $storageHash = [ 'title' => $_REQUEST['image_title'][$contentId] ];
// make sure we don't delete the 'data' field on en masse title updating
$storageHash['edit'] = $galleryItem->getField( 'data' );
}
@@ -190,7 +190,7 @@ if (!empty($_REQUEST['cancel'])) {
$_SESSION['image_order_feedback'] = $feedback;
// Redirect so reload does not cause double-batch processing
- bit_redirect( FISHEYE_PKG_URL.'image_order.php?gallery_id='.$gContent->getField( 'gallery_id' ) );
+ KernelTools::bit_redirect( FISHEYE_PKG_URL.'image_order.php?gallery_id='.$gContent->getField( 'gallery_id' ) );
}
if( !empty( $_SESSION['image_order_feedback'] ) ) {
@@ -199,25 +199,26 @@ if( !empty( $_SESSION['image_order_feedback'] ) ) {
}
// Get a list of usable galleries
-$listHash = array(
+$listHash = [
'user_id' => $gBitUser->mUserId,
+ 'page' => -1,
'max_records' => -1,
- 'no_thumbnails' => TRUE,
+ 'no_thumbnails' => true,
'sort_mode' => 'title_asc',
- 'show_empty' => TRUE
-);
+ 'show_empty' => true
+];
// modify listHash according to global preferences
if( $gBitSystem->isFeatureActive( 'fisheye_show_all_to_admins' ) && $gBitUser->hasPermission( 'p_fisheye_admin' ) ) {
unset( $listHash['user_id'] );
} elseif( $gBitSystem->isFeatureActive( 'fisheye_show_public_on_upload' ) ) {
-// $listHash['show_public'] = TRUE;
+// $listHash['show_public'] = true;
}
$galleryList = $gContent->getList( $listHash );
-$gBitSmarty->assignByRef( 'galleryList', $galleryList );
-$gContent->loadImages();
-
-$gBitSmarty->assignByRef('formfeedback', $feedback);
+$gBitSmarty->assign( 'galleryList', $galleryList );
+$gContent->loadImages( $listHash );
+if ( !empty( $feedback ) ) {
+ $gBitSmarty->assign('formfeedback', $feedback);
+}
-$gBitThemes->loadAjax( 'mochikit' );
-$gBitSystem->display( 'bitpackage:fisheye/image_order.tpl', tra( 'Edit Gallery Images' ).': '.$gContent->getTitle() , array( 'display_mode' => 'display' ));
-?>
+// $gBitThemes->loadAjax( 'mochikit' );
+$gBitSystem->display( 'bitpackage:fisheye/image_order.tpl', KernelTools::tra( 'Edit Gallery Images' ).': '.$gContent->getTitle() , [ 'display_mode' => 'display' ] );
diff --git a/index.php b/index.php
index d29793b..fbe3832 100644..100755
--- a/index.php
+++ b/index.php
@@ -1,3 +1,2 @@
<?php
-require_once( 'list_galleries.php' );
-?>
+require_once 'list_galleries.php';
diff --git a/list_galleries.php b/list_galleries.php
index 630b078..9d1f880 100644..100755
--- a/list_galleries.php
+++ b/list_galleries.php
@@ -8,26 +8,28 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+namespace Bitweaver\Fisheye;
+
+require_once '../kernel/includes/setup_inc.php';
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
global $gBitSystem, $gBitSmarty, $gFisheyeGallery;
-$gBitSystem->verifyPermission( 'p_fisheye_list_galleries' );
+//$gBitSystem->verifyPermission( 'p_fisheye_list_galleries' );
+require_once LIBERTY_PKG_PATH.'plugins/mime.image.php';
$gFisheyeGallery = new FisheyeGallery();
/* Get a list of galleries which matches the input parameters (default is to list every gallery in the system) */
-$_REQUEST['root_only'] = TRUE;
+$_REQUEST['root_only'] = true;
/* Process the input parameters this page accepts */
if (!empty($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
if( $_REQUEST['user_id'] == $gBitUser->mUserId ) {
- $_REQUEST['show_empty'] = TRUE;
+ $_REQUEST['show_empty'] = true;
}
- $gBitSmarty->assignByRef('gQueryUserId', $_REQUEST['user_id']);
+ $gBitSmarty->assign('gQueryUserId', $_REQUEST['user_id']);
$template = 'user_galleries.tpl';
} else {
- $template = 'list_galleries.tpl';
+ $template = 'list_galleries2.tpl';
}
$_REQUEST['thumbnail_size'] = $gBitSystem->getConfig( 'fisheye_list_thumbnail_size', 'small' );
@@ -35,12 +37,10 @@ $_REQUEST['thumbnail_size'] = $gBitSystem->getConfig( 'fisheye_list_thumbnail_si
$galleryList = $gFisheyeGallery->getList( $_REQUEST );
$gFisheyeGallery->invokeServices( 'content_list_function', $_REQUEST );
// Pagination Data
-$gBitSmarty->assignByRef( 'listInfo', $_REQUEST['listInfo'] );
+$gBitSmarty->assign( 'listInfo', $_REQUEST['listInfo'] );
$gBitSmarty->assign( 'galleryList', $galleryList );
// Display the template
$gDefaultCenter = "bitpackage:fisheye/$template";
-$gBitSmarty->assignByRef( 'gDefaultCenter', $gDefaultCenter );
-$gBitSystem->display( 'bitpackage:kernel/dynamic.tpl', 'List Galleries' , array( 'display_mode' => 'list' ));
-
-?>
+$gBitSmarty->assign( 'gDefaultCenter', $gDefaultCenter );
+$gBitSystem->display( 'bitpackage:kernel/dynamic.tpl', 'List Galleries' , [ 'display_mode' => 'list' ] );
diff --git a/main.php b/main.php
index e56f61b..cdc7d9a 100644..100755
--- a/main.php
+++ b/main.php
@@ -20,40 +20,36 @@
// | Authors: spider <spider@steelsun.com>
// +----------------------------------------------------------------------+
-chdir( dirname( __FILE__ ) );
/**
* Setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+namespace Bitweaver\Fisheye;
+chdir( dirname( __FILE__ ) );
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\KernelTools;
//Point of access for FisheyeRemote requests
-require_once( 'FisheyeRemote.php' );
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php' );
-
$gFisheyeRemote = new FisheyeRemote();
// Fisheye allows directories to below to multiple parents - not in gallery. This confuses some clients
// We pad with a random number for uniqueness
foreach( array( 'g2_itemId', 'set_albumName' ) as $key ) {
if( !empty( $_POST['g2_form'][$key] ) && $_POST['g2_form'][$key] > 1 ) {
- $_POST['g2_form'][$key] = substr( $_POST['g2_form'][$key], 0, (strlen( $_POST['g2_form'][$key] ) - 2) );
+ $_POST['g2_form'][$key] = substr( $_POST['g2_form'][$key], 0, strlen( $_POST['g2_form'][$key] ) - 2 );
}
if( !empty( $_GET['g2_form'][$key] ) && $_GET['g2_form'][$key] > 1 ) {
- $_GET['g2_form'][$key] = substr( $_GET['g2_form'][$key], 0, (strlen( $_GET['g2_form'][$key] ) - 2) );
+ $_GET['g2_form'][$key] = substr( $_GET['g2_form'][$key], 0, strlen( $_GET['g2_form'][$key] ) - 2 );
}
if( !empty( $_REQUEST[$key] ) && $_REQUEST[$key] > 1 ) {
- $_REQUEST[$key] = substr( $_REQUEST[$key], 0, (strlen( $_REQUEST[$key] ) - 2) );
+ $_REQUEST[$key] = substr( $_REQUEST[$key], 0, strlen( $_REQUEST[$key] ) - 2 );
}
}
if( !empty( $_REQUEST['g2_form'] ) ){
- $gFisheyeRemote->processRequest( (!empty( $_GET['g2_form'] ) ? $_GET['g2_form'] : array()), (!empty( $_POST['g2_form'] ) ? $_POST['g2_form'] : array()) );
+ $gFisheyeRemote->processRequest( !empty( $_GET['g2_form'] ) ? $_GET['g2_form'] : [], !empty( $_POST['g2_form'] ? $_POST['g2_form'] : []) );
} elseif( !empty( $_REQUEST['g2_itemId'] ) ) {
//If we don't have g2_form, they must be asking the gallery to be opened upon export completion
$gallery = new FisheyeGallery();
$gallery = $gallery->lookup(array('content_id' => $_REQUEST['g2_itemId'] ));
- bit_redirect( $gallery->getDisplayUrl() );
+ KernelTools::bit_redirect( $gallery->getDisplayUrl() );
}
-
-
-?>
diff --git a/thumbnailer.php b/thumbnailer.php
index 3cd8601..0533ddd 100644..100755
--- a/thumbnailer.php
+++ b/thumbnailer.php
@@ -14,6 +14,9 @@
* @subpackage functions
*/
+namespace Bitweaver\Fisheye;
+use Bitweaver\KernelTools;
+
global $gBitSystem, $gBitDb, $_SERVER;
$_SERVER['SCRIPT_URL'] = '';
@@ -32,13 +35,12 @@
// running from cron can cause us not to be in the right dir.
chdir( dirname( __FILE__ ) );
- require_once( '../kernel/includes/setup_inc.php' );
- require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php' );
-
+ require_once '../kernel/includes/setup_inc.php';
+
// add some protection for arbitrary thumbail execution.
// if argc is present, we will trust it was exec'ed command line.
if( empty( $argc ) && !$gBitUser->isAdmin() ) {
- $gBitSystem->fatalError( tra( 'You cannot run the thumbnailer' ));
+ $gBitSystem->fatalError( KernelTools::tra( 'You cannot run the thumbnailer' ));
}
$thumbCount = ( !empty( $argv[1] ) ) ? $argv[1] : ( !empty( $_REQUEST['thumbnails'] ) ? $_REQUEST['thumbnails'] : 10);
@@ -47,24 +49,23 @@
$sql = "SELECT pq.content_id AS hash_key, pq.*
FROM `".BIT_DB_PREFIX."liberty_process_queue` pq
- WHERE pq.begin_date IS NULL
+ WHERE pq.begin_date IS null
ORDER BY pq.queue_date";
- $rs = $gBitSystem->mDb->query( $sql, FALSE, $thumbCount );
+ $rows = $gBitSystem->mDb->getAssoc( $sql, false, $thumbCount );
- $processContent = array();
- while( !$rs->EOF ) {
- $processContent[$rs->fields['content_id']] = $rs->fields;
- $processContent[$rs->fields['content_id']]['parameters'] = unserialize( $rs->fields['processor_parameters'] );
+ $processContent = [];
+ foreach( $rows as $row ) {
+ $processContent[$row['content_id']] = $row;
+ $processContent[$row['content_id']]['parameters'] = unserialize( $row['processor_parameters'] );
$sql2 = "UPDATE `".BIT_DB_PREFIX."liberty_process_queue` SET `begin_date`=? WHERE `content_id`=?";
- $rs2 = $gBitSystem->mDb->query( $sql2, array( date( 'U' ), $rs->fields['content_id'] ) );
- $rs->MoveNext();
+ $rs2 = $gBitSystem->mDb->getOne( $sql2, array( date( 'U' ), $row['content_id'] ) );
}
$gBitDb->CompleteTrans();
- $log = array();
+ $log = [];
$total = date( 'U' );
foreach( array_keys( $processContent ) as $contentId ) {
- $image = new FisheyeImage( NULL, $contentId );
+ $image = new FisheyeImage( null, $contentId );
$begin = date( 'U' );
if( !empty( $processContent[$contentId]['parameters']['resize_original'] ) ) {
$image->resizeOriginal( $processContent[$contentId]['parameters']['resize_original'] );
@@ -72,7 +73,7 @@
if( $image->renderThumbnails() ) {
$log[$contentId]['message'] = 'SUCCESS: Thumbnails created';
$sql3 = "UPDATE `".BIT_DB_PREFIX."liberty_process_queue` SET `begin_date`=?, `end_date`=? WHERE `content_id`=?";
- $rs3 = $gBitSystem->mDb->query( $sql3, array( $begin, $gBitSystem->getUTCTime(), $contentId ) );
+ $rs3 = $gBitSystem->mDb->getOne( $sql3, array( $begin, $gBitSystem->getUTCTime(), $contentId ) );
} else {
$log[$contentId]['message'] = ' ERROR: '.$image->mErrors['thumbnail'];
}
@@ -89,5 +90,3 @@
if( count($processContent) ) {
print '# '.count($processContent)." images processed in ".(date( 'U' ) - $total)." seconds<br/>\n";
}
-
-?>
diff --git a/upload.php b/upload.php
index 1f17b5e..f5c7714 100644..100755
--- a/upload.php
+++ b/upload.php
@@ -7,23 +7,22 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
-
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
+namespace Bitweaver\Fisheye;
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\KernelTools;
global $gBitSystem;
global $fisheyeErrors, $fisheyeWarnings, $fisheyeSuccess, $gFisheyeUploads;
-include_once( FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php' );
-require_once( FISHEYE_PKG_INCLUDE_PATH.'upload_inc.php');
+include_once FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php';
+require_once FISHEYE_PKG_INCLUDE_PATH.'upload_inc.php';
$gBitSystem->verifyPermission( 'p_fisheye_upload' );
if( !empty( $_FILES ) ) {
- $upErrors = fisheye_handle_upload( $_FILES, $_REQUEST );
+ $upErrors = fisheye_handle_upload( $_FILES );
if( empty( $upErrors ) ) {
- bit_redirect( $gContent->getDisplayUrl() );
+ KernelTools::bit_redirect( $gContent->getDisplayUrl() );
} else {
$gBitSmarty->assign( 'errors', $upErrors );
}
@@ -36,30 +35,30 @@ if ( !empty($_REQUEST['on_complete'])){
}
-require_once( LIBERTY_PKG_INCLUDE_PATH.'calculate_max_upload_inc.php' );
+require_once LIBERTY_PKG_INCLUDE_PATH.'calculate_max_upload_inc.php';
$gContent->invokeServices( 'content_edit_function' );
// Get a list of all existing galleries
$gFisheyeGallery = new FisheyeGallery();
-$getHash = array(
+$getHash = [
'user_id' => $gBitUser->mUserId,
-);
+];
// modify listHash according to global preferences
if( $gBitSystem->isFeatureActive( 'fisheye_show_all_to_admins' ) && $gBitUser->hasPermission( 'p_fisheye_admin' ) ) {
unset( $getHash['user_id'] );
} elseif( $gBitSystem->isFeatureActive( 'fisheye_show_public_on_upload' ) ) {
-// $getHash['show_public'] = TRUE; THis should be handled with a content_status, disabled for now
+// $getHash['show_public'] = true; THis should be handled with a content_status, disabled for now
}
-$galleryTree = $gContent->generateList( $getHash, array( 'name' => "gallery_id", 'id' => "gallerylist", 'item_attributes' => array( 'class'=>'listingtitle'), 'radio_checkbox' => TRUE, ), true );
+$galleryTree = $gContent->generateList( $getHash, [ 'name' => "gallery_id", 'id' => "gallerylist", 'item_attributes' => [ 'class'=>'listingtitle' ], 'radio_checkbox' => true, ], true );
-$gBitSmarty->assignByRef( 'galleryTree', $galleryTree );
+$gBitSmarty->assign( 'galleryTree', $galleryTree );
if( $gLibertySystem->hasService( 'upload' ) ) {
$gContent->invokeServices( "content_pre_upload_function", $_REQUEST );
} else {
- $gBitThemes->loadJavascript( UTIL_PKG_PATH.'javascript/multifile.js', TRUE );
+ $gBitThemes->loadJavascript( UTIL_PKG_PATH.'javascript/multifile.js', true );
}
if( $gBitThemes->isAjaxRequest() ) {
@@ -68,7 +67,5 @@ if( $gBitThemes->isAjaxRequest() ) {
}
} else {
$displayMode = !empty($_REQUEST['display_mode']) ? $_REQUEST['display_mode'] : 'edit';
- $gBitSystem->display( 'bitpackage:fisheye/upload_fisheye.tpl', 'Upload Images' , array( 'display_mode' => $displayMode ));
+ $gBitSystem->display( 'bitpackage:fisheye/upload_fisheye.tpl', 'Upload Images' , [ 'display_mode' => $displayMode ] );
}
-
-?>
diff --git a/view.php b/view.php
index 3514f2d..61b8546 100644..100755
--- a/view.php
+++ b/view.php
@@ -5,20 +5,18 @@
* @subpackage functions
*/
+use Bitweaver\KernelTools;
+
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'fisheye' );
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
global $gBitSystem, $fisheyeErrors, $fisheyeWarnings, $fisheyeSuccess;
-//$gDebug = TRUE;
-
-include_once( FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php' );
+include_once FISHEYE_PKG_INCLUDE_PATH.'gallery_lookup_inc.php';
if( $gContent && $gContent->isValid() ) {
$gBitSystem->setCanonicalLink( $gContent->getDisplayUrl() );
@@ -29,17 +27,17 @@ $gHideModules = $gBitSystem->isFeatureActive( 'fisheye_gallery_hide_modules' );
if ( !$gContent->isValid() ) {
// No gallery was indicated so we will redirect to the browse galleries page
- bit_redirect( FISHEYE_PKG_URL."list_galleries.php", '404' );
+ KernelTools::bit_redirect( FISHEYE_PKG_URL."list_galleries.php", '404' );
die;
}
if( $gContent->isCommentable() ) {
$commentsParentId = $gContent->mContentId;
- $comments_vars = Array('fisheyegallery');
+ $comments_vars = [ 'fisheyegallery' ];
$comments_prefix_var='fisheyegallery:';
$comments_object_var='fisheyegallery';
$comments_return_url = $_SERVER['SCRIPT_NAME']."?gallery_id=".$gContent->mGalleryId;
- include_once( LIBERTY_PKG_INCLUDE_PATH.'comments_inc.php' );
+ include_once LIBERTY_PKG_INCLUDE_PATH.'comments_inc.php';
}
if (!empty($_REQUEST['download'])){
@@ -48,7 +46,5 @@ if (!empty($_REQUEST['download'])){
$gContent->verifyUserPermission('p_fisheye_download_gallery_arc');
$gContent->download();
} else {
- require_once( FISHEYE_PKG_INCLUDE_PATH.'display_fisheye_gallery_inc.php' );
+ require_once FISHEYE_PKG_INCLUDE_PATH.'display_fisheye_gallery_inc.php';
}
-
-?>
diff --git a/view_image.php b/view_image.php
index 76d9537..6e7a5ca 100644..100755
--- a/view_image.php
+++ b/view_image.php
@@ -7,17 +7,15 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
-
-$gBitSystem->verifyPackage( 'fisheye' );
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
+require_once '../kernel/includes/setup_inc.php';
global $gBitSystem, $gDebug;
+$gBitSystem->verifyPackage( 'fisheye' );
+
if( !empty( $_REQUEST['size'] ) ) {
// nuke old values if set
- $_COOKIE['fisheyeviewsize'] = NULL;
+ $_COOKIE['fisheyeviewsize'] = null;
setcookie( 'fisheyeviewsize', $_REQUEST['size'], 0, $gBitSystem->getConfig( 'cookie_path', BIT_ROOT_URL ), $gBitSystem->getConfig( 'cookie_domain', '.'.$_SERVER['SERVER_NAME'] ) );
}
@@ -25,7 +23,7 @@ if( !empty( $_REQUEST['refresh'] ) ) {
$gBitSmarty->assign( 'refresh', '?refresh='.time() );
}
-include_once( FISHEYE_PKG_INCLUDE_PATH.'image_lookup_inc.php' );
+include_once FISHEYE_PKG_INCLUDE_PATH.'image_lookup_inc.php';
if( $gContent && $gContent->isValid() ) {
$gBitSystem->setCanonicalLink( $gContent->getDisplayUrl() );
@@ -36,24 +34,24 @@ $gHideModules = $gBitSystem->isFeatureActive( 'fisheye_image_hide_modules' );
if( is_object( $gGallery ) && $gGallery->isCommentable() ) {
$commentsParentId = $gContent->mContentId;
- $comments_vars = Array('fisheyeimage');
+ $comments_vars = [ 'fisheyeimage' ];
$comments_prefix_var='fisheyeimage:';
$comments_object_var='fisheyeimage';
- $comments_return_url = $_SERVER['SCRIPT_NAME']."?image_id=".$gContent->mImageId;
- include_once( LIBERTY_PKG_INCLUDE_PATH.'comments_inc.php' );
+ $comments_return_url = $_SERVER['SCRIPT_NAME']."?image_id=" . $gContent->mImageId ?? $gContent->mContentId;
+ include_once LIBERTY_PKG_INCLUDE_PATH.'comments_inc.php';
}
$gContent->addHit();
// this will let LibertyMime know that we want to display the original image
if( $gContent->hasUpdatePermission() || $gGallery && $gGallery->getPreference( 'link_original_images' )) {
- $gContent->mInfo['image_file']['original'] = TRUE;
+ $gContent->mInfo['image_file']['original'] = true;
}
if( $gContent->hasUpdatePermission() ) {
if( !empty( $_REQUEST['rethumb'] ) ) {
- $gContent->generateThumbnails( FALSE, TRUE );
+ $gContent->generateThumbnails( false, true );
}
}
-require_once( FISHEYE_PKG_INCLUDE_PATH.'display_fisheye_image_inc.php' );
+require_once FISHEYE_PKG_INCLUDE_PATH.'display_fisheye_image_inc.php';
diff --git a/view_image_details.php b/view_image_details.php
index 2fbd8b5..a561be2 100644..100755
--- a/view_image_details.php
+++ b/view_image_details.php
@@ -8,25 +8,23 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'fisheye' );
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php');
global $gBitSystem, $gDebug;
-include_once( FISHEYE_PKG_INCLUDE_PATH.'image_lookup_inc.php' );
+include_once FISHEYE_PKG_INCLUDE_PATH.'image_lookup_inc.php';
$gContent->invokeServices( 'content_display_function', $displayHash );
if( is_object( $gGallery ) && $gGallery->isCommentable() ) {
$commentsParentId = $gContent->mContentId;
- $comments_vars = Array('fisheyeimage');
+ $comments_vars = [ 'fisheyeimage' ];
$comments_prefix_var='fisheyeimage:';
$comments_object_var='fisheyeimage';
- $comments_return_url = FISHEYE_PKG_URL."view_image.php?image_id=".$gContent->mImageId;
- include_once( LIBERTY_PKG_INCLUDE_PATH.'comments_inc.php' );
+ $comments_return_url = FISHEYE_PKG_URL."view_image.php?image_id=".$gContent->mContentId;
+ include_once LIBERTY_PKG_INCLUDE_PATH.'comments_inc.php';
}
$gBitSmarty->display( 'bitpackage:fisheye/view_image_details.tpl' );