Gallery2:How to Change Fullname to Username in Comments - Gallery Codex
Personal tools

Gallery2:How to Change Fullname to Username in Comments

From Gallery Codex

Maybe you don't want to show full names associated with the comments in G2, but show usernames instead. Unfortunately the module doesn't allow the ability to choose yet, so I had to hack the files.

In the file gallery2/modules/comment/templates/Comment.tpl go to the last few lines

<p class="info">
  {capture name="date"}{g->date timestamp=$ style="datetime"}{/capture}
  {if $can.edit}
    {g->text text="Posted by %s on %s (%s)"

    {g->text text="Posted by %s on %s"

I changed $user.fullName to $user.userName. Dunno what the second portion after "default:" is for.

Additionally, if you want to change the item owner's fullname to username, in 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}

Change $item.owner.fullName to $item.owner.userName

More info in this forum thread