教程:教程:分步详解新的区块注释设计
发布者: alain01于 2013/2/19 21:40:00 7820次阅读我与您分享关于新式新闻的经验:一个分步教程。在本期中,我将向您展示如何修改注释块。该块的默认设计相当过时,因此让我们进行一些小而巧的设计更改,以使显示更实用。请在这里查看一个示例 这里(非XOOPS网站)。首先,您应该理解主题是如何过载的(主题过载)。这方面的最佳教程是XOOPS France上的这个(法语)。我们将一步一步地进行,以便向您解释这是如何可能的,最后,您应该练习对这些更改进行其他区块。我会邀请您逐步上传文件,这样您会更清楚。所以,现在,让我们开始吧!我们需要: - 来自系统模块的注释模板文件 - 来自您的主题的CSS文件(style.css) 1 - 将注释模板文件复制到过载的主题中 将文件 /www/modules/system/templates/system_comment*.html 复制到 /www/themes/mytheme/modules/system - system_comment.html - system_comments_flat.html - system_comments_net.html - system_comments_thread.html 2 - 定制化 2a Head 现在,我们在 /www/themes/mytheme/modules/system 的文件上工作。我们从删除顶部头部开始。编辑 3 个文件 system_comments_*.html 并将这些行注释掉(或删除这些行)
<div class="comUserRank">
<div class="comUserRankText"><{$comment.poster.rank_title}>div>
<img class="comUserRankImg" src="<{$xoops_upload_url}>/<{$comment.poster.rank_image}>" alt="" />
div>
<img class="comUserImg" src="<{$xoops_upload_url}>/<{$comment.poster.avatar}>" alt="" />
<div class="comUserStat"><span class="comUserStatCaption"><{$lang_joined}>:span> <{$comment.poster.regdate}>div>
<div class="comUserStat"><span class="comUserStatCaption"><{$lang_from}>:span> <{$comment.poster.from}>div>
<div class="comUserStat"><span class="comUserStatCaption"><{$lang_posts}>:span> <{$comment.poster.postnum}>div>
<div class="comUserStatus"><{$comment.poster.status}>div>
<img class="comUserImg" src="<{$xoops_upload_url}>/<{$comment.poster.avatar}>" alt="" />
<tr>
<td class="head"><a id="comment<{$comment.id}>">a> <{$comment.poster.uname}>td>
<td class="head"><div class="comDate"><span class="comDateCaption"><{$lang_posted}>:span> <{$comment.date_posted}> <span class="comDateCaption"><{$lang_updated}>:span> <{$comment.date_modified}>div>td>
<tr>
<tr>
<td><a id="comment<{$comment.id}>">a<td>
<td><{$comment.poster.uname}> 说了<$comment.date_posted}> ($lang_updated>:$comment.date_modified>>)td>
<tr>
<tr>
<td><a id="comment<{$comment.id}>">a<td>
<td><{$comment.poster.uname}> 说了<$comment.date_posted>
<{if $comment.date_posted!= $comment.date_modified>
(修改于<$comment.date_modified>>)
<{/if}>
td>
<tr>
<div style="float:right;">
<{if $xoops_iscommentadmin == true}>
<a href="<{$editcomment_link}>&com_id=<{$comment.id}>" title="<{$lang_edit}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" />a>
<a href="<{$deletecomment_link}>&com_id=<{$comment.id}>" title="<{$lang_delete}>"><img src="<{$xoops_url}>/images/icons/delete.gif" alt="<{$lang_delete}>" />a>
<a href="<{$replycomment_link}>&com_id=<{$comment.id}>" title="<{$lang_reply}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" />a>
<{elseif $xoops_isuser == true && $xoops_userid == $comment.poster.id}>
<a href="<{$editcomment_link}>&com_id=<{$comment.id}>" title="<{$lang_edit}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" />a>
<a href="<{$replycomment_link}>&com_id=<{$comment.id}>" title="<{$lang_reply}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" />a>
<{elseif $xoops_isuser == true || $anon_canpost == true}>
<a href="<{$replycomment_link}>&com_id=<{$comment.id}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" />a>
<{/if}>
div>
<div class="comTitle"><{$comment.image}><{$comment.title}>div>
<td style="width:120px;"><a id="comment<{$comment.id}>">a>td>
<td style="text-align:center;">
<img class="comUserImg" src="<{$xoops_upload_url}>/<{$comment.poster.avatar}>" alt="" />
td>
.arrow-left {
width: 0px;
height: 0px;
border-style: solid;
border-width: 25px 20px 25px 0;
border-color: transparent #ECE9D8 transparent transparent;
}
<td>td>
<td style="width:120px;"><a id="comment<{$comment.id}>">a>td>
<td>td>
<td class="odd"><div class="comText"><{$comment.text}>div>td>
<div class="arrow-left">div>
<td style="width:20px;"><div class="arrow-left">div><td>
<td><br /><br /><{$comment.poster.uname}>
<tr>
<td style="width:120px;"><a id="comment<{$comment.id}>">a>td>
<td>td>
<td><br /><br /><{$comment.poster.uname}> a dit le <{$comment.date_posted}>
<{if $comment.date_posted != $comment.date_modified}>
(modifié le <{$comment.date_modified}>)
<{/if}>
<div style="float:right;">
<{if $xoops_iscommentadmin == true}>
<a href="<{$editcomment_link}>&com_id=<{$comment.id}>" title="<{$lang_edit}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" />a>
<a href="<{$deletecomment_link}>&com_id=<{$comment.id}>" title="<{$lang_delete}>"><img src="<{$xoops_url}>/images/icons/delete.gif" alt="<{$lang_delete}>" />a>
<a href="<{$replycomment_link}>&com_id=<{$comment.id}>" title="<{$lang_reply}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" />a>
<{elseif $xoops_isuser == true && $xoops_userid == $comment.poster.id}>
<a href="<{$editcomment_link}>&com_id=<{$comment.id}>" title="<{$lang_edit}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" />a>
<a href="<{$replycomment_link}>&com_id=<{$comment.id}>" title="<{$lang_reply}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" />a>
<{elseif $xoops_isuser == true || $anon_canpost == true}>
<a href="<{$replycomment_link}>&com_id=<{$comment.id}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" />a>
<{/if}>
div>
td>
tr>
<tr>
<{if $comment.poster.id != 0}>
<td style="text-align:center;">
<img class="comUserImg" src="<{$xoops_upload_url}>/<{$comment.poster.avatar}>" alt="" />
td>
<{else}>
<td class="odd"> td>
<{/if}>
<td style="width:20px;"><div class="arrow-left">div>td>
<td class="odd">
<div class="comText"><{$comment.text}>div>
td>
tr>
<tr><td>td><td>td><td>td>tr>