function Styles_Url($Element) { /****************************************************************************/ $__args_types = array('string'); #----------------------------------------------------------------------------- $__args__ = Func_Get_Args(); eval(FUNCTION_INIT); /****************************************************************************/ $HostsIDs = Styles_HostsIDs($Element); if (Is_Error($HostsIDs)) { return ERROR | @Trigger_Error('[Styles_Url]: список хостов содержащих элемент не найдены'); } #----------------------------------------------------------------------------- $HostID = Current($HostsIDs); #----------------------------------------------------------------------------- return SPrintF('%s://%s/styles/%s/%s', Url_Scheme(), @$_SERVER['HTTP_HOST'], $HostID, $Element); #return SPrintF('/styles/%s/%s',$HostID,$Element); }
} #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # проверяем наличие аттача $FileLength = GetUploadedFileSize('EdesksMessages', $MessageID); #------------------------------------------------------------------------------- if ((int) $FileLength) { #------------------------------------------------------------------------------- # проверяем наличие точки в имени (значит расширение определить удастся) if (StrRIPos($FileName, '.')) { #------------------------------------------------------------------------------- # проверяем что это картинка if ($__USER['Params']['Settings']['EdeskImagesPreview'] == "Yes" && In_Array(StrToLower(SubStr($FileName, StrRIPos($FileName, '.') + 1, 4)), array('png', 'gif', 'jpg', 'jpeg'))) { #------------------------------------------------------------------------------- # добавляем к тексту превьюху $Content = SPrintF("%s\n\n[image]%s://%s/FileDownload?TypeID=EdesksMessages&FileID=%u[/image]", $Content, Url_Scheme(), HOST_ID, $MessageID); #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Params = array('User' => $User, 'Status' => Time() - $User['EnterDate'] < 600 ? 'OnLine' : 'OffLine', 'Delete' => '', 'MessageID' => SPrintF('%06u', $MessageID), 'CreateDate' => $CreateDate, 'Group' => $Group); #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Text = Comp_Load('Edesks/Text', array('String' => $Content, 'IsLockText' => $OwnerID != @$GLOBALS['__USER']['ID'])); if (Is_Error($Text)) { return ERROR | @Trigger_Error(500); }