コード例 #1
0
ファイル: blog_group.php プロジェクト: DarneoStudio/bitrix
 function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen($arFields["NAME"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GG_EMPTY_NAME"), "EMPTY_NAME");
         return false;
     } elseif (is_set($arFields, "NAME")) {
         $dbResult = CBlogGroup::GetList(array(), array("NAME" => $arFields["NAME"], "!ID" => $ID, "SITE_ID" => $arFields["SITE_ID"]), false, false, array("ID"));
         if ($dbResult->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GG_DUBLICATE_NAME"), "DUBLICATE_NAME");
             return false;
         }
     }
     if ((is_set($arFields, "SITE_ID") || $ACTION == "ADD") && strlen($arFields["SITE_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GG_EMPTY_SITE_ID"), "EMPTY_SITE_ID");
         return false;
     } elseif (is_set($arFields, "SITE_ID")) {
         $dbResult = CSite::GetByID($arFields["SITE_ID"]);
         if (!$dbResult->Fetch()) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["SITE_ID"], GetMessage("BLG_GG_ERROR_NO_SITE")), "ERROR_NO_SITE");
             return false;
         }
     }
     return True;
 }
コード例 #2
0
ファイル: blog.php プロジェクト: k-kalashnikov/geekcon_new
?>
" size="40"></td>
	</tr>
	<tr>
		<td valign="top"><?php 
echo GetMessage("BLB_FILTER_GROUP_ID");
?>
:</td>
		<td>
			<select name="filter_group_id[]" multiple size="5">
				<option value=""><?php 
echo GetMessage("BLB_F_ALL");
?>
</option>
				<?php 
