本文整理汇总了PHP中CForumNew::PreparePath2Message方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumNew::PreparePath2Message方法的具体用法?PHP CForumNew::PreparePath2Message怎么用?PHP CForumNew::PreparePath2Message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForumNew
的用法示例。
在下文中一共展示了CForumNew::PreparePath2Message方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateStatisticModule
private function updateStatisticModule($mid)
{
if (\CModule::IncludeModule("statistic")) {
$F_EVENT1 = $this->forum["EVENT1"];
$F_EVENT2 = $this->forum["EVENT2"];
$F_EVENT3 = $this->forum["EVENT3"];
if (empty($F_EVENT3)) {
$site = (array) \CForumNew::GetSites($this->forum["ID"]);
$F_EVENT3 = \CForumNew::PreparePath2Message(array_key_exists(SITE_ID, $site) ? $site[SITE_ID] : reset($site), array("FORUM_ID" => $this->forum["ID"], "TOPIC_ID" => $this->topic["ID"], "MESSAGE_ID" => $mid));
}
\CStatistics::Set_Event($F_EVENT1, $F_EVENT2, $F_EVENT3);
}
}
示例2: OnReindex
function OnReindex($NS = array(), $oCallback = NULL, $callback_method = "")
{
global $DB;
$arResultAll = array();
$arParams = array("PERMISSION" => array(), "SITE" => array(), "DEFAULT_URL" => array());
$search_message_count = intVal(COption::GetOptionInt("forum", "search_message_count", 0));
$strNSJoin = "";
$strFilter = "";
if ($NS["MODULE"] == "forum" && intVal($NS["ID"]) > 0 && intVal($NS["CNT"]) > 0) {
$strFilter = " AND (FM.ID>" . intVal($NS["ID"]) . ") ";
} elseif ($NS["MODULE"] == "forum" && intVal($NS["ID"]) > 0) {
// out of date
$strFilter = " AND (FM.ID>=" . intVal($NS["ID"]) . ") ";
}
if ($NS["SITE_ID"] != "") {
$strNSJoin .= " INNER JOIN b_forum2site FS ON (FS.FORUM_ID=F.ID) ";
$strFilter .= " AND FS.SITE_ID='" . $DB->ForSQL($NS["SITE_ID"]) . "' ";
}
$strSql = "SELECT STRAIGHT_JOIN FT.ID as TID, FM.ID as MID, FM.ID as ID, FT.FORUM_ID, FT.TITLE, " . CForumNew::Concat("-", array("FT.ID", "FT.TITLE_SEO")) . ",\n\t\t\t\tFT.DESCRIPTION, FT.TAGS, FT.HTML as FT_HTML,\n\t\t\t\tFM.PARAM1, FM.PARAM2, FM.POST_MESSAGE, FM.POST_MESSAGE_FILTER, FM.POST_MESSAGE_HTML, FM.AUTHOR_NAME, FM.AUTHOR_ID, FM.NEW_TOPIC,\n\t\t\t\t" . $DB->DateToCharFunction("FM.POST_DATE") . " as POST_DATE, " . $DB->DateToCharFunction("FM.EDIT_DATE") . " as EDIT_DATE, FT.SOCNET_GROUP_ID, FT.OWNER_ID\n\t\t\tFROM b_forum_message FM use index (PRIMARY), b_forum_topic FT, b_forum F\n\t\t\t" . $strNSJoin . "\n\t\t\tWHERE (FM.TOPIC_ID = FT.ID) AND (F.ID = FT.FORUM_ID) AND (F.INDEXATION = 'Y') AND (FM.APPROVED = 'Y')\n\t\t\t" . $strFilter . "\n\t\t\tORDER BY FM.ID";
if ($search_message_count > 0) {
$strSql .= " LIMIT 0, " . $search_message_count;
}
$db_res = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
if ($db_res && COption::GetOptionString("forum", "FILTER", "Y") == "Y") {
$db_res = new _CMessageDBResult($db_res);
}
$rownum = 0;
while ($res = $db_res->Fetch()) {
$rownum++;
if (empty($arParams["PERMISSION"][$res["FORUM_ID"]])) {
$arGroups = CForumNew::GetAccessPermissions($res["FORUM_ID"]);
$arParams["PERMISSION"][$res["FORUM_ID"]] = array();
for ($i = 0; $i < count($arGroups); $i++) {
if ($arGroups[$i][1] >= "E") {
$arParams["PERMISSION"][$res["FORUM_ID"]][] = $arGroups[$i][0];
if ($arGroups[$i][0] == 2) {
break;
}
}
}
}
if (empty($arParams["SITE"][$res["FORUM_ID"]])) {
$arParams["SITE"][$res["FORUM_ID"]] = CForumNew::GetSites($res["FORUM_ID"]);
}
$arResult = array("ID" => $res["MID"], "LID" => array(), "LAST_MODIFIED" => !empty($res["EDIT_DATE"]) ? $res["EDIT_DATE"] : $res["POST_DATE"], "PARAM1" => $res["FORUM_ID"], "PARAM2" => $res["TID"], "USER_ID" => $res["AUTHOR_ID"], "ENTITY_TYPE_ID" => $res["NEW_TOPIC"] == "Y" ? "FORUM_TOPIC" : "FORUM_POST", "ENTITY_ID" => $res["NEW_TOPIC"] == "Y" ? $res["TID"] : $res["MID"], "PERMISSIONS" => $arParams["PERMISSION"][$res["FORUM_ID"]], "TITLE" => $res["TITLE"] . ($res["NEW_TOPIC"] == "Y" && !empty($res["DESCRIPTION"]) ? ", " . $res["DESCRIPTION"] : ""), "TAGS" => $res["NEW_TOPIC"] == "Y" ? $res["TAGS"] : "", "BODY" => GetMessage("AVTOR_PREF") . " " . $res["AUTHOR_NAME"] . ". " . textParser::killAllTags(COption::GetOptionString("forum", "FILTER", "Y") != "Y" ? $res["POST_MESSAGE"] : $res["POST_MESSAGE_FILTER"]), "URL" => "", "INDEX_TITLE" => $res["NEW_TOPIC"] == "Y");
foreach ($arParams["SITE"][$res["FORUM_ID"]] as $key => $val) {
$arResult["LID"][$key] = CForumNew::PreparePath2Message($val, array("FORUM_ID" => $res["FORUM_ID"], "TOPIC_ID" => $res["TID"], "MESSAGE_ID" => $res["MID"], "SOCNET_GROUP_ID" => $res["SOCNET_GROUP_ID"], "OWNER_ID" => $res["OWNER_ID"], "PARAM1" => $res["PARAM1"], "PARAM2" => $res["PARAM2"]));
if (empty($arResult["URL"]) && !empty($arResult["LID"][$key])) {
$arResult["URL"] = $arResult["LID"][$key];
}
}
if (empty($arResult["URL"])) {
if (empty($arParams["DEFAULT_URL"][$res["FORUM_ID"]])) {
$arParams["DEFAULT_URL"][$res["FORUM_ID"]] = "/";
foreach ($arParams["SITE"][$res["FORUM_ID"]] as $key => $val) {
$db_lang = CLang::GetByID($key);
if ($db_lang && ($ar_lang = $db_lang->Fetch())) {
$arParams["DEFAULT_URL"][$res["FORUM_ID"]] = $ar_lang["DIR"];
break;
}
}
$arParams["DEFAULT_URL"][$res["FORUM_ID"]] .= COption::GetOptionString("forum", "REL_FPATH", "") . "forum/read.php?FID=#FID#&TID=#TID#&MID=#MID##message#MID#";
}
$arResult["URL"] = CForumNew::PreparePath2Message($arParams["DEFAULT_URL"][$res["FORUM_ID"]], array("FORUM_ID" => $res["FORUM_ID"], "TOPIC_ID" => $res["TID"], "MESSAGE_ID" => $res["MID"], "SOCNET_GROUP_ID" => $res["SOCNET_GROUP_ID"], "OWNER_ID" => $res["OWNER_ID"], "PARAM1" => $res["PARAM1"], "PARAM2" => $res["PARAM2"]));
}
if ($oCallback) {
$resCall = call_user_func(array($oCallback, $callback_method), $arResult);
if (!$resCall) {
return $arResult["ID"];
}
} else {
$arResultAll[] = $arResult;
}
}
if ($oCallback && $search_message_count > 0 && $rownum >= $search_message_count - 1) {
return $arResult["ID"];
}
if ($oCallback) {
return false;
}
return $arResultAll;
}
示例3: AddComment_News
function AddComment_News($arFields)
{
if (!CModule::IncludeModule("forum")) {
return false;
}
if (!CModule::IncludeModule("iblock")) {
return false;
}
if (!CModule::IncludeModule("socialnetwork")) {
return false;
}
$dbResult = CSocNetLog::GetList(array("ID" => "DESC"), array("TMP_ID" => $arFields["LOG_ID"]), false, false, array("ID", "SOURCE_ID", "PARAMS"));
$bFound = false;
if ($arLog = $dbResult->Fetch()) {
if (intval($arLog["SOURCE_ID"]) > 0) {
$arFilter = array("ID" => $arLog["SOURCE_ID"]);
$arSelectedFields = array("IBLOCK_ID", "ID", "CREATED_BY", "NAME", "PROPERTY_FORUM_TOPIC_ID", "PROPERTY_FORUM_MESSAGE_CNT");
$db_res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelectedFields);
if ($db_res && ($res = $db_res->GetNext())) {
$arElement = $res;
$val = COption::GetOptionString("intranet", "sonet_log_news_iblock_forum");
if (strlen($val) > 0) {
$arIBlockForum = unserialize($val);
} else {
$arIBlockForum = array();
}
if (array_key_exists($arElement["IBLOCK_ID"], $arIBlockForum)) {
$FORUM_ID = $arIBlockForum[$arElement["IBLOCK_ID"]];
}
if (intval($FORUM_ID) > 0) {
CSocNetLogTools::AddComment_Review_CheckIBlock($arElement);
$dbMessage = CForumMessage::GetList(array(), array("PARAM2" => $arElement["ID"]));
if (!($arMessage = $dbMessage->Fetch())) {
// Add Topic
$TOPIC_ID = CSocNetLogTools::AddComment_Review_CreateRoot($arElement, $FORUM_ID);
$bNewTopic = true;
} else {
$TOPIC_ID = $arMessage["TOPIC_ID"];
}
if (intval($TOPIC_ID) > 0) {
// Add comment
$messageID = false;
$bError = false;
if (CForumMessage::CanUserAddMessage($TOPIC_ID, $GLOBALS["USER"]->GetUserGroupArray(), $GLOBALS["USER"]->GetID(), false)) {
$bSHOW_NAME = true;
$res = CForumUser::GetByUSER_ID($GLOBALS["USER"]->GetID());
if ($res) {
$bSHOW_NAME = $res["SHOW_NAME"] == "Y";
}
if ($bSHOW_NAME) {
$AUTHOR_NAME = $GLOBALS["USER"]->GetFullName();
}
if (strlen(Trim($AUTHOR_NAME)) <= 0) {
$AUTHOR_NAME = $GLOBALS["USER"]->GetLogin();
}
if (strlen($AUTHOR_NAME) <= 0) {
$bError = true;
}
}
if (!$bError) {
$arFieldsMessage = array("POST_MESSAGE" => $arFields["TEXT_MESSAGE"], "USE_SMILES" => "Y", "APPROVED" => "Y", "PARAM2" => $arElement["ID"], "AUTHOR_NAME" => $AUTHOR_NAME, "AUTHOR_ID" => IntVal($GLOBALS["USER"]->GetParam("USER_ID")), "FORUM_ID" => $FORUM_ID, "TOPIC_ID" => $TOPIC_ID, "NEW_TOPIC" => "N", "GUEST_ID" => $_SESSION["SESS_GUEST_ID"], "ADD_TO_LOG" => "N");
$AUTHOR_IP = ForumGetRealIP();
$AUTHOR_IP_tmp = $AUTHOR_IP;
$AUTHOR_REAL_IP = $_SERVER['REMOTE_ADDR'];
if (COption::GetOptionString("forum", "FORUM_GETHOSTBYADDR", "N") == "Y") {
$AUTHOR_IP = @gethostbyaddr($AUTHOR_IP);
if ($AUTHOR_IP_tmp == $AUTHOR_REAL_IP) {
$AUTHOR_REAL_IP = $AUTHOR_IP;
} else {
$AUTHOR_REAL_IP = @gethostbyaddr($AUTHOR_REAL_IP);
}
}
$arFieldsMessage["AUTHOR_IP"] = $AUTHOR_IP !== False ? $AUTHOR_IP : "<no address>";
$arFieldsMessage["AUTHOR_REAL_IP"] = $AUTHOR_REAL_IP !== False ? $AUTHOR_REAL_IP : "<no address>";
$messageID = CForumMessage::Add($arFieldsMessage, false);
if (intVal($messageID) <= 0) {
$bError = true;
} else {
if (CModule::IncludeModule("statistic")) {
$arForum = CForumNew::GetByID($FORUM_ID);
$F_EVENT1 = $arForum["EVENT1"];
$F_EVENT2 = $arForum["EVENT2"];
$F_EVENT3 = $arForum["EVENT3"];
if (strlen($F_EVENT3) <= 0) {
$arForumSite_tmp = CForumNew::GetSites($FORUM_ID);
$F_EVENT3 = CForumNew::PreparePath2Message($arForumSite_tmp[SITE_ID], array("FORUM_ID" => $FORUM_ID, "TOPIC_ID" => $TOPIC_ID, "MESSAGE_ID" => $messageID));
}
CStatistic::Set_Event($F_EVENT1, $F_EVENT2, $F_EVENT3);
}
CForumMessage::SendMailMessage($messageID, array(), false, "NEW_FORUM_MESSAGE");
CSocNetLogTools::AddComment_Review_UpdateElement($arElement, $TOPIC_ID, $bNewTopic);
}
}
}
}
}
}
}
if (intval($messageID) <= 0) {
$strError = GetMessage("SONET_ADD_COMMENT_SOURCE_ERROR");
//.........这里部分代码省略.........
示例4: Add
//.........这里部分代码省略.........
if ($arParams["SKIP_STATISTIC"] == "Y" && $arParams["SKIP_INDEXING"] == "Y")
return $ID;
$arMessage = CForumMessage::GetByIDEx($ID, array("GET_FORUM_INFO" => "N", "GET_TOPIC_INFO" => "Y", "FILTER" => "Y"));
if ($arParams["SKIP_STATISTIC"] != "Y")
{
if (intVal($arMessage["AUTHOR_ID"]) > 0)
{
CForumUser::SetStat($arMessage["AUTHOR_ID"], array("MESSAGE" => $arMessage));
}
CForumTopic::SetStat($arMessage["TOPIC_ID"], array("MESSAGE" => $arMessage));
CForumNew::SetStat($arMessage["FORUM_ID"], array("MESSAGE" => $arMessage));
}
/***************** Events onAfterMessageAdd ************************/
foreach(GetModuleEvents("forum", "onAfterMessageAdd", true) as $arEvent)
ExecuteModuleEventEx($arEvent, array(&$ID, $arMessage, $arMessage["TOPIC_INFO"], $arMessage["FORUM_INFO"], $arFields));
/***************** /Events *****************************************/
if ($arMessage["APPROVED"] == "Y")
{
if ($arParams["SKIP_INDEXING"] != "Y" && CModule::IncludeModule("search"))
{
$arMessage["POST_MESSAGE"] = (COption::GetOptionString("forum", "FILTER", "Y") == "Y" ?
$arMessage["POST_MESSAGE_FILTER"] : $arMessage["POST_MESSAGE"]);
$arParams = array(
"PERMISSION" => array(),
"SITE" => CForumNew::GetSites($arMessage["FORUM_ID"]),
"DEFAULT_URL" => "/");
$arGroups = CForumNew::GetAccessPermissions($arMessage["FORUM_ID"]);
foreach($arGroups as $arGroup)
{
if ($arGroup[1] >= "E")
{
$arParams["PERMISSION"][] = $arGroup[0];
if ($arGroup[0] == 2)
break;
}
}
$arSearchInd = array(
"LID" => array(),
"LAST_MODIFIED" => $arMessage["POST_DATE"],
"PARAM1" => $arMessage["FORUM_ID"],
"PARAM2" => $arMessage["TOPIC_ID"],
"ENTITY_TYPE_ID" => ($arMessage["NEW_TOPIC"] == "Y"? "FORUM_TOPIC": "FORUM_POST"),
"ENTITY_ID" => ($arMessage["NEW_TOPIC"] == "Y"? $arMessage["TOPIC_ID"]: $ID),
"USER_ID" => $arMessage["AUTHOR_ID"],
"PERMISSIONS" => $arParams["PERMISSION"],
"TITLE" => $arMessage["TOPIC_INFO"]["TITLE"].($arMessage["NEW_TOPIC"] == "Y" && !empty($arMessage["TOPIC_INFO"]["DESCRIPTION"]) ?
", ".$arMessage["TOPIC_INFO"]["DESCRIPTION"] : ""),
"TAGS" => ($arMessage["NEW_TOPIC"] == "Y" ? $arMessage["TOPIC_INFO"]["TAGS"] : ""),
"BODY" => GetMessage("AVTOR_PREF")." ".$arMessage["AUTHOR_NAME"].". ".(textParser::killAllTags($arMessage["POST_MESSAGE"])),
"URL" => "",
"INDEX_TITLE" => $arMessage["NEW_TOPIC"] == "Y",
);
// get mentions
$arMentionedUserID = CForumMessage::GetMentionedUserID($arMessage["POST_MESSAGE"]);
if (!empty($arMentionedUserID))
{
$arSearchInd["PARAMS"] = array(
"mentioned_user_id" => $arMentionedUserID
);
}
$urlPatterns = array(
"FORUM_ID" => $arMessage["FORUM_ID"],
"TOPIC_ID" => $arMessage["TOPIC_ID"],
"TITLE_SEO" => $arMessage["TOPIC_INFO"]["TITLE_SEO"],
"MESSAGE_ID" => $arMessage["ID"],
"SOCNET_GROUP_ID" => $arMessage["TOPIC_INFO"]["SOCNET_GROUP_ID"],
"OWNER_ID" => $arMessage["TOPIC_INFO"]["OWNER_ID"],
"PARAM1" => $arMessage["PARAM1"],
"PARAM2" => $arMessage["PARAM2"]);
foreach ($arParams["SITE"] as $key => $val)
{
$arSearchInd["LID"][$key] = CForumNew::PreparePath2Message($val, $urlPatterns);
if (empty($arSearchInd["URL"]) && !empty($arSearchInd["LID"][$key]))
$arSearchInd["URL"] = $arSearchInd["LID"][$key];
}
if (empty($arSearchInd["URL"]))
{
foreach ($arParams["SITE"] as $key => $val):
$db_lang = CLang::GetByID($key);
if ($db_lang && $ar_lang = $db_lang->Fetch()):
$arParams["DEFAULT_URL"] = $ar_lang["DIR"];
break;
endif;
endforeach;
$arParams["DEFAULT_URL"] .= COption::GetOptionString("forum", "REL_FPATH", "").
"forum/read.php?FID=#FID#&TID=#TID#&MID=#MID##message#MID#";
$arSearchInd["URL"] = CForumNew::PreparePath2Message($arParams["DEFAULT_URL"], $urlPatterns);
}
CSearch::Index("forum", $ID, $arSearchInd);
}
}
return $ID;
}
示例5: SendMailMessage
//.........这里部分代码省略.........
} elseif ($arMailParams['USE_EMAIL'] == 'Y' && $arMessage["EMAIL"] != '') {
$arFields["FROM_EMAIL"] = '"' . $arMessage['AUTHOR_NAME'] . '" <' . $arMessage['EMAIL'] . '>';
} else {
$arFields["FROM_EMAIL"] = '"' . $arMessage['AUTHOR_NAME'] . '" <' . $arMailParams['EMAIL'] . '>';
}
if ($arMessage["NEW_TOPIC"] == "Y") {
$arFields["=Message-Id"] = $arFields["MSG_ID"] = "<" . $arTopic["XML_ID"] . ">";
} else {
$arFields["TOPIC_TITLE"] = "Re" . ($arMessage["TOPIC_INFO"]["POSTS"] > 1 ? "[" . $arMessage["TOPIC_INFO"]["POSTS"] . "]" : "") . ": " . $arFields["TOPIC_TITLE"];
$arFields["=Message-Id"] = $arFields["MSG_ID"] = "<" . $arMessage["XML_ID"] . ">";
$arFields["=In-Reply-To"] = $arFields["IN_REPLY_TO"] = "<" . $arTopic["XML_ID"] . ">";
}
//fill REPLY_TO from the settings of the mail processor
$arFields["=Reply-To"] = $arFields["REPLY_TO"] = $arMailParams["EMAIL"];
$arFields["FORUM_EMAIL"] = $arMailParams["EMAIL"];
$arSocNetGroup = CSocNetGroup::GetById($arTopic["SOCNET_GROUP_ID"]);
$arFields["FORUM_NAME"] = $arSocNetGroup["NAME"];
if ($arMailParams["SUBJECT_SUF"] != '') {
$arFields["TOPIC_TITLE"] .= ' ' . $arMailParams["SUBJECT_SUF"];
}
if ($arMailParams["USE_SUBJECT"] == "Y") {
$arFields["=Subject"] = $arFields["TOPIC_TITLE"];
}
$arFields["PATH2FORUM"] = CComponentEngine::MakePathFromTemplate($arMailParams["URL_TEMPLATES_MESSAGE"], array("FID" => $arMessage["FORUM_ID"], "TID" => $arMessage["TOPIC_ID"], "TITLE_SEO" => $arMessage["TOPIC_INFO"]["TITLE_SEO"], "MID" => $arMessage["ID"]));
} else {
return false;
}
} else {
return false;
}
} else {
$arForumSites = CForumNew::GetSites($FID);
foreach ($arForumSites as $site_id => $path) {
$arForumSites[$site_id] = trim(CForumNew::PreparePath2Message($arForumSites[$site_id], array("FORUM_ID" => $arMessage["FORUM_ID"], "TOPIC_ID" => $arMessage["TOPIC_ID"], "TITLE_SEO" => $arMessage["TOPIC_INFO"]["TITLE_SEO"], "MESSAGE_ID" => $arMessage["ID"], "SOCNET_GROUP_ID" => $arTopic["SOCNET_GROUP_ID"], "OWNER_ID" => $arTopic["OWNER_ID"], "PARAM1" => $arMessage["PARAM1"], "PARAM2" => $arMessage["PARAM2"])));
if (empty($arForumSites[$site_id])) {
$db_lang = CSite::GetByID($site_id);
$arForumSites[$site_id] = "/";
if ($ar_lang = $db_lang->Fetch()) {
$arForumSites[$site_id] = $ar_lang["DIR"];
}
$arForumSites[$site_id] = COption::GetOptionString("forum", "REL_FPATH", "") . "forum/read.php?FID=#FID#&TID=#TID#&MID=#MID##message#MID#";
}
}
foreach (GetModuleEvents("forum", "onBeforeMailMessageSend", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array(&$mailTemplate, &$arForumSites, &$arFields, $arForum, $arTopic, $arMessage)) === false) {
return false;
}
}
}
/*
??
ALTER TABLE dbo.B_FORUM_MESSAGE ADD
MSG_ID varchar(255) NULL,
MAIL_MESSAGE_ID int NULL
*/
$arFilter = array("FORUM_ID" => $FID, "TOPIC_ID_OR_NULL" => $TID, "ACTIVE" => "Y", ">=PERMISSION" => $arTopic["APPROVED"] != "Y" || $arMessage["APPROVED"] != "Y" ? "Q" : "E");
if ($arMessage["NEW_TOPIC"] != "Y") {
$arFilter["NEW_TOPIC_ONLY"] = "N";
}
if ($mailTemplate == "NEW_FORUM_MESSAGE") {
$arFilter["LAST_SEND_OR_NULL"] = $MID;
}
if ($arTopic["SOCNET_GROUP_ID"] > 0) {
$mailTemplate = "FORUM_NEW_MESSAGE_MAIL";
$arFilter["SOCNET_GROUP_ID"] = $arTopic["SOCNET_GROUP_ID"];
} else {
示例6: BeginNote
siteCheck = document.forum_edit["SITE[" + lid + "]"];
sitePath = document.forum_edit["SITE_PATH[" + lid + "]"];
if (siteCheck.checked && sitePath.value.length <= 0)
{
var res = dir + "/forum/index.php?PAGE_NAME=message&FID=#FORUM_ID#&TID=#TOPIC_ID#&MID=#MESSAGE_ID#";
sitePath.value = res.replace(/\/\//g, "/");
}
}
//-->
</script>
<?php
echo BeginNote();
?>
<span class="required"><sup>1</sup></span> -
<?php
if (IsModuleInstalled("search")) {
echo GetMessage("REQUIRE_REINDEX", array("#LINK#" => "/bitrix/admin/search_reindex.php"));
?>
<?php
}
$res = CForumNew::PreparePath2Message(null);
echo GetMessage("FE_SAMPLE_SITEPATH");
?>
: /forum/index.php?PAGE_NAME=message&FID=#FORUM_ID#&TID=#TOPIC_ID#&MID=#MESSAGE_ID#
<br /><?php
echo implode(', ', $res);
?>
<br />
<?php
echo EndNote();
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
示例7: array_shift
$res = CForumTopic::GetByID($a_ITEM_ID);
$res["MESSAGE_ID"] = $res["LAST_MESSAGE_ID"];
$res["TOPIC_ID"] = $res["ID"];
$arForumCache["TOPIC"][$a_ITEM_ID] = $res;
} else {
$res = $arForumCache["TOPIC"][$a_ITEM_ID];
}
if (!array_key_exists($res["FORUM_ID"], $arForumCache["FORUM"])) {
$arForumCache["FORUM"][$res["FORUM_ID"]] = CForumNew::GetByID($res["FORUM_ID"]);
if ($arForumCache["FORUM"][$res["FORUM_ID"]]) {
$arSitesPath = CForumNew::GetSites($res["FORUM_ID"]);
$arForumCache["FORUM"][$res["FORUM_ID"]]["PATH"] = array_shift($arSitesPath);
}
}
if ($arForumCache["FORUM"][$res["FORUM_ID"]]["PATH"]) {
$sPath = CForumNew::PreparePath2Message($arForumCache["FORUM"][$res["FORUM_ID"]]["PATH"], $res);
$row->AddViewField("ITEM_ID", '[<a href="' . $sPath . '">' . $a_ITEM_ID . '</a>] ' . GetMessage("MAIN_EVENTLOG_FORUM_TOPIC"));
} else {
$row->AddViewField("ITEM_ID", '[' . $a_ITEM_ID . '] ' . GetMessage("MAIN_EVENTLOG_FORUM_TOPIC"));
}
break;
case "FORUM_MESSAGE_DELETE":
$row->AddViewField("ITEM_ID", '[' . $a_ITEM_ID . '] ' . GetMessage("MAIN_EVENTLOG_FORUM_MESSAGE"));
break;
case "FORUM_TOPIC_DELETE":
$row->AddViewField("ITEM_ID", '[' . $a_ITEM_ID . '] ' . GetMessage("MAIN_EVENTLOG_FORUM_TOPIC"));
break;
case "IBLOCK_SECTION_ADD":
case "IBLOCK_SECTION_EDIT":
case "IBLOCK_SECTION_DELETE":
case "IBLOCK_ELEMENT_ADD":
示例8: MakeTimeStamp
"PARAM1" => $arTopic["PARAM1"],
"PARAM2" => $arTopic["PARAM2"]
)
);
$sitemapFile->addIBlockEntry($url, MakeTimeStamp($arTopic['LAST_POST_DATE']));
}
}
else
{
$url = CForumNew::PreparePath2Message(
$arCurrentForum["PATH2FORUM_MESSAGE"],
array(
"FORUM_ID" => $arCurrentForum["ID"],
"TOPIC_ID" => $arCurrentForum["TID"],
"TITLE_SEO" => $arCurrentForum["TITLE_SEO"],
"MESSAGE_ID" => "s",
"SOCNET_GROUP_ID" => $arCurrentForum["SOCNET_GROUP_ID"],
"OWNER_ID" => $arCurrentForum["OWNER_ID"],
"PARAM1" => $arCurrentForum["PARAM1"],
"PARAM2" => $arCurrentForum["PARAM2"]
)
);
$sitemapFile->addIBlockEntry($url, MakeTimeStamp($arCurrentForum['LAST_POST_DATE']));
}
if (empty($arTopic))
{
$bCheckFinished = false;
// we have finished current forum
SitemapRuntimeTable::update($currentForum['ID'], array(
'PROCESSED' => SitemapRuntimeTable::PROCESSED,
示例9: ForumAddMessage
//.........这里部分代码省略.........
$TID = 0;
}
}
} else {
if (empty($AUTHOR_ID)) {
if (is_set($arFieldsG, "AUTHOR_NAME")) {
$arFields["AUTHOR_NAME"] = $arFieldsG["AUTHOR_NAME"];
}
if (is_set($arFieldsG, "AUTHOR_EMAIL")) {
$arFields["AUTHOR_EMAIL"] = $arFieldsG["AUTHOR_EMAIL"];
}
}
if ($bAddEditNote) {
$arFields["EDITOR_NAME"] = $arFieldsG["EDITOR_NAME"];
$arFields["EDITOR_EMAIL"] = $arFieldsG["EDITOR_EMAIL"];
$arFields["EDIT_REASON"] = $arFieldsG["EDIT_REASON"];
$arFields["EDIT_DATE"] = "";
if ($GLOBALS["USER"]->IsAuthorized()) {
$arFields["EDITOR_ID"] = $GLOBALS["USER"]->GetID();
}
}
$MID1 = CForumMessage::Update($MID, $arFields);
if (IntVal($MID1) <= 0) {
$ex = $GLOBALS['APPLICATION']->GetException();
if ($ex) {
$aMsg[] = array("id" => "MESSAGE_ID", "text" => $ex->GetString());
} else {
$aMsg[] = array("id" => "MESSAGE_ID", "text" => GetMessage("ADDMESS_ERROR_EDIT_MESSAGE") . ".");
}
} elseif ($AUTHOR_ID == $GLOBALS["USER"]->GetId() && COption::GetOptionString("forum", "LOGS", "Q") < "U") {
} else {
$res_log = array();
foreach ($arFields as $key => $val) {
if ($arFields[$key] != $arMessage[$key]) {
if ($key == "FILES" || $key == "ATTACH_IMG") {
$res_log[$key] = GetMessage("F_ATTACH_IS_MODIFIED");
continue;
}
$res_log["BeforeMessage"] = $arMessage[$key];
$res_log["AfterMessage"] = $arFields[$key];
}
}
if (!empty($res_log)) {
$arMessage = CForumMessage::GetByID($MID);
$TID = $arMessage['TOPIC_ID'];
$res_log['FORUM_ID'] = $arMessage['FORUM_ID'];
$arTopic = CForumTopic::GetByID($TID);
$res_log['TITLE'] = $arTopic['TITLE'];
$res_log['TOPIC_ID'] = $TID;
$res_log = serialize($res_log);
CForumEventLog::Log("message", "edit", $MID, $res_log);
}
}
}
}
//*************************/Add/edit message ***********************************************************************
if (empty($aMsg)) {
$DB->Commit();
} else {
$DB->Rollback();
}
if (empty($aMsg) && CModule::IncludeModule("statistic")) {
$F_EVENT1 = $arForum["EVENT1"];
$F_EVENT2 = $arForum["EVENT2"];
$F_EVENT3 = $arForum["EVENT3"];
if (empty($F_EVENT3)) {
$arForumSite_tmp = CForumNew::GetSites($FID);
if (defined("ADMIN_SECTION") && ADMIN_SECTION === true) {
$arForumSiteCode_tmp = array_keys($arForumSite_tmp);
$F_EVENT3 = CForumNew::PreparePath2Message(empty($arForumSite_tmp[$arForumSiteCode_tmp[0]]) ? '' : $arForumSite_tmp[$arForumSiteCode_tmp[0]], array("FORUM_ID" => $FID, "TOPIC_ID" => $TID, "MESSAGE_ID" => $MID));
} else {
$F_EVENT3 = CForumNew::PreparePath2Message(empty($arForumSite_tmp[SITE_ID]) ? '' : $arForumSite_tmp[SITE_ID], array("FORUM_ID" => $FID, "TOPIC_ID" => $TID, "MESSAGE_ID" => $MID));
}
}
CStatistics::Set_Event($F_EVENT1, $F_EVENT2, $F_EVENT3);
}
if (empty($aMsg)) {
$arNote = array();
if ($MESSAGE_TYPE == "NEW" || $MESSAGE_TYPE == "REPLY") {
CForumMessage::SendMailMessage($MID, array(), false, "NEW_FORUM_MESSAGE");
$arNote = array("id" => $MESSAGE_TYPE, "text" => GetMessage("ADDMESS_SUCCESS_ADD") . ". \n");
} else {
CForumMessage::SendMailMessage($MID, array(), false, "EDIT_FORUM_MESSAGE");
$arNote = array("id" => "EDIT", "text" => GetMessage("ADDMESS_SUCCESS_EDIT") . ". \n");
}
if ($arFieldsG["APPROVED"] != "Y") {
$arNote["id"] .= "_NOT_APPROVED";
$arNote["text"] .= GetMessage("ADDMESS_AFTER_MODERATE") . ". \n";
}
if (is_array($strOKMessage)) {
$strOKMessage[] = $arNote;
} else {
$strOKMessage .= $arNote["text"];
}
return $MID;
}
$e = new CAdminException($aMsg);
$strErrorMessage = $e->GetString();
return false;
}
示例10: actionDelete
protected static function actionDelete($arTopic, $arForum = array())
{
if (($arSitemaps = self::checkParams(array(), $arTopic, $arForum)) && $arSitemaps) {
foreach ($arSitemaps as $arSitemap) {
$sitemapFile = new SitemapFile($arSitemap["fileName"], $arSitemap);
$sitemapFile->removeEntry($arSitemap['url']);
$informRobots = false;
if (!$sitemapFile->isNotEmpty()) {
$rule = array('url' => \CForumNew::PreparePath2Message($arForum["PATH2FORUM_MESSAGE"][$arSitemap["SITE_ID"]], array("FORUM_ID" => $arForum["ID"], "TOPIC_ID" => $arForum["TID"], "TITLE_SEO" => $arForum["TITLE_SEO"], "MESSAGE_ID" => "s", "SOCNET_GROUP_ID" => $arForum["SOCNET_GROUP_ID"], "OWNER_ID" => $arForum["OWNER_ID"], "PARAM1" => $arForum["PARAM1"], "PARAM2" => $arForum["PARAM2"])), 'date' => MakeTimeStamp($arForum['LAST_POST_DATE']));
$sitemapFile->appendIblockEntry($rule['url'], $rule['date']);
$informRobots = true;
}
$sitemapIndex = new SitemapIndex($arSitemap['SITEMAP_FILE'], $arSitemap);
$sitemapIndex->appendIndexEntry($sitemapFile);
if ($informRobots && $arSitemap['ROBOTS'] == 'Y') {
$robotsFile = new RobotsFile($arSitemap['SITE_ID']);
$robotsFile->addRule(array(RobotsFile::SITEMAP_RULE, $sitemapIndex->getUrl()));
}
}
}
}