By mskristinahall on
Hello.
I am making modifcations to my user list page. Not the profiles themselves, but the listing. For some reason I cannot find a way to make the users username be a link to their profile page.
Here is a copy of my customized profile_listing.tpl
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?php print $user->name ?></td>
<td><?php print $user->profile_firstname ?></td>
<td>
<?php
$year_diff = date("Y") - ($user->profile_bday{year});
$month_diff = date("m") - ($user->profile_bday{month});
$day_diff = date("d") - ($user->profile_bday{day});
if ($month_diff < 0)
$year_diff--;
elseif ($month_diff == 0 && $day_diff < 0)
$year_diff--;
?>
</td>
<td><?php print $user->profile_city ?></td>
<td><?php print $user->profile_orientation ?></td>
<td><?php print $user->profile_status ?></td>
<td>
<?php if($user->picture): ?>
<img src="/<?php print $user->picture ?>">
<?php endif; ?>
</td>
</tr>
</table>
Comments
put link to user name with user id
l( $user->name,'$base_url/$user->uid'); /*put associated link */print $user->profile_firstnameprint $user->profile_cityprint $user->profile_orientationprint $user->profile_statusif($user->picture):endif;Hi I have not tested this code but it should be like this
I am going to try that right
I am going to try that right now!
I copied the code you gave
I copied the code you gave me just to see what it would do.
It displays this http://kristinahall.net/qwo/?q=profile
This seems like a silly
This seems like a silly question but hmm I guessing its the right answer...
did you turn on users ability to access user profiles in admin/user/access?
to fix the code...
see: http://api.drupal.org/api/function/l/5
Aha! Yay thank you. It works
Aha! Yay thank you. It works fine now :D