国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

48 satır
1.6KB

  1. <?php
  2. if (!defined('DEDEINC')) exit ('dedebiz');
  3. /**
  4. * @version $id:productimagelist.lib.php 9:29 2010年7月6日 tianya $
  5. * @package DedeBIZ.Taglib
  6. * @copyright Copyright (c) 2022 DedeBIZ.COM
  7. * @license https://www.dedebiz.com/license
  8. * @link https://www.dedebiz.com
  9. */
  10. function lib_productimagelist(&$ctag, &$refObj)
  11. {
  12. global $dsql, $sqlCt;
  13. $attlist = "desclen|80";
  14. FillAttsDefault($ctag->CAttribute->Items, $attlist);
  15. extract($ctag->CAttribute->Items, EXTR_SKIP);
  16. if (!isset($refObj->addTableRow['imgurls'])) return;
  17. $revalue = '';
  18. $innerText = trim($ctag->GetInnerText());
  19. if (empty($innerText)) $innerText = GetSysTemplets('productimagelist.htm');
  20. $dtp = new DedeTagParse();
  21. $dtp->LoadSource($refObj->addTableRow['imgurls']);
  22. $images = array();
  23. if (is_array($dtp->CTags)) {
  24. foreach ($dtp->CTags as $ctag) {
  25. if ($ctag->GetName() == "img") {
  26. $row = array();
  27. $row['imgsrc'] = trim($ctag->GetInnerText());
  28. $row['text'] = $ctag->GetAtt('text');
  29. $images[] = $row;
  30. }
  31. }
  32. }
  33. $dtp->Clear();
  34. $revalue = '';
  35. $ctp = new DedeTagParse();
  36. $ctp->SetNameSpace('field', '[', ']');
  37. $ctp->LoadSource($innerText);
  38. foreach ($images as $row) {
  39. foreach ($ctp->CTags as $tagid => $ctag) {
  40. if (isset($row[$ctag->GetName()])) {
  41. $ctp->Assign($tagid, $row[$ctag->GetName()]);
  42. }
  43. }
  44. $revalue .= $ctp->GetResult();
  45. }
  46. return $revalue;
  47. }
  48. ?>