Changeset 308

Show
Ignore:
Timestamp:
03/09/08 21:48:55 (5 years ago)
Author:
MDMAN
Message:

New Search for new applications for the Info-Box

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • application.register/files/lib/system/event/listener/ApplicationRegisterListener.class.php

    r303 r308  
    1515        public $templateName = 'applicationRegister'; 
    1616        public $count = 0; 
     17        public $applications = array(); 
     18        public $disables = array(); 
    1719         
    1820        /** 
     
    2224                if(self::$check || WCF::getUser()->userID == 0) return; 
    2325                self::$check = true; 
    24                 $a = 0; 
    25                 $b = 0; 
     26                 
    2627                $c = 0; 
    27                 $sql = "SELECT          COUNT(*) AS a 
     28 
     29                $sql = "SELECT          applicationID 
    2830                                FROM            wcf".WCF_N."_group_application application 
    2931                                WHERE           application.groupID IN ( 
     
    3234                                                        WHERE   userID = ".WCF::getUser()->userID." 
    3335                                                ) 
    34                                 AND                     application.applicationStatus = 0"; 
     36                                AND                     application.applicationStatus = '0' 
     37                                "; 
    3538 
    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                } 
    3743                 
    38                 $a = $row['a']; 
     44                $sql = "SELECT          applicationID 
     45                                FROM            wcf".WCF_N."_group_application_notification 
     46                                WHERE           userID = ".WCF::getUser()->userID." 
     47                                "; 
    3948                 
    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){             
    4661                 
    47                 $b = $row['b']; 
    48                  
    49                 $c = $a - $b; 
    50  
    51                 if ($c > 0){ 
    5262                        //Hier werden die Variablen im Template registriert 
    5363                        WCF::getTPL()->assign(array( 
    54                                 'count' => $c 
     64                                'count' => $c, 
    5565                        )); 
    5666