• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CBlogImage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CBlogImage的典型用法代码示例。如果您正苦于以下问题:PHP CBlogImage类的具体用法?PHP CBlogImage怎么用?PHP CBlogImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CBlogImage类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: Update

 function Update($ID, $arFields)
 {
     global $DB;
     $ID = IntVal($ID);
     $arFields1 = array();
     foreach ($arFields as $key => $value) {
         if (substr($key, 0, 1) == "=") {
             $arFields1[substr($key, 1)] = $value;
             unset($arFields[$key]);
         }
     }
     if (!CBlogImage::CheckFields("UPDATE", $arFields, $ID)) {
         return false;
     }
     $strUpdate = $DB->PrepareUpdate("b_blog_image", $arFields);
     foreach ($arFields1 as $key => $value) {
         if (strlen($strUpdate) > 0) {
             $strUpdate .= ", ";
         }
         $strUpdate .= $key . "=" . $value . " ";
     }
     if (strlen($strUpdate) > 0) {
         $strSql = "UPDATE b_blog_image SET " . "\t" . $strUpdate . " " . "WHERE ID = " . $ID . " ";
         $DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         unset($GLOBALS["BLOG_IMAGE"]["BLOG_IMAGE_CACHE_" . $ID]);
         return $ID;
     }
     return False;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:29,代码来源:blog_image.php


示例2: array_merge

         $arResult["title"]["category"] = CBlogTools::htmlspecialcharsExArray($arCat);
     }
 }
 $arResult["filter"] = $arFilter;
 $dbPost = CBlogPost::GetList($SORT, array_merge($arParams["EXT_FILTER"], $arFilter), false, array("bDescPageNumbering" => true, "nPageSize" => $arParams["MESSAGE_COUNT"], "bShowAll" => false), array("ID", "TITLE", "BLOG_ID", "AUTHOR_ID", "PREVIEW_TEXT", "PREVIEW_TEXT_TYPE", "DETAIL_TEXT", "DETAIL_TEXT_TYPE", "DATE_CREATE", "DATE_PUBLISH", "KEYWORDS", "PUBLISH_STATUS", "ATRIBUTE", "ATTACH_IMG", "ENABLE_TRACKBACK", "ENABLE_COMMENTS", "VIEWS", "NUM_COMMENTS", "CODE", "MICRO", "CATEGORY_ID"));
 $arResult["NAV_STRING"] = $dbPost->GetPageNavStringEx($navComponentObject, GetMessage("MESSAGE_COUNT"), $arParams["NAV_TEMPLATE"], false, $this->__component->__parent ? $this->__component->__parent : $this->__component);
 $arResult["NAV_CACHED_DATA"] = $navComponentObject->GetTemplateCachedData();
 $arResult["POST"] = array();
 $arResult["IDS"] = array();
 $p = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
 $arParserParams = array("imageWidth" => $arParams["IMAGE_MAX_WIDTH"], "imageHeight" => $arParams["IMAGE_MAX_HEIGHT"]);
 while ($CurPost = $dbPost->GetNext()) {
     $CurPost["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $arBlog["URL"], "post_id" => CBlogPost::GetPostID($CurPost["ID"], $CurPost["CODE"], $arParams["ALLOW_POST_CODE"])));
     $CurPost["urlToAuthor"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $CurPost["AUTHOR_ID"]));
     $arImages = array();
     $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $CurPost['ID'], "BLOG_ID" => $arBlog['ID']));
     while ($arImage = $res->Fetch()) {
         $arImages[$arImage['ID']] = $arImage['FILE_ID'];
     }
     if ($CurPost["DETAIL_TEXT_TYPE"] == "html" && COption::GetOptionString("blog", "allow_html", "N") == "Y") {
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "IMG" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "QUOTE" => "Y", "CODE" => "Y");
         if (COption::GetOptionString("blog", "allow_video", "Y") != "Y") {
             $arAllow["VIDEO"] = "N";
         }
         $CurPost["TEXT_FORMATED"] = $p->convert($CurPost["~DETAIL_TEXT"], true, $arImages, $arAllow, $arParserParams);
     } else {
         $arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y");
         if (COption::GetOptionString("blog", "allow_video", "Y") != "Y") {
             $arAllow["VIDEO"] = "N";
         }
         $CurPost["TEXT_FORMATED"] = $p->convert($CurPost["~DETAIL_TEXT"], true, $arImages, $arAllow, $arParserParams);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


示例3: array

         $arTmp["FIRST"] = "Y";
     }
     if (!in_array($arPost["AUTHOR_ID"], $arUsrTmp)) {
         $arUsrTmp[] = $arPost["AUTHOR_ID"];
     }
     $arUsrTmpPostId[$arPost["AUTHOR_ID"]][] = $arPost["ID"];
     if (strlen($arPost["BLOG_USER_ALIAS"]) > 0) {
         $arUsrTmpAlias[$arPost["AUTHOR_ID"]] = $arPost["BLOG_USER_ALIAS"];
     }
     $itemCnt++;
     $arResult[$arTmp["ID"]] = $arTmp;
     $ids[] = $arTmp["ID"];
 }
 $arResult["IDS"] = $ids;
 if (!empty($arImgPosts)) {
     $dbImage = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arImgPosts, "IS_COMMENT" => "N"));
     while ($arImage = $dbImage->Fetch()) {
         if (empty($arResult[$arImage["POST_ID"]]["IMG"])) {
             if ($file = CFile::ResizeImageGet($arImage["FILE_ID"], array("width" => $arParams["PREVIEW_WIDTH"], "height" => $arParams["PREVIEW_HEIGHT"]))) {
                 $arResult[$arImage["POST_ID"]]["IMG"] = CFile::ShowImage($file["src"], false, false, 'align="left" hspace="2" vspace="2"');
             }
         }
     }
 }
 if (!empty($arUsrTmp)) {
     $dbUser = CUser::GetList($b = "ID", $o = "DESC", array("ID" => implode(' | ', $arUsrTmp)), array("FIELDS" => array("ID", "LOGIN", "NAME", "LAST_NAME", "SECOND_NAME", "PERSONAL_PHOTO")));
     while ($arUser = $dbUser->GetNext()) {
         $urlToAuthor = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUser["ID"]));
         $AuthorName = CBlogUser::GetUserName($arUsrTmpAlias[$arUser["ID"]], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"], $arUser["SECOND_NAME"]);
         foreach ($arUsrTmpPostId[$arUser["ID"]] as $postId) {
             $arResult[$postId]["arUser"] = $arUser;
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php


示例4: array

     $arResult["userCache"] = CBlogUser::GetUserInfoArray($arIdToGet, $arParams["PATH_TO_USER"], array("AVATAR_SIZE" => isset($arParams["AVATAR_SIZE_COMMON"]) ? $arParams["AVATAR_SIZE_COMMON"] : $arParams["AVATAR_SIZE"], "AVATAR_SIZE_COMMENT" => $arParams["AVATAR_SIZE_COMMENT"]));
     foreach ($arResult["userCache"] as $userId => $arUserCache) {
         $arTmpUser = array("NAME" => $arUserCache["~NAME"], "LAST_NAME" => $arUserCache["~LAST_NAME"], "SECOND_NAME" => $arUserCache["~SECOND_NAME"], "LOGIN" => $arUserCache["~LOGIN"], "NAME_LIST_FORMATTED" => "");
         $arResult["userCache"][$userId]["NAME_FORMATED"] = CUser::FormatName($arParams["NAME_TEMPLATE"], $arTmpUser, $arParams["SHOW_LOGIN"] != "N" ? true : false);
     }
 }
 $i = 0;
 if (!empty($arCommentsAll[$i])) {
     $arComment = $arCommentsAll[$i];
     $p = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
     $p->LAZYLOAD = isset($arParams["LAZYLOAD"]) && $arParams["LAZYLOAD"] == "Y" ? "Y" : "N";
     $p->bMobile = isset($arParams["MOBILE"]) && $arParams["MOBILE"] == "Y";
     $arParserParams = array("imageWidth" => $arParams["IMAGE_MAX_WIDTH"], "imageHeight" => $arParams["IMAGE_MAX_HEIGHT"], "pathToUser" => $arParams["PATH_TO_USER"]);
     $bHasImg = false;
     if ($arPost["HAS_COMMENT_IMAGES"] != "N") {
         $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost['ID'], "BLOG_ID" => $arPost['BLOG_ID'], "IS_COMMENT" => "Y"), false, false, array("ID", "FILE_ID", "POST_ID", "BLOG_ID", "USER_ID", "TITLE", "COMMENT_ID", "IS_COMMENT"));
         while ($aImg = $res->Fetch()) {
             $bHasImg = true;
             $arImages[$aImg['ID']] = $aImg['FILE_ID'];
             if ($arResult["allowImageUpload"]) {
                 $aImgNew = CFile::ResizeImageGet($aImg["FILE_ID"], array("width" => 90, "height" => 90), BX_RESIZE_IMAGE_EXACT, true);
                 $aImgNew["source"] = CFile::ResizeImageGet($aImg["FILE_ID"], array("width" => $arParams["IMAGE_MAX_WIDTH"], "height" => $arParams["IMAGE_MAX_HEIGHT"]), BX_RESIZE_IMAGE_EXACT, true);
                 $aImgNew["ID"] = $aImg["ID"];
                 $aImgNew["fileName"] = substr($aImgNew["src"], strrpos($aImgNew["src"], "/") + 1);
                 $arResult["Images"][$aImg['ID']] = $aImgNew;
             }
             $arResult["arImages"][$aImg["COMMENT_ID"]][$aImg['ID']] = array("small" => "/bitrix/components/bitrix/blog/show_file.php?fid=" . $aImg['ID'] . "&width=" . $arParams["ATTACHED_IMAGE_MAX_WIDTH_SMALL"] . "&height=" . $arParams["ATTACHED_IMAGE_MAX_HEIGHT_SMALL"] . "&type=square");
             $arResult["arImages"][$aImg["COMMENT_ID"]][$aImg['ID']]["full"] = $arParams["MOBILE"] == "Y" ? SITE_DIR . "mobile/log/blog_image.php?bfid=" . $aImg['ID'] . "&fid=" . $aImg['FILE_ID'] . "&width=" . $arParams["ATTACHED_IMAGE_MAX_WIDTH_FULL"] . "&height=" . $arParams["ATTACHED_IMAGE_MAX_HEIGHT_FULL"] : "/bitrix/components/bitrix/blog/show_file.php?fid=" . $aImg['ID'] . "&width=" . $arParams["ATTACHED_IMAGE_MAX_WIDTH_FULL"] . "&height=" . $arParams["ATTACHED_IMAGE_MAX_HEIGHT_FULL"];
         }
     }
     $arFieldsHave = array();
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php


