function shrinktheweb_getNoResponseImage in ShrinkTheWeb 7
Same name and namespace in other branches
- 8 shrinktheweb.api.inc \shrinktheweb_getNoResponseImage()
- 6 shrinktheweb.api.inc \shrinktheweb_getNoResponseImage()
Gets the account problem image and returns the relative path to the cached image
1 call to shrinktheweb_getNoResponseImage()
File
- ./
shrinktheweb.api.inc, line 397
Code
function shrinktheweb_getNoResponseImage($sUrl, $aOptions) {
// create cache directory if it doesn't exist
shrinktheweb_createCacheDirectory();
$aOptions = shrinktheweb_generateOptions($aOptions);
$aArgs['stwaccesskeyid'] = 'accountproblem';
if ($aOptions['SizeCustom']) {
$aArgs['stwxmax'] = $aOptions['SizeCustom'];
}
else {
$aArgs['stwsize'] = $aOptions['Size'];
}
$sRequestUrl = PROTOCOL . 'images.shrinktheweb.com/xino.php';
$sRemoteData = shrinktheweb_fileGetContent($sRequestUrl, $aArgs);
if ($sRemoteData != '') {
$aResponse = shrinktheweb_getXMLResponse($sRemoteData);
if (!$aResponse['exists'] && $aResponse['thumbnail'] != '') {
$sImageUrl = $aResponse['thumbnail'];
$sFilename = NO_RESPONSE_IMAGE;
$sFile = THUMBNAIL_DIR . $sFilename;
$isDownloaded = shrinktheweb_downloadRemoteImageToLocalPath($sImageUrl, $sFile);
if ($isDownloaded == true) {
return THUMBNAIL_URI . $sFilename;
}
}
}
return false;
}