本文整理汇总了PHP中CFile::GetById方法的典型用法代码示例。如果您正苦于以下问题:PHP CFile::GetById方法的具体用法?PHP CFile::GetById怎么用?PHP CFile::GetById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFile
的用法示例。
在下文中一共展示了CFile::GetById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* File constructor.
* @param $id
*/
public function __construct($id)
{
$res = \CFile::GetById($id);
while ($row = $res->Fetch()) {
$this->fieldsData = $row;
$this->id = $id;
break;
}
}
示例2: IncludeTemplateLangFile
<?php
global $USER;
$user_id = $USER->GetID();
if (!$user_id) {
return;
}
if (!CModule::IncludeModule('st1234holes')) {
return;
}
IncludeTemplateLangFile(__FILE__);
$_user = $USER->GetByID($user_id);
$_user = $_user->Fetch();
if ($_user['PERSONAL_PHOTO']) {
$_user['PERSONAL_PHOTO'] = CFile::GetById($_user['PERSONAL_PHOTO']);
$_user['PERSONAL_PHOTO'] = $_user['PERSONAL_PHOTO']->Fetch();
}
$_user_holes = C1234Hole::GetList(array(), array('USER_ID' => $user_id), array('nopicts' => true));
$fixed = 0;
$holes = 0;
global $fresh;
$fresh = 0;
foreach ($_user_holes as $hole) {
$holes++;
if ($hole['STATE'] == 'fixed') {
$fixed++;
}
if ($hole['STATE'] == 'fresh') {
$fresh++;
}
}
$holes = (string) $holes;
示例3: GetMessage
$arResult['HOLE']['PAST_DAYS'] .= ' ' . GetMessage('DAYS5');
} elseif ($last_digit > 4 || !$last_digit) {
$arResult['HOLE']['PAST_DAYS'] .= ' ' . GetMessage('DAYS5');
} elseif ($last_digit > 1) {
$arResult['HOLE']['PAST_DAYS'] .= ' ' . GetMessage('DAYS2');
} else {
$arResult['HOLE']['PAST_DAYS'] .= ' ' . GetMessage('DAY');
}
} elseif ($arResult['HOLE']['STATE'] == 'fixed') {
$arResult['allow_cancel_fix'] = sizeof($arResult['HOLE']['pictures']['original']['fixed']) ? false : true;
}
$arResult['PROSECUTOR_FORM_TO'] = CGreensightRFSubject::$_RF_SUBJECTS_GENITIVE[$arResult['HOLE']['ADR_SUBJECTRF']];
$arResult['AUTHOR'] = CUser::GetByID($arResult['HOLE']['USER_ID']);
$arResult['AUTHOR'] = $arResult['AUTHOR']->Fetch();
if ($arResult['AUTHOR']['PERSONAL_PHOTO']) {
$arResult['AUTHOR']['PERSONAL_PHOTO'] = CFile::GetById($arResult['AUTHOR']['PERSONAL_PHOTO']);
$arResult['AUTHOR']['PERSONAL_PHOTO'] = $arResult['AUTHOR']['PERSONAL_PHOTO']->Fetch();
}
$arResult['YANDEX_MAP_KEY'] = CIBlockPropertyMapYandex::_GetMapKey('yandex', $_SERVER['SERVER_NAME']);
// начальник и отделение ГИБДД, а также прокуратура
if ($arResult['HOLE']['ADR_SUBJECTRF']) {
$res = CIBlockElement::GetList(array(), array('IBLOCK_CODE' => 'GIBDD_HEADS', 'PROPERTY_SUBJECT_ID' => $arResult['HOLE']['ADR_SUBJECTRF']), array('PROPERTY_POST_DATIVE', 'PROPERTY_FIO_DATIVE', 'PROPERTY_POST'));
$ar = $res->Fetch();
$arResult['PDF_FORM_TO'] = $ar['PROPERTY_POST_DATIVE_VALUE'] . ' ' . $ar['PROPERTY_FIO_DATIVE_VALUE'];
$arResult['PROSECUTOR_GIBDD'] = explode(' ', $ar['PROPERTY_POST_VALUE']);
$arResult['PROSECUTOR_GIBDD'] = array_slice($arResult['PROSECUTOR_GIBDD'], 1);
if (ToUpper($arResult['PROSECUTOR_GIBDD'][0]) == 'УПРАВЛЕНИЯ') {
$arResult['PROSECUTOR_GIBDD'][0] = 'УПРАВЛЕНИЕ';
}
$arResult['PROSECUTOR_GIBDD'] = implode(' ', $arResult['PROSECUTOR_GIBDD']);
$res = CIBlockElement::GetList(array(), array('IBLOCK_CODE' => 'PROSECUTORS', 'PROPERTY_SUBJECT_ID' => $arResult['HOLE']['ADR_SUBJECTRF']));