Changeset 661
- Timestamp:
- 09/26/08 22:49:53 (5 years ago)
- Location:
- de.inside.Gewinnspiel
- Files:
-
- 13 modified
-
files/acp/images/acpLogo.png (modified) (previous)
-
files/lib/acp/action/GewinnspielDeleteAction.class.php (modified) (3 diffs)
-
files/lib/acp/form/GewinnspielAddForm.class.php (modified) (2 diffs)
-
files/lib/acp/form/GewinnspielEditForm.class.php (modified) (7 diffs)
-
files/lib/form/GewinnspielForm.class.php (modified) (17 diffs)
-
files/lib/page/IndexPage.class.php (modified) (5 diffs)
-
files/lib/system/cache/CacheBuilderGWSPGames.class.php (modified) (2 diffs)
-
files/lib/system/cache/CacheBuilderGWSPUser.class.php (modified) (1 diff)
-
files/style/competition.css (modified) (1 diff)
-
package.xml (modified) (1 diff)
-
templates/footer.tpl (modified) (1 diff)
-
templates/gewinnspiel.tpl (modified) (4 diffs)
-
templates/index.tpl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
de.inside.Gewinnspiel/files/lib/acp/action/GewinnspielDeleteAction.class.php
r579 r661 12 12 13 13 class GewinnspielDeleteAction extends AbstractAction { 14 public $gws ID = 0;14 public $gwspID = 0; 15 15 16 16 /** … … 20 20 parent::readParameters(); 21 21 22 if (isset($_REQUEST['gws ID'])) $this->gwsID = intval($_REQUEST['gwsID']);22 if (isset($_REQUEST['gwspID'])) $this->gwspID = intval($_REQUEST['gwspID']); 23 23 } 24 24 … … 31 31 // delete game 32 32 $sql = "DELETE FROM gwsp".GWSP_N."_game 33 WHERE gwsID = ".$this->gws ID;33 WHERE gwsID = ".$this->gwspID; 34 34 WCF::getDB()->sendQuery($sql); 35 35 $sql = "DELETE FROM gwsp".GWSP_N."_options 36 WHERE gwsID = ".$this->gws ID;36 WHERE gwsID = ".$this->gwspID; 37 37 WCF::getDB()->sendQuery($sql); 38 38 $sql = "DELETE FROM gwsp".GWSP_N."_spiel 39 WHERE gwsID = ".$this->gws ID;39 WHERE gwsID = ".$this->gwspID; 40 40 WCF::getDB()->sendQuery($sql); 41 // reset cache 42 GWSPACP::getCache()->clear(GWSP_DIR.'cache/', 'competition.games-'.PACKAGE_ID.'.php'); 43 GWSPACP::getCache()->clear(GWSP_DIR.'cache/', 'competition.user-'.PACKAGE_ID.'.php'); 41 44 // forward to list page 42 header('Location: index.php?page=GewinnspielList&deletedgwsID='.$this->gws ID.'&packageID='.PACKAGE_ID.SID_ARG_2ND_NOT_ENCODED);45 header('Location: index.php?page=GewinnspielList&deletedgwsID='.$this->gwspID.'&packageID='.PACKAGE_ID.SID_ARG_2ND_NOT_ENCODED); 43 46 exit; 44 47 } -
de.inside.Gewinnspiel/files/lib/acp/form/GewinnspielAddForm.class.php
r579 r661 53 53 public function show() { 54 54 // enable menu item 55 WCFACP::getMenu()->setActiveMenuItem('gws.acp.menu.link.content.games');55 GWSPACP::getMenu()->setActiveMenuItem('gws.acp.menu.link.content.games'); 56 56 57 57 // check permission … … 193 193 } 194 194 } 195 // reset cache 196 GWSPACP::getCache()->clear(GWSP_DIR.'cache/', 'competition.games-'.PACKAGE_ID.'.php'); 195 197 // forward to list page 196 198 header('Location: index.php?page=GewinnspielList&packageID='.PACKAGE_ID.SID_ARG_2ND_NOT_ENCODED); -
de.inside.Gewinnspiel/files/lib/acp/form/GewinnspielEditForm.class.php
r579 r661 43 43 FROM gwsp".GWSP_N."_game 44 44 WHERE gwsID = '".$this->gwsID."'"; 45 $result = WCF::getDB()->sendQuery($sql);46 while ($row = WCF::getDB()->fetchArray($result)) {45 $result = GWSPACP::getDB()->sendQuery($sql); 46 while ($row = GWSPACP::getDB()->fetchArray($result)) { 47 47 $games =array('gwsID' => $row['gwsID'], 48 48 'gwsTitel' => $row['gwsTitel'], … … 64 64 WHERE gwsID = ".$this->gwsID." 65 65 ORDER BY showOrder"; 66 $result = WCF::getDB()->sendQuery($sql);67 while ($row = WCF::getDB()->fetchArray($result)) {66 $result = GWSPACP::getDB()->sendQuery($sql); 67 while ($row = GWSPACP::getDB()->fetchArray($result)) { 68 68 $this->gwsOptionsArray[] .= "$row[gwsOption]"; 69 69 } … … 103 103 parent::assignVariables(); 104 104 105 WCF::getTPL()->assign(array(105 GWSPACP::getTPL()->assign(array( 106 106 'gwsID' => $this->gwsID, 107 107 'action' => 'edit', … … 128 128 WHERE gwsID = ".$this->gwsID." 129 129 ORDER BY showOrder"; 130 $result = WCF::getDB()->sendQuery($sql);131 while ($row = WCF::getDB()->fetchArray($result)) {130 $result = GWSPACP::getDB()->sendQuery($sql); 131 while ($row = GWSPACP::getDB()->fetchArray($result)) { 132 132 $this->gwsOldOptionsArray[] .= "$row[gwsOption]"; 133 133 } … … 141 141 '".escapeString($this->gwsOptionsArray[$showOrder])."', 142 142 ".$showOrder.")"; 143 WCF::getDB()->registerShutdownUpdate($sql);143 GWSPACP::getDB()->registerShutdownUpdate($sql); 144 144 // wenn noch alt Optionen vorhanden sind dann lschen 145 145 } elseif(empty($this->gwsOptionsArray[$showOrder]) && $this->gwsOldOptionsArray[$showOrder]) { 146 146 $sql = "DELETE FROM gwsp".GWSP_N."_options 147 147 WHERE gwsID = ".$this->gwsID." AND showOrder = ".$showOrder; 148 WCF::getDB()->registerShutdownUpdate($sql);148 GWSPACP::getDB()->registerShutdownUpdate($sql); 149 149 // wenn alte Optione nicht gleich der neuen dann UPDATE 150 150 } elseif ($this->gwsOptionsArray[$showOrder] != $this->gwsOldOptionsArray[$showOrder]){ … … 152 152 SET gwsOption = '".escapeString($this->gwsOptionsArray[$showOrder])."' 153 153 WHERE gwsID = ".$this->gwsID." AND showOrder = ".$showOrder; 154 WCF::getDB()->registerShutdownUpdate($sql);154 GWSPACP::getDB()->registerShutdownUpdate($sql); 155 155 } 156 156 } … … 167 167 money = '".intval($this->money)."' 168 168 WHERE gwsID = " .$this->gwsID; 169 WCF::getDB()->registerShutdownUpdate($sql); 169 GWSPACP::getDB()->registerShutdownUpdate($sql); 170 // reset cache 171 GWSPACP::getCache()->clear(GWSP_DIR.'cache/', 'competition.games-'.PACKAGE_ID.'.php'); 170 172 // forward to list page 171 173 header('Location: index.php?page=GewinnspielList&packageID='.PACKAGE_ID.SID_ARG_2ND_NOT_ENCODED); -
de.inside.Gewinnspiel/files/lib/form/GewinnspielForm.class.php
r579 r661 61 61 if (!$this->gwsID){ 62 62 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 63 throw new NamedUserException( WCF::getLanguage()->get('gws.gewinnspiel.wrongid'));63 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.wrongid')); 64 64 exit; 65 65 } … … 131 131 // parent::validate(); 132 132 // Kontrolle ob Gast schon teilgenommen hat 133 $id = WCF::getUser()->userID;133 $id = GWSPCore::getUser()->userID; 134 134 if (!$id){ 135 135 $sql = "SELECT `ipaddress`, `email`, `realName` 136 136 FROM gwsp".GWSP_N."_spiel 137 137 WHERE `gwsID` = $this->gwsID AND `userID` = 0"; 138 $result = WCF::getDB()->sendQuery($sql);139 while ($row = WCF::getDB()->fetchArray($result)) {138 $result = GWSPCore::getDB()->sendQuery($sql); 139 while ($row = GWSPCore::getDB()->fetchArray($result)) { 140 140 $ipArray[] = "$row[ipaddress]"; 141 141 $mailArray[] = "$row[email]"; … … 146 146 if (StringUtil::toLowerCase($mailArray[$key]) == StringUtil::toLowerCase($this->useremail) || StringUtil::toLowerCase($rnArray[$key]) == StringUtil::toLowerCase($this->userreal)){ 147 147 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 148 throw new NamedUserException( WCF::getLanguage()->get('gws.gewinnspiel.alreadyplayed'));148 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.alreadyplayed')); 149 149 exit; 150 150 } … … 166 166 (gwsID, userID, ipaddress, email, realName) 167 167 VALUES (".intval($this->gwsID).", 168 ".intval( WCF::getUser()->userID).",169 '".escapeString( WCF::getSession()->ipAddress)."',168 ".intval(GWSPCore::getUser()->userID).", 169 '".escapeString(GWSPCore::getSession()->ipAddress)."', 170 170 '".$this->useremail."', 171 171 '".$this->userreal."')"; 172 WCF::getDB()->sendQuery($sql);173 174 // E-Mail des Empfngers holen.172 GWSPCore::getDB()->sendQuery($sql); 173 174 // Competition Mod E-Mail. 175 175 $sql = "SELECT `recipient` 176 176 FROM gwsp".GWSP_N."_game 177 177 WHERE gwsID = $this->gwsID"; 178 $result = WCF::getDB()->getFirstRow($sql);178 $result = GWSPCore::getDB()->getFirstRow($sql); 179 179 $this->empfnger = $result['recipient']; 180 180 // E-Mail vorbeiten und senden … … 185 185 WHERE gwsID = ".$this->gwsID." 186 186 ORDER BY showOrder"; 187 $result = WCF::getDB()->sendQuery($sql);188 while ($row = WCF::getDB()->fetchArray($result)) {187 $result = GWSPCore::getDB()->sendQuery($sql); 188 while ($row = GWSPCore::getDB()->fetchArray($result)) { 189 189 $this->gwsOptionsArray[] .= "$row[gwsOption]"; 190 190 } 191 $frage = WCF::getLanguage()->get('gws.gewinnspiel.frage');192 $antwort = WCF::getLanguage()->get('gws.gewinnspiel.antwort');191 $frage = GWSPCore::getLanguage()->get('gws.gewinnspiel.frage'); 192 $antwort = GWSPCore::getLanguage()->get('gws.gewinnspiel.antwort'); 193 193 foreach ($this->gwsOptionsArray as $key =>$option){ 194 194 $this->frageantwort .= $frage.": "."$option"."\n".$antwort.": ".$this->answer[$key]."\n"."\n"; 195 195 } 196 $languages = array(0 => WCF::getLanguage(), WCF::getLanguage()->getLanguageID() => WCF::getLanguage());196 $languages = array(0 => GWSPCore::getLanguage(), GWSPCore::getLanguage()->getLanguageID() => GWSPCore::getLanguage()); 197 197 require_once(WCF_DIR.'lib/data/mail/Mail.class.php'); 198 198 require_once(WCF_DIR.'lib/data/user/User.class.php'); 199 199 // get language 200 200 // enable language 201 $languages[ WCF::getLanguage()->getLanguageID()]->setLocale();201 $languages[GWSPCore::getLanguage()->getLanguageID()]->setLocale(); 202 202 203 203 $subjectData = array('PAGE_TITLE' => PAGE_TITLE); … … 214 214 // Mail an den User 215 215 $mail = new Mail( array($this->userreal => $this->useremail), 216 $languages[ WCF::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.subject', $subjectData),217 $languages[ WCF::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.message', $messageData));216 $languages[GWSPCore::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.subject', $subjectData), 217 $languages[GWSPCore::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.message', $messageData)); 218 218 $mail->send(); 219 219 // Mail an den Veranstalter 220 220 $mail = new Mail( $this->empfnger, 221 $languages[ WCF::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.subject.recipient', $subjectData),222 $languages[ WCF::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.message.recipient', $messageData));221 $languages[GWSPCore::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.subject.recipient', $subjectData), 222 $languages[GWSPCore::getLanguage()->getLanguageID()]->get('gws.gewinnspiel.mail.message.recipient', $messageData)); 223 223 $mail->send(); 224 224 225 225 // enable user language 226 WCF::getLanguage()->setLocale(); 227 226 GWSPCore::getLanguage()->setLocale(); 227 // reset cache 228 GWSPCore::getCache()->clear(GWSP_DIR.'cache/', 'competition.user-'.PACKAGE_ID.'.php'); 228 229 // forward to index page 229 WCF::getTPL()->assign(array(230 'url' => 'index.php?page= Gewinnspiel'.SID_ARG_1ST,231 'message' => WCF::getLanguage()->get(WCF::getLanguage()->get('gws.gewinnspiel.ok_redirect'), array('$userreal' => $this->username, '$uemail' => $this->useremail))230 GWSPCore::getTPL()->assign(array( 231 'url' => 'index.php?page=Index'.SID_ARG_1ST, 232 'message' => GWSPCore::getLanguage()->get(GWSPCore::getLanguage()->get('gws.gewinnspiel.ok_redirect'), array('$userreal' => $this->username, '$uemail' => $this->useremail)) 232 233 )); 233 WCF::getTPL()->display('redirect');234 GWSPCore::getTPL()->display('redirect'); 234 235 exit; 235 236 } … … 241 242 public function readData() { 242 243 parent::readData(); 243 if (( WCF::getUser()->userID) > 0){244 $this->username = WCF::getUser()->username;245 $this->useremail = $this->useremailconfirm = WCF::getUser()->email;244 if ((GWSPCore::getUser()->userID) > 0){ 245 $this->username = GWSPCore::getUser()->username; 246 $this->useremail = $this->useremailconfirm = GWSPCore::getUser()->email; 246 247 }else{ 247 248 if (!count($_POST)) { 248 $this->username = WCF::getLanguage()->get('gws.gewinnspiel.username.gast');249 $this->username = GWSPCore::getLanguage()->get('gws.gewinnspiel.username.gast'); 249 250 $this->useremail = $this->useremailconfirm = ''; 250 251 } … … 283 284 public function show() { 284 285 // get the default langauge id 285 $this->languageID = WCF::getLanguage()->getLanguageID();286 $this->languageID = GWSPCore::getLanguage()->getLanguageID(); 286 287 // show form 287 288 parent::show(); … … 290 291 protected function checkPermissions() { 291 292 // Kontrolle ob User schon teilgenommen hat (nicht bei Gsten) 292 $id = WCF::getUser()->userID;293 $id = GWSPCore::getUser()->userID; 293 294 if ($id){ 294 295 $sql = "SELECT COUNT(userID) AS users 295 296 FROM gwsp".GWSP_N."_spiel 296 297 WHERE gwsID = '.$this->gwsID.' AND userID = '.$id.'"; 297 $row = WCF::getDB()->getFirstRow($sql);298 $row = GWSPCore::getDB()->getFirstRow($sql); 298 299 if ($row['users']) { 299 300 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 300 throw new NamedUserException( WCF::getLanguage()->get('gws.gewinnspiel.alreadyplayed'));301 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.alreadyplayed')); 301 302 exit; 302 303 } … … 306 307 FROM gwsp".GWSP_N."_game 307 308 WHERE gwsID = $this->gwsID"; 308 $result = WCF::getDB()->sendQuery($sql);309 $row = WCF::getDB()->fetchArray($result);309 $result = GWSPCore::getDB()->sendQuery($sql); 310 $row = GWSPCore::getDB()->fetchArray($result); 310 311 // Keine gltige GameID angegeben ? 311 312 if(empty($row)){ 312 313 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 313 throw new NamedUserException( WCF::getLanguage()->get('gws.gewinnspiel.wrongid'));314 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.wrongid')); 314 315 exit; 315 316 } … … 323 324 if (!$canplay) { 324 325 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 325 throw new NamedUserException( WCF::getLanguage()->get('gws.gewinnspiel.nogroupe'));326 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.nogroupe')); 326 327 } 327 328 } … … 332 333 FROM gwsp".GWSP_N."_game gewinnspiel 333 334 WHERE gwsID = ".$this->gwsID; 334 $row = WCF::getDB()->getFirstRow($sql);335 $row = GWSPCore::getDB()->getFirstRow($sql); 335 336 $this->gwsID = $row['gwsID']; 336 337 $this->gwsTitel = $row['gwsTitel']; … … 345 346 346 347 if (defined('GUTHABEN_ENABLE_GLOBAL')){ 347 if( WCF::getUser()->userID && $this->money >= 1) {348 if(GWSPCore::getUser()->userID && $this->money >= 1) { 348 349 require_once(WCF_DIR.'lib/data/user/UserGuthaben.class.php'); 349 $um = new UserGuthaben( WCF::getUser()->userID);350 $um = new UserGuthaben(GWSPCore::getUser()->userID); 350 351 if (!$um->subGuthaben($this->money,'gws.gewinnspiel.kosten')) { 351 352 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 352 throw new NamedUserException( WCF::getLanguage()->get('gws.gewinnspiel.errormoney'));353 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.errormoney')); 353 354 } 354 355 } … … 357 358 if ($this->gwsStart > TIME_NOW) { 358 359 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 359 throw new NamedUserException( WCF::getLanguage()->get('gws.gewinnspiel.statustocome'));360 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.statustocome')); 360 361 exit; 361 362 } … … 363 364 if ($this->gwsEnde < TIME_NOW) { 364 365 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 365 throw new NamedUserException( WCF::getLanguage()->get('gws.gewinnspiel.statusended'));366 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.statusended')); 366 367 exit; 367 368 } … … 371 372 WHERE gwsID = ".$this->gwsID." 372 373 ORDER BY showOrder"; 373 $result = WCF::getDB()->sendQuery($sql);374 while ($row = WCF::getDB()->fetchArray($result)) {374 $result = GWSPCore::getDB()->sendQuery($sql); 375 while ($row = GWSPCore::getDB()->fetchArray($result)) { 375 376 $titel = $this->getFormattedMessage($row['gwsOption'], true); 376 377 $this->gwsOptionsArray[] .= "$titel"; … … 385 386 FROM gwsp".GWSP_N."_spiel 386 387 WHERE gwsID = ".$this->gwsID; 387 $row = WCF::getDB()->getFirstRow($sql);388 $row = GWSPCore::getDB()->getFirstRow($sql); 388 389 $this->usercount = $row['userID']; 389 390 } -
de.inside.Gewinnspiel/files/lib/page/IndexPage.class.php
r579 r661 10 10 * denen man keine Berechtigung hat werden entsprechend gekennzeichnet. 11 11 * @author Robert "Tatzelwurm" Hempel 12 * @copyright 2007/2008 INSIDE das H rspiel12 * @copyright 2007/2008 INSIDE das Hörspiel 13 13 * @license GNU LGPL http://www.gnu.org/licenses/lgpl.txt 14 14 * @package de.inside.Gewinnspiel … … 28 28 public $highlight = ''; 29 29 30 private $gamesCache = array(); 30 31 private $enableSmilies = true; 31 32 private $enableBBCodes = true; … … 44 45 if (isset($_REQUEST['action'])) $this->action = $_REQUEST['action']; 45 46 46 // Hier Code fÃŒr Action !!!! 47 if ($this->action == 'go' && $this->gwsID) { 48 $sql = "SELECT `groupIDs` 49 FROM gwsp".GWSP_N."_game 50 WHERE gwsID = ".$this->gwsID.""; 51 $result = GWSPCore::getDB()->sendQuery($sql); 52 $row = GWSPCore::getDB()->fetchArray($result); 53 $this->gwsGroupIDs = explode(',',$row['groupIDs']); 54 require_once(WCF_DIR.'lib/data/user/group/Group.class.php'); 55 $canplay = false; 56 foreach ($this->gwsGroupIDs as $groupID){ 57 if (Group::isMember($groupID)) $canplay = true; 58 } 59 if (!$canplay) { 60 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 61 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.nogroupe')); 62 } 47 GWSPCore::getCache()->addResource('competition-games-'.PACKAGE_ID, 48 GWSP_DIR.'cache/competition.games-'.PACKAGE_ID.'.php', 49 GWSP_DIR.'lib/system/cache/CacheBuilderGWSPGames.class.php'); 50 GWSPCore::getCache()->addResource('competition-user-'.PACKAGE_ID, 51 GWSP_DIR.'cache/competition.user-'.PACKAGE_ID.'.php', 52 GWSP_DIR.'lib/system/cache/CacheBuilderGWSPUser.class.php'); 63 53 64 } 54 // Action !!!! 55 if ($this->action == 'go' && $this->gwsID) $this->startGame(); 65 56 } 66 57 67 58 public function readData() { 68 59 parent::readData(); 60 $this->gamesCache = GWSPCore::getCache()->get('competition-games-'.PACKAGE_ID); 61 $this->userCache = GWSPCore::getCache()->get('competition-user-'.PACKAGE_ID); 69 62 $this->readGewinnspiele(); 70 63 } … … 113 106 114 107 protected function readGewinnspiele() { 115 $sql = "SELECT `gwsID`, `gwsTitel`, `starttime`, `timeout`, `groupIDs`, `money` 116 FROM gwsp".GWSP_N."_game gewinnspiele 117 ORDER BY timeout ASC 118 LIMIT ".$this->itemsPerPage." 119 OFFSET ".(($this->pageNo - 1) * $this->itemsPerPage); 120 $result = GWSPCore::getDB()->sendQuery($sql); 121 while ($row = GWSPCore::getDB()->fetchArray($result)) { 122 $gewinnspiele =array( 123 'gwsID' => $row['gwsID'], 124 'groupIDs' => $row['groupIDs'], 125 'permission' => '', 126 'done' => '', 127 ); 108 foreach ($this->gamesCache as $gewinnspiel ) { 109 // Check for Guthaben Plugin 128 110 if (!defined('GUTHABEN_ENABLE_GLOBAL')){ 129 $ row['money'] = 0;111 $gewinnspiel['money'] = 0; 130 112 } 131 // Kontrolle ob Gruppe berechtigt ist132 $ row['permission'] = 'nein';133 $IDs = explode(',', $row['groupIDs']);113 // Check gruppe permission 114 $gewinnspiel['permission'] = 'nein'; 115 $IDs = explode(',', $gewinnspiel['groupIDs']); 134 116 require_once(WCF_DIR.'lib/data/user/group/Group.class.php'); 135 117 foreach ($IDs as $gruppe) { 136 if (Group::isMember($gruppe)) $row['permission'] = 'ok'; 118 $gewinnspiel['permission'] = false; 119 if (Group::isMember($gruppe)) { 120 $gewinnspiel['permission'] = true; 121 break; 122 } 137 123 } 138 // Kontrolle ob User schon teilgenommen hat (nicht bei G sten)124 // Kontrolle ob User schon teilgenommen hat (nicht bei GÀsten) 139 125 $id = GWSPCore::getUser()->userID; 140 $ row['done'] = 'notdone';126 $gewinnspiel['done'] = 'notdone'; 141 127 if ($id){ 142 $sql 1= "SELECT COUNT(`userID`) AS users128 $sql = "SELECT COUNT(`userID`) AS users 143 129 FROM gwsp".GWSP_N."_spiel 144 WHERE `gwsID` = ".$ row['gwsID']." AND `userID`=".$id;145 $row 1 = GWSPCore::getDB()->getFirstRow($sql1);146 if ($row 1['users']) {147 $ row['done'] = 'done';130 WHERE `gwsID` = ".$gewinnspiel['gwsID']." AND `userID`=".$id; 131 $row = GWSPCore::getDB()->getFirstRow($sql); 132 if ($row['users']) { 133 $gewinnspiel['done'] = 'done'; 148 134 } 149 135 } 150 $this->gewinnspiele[] = $ row;136 $this->gewinnspiele[] = $gewinnspiel; 151 137 } 152 138 } … … 156 142 return $datumzeit; 157 143 } 144 145 protected function startGame() { 146 $sql = "SELECT `groupIDs` 147 FROM gwsp".GWSP_N."_game 148 WHERE gwsID = ".$this->gwsID.""; 149 $result = GWSPCore::getDB()->sendQuery($sql); 150 $row = GWSPCore::getDB()->fetchArray($result); 151 $this->gwsGroupIDs = explode(',',$row['groupIDs']); 152 require_once(WCF_DIR.'lib/data/user/group/Group.class.php'); 153 $canplay = false; 154 foreach ($this->gwsGroupIDs as $groupID){ 155 if (Group::isMember($groupID)) $canplay = true; 156 } 157 if (!$canplay) { 158 require_once(WCF_DIR.'lib/system/exception/NamedUserException.class.php'); 159 throw new NamedUserException(GWSPCore::getLanguage()->get('gws.gewinnspiel.nogroupe')); 160 } 161 } 158 162 } 159 163 -
de.inside.Gewinnspiel/files/lib/system/cache/CacheBuilderGWSPGames.class.php
r616 r661 16 16 public function getData($cacheResource) { 17 17 $data = array(); 18 $questions = array(); 18 19 19 20 $sql = "SELECT t1.gwsID AS gwsID, t1.gwsTitel AS gwsTitel, 20 21 t1.starttime AS starttime, t1.timeout AS timeout, 21 t1.recipient AS recipient, t1.regeln AS r egeln,22 t1.recipient AS recipient, t1.regeln AS rules, 22 23 t1.discl AS disclaimer, t1.beschreib AS description, 23 24 t1.groupIDs AS groupIDs, t1.money AS money, … … 25 26 FROM gwsp".GWSP_N."_spiel as t2 26 27 WHERE t2.gwsID = t1.`gwsID`) 27 AS userCount, 28 AS userCount, 1 AS questions 28 29 FROM gwsp".GWSP_N."_game AS t1 29 30 ORDER BY t1.`gwsID` DESC"; 30 31 $result = GWSPCore::getDB()->sendQuery($sql); 31 32 while ($row = GWSPCore::getDB()->fetchArray($result)) { 32 $data[] = $row;33 33 $sql = "SELECT * 34 34 FROM gwsp".GWSP_N."_options 35 35 WHERE gwsID = ".$row['gwsID']." 36 ORDER showOrder ASC";36 ORDER BY showOrder ASC"; 37 37 $questions = GWSPCore::getDB()->sendQuery($sql); 38 $data['questions'] = GWSPCore::getDB()->getFirstRow($questions); 38 $row['questions'] = GWSPCore::getDB()->fetchArray($questions); 39 $data[] = $row; 39 40 } 40 41 return $data; -
de.inside.Gewinnspiel/files/lib/system/cache/CacheBuilderGWSPUser.class.php
r616 r661 17 17 $data = array(); 18 18 19 $sql = "SELECT t1.gwsID, t1.userID, t2.username 19 $sql = "SELECT t1.gwsID, t1.userID, t2.username, 20 20 t1.ipaddress, t1.email, t1.realName 21 21 FROM gwsp".GWSP_N."_spiel AS t1 left join wcf".WCF_N."_user AS t2 ON t2.userID = t1.userID -
de.inside.Gewinnspiel/files/style/competition.css
r563 r661 1 1 2 /* ### -- -- -- -- -- Special Burning Board 3Styles -- -- -- -- -- ### */2 /* ### -- -- -- -- -- Competition / Gewinnspiel Styles -- -- -- -- -- ### */ 3 3 4 4 /* 5 5 6 File: burningBoard.css7 Copyright 200 6 by WoltLab GmbH.6 File: competition.css 7 Copyright 2008 by INSIDE das Hörspiel. 8 8 9 9 */ 10 10 11 /* ### -- -- -- -- -- Miscellaneous-- -- -- -- -- ### */11 /* ### -- -- -- -- -- general -- -- -- -- -- ### */ 12 12 13 . hot {14 font-weight: bold; 13 .gwspCopyHint { 14 15 15 } 16 16 17 .interesting a { 18 font-style: italic; 17 /* ### -- -- -- -- -- Index / Competition list -- -- -- -- -- ### */ 18 19 /* Icons */ 20 .tableList th.gwspColumnIcon { 21 white-space: nowrap; 22 width:1%; 23 } 24 .tableList td.gwspColumnIcon { 25 white-space: nowrap; 26 width:1%; 19 27 } 20 28 21 .threadStarter { 22 font-style: italic; 29 /* date & time */ 30 .tableList th.gwspColumnDatum { 31 text-align: center; 32 white-space: nowrap; 33 min-width: 150px; 23 34 } 24 25 .topicQuickEdit { 26 display: none; 27 width: 50%; 28 } 29 30 .prefix strong { 31 font-weight: normal; 32 } 33 34 .headlineContainer h1 .prefix { 35 font-size: .7em; 36 } 37 38 .smallPages { 39 float: right; 40 height: 24px; 41 } 42 43 .goToNewPost { 44 margin-right: 3px; 45 float: left; 46 } 47 48 .topic input, .headlineContainer h1 input { 49 width: 70%; 50 } 51 52 .threadSort:after { 53 content: ""; 54 height: 0; 55 display: block; 56 clear: both; 57 } 58 59 .breadCrumbs .prefix { 60 text-decoration: none; 61 } 62 63 /* ### -- -- -- -- -- Quick Jump -- -- -- -- -- ### */ 64 65 .quickJump { 66 white-space: nowrap; 67 width: auto; 68 } 69 70 .quickJump select { 71 width: auto; 72 } 73 74 /* ### -- -- -- -- -- Page Options -- -- -- -- -- ### */ 75 76 .pageOptions { 77 float: right; 78 } 79 80 .pageOptions form, .pageOptions div { 81 display: inline; 82 } 83 84 .pageOptions a, .pageOptions form { 85 text-decoration: none; 86 margin-left: 10px; 87 } 88 89 .pageOptions a span { 90 text-decoration: underline; 91 } 92 93 .pageOptions a:hover span { 94 text-decoration: none; 95 } 96 97 /* ### -- -- -- -- -- Board List -- -- -- -- -- ### */ 98 99 #boardlist, #boardlist ul { 100 list-style: none; 101 padding: 0; 102 margin: 0; 103 } 104 105 #boardlist { 106 margin-bottom: 20px; 107 } 108 109 #boardlist .boardlistInner { 110 min-height: 16px; 111 } 112 113 #boardlist .container-1, #boardlist .container-2 { 114 background-repeat: no-repeat; 115 background-position: center left; 116 } 117 118 #boardlist li ul .boardlistInner { 119 padding-left: 30px; 120 } 121 122 #boardlist li ul li ul .boardlistInner { 123 padding-left: 60px; 124 } 125 126 #boardlist li ul li ul li ul .boardlistInner { 127 padding-left: 90px; 128 } 129 130 #boardlist li { 131 min-height: 0; 132 } 133 134 #boardlist .containerContent:after { 135 content: ""; 136 height: 0; 137 display: block; 138 clear: both; 139 } 140 141 #boardlist .container-1, #boardlist .container-2 { 142 padding: 4px; 143 } 144 145 .boardlistLastPost { 146 margin: -1.5em 3em 0 3em; 147 float: right; 148 width: 40%; 149 overflow: hidden; 150 } 151 152 #boardlist .boardTitle { 153 width: 45%; 154 } 155 156 #boardlist .containerHead .boardTitle { 157 width: 99.5%; 158 } 159 160 #boardlist .boardlistSubboards { 161 margin: 3px 0 0 0; 162 padding: 0; 163 min-height: 0; 164 } 165 166 #boardlist .boardlistSubboards { 167 margin: 3px 0 0 0; 168 } 169 170 #boardlist .boardlistSubboards h4, #boardlist .boardlistSubboards h5, #boardlist .boardlistSubboards h6 { 171 display: inline; 172 } 173 174 .boardlistUserOnline, .moderators { 175 margin-top: 3px; 176 } 177 178 .boardlistDescription { 179 margin-bottom: 3px; 180 } 181 182 .boardlistCounter { 183 margin-bottom: 3px; 184 } 185 186 /* ### -- -- -- Thread List -- -- -- ###*/ 187 188 .tableList .columnLastPost { 189 width: 30%; 190 } 191 192 .tableList .columnLastPost p { 35 .tableList td.gwspColumnDatum { 36 white-space: nowrap; 37 min-width: 150px; 193 38 text-align: center; 194 39 } 195 40 196 .tableList .columnLastPost .containerContentSmall p { 41 /* competition description */ 42 .tableList th.gwspColumnMarkContent { 43 text-align: center; 44 } 45 .tableList td.gwspColumnMarkContent { 197 46 text-align: left; 47 padding-left: 5px; 198 48 } 199 49 200 .tableList .columnTopic {201 width: 70%;202 }203 50 204 .tableList .columnTopic div.topic { 205 overflow: hidden; 206 } 207 208 .tableList .columnViews, .tableList .columnReplies { 209 text-align: center; 210 } 211 212 .tableList .columnRating, .tableList .columnLastActivity { 213 white-space: nowrap; 214 } 215 216 /* todo: find a better solution, because this makes problems, when more than 217 only one image is in that td, e.g. delete and enable action 218 -> maybe apply this via javascript, as it is only needed for drop down menus 219 */ 220 .tableList td.columnIcon img { 51 .gwspContainerIcon { 52 padding-top:5px; 221 53 display: block; 222 } 223 224 /* ### -- -- -- Similar Threads -- -- -- ###*/ 225 226 .similarThreads { 227 list-style: none; 228 margin-top: 10px; 229 padding: 0; 230 } 231 232 .similarThreads li { 233 min-height: 0; 234 } 235 236 .similarThreads .breadCrumbs { 237 margin: 0; 238 } 239 240 /* ### -- -- -- Moderation Overview -- -- -- ###*/ 241 242 .moderationOverview { 243 list-style: none; 244 margin: 15px 0 5px 0 !important; 245 padding: 0; 246 } 247 248 .moderationOverview:after { 249 content: ""; 250 height: 0; 251 display: block; 252 clear: both; 253 } 254 255 .moderationOverview ul { 256 list-style: none; 257 margin: 0; 258 padding: 0; 259 } 260 261 .moderationOverview img { 262 margin-right: 5px; 263 float: left; 264 } 265 266 .moderationOverview li { 267 margin: 0 5% 10px 0; 268 float: left; 269 width: 40%; 270 min-height: 48px; 271 } 272 273 .moderationOverview li ul li { 274 margin: 3px 0 3px 0; 275 float: none; 276 width: auto; 277 min-height: 0; 278 } 279 280 /* ### -- -- -- -- -- Delete Post -- -- -- -- -- ### */ 281 282 .deletePost input[type="submit"] { 283 float: right; 284 } 285 286 .deletePost .formField { 287 float: left; 288 } 289 290 .deletePost:after { 291 content: ""; 292 height: 0; 293 display: block; 294 clear: both; 54 float:left; 55 margin-left:8px; 56 text-align:center; 57 width:30px; 295 58 } 296 59 -
de.inside.Gewinnspiel/package.xml
r603 r661 34 34 <requiredpackage minversion="1.0.7">com.woltlab.wcf.page.user.profile</requiredpackage> 35 35 36 <!-- Pakete unter Woltlab Lizenz 37 <requiredpackage minversion="1.0.6">com.woltlab.wcf.data.message.pm</requiredpackage> 38 <requiredpackage minversion="1.0.2">com.woltlab.wcf.data.user.messenger</requiredpackage> 39 <requiredpackage minversion="1.0.3">com.woltlab.wcf.acp.user.avatar</requiredpackage> 40 <requiredpackage minversion="1.0.2">com.woltlab.wcf.acp.user.rank</requiredpackage> 41 <requiredpackage minversion="1.0.4">com.woltlab.wcf.acp.content.smiley</requiredpackage> 42 <requiredpackage minversion="1.0.2">com.woltlab.wcf.acp.content.bbcode</requiredpackage> 43 <requiredpackage minversion="1.0.5">com.woltlab.wcf.acp.user.option</requiredpackage> 44 <requiredpackage minversion="1.0.3">com.woltlab.wcf.acp.display.language</requiredpackage> 45 <requiredpackage minversion="1.0.3">com.woltlab.wcf.acp.system.db</requiredpackage> 46 <requiredpackage minversion="1.0.4">com.woltlab.wcf.acp.display.template</requiredpackage> --> 36 <!-- Pakete unter Woltlab Lizenz --> 47 37 <requiredpackage minversion="1.0.6">com.woltlab.wcf.acp.display.style</requiredpackage> 48 38 <requiredpackage minversion="1.0.5">com.woltlab.wcf.form.user.signature</requiredpackage> 49 <!-- <requiredpackage minversion="1.0.4">com.woltlab.wcf.form.user.group</requiredpackage>50 <requiredpackage minversion="1.0.3 pl 1">com.woltlab.wcf.page.user.membersList</requiredpackage>51 <requiredpackage minversion="1.0.4">com.woltlab.wcf.page.user.usersOnline</requiredpackage>52 <requiredpackage minversion="1.0.3">com.woltlab.wcf.page.user.membersList.team</requiredpackage>53 -->54 39 55 40 </requiredpackages> -
de.inside.Gewinnspiel/templates/footer.tpl
r579 r661 1 <p class="copyright ">{lang}gws.gewinnspiel.copyhint{/lang}</p>1 <p class="copyright gwspCopyHint">{lang}gws.gewinnspiel.copyhint{/lang}</p> 2 2 </div> -
de.inside.Gewinnspiel/templates/gewinnspiel.tpl
r579 r661 11 11 <div id="main"> 12 12 <ul class="breadCrumbs"> 13 <li><a href="index.php?page= Gewinnspiel{@SID_ARG_2ND}"><img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielS.png" alt="" /> <span>{lang}gws.gewinnspiel.title{/lang}</span></a> »</li>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 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 15 </ul> … … 23 23 </div> 24 24 {if $errorField} 25 <p class="error">{lang} gws.global.form.error{/lang}</p>25 <p class="error">{lang}wcf.global.form.error{/lang}</p> 26 26 {/if} 27 27 … … 176 176 {if $errorField == 'akzept'} 177 177 <p class="innerError"> 178 {if $errorType == 'empty'}{lang} gws.global.error.empty{/lang}{/if}178 {if $errorType == 'empty'}{lang}wcf.global.error.empty{/lang}{/if} 179 179 </p> 180 180 {/if} … … 182 182 </div> 183 183 <div class="formSubmit"> 184 <input type="submit" name="send" accesskey="s" value="{lang} gws.global.button.submit{/lang}" />185 <input type="reset" name="reset" accesskey="r" value="{lang} gws.global.button.reset{/lang}" />184 <input type="submit" name="send" accesskey="s" value="{lang}wcf.global.button.submit{/lang}" /> 185 <input type="reset" name="reset" accesskey="r" value="{lang}wcf.global.button.reset{/lang}" /> 186 186 <input type="hidden" name="gwsID" value="{@$gwsID}" /> 187 187 </div> -
de.inside.Gewinnspiel/templates/index.tpl
r579 r661 24 24 <div class="container-1"> 25 25 <div class="contentHeader"> 26 {assign var=multiplePagesLink value="index.php?page= Gewinnspiel&pageNo=%d"}26 {assign var=multiplePagesLink value="index.php?page=Index&pageNo=%d"} 27 27 {pages print=true assign=pagesOutput link=$multiplePagesLink|concat:SID_ARG_2ND_NOT_ENCODED} 28 28 </div> … … 32 32 <thead> 33 33 <tr class="tableHead"> 34 <th class=" columnIcon"><div>{lang}gws.acp.gwsID{/lang}</div></th>35 <th class=" columnBoxname"><div>{lang}gws.acp.titelname{/lang}</div></th>36 <th class=" columnBoxname"><div>{lang}gws.gewinnspiel.start{/lang}</div></th>37 <th class=" columnBoxname"><div>{lang}gws.gewinnspiel.timeout{/lang}</div></th>38 <th class=" columnIcon"><div>{lang}gws.gewinnspiel.statusmain{/lang}</div></th>34 <th class="gwspColumnIcon"><div>{lang}gws.acp.gwsID{/lang}</div></th> 35 <th class="gwspColumnMarkContent"><div>{lang}gws.acp.titelname{/lang}</div></th> 36 <th class="gwspColumnDatum"><div>{lang}gws.gewinnspiel.start{/lang}</div></th> 37 <th class="gwspColumnDatum"><div>{lang}gws.gewinnspiel.timeout{/lang}</div></th> 38 <th class="gwspColumnIcon"><div>{lang}gws.gewinnspiel.statusmain{/lang}</div></th> 39 39 </tr> 40 40 </thead> 41 <tbody> 42 {foreach from=$gewinnspiele item=gewinnspiel} 43 <tr class="{cycle values="container-1,container-2" advance=false} id="{@$gewinnspiel.gwsID}""> 44 <td class="columnIcon"> 41 {foreach from=$gewinnspiele item=gewinnspiel} 42 <tbody> 43 {cycle values='container-1,container-2' name='className' print=false advance=false} 44 <tr class="{cycle name='className'}" id="gwsp{$gewinnspiel.gwsID}"> 45 <td class="gwspColumnIcon"> 45 46 <b>{@$gewinnspiel.gwsID}</b> 46 47 </td> 47 <td class=" columnname columnText">48 <td class="gwspColumnMarkContent"> 48 49 <b>{@$gewinnspiel.gwsTitel}</b> 49 50 {if $gewinnspiel.money} … … 52 53 {/if} 53 54 </td> 54 <td class=" columnMarkUsers" align="center">55 <td class="gwspColumnDatum"> 55 56 {@$gewinnspiel.starttime|shorttime} 56 57 </td> 57 <td class=" columnMarkUsers" align="center">58 <td class="gwspColumnDatum"> 58 59 {@$gewinnspiel.timeout|shorttime} 59 60 </td> 60 <td class=" columnIcon">61 <td class="gwspColumnIcon"> 61 62 {if $gewinnspiel.timeout < TIME_NOW} 62 63 <img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielEndeS.png" alt="{lang}gws.gewinnspiel.statusended{/lang}" title="{lang}gws.gewinnspiel.statusended{/lang}" /> … … 66 67 {/if} 67 68 {if $gewinnspiel.starttime < TIME_NOW && $gewinnspiel.timeout > TIME_NOW} 68 {if $gewinnspiel.permission == "ok"&& $gewinnspiel.done == "notdone"}69 {if $gewinnspiel.permission == true && $gewinnspiel.done == "notdone"} 69 70 <a href="index.php?form=Gewinnspiel&gwsID={@$gewinnspiel.gwsID}{@SID_ARG_2ND}" alt='{lang}gws.gewinnspiel.statusspielen{/lang}'><img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielGoS.png" alt="{lang}gws.gewinnspiel.statusspielen{/lang}" title="{lang}gws.gewinnspiel.statusspielen{/lang}" /></a> 70 71 {/if} 71 {if $gewinnspiel.permission == "ok"&& $gewinnspiel.done == "done"}72 {if $gewinnspiel.permission == true && $gewinnspiel.done == "done"} 72 73 <img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielNotokS.png" alt="{lang}gws.gewinnspiel.statusgespielt{/lang}" title="{lang}gws.gewinnspiel.statusgespielt{/lang}" /> 73 74 {/if} 74 {if $gewinnspiel.permission == "nein"&& $gewinnspiel.done == "notdone"}75 {if !$gewinnspiel.permission && $gewinnspiel.done == "notdone"} 75 76 <img src="{@RELATIVE_GWSP_DIR}icon/gewinnspielNotokS.png" alt="{lang}gws.gewinnspiel.statusnotok{/lang}" title="{lang}gws.gewinnspiel.statusnotok{/lang}" /> 76 77 {/if} … … 83 84 </fieldset> 84 85 <div class="contentHeader"> 85 {assign var=multiplePagesLink value="index.php?page= Gewinnspiel&pageNo=%d"}86 {assign var=multiplePagesLink value="index.php?page=Index&pageNo=%d"} 86 87 {pages print=true assign=pagesOutput link=$multiplePagesLink|concat:SID_ARG_2ND_NOT_ENCODED} 87 88 </div>
