本帖最后由 冰封123 于 2011-11-2 11:32 编辑
第一步:找到\templates\site\default下index.html.php
在需要评论的地方插入代码
- <div class="bnm">
- <div class="bnm_h">
- <h3>我要点评</h3>
- </div>
- <div class="bnm_c">
- <!--{block name="sql" parameter="sql/SELECT a.*, b.subject FROM brand_spacecomments a, brand_shopitems b WHERE a.itemid = b.itemid ORDER BY a.cid DESC/limit/0,5/cachetime/3600/tpl/brandhome"}-->
- <!--点评调用-->
- </div>
- </div>
复制代码 5为你调用评论的数字。brandhome是调用的模板
第二步:在\static\blockstyle 目录下建立一个文件brandhome.html.php
- <?exit?>
- <!--/**
- * [品牌空间] (C)2001-2010 Comsenz Inc.
- * This is NOT a freeware, use is subject to license terms
- */-->
- <!--{if $iarr}-->
- <!--{loop $iarr $ikey $value}-->
- <!--{eval
- $value['subject'] = cutstr($value['subject'], 9, true);
- $value['message'] = cutstr($value['message'], 10, true);
- }-->
- <!--这里控制显示的字数-->
- <table width="100%" border="0">
- <tr>
- <td width="48" rowspan="3" valign="top"><a class="avatar" target="_blank" href="http://192.168.1.108/bbs/home.php?mod=space&uid={$value['authorid']}"><img src="{UC_API}/avatar.php?uid={$value['authorid']}&rand=$_G[timestamp]&size=small"></a></td>
- <td width="542"><a target="_blank" href="http://192.168.1.108/bbs/home.php?mod=space&uid={$value['authorid']}">{$value['author']}</a>@<a class="shop-name" href="store.php?id={$value['itemid']}&op=view&page=0#comment{$value['cid']}">{$value['subject']}</a><span class="time"> <p> 更新于<!--{eval echo date("Y-m-d H:i", $value['dateline']);}--></p></span>
- <!--{block name="sql" parameter="sql/SELECT * FROM brand_commentscores WHERE cid=$value['cid']/limit/0,1/cachetime/3600/tpl/brandscore"}--><!--打分调用--></td>
- </tr>
- <tr>
- <td><blockquote>{$value['message']}</blockquote><span class="more"></span>
- </td>
- </tr>
- <tr>
- <td><a href="store.php?id={$value['itemid']}&op=view&page=0#comment{$value['cid']}">我来评论</a></td>
- </tr>
- </table>
-
- </li>
- <!--{/loop}-->
- <!--{/if}-->
复制代码 第三步:在\static\blockstyle 目录下建立一个文件brandscore.html.php
- <?exit?>
- <!--/**
- * [品牌空间] (C)2001-2010 Comsenz Inc.
- * This is NOT a freeware, use is subject to license terms
- */-->
- <!--{if $iarr}-->
- <!--{loop $iarr $ikey $value}-->
- <!--{eval $num="images/".floor($value['score']).".gif"}-->
- <!--{eval
- $s1 = sprintf("%.0f",{$value['score1']});
- $s2 = sprintf("%.0f",{$value['score2']});
- $s3 = sprintf("%.0f",{$value['score3']});
- $s4 = sprintf("%.0f",{$value['score4']});
- $s5 = sprintf("%.0f",{$value['score5']});
- }-->
- <div class="comment-rst">
- <dl>
- <dt>{$lang['comment_total_fee']}{$lang['colon']}<img src="{$num}"/><p>总分:<font color="#FF0000">{$value['score']}</font> </p>口味:<font color="#FF0000">$s1</font> 服务:<font color="#FF0000">$s2</font><p>环境:<font color="#FF0000">$s3</font> 份量:<font color="#FF0000">$s4</font></p></dt>
- </dl>
- </div>
- <!--{/loop}-->
- <!--{/if}-->
复制代码 第四步:大功告成!
前面几位朋友弄的不完善,这里我结合了前两位的,整合了一个可以直接拿过来用的评论!
本来金币不多,想赚个金币的,既然你们说你们看不了,那就不设置限制了!
|