Changeset 720
- Timestamp:
- 11/17/08 22:54:09 (5 years ago)
- Location:
- de.inside.Gewinnspiel
- Files:
-
- 1 added
- 1 removed
- 11 modified
-
acptemplates/gewinnspielAdd.tpl (modified) (6 diffs)
-
de-informal.xml (modified) (1 diff)
-
de.xml (modified) (1 diff)
-
en.xml (modified) (1 diff)
-
files/icon/gewinnspielQuestionM.png (added)
-
files/icon/postNewM.png (deleted)
-
files/lib/acp/action/GewinnspielDeleteAction.class.php (modified) (3 diffs)
-
files/lib/form/GewinnspielForm.class.php (modified) (26 diffs)
-
files/lib/page/IndexPage.class.php (modified) (2 diffs)
-
files/style/competition.css (modified) (1 diff)
-
package.xml (modified) (2 diffs)
-
templates/gewinnspiel.tpl (modified) (6 diffs)
-
templates/index.tpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
de.inside.Gewinnspiel/acptemplates/gewinnspielAdd.tpl
r579 r720 49 49 </div> 50 50 <div id="gwsEdit"> 51 <fieldset class="noJavaScript">52 51 <script src="{@RELATIVE_WCF_DIR}js/Calendar.class.js" type="text/javascript"></script> 53 52 <script type="text/javascript"> … … 56 55 //]]> 57 56 </script> 58 <legend class="noJavaScript">{lang}gws.acp.data{/lang}</legend> 57 58 <fieldset class="noJavaScript"> 59 <legend class="noJavaScript">{lang}gws.acp.data{/lang}</legend> 59 60 <div class="formElement{if $errorField == 'gwsOptions'} formError{/if}"> 60 61 <div class="formFieldLabel"> … … 82 83 <div class="formGroupField"> 83 84 <fieldset> 84 <legend><label>{lang}gws.gewinnspiel.start{/lang}</label></legend>85 <legend><label>{lang}gws.gewinnspiel.start{/lang}</label></legend> 85 86 <div class="formField"> 86 87 {if $action == 'add' || $starttime >= TIME_NOW} … … 106 107 </div> 107 108 <div class="floatedElement"> 108 <a id="startButton"><img src="{@RELATIVE_WCF_DIR}icon/ calendarOptionsM.png" alt="" /></a>109 <a id="startButton"><img src="{@RELATIVE_WCF_DIR}icon/datePickerOptionsM.png" alt="" /></a> 109 110 <div id="startCalendar" class="inlineCalendar"> 110 111 </div> … … 158 159 </div> 159 160 <div class="floatedElement"> 160 <a id="timeoutButton"><img src="{@RELATIVE_WCF_DIR}icon/ calendarOptionsM.png" alt="" /></a>161 <a id="timeoutButton"><img src="{@RELATIVE_WCF_DIR}icon/datePickerOptionsM.png" alt="" /></a> 161 162 <div id="timeoutCalendar" class="inlineCalendar"></div> 162 163 <script type="text/javascript"> … … 251 252 {/foreach} 252 253 253 <fieldset> 254 <legend>{lang}gws.acp.guthaben{/lang}</legend> 255 <div class="formElement" id="money"> 256 <div class="formField"> 257 <label id="money"><input type="text" size="5" name="money" value="{$money}" /> {lang}gws.acp.money2{/lang}</label> 258 </div> 259 </div> 260 </fieldset> 254 {if $ENABLE_GUTHABEN_GLOBAL|isset} 255 <fieldset> 256 <legend>{lang}gws.acp.guthaben{/lang}</legend> 257 <div class="formElement" id="money"> 258 <div class="formField"> 259 <label id="money"><input type="text" size="5" name="money" value="{$money}" /> {lang}gws.acp.money2{/lang}</label> 260 </div> 261 </div> 262 </fieldset> 263 {/if} 261 264 262 265 <fieldset> -
de.inside.Gewinnspiel/de-informal.xml
r718 r720 138 138 <category name="gws.gewinnspiel"> 139 139 <item name="gws.gewinnspiel.offline"><![CDATA[Das Gewinnspiel befindet sich aus folgendem Grund im Watungsmodus:]]></item> 140 <item name="gws.gewinnspiel.copyhint"><![CDATA[<a href="http://www.inside-das-hoerspiel.de"> Gewinnspiel{if SHOW_VERSION_NUMBER} {@PACKAGE_VERSION}{/if}</strong>, entwickelt von <strong>INSIDE das Hörspiel</strong></a>]]></item>140 <item name="gws.gewinnspiel.copyhint"><![CDATA[<a href="http://www.inside-das-hoerspiel.de"><strong>Gewinnspiel{if SHOW_VERSION_NUMBER} {@PACKAGE_VERSION}{/if}</strong>, entwickelt von <strong>INSIDE das Hörspiel</strong></a>]]></item> 141 141 <item name="gws.gewinnspiel.title"><![CDATA[Gewinnspiel]]></item> 142 142 <item name="gws.gewinnspiel.description"><![CDATA[]]></item> 143 <item name="gws.gewinnspiel.money"><![CDATA[benötigtes Guthaben: {$gewinnspiel.money} ]]></item>143 <item name="gws.gewinnspiel.money"><![CDATA[benötigtes Guthaben: {$gewinnspiel.money} {lang}wcf.guthaben.currency{/lang}]]></item> 144 144 <item name="gws.gewinnspiel.errormoney"><![CDATA[Sie haben nicht genÌgend Guthaben um spielen zu dÌrfen.]]></item> 145 145 <item name="gws.gewinnspiel.statusmain"><![CDATA[Status]]></item> -
de.inside.Gewinnspiel/de.xml
r718 r720 138 138 <category name="gws.gewinnspiel"> 139 139 <item name="gws.gewinnspiel.offline"><![CDATA[Das Gewinnspiel befindet sich aus folgendem Grund im Watungsmodus:]]></item> 140 <item name="gws.gewinnspiel.copyhint"><![CDATA[<a href="http://www.inside-das-hoerspiel.de"> Gewinnspiel{if SHOW_VERSION_NUMBER} {@PACKAGE_VERSION}{/if}</strong>, entwickelt von <strong>INSIDE das Hörspiel</strong></a>]]></item>140 <item name="gws.gewinnspiel.copyhint"><![CDATA[<a href="http://www.inside-das-hoerspiel.de"><strong>Gewinnspiel{if SHOW_VERSION_NUMBER} {@PACKAGE_VERSION}{/if}</strong>, entwickelt von <strong>INSIDE das Hörspiel</strong></a>]]></item> 141 141 <item name="gws.gewinnspiel.title"><![CDATA[Gewinnspiel]]></item> 142 142 <item name="gws.gewinnspiel.description"><![CDATA[]]></item> 143 <item name="gws.gewinnspiel.money"><![CDATA[benötigtes Guthaben: {$gewinnspiel.money} ]]></item>143 <item name="gws.gewinnspiel.money"><![CDATA[benötigtes Guthaben: {$gewinnspiel.money} {lang}wcf.guthaben.currency{/lang}]]></item> 144 144 <item name="gws.gewinnspiel.errormoney"><![CDATA[Sie haben nicht genÌgend Guthaben um spielen zu dÌrfen.]]></item> 145 145 <item name="gws.gewinnspiel.statusmain"><![CDATA[Status]]></item> -
de.inside.Gewinnspiel/en.xml
r718 r720 72 72 <category name="gws.gewinnspiel"> 73 73 <item name="gws.gewinnspiel.offline"><![CDATA[Das Gewinnspiel befindet sich aus folgendem Grund im Watungsmodus:]]></item> 74 <item name="gws.gewinnspiel.copyhint"><![CDATA[<a href="http://www.inside-das-hoerspiel.de"> Gewinnspiel{if SHOW_VERSION_NUMBER} {@PACKAGE_VERSION}{/if}</strong>, by <strong>INSIDE das Hörspiel</strong></a>]]></item>74 <item name="gws.gewinnspiel.copyhint"><![CDATA[<a href="http://www.inside-das-hoerspiel.de"><strong>Gewinnspiel{if SHOW_VERSION_NUMBER} {@PACKAGE_VERSION}{/if}</strong>, by <strong>INSIDE das Hörspiel</strong></a>]]></item> 75 75 <item name="gws.gewinnspiel.title"><![CDATA[Competition]]></item> 76 76 <item name="gws.gewinnspiel.description"><![CDATA[]]></item> 77 <item name="gws.gewinnspiel.money"><![CDATA[required money: {$gewinnspiel.money} ]]></item>77 <item name="gws.gewinnspiel.money"><![CDATA[required money: {$gewinnspiel.money} {lang}wcf.guthaben.currency{/lang}]]></item> 78 78 <item name="gws.gewinnspiel.errormoney"><![CDATA[You do not have sufficient assets, so you can not play.]]></item> 79 79 <item name="gws.gewinnspiel.statusmain"><![CDATA[Status]]></item> -
de.inside.Gewinnspiel/files/lib/acp/action/GewinnspielDeleteAction.class.php
r718 r720 1 1 <?php 2 2 require_once(WCF_DIR.'lib/action/AbstractAction.class.php'); 3 // gwsp imports 4 require_once(GWSP_DIR.'lib/data/competition/CompetitionGame.class.php'); 3 5 4 6 /** … … 20 22 parent::readParameters(); 21 23 22 if (isset($_REQUEST['gwspID'])) $this->gwspID = intval($_REQUEST['gwspID']); 24 if (isset($_REQUEST['gwsID'])) $this->gwsID = intval($_REQUEST['gwsID']); 25 if (!$this->gwsID){ 26 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 27 throw new NamedUserException(GWSPACP::getLanguage()->get('gws.gewinnspiel.wrongid')); 28 exit; 29 } 23 30 } 24 31 … … 28 35 public function execute() { 29 36 parent::execute(); 30 31 37 // delete game 32 $sql = "DELETE FROM gwsp".GWSP_N."_game 33 WHERE gwsID = ".$this->gwspID; 34 WCF::getDB()->sendQuery($sql); 35 $sql = "DELETE FROM gwsp".GWSP_N."_options 36 WHERE gwsID = ".$this->gwspID; 37 WCF::getDB()->sendQuery($sql); 38 $sql = "DELETE FROM gwsp".GWSP_N."_spiel 39 WHERE gwsID = ".$this->gwspID; 40 WCF::getDB()->sendQuery($sql); 41 // reset cache 42 GWSPACP::getCache()->clearResource('competition-games-'.PACKAGE_ID); 43 GWSPACP::getCache()->clearResource('competition-user-'.PACKAGE_ID); 38 // new game object 39 $game = new CompetitionGame($this->gwsID); 40 $game->delete(); 41 // $sql = "DELETE FROM gwsp".GWSP_N."_game 42 // WHERE gwsID = ".$this->gwspID; 43 // WCF::getDB()->sendQuery($sql); 44 // $sql = "DELETE FROM gwsp".GWSP_N."_options 45 // WHERE gwsID = ".$this->gwspID; 46 // WCF::getDB()->sendQuery($sql); 47 // $sql = "DELETE FROM gwsp".GWSP_N."_spiel 48 // WHERE gwsID = ".$this->gwspID; 49 // WCF::getDB()->sendQuery($sql); 50 // // reset cache 51 // GWSPACP::getCache()->clearResource('competition-games-'.PACKAGE_ID); 52 // GWSPACP::getCache()->clearResource('competition-user-'.PACKAGE_ID); 44 53 // forward to list page 45 header('Location: index.php?page=GewinnspielList&deletedgwsID='.$this->gws pID.'&packageID='.PACKAGE_ID.SID_ARG_2ND_NOT_ENCODED);54 header('Location: index.php?page=GewinnspielList&deletedgwsID='.$this->gwsID.'&packageID='.PACKAGE_ID.SID_ARG_2ND_NOT_ENCODED); 46 55 exit; 47 56 } -
de.inside.Gewinnspiel/files/lib/form/GewinnspielForm.class.php
r718 r720 1 1 <?php 2 // wcf imports3 require_once(WCF_DIR.'lib/acp/form/UserAddForm.class.php');4 require_once(WCF_DIR.'lib/data/user/UserEditor.class.php');5 require_once(WCF_DIR.'lib/page/AbstractPage.class.php');6 require_once(WCF_DIR.'lib/acp/form/UserOptionListForm.class.php');7 2 require_once(WCF_DIR.'lib/form/AbstractForm.class.php'); 8 require_once(WCF_DIR.'lib/form/MessageForm.class.php'); 3 4 // gwsp imports 5 require_once(GWSP_DIR.'lib/data/competition/CompetitionGame.class.php'); 6 9 7 10 8 /* … … 24 22 public $templateName = 'gewinnspiel'; 25 23 // Gewinnspiel und Teilnehmer Daten 26 public $gwsID; // Game ID 27 public $gwsTitel; // Titel 28 public $gwsStart; // Startzeit 29 public $gwsEnde; // Endzeit 30 public $gwsOptionsArray = array (); // Die Fragen 31 public $regeln; // Gewinnspiel Regeln 32 public $datenschutz; // Datenschutzerklrung 33 public $beschreibung; // Beschreibung des Gewinnspiels 24 public $game; // Game object 25 public $gwsID; // Game id 26 public $gwsOptionsArray = array (); // the Questions 34 27 public $gwsGroupIDs = array(); // Berechtigte Gruppen 35 public $money; // Kosten fr die Teilnahme36 28 public $userreal; // aktueller Teilnehmer Name 37 29 public $username; // aktueller Teilnehmer Nick … … 39 31 public $useremailconfirm; // E-Mail Kontrolle 40 32 public $useraddr; // Anschrift des Teilnehmers 41 public $ipAddress = 0; // IP des Teilnehmers42 public $usercount = 5;// Anzahl der User die bereits mitgemacht haben33 public $ipAddress = 0; // IP des Teilnehmers 34 public $usercount; // Anzahl der User die bereits mitgemacht haben 43 35 public $answer = array(); // Die Antworten 44 // Voreinstellungen f r die Textausgabe36 // Voreinstellungen fuer die Textausgabe 45 37 private $enableSmilies = true; 46 38 private $enableBBCodes = true; 47 39 protected $akzept; // auf "AKZEPTIERT" testen 48 protected $valid = false; // Variable zu G ltikeitsberprfung49 protected $ empfnger; // Empfnger zur Auswertung50 protected $frageantwort = ''; // Die Fragen und Antworten f r die Mail40 protected $valid = false; // Variable zu Gueltikeitsberpruefung 41 protected $recipient; // Empfaenger zur Auswertung 42 protected $frageantwort = ''; // Die Fragen und Antworten fuer die Mail 51 43 52 44 /** … … 58 50 // get game id 59 51 if (isset($_REQUEST['gwsID'])) $this->gwsID = intval($_REQUEST['gwsID']); 60 // Sicherheitsabfrage ob ID bergeben wurde52 // game id OK? 61 53 if (!$this->gwsID){ 62 54 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); … … 64 56 exit; 65 57 } 66 // Teilnahmeberechtigung prfen 58 // new game object 59 $this->game = new CompetitionGame($this->gwsID); 60 61 // check game permissions 67 62 $this->checkPermissions(); 68 63 … … 75 70 parent::readFormParameters(); 76 71 77 if (isset($_POST['gwsID'])) $this->gwsID = intval($_ REQUEST['gwsID']);78 if (isset($_POST['gwsTitel'])) $this->gwsTitel = escapeString($_ REQUEST['gwsTitel']);72 if (isset($_POST['gwsID'])) $this->gwsID = intval($_POST['gwsID']); 73 if (isset($_POST['gwsTitel'])) $this->gwsTitel = escapeString($_POST['gwsTitel']); 79 74 if (isset($_POST['useremail'])) $this->useremail = StringUtil::trim($_POST['useremail']); 80 75 if (isset($_POST['useremailconfirm'])) $this->useremailconfirm = StringUtil::trim($_POST['useremailconfirm']); … … 93 88 public function validate() { 94 89 95 // E-Mail prfen96 // email angegeben?90 // check E-Mail 91 // email input OK? 97 92 if (empty($this->useremail)) { 98 93 throw new UserInputException('useremail', 'empty'); 99 94 } 100 // validateEmail angegeben?95 // validateEmail input OK? 101 96 if (empty($this->useremailconfirm)) { 102 97 throw new UserInputException('useremailconfirm', 'empty'); … … 110 105 throw new UserInputException('useremailconfirm', 'notEqual'); 111 106 } 112 // Realname angegeben?107 // Realname input valid? 113 108 if (empty($this->userreal)) { 114 109 throw new UserInputException('userreal', 'empty'); 115 110 } 116 // Adresse angegeben ?111 // check for valid address 117 112 if (empty($this->useraddr)) { 118 113 throw new UserInputException('useraddr', 'empty'); 119 114 } 120 // Sind alle Fragen beantwortet worden?115 // All questions answerd? 121 116 foreach ($this->answer as $key => $nummer){ 122 117 if (empty($nummer)){ 123 $ fehler= "answer[".$key."]";124 throw new UserInputException($ fehler, 'empty');125 } 126 } 127 // Regeln Akzeptiert?118 $notok = "answer[".$key."]"; 119 throw new UserInputException($notok, 'empty'); 120 } 121 } 122 // rules accepted? 128 123 if (empty($this->akzept) || $this->akzept != 'AKZEPTIERT') { 129 124 throw new UserInputException('akzept', 'empty'); … … 135 130 $sql = "SELECT `ipaddress`, `email`, `realName` 136 131 FROM gwsp".GWSP_N."_spiel 137 WHERE `gwsID` = $this->gwsIDAND `userID` = 0";132 WHERE `gwsID` = ".$this->game->gwsID." AND `userID` = 0"; 138 133 $result = GWSPCore::getDB()->sendQuery($sql); 139 134 while ($row = GWSPCore::getDB()->fetchArray($result)) { … … 143 138 } 144 139 if (!empty($ipArray)){ 145 foreach ($ipArray as $key => $option){140 foreach ($ipArray as $key => $option){ 146 141 if (StringUtil::toLowerCase($mailArray[$key]) == StringUtil::toLowerCase($this->useremail) || StringUtil::toLowerCase($rnArray[$key]) == StringUtil::toLowerCase($this->userreal)){ 147 142 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); … … 165 160 $sql = "INSERT INTO gwsp".GWSP_N."_spiel 166 161 (gwsID, userID, ipaddress, email, realName) 167 VALUES (".intval($this->g wsID).",162 VALUES (".intval($this->game->gwsID).", 168 163 ".intval(GWSPCore::getUser()->userID).", 169 164 '".escapeString(GWSPCore::getSession()->ipAddress)."', … … 175 170 $sql = "SELECT `recipient` 176 171 FROM gwsp".GWSP_N."_game 177 WHERE gwsID = $this->gwsID";172 WHERE gwsID = ".$this->game->gwsID; 178 173 $result = GWSPCore::getDB()->getFirstRow($sql); 179 $this-> empfnger= $result['recipient'];174 $this->recipient = $result['recipient']; 180 175 // E-Mail vorbeiten und senden 181 176 if (!$this->username) $this->username = 'Gast'; … … 183 178 $sql = "SELECT * 184 179 FROM gwsp".GWSP_N."_options 185 WHERE gwsID = ".$this->g wsID."180 WHERE gwsID = ".$this->game->gwsID." 186 181 ORDER BY showOrder"; 187 182 $result = GWSPCore::getDB()->sendQuery($sql); … … 208 203 '$useremail' => $this->useremail, 209 204 '$useraddr' => $this->useraddr, 210 '$recipient' => $this-> empfnger,205 '$recipient' => $this->recipient, 211 206 '$FrageAntwort' => $this->frageantwort, 212 207 '$datetime' => $this->getTimeDate() … … 218 213 $mail->send(); 219 214 // Mail an den Veranstalter 220 $mail = new Mail( $this-> empfnger,215 $mail = new Mail( $this->recipient, 221 216 $languages[GWSPCore::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.subject.recipient', $subjectData), 222 217 $languages[GWSPCore::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.message.recipient', $messageData)); … … 252 247 } 253 248 } 249 254 250 // Gewinnspiel Daten auslesen 255 251 $this->readGewinnspiel(); … … 263 259 264 260 GWSPCore::getTPL()->assign(array( 265 'gwsID' => $this->gwsID, 266 'gwsTitel' => $this->gwsTitel, 267 'regeln' => $this->regeln, 268 'beschreibung' => $this->beschreibung, 269 'datenschutz' => $this->datenschutz, 270 'username' => $this->username, 271 'useremail' => $this->useremail, 261 'game' => $this->game, 262 'username' => $this->username, 263 'useremail' => $this->useremail, 272 264 'useremailconfirm' => $this->useremailconfirm, 273 'userreal' => $this->userreal,274 'useraddr' => $this->useraddr,275 'usercount' => $this->usercount,265 'userreal' => $this->userreal, 266 'useraddr' => $this->useraddr, 267 'usercount' => $this->usercount, 276 268 'gwsOptionsArray' => $this->gwsOptionsArray, 277 'answer' => $this->answer,278 'akzept' => $this->akzept,269 'answer' => $this->answer, 270 'akzept' => $this->akzept, 279 271 )); 280 272 } … … 291 283 292 284 protected function checkPermissions() { 293 // Kontrolle ob User schon teilgenommen hat (nicht bei G sten)285 // Kontrolle ob User schon teilgenommen hat (nicht bei Gaesten) 294 286 $id = GWSPCore::getUser()->userID; 295 287 if ($id){ 296 288 $sql = "SELECT COUNT(userID) AS users 297 289 FROM gwsp".GWSP_N."_spiel 298 WHERE gwsID = '.$this->gwsID.' AND userID = '.$id.'";290 WHERE `gwsID` = ".$this->game->gwsID." AND `userID` = ".$id; 299 291 $row = GWSPCore::getDB()->getFirstRow($sql); 300 292 if ($row['users']) { … … 307 299 $sql = "SELECT `groupIDs` 308 300 FROM gwsp".GWSP_N."_game 309 WHERE gwsID = $this->gwsID";301 WHERE gwsID = ".$this->game->gwsID; 310 302 $result = GWSPCore::getDB()->sendQuery($sql); 311 303 $row = GWSPCore::getDB()->fetchArray($result); 312 // Keine gltige GameID angegeben?304 // gwsID valid? 313 305 if(empty($row)){ 314 306 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); … … 316 308 exit; 317 309 } 318 $this->gwsGroupIDs = explode(',', $row['groupIDs']);310 $this->gwsGroupIDs = explode(',', $row['groupIDs']); 319 311 require_once(WCF_DIR.'lib/data/user/group/Group.class.php'); 320 312 $canplay = false; … … 322 314 if (Group::isMember($groupID)) $canplay = true; 323 315 } 324 // Fehlermeldung wenn Teilnemer keiner Berechtigten Gruppe angeh rt316 // Fehlermeldung wenn Teilnemer keiner Berechtigten Gruppe angehoert 325 317 if (!$canplay) { 326 318 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); … … 331 323 protected function readGewinnspiel() { 332 324 // get game 333 $sql = "SELECT * 334 FROM gwsp".GWSP_N."_game gewinnspiel 335 WHERE gwsID = ".$this->gwsID; 336 $row = GWSPCore::getDB()->getFirstRow($sql); 337 $this->gwsID = $row['gwsID']; 338 $this->gwsTitel = $row['gwsTitel']; 339 $this->gwsStart = $row['starttime']; 340 $this->gwsEnde = $row['timeout']; 341 $this->recipient = $row['recipient']; 342 $this->regeln = $this->getFormattedMessage($row['regeln'], false); 343 $this->datenschutz = $this->getFormattedMessage($row['discl'], false); 344 $this->beschreibung = $this->getFormattedMessage($row['beschreib'], false); 345 $this->groupIDs = $row['groupIDs']; 346 $this->money = $row['money']; 347 325 $this->game->rules = $this->getFormattedMessage($this->game->rules, false); 326 $this->game->disclaimer = $this->getFormattedMessage($this->game->disclaimer, false); 327 $this->game->description = $this->getFormattedMessage($this->game->description, false); 328 //Check Guthaben 348 329 if (defined('GUTHABEN_ENABLE_GLOBAL')){ 349 if(GWSPCore::getUser()->userID && $this-> money >= 1) {330 if(GWSPCore::getUser()->userID && $this->game->money >= 1) { 350 331 require_once(WCF_DIR.'lib/data/user/UserGuthaben.class.php'); 351 332 $um = new UserGuthaben(GWSPCore::getUser()->userID); 352 if (!$um->subGuthaben($this-> money,'gws.gewinnspiel.kosten')) {333 if (!$um->subGuthaben($this->game->money,'gws.gewinnspiel.kosten')) { 353 334 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 354 335 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.errormoney')); … … 357 338 } 358 339 // Kontrolle ob das Gewinnspiel schon gestartet ist 359 if ($this->g wsStart> TIME_NOW) {340 if ($this->game->starttime > TIME_NOW) { 360 341 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 361 342 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.statustocome')); … … 363 344 } 364 345 // Kontrolle ob das Gewinnspiel schon beendet ist 365 if ($this->g wsEnde< TIME_NOW) {346 if ($this->game->timeout < TIME_NOW) { 366 347 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 367 348 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.statusended')); … … 369 350 } 370 351 // get game options 371 $sql = "SELECT * 372 FROM gwsp".GWSP_N."_options 373 WHERE gwsID = ".$this->gwsID." 374 ORDER BY showOrder"; 375 $result = GWSPCore::getDB()->sendQuery($sql); 376 while ($row = GWSPCore::getDB()->fetchArray($result)) { 377 $titel = $this->getFormattedMessage($row['gwsOption'], true); 378 $this->gwsOptionsArray[] .= "$titel"; 379 } 352 $this->gwsOptionsArray = $this->game->getQuestions(); 353 foreach ($this->gwsOptionsArray as $key => $val){ 354 $this->gwsOptionsArray[$key] = $this->getFormattedMessage($this->gwsOptionsArray[$key], true); 355 } 356 // for the first time clear answers 380 357 if (empty($this->answer)){ 381 358 foreach ($this->gwsOptionsArray as $key => $nummer){ … … 383 360 } 384 361 } 385 // Anzahl der User die schon Teilgenommen haben 386 $sql = "SELECT COUNT(userID) AS userID 387 FROM gwsp".GWSP_N."_spiel 388 WHERE gwsID = ".$this->gwsID; 389 $row = GWSPCore::getDB()->getFirstRow($sql); 390 $this->usercount = $row['userID']; 362 // count users 363 $this->usercount = $this->game->countUsers(); 391 364 } 392 365 -
de.inside.Gewinnspiel/files/lib/page/IndexPage.class.php
r718 r720 9 9 * Gewinnspiel (noch) aktuell ist. Abgelaufene Spiele und Gewinnspiele zu 10 10 * denen man keine Berechtigung hat werden entsprechend gekennzeichnet. 11 * Die Tabelle kann sortiert werden. 11 12 * @author Robert "Tatzelwurm" Hempel 12 13 * @copyright 2007/2008 INSIDE das Hörspiel … … 18 19 19 20 public $templateName = 'index'; 20 public $itemsPerPage = 10;21 21 public $gwsID; 22 22 public $gwsGroupIDs = array(); -
de.inside.Gewinnspiel/files/style/competition.css
r661 r720 58 58 } 59 59 60 .gwspContainerHead { 61 padding: 2px 5px; 62 text-align:center; 63 } 64 60 65 /* ### -- -- -- -- -- EOF -- -- -- -- -- ### */ -
de.inside.Gewinnspiel/package.xml
r718 r720 11 11 <packageurl><![CDATA[http://community.woltlab.com/db/index.php?page=Project&projectID=593]]></packageurl> 12 12 <standalone>1</standalone> 13 <version> 1.0.0 RC 1</version>14 <date> DATE</date>13 <version>2.0.0 RC 1</version> 14 <date>2008-11-17</date> 15 15 </packageinformation> 16 16 17 17 <authorInformation> 18 <author>Robert "Tat elwurm" Hempel</author>18 <author>Robert "Tatzelwurm" Hempel</author> 19 19 <authorURL>http://www.inside-das-hoerspiel.de</authorURL> 20 20 </authorInformation> 21 21 22 22 <requiredpackages> 23 <!-- <requiredpackage minversion="1.5.0" file="http://community.woltlab.com/db/packages/index.php?packageName=de.inside.wcf.gamemenue">de.inside.wcf.gamemenue</requiredpackage> -->24 23 25 24 <!-- Pakete unter LGPL --> … … 49 48 <languages languagecode="de-informal">de-informal.xml</languages> 50 49 <!-- <languages languagecode="en">en.xml</languages> --> 50 <!-- <languages languagecode="hr">hr.xml</languages> --> 51 <!-- <languages languagecode="fr">fr.xml</languages> --> 51 52 <acpmenu>acpmenu.xml</acpmenu> 52 53 <options>options.xml</options> -
de.inside.Gewinnspiel/templates/gewinnspiel.tpl
r661 r720 1 1 {include file="documentHeader"} 2 2 <head> 3 <title>{@$g wsTitel} - {lang}gws.gewinnspiel.title{/lang} - {PAGE_TITLE}</title>3 <title>{@$game->gwsTitel} - {lang}gws.gewinnspiel.title{/lang} - {PAGE_TITLE}</title> 4 4 {include file='headInclude' sandbox=false} 5 5 <link rel="alternate" type="application/rss+xml" href="index.php?page=Feed&type=RSS2" title="RSS2" /> … … 10 10 11 11 <div id="main"> 12 <ul class="breadCrumbs">13 <li><a href="index.php?page=Index{@SID_ARG_2ND}"><img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielS.png" alt="" /> <span>{lang}gws.gewinnspiel.title{/lang}</span></a> »</li>14 <li><a href="index.php?form=Gewinnspiel&gwsID={$gwsID}{@SID_ARG_2ND}"><img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielS.png" alt="" /> <span>{@$gwsTitel}</span></a> »</li>15 </ul>16 12 17 13 <div class="mainHeadline"> 18 14 <img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielL.png" alt="" /> 19 15 <div class="headlineContainer"> 20 <h2>{ PAGE_TITLE} {lang}gws.gewinnspiel.title{/lang}</h2>16 <h2>{lang}{@$game->gwsTitel}{/lang}</h2> 21 17 <p>{lang}gws.gewinnspiel.usercount{/lang}</p> 22 18 </div> 23 19 </div> 24 {if $errorField} 25 <p class="error">{lang}wcf.global.form.error{/lang}</p> 26 { /if}20 21 {if $userMessages|isset}{@$userMessages}{/if} 22 {if $errorField}<p class="error">{lang}wcf.global.form.error{/lang}</p> {/if} 27 23 28 24 <form method="post" action="index.php?form=Gewinnspiel"> 29 25 <div class="border content"> 30 <div class="containerHead " align="center"><b>{@$gwsTitel}</b></div>31 {if $ beschreibung}26 <div class="containerHead gwspContainerHead" align="center"><b>{@$game->gwsTitel}</b></div> 27 {if $game->description} 32 28 <div class="container-1"> 33 <div class="messageContainer">{@$ beschreibung}</div>29 <div class="messageContainer">{@$game->description}</div> 34 30 </div> 35 31 {/if} … … 37 33 38 34 <div class="border content"> 39 <div class="containerHead " align="center"><b>{lang}gws.gewinnspiel.hinweis1{/lang}</b></div>35 <div class="containerHead gwspContainerHead"><b>{lang}gws.gewinnspiel.hinweis1{/lang}</b></div> 40 36 <div class="container-1"> 41 37 <fieldset> … … 135 131 <div class="container-1"> 136 132 <div class="containerIcon"> 137 <img src="{@RELATIVE_GWSP_DIR}icon/ postNewM.png" alt="" />133 <img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielQuestionM.png" alt="" /> 138 134 </div> 139 135 <div class="formElement{if $errorField == "answer[$order]"} formError{/if}"> … … 151 147 {/foreach} 152 148 153 {if $ regeln}149 {if $game->rules} 154 150 <div class="border content"> 155 <div class="containerHead " align="center"><b>{lang}gws.gewinnspiel.regeln{/lang}</b></div>151 <div class="containerHead gwspContainerHead"><b>{lang}gws.gewinnspiel.regeln{/lang}</b></div> 156 152 <div class="container-1"> 157 <div class="messageContainer">{@$ regeln}</div>153 <div class="messageContainer">{@$game->rules}</div> 158 154 </div> 159 155 </div> 160 156 {/if} 161 {if $ datenschutz}157 {if $game->disclaimer} 162 158 <div class="border content"> 163 <div class="containerHead " align="center"><b>{lang}gws.gewinnspiel.datenschutz{/lang}</b></div>159 <div class="containerHead gwspContainerHead"><b>{lang}gws.gewinnspiel.datenschutz{/lang}</b></div> 164 160 <div class="container-1"> 165 <div class="messageContainer">{@$ datenschutz}</div>161 <div class="messageContainer">{@$game->disclaimer}</div> 166 162 </div> 167 163 </div> … … 184 180 <input type="submit" name="send" accesskey="s" value="{lang}wcf.global.button.submit{/lang}" /> 185 181 <input type="reset" name="reset" accesskey="r" value="{lang}wcf.global.button.reset{/lang}" /> 186 <input type="hidden" name="gwsID" value="{@$g wsID}" />182 <input type="hidden" name="gwsID" value="{@$game->gwsID}" /> 187 183 </div> 188 184 {@SID_INPUT_TAG} -
de.inside.Gewinnspiel/templates/index.tpl
r718 r720 47 47 <td class="gwspColumnMarkContent"> 48 48 <b>{@$gewinnspiel.gwsTitel}</b> 49 {if $gewinnspiel.money }<br />{lang}gws.gewinnspiel.money{/lang}{/if}49 {if $gewinnspiel.money && $ENABLE_GUTHABEN_GLOBAL}<br />{lang}gws.gewinnspiel.money{/lang}{/if} 50 50 </td> 51 51 <td class="gwspColumnDatum"> … … 80 80 </div> 81 81 </div> 82 {include file='footer' sandbox= false}82 {include file='footer' sandbox=true} 83 83 </div> 84 84
