本文整理汇总了PHP中CForumNew类的典型用法代码示例。如果您正苦于以下问题:PHP CForumNew类的具体用法?PHP CForumNew怎么用?PHP CForumNew使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CForumNew类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: UnInstallDB
function UnInstallDB($arParams = array())
{
global $DB, $APPLICATION;
$this->errors = false;
if (!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") {
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/meeting/install/db/" . strtolower($DB->type) . "/uninstall.sql");
if ($this->errors === false && CModule::IncludeModule('forum')) {
$dbRes = CSite::GetList($by = 'sort', $order = 'asc', array());
while ($arSite = $dbRes->Fetch()) {
$forumId = COption::GetOptionInt('meeting', 'comments_forum_id', 0, $arSite['ID']);
if ($forumId > 0) {
CForumNew::Delete($forumId);
}
}
}
}
UnRegisterModuleDependences("calendar", "OnAfterCalendarConvert", "meeting", "CMeetingEventHandlers", "OnAfterCalendarConvert");
UnRegisterModuleDependences("tasks", "OnTaskDelete", "meeting", "CMeetingEventHandlers", "OnTaskDelete");
UnRegisterModule("meeting");
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
return true;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:25,代码来源:index.php
示例2: 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);
}
}
开发者ID:rasuldev,项目名称:torino,代码行数:13,代码来源:comment.php
示例3: GetForumsList
function GetForumsList()
{
$arGroup = array();
$arForum = array();
$db_res = CForumGroup::GetListEx(array(), array("LID" => LANG));
if ($db_res && ($res = $db_res->GetNext())) {
do {
$arGroup[intVal($res["ID"])] = $res["~NAME"];
} while ($res = $db_res->GetNext());
}
$db_res = CForumNew::GetListEx(array("FORUM_GROUP_SORT" => "ASC", "FORUM_GROUP_ID" => "ASC", "SORT" => "ASC", "NAME" => "ASC"), array());
if ($db_res && ($res = $db_res->GetNext())) {
do {
$arForum[intVal($res["ID"])] = $res["~NAME"];
if (intVal($res["FORUM_GROUP_ID"]) > 0 && array_key_exists($res["FORUM_GROUP_ID"], $arGroup)) {
$arForum[intVal($res["ID"])] .= " [" . $arGroup[$res["FORUM_GROUP_ID"]] . "]";
}
if ($res["ACTIVE"] != "Y") {
$arForum[intVal($res["ID"])] .= " N/A";
}
} while ($res = $db_res->GetNext());
}
return $arForum;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:24,代码来源:components_lib.php
示例4: array
$arComponentParameters["PARAMETERS"]["FILTER_NAME"] = array("PARENT" => "FILTER_SETTINGS", "NAME" => GetMessage("T_IBLOCK_FILTER"), "TYPE" => "STRING", "DEFAULT" => "");
$arComponentParameters["PARAMETERS"]["FILTER_FIELD_CODE"] = CIBlockParameters::GetFieldCode(GetMessage("IBLOCK_FIELD"), "FILTER_SETTINGS");
$arComponentParameters["PARAMETERS"]["FILTER_PROPERTY_CODE"] = array("PARENT" => "FILTER_SETTINGS", "NAME" => GetMessage("T_IBLOCK_PROPERTY"), "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $arProperty_LNS, "ADDITIONAL_VALUES" => "Y");
$arComponentParameters["PARAMETERS"]["FILTER_PRICE_CODE"] = array("PARENT" => "FILTER_SETTINGS", "NAME" => GetMessage("IBLOCK_PRICE_CODE"), "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $arPrice);
if ($OFFERS_IBLOCK_ID) {
$arComponentParameters["PARAMETERS"]["FILTER_OFFERS_FIELD_CODE"] = CIBlockParameters::GetFieldCode(GetMessage("CP_BC_FILTER_OFFERS_FIELD_CODE"), "FILTER_SETTINGS");
$arComponentParameters["PARAMETERS"]["FILTER_OFFERS_PROPERTY_CODE"] = array("PARENT" => "FILTER_SETTINGS", "NAME" => GetMessage("CP_BC_FILTER_OFFERS_PROPERTY_CODE"), "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $arProperty_Offers, "ADDITIONAL_VALUES" => "Y");
}
}
if (!IsModuleInstalled("forum")) {
unset($arComponentParameters["PARAMETERS"]["USE_REVIEW"]);
unset($arComponentParameters["GROUPS"]["REVIEW_SETTINGS"]);
} elseif ($arCurrentValues["USE_REVIEW"] == "Y") {
$arForumList = array();
if (CModule::IncludeModule("forum")) {
$rsForum = CForumNew::GetList();
while ($arForum = $rsForum->Fetch()) {
$arForumList[$arForum["ID"]] = $arForum["NAME"];
}
}
$arComponentParameters["PARAMETERS"]["MESSAGES_PER_PAGE"] = array("PARENT" => "REVIEW_SETTINGS", "NAME" => GetMessage("F_MESSAGES_PER_PAGE"), "TYPE" => "STRING", "DEFAULT" => intVal(COption::GetOptionString("forum", "MESSAGES_PER_PAGE", "10")));
$arComponentParameters["PARAMETERS"]["USE_CAPTCHA"] = array("PARENT" => "REVIEW_SETTINGS", "NAME" => GetMessage("F_USE_CAPTCHA"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y");
$arComponentParameters["PARAMETERS"]["REVIEW_AJAX_POST"] = array("PARENT" => "REVIEW_SETTINGS", "NAME" => GetMessage("F_REVIEW_AJAX_POST"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y");
$arComponentParameters["PARAMETERS"]["PATH_TO_SMILE"] = array("PARENT" => "REVIEW_SETTINGS", "NAME" => GetMessage("F_PATH_TO_SMILE"), "TYPE" => "STRING", "DEFAULT" => "/bitrix/images/forum/smile/");
$arComponentParameters["PARAMETERS"]["FORUM_ID"] = array("PARENT" => "REVIEW_SETTINGS", "NAME" => GetMessage("F_FORUM_ID"), "TYPE" => "LIST", "VALUES" => $arForumList, "DEFAULT" => "");
$arComponentParameters["PARAMETERS"]["URL_TEMPLATES_READ"] = array("PARENT" => "REVIEW_SETTINGS", "NAME" => GetMessage("F_READ_TEMPLATE"), "TYPE" => "STRING", "DEFAULT" => "");
$arComponentParameters["PARAMETERS"]["SHOW_LINK_TO_FORUM"] = array("PARENT" => "REVIEW_SETTINGS", "NAME" => GetMessage("F_SHOW_LINK_TO_FORUM"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y");
$arComponentParameters["PARAMETERS"]["POST_FIRST_MESSAGE"] = array("PARENT" => "REVIEW_SETTINGS", "NAME" => GetMessage("F_POST_FIRST_MESSAGE"), "TYPE" => "CHECKBOX", "DEFAULT" => "N");
}
if (CModule::IncludeModule('catalog') && $arCurrentValues["USE_STORE"] == 'Y') {
$arComponentParameters["PARAMETERS"]['USE_STORE_PHONE'] = array('PARENT' => 'STORE_SETTINGS', 'NAME' => GetMessage('USE_STORE_PHONE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N');
开发者ID:,项目名称:,代码行数:31,代码来源:
示例5: array
$DocsSharedForumID = 0;
$dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "DOCS_SHARED_COMMENTS"));
if ($arRes = $dbRes->Fetch()) {
$DocsSharedForumID = $arRes["ID"];
}
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/docs/shared/index.php", array("SHARED_FILES_FORUM_ID" => $DocsSharedForumID));
$DocsSalesForumID = 0;
$dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "DOCS_SALES_COMMENTS"));
if ($arRes = $dbRes->Fetch()) {
$DocsSalesForumID = $arRes["ID"];
}
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/docs/sale/index.php", array("SALE_FILES_FORUM_ID" => $DocsSalesForumID));
$DocsDirectorsForumID = 0;
$dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "DOCS_DIRECTORS_COMMENTS"));
if ($arRes = $dbRes->Fetch()) {
$DocsDirectorsForumID = $arRes["ID"];
}
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/docs/manage/index.php", array("DIRECTORS_FILES_FORUM_ID" => $DocsDirectorsForumID));
$DocsSocnetCommentsForumID = 0;
$dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "GROUPS_AND_USERS_FILES_COMMENTS"));
if ($arRes = $dbRes->Fetch()) {
$DocsSocnetCommentsForumID = $arRes["ID"];
}
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/company/personal.php", array("FILES_FORUM_ID" => $DocsSocnetCommentsForumID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index_b24.php", array("FILES_FORUM_ID" => $DocsSocnetCommentsForumID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/workgroups/index.php", array("FILES_FORUM_ID" => $DocsSocnetCommentsForumID));
if (!WIZARD_IS_RERUN) {
$APPLICATION->SetGroupRight("forum", WIZARD_PORTAL_ADMINISTRATION_GROUP, "W");
COption::SetOptionString("forum", "SHOW_VOTES", "N");
COption::SetOptionString("forum", "file_max_size", 10485760);
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:index.php
示例6: array
$res["~POST_MESSAGE_TEXT"] = COption::GetOptionString("forum", "FILTER", "Y") == "Y" ? $res["~POST_MESSAGE_FILTER"] : $res["~POST_MESSAGE"];
// attach
$res["ATTACH_IMG"] = "";
$res["FILES"] = array();
$res["~ATTACH_FILE"] = array();
$res["ATTACH_FILE"] = array();
/************** Message info/***************************************/
/************** Author info ****************************************/
$res["AUTHOR_ID"] = intVal($res["AUTHOR_ID"]);
$res["AUTHOR_NAME"] = $parser->wrap_long_words($res["AUTHOR_NAME"]);
if ($res["AUTHOR_ID"] <= 0) {
// Status
list($res["AUTHOR_STATUS_CODE"], $res["AUTHOR_STATUS"]) = ForumGetUserForumStatus(0);
} else {
if (!array_key_exists($res["AUTHOR_ID"], $UserInfo)) {
$perm = CForumNew::GetUserPermission($res["FORUM_ID"], CUser::GetUserGroup($res["AUTHOR_ID"]));
$arUser = array("Perms" => $perm, "Rank" => $perm <= "Q" ? CForumUser::GetUserRank($res["AUTHOR_ID"], LANGUAGE_ID) : "", "Points" => !empty($res["POINTS"]) ? array("POINTS" => $res["POINTS"], "DATE_UPDATE" => $res["DATE_UPDATE"]) : false);
$arUData = array();
// Status
list($arUData["AUTHOR_STATUS_CODE"], $arUData["AUTHOR_STATUS"]) = ForumGetUserForumStatus($res["AUTHOR_ID"], $arUser["Perms"], $arUser);
// Avatar
if (!empty($res["AVATAR"])) {
$arUData["AVATAR"] = array("ID" => $res["~AVATAR"], "FILE" => CFile::GetFileArray($res["~AVATAR"]));
$arUData["AVATAR"]["HTML"] = CFile::ShowImage($arUData["AVATAR"]["FILE"], COption::GetOptionString("forum", "avatar_max_width", 90), COption::GetOptionString("forum", "avatar_max_height", 90), "border=\"0\"", "", true);
}
// Voting
$arUData["VOTING"] = "N";
if (COption::GetOptionString("forum", "SHOW_VOTES", "Y") == "Y" && $USER->IsAuthorized() && ($GLOBALS["APPLICATION"]->GetGroupRight("forum") >= "W" || $USER->GetID() != $res["AUTHOR_ID"])) {
$bUnVote = $arUser["Points"];
$bVote = !$arUser["Points"] ? $arResult["USER"]["RANK"]["VOTES"] : intval($arUser["Points"]["POINTS"]) < intval($arResult["USER"]["RANK"]["VOTES"]);
$bVote = $bVote ? $bVote : $GLOBALS["APPLICATION"]->GetGroupRight("forum") >= "W";
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php
示例7: GetMessage
/Input params
********************************************************************/
$APPLICATION->SetTitle($ID > 0 ? GetMessage("FORUM_EDIT_RECORD", array("#ID#" => $ID)) : GetMessage("FORUM_NEW_RECORD"));
/********************************************************************
Action
********************************************************************/
$fileName = '';
if ($REQUEST_METHOD == "POST" && $forumPermissions >= "W" && (strlen($save) > 0 || strlen($apply) > 0)) {
if (isset($_FILES["IMAGE"]["name"])) {
$fileName = RemoveScriptExtension($_FILES["IMAGE"]["name"]);
}
if (!check_bitrix_sessid()) {
$arError[] = array("id" => "bad_sessid", "text" => GetMessage("ERROR_BAD_SESSID"));
} elseif ($ID > 0 && !CForumNew::CanUserUpdateForum($ID, $USER->GetUserGroupArray(), $USER->GetID())) {
$arError[] = array("id" => "not_right_for_edit", "text" => GetMessage("FE_NO_PERMS2UPDATE"));
} elseif ($ID <= 0 && !CForumNew::CanUserAddForum($USER->GetUserGroupArray(), $USER->GetID())) {
$arError[] = array("id" => "not_right_for_add", "text" => GetMessage("FE_NO_PERMS2ADD"));
} elseif (!empty($_FILES["IMAGE"]["tmp_name"])) {
$sUploadDir = $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/images/forum/" . ($_REQUEST["TYPE"] == "I" ? "icon" : "smile") . "/";
CheckDirPath($sUploadDir);
$arSmile = $ID > 0 ? CForumSmile::GetByID($ID) : $arSmile;
$res = CFile::CheckImageFile($_FILES["IMAGE"], COption::GetOptionString("forum", "file_max_size", 50000), 0, 0);
if (strLen($res) > 0) {
$arError[] = array("id" => "IMAGE", "text" => $res);
} elseif (file_exists($sUploadDir . $fileName) && !(isset($arSmile["IMAGE"]) && $arSmile["IMAGE"] != $fileName)) {
$arError[] = array("id" => "IMAGE", "text" => GetMessage("ERROR_EXISTS_IMAGE", array("#FILE#" => str_replace("//", "/", "/" . BX_ROOT . "/images/forum/" . ($_REQUEST["TYPE"] == "I" ? "icon" : "smile") . "/" . $fileName))));
} elseif (!@copy($_FILES["IMAGE"]["tmp_name"], $sUploadDir . $fileName)) {
$arError[] = array("id" => "IMAGE", "text" => GetMessage("ERROR_COPY_IMAGE"));
} else {
@chmod($sUploadDir . $fileName, BX_FILE_PERMISSIONS);
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:smile_edit.php
示例8: 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;
}
开发者ID:spas-viktor,项目名称:books,代码行数:82,代码来源:forum_new.php
示例9: ShowError
}
$arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "N" ? "N" : "Y";
$arParams["SET_NAVIGATION"] = $arParams["SET_NAVIGATION"] == "N" ? "N" : "Y";
// $arParams["DISPLAY_PANEL"] = ($arParams["DISPLAY_PANEL"] == "Y" ? "Y" : "N");
/********************************************************************
/Input params
********************************************************************/
$arResult["FORUM"] = CForumNew::GetByID($arParams["FID"]);
if (empty($arResult["FORUM"])) {
CHTTP::SetStatus("404 Not Found");
ShowError(GetMessage("F_ERROR_FORUM_NOT_EXISTS"));
return false;
} elseif (!CForumNew::CanUserViewForum($arParams["FID"], $USER->GetUserGroupArray())) {
$APPLICATION->AuthForm(GetMessage("F_NO_FPERMS"));
return false;
} elseif (!array_key_exists(SITE_ID, CForumNew::GetSites($arParams["FID"])) && ($arParams["SHOW_FORUM_ANOTHER_SITE"] == "N" || !CForumUser::IsAdmin())) {
CHTTP::SetStatus("404 Not Found");
ShowError(GetMessage("F_ERROR_FORUM_NOT_EXISTS"));
return false;
}
/********************************************************************
Default values
********************************************************************/
$arParams["PERMISSION"] = $arResult["PERMISSION"] = ForumCurrUserPermissions($arParams["FID"]);
$arResult["Topics"] = array();
$arResult["TOPICS"] = array();
$arResult["URL"] = array("INDEX" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_INDEX"], array()), "~INDEX" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_INDEX"], array()), "TOPIC_LIST" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $arParams["FID"])), "~TOPIC_LIST" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_LIST"], array("FID" => $arParams["FID"])), "TOPIC_NEW" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_TOPIC_NEW"], array("FID" => $arParams["FID"])), "~TOPIC_NEW" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_TOPIC_NEW"], array("FID" => $arParams["FID"])), "RSS" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_RSS"], array("TYPE" => "default", "MODE" => "forum", "IID" => $arParams["FID"])), "~RSS" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_RSS"], array("TYPE" => "default", "MODE" => "forum", "IID" => $arParams["FID"])), "RSS_DEFAULT" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_RSS"], array("TYPE" => "rss2", "MODE" => "forum", "IID" => $arParams["FID"])), "~RSS_DEFAULT" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_RSS"], array("TYPE" => "rss2", "MODE" => "forum", "IID" => $arParams["FID"])));
$arResult["CanUserAddTopic"] = CForumTopic::CanUserAddTopic($arParams["FID"], $USER->GetUserGroupArray(), $USER->GetID(), $arResult["FORUM"]);
$arResult["ERROR_MESSAGE"] = "";
$arResult["OK_MESSAGE"] = "";
$parser = new forumTextParser(false, false, false, "light");
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php
示例10: GetListEx
public static function GetListEx($arOrder = array("ID" => "ASC"), $arFilter = array(), $arAddParams = array())
{
global $DB;
$arSqlSearch = array();
$arSqlFrom = array();
$arSqlOrder = array();
$strSqlSearch = "";
$strSqlFrom = "";
$strSqlOrder = "";
$arFilter = is_array($arFilter) ? $arFilter : array();
foreach ($arFilter as $key => $val) {
$key_res = CForumNew::GetFilterOperation($key);
$key = strtoupper($key_res["FIELD"]);
$strNegative = $key_res["NEGATIVE"];
$strOperation = $key_res["OPERATION"];
switch ($key) {
case "TOPIC_ID":
case "FORUM_ID":
if (intVal($val) <= 0) {
$arSqlSearch[] = ($strNegative == "Y" ? "NOT" : "") . "(FSTAT." . $key . " IS NULL OR FSTAT." . $key . "<=0)";
} else {
$arSqlSearch[] = ($strNegative == "Y" ? " FSTAT." . $key . " IS NULL OR NOT " : "") . "(FSTAT." . $key . " " . $strOperation . " " . intVal($val) . ")";
}
break;
case "SITE_ID":
$bOrNull = false;
if (is_array($val)) {
$res = array();
foreach ($val as $v) {
$v = trim($v);
if ($v == "NULL") {
$bOrNull = true;
} elseif (!empty($v)) {
$res[] = "'" . $DB->ForSql($v) . "'";
}
}
$val = !empty($res) ? implode(", ", $res) : "";
$strOperation = !empty($res) ? "IN" : $strOperation;
} else {
$val = "'" . $DB->ForSql($val) . "'";
}
if (strlen($val) <= 0) {
$arSqlSearch[] = ($strNegative == "Y" ? "NOT" : "") . "(FSTAT." . $key . " IS NULL OR LENGTH(FSTAT." . $key . ")<=0)";
} elseif ($strOperation == "IN") {
$arSqlSearch[] = ($strNegative == "Y" ? " FSTAT." . $key . " IS NULL OR NOT " : "") . "(FSTAT." . $key . " IN (" . $val . ")" . ($bOrNull ? " OR (FSTAT." . $key . " IS NULL OR LENGTH(FSTAT." . $key . ")<=0)" : "") . ")";
} else {
$arSqlSearch[] = ($strNegative == "Y" ? " FSTAT." . $key . " IS NULL OR NOT " : "") . "(FSTAT." . $key . " " . $strOperation . " " . $val . ")";
}
break;
case "LAST_VISIT":
if (strLen($val) <= 0) {
$arSqlSearch[] = ($strNegative == "Y" ? "NOT" : "") . "(FSTAT." . $key . " IS NULL)";
} else {
$arSqlSearch[] = ($strNegative == "Y" ? " FSTAT." . $key . " IS NULL OR NOT " : "") . "(FSTAT." . $key . " " . $strOperation . " " . $DB->CharToDateFunction($DB->ForSql($val), "FULL") . ")";
}
break;
case "PERIOD":
if (strLen($val) <= 0) {
$arSqlSearch[] = ($strNegative == "Y" ? "NOT" : "") . "(FSTAT.LAST_VISIT IS NULL)";
} else {
$arSqlSearch[] = ($strNegative == "Y" ? " FSTAT.LAST_VISIT IS NULL OR NOT " : "") . "(FROM_UNIXTIME(UNIX_TIMESTAMP(CURRENT_TIMESTAMP) - " . intVal($val) . ") " . $strOperation . " FSTAT.LAST_VISIT)";
}
break;
case "HIDE_FROM_ONLINE":
$arSqlFrom["FU"] = "LEFT JOIN b_forum_user FU ON (FSTAT.USER_ID=FU.USER_ID)";
if (strLen($val) <= 0) {
$arSqlSearch[] = ($strNegative == "Y" ? "NOT" : "") . "(FU." . $key . " IS NULL OR LENGTH(FU." . $key . ")<=0)";
} else {
$arSqlSearch[] = ($strNegative == "Y" ? " FU." . $key . " IS NULL OR NOT " : "") . "(((FU." . $key . " " . $strOperation . " '" . $DB->ForSql($val) . "' ) AND (FSTAT.USER_ID > 0)) OR (FSTAT.USER_ID <= 0))";
}
break;
break;
case "ACTIVE":
$arSqlFrom["U"] = "LEFT JOIN b_user U ON (FSTAT.USER_ID=U.ID)";
$arSqlSearch[] = ($strNegative == "Y" ? " U." . $key . " IS NULL OR NOT " : "") . "(FSTAT.USER_ID = 0 OR U.ACTIVE = 'Y')";
break;
}
}
if (!empty($arSqlSearch)) {
$strSqlSearch = " AND " . implode(" AND ", $arSqlSearch) . " ";
}
if (!empty($arSqlFrom)) {
$strSqlFrom = implode("\n", $arSqlFrom);
}
foreach ($arOrder as $by => $order) {
$by = strtoupper($by);
$order = strtoupper($order);
$order = $order != "ASC" ? $order = "DESC" : "ASC";
if ($by == "USER_ID") {
$arSqlOrder[] = " FSTAT.USER_ID " . $order . " ";
}
}
DelDuplicateSort($arSqlOrder);
if (count($arSqlOrder) > 0) {
$strSqlOrder = " ORDER BY " . implode(", ", $arSqlOrder);
}
$strSql = "SELECT FSTAT.USER_ID, FSTAT.IP_ADDRESS, FSTAT.PHPSESSID, \n" . "\t" . $DB->DateToCharFunction("FSTAT.LAST_VISIT", "FULL") . " AS LAST_VISIT, \n" . "\tFSTAT.FORUM_ID, FSTAT.TOPIC_ID \n" . "FROM b_forum_stat FSTAT " . $strSqlFrom . "\n" . "WHERE 1=1 " . $strSqlSearch . "\n" . $strSqlOrder;
if (is_set($arFilter, "COUNT_GUEST")) {
$strSql = "SELECT FST.*, FU.*, FSTAT.IP_ADDRESS, FSTAT.PHPSESSID, \n" . "\t" . $DB->DateToCharFunction("FSTAT.LAST_VISIT", "FULL") . " AS LAST_VISIT, \n" . "\tFSTAT.FORUM_ID, FSTAT.TOPIC_ID, \n" . "\tU.LOGIN, U.NAME, U.SECOND_NAME, U.LAST_NAME, \n" . "\t" . (!empty($arAddParams["sNameTemplate"]) ? CForumUser::GetFormattedNameFieldsForSelect(array_merge($arAddParams, array("sUserTablePrefix" => "U.", "sForumUserTablePrefix" => "FU.", "sFieldName" => "SHOW_NAME")), false) : "FSTAT.SHOW_NAME") . "\n " . " FROM ( " . " SELECT FSTAT.USER_ID, MAX(FSTAT.ID) FST_ID, COUNT(FSTAT.PHPSESSID) COUNT_USER " . " FROM b_forum_stat FSTAT " . $strSqlFrom . " WHERE 1=1 " . $strSqlSearch . " GROUP BY FSTAT.USER_ID" . ") FST " . "LEFT JOIN b_forum_stat FSTAT ON (FST.FST_ID = FSTAT.ID) " . "LEFT JOIN b_forum_user FU ON (FST.USER_ID = FU.USER_ID) " . "LEFT JOIN b_user U ON (FST.USER_ID = U.ID) " . $strSqlOrder;
}
//.........这里部分代码省略.........
开发者ID:rasuldev,项目名称:torino,代码行数:101,代码来源:user.php
示例11: intVal
********************************************************************/
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$TID1 = $arParams["MESSAGE_TYPE"] == "NEW" ? 0 : intVal($arParams["TID"]);
$MID1 = $arParams["MESSAGE_TYPE"] == "NEW" ? 0 : intVal($arParams["MID"]);
if (!check_bitrix_sessid()) {
$arError[] = array("id" => "bad sessid", "text" => GetMessage("F_ERR_SESS_FINISH"));
} elseif (!in_array($arResult["FORUM"]["ALLOW_UPLOAD"], array("Y", "A", "F")) && (!empty($_FILES) || !empty($_REQUEST["FILES"]))) {
$arError[] = array("id" => "bad files", "text" => GetMessage("F_ERRRO_FILE_NOT_UPLOAD"));
unset($_REQUEST["FILES"]);
} elseif ($arResult["VIEW"] == "N") {
$arFieldsG = array("POST_MESSAGE" => $_REQUEST["POST_MESSAGE"], "USE_SMILES" => $_REQUEST["USE_SMILES"], "OWNER_ID" => $arParams["USER_ID"], "SOCNET_GROUP_ID" => $arParams["SOCNET_GROUP_ID"], "PERMISSION_EXTERNAL" => $arParams["PERMISSION"]);
if ($arParams["SHOW_VOTE"] == "Y" && (!empty($_REQUEST["QUESTION"]) || !empty($_REQUEST["QUESTION_ID"]))) {
$VOTE_ID = $arResult["MESSAGE"]["PARAM1"] == 'VT' ? intVal($arResult["MESSAGE"]["PARAM2"]) : 0;
$arVote = array("CHANNEL_ID" => $arParams["VOTE_CHANNEL_ID"], "TITLE" => $_REQUEST["TITLE"], "QUESTIONS" => array());
if ($VOTE_ID <= 0) {
$arVote["DATE_START"] = GetTime(CForumNew::GetNowTime(), "FULL");
$arVote["DATE_END"] = GetTime(MakeTimeStamp($_REQUEST['DATE_END']), "FULL");
} else {
$arVote["DATE_END"] = $_REQUEST['DATE_END'];
}
$arQuestions = $arResult["~QUESTIONS"];
$_REQUEST["QUESTION"] = is_array($_REQUEST["QUESTION"]) ? $_REQUEST["QUESTION"] : array();
foreach ($_REQUEST["QUESTION"] as $key => $val) {
$res = array("QUESTION" => trim($val), "MULTI" => $_REQUEST["MULTI"][$key] == "Y" ? "Y" : "N", "DEL" => $_REQUEST["QUESTION_DEL"][$key] == "Y" ? "Y" : "N", "ANSWERS" => array());
$id = intval($_REQUEST["QUESTION_ID"][$key]);
if ($id > 0 && is_set($arQuestions, $id)) {
$res["ID"] = $id;
} elseif ($res["DEL"] == "Y") {
continue;
}
$arAnswers = is_array($arResult["~QUESTIONS"][$res["ID"]]["ANSWERS"]) ? $arResult["~QUESTIONS"][$res["ID"]]["ANSWERS"] : array();
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php
示例12: IncludeModuleLangFile
<?php
/********************************************************************
Topics
**************************************!*****************************/
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/forum/include.php";
$forumModulePermissions = $APPLICATION->GetGroupRight("forum");
if ($forumModulePermissions == "D") {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
IncludeModuleLangFile(__FILE__);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/forum/prolog.php";
/*******************************************************************/
$db_Forum = CForumNew::GetListEx(array("SORT" => "ASC", "NAME" => "ASC"));
$arr = array();
$arr["reference_id"][] = "";
$arr["reference"][] = "";
$arrForum = array();
$arrSelect = "";
while ($dbForum = $db_Forum->Fetch()) {
$arrForum[$dbForum["ID"]] = $dbForum["NAME"];
$arrSelect .= "<option value='" . $dbForum["ID"] . "'>" . htmlspecialcharsex($dbForum["NAME"]) . "</option>";
$arr["reference_id"][] = $dbForum["ID"];
$arr["reference"][] = $dbForum["NAME"];
}
/*******************************************************************/
$sTableID = "tbl_topic";
$oSort = new CAdminSorting($sTableID, "ID", "asc");
$lAdmin = new CAdminList($sTableID, $oSort);
$lAdmin->InitFilter(array("FORUM_ID", "TITLE", "DESCRIPTION", "USER_START_ID", "ACTIVE", "PINNED", "OPENED", "DATE_FROM", "DATE_TO", "CREATE_DATE_FROM", "CREATE_DATE_TO"));
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:forum_topics.php
示例13: GetSettings
public static function GetSettings($Params = array())
{
if (isset(self::$settings) && count(self::$settings) > 0 && $Params['request'] === false) {
return self::$settings;
}
$pathes_for_sites = COption::GetOptionString('calendar', 'pathes_for_sites', true);
if ($Params['forseGetSitePathes'] || !$pathes_for_sites) {
$pathes = self::GetPathes();
} else {
$pathes = array();
}
if (!isset($Params['getDefaultForEmpty']) || $Params['getDefaultForEmpty'] !== false) {
$Params['getDefaultForEmpty'] = true;
}
self::$settings = array('work_time_start' => COption::GetOptionString('calendar', 'work_time_start', 9), 'work_time_end' => COption::GetOptionString('calendar', 'work_time_end', 19), 'year_holidays' => COption::GetOptionString('calendar', 'year_holidays', '1.01,2.01,7.01,23.02,8.03,1.05,9.05,12.06,4.11,12.12'), 'year_workdays' => COption::GetOptionString('calendar', 'year_workdays', ''), 'week_holidays' => explode('|', COption::GetOptionString('calendar', 'week_holidays', 'SA|SU')), 'week_start' => COption::GetOptionString('calendar', 'week_start', 'MO'), 'user_name_template' => self::GetUserNameTemplate($Params['getDefaultForEmpty']), 'user_show_login' => COption::GetOptionString('calendar', 'user_show_login', true), 'path_to_user' => COption::GetOptionString('calendar', 'path_to_user', "/company/personal/user/#user_id#/"), 'path_to_user_calendar' => COption::GetOptionString('calendar', 'path_to_user_calendar', "/company/personal/user/#user_id#/calendar/"), 'path_to_group' => COption::GetOptionString('calendar', 'path_to_group', "/workgroups/group/#group_id#/"), 'path_to_group_calendar' => COption::GetOptionString('calendar', 'path_to_group_calendar', "/workgroups/group/#group_id#/calendar/"), 'path_to_vr' => COption::GetOptionString('calendar', 'path_to_vr', ""), 'path_to_rm' => COption::GetOptionString('calendar', 'path_to_rm', ""), 'rm_iblock_type' => COption::GetOptionString('calendar', 'rm_iblock_type', ""), 'rm_iblock_id' => COption::GetOptionString('calendar', 'rm_iblock_id', ""), 'vr_iblock_id' => COption::GetOptionString('calendar', 'vr_iblock_id', ""), 'dep_manager_sub' => COption::GetOptionString('calendar', 'dep_manager_sub', true), 'denied_superpose_types' => unserialize(COption::GetOptionString('calendar', 'denied_superpose_types', serialize(array()))), 'pathes_for_sites' => $pathes_for_sites, 'pathes' => $pathes, 'forum_id' => COption::GetOptionString('calendar', 'forum_id', ""));
if (self::$settings['work_time_start'] > 23) {
self::$settings['work_time_start'] = 23;
}
if (self::$settings['work_time_end'] <= self::$settings['work_time_start']) {
self::$settings['work_time_end'] = self::$settings['work_time_start'] + 1;
}
if (self::$settings['work_time_end'] > 23.3) {
self::$settings['work_time_end'] = 23.3;
}
if (self::$settings['forum_id'] == "") {
self::$settings['forum_id'] = COption::GetOptionString("tasks", "task_forum_id", "");
if (self::$settings['forum_id'] == "" && CModule::IncludeModule("forum")) {
$db = CForumNew::GetListEx();
if ($ar = $db->GetNext()) {
self::$settings['forum_id'] = $ar["ID"];
}
}
COption::SetOptionString("calendar", "forum_id", self::$settings['forum_id']);
}
return self::$settings;
}
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:36,代码来源:calendar.php
-
The BolunHan/Krypton repository through 2021-06-03 on GitHub allows absolute pat
阅读:686|2022-07-29
-
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1223|2022-08-30
-
ozzieperez/packtpub-library-downloader: Script to download all your PacktPub ebo
阅读:535|2022-08-15
-
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1136|2022-08-17
-
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:947|2022-11-06
-
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1344|2022-08-18
-
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:491|2022-08-16
-
PacktPublishing/Mastering-Embedded-Linux-Programming-Third-Edition: Mastering Em
阅读:747|2022-08-15
-
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:644|2022-11-06
-
shem8/MaterialLogin: Login view with material design
阅读:726|2022-08-17
|
请发表评论