8 require_once(CH_DIRECTORY_PATH_INC .
"utils.inc.php");
9 require_once(CH_DIRECTORY_PATH_INC .
"membership_levels.inc.php");
10 require_once(CH_DIRECTORY_PATH_CLASSES .
"ChWsbInstallerUtils.php");
15 return $aMembership[
"ID"];
20 $aMemberships = array();
21 $rResult =
getResult(
"SELECT * FROM `sys_acl_levels`");
22 $iCount = $rResult->rowCount();
23 for($i=0; $i<$iCount; $i++) {
24 $aMembership = $rResult->fetch();
25 $aMemberships[$aMembership[
"ID"]] = $aMembership[
"Name"];
32 $rResult =
getResult(
"SELECT `ID` FROM `Profiles` WHERE (`Role` & 2)");
34 $iCount = $rResult->rowCount();
35 for($i=0; $i<$iCount; $i++) {
36 $aId = $rResult->fetch();
37 $aIds[] = (int)$aId[
'ID'];
45 return in_array((
int)
$iId, $aIds);
69 getResult(
"REPLACE INTO `sys_block_list` SET `ID` = '" . $iUserId .
"', `Profile` = '" . $iBlockedId .
"'");
72 getResult(
"DELETE FROM `sys_block_list` WHERE `ID` = '" . $iUserId .
"' AND `Profile` = '" . $iBlockedId .
"'");
80 $sSelectField = $bBlocking ?
"ID" :
"Profile";
81 $sWhereField = $bBlocking ?
"Profile" :
"ID";
83 $sType =
getValue(
"SELECT `Type` FROM `" . MODULE_DB_PREFIX .
"Profiles` WHERE `ID`='" .
$sId .
"' LIMIT 1");
86 $aAllTypes = array(CHAT_TYPE_FULL, CHAT_TYPE_MODER, CHAT_TYPE_ADMIN);
87 $iTypeIndex = array_search(
$sType, $aAllTypes);
89 array_splice($aAllTypes, 0, $iTypeIndex);
91 array_splice($aAllTypes, $iTypeIndex+1, count($aAllTypes)-$iTypeIndex-1);
92 $sTypes = count($aAllTypes) > 0 ?
" AND `profiles`.`Type` IN ('" . implode(
"','", $aAllTypes) .
"')" :
"";
93 $rResult =
getResult(
"SELECT `blocked`.`" . $sSelectField .
"` AS `Member` FROM `sys_block_list` AS `blocked` LEFT JOIN `" . MODULE_DB_PREFIX .
"Profiles` AS `profiles` ON `blocked`.`" . $sSelectField .
"`=`profiles`.`ID` WHERE `blocked`.`" . $sWhereField .
"`='" .
$sId .
"'" . $sTypes);
96 $iCount = $rResult->rowCount();
97 for($i=0; $i<$iCount; $i++) {
98 $aBlocked = $rResult->fetch();
99 $aUsers[] = $aBlocked[
"Member"];