Changeset 308
- Timestamp:
- 03/09/08 21:48:55 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
application.register/files/lib/system/event/listener/ApplicationRegisterListener.class.php
r303 r308 15 15 public $templateName = 'applicationRegister'; 16 16 public $count = 0; 17 public $applications = array(); 18 public $disables = array(); 17 19 18 20 /** … … 22 24 if(self::$check || WCF::getUser()->userID == 0) return; 23 25 self::$check = true; 24 $a = 0; 25 $b = 0; 26 26 27 $c = 0; 27 $sql = "SELECT COUNT(*) AS a 28 29 $sql = "SELECT applicationID 28 30 FROM wcf".WCF_N."_group_application application 29 31 WHERE application.groupID IN ( … … 32 34 WHERE userID = ".WCF::getUser()->userID." 33 35 ) 34 AND application.applicationStatus = 0"; 36 AND application.applicationStatus = '0' 37 "; 35 38 36 $row = WCF::getDB()->getFirstRow($sql); 39 $res = WCF::getDB()->sendQuery($sql); 40 while ($row = WCF::getDB()->fetchArray($res)){ 41 $this->applications[]= $row["applicationID"]; 42 } 37 43 38 $a = $row['a']; 44 $sql = "SELECT applicationID 45 FROM wcf".WCF_N."_group_application_notification 46 WHERE userID = ".WCF::getUser()->userID." 47 "; 39 48 40 $sql = "SELECT COUNT(*) AS b 41 FROM wcf".WCF_N."_group_application_notification notification 42 WHERE userID = ".WCF::getUser()->userID." 43 "; 44 45 $row = WCF::getDB()->getFirstRow($sql); 49 $res = WCF::getDB()->sendQuery($sql); 50 while ($row = WCF::getDB()->fetchArray($res)){ 51 $this->disables[]= $row["applicationID"]; 52 } 53 if (isset ($this->disables)){ 54 $result = array_diff($this->applications, $this->disables); 55 } 56 57 if (isset($result)){ 58 $c = count($result); 59 } 60 if ($c > 0){ 46 61 47 $b = $row['b'];48 49 $c = $a - $b;50 51 if ($c > 0){52 62 //Hier werden die Variablen im Template registriert 53 63 WCF::getTPL()->assign(array( 54 'count' => $c 64 'count' => $c, 55 65 )); 56 66
