PageListPop_db_num ); break; case 'hot': $_page['header'] = _t('_Hot list'); $_page_cont[$_ni]['page_main_code'] = DesignBoxContent( _t('_Hot list'), PageListHot($sourceID, $targetID), $oTemplConfig -> PageListPop_db_num ); break; case 'friend': $_page['header'] = _t('_Friend list'); $_page_cont[$_ni]['page_main_code'] = DesignBoxContent(_t('_Friend list'), PageListFriend($sourceID, $targetID), $oTemplConfig -> PageListPop_db_num ); break; case 'spam': $_page['header'] = _t('_Spam report'); $_page_cont[$_ni]['page_main_code'] = DesignBoxContent( _t('_Spam report'), PageListSpam($sourceID, $targetID), $oTemplConfig -> PageListPop_db_num); break; } PageCode(); function PageListBlock( $sourceID, $targetID ) { $ret = ''; $query = "REPLACE INTO `BlockList` SET `ID` = '$sourceID', `Profile` = '$targetID';"; if( db_res($query, 0) ) { $ret = _t_action('_User was added to block list'); } else { $ret = _t_err('_Failed to apply changes'); } return $ret; } function PageListHot($sourceID, $targetID) { $ret = ''; $query = "REPLACE INTO `HotList` SET `ID` = '$sourceID', `Profile` = '$targetID';"; if( db_res($query, 0) ) { $ret = _t_action('_User was added to hot list'); } else { $ret = _t_err('_Failed to apply changes'); } return $ret; } function PageListFriend($sourceID, $targetID) { $ret = ''; $query = "SELECT * FROM `FriendList` WHERE (`ID` = '$sourceID' and `Profile` = '$targetID') or ( `ID` = '$targetID' and `Profile` = '$sourceID')"; $temp = db_assoc_arr($query); if( $sourceID == $temp['ID'] || $temp['Check'] == 1 ) { $ret = _t_action('_already_in_friend_list'); } elseif( $targetID == $temp['ID'] && 0 == $temp['Check'] ) { $query = "UPDATE `FriendList` SET `Check` = '1' WHERE `ID` = '$targetID' AND `Profile` = '$sourceID';"; if( db_res($query) ) { $ret = _t_action('_User was added to friend list'); } else { $ret = _t_err('_Failed to apply changes'); } } else { $query = "INSERT INTO `FriendList` SET `ID` = '$sourceID', `Profile` = '$targetID', `Check` = '0';"; if( db_res( $query ) ) { $ret = _t_action('_User was invited to friend list'); } else { $ret = _t_err('_Failed to apply changes'); } } return $ret; } function PageListSpam($sourceID, $targetID) { global $site; $reporterID = $sourceID; $spamerID = $targetID; $aReporter = getProfileInfo( $reporterID );// db_arr("SELECT `NickName` FROM `Profiles` WHERE `ID` = '$reporterID';", 0); $aSpamer = getProfileInfo( $spamerID );//db_arr("SELECT `NickName` FROM `Profiles` WHERE `ID` = '$spamerID';", 0); $message = getParam( "t_SpamReport" ); $subject = getParam('t_SpamReport_subject'); $aPlus = array(); $aPlus['reporterID'] = $reporterID; $aPlus['reporterNick'] = $aReporter['NickName']; $aPlus['spamerID'] = $spamerID; $aPlus['spamerNick'] = $aSpamer['NickName']; $mail_result = sendMail( $site['email'], $subject, $message, '', $aPlus ); if ( $mail_result ) $ret = _t_action('_Report about spam was sent'); else $ret = _t_err('_Report about spam failed to sent'); return $ret; } ?>