本文整理汇总了PHP中CForumTopic类的典型用法代码示例。如果您正苦于以下问题:PHP CForumTopic类的具体用法?PHP CForumTopic怎么用?PHP CForumTopic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CForumTopic类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: AddComment_Calendar
public static function AddComment_Calendar($arFields)
{
global $DB;
if (!CModule::IncludeModule("forum")) {
return false;
}
$ufFileID = array();
$ufDocID = array();
$dbResult = CSocNetLog::GetList(array(), array("ID" => $arFields["LOG_ID"]), false, false, array("ID", "SOURCE_ID", "SITE_ID"));
if ($arLog = $dbResult->Fetch()) {
$arCalendarEvent = CCalendarEvent::GetById($arLog["SOURCE_ID"]);
if ($arCalendarEvent) {
$arCalendarSettings = CCalendar::GetSettings();
$forumID = $arCalendarSettings["forum_id"];
if ($forumID) {
$arFilter = array("FORUM_ID" => $forumID, "XML_ID" => "EVENT_" . $arLog["SOURCE_ID"]);
$dbTopic = CForumTopic::GetList(null, $arFilter);
if ($dbTopic && ($arTopic = $dbTopic->Fetch())) {
$topicID = $arTopic["ID"];
} else {
$topicID = 0;
}
$currentUserId = CCalendar::GetCurUserId();
$strPermission = $currentUserId == $arCalendarEvent["OWNER_ID"] ? "Y" : "M";
$arFieldsMessage = array("POST_MESSAGE" => $arFields["TEXT_MESSAGE"], "USE_SMILES" => "Y", "PERMISSION_EXTERNAL" => "Q", "PERMISSION" => $strPermission, "APPROVED" => "Y");
if ($topicID === 0) {
$arFieldsMessage["TITLE"] = "EVENT_" . $arLog["SOURCE_ID"];
$arFieldsMessage["TOPIC_XML_ID"] = "EVENT_" . $arLog["SOURCE_ID"];
}
$arTmp = false;
$GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("SONET_COMMENT", $arTmp);
if (is_array($arTmp)) {
if (array_key_exists("UF_SONET_COM_DOC", $arTmp)) {
$GLOBALS["UF_FORUM_MESSAGE_DOC"] = $arTmp["UF_SONET_COM_DOC"];
} elseif (array_key_exists("UF_SONET_COM_FILE", $arTmp)) {
$arFieldsMessage["FILES"] = array();
foreach ($arTmp["UF_SONET_COM_FILE"] as $file_id) {
$arFieldsMessage["FILES"][] = array("FILE_ID" => $file_id);
}
}
}
$messageID = ForumAddMessage($topicID > 0 ? "REPLY" : "NEW", $forumID, $topicID, 0, $arFieldsMessage, $sError, $sNote);
// get UF DOC value and FILE_ID there
if ($messageID > 0) {
$messageUrl = CCalendar::GetPath("user", $arCalendarEvent["OWNER_ID"]);
$messageUrl = $messageUrl . (strpos($messageUrl, "?") === false ? "?" : "&") . "EVENT_ID=" . $arCalendarEvent["ID"] . "&MID=" . $messageID;
$dbAddedMessageFiles = CForumFiles::GetList(array("ID" => "ASC"), array("MESSAGE_ID" => $messageID));
while ($arAddedMessageFiles = $dbAddedMessageFiles->Fetch()) {
$ufFileID[] = $arAddedMessageFiles["FILE_ID"];
}
$ufDocID = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFieldValue("FORUM_MESSAGE", "UF_FORUM_MESSAGE_DOC", $messageID, LANGUAGE_ID);
}
}
}
}
if (!$messageID) {
$sError = GetMessage("EC_LF_ADD_COMMENT_SOURCE_ERROR");
}
return array("SOURCE_ID" => $messageID, "MESSAGE" => $arFieldsMessage ? $arFieldsMessage["POST_MESSAGE"] : false, "RATING_TYPE_ID" => "FORUM_POST", "RATING_ENTITY_ID" => $messageID, "ERROR" => $sError, "NOTES" => $sNote, "UF" => array("FILE" => $ufFileID, "DOC" => $ufDocID), "URL" => $messageUrl);
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:60,代码来源:calendar_livefeed.php
示例2: checkParams
protected static function checkParams($arMessage = array(), &$arTopic, &$arForum)
{
if (\Freetrix\Main\Loader::includeModule('forum')) {
$arTopic = !empty($arTopic) ? $arTopic : \CForumTopic::GetByID($arMessage["TOPIC_ID"]);
if (empty($arTopic)) {
return false;
}
$arSitemaps = SitemapForumTable::getSitemapsByEntityId($arTopic["FORUM_ID"]);
if (!empty($arSitemaps) && ($arForum = \CForumNew::GetByIDEx($arTopic["FORUM_ID"])) && $arForum) {
$arForum["PATH2FORUM_MESSAGE"] = \CForumNew::GetSites($arTopic["FORUM_ID"]);
$date = MakeTimeStamp($arTopic['LAST_POST_DATE']);
$result = array();
foreach ($arSitemaps as $arSitemap) {
$path = $arForum["PATH2FORUM_MESSAGE"][$arSitemap["SITE_ID"]];
if (!empty($path)) {
$arSitemap["fileName"] = str_replace("#FORUM_ID#", $arForum["ID"], $arSitemap['SITEMAP_FILE_FORUM']);
$arSitemap["url"] = \CForumNew::PreparePath2Message($path, array("FORUM_ID" => $arForum["ID"], "TOPIC_ID" => $arTopic["ID"], "TITLE_SEO" => $arTopic["TITLE_SEO"], "MESSAGE_ID" => "s", "SOCNET_GROUP_ID" => $arTopic["SOCNET_GROUP_ID"], "OWNER_ID" => $arTopic["OWNER_ID"], "PARAM1" => $arTopic["PARAM1"], "PARAM2" => $arTopic["PARAM2"]));
$arSitemap["date"] = $date;
$result[] = $arSitemap;
}
}
return empty($result) ? false : $result;
}
}
return false;
}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:26,代码来源:sitemapforum.php
示例3: updateIBlockProperty
public static function updateIBlockProperty($ID, $TYPE, $arMessage, $arTopic = array())
{
if ($ID > 0 && $arMessage["PARAM1"] != "IB" && IsModuleInstalled("iblock")) {
$arTopic = empty($arTopic) ? CForumTopic::GetByID($arMessage["TOPIC_ID"]) : $arTopic;
if (!empty($arTopic) && $arTopic["XML_ID"] == "IBLOCK_" . $arMessage["PARAM2"] && CModule::IncludeModule("iblock")) {
CIBlockElement::SetPropertyValuesEx($arMessage["PARAM2"], 0, array("FORUM_MESSAGE_CNT" => array("VALUE" => CForumMessage::GetList(array(), array("TOPIC_ID" => $arMessage["TOPIC_ID"], "APPROVED" => "Y", "!PARAM1" => "IB"), true), "DESCRIPTION" => "")));
}
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:9,代码来源:event_manager.php
示例4: Execute
public function Execute()
{
if (!CModule::IncludeModule("forum")) {
return CBPActivityExecutionStatus::Closed;
}
if (!CModule::IncludeModule("iblock")) {
return CBPActivityExecutionStatus::Closed;
}
$forumId = intval($this->ForumId);
if ($forumId <= 0) {
return CBPActivityExecutionStatus::Closed;
}
$rootActivity = $this->GetRootActivity();
$documentId = $rootActivity->GetDocumentId();
$iblockId = $this->IBlockId;
$dbResult = CIBlockElement::GetProperty($iblockId, $documentId[2], false, false, array("CODE" => "FORUM_TOPIC_ID"));
$arResult = $dbResult->Fetch();
if (!$arResult) {
$obProperty = new CIBlockProperty();
$obProperty->Add(array("IBLOCK_ID" => $iblockId, "ACTIVE" => "Y", "PROPERTY_TYPE" => "N", "MULTIPLE" => "N", "NAME" => "Forum topic", "CODE" => "FORUM_TOPIC_ID"));
$obProperty->Add(array("IBLOCK_ID" => $iblockId, "ACTIVE" => "Y", "PROPERTY_TYPE" => "N", "MULTIPLE" => "N", "NAME" => "Forum message count", "CODE" => "FORUM_MESSAGE_CNT"));
$dbResult = CIBlockElement::GetProperty($iblockId, $documentId[2], false, false, array("CODE" => "FORUM_TOPIC_ID"));
$arResult = $dbResult->Fetch();
}
$forumTopicId = intval($arResult["VALUE"]);
$arForumUserTmp = $this->ForumUser;
$arForumUser = CBPHelper::ExtractUsers($arForumUserTmp, $documentId, true);
$forumUserId = 1;
$forumUserName = "Admin";
if ($arForumUser != null) {
$forumUserId = $arForumUser;
$dbResult = CUser::GetByID($forumUserId);
if ($arResult = $dbResult->Fetch()) {
$forumUserName = CUser::FormatName(COption::GetOptionString("bizproc", "name_template", CSite::GetNameFormat(false), SITE_ID), $arResult, true);
}
}
$newTopic = "N";
if ($forumTopicId <= 0) {
$documentService = $this->workflow->GetService("DocumentService");
$document = $documentService->GetDocument($documentId);
$newTopic = "Y";
$arFields = array("TITLE" => $document["NAME"], "FORUM_ID" => $forumId, "USER_START_ID" => $forumUserId, "USER_START_NAME" => $forumUserName, "LAST_POSTER_NAME" => $forumUserName, "APPROVED" => "Y");
$forumTopicId = CForumTopic::Add($arFields);
CIBlockElement::SetPropertyValues($documentId[2], $iblockId, $forumTopicId, "FORUM_TOPIC_ID");
}
$arFields = array("POST_MESSAGE" => $this->ForumPostMessage, "AUTHOR_ID" => $forumUserId, "AUTHOR_NAME" => $forumUserName, "FORUM_ID" => $forumId, "TOPIC_ID" => $forumTopicId, "APPROVED" => "Y", "NEW_TOPIC" => $newTopic, "PARAM2" => $documentId[2]);
$forumMessageId = CForumMessage::Add($arFields, false, array("SKIP_INDEXING" => "Y", "SKIP_STATISTIC" => "N"));
return CBPActivityExecutionStatus::Closed;
}
开发者ID:webgksupport,项目名称:alpina,代码行数:49,代码来源:forumreviewactivity.php
示例5: GetAdminListViewHTML
public static function GetAdminListViewHTML($arProperty, $value, $strHTMLControlName)
{
static $cache = array();
if (CModule::IncludeModule("forum")) {
$value["VALUE"] = intval($value["VALUE"]);
if ($value["VALUE"] <= 0) {
$value["VALUE"] = '';
$res = '';
} else {
if (!array_key_exists($value["VALUE"], $cache)) {
$cache[$value["VALUE"]] = CForumTopic::GetByID($value["VALUE"]);
}
$arTopic = $cache[$value["VALUE"]];
$res = !empty($arTopic) ? "[" . $value["VALUE"] . "] (" . htmlspecialcharsEx($arTopic["TITLE"]) . ")" : $value["VALUE"];
}
return $res;
}
return '';
}
开发者ID:rasuldev,项目名称:torino,代码行数:19,代码来源:prop_topicid.php
示例6: substr
$res["SITE_URL"] = substr($res["SITE_URL"], 0, strpos($res["SITE_URL"], "#message"));
}
$res["TAGS"] = array();
if (!empty($res["~TAGS_FORMATED"])) {
foreach ($res["~TAGS_FORMATED"] as $name => $tag) {
$tags = $tag;
$res["TAGS"][] = array("URL" => $APPLICATION->GetCurPageParam("tags=" . urlencode($tags), array("tags")), "TAG_NAME" => htmlspecialcharsbx($name));
}
}
$topics[$res["PARAM2"]] = !!$topics[$res["PARAM2"]] ? $topics[$res["PARAM2"]] : array();
$topics[$res["PARAM2"]][] = count($arResult["TOPICS"]);
$arResult["TOPICS"][] = $res;
} while ($res = $obSearch->GetNext());
}
if (strpos($arParams["URL_TEMPLATES_READ"], "#TITLE_SEO#") !== false && !empty($topics)) {
$db_res2 = CForumTopic::GetList(array(), array("@ID" => array_keys($topics)));
while ($db_res2 && ($res2 = $db_res2->Fetch())) {
if (array_key_exists($res2["ID"], $topics)) {
foreach ($topics[$res2["ID"]] as $key) {
$res = $arResult["TOPICS"][$key];
if (intVal($res["ITEM_ID"]) > 0) {
$res["URL"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["PARAM1"], "TID" => $res["PARAM2"], "TITLE_SEO" => $res2["TITLE_SEO"], "MID" => $res["ITEM_ID"]));
$res["~URL"] = CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("FID" => $res["PARAM1"], "TID" => $res["PARAM2"], "TITLE_SEO" => $res2["TITLE_SEO"], "MID" => $res["ITEM_ID"]));
} else {
$res["URL"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_READ"], array("FID" => $res["PARAM1"], "TID" => $res["PARAM2"], "TITLE_SEO" => $res2["TITLE_SEO"], "MID" => "s"));
$res["~URL"] = CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_READ"], array("FID" => $res["PARAM1"], "TID" => $res["PARAM2"], "TITLE_SEO" => $res2["TITLE_SEO"], "MID" => "s"));
}
$arResult["TOPICS"][$key] = $res;
}
}
}
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php
示例7: array
}
$arParams["FATAL_ERROR"] = $res <= 0 ? "Y" : "N";
if (strPos($componentPage, "group_photo") !== false && CModule::IncludeModule('iblock')) {
$arPhotoIBlockID = array();
$rsIBlock = CIBlock::GetList(array(), array("ACTIVE" => "Y", "CODE" => "group_photogallery%"));
while ($arIBlock = $rsIBlock->Fetch()) {
$arPhotoIBlockID[] = $arIBlock["ID"];
}
if (count($arPhotoIBlockID) > 0) {
$rsPhotoSection = CIBlockSection::GetList(array("timestamp_x" => "desc"), array("IBLOCK_ID" => $arPhotoIBlockID, "SOCNET_GROUP_ID" => $arResult["VARIABLES"]["group_id"]));
if ($arPhotoSection = $rsPhotoSection->Fetch()) {
$arParams["PHOTO_GROUP_IBLOCK_ID"] = $arPhotoSection["IBLOCK_ID"];
if (intval($_GET["ELEMENT_ID"]) > 0 && intval($arParams["PHOTO"]["ALL"]["FORUM_ID"]) > 0 && $arParams["PHOTO"]["ALL"]["COMMENTS_TYPE"] == "FORUM" && CModule::IncludeModule("forum")) {
$rsIBlockElement = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $arParams["PHOTO_GROUP_IBLOCK_ID"], "ID" => $_GET["ELEMENT_ID"]), false, false, array("IBLOCK_ID", "PROPERTY_FORUM_TOPIC_ID"));
if (($arIBlockElement = $rsIBlockElement->Fetch()) && array_key_exists("PROPERTY_FORUM_TOPIC_ID_VALUE", $arIBlockElement)) {
$arForumTopic = CForumTopic::GetByID($arIBlockElement["PROPERTY_FORUM_TOPIC_ID_VALUE"]);
$arParams["PHOTO"]["ALL"]["FORUM_ID"] = $arForumTopic["FORUM_ID"];
}
}
}
}
}
} elseif (strPos($componentPage, "group_calendar") !== false && CModule::IncludeModule("iblock")) {
$arCalendarIBlockID = array();
$rsIBlock = CIBlock::GetList(array(), array("ACTIVE" => "Y", "CODE" => "calendar_group%"));
while ($arIBlock = $rsIBlock->Fetch()) {
$arCalendarIBlockID[] = $arIBlock["ID"];
}
if (count($arCalendarIBlockID) > 0) {
$rsCalendarSection = CIBlockSection::GetList(array("timestamp_x" => "desc"), array("IBLOCK_ID" => $arCalendarIBlockID, "SOCNET_GROUP_ID" => $arResult["VARIABLES"]["group_id"]));
if ($arCalendarSection = $rsCalendarSection->Fetch()) {
开发者ID:vim84,项目名称:b-markt,代码行数:31,代码来源:component.php
示例8: array
}
$arResult["ERROR_MESSAGE"] = $strErrorMessage;
$arResult["OK_MESSAGE"] = $strOKMessage;
}
/********************************************************************
/Action
********************************************************************/
/********************************************************************
Data
********************************************************************/
/************** Topic for move *************************************/
$arFilter = array("@ID" => implode(",", $topics), "FORUM_ID" => $arParams["FID"]);
if (!CForumUser::IsAdmin()) {
$arFilter["PERMISSION_STRONG"] = true;
}
$db_res = CForumTopic::GetListEx(array(), $arFilter);
if ($db_res && ($res = $db_res->GetNext())) {
do {
$res["read"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_READ"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "s"));
$res["read_last_message"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intVal($res["LAST_MESSAGE_ID"]))) . "#message" . $res["LAST_MESSAGE_ID"];
$res["USER_START_HREF"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => intVal($res["USER_START_ID"])));
$res["LAST_POSTER_HREF"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => intVal($res["LAST_POSTER_ID"])));
$arResult["TOPICS"][$res["ID"]] = $res;
} while ($res = $db_res->GetNext());
}
$arParams["TID"] = implode(",", array_keys($arResult["TOPICS"]));
/************** Forums *********************************************/
$arFilter = array();
if ($arParams["SHOW_FORUM_ANOTHER_SITE"] == "N" || !CForumUser::IsAdmin()) {
$arFilter["LID"] = SITE_ID;
}
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php
示例9: OnRate
function OnRate($rateID, $arData)
{
if (!isset($arData['ENTITY_TYPE_ID']) || !isset($arData['ENTITY_ID']) || $arData['ENTITY_TYPE_ID'] !== 'FORUM_POST' && $arData['ENTITY_TYPE_ID'] !== 'FORUM_TOPIC') {
return false;
}
if ($arData['ENTITY_TYPE_ID'] === 'FORUM_POST') {
$arMessage = CForumMessage::GetByID($arData['ENTITY_ID']);
if ($arMessage) {
$this->ClearTag("T", $arMessage['TOPIC_ID']);
}
} else {
if ($arData['ENTITY_TYPE_ID'] === 'FORUM_TOPIC') {
$arTopic = CForumTopic::GetByID($arData['ENTITY_ID']);
if ($arTopic) {
$this->ClearTag("F", $arTopic['FORUM_ID']);
}
$this->ClearTag("T", $arData['ENTITY_ID']);
}
}
return true;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:21,代码来源:functions.php
示例10: Create
function Create($site_id, $max_execution_time, $NS, $arOptions = array())
{
@set_time_limit(0);
if (!is_array($NS)) {
$NS = array("ID" => 0, "CNT" => 0, "FILE_SIZE" => 0, "FILE_ID" => 1, "FILE_URL_CNT" => 0, "ERROR_CNT" => 0, "PARAM2" => 0);
} else {
$NS = array("ID" => intval($NS["ID"]), "CNT" => intval($NS["CNT"]), "FILE_SIZE" => intval($NS["FILE_SIZE"]), "FILE_ID" => intval($NS["FILE_ID"]), "FILE_URL_CNT" => intval($NS["FILE_URL_CNT"]), "ERROR_CNT" => intval($NS["ERROR_CNT"]), "PARAM2" => intval($NS["ID"]));
}
if (is_array($max_execution_time)) {
$record_limit = $max_execution_time[1];
$max_execution_time = $max_execution_time[0];
} else {
$record_limit = 5000;
}
if ($max_execution_time > 0) {
$end_of_execution = time() + $max_execution_time;
} else {
$end_of_execution = 0;
}
if (is_array($arOptions) && $arOptions["FORUM_TOPICS_ONLY"] == "Y") {
$bForumTopicsOnly = CModule::IncludeModule("forum");
} else {
$bForumTopicsOnly = false;
}
if (is_array($arOptions) && $arOptions["BLOG_NO_COMMENTS"] == "Y") {
$bBlogNoComments = CModule::IncludeModule("blog");
} else {
$bBlogNoComments = false;
}
if (is_array($arOptions) && $arOptions["USE_HTTPS"] == "Y") {
$strProto = "https://";
} else {
$strProto = "http://";
}
$rsSite = CSite::GetByID($site_id);
if ($arSite = $rsSite->Fetch()) {
$SERVER_NAME = trim($arSite["SERVER_NAME"]);
if (strlen($SERVER_NAME) <= 0) {
$this->m_error = GetMessage("SEARCH_ERROR_SERVER_NAME", array("#SITE_ID#" => '<a href="site_edit.php?LID=' . urlencode($site_id) . '&lang=' . urlencode(LANGUAGE_ID) . '">' . htmlspecialcharsbx($site_id) . '</a>')) . "<br>";
return false;
}
//Cache events
$this->m_events = GetModuleEvents("search", "OnSearchGetURL", true);
//Clear error file
if ($NS["ID"] == 0 && $NS["CNT"] == 0) {
$e = fopen($arSite["ABS_DOC_ROOT"] . $arSite["DIR"] . "sitemap_errors.xml", "w");
$strBegin = "<?xml version='1.0' encoding='UTF-8'?>\n<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
fwrite($e, $strBegin);
} else {
$e = fopen($arSite["ABS_DOC_ROOT"] . $arSite["DIR"] . "sitemap_errors.xml", "a");
}
if (!$e) {
$this->m_error = GetMessage("SEARCH_ERROR_OPEN_FILE") . " " . $arSite["ABS_DOC_ROOT"] . $arSite["DIR"] . "sitemap_errors.xml" . "<br>";
return false;
}
//Open current sitemap file
if ($NS["FILE_SIZE"] == 0) {
$f = fopen($arSite["ABS_DOC_ROOT"] . $arSite["DIR"] . "sitemap_" . sprintf("%03d", $NS["FILE_ID"]) . ".xml", "w");
$strBegin = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
fwrite($f, $strBegin);
$NS["FILE_SIZE"] += strlen($strBegin);
} else {
$f = fopen($arSite["ABS_DOC_ROOT"] . $arSite["DIR"] . "sitemap_" . sprintf("%03d", $NS["FILE_ID"]) . ".xml", "a");
}
if (!$f) {
$this->m_error = GetMessage("SEARCH_ERROR_OPEN_FILE") . " " . $arSite["ABS_DOC_ROOT"] . $arSite["DIR"] . "sitemap_" . sprintf("%03d", $NS["FILE_ID"]) . ".xml" . "<br>";
return false;
}
CTimeZone::Disable();
$this->GetURLs($site_id, $NS["ID"], $record_limit);
$bFileIsFull = false;
while (!$bFileIsFull && ($ar = $this->Fetch())) {
$record_limit--;
$NS["ID"] = $ar["ID"];
if (strlen($ar["URL"]) < 1) {
continue;
}
if ($bForumTopicsOnly && $ar["MODULE_ID"] == "forum") {
//Forum topic ID
$PARAM2 = intval($ar["PARAM2"]);
if ($NS["PARAM2"] < $PARAM2) {
$NS["PARAM2"] = $PARAM2;
$arTopic = CForumTopic::GetByIDEx($PARAM2);
if ($arTopic) {
$ar["FULL_DATE_CHANGE"] = $arTopic["LAST_POST_DATE"];
}
} else {
continue;
}
}
if ($bBlogNoComments && $ar["MODULE_ID"] == "blog") {
if (substr($ar["ITEM_ID"], 0, 1) === "C") {
continue;
}
}
if (preg_match("/^[a-z]+:\\/\\//", $ar["URL"])) {
$strURL = $ar["URL"];
} else {
$strURL = $strProto . $ar["SERVER_NAME"] . $ar["URL"];
}
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:sitemap.php
示例11: while
$arResult["~QUESTIONS"][$res["QUESTION_ID"]]["ANSWERS"][$res["ID"]] = $res;
}
} while ($res = $db_res->Fetch());
}
}
$arResult["QUESTIONS"] = $arResult["~QUESTIONS"];
}
}
}
} else {
$arResult["FORUM"] = CForumNew::GetByID($arParams["FID"]);
if (empty($arResult["FORUM"])) {
$arError = array("code" => "fid_is_lost", "title" => GetMessage("F_FID_IS_LOST"), "link" => $arResult["index"]);
}
}
if (empty($arError) && ($arParams["MESSAGE_TYPE"] == "NEW" && !CForumTopic::CanUserAddTopic($arParams["FID"], $USER->GetUserGroupArray(), $USER->GetID())) || $arParams["MESSAGE_TYPE"] == "EDIT" && !CForumMessage::CanUserUpdateMessage($arParams["MID"], $USER->GetUserGroupArray(), $USER->GetID())) {
$arError = array("code" => "rightsn_new", "title" => $arParams["MESSAGE_TYPE"] == "NEW" ? GetMessage("F_NO_NPERMS") : GetMessage("F_NO_EPERMS"), "link" => $arResult["index"]);
}
if (!empty($arError)) {
if ($arParams["AJAX_CALL"] == "Y") {
$res = array("error" => $arError, "note" => $arNote, "id" => $arParams["MID"], "post" => ShowError($arError["title"]));
if ($_REQUEST["CONVERT_DATA"] == "Y") {
array_walk($res, "htmlspecialcharsEx");
}
$APPLICATION->RestartBuffer();
echo CUtil::PhpToJSObject($res);
die;
}
ShowError($arError["title"]);
return false;
}
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php
示例12: array
if ($_REQUEST['AGENDA_EX'] && check_bitrix_sessid()) {
$APPLICATION->RestartBuffer();
$arResult['POPUP'] = $_REQUEST['POPUP'] == 'Y';
$this->IncludeComponentTemplate('agenda_ex');
die;
}
$arResult['USERS'] = array();
$dbUsers = CUser::GetList($by = 'ID', $order = 'ASC', array('ID' => implode('|', array_keys($arResult['MEETING']['USERS']))));
while ($arUser = $dbUsers->GetNext()) {
$arResult['USERS'][$arUser['ID']] = $arUser;
}
if (CModule::IncludeModule('forum')) {
$obForumConnector = new CMeetingForumHandlers($arParams['FORUM_ID'], $arResult['MEETING']);
$arParams['FORUM_ID'] = $obForumConnector->GetForumID();
foreach ($arResult['MEETING']['AGENDA'] as &$arItem) {
$arItem['COMMENTS_COUNT'] = intval(CForumTopic::GetMessageCount($arParams['FORUM_ID'], "MEETING_ITEM_" . $arItem['ITEM_ID'], true));
if ($arItem['COMMENTS_COUNT'] > 0) {
$arItem['COMMENTS_COUNT']--;
}
}
}
CJSCore::Init(array('ajax', 'popup', 'date', 'meeting'));
if ($arResult['CAN_EDIT']) {
$APPLICATION->AddHeadScript('/bitrix/js/main/utils.js');
$APPLICATION->AddHeadScript('/bitrix/js/main/dd.js');
}
if ($arParams['EDIT'] && $arResult['CAN_EDIT'] || isset($arResult["MEETING"]["PLACE_ID"])) {
$arResult['MEETING_ROOMS_LIST'] = array();
if ($arParams['RESERVE_MEETING_IBLOCK_ID'] || $arParams['RESERVE_VMEETING_IBLOCK_ID']) {
$dbMeetingsList = CIBlockSection::GetList(array('IBLOCK_ID' => 'ASC', 'NAME' => 'ASC', 'ID' => 'DESC'), array('IBLOCK_ID' => array(intval($arParams['RESERVE_MEETING_IBLOCK_ID']), intval($arParams['RESERVE_VMEETING_IBLOCK_ID']))), false, array('ID', 'IBLOCK_ID', 'NAME', 'DESCRIPTION'));
while ($arRoom = $dbMeetingsList->Fetch()) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php
示例13: BeforeIndexSocNet
function BeforeIndexSocNet($bxSocNetSearch, $fields)
{
static $bizprocForumId = false;
if (!$bizprocForumId) {
$bizprocForumId = intval(COption::GetOptionString('bizproc', 'forum_id'));
}
if ($fields['ENTITY_TYPE_ID'] == 'FORUM_POST' && intval($fields['PARAM1']) == $bizprocForumId && !empty($fields['PARAM2']) && !empty($bxSocNetSearch->_params["PATH_TO_WORKFLOW"]) && CModule::IncludeModule("forum") && CModule::IncludeModule("bizproc")) {
$topic = CForumTopic::GetByID($fields['PARAM2']);
if (!empty($topic) && is_array($topic) && !empty($topic["XML_ID"])) {
if (preg_match('/^WF_([0-9a-f\\.]+)/', $topic["XML_ID"], $match)) {
$workflowId = $match[1];
$state = CBPStateService::GetStateDocumentId($workflowId);
if ($state[0] == 'lists' && $state[1] == 'BizprocDocument' && CModule::IncludeModule('iblock') && intval($state[2]) > 0) {
$iblockElementQuery = CIBlockElement::GetList(array(), array("ID" => intval($state[2])), false, false, array("ID", "IBLOCK_ID"));
if ($iblockElement = $iblockElementQuery->Fetch()) {
$listId = $iblockElement["IBLOCK_ID"];
$fields["URL"] = $bxSocNetSearch->Url(str_replace(array("#list_id#", "#workflow_id#"), array($listId, urlencode($workflowId)), $bxSocNetSearch->_params["PATH_TO_WORKFLOW"]), array("MID" => $fields["ENTITY_ID"]), "message" . $fields["ENTITY_ID"]);
if (!empty($fields["LID"]) && is_array($fields["LID"])) {
foreach ($fields["LID"] as $siteId => $url) {
$fields["LID"][$siteId] = $fields["URL"];
}
}
}
}
}
}
}
return $fields;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:29,代码来源:livefeed.php
示例14: GetByIDEx
function GetByIDEx($ID, $arAddParams = array())
{
global $DB;
$ID = intVal($ID);
$res = false;
if ($ID <= 0) {
return false;
}
$arAddParams = is_array($arAddParams) ? $arAddParams : array($arAddParams);
$arAddParams["GET_TOPIC_INFO"] = $arAddParams["GET_TOPIC_INFO"] == "Y" ? "Y" : "N";
$arAddParams["FILTER_TOPIC_INFO"] = $arAddParams["FILTER_TOPIC_INFO"] == "N" ? "N" : "Y";
$arAddParams["GET_FORUM_INFO"] = $arAddParams["GET_FORUM_INFO"] == "Y" ? "Y" : "N";
$arAddParams["FILTER_FORUM_INFO"] = $arAddParams["FILTER_FORUM_INFO"] == "N" ? "N" : "Y";
$arAddParams["FILTER_MESSAGE_INFO"] = $arAddParams["FILTER_MESSAGE_INFO"] == "N" ? "N" : "Y";
if (COption::GetOptionString("forum", "FILTER", "Y") == "Y") {
$arAddParams["FILTER"] = is_set($arAddParams, "FILTER") ? $arAddParams["FILTER"] : "P";
$arAddParams["FILTER"] = $arAddParams["FILTER"] == "Y" || $arAddParams["FILTER"] == "P" ? $arAddParams["FILTER"] : "N";
} else {
$arAddParams["FILTER"] = "N";
}
if ($arAddParams["FILTER"] == "N") {
$arAddParams["FILTER_TOPIC_INFO"] = "N";
$arAddParams["FILTER_FORUM_INFO"] = "N";
$arAddParams["FILTER_MESSAGE_INFO"] = "N";
} elseif ($arAddParams["FILTER"] == "P") {
$arAddParams["FILTER_MESSAGE_INFO"] = "N";
}
$arSqlSelect = array();
$arSqlFrom = array();
if ($arAddParams["GET_TOPIC_INFO"] == "Y") {
$arSqlSelect[] = CForumTopic::GetSelectFields(array("sPrefix" => "FT_", "sReturnResult" => "string"));
if ($arAddParams["FILTER_TOPIC_INFO"] != "N") {
$arSqlSelect[] = "FT.HTML as FT_HTML";
}
$arSqlSelect[] = "FT.XML_ID as FT_XML_ID";
$arSqlFrom[] = "INNER JOIN b_forum_topic FT ON (FM.TOPIC_ID = FT.ID)";
}
if ($arAddParams["GET_FORUM_INFO"] == "Y") {
$arSqlSelect[] = CForumNew::GetSelectFields(array("sPrefix" => "F_", "sReturnResult" => "string"));
if ($arAddParams["FILTER_FORUM_INFO"] != "N") {
$arSqlSelect[] = "F.HTML as F_HTML";
}
$arSqlFrom[] = "INNER JOIN b_forum F ON (FM.FORUM_ID = F.ID)";
}
$strSql = "SELECT FM.*, " . $DB->DateToCharFunction("FM.POST_DATE", "FULL") . " as POST_DATE,\n\t\t\t\tFU.SHOW_NAME, FU.DESCRIPTION, FU.NUM_POSTS, FU.POINTS as NUM_POINTS, FU.SIGNATURE, FU.AVATAR, FU.RANK_ID,\n\t\t\t\t" . $DB->DateToCharFunction("FU.DATE_REG", "SHORT") . " as DATE_REG,\n\t\t\t\tU.EMAIL, U.PERSONAL_ICQ, U.LOGIN, U.NAME, U.SECOND_NAME, U.LAST_NAME" . (!empty($arSqlSelect) ? ", " . implode(", ", $arSqlSelect) : "") . "\n\t\t\tFROM b_forum_message FM\n\t\t\t\tLEFT JOIN b_forum_user FU ON (FM.AUTHOR_ID = FU.USER_ID)\n\t\t\t\tLEFT JOIN b_user U ON (FM.AUTHOR_ID = U.ID)\n\t\t\t\t" . implode(" ", $arSqlFrom) . "\n\t\t\tWHERE FM.ID = " . $ID . "";
$db_res = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
if ($db_res && ($res = $db_res->Fetch())) {
if ($arAddParams["FILTER_MESSAGE_INFO"] == "N") {
unset($res["HTML"]);
}
if ($arAddParams["GET_TOPIC_INFO"] == "Y" && COption::GetOptionString("forum", "FILTER", "Y") == "Y") {
$arTopic = array();
foreach ($res as $key => $val) {
if (substr($key, 0, 3) == "FT_") {
$arTopic[substr($key, 3)] = $val;
}
}
if (!empty($arTopic)) {
$GLOBALS["FORUM_CACHE"]["TOPIC"][intVal($res["TOPIC_INFO"]["ID"])] = $arTopic;
$db_res_filter = new CDBResult();
$db_res_filter->InitFromArray(array($arTopic));
$db_res_filter = new _CTopicDBResult($db_res_filter);
if ($res_filter = $db_res_filter->Fetch()) {
$GLOBALS["FORUM_CACHE"]["TOPIC_FILTER"][intVal($res["TOPIC_INFO"]["ID"])] = $res_filter;
}
}
}
$db_res = new CDBResult();
$db_res->InitFromArray(array($res));
$db_res = new _CMessageDBResult($db_res, $arAddParams);
$res = $db_res->Fetch();
if ($arAddParams["GET_TOPIC_INFO"] == "Y" || $arAddParams["GET_FORUM_INFO"] == "Y") {
$res["TOPIC_INFO"] = array();
$res["FORUM_INFO"] = array();
$res["MESSAGE_INFO"] = array();
foreach ($res as $key => $val) {
if (substr($key, 0, 3) == "FT_") {
$res["TOPIC_INFO"][substr($key, 3)] = $val;
} elseif (substr($key, 0, 2) == "F_") {
$res["FORUM_INFO"][substr($key, 2)] = $val;
} else {
$res["MESSAGE_INFO"][$key] = $val;
}
}
if (COption::GetOptionString("forum", "FILTER", "Y") != "Y" && !empty($res["TOPIC_INFO"])) {
$GLOBALS["FORUM_CACHE"]["TOPIC"][intVal($res["TOPIC_INFO"]["ID"])] = $res["TOPIC_INFO"];
}
if (!empty($res["FORUM_INFO"])) {
$GLOBALS["FORUM_CACHE"]["FORUM"][intVal($res["FORUM_INFO"]["ID"])] = $res["FORUM_INFO"];
}
}
if ($arAddParams["getFiles"] == "Y" && !empty($res)) {
$res["FILES"] = CForumFiles::getByMessageID($ID);
}
return $res;
}
return false;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:98,代码来源:message.php
示例15: ForumGetRealIP
}
if (strlen($strErrorMessage) <= 0) {
$AUTHOR_IP = ForumGetRealIP();
$AUTHOR_IP_tmp = $AUTHOR_IP;
$AUTHOR_REAL_IP = $_SERVER['REMOTE_ADDR'];
$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);
}
$arFields = array("POST_MESSAGE" => $strDescription, "AUTHOR_NAME" => $_POST["comment_author"], "AUTHOR_EMAIL" => $_POST["comment_email"], "FORUM_ID" => $INQUERY_FORUM_ID, "TOPIC_ID" => $TID1, "AUTHOR_IP" => $AUTHOR_IP !== False ? $AUTHOR_IP : "<no address>", "AUTHOR_REAL_IP" => $AUTHOR_REAL_IP !== False ? $AUTHOR_REAL_IP : "<no address>", "NEW_TOPIC" => "Y", "GUEST_ID" => $_SESSION["SESS_GUEST_ID"]);
$MID1 = CForumMessage::Add($arFields);
if (IntVal($MID1) <= 0) {
$strErrorMessage .= GetMessage("ADDMESS_ERROR_ADD_MESSAGE") . ". \n";
CForumTopic::Delete($TID1);
$TID1 = 0;
}
}
if (strlen($strErrorMessage) <= 0) {
$DB->Commit();
$strOKMessage .= GetMessage("COMM_COMMENT_OK") . ". ";
} else {
if ($sTransStarted) {
$DB->Rollback();
}
}
}
?>
<br><a name="cm">
开发者ID:,项目名称:,代码行数:31,代码来源:
示例16: AddComment_Report_Forum
public static function AddComment_Report_Forum($arFields, $FORUM_ID, $arLog)
{
global $USER, $DB;
$mess_id = false;
$dbReport = CTimeManReportFull::GetByID($arLog["SOURCE_ID"]);
$arReport = $dbReport->Fetch();
if (CModule::IncludeModule("forum") && $arReport) {
$ufFileID = array();
$ufDocID = array();
if (!($userName = trim($USER->GetFormattedName(false)))) {
$userName = $USER->GetLogin();
}
if (!$arReport[&
|
请发表评论