国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

80 líneas
2.6KB

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