53 $bShowErrorCode = ($bShowErrorCode ===
true ? true :
false);
60 if (!is_array($arError))
66 if (isset($arError[
"title"]))
67 $sReturn = $arError[
"title"];
69 if (isset($arError[
"code"]))
77 $sReturn .= ($bShowErrorCode ?
" [CODE: ".$arError[
"code"].
"]" :
"");
80 if (isset($arError[
"DATA"]) || isset($arError[
"data"]))
82 $tmp = (isset($arError[
"DATA"]) ? $arError[
"DATA"] : $arError[
"data"]);
84 if (!empty($arShowFields) && is_array($arShowFields))
86 if (in_array(
"ID", $arShowFields) && !empty(
$tmp[
"ID"]))
88 $arRes[] =
"ID: ".$tmp[
"ID"];
92 foreach ($arShowFields as
$key)
104 $sReturn .=
" (".implode(
", ",
$arRes).
")";
155function PhotoFormatDate($strDate, $format=
"DD.MM.YYYY HH:MI:SS", $new_format=
"DD.MM.YYYY HH:MI:SS")
159 $strDate = trim($strDate);
161 $new_format = str_replace(
"MI",
"I", $new_format);
162 $new_format = preg_replace(
"/([DMYIHS])\\1+/isu",
"\\1", $new_format);
163 $new_format_len = mb_strlen($new_format);
164 $arFormat = preg_split(
'/[^0-9A-Za-z]/', mb_strtoupper($format));
165 $arDate = preg_split(
'/[^0-9]/', $strDate);
166 $arParsedDate=Array();
167 $bound = min(
count($arFormat),
count($arDate));
169 for(
$i=0;
$i<$bound;
$i++)
171 if(preg_match(
"/[^0-9]/", $arDate[
$i],
$matches))
172 $r =
$DB->ForSql($arDate[
$i], 4);
174 $r = intval($arDate[
$i]);
176 $arParsedDate[mb_substr($arFormat[
$i], 0, 2)] = $r;
178 if (intval($arParsedDate[
"DD"])<=0 || intval($arParsedDate[
"MM"])<=0 || intval($arParsedDate[
"YY"])<=0)
183 if(intval($arParsedDate[
"YY"])>1970 && intval($arParsedDate[
"YY"])<2038)
186 intval($arParsedDate[
"HH"]),
187 intval($arParsedDate[
"MI"]),
188 intval($arParsedDate[
"SS"]),
189 intval($arParsedDate[
"MM"]),
190 intval($arParsedDate[
"DD"]),
191 intval($arParsedDate[
"YY"])
194 for (
$i = 0;
$i < $new_format_len;
$i++)
196 switch(mb_substr($new_format,
$i, 1))
199 $match =
GetMessage(
"P_MONTH_".date(
"n", $ux_time));
202 $match =
GetMessage(
"P_MON_".date(
"n", $ux_time));
205 $match =
GetMessage(
"P_DAY_OF_WEEK_".date(
"w", $ux_time));
208 $match =
GetMessage(
"P_DOW_".date(
"w", $ux_time));
211 $match = date(mb_substr($new_format,
$i, 1), $ux_time);
214 $strResult .= $match;
219 if($arParsedDate[
"MM"]<1 || $arParsedDate[
"MM"]>12)
220 $arParsedDate[
"MM"] = 1;
221 for (
$i = 0;
$i < $new_format_len;
$i++)
223 switch(mb_substr($new_format,
$i, 1))
226 $match = str_pad($arParsedDate[
"MM"], 2,
"0", STR_PAD_LEFT);
227 if(intval($arParsedDate[
"MM"]) > 0)
229 $match =
GetMessage(
"P_MONTH_".intval($arParsedDate[
"MM"]));
233 $match = str_pad($arParsedDate[
"MM"], 2,
"0", STR_PAD_LEFT);
234 if(intval($arParsedDate[
"MM"]) > 0)
236 $match =
GetMessage(
"P_MON_".intval($arParsedDate[
"MM"]));
240 $match = str_pad($arParsedDate[
"DD"], 2,
"0", STR_PAD_LEFT);
241 if(intval($arParsedDate[
"DD"]) > 0)
243 $match =
GetMessage(
"P_DAY_OF_WEEK_".intval($arParsedDate[
"DD"]));
247 $match = str_pad($arParsedDate[
"DD"], 2,
"0", STR_PAD_LEFT);
248 if(intval($arParsedDate[
"DD"]) > 0)
250 $match =
GetMessage(
"P_DOW_".intval($arParsedDate[
"DD"]));
254 $match = str_pad($arParsedDate[
"DD"], 2,
"0", STR_PAD_LEFT);
257 $match = str_pad($arParsedDate[
"MM"], 2,
"0", STR_PAD_LEFT);
260 $match = intval($arParsedDate[
"MM"]);
263 $match = str_pad($arParsedDate[
"YY"], 4,
"0", STR_PAD_LEFT);
266 $match = mb_substr($arParsedDate[
"YY"], 2);
269 $match = str_pad($arParsedDate[
"HH"], 2,
"0", STR_PAD_LEFT);
272 $match = str_pad($arParsedDate[
"MI"], 2,
"0", STR_PAD_LEFT);
275 $match = str_pad($arParsedDate[
"SS"], 2,
"0", STR_PAD_LEFT);
278 $match = intval($arParsedDate[
"HH"]);
281 $match = $match - 12;
285 $match = intval($arParsedDate[
"HH"]);
288 $match = ($match - 12).
" PM";
295 if(mb_substr($new_format,
$i,1) ==
"a")
297 $match = mb_strtolower($match);
301 $match = mb_substr($new_format,
$i,1);
304 $strResult .= $match;
312 if (empty($components))
320 $arSite =
array($arSite);
328 if (is_array($components))
336 if (mb_strpos($component_name,
"/") !==
false)
338 $add_path = mb_substr($component_name,mb_strpos($component_name,
"/"));
339 $component_name = mb_substr($component_name,0,mb_strpos($component_name,
"/"));
341 $componentRelativePath = CComponentEngine::MakeComponentPath($component_name);
343 if ($componentRelativePath <>
'')
345 BXClearCache(
true,
"/".$componentRelativePath.$add_path);
365 $arCache[] =
"photogallery";
368 $arCache[] =
"search.page";
369 $arCache[] =
"search.tags.cloud";
370 $arCache[] =
"photogallery/".$iblockId;
371 $arCache[] =
"photogallery/".$iblockId.
"/pemission";
372 $arCache[] =
"photogallery.detail.comment/".$iblockId;
373 $arCache[] =
"photogallery.gallery.list/".$iblockId;
380 $arCache[] =
"photogallery/".$iblockId.
"/section".intval($sectionId);
382 $arCache[] =
"photogallery/".$iblockId.
"/section".intval($sectionId);
384 if(is_array($arGalleries))
386 $arGalleries = array_unique($arGalleries);
387 foreach($arGalleries as $galleryCode)
388 $arCache[] =
"photogallery/".$iblockId.
"/gallery".$galleryCode;
391 if (is_array($arUsers))
393 $arUsers = array_unique($arUsers);
395 $arCache[] =
"photogallery/".$iblockId.
"/user".intval(
$userId);
400 $rsIblockSite = CIBlock::GetSite(
$iblockId);
401 while($arIblockSite = $rsIblockSite->Fetch())
403 $arSite[] = $arIblockSite[
"SITE_ID"];
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)