Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

slideshow.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: slideshow.php 9345 2002-03-06 10:34:39Z jhe $
5 //
6 // Definition of eZArticle class
7 //
8 // Created on: <25-Jun-2001 11:50:32 jhe>
9 //
10 // This source file is part of Exponential Basic, publishing software.
11 //
12 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
27 //
28
29 // include_once( "classes/INIFile.php" );
30 // include_once( "classes/eztemplate.php" );
31 // include_once( "ezimagecatalogue/classes/ezslideshow.php" );
32
33 // sections
34 // include_once( "ezsitemanager/classes/ezsection.php" );
35
36 $ini =& eZINI::instance( 'site.ini' );
37 $Language = $ini->variable( "eZImageCatalogueMain", "Language" );
38
39 $SlideShowHeaderFooter = $ini->variable( "eZImageCatalogueMain", "SlideShowHeaderFooter" );
40 $SlideShowOriginalImage = $ini->variable( "eZImageCatalogueMain", "SlideShowOriginalImage" );
41
42 if ( $SlideShowHeaderFooter == "disabled" )
43 {
44 $PrintableVersion = "enabled";
45 }
46
47 $t = new eZTemplate( "kernel/ezimagecatalogue/user/" . $ini->variable( "eZImageCatalogueMain", "TemplateDir" ),
48 "kernel/ezimagecatalogue/user/intl/", $Language, "slideshow.php" );
49
50 $t->setAllStrings();
51
52 $t->set_file( "slideshow_tpl", "slideshow.tpl" );
53
54 $t->set_block( "slideshow_tpl", "image_tpl", "image" );
55 $t->set_block( "slideshow_tpl", "previous_tpl", "previous" );
56 $t->set_block( "slideshow_tpl", "next_tpl", "next" );
57
58
59 if ( $CategoryID == 0 )
60 $GlobalSectionID = $ini->variable( "eZImageCatalogueMain", "DefaultSection" );
61
62 if ( !$GlobalSectionID )
63 $GlobalSectionID = $ini->variable( "eZImageCatalogueMain", "DefaultSection" );
64
65 $sectionObject =& eZSection::globalSectionObject( $GlobalSectionID );
66 $sectionObject->setOverrideVariables();
67
68 if ( $Position == "" )
69 $Position = 0;
70
71 $slideshow = new eZSlideshow( $CategoryID, eZUser::currentUser(), $Position );
72 $image = $slideshow->image();
73
74 if ( !$image )
75 {
76 $t->set_var( "image", "" );
77 }
78 else
79 {
80 if ( $SlideShowOriginalImage == "enabled" )
81 {
82 $variation = $image;
83 }
84 else
85 {
86 $variation =& $image->requestImageVariation( $ini->variable( "eZImageCatalogueMain", "ImageViewWidth" ),
87 $ini->variable( "eZImageCatalogueMain", "ImageViewHeight" ) );
88 }
89
90 $t->set_var( "image_uri", "/" . $variation->imagePath( true ) );
91 $t->set_var( "image_width", $variation->width() );
92 $t->set_var( "image_height", $variation->height() );
93
94 $t->parse( "image", "image_tpl" );
95 }
96
97 $current = $slideshow->currentPosition();
98 $t->set_var( "category", $CategoryID );
99
100 if ( $current > 0 )
101 {
102 $t->set_var( "prev_image", $current - 1 );
103 $t->parse( "previous", "previous_tpl" );
104 }
105 else
106 {
107 $t->set_var( "prev_image", $current );
108 $t->set_var( "previous", "" );
109 }
110
111 if ( $current < ( $slideshow->size() - 1 ) )
112 {
113 if ( is_numeric( $RefreshTimer ) )
114 {
115 $MetaRedirectLocation = "/imagecatalogue/slideshow/" . $CategoryID . "/" . ( $current + 1 ) . "/" . $RefreshTimer . "/";
116 $MetaRedirectTimer = $RefreshTimer;
117 }
118 $t->set_var( "next_image", $current + 1 );
119 $t->parse( "next", "next_tpl" );
120 }
121 else
122 {
123 $t->set_var( "next_image", $current );
124 $t->set_var( "next", "" );
125 }
126
127 $t->pparse( "output", "slideshow_tpl" );
128
129 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZSection\globalSectionObject
static & globalSectionObject( $sectionID)
Definition: ezsection.php:366
eZSlideshow
Definition: ezslideshow.php:43
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$GlobalSectionID
$GlobalSectionID
Definition: ezad/user/datasupplier.php:28
$MetaRedirectTimer
$MetaRedirectTimer
Definition: ezerror/admin/datasupplier.php:30
$MetaRedirectLocation
$MetaRedirectLocation
Definition: ezerror/admin/datasupplier.php:29
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
$SlideShowHeaderFooter
$SlideShowHeaderFooter
Definition: slideshow.php:39
$current
$current
Definition: slideshow.php:97
$SlideShowOriginalImage
$SlideShowOriginalImage
Definition: slideshow.php:40
$t
if( $SlideShowHeaderFooter=="disabled") $t
Definition: slideshow.php:47
$sectionObject
$sectionObject
Definition: slideshow.php:65
$Language
$Language
Definition: slideshow.php:37
$ini
$ini
Definition: slideshow.php:36
$slideshow
$slideshow
Definition: slideshow.php:71
$image
$image
Definition: slideshow.php:72
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.