Commit a8225b72 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use clean profile urls in forums area



Bug #1006634, part 3

These changes will call profile_url on user ids rather than user
records or objects, but this will not result in any additional queries
on these pages: the users are (unfortunately) already being fetched
one by one to run display_name.

Change-Id: Ia744e06fcbf761310f43461479ea1f345ea04c62
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 853e8647
......@@ -25,8 +25,8 @@
<div class="inlinelist">
<span>{str tag="Moderators" section="interaction.forum"}:</span>
{foreach from=$forum->moderators item=mod}
<a href="{$WWWROOT}user/view.php?id={$mod}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$mod}" alt=""></a>
<a href="{$WWWROOT}user/view.php?id={$mod}" class="moderator">{$mod|display_name:null:true}</a>
<a href="{profile_url($mod)}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$mod}" alt=""></a>
<a href="{profile_url($mod)}" class="moderator">{$mod|display_name:null:true}</a>
{/foreach}
</div>
{/if}
......
......@@ -11,7 +11,7 @@
<td class="forumpostleft">
<div class="author">
<img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=40&amp;id={$post->poster}" alt="" class="center">
<div class="poster"><a href="{$WWWROOT}user/view.php?id={$post->poster}"{if in_array($post->poster, $groupadmins)} class="groupadmin"{elseif $post->moderator} class="moderator"{/if}>{$post->poster|display_name}</a></div>
<div class="poster"><a href="{profile_url($post->poster)}"{if in_array($post->poster, $groupadmins)} class="groupadmin"{elseif $post->moderator} class="moderator"{/if}>{$post->poster|display_name}</a></div>
{if $post->postcount}<div class="postcount">{$post->postcount}</div>{/if}
</div>
</td>
......@@ -22,7 +22,7 @@
<ul>
{foreach from=$post->edit item=edit}
<li>
<a href="{$WWWROOT}user/view.php?id={$edit.editor}"
<a href="{profile_url($edit.editor)}"
{if $edit.editor == $groupowner} class="groupowner"
{elseif $edit.moderator} class="moderator"
{/if}
......
......@@ -18,14 +18,14 @@
<div class="s">{$topic->body|str_shorten_html:50:true:false|safe}</div>
</td>
<td class="s">
<a href="{$WWWROOT}user/view.php?id={$topic->poster}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$topic->poster}" alt=""></a>
<a href="{$WWWROOT}user/view.php?id={$topic->poster}" class="forumuser{if in_array($topic->poster, $groupadmins)} groupadmin{elseif $topic->moderator} moderator{/if}">{$topic->poster|display_name:null:true}</a>
<a href="{profile_url($topic->poster)}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$topic->poster}" alt=""></a>
<a href="{profile_url($topic->poster)}" class="forumuser{if in_array($topic->poster, $groupadmins)} groupadmin{elseif $topic->moderator} moderator{/if}">{$topic->poster|display_name:null:true}</a>
</td>
<td class="center s">{$topic->postcount}</td>
<td class="s">
{if !$topic->lastpostdeleted}
<a href="{$WWWROOT}interaction/forum/topic.php?id={$topic->id}#post{$topic->lastpost}">{$topic->lastposttime}</a> {str tag=by section=view}
<a href="{$WWWROOT}user/view.php?id={$topic->lastposter}" {if in_array($topic->lastposter, $groupadmins)} class="groupadmin"{elseif $topic->lastpostermoderator} class="moderator"{/if}>{$topic->lastposter|display_name:null:true}</a>
<a href="{profile_url($topic->lastposter)}" {if in_array($topic->lastposter, $groupadmins)} class="groupadmin"{elseif $topic->lastpostermoderator} class="moderator"{/if}>{$topic->lastposter|display_name:null:true}</a>
{/if}
</td>
{if $moderator}
......
......@@ -70,8 +70,8 @@
<label>{str tag="groupadminlist" section="interaction.forum"}</label>
{foreach from=$groupadmins item=groupadmin}
<span class="s inlinelist">
<a href="{$WWWROOT}user/view.php?id={$groupadmin}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$groupadmin}" alt=""></a>
<a href="{$WWWROOT}user/view.php?id={$groupadmin}" class="groupadmin">{$groupadmin|display_name}</a>
<a href="{profile_url($groupadmin)}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$groupadmin}" alt=""></a>
<a href="{profile_url($groupadmin)}" class="groupadmin">{$groupadmin|display_name}</a>
</span>
{/foreach}
{if $moderators}
......@@ -79,8 +79,8 @@
<label>{str tag="moderatorslist" section="interaction.forum"}</label>
{foreach from=$moderators item=mod}
<span class="s inlinelist">
<a href="{$WWWROOT}user/view.php?id={$mod}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$mod}" alt=""></a>
<a href="{$WWWROOT}user/view.php?id={$mod}" class="moderator">{$mod|display_name}</a>
<a href="{profile_url($mod)}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$mod}" alt=""></a>
<a href="{profile_url($mod)}" class="moderator">{$mod|display_name}</a>
</span>
{/foreach}
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment