summaryrefslogtreecommitdiff
path: root/display_fisheye_gallery_inc.php
diff options
context:
space:
mode:
authorbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 04:36:24 +0000
committerbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 04:36:24 +0000
commitcf071b67f1000864b864aedb3e294cbaf0509f73 (patch)
tree641097ba8de3271ac243806c9ec90b1237e8c9f6 /display_fisheye_gallery_inc.php
downloadfisheye-cf071b67f1000864b864aedb3e294cbaf0509f73.tar.gz
fisheye-cf071b67f1000864b864aedb3e294cbaf0509f73.tar.bz2
fisheye-cf071b67f1000864b864aedb3e294cbaf0509f73.zip
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'display_fisheye_gallery_inc.php')
-rw-r--r--display_fisheye_gallery_inc.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/display_fisheye_gallery_inc.php b/display_fisheye_gallery_inc.php
new file mode 100644
index 0000000..8c13510
--- /dev/null
+++ b/display_fisheye_gallery_inc.php
@@ -0,0 +1,54 @@
+<?php
+
+if( !$gContent->hasUserAccess( 'bit_p_view_fisheye' ) ) {
+ if ( !empty($_REQUEST['submit_answer'])) { // User is attempting to authenticate themseleves to view this gallery
+ if( !$gContent->validateUserAccess( $_REQUEST['try_access_answer']) ) {
+ $smarty->assign("failedLogin", "Incorrect Answer");
+ $gBitSystem->display("bitpackage:fisheye/authenticate.tpl", "Password Required to view: ".$gContent->getTitle() );
+ die;
+ }
+ } else {
+ if( !empty( $gContent->mInfo['access_answer'] ) ) {
+ $gBitSystem->display("bitpackage:fisheye/authenticate.tpl", "Password Required to view: ".$gContent->getTitle() );
+ die;
+ }
+ $gBitSystem->fatalError( tra( "You cannot view this image gallery" ) );
+ }
+}
+
+
+if( $gBitSystem->isPackageActive( 'categories' ) ) {
+ $cat_obj_type = FISHEYEGALLERY_CONTENT_TYPE_GUID;
+ $cat_objid =$gContent->mContentId;
+ include_once( CATEGORIES_PKG_PATH.'categories_display_inc.php' );
+}
+
+
+if (!empty($_REQUEST['page']) && is_numeric($_REQUEST['page'])) {
+ $page = $_REQUEST['page'];
+} else {
+ $page = 0;
+}
+
+if ($page > $gContent->mInfo['num_pages']) {
+ $page = $gContent->mInfo['num_pages'];
+} elseif ($page < 1) {
+ $page = 1;
+}
+
+$imagesPerPage = $gContent->mInfo['rows_per_page'] * $gContent->mInfo['cols_per_page'];
+$imageOffset = $imagesPerPage * ($page-1);
+
+$smarty->assign_by_ref('page', $page);
+$smarty->assign_by_ref('imagesPerPage', $imagesPerPage);
+$smarty->assign_by_ref('imageOffset', $imageOffset);
+$smarty->assign_by_ref('rows_per_page', $gContent->mInfo['rows_per_page']);
+$smarty->assign_by_ref('cols_per_page', $gContent->mInfo['cols_per_page']);
+
+$gContent->loadImages($imageOffset, $imagesPerPage);
+$gContent->addHit();
+
+$gBitSystem->setBrowserTitle( $gContent->getTitle().' '.tra('Gallery') );
+$gBitSystem->display("bitpackage:fisheye/view_gallery.tpl");
+
+?>