Changeset 7387 for trunk/inc/classes/BxDolAlerts.php
- Timestamp:
- 10/31/08 11:35:27 (4 years ago)
- File:
-
- 1 edited
-
trunk/inc/classes/BxDolAlerts.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/classes/BxDolAlerts.php
r7345 r7387 14 14 var $aUnit; 15 15 var $aSupportModules = array( 16 'alertUser' => array( 'class' => 'BxDolAlertsResponseUser', 'file' => ''),16 'alertUser' => array('class' => 'BxDolAlertsResponseUser', 'file' => '') 17 17 ); 18 18 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') 97 27 ); 98 28 … … 107 37 'actionUrl' => 'actionUrl', 108 38 'actionText'=> 'actionText', 109 'actionDate'=> 'actionDate' ,39 'actionDate'=> 'actionDate' 110 40 ); 111 41 … … 122 52 $this->sUnit = process_db_input(clear_xss($sUnit)); 123 53 124 if (isset($this->a SupportUnits[$this->sUnit]))125 $this->aUnit = $this->aSupportUnits[$this->sUnit];54 if (isset($this->aUnits[$this->sUnit])) 55 $this->aUnit[$sType] = $this->aUnits[$this->sUnit]; 126 56 else 127 57 return; … … 137 67 foreach ($this->aSupportModules as $a) { 138 68 $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 141 72 $o = new $sClass(); 142 73 $o->response($this); … … 156 87 157 88 class 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 ); 159 159 160 160 var $aInfo = array( 161 162 161 'profile' => array( 163 162 'infoTable' => '', … … 190 189 ), 191 190 192 'blog posts' => array(191 'blog' => array( 193 192 'customQuery'=>'SELECT `BlogCategories`.`OwnerID` FROM `BlogCategories` 194 193 INNER JOIN `BlogPosts` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID` … … 196 195 ), 197 196 198 'guestbook' => array( 199 'infoTable' => '', 200 'infoObjId' => '', 201 'infoOwner' => '' 202 ), 203 204 'classifieds'=> array( 197 'classified'=> array( 205 198 'infoTable' => 'ClassifiedsAdvertisements', 206 199 'infoObjId' => 'ID', … … 208 201 ) 209 202 ); 203 204 var $aCurrent; 210 205 211 206 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']); 214 212 $sText = str_replace('__iSender__', $o->iSender, $sText); 215 213 $a = $this->aInfo[$o->sUnit]; … … 235 233 `{$o->aAlrFields['actionDate']}` = UNIX_TIMESTAMP() 236 234 "; 237 238 db_res($sqlQuery); 239 } 235 236 db_res($sqlQuery); 237 } 238 } 240 239 } 241 240
Note: See TracChangeset
for help on using the changeset viewer.