Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezquiz/user/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 9344 2002-03-06 08:56:33Z jhe $
5 //
6 // Created on: <28-May-2001 11:24:41 pkej>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/ezhttptool.php" );
29
30 $ini =& eZINI::instance( 'site.ini' );
31
32 $PageCaching = $ini->variable( "eZQuizMain", "PageCaching" );
33 $GlobalSectionID = $ini->variable( "eZQuizMain", "DefaultSection" );
34
35 switch ( $url_array[2] )
36 {
37 case "game":
38 {
39 $Action = $url_array[3];
40
41 switch ( $Action )
42 {
43 case "future":
44 case "past":
45 case "list":
46 {
47 $Offset = $url_array[4];
48
49 if ( !is_numeric( $Offset ) )
50 {
51 $Offset = 0;
52 }
53
54 include( "kernel/ezquiz/user/quizlist.php" );
55 }
56 break;
57
58 case "score":
59 case "scores":
60 {
61 $Offset = $url_array[5];
62
63 if ( !is_numeric( $Offset ) )
64 {
65 $Offset = 0;
66 }
67
68 $GameID = $url_array[4];
69
70 if( !is_numeric( $GameID ) )
71 {
72 eZHTTPTool::header( "Location: /quiz/game/list" );
73 }
74
75 include( "kernel/ezquiz/user/quizscores.php" );
76 }
77 break;
78
79
80 case "view":
81 case "play":
82 {
83 $GameID = $url_array[4];
84
85 $user =& eZUser::currentUser();
86
87 if ( !is_a( $user, "eZUser" ) )
88 {
89 eZHTTPTool::header( "Location: /user/login?RedirectURL=" . urlencode( "/quiz/game/play/$GameID" ) );
90 }
91 else
92 {
93 // include_once( "classes/ezlocale.php" );
94 // include_once( "classes/ezdate.php" );
95 // include_once( "ezquiz/classes/ezquizgame.php" );
96
97 $game = new eZQuizGame( $GameID );
98 $gameStop = $game->stopDate();
99 $gameStart = $game->startDate();
100 $today = new eZDate();
101
102 $locale = new eZLocale( $Language );
103
104 if ( $gameStart->isGreater( $today, true ) )
105 {
106 if ( $today->isGreater( $gameStop, true ) )
107 {
108 $QuestionNum = $url_array[5];
109 if ( !is_numeric( $QuestionNum ) )
110 {
111 $QuestionNum = 0;
112 }
113
114 include( "kernel/ezquiz/user/quizplay.php" );
115 }
116 else
117 {
118 $error = "closed";
119 include( "kernel/ezquiz/user/quizplay.php" );
120 }
121 }
122 else
123 {
124 $error = "unopened";
125 include( "kernel/ezquiz/user/quizplay.php" );
126 }
127 }
128 }
129 break;
130 }
131 break;
132 }
133
134 case "my":
135 {
136 $Action = $url_array[3];
137
138 $user =& eZUser::currentUser();
139
140 if( !is_a( $user, "eZUser" ) )
141 {
142 }
143
144
145 switch ( $Action )
146 {
147 case "open":
148 case "closed":
149 {
150 $Offset = $url_array[4];
151
152 if ( !is_numeric( $Offset ) )
153 {
154 $Offset = 0;
155 }
156
157 include( "kernel/ezquiz/user/quizlist.php" );
158 }
159 break;
160
161 case "score":
162 case "scores":
163 {
164 $Offset = $url_array[4];
165
166 if ( !is_numeric( $Offset ) )
167 {
168 $Offset = 0;
169 }
170
171 include( "kernel/ezquiz/user/quizmyscores.php" );
172 }
173 break;
174 }
175 break;
176 }
177 }
178
179 ?>
$locale
$locale
Definition: admin/adlist.php:127
$today
$today
Definition: appointmentedit.php:651
eZDate
Definition: ezdate.php:46
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZLocale
Definition: ezlocale.php:119
eZQuizGame
Definition: ezquizgame.php:43
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Language
$Language
Definition: classes/admin/linklist.php:65
$Action
$Action
Definition: companysearch.php:80
$url_array
$url_array
Definition: ezaddress/admin/datasupplier.php:34
$error
$error
Definition: ezarticle/admin/categoryedit.php:51
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$GlobalSectionID
$GlobalSectionID
Definition: ezquiz/user/datasupplier.php:33
$ini
$ini
Definition: ezquiz/user/datasupplier.php:30
$PageCaching
$PageCaching
Definition: ezquiz/user/datasupplier.php:32
$game
$game
Definition: quizlist.php:60
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.