Add
int CBlogImage::Add( array arFields );
The method adds new image to a blog post.
Method parameters
Parameter | Description |
---|---|
arFields |
Array of the array("field"=>"value").
|
Returned value
The method returns ID of the added record, if the adding was successful. If an error occurs, the method will return false.Examples of use
$fileID = 2268; $file = CFile::GetFileArray($fileID); $res = CBlogImage::Add( array( "TITLE" => "image title", "FILE_ID" => $fileID, "BLOG_ID" => 1, "POST_ID" => 2, "USER_ID" => $USER->GetID(), "IMAGE_SIZE" => $file["FILE_SIZE"], "TIMESTAMP_X" => $DB->GetNowFunction(), ) ); if($res) echo 'Success';
© «Bitrix24», 2001-2024