|
|
@ -342,8 +342,13 @@ if (!empty($q)) { |
|
|
|
($hostImage->port ? ':' . $hostImage->port : false) . |
|
|
|
($hostImage->port ? ':' . $hostImage->port : false) . |
|
|
|
$hostImage->uri; |
|
|
|
$hostImage->uri; |
|
|
|
|
|
|
|
|
|
|
|
// Get remote image data |
|
|
|
// Get local image data |
|
|
|
if (empty($hostImage->data)) { |
|
|
|
if ($lastHostImageDescription = $db->getLastHostImageDescription($hostImage->hostImageId)) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$hostImageURLencoded = $lastHostImageDescription->data; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get remote if local index not found or CRAWL_HOST_DEFAULT_META_ONLY enabled |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
// Init image request |
|
|
|
// Init image request |
|
|
|
$hostImageCurl = new Curl($hostImageURL, PROXY_CURLOPT_USERAGENT); |
|
|
|
$hostImageCurl = new Curl($hostImageURL, PROXY_CURLOPT_USERAGENT); |
|
|
@ -420,29 +425,15 @@ if (!empty($q)) { |
|
|
|
Filter::mime($hostImageContentType), |
|
|
|
Filter::mime($hostImageContentType), |
|
|
|
time()); |
|
|
|
time()); |
|
|
|
|
|
|
|
|
|
|
|
// Set host image description |
|
|
|
$db->setHostImageDescriptionData($hostImage->hostImageId, |
|
|
|
// On link collection we knew meta but data, |
|
|
|
crc32($hostImageURLencoded), |
|
|
|
// this step use latest description slice and insert the data received by curl request |
|
|
|
$hostImage->crawlMetaOnly ? null : $hostImageURLencoded, |
|
|
|
if ($lastHostImageDescription = $db->getLastHostImageDescription($hostImage->hostImageId)) { |
|
|
|
time()); |
|
|
|
|
|
|
|
|
|
|
|
$db->setHostImageDescription($hostImage->hostImageId, |
|
|
|
|
|
|
|
crc32($hostImageData), |
|
|
|
|
|
|
|
$lastHostImageDescription->alt, |
|
|
|
|
|
|
|
$lastHostImageDescription->title, |
|
|
|
|
|
|
|
$hostImage->crawlMetaOnly ? null : $hostImageData, |
|
|
|
|
|
|
|
time()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Local image data exists |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$hostImageURLencoded = $hostImage->data; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
?> |
|
|
|
?> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<a href="<?php echo $hostImageURL ?>"> |
|
|
|
<a href="<?php echo $hostImageURL ?>"> |
|
|
|
<img src="<?php echo $hostImageURLencoded ?>" alt="<?php echo htmlentities($hostImage->description) ?>" title="<?php echo htmlentities($hostImageURL) ?>" class="image" /> |
|
|
|
<img src="<?php echo $hostImageURLencoded ?>" alt="<?php echo htmlentities($hostImageURL) ?>" title="<?php echo htmlentities($hostImageURL) ?>" class="image" /> |
|
|
|
</a> |
|
|
|
</a> |
|
|
|
<?php $hostImageHostPagesTotal = $db->getHostImageHostPagesTotal($result->id) ?> |
|
|
|
<?php $hostImageHostPagesTotal = $db->getHostImageHostPagesTotal($result->id) ?> |
|
|
|
<?php foreach ((array) $db->getHostImageHostPages($result->id, WEBSITE_SEARCH_IMAGE_RELATED_PAGE_RESULTS_LIMIT) as $hostPage) { ?> |
|
|
|
<?php foreach ((array) $db->getHostImageHostPages($result->id, WEBSITE_SEARCH_IMAGE_RELATED_PAGE_RESULTS_LIMIT) as $hostPage) { ?> |
|
|
|