Cheetah
ChSitesSTW.php
Go to the documentation of this file.
1 <?php
2 
8  define('ACCESS_KEY', getParam('ch_sites_key_id'));
9  define('SECRET_KEY', getParam('ch_sites_secret_key'));
10  define('ACCOUNT_TYPE', getParam('ch_sites_account_type')); // 'No Automated Screenshots' or 'Enabled'
11  define('THUMBNAIL_URI', $GLOBALS['oChSitesModule']->sThumbUrl);
12  define('THUMBNAIL_DIR', $GLOBALS['oChSitesModule']->sThumbPath);
13  define('INSIDE_PAGES', getParam('ch_sites_inside_pages') == 'on' ? true : false); // set to true if inside capturing should be allowed
14  define('CUSTOM_MSG_URL', getParam('ch_sites_custom_msg_url')); // i.e. 'http://yourdomain.com/path/to/your/custom/msgs'
15  define('CACHE_DAYS', getParam('ch_sites_cache_days')); // how many days should the local copy be valid?
16  // Enter 0 (zero) to never update screenshots once cached
17  // Enter -1 to disable caching and always use embedded method instead
18  define('VER', '2.0.3_dol7'); // allows us to identify known bugs and version control; DONT touch!
19  define('DEBUG', getParam('ch_sites_debug') == 'on' ? true : false);
20  define('QUOTA_IMAGE', 'quota.jpg');
21  define('BANDWIDTH_IMAGE', 'bandwidth.jpg');
22  define('NO_RESPONSE_IMAGE', 'no_response.jpg');
23 
24  /********************************************
25  * !! DO NOT CHANGE BELOW THIS LINE !! *
26  * ...unless you know what you are doing *
27  ********************************************/
28 
34  function getThumbnailHTML($sUrl, $aOptions, $sAttribAlt = false, $sAttribClass = false, $sAttribStyle = false)
35  {
36  $sImageTag = false;
37  if (ACCOUNT_TYPE != 'No Automated Screenshots') {
38  $aOptions = _generateOptions($aOptions);
39 
40  $sImageTag = _getThumbnailPaid($sUrl, $aOptions, $sAttribAlt, $sAttribClass, $sAttribStyle);
41  }
42 
43  return $sImageTag;
44  }
45 
49  function saveAccountInfo()
50  {
51  $aArgs['stwaccesskeyid'] = ACCESS_KEY;
52  $aArgs['stwu'] = SECRET_KEY;
53 
54  $sRequestUrl = 'http://images.shrinktheweb.com/account.php';
55  $sRemoteData = ch_file_get_contents($sRequestUrl, $aArgs);
56  $aResponse = _getAccXMLResponse($sRemoteData);
57 
58  if ($aResponse['stw_response_status'] == 'Success') {
59  $GLOBALS['oChSitesModule']->_oDb->addAccountInfo(ACCESS_KEY, $aResponse);
60  }
61 
62  return $aResponse;
63  }
64 
68  function deleteThumbnail($sUrl, $aOptions = array())
69  {
70  $aOptions = _generateOptions($aOptions);
71  $aArgs = _generateRequestArgs($aOptions);
72  $aArgs['stwurl'] = $sUrl;
73 
74  $sFilename = _generateHash($aArgs).'.jpg';
75  $sFile = THUMBNAIL_DIR . $sFilename;
76 
77  if (file_exists($sFile)) {
78  @unlink($sFile);
79  }
80  }
81 
82  function _getThumbnailPaid($sUrl, $aOptions, $sAttribAlt, $sAttribClass, $sAttribStyle)
83  {
84  $sImageUrl = _getThumbnail($sUrl, $aOptions);
85 
86  // if WAY OVER the limits (i.e. request is ignored by STW), grab an "Account Problem" image and store it as NO_RESPONSE_IMAGE
87  if ($sImageUrl == 'no_response') {
88  $sImageUrl = _getNoResponseImage($sUrl, $aOptions);
89  }
90 
91  // Add attributes if set
92  $sTags = false;
93  if ($sAttribStyle) {
94  $sTags .= ' style="' . ch_html_attribute($sAttribStyle) . '"';
95  }
96  if ($sAttribAlt) {
97  $sTags .= ' alt="' . ch_html_attribute($sAttribAlt) . '"';
98  }
99  if ($sAttribClass) {
100  $sTags .= ' class="' . ch_html_attribute($sAttribClass) . '"';
101  }
102 
103  return $sImageUrl ? '<img src="' . ch_html_attribute($sImageUrl) . '"'.$sTags.'/>' : false;
104  }
105 
110  function _getThumbnail($sUrl, $aOptions)
111  {
112  // create cache directory if it doesn't exist
114 
115  $aOptions = _generateOptions($aOptions);
116  $aArgs = _generateRequestArgs($aOptions);
117 
118  // Try to grab the thumbnail
119  $iCacheDays = CACHE_DAYS + 0;
120  if ($iCacheDays >= 0 && $aOptions['Embedded'] != 1) {
121  $aArgs['stwurl'] = $sUrl;
122  $sImageUrl = _getCachedThumbnail($aArgs);
123  } else {
124  // Get raw image data
125  unset($aArgs['stwu']); // ONLY on "Advanced" method requests!! (not allowed on embedded)
126  $aArgs['stwembed'] = 1;
127  $aArgs['stwurl'] = $sUrl;
128  $sImageUrl = urldecode("http://images.shrinktheweb.com/xino.php?".http_build_query($aArgs,'','&'));
129  }
130 
131  return $sImageUrl;
132  }
133 
137  function _generateOptions($aOptions)
138  {
139  $aOptions['Size'] = $aOptions['Size'] ? $aOptions['Size'] : getParam('ch_sites_thumb_size');
140  $aOptions['SizeCustom'] = $aOptions['SizeCustom'] ? $aOptions['SizeCustom'] : getParam('ch_sites_thumb_size_custom');
141  $aOptions['FullSizeCapture'] = $aOptions['FullSizeCapture'] ? $aOptions['FullSizeCapture'] : getParam('ch_sites_full_size') == 'on' ? true : false;
142  $aOptions['MaxHeight'] = $aOptions['MaxHeight'] ? $aOptions['MaxHeight'] : getParam('ch_sites_max_height');
143  $aOptions['NativeResolution'] = $aOptions['NativeResolution'] ? $aOptions['NativeResolution'] : getParam('ch_sites_native_res');
144  $aOptions['WidescreenY'] = $aOptions['WidescreenY'] ? $aOptions['WidescreenY'] : getParam('ch_sites_widescreen_y');
145  $aOptions['RefreshOnDemand'] = $aOptions['RefreshOnDemand'] ? $aOptions['RefreshOnDemand'] : false;
146  $aOptions['Delay'] = $aOptions['Delay'] ? $aOptions['Delay'] : getParam('ch_sites_delay');
147  $aOptions['Quality'] = $aOptions['Quality'] ? $aOptions['Quality'] : getParam('ch_sites_quality');
148 
149  return $aOptions;
150  }
151 
155  function _generateRequestArgs($aOptions)
156  {
157  // Get all the options from the database for the thumbnail
158  $aArgs['stwaccesskeyid'] = ACCESS_KEY;
159  $aArgs['stwu'] = SECRET_KEY;
160  $aArgs['stwver'] = VER;
161 
162  // Allowing internal links?
163  if (INSIDE_PAGES) {
164  $aArgs['stwinside'] = 1;
165  }
166 
167  // If SizeCustom is specified and widescreen capturing is not activated,
168  // then use that size rather than the size stored in the settings
169  if (!$aOptions['FullSizeCapture'] && !$aOptions['WidescreenY']) {
170  // Do we have a custom size?
171  if ($aOptions['SizeCustom']) {
172  $aArgs['stwxmax'] = $aOptions['SizeCustom'];
173  } else {
174  $aArgs['stwsize'] = $aOptions['Size'];
175  }
176  }
177 
178  // Use fullsize capturing?
179  if ($aOptions['FullSizeCapture']) {
180  $aArgs['stwfull'] = 1;
181  if ($aOptions['SizeCustom']) {
182  $aArgs['stwxmax'] = $aOptions['SizeCustom'];
183  } else {
184  $aArgs['stwxmax'] = 120;
185  }
186  if ($aOptions['MaxHeight']) {
187  $aArgs['stwymax'] = $aOptions['MaxHeight'];
188  }
189  }
190 
191  // Change native resolution?
192  if ($aOptions['NativeResolution']) {
193  $aArgs['stwnrx'] = $aOptions['NativeResolution'];
194  if ($aOptions['WidescreenY']) {
195  $aArgs['stwnry'] = $aOptions['WidescreenY'];
196  if ($aOptions['SizeCustom']) {
197  $aArgs['stwxmax'] = $aOptions['SizeCustom'];
198  } else {
199  $aArgs['stwxmax'] = 120;
200  }
201  }
202  }
203 
204  // Wait after page load in seconds
205  if ($aOptions['Delay']) {
206  $aArgs['stwdelay'] = intval($aOptions['Delay']) <= 45 ? intval($aOptions['Delay']) : 45;
207  }
208 
209  // Use Refresh On-Demand?
210  if ($aOptions['RefreshOnDemand']) {
211  $aArgs['stwredo'] = 1;
212  }
213 
214  // Use another image quality percent %
215  if ($aOptions['Quality']) {
216  $aArgs['stwq'] = intval($aOptions['Quality']);
217  }
218 
219  // Use custom messages?
220  if (CUSTOM_MSG_URL) {
221  $aArgs['stwrpath'] = CUSTOM_MSG_URL;
222  }
223 
224  return $aArgs;
225  }
226 
230  function _getCachedThumbnail($aArgs = null)
231  {
232  $aArgs = is_array($aArgs) ? $aArgs : array();
233 
234  // Use arguments to work out the target filename
235  $sFilename = _generateHash($aArgs).'.jpg';
236  $sFile = THUMBNAIL_DIR . $sFilename;
237 
238  $sReturnName = false;
239  // Work out if we need to update the cached thumbnail
240  $iForceUpdate = $aArgs['stwredo'] ? true : false;
241  if ($iForceUpdate || _cacheFileExpired($sFile)) {
242  // if quota limit has reached return the QUOTA_IMAGE
244  $sFilename = QUOTA_IMAGE;
245  // if bandwidth limit has reached return the BANDWIDTH_IMAGE
247  $sFilename = BANDWIDTH_IMAGE;
248  // if WAY OVER the limits (i.e. request is ignored by STW) return the NO_RESPONSE_IMAGE
250  $sFilename = NO_RESPONSE_IMAGE;
251  } else {
252  // check if the thumbnail was captured
253  $aImage = _checkWebsiteThumbnailCaptured($aArgs);
254  switch ($aImage['status']) {
255  case 'save': // download the image to local path
256  _downloadRemoteImageToLocalPath($aImage['url'], $sFile);
257  break;
258 
259  case 'nosave': // dont save the image but return the url
260  return $aImage['url'];
261  break;
262 
263  case 'quota_exceed': // download the image to local path for locking requests
264  $sFilename = QUOTA_IMAGE;
265  $sFile = THUMBNAIL_DIR . $sFilename;
266  _downloadRemoteImageToLocalPath($aImage['url'], $sFile);
267  break;
268 
269  case 'bandwidth_exceed': // download the image to local path for locking requests
270  $sFilename = BANDWIDTH_IMAGE;
271  $sFile = THUMBNAIL_DIR . $sFilename;
272  _downloadRemoteImageToLocalPath($aImage['url'], $sFile);
273  break;
274 
275  default: // otherwise return the status
276  return $aImage['status'];
277  }
278  }
279  }
280 
281  $sFile = THUMBNAIL_DIR . $sFilename;
282  // Check if file exists
283  if (file_exists($sFile)) {
284  $sReturnName = THUMBNAIL_URI . $sFilename;
285  }
286 
287  return $sReturnName;
288  }
289 
294  {
295  $sRequestUrl = 'http://images.shrinktheweb.com/xino.php';
296  $sRemoteData = ch_file_get_contents($sRequestUrl, $aArgs);
297 
298  if ($sRemoteData != "") {
299  $aResponse = _getXMLResponse($sRemoteData);
300  // thumbnail is existing, download it
301  if ($aResponse['exists'] && $aResponse['thumbnail'] != '') {
302  $aImage = array('status' => 'save', 'url' => $aResponse['thumbnail']);
303  // lock-to-account, show image but do not store (so users will not be locked out for 6 hours just to update their allowed referrers
304  // bandwidth limit has reached, grab embedded image and store it as BANDWIDTH_IMAGE
305  } else if ($aResponse['stw_bandwidth_remaining'] == 0 && !$aResponse['locked'] && !$aResponse['invalid'] && !$aResponse['exists']) {
306  $aImage = array('status' => 'bandwidth_exceed', 'url' => $aResponse['thumbnail']);
307  // quota limit has reached, grab embedded image and store it as QUOTA_IMAGE
308  } else if ($aResponse['stw_quota_remaining'] == 0 && !$aResponse['locked'] && !$aResponse['invalid'] && !$aResponse['exists']) {
309  $aImage = array('status' => 'quota_exceed', 'url' => $aResponse['thumbnail']);
310  // an error has occured, return the url but dont save the image
311  } else if (!$aResponse['exists'] && $aResponse['thumbnail'] != '') {
312  $aImage = array('status' => 'nosave', 'url' => $aResponse['thumbnail']);
313  // otherwise return error because we dont know the situation
314  } else {
315  $aImage = array('status' => 'error');
316  }
317 
318  if (DEBUG) {
319  $GLOBALS['oChSitesModule']->_oDb->addRequest($aArgs, $aResponse, _generateHash($aArgs));
320  }
321  } else {
322  $aImage = array('status' => 'no_response');
323  }
324 
325  return $aImage;
326  }
327 
332  {
333  $sRemoteData = ch_file_get_contents($sRemoteUrl, array());
334 
335  // Only save data if we managed to get the file content
336  if ($sRemoteData) {
337  if ($oFile = fopen($sFile, "w+")) {
338  fputs($oFile, $sRemoteData);
339  fclose($oFile);
340  }
341  } else {
342  // Try to delete file if download failed
343  if (file_exists($sFile)) {
344  @unlink($sFile);
345  }
346 
347  return false;
348  }
349 
350  return true;
351  }
352 
356  function _getNoResponseImage($sUrl, $aOptions)
357  {
358  // create cache directory if it doesn't exist
360 
361  $aOptions = _generateOptions($aOptions);
362 
363  $aArgs['stwaccesskeyid'] = 'accountproblem';
364 
365  if ($aOptions['SizeCustom']) {
366  $aArgs['stwxmax'] = $aOptions['SizeCustom'];
367  } else {
368  $aArgs['stwsize'] = $aOptions['Size'];
369  }
370 
371  $sRequestUrl = 'http://images.shrinktheweb.com/xino.php';
372  $sRemoteData = ch_file_get_contents($sRequestUrl, $aArgs);
373 
374  if ($sRemoteData != '') {
375  $aResponse = _getXMLResponse($sRemoteData);
376 
377  if (!$aResponse['exists'] && $aResponse['thumbnail'] != '') {
378  $sImageUrl = $aResponse['thumbnail'];
379 
380  $sFilename = NO_RESPONSE_IMAGE;
381  $sFile = THUMBNAIL_DIR . $sFilename;
382  $isDownloaded = _downloadRemoteImageToLocalPath($sImageUrl, $sFile);
383 
384  if ($isDownloaded == true) {
385  return THUMBNAIL_URI . $sFilename;
386  }
387  }
388  }
389 
390  return false;
391  }
392 
399  {
400  // file is not existing
401  if (!file_exists($sFile)) {
402  return false;
403  }
404 
405  // is file older then 6 hours?
406  $iCutoff = time() - (3600 * 6);
407  if (filemtime($sFile) <= $iCutoff) {
408  @unlink($sFile);
409  return false;
410  }
411 
412  // file is existing and not expired!
413  return true;
414  }
415 
420  {
421  // Create cache directory if it doesn't exist
422  if (!file_exists(THUMBNAIL_DIR)) {
423  @mkdir(THUMBNAIL_DIR, 0777, true);
424  } else {
425  // Try to make the directory writable
426  @chmod(THUMBNAIL_DIR, 0777);
427  }
428  }
429 
433  function _generateHash($aArgs)
434  {
435 /* $sPrehash = $aArgs['stwfull'] ? 'a' : 'c';
436  $sPrehash .= $aArgs['stwxmax'].'x'.$aArgs['stwymax'];
437  if ($aArgs['stwnrx']) {
438  $sPrehash .= 'b'.$aArgs['stwnrx'].'x'.$aArgs['stwnry'];
439  }
440  $sPrehash .= $aArgs['stwinside'];*/
441 
442  $aReplace = array('http', 'https', 'ftp', '://');
443  $sUrl = str_replace($aReplace, '', $aArgs['stwurl']);
444 
445 // return md5($sPrehash.$aArgs['stwsize'].$aArgs['stwq'].$sUrl);
446  return md5($sUrl);
447  }
448 
452  function _getXMLResponse($sResponse)
453  {
454  if (extension_loaded('simplexml')) { // If simplexml is available, we can do more stuff!
455  $oDOM = new DOMDocument;
456  $oDOM->loadXML($sResponse);
457  $sXML = simplexml_import_dom($oDOM);
458  $sXMLLayout = 'http://www.shrinktheweb.com/doc/stwresponse.xsd';
459 
460  // Pull response codes from XML feed
461  $aResponse['stw_response_status'] = $sXML->children($sXMLLayout)->Response->ResponseStatus->StatusCode; // HTTP Response Code
462  $aResponse['stw_action'] = $sXML->children($sXMLLayout)->Response->ThumbnailResult->Thumbnail[1]; // ACTION
463  $aResponse['stw_response_code'] = $sXML->children($sXMLLayout)->Response->ResponseCode->StatusCode; // STW Error Response
464  $aResponse['stw_last_captured'] = $sXML->children($sXMLLayout)->Response->ResponseTimestamp->StatusCode; // Last Captured
465  $aResponse['stw_quota_remaining'] = $sXML->children($sXMLLayout)->Response->Quota_Remaining->StatusCode; // New Reqs left for today
466  $aResponse['stw_bandwidth_remaining'] = $sXML->children($sXMLLayout)->Response->Bandwidth_Remaining->StatusCode; // New Reqs left for today
467  $aResponse['stw_category_code'] = $sXML->children($sXMLLayout)->Response->CategoryCode->StatusCode; // Not yet implemented
468  $aResponse['thumbnail'] = $sXML->children($sXMLLayout)->Response->ThumbnailResult->Thumbnail[0]; // Image Location (alt method)
469  } else {
470  // LEGACY SUPPPORT
471  $aResponse['stw_response_status'] = _getLegacyResponse('ResponseStatus', $sRemoteData);
472  $aResponse['stw_response_code'] = _getLegacyResponse('ResponseCode', $sRemoteData);
473 
474  // check remaining quota
475  $aResponse['stw_quota_remaining'] = _getLegacyResponse('Quota_Remaining', $sRemoteData);
476  // check remaining bandwidth
477  $aResponse['stw_bandwidth_remaining'] = _getLegacyResponse('Bandwidth_Remaining', $sRemoteData);
478 
479  // get thumbnail and status
480  $aThumbnail = _getThumbnailStatus($sRemoteData);
481  $aResponse = array_merge($aResponse, $aThumbnail);
482  }
483 
484  if ($aResponse['stw_action'] == 'delivered') {
485  $aResponse['exists'] = true;
486  } else {
487  $aResponse['exists'] = false;
488  }
489 
490  if ($aResponse['stw_action'] == 'fix_and_retry') {
491  $aResponse['problem'] = true;
492  } else {
493  $aResponse['problem'] = false;
494  }
495 
496  if ($aResponse['stw_action'] == 'noretry' && !$aResponse['exists']) {
497  $aResponse['error'] = true;
498  } else {
499  $aResponse['error'] = false;
500  }
501 
502  // if we use the advanced api for free account we get an invalid request
503  if ($aResponse['stw_response_code'] == 'INVALID_REQUEST') {
504  $aResponse['invalid'] = true;
505  } else {
506  $aResponse['invalid'] = false;
507  }
508 
509  // if our domain or IP is not listed in the account's "Allowed Referrers" AND "Lock to Account" is enabled, then we get this error
510  if ($aResponse['stw_response_code'] == 'LOCK_TO_ACCOUNT') {
511  $aResponse['locked'] = true;
512  } else {
513  $aResponse['locked'] = false;
514  }
515 
516  return $aResponse;
517  }
518 
519  function _getLegacyResponse($sSearch, $s)
520  {
521  $sRegex = '/<[^:]*:' . $sSearch . '[^>]*>[^<]*<[^:]*:StatusCode[^>]*>([^<]*)<\//';
522  if (preg_match($sRegex, $s, $sMatches)) {
523  return $sMatches[1];
524  }
525  return false;
526  }
527 
529  {
530  $sRegex = '/<[^:]*:ThumbnailResult?[^>]*>[^<]*<[^:]*:Thumbnail\s*(?:Exists=\"((?:true)|(?:false))\")+[^>]*>([^<]*)<\//';
531  if (preg_match($sRegex, $s, $sMatches)) {
532  return array('stw_action' => $sMatches[1],
533  'thumbnail' => $sMatches[2]);
534  }
535  return false;
536  }
537 
542  {
543  // Use setting to check age of files.
544  $iCacheDays = CACHE_DAYS + 0;
545 
546  // dont update image once it is cached
547  if ($iCacheDays == 0 && file_exists($sFile)) {
548  return false;
549  // check age of file and if file exists return false, otherwise recache the file
550  } else {
551  $iCutoff = time() - (3600 * 24 * $iCacheDays);
552  return (!file_exists($sFile) || filemtime($sFile) <= $iCutoff);
553  }
554  }
555 
559  function _getArrayValue($aArray, $sKey, $isReturnSpace = false)
560  {
561  if ($aArray && isset($aArray[$sKey])) {
562  return $aArray[$sKey];
563  }
564 
565  // If returnSpace is true, then return a space rather than nothing at all
566  if ($isReturnSpace) {
567  return '&nbsp;';
568  } else {
569  return false;
570  }
571  }
572 
576  function _getAccXMLResponse($sResponse)
577  {
578  if (extension_loaded('simplexml')) { // If simplexml is available, we can do more stuff!
579  $oDOM = new DOMDocument;
580  $oDOM->loadXML($sResponse);
581  $sXML = simplexml_import_dom($oDOM);
582  $sXMLLayout = 'http://www.shrinktheweb.com/doc/stwacctresponse.xsd';
583 
584  // Pull response codes from XML feed
585  $aResponse['stw_response_status'] = $sXML->children($sXMLLayout)->Response->Status->StatusCode; // Response Code
586  $aResponse['stw_account_level'] = $sXML->children($sXMLLayout)->Response->Account_Level->StatusCode; // Account level
587  // check for enabled upgrades
588  $aResponse['stw_inside_pages'] = $sXML->children($sXMLLayout)->Response->Inside_Pages->StatusCode; // Inside Pages
589  $aResponse['stw_custom_size'] = $sXML->children($sXMLLayout)->Response->Custom_Size->StatusCode; // Custom Size
590  $aResponse['stw_full_length'] = $sXML->children($sXMLLayout)->Response->Full_Length->StatusCode; // Full Length
591  $aResponse['stw_refresh_ondemand'] = $sXML->children($sXMLLayout)->Response->Refresh_OnDemand->StatusCode; // Refresh OnDemand
592  $aResponse['stw_custom_delay'] = $sXML->children($sXMLLayout)->Response->Custom_Delay->StatusCode; // Custom Delay
593  $aResponse['stw_custom_quality'] = $sXML->children($sXMLLayout)->Response->Custom_Quality->StatusCode; // Custom Quality
594  $aResponse['stw_custom_resolution'] = $sXML->children($sXMLLayout)->Response->Custom_Resolution->StatusCode; // Custom Resolution
595  $aResponse['stw_custom_messages'] = $sXML->children($sXMLLayout)->Response->Custom_Messages->StatusCode; // Custom Messages
596  } else {
597  // LEGACY SUPPPORT
598  $aResponse['stw_response_status'] = _getLegacyResponse('Status', $sRemoteData);
599  $aResponse['stw_account_level'] = _getLegacyResponse('Account_Level', $sRemoteData); // Account level
600  // check for enabled upgrades
601  $aResponse['stw_inside_pages'] = _getLegacyResponse('Inside_Pages', $sRemoteData); // Inside Pages
602  $aResponse['stw_custom_size'] = _getLegacyResponse('Custom_Size', $sRemoteData); // Custom Size
603  $aResponse['stw_full_length'] = _getLegacyResponse('Full_Length', $sRemoteData); // Full Length
604  $aResponse['stw_refresh_ondemand'] = _getLegacyResponse('Refresh_OnDemand', $sRemoteData); // Refresh OnDemand
605  $aResponse['stw_custom_delay'] = _getLegacyResponse('Custom_Delay', $sRemoteData); // Custom Delay
606  $aResponse['stw_custom_quality'] = _getLegacyResponse('Custom_Quality', $sRemoteData); // Custom Quality
607  $aResponse['stw_custom_resolution'] = _getLegacyResponse('Custom_Resolution', $sRemoteData); // Custom Resolution
608  $aResponse['stw_custom_messages'] = _getLegacyResponse('Custom_Messages', $sRemoteData); // Custom Messages
609  }
610 
611  return $aResponse;
612  }
true
if(!defined("TRUE_VAL")) define("TRUE_VAL" true
Definition: constants.inc.php:8
_cacheFileExpired
_cacheFileExpired($sFile)
Definition: ChSitesSTW.php:541
VER
const VER
Definition: ChSitesSTW.php:18
_generateRequestArgs
_generateRequestArgs($aOptions)
Definition: ChSitesSTW.php:155
_downloadRemoteImageToLocalPath
_downloadRemoteImageToLocalPath($sRemoteUrl, $sFile)
Definition: ChSitesSTW.php:331
_getThumbnailStatus
_getThumbnailStatus($s)
Definition: ChSitesSTW.php:528
DEBUG
const DEBUG
Definition: ChSitesSTW.php:19
$sUrl
$sUrl
Definition: cart.php:15
php
ACCOUNT_TYPE
const ACCOUNT_TYPE
Definition: ChSitesSTW.php:10
_generateOptions
_generateOptions($aOptions)
Definition: ChSitesSTW.php:137
_generateHash
_generateHash($aArgs)
Definition: ChSitesSTW.php:433
_createCacheDirectory
_createCacheDirectory()
Definition: ChSitesSTW.php:419
INSIDE_PAGES
const INSIDE_PAGES
Definition: ChSitesSTW.php:13
_getXMLResponse
_getXMLResponse($sResponse)
Definition: ChSitesSTW.php:452
_getAccXMLResponse
_getAccXMLResponse($sResponse)
Definition: ChSitesSTW.php:576
ch_html_attribute
ch_html_attribute($mixedInput)
Definition: utils.inc.php:1324
_getLegacyResponse
_getLegacyResponse($sSearch, $s)
Definition: ChSitesSTW.php:519
SECRET_KEY
const SECRET_KEY
Definition: ChSitesSTW.php:9
$sFile
$sFile
Definition: index.php:20
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
_getThumbnail
_getThumbnail($sUrl, $aOptions)
Definition: ChSitesSTW.php:110
$sTags
$sTags
Definition: actions.inc.php:12
_getThumbnailPaid
_getThumbnailPaid($sUrl, $aOptions, $sAttribAlt, $sAttribClass, $sAttribStyle)
Definition: ChSitesSTW.php:82
ch_file_get_contents
ch_file_get_contents($sFileUrl, $aParams=array(), $sMethod='get', $aHeaders=array(), &$sHttpCode=null)
Definition: utils.inc.php:1357
QUOTA_IMAGE
const QUOTA_IMAGE
Definition: ChSitesSTW.php:20
time
that in the case of a Adaptation or at a minimum such credit will if a credit for all contributing authors of the Adaptation or Collection then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors For the avoidance of You may only use the credit required by this Section for the purpose of attribution in the manner set out above by exercising Your rights under this You may not implicitly or explicitly assert or imply any connection sponsorship or endorsement by the Original Licensor and or Attribution as of You or Your use of the without the express prior written permission of the Original Licensor and or Attribution Parties Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable if You Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or You must not modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author s honor or reputation Licensor agrees that in those in which any exercise of the right granted in modification or other derogatory action prejudicial to the Original Author s honor and the Licensor will waive or not as this to the fullest extent permitted by the applicable national to enable You to reasonably exercise Your right under Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN LICENSOR OFFERS THE WORK AS IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE STATUTORY OR WITHOUT WARRANTIES OF FITNESS FOR A PARTICULAR OR THE ABSENCE OF LATENT OR OTHER OR THE PRESENCE OF ABSENCE OF WHETHER OR NOT DISCOVERABLE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED SO SUCH EXCLUSION MAY NOT APPLY TO YOU Limitation on Liability EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License Individuals or entities who have received Adaptations or Collections from You under this will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses and will survive any termination of this License Subject to the above terms and the license granted here is Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time
Definition: license.txt:56
CACHE_DAYS
const CACHE_DAYS
Definition: ChSitesSTW.php:15
CUSTOM_MSG_URL
const CUSTOM_MSG_URL
Definition: ChSitesSTW.php:14
$s
$s
Definition: embed.php:13
getThumbnailHTML
getThumbnailHTML($sUrl, $aOptions, $sAttribAlt=false, $sAttribClass=false, $sAttribStyle=false)
Definition: ChSitesSTW.php:34
_getNoResponseImage
_getNoResponseImage($sUrl, $aOptions)
Definition: ChSitesSTW.php:356
_getArrayValue
_getArrayValue($aArray, $sKey, $isReturnSpace=false)
Definition: ChSitesSTW.php:559
THUMBNAIL_DIR
const THUMBNAIL_DIR
Definition: ChSitesSTW.php:12
_checkLimitReached
_checkLimitReached($sFile)
Definition: ChSitesSTW.php:398
NO_RESPONSE_IMAGE
const NO_RESPONSE_IMAGE
Definition: ChSitesSTW.php:22
THUMBNAIL_URI
const THUMBNAIL_URI
Definition: ChSitesSTW.php:11
ACCESS_KEY
const ACCESS_KEY
Definition: ChSitesSTW.php:8
saveAccountInfo
saveAccountInfo()
Definition: ChSitesSTW.php:49
_getCachedThumbnail
_getCachedThumbnail($aArgs=null)
Definition: ChSitesSTW.php:230
deleteThumbnail
deleteThumbnail($sUrl, $aOptions=array())
Definition: ChSitesSTW.php:68
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10
BANDWIDTH_IMAGE
const BANDWIDTH_IMAGE
Definition: ChSitesSTW.php:21
_checkWebsiteThumbnailCaptured
_checkWebsiteThumbnailCaptured($aArgs)
Definition: ChSitesSTW.php:293