$dbGroup = CBlogGroup::GetList(array("NAME" => "ASC"), array());
while ($arGroup = $dbGroup->GetNext()) {
    ?>
<option value="<?php 
    echo $arGroup["ID"];
    ?>
"<?php 
    if (in_array($arGroup["ID"], $filter_group_id)) {
        echo " selected";
    }
    ?>
>[<?php 
    echo $arGroup["ID"];
    ?>
] <?php 
    echo $arGroup["NAME"];
コード例 #3
0
}
// ------------------ 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;
$photoGroupIBlockID = 0;
if (CModule::IncludeModule("iblock")) {
    $dbIBlockType = CIBlockType::GetList(array(), array("=ID" => $photoIBlockTypeID));
    if ($arIBlockType = $dbIBlockType->Fetch()) {
        $photoIBlockTypeID = $arIBlockType["ID"];
    } else {
コード例 #4
0
ファイル: idea_blog.php プロジェクト: mrdeadmouse/u136006
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("blog") || !CModule::IncludeModule("idea")) {
    return;
}
$SocNetGroupID = false;
$IdeaBlogGroupName = "[" . WIZARD_SITE_ID . "] " . GetMessage("IDEA_DEMO_BLOG_GROUP_NAME");
$IdeaBlogUrl = "idea_" . WIZARD_SITE_ID;
$db_blog_group = CBlogGroup::GetList(array("ID" => "ASC"), array("SITE_ID" => WIZARD_SITE_ID, "NAME" => $IdeaBlogGroupName));
if ($res_blog_group = $db_blog_group->Fetch()) {
    $SocNetGroupID = $res_blog_group["ID"];
    /* if (WIZARD_INSTALL_DEMO_DATA)
    	 {
    		$db_blog = CBlog::GetList(array(), array("GROUP_ID" => $res_blog_group["ID"]), false, false, array("ID"));
    		if ($res_blog = $db_blog->Fetch())
    		{
    			do 
    			{
    				CBlog::Delete($res_blog["ID"]); 
    			} while ($res_blog = $db_blog->Fetch()); 
    		}
    		BXClearCache(True, "/".WIZARD_SITE_ID."/blog/");
    		BXClearCache(True, "/".WIZARD_SITE_ID."/idea/");
    	 } */
}
if (!$SocNetGroupID) {
    $SocNetGroupID = CBlogGroup::Add(array("SITE_ID" => WIZARD_SITE_ID, "NAME" => $IdeaBlogGroupName));
}
コード例 #5
0
ファイル: step1.php プロジェクト: webgksupport/alpina
 private function CheckBlogGroup()
 {
     $arFilter = array("SITE_ID" => $this->SITE_ID, "NAME" => $this->ModuleBlogGroup);
     if ($arBlogGroup = CBlogGroup::GetList(array(), $arFilter)->Fetch()) {
         $this->arResult["INSTALLATION"]["BLOG_GROUP_INSTALL"] = false;
         $this->arResult["INSTALLATION"]["BLOG_GROUP_ID"] = $arBlogGroup["ID"];
         $this->arResult["INSTALLATION"]["BLOG_GROUP_NAME"] = $this->ModuleBlogGroup;
     }
 }
コード例 #6
0
ファイル: .parameters.php プロジェクト: vim84/b-markt
                    if ($db_res && ($res = $db_res->GetNext())) {
                        do {
                            $arForum[intVal($res["ID"])] = $res["NAME"];
                            $fid = intVal($res["ID"]);
                        } while ($res = $db_res->GetNext());
                    }
                }
                $arComponentParameters["PARAMETERS"]["FILES_FORUM_ID"] = array("PARENT" => "WEBDAV_SETTINGS", "NAME" => GetMessage("SONET_FORUM_ID"), "TYPE" => "LIST", "VALUES" => $arForum, "DEFAULT" => $fid);
                $arComponentParameters["PARAMETERS"]["FILES_USE_CAPTCHA"] = array("PARENT" => "WEBDAV_SETTINGS", "NAME" => GetMessage("SONET_USE_CAPTCHA"), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "Y");
            }
        }
    }
}
if (CModule::IncludeModule("blog")) {
    $arBlogGroup = array();
    $dbBlogGr = CBlogGroup::GetList();
    while ($arBlogGr = $dbBlogGr->Fetch()) {
        $arBlogGroup[$arBlogGr["ID"]] = "(" . $arBlogGr["SITE_ID"] . ") " . $arBlogGr["NAME"];
    }
    $arComponentParameters["GROUPS"]["BLOG_SETTINGS"] = array("NAME" => GetMessage("SONET_BLOG_SETTINGS"));
    if (!empty($arBlogGroup)) {
        $arComponentParameters["PARAMETERS"]["BLOG_GROUP_ID"] = array("PARENT" => "BLOG_SETTINGS", "NAME" => GetMessage("SONET_BLOG_GROUP_ID"), "TYPE" => "LIST", "VALUES" => $arBlogGroup, "REFRESH" => "N", "MULTIPLE" => "N");
    }
    $arComponentParameters["PARAMETERS"]["ALLOW_POST_MOVE"] = array("NAME" => GetMessage("BPE_ALLOW_POST_MOVE"), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "VALUE" => "Y", "DEFAULT" => "N", "PARENT" => "BLOG_SETTINGS", "REFRESH" => "Y");
    $arComponentParameters["PARAMETERS"]["PATH_TO_USER_BLOG_POST"] = array("NAME" => GetMessage("BPE_PATH_TO_USER_POST"), "TYPE" => "STRING", "DEFAULT" => "", "PARENT" => "BLOG_SETTINGS");
    $arComponentParameters["PARAMETERS"]["PATH_TO_USER_BLOG_POST_EDIT"] = array("NAME" => GetMessage("BPE_PATH_TO_USER_POST_EDIT"), "TYPE" => "STRING", "DEFAULT" => "", "PARENT" => "BLOG_SETTINGS");
    if ($arCurrentValues["ALLOW_POST_MOVE"] == "Y") {
        $arComponentParameters["PARAMETERS"]["PATH_TO_BLOG_POST"] = array("NAME" => GetMessage("BPE_PATH_TO_BLOG_POST"), "TYPE" => "STRING", "DEFAULT" => "", "PARENT" => "BLOG_SETTINGS");
        $arComponentParameters["PARAMETERS"]["PATH_TO_BLOG_POST_EDIT"] = array("NAME" => GetMessage("BPE_PATH_TO_BLOG_POST_EDIT"), "TYPE" => "STRING", "DEFAULT" => "", "PARENT" => "BLOG_SETTINGS");
        $arComponentParameters["PARAMETERS"]["PATH_TO_BLOG_DRAFT"] = array("NAME" => GetMessage("BPE_PATH_TO_BLOG_DRAFT"), "TYPE" => "STRING", "DEFAULT" => "", "PARENT" => "BLOG_SETTINGS");
        $arComponentParameters["PARAMETERS"]["PATH_TO_BLOG_BLOG"] = array("NAME" => GetMessage("BPE_PATH_TO_BLOG_BLOG"), "TYPE" => "STRING", "DEFAULT" => "", "PARENT" => "BLOG_SETTINGS");
コード例 #7
0
ファイル: group.php プロジェクト: DarneoStudio/bitrix
                $arBlogGroupTmp = CBlogGroup::GetByID($ID);
                if (!CBlogGroup::Delete($ID)) {
                    $DB->Rollback();
                    if ($ex = $APPLICATION->GetException()) {
                        $lAdmin->AddGroupError($ex->GetString(), $ID);
                    } else {
                        $lAdmin->AddGroupError(GetMessage("BLG_DELETE_ERROR"), $ID);
                    }
                }
                BXClearCache(True, "/" . $arBlogGroupTmp["SITE_ID"] . "/blog/");
                $DB->Commit();
                break;
        }
    }
}
$dbResultList = CBlogGroup::GetList(array($by => $order), $arFilter, false, false, array("ID", "SITE_ID", "NAME"));
$dbResultList = new CAdminResult($dbResultList, $sTableID);
$dbResultList->NavStart();
$lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("BLG_GROUP_NAV")));
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "NAME", "content" => GetMessage("BLG_GROUP_NAME"), "sort" => "NAME", "default" => true), array("id" => "SITE_ID", "content" => GetMessage('BLG_GROUP_SITE_ID'), "sort" => "SITE_ID", "default" => true)));
$arVisibleColumns = $lAdmin->GetVisibleHeaderColumns();
$arSites = array();
$dbSitesList = CSite::GetList($b = "sort", $o = "asc");
while ($arSite = $dbSitesList->Fetch()) {
    $arSites[$arSite["LID"]] = "[" . $arSite["LID"] . "]&nbsp;" . $arSite["NAME"];
}
while ($arGroup = $dbResultList->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_ID, $arGroup);
    $row->AddField("ID", '<a href="/bitrix/admin/blog_group_edit.php?ID=' . $f_ID . '&lang=' . LANGUAGE_ID . '" title="' . GetMessage("BLG_UPDATE_ALT") . '">' . $f_ID . '</a>');
    $row->AddInputField("NAME", array("size" => "35"));
    $row->AddSelectField("SITE_ID", $arSites, array());