示例5: intval

             }
         }
         echo CUtil::PhpToJsObject(array('SUCCESS' => 'Y', "FILE_ID" => $file_id));
     }
 }
 if (isset($_REQUEST["post_id"]) && intval($_REQUEST["post_id"]) > 0) {
     // Blog Images
     $varKey = "MFU_UPLOADED_IMAGES_" . $GLOBALS["USER"]->GetId() . "_" . intval($_REQUEST["post_id"]);
     if (in_array($file_id, $_SESSION[$varKey])) {
         $rsFile = CFile::GetByID($file_id);
         if ($arFile = $rsFile->Fetch()) {
             $bFileFound = true;
             if (CModule::IncludeModule('blog')) {
                 $rsBlogImage = CBlogImage::GetList(array(), array("FILE_ID" => $file_id));
                 if ($arBlogImage = $rsBlogImage->Fetch()) {
                     CBlogImage::Delete($arBlogImage["ID"]);
                     BXClearCache(true, "/blog/socnet_post/" . intval($_REQUEST["post_id"]) . "/");
                     BXClearCache(true, "/blog/socnet_post/gen/" . intval($_REQUEST["post_id"]) . "/");
                 }
             }
             CFile::Delete($file_id);
             foreach ($_SESSION[$varKey] as $key => $session_file_id) {
                 if ($session_file_id == $file_id) {
                     unset($_SESSION[$varKey][$key]);
                     break;
                 }
             }
             echo CUtil::PhpToJsObject(array('SUCCESS' => 'Y', "FILE_ID" => $file_id));
         }
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php


示例6: BuildRSSAll


//.........这里部分代码省略.........
     $parser = new blogTextParser();
     $arParserParams = array("imageWidth" => $arPathTemplates["IMAGE_MAX_WIDTH"], "imageHeight" => $arPathTemplates["IMAGE_MAX_HEIGHT"]);
     $arFilter = array("<=DATE_PUBLISH" => ConvertTimeStamp(false, "FULL", false), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "BLOG_ENABLE_RSS" => "Y", "MICRO" => "N");
     $arSelFields = array("ID", "TITLE", "DETAIL_TEXT", "DATE_PUBLISH", "AUTHOR_ID", "BLOG_USER_ALIAS", "BLOG_ID", "DETAIL_TEXT_TYPE", "BLOG_URL", "BLOG_OWNER_ID", "BLOG_SOCNET_GROUP_ID", "BLOG_GROUP_SITE_ID", "CODE", "PATH");
     if (!empty($arGroup)) {
         $arFilter["BLOG_GROUP_ID"] = $arGroup["ID"];
     } elseif (count($arGroupID) > 0) {
         $arFilter["BLOG_GROUP_ID"] = $arGroupID;
     }
     if (count($arAvBlog) > 0) {
         $arFilter["BLOG_ID"] = $arAvBlog;
     }
     if ($siteID !== false) {
         $arFilter["BLOG_GROUP_SITE_ID"] = $siteID;
     }
     if ($bUserSocNet == "Y") {
         $arFilter["BLOG_USE_SOCNET"] = "Y";
         $arFilter["FOR_USER"] = $user_id;
         unset($arFilter["MICRO"]);
     }
     CTimeZone::Disable();
     $dbPosts = CBlogPost::GetList(array("DATE_PUBLISH" => "DESC"), $arFilter, false, array("nTopCount" => $numPosts), $arSelFields);
     CTimeZone::Enable();
     while ($arPost = $dbPosts->Fetch()) {
         $perms = CBlogPost::GetBlogUserPostPerms($arPost["ID"], $GLOBALS["USER"]->IsAuthorized() ? $GLOBALS["USER"]->GetID() : 0);
         if ($perms < BLOG_PERMS_READ) {
             continue;
         }
         $dbUser = CUser::GetByID($arPost["AUTHOR_ID"]);
         $arUser = $dbUser->Fetch();
         $author = CBlogUser::GetUserName($arPost["BLOG_USER_ALIAS"], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"], $arUser["SECOND_NAME"]);
         $title = str_replace(array("&", "<", ">", "\""), array("&amp;", "&lt;", "&gt;", "&quot;"), $author . ": " . $arPost["TITLE"]);
         $arImages = array();
         $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arPost["BLOG_ID"], "IS_COMMENT" => "N"));
         while ($arImage = $res->Fetch()) {
             $arImages[$arImage['ID']] = $arImage['FILE_ID'];
         }
         $arDate = ParseDateTime($arPost["DATE_PUBLISH"], CSite::GetDateFormat("FULL", $arPost["BLOG_GROUP_SITE_ID"]));
         $date = date("r", mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]));
         if (strlen($arPost["PATH"]) > 0) {
             $url = htmlspecialcharsbx("http://" . $serverName . str_replace("#post_id#", CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), $arPost["PATH"]));
         } elseif (!empty($arPathTemplates)) {
             if (IntVal($arPost["BLOG_SOCNET_GROUP_ID"]) > 0 && strlen($arPathTemplates["GROUP_BLOG_POST"]) > 0) {
                 $url = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($arPathTemplates["GROUP_BLOG_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arPathTemplates["ALLOW_POST_CODE"]), "user_id" => $arPost["BLOG_OWNER_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
             } else {
                 $url = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($arPathTemplates["BLOG_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arPathTemplates["ALLOW_POST_CODE"]), "user_id" => $arPost["BLOG_OWNER_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
             }
         } elseif (strLen($postTemplate) > 0) {
             $url = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($postTemplate, array("blog" => $arPost["BLOG_URL"], "post_id" => $arPost["ID"], "user_id" => $arPost["BLOG_OWNER_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } else {
             $url = htmlspecialcharsbx("http://" . $serverName . CBlogPost::PreparePath(htmlspecialcharsbx($arPost["BLOG_URL"]), $arPost["ID"], $arPost["BLOG_GROUP_SITE_ID"]));
         }
         $category = htmlspecialcharsbx($arPost["CATEGORY_NAME"]);
         if (strlen($arPathTemplates["USER"]) > 0) {
             $authorURL = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($arPathTemplates["USER"], array("user_id" => $arPost["AUTHOR_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } elseif (strLen($userTemplate) > 0) {
             $authorURL = htmlspecialcharsbx("http://" . $serverName . CComponentEngine::MakePathFromTemplate($userTemplate, array("user_id" => $arPost["AUTHOR_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } else {
             $authorURL = htmlspecialcharsbx("http://" . $serverName . CBlogUser::PreparePath($arPost["AUTHOR_ID"], $arPost["BLOG_GROUP_SITE_ID"]));
         }
         if ($arPost["DETAIL_TEXT_TYPE"] == "html") {
             $text = $parser->convert_to_rss($arPost["DETAIL_TEXT"], $arImages, array("HTML" => "Y", "ANCHOR" => "Y", "IMG" => "Y", "SMILES" => "Y", "NL2BR" => "N", "QUOTE" => "Y", "CODE" => "Y"), true, $arParserParams);
         } else {
             $text = $parser->convert_to_rss($arPost["DETAIL_TEXT"], $arImages, false, true, $arParserParams);
         }
         if ($bUserSocNet != "Y") {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:67,代码来源:blog.php


示例7: array

     }
 }
 if ($perms != BLOG_PERMS_DENY) {
     $SORT = array($arParams["SORT_BY1"] => $arParams["SORT_ORDER1"], $arParams["SORT_BY2"] => $arParams["SORT_ORDER2"]);
     if ($arParams["MESSAGE_COUNT"] > 0) {
         $COUNT = array("nTopCount" => $arParams["MESSAGE_COUNT"]);
     } else {
         $COUNT = false;
     }
     $ids = array();
     $dbPosts = CBlogPost::GetList($SORT, $arFilter, false, $COUNT, $arSelectedFields);
     $p = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
     $itemCnt = 0;
     while ($arPost = $dbPosts->GetNext()) {
         if (IntVal($arPost["ATTACH_IMG"]) <= 0) {
             $dbImage = CBlogImage::GetList(array("ID" => "ASC"), array("BLOG_ID" => $arPost["BLOG_ID"], "POST_ID" => $arPost["ID"], "IS_COMMENT" => "N"));
             if ($arImage = $dbImage->Fetch()) {
                 if ($file = CFile::ResizeImageGet($arImage["FILE_ID"], array("width" => $arParams["PREVIEW_WIDTH"], "height" => $arParams["PREVIEW_HEIGHT"]))) {
                     $arPost["IMG"] = CFile::ShowImage($file["src"], false, false, 'align="left" hspace="2" vspace="2"');
                 }
             }
         } else {
             $arPost["IMG"] = CFile::ShowImage($arPost["ATTACH_IMG"], false, false, 'align="left" hspace="2" vspace="2"');
         }
         $arTmp = $arPost;
         if ($arTmp["AUTHOR_ID"] == $arTmp["BLOG_OWNER_ID"]) {
             $arTmp["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arPost["BLOG_URL"], "user_id" => $arPost["AUTHOR_ID"]));
         } else {
             if ($arParams["USE_SOCNET"] == "Y" && IntVal($arParams["SOCNET_GROUP_ID"]) > 0) {
                 $arTmp["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arPost["AUTHOR_ID"]));
             } else {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


示例8: htmlspecialcharsEx

                     $arPostField["EDIT_FORM_LABEL"] = htmlspecialcharsEx($arPostField["EDIT_FORM_LABEL"]);
                     $arPostField["~EDIT_FORM_LABEL"] = $arPostField["EDIT_FORM_LABEL"];
                     $arResult["POST_PROPERTIES"]["DATA"][$FIELD_NAME] = $arPostField;
                     if (!empty($arPostField["VALUE"])) {
                         $bHasProps = true;
                     }
                 }
             }
         }
         if (!empty($arResult["POST_PROPERTIES"]["DATA"])) {
             $arResult["POST_PROPERTIES"]["SHOW"] = "Y";
         }
     }
 }
 if ($arPost["HAS_IMAGES"] != "N") {
     $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost['ID'], "IS_COMMENT" => "N"));
     while ($arImage = $res->Fetch()) {
         $bHasImg = true;
         $arImages[$arImage['ID']] = $arImage['FILE_ID'];
         $arResult["images"][$arImage['ID']] = array("small" => "/bitrix/components/bitrix/blog/show_file.php?fid=" . $arImage['ID'] . "&width=" . $arParams["ATTACHED_IMAGE_MAX_WIDTH_SMALL"] . "&height=" . $arParams["ATTACHED_IMAGE_MAX_HEIGHT_SMALL"] . "&type=square");
         $arResult["images"][$arImage['ID']]["full"] = "/bitrix/components/bitrix/blog/show_file.php?fid=" . $arImage['ID'] . "&width=" . $arParams["ATTACHED_IMAGE_MAX_WIDTH_FULL"] . "&height=" . $arParams["ATTACHED_IMAGE_MAX_HEIGHT_FULL"];
     }
 }
 $arParserParams = array("imageWidth" => $arParams["IMAGE_MAX_WIDTH"], "imageHeight" => $arParams["IMAGE_MAX_HEIGHT"], "pathToUser" => $arParams["PATH_TO_USER"]);
 $arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "USER" => "Y", "TAG" => "Y", "SHORT_ANCHOR" => "Y");
 if (COption::GetOptionString("blog", "allow_video", "Y") != "Y") {
     $arAllow["VIDEO"] = "N";
 }
 if (is_array($arResult["POST_PROPERTIES"]["DATA"]["UF_BLOG_POST_FILE"])) {
     $p->arUserfields = array("UF_BLOG_POST_FILE" => array_merge($arResult["POST_PROPERTIES"]["DATA"]["UF_BLOG_POST_FILE"], array("TAG" => "DOCUMENT ID")));
 }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


示例9: GetRSS


//.........这里部分代码省略.........
         $arSettings["RSS"] .= "  <id>" . $atomID . "</id>\n";
         $arSettings["RSS"] .= "  <link rel=\"alternate\" type=\"text/html\" href=\"" . $arSettings["BLOG_URL"] . "\" />\n";
         $arSettings["RSS"] .= "  <copyright>Copyright (c) " . $arSettings["SERVER_NAME"] . "</copyright>\n";
         $arSettings["RSS"] .= "  <modified>" . $arSettings["NOW_ISO"] . "</modified>\n";
         $arSettings["RSS"] .= "\n";
     }
     $arParserParams = array("imageWidth" => $arPathTemplates["IMAGE_MAX_WIDTH"], "imageHeight" => $arPathTemplates["IMAGE_MAX_HEIGHT"]);
     //Text Parser
     $parser = new blogTextParser();
     //SELECT
     $arSelFields = array("ID", "TITLE", "DETAIL_TEXT", "DATE_PUBLISH", "AUTHOR_ID", "BLOG_USER_ALIAS", "BLOG_ID", "DETAIL_TEXT_TYPE", "BLOG_URL", "BLOG_OWNER_ID", "BLOG_SOCNET_GROUP_ID", "BLOG_GROUP_SITE_ID", "CODE", self::UFCategroryCodeField);
     //WHERE
     $arFilter = array("<=DATE_PUBLISH" => ConvertTimeStamp(false, "FULL", false), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "BLOG_ENABLE_RSS" => "Y", "MICRO" => "N");
     if (intval($arSettings["BLOG_CODE"]) === $arSettings["BLOG_CODE"]) {
         $arFilter["BLOG_ID"] = $arSettings["BLOG_CODE"];
     } else {
         $arFilter["BLOG_URL"] = $arSettings["BLOG_CODE"];
     }
     //Extend standart filter
     $arFilter = array_merge($arFilter, $arFilterExt);
     CTimeZone::Disable();
     $dbPosts = CBlogPost::GetList(array("DATE_PUBLISH" => "DESC"), $arFilter, false, array("nTopCount" => $numPosts), $arSelFields);
     CTimeZone::Enable();
     while ($arPost = $dbPosts->Fetch()) {
         //Can read
         if (CBlogPost::GetBlogUserPostPerms($arPost["ID"], $arSettings["CURRENT_USER_ID"]) < BLOG_PERMS_READ) {
             continue;
         }
         $arAuthorUser = $USER->GetByID($arPost["AUTHOR_ID"])->Fetch();
         $author = CBlogUser::GetUserName($arPost["BLOG_USER_ALIAS"], $arAuthorUser["NAME"], $arAuthorUser["LAST_NAME"], $arAuthorUser["LOGIN"], $arAuthorUser["SECOND_NAME"]);
         $title = str_replace(array("&", "<", ">", "\""), array("&amp;", "&lt;", "&gt;", "&quot;"), $author . ": " . $arPost["TITLE"]);
         //Idea Images
         $arImages = array();
         $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arPost["BLOG_ID"], "IS_COMMENT" => "N"));
         while ($arImage = $res->Fetch()) {
             $arImages[$arImage['ID']] = $arImage['FILE_ID'];
         }
         $arDate = ParseDateTime($arPost["DATE_PUBLISH"], CSite::GetDateFormat("FULL", $arPost["BLOG_GROUP_SITE_ID"]));
         $date = date("r", mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]));
         if (!empty($arPathTemplates)) {
             $url = htmlspecialcharsbx("http://" . $arSettings["SERVER_NAME"] . CComponentEngine::MakePathFromTemplate($arPathTemplates["BLOG_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arPathTemplates["ALLOW_POST_CODE"]), "user_id" => $arPost["BLOG_OWNER_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } else {
             $url = htmlspecialcharsbx("http://" . $arSettings["SERVER_NAME"] . CBlogPost::PreparePath(htmlspecialcharsbx($arPost["BLOG_URL"]), $arPost["ID"], $arPost["BLOG_GROUP_SITE_ID"]));
         }
         $category = "";
         if (isset($arPost[self::UFCategroryCodeField]) && is_array($arSettings["CATEGORIES"][ToUpper($arPost[self::UFCategroryCodeField])])) {
             $category = htmlspecialcharsbx($arSettings["CATEGORIES"][ToUpper($arPost[self::UFCategroryCodeField])]["NAME"]);
         }
         if (strlen($arPathTemplates["USER"]) > 0) {
             $authorURL = htmlspecialcharsbx("http://" . $arSettings["SERVER_NAME"] . CComponentEngine::MakePathFromTemplate($arPathTemplates["USER"], array("user_id" => $arPost["AUTHOR_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"])));
         } else {
             $authorURL = htmlspecialcharsbx("http://" . $arSettings["SERVER_NAME"] . CBlogUser::PreparePath($arPost["AUTHOR_ID"], $arPost["BLOG_GROUP_SITE_ID"]));
         }
         if ($arPost["DETAIL_TEXT_TYPE"] == "html") {
             $IdeaText = $parser->convert_to_rss($arPost["DETAIL_TEXT"], $arImages, array("HTML" => "Y", "ANCHOR" => "Y", "IMG" => "Y", "SMILES" => "Y", "NL2BR" => "N", "QUOTE" => "Y", "CODE" => "Y"), true, $arParserParams);
         } else {
             $IdeaText = $parser->convert_to_rss($arPost["DETAIL_TEXT"], $arImages, false, true, $arParserParams);
         }
         $IdeaText .= "<br /><a href=\"" . $url . "\">" . GetMessage("BLG_GB_RSS_DETAIL") . "</a>";
         $IdeaText = "<![CDATA[" . $IdeaText . "]]>";
         if ($arSettings["RSS_TYPE"] == "rss.92") {
             $arSettings["RSS"] .= "\t<item>\n";
             $arSettings["RSS"] .= "\t  <title>" . $title . "</title>\n";
             $arSettings["RSS"] .= "\t  <description>" . $IdeaText . "</description>\n";
             $arSettings["RSS"] .= "\t  <link>" . $url . "</link>\n";
             $arSettings["RSS"] .= "\t</item>\n";
开发者ID:rasuldev,项目名称:torino,代码行数:67,代码来源:idea.php


示例10: FormatEvent_Blog

 function FormatEvent_Blog($arFields, $arParams, $bMail = false)
 {
     if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
         IncludeModuleLangFile(__FILE__, $arFields["MAIL_LANGUAGE_ID"]);
     }
     $arResult = array("EVENT" => $arFields, "CREATED_BY" => CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail), "ENTITY" => CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, $bMail), "EVENT_FORMATTED" => array());
     $arResult["CREATED_BY"]["ACTION_TYPE"] = "wrote";
     if (!$bMail) {
         $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams);
     }
     if ($bMail) {
         $title_tmp = GetMessage("SONET_GL_EVENT_TITLE_" . ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP ? "GROUP" : "USER") . "_BLOG_POST_MAIL");
         //if the title duplicates message, don't show it
         $arFields["TITLE"] = strpos($arFields["MESSAGE"], $arFields["TITLE"]) === 0 ? "" : ' "' . $arFields["TITLE"] . '"';
     } else {
         $title_tmp = GetMessage("SONET_GL_EVENT_TITLE_BLOG_POST");
     }
     $post_tmp = !$bMail && array_key_exists("URL", $arFields) && strlen($arFields["URL"]) > 0 ? '<a href="' . $arFields["URL"] . '">' . $arFields["TITLE"] . '</a>' : $arFields["TITLE"];
     $title = str_replace(array("#TITLE#", "#ENTITY#", "#CREATED_BY#"), array($post_tmp, $arResult["ENTITY"]["FORMATTED"], $bMail ? $arResult["CREATED_BY"]["FORMATTED"] : ""), $title_tmp);
     $title = trim(preg_replace('/\\s+/', ' ', $title));
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "TITLE_24" => GetMessage("SONET_GL_EVENT_TITLE_BLOG_POST_24"), "TITLE_24_2" => $arFields["TITLE"], "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["~MESSAGE"]);
     if (!$bMail) {
         if ($arParams["NEW_TEMPLATE"] != "Y" || $arFields["EVENT_ID"] == "idea") {
             if (CModule::IncludeModule("blog")) {
                 $parserLog = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
                 $arImages = array();
                 $arBlogPost = CBlogPost::GetByID($arFields["SOURCE_ID"]);
                 if ($arBlogPost["HAS_IMAGES"] != "N") {
                     $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arBlogPost['ID'], "IS_COMMENT" => "N"));
                     while ($arImage = $res->Fetch()) {
                         $arImages[$arImage['ID']] = $arImage['FILE_ID'];
                     }
                 }
             } else {
                 $parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
             }
             $arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N", "SHORT_ANCHOR" => "Y");
             if (get_class($parserLog) == "blogTextParser") {
                 $arResult["EVENT_FORMATTED"]["MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), true, $arImages, $arAllow), 10000);
             } else {
                 $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
             }
             $arResult["EVENT_FORMATTED"]["MESSAGE"] = str_replace("#CUT#", '<br><a href="' . $arFields["URL"] . '">' . GetMessage("SONET_GL_EVENT_BLOG_MORE") . '</a>', $arResult["EVENT_FORMATTED"]["MESSAGE"]);
             $arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
             if ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP) {
                 $arResult["EVENT_FORMATTED"]["DESTINATION"] = array(array("STYLE" => "sonetgroups", "TITLE" => $arResult["ENTITY"]["FORMATTED"]["NAME"], "URL" => $arResult["ENTITY"]["FORMATTED"]["URL"]));
             }
         }
         $dbRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $arFields["ID"]));
         while ($arRight = $dbRight->Fetch()) {
             $arRights[] = $arRight["GROUP_CODE"];
         }
         if ($arParams["MOBILE"] == "Y") {
             $arResult["EVENT_FORMATTED"]["DESTINATION"] = CSocNetLogTools::FormatDestinationFromRights($arRights, array_merge($arParams, array("CREATED_BY" => $arFields["USER_ID"], "USE_ALL_DESTINATION" => true)), $iMoreCount);
             if (intval($iMoreCount) > 0) {
                 $arResult["EVENT_FORMATTED"]["DESTINATION_MORE"] = $iMoreCount;
             }
         } else {
             $arResult["EVENT_FORMATTED"]["DESTINATION_CODE"] = CSocNetLogTools::GetDestinationFromRights($arRights, array_merge($arParams, array("CREATED_BY" => $arFields["USER_ID"])));
         }
     } else {
         $url = CSocNetLogTools::FormatEvent_GetURL($arFields);
         if (strlen($url) > 0) {
             $arResult["EVENT_FORMATTED"]["URL"] = $url;
         }
     }
     $arResult["HAS_COMMENTS"] = intval($arFields["SOURCE_ID"]) > 0 ? "Y" : "N";
     if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
         IncludeModuleLangFile(__FILE__, LANGUAGE_ID);
     }
     return $arResult;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:72,代码来源:log_tools.php


示例11: Delete

 function Delete($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     unset($GLOBALS["BLOG_IMAGE"]["BLOG_IMAGE_CACHE_" . $ID]);
     if ($res = CBlogImage::GetByID($ID)) {
         CFile::Delete($res['FILE_ID']);
         return $DB->Query("DELETE FROM b_blog_image WHERE ID = " . $ID, true);
     }
     return false;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:11,代码来源:blog_image.php


示例12: convert_blog_image

	function convert_blog_image($p1 = "", $imageId = "", $p2 = "", $type = "html", $serverName="")
	{
		$imageId = IntVal($imageId);
		if($imageId <= 0)
			return;

		$res = "";
		if(IntVal($this->arImages[$imageId]) > 0)
		{
			$this->showedImages[] = $imageId;
			if($f = CBlogImage::GetByID($imageId))
			{
				if(COption::GetOptionString("blog", "use_image_perm", "N") == "N")
				{
					if($db_img_arr = CFile::GetFileArray($this->arImages[$imageId]))
					{
						if(substr($db_img_arr["SRC"], 0, 1) == "/")
							$strImage = $this->serverName.$db_img_arr["SRC"];
						else
							$strImage = $db_img_arr["SRC"];
						$sourceImage = $strImage;

						$strPar = "";
						preg_match("/width\=([0-9]+)/is".BX_UTF_PCRE_MODIFIER, $p1, $width);
						preg_match("/height\=([0-9]+)/is".BX_UTF_PCRE_MODIFIER, $p1, $height);
						$width = intval($width[1]);
						$height = intval($height[1]);

						if($width <= 0)
						{
							preg_match("/width\=([0-9]+)/is".BX_UTF_PCRE_MODIFIER, $p2, $width);
							$width = intval($width[1]);
						}
						if($height <= 0)
						{
							preg_match("/height\=([0-9]+)/is".BX_UTF_PCRE_MODIFIER, $p2, $height);
							$height = intval($height[1]);
						}

						if(IntVal($width) <= 0)
							$width = $db_img_arr["WIDTH"];
						if(IntVal($height) <= 0)
							$height= $db_img_arr["HEIGHT"];

						if($width > $this->imageWidth || $height > $this->imageHeight)
						{
							$arFileTmp = CFile::ResizeImageGet(
								$db_img_arr,
								array("width" => $this->imageWidth, "height" => $this->imageHeight),
								BX_RESIZE_IMAGE_PROPORTIONAL,
								true
							);
							if(substr($arFileTmp["src"], 0, 1) == "/")
								$strImage = $this->serverName.$arFileTmp["src"];
							else
								$strImage = $arFileTmp["src"];
							$width = $arFileTmp["width"];
							$height = $arFileTmp["height"];
						}

						$strPar = ' width="'.$width.'" height="'.$height.'"';
						$strImage = preg_replace("'(?<!:)/+'s", "/", $strImage);
						$sourceImage = preg_replace("'(?<!:)/+'s", "/", $sourceImage);

						if(strlen($this->authorName) > 0)
							$strPar .= " data-bx-title=\"".$this->authorName."\"";

						if ($this->isSonetLog)
						{
							$strImage = preg_replace("'(?<!:)/+'s", "/", $strImage);
							$res = '[IMG]'.$strImage.'[/IMG]';
						}
						else
						{

							if($type == "mail")
								$res = htmlspecialcharsbx($f["TITLE"])." (IMAGE: ".$strImage." )";
							else
								$res = '<img src="'.$strImage.'" title="" alt="'.htmlspecialcharsbx($f["TITLE"]).'" border="0"'.$strPar.' data-bx-image="'.$sourceImage.'" />';
						}
					}
				}
				else
				{
					preg_match("/width\=([0-9]+)/is".BX_UTF_PCRE_MODIFIER, $p1, $width);
					preg_match("/height\=([0-9]+)/is".BX_UTF_PCRE_MODIFIER, $p1, $height);
					$width = intval($width[1]);
					$height = intval($height[1]);

					if($width <= 0)
					{
						preg_match("/width\=([0-9]+)/is".BX_UTF_PCRE_MODIFIER, $p2, $width);
						$width = intval($width[1]);
					}
					if($height <= 0)
					{
						preg_match("/height\=([0-9]+)/is".BX_UTF_PCRE_MODIFIER, $p2, $height);
						$height = intval($height[1]);
					}

//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:101,代码来源:functions.php


示例13: array

             }
             CSocNetLog::Update($logID, array("TMP_ID" => $logID));
             if (CModule::IncludeModule("extranet")) {
                 $arSiteID = CExtranet::GetSitesByLogDestinations($socnetPerms);
                 CSocNetLog::Update($logID, array("SITE_ID" => $arSiteID));
             }
             CSocNetLogRights::DeleteByLogID($logID);
             CSocNetLogRights::Add($logID, $socnetPerms);
             CSocNetLog::SendEvent($logID, "SONET_NEW_EVENT", $logID);
         }
     }
 }
 // IMAGES UPDATE
 if (!empty($arImagesToUpdate)) {
     foreach ($arImagesToUpdate as $imgID) {
         CBlogImage::Update($imgID, array("POST_ID" => $postID));
     }
 }
 // category update
 foreach ($iCategory as $iCategoryValue) {
     CBlogPostCategory::Add(array("BLOG_ID" => $blogID, "POST_ID" => $postID, "CATEGORY_ID" => $iCategoryValue));
 }
 // COMMENTS
 if (!empty($arComments)) {
     if (!function_exists("__blog_add_comments")) {
         function __blog_add_comments($arComments, $parentID, $arParams)
         {
             if (!is_array($arComments) || empty($arComments)) {
                 return;
             }
             foreach ($arComments as $res) {
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:index.php


示例14: isset

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CBlogPost类代码示例发布时间:2022-05-23
下一篇:
PHP CBlogGroup类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap