6 "reference_id" =>
array(
"P",
"T",
"N",
"V",
"D",
"A"));
10 "reference_id" =>
array(
"ASC",
"DESC"));
17 "reference_id" =>
array(
"A",
"E",
"I",
"M",
"Q",
"U",
"Y"));
18$GLOBALS[
"FORUMS_PER_PAGE"] = intVal(COption::GetOptionString(
"forum",
"FORUMS_PER_PAGE",
"10"));
19$GLOBALS[
"FORUM_TOPICS_PER_PAGE"] = intVal(COption::GetOptionString(
"forum",
"TOPICS_PER_PAGE",
"10"));
20$GLOBALS[
"FORUM_MESSAGES_PER_PAGE"] = intVal(COption::GetOptionString(
"forum",
"MESSAGES_PER_PAGE",
"10"));
45 while ($ar_Forum = $db_Forum->Fetch())
83 $strErr =
GetMessage(
"FSUBSC_NO_SPERMS").
". \n";
94 $LastVisit = time() + CTimeZone::GetOffset();
95 if (
$GLOBALS[
"USER"]->IsAuthorized())
97 if (!is_array($_SESSION[
"FORUM"][
"USER"]) || $_SESSION[
"FORUM"][
"USER"][
"USER_ID"] !=
$GLOBALS[
"USER"]->GetID()):
99 if ($_SESSION[
"FORUM"][
"USER"]):
100 $_SESSION[
"FORUM"][
"USER"][
"LAST_VISIT_TIMESTAMP"] =
MakeTimeStamp($_SESSION[
"FORUM"][
"USER"][
"LAST_VISIT"]);
102 $_SESSION[
"FORUM"][
"USER"] =
array();
105 elseif (empty($_SESSION[
"FORUM"][
"USER"][
"LAST_VISIT_TIMESTAMP"])):
109 $arUser = $_SESSION[
"FORUM"][
"USER"];
110 $UserLogin =
$GLOBALS[
"USER"]->GetLogin();
111 $LastVisit = $_SESSION[
"FORUM"][
"USER"][
"LAST_VISIT_TIMESTAMP"];
114 if (!isset($_SESSION[
"FORUM"][$UserLogin]) || !is_array($_SESSION[
"FORUM"][$UserLogin]) || !isset($_SESSION[
"FORUM"][$UserLogin][0]) || intVal($_SESSION[
"FORUM"][$UserLogin][0]) <= 0)
116 $_SESSION[
"FORUM"][$UserLogin] =
array();
125 if (!isset($_SESSION[
"FORUM"][$UserLogin][0]) || intVal($_SESSION[
"FORUM"][$UserLogin][0]) <= 0):
126 $_SESSION[
"FORUM"][$UserLogin] =
array();
132 $_SESSION[
"FORUM"][$UserLogin][0] = $LastVisit;
138 if (isset($_SESSION[
"FORUM"]) && isset($_SESSION[
"FORUM"][
"GUEST_TID"]) && !empty($_SESSION[
"FORUM"][
"GUEST_TID"]))
140 foreach ($_SESSION[
"FORUM"][
"GUEST_TID"] as
$key =>
$val):
152 unset($_SESSION[
"FORUM"][
"GUEST_TID"]);
153 unset($_SESSION[
"FORUM"][
"GUEST"]);
157 if (!isset($_SESSION[
"FORUM"][
"GUEST"]) || !is_array($_SESSION[
"FORUM"][
"GUEST"]))
159 $forum_cookie = COption::GetOptionString(
"main",
"cookie_name",
"BITRIX_SM").
"_FORUM_GUEST";
160 if (isset($_COOKIE[$forum_cookie]) && $_COOKIE[$forum_cookie] <>
'')
162 $arForum = explode(
"/", $_COOKIE[$forum_cookie]);
163 if (is_array($arForum) &&
count($arForum) > 0)
165 foreach ($arForum as $forumInfo)
167 list(
$f, $lv) = explode(
"-", $forumInfo);
168 $_SESSION[
"FORUM"][
"GUEST"][intVal(
$f)] = intVal($lv);
174 if (!isset($_SESSION[
"FORUM"][
"GUEST"]) || !is_array($_SESSION[
"FORUM"][
"GUEST"]) || (intVal($_SESSION[
"FORUM"][
"GUEST"][0]) < 0))
176 $_SESSION[
"FORUM"][
"GUEST"] =
array();
180 if (COption::GetOptionString(
"forum",
"USE_COOKIE",
"N") ==
"Y"):
182 foreach ($_SESSION[
"FORUM"][
"GUEST"] as
$key =>
$val):
185 $GLOBALS[
"APPLICATION"]->set_cookie(
"FORUM_GUEST", implode(
"/", $arCookie),
false,
"/",
false,
false,
"Y",
false);
189 if (!isset($_SESSION[
"FORUM"][
"GUEST_TID"]) || !is_array($_SESSION[
"FORUM"][
"GUEST_TID"]))
191 $_SESSION[
"FORUM"][
"GUEST_TID"] =
array();
192 $topic_cookie = COption::GetOptionString(
"main",
"cookie_name",
"BITRIX_SM").
"_FORUM_GUEST_TID";
193 if (isset($_COOKIE[$topic_cookie]) && $_COOKIE[$topic_cookie] <>
''):
194 $arTopic = explode(
"/", $_COOKIE[$topic_cookie]);
195 if (is_array($arTopic) &&
count($arTopic) > 0):
196 foreach ($arTopic as $topicInfo):
197 list(
$f, $lv) = explode(
"-", $topicInfo);
198 $_SESSION[
"FORUM"][
"GUEST_TID"][intVal(
$f)] = intVal($lv);
205 if (is_array($_SESSION[
"FORUM"]))
207 foreach ($_SESSION[
"FORUM"] as
$key =>
$val):
208 if (substr(
$key, 0, strLen(
"LAST_VISIT_FORUM_")) ==
"LAST_VISIT_FORUM_"):
209 unset($_SESSION[
"FORUM"][
$key]);
214 if (is_array($_SESSION[
"FORUM"][$UserLogin])):
215 foreach ($_SESSION[
"FORUM"][$UserLogin] as
$key =>
$val):
216 $_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_".$key] =
$val;
229 if (intVal($_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_0"]) <= 0)
233 $LAST_VISIT = max($_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_0"], $_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_".$FID]);
236 if (intVal($LAST_POST_DATE) > 0 && $LAST_POST_DATE < $LAST_VISIT):
249 if (is_array($_SESSION[
"FORUM"][
"GUEST_TID"]) && !empty($_SESSION[
"FORUM"][
"GUEST_TID"])):
250 $arFilter[
"RENEW_TOPIC"][0] = ConvertTimeStamp($LAST_VISIT,
"FULL");
251 foreach ($_SESSION[
"FORUM"][
"GUEST_TID"] as
$key =>
$val):
255 $arFilter[
">LAST_POST_DATE"] = ConvertTimeStamp($LAST_VISIT,
"FULL");
273 if (intVal($_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_0"]) <= 0)
277 $LAST_VISIT = intVal(
$GLOBALS[
"USER"]->IsAuthorized() ?
MakeTimeStamp($LAST_VISIT) : ($_SESSION[
"FORUM"][
"GUEST_TID"][$TID] ??
null));
278 $LAST_VISIT = max($LAST_VISIT, $_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_0"], intVal($_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_".$FID] ?? 0));
279 return ($LAST_POST_DATE > $LAST_VISIT);
286 $UserLogin =
"GUEST";
290 if (
$GLOBALS[
"USER"]->IsAuthorized()):
291 $UserLogin =
$GLOBALS[
"USER"]->GetLogin();
297 if (is_array($_SESSION[
"FORUM"])):
298 foreach ($_SESSION[
"FORUM"] as
$key =>
$val):
299 if (substr(
$key, 0, strLen(
"LAST_VISIT_FORUM_")) ==
"LAST_VISIT_FORUM_"):
300 unset($_SESSION[
"FORUM"][
$key]);
304 unset($_SESSION[
"FORUM"][$UserLogin]);
306 $_SESSION[
"FORUM"][$UserLogin][$FID] = $timestamp;
307 $_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_".$FID] = $timestamp;
317 if (!
$GLOBALS[
'USER']->IsAuthorized())
319 if (!isset($_SESSION[
"FORUM"][
"GUEST_TID"]))
322 if (COption::GetOptionString(
"forum",
"USE_COOKIE",
"N") ==
"Y")
325 foreach ($_SESSION[
"FORUM"][
"GUEST_TID"] as
$key =>
$val):
326 $arCookie[] = intVal(
$key).
"-".intVal(
$val);
328 $GLOBALS[
"APPLICATION"]->set_cookie(
"FORUM_GUEST_TID", implode(
"/", $arCookie),
false,
"/",
false,
false,
"Y",
false);
339 $FID = $forumId = intval($forumId ===
false ? $FID : $forumId);
341 if (
$USER->isAuthorized())
344 $forumUser = \Bitrix\Forum\User::getById(
$USER->getID());
345 $forumUser->setLastVisit()->setLocation($forumId, (
int) $TID);
347 if (!isset($_SESSION[
'FORUM']))
349 $_SESSION[
'FORUM'] = [
354 if (!isset($_SESSION[
"FORUM"][
"USER"]) || !is_array($_SESSION[
"FORUM"][
"USER"]) || $_SESSION[
"FORUM"][
"USER"][
"USER_ID"] !=
$USER->getID())
356 $_SESSION[
"FORUM"][
"USER"] = $forumUser->getData();
357 $_SESSION[
"FORUM"][
"SHOW_NAME"] = $_SESSION[
"FORUM"][
"USER"][
"SHOW_NAME"];
379 if (intVal($_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_0"]) <= 0)
381 $LastVisit = max(intVal($_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_0"]), intVal($_SESSION[
"FORUM"][
"LAST_VISIT_FORUM_".$FID]));
383 if (
$USER->IsAuthorized())
386 array(
"TOPIC_ID" => $TID,
"USER_ID" =>
$USER->GetId(),
">NEW_MESSAGE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat(
"FULL", LANG)), $LastVisit)), 0, 1);
390 $LastVisit = max($LastVisit, intVal($_SESSION[
"FORUM"][
"GUEST_TID"][$TID]));
392 array(
"TOPIC_ID" => $TID,
">POST_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat(
"FULL", LANG)), $LastVisit)), 0, 1);
401 $url = CUtil::GetAdditionalFileURL($script);
402 return "<script>BX.ready(function(){BX.loadScript(\"".$url.
"\");});</script>\n";
412 LHEButtons[
'Translit'].handler =
function(pBut)
415 var translit =
function(textbody)
417 if (typeof but.pLEditor.bTranslited ==
'undefined')
418 but.pLEditor.bTranslited =
false;
420 var arStack =
new Array();
423 function bPushTag(str, p1, offset, s)
429 function bPopTag(str, p1, offset, s)
431 return arStack.shift();
435 var r =
new RegExp(
"(\\[[^\\]]*\\])",
'gi');
436 textbody = textbody.replace(r, bPushTag);
438 if ( but.pLEditor.bTranslited ==
false)
440 for (i=0; i<capitEngLettersReg.length; i++) textbody = textbody.replace(capitEngLettersReg[i], capitRusLetters[i]);
441 for (i=0; i<smallEngLettersReg.length; i++) textbody = textbody.replace(smallEngLettersReg[i], smallRusLetters[i]);
442 but.pLEditor.bTranslited =
true;
446 for (i=0; i<capitRusLetters.length; i++) textbody = textbody.replace(capitRusLettersReg[i], capitEngLetters[i]);
447 for (i=0; i<smallRusLetters.length; i++) textbody = textbody.replace(smallRusLettersReg[i], smallEngLetters[i]);
448 but.pLEditor.bTranslited =
false;
451 textbody = textbody.replace(
new RegExp(
"\001",
"g"), bPopTag);
456 pBut.pLEditor.SaveContent();
457 var content = translit(pBut.pLEditor.GetContent());
461 if (window.oLHE.sEditorMode ==
'code')
462 window.oLHE.SetContent(content);
464 window.oLHE.SetEditorContent(content);
467 LHEButtons[
'SmileList'][
'SetSmile'] =
function(k, pList)
470 var oSmile = pList.oSmiles[k];
472 if (pList.pLEditor.sEditorMode ==
'code')
473 pList.pLEditor.WrapWith(
' ',
' ', oSmile.code);
475 pList.pLEditor.InsertHTML(
'<img id="' + pList.pLEditor.SetBxTag(
false, {tag:
"smile", params: oSmile}) +
'" src="' + oSmile.path +
'" title="' + oSmile.name +
'"/>');
480 LHEButtons[
'SmileList'][
'parser'][
'obj'][
'UnParse'] =
function(bxTag, pNode, pLEditor)
482 if (!bxTag.params || !bxTag.params.code)
484 return ' ' + bxTag.params.code +
' ';
486 LHEButtons[
'ForumVideo'] = {
487 id :
'ForumInputVideo',
488 src :
'/bitrix/components/bitrix/forum/templates/.default/images/bbcode/font_video.gif',
489 name :
'<?=GetMessage("FR_VIDEO")?>',
490 handler:
function(pBut)
492 pBut.pLEditor.OpenDialog({id :
'ForumVideo', obj:
false});
494 OnBeforeCreate:
function(pLEditor, pBut)
497 pBut.disableOnCodeView = !pLEditor.bBBCode || pLEditor.arConfig.bConvertContentFromBBCodes;
503 Parse:
function(sName, sContent, pLEditor)
505 sContent = sContent.replace(/\[VIDEO\s*?
width=(\d+)\s*?
height=(\d+)\s*\]((?:\s|\S)*?)\[\/VIDEO\]/ig,
function(str, w, h, src)
508 w = parseInt(w) || 400,
509 h = parseInt(h) || 300,
510 src = BX.util.trim(src);
512 return '<img id="' + pLEditor.SetBxTag(
false, {tag:
"forumvideo", params: {value : src}}) +
'" src="/bitrix/images/1.gif" class="bxed-video" width=' + w +
' height=' + h +
' title="' + BX.message.Video +
": " + src +
'" />';
516 UnParse:
function(bxTag, pNode, pLEditor)
518 if (bxTag.tag ==
'forumvideo')
520 return "[VIDEO WIDTH=" + pNode.arAttributes[
"width"] +
" HEIGHT=" + pNode.arAttributes[
"height"] +
"]" + bxTag.params.value +
"[/VIDEO]";
527 if (!LHEButtons[
'InputVideo'])
528 LHEButtons[
'InputVideo'] = LHEButtons[
'ForumVideo'];
530 window.LHEDailogs[
'ForumVideo'] =
function(pObj)
532 var str =
'<table width="100%"><tr>' +
533 '<td class="lhe-dialog-label lhe-label-imp"><label for="' + pObj.pLEditor.id +
'lhed_forum_video_path"><b><?= GetMessage('FR_VIDEO_P
')?>:</b></label></td>' +
534 '<td class="lhe-dialog-param">' +
535 '<input id="' + pObj.pLEditor.id +
'lhed_forum_video_path" value="" size="30"/>' +
539 '<td style="padding: 0!important; font-size: 11px!important;"><?= GetMessageJS('FR_VIDEO_PATH_EXAMPLE
')?></td>' +
541 '<td class="lhe-dialog-label lhe-label-imp"><label for="' + pObj.pLEditor.id +
'lhed_forum_video_width">' + BX.message.ImageSizing +
':</label></td>' +
542 '<td class="lhe-dialog-param">' +
543 '<input id="' + pObj.pLEditor.id +
'lhed_forum_video_width" value="" size="4"/>' +
545 '<input id="' + pObj.pLEditor.id +
'lhed_forum_video_height" value="" size="4" />' +
550 title:
"<?= GetMessageJS('FR_VIDEO')?>",
555 pObj.pPath = BX(pObj.pLEditor.id +
"lhed_forum_video_path");
556 pObj.pWidth = BX(pObj.pLEditor.id +
"lhed_forum_video_width");
557 pObj.pHeight = BX(pObj.pLEditor.id +
"lhed_forum_video_height");
559 pObj.pLEditor.focus(pObj.pPath);
563 pLEditor = window.oLHE;
566 src = BX.util.trim(pObj.pPath.value),
567 w = parseInt(pObj.pWidth.value) || 400,
568 h = parseInt(pObj.pHeight.value) || 300;
573 if (pLEditor.sEditorMode ==
'code' && pLEditor.bBBCode)
575 pLEditor.WrapWith(
"",
"",
"[VIDEO WIDTH=" + w +
" HEIGHT=" + h +
"]" + src +
"[/VIDEO]");
577 else if(pLEditor.sEditorMode ==
'html')
579 pLEditor.InsertHTML(
'<img id="' + pLEditor.SetBxTag(
false, {tag:
"forumvideo", params: {value : src}}) +
580 '" src="/bitrix/images/1.gif" class="bxed-video" width=' + w +
' height=' + h +
581 ' title="' + BX.message.Video +
": " + src +
'" />');
static RegisterUSER($arFields=array())
static GetList($arOrder=Array("SORT"=>"ASC"), $arFilter=Array(), $arAddParams=array())
static SetLabelsBeRead($ID, $arUserGroups)
static CanUserDeleteSubscribe($ID, $arUserGroups, $CurrentUserID=0)
static SetReadLabelsNew($ID, $updateForum=false, $LastVisit=false, $arAddParams=array())
static IsAdmin($userId=false, $arGroups=false)
static GetListUserForumLastVisit($arOrder=Array("LAST_VISIT"=>"DESC"), $arFilter=Array())
static GetByUSER_ID($USER_ID)
static SetUserForumLastVisit($USER_ID, $FORUM_ID=0, $LAST_VISIT=false)
static GetList($arOrder=Array("ID"=>"ASC"), $arFilter=Array(), $bCount=false, $iNum=0, $arAddParams=array())
static GetListEx($arOrder=Array("ID"=>"ASC"), $arFilter=Array(), $bCount=false, $iNum=0, $arAddParams=array())
static GetNowTime($ResultType="timestamp")
static GetListEx($arOrder=Array("SORT"=>"ASC"), $arFilter=Array(), $bCount=false, $iNum=0, $arAddParams=[])
static GetList($arOrder=Array("SORT"=>"ASC"), $arFilter=Array(), $bCount=false, $iNum=0, $arAddParams=array())
ForumAddDeferredScript($script)
ForumSetLastVisit($forumId=false, $TID=false, $arAddParams=array())
ForumSetAllMessagesReaded($FID=false)
ForumGetFirstUnreadMessage($FID, $TID)
ForumDeleteSubscribe($ID, &$strErr, &$strOk)
ForumSetAllMessagesRead($FID=false)
ForumSetReadForum($FID=false)
NewMessageTopic($FID, $TID, $LAST_POST_DATE, $LAST_VISIT)
ForumSetReadTopic($FID, $TID)
NewMessageForum($FID, $LAST_POST_DATE=false)
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
ForumCurrUserPermissions($FID, $arAddParams=array())
IsModuleInstalled($module_id)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
MakeTimeStamp($datetime, $format=false)
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)
<? endif;?> window document title
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."%"
$GLOBALS['_____370096793']