3_3_forum_discuzcode.tpl.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. <?php if(!defined('IN_DISCUZ')) exit('Access Denied');
  2. function tpl_hide_credits_hidden($creditsrequire) {
  3. global $_G;
  4. ?><?php
  5. $return = <<<EOF
  6. <div class="locked">
  7. EOF;
  8. if($_G['uid']) {
  9. $return .= <<<EOF
  10. {$_G['username']}
  11. EOF;
  12. } else {
  13. $return .= <<<EOF
  14. 游客
  15. EOF;
  16. }
  17. $return .= <<<EOF
  18. ,本帖隐藏的内容需要积分高于 {$creditsrequire} 才可浏览,您当前积分为 {$_G['member']['credits']}</div>
  19. EOF;
  20. ?><?php
  21. return $return;
  22. }
  23. function tpl_hide_credits($creditsrequire, $message) {
  24. ?><?php
  25. $return = <<<EOF
  26. <div class="locked">以下内容需要积分高于 {$creditsrequire} 才可浏览</div>
  27. {$message}<br /><br />
  28. EOF;
  29. ?><?php
  30. return $return;
  31. }
  32. function tpl_codedisp($code) {
  33. $randomid = 'code_'.random(3);
  34. ?><?php
  35. $return = <<<EOF
  36. <div class="blockcode"><div id="{$randomid}"><ol><li>{$code}</ol></div><em onclick="copycode($('{$randomid}'));">复制代码</em></div>
  37. EOF;
  38. ?><?php
  39. return $return;
  40. }
  41. function tpl_quote() {
  42. ?><?php
  43. $return = <<<EOF
  44. <div class="quote"><blockquote>\\1</blockquote></div>
  45. EOF;
  46. ?><?php
  47. return $return;
  48. }
  49. function tpl_free() {
  50. ?><?php
  51. $return = <<<EOF
  52. <div class="quote"><blockquote>\\1</blockquote></div>
  53. EOF;
  54. ?><?php
  55. return $return;
  56. }
  57. function tpl_hide_reply() {
  58. global $_G;
  59. ?><?php
  60. $return = <<<EOF
  61. <div class="showhide"><h4>本帖隐藏的内容</h4>\\1</div>
  62. EOF;
  63. ?><?php
  64. return $return;
  65. }
  66. function tpl_hide_reply_hidden() {
  67. global $_G;
  68. ?><?php
  69. $return = <<<EOF
  70. <div class="locked">
  71. EOF;
  72. if($_G['uid']) {
  73. $return .= <<<EOF
  74. {$_G['username']}
  75. EOF;
  76. } else {
  77. $return .= <<<EOF
  78. 游客
  79. EOF;
  80. }
  81. $return .= <<<EOF
  82. ,如果您要查看本帖隐藏内容请<a href="forum.php?mod=post&amp;action=reply&amp;fid={$_G['fid']}&amp;tid={$_G['tid']}" onclick="showWindow('reply', this.href)">回复</a></div>
  83. EOF;
  84. ?><?php
  85. return $return;
  86. }
  87. function attachlist($attach) {
  88. global $_G;
  89. $attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp')));
  90. $aidencode = packaids($attach);
  91. $widthcode = attachwidth($attach['width']);
  92. $is_archive = $_G['forum_thread']['is_archived'] ? "&fid=".$_G['fid']."&archiveid=".$_G[forum_thread][archiveid] : '';
  93. $pluginhook = !empty($_G['setting']['pluginhooks']['viewthread_attach_extra'][$attach[aid]]) ? $_G['setting']['pluginhooks']['viewthread_attach_extra'][$attach[aid]] : '';
  94. ?><?php
  95. $return = <<<EOF
  96. <ignore_js_op>
  97. <dl class="tattl">
  98. <dt>
  99. {$attach['attachicon']}
  100. </dt>
  101. <dd>
  102. <p class="attnm">
  103. EOF;
  104. if(!$attach['price'] || $attach['payed']) {
  105. $return .= <<<EOF
  106. <a href="forum.php?mod=attachment{$is_archive}&amp;aid={$aidencode}"
  107. EOF;
  108. if($_GET['from'] != 'preview') {
  109. $return .= <<<EOF
  110. onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"
  111. EOF;
  112. }
  113. $return .= <<<EOF
  114. id="aid{$attach['aid']}" target="_blank">{$attach['filename']}</a>
  115. EOF;
  116. } else {
  117. $return .= <<<EOF
  118. <a href="forum.php?mod=misc&amp;action=attachpay&amp;aid={$attach['aid']}&amp;tid={$attach['tid']}" onclick="showWindow('attachpay', this.href)">{$attach['filename']}</a>
  119. EOF;
  120. }
  121. $return .= <<<EOF
  122. <div class="tip tip_4" id="aid{$attach['aid']}_menu" style="display: none" disautofocus="true">
  123. <div class="tip_c">
  124. <p class="y">{$attach['dateline']} 上传</p>
  125. <p>点击文件名下载附件</p>
  126. EOF;
  127. if(!$attach['attachimg'] && $_G['getattachcredits']) {
  128. $return .= <<<EOF
  129. 下载积分: {$_G['getattachcredits']}<br />
  130. EOF;
  131. }
  132. $return .= <<<EOF
  133. </div>
  134. <div class="tip_horn"></div>
  135. </div>
  136. </p>
  137. <p>{$attach['attachsize']}
  138. EOF;
  139. if($attach['readperm']) {
  140. $return .= <<<EOF
  141. , 阅读权限: <strong>{$attach['readperm']}</strong>
  142. EOF;
  143. }
  144. $return .= <<<EOF
  145. , 下载次数: {$attach['downloads']}
  146. EOF;
  147. if(!$attach['attachimg'] && $_G['getattachcredits']) {
  148. $return .= <<<EOF
  149. , 下载积分: {$_G['getattachcredits']}
  150. EOF;
  151. }
  152. $return .= <<<EOF
  153. </p>
  154. <p>
  155. EOF;
  156. if($attach['price']) {
  157. $return .= <<<EOF
  158. 售价: <strong>{$attach['price']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['title']}</strong> &nbsp;[<a href="forum.php?mod=misc&amp;action=viewattachpayments&amp;aid={$attach['aid']}" onclick="showWindow('attachpay', this.href)" target="_blank">记录</a>]
  159. EOF;
  160. if(!$attach['payed']) {
  161. $return .= <<<EOF
  162. &nbsp;[<a href="forum.php?mod=misc&amp;action=attachpay&amp;aid={$attach['aid']}&amp;tid={$attach['tid']}" onclick="showWindow('attachpay', this.href)">购买</a>]
  163. EOF;
  164. } }
  165. $return .= <<<EOF
  166. </p>
  167. EOF;
  168. if($attach['description']) {
  169. $return .= <<<EOF
  170. <p class="xg2">{$attach['description']}</p>
  171. EOF;
  172. }
  173. $return .= <<<EOF
  174. {$pluginhook}
  175. </dd>
  176. </dl>
  177. </ignore_js_op>
  178. EOF;
  179. ?><?php
  180. return $return;
  181. }
  182. function imagelist($attach, $firstpost = 0) {
  183. global $_G;
  184. $attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp')));
  185. $aidencode = packaids($attach);
  186. $widthcode = attachwidth($attach['width']);
  187. $is_archive = $_G['forum_thread']['is_archived'] ? "&fid=".$_G['fid']."&archiveid=".$_G[forum_thread][archiveid] : '';
  188. $attachthumb = getimgthumbname($attach['attachment']);
  189. $pluginhook = !empty($_G['setting']['pluginhooks']['viewthread_attach_extra'][$attach[aid]]) ? $_G['setting']['pluginhooks']['viewthread_attach_extra'][$attach[aid]] : '';
  190. $guestviewthumb = !empty($_G['setting']['guestviewthumb']['flag']) && !$_G['uid'];
  191. if($guestviewthumb) {
  192. $guestviewthumbcss = guestviewthumbstyle();
  193. }
  194. ?><?php
  195. $__STATICURL = STATICURL;$return = <<<EOF
  196. EOF;
  197. if($attach['attachimg'] && $_G['setting']['showimages'] && (($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid']) || (($guestviewthumb)))) {
  198. $return .= <<<EOF
  199. <ignore_js_op>
  200. EOF;
  201. if(!IS_ROBOT) {
  202. $return .= <<<EOF
  203. <dl class="tattl attm">
  204. <dt></dt>
  205. <dd>
  206. EOF;
  207. if(!$guestviewthumb) {
  208. $return .= <<<EOF
  209. <p class="mbn">
  210. <a href="forum.php?mod=attachment{$is_archive}&amp;aid={$aidencode}&amp;nothumb=yes"
  211. EOF;
  212. if($_GET['from'] != 'preview') {
  213. $return .= <<<EOF
  214. onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" id="aid{$attach['aid']}"
  215. EOF;
  216. }
  217. $return .= <<<EOF
  218. class="xw1" target="_blank">{$attach['filename']}</a>
  219. <em class="xg1">({$attach['attachsize']}, 下载次数: {$attach['downloads']})</em>
  220. </p>
  221. <div class="tip tip_4" id="aid{$attach['aid']}_menu" style="display: none" disautofocus="true">
  222. <div>
  223. <p>
  224. <a href="forum.php?mod=attachment{$is_archive}&amp;aid={$aidencode}&amp;nothumb=yes" target="_blank">下载附件</a>
  225. EOF;
  226. if(helper_access::check_module('album')) {
  227. $return .= <<<EOF
  228. &nbsp;<a href="javascript:;" onclick="showWindow(this.id, this.getAttribute('url'), 'get', 0);" id="savephoto_{$attach['aid']}" url="home.php?mod=spacecp&amp;ac=album&amp;op=saveforumphoto&amp;aid={$attach['aid']}&amp;handlekey=savephoto_{$attach['aid']}">保存到相册</a>
  229. EOF;
  230. } if($firstpost && $_G['fid'] && $_G['forum']['picstyle'] && ($_G['forum']['ismoderator'] || $_G['uid'] == $attach['uid'])) {
  231. $return .= <<<EOF
  232. &nbsp;<a href="forum.php?mod=ajax&amp;action=setthreadcover&amp;aid={$attach['aid']}&amp;fid={$_G['fid']}" onclick="showWindow('setcover{$attach['aid']}', this.href)">设为封面</a>
  233. EOF;
  234. }
  235. $return .= <<<EOF
  236. </p>
  237. <p>
  238. <span class="y">{$attach['dateline']} 上传</span>
  239. <a href="javascript:;" onclick="imageRotate('aimg_{$attach['aid']}', 1)"><img src="{$__STATICURL}image/common/rleft.gif" class="vm" /></a>
  240. <a href="javascript:;" onclick="imageRotate('aimg_{$attach['aid']}', 2)"><img src="{$__STATICURL}image/common/rright.gif" class="vm" /></a>
  241. </p>
  242. </div>
  243. <div class="tip_horn"></div>
  244. </div>
  245. <p class="mbn">
  246. EOF;
  247. if($attach['readperm']) {
  248. $return .= <<<EOF
  249. 阅读权限: <strong>{$attach['readperm']}</strong>
  250. EOF;
  251. } if($attach['price']) {
  252. $return .= <<<EOF
  253. 售价: <strong>{$attach['price']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['title']}</strong> &nbsp;[<a href="forum.php?mod=misc&amp;action=viewattachpayments&amp;aid={$attach['aid']}" onclick="showWindow('attachpay', this.href)" target="_blank">记录</a>]
  254. EOF;
  255. if(!$attach['payed']) {
  256. $return .= <<<EOF
  257. &nbsp;[<a href="forum.php?mod=misc&amp;action=attachpay&amp;aid={$attach['aid']}&amp;tid={$attach['tid']}" onclick="showWindow('attachpay', this.href)" target="_blank">购买</a>]
  258. EOF;
  259. } }
  260. $return .= <<<EOF
  261. </p>
  262. EOF;
  263. if($attach['description']) {
  264. $return .= <<<EOF
  265. <p class="mbn xg2">{$attach['description']}</p>
  266. EOF;
  267. } }
  268. $return .= <<<EOF
  269. {$pluginhook}
  270. EOF;
  271. if($guestviewthumb) {
  272. $thumbpath = helper_attach::attachpreurl().'image/'.helper_attach::makethumbpath($attach['aid'], $_G['setting']['guestviewthumb']['width'], $_G['setting']['guestviewthumb']['height']);
  273. $makefile = 'forum.php?mod=image&aid='.$attach['aid'].'&size='.$_G['setting']['guestviewthumb']['width'].'x'.$_G['setting']['guestviewthumb']['height'].'&key='.dsign($attach['aid'].'|'.$_G['setting']['guestviewthumb']['width'].'|'.$_G['setting']['guestviewthumb']['height']).'&type=1';
  274. $return .= <<<EOF
  275. {$guestviewthumbcss}
  276. <div class="guestviewthumb">
  277. <img id="aimg_{$attach['aid']}" class="guestviewthumb_cur" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" onclick="showWindow('login', 'member.php?mod=logging&action=login'+'&referer='+encodeURIComponent(location))" onerror="javascript:if(this.getAttribute('makefile')){this.src=this.getAttribute('makefile'); this.removeAttribute('makefile');}" file="{$thumbpath}" makefile="{$makefile}" alt="{$attach['imgalt']}" title="{$attach['imgalt']}"/>
  278. <br>
  279. <a href="member.php?mod=logging&amp;action=login" onclick="showWindow('login', this.href+'&referer='+encodeURIComponent(location));">登录/注册后可看大图</a>
  280. </div>
  281. EOF;
  282. } elseif(!$attach['price'] || $attach['payed']) {
  283. $return .= <<<EOF
  284. <div class="mbn savephotop">
  285. EOF;
  286. if($_G['setting']['thumbstatus'] && $attach['thumb']) {
  287. $return .= <<<EOF
  288. <a href="javascript:;"><img id="aimg_{$attach['aid']}" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" onclick="zoom(this, this.getAttribute('zoomfile'), 0, 0, '{$_G['setting']['showexif']}')" zoomfile="
  289. EOF;
  290. if($attach['refcheck']) {
  291. $return .= <<<EOF
  292. forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes&nothumb=yes
  293. EOF;
  294. } else {
  295. $return .= <<<EOF
  296. {$attach['url']}{$attach['attachment']}
  297. EOF;
  298. }
  299. $return .= <<<EOF
  300. " file="
  301. EOF;
  302. if($attach['refcheck']) {
  303. $return .= <<<EOF
  304. forum.php?mod=attachment{$is_archive}&aid={$aidencode}
  305. EOF;
  306. } else {
  307. $return .= <<<EOF
  308. {$attach['url']}{$attachthumb}
  309. EOF;
  310. }
  311. $return .= <<<EOF
  312. " alt="{$attach['imgalt']}" title="{$attach['imgalt']}" w="{$attach['width']}" /></a>
  313. EOF;
  314. } else {
  315. $return .= <<<EOF
  316. <img id="aimg_{$attach['aid']}" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" zoomfile="
  317. EOF;
  318. if($attach['refcheck']) {
  319. $return .= <<<EOF
  320. forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes&nothumb=yes
  321. EOF;
  322. } else {
  323. $return .= <<<EOF
  324. {$attach['url']}{$attach['attachment']}
  325. EOF;
  326. }
  327. $return .= <<<EOF
  328. " file="
  329. EOF;
  330. if($attach['refcheck']) {
  331. $return .= <<<EOF
  332. forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes
  333. EOF;
  334. } else {
  335. $return .= <<<EOF
  336. {$attach['url']}{$attach['attachment']}
  337. EOF;
  338. }
  339. $return .= <<<EOF
  340. " {$widthcode} alt="{$attach['imgalt']}" title="{$attach['imgalt']}" w="{$attach['width']}" />
  341. EOF;
  342. }
  343. $return .= <<<EOF
  344. </div>
  345. EOF;
  346. }
  347. $return .= <<<EOF
  348. </dd>
  349. </dl>
  350. EOF;
  351. } else {
  352. $return .= <<<EOF
  353. <dl class="tattl attm">
  354. EOF;
  355. if(!$attach['price'] || $attach['payed']) {
  356. $return .= <<<EOF
  357. <dd>
  358. EOF;
  359. if($attach['description']) {
  360. $return .= <<<EOF
  361. <p>{$attach['description']}</p>
  362. EOF;
  363. }
  364. $return .= <<<EOF
  365. <img src="
  366. EOF;
  367. if($attach['refcheck']) {
  368. $return .= <<<EOF
  369. forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes
  370. EOF;
  371. } else {
  372. $return .= <<<EOF
  373. {$attach['url']}{$attach['attachment']}
  374. EOF;
  375. }
  376. $return .= <<<EOF
  377. " alt="{$attach['imgalt']}" title="{$attach['imgalt']}" />
  378. </dd>
  379. EOF;
  380. }
  381. $return .= <<<EOF
  382. </dl>
  383. EOF;
  384. }
  385. $return .= <<<EOF
  386. </ignore_js_op>
  387. EOF;
  388. }
  389. $return .= <<<EOF
  390. EOF;
  391. ?><?php
  392. return $return;
  393. }
  394. function attachinpost($attach, $post) {
  395. global $_G;
  396. $firstpost = $post['first'];
  397. $attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp')));
  398. $aidencode = packaids($attach);
  399. $widthcode = attachwidth($attach['width']);
  400. $is_archive = $_G['forum_thread']['is_archived'] ? '&fid='.$_G['fid'].'&archiveid='.$_G[forum_thread][archiveid] : '';
  401. $attachthumb = getimgthumbname($attach['attachment']);
  402. $musiccode = getstatus($post[status], 7) && fileext($attach['attachment']) == 'mp3' ? (browserversion('ie') > 8 || browserversion('safari') ? '<audio controls="controls"><source src="'.$attach['url'].$attach['attachment'].'"></audio>' : parseaudio($attach['url'].$attach['attachment'], 400)) : '';
  403. $guestviewthumb = !empty($_G['setting']['guestviewthumb']['flag']) && !$_G['uid'];
  404. if($guestviewthumb) {
  405. $guestviewthumbcss = guestviewthumbstyle();
  406. }
  407. ?><?php
  408. $__STATICURL = STATICURL;$return = <<<EOF
  409. <ignore_js_op>
  410. EOF;
  411. if($attach['attachimg'] && $_G['setting']['showimages'] && (((!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid'])) || (($guestviewthumb)))) { if(!IS_ROBOT) { if($guestviewthumb) {
  412. $thumbpath = helper_attach::attachpreurl().'image/'.helper_attach::makethumbpath($attach['aid'], $_G['setting']['guestviewthumb']['width'], $_G['setting']['guestviewthumb']['height']);
  413. $makefile = 'forum.php?mod=image&aid='.$attach['aid'].'&size='.$_G['setting']['guestviewthumb']['width'].'x'.$_G['setting']['guestviewthumb']['height'].'&key='.dsign($attach['aid'].'|'.$_G['setting']['guestviewthumb']['width'].'|'.$_G['setting']['guestviewthumb']['height']).'&type=1';
  414. $return .= <<<EOF
  415. {$guestviewthumbcss}
  416. <div class="guestviewthumb">
  417. <div style="margin: 0 auto;">
  418. <img id="aimg_{$attach['aid']}" class="guestviewthumb_cur" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" onclick="showWindow('login', 'member.php?mod=logging&action=login'+'&referer='+encodeURIComponent(location))" onerror="javascript:if(this.getAttribute('makefile')){this.src=this.getAttribute('makefile'); this.removeAttribute('makefile');}" file="{$thumbpath}" makefile="{$makefile}" inpost="1" alt="{$attach['imgalt']}" title="{$attach['imgalt']}"/>
  419. <br>
  420. <a href="member.php?mod=logging&amp;action=login" onclick="showWindow('login', this.href+'&referer='+encodeURIComponent(location));">登录/注册后可看大图</a>
  421. </div>
  422. </div>
  423. EOF;
  424. } else { if($_G['setting']['thumbstatus'] && $attach['thumb']) {
  425. $return .= <<<EOF
  426. <img
  427. EOF;
  428. if($attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']) {
  429. $return .= <<<EOF
  430. class="attprice"
  431. EOF;
  432. }
  433. $return .= <<<EOF
  434. style="cursor:pointer" id="aimg_{$attach['aid']}" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" onclick="zoom(this, this.getAttribute('zoomfile'), 0, 0, '{$_G['setting']['showexif']}')" zoomfile="
  435. EOF;
  436. if($attach['refcheck']) {
  437. $return .= <<<EOF
  438. forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes&nothumb=yes
  439. EOF;
  440. } else {
  441. $return .= <<<EOF
  442. {$attach['url']}{$attach['attachment']}
  443. EOF;
  444. }
  445. $return .= <<<EOF
  446. " file="
  447. EOF;
  448. if($attach['refcheck']) {
  449. $return .= <<<EOF
  450. forum.php?mod=attachment{$is_archive}&aid={$aidencode}
  451. EOF;
  452. } else {
  453. $return .= <<<EOF
  454. {$attach['url']}{$attachthumb}
  455. EOF;
  456. }
  457. $return .= <<<EOF
  458. " inpost="1"
  459. EOF;
  460. if($_GET['from'] != 'preview') {
  461. $return .= <<<EOF
  462. onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"
  463. EOF;
  464. }
  465. $return .= <<<EOF
  466. />
  467. EOF;
  468. } else {
  469. $return .= <<<EOF
  470. <img
  471. EOF;
  472. if($attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']) {
  473. $return .= <<<EOF
  474. class="attprice"
  475. EOF;
  476. }
  477. $return .= <<<EOF
  478. id="aimg_{$attach['aid']}" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" zoomfile="
  479. EOF;
  480. if($attach['refcheck']) {
  481. $return .= <<<EOF
  482. forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes&nothumb=yes
  483. EOF;
  484. } else {
  485. $return .= <<<EOF
  486. {$attach['url']}{$attach['attachment']}
  487. EOF;
  488. }
  489. $return .= <<<EOF
  490. " file="
  491. EOF;
  492. if($attach['refcheck']) {
  493. $return .= <<<EOF
  494. forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes
  495. EOF;
  496. } else {
  497. $return .= <<<EOF
  498. {$attach['url']}{$attach['attachment']}
  499. EOF;
  500. }
  501. $return .= <<<EOF
  502. " {$widthcode} id="aimg_{$attach['aid']}" inpost="1"
  503. EOF;
  504. if($_GET['from'] != 'preview') {
  505. $return .= <<<EOF
  506. onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"
  507. EOF;
  508. }
  509. $return .= <<<EOF
  510. />
  511. EOF;
  512. } }
  513. $return .= <<<EOF
  514. <div class="tip tip_4 aimg_tip" id="aimg_{$attach['aid']}_menu" style="position: absolute; display: none" disautofocus="true">
  515. <div class="xs0">
  516. <p><strong>{$attach['filename']}</strong> <em class="xg1">({$attach['attachsize']}, 下载次数: {$attach['downloads']})</em></p>
  517. <p>
  518. <a href="forum.php?mod=attachment{$is_archive}&amp;aid={$aidencode}&amp;nothumb=yes" target="_blank">下载附件</a>
  519. EOF;
  520. if(helper_access::check_module('album')) {
  521. $return .= <<<EOF
  522. &nbsp;<a href="javascript:;" onclick="showWindow(this.id, this.getAttribute('url'), 'get', 0);" id="savephoto_{$attach['aid']}" url="home.php?mod=spacecp&amp;ac=album&amp;op=saveforumphoto&amp;aid={$attach['aid']}&amp;handlekey=savephoto_{$attach['aid']}">保存到相册</a>
  523. EOF;
  524. } if($firstpost && $_G['fid'] && $_G['forum']['picstyle'] && ($_G['forum']['ismoderator'] || $_G['uid'] == $attach['uid'])) {
  525. $return .= <<<EOF
  526. &nbsp;<a href="forum.php?mod=ajax&amp;action=setthreadcover&amp;aid={$attach['aid']}&amp;fid={$_G['fid']}" onclick="showWindow('setcover{$attach['aid']}', this.href)">设为封面</a>
  527. EOF;
  528. }
  529. $return .= <<<EOF
  530. </p>
  531. EOF;
  532. if($attach['description']) {
  533. $return .= <<<EOF
  534. <p>{$attach['description']}</p>
  535. EOF;
  536. }
  537. $return .= <<<EOF
  538. <p class="xg1 y">{$attach['dateline']} 上传</p>
  539. EOF;
  540. } else { if($attach['description']) {
  541. $return .= <<<EOF
  542. <p>{$attach['description']}</p>
  543. EOF;
  544. }
  545. $return .= <<<EOF
  546. <img src="
  547. EOF;
  548. if($attach['refcheck']) {
  549. $return .= <<<EOF
  550. forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes
  551. EOF;
  552. } else {
  553. $return .= <<<EOF
  554. {$attach['url']}{$attach['attachment']}
  555. EOF;
  556. }
  557. $return .= <<<EOF
  558. " alt="{$attach['imgalt']}" title="{$attach['imgalt']}" />
  559. EOF;
  560. } } else { if($musiccode) {
  561. $return .= <<<EOF
  562. <div>{$musiccode}</div>
  563. EOF;
  564. }
  565. $return .= <<<EOF
  566. {$attach['attachicon']}
  567. <span style="white-space: nowrap" id="attach_{$attach['aid']}"
  568. EOF;
  569. if($_GET['from'] != 'preview') {
  570. $return .= <<<EOF
  571. onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"
  572. EOF;
  573. }
  574. $return .= <<<EOF
  575. >
  576. EOF;
  577. if(!$attach['price'] || $attach['payed']) {
  578. $return .= <<<EOF
  579. <a href="forum.php?mod=attachment{$is_archive}&amp;aid={$aidencode}" target="_blank">{$attach['filename']}</a>
  580. EOF;
  581. } else {
  582. $return .= <<<EOF
  583. <a href="forum.php?mod=misc&amp;action=attachpay&amp;aid={$attach['aid']}&amp;tid={$attach['tid']}" onclick="showWindow('attachpay', this.href)">{$attach['filename']}</a>
  584. EOF;
  585. }
  586. $return .= <<<EOF
  587. <em class="xg1">({$attach['attachsize']}, 下载次数: {$attach['downloads']}
  588. EOF;
  589. if($attach['price']) {
  590. $return .= <<<EOF
  591. , 售价: {$attach['price']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['title']}
  592. EOF;
  593. }
  594. $return .= <<<EOF
  595. )</em>
  596. </span>
  597. <div class="tip tip_4" id="attach_{$attach['aid']}_menu" style="position: absolute; display: none" disautofocus="true">
  598. <div class="tip_c xs0">
  599. <div class="y">{$attach['dateline']} 上传</div>
  600. 点击文件名下载附件
  601. EOF;
  602. if($attach['description']) {
  603. $return .= <<<EOF
  604. <br />{$attach['description']}
  605. EOF;
  606. } if($attach['readperm']) {
  607. $return .= <<<EOF
  608. <br />阅读权限: {$attach['readperm']}
  609. EOF;
  610. } } if(!IS_ROBOT && !$guestviewthumb) { if($attach['price']) {
  611. $return .= <<<EOF
  612. <br />售价: {$attach['price']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['title']} &nbsp;<a href="forum.php?mod=misc&amp;action=viewattachpayments&amp;aid={$attach['aid']}" onclick="showWindow('attachpay', this.href)" target="_blank">[记录]</a>
  613. EOF;
  614. if(!$attach['payed']) {
  615. $return .= <<<EOF
  616. &nbsp;[<a href="forum.php?mod=misc&amp;action=attachpay&amp;aid={$attach['aid']}&amp;tid={$attach['tid']}" onclick="showWindow('attachpay', this.href)" target="_blank">购买</a>]
  617. EOF;
  618. } } if(!$attach['attachimg'] && $_G['getattachcredits']) {
  619. $return .= <<<EOF
  620. <br />下载积分: {$_G['getattachcredits']}
  621. EOF;
  622. }
  623. $return .= <<<EOF
  624. </div>
  625. <div class="tip_horn"></div>
  626. </div>
  627. EOF;
  628. if($musiccode) {
  629. $return .= <<<EOF
  630. <br />
  631. EOF;
  632. } }
  633. $return .= <<<EOF
  634. </ignore_js_op>
  635. EOF;
  636. ?><?php
  637. return $return;
  638. }
  639. ?>