コード例 #8
0
ファイル: .parameters.php プロジェクト: rasuldev/torino
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("blog")) {
    return false;
}
$arGroupList = array();
$dbGroup = CBlogGroup::GetList(array("SITE_ID" => "ASC", "NAME" => "ASC"));
while ($arGroup = $dbGroup->Fetch()) {
    $arGroupList[$arGroup["ID"]] = "(" . $arGroup["SITE_ID"] . ") [" . $arGroup["ID"] . "] " . $arGroup["NAME"];
}
$arComponentParameters = array("GROUPS" => array("VARIABLE_ALIASES" => array("NAME" => GetMessage("B_VARIABLE_ALIASES"))), "PARAMETERS" => array("MESSAGE_COUNT" => array("NAME" => GetMessage("BMNP_MESSAGE_COUNT"), "TYPE" => "STRING", "DEFAULT" => 6, "PARENT" => "VISUAL"), "PERIOD_DAYS" => array("NAME" => GetMessage("BMNP_PERIOD_DAYS"), "TYPE" => "STRING", "DEFAULT" => 30, "PARENT" => "VISUAL"), "MESSAGE_LENGTH" => array("NAME" => GetMessage("BMNP_MESSAGE_LENGTH"), "TYPE" => "STRING", "DEFAULT" => 100, "PARENT" => "VISUAL"), "PREVIEW_WIDTH" => array("NAME" => GetMessage("BMNP_PREVIEW_WIDTH"), "TYPE" => "STRING", "DEFAULT" => 100, "PARENT" => "VISUAL"), "PREVIEW_HEIGHT" => array("NAME" => GetMessage("BMNP_PREVIEW_HEIGHT"), "TYPE" => "STRING", "DEFAULT" => 100, "PARENT" => "VISUAL"), "DATE_TIME_FORMAT" => CComponentUtil::GetDateTimeFormatField(GetMessage("BC_DATE_TIME_FORMAT"), "VISUAL"), "PATH_TO_BLOG" => array("NAME" => GetMessage("BMNP_PATH_TO_BLOG"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_POST" => array("NAME" => GetMessage("BMNP_PATH_TO_POST"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_USER" => array("NAME" => GetMessage("BMNP_PATH_TO_USER"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_GROUP_BLOG_POST" => array("NAME" => GetMessage("BMNP_PATH_TO_GROUP_BLOG_POST"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_SMILE" => array("NAME" => GetMessage("BMNP_PATH_TO_SMILE"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "ADDITIONAL_SETTINGS"), "BLOG_VAR" => array("NAME" => GetMessage("BMNP_BLOG_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "POST_VAR" => array("NAME" => GetMessage("BMNP_POST_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "USER_VAR" => array("NAME" => GetMessage("BMNP_USER_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "PAGE_VAR" => array("NAME" => GetMessage("BMNP_PAGE_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "CACHE_TIME" => array("DEFAULT" => "86400"), "GROUP_ID" => array("NAME" => GetMessage("BLG_GROUP_ID"), "TYPE" => "LIST", "VALUES" => $arGroupList, "MULTIPLE" => "N", "DEFAULT" => "", "ADDITIONAL_VALUES" => "Y", "PARENT" => "DATA_SOURCE"), "BLOG_URL" => array("NAME" => GetMessage("BLG_BLOG_URL"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "DATA_SOURCE")));
コード例 #9
0
ファイル: index.php プロジェクト: mrdeadmouse/u136006
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("blog")) {
    return;
}
$dbGroup = CBlogGroup::GetList(array("ID" => "ASC"), array("SITE_ID" => WIZARD_SITE_ID));
if ($arGroup = $dbGroup->Fetch()) {
    if (WIZARD_B24_TO_CP) {
        $groupID = $arGroup["ID"];
        CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index.php", array("BLOG_GROUP_ID" => $groupID));
        CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index_b24.php", array("BLOG_GROUP_ID" => $groupID));
        CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/contacts/personal.php", array("BLOG_GROUP_ID" => $groupID));
        CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/workgroups/index.php", array("BLOG_GROUP_ID" => $groupID));
    }
    return;
}
CBlogSitePath::Add(array("SITE_ID" => WIZARD_SITE_ID, "PATH" => WIZARD_SITE_DIR . "contacts/personal/user/#user_id#/blog/", "TYPE" => "B"));
CBlogSitePath::Add(array("SITE_ID" => WIZARD_SITE_ID, "PATH" => WIZARD_SITE_DIR . "contacts/personal/user/#user_id#/blog/#post_id#/", "TYPE" => "P"));
CBlogSitePath::Add(array("SITE_ID" => WIZARD_SITE_ID, "PATH" => WIZARD_SITE_DIR . "contacts/personal/user/#user_id#/", "TYPE" => "U"));
CBlogSitePath::Add(array("SITE_ID" => WIZARD_SITE_ID, "PATH" => WIZARD_SITE_DIR . "workgroups/group/#group_id#/blog/", "TYPE" => "G"));
CBlogSitePath::Add(array("SITE_ID" => WIZARD_SITE_ID, "PATH" => WIZARD_SITE_DIR . "workgroups/group/#group_id#/blog/#post_id#/", "TYPE" => "H"));
$groupID = CBlogGroup::Add(array("SITE_ID" => WIZARD_SITE_ID, "NAME" => GetMessage("BLOG_SOCNET_GROUP_EXTRANET_NAME")));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index.php", array("BLOG_GROUP_ID" => $groupID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index_b24.php", array("BLOG_GROUP_ID" => $groupID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/contacts/personal.php", array("BLOG_GROUP_ID" => $groupID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/workgroups/index.php", array("BLOG_GROUP_ID" => $groupID));
コード例 #10
0
ファイル: component.php プロジェクト: ASDAFF/entask.ru
				unset($blogIterator);
			}
			if ($blogGroupExist)
			{
				$blogGroupID = (int)$blog['GROUP_ID'];
				$blogID = (int)$blog['ID'];
			}
			else
			{
				if ($arParams['BLOG_FROM_AJAX'] === 'N')
				{
					$fields = array(
						'SITE_ID' => SITE_ID,
						'NAME' => GetMessage('IBLOCK_CSC_BLOG_GROUP_NAME')
					);
					$blogGroupIterator = CBlogGroup::GetList(array(), $fields, false, false, array('ID'));
					if ($blogGroup = $blogGroupIterator->Fetch())
					{
						$blogGroupID = (int)$blogGroup['ID'];
					}
					else
					{
						$blogGroupID = (int)CBlogGroup::Add($fields);
						if ($blogGroupID == 0)
						{
							if ($ex = $APPLICATION->GetException())
								$arResult["ERRORS"][] = $ex->GetString();
							else
								$arResult["ERRORS"][] = GetMessage("IBLOCK_CSC_BLOG_GROUP_CREATE_ERROR");
						}
					}
コード例 #11
0
ファイル: component.php プロジェクト: rasuldev/torino
             }
         }
     }
 }
 if ($arParams["SET_TITLE"] == "Y") {
     if (!empty($arBlog)) {
         $APPLICATION->SetTitle(str_replace("#BLOG#", $arBlog["NAME"], GetMessage('BLOG_TOP_TITLE')));
     } else {
         $APPLICATION->SetTitle(GetMessage('BLOG_NEW_BLOG'));
     }
 }
 $arFilterGroup = array("SITE_ID" => SITE_ID);
 if (!empty($arParams["GROUP_ID"])) {
     $arFilterGroup["ID"] = $arParams["GROUP_ID"];
 }
 $dbBlogGroup = CBlogGroup::GetList(array("NAME" => "ASC"), $arFilterGroup);
 $arBlogGroupTmp = array();
 while ($arBlogGroup = $dbBlogGroup->GetNext()) {
     if ($arBlogGroup["ID"] == $arResult["BLOG"]["GROUP_ID"]) {
         $arBlogGroup["SELECTED"] = "Y";
     }
     $arBlogGroupTmp[] = $arBlogGroup;
 }
 $arResult["GROUP"] = $arBlogGroupTmp;
 $arResult["AUTO_GROUPS"] = array();
 if (!empty($arBlog)) {
     $arResult["AUTO_GROUPS"] = unserialize($arBlog["AUTO_GROUPS"]);
 }
 if (!empty($arBlog)) {
     $res = CBlogUserGroup::GetList(array("NAME" => "ASC"), array("BLOG_ID" => $arBlog["ID"]), array("ID", "NAME", "BLOG_ID", "COUNT" => "USER2GROUP_ID"));
     while ($arGroup = $res->Fetch()) {
コード例 #12
0
ファイル: index.php プロジェクト: webgksupport/alpina
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
} elseif (!CModule::IncludeModule("blog")) {
    return;
}
$SocNetGroupID = false;
$db_blog_group = CBlogGroup::GetList(array("ID" => "ASC"), array("SITE_ID" => WIZARD_SITE_ID, "NAME" => "[" . WIZARD_SITE_ID . "] " . GetMessage("BLOG_DEMO_GROUP_SOCNET")));
if ($res_blog_group = $db_blog_group->Fetch()) {
    $SocNetGroupID = $res_blog_group["ID"];
    if (WIZARD_INSTALL_DEMO_DATA) {
        $db_blog = CBlog::GetList(array(), array("GROUP_ID" => $res_blog_group["ID"]), false, false, array("ID"));
        if ($res_blog = $db_blog->Fetch()) {
            do {
                CBlog::Delete($res_blog["ID"]);
            } while ($res_blog = $db_blog->Fetch());
        }
        if (CModule::IncludeModule("socialnetwork")) {
            $db_log = CSocNetLog::GetList(array("ID" => "DESC"), array("SITE_ID" => WIZARD_SITE_ID, "EVENT_ID" => array("blog", "blog_post", "blog_comment")), false, false, array("ID"));
            while ($arLog = $db_log->Fetch()) {
                CSocNetLog::Delete($arLog["ID"]);
            }
        }
        BXClearCache(True, "/" . WIZARD_SITE_ID . "/blog/");
    } else {
        CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/_index.php", array("BLOG_GROUP_ID" => $SocNetGroupID));
        CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/index.php", array("BLOG_GROUP_ID" => $SocNetGroupID));
        CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/people/user.php", array("BLOG_GROUP_ID" => $SocNetGroupID));
        CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/groups/group.php", array("BLOG_GROUP_ID" => $SocNetGroupID));
        CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/blogs/index.php", array("BLOG_GROUP_ID" => $SocNetGroupID));
コード例 #13
0
ファイル: index.php プロジェクト: Satariall/izurit
            } while ($res_blog = $db_blog->Fetch());
        }
        $SocNetGroupID = $res_blog_group["ID"];
    } else {
        if ($arBlog = CBlog::GetByUrl("admin-blog-" . WIZARD_SITE_ID)) {
            CWizardUtil::ReplaceMacros($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . WIZARD_TEMPLATE_ID . "_" . WIZARD_THEME_ID . "/footer.php", array("BLOG_URL" => $arBlog["URL"]));
            CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/_index.php", array("BLOG_URL" => $arBlog["URL"], "SEF_FOLDER" => WIZARD_SITE_DIR));
        }
        if ($arUtilBlog = CBlog::GetByUrl("util-photo-blog-" . WIZARD_SITE_ID)) {
            CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/photo.php", array("PHOTO_BLOG_URL" => $arUtilBlog["URL"]));
        }
        return;
    }
}
$utilGroupID = false;
$db_blog_group = CBlogGroup::GetList(array("ID" => "ASC"), array("SITE_ID" => WIZARD_SITE_ID, "NAME" => GetMessage("BLOG_DEMO_GROUP_UTIL") . " (" . WIZARD_SITE_ID . ")"));
if ($res_blog_group = $db_blog_group->Fetch()) {
    if (WIZARD_INSTALL_DEMO_DATA) {
        $db_blog = CBlog::GetList(array(), array("GROUP_ID" => $res_blog_group["ID"]), false, false, array("ID"));
        if ($res_blog = $db_blog->Fetch()) {
            do {
                CBlog::Delete($res_blog["ID"]);
            } while ($res_blog = $db_blog->Fetch());
        }
        $utilGroupID = $res_blog_group["ID"];
    } else {
        return;
    }
}
COption::SetOptionString('blog', 'avatar_max_size', '30000');
COption::SetOptionString('blog', 'avatar_max_width', '100');
コード例 #14
0
ファイル: component.php プロジェクト: Satariall/izurit
     $obCache->StartDataCache();
     $dbBl = CBlog::GetList(array(), $arFilterblg);
     $arBlog = $dbBl->Fetch();
     if (!$arBlog && IsModuleInstalled("intranet")) {
         $arIdeaBlogGroupID = array();
         if (IsModuleInstalled("idea")) {
             $rsSite = CSite::GetList($by = "sort", $order = "desc", array("ACTIVE" => "Y"));
             while ($arSite = $rsSite->Fetch()) {
                 $arIdeaBlogGroupID[] = COption::GetOptionInt("idea", "blog_group_id", false, $arSite["LID"]);
             }
         }
         if (empty($arIdeaBlogGroupID)) {
             $arBlog = CBlog::GetByOwnerID($arParams["USER_ID"]);
         } else {
             $arBlogGroupID = array();
             $rsBlogGroup = CBlogGroup::GetList(array(), array(), false, false, array("ID"));
             while ($arBlogGroup = $rsBlogGroup->Fetch()) {
                 if (!in_array($arBlogGroup["ID"], $arIdeaBlogGroupID)) {
                     $arBlogGroupID[] = $arBlogGroup["ID"];
                 }
             }
             $arBlog = CBlog::GetByOwnerID($arParams["USER_ID"], $arBlogGroupID);
         }
     }
     $obCache->EndDataCache($arBlog);
 }
 $arResult["Blog"] = $arBlog;
 if ($GLOBALS["USER"]->IsAuthorized()) {
     CSocNetTools::InitGlobalExtranetArrays();
     if (isset($GLOBALS["arExtranetGroupID"])) {
         $arResult["arExtranetGroupID"] = $GLOBALS["arExtranetGroupID"];
コード例 #15
0
								</td>
							</tr>
							<tr valign=top>
								<td nowrap valign="top" align="right" class="blogtablehead">
									<font class="blogheadtext">
									<font color="#FF0000">*</font> <b><?php 
                    echo GetMessage('BLOG_GRP');
                    ?>
</b>
									</font>
								</td>
								<td class="blogtablebody">
									<select name="GROUP_ID" class="inputselect">
										<?php 
                    $val = IntVal($bVarsFromForm ? $_POST['GROUP_ID'] : ($arBlog ? $arBlog["GROUP_ID"] : 0));
                    $dbBlogGroup = CBlogGroup::GetList(array("NAME" => "ASC"), array("SITE_ID" => SITE_ID));
                    while ($arBlogGroup = $dbBlogGroup->Fetch()) {
                        ?>
<option value="<?php 
                        echo $arBlogGroup["ID"];
                        ?>
"<?php 
                        if ($val == IntVal($arBlogGroup["ID"])) {
                            echo " selected";
                        }
                        ?>
><?php 
                        echo htmlspecialchars($arBlogGroup["NAME"]);
                        ?>
</option><?php 
                    }
コード例 #16
0
ファイル: component.php プロジェクト: Satariall/izurit
 if ($arParams["CACHE_TIME"] > 0) {
     $cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path);
 }
 $SORT = array($arParams["SORT_BY1"] => $arParams["SORT_ORDER1"], $arParams["SORT_BY2"] => $arParams["SORT_ORDER2"]);
 $arFilter = array("SITE_ID" => SITE_ID);
 if (!empty($arParams["GROUP_ID"])) {
     $arFilter["ID"] = $arParams["GROUP_ID"];
 }
 $arSelectFields = false;
 //	if($arParams["GROUPS_COUNT"]>0)
 //		$COUNT = Array("nTopCount" => $arParams["GROUPS_COUNT"]*2);
 //	else
 $COUNT = false;
 $arResult["GROUPS"] = array();
 $arResult["GROUPS_TABLE"] = array();
 $dbGroups = CBlogGroup::GetList($SORT, $arFilter, false, $COUNT, $arSelectFields);
 $itemCnt = 0;
 while ($arGroups = $dbGroups->Fetch()) {
     $dbBlog = CBlog::GetList(array(), array("GROUP_ID" => $arGroups["ID"]), false, false, array("ID", "GROUP_ID"));
     if ($arBlog = $dbBlog->Fetch()) {
         $url = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arGroups["ID"]));
         $arResult["GROUPS"][] = array("ID" => $arGroups["ID"], "NAME" => htmlspecialcharsex($arGroups["NAME"]), "URL" => $url);
         $itemCnt++;
         if ($itemCnt >= $arParams["GROUPS_COUNT"] && $arParams["GROUPS_COUNT"] > 0) {
             break;
         }
     }
 }
 $cnt = count($arResult["GROUPS"]);
 $row1 = ceil($cnt / $arParams["COLS_COUNT"]);
 $all = $cnt - $row1;
コード例 #17
0
ファイル: component.php プロジェクト: spas-viktor/books
    return false;
}
$arResult["ELEMENT"]["PROPERTIES"] = array();
foreach ($arResult["ELEMENT"] as $key => $val) {
    if (substr($key, 0, 9) == "PROPERTY_" && substr($key, -6, 6) == "_VALUE") {
        $arResult["ELEMENT"]["PROPERTIES"][substr($key, 9, intVal(strLen($key) - 15))] = array("VALUE" => $val);
    }
}
if (isset($arParams["BLOG_URL"]) && trim($arParams["BLOG_URL"]) != "") {
    $arResult["BLOG_URL"] = $arParams["BLOG_URL"];
} else {
    $arResult["BLOG_URL"] = "catalog_comments";
}
$SITE_ID = defined("SITE_ID") && strLen(SITE_ID) > 0 ? SITE_ID : "s1";
$arFields = array("SITE_ID" => $SITE_ID, "NAME" => GetMessage("IBLOCK_CSC_BLOG_GROUP_NAME"));
$dbBlogGroup = CBlogGroup::GetList(array(), $arFields, false, false, array("ID"));
if ($arBlogGroup = $dbBlogGroup->Fetch()) {
    $blogGroupID = $arBlogGroup["ID"];
} else {
    $blogGroupID = CBlogGroup::Add($arFields);
}
$blogGroupID = intval($blogGroupID);
if ($blogGroupID > 0) {
    $dbBlog = CBlog::GetList(array(), array("URL" => $arResult["BLOG_URL"]), false, false, array("ID"));
    if ($arBlog = $dbBlog->Fetch()) {
        $blogId = $arBlog["ID"];
    } else {
        $arFields = array("NAME" => GetMessage("IBLOCK_CSC_BLOG_NAME"), "DESCRIPTION" => GetMessage("IBLOCK_CSC_BLOG_DESCRIPTION"), "GROUP_ID" => $blogGroupID, "ENABLE_COMMENTS" => 'Y', "ENABLE_IMG_VERIF" => 'Y', "EMAIL_NOTIFY" => isset($arParams["EMAIL_NOTIFY"]) && $arParams["EMAIL_NOTIFY"] == 'Y' ? 'Y' : 'N', "URL" => $arResult["BLOG_URL"], "ACTIVE" => "Y", "OWNER_ID" => 1, "AUTO_GROUPS" => "N");
        $blogId = CBlog::Add($arFields);
        if (IntVal($blogId) > 0) {
            CBlog::SetBlogPerms($blogId, array("1" => BLOG_PERMS_WRITE, "2" => BLOG_PERMS_WRITE), BLOG_PERMS_COMMENT);
コード例 #18
0
ファイル: index.php プロジェクト: mrdeadmouse/u136006
 if (StrLen($errorMessage) <= 0) {
     foreach ($arGroupsId as $ind => $val) {
         CSocNetUserToGroup::Add(array("USER_ID" => 1, "GROUP_ID" => $val, "ROLE" => "A", "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "INITIATED_BY_TYPE" => SONET_INITIATED_BY_USER, "INITIATED_BY_USER_ID" => 1, "MESSAGE" => false));
     }
 }
 if (StrLen($errorMessage) <= 0) {
     // set EUV vor news
     $dbResult = CSocNetEventUserView::GetList(array("ENTITY_ID" => "ASC"), array("ENTITY_TYPE" => "N"));
     $arResult = $dbResult->Fetch();
     if (!$arResult) {
         CSocNetEventUserView::Add(array("ENTITY_TYPE" => "N", "ENTITY_ID" => 0, "EVENT_ID" => "news", "USER_ID" => 0, "USER_ANONYMOUS" => "N"));
         CSocNetEventUserView::Add(array("ENTITY_TYPE" => "N", "ENTITY_ID" => 0, "EVENT_ID" => "news_comment", "USER_ID" => 0, "USER_ANONYMOUS" => "N"));
     }
     $blogGroupID = 0;
     if (CModule::IncludeModule("blog")) {
         $dbRes = CBlogGroup::GetList(array("ID" => "DESC"), array("SITE_ID" => WIZARD_SITE_ID));
         if ($arRes = $dbRes->Fetch()) {
             $blogGroupID = $arRes["ID"];
         }
     }
     $forumID = 0;
     $photoForumID = 0;
     if (CModule::IncludeModule("forum")) {
         $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "USERS_AND_GROUPS"));
         if ($arRes = $dbRes->Fetch()) {
             $forumID = $arRes["ID"];
         }
         $dbRes = CForumNew::GetListEx(array(), array("XML_ID" => "PHOTOGALLERY_COMMENTS"));
         if ($arRes = $dbRes->Fetch()) {
             $photoForumID = $arRes["ID"];
         }
コード例 #19
0
ファイル: index.php プロジェクト: Satariall/izurit
if (!CModule::IncludeModule('blog')) {
    return;
}
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", "/" . basename(__FILE__)));
$siteID = $arParams["site_id"];
if (strlen($arParams["site_id"]) <= 0) {
    $siteID = "s1";
}
$dbSite = CSite::GetByID($siteID);
if ($arSite = $dbSite->Fetch()) {
    $LID = $arSite["LANGUAGE_ID"];
}
if (strlen($LID) <= 0) {
    $LID = "ru";
}
$dbGroup = CBlogGroup::GetList(array("ID" => "ASC"));
if (!$dbGroup->Fetch()) {
    COption::SetOptionString('blog', 'avatar_max_size', '30000');
    COption::SetOptionString('blog', 'avatar_max_width', '50');
    COption::SetOptionString('blog', 'avatar_max_height', '50');
    COption::SetOptionString('blog', 'image_max_width', '600');
    COption::SetOptionString('blog', 'image_max_height', '600');
    COption::SetOptionString('blog', 'allow_alias', 'Y');
    COption::SetOptionString('blog', 'block_url_change', 'Y');
    COption::SetOptionString('blog', 'GROUP_DEFAULT_RIGHT', 'D');
    COption::SetOptionString('blog', 'show_ip', 'Y');
    COption::SetOptionString('blog', 'enable_trackback', 'N');
    COption::SetOptionString('blog', 'allow_html', 'Y');
    COption::SetOptionString('blog', 'parser_nofollow', 'Y');
    if (IsModuleInstalled("socialnetwork")) {
        $SocNetGroupID = CBlogGroup::Add(array("SITE_ID" => $siteID, "NAME" => GetMessage("BLOG_DEMO_GROUP_SOCNET")));