What can we improve?

Documentation

(Edit)

Translation is in progress...
Not all topics are available at the moment and content links may be broken.

IPS_GetMedia

array IPS_GetMedia (integer $MediaID)

Parameters

MediaID The ID of the media object

Returns

The following information are available as key => value pairs:

Index  Type Description
IsAvailable(up to 3.4) boolean TRUE if media file is available (replaced by MediaIsAvailable since version 4.0)
IsLinked(up to 3.4) boolean TRUE if the file is located outside the Media folder (removed since version 4.0)
LastUpdate(up to 3.4) float Unix timestamp of last update (replaced by MediaUpdated since version 4.0)
MediaCRC string CRC32 of the file
MediaFile string Path to the file
MediaID integer MediaID
MediaIsAvailable(since 4.0) boolean TRUE if media file is available
MediaSize integer Size in bytes
MediaType integer Media Type (0: Form 1: Image 2: Sound 3: Stream 4: Chart, 5: Document)
MediaUpdated(since 4.0) integer Unix timestamp of last update
SendEvent(up to 3.4) boolean TRUE if automatic file changes should be sent (removed since version 4.0)

Description

The command returns an array with information about media with the ID MediaID.

The previous form of the command that was used up to version 3.4 is accessible as "array IPS_GetMediaCompatibility(integer $MediaID)" since version 4.0 if the corresponding Invalid Link: Special Switches is set.

Example

// Since Version 4.0
print_r(IPS_GetMedia(45699));
/* returns e.g.:
Array
(
    [MediaCRC] => E2D2C1D1
    [MediaFile] => media\45699.bin
    [MediaID] => 45699
    [MediaIsAvailable] => 1
    [MediaIsCached] =>
    [MediaSize] => 8192
    [MediaType] => 0
    [MediaUpdated] => 1214421546
)
*/
 
print_r(IPS_GetMediaCompatibility(45699));
/* returns e.g.:
Array
(
    [IsAvailable] => 1
    [IsLinked] =>
    [LastUpdate] => 1214421546
    [MediaCRC] => E2D2C1D1
    [MediaFile] => media\45699.bin
    [MediaID] => 45699
    [MediaSize] => 8192
    [MediaType] => 0
    [SendEvent] =>
)
*/
 
 
 
// Up to Version 3.4
print_r(IPS_GetMedia(45699));
/* returns e.g.:
Array
(
    [IsAvailable] => 1
    [IsLinked] =>
    [LastUpdate] => 1214421546
    [MediaCRC] => E2D2C1D1
    [MediaFile] => media\45699.bin
    [MediaID] => 45699
    [MediaSize] => 8192
    [MediaType] => 0
    [SendEvent] =>
)
*/
Deutsche Webseite verfügbar
Go to cart
Any questions?