Documentation
IPS_GetMediaIDByFile
int IPS_GetMediaIDByFile (string $MediaPath)
Parameters
| MediaPath | Relative media path as seen from main program path |
Returns
ID of the found media object, otherwise FALSE and a warning
Description
The function returns the ID of the media object with the path MediaPath. If no such object exists, the function returns FALSE.
This function generates a warning if the file was not found. The @ operator can be used to suppress these messages. The exact functionality of this operator is found in the PHP manual.
Example
$MediaID = @IPS_GetMediaIDByFile("media/help.png");
if ($MediaID === false)
echo "Picture not found!";
else
echo "The Media ID is: ". $MediaID;