Gallery:如何将评论中的全名修改为用户名
来自站长百科
或许你不想在G2相关的评论中留下全名,而只想显示用户名。不过模块不能提供这种便利,所以我得对文件做些调整。
在 gallery2/modules/comment/templates/Comment.tpl文件中 来看最后几行
<p class="info">
{capture name="date"}{g->date timestamp=$comment.date style="datetime"}{/capture}
{if $can.edit}
{g->text text="Posted by %s on %s (%s)"
arg1=$user.fullName|default:$user.userName
arg2=$smarty.capture.date
arg3=$comment.host}
{else}
{g->text text="Posted by %s on %s"
arg1=$user.fullName|default:$user.userName
arg2=$smarty.capture.date}
{/if}
</p>
我将$user.fullName修改为$user.userName。但不知道"default:"后的第二部分是做什么用的。
另外,如果你想将项目所有者的全名修改为用户名的话,在gallery2/modules/core/templates/blocks/ItemInfo.tpl文件中
{if !empty($showOwner)}
<span class="owner summary">
{g->text text="Owner: %s" arg1=$item.owner.fullName|default:$item.owner.userName}
</span>
{/if}
将$item.owner.fullName修改为$item.owner.userName
更多相关信息可在此论坛帖子中找到