43 lines
8.5 KiB
PHP
43 lines
8.5 KiB
PHP
<?php
|
|
$resourcesPublications = <<<EOF
|
|
<h2>相关材料与文献</h2> <h2 class="mobile-popup-trigger"> 技术资料 <span>(4)</span> </h2> <div class="swiper-container product-pdf-slider"><div class="materials mobile-popup swiper-wrapper"> <div class="tile swiper-slide"> <div class="material sync-height"> <div class="material-image"> <a href="https://cdn.stemcell.com/media/files/brochure/BR27276-Automate_and_Standardize_with_STEMprep.pdf" target="_blank"> <div class="material-image-container"> <picture> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/b/r/br182-stemprep_-brochure_thumbnail.jpg?width=175&height=100&fit=crop" media="(min-width: 768px) and (max-width: 1007px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/b/r/br182-stemprep_-brochure_thumbnail.jpg?width=227&height=130&fit=crop" media="(min-width: 481px) and (max-width: 767px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/b/r/br182-stemprep_-brochure_thumbnail.jpg?width=204&height=115&fit=crop" media="(max-width: 480px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/b/r/br182-stemprep_-brochure_thumbnail.jpg?width=303&height=170&fit=crop"> <img loading="lazy" src="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/b/r/br182-stemprep_-brochure_thumbnail.jpg?width=303&height=170&fit=crop" width="303" height="170" alt="Automate and Standardize with STEMprep™"> </picture> </div> </a> </div> <div class="type-name"> Brochure </div> <div class="material-name" title="Automate and Standardize with STEMprep™"> <a href="https://cdn.stemcell.com/media/files/brochure/BR27276-Automate_and_Standardize_with_STEMprep.pdf" target="_blank"> Automate and Standardize with STEMprep™ </a> </div> </div> </div> <div class="tile swiper-slide"> <div class="material sync-height"> <div class="material-image"> <a href="/technical-resources/elevate-tissue-dissociation-with-stemprep.html" target="_blank"> <div class="material-image-container"> <picture> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/e/a/easysep-simple-choice.jpg?width=175&height=100&fit=crop" media="(min-width: 768px) and (max-width: 1007px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/e/a/easysep-simple-choice.jpg?width=227&height=130&fit=crop" media="(min-width: 481px) and (max-width: 767px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/e/a/easysep-simple-choice.jpg?width=204&height=115&fit=crop" media="(max-width: 480px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/e/a/easysep-simple-choice.jpg?width=303&height=170&fit=crop"> <img loading="lazy" src="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/e/a/easysep-simple-choice.jpg?width=303&height=170&fit=crop" width="303" height="170" alt="Elevate Tissue Dissociation with STEMprep™"> </picture> </div> </a> <div class="duration"> 1:44 </div> </div> <div class="type-name"> Video </div> <div class="material-name" title="Elevate Tissue Dissociation with STEMprep™"> <a href="https://www.stemcell.com/technical-resources/elevate-tissue-dissociation-with-stemprep.html" target="_blank"> Elevate Tissue Dissociation with STEMprep™ </a> </div> </div> </div> <div class="tile swiper-slide"> <div class="material sync-height"> <div class="material-image"> <a href="https://www.stemcell.com/technical-resources/aai2025-stemprep-workshop.html" target="_blank"> <div class="material-image-container"> <picture> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/t/stemprep-aai-workshopl-519x291.jpg?width=175&height=100&fit=crop" media="(min-width: 768px) and (max-width: 1007px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/t/stemprep-aai-workshopl-519x291.jpg?width=227&height=130&fit=crop" media="(min-width: 481px) and (max-width: 767px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/t/stemprep-aai-workshopl-519x291.jpg?width=204&height=115&fit=crop" media="(max-width: 480px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/t/stemprep-aai-workshopl-519x291.jpg?width=303&height=170&fit=crop"> <img loading="lazy" src="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/t/stemprep-aai-workshopl-519x291.jpg?width=303&height=170&fit=crop" width="303" height="170" alt="Streamline Your Tissue Processing Using the Automated STEMprep™ Tissue Dissociator"> </picture> </div> </a> <div class="duration"> 24:08 </div> </div> <div class="type-name"> Webinar </div> <div class="material-name" title="Streamline Your Tissue Processing Using the Automated STEMprep™ Tissue Dissociator"> <a href="https://www.stemcell.com/technical-resources/aai2025-stemprep-workshop.html" target="_blank"> Streamline Your Tissue Processing Using the Automated STEMprep™ Tissue Dissociator </a> </div> </div> </div> <div class="tile swiper-slide"> <div class="material sync-height"> <div class="material-image"> <a href="https://cdn.stemcell.com/media/files/scientificposter/SP00296-Automate_Tissue_Processing_with_STEMprep_for_Versatile_Sample_Preparation.pdf" target="_blank"> <div class="material-image-container"> <picture> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/p/sp00296-thumbnail.png?width=175&height=100&fit=crop" media="(min-width: 768px) and (max-width: 1007px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/p/sp00296-thumbnail.png?width=227&height=130&fit=crop" media="(min-width: 481px) and (max-width: 767px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/p/sp00296-thumbnail.png?width=204&height=115&fit=crop" media="(max-width: 480px)"> <source srcset="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/p/sp00296-thumbnail.png?width=303&height=170&fit=crop"> <img loading="lazy" src="https://www.stemcell.com/media/catalog/product/cache/a3b2788186157220f33afb50b11e7d2a/s/p/sp00296-thumbnail.png?width=303&height=170&fit=crop" width="303" height="170" alt="Automate Tissue Processing with STEMprep™ for Versatile Sample Preparation"> </picture> </div> </a> </div> <div class="type-name"> Scientific Poster </div> <div class="material-name" title="Automate Tissue Processing with STEMprep™ for Versatile Sample Preparation"> <a href="https://cdn.stemcell.com/media/files/scientificposter/SP00296-Automate_Tissue_Processing_with_STEMprep_for_Versatile_Sample_Preparation.pdf" target="_blank"> Automate Tissue Processing with STEMprep™ for Versatile Sample Preparation </a> </div> </div> </div> </div> <div class="swiper-pagination"></div></div>
|
|
EOF;
|
|
|
|
// echo preg_replace(
|
|
// '#https://cdn\.stemcell\.com([^"\']+\.pdf)#i',
|
|
// 'https://uat.stemcell.cn$1',
|
|
// $resourcesPublications
|
|
// );
|
|
$mediaDomain = 'https://uat.stemcell.cn';
|
|
echo $resourcesPublications = preg_replace_callback(
|
|
'#<a[^>]+href="([^"]+\.html[^"]*)"[^>]*>#i',
|
|
function ($matches) use ($mediaDomain) {
|
|
|
|
$newUrl = preg_replace(
|
|
'#https://www\.stemcell\.com#',
|
|
$mediaDomain,
|
|
$matches[1]
|
|
);
|
|
$newUrl = preg_replace('/^:\/\//', '', $newUrl);
|
|
var_export(parse_url($newUrl, PHP_URL_SCHEME), parse_url($newUrl, PHP_URL_HOST));
|
|
// $newUrl = parse_url($newUrl, PHP_URL_SCHEME).'://'.parse_url($newUrl, PHP_URL_HOST).'/'.basename(parse_url($newUrl, PHP_URL_PATH));
|
|
|
|
return str_replace($matches[1], $newUrl, $matches[0]);
|
|
},
|
|
$resourcesPublications
|
|
);
|
|
|
|
|
|
$data = [
|
|
'row1' => [
|
|
['base_image'=>'aaaaa', 'small_image'=>'bbbb', 'thumbnail_image'=>'bbbbbbb'],
|
|
['base_image'=>'aaaaa1', 'small_image'=>'bbbb1', 'thumbnail_image'=>'bbbbbbb'],
|
|
['base_image'=>'aaaaa1', 'small_image'=>'bbbb1', 'thumbnail_image'=>'bbbbbbb'],
|
|
],
|
|
'row2' => [
|
|
['base_image'=>'aaaaa2', 'small_image'=>'bbbb2', 'thumbnail_image'=>'bbbbbbb2'],
|
|
['base_image'=>'aaaaa2', 'small_image'=>'bbbb2', 'thumbnail_image'=>'bbbbbbb'],
|
|
['base_image'=>'aaaaa2', 'small_image'=>'bbbb2', 'thumbnail_image'=>'bbbbbbb'],
|
|
]
|
|
];
|