Файл: 2/3020.ru/modules/communities/plugins/introduction.php
Строк: 124
<?php
IF (ISSET($user['ID'])){
ECHO "<div class='list'>";
ECHO "<span id='int'>";
IF ($comm['PRIVATE'] == 0){
/*
-------------------
Открытое сообщество
-------------------
*/
IF (GET('get') == "int_go" && !ISSET($par['ID'])){
CSRF::GET_CHECK_VALID(GET('get'));
DB::GET_ADD("INSERT INTO `COMMUNITIES_PAR` (`USER_ID`, `COMMUNITY_ID`) VALUES ('".$user['ID']."', '".$comm['ID']."')");
}
IF (GET('get') == "int_stop" && ISSET($par['ID']) && $par['ADMINISTRATION'] != 1){
CSRF::GET_CHECK_VALID(GET('get'));
DB::GET_SET("DELETE FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."'");
}
IF (DB::GET_COLUMN("SELECT COUNT(*) FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."' LIMIT 1") == 0){
?><a class="btn" onclick="request('int', '/modules/?section=show&path=communities&id=<?=$comm['ID']?>&get=int_go&<?=$token_url?>', '#int')" load="none"><?=ICONS('plus', 15, 'fa-fw')?> <?=LG('Вступить')?></a><?
}ELSEIF (DB::GET_COLUMN("SELECT COUNT(*) FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."' AND `ADMINISTRATION` != '1' AND `ACT` = '1' LIMIT 1") == 1){
?><a class="btn-o" onclick="request('int', '/modules/?section=show&path=communities&id=<?=$comm['ID']?>&get=int_stop&<?=$token_url?>', '#int')" load="none"><?=ICONS('minus', 15, 'fa-fw')?> <?=LG('Покинуть')?></a><?
}ELSEIF (DB::GET_COLUMN("SELECT COUNT(*) FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."' AND `ADMINISTRATION` != '1' AND `ACT` = '2' LIMIT 1") == 1){
$inv = DB::GET_STRING("SELECT `ID`,`USER_ID`,`COMMUNITY_ID` FROM `COMMUNITIES_PAR` WHERE `USER_ID` = '".$user['ID']."' AND `ACT` = '2' AND `COMMUNITY_ID` = '".$comm['ID']."' LIMIT 1");
ECHO "<a class='btn' href='/modules/?path=communities§ion=users&id=".$user['ID']."&get=inv&yes=".$inv['ID']."&".$token_url."'>".ICONS('plus', 15, 'fa-fw')." ".LG('Принять приглашение')."</a>";
ECHO "<a class='btn' href='/modules/?path=communities§ion=users&id=".$user['ID']."&get=inv&no=".$inv['ID']."&".$token_url."'>".ICONS('times', 15, 'fa-fw')." ".LG('Отклонить приглашение')."</a>";
}
/*
-----------------------
Сообщество по интересам
-----------------------
*/
}ELSEIF ($comm['PRIVATE'] == 2){
IF (GET('get') == "int_go" && !ISSET($par['ID'])){
CSRF::GET_CHECK_VALID(GET('get'));
DB::GET_ADD("INSERT INTO `COMMUNITIES_PAR` (`USER_ID`, `COMMUNITY_ID`, `ACT`) VALUES ('".$user['ID']."', '".$comm['ID']."', '0')");
$message = "Пользователь [b]".$user['LOGIN']."[/b] хочет вступить в ваше сообщество [b]".ADSL($comm['NAME'])."[/b].
[a href=/modules/?path=communities§ion=show&id=".$comm['ID']."&get=plus]Перейти к заявкам >>>[/a]
";
DB::GET_ADD("INSERT INTO `MAIL_MESSAGE` (`USER_ID`, `MY_ID`, `TIME`, `MESSAGE`, `USER`) VALUES ('".$comm['USER_ID']."', '".CONFIG('SYSTEM')."', '".TIME()."', '".$message."', '".$comm['USER_ID']."'),('".CONFIG('SYSTEM')."', '".$comm['USER_ID']."', '".TIME()."', '".$message."', '".CONFIG('SYSTEM')."')");
}
IF (GET('get') == "int_cancel"){
CSRF::GET_CHECK_VALID(GET('get'));
DB::GET_SET("DELETE FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."' AND `ACT` = '0'");
}
IF (GET('get') == "int_stop" && ISSET($par['ID']) && $par['ADMINISTRATION'] != 1){
CSRF::GET_CHECK_VALID(GET('get'));
DB::GET_SET("DELETE FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."'");
}
IF (DB::GET_COLUMN("SELECT COUNT(*) FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."' LIMIT 1") == 0){
?><a class="btn" onclick="request('int', '/modules/?section=show&path=communities&id=<?=$comm['ID']?>&get=int_go&<?=$token_url?>', '#int')" load="none"><?=ICONS('plus', 15, 'fa-fw')?> <?=LG('Отправить заявку')?></a><?
}ELSEIF (DB::GET_COLUMN("SELECT COUNT(*) FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."' AND `ADMINISTRATION` != '1' AND `ACT` = '0' LIMIT 1") == 1){
?><a class="btn-o" onclick="request('int', '/modules/?section=show&path=communities&id=<?=$comm['ID']?>&get=int_cancel&<?=$token_url?>', '#int')" load="none"><?=ICONS('times', 15, 'fa-fw')?> <?=LG('Отменить заявку')?></a><?
}ELSEIF (DB::GET_COLUMN("SELECT COUNT(*) FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."' AND `ADMINISTRATION` != '1' AND `ACT` = '1' LIMIT 1") == 1){
?><a class="btn-o" onclick="request('int', '/modules/?section=show&path=communities&id=<?=$comm['ID']?>&get=int_stop&<?=$token_url?>', '#int')" load="none"><?=ICONS('minus', 15, 'fa-fw')?> <?=LG('Покинуть')?></a><?
}ELSEIF (DB::GET_COLUMN("SELECT COUNT(*) FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."' AND `ADMINISTRATION` != '1' AND `ACT` = '2' LIMIT 1") == 1){
$inv = DB::GET_STRING("SELECT `ID`,`USER_ID`,`COMMUNITY_ID` FROM `COMMUNITIES_PAR` WHERE `USER_ID` = '".$user['ID']."' AND `ACT` = '2' AND `COMMUNITY_ID` = '".$comm['ID']."' LIMIT 1");
ECHO "<a class='btn' href='/modules/?path=communities§ion=users&id=".$user['ID']."&get=inv&yes=".$inv['ID']."&".$token_url."'>".ICONS('plus', 15, 'fa-fw')." ".LG('Принять приглашение')."</a>";
ECHO "<a class='btn' href='/modules/?path=communities§ion=users&id=".$user['ID']."&get=inv&no=".$inv['ID']."&".$token_url."'>".ICONS('times', 15, 'fa-fw')." ".LG('Отклонить приглашение')."</a>";
}
/*
--------------------
Анонимное сообщество
--------------------
*/
}ELSEIF ($comm['PRIVATE'] == 1){
IF (GET('get') == "int_stop" && ISSET($par['ID']) && $par['ADMINISTRATION'] != 1){
CSRF::GET_CHECK_VALID(GET('get'));
DB::GET_SET("DELETE FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."'");
}
IF (DB::GET_COLUMN("SELECT COUNT(*) FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `ACT` = '1' AND `USER_ID` = '".$user['ID']."' AND `ADMINISTRATION` != '1' AND `ACT` = '1' LIMIT 1") == 1){
?><a class="btn-o" onclick="request('int', '/modules/?section=show&path=communities&id=<?=$comm['ID']?>&get=int_stop&<?=$token_url?>', '#int')" load="none"><?=ICONS('minus', 15, 'fa-fw')?> <?=LG('Покинуть')?></a><?
}ELSEIF (DB::GET_COLUMN("SELECT COUNT(*) FROM `COMMUNITIES_PAR` WHERE `COMMUNITY_ID` = '".$comm['ID']."' AND `USER_ID` = '".$user['ID']."' AND `ADMINISTRATION` != '1' AND `ACT` = '2' LIMIT 1") == 1){
$inv = DB::GET_STRING("SELECT `ID`,`USER_ID`,`COMMUNITY_ID` FROM `COMMUNITIES_PAR` WHERE `USER_ID` = '".$user['ID']."' AND `ACT` = '2' AND `COMMUNITY_ID` = '".$comm['ID']."' LIMIT 1");
ECHO "<a class='btn' href='/modules/?path=communities§ion=users&id=".$user['ID']."&get=inv&yes=".$inv['ID']."&".$token_url."'>".ICONS('plus', 15, 'fa-fw')." ".LG('Принять приглашение')."</a>";
ECHO "<a class='btn' href='/modules/?path=communities§ion=users&id=".$user['ID']."&get=inv&no=".$inv['ID']."&".$token_url."'>".ICONS('times', 15, 'fa-fw')." ".LG('Отклонить приглашение')."</a>";
}
}
ECHO "</span>";
ECHO "<a class='btn' href='/modules/?path=communities§ion=show&id=".$comm['ID']."&get=inv&inv=go'>".ICONS('plus', 15, 'fa-fw')." ".LG('Пригласить')."</a>";
ECHO "</div>";
}
?>