Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

如何使附件的图片居中?

[复制链接]
hippoo 发表于 2006-8-24 16:21:20 | 显示全部楼层 |阅读模式
viewthread.htm里面这段,在什么地方插入align=center?


  1. <td valign="top">
  2.         <!--{if $avatarshowpos == 1}--><div style="float: right">$post[avatarshow]</div><!--{/if}-->
  3.         <a name="pid$post[pid]" href="misc.php?action=viewratings&tid=$tid&pid=$post[pid]" alt="{lang rate_view}">$post[ratings]</a>
  4.         <!--{if !empty($advlist['thread'][$post['count']])}--><span class="smalltxt"><span class="bold">[{lang advertisement}]:</span> $advlist[thread][$post[count]]</span><hr width="100%" style="height: 1px; color: {INNERBORDERCOLOR}"><!--{/if}-->
  5.         <!--{if $post['subject']}--><span class="smalltxt"><span class="bold">$post[subject]</span></span><br><br><!--{/if}-->
  6.         <!--{if $bannedmessages && (($post['authorid'] && !$post['username']) || ($post['groupid'] == 4 || $post['groupid'] == 5))}-->
  7.                 {lang message_banned}
  8.         <!--{else}-->
  9.                 <span style="font-size: {MSGFONTSIZE}">$post[message]</span><br><br><br>
  10.                 <!--{if $post['attachment']}-->
  11.                         <br><br><img src="images/attachicons/common.gif">&nbsp;{lang attachment}: <i>{lang attach_nopermission}</i>
  12.                 <!--{else}-->
  13.                         <!--{loop $post['attachments'] $attach}-->
  14.                                 <br><br><!--{if !$attach['attachimg']}-->$attach[attachicon]<!--{/if}-->
  15. <!--{if $attach['attachimg']}-->
  16.                                         <!--{if $attach['readperm']}-->{lang readperm} $attach[readperm] <!--{/if}-->
  17. <!--{if $attach['description']}-->{$attach[description]}<!--{/if}-->
  18. <br><br>
  19.                                         <!--{if $attachrefcheck}-->
  20.                                                 <img src="attachment.php?aid=$attach[aid]&noupdate=yes" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='{lang image_open_zoom}';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachment.php?aid=$attach[aid]');}" onmousewheel="return imgzoom(this);">
  21.                                         <!--{else}-->
  22.                                                 <img src="$attachurl/$attach[attachment]" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='{lang image_open_zoom}';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);">
  23.                                         <!--{/if}-->
  24.                                 <!--{else}-->
  25.                                         <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
  26.                                         <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
  27.                                         <span class="smalltxt">{lang attach_download_count} $attach[downloads]
  28.                                         <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}--></span><br>
  29.                                 <!--{/if}-->
  30.                         <!--{/loop}-->
  31.                 <!--{/if}-->
  32.                 <!--{if $post['number'] == 1 && $relatedkeywords}--><br><br><span class="bold">{lang thread_keywords}</span> $relatedkeywords<br><br><!--{/if}-->
  33.                 <!--{if $post['signature'] && !$post['anonymous']}--><br><br><br></td></tr><tr><td valign="bottom" $maxsigrows><img src="images/common/sigline.gif"><br>$post[signature]<!--{/if}-->
  34.         <!--{/if}-->
  35.         </td>
复制代码
 楼主| hippoo 发表于 2006-8-24 16:29:50 | 显示全部楼层
upup
回复

使用道具 举报

 楼主| hippoo 发表于 2006-8-24 16:42:33 | 显示全部楼层
upup
回复

使用道具 举报

诚信的松子茶 发表于 2006-8-24 16:44:01 | 显示全部楼层
顶了
回复

使用道具 举报

诚信的松子茶 发表于 2006-8-24 16:44:23 | 显示全部楼层
发错了  请斑主 删除
回复

使用道具 举报

 楼主| hippoo 发表于 2006-8-24 17:09:17 | 显示全部楼层
怎么错了?
回复

使用道具 举报

 楼主| hippoo 发表于 2006-8-24 17:22:34 | 显示全部楼层
up。有人帮忙吗
回复

使用道具 举报

 楼主| hippoo 发表于 2006-8-24 18:28:28 | 显示全部楼层
up。有人帮忙吗
回复

使用道具 举报

 楼主| hippoo 发表于 2006-8-24 18:36:12 | 显示全部楼层
有人帮忙吗
回复

使用道具 举报

fredyj 发表于 2006-8-24 18:38:45 | 显示全部楼层
  1. <td valign="top">
  2.         <!--{if $avatarshowpos == 1}--><div style="float: right">$post[avatarshow]</div><!--{/if}-->
  3.         <a name="pid$post[pid]" href="misc.php?action=viewratings&tid=$tid&pid=$post[pid]" alt="{lang rate_view}">$post[ratings]</a>
  4.         <!--{if !empty($advlist['thread'][$post['count']])}--><span class="smalltxt"><span class="bold">[{lang advertisement}]:</span> $advlist[thread][$post[count]]</span><hr width="100%" style="height: 1px; color: {INNERBORDERCOLOR}"><!--{/if}-->
  5.         <!--{if $post['subject']}--><span class="smalltxt"><span class="bold">$post[subject]</span></span><br><br><!--{/if}-->
  6.         <!--{if $bannedmessages && (($post['authorid'] && !$post['username']) || ($post['groupid'] == 4 || $post['groupid'] == 5))}-->
  7.                 {lang message_banned}
  8.         <!--{else}-->
  9.                 <span style="font-size: {MSGFONTSIZE}">$post[message]</span><br><br><br>



  10. <div style="float: center">
  11. 这里是开始

  12.                 <!--{if $post['attachment']}-->

  13. 这里是没有权限的
  14.                         <br><br><img src="images/attachicons/common.gif"> {lang attachment}: <i>{lang attach_nopermission}</i>
  15.                 <!--{else}-->

  16. 这里是循环取附件

  17.                         <!--{loop $post['attachments'] $attach}-->
  18.                                 <br><br><!--{if !$attach['attachimg']}-->$attach[attachicon]<!--{/if}-->
  19. <!--{if $attach['attachimg']}-->
  20.                                         <!--{if $attach['readperm']}-->{lang readperm} $attach[readperm] <!--{/if}-->
  21. <!--{if $attach['description']}-->{$attach[description]}<!--{/if}-->
  22. <br><br>
  23.                                         <!--{if $attachrefcheck}-->
  24.                                                 <img src="attachment.php?aid=$attach[aid]&noupdate=yes" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='{lang image_open_zoom}';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachment.php?aid=$attach[aid]');}" onmousewheel="return imgzoom(this);">
  25.                                         <!--{else}-->
  26.                                                 <img src="$attachurl/$attach[attachment]" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='{lang image_open_zoom}';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);">
  27.                                         <!--{/if}-->
  28.                                 <!--{else}-->
  29.                                         <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
  30.                                         <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
  31.                                         <span class="smalltxt">{lang attach_download_count} $attach[downloads]
  32.                                         <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}--></span><br>
  33.                                 <!--{/if}-->
  34.                         <!--{/loop}-->
  35.                 <!--{/if}-->

  36. 这里是结束

  37. </div>



  38.                 <!--{if $post['number'] == 1 && $relatedkeywords}--><br><br><span class="bold">{lang thread_keywords}</span> $relatedkeywords<br><br><!--{/if}-->
  39.                 <!--{if $post['signature'] && !$post['anonymous']}--><br><br><br></td></tr><tr><td valign="bottom" $maxsigrows><img src="images/common/sigline.gif"><br>$post[signature]<!--{/if}-->
  40.         <!--{/if}-->
  41.         </td>
复制代码


貌似如此 自己看吧~~

中文是注释 只需要加 div 的那两个就可以了 ,我没有测试,思路如此,供参考。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-2-25 21:21 , Processed in 0.031874 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表