Commit 43559c30 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use clean urls in tagged posts block



Bug #1006634, part 3

Because the urlid field is required here, this patch also modifies the
block to use the display_name function rather than firstname and
lastname.

Change-Id: Ie24a5bfa51595da9a063e23aae98420ca93fc7f4
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent ca06d2ec
......@@ -92,13 +92,7 @@ class PluginBlocktypeTaggedposts extends SystemBlocktype {
// check if the user viewing the page is the owner of the selected tag
$owner = $results[0]->owner;
if ($USER->id != $owner) {
$sql =
'SELECT id, firstname, lastname
FROM {usr}
WHERE id = ?';
$viewowner = get_records_sql_array($sql, array($owner));
$viewowner = get_user_for_display($owner);
$smarty->assign('viewowner', $viewowner);
}
......
......@@ -5,8 +5,7 @@
{else}
{str tag='blockheading' section='blocktype.blog/taggedposts'}
{if $viewowner}
{$viewowner = $viewowner[0]}
<strong>{$tag}</strong> by <strong><a href="{$WWWROOT}user/view.php?id={$viewowner->id}">{$viewowner->firstname} {$viewowner->lastname}</a></strong>
<strong>{$tag}</strong> by <strong><a href="{profile_url($viewowner)}">{$viewowner|display_default_name}</a></strong>
{else}
<strong><a href="{$WWWROOT}tags.php?tag={$tag}&sort=name&type=text">{$tag}</a></strong>
{/if}
......
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