48 $forumID = intval($forumID);
50 $userID =
$USER->GetID();
52 $userID = intval($userID);
53 if (($forumID <= 0) || ($userID <= 0))
57 $arSelectTopic =
array();
58 foreach ($arTopic as $topicID)
59 $arSelectTopic[] = intval($topicID);
60 $arSelectTopic = array_unique(array_filter($arSelectTopic));
61 if (
sizeof($arSelectTopic) < 1)
65 $sTopicIDs = implode(
",", $arSelectTopic);
67 $strSql =
"SELECT FUT.TOPIC_ID,
68 ".$DB->DateToCharFunction(
"FUT.LAST_VISIT",
"FULL").
" as LAST_VISIT
69 FROM b_forum_user_topic FUT
70 WHERE (FORUM_ID=".$forumID.
" AND USER_ID=".$userID.
" AND TOPIC_ID IN (".$sTopicIDs.
"))";
71 $rVisit =
$DB->Query($strSql);
74 while ($arVisit = $rVisit->Fetch())
76 $arResult[$arVisit[
'TOPIC_ID']] = $arVisit[
'LAST_VISIT'];
84 $userID = (int) $userID;
90 $cacheID =
'b_forum_user_locked_' . $userID;
93 if (CACHED_b_forum_user !==
false && $cache->read(CACHED_b_forum_user, $cacheID,
'b_forum_user'))
95 $result = $cache->get($cacheID);
99 $allow = Bitrix\Forum\UserTable::query()
100 ->addSelect(
'ALLOW_POST')
101 ->where(
'USER_ID', $userID)
106 $result = $allow[
'ALLOW_POST'];
113 $cache->set($cacheID,
$result);
127 $CurrentUserID = intval($CurrentUserID);
128 if (in_array(1, $arUserGroups))
return True;
130 if ($arUser && intval($arUser[
"USER_ID"]) == $CurrentUserID)
return True;
137 if (in_array(1, $arUserGroups))
return True;
154 "id" =>
'EMPTY_USER_ID',
155 "text" =>
GetMessage(
"F_GL_ERR_EMPTY_USER_ID"));
159 $user = CUser::GetByID(
$arFields[
"USER_ID"])->fetch();
163 "id" =>
'USER_DOES_NOT_EXIST',
173 else if (!empty(
$res))
176 "id" =>
'USER_EXISTS',
179 else if (!array_key_exists(
"AVATAR",
$arFields) && $user[
"PERSONAL_PHOTO"] > 0)
181 $arFields[
"AVATAR"] = CFile::MakeFileArray($user[
"PERSONAL_PHOTO"]);
183 "width" => COption::GetOptionInt(
"forum",
"avatar_max_width", 100),
184 "height" => COption::GetOptionInt(
"forum",
"avatar_max_height", 100)))
199 "id" =>
'LAST_VISIT',
228 $max_size = COption::GetOptionInt(
"forum",
"file_max_size", 5242880);
230 "width" => COption::GetOptionInt(
"forum",
"avatar_max_width", 100),
231 "height" => COption::GetOptionInt(
"forum",
"avatar_max_height", 100));
232 $res = CFile::CheckImageFile(
$arFields[
"AVATAR"], $max_size);
235 $res = CFile::CheckImageFile(
$arFields[
"AVATAR"], $max_size, $size[
"width"], $size[
"height"]);
250 $GLOBALS[
"APPLICATION"]->ThrowException($e);
258 $arFields[
"SHOW_NAME"] = COption::GetOptionString(
"forum",
"USER_SHOW_NAME",
"Y") ==
"Y" ?
"Y" :
"N";
276 if (!array_key_exists(
"AVATAR",
$fields))
278 $user = CUser::GetByID(
$fields[
"USER_ID"])->fetch();
279 if ($user[
"PERSONAL_PHOTO"] > 0)
281 $fields[
"AVATAR"] = CFile::MakeFileArray($user[
"PERSONAL_PHOTO"]);
308 "filter" => [
"USER_ID" =>
$ID]
321 if (CACHED_b_forum_user !==
false)
322 $GLOBALS[
"CACHE_MANAGER"]->CleanDir(
"b_forum_user");
324 unset(
$GLOBALS[
"FORUM_CACHE"][
"USER"]);
325 unset(
$GLOBALS[
"FORUM_CACHE"][
"USER_ID"]);
327 $entity = \Bitrix\Forum\UserTable::getEntity();
331 $k = (mb_strpos(
$k,
"=") === 0? mb_substr(
$k, 1) :
$k);
336 if ($field instanceof \
Bitrix\Main\ORM\Fields\DateField)
338 $data[
$k] = new \Bitrix\Main\Type\DateTime(\
Bitrix\Main\Type\DateTime::isCorrect($v) ? $v :
null);
343 && preg_match(
"/{$k}\s*(\+|\-)\s*(\d+)/", $v,
$matches)
346 $data[
$k] = new \Bitrix\Main\DB\SqlExpression(
"?# $matches[1] $matches[2]",
$k);
361 $result = \Bitrix\Forum\UserTable::delete(
$ID);
362 unset(
$GLOBALS[
"FORUM_CACHE"][
"USER"]);
363 unset(
$GLOBALS[
"FORUM_CACHE"][
"USER_ID"]);
371 $arSqlSearch =
array();
374 $arSqlSearch[] =
"NUM_POSTS > 0";
378 $key = mb_strtoupper($key_res[
"FIELD"]);
379 $strNegative = $key_res[
"NEGATIVE"];
380 $strOperation = $key_res[
"OPERATION"];
386 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(U.".
$key.
" IS NULL OR ".(
$DB->type ==
"MSSQL" ?
"LEN" :
"LENGTH").
"(U.".
$key.
")<=0)";
388 $arSqlSearch[] = ($strNegative==
"Y"?
" U.".$key.
" IS NULL OR NOT (":
"").
"U.".
$key.
" ".$strOperation.
" '".
$DB->ForSql(
$val).
"'".
389 ($strNegative==
"Y"?
")":
"");
393 if (
count($arSqlSearch) > 0)
394 $strSqlSearch =
" WHERE (".implode(
") AND (", $arSqlSearch).
") ";
396 $strSql =
"SELECT COUNT(FU.ID) AS CNT FROM b_forum_user FU INNER JOIN b_user U ON (U.ID = FU.USER_ID)".$strSqlSearch;
416 "SELECT FU.ID, FU.USER_ID, FU.SHOW_NAME, FU.DESCRIPTION, FU.IP_ADDRESS,
417 FU.REAL_IP_ADDRESS, FU.AVATAR, FU.NUM_POSTS, FU.POINTS as NUM_POINTS, FU.INTERESTS,
418 FU.HIDE_FROM_ONLINE, FU.SUBSC_GROUP_MESSAGE, FU.SUBSC_GET_MY_MESSAGE,
419 FU.LAST_POST, FU.ALLOW_POST, FU.SIGNATURE, FU.RANK_ID, FU.POINTS,
420 ".$DB->DateToCharFunction(
"FU.DATE_REG",
"SHORT").
" as DATE_REG,
421 ".
$DB->DateToCharFunction(
"FU.LAST_VISIT",
"FULL").
" as LAST_VISIT
437 $Name =
$DB->ForSql(trim($Name));
439 isset(
$GLOBALS[
"FORUM_CACHE"][
"USER_NAME"]) &&
441 is_array(
$GLOBALS[
"FORUM_CACHE"][
"USER_NAME"][$Name]) &&
444 return $GLOBALS[
"FORUM_CACHE"][
"USER_NAME"][$Name];
449 "SELECT ID AS USER_ID
451 WHERE LOGIN='".$Name.
"'";
454 if (!empty(
$res[
"USER_ID"]))
457 "SELECT FU.ID, FU.USER_ID, FU.SHOW_NAME, FU.DESCRIPTION, FU.IP_ADDRESS,
458 FU.REAL_IP_ADDRESS, FU.AVATAR, FU.NUM_POSTS, FU.POINTS as NUM_POINTS,
459 FU.INTERESTS, FU.HIDE_FROM_ONLINE, FU.SUBSC_GROUP_MESSAGE, FU.SUBSC_GET_MY_MESSAGE,
460 FU.LAST_POST, FU.ALLOW_POST, FU.SIGNATURE, FU.RANK_ID, FU.POINTS,
461 ".$DB->DateToCharFunction(
"FU.DATE_REG",
"SHORT").
" as DATE_REG,
462 ".
$DB->DateToCharFunction(
"FU.LAST_VISIT",
"FULL").
" as LAST_VISIT
464 WHERE FU.USER_ID = ".
$res[
"USER_ID"];
481 $arAddParams = (is_array($arAddParams) ? $arAddParams :
array($arAddParams));
485 "SELECT FU.ID, FU.USER_ID, FU.SHOW_NAME, FU.DESCRIPTION, FU.IP_ADDRESS,\n ".
486 " FU.REAL_IP_ADDRESS, FU.AVATAR, FU.NUM_POSTS, FU.POINTS as NUM_POINTS, FU.INTERESTS,\n ".
487 " FU.LAST_POST, FU.ALLOW_POST, FU.SIGNATURE, FU.RANK_ID,\n ".
488 " U.EMAIL, U.NAME, U.SECOND_NAME, U.LAST_NAME, U.LOGIN, U.PERSONAL_BIRTHDATE,\n ".
489 " ".$DB->DateToCharFunction(
"FU.DATE_REG",
"SHORT").
" as DATE_REG,\n ".
490 " ".$DB->DateToCharFunction(
"FU.LAST_VISIT",
"FULL").
" as LAST_VISIT,\n ".
491 " U.PERSONAL_ICQ, U.PERSONAL_WWW, U.PERSONAL_PROFESSION,\n ".
492 " U.PERSONAL_CITY, U.PERSONAL_COUNTRY, U.EXTERNAL_AUTH_ID, U.PERSONAL_PHOTO,\n ".
493 " U.PERSONAL_GENDER, FU.POINTS, FU.HIDE_FROM_ONLINE, FU.SUBSC_GROUP_MESSAGE, FU.SUBSC_GET_MY_MESSAGE,\n ".
494 " ".$DB->DateToCharFunction(
"U.PERSONAL_BIRTHDAY",
"SHORT").
" as PERSONAL_BIRTHDAY ".
495 (array_key_exists(
"SHOW_ABC", $arAddParams) || in_array(
"SHOW_ABC", $arAddParams) ?
496 ", \n\t".CForumUser::GetFormattedNameFieldsForSelect(
500 "sUserTablePrefix" =>
"U.",
501 "sForumUserTablePrefix" =>
"FU.",
502 "sFieldName" =>
"SHOW_ABC"),
506 " FROM b_user U, b_forum_user FU \n".
507 " WHERE FU.USER_ID = U.ID AND FU.ID = ".
$ID.
" ";
521 $USER_ID = intval($USER_ID);
522 if (isset(
$GLOBALS[
"FORUM_CACHE"][
"USER_ID"][$USER_ID]) && is_array(
$GLOBALS[
"FORUM_CACHE"][
"USER_ID"][$USER_ID]) &&
is_set(
$GLOBALS[
"FORUM_CACHE"][
"USER_ID"][$USER_ID],
"ID"))
524 return $GLOBALS[
"FORUM_CACHE"][
"USER_ID"][$USER_ID];
529 "SELECT FU.ID, FU.USER_ID, FU.SHOW_NAME, FU.DESCRIPTION, FU.IP_ADDRESS,
530 FU.REAL_IP_ADDRESS, FU.AVATAR, FU.NUM_POSTS, FU.POINTS as NUM_POINTS,
531 FU.INTERESTS, FU.HIDE_FROM_ONLINE, FU.SUBSC_GROUP_MESSAGE, FU.SUBSC_GET_MY_MESSAGE,
532 FU.LAST_POST, FU.ALLOW_POST, FU.SIGNATURE, FU.RANK_ID, FU.POINTS,
533 ".$DB->DateToCharFunction(
"FU.DATE_REG",
"SHORT").
" as DATE_REG,
534 ".
$DB->DateToCharFunction(
"FU.LAST_VISIT",
"FULL").
" as LAST_VISIT
536 WHERE FU.USER_ID = ".$USER_ID;
551 $arAddParams = (is_array($arAddParams) ? $arAddParams :
array($arAddParams));
553 $USER_ID = intval($USER_ID);
555 "SELECT F_USER.*, FU.ID, FU.USER_ID, FU.SHOW_NAME, FU.DESCRIPTION, FU.IP_ADDRESS,\n ".
556 " FU.REAL_IP_ADDRESS, FU.AVATAR, FU.NUM_POSTS, FU.POINTS as NUM_POINTS,\n ".
557 " FU.INTERESTS, FU.HIDE_FROM_ONLINE, FU.SUBSC_GROUP_MESSAGE, FU.SUBSC_GET_MY_MESSAGE,\n ".
558 " FU.LAST_POST, FU.ALLOW_POST, FU.SIGNATURE, FU.RANK_ID, FU.POINTS,\n ".
559 " ".$DB->DateToCharFunction(
"FU.DATE_REG",
"SHORT").
" as DATE_REG,\n ".
560 " ".$DB->DateToCharFunction(
"FU.LAST_VISIT",
"FULL").
" as LAST_VISIT,\n ".
561 " U.EMAIL, U.NAME, U.SECOND_NAME, U.LAST_NAME, U.LOGIN, U.PERSONAL_BIRTHDATE,\n ".
562 " U.PERSONAL_ICQ, U.PERSONAL_WWW, U.PERSONAL_PROFESSION,\n ".
563 " U.PERSONAL_CITY, U.PERSONAL_COUNTRY, U.EXTERNAL_AUTH_ID, U.PERSONAL_PHOTO, U.PERSONAL_GENDER,\n ".
564 " ".$DB->DateToCharFunction(
"U.PERSONAL_BIRTHDAY",
"SHORT").
" as PERSONAL_BIRTHDAY ".
565 (array_key_exists(
"SHOW_ABC", $arAddParams) || in_array(
"SHOW_ABC", $arAddParams) ?
566 ", \n\t".CForumUser::GetFormattedNameFieldsForSelect(
570 "sUserTablePrefix" =>
"U.",
571 "sForumUserTablePrefix" =>
"FU.",
572 "sFieldName" =>
"SHOW_ABC"),
576 " FROM b_forum_user FU \n".
577 " INNER JOIN b_user U ON (FU.USER_ID = U.ID) \n".
579 " SELECT FM.AUTHOR_ID, MAX(FM.ID) AS LAST_MESSAGE_ID, COUNT(FM.ID) AS CNT \n".
580 " FROM b_forum_message FM \n".
581 " WHERE (FM.AUTHOR_ID = ".$USER_ID.
" AND FM.APPROVED = 'Y') \n".
582 " GROUP BY FM.AUTHOR_ID \n".
583 " ) F_USER ON (F_USER.AUTHOR_ID = FU.USER_ID) \n".
584 " WHERE (FU.USER_ID = ".$USER_ID.
")";
597 $USER_ID = intval($USER_ID);
599 if ($USER_ID <= 0)
return false;
601 if (COption::GetOptionString(
"forum",
"SHOW_VOTES",
"Y") ==
"Y")
607 if (isset($arRatingResult[
'CURRENT_VALUE']))
608 $arUser =
array(
'POINTS' => round(floatval($arRatingResult[
'CURRENT_VALUE'])/COption::GetOptionString(
"main",
"rating_vote_weight", 1)));
612 if ($strLang ===
false || mb_strlen($strLang) != 2)
626 $USER_ID = intval($USER_ID);
627 $FORUM_ID = intval($FORUM_ID);
628 if (is_int($LAST_VISIT)):
629 $LAST_VISIT =
$DB->CharToDateFunction(date(CDatabase::DateFormatToPHP(CLang::GetDateFormat(
"FULL")), $LAST_VISIT),
"FULL");
630 elseif (is_string($LAST_VISIT)):
631 $LAST_VISIT =
$DB->CharToDateFunction(trim($LAST_VISIT),
"FULL");
637 $Fields =
array(
"LAST_VISIT" =>
$DB->GetNowFunction());
638 $rows =
$DB->Update(
"b_forum_user_forum", $Fields,
"WHERE (FORUM_ID=".$FORUM_ID.
" AND USER_ID=".$USER_ID.
")",
"File: ".__FILE__.
"<br>Line: ".__LINE__);
640 if (intval(
$rows) <= 0):
641 $Fields[
"USER_ID"] = $USER_ID;
642 $Fields[
"FORUM_ID"] = $FORUM_ID;
643 $DB->Insert(
"b_forum_user_forum", $Fields,
"File: ".__FILE__.
"<br>Line: ".__LINE__);
645 $DB->Query(
"DELETE FROM b_forum_user_forum WHERE (FORUM_ID > 0 AND USER_ID=".$USER_ID.
")");
646 $DB->Query(
"DELETE FROM b_forum_user_topic WHERE (USER_ID=".$USER_ID.
")");
648 $DB->Query(
"DELETE FROM b_forum_user_topic WHERE (FORUM_ID=".$FORUM_ID.
" AND USER_ID=".$USER_ID.
")");
651 $Fields =
array(
"LAST_VISIT" => $LAST_VISIT);
652 $rows =
$DB->Update(
"b_forum_user_forum", $Fields,
653 "WHERE (FORUM_ID=".$FORUM_ID.
" AND USER_ID=".$USER_ID.
")",
"File: ".__FILE__.
"<br>Line: ".__LINE__);
655 if (intval(
$rows) <= 0):
656 $Fields =
array(
"LAST_VISIT" => $LAST_VISIT,
"FORUM_ID" => $FORUM_ID,
"USER_ID" => $USER_ID);
657 $DB->Insert(
"b_forum_user_forum", $Fields,
"File: ".__FILE__.
"<br>Line: ".__LINE__);
659 $DB->Query(
"DELETE FROM b_forum_user_forum WHERE (FORUM_ID > 0 AND USER_ID=".$USER_ID.
" AND LAST_VISIT <= ".$LAST_VISIT.
")");
660 $DB->Query(
"DELETE FROM b_forum_user_topic WHERE (USER_ID=".$USER_ID.
" AND LAST_VISIT <= ".$LAST_VISIT.
")");
662 $DB->Query(
"DELETE FROM b_forum_user_topic WHERE (FORUM_ID=".$FORUM_ID.
" AND USER_ID=".$USER_ID.
" AND LAST_VISIT <= ".$LAST_VISIT.
")");
671 $arSqlSearch = Array();
672 $arSqlOrder = Array();
680 $key = mb_strtoupper($key_res[
"FIELD"]);
681 $strNegative = $key_res[
"NEGATIVE"];
682 $strOperation = $key_res[
"OPERATION"];
690 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FUF.".
$key.
" IS NULL OR FUF.".
$key.
"<=0)";
692 $arSqlSearch[] = ($strNegative==
"Y"?
" FUF.".$key.
" IS NULL OR NOT ":
"").
"(FUF.".
$key.
" ".$strOperation.
" ".intval(
$val).
" )";
696 if (!empty($arSqlSearch))
697 $strSqlSearch =
" AND (".implode(
") AND (", $arSqlSearch).
")";
698 foreach ($arOrder as $by=>
$order)
700 $by = mb_strtoupper($by);
704 if ($by ==
"USER_ID") $arSqlOrder[] =
" FUF.USER_ID ".$order.
" ";
705 elseif ($by ==
"FORUM_ID") $arSqlOrder[] =
" FUF.FORUM_ID ".$order.
" ";
706 elseif ($by ==
"LAST_VISIT") $arSqlOrder[] =
" FUF.LAST_VISIT ".$order.
" ";
709 $arSqlOrder[] =
" FU.ID ".$order.
" ";
714 if (
count($arSqlOrder) > 0)
715 $strSqlOrder =
" ORDER BY ".implode(
", ", $arSqlOrder);
718 SELECT FUF.ID, FUF.FORUM_ID, FUF.USER_ID, ".$DB->DateToCharFunction(
"FUF.LAST_VISIT",
"FULL").
" as LAST_VISIT
719 FROM b_forum_user_forum FUF
720 INNER JOIN b_user U ON (U.ID = FUF.USER_ID)
721 WHERE 1=1 ".$strSqlSearch.
"
742 static $arUsers =
array();
744 if (!array_key_exists($userID, $arUsers))
747 $arUsers[$userID] = (!empty($arUsers[$userID]) ? $arUsers[$userID] :
array());
748 $arUsers[$userID][
"SHOW_NAME"] = ($arUsers[$userID][
"SHOW_NAME"] ==
"Y" ?
"Y" :
"N");
749 if (!array_key_exists(
"LOGIN", $arUsers[$userID]) || !array_key_exists(
"NAME", $arUsers[$userID]) ||
750 !array_key_exists(
"SECOND_NAME", $arUsers[$userID]) || !array_key_exists(
"LAST_NAME", $arUsers[$userID])
753 $dbRes = CUser::GetByID($userID);
755 $arUsers[$userID] = array_merge(
$arRes, $arUsers[$userID]);
757 $arUsers[$userID][
"FORMATTED_NAME"] = ($arUsers[$userID][
"SHOW_NAME"] ==
"Y" ?
758 CUser::FormatName(
$template, $arUsers[$userID],
false,
false) :
"");
759 $arUsers[$userID][
"FORMATTED_NAME"] = (empty($arUsers[$userID][
"FORMATTED_NAME"]) ||
760 $arUsers[$userID][
"FORMATTED_NAME"] ==
GetMessage(
"FORMATNAME_NONAME")?
761 $arUsers[$userID][
"LOGIN"] : $arUsers[$userID][
"FORMATTED_NAME"]);
763 return $arUsers[$userID][
"FORMATTED_NAME"];
769 $USER_ID = intval($USER_ID);
770 if ($USER_ID <= 0)
return 0;
771 $arAddParams = (is_array($arAddParams) ? $arAddParams :
array($arAddParams));
772 $arAddParams[
"INCREMENT"] = intval($arAddParams[
"INCREMENT"] ?? 0);
773 $arAddParams[
"DECREMENT"] = intval($arAddParams[
"DECREMENT"] ?? 0);
774 $arAddParams[
"NUM_POSTS"] = (
is_set($arAddParams,
"NUM_POSTS") ? $arAddParams[
"NUM_POSTS"] :
false);
775 $arAddParams[
"RETURN_FETCH"] = (isset($arAddParams[
"RETURN_FETCH"]) && $arAddParams[
"RETURN_FETCH"] ==
"Y" ?
"Y" :
"N");
779 ($arAddParams[
"NUM_POSTS"] ? $arAddParams[
"NUM_POSTS"] :
"FU.NUM_POSTS").
780 ($arAddParams[
"INCREMENT"] > 0 ?
"+".$arAddParams[
"INCREMENT"] :
"").
781 ($arAddParams[
"DECREMENT"] > 0 ?
"-".$arAddParams[
"DECREMENT"] :
"").
782 ") AS NUM_POSTS, FP2P.MIN_NUM_POSTS, FP2P.POINTS_PER_POST, SUM(FUP.POINTS) AS POINTS_FROM_USER
785 LEFT JOIN b_forum_points2post FP2P ON (FP2P.MIN_NUM_POSTS <= ".
786 ($arAddParams[
"NUM_POSTS"] ? $arAddParams[
"NUM_POSTS"] :
"FU.NUM_POSTS").
787 ($arAddParams[
"INCREMENT"] > 0 ?
"+".$arAddParams[
"INCREMENT"] :
"").
788 ($arAddParams[
"DECREMENT"] > 0 ?
"-".$arAddParams[
"DECREMENT"] :
"").
")
789 LEFT JOIN b_forum_user_points FUP ON (FUP.TO_USER_ID = FU.USER_ID)
791 FU.user_id = ".$USER_ID.
"
793 ".($arAddParams[
"NUM_POSTS"] ?
"" :
"FU.NUM_POSTS, ").
"FP2P.MIN_NUM_POSTS, FP2P.POINTS_PER_POST
794 ORDER BY FP2P.MIN_NUM_POSTS DESC";
797 if ($arAddParams[
"RETURN_FETCH"] ==
"Y"):
800 $result = floor(doubleVal(
$res[
"POINTS_PER_POST"])*intval(
$res[
"NUM_POSTS"]) + intval(
$res[
"POINTS_FROM_USER"]));
808 $USER_ID = intval($USER_ID);
809 $iNumUserPosts = intval($iCnt);
811 $fPointsPerPost = 0.0;
812 if ($USER_ID <= 0)
return 0;
814 if ($iCnt ===
false):
818 if ($iNumUserPoints ===
false || $iCnt !=
false):
822 $fPointsPerPost = DoubleVal(
$ar_res[
"POINTS_PER_POST"]);
823 $iNumUserPoints = floor($fPointsPerPost*$iNumUserPosts);
825 $iNumUserPoints += $iCnt;
827 return $iNumUserPoints;
832 $enableCalculateStatistics = COption::GetOptionString(
'forum',
'enable_calculate_statistics',
'Y');
834 $enableCalculateStatistics ===
'N'
836 || (!empty(
$params[
'MESSAGE'][
'APPROVED']) &&
$params[
'MESSAGE'][
'APPROVED'] !==
'Y')
844 $bNeedCreateUser =
false;
850 $arMessage =
$params[
'MESSAGE'];
852 if (
$params[
'ACTION'] ==
'UPDATE')
854 $params[
'ACTION'] = ($arMessage[
'APPROVED'] ==
'Y' ?
'INCREMENT' :
'DECREMENT');
855 $arMessage[
'APPROVED'] =
'Y';
861 if (
$params[
'ACTION'] ==
'DECREMENT' && $arMessage[
'ID'] < $arUser[
'LAST_POST'])
864 '=NUM_POSTS' =>
'NUM_POSTS-'.$params[
'POSTS'],
868 else if (
$params[
'ACTION'] ==
'INCREMENT' && $arMessage[
'ID'] < $arUser[
'LAST_POST'])
871 '=NUM_POSTS' =>
'NUM_POSTS+'.$params[
'POSTS'],
875 else if (
$params[
'ACTION'] ==
'INCREMENT')
877 $arUserFields[
'IP_ADDRESS'] = $arMessage[
'AUTHOR_IP'];
878 $arUserFields[
'REAL_IP_ADDRESS'] = $arMessage[
'AUTHOR_REAL_IP'];
879 $arUserFields[
'LAST_POST'] = intval($arMessage[
'ID']);
880 $arUserFields[
'=NUM_POSTS'] =
'NUM_POSTS+' .
$params[
'POSTS'];
885 if (empty($arUserFields))
890 if ($bNeedCreateUser ===
false)
892 if (empty($arUser) || $bNeedCreateUser ==
true):
893 $bNeedCreateUser =
true;
895 $arUser = (is_array($arUser) ? $arUser :
array());
899 $arUserFields[
'IP_ADDRESS'] = $arMessage[
'AUTHOR_IP'];
900 $arUserFields[
'REAL_IP_ADDRESS'] = $arMessage[
'AUTHOR_REAL_IP'];
901 $arUserFields[
'LAST_POST'] = intval($arMessage[
'ID']);
903 $arUserFields[
'NUM_POSTS'] = intval($arUser[
'CNT']);
907 if ($bNeedCreateUser):
908 $arUserFields[
'USER_ID'] =
$userId;
920 $user_id = intval($user_id);
923 $DB->Query(
"UPDATE b_forum SET LAST_POSTER_ID = NULL WHERE LAST_POSTER_ID = ".$user_id.
"");
924 $DB->Query(
"UPDATE b_forum_topic SET LAST_POSTER_ID = NULL WHERE LAST_POSTER_ID = ".$user_id.
"");
925 $DB->Query(
"UPDATE b_forum_topic SET USER_START_ID = NULL WHERE USER_START_ID = ".$user_id.
"");
926 $DB->Query(
"UPDATE b_forum_message SET AUTHOR_ID = NULL WHERE AUTHOR_ID = ".$user_id.
"");
927 $DB->Query(
"DELETE FROM b_forum_subscribe WHERE USER_ID = ".$user_id.
"");
928 $DB->Query(
"DELETE FROM b_forum_stat WHERE USER_ID = ".$user_id.
"");
937 FU.USER_ID = $user_id
940 $z =
$DB->Query($strSql);
941 while (
$zr =
$z->Fetch()) CFile::Delete(
$zr[
"ID"]);
943 $DB->Query(
"DELETE FROM b_forum_user WHERE USER_ID = ".$user_id.
"");
945 if(CModule::IncludeModule(
"socialnetwork"))
947 $dbRes =
$DB->Query(
"select ID from b_forum_topic where OWNER_ID=".$user_id);
950 $DB->Query(
"DELETE FROM b_forum_message WHERE TOPIC_ID = ".
$arRes[
"ID"]);
951 $DB->Query(
"DELETE FROM b_forum_topic WHERE ID = ".
$arRes[
"ID"]);
965 "SELECT U.ID, U.NAME, U.LAST_NAME, U.LOGIN, F.SHOW_NAME ".
966 "FROM b_forum_user F LEFT JOIN b_user U ON(F.USER_ID = U.ID)".
967 "WHERE ((F.SHOW_NAME='Y')AND(U.NAME LIKE '".$template.
"' OR U.LAST_NAME LIKE '".
$template.
"')) OR(( U.LOGIN LIKE '".
$template.
"')AND(F.SHOW_NAME='N'))";
976 $arSqlFrom =
array();
977 $arSqlOrder =
array();
978 $arSqlSearch =
array();
992 $key = mb_strtoupper($key_res[
"FIELD"]);
993 $strNegative = $key_res[
"NEGATIVE"];
994 $strOperation = $key_res[
"OPERATION"];
1001 if ($strOperation ==
'IN'):
1004 foreach (
$res as $v)
1005 $val[] = intval($v);
1011 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FM.".
$key.
" IS NULL OR FM.".
$key.
"<=0)";
1013 $arSqlSearch[] = ($strNegative==
"Y"?
" FM.".$key.
" IS NULL OR NOT ":
"").
"FM.".
$key.
" ".$strOperation.
" (".
$DB->ForSql(
$val).
")";
1017 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FM.".
$key.
" IS NULL OR ".(
$DB->type ==
"MSSQL" ?
"LEN" :
"LENGTH").
"(FM.".
$key.
")<=0)";
1019 $arSqlSearch[] = ($strNegative==
"Y"?
" FM.".$key.
" IS NULL OR NOT ":
"").
"FM.".
$key.
" ".$strOperation.
" '".
$DB->ForSql(
$val).
"'";
1024 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"FM.".
$key.
" IS NULL";
1026 $arSqlSearch[] = ($strNegative==
"Y"?
" FM.".$key.
" IS NULL OR NOT ":
"").
"FM.".
$key.
" ".$strOperation.
" ".
$DB->CharToDateFunction(
$DB->ForSql(
$val),
"SHORT");
1029 $arSqlFrom[
"FS2"] =
"LEFT JOIN b_forum2site FS2 ON (FS2.FORUM_ID = FM.FORUM_ID)";
1030 $arSqlSearch[] = ($strNegative==
"Y"?
" NOT ":
"").
"(FS2.SITE_ID ".$strOperation.
" '".
$DB->ForSql(
$val).
"')";
1033 $arSqlFrom[
"F"] =
"INNER JOIN b_forum F ON (F.ID = FM.FORUM_ID)";
1035 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(F.".
$key.
" IS NULL OR ".(
$DB->type ==
"MSSQL" ?
"LEN" :
"LENGTH").
"(F.".
$key.
")<=0)";
1037 $arSqlSearch[] = ($strNegative==
"Y"?
" F.".$key.
" IS NULL OR NOT ":
"").
"F.".
$key.
" ".$strOperation.
" '".
$DB->ForSql(
$val).
"'";
1039 case "USER_START_ID":
1040 if (!is_array(
$val))
1044 $tmp[] = intval(trim($v));
1046 $arSqlFrom[
"FT"] =
"INNER JOIN b_forum_topic FT ON (FT.ID = FM.TOPIC_ID)";
1048 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"FT.".
$key.
" IS NULL OR FT.".
$key.
"<=0";
1050 $arSqlSearch[] = ($strNegative==
"Y"?
" FT.".$key.
" IS NULL OR NOT ":
"").
"FT.".
$key.
" ".$strOperation.
" (".
$DB->ForSql(
$val).
")";
1053 $arSqlFrom[
"FP"] =
"
1055 SELECT FP.FORUM_ID, MAX(FP.PERMISSION) AS PERMISSION
1056 FROM b_forum_perms FP
1057 WHERE FP.GROUP_ID IN (".$DB->ForSql(implode(
",",
$USER->GetUserGroupArray())).
") AND FP.PERMISSION > 'A'
1058 GROUP BY FP.FORUM_ID) FPP ON (FPP.FORUM_ID = FM.FORUM_ID) ";
1059 $arSqlSearch[] =
"(FPP.PERMISSION > 'A' AND (FM.APPROVED='Y' OR FPP.PERMISSION >= 'Q'))";
1062 case "POST_MESSAGE":
1063 if (
$key ==
"TOPIC_TITLE")
1066 $arSqlFrom[
"FT"] =
"INNER JOIN b_forum_topic FT ON (FT.ID = FM.TOPIC_ID)";
1069 $key =
"FM.POST_MESSAGE";
1070 if ($strOperation ==
"LIKE")
1071 $val =
"%".$val.
"%";
1074 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(".
$key.
" IS NULL OR ".(
$DB->type ==
"MSSQL" ?
"LEN" :
"LENGTH").
"(".
$key.
")<=0)";
1076 $arSqlSearch[] = ($strNegative==
"Y"?
" ".$key.
" IS NULL OR NOT ":
"").
"(".
$key.
" ".$strOperation.
" '".
$DB->ForSQL(
$val).
"')";
1081 if (
count($arSqlFrom) > 0)
1082 $strSqlFrom =
" ".implode(
" ", $arSqlFrom);
1084 if (
count($arSqlSearch) > 0)
1085 $strSqlSearch =
" AND (".implode(
") AND (", $arSqlSearch).
")";
1089 $key = mb_strtoupper(
$key);
$val = (mb_strtoupper(
$val) !=
"ASC" ?
"DESC" :
"ASC");
1094 $arSqlOrder[
"LAST_POST"] =
"FMM.".$key.
" ".
$val;
1098 $arSqlOrder[
"ID"] =
" FT.".$key.
" ".
$val;
1102 if (
count($arSqlOrder)>0)
1103 $strSqlOrder =
"ORDER BY ".implode(
", ", $arSqlOrder);
1105 $strSqlOrder =
"ORDER BY FMM.FIRST_POST DESC";
1109 SELECT FMM.*, FT.TITLE, FT.DESCRIPTION, FT.VIEWS, FT.LAST_POSTER_ID,
1110 ".CForumNew::Concat(
"-",
array(
"FT.ID",
"FT.TITLE_SEO")).
" as TITLE_SEO,
1111 ".
$DB->DateToCharFunction(
"FT.START_DATE",
"FULL").
" as START_DATE,
1112 FT.USER_START_NAME, FT.USER_START_ID, FT.POSTS, FT.LAST_POSTER_NAME,
1113 FT.LAST_MESSAGE_ID, '' as IMAGE, '' as IMAGE_DESCR,
1114 FT.APPROVED, FT.STATE, FT.FORUM_ID, FT.ICON, FT.SORT, FT.HTML
1117 SELECT FM.TOPIC_ID, COUNT(FM.ID) AS COUNT_MESSAGE, MIN(FM.ID) AS FIRST_POST, MAX(FM.ID) AS LAST_POST
1118 FROM b_forum_message FM
1122 GROUP BY FM.TOPIC_ID
1124 LEFT JOIN b_forum_topic FT ON (FT.ID = FMM.TOPIC_ID)
1129 if (! empty($arNavigation))
1132 SELECT COUNT( DISTINCT FM.TOPIC_ID ) CNT
1133 FROM b_forum_message FM
1138 $dbCount_res =
$DB->Query($strCountSql);
1139 if ($dbCount_res && $arCount = $dbCount_res->Fetch())
1141 $cnt = $arCount[
'CNT'];
1145 if (empty($arNavigation) || !$cnt)
1151 if (isset($arNavigation[
"SIZEN"]) && $arNavigation[
"SIZEN"])
1152 $arNavigation[
"nPageSize"] = $arNavigation[
"SIZEN"];
1153 if (isset($arNavigation[
"PAGEN"]) && $arNavigation[
"PAGEN"])
1154 $arNavigation[
"iNumPage"] = $arNavigation[
"PAGEN"];
1156 $db_res->NavQuery($strSql, $cnt, $arNavigation);
1166 $group_id = intval($group_id);
1169 if(CModule::IncludeModule(
"socialnetwork"))
1171 $dbRes =
$DB->Query(
"select ID from b_forum_topic where SOCNET_GROUP_ID=".$group_id);
1187 ($avatar = CFile::MakeFileArray(
$arFields[
"PERSONAL_PHOTO"])) &&
1211 $CurrentUserID = intval($CurrentUserID);
1212 if (in_array(1, $arUserGroups))
return True;
1215 if ($arSubscr && intval($arSubscr[
"USER_ID"]) == $CurrentUserID)
return True;
1222 $CurrentUserID = intval($CurrentUserID);
1223 if (in_array(1, $arUserGroups))
return True;
1226 if ($arSubscr && intval($arSubscr[
"USER_ID"]) == $CurrentUserID)
return True;
1263 "USER_ID" => intval(
$arFields[
"USER_ID"]),
1264 "FORUM_ID" => intval(
$arFields[
"FORUM_ID"]),
1265 "START_DATE" =>
$DB->GetNowFunction(),
1266 "NEW_TOPIC_ONLY" =>
"'".$DB->ForSQL(
$arFields[
"NEW_TOPIC_ONLY"], 1).
"'",
1267 "SITE_ID" =>
"'".$DB->ForSQL(
$arFields[
"SITE_ID"], 2).
"'",
1271 $Fields[
"SOCNET_GROUP_ID"] = intval(
$arFields[
"SOCNET_GROUP_ID"]);
1274 $Fields[
"TOPIC_ID"] = intval(
$arFields[
"TOPIC_ID"]);
1276 return $DB->Insert(
"b_forum_subscribe", $Fields,
"File: ".__FILE__.
"<br>Line: ".__LINE__);
1287 $strUpdate =
$DB->PrepareUpdate(
"b_forum_subscribe",
$arFields);
1288 $strSql =
"UPDATE b_forum_subscribe SET ".$strUpdate.
" WHERE ID = ".
$ID;
1289 $DB->Query($strSql);
1298 return $DB->Query(
"DELETE FROM b_forum_subscribe WHERE ID = ".
$ID, True);
1304 $USER_ID = intval($USER_ID);
1305 return $DB->Query(
"DELETE FROM b_forum_subscribe WHERE USER_ID = ".$USER_ID);
1311 $MID = intval($MID);
1312 $arID = explode(
",", $sIDs);
1313 if ($MID <= 0 || empty($sIDs) || (
count($arID) == 1 && intval($arID[0]) == 0))
1316 $arUpdateIDs =
array();
1317 foreach ($arID as $sID)
1319 $value = intval($sID);
1320 if ($value > 0) $arUpdateIDs[] = $value;
1322 if (
count($arUpdateIDs) < 1)
1325 $DB->Query(
"UPDATE b_forum_subscribe SET LAST_SEND = ".$MID.
" WHERE ID IN (".implode(
',', $arUpdateIDs).
")");
1331 $arSqlSearch = Array();
1333 $arAddParams = (is_array($arAddParams) ? $arAddParams :
array());
1338 $key = mb_strtoupper($key_res[
"FIELD"]);
1339 $strNegative = $key_res[
"NEGATIVE"];
1340 $strOperation = $key_res[
"OPERATION"];
1349 if (intval(
$val)<=0)
1350 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FP.".
$key.
" IS NULL OR FP.".
$key.
"<=0)";
1352 $arSqlSearch[] = ($strNegative==
"Y"?
" FP.".$key.
" IS NULL OR NOT ":
"").
"(FP.".
$key.
" ".$strOperation.
" ".intval(
$val).
" )";
1354 case "TOPIC_ID_OR_NULL":
1355 $arSqlSearch[] =
"(FP.TOPIC_ID = ".intval(
$val).
" OR FP.TOPIC_ID = 0 OR FP.TOPIC_ID IS NULL)";
1357 case "NEW_TOPIC_ONLY":
1359 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FP.NEW_TOPIC_ONLY IS NULL)";
1361 $arSqlSearch[] = ($strNegative==
"Y"?
" FP.NEW_TOPIC_ONLY IS NULL OR NOT ":
"").
"(FP.NEW_TOPIC_ONLY ".$strOperation.
" '".
$DB->ForSql(
$val).
"' )";
1363 case "SOCNET_GROUP_ID":
1365 $arSqlSearch[] =
"FP.SOCNET_GROUP_ID=".intval(
$val);
1367 $arSqlSearch[] =
"FP.SOCNET_GROUP_ID IS NULL";
1369 case "LAST_SEND_OR_NULL":
1370 $arSqlSearch[] =
"(FP.LAST_SEND IS NULL OR FP.LAST_SEND = 0 OR FP.LAST_SEND < ".intval(
$val).
")";
1375 $strSqlSearch = (empty($arSqlSearch) ?
"" :
" AND (".implode(
") AND (", $arSqlSearch).
") ");
1378 if (
is_set($arAddParams,
"bDescPageNumbering") ||
is_set($arAddParams,
"nCount"))
1380 $strSql =
"SELECT COUNT(FP.ID) AS CNT FROM b_forum_subscribe FP WHERE 1 = 1 ".$strSqlSearch;
1383 $iCnt = intval(
$ar_res[
"CNT"]);
1384 if (
is_set($arAddParams,
"nCount"))
1389 "SELECT FP.ID, FP.USER_ID, FP.FORUM_ID, FP.TOPIC_ID, FP.LAST_SEND, FP.NEW_TOPIC_ONLY, FP.SITE_ID, ".
1390 " ".$DB->DateToCharFunction(
"FP.START_DATE",
"FULL").
" as START_DATE ".
1391 "FROM b_forum_subscribe FP ".
1393 " ".$strSqlSearch.
" ";
1395 $arSqlOrder = Array();
1396 foreach ($arOrder as $by=>
$order)
1398 $by = mb_strtoupper($by);
1402 if ($by ==
"FORUM_ID") $arSqlOrder[] =
" FP.FORUM_ID ".$order.
" ";
1403 elseif ($by ==
"USER_ID") $arSqlOrder[] =
" FP.USER_ID ".$order.
" ";
1404 elseif ($by ==
"TOPIC_ID") $arSqlOrder[] =
" FP.TOPIC_ID ".$order.
" ";
1405 elseif ($by ==
"NEW_TOPIC_ONLY") $arSqlOrder[] =
" FP.NEW_TOPIC_ONLY ".$order.
" ";
1406 elseif ($by ==
"START_DATE") $arSqlOrder[] =
" FP.START_DATE ".$order.
" ";
1409 $arSqlOrder[] =
" FP.ID ".$order.
" ";
1415 $strSqlOrder = (empty($arSqlOrder) ?
"" :
" ORDER BY ".implode(
", ", $arSqlOrder));
1417 $strSql .= $strSqlOrder.(isset($arAddParams[
"nTopCount"]) ? ($arAddParams[
"nTopCount"] > 0 ?
"\nLIMIT 0,".intval($arAddParams[
"nTopCount"]) :
"") :
'');
1419 if (isset($arAddParams[
"nTopCount"]) && $arAddParams[
"nTopCount"] <= 0 &&
is_set($arAddParams,
"bDescPageNumbering"))
1422 $db_res->NavQuery($strSql, $iCnt, $arAddParams);
1435 $arSqlSearch =
array();
1436 $arSqlFrom =
array();
1437 $arSqlGroup =
array();
1438 $arSqlSelect =
array();
1439 $arSqlOrder =
array();
1445 $arSqlSelectConst =
array(
1447 "FS.USER_ID" =>
"FS.USER_ID",
1448 "FS.FORUM_ID" =>
"FS.FORUM_ID",
1449 "FS.TOPIC_ID" =>
"FS.TOPIC_ID",
1451 "FS.LAST_SEND" =>
"FS.LAST_SEND",
1452 "FS.NEW_TOPIC_ONLY" =>
"FS.NEW_TOPIC_ONLY",
1453 "FS.SITE_ID" =>
"FS.SITE_ID",
1454 "START_DATE" =>
$DB->DateToCharFunction(
"FS.START_DATE",
"FULL"),
1455 "U.EMAIL" =>
"U.EMAIL",
1456 "U.LOGIN" =>
"U.LOGIN",
1457 "U.NAME" =>
"U.NAME",
1458 "U.LAST_NAME" =>
"U.LAST_NAME",
1459 "FT.TITLE" =>
"FT.TITLE",
1460 "FORUM_NAME" =>
"F.NAME"
1467 $key = mb_strtoupper($key_res[
"FIELD"]);
1468 $strNegative = $key_res[
"NEGATIVE"];
1469 $strOperation = $key_res[
"OPERATION"];
1478 if (intval(
$val)<=0)
1479 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FS.".
$key.
" IS NULL OR FS.".
$key.
"<=0)";
1481 $arSqlSearch[] = ($strNegative==
"Y"?
" FS.".$key.
" IS NULL OR NOT ":
"").
"(FS.".
$key.
" ".$strOperation.
" ".intval(
$val).
" )";
1483 case "TOPIC_ID_OR_NULL":
1484 $arSqlSearch[] =
"(FS.TOPIC_ID = ".intval(
$val).
" OR FS.TOPIC_ID = 0 OR FS.TOPIC_ID IS NULL)";
1486 case "NEW_TOPIC_ONLY":
1488 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FS.".
$key.
" IS NULL)";
1490 $arSqlSearch[] = ($strNegative==
"Y"?
" FS.".$key.
" IS NULL OR NOT ":
"").
"(FS.".
$key.
" ".$strOperation.
" '".
$DB->ForSql(
$val).
"' )";
1494 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FS.".
$key.
" IS NULL)";
1496 $arSqlSearch[] = ($strNegative==
"Y"?
" FS.".$key.
" IS NULL OR NOT ":
"").
"(FS.".
$key.
" ".$strOperation.
" ".
$DB->CharToDateFunction(
$DB->ForSql(
$val),
"SHORT").
")";
1498 case "LAST_SEND_OR_NULL":
1499 $arSqlSearch[] =
"(FS.LAST_SEND IS NULL OR FS.LAST_SEND = 0 OR FS.LAST_SEND < ".intval(
$val).
")";
1503 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(U.".
$key.
" IS NULL)";
1505 $arSqlSearch[] = ($strNegative==
"Y"?
" U.".$key.
" IS NULL OR NOT ":
"").
"(U.".
$key.
" ".$strOperation.
" '".
$DB->ForSql(
$val).
"' )";
1509 $key = (
$key ==
"FORUM" ?
"F.NAME" :
"FT.TITLE");
1512 case "SOCNET_GROUP_ID":
1514 $arSqlSearch[] =
"FS.SOCNET_GROUP_ID=".intval(
$val);
1516 $arSqlSearch[] =
"FS.SOCNET_GROUP_ID IS NULL";
1521 $arSqlSearch[] =
"EXISTS(SELECT 'x'
1522 FROM b_sonet_features SF
1523 INNER JOIN b_sonet_features2perms SFP ON SFP.FEATURE_ID = SF.ID AND SFP.OPERATION_ID = 'view'
1524 WHERE SF.ENTITY_TYPE = 'G'
1525 AND SF.ENTITY_ID = FS.SOCNET_GROUP_ID
1526 AND SF.FEATURE = 'forum'
1527 AND SFP.ROLE = 'N' OR EXISTS(SELECT 'x' FROM b_sonet_user2group UG WHERE UG.USER_ID = FS.USER_ID AND ".$DB->IsNull(
"SFP.ROLE",
"'K'").
" >= UG.ROLE AND UG.GROUP_ID = FS.SOCNET_GROUP_ID)
1533 (FP.PERMISSION >= '".$DB->ForSql(
$val).
"') OR
1534 (FP1.PERMISSION >= '".
$DB->ForSql(
$val).
"') OR
1535 ((FP.ID IS NULL) AND (UG.GROUP_ID = 1)))";
1536 $arSqlSelect[] =
"FU.SUBSC_GROUP_MESSAGE, FU.SUBSC_GET_MY_MESSAGE";
1538 LEFT JOIN b_forum_user FU ON (U.ID = FU.USER_ID)
1539 LEFT JOIN b_user_group UG ON (U.ID = UG.USER_ID)
1540 LEFT JOIN b_forum_perms FP ON (FP.FORUM_ID = FS.FORUM_ID AND FP.GROUP_ID=UG.GROUP_ID)
1541 LEFT JOIN b_forum_perms FP1 ON (FP1.FORUM_ID = FS.FORUM_ID AND FP1.GROUP_ID=2)";
1542 $arSqlGroup = array_values($arSqlSelectConst);
1543 $arSqlGroup[] =
"FU.SUBSC_GROUP_MESSAGE, FU.SUBSC_GET_MY_MESSAGE";
1549 if (
count($arSqlSelect) > 0)
1550 $strSqlSelect .=
", ".implode(
", ", $arSqlSelect);
1552 if (
count($arSqlSearch) > 0)
1553 $strSqlSearch .=
" AND (".implode(
")
1555 (", $arSqlSearch).
") ";
1557 if (
count($arSqlFrom)>0)
1558 $strSqlFrom .=
" ".implode(
" ", $arSqlFrom).
" ";
1560 if (
count($arSqlGroup)>0)
1561 $strSqlGroup .=
" GROUP BY ".implode(
", ", $arSqlGroup).
" ";
1563 foreach ($arOrder as $by=>
$order)
1565 $by = mb_strtoupper($by);
1569 if ($by ==
"FORUM_ID") $arSqlOrder[] =
" FS.FORUM_ID ".$order.
" ";
1570 elseif ($by ==
"USER_ID") $arSqlOrder[] =
" FS.USER_ID ".$order.
" ";
1571 elseif ($by ==
"FORUM_NAME") $arSqlOrder[] =
" F.NAME ".$order.
" ";
1572 elseif ($by ==
"TOPIC_ID") $arSqlOrder[] =
" FS.TOPIC_ID ".$order.
" ";
1573 elseif ($by ==
"TITLE") $arSqlOrder[] =
" FT.TITLE ".$order.
" ";
1574 elseif ($by ==
"START_DATE") $arSqlOrder[] =
" FS.START_DATE ".$order.
" ";
1575 elseif ($by ==
"NEW_TOPIC_ONLY") $arSqlOrder[] =
" FS.NEW_TOPIC_ONLY ".$order.
" ";
1576 elseif ($by ==
"LAST_SEND") $arSqlOrder[] =
" FS.LAST_SEND ".$order.
" ";
1579 $arSqlOrder[] =
" FS.ID ".$order.
" ";
1584 if (
count($arSqlOrder)>0)
1585 $strSqlOrder =
" ORDER BY ".implode(
", ", $arSqlOrder);
1588 SELECT FS.ID, FS.USER_ID, FS.FORUM_ID, FS.TOPIC_ID, FS.LAST_SEND, FS.NEW_TOPIC_ONLY, FS.SITE_ID,
1589 ".CForumNew::Concat(
"-",
array(
"FS.TOPIC_ID",
"FT.TITLE_SEO")).
" as TITLE_SEO,
1590 ".
$DB->DateToCharFunction(
"FS.START_DATE",
"FULL").
" as START_DATE,
1591 U.EMAIL, U.LOGIN, U.NAME, U.LAST_NAME, FT.TITLE, F.NAME AS FORUM_NAME".$strSqlSelect.
"
1592 FROM b_forum_subscribe FS
1593 INNER JOIN b_user U ON (FS.USER_ID = U.ID)
1594 LEFT JOIN b_forum_topic FT ON (FS.TOPIC_ID = FT.ID)
1595 LEFT JOIN b_forum F ON (FS.FORUM_ID = F.ID)
1612 "SELECT FP.ID, FP.USER_ID, FP.FORUM_ID, FP.TOPIC_ID, FP.LAST_SEND, FP.NEW_TOPIC_ONLY, FP.SITE_ID, ".
1613 " ".$DB->DateToCharFunction(
"FP.START_DATE",
"FULL").
" as START_DATE ".
1614 "FROM b_forum_subscribe FP ".
1615 "WHERE FP.ID = ".$ID.
"";
1634 if (in_array(1, $arUserGroups))
return True;
1640 if (in_array(1, $arUserGroups))
return True;
1646 if (in_array(1, $arUserGroups))
return True;
1660 $db_lang = CLang::GetList();
1661 while ($arLang = $db_lang->Fetch())
1686 $strUpdate =
$DB->PrepareUpdate(
"b_forum_rank",
$arFields);
1687 $strSql =
"UPDATE b_forum_rank SET ".$strUpdate.
" WHERE ID = ".
$ID;
1688 $DB->Query($strSql);
1692 $DB->Query(
"DELETE FROM b_forum_rank_lang WHERE RANK_ID = ".
$ID);
1696 $arInsert =
$DB->PrepareInsert(
"b_forum_rank_lang",
$arFields[
"LANG"][
$i]);
1697 $strSql =
"INSERT INTO b_forum_rank_lang(RANK_ID, ".$arInsert[0].
") VALUES(".
$ID.
", ".$arInsert[1].
")";
1698 $DB->Query($strSql);
1713 $arUsers[] =
$ar_res[
"USER_ID"];
1716 $DB->Query(
"DELETE FROM b_forum_rank_lang WHERE RANK_ID = ".
$ID, True);
1717 $DB->Query(
"DELETE FROM b_forum_rank WHERE ID = ".
$ID, True);
1728 $arSqlSearch =
array();
1729 $arSqlOrder =
array();
1737 $key = mb_strtoupper($key_res[
"FIELD"]);
1738 $strNegative = $key_res[
"NEGATIVE"];
1739 $strOperation = $key_res[
"OPERATION"];
1744 case "MIN_NUM_POSTS":
1745 if (intval(
$val)<=0)
1746 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FR.".
$key.
" IS NULL OR FR.".
$key.
"<=0)";
1748 $arSqlSearch[] = ($strNegative==
"Y"?
" FR.".$key.
" IS NULL OR NOT ":
"").
"(FR.".
$key.
" ".$strOperation.
" ".intval(
$val).
" )";
1753 if (
count($arSqlSearch) > 0)
1754 $strSqlSearch =
" AND (".implode(
") AND (", $arSqlSearch).
") ";
1756 foreach ($arOrder as $by=>
$order)
1758 $by = mb_strtoupper($by);
1762 if ($by ==
"ID") $arSqlOrder[] =
" FR.ID ".$order.
" ";
1765 $arSqlOrder[] =
" FR.MIN_NUM_POSTS ".$order.
" ";
1766 $by =
"MIN_NUM_POSTS";
1770 if (
count($arSqlOrder) > 0)
1771 $strSqlOrder =
" ORDER BY ".implode(
", ", $arSqlOrder);
1774 "SELECT FR.ID, FR.MIN_NUM_POSTS
1775 FROM b_forum_rank FR
1787 $arSqlSearch =
array();
1788 $arSqlOrder =
array();
1796 $key = mb_strtoupper($key_res[
"FIELD"]);
1797 $strNegative = $key_res[
"NEGATIVE"];
1798 $strOperation = $key_res[
"OPERATION"];
1803 case "MIN_NUM_POSTS":
1804 if (intval(
$val)<=0)
1805 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FR.".
$key.
" IS NULL OR FR.".
$key.
"<=0)";
1807 $arSqlSearch[] = ($strNegative==
"Y"?
" FR.".$key.
" IS NULL OR NOT ":
"").
"(FR.".
$key.
" ".$strOperation.
" ".intval(
$val).
" )";
1811 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FRL.LID IS NULL OR ".(
$DB->type ==
"MSSQL" ?
"LEN" :
"LENGTH").
"(FRL.LID)<=0)";
1813 $arSqlSearch[] = ($strNegative==
"Y"?
" FRL.LID IS NULL OR NOT ":
"").
"(FRL.LID ".$strOperation.
" '".
$DB->ForSql(
$val).
"' )";
1817 if (
count($arSqlSearch) > 0)
1818 $strSqlSearch =
" AND (".imlode(
" ) AND (", $arSqlSearch).
") ";
1820 foreach ($arOrder as $by=>
$order)
1822 $by = mb_strtoupper($by);
1826 if ($by ==
"ID") $arSqlOrder[] =
" FR.ID ".$order.
" ";
1827 elseif ($by ==
"LID") $arSqlOrder[] =
" FRL.LID ".$order.
" ";
1828 elseif ($by ==
"NAME") $arSqlOrder[] =
" FRL.NAME ".$order.
" ";
1831 $arSqlOrder[] =
" FR.MIN_NUM_POSTS ".$order.
" ";
1832 $by =
"MIN_NUM_POSTS";
1836 if (
count($arSqlOrder) > 0)
1837 $strSqlOrder =
" ORDER BY ".implode(
", ", $arSqlOrder);
1840 SELECT FR.ID, FR.MIN_NUM_POSTS, FRL.LID, FRL.NAME
1841 FROM b_forum_rank FR
1842 LEFT JOIN b_forum_rank_lang FRL ON FR.ID = FRL.RANK_ID
1857 "SELECT FR.ID, FR.MIN_NUM_POSTS ".
1858 "FROM b_forum_rank FR ".
1859 "WHERE FR.ID = ".$ID.
"";
1875 "SELECT FR.ID, FRL.LID, FRL.NAME, FR.MIN_NUM_POSTS ".
1876 "FROM b_forum_rank FR ".
1877 " LEFT JOIN b_forum_rank_lang FRL ON (FR.ID = FRL.RANK_ID AND FRL.LID = '".$DB->ForSql($strLang).
"') ".
1878 "WHERE FR.ID = ".$ID.
"";
1892 $RANK_ID = intval($RANK_ID);
1894 "SELECT FRL.ID, FRL.RANK_ID, FRL.LID, FRL.NAME ".
1895 "FROM b_forum_rank_lang FRL ".
1896 "WHERE FRL.RANK_ID = ".$RANK_ID.
" ".
1897 " AND FRL.LID = '".$DB->ForSql($strLang).
"' ";
1921 if ($_SESSION[
"FORUM"][
"SHOW_NAME"] ==
"Y" && trim(
$USER->GetFormattedName(
false)) <>
'')
1928 $session_id =
"'".$DB->ForSQL($session_id, 255).
"'";
1930 "FS.USER_ID" => intval(
$USER->GetID()),
1931 "FS.IP_ADDRESS" =>
"'".$DB->ForSql(
$_SERVER[
"REMOTE_ADDR"],15).
"'",
1932 "FS.SHOW_NAME" =>
"'".$DB->ForSQL(
$tmp, 255).
"'",
1933 "FS.LAST_VISIT" =>
$DB->GetNowFunction(),
1934 "FS.FORUM_ID" => intval(
$arFields[
"FORUM_ID"]),
1935 "FS.TOPIC_ID" => intval(
$arFields[
"TOPIC_ID"])
1937 $FieldsForInsert =
array(
1938 "USER_ID" => $Fields[
"FS.USER_ID"],
1939 "IP_ADDRESS" => $Fields[
"FS.IP_ADDRESS"],
1940 "SHOW_NAME" => $Fields[
"FS.SHOW_NAME"],
1941 "LAST_VISIT" => $Fields[
"FS.LAST_VISIT"],
1942 "FORUM_ID" => $Fields[
"FS.FORUM_ID"],
1943 "TOPIC_ID" => $Fields[
"FS.TOPIC_ID"],
1944 "PHPSESSID" => $session_id
1948 if (intval(
$USER->GetID()) > 0)
1950 $FieldsForUpdate = $Fields;
1951 $FieldsForUpdate[
"FU.LAST_VISIT"] =
$DB->GetNowFunction();
1953 "b_forum_user FU, b_forum_stat FS",
1955 "WHERE (FU.USER_ID=".$Fields[
"FS.USER_ID"].
") AND (FS.PHPSESSID=".$session_id.
")",
1956 "File: ".__FILE__.
"<br>Line: ".__LINE__,
1959 if (intval(
$rows) < 2)
1961 if (intval(
$rows)<=0)
1965 array(
"USER_ID" => $Fields[
"FS.USER_ID"]),
1966 "WHERE (USER_ID=".$Fields[
"FS.USER_ID"].
")",
1967 "File: ".__FILE__.
"<br>Line: ".__LINE__,
1969 if (intval(
$rows) <= 0)
1977 "USER_ID" => $Fields[
"FS.USER_ID"],
1978 "IP_ADDRESS" => $Fields[
"FS.IP_ADDRESS"],
1979 "SHOW_NAME" => $Fields[
"FS.SHOW_NAME"],
1980 "LAST_VISIT" => $Fields[
"FS.LAST_VISIT"],
1981 "FORUM_ID" => $Fields[
"FS.FORUM_ID"],
1982 "TOPIC_ID" => $Fields[
"FS.TOPIC_ID"],
1984 "WHERE (PHPSESSID=".$session_id.
")",
1985 "File: ".__FILE__.
"<br>Line: ".__LINE__,
1987 if (intval(
$rows) <= 0)
1989 $DB->Insert(
"b_forum_stat", $FieldsForInsert,
"File: ".__FILE__.
"<br>Line: ".__LINE__);
1999 "USER_ID" => $Fields[
"FS.USER_ID"],
2000 "IP_ADDRESS" => $Fields[
"FS.IP_ADDRESS"],
2001 "SHOW_NAME" => $Fields[
"FS.SHOW_NAME"],
2002 "LAST_VISIT" => $Fields[
"FS.LAST_VISIT"],
2003 "FORUM_ID" => $Fields[
"FS.FORUM_ID"],
2004 "TOPIC_ID" => $Fields[
"FS.TOPIC_ID"],
2006 "WHERE (PHPSESSID=".$session_id.
")",
"File: ".__FILE__.
"<br>Line: ".__LINE__);
2008 if (intval(
$rows)<=0)
2010 $DB->Insert(
"b_forum_stat", $FieldsForInsert,
"File: ".__FILE__.
"<br>Line: ".__LINE__);
2019 $tmp = ($_SESSION[
"FORUM"][
"SHOW_NAME"] ==
"Y" && trim(
$USER->GetFullName()) <>
'' ?
2020 trim(
$USER->GetFullName()) :
$USER->GetLogin());
2021 if (method_exists(\
Bitrix\Main\Application::getInstance(),
"getKernelSession"))
2030 $session_id =
"'".$DB->ForSQL($session_id, 255).
"'";
2033 "USER_ID" => intval(
$USER->GetID()),
2034 "IP_ADDRESS" =>
"'".$DB->ForSql(
$_SERVER[
"REMOTE_ADDR"], 15).
"'",
2035 "SHOW_NAME" =>
"'".$DB->ForSQL(
$tmp, 255).
"'",
2036 "LAST_VISIT" =>
$DB->GetNowFunction(),
2037 "SITE_ID" =>
"'".$DB->ForSQL(
$arFields[
"SITE_ID"], 2).
"'",
2038 "FORUM_ID" => intval(
$arFields[
"FORUM_ID"]),
2039 "TOPIC_ID" => intval(
$arFields[
"TOPIC_ID"]));
2040 $rows =
$DB->Update(
"b_forum_stat", $Fields,
"WHERE PHPSESSID=".$session_id.
"",
"File: ".__FILE__.
"<br>Line: ".__LINE__);
2041 if (intval(
$rows)<=0)
2044 "USER_ID" => intval(
$USER->GetID()),
2045 "IP_ADDRESS" =>
"'".$DB->ForSql(
$_SERVER[
"REMOTE_ADDR"], 15).
"'",
2046 "SHOW_NAME" =>
"'".$DB->ForSQL(
$tmp, 255).
"'",
2047 "PHPSESSID" => $session_id,
2048 "LAST_VISIT" =>
$DB->GetNowFunction(),
2049 "SITE_ID" =>
"'".$DB->ForSQL(
$arFields[
"SITE_ID"], 2).
"'",
2050 "FORUM_ID" => intval(
$arFields[
"FORUM_ID"]),
2051 "TOPIC_ID" => intval(
$arFields[
"TOPIC_ID"]));
2052 return $DB->Insert(
"b_forum_stat", $Fields,
"File: ".__FILE__.
"<br>Line: ".__LINE__);
2062 "USER_ID" =>
$USER->GetID(),
2063 "IP_ADDRESS" =>
"'".$DB->ForSql(
$_SERVER[
"REMOTE_ADDR"],15).
"'",
2064 "PHPSESSID" =>
"'".$DB->ForSQL($session_id, 255) .
"'",
2065 "LAST_VISIT" =>
"'".$DB->GetNowFunction().
"'",
2066 "FORUM_ID" => intval(
$arFields[
"FORUM_ID"]),
2067 "TOPIC_ID" => intval(
$arFields[
"TOPIC_ID"]));
2069 return $DB->Insert(
"b_forum_stat", $Fields,
"File: ".__FILE__.
"<br>Line: ".__LINE__);
2075 $arSqlSearch =
array();
2076 $arSqlSelect =
array();
2077 $arSqlFrom =
array();
2078 $arSqlGroup =
array();
2079 $arSqlOrder =
array();
2088 $arSqlSelectConst =
array(
2089 "FSTAT.USER_ID" =>
"FSTAT.USER_ID",
2090 "FSTAT.IPADDRES" =>
"FSTAT.IPADDRES",
2091 "FSTAT.PHPSESSID" =>
"FSTAT.PHPSESSID",
2092 "LAST_VISIT" =>
$DB->DateToCharFunction(
"FSTAT.LAST_VISIT",
"FULL"),
2093 "FSTAT.FORUM_ID" =>
"FSTAT.FORUM_ID",
2094 "FSTAT.TOPIC_ID" =>
"FSTAT.TOPIC_ID"
2096 $arSqlSelect = $arSqlSelectConst;
2102 $key = mb_strtoupper($key_res[
"FIELD"]);
2103 $strNegative = $key_res[
"NEGATIVE"];
2104 $strOperation = $key_res[
"OPERATION"];
2111 if (intval(
$val)<=0)
2112 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FSTAT.".
$key.
" IS NULL OR FSTAT.".
$key.
"<=0)";
2114 $arSqlSearch[] = ($strNegative==
"Y"?
" FSTAT.".$key.
" IS NULL OR NOT ":
"").
"(FSTAT.".
$key.
" ".$strOperation.
" ".intval(
$val).
" )";
2118 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FSTAT.".
$key.
" IS NULL)";
2120 $arSqlSearch[] = ($strNegative==
"Y"?
" FSTAT.".$key.
" IS NULL OR NOT ":
"").
"(FSTAT.".
$key.
" ".$strOperation.
" ".
$DB->CharToDateFunction(
$DB->ForSql(
$val),
"FULL").
")";
2122 case "HIDE_FROM_ONLINE":
2123 $arSqlFrom[
"FU"] =
"LEFT JOIN b_forum_user FU ON FSTAT.USER_ID=FU.USER_ID";
2125 $arSqlSearch[] = ($strNegative==
"Y"?
"NOT":
"").
"(FU.".
$key.
" IS NULL OR ".(
$DB->type ==
"MSSQL" ?
"LEN" :
"LENGTH").
"(FU.".
$key.
")<=0)";
2127 $arSqlSearch[] = ($strNegative==
"Y"?
" FU.".$key.
" IS NULL OR NOT ":
"").
"(FU.".
$key.
" ".$strOperation.
" '".
$DB->ForSql(
$val).
"' )";
2131 $arSqlSelect =
array(
2132 "FSTAT.USER_ID" =>
"FSTAT.USER_ID",
2133 "FSTAT.SHOW_NAME" =>
"FSTAT.SHOW_NAME",
2134 "COUNT_USER" =>
"COUNT(FSTAT.PHPSESSID) AS COUNT_USER",
2136 $arSqlGroup[
"FSTAT.USER_ID"] =
"FSTAT.USER_ID";
2137 $arSqlGroup[
"FSTAT.SHOW_NAME"] =
"FSTAT.SHOW_NAME";
2141 if (
count($arSqlSearch) > 0)
2142 $strSqlSearch =
" AND (".implode(
") AND (", $arSqlSearch).
") ";
2143 if (
count($arSqlSelect) > 0)
2144 $strSqlSelect = implode(
", ", $arSqlSelect);
2145 if (
count($arSqlFrom) > 0)
2146 $strSqlFrom = implode(
" ", $arSqlFrom);
2147 if (
count($arSqlGroup) > 0)
2148 $strSqlGroup =
" GROUP BY ".implode(
", ", $arSqlGroup);
2151 foreach ($arOrder as $by=>
$order)
2153 $by = mb_strtoupper($by);
2157 if ($by ==
"USER_ID") $arSqlOrder[] =
" FSTAT.USER_ID ".$order.
" ";
2161 if (
count($arSqlOrder) > 0)
2162 $strSqlOrder =
" ORDER BY ".implode(
", ", $arSqlOrder);
2164 $strSql =
" SELECT ".$strSqlSelect.
"
2165 FROM b_forum_stat FSTAT
2181 "DELETE FROM b_forum_stat WHERE LAST_VISIT < " . $helper->addDaysToDateTime(-1)
2183 return "CForumStat::CleanUp();";
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static update(int $id, array &$data)
static getConnection($name="")
static GetListEx($arOrder=Array("ID"=>"ASC"), $arFilter=Array())
static RegisterUSER_OLD($arFields=array())
static RegisterUSER($arFields=array())
static GetByID($ID, $arAddParams=array())
static GetFilterOperation($key)
static GetUserPermission($ID, $arUserGroups)
static GetList($arOrder=array("MIN_NUM_POSTS"=>"ASC"), $arFilter=array())
static GetListEx($arOrder=array("MIN_POINTS"=>"ASC"), $arFilter=array())
static GetList($arOrder=array("MIN_POINTS"=>"ASC"), $arFilter=array())
static GetLangByID($RANK_ID, $strLang)
static GetListEx($arOrder=array("MIN_NUM_POSTS"=>"ASC"), $arFilter=array())
static GetList($arOrder=array("MIN_NUM_POSTS"=>"ASC"), $arFilter=array())
static CanUserDeleteRank($ID, $arUserGroups)
static CanUserAddRank($arUserGroups)
static CheckFields($ACTION, &$arFields)
static CanUserUpdateRank($ID, $arUserGroups)
static GetByIDEx($ID, $strLang)
static Update($ID, $arFields)
static UpdateLastSend($MID, $sIDs)
static CanUserAddSubscribe($FID, $arUserGroups)
static CanUserDeleteSubscribe($ID, $arUserGroups, $CurrentUserID=0)
static GetListEx($arOrder=array("ID"=>"ASC"), $arFilter=array())
static GetList($arOrder=array("ID"=>"ASC"), $arFilter=array(), $arAddParams=array())
static CheckFields($ACTION, &$arFields)
static DeleteUSERSubscribe($USER_ID)
static CanUserUpdateSubscribe($ID, $arUserGroups, $CurrentUserID=0)
static Update($ID, $arFields)
static CountUserPoints($USER_ID=0, $iCnt=false)
static GetUserRank($USER_ID, $strLang=false)
static GetUserTopicVisits($forumID, $arTopic, $userID=null)
static IsAdmin($userId=false, $arGroups=false)
static GetUserPoints($USER_ID, $arAddParams=array())
static CheckFields($ACTION, &$arFields, $ID=false)
static GetListUserForumLastVisit($arOrder=Array("LAST_VISIT"=>"DESC"), $arFilter=Array())
static OnUserDelete($user_id)
static OnSocNetGroupDelete($group_id)
static CanUserDeleteUser($ID, $arUserGroups)
static GetByIDEx($ID, $arAddParams=array())
static SearchUser($template)
static CanUserAddUser($arUserGroups)
static SetStat($userId=0, $params=[])
static GetByUSER_ID($USER_ID)
static OnAfterUserUpdate($arFields=array())
static CountUsers($bActive=False, $arFilter=array())
static Add($fields, $strUploadDir=false)
static CanUserUpdateUser($ID, $arUserGroups, $CurrentUserID=0)
static GetByUSER_IDEx($USER_ID, $arAddParams=array())
static UserAddInfo($arOrder=array(), $arFilter=Array(), $mode=false, $iNum=0, $check_permission=true, $arNavigation=array())
static Update($ID, $arFields, $strUploadDir=false, $UpdateByUserId=false)
static SetUserForumLastVisit($USER_ID, $FORUM_ID=0, $LAST_VISIT=false)
static GetFormattedNameByUserID($userID, $template="", $arUser=array())
static CountSumPoints($TO_USER_ID)
static GetList($arOrder=Array("ID"=>"ASC"), $arFilter=Array(), $bCount=false, $iNum=0, $arAddParams=array())
static Concat($glue="", $pieces=array())
static GetList($arOrder=Array("ID"=>"ASC"), $arFilter=Array(), $arAddParams=array())
static GetAuthorityRating()
static GetRatingResult($ID, $entityId)
if(!is_array($prop["VALUES"])) $tmp
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
DelDuplicateSort(&$arSort)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
global_menu_<?echo $menu["menu_id"]?> adm main menu item icon adm main menu item text text adm main menu hover adm submenu menucontainer menu_id menu_id items_id items_id desktop menu_id block none adm global submenu<?=($subMenuDisplay=="block" ? " adm-global-submenu-active" :"")?> global_submenu_<?echo $menu["menu_id"]?> text MAIN_PR_ADMIN_FAV items adm submenu items wrap adm submenu items stretch wrap BX adminMenu itemsStretchScroll()"> <table class if (!empty( $menu["items"])) elseif ( $menu[ 'menu_id']=='desktop') if ( $menu[ 'menu_id']=='desktop') endforeach
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
$GLOBALS['_____370096793']