Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
util.php
1<?php
9namespace Bitrix\Blog;
10
12
17class Util
18{
23 public static function getImageMaxWidth()
24 {
25 return Option::get("blog", "image_max_width", 800);
26 }
27
32 public static function getImageMaxHeight()
33 {
34 return Option::get("blog", "image_max_height", 1000);
35 }
36
37 public static function sendBlogPing($params = array())
38 {
39 $serverName = (
40 is_array($params)
41 && !empty($params['serverName'])
42 ? $params['serverName']
43 : ''
44 );
45
46 $siteId = (
47 is_array($params)
48 && !empty($params['siteId'])
49 ? $params['siteId']
50 : SITE_ID
51 );
52
53 $pathToBlog = (
54 is_array($params)
55 && !empty($params['pathToBlog'])
56 ? $params['pathToBlog']
57 : ''
58 );
59
60 $blogFields = (
61 is_array($params)
62 && !empty($params['blogFields'])
63 && is_array($params['blogFields'])
64 ? $params['blogFields']
65 : array()
66 );
67
68 if (
69 empty($pathToBlog)
70 || empty($blogFields)
71 )
72 {
73 return false;
74 }
75
76 if (Option::get("blog","send_blog_ping", "N") == "Y")
77 {
78 if($serverName == '')
79 {
80 $res = \CSite::getById($siteId);
81 $siteFields = $res->fetch();
82
83 $serverName = htmlspecialcharsEx($siteFields["SERVER_NAME"]);
84
85 if (empty($serverName))
86 {
87 $serverName = (
88 defined("SITE_SERVER_NAME")
89 && SITE_SERVER_NAME <> ''
90 ? SITE_SERVER_NAME
91 : Option::get("main", "server_name", "")
92 );
93
94 if (empty($serverName))
95 {
96 $serverName = $_SERVER["SERVER_NAME"];
97 }
98 }
99 }
100
101 \CBlog::sendPing($blogFields["NAME"], "http://".$serverName.\CComponentEngine::makePathFromTemplate(
102 htmlspecialcharsBack($pathToBlog),
103 array(
104 "blog" => $blogFields["URL"],
105 "user_id" => $blogFields["OWNER_ID"],
106 "group_id" => $blogFields["SOCNET_GROUP_ID"]
107 )
108 ));
109
110 return true;
111 }
112
113 return false;
114 }
115}
116
static getImageMaxWidth()
Definition util.php:23
static getImageMaxHeight()
Definition util.php:32
static sendBlogPing($params=array())
Definition util.php:37