You are here

function shrinktheweb_getNoResponseImage in ShrinkTheWeb 8

Same name and namespace in other branches
  1. 6 shrinktheweb.api.inc \shrinktheweb_getNoResponseImage()
  2. 7 shrinktheweb.api.inc \shrinktheweb_getNoResponseImage()

Gets the account problem image and returns the relative path to the cached image.

Parameters

$sUrl:

$aOptions:

Return value

bool|string

1 call to shrinktheweb_getNoResponseImage()
shrinktheweb_getThumbnailAdvanced in ./shrinktheweb.api.inc
Getting the thumbnail with advanced api. !!! SLIGHTLY CHANGED FOR DRUPAL !!!

File

./shrinktheweb.api.inc, line 576

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;
}