| 1 | <? |
|---|
| 2 | |
|---|
| 3 | /*************************************************************************** |
|---|
| 4 | * Dolphin Smart Community Builder |
|---|
| 5 | * ----------------- |
|---|
| 6 | * begin : Mon Mar 23 2006 |
|---|
| 7 | * copyright : (C) 2006 BoonEx Group |
|---|
| 8 | * website : http://www.boonex.com/ |
|---|
| 9 | * This file is part of Dolphin - Smart Community Builder |
|---|
| 10 | * |
|---|
| 11 | * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. |
|---|
| 12 | * http://creativecommons.org/licenses/by/3.0/ |
|---|
| 13 | * |
|---|
| 14 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|---|
| 15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|---|
| 16 | * See the Creative Commons Attribution 3.0 License for more details. |
|---|
| 17 | * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, |
|---|
| 18 | * see license.txt file; if not, write to marketing@boonex.com |
|---|
| 19 | ***************************************************************************/ |
|---|
| 20 | |
|---|
| 21 | require_once( 'inc/header.inc.php' ); |
|---|
| 22 | require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); |
|---|
| 23 | require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); |
|---|
| 24 | |
|---|
| 25 | $_page['name_index'] = 44; |
|---|
| 26 | |
|---|
| 27 | $logged['member'] = member_auth(0); |
|---|
| 28 | |
|---|
| 29 | $sourceID = (int)$_COOKIE['memberID']; |
|---|
| 30 | $targetID = (int)$_GET['ID']; |
|---|
| 31 | $action = $_GET['action']; |
|---|
| 32 | |
|---|
| 33 | $_ni = $_page['name_index']; |
|---|
| 34 | |
|---|
| 35 | switch ($action) |
|---|
| 36 | { |
|---|
| 37 | case 'block': |
|---|
| 38 | $_page['header'] = _t( "_Block list" ); |
|---|
| 39 | $_page_cont[$_ni]['page_main_code'] = DesignBoxContent( _t('_Block list'), PageListBlock($sourceID, $targetID), $oTemplConfig -> PageListPop_db_num ); |
|---|
| 40 | break; |
|---|
| 41 | case 'hot': |
|---|
| 42 | $_page['header'] = _t('_Hot list'); |
|---|
| 43 | $_page_cont[$_ni]['page_main_code'] = DesignBoxContent( _t('_Hot list'), PageListHot($sourceID, $targetID), $oTemplConfig -> PageListPop_db_num ); |
|---|
| 44 | break; |
|---|
| 45 | case 'friend': |
|---|
| 46 | $_page['header'] = _t('_Friend list'); |
|---|
| 47 | $_page_cont[$_ni]['page_main_code'] = DesignBoxContent(_t('_Friend list'), PageListFriend($sourceID, $targetID), $oTemplConfig -> PageListPop_db_num ); |
|---|
| 48 | break; |
|---|
| 49 | case 'spam': |
|---|
| 50 | $_page['header'] = _t('_Spam report'); |
|---|
| 51 | $_page_cont[$_ni]['page_main_code'] = DesignBoxContent( _t('_Spam report'), PageListSpam($sourceID, $targetID), $oTemplConfig -> PageListPop_db_num); |
|---|
| 52 | break; |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | PageCode(); |
|---|
| 56 | |
|---|
| 57 | function PageListBlock( $sourceID, $targetID ) |
|---|
| 58 | { |
|---|
| 59 | $ret = ''; |
|---|
| 60 | $query = "REPLACE INTO `BlockList` SET `ID` = '$sourceID', `Profile` = '$targetID';"; |
|---|
| 61 | if( db_res($query, 0) ) |
|---|
| 62 | { |
|---|
| 63 | $ret = _t_action('_User was added to block list'); |
|---|
| 64 | } |
|---|
| 65 | else |
|---|
| 66 | { |
|---|
| 67 | $ret = _t_err('_Failed to apply changes'); |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | return $ret; |
|---|
| 71 | } |
|---|
| 72 | |
|---|
| 73 | function PageListHot($sourceID, $targetID) |
|---|
| 74 | { |
|---|
| 75 | $ret = ''; |
|---|
| 76 | |
|---|
| 77 | $query = "REPLACE INTO `HotList` SET `ID` = '$sourceID', `Profile` = '$targetID';"; |
|---|
| 78 | if( db_res($query, 0) ) |
|---|
| 79 | { |
|---|
| 80 | $ret = _t_action('_User was added to hot list'); |
|---|
| 81 | } |
|---|
| 82 | else |
|---|
| 83 | { |
|---|
| 84 | $ret = _t_err('_Failed to apply changes'); |
|---|
| 85 | } |
|---|
| 86 | |
|---|
| 87 | return $ret; |
|---|
| 88 | } |
|---|
| 89 | |
|---|
| 90 | function PageListFriend($sourceID, $targetID) |
|---|
| 91 | { |
|---|
| 92 | $ret = ''; |
|---|
| 93 | $query = "SELECT * FROM `FriendList` WHERE (`ID` = '$sourceID' and `Profile` = '$targetID') or ( `ID` = '$targetID' and `Profile` = '$sourceID')"; |
|---|
| 94 | $temp = db_assoc_arr($query); |
|---|
| 95 | |
|---|
| 96 | if( $sourceID == $temp['ID'] || $temp['Check'] == 1 ) |
|---|
| 97 | { |
|---|
| 98 | $ret = _t_action('_already_in_friend_list'); |
|---|
| 99 | } |
|---|
| 100 | elseif( $targetID == $temp['ID'] && 0 == $temp['Check'] ) |
|---|
| 101 | { |
|---|
| 102 | $query = "UPDATE `FriendList` SET `Check` = '1' WHERE `ID` = '$targetID' AND `Profile` = '$sourceID';"; |
|---|
| 103 | if( db_res($query) ) |
|---|
| 104 | { |
|---|
| 105 | $ret = _t_action('_User was added to friend list'); |
|---|
| 106 | } |
|---|
| 107 | else |
|---|
| 108 | { |
|---|
| 109 | $ret = _t_err('_Failed to apply changes'); |
|---|
| 110 | } |
|---|
| 111 | } |
|---|
| 112 | else |
|---|
| 113 | { |
|---|
| 114 | $query = "INSERT INTO `FriendList` SET `ID` = '$sourceID', `Profile` = '$targetID', `Check` = '0';"; |
|---|
| 115 | if( db_res( $query ) ) |
|---|
| 116 | { |
|---|
| 117 | $ret = _t_action('_User was invited to friend list'); |
|---|
| 118 | } |
|---|
| 119 | else |
|---|
| 120 | { |
|---|
| 121 | $ret = _t_err('_Failed to apply changes'); |
|---|
| 122 | } |
|---|
| 123 | |
|---|
| 124 | } |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | return $ret; |
|---|
| 128 | } |
|---|
| 129 | |
|---|
| 130 | function PageListSpam($sourceID, $targetID) |
|---|
| 131 | { |
|---|
| 132 | global $site; |
|---|
| 133 | |
|---|
| 134 | $reporterID = $sourceID; |
|---|
| 135 | $spamerID = $targetID; |
|---|
| 136 | |
|---|
| 137 | $aReporter = getProfileInfo( $reporterID );// db_arr("SELECT `NickName` FROM `Profiles` WHERE `ID` = '$reporterID';", 0); |
|---|
| 138 | $aSpamer = getProfileInfo( $spamerID );//db_arr("SELECT `NickName` FROM `Profiles` WHERE `ID` = '$spamerID';", 0); |
|---|
| 139 | |
|---|
| 140 | $message = getParam( "t_SpamReport" ); |
|---|
| 141 | $subject = getParam('t_SpamReport_subject'); |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | $aPlus = array(); |
|---|
| 145 | $aPlus['reporterID'] = $reporterID; |
|---|
| 146 | $aPlus['reporterNick'] = $aReporter['NickName']; |
|---|
| 147 | |
|---|
| 148 | $aPlus['spamerID'] = $spamerID; |
|---|
| 149 | $aPlus['spamerNick'] = $aSpamer['NickName']; |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | $mail_result = sendMail( $site['email'], $subject, $message, '', $aPlus ); |
|---|
| 153 | |
|---|
| 154 | if ( $mail_result ) |
|---|
| 155 | $ret = _t_action('_Report about spam was sent'); |
|---|
| 156 | else |
|---|
| 157 | $ret = _t_err('_Report about spam failed to sent'); |
|---|
| 158 | |
|---|
| 159 | return $ret; |
|---|
| 160 | } |
|---|
| 161 | |
|---|
| 162 | ?> |
|---|