HomeHelpTrac

Ignore:
Timestamp:
10/31/08 11:35:27 (4 years ago)
Author:
nell
Message:

Changed alerts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/classes/BxDolAlerts.php

    r7345 r7387  
    1414    var $aUnit; 
    1515    var $aSupportModules = array( 
    16         'alertUser' => array( 'class' => 'BxDolAlertsResponseUser', 'file' => ''), 
     16        'alertUser' => array('class' => 'BxDolAlertsResponseUser', 'file' => '') 
    1717    ); 
    1818 
    19     var $aSupportUnits = array( 
    20          
    21         'profile'   =>  array( 
    22             'picFile'   =>  'mbs.gif', 
    23             'caption'   =>  '_My Profile', 
    24             'viewLink'  =>  '', 
    25             'actions'   =>  array( 
    26                 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_profile_comment', \$sArg);"), 
    27                 'rate'=>array('message'=>"return _t('_your profile has been rated');") 
    28             ) 
    29         ), 
    30          
    31         'sharedPhoto' => array( 
    32             'picFile'   =>  'pph.gif', 
    33             'caption'   =>  '_Shared Photos', 
    34             'viewLink'  =>  '', 
    35             'actions'   =>  array( 
    36                 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedPhoto_comment', \$sArg);"), 
    37                 'rate'=>array('message'=>"return _t('_your sharedPhoto has been rated');") 
    38             ) 
    39         ), 
    40          
    41         'sharedMusic' => array( 
    42             'picFile'   =>  'pmu.gif', 
    43             'caption'   =>  '_Shared Music Files', 
    44             'viewLink'  =>  '', 
    45             'actions'   =>  array( 
    46                 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedMusic_comment', \$sArg);"), 
    47                 'rate'=>array('message'=>"return _t('_your sharedMusic has been rated');") 
    48             ) 
    49         ), 
    50          
    51         'sharedVideo' => array( 
    52             'picFile'   =>  'pvi.gif', 
    53             'caption'   =>  '_Shared Videos', 
    54             'viewLink'  =>  '', 
    55             'actions'   =>  array( 
    56                 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedVideo_comment', \$sArg);"), 
    57                 'rate'=>array('message'=>"return _t('_your sharedVideo has been rated');") 
    58             ) 
    59         ), 
    60          
    61         'friend' => array( 
    62             'picFile'   =>  'frs.gif', 
    63             'caption'   =>  '_Friends', 
    64             'viewLink'  =>  '', 
    65             'actions'   =>  array( 
    66                 'request'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_invited_friend', \$sArg);"), 
    67                 'accept' =>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_added_friend', \$sArg);") 
    68          ) 
    69         ), 
    70          
    71         'blogposts' => array( 
    72             'picFile'   =>  'pts.gif', 
    73             'caption'   =>  '_Blogs', 
    74             'viewLink'  =>  '', 
    75             'actions'   =>  array( 
    76                 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_made_blog_post', \$sArg);") 
    77         ) 
    78        ), 
    79         
    80        'guestbook' => array( 
    81             'picFile'   =>  'ars.gif', 
    82             'caption'   =>  '_Guestbook', 
    83             'viewLink'  =>  '', 
    84             'actions'   =>  array( 
    85                 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_guestbook_comment', \$sArg);") 
    86             ) 
    87         ), 
    88         'classifieds' => array( 
    89             'picFile'   =>  'cls.gif', 
    90             'caption'   =>  '_Classifieds', 
    91             'viewLink'  =>  '', 
    92             'actions'   =>  array( 
    93                 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_classified_comment', \$sArg);"), 
    94                 'buy' =>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_bought_classified', \$sArg);"), 
    95             ) 
    96         ) 
     19    var $aUnits = array( 
     20        'profile' => array('commentPost', 'rate'), 
     21        'sharedPhoto' => array('commentPost', 'rate'), 
     22        'sharedMusic' => array('commentPost', 'rate'), 
     23        'sharedVideo' => array('commentPost', 'rate'), 
     24        'friend' => array('request', 'accept'), 
     25        'blogposts' => array('commentPost'), 
     26        'classified' => array('commentPost', 'buy') 
    9727    ); 
    9828     
     
    10737        'actionUrl' =>   'actionUrl', 
    10838        'actionText'=>   'actionText', 
    109         'actionDate'=>   'actionDate', 
     39        'actionDate'=>   'actionDate' 
    11040    ); 
    11141     
     
    12252        $this->sUnit   = process_db_input(clear_xss($sUnit)); 
    12353 
    124         if (isset($this->aSupportUnits[$this->sUnit])) 
    125             $this->aUnit = $this->aSupportUnits[$this->sUnit]; 
     54        if (isset($this->aUnits[$this->sUnit])) 
     55            $this->aUnit[$sType] = $this->aUnits[$this->sUnit]; 
    12656        else 
    12757            return; 
     
    13767        foreach ($this->aSupportModules as $a) { 
    13868            $sClass = $a['class']; 
    139             if ($a['file'] && !class_exists($sClass)) 
    140                 include_once(BX_DIRECTORY_PATH_ROOT . $a['file']); 
     69            if ($a['file'] && !class_exists($sClass) && file_exists(BX_DIRECTORY_PATH_ROOT . $a['file'])) 
     70                include_once(BX_DIRECTORY_PATH_ROOT . $a['file']); 
     71             
    14172            $o = new $sClass(); 
    14273            $o->response($this); 
     
    15687 
    15788class BxDolAlertsResponseUser extends BxDolAlertsResponse { 
    158  
     89    var $aSupportUnits = array( 
     90        'profile'   =>  array( 
     91            'picFile'   =>  'mbs.gif', 
     92            'caption'   =>  '_My Profile', 
     93            'viewLink'  =>  '', 
     94            'actions'   =>  array( 
     95                'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_profile_comment', \$sArg);"), 
     96                'rate'=>array('message'=>"return _t('_your profile has been rated');") 
     97            ) 
     98        ), 
     99         
     100        'sharedPhoto' => array( 
     101            'picFile'   =>  'pph.gif', 
     102            'caption'   =>  '_Shared Photos', 
     103            'viewLink'  =>  '', 
     104            'actions'   =>  array( 
     105                'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedPhoto_comment', \$sArg);"), 
     106                'rate'=>array('message'=>"return _t('_your sharedPhoto has been rated');") 
     107            ) 
     108        ), 
     109         
     110        'sharedMusic' => array( 
     111            'picFile'   =>  'pmu.gif', 
     112            'caption'   =>  '_Shared Music Files', 
     113            'viewLink'  =>  '', 
     114            'actions'   =>  array( 
     115                'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedMusic_comment', \$sArg);"), 
     116                'rate'=>array('message'=>"return _t('_your sharedMusic has been rated');") 
     117            ) 
     118        ), 
     119         
     120        'sharedVideo' => array( 
     121            'picFile'   =>  'pvi.gif', 
     122            'caption'   =>  '_Shared Videos', 
     123            'viewLink'  =>  '', 
     124            'actions'   =>  array( 
     125                'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedVideo_comment', \$sArg);"), 
     126                'rate'=>array('message'=>"return _t('_your sharedVideo has been rated');") 
     127            ) 
     128        ), 
     129         
     130        'friend' => array( 
     131            'picFile'   =>  'frs.gif', 
     132            'caption'   =>  '_Friends', 
     133            'viewLink'  =>  '', 
     134            'actions'   =>  array( 
     135                'request'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_invited_friend', \$sArg);"), 
     136                'accept' =>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_added_friend', \$sArg);") 
     137         ) 
     138        ), 
     139         
     140        'blogposts' => array( 
     141            'picFile'   =>  'pts.gif', 
     142            'caption'   =>  '_Blogs', 
     143            'viewLink'  =>  '', 
     144            'actions'   =>  array( 
     145                'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_made_blog_post', \$sArg);") 
     146        ) 
     147       ), 
     148         
     149       'classifieds' => array( 
     150            'picFile'   =>  'cls.gif', 
     151            'caption'   =>  '_Classifieds', 
     152            'viewLink'  =>  '', 
     153            'actions'   =>  array( 
     154                'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_classified_comment', \$sArg);"), 
     155                'buy' =>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_bought_classified', \$sArg);"), 
     156            ) 
     157        ) 
     158    ); 
    159159 
    160160    var $aInfo = array( 
    161          
    162161        'profile'   =>  array( 
    163162            'infoTable' => '', 
     
    190189        ), 
    191190         
    192         'blogposts' => array( 
     191        'blog' => array( 
    193192            'customQuery'=>'SELECT `BlogCategories`.`OwnerID` FROM `BlogCategories` 
    194193                INNER JOIN `BlogPosts` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID` 
     
    196195        ), 
    197196         
    198         'guestbook' =>  array( 
    199             'infoTable' => '', 
    200             'infoObjId' => '', 
    201             'infoOwner' => '' 
    202         ), 
    203          
    204         'classifieds'=> array( 
     197        'classified'=>  array( 
    205198            'infoTable' => 'ClassifiedsAdvertisements', 
    206199            'infoObjId' => 'ID', 
     
    208201        ) 
    209202    ); 
     203     
     204    var $aCurrent; 
    210205 
    211206    function response($o) {   
    212         $sLink = $o->aUnit['actions']['viewLink']; 
    213         $sText = addslashes($o->aUnit['actions'][$o->sAction]['message']); 
     207        if (isset($this->aSupportUnits[$o->sUnit])) { 
     208            $this->aCurrent = $this->aSupportUnits[$o->sUnit]; 
     209         
     210        $sLink = $this->aCurrent['actions']['viewLink']; 
     211        $sText = addslashes($this->aCurrent['actions'][$o->sAction]['message']); 
    214212        $sText = str_replace('__iSender__', $o->iSender, $sText); 
    215213        $a = $this->aInfo[$o->sUnit]; 
     
    235233                `{$o->aAlrFields['actionDate']}` = UNIX_TIMESTAMP() 
    236234            "; 
    237      
    238             db_res($sqlQuery); 
    239         }    
     235      
     236        db_res($sqlQuery); 
     237        } 
     238      }  
    240239    } 
    241240 
Note: See TracChangeset for help on using the changeset viewer.