Changeset 720

Show
Ignore:
Timestamp:
11/17/08 22:54:09 (5 years ago)
Author:
Tatzelwurm
Message:

New Version.
New class, Gewinnspiel.Form object oriented.
Need help to translate en.xml and other languages.

Location:
de.inside.Gewinnspiel
Files:
1 added
1 removed
11 modified

Legend:

Unmodified
Added
Removed
  • de.inside.Gewinnspiel/acptemplates/gewinnspielAdd.tpl

    r579 r720  
    4949                </div> 
    5050                <div id="gwsEdit"> 
    51                         <fieldset class="noJavaScript"> 
    5251                        <script src="{@RELATIVE_WCF_DIR}js/Calendar.class.js" type="text/javascript"></script> 
    5352                        <script type="text/javascript"> 
     
    5655                                //]]> 
    5756                        </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> 
    5960                                <div class="formElement{if $errorField == 'gwsOptions'} formError{/if}"> 
    6061                                        <div class="formFieldLabel"> 
     
    8283                                        <div class="formGroupField"> 
    8384                                                <fieldset> 
    84                                                 <legend><label>{lang}gws.gewinnspiel.start{/lang}</label></legend> 
     85                                                        <legend><label>{lang}gws.gewinnspiel.start{/lang}</label></legend> 
    8586                                                        <div class="formField"> 
    8687                                                        {if $action == 'add' || $starttime >= TIME_NOW} 
     
    106107                                                                </div> 
    107108                                                                <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> 
    109110                                                                        <div id="startCalendar" class="inlineCalendar"> 
    110111                                                                        </div> 
     
    158159                                                                </div> 
    159160                                                                <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> 
    161162                                                                        <div id="timeoutCalendar" class="inlineCalendar"></div> 
    162163                                                                        <script type="text/javascript"> 
     
    251252                        {/foreach} 
    252253                                                 
    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} 
    261264 
    262265                        <fieldset> 
  • de.inside.Gewinnspiel/de-informal.xml

    r718 r720  
    138138        <category name="gws.gewinnspiel"> 
    139139                <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> 
    141141                <item name="gws.gewinnspiel.title"><![CDATA[Gewinnspiel]]></item> 
    142142                <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> 
    144144                <item name="gws.gewinnspiel.errormoney"><![CDATA[Sie haben nicht genÃŒgend Guthaben um spielen zu dÃŒrfen.]]></item> 
    145145                <item name="gws.gewinnspiel.statusmain"><![CDATA[Status]]></item> 
  • de.inside.Gewinnspiel/de.xml

    r718 r720  
    138138        <category name="gws.gewinnspiel"> 
    139139                <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> 
    141141                <item name="gws.gewinnspiel.title"><![CDATA[Gewinnspiel]]></item> 
    142142                <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> 
    144144                <item name="gws.gewinnspiel.errormoney"><![CDATA[Sie haben nicht genÃŒgend Guthaben um spielen zu dÃŒrfen.]]></item> 
    145145                <item name="gws.gewinnspiel.statusmain"><![CDATA[Status]]></item> 
  • de.inside.Gewinnspiel/en.xml

    r718 r720  
    7272        <category name="gws.gewinnspiel"> 
    7373                <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> 
    7575                <item name="gws.gewinnspiel.title"><![CDATA[Competition]]></item> 
    7676                <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> 
    7878                <item name="gws.gewinnspiel.errormoney"><![CDATA[You do not have sufficient assets, so you can not play.]]></item> 
    7979                <item name="gws.gewinnspiel.statusmain"><![CDATA[Status]]></item> 
  • de.inside.Gewinnspiel/files/lib/acp/action/GewinnspielDeleteAction.class.php

    r718 r720  
    11<?php 
    22require_once(WCF_DIR.'lib/action/AbstractAction.class.php'); 
     3// gwsp imports 
     4require_once(GWSP_DIR.'lib/data/competition/CompetitionGame.class.php'); 
    35 
    46/** 
     
    2022                parent::readParameters(); 
    2123                 
    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                } 
    2330        } 
    2431         
     
    2835        public function execute() { 
    2936                parent::execute(); 
    30                  
    3137                // 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); 
    4453                // forward to list page 
    45                 header('Location: index.php?page=GewinnspielList&deletedgwsID='.$this->gwspID.'&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); 
    4655                exit; 
    4756        } 
  • de.inside.Gewinnspiel/files/lib/form/GewinnspielForm.class.php

    r718 r720  
    11<?php 
    2 // wcf imports 
    3 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'); 
    72require_once(WCF_DIR.'lib/form/AbstractForm.class.php'); 
    8 require_once(WCF_DIR.'lib/form/MessageForm.class.php'); 
     3 
     4// gwsp imports 
     5require_once(GWSP_DIR.'lib/data/competition/CompetitionGame.class.php'); 
     6 
    97 
    108/* 
     
    2422        public $templateName = 'gewinnspiel'; 
    2523        // 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 
    3427        public $gwsGroupIDs = array();          // Berechtigte Gruppen 
    35         public $money;                                          // Kosten fr die Teilnahme 
    3628        public $userreal;                                       // aktueller Teilnehmer Name 
    3729        public $username;                                       // aktueller Teilnehmer Nick 
     
    3931        public $useremailconfirm;                       // E-Mail Kontrolle 
    4032        public $useraddr;                                       // Anschrift des Teilnehmers 
    41         public $ipAddress = 0;                                  // IP des Teilnehmers 
    42         public $usercount = 5;                          // Anzahl der User die bereits mitgemacht haben 
     33        public $ipAddress = 0;                          // IP des Teilnehmers 
     34        public $usercount;                                      // Anzahl der User die bereits mitgemacht haben 
    4335        public $answer = array();                       // Die Antworten 
    44         // Voreinstellungen fr die Textausgabe 
     36        // Voreinstellungen fuer die Textausgabe 
    4537        private $enableSmilies = true; 
    4638        private $enableBBCodes = true; 
    4739        protected $akzept;                                      // auf "AKZEPTIERT" testen 
    48         protected $valid = false;                       // Variable zu Gltikeitsberprfung 
    49         protected $empfnger;                            // Empfnger zur Auswertung 
    50         protected $frageantwort = '';           // Die Fragen und Antworten fr die Mail 
     40        protected $valid = false;                       // Variable zu Gueltikeitsberpruefung 
     41        protected $recipient;                           // Empfaenger zur Auswertung 
     42        protected $frageantwort = '';           // Die Fragen und Antworten fuer die Mail 
    5143         
    5244        /** 
     
    5850                // get game id 
    5951                if (isset($_REQUEST['gwsID'])) $this->gwsID = intval($_REQUEST['gwsID']); 
    60                 // Sicherheitsabfrage ob ID bergeben wurde 
     52                // game id OK? 
    6153                if (!$this->gwsID){ 
    6254                        require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 
     
    6456                        exit; 
    6557                } 
    66                 // Teilnahmeberechtigung prfen 
     58                // new game object 
     59                $this->game = new CompetitionGame($this->gwsID); 
     60 
     61                // check game permissions 
    6762                $this->checkPermissions(); 
    6863 
     
    7570                parent::readFormParameters(); 
    7671 
    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']); 
    7974                if (isset($_POST['useremail']))                 $this->useremail                = StringUtil::trim($_POST['useremail']); 
    8075                if (isset($_POST['useremailconfirm']))  $this->useremailconfirm = StringUtil::trim($_POST['useremailconfirm']); 
     
    9388        public function validate() { 
    9489 
    95                 // E-Mail prfen 
    96                 // email angegeben ? 
     90                // check E-Mail 
     91                // email input OK? 
    9792                if (empty($this->useremail)) {   
    9893                        throw new UserInputException('useremail', 'empty'); 
    9994                } 
    100                 // validateEmail angegeben ? 
     95                // validateEmail input OK? 
    10196                if (empty($this->useremailconfirm)) {    
    10297                        throw new UserInputException('useremailconfirm', 'empty'); 
     
    110105                        throw new UserInputException('useremailconfirm', 'notEqual'); 
    111106                } 
    112                 // Realname angegeben ? 
     107                // Realname input valid? 
    113108                if (empty($this->userreal)) {    
    114109                        throw new UserInputException('userreal', 'empty'); 
    115110                } 
    116                 // Adresse angegeben ? 
     111                // check for valid address 
    117112                if (empty($this->useraddr)) {    
    118113                        throw new UserInputException('useraddr', 'empty'); 
    119114                } 
    120                 // Sind alle Fragen beantwortet worden? 
     115                // All questions answerd? 
    121116                foreach ($this->answer as $key => $nummer){ 
    122117                        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? 
    128123                if (empty($this->akzept) || $this->akzept != 'AKZEPTIERT') {     
    129124                        throw new UserInputException('akzept', 'empty'); 
     
    135130                        $sql = "SELECT  `ipaddress`, `email`, `realName` 
    136131                                        FROM    gwsp".GWSP_N."_spiel 
    137                                         WHERE   `gwsID` = $this->gwsID AND `userID` = 0"; 
     132                                        WHERE   `gwsID` = ".$this->game->gwsID." AND `userID` = 0"; 
    138133                        $result = GWSPCore::getDB()->sendQuery($sql); 
    139134                        while ($row = GWSPCore::getDB()->fetchArray($result)) { 
     
    143138                        } 
    144139                        if (!empty($ipArray)){ 
    145                                 foreach ($ipArray as $key =>$option){ 
     140                                foreach ($ipArray as $key => $option){ 
    146141                                        if (StringUtil::toLowerCase($mailArray[$key]) == StringUtil::toLowerCase($this->useremail) || StringUtil::toLowerCase($rnArray[$key]) == StringUtil::toLowerCase($this->userreal)){ 
    147142                                                require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 
     
    165160                        $sql = "INSERT INTO     gwsp".GWSP_N."_spiel 
    166161                                        (gwsID, userID, ipaddress, email, realName) 
    167                                         VALUES  (".intval($this->gwsID).", 
     162                                        VALUES  (".intval($this->game->gwsID).", 
    168163                                                        ".intval(GWSPCore::getUser()->userID).", 
    169164                                                        '".escapeString(GWSPCore::getSession()->ipAddress)."', 
     
    175170                        $sql = "SELECT  `recipient` 
    176171                                        FROM    gwsp".GWSP_N."_game 
    177                                         WHERE   gwsID = $this->gwsID"; 
     172                                        WHERE   gwsID = ".$this->game->gwsID; 
    178173                        $result = GWSPCore::getDB()->getFirstRow($sql); 
    179                         $this->empfnger = $result['recipient']; 
     174                        $this->recipient = $result['recipient']; 
    180175                        // E-Mail vorbeiten und senden 
    181176                        if (!$this->username) $this->username = 'Gast'; 
     
    183178                        $sql = "SELECT          * 
    184179                                        FROM            gwsp".GWSP_N."_options 
    185                                         WHERE           gwsID = ".$this->gwsID." 
     180                                        WHERE           gwsID = ".$this->game->gwsID." 
    186181                                        ORDER BY        showOrder"; 
    187182                        $result = GWSPCore::getDB()->sendQuery($sql); 
     
    208203                                        '$useremail' => $this->useremail, 
    209204                                        '$useraddr' => $this->useraddr, 
    210                                         '$recipient' => $this->empfnger, 
     205                                        '$recipient' => $this->recipient, 
    211206                                        '$FrageAntwort' => $this->frageantwort, 
    212207                                        '$datetime' => $this->getTimeDate() 
     
    218213                        $mail->send(); 
    219214                        // Mail an den Veranstalter 
    220                         $mail = new Mail(       $this->empfnger, 
     215                        $mail = new Mail(       $this->recipient, 
    221216                                                                $languages[GWSPCore::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.subject.recipient', $subjectData), 
    222217                                                                $languages[GWSPCore::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.message.recipient', $messageData)); 
     
    252247                        } 
    253248                } 
     249 
    254250                // Gewinnspiel Daten auslesen 
    255251                $this->readGewinnspiel(); 
     
    263259 
    264260                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, 
    272264                                '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, 
    276268                                'gwsOptionsArray' => $this->gwsOptionsArray, 
    277                                 'answer'        => $this->answer, 
    278                                 'akzept'        => $this->akzept, 
     269                                'answer'                => $this->answer, 
     270                                'akzept'                => $this->akzept, 
    279271                )); 
    280272        } 
     
    291283         
    292284        protected function checkPermissions() { 
    293                 // Kontrolle ob User schon teilgenommen hat (nicht bei Gsten) 
     285                // Kontrolle ob User schon teilgenommen hat (nicht bei Gaesten) 
    294286                $id = GWSPCore::getUser()->userID; 
    295287                if ($id){ 
    296288                        $sql = "SELECT  COUNT(userID) AS users 
    297289                                        FROM    gwsp".GWSP_N."_spiel 
    298                                         WHERE   gwsID = '.$this->gwsID.'  AND userID = '.$id.'"; 
     290                                        WHERE   `gwsID` = ".$this->game->gwsID." AND `userID` = ".$id; 
    299291                        $row = GWSPCore::getDB()->getFirstRow($sql); 
    300292                        if ($row['users'])      {                
     
    307299                $sql = "SELECT  `groupIDs` 
    308300                                FROM    gwsp".GWSP_N."_game 
    309                                 WHERE   gwsID = $this->gwsID"; 
     301                                WHERE   gwsID = ".$this->game->gwsID; 
    310302                $result = GWSPCore::getDB()->sendQuery($sql); 
    311303                $row = GWSPCore::getDB()->fetchArray($result); 
    312                 // Keine gltige GameID angegeben ? 
     304                // gwsID valid? 
    313305                if(empty($row)){ 
    314306                        require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 
     
    316308                        exit; 
    317309                } 
    318                 $this->gwsGroupIDs = explode(',',$row['groupIDs']); 
     310                $this->gwsGroupIDs = explode(',', $row['groupIDs']); 
    319311                require_once(WCF_DIR.'lib/data/user/group/Group.class.php'); 
    320312                $canplay = false; 
     
    322314                        if (Group::isMember($groupID)) $canplay = true; 
    323315                } 
    324                 // Fehlermeldung wenn Teilnemer keiner Berechtigten Gruppe angehrt 
     316                // Fehlermeldung wenn Teilnemer keiner Berechtigten Gruppe angehoert 
    325317                if (!$canplay) { 
    326318                        require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 
     
    331323        protected function readGewinnspiel() { 
    332324                // 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 
    348329                if (defined('GUTHABEN_ENABLE_GLOBAL')){ 
    349                         if(GWSPCore::getUser()->userID && $this->money >= 1) { 
     330                        if(GWSPCore::getUser()->userID && $this->game->money >= 1) { 
    350331                                require_once(WCF_DIR.'lib/data/user/UserGuthaben.class.php'); 
    351332                                $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')) { 
    353334                                        require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 
    354335                                        throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.errormoney')); 
     
    357338                } 
    358339                // Kontrolle ob das Gewinnspiel schon gestartet ist 
    359                 if ($this->gwsStart > TIME_NOW) { 
     340                if ($this->game->starttime > TIME_NOW) { 
    360341                        require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 
    361342                        throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.statustocome')); 
     
    363344                } 
    364345                // Kontrolle ob das Gewinnspiel schon beendet ist 
    365                 if ($this->gwsEnde < TIME_NOW) { 
     346                if ($this->game->timeout < TIME_NOW) { 
    366347                        require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 
    367348                        throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.statusended')); 
     
    369350                } 
    370351                // 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 
    380357                if (empty($this->answer)){ 
    381358                        foreach ($this->gwsOptionsArray as $key => $nummer){ 
     
    383360                        } 
    384361                } 
    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(); 
    391364        } 
    392365         
  • de.inside.Gewinnspiel/files/lib/page/IndexPage.class.php

    r718 r720  
    99 * Gewinnspiel (noch) aktuell ist. Abgelaufene Spiele und Gewinnspiele zu 
    1010 * denen man keine Berechtigung hat werden entsprechend gekennzeichnet. 
     11 * Die Tabelle kann sortiert werden. 
    1112 * @author              Robert "Tatzelwurm" Hempel 
    1213 * @copyright   2007/2008 INSIDE das Hörspiel 
     
    1819 
    1920        public $templateName = 'index'; 
    20         public $itemsPerPage = 10; 
    2121        public $gwsID; 
    2222        public $gwsGroupIDs = array(); 
  • de.inside.Gewinnspiel/files/style/competition.css

    r661 r720  
    5858} 
    5959 
     60.gwspContainerHead { 
     61        padding: 2px 5px; 
     62        text-align:center; 
     63} 
     64 
    6065/* ### -- -- -- -- -- EOF -- -- -- -- -- ### */ 
  • de.inside.Gewinnspiel/package.xml

    r718 r720  
    1111                <packageurl><![CDATA[http://community.woltlab.com/db/index.php?page=Project&projectID=593]]></packageurl> 
    1212                <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> 
    1515        </packageinformation> 
    1616 
    1717        <authorInformation> 
    18                 <author>Robert "Tatelwurm" Hempel</author> 
     18                <author>Robert "Tatzelwurm" Hempel</author> 
    1919                <authorURL>http://www.inside-das-hoerspiel.de</authorURL> 
    2020        </authorInformation> 
    2121 
    2222        <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> --> 
    2423 
    2524<!-- Pakete unter LGPL --> 
     
    4948                <languages languagecode="de-informal">de-informal.xml</languages> 
    5049<!--            <languages languagecode="en">en.xml</languages> --> 
     50<!--            <languages languagecode="hr">hr.xml</languages> --> 
     51<!--            <languages languagecode="fr">fr.xml</languages> --> 
    5152                <acpmenu>acpmenu.xml</acpmenu> 
    5253                <options>options.xml</options> 
  • de.inside.Gewinnspiel/templates/gewinnspiel.tpl

    r661 r720  
    11{include file="documentHeader"} 
    22<head> 
    3         <title>{@$gwsTitel} - {lang}gws.gewinnspiel.title{/lang} - {PAGE_TITLE}</title> 
     3        <title>{@$game->gwsTitel} - {lang}gws.gewinnspiel.title{/lang} - {PAGE_TITLE}</title> 
    44        {include file='headInclude' sandbox=false} 
    55        <link rel="alternate" type="application/rss+xml" href="index.php?page=Feed&amp;type=RSS2" title="RSS2" /> 
     
    1010 
    1111<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> &raquo;</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> &raquo;</li> 
    15         </ul> 
    1612         
    1713        <div class="mainHeadline"> 
    1814                <img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielL.png" alt="" /> 
    1915                <div class="headlineContainer"> 
    20                         <h2>{PAGE_TITLE} {lang}gws.gewinnspiel.title{/lang}</h2> 
     16                        <h2>{lang}{@$game->gwsTitel}{/lang}</h2> 
    2117                        <p>{lang}gws.gewinnspiel.usercount{/lang}</p> 
    2218                </div> 
    2319        </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} 
    2723 
    2824        <form method="post" action="index.php?form=Gewinnspiel"> 
    2925                <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} 
    3228                                <div class="container-1"> 
    33                                         <div class="messageContainer">{@$beschreibung}</div> 
     29                                        <div class="messageContainer">{@$game->description}</div> 
    3430                                </div> 
    3531                        {/if} 
     
    3733         
    3834                <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> 
    4036                                <div class="container-1"> 
    4137                                        <fieldset> 
     
    135131                        <div class="container-1"> 
    136132                                <div class="containerIcon"> 
    137                                         <img src="{@RELATIVE_GWSP_DIR}icon/postNewM.png" alt="" /> 
     133                                        <img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielQuestionM.png" alt="" /> 
    138134                                </div> 
    139135                                <div class="formElement{if $errorField == "answer[$order]"} formError{/if}"> 
     
    151147                {/foreach} 
    152148         
    153                 {if $regeln} 
     149                {if $game->rules} 
    154150                        <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> 
    156152                                <div class="container-1"> 
    157                                         <div class="messageContainer">{@$regeln}</div> 
     153                                        <div class="messageContainer">{@$game->rules}</div> 
    158154                                </div> 
    159155                        </div> 
    160156                {/if} 
    161                 {if $datenschutz} 
     157                {if $game->disclaimer} 
    162158                        <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> 
    164160                                <div class="container-1"> 
    165                                         <div class="messageContainer">{@$datenschutz}</div> 
     161                                        <div class="messageContainer">{@$game->disclaimer}</div> 
    166162                                </div> 
    167163                        </div> 
     
    184180                        <input type="submit" name="send" accesskey="s" value="{lang}wcf.global.button.submit{/lang}" /> 
    185181                        <input type="reset" name="reset" accesskey="r" value="{lang}wcf.global.button.reset{/lang}" /> 
    186                         <input type="hidden" name="gwsID" value="{@$gwsID}" /> 
     182                        <input type="hidden" name="gwsID" value="{@$game->gwsID}" /> 
    187183                </div> 
    188184                        {@SID_INPUT_TAG} 
  • de.inside.Gewinnspiel/templates/index.tpl

    r718 r720  
    4747                                                        <td class="gwspColumnMarkContent"> 
    4848                                                                <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} 
    5050                                                        </td> 
    5151                                                        <td class="gwspColumnDatum"> 
     
    8080                </div> 
    8181        </div> 
    82 {include file='footer' sandbox=false} 
     82{include file='footer' sandbox=true} 
    8383</div> 
    8484