Changeset 8652 for trunk/inc/classes/BxDolCommunicator.php
- Timestamp:
- 01/20/09 05:17:52 (3 years ago)
- File:
-
- 1 edited
-
trunk/inc/classes/BxDolCommunicator.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/classes/BxDolCommunicator.php
r8627 r8652 65 65 * 66 66 * @param : $sTableName (string) - DB's table name; 67 * @param : $sAdditionalParam (string) - additional SQL query ;68 67 * @param : $aRequestTypes (array) - contain language keys for differences person's mode ; 69 [ from ] - needed if person mode = 'from' ; 70 [ to ] - needed if person mode = 'to' ; 68 [ from ] - needed if person mode = 'from' ; 69 [ to ] - needed if person mode = 'to' ; 70 * @param : $sAdditionalParam (string) - additional SQL query ; 71 * @param : $sAdditionalField (string) - additional table's field ; 71 72 * @return : (array) array with all requests ; 72 */ 73 function getRequests( $sTableName, $sAdditionalParam, &$aRequestTypes) 73 [ member_id ] - member's ID ; 74 [ date ] - request's date ; 75 [ type ] - type of request ; 76 */ 77 function getRequests( $sTableName, &$aRequestTypes, $sAdditionalParam = null, $sAdditionalField = null ) 74 78 { 75 79 // ** init some needed variables ; … … 135 139 $sSqlLimit = "LIMIT {$sLimitFrom}, {$this -> aCommunicatorSettings['per_page']}"; 136 140 141 // define the additional table's field ; 142 $sExtFieldName = ( $sAdditionalField ) ? ", `{$sTableName}`.`{$sAdditionalField}`" : null ; 143 137 144 $sQuery = 138 145 " … … 145 152 146 153 DATE_FORMAT(`{$sTableName}`.`When`, '%d.%m.%Y %H.%i') AS `sDate` 154 {$sExtFieldName} 147 155 FROM 148 156 `{$sTableName}` 149 INNERJOIN157 LEFT JOIN 150 158 `Profiles` 151 159 ON … … 162 170 $rResult = db_res($sQuery); 163 171 while( $aRow = mysql_fetch_assoc($rResult) ) 164 { 172 { 173 $sExtType = ( !empty($aRequestTypes['specific_key']) and $sAdditionalField ) 174 ? ' ' . _t( $aRequestTypes['specific_key'], $aRow[$sAdditionalField] ) 175 : null ; 176 165 177 $aRequests[] = array 166 178 ( 167 179 'member_id' => $aRow['iMemberID'], 168 180 'date' => $aRow['sDate'], 169 'type' => $aRow['sType'] 181 'type' => $aRow['sType'] . $sExtType, 170 182 ); 171 183 } … … 230 242 * @param : $iMemberID (integer) - member's ID ; 231 243 */ 232 function Delete FromHotList( $iMemberID )244 function DeleteHotList( $iMemberID ) 233 245 { 234 246 $sQuery = … … 250 262 * @param : $iMemberID (integer) - member's ID ; 251 263 */ 252 function Add ToHotList($iMemberID)264 function AddHotList($iMemberID) 253 265 { 254 266 $sQuery = … … 281 293 282 294 /** 295 * Function will delete from greetings ; 296 * 297 * @param : $bFromOwner (integer) - swith mode to from owner or from recipent ; 298 * @param : $iMemberID (integer) - member's ID ; 299 */ 300 function DeleteGreeting( $iMemberID, $iFromOwner = 0 ) 301 { 302 // define the table's field ; 303 if ( !$iFromOwner ) 304 { 305 $iID = $iMemberID; 306 $iProfile = $this -> aCommunicatorSettings['member_id']; 307 } 308 else 309 { 310 $iID = $this -> aCommunicatorSettings['member_id']; 311 $iProfile = $iMemberID; 312 } 313 314 $sQuery = "DELETE FROM `Greetings` WHERE `ID` = {$iID} AND `Profile` = {$iProfile}"; 315 db_res($sQuery); 316 } 317 318 /** 283 319 * Function will execute the received method name ; 284 320 * … … 292 328 if ( is_callable($aCallback) and is_array($aRowsList) and !empty($aRowsList) ) 293 329 { 294 foreach( $aRowsList AS $i Key)330 foreach( $aRowsList AS $iMemberID ) 295 331 { 296 $iMemberID = (int) $iKey; 297 if ($iMemberID) 332 if ( is_numeric($iMemberID) ) 298 333 { 299 $aExtendedParameters = array_merge( array( $iMemberID), $aParameters );334 $aExtendedParameters = array_merge( array( $iMemberID), $aParameters ); 300 335 call_user_func_array($aCallback, $aExtendedParameters ); 301 } 336 } 302 337 } 303 338 }
Note: See TracChangeset
for help on using the changeset viewer.