国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

83 行
2.7KB

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