国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.7KB

  1. <?php
  2. /**
  3. * 显示图片
  4. *
  5. * @version $Id: showphoto.php$
  6. * @package DedeBIZ.Site
  7. * @copyright Copyright (c) 2022, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__)."/../system/common.inc.php");
  12. require_once(DEDEINC."/channelunit.class.php");
  13. if (isset($arcID)) $aid = $arcID;
  14. $arcID = $aid = (isset($aid) && is_numeric($aid)) ? $aid : 0;
  15. if ($aid == 0) die("dedebiz");
  16. //读取文档信息
  17. $arctitle = '';
  18. $arcurl = '';
  19. $topid = 0;
  20. $arcRow = $dsql->GetOne("SELECT arc.title,arc.senddate,arc.arcrank,arc.ismake,arc.money,arc.typeid,tp.topid,tp.typedir,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid WHERE arc.id='$aid'");
  21. if (is_array($arcRow)) {
  22. $arctitle = $arcRow['title'];
  23. $topid = $arcRow['topid'];
  24. $arcurl = @GetFileUrl(
  25. $aid,
  26. $arcRow['typeid'],
  27. $arcRow['senddate'],
  28. $arctitle,
  29. $arcRow['ismake'],
  30. $arcRow['arcrank'],
  31. $arcRow['namerule'],
  32. $arcRow['typedir'],
  33. $arcRow['money'],
  34. $arcRow['filename'],
  35. $arcRow['moresite'],
  36. $arcRow['siteurl'],
  37. $arcRow['sitepath']
  38. );
  39. } else {
  40. ShowMsg('无法浏览未知文档!', '-1');
  41. exit();
  42. }
  43. if (empty($mx)) $mx = $cfg_album_width;
  44. $pageGuide = "";
  45. //获取上下幅图片链接
  46. $row = $dsql->GetOne("SELECT imgurls FROM `#@__addonimages` WHERE aid='{$aid}'");
  47. $i = 0;
  48. $nextSrc = '';
  49. $preSrc = '';
  50. $dtp = new DedeTagParse();
  51. $dtp->LoadSource($row['imgurls']);
  52. foreach ($dtp->CTags as $ctag) {
  53. if ($ctag->GetName() == "img") {
  54. if ($i == ($npos - 1)) $preSrc = trim($ctag->GetInnerText());
  55. if ($i == ($npos + 1)) $nextSrc = trim($ctag->GetInnerText());
  56. $i++;
  57. }
  58. }
  59. unset($dtp);
  60. if ($cfg_multi_site == 'Y') {
  61. if (!preg_match("/^http:/i", $preSrc) && !empty($preSrc)) $preSrc = $cfg_basehost.$preSrc;
  62. if (!preg_match("/^http:/i", $nextSrc) && !empty($nextSrc)) $nextSrc = $cfg_basehost.$nextSrc;
  63. }
  64. if ($preSrc != '') {
  65. $pageGuide .= "<a href='showphoto.php?aid={$aid}&src=".urlencode($preSrc)."&npos=".($npos - 1)."'>&lt;&lt;上一幅图片</a> ";
  66. } else {
  67. $pageGuide .= "这是开始";
  68. }
  69. $nextlink = 'javascript:;';
  70. if ($nextSrc != '') {
  71. $nextlink = "showphoto.php?aid={$aid}&src=".urlencode($nextSrc)."&npos=".($npos + 1);
  72. if ($pageGuide != "") $pageGuide .= " | ";
  73. $pageGuide .= "<a href='showphoto.php?aid={$aid}&src=".urlencode($nextSrc)."&npos=".($npos + 1)."'>下一幅图片&gt;</a>";
  74. } else {
  75. $pageGuide .= " | 没有了";
  76. }
  77. require_once(DEDETEMPLATE.'/plus/showphoto.htm');
  78. exit();