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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

代码分析之:viewthead.htm篇...

[复制链接]
ComsenzInc 发表于 2006-11-19 16:44:26 | 显示全部楼层 |阅读模式
麻烦版主帮忙移动插件区..谢谢..


前些天..和大家一起分析了forumdisplay.htm模板代码,详细可以看这个帖子:https://discuz.dismall.com/thread-459921-1-1.html,
其中涉及的变量,大家可以参考M55等人收录总结出来的变量列表:https://discuz.dismall.com/thread-329110-1-1.html
记得M55说过..授人以鱼不如授人以渔
,
   大家不要一味上来就要求要这个,要那个..浪费时间不说.除去好心人提供的一些东西外,也得不到什么,这也是导致DISCUZ现在论坛的风气不好的一个主要原因..我觉得,以前那个相互学习的氛围没有了..所以说..大家还是最好还是扎扎实实的学些东西.从很基本的开始做起,好比喻说..细心看看我写的这几篇东东,虽然是很表面的东西,可是,又有多少人认真去看了呢?
  或者,看慬了,又有多少人耐着性子,拿出来和大家一起分享了呢?
  还是那一句,我写的这些东西,主要是面对新手..好像我这样,想学东西,但又什么都不慬的,就给点精神,细细的看完..但如果是高手,笑笑过就算了..
  宗旨:
共同学习..一起提高!


   很多人说要看viewthead.htm的.好..现在VIEWTHEAD的..也写上来了..

   还是和上次一样(分析用的是default下的viewthead.htm模板...顺序是从上到下...一段一段的解释..其中与forumdisplay.htm中调用相同的模块的,就只是标出,不详细介绍了..
   好下面正式开始..
  
{template header}
...火星人都知道了吧...
  
  <div class="subtable nav" style="width:{TABLEWIDTH}">
  1. <!--{if $searchboxstatus}-->
  2.         <div class="right">
  3.         <form method="post" action="search.php?srchtype=qihoo" onSubmit="this.target='_blank';">
  4.         <input type="hidden" name="searchsubmit" value="yes">
  5.         <input type="text" name="srchtxt" value="$qihoo_searchboxtxt" size="27" class="input" style="{BGCODE}" onmouseover="this.focus();this.value='';this.onmouseover=null;" onfocus="this.select()">
  6.         <!--{if $qihoo_allsearch != '2'}--><input name="searchsubmit" class="button" type="submit" value="{lang search}"><!--{/if}-->
  7.         <!--{if $qihoo_allsearch}-->
  8.                 <input name="allsearchsubmit" class="button" type="submit" value="{lang qihoo_search}">
  9.         <!--{/if}-->
  10.         </form>
  11.         </div>
  12. <!--{/if}-->
复制代码
这个是帖子右上角的垃圾QIHOO搜索..不多说...
  1. <!--{if $forumjump && $jsmenu[1]}--><span id="forumlist"><a href="$indexname">$bbname</a><script type="text/javascript">menuregister(false, "forumlist")</script></span><!--{else}--><a href="$indexname">$bbname</a><!--{/if}-->
复制代码
论坛版块下拉菜单(JS调用)
  1. $navigation
复制代码
这个函数是控制输出:帖子所属的版块,和帖子标题
</div><br></div>
  1. <!--{if !empty($advlist['text'])}-->
  2.         <div class="maintable">
  3.         <div class="spaceborder" style="width: {TABLEWIDTH}">
  4.         <table cellspacing="1" border="0" cellpadding="{TABLESPACE}" width="100%" style="background: {BGBORDER}">$advlist[text]</table>
  5.         </div><br></div>
  6. <!--{/if}-->
复制代码
这个是帖子上面的文字广告栏..
  1. <!--{if $newpmexists}-->
  2.         <div class="maintable">
  3.         {template pmprompt}
  4.         </div>
  5. <!--{/if}-->
复制代码
...当你有消息的时候,调用出短信提示的模板pmprompt.htm
<div class="maintable">
<table width="{TABLEWIDTH}" cellspacing="0" cellpadding="0" align="center" style="clear: both;">
<tr><td valign="bottom">
<div style="margin-bottom: {TABLESPACE}px">

  1. <!--{if $highlightstatus}--><a href="viewthread.php?tid=$tid&page=$page" style="font-weight: normal">{lang disable_highlight}</a><!--{/if}-->
复制代码
当帖子高亮被取消的时候的取消高亮的提示..

  1. <a href="redirect.php?fid=$fid&tid=$tid&goto=nextoldset" style="font-weight: normal"> &#8249;&#8249; {lang last_thread}</a> | <a href="redirect.php?fid=$fid&tid=$tid&goto=nextnewset" style="font-weight: normal">{lang next_thread} &#8250;&#8250;</a><br>
  2. </div>
复制代码
帖子左上角的:上一主题,下一主题..
  1. $multipage</td><td width="40%" align="right" valign="bottom">
  2. <!--{if $allowpostreply || !$discuz_uid}--><div class="right">&nbsp;<a href="post.php?action=reply&fid=$fid&tid=$tid&extra=$extra"><img src="{IMGDIR}/reply.gif" border="0" alt="" /></a></div><!--{/if}-->
  3. <!--{if $allowpost || !$discuz_uid}-->
  4.         <div id="newspecialheader" class="right"><a href="post.php?action=newthread&fid=$fid&extra=$extra"><img src="{IMGDIR}/newtopic.gif" border="0" alt="" /></a><a href="###"><img src="{IMGDIR}/newspecial.gif" border="0" alt="" /></a><script type="text/javascript">menuregister(false, "newspecialheader", true)</script></div>
  5.         <!--{if ($allowposttrade && $ec_id) || $allowpostpoll || $allowpostreward || $allowpostactivity || !$discuz_uid}-->
  6.                 <div class="popupmenu_popup newspecialmenu" id="newspecialheader_menu" style="display: none">
  7.                 <table cellpadding="4" cellspacing="0" border="0" width="100%">
  8.                 <!--{if $allowpostpoll || !$discuz_uid}--><tr><td class="popupmenu_option"><div class="newspecial"><a href="post.php?action=newthread&fid=$fid&extra=$extra&poll=yes">{lang thread_poll}</a></div></td></tr><!--{/if}-->
  9.                 <!--{if ($allowposttrade && $ec_id) || !$discuz_uid}--><tr><td class="popupmenu_option"><div class="newspecial"><a href="post.php?action=newthread&fid=$fid&extra=$extra&trade=yes">{lang thread_trade}</a></div></td></tr><!--{/if}-->
  10.                 <!--{if $allowpostreward || !$discuz_uid}--><tr><td class="popupmenu_option"><div class="newspecial"><a href="post.php?action=newthread&fid=$fid&extra=$extra&reward=yes">{lang thread_reward}</a></div></td></tr><!--{/if}-->
  11.                 <!--{if $allowpostactivity || !$discuz_uid}--><tr><td class="popupmenu_option"><div class="newspecial"><a href="post.php?action=newthread&fid=$fid&extra=$extra&activity=yes">{lang thread_activity}</a></div></td></tr><!--{/if}-->
  12.                 </table></div>
  13.         <!--{/if}-->
  14. <!--{/if}-->
  15. </td></tr></table></div>
复制代码
这段和forumdisplay.htm中的一样,是分页功能和发贴菜单..说到这里,大家应该也留意到了.DISCUZ很多模块是可以随意调用的..呵呵..

  1. <!--{if $thread['special'] == 1 && $polloptions}-->
  2.         <div class="maintable">
  3.         {template viewthread_poll}
  4.         </div>
复制代码
在上个帖子中,已经详细提到过$thread['special']的这个变量了,帖子的类型..为1时为投票,这样就调用出帖子投票模板viewthread_poll
  1. <!--{elseif $thread['special'] == 2}-->
  2.         <div class="maintable">
  3.         {template viewthread_trade}
  4.         </div>
复制代码
如果2时为交易,调用交易帖子的模板..
  1. <!--{elseif $thread['special'] == 4}-->
  2.         <div class="maintable">
  3.         {template viewthread_activity}
  4.         </div>
复制代码
..如果3时,调用活动帖子的模板..  ..看到这里,大家想到什么呢?我们可以改造VIEWTHRAEAD中相应帖子的表现形式了,好比喻说.我可以将这些调用插到帖子内容中去,呵呵...在相应的地方加上上面的判断语句就可以了.
<!--{/if}-->
  1. <script type="text/javascript">
  2. function fastreply(subject) {
  3.         if($('postform')) {
  4.                 $('postform').subject.value = subject;
  5.                 $('postform').message.focus();
  6.         }
  7. }
  8. </script>
复制代码
..这个我也不是很清楚..应该是下面那个快速发贴框需要用到的JS变量声明吧...希望清楚的人帮我补上这个..


好了..下面开始的就是帖子主体的内容了..包括左边的头像信息啊..右边的帖子信息啊..之类的..休息一下,大家一努力一起看下去..

下面这段是帖子标题的那一个TABLE的分析..
<div class="maintable">
<div class="spaceborder" style="width: {TABLEWIDTH}; border-bottom: none">
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
<tr class="header"><td colspan="2" style="color: {HEADERTEXT}">

  1. <div class="right" style="font-weight: normal">
  2.         <a href="viewthread.php?action=printable&tid=$tid" target="_blank">{lang thread_printable}</a> |
  3.         <a href="misc.php?action=emailfriend&tid=$tid">{lang thread_email_friend}</a> |
  4.         <a href="my.php?item=subscriptions&subadd=$tid">{lang thread_subscribe}</a> |
  5.         <a href="my.php?item=favorites&favadd=$tid&type=thread">{lang thread_favorite}</a>
  6.         <!--{if $thread['authorid'] && ($thread['authorid'] == $discuz_uid || $forum['ismoderator'])}-->
  7.                 <!--{if $thread['blog']}-->
  8.                          | <a href="misc.php?action=blog&tid=$tid">{lang blog_remove}</a>
  9.                 <!--{elseif $allowuseblog && $forum['allowshare'] && $thread['authorid'] == $discuz_uid}-->
  10.                          | <a href="misc.php?action=blog&tid=$tid">{lang blog_add}</a>
  11.                 <!--{/if}-->
  12.         <!--{/if}-->
  13.         <!--{if $supe_status && $supe_siteurl}-->
  14.                 <!--{if $thread['authorid'] == $discuz_uid}-->
  15.                         <!--{if  !$thread['itemid']}-->
  16.                                 | <a href="$supe_siteurl/spacecp.php?action=spaceblogs&op=add&tid=$tid" target="_blank">{lang supe_join_xspace}</a>
  17.                         <!--{else}-->
  18.                                 | <a href="$supe_siteurl/index.php?action/viewspace/itemid/$thread[itemid]/fromdiscuz/$supe_fromdiscuz" target="_blank">{lang supe_view_in_xspace}</a>
  19.                         <!--{/if}-->
  20.                 <!--{elseif !$xspacestatus}-->
  21.                         | <a href="$supe_siteurl/index.php?action/register" target="_blank">{lang supe_register_xspace}</a>
  22.                 <!--{/if}-->
  23.                 | <a href="$supe_siteurl/spacecp.php?action=spacenews&op=add&tid=$tid" target="_blank">{lang supe_resource_add}</a>
  24.         <!--{/if}-->
  25. </div>
复制代码
我们可以看到这个div class="right" 可以根据这个,看出这个DIV大概在什么位置..具体可以参考:CSS.HTM中相应的参数.
这个DIV里面的就是帖子右上角的打印 | 推荐 | 订阅 | 收藏 | 加入文集 | 加入个人空间 | 加入资讯 的几个选项了..具体的判断语句,很简单..用IF来看相应的数组中的条件是否成立..学到现在,我们可以反过来,根据一些已经的功能,去推断一些参数的意义了..
  1. {lang subject}:
  2. <!--{if $thread['special'] == 3}-->
  3.         <!--{if $thread['price'] > 0}-->
  4.                 [{lang reward_unsolved}]
  5.         <!--{elseif $thread['price'] < 0}-->
  6.                 [{lang reward_solved}]
  7.         <!--{/if}-->
  8. <!--{/if}-->
  9. $thread[subject]
  10. </td></tr>
复制代码
帖子左上角的帖子标题..标题前加了一个IF,看如果这个帖子是悬赏贴的话,根据$thread['price']来判断来看是否已经解决..根据那个lang,我们可以推测出,$thread['price']的意思了..查了上面的那个表,果然是.呵呵..继续.
  1. <!--{if $lastmod['modaction'] || $thread['blog'] || $thread['readperm'] || $thread['price'] != 0 || $thread[itemid]}-->
复制代码

FujiwaraSai  说多分析一下IF...好大家看看这里了..这里,有一些很简单的语法,和C应该差不多吧.."||"是或,IF.. 其中的变量,有一个为真时,执行IF下面的语句..
先看看相应的变量:,$thread['blog'],$lastmod['modaction'],$thread['readperm'] ,$thread['price'] , $thread[itemid]
其中:$thread['blog']应该是主题是否允许加入BLOG..$lastmod['modaction']应该是操作纪录,$thread['readperm']应该是帖子的阅读权限,而$thread[itemid]应该是什么呢?... $thread['price'] != 0为帖子交易积分不为0..
当上面任意一个变量存在的时候,开始执行下面的语句了吧..
        <tr class="category"><td colspan="2" align="center" class="bold">
  1. <!--{if $thread[itemid]}-->
  2.                 <a href="$supe_siteurl/index.php?action/viewspace/itemid/$thread[itemid]" target="_blank"><span class="bold" style="margin-right:20px;">{lang supe_thread_already_been_join_to_xspace}</span></a><!--{/if}-->
复制代码
..如果$thread[itemid]成立,则输出,已经加入到SS资讯里.从这里,可以推测出$thread[itemid]变量是控制判断DZ和SS之间的联系的.功能大概是,帖子是否已经导入SS中.

  1.         <!--{if $thread['special'] == '0' && $thread['price'] > 0}-->====如果主题交易积分不为0
  2.                   <a href="misc.php?action=viewpayments&tid=$tid">{lang price_thread} {$extcredits[$creditstrans][title]} <span class="bold">$thread[price]</span> {$extcredits[$creditstrans][unit]}</a>  ====浏览所需积分:其中: {$extcredits[$creditstrans][title]} 为论坛交易积分的ID
  3.         <!--{elseif $thread['special'] == 3}-->
  4.                   <span class="bold">
  5.                 <!--{if $thread['price'] > 0 }-->
  6.                         [{lang reward_unsolved}]====根据积分确定是否已经解决.
  7.                 <!--{elseif $thread['price'] < 0}-->
  8.                         [{lang reward_solved}]
  9.                 <!--{/if}-->
  10.                 {lang reward_thethread} {$extcredits[$creditstrans][title]} $rewardprice</span> {$extcredits[$creditstrans][unit]}</a> &nbsp;
  11.         <!--{/if}-->
复制代码
\
分析一下这个IF吧..
  1. <!--{if $lastmod['modaction']}-->  <a href="misc.php?action=viewthreadmod&tid=$tid" title="{lang thread_mod}" target="_blank">{lang thread_mod_by}</a> <!--{/if}-->
  2.         <!--{if $thread['blog']}-->  <a href="blog.php?uid=$thread[authorid]" target="_blank">{lang thread_blog}</a>  <!--{/if}-->
复制代码
帖子操作纪录
  1. <!--{if $thread['readperm']}-->  {lang readperm_thread} <span class="bold">$thread[readperm]</span>  <!--{/if}-->
  2.         </td></tr>
  3. <!--{/if}-->
复制代码
帖子阅读权限.
</table></div>


..
见没有什么人顶..本来想不写了的..哎..还是写完它..然后.....

[ 本帖最后由 ComsenzInc 于 2006-11-20 23:32 编辑 ]
 楼主| ComsenzInc 发表于 2006-11-19 16:44:50 | 显示全部楼层
:) :) :) 占位.......
<form method="post" name="delpost" action="topicadmin.php?action=delpost&amp;fid=$fid&amp;tid=$tid&amp;page=$page">
<input type="hidden" name="formhash" value="{FORMHASH}">
<!--{loop $postlist $post}-->

        <div class="spaceborder" style="width: {TABLEWIDTH}; margin-bottom: 4px;<!--{if $post['first']}--> border-top: none<!--{/if}-->">
        <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center" class="t_row">
        <tr style="height: 100%">
        <td width="18%" valign="top" class="t_user">$post[newpostanchor] $post[lastpostanchor]
        <!--{if $forum['ismoderator']}-->
                <!--{if $allowviewip}--><a href="topicadmin.php?action=getip&amp;fid=$fid&amp;tid=$tid&amp;pid=$post[pid]"><img src="{IMGDIR}/ip.gif" border="0" align="right" alt="{lang admin_getip}" /></a><!--{/if}-->
        <!--{/if}-->
        <!--{if $post['authorid'] && $post['username'] && !$post['anonymous']}-->
                <a href="viewpro.php?uid=$post[authorid]" target="_blank" class="bold">$post[author]</a><!--{if $post['nickname']}--> <span class="smalltxt">($post[nickname])</span><!--{/if}-->
                <br><div class="smalltxt">
                $post[authortitle]
                <br>{eval showstars($post['stars']);}<br><!--{if $post['customstatus']}-->$post[customstatus]<br><!--{/if}--><br>
                <!--{if $avatarshowpos == 3 && $post['avatarshow'] && $showavatars}-->
                        <center>$post[avatarshow]</center><br>
                <!--{elseif $post['avatar'] && $showavatars}-->
                        <table width="95%" border="0" cellspacing="0" cellpadding="0" style="table-layout: fixed; overflow: hidden">
                        <tr><td align="center">$post[avatar]</td></tr></table><br>
                <!--{else}-->
                        <br><br>
                <!--{/if}-->
                <!--{if $post['medals']}-->
                        <!--{loop $post['medals'] $medal}-->
                                <img src="images/common/$medal[image]" border="0" alt="$medal[name]" /> &nbsp;
                        <!--{/loop}-->
                        <br>
                <!--{/if}-->
                {lang uid} $post[uid]<br>
                {lang digest_posts} <!--{if $post['digestposts']}--><a href="digest.php?authorid=$post[authorid]">$post[digestposts]</a><!--{else}-->$post[digestposts]<!--{/if}--><br>
                {lang credits} $post[credits]<br>
                {lang posts} $post[posts]<br>
                <!--{loop $extcredits_thread $key $credit}-->
                        $credit[title] $post[$key] $credit[unit]<br>
                <!--{/loop}-->
                {lang readperm} $post[readaccess]<br>
                {lang regtime} $post[regdate]
                <!--{loop $_DCACHE['fields_thread'] $field}-->
                        <br>$field[title]&nbsp;
                        <!--{if $field['selective']}-->
                                $field['choices'][$post['field_'.$field['fieldid']]]
                        <!--{else}-->
                                $post['field_'.$field['fieldid']]
                        <!--{/if}-->
                <!--{/loop}-->
                <!--{if $post['location']}--><br>{lang location} $post[location]<!--{/if}--><br>
                <!--{if $vtonlinestatus && $post['authorid']}-->
                        <!--{if ($vtonlinestatus == 2 && $onlineauthors[$post[authorid]]) || ($vtonlinestatus == 1 && ($timestamp - $post['lastactivity'] <= 10800) && !$post['invisible'])}-->
                                {lang online_status} <b>{lang online}</b>
                        <!--{else}-->
                                {lang online_status} {lang offline}
                        <!--{/if}-->
                <!--{/if}-->
                <!--{if $avatarshowpos == 2 && $showavatars}--><br><br><center>$post[avatarshow]</center><!--{/if}-->
                </div>
                <!--{if $post['alipay']}--><br><a href="https://www.alipay.com/paytopost[alipay]?partner=20880020258585430156" target="_blank"><img src="{IMGDIR}/payto.gif" border="0" alt="{lang payto_author}" /></a><!--{/if}-->
        <!--{else}-->
                <!--{if !$post['authorid']}-->
                        <span class="bold">{lang guest}</span> <span class="smalltxt">$post[useip]</span><br><span class="smalltxt">{lang unregistered}
                <!--{elseif $post['authorid'] && $post['username'] && $post['anonymous']}-->
                        <span class="bold">
                        <!--{if $forum['ismoderator']}--><a href="viewpro.php?uid=$post[authorid]" target="_blank">{lang anonymous}</a><!--{else}-->{lang anonymous}<!--{/if}-->
                        </span><br>{lang member_anonymous}
                <!--{else}-->
                        <span class="bold">$post[author]</span><br>
                        {lang member_deleted}
                <!--{/if}-->
                <br><br><br><br><br><br><br><br><br><br>
        <!--{/if}-->
        </td>
        <td width="82%" valign="top" style="padding: 0px">
        <table border="0" cellspacing="0" cellpadding="{TABLESPACE}" class="t_msg">
        <tr><td>
        <div>
        <div class="right t_number"><a href="###" class="bold" onclick="window.clipboardData.setData('text','{$boardurl}viewthread.php?tid=$tid&amp;page=$page#pid$post[pid]')">#$post[number]</a></div>
        <!--{if $thread['special'] == 3 && $thread['price'] < 0 && $thread['dateline'] + 1 == $post['dbdateline'] && $post['first'] == 0 }-->
        <div class="right" style="padding-top: {TABLESPACE}px; background:url({IMGDIR}/flag.gif) no-repeat"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{lang reward_bestanswer}</b>&nbsp;</div>
        <!--{/if}-->
        <div style="padding-top: {TABLESPACE}px;">
        <!--{if $thread['special'] != 3 || $thread['price'] >= 0 || $thread['dateline'] + 1 != $post['dbdateline'] || $post['first']}-->{lang poston} $post[dateline]&nbsp;<!--{/if}-->
        <!--{if $post['username'] && !$post['anonymous']}-->
                <a href="viewpro.php?uid=$post[authorid]">{lang view_profile}</a>
                <!--{if $post['site']}--><a href="$post[site]" target="_blank">{lang homepage}</a><!--{/if}-->
                <!--{if $supe_status && $post['xspacestatus']}--><a href="$supe_siteurl/index.php?action/space/uid/$post[authorid]" target="_blank">{lang space}</a>
                <!--{elseif $post['allowuseblog']}--><a href="blog.php?uid=$post[authorid]" target="_blank">{lang blog}</a>
                <!--{/if}-->
                <a href="pm.php?action=send&amp;uid=$post[authorid]" target="_blank">{lang pm}</a>&nbsp;
                <!--{if $post['qq']}--><a href="http://wpa.qq.com/msgrd?V=1&amp;Uin=$post[qq]&amp;Site=$bbname&amp;Menu=yes" target="_blank"><img src="http://wpa.qq.com/pa?p=1post[qq]:4"  border="0" alt="QQ" /></a><!--{/if}-->
                <!--{if $post['icq']}--><a href="http://wwp.icq.com/scripts/search.dll?to=$post[icq]" target="_blank"><img src="http://web.icq.com/whitepages/online?icq=$post[icq]&amp;img=5" alt="ICQ {lang online_status}" border="0"  /></a><!--{/if}-->
                <!--{if $post['yahoo']}--><a href="http://edit.yahoo.com/config/send_webmesg?.target=$post[yahoo]&.src=pg" target="_blank"><img src="{IMGDIR}/yahoo.gif" alt="Yahoo!" border="0"  /></a><!--{/if}-->
                <!--{if $post['taobao']}--><script type="text/javascript">document.write('<a target="_blank" href="http://amos1.taobao.com/msg.ww?v=2&amp;uid='+encodeURIComponent('$post[taobao]')+'&amp;s=2"><img src="http://amos1.taobao.com/online.ww?v=2&uid='+encodeURIComponent('$post[taobao]')+'&s=2" alt="{lang taobao}" border="0"  /></a>&nbsp;');</script><!--{/if}-->
        <!--{/if}-->
        </div></div>
        </td></tr>
        <tr><td valign="top" class="line" height="100%" style="padding-top: 10px;">
        <!--{if $avatarshowpos == 1 && $showavatars}--><div style="float: right">$post[avatarshow]</div><!--{/if}-->
        <a name="pid$post[pid]" href="misc.php?action=viewratings&amp;tid=$tid&amp;pid=$post[pid]" title="{lang rate} $post[rate]">$post[ratings]</a>
        <!--{if $post['subject']}-->
                <span class="bold">$post[subject]</span><br><br>
        <!--{/if}-->
        <!--{if $adminid !=1 && $bannedmessages && (($post['authorid'] && !$post['username']) || ($post['groupid'] == 4 || $post['groupid'] == 5))}-->
                {lang message_banned}
        <!--{else}-->
                <div style="font-size: {MSGFONTSIZE}">$post[message]</div>
                <!--{if $post['attachment']}-->
                        <br><br><img src="images/attachicons/common.gif" alt="" />&nbsp;{lang attachment}: <i>{lang attach_nopermission}</i>
                <!--{else}-->
                        <!--{loop $post['attachments'] $attach}-->
                                <br><br>$attach[attachicon]
                                <!--{if $attach['attachimg']}-->
                                        <a href="member.php?action=credits&amp;view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attach_img}</a>:
                                        <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}-->
                                        <!--{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><br>
                                        <!--{if $attachrefcheck}-->
                                                <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);" alt="" />
                                        <!--{else}-->
                                                <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);" alt="" />
                                        <!--{/if}-->
                                <!--{else}-->
                                        <a href="member.php?action=credits&amp;view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
                                        <!--{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>
                                        <span class="smalltxt">{lang attach_download_count} $attach[downloads]
                                        <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}--></span><br>
                                <!--{/if}-->
                        <!--{/loop}-->
                <!--{/if}-->
                <!--{if $post['number'] == 1 && $relatedkeywords}--><br><br><span class="bold">{lang thread_keywords}</span> $relatedkeywords<br><br><!--{/if}-->
                <!--{if $relatedthreadlist && !$qihoo_location && $post['number'] == 1}-->
                        <br><fieldset><legend>{lang qihoo_relatedthreads}</legend><br>
                        <!--{loop $relatedthreadlist $key $threads}-->
                                <a href="viewthread.php?tid=$threads[tid]" target="_blank">$threads[title]</a><br>
                        <!--{/loop}-->
                        </fieldset>
                <!--{/if}-->
                <!--{if $post['ratelog']}-->
                        <br><fieldset><legend><a href="misc.php?action=viewratings&amp;tid=$tid&amp;pid=$post[pid]" title="{lang rate_view}">{lang thread_rate_log_lately}</a></legend><br>
                        <table border="0" cellspacing="0" cellpadding="0">
                        <!--{loop $post['ratelog'] $ratelog}-->
                                <tr><td><a href="viewpro.php?uid=$ratelog[uid]" target="_blank">$ratelog[username]</a></td>
                                <td>&nbsp;&nbsp;$ratelog[dateline]</td><td>&nbsp;&nbsp;{$extcredits[$ratelog[extcredits]][title]}</td><td>&nbsp;&nbsp;<b>$ratelog[score]</b></td>
                                <td>&nbsp;&nbsp;$ratelog[reason]</td></tr>
                        <!--{/loop}-->
                        </table>
                        </fieldset>
                <!--{/if}-->
                </td></tr>
                <!--{if $post['signature'] && !$post['anonymous'] && $showsignatures}-->
                        <tr><td valign="bottom">
                        <br><br><br><img src="images/common/sigline.gif" alt="" /><br><div class="signature" $maxsigrows>$post[signature]</div>
                        </td></tr>
                <!--{/if}-->
                <tr><td align="right">
                <!--{if ($forum['ismoderator'] || $thread['authorid'] == $discuz_uid) && $discuz_uid != $post['authorid'] && $post['authorid'] != $thread['authorid'] && $post['first'] == 0 && $thread['price'] > 0 && $thread['special'] == 3}-->
                &nbsp;<a href="###" onclick="setanswer($post['pid'])"><img src="{IMGDIR}/right.gif" border="0" alt="" /> <span class="bold">{lang reward_set_bestanswer}</span></a>
                <!--{/if}-->
                <!--{if $forum['ismoderator'] || $post['authorid'] == $discuz_uid}-->&nbsp;<a href="post.php?action=edit&amp;fid=$fid&amp;tid=$tid&amp;pid=$post[pid]&amp;page=$page&amp;extra=$extra">{lang edit}</a><!--{/if}-->
                <!--{if $allowpostreply}-->&nbsp;<a href="post.php?action=reply&amp;fid=$fid&amp;tid=$tid&amp;repquote=$post[pid]&amp;extra=$extra">{lang reply_quote}</a><!--{/if}-->
                <!--{if $discuz_uid && $reportpost}-->&nbsp;<a href="misc.php?action=report&amp;fid=$fid&amp;tid=$tid&amp;pid=$post[pid]&amp;page=$page">{lang reportpost}</a><!--{/if}-->
                <!--{if $raterange && $post['authorid']}-->&nbsp;<a href="misc.php?action=rate&amp;tid=$tid&amp;pid=$post[pid]&amp;page=$page">{lang rate}</a><!--{/if}-->
                <!--{if $fastpost && $allowpostreply}--><a href="###" onclick="fastreply('{lang post_fastreply_author}')">{lang reply}</a><!--{/if}-->
                <a href="###" onclick="scroll(0,0)"><img src="{IMGDIR}/top.gif" border="0" alt="{lang top}" /></a>
                <!--{if $forum['ismoderator'] && $allowdelpost}--><!--{if $post['number'] == 1}--><input class="checkbox" type="checkbox" disabled><!--{else}--><input class="checkbox" type="checkbox" name="delete[]" value="$post[pid]"><!--{/if}--><!--{/if}-->
                </td></tr>
                <!--{if !empty($advlist['thread'][$post['count']])}--><tr class="t_infoline"><td class="line" style="padding: 5px">[{lang advertisement}] $advlist[thread][$post[count]]</td></tr><!--{/if}-->
        <!--{/if}-->
        </table></td></tr></table></div>
<!--{/loop}-->
</form>

[ 本帖最后由 ComsenzInc 于 2006-11-20 23:14 编辑 ]
回复

使用道具 举报

 楼主| ComsenzInc 发表于 2006-11-19 16:45:08 | 显示全部楼层
:) :) :) 占位.......
回复

使用道具 举报

 楼主| ComsenzInc 发表于 2006-11-19 16:45:29 | 显示全部楼层
:) :) :) 占位.......
好了..下面开始慢慢写上来了..有无人看呢?
回复

使用道具 举报

Zart 发表于 2006-11-19 16:45:44 | 显示全部楼层
呵呵.
看看你
回复

使用道具 举报

Zart 发表于 2006-11-19 16:46:14 | 显示全部楼层
我看!!!

我也很想了解
回复

使用道具 举报

FujiwaraSai 发表于 2006-11-19 17:22:28 | 显示全部楼层
我觉得不必写这么复杂。讲解了if else loop然后给出变量列表就可以了
回复

使用道具 举报

elefee 发表于 2006-11-19 17:24:37 | 显示全部楼层
支持技术帖
回复

使用道具 举报

 楼主| ComsenzInc 发表于 2006-11-19 17:34:03 | 显示全部楼层
原帖由 FujiwaraSai 于 2006-11-19 17:22 发表
我觉得不必写这么复杂。讲解了if else loop然后给出变量列表就可以了
  1. 变量列表
复制代码
的话..已经有M55等人已经总结提供过了吧..
https://discuz.dismall.com/thread-329110-1-1.html
.....请教一点不明白的地方:
<!--{loop $postlist $post}-->这个LOOP,是怎么样进行的...或者说,LOOP的里面的变量是什么意思?

...估计是这样.按$post的顺序.loop $postlist

...高手就别取笑了,我不慬就是不慬..问问..希望,你能教教我.

[ 本帖最后由 ComsenzInc 于 2006-11-19 17:36 编辑 ]
回复

使用道具 举报

Zart 发表于 2006-11-19 17:36:58 | 显示全部楼层
呵呵.继续写.我支持你
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-28 03:22 , Processed in 0.241823 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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