$am =& $GLOBALS['SQ_SYSTEM']->am; $thumbnail = null; if ($metadata_asset->useSystemVersion()) { $notice_links = unserialize(file_to_string($metadata_asset->data_path.'/.sq_notice_links')); foreach ($notice_links as $link) { if ($link['value'] == 'thumbnail') { $thumbnail = $GLOBALS['SQ_SYSTEM']->am->getAsset($link['minorid']); break; } } } else { if ($metadata_asset->id) { $link = $GLOBALS['SQ_SYSTEM']->am->getLink($metadata_asset->id, SQ_LINK_NOTICE, 'image', FALSE, 'thumbnail'); if (!empty($link)) { $thumbnail = $GLOBALS['SQ_SYSTEM']->am->getAsset($link['minorid'], $link['minor_type_code']); } } } $metadata_replacements['asset_thumbnail_v_ls_small_url'] = (is_null($thumbnail)) ? '' : $thumbnail->getKeywordReplacement('image_v_ls_small_url');