本文整理汇总了PHP中CForumNew::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumNew::Add方法的具体用法?PHP CForumNew::Add怎么用?PHP CForumNew::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForumNew
的用法示例。
在下文中一共展示了CForumNew::Add方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$forumCode = "intranet_tasks";
$dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => $forumCode));
if ($arRes = $dbRes->Fetch()) {
$tasksForumId = $arRes["ID"];
} else {
$arGroupID = array("GENERAL" => 0, "COMMENTS" => 0, "HIDDEN" => 0);
$dbExistsGroup = CForumGroup::GetListEx(array(), array("LID" => LANGUAGE_ID));
while ($arExistsGroup = $dbExistsGroup->Fetch()) {
foreach ($arGroupID as $xmlID => $ID) {
if ($arExistsGroup["NAME"] == GetMessage($xmlID . "_GROUP_NAME")) {
$arGroupID[$xmlID] = $arExistsGroup["ID"];
}
}
}
$arFields = array("XML_ID" => $forumCode, "NAME" => "Intranet Tasks", "DESCRIPTION" => false, "SORT" => 1, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "A", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "DEDUPLICATION" => "N", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "E", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y", WIZARD_EMPLOYEES_GROUP => "M", WIZARD_PERSONNEL_DEPARTMENT_GROUP => "M"), "FORUM_GROUP_ID" => $arGroupID["HIDDEN"]);
$tasksForumId = CForumNew::Add($arFields);
}
}
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/_index.php", array("TASKS_IBLOCK_ID" => $tasksIblockId));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/desktop.php", array("TASKS_IBLOCK_ID" => $tasksIblockId));
$arReplace = array("BLOG_GROUP_ID" => $blogGroupID, "FORUM_ID" => $forumID, "FILES_USER_IBLOCK_ID" => $filesUserIBlockID, "CALENDAR_USER_IBLOCK_ID" => $calendarUserIBlockID, "PHOTO_USER_IBLOCK_ID" => $photoUserIBlockID, "PHOTO_FORUM_ID" => $photoForumID, "TASKS_IBLOCK_ID" => $tasksIblockId, "TASKS_FORUM_ID" => $tasksForumId);
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/company/personal.php", $arReplace);
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index_b24.php", $arReplace);
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index.php", $arReplace);
$arReplace = array("BLOG_GROUP_ID" => $blogGroupID, "FORUM_ID" => $forumID, "FILES_GROUP_IBLOCK_ID" => $filesGroupIBlockID, "CALENDAR_IBLOCK_ID" => $calendarGroupIBlockID, "PHOTO_GROUP_IBLOCK_ID" => $photoGroupIBlockID, "PHOTO_FORUM_ID" => $photoForumID, "TASKS_IBLOCK_ID" => $tasksIblockId, "TASKS_FORUM_ID" => $tasksForumId);
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/workgroups/index.php", $arReplace);
$arReplace = array("FILES_GROUP_IBLOCK_ID" => $filesGroupIBlockID, "FILES_USER_IBLOCK_ID" => $filesUserIBlockID);
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/docs/index.php", $arReplace);
$arReplace = array("FILES_GROUP_IBLOCK_ID" => $filesGroupIBlockID, "FILES_USER_IBLOCK_ID" => $filesUserIBlockID, "TASKS_FORUM_ID" => $tasksForumId);
CWizardUtil::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "/m/", $arReplace);
}
示例2: strlen
$arGroupID[$xmlID] = CForumGroup::Add($arNewGroup);
}
$rsUser = CUser::GetByID(1);
if ($arUser = $rsUser->Fetch()) {
$userName = $arUser["NAME"] . (strlen($arUser["NAME"]) <= 0 || strlen($arUser["LAST_NAME"]) <= 0 ? "" : " ") . $arUser["LAST_NAME"];
$authorName = strlen(trim($userName)) > 0 ? $userName : $arUser["LOGIN"];
} else {
$authorName = "admin";
}
$arForums = array(array("XML_ID" => "NEWS_COMMENTS", "NAME" => GetMessage("NEWS_COMMENTS_FORUM_NAME"), "DESCRIPTION" => GetMessage("NEWS_COMMENTS_FORUM_DESCRIPTION"), "SORT" => 2, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "DEDUPLICATION" => "N", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["COMMENTS"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")), array("XML_ID" => "PHOTOGALLERY_COMMENTS", "NAME" => GetMessage("PHOTOGALLERY_COMMENTS_FORUM_NAME"), "DESCRIPTION" => GetMessage("PHOTOGALLERY_COMMENTS_FORUM_DESCRIPTION"), "SORT" => 3, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "DEDUPLICATION" => "N", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")), array("XML_ID" => "USERS_AND_GROUPS", "NAME" => GetMessage("USERS_AND_GROUPS_FORUM_NAME"), "DESCRIPTION" => GetMessage("USERS_AND_GROUPS_FORUM_DESCRIPTION"), "SORT" => 4, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "A", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "DEDUPLICATION" => "N", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array(WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")), array("XML_ID" => "DOCS_SHARED_COMMENTS", "NAME" => GetMessage("DOCS_SHARED_COMMENTS_NAME"), "DESCRIPTION" => GetMessage("DOCS_SHARED_COMMENTS_DECRIPTION"), "SORT" => 5, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "DEDUPLICATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")), array("XML_ID" => "DOCS_SALES_COMMENTS", "NAME" => GetMessage("DOCS_SALES_COMMENTS_NAME"), "DESCRIPTION" => GetMessage("DOCS_SALES_COMMENTS_DECRIPTION"), "SORT" => 6, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "DEDUPLICATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "A", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y", WIZARD_EMPLOYEES_GROUP => "M", WIZARD_MARKETING_AND_SALES_GROUP => "M")), array("XML_ID" => "DOCS_DIRECTORS_COMMENTS", "NAME" => GetMessage("DOCS_DIRECTORS_COMMENTS_NAME"), "DESCRIPTION" => GetMessage("DOCS_DIRECTORS_COMMENTS_DECRIPTION"), "SORT" => 6, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "DEDUPLICATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "A", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y", WIZARD_DIRECTION_GROUP => "M")), array("XML_ID" => "GROUPS_AND_USERS_FILES_COMMENTS", "NAME" => GetMessage("GROUPS_AND_USERS_COMMENTS_NAME"), "DESCRIPTION" => GetMessage("GROUPS_AND_USERS_COMMENTS_DESCRIPTION"), "SORT" => 6, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "DEDUPLICATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "community/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", WIZARD_PORTAL_ADMINISTRATION_GROUP => "Y")));
foreach ($arForums as $arForum) {
$dbForum = CForumNew::GetList(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => $arForum["XML_ID"]));
if ($dbForum->Fetch()) {
continue;
}
$forumID = CForumNew::Add($arForum);
if ($forumID < 1 || !isset($arForum["TOPICS"]) || !is_array($arForum["TOPICS"])) {
continue;
}
foreach ($arForum["TOPICS"] as $arTopic) {
$arTopic["FORUM_ID"] = $forumID;
$topicID = CForumTopic::Add($arTopic);
if ($topicID < 1 || !isset($arTopic["MESSAGES"]) || !is_array($arTopic["MESSAGES"])) {
continue;
}
foreach ($arTopic["MESSAGES"] as $arMessage) {
$arMessage["FORUM_ID"] = $forumID;
$arMessage["TOPIC_ID"] = $topicID;
$messageID = CForumMessage::Add($arMessage, false);
if ($messageID < 1) {
CForumTopic::Delete($topicID);
示例3: while
while ($arLang = $rsLanguages->Fetch()) {
$file = dirname(__FILE__) . "/lang/" . $arLang["LANGUAGE_ID"] . "/books-files.php";
include $file;
$arFields["LANG"][] = array("LID" => $arLang["LANGUAGE_ID"], "NAME" => GetMessage("DEMO_IBLOCK_ESTORE_BOOKS_FORUM_GROUP_NAME"), "DESCRIPTION" => "");
}
$arForumGroup = array("FORUM_GROUP_ID" => CForumGroup::Add($arFields));
}
if ($arForumGroup["FORUM_GROUP_ID"]) {
$arFields = array("NAME" => GetMessage("DEMO_IBLOCK_ESTORE_BOOKS_FORUM_NAME"), "DESCRIPTION" => "", "SORT" => 150, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "N", "ALLOW_UPLOAD_EXT" => "", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "N", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "PATH2FORUM_MESSAGE" => "", "FORUM_GROUP_ID" => $arForumGroup["FORUM_GROUP_ID"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "SITES" => array($arParams["site_id"] => "/communication/forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/"));
$arFields["GROUP_ID"] = array("2" => "M", "19" => "Q");
if (CModule::IncludeModule("statistic")) {
$arFields["EVENT1"] = "forum";
$arFields["EVENT2"] = "message";
$arFields["EVENT3"] = "";
}
$arForum = array("ID" => CForumNew::Add($arFields));
}
}
} else {
$arForum = array("ID" => "");
}
//Include language one more time (after forum creation)
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", "/" . basename(__FILE__)));
$search = array("#IBLOCK.ID(XML_ID=books-authors)#", "#IBLOCK.ID(XML_ID=books-books)#", "#IBLOCK.ID(XML_ID=books-reviews)#", "#FORUM.ID(NAME=books-reviews)#", "#MODULE.INSTALLED(ID=forum)#");
$replace = array(CIBlockCMLImport::GetIBlockByXML_ID("books-authors"), CIBlockCMLImport::GetIBlockByXML_ID("books-books"), CIBlockCMLImport::GetIBlockByXML_ID("books-reviews"), $arForum["ID"], IsModuleInstalled("forum") ? "Y" : "N");
//Create directory and copy files
DEMO_IBlock_CopyFiles("/public/e-store/books/", "/e-store/books/", false, $search, $replace);
DEMO_IBlock_CopyFiles("/public/e-store/books/authors/", "/e-store/books/authors/", false, $search, $replace);
DEMO_IBlock_CopyFiles("/public/e-store/books/reviews/", "/e-store/books/reviews/", false, $search, $replace);
CopyDirFiles(dirname(__FILE__) . "/public/language/" . LANGUAGE_ID . "/e-store/books/", $_SERVER["DOCUMENT_ROOT"] . "/e-store/books", false, true);
//Add menu item
示例4: foreach
foreach ($arGroupsId as $ind => $val) {
CSocNetFeatures::Add(array("ENTITY_TYPE" => SONET_ENTITY_GROUP, "ENTITY_ID" => $val, "FEATURE" => "forum", "FEATURE_NAME" => GetSocNetMessageLocal("SONET_I_FEATURE_FORUM", $arSite["LANGUAGE_ID"]), "ACTIVE" => "Y", "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction()));
CSocNetFeatures::Add(array("ENTITY_TYPE" => SONET_ENTITY_GROUP, "ENTITY_ID" => $val, "FEATURE" => "blog", "FEATURE_NAME" => GetSocNetMessageLocal("SONET_I_FEATURE_BLOG", $arSite["LANGUAGE_ID"]), "ACTIVE" => "Y", "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction()));
}
}
}
}
// ------------------ FORUM -------------------------------
$forumID = 0;
if (CModule::IncludeModule("forum")) {
$dbResult = CForumNew::GetListEx(array(), array("SITE_ID" => $arSite["SITE_ID"], "XML_ID" => "car_forum_demo"));
if ($arResult = $dbResult->Fetch()) {
$forumID = $arResult["ID"];
} else {
$arFields = array("NAME" => GetSocNetMessageLocal("SONET_I_FORUM_NAME", $arSite["LANGUAGE_ID"]), "ACTIVE" => "Y", "XML_ID" => "car_forum_demo", "MODERATION" => "N", "SITES" => array($arSite["SITE_ID"] => StrLen($arSite["DIR"]) > 0 ? $arSite["DIR"] : "/"));
$forumID = CForumNew::Add($arFields);
}
}
// ------------------ BLOG -------------------------------
$blogGroupID = 0;
if (CModule::IncludeModule("blog")) {
$dbResult = CBlogGroup::GetList(array("ID" => "ASC"), array("SITE_ID" => $arSite["SITE_ID"]));
if ($arResult = $dbResult->Fetch()) {
$blogGroupID = $arResult["ID"];
} else {
$blogGroupID = CBlogGroup::Add(array("SITE_ID" => $arSite["SITE_ID"], "NAME" => GetSocNetMessageLocal("SONET_I_BLOG_NAME", $arSite["LANGUAGE_ID"])));
}
}
// ------------------ PHOTO -------------------------------
$photoIBlockTypeID = "car_gallery_demo";
$photoUserIBlockID = 0;
示例5: array
CWikiSocnet::EnableSocnet(true);
}
}
}
if (!$bVarsFromForm && $_REQUEST["socnet_forum"] == "Y" && IsModuleInstalled("forum") && $GLOBALS["APPLICATION"]->GetGroupRight("forum") >= "W") {
CModule::IncludeModule("forum");
$arFields = array("ACTIVE" => "Y", "NAME" => $_REQUEST["socnet_forum_name"], "GROUP_ID" => array(1 => "Y", 2 => "E", 3 => "M"), "SITES" => array());
$db_res = CSite::GetList($lby = "sort", $lorder = "asc");
while ($res = $db_res->Fetch()) {
if (IsModuleInstalled("intranet")) {
$arFields["SITES"][$res["LID"]] = "/community/forum/forum#FORUM_ID#/topic#TOPIC_ID#/";
} else {
$arFields["SITES"][$res["LID"]] = "/communication/forum/forum#FORUM_ID#/topic#TOPIC_ID#/";
}
}
$SOCNET_FORUM_ID = CForumNew::Add($arFields);
COption::SetOptionString("wiki", "socnet_forum_id", $SOCNET_FORUM_ID);
COption::SetOptionString("wiki", "socnet_use_review", "Y");
}
}
if ($bVarsFromForm) {
ShowError($strWarning);
include "step.php";
} else {
?>
<script>
window.location='/bitrix/admin/module_admin.php?step=3&lang=<?php
echo LANGUAGE_ID . "&id=wiki&install=y&" . bitrix_sessid_get();
?>
';
</script>
示例6: getForumId
public static function getForumId()
{
$forumId = COption::GetOptionString('bizproc', 'forum_id', 0);
if (!$forumId && CModule::includeModule('forum')) {
$defaultSiteId = CSite::GetDefSite();
$forumId = CForumNew::Add(array('NAME' => 'Bizproc Workflow', 'XML_ID' => 'bizproc_workflow', 'SITES' => array($defaultSiteId => '/'), 'ACTIVE' => 'Y', 'DEDUPLICATION' => 'N'));
COption::SetOptionString("bizproc", "forum_id", $forumId);
}
return $forumId;
}
示例7: GetForum
public static function GetForum($arLog)
{
$FORUM_ID = COption::GetOptionInt("timeman", "report_forum_id", 0);
if ($FORUM_ID <= 0 && CModule::IncludeModule("forum")) {
$arForumFields = array("NAME" => GetMessage("TIMEMAN_FORUM_TITLE"), "DESCRIPTION" => "", "FORUM_GROUP_ID" => 0, "GROUP_ID" => array(1 => "Y", 2 => "M"), "SITES" => array($arLog["SITE_ID"] => "/"), "ACTIVE" => "Y", "MODERATION" => "N", "INDEXATION" => "N", "SORT" => 150, "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_VIDEO" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_UPLOAD_EXT" => "", "ALLOW_TOPIC_TITLED" => "Y");
$FORUM_ID = CForumNew::Add($arForumFields);
if ($FORUM_ID > 0) {
COption::SetOptionInt("timeman", "report_forum_id", $FORUM_ID);
}
}
return $FORUM_ID;
}
示例8: GetContent
function GetContent($arParams)
{
if (!CModule::IncludeModule('iblock')) {
return false;
}
if ($_POST['library_resource_type'] != "folder") {
//iblock
$iblock_type = '';
$iblock_id = 0;
if ($_POST['library_IBLOCK_TYPE'] != '') {
$res = CIBlockType::GetByID($_POST['library_IBLOCK_TYPE']);
if ($res_arr = $res->Fetch()) {
$iblock_type = $res_arr["ID"];
}
if ($iblock_type != '') {
if ($_POST['library_NEW_IBLOCK'] == 'Y') {
//new iblock
$ib = new CIBlock();
$arFields = array("ACTIVE" => "Y", "VERSION" => 1, "LIST_PAGE_URL" => $arParams['path'], "DETAIL_PAGE_URL" => $arParams['path'] . 'element/view/#ID#/', "NAME" => $_POST['library_TITLE'], "IBLOCK_TYPE_ID" => $iblock_type, "LID" => array($arParams['site']), "SORT" => "500", "WORKFLOW" => "N", "BIZPROC" => "N", "SECTION_CHOOSER" => "L");
if (is_array($_POST['library_PERMISSION'])) {
$arPerm = array();
foreach ($_POST['library_PERMISSION'] as $grp => $perm) {
if ($perm == 'R' || $perm == 'U' || $perm == 'W') {
$arPerm[$grp] = $perm;
}
if ($perm == 'U') {
$arFields['BIZPROC'] = 'Y';
}
}
$arFields["GROUP_ID"] = $arPerm;
}
$iblock_id = $ib->Add($arFields);
} elseif (intval($_POST['library_IBLOCK_ID']) > 0) {
//existing iblock: need check permissions
if (CIBlock::GetPermission($_POST['library_IBLOCK_ID']) >= "X") {
$iblock_id = intval($_POST['library_IBLOCK_ID']);
}
}
}
}
//forum for comments
$forum_id = 0;
if ($_POST['library_USE_COMMENTS'] == 'Y') {
if ($_POST['library_NEW_FORUM'] == 'Y') {
CModule::IncludeModule('forum');
//new forum
$arFields = array("NAME" => GetMessage("library_wizard_forum_name") . " \"" . $_POST['library_TITLE'] . "\"", "SITES" => array($arParams['site'] => $arParams["path"] . "element/view/#PARAM2#/"), "ACTIVE" => "Y", "INDEXATION" => "N", "SORT" => 150, "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_TOPIC_TITLED" => "Y");
if (is_array($_POST['library_FORUM_PERMISSION'])) {
$arPerm = array();
foreach ($_POST['library_FORUM_PERMISSION'] as $grp => $perm) {
if ($perm == 'E' || $perm == 'M') {
$arPerm[$grp] = $perm;
}
}
$arFields["GROUP_ID"] = $arPerm;
}
$forum_id = CForumNew::Add($arFields);
} elseif (intval($_POST['library_FORUM_ID']) > 0) {
$forum_id = intval($_POST['library_FORUM_ID']);
}
}
//file size
$iUploadMaxFilesize = intval(ini_get('upload_max_filesize'));
$iPostMaxSize = intval(ini_get('post_max_size'));
$iUploadMaxFilesize = min($iUploadMaxFilesize, $iPostMaxSize);
//bizproc templates
if ($_POST['library_NEW_IBLOCK'] == 'Y' && $iblock_id > 0 && CModule::IncludeModule("bizproc")) {
$documentType = array("webdav", "CIBlockDocumentWebdav", "iblock_" . $iblock_id);
if (!function_exists("__wd_replace_user_and_groups")) {
function __wd_replace_user_and_groups(&$val, $key, $params = array())
{
if ($key == "MailText") {
$val = str_replace("/company/personal/bizproc/{=Workflow:id}/", $params["path"], $val);
}
return true;
}
}
if ($handle = opendir($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/bizproc/templates')) {
$arr = array("path" => str_replace("//", "/", $arParams["path"] . "/webdav_bizproc_view/{=Document:ID}/"));
while (false !== ($file = readdir($handle))) {
if (!is_file($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/bizproc/templates/' . $file)) {
continue;
}
$arFields = false;
include $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/bizproc/templates/' . $file;
array_walk_recursive($arFields["TEMPLATE"], "__wd_replace_user_and_groups", $arr);
if ($file == "status.php") {
$arFields["AUTO_EXECUTE"] = CBPDocumentEventType::Create;
}
if (is_array($arFields)) {
$arFields["DOCUMENT_TYPE"] = $documentType;
$arFields["SYSTEM_CODE"] = $file;
if (is_object($GLOBALS['USER'])) {
$arFields["USER_ID"] = $GLOBALS['USER']->GetID();
}
try {
CBPWorkflowTemplateLoader::Add($arFields);
} catch (Exception $e) {
}
}
//.........这里部分代码省略.........
示例9: ProcessForum
protected function ProcessForum($forumId)
{
if (!CModule::IncludeModule('forum')) {
return false;
}
$forumId = intval($forumId);
if ($forumId <= 0) {
$forumId = COption::GetOptionInt('meeting', 'comments_forum_id', 0, SITE_ID);
$bNeedCreate = $forumId <= 0 || !CForumNew::GetByID($forumId);
if ($bNeedCreate) {
$arForumFields = array('NAME' => GetMessage('MEETING_FORUM_NAME'), 'ACTIVE' => 'Y', 'INDEXATION' => 'N', 'ALLOW_HTML' => 'N', 'ALLOW_UPLOAD' => 'A', 'MODERATION' => 'N', 'SITES' => array(SITE_ID => $this->forumPath), 'GROUP_ID' => array(1 => 'Y'));
$forumId = CForumNew::Add($arForumFields);
if ($forumId > 0) {
COption::SetOptionInt('meeting', 'comments_forum_id', $forumId, '', SITE_ID);
}
}
}
$this->forumId = $forumId;
}