Creating a "Biographies" page

I used the Profile module to add a multi-line field called "Interests," and a URL field called "My Web Site or Biography Link." There are also fields for first and last names, city, state, and zip codes. This page also includes the user's picture if they loaded one.

I create a simple table with the class="even" and class="odd" to separate the rows. The user's web site link is a bit smaller than normal text, but includes target="_blank" so your users stay on your site.

<p>This page is intended to give you an introduction to the members of xxxxx.  The information is filled in by the members themselves in their &quot;My Account&quot; page. In order to appear on this list you must have logged in at least once.</p>

<?php
print('<table width="100%"><caption><b>XXXXX Member Biographies</b></caption>'."\n");

$header = array(
  array(
'data' => t('Username'), 'field' => 'u.name', 'sort' => 'asc'),
  array(
'data' => t('Photo')),
  array(
'data' => t('Name')),
  array(
'data' => t('Location')),
  array(
'data' => t('Member since')),
  array(
'data' => t('Interests/Bio'))
);
$sql = "SELECT u.uid, u.name FROM {users} u";
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
$oddrow = 1;

while (
$account = db_fetch_object($result)) {
  
$account = user_load(array('uid' => $account->uid));

if (
$account->uid > 1) {
   if (
$account->picture){$account->picture = '<img src="/'.$account->picture.'" height="100" width="100" border="0" alt="'.$account->name.'">';}
    else {
$account->picture = '<img src="/files/pictures/KB/bodYou.gif" height="100" width="100" border="0" alt="no picture found">';}

 
$fullname = $account->profile_firstname . " " . $account->profile_lastname;

  if (
$account->profile_interests) {$interests = $account->profile_interests;}
  else {
$interests = "No biography provided";}

  if (
$account->profile_biolink) {$interests .= '<br><small><a href="' . $account->profile_biolink
                                        
. '" target="_blank">' . $fullname . "'s web site</a></small>";}
  if (
$account->profile_city) {$location = $account->profile_city . ", "
                                
. $account->profile_state . " " . $account->profile_zip;}
  else {
$location = "No location provided";}
 
  if (
$oddrow == 1) {print ('<tr class="odd">'); $oddrow = 0;}
  else {print (
'<tr class="even">'); $oddrow = 1;}

  print (
'<td align="center">' . $fullname . "<br>" . $account->picture . "<br>" . "</td> \n"
     
. '<td align="center"><small>' . $location . "</small></td> \n"
     
. "<td>Member since " . date('F Y', mktime(0, 0, 0, $account->profile_date_joined['month'],
                              
$account->profile_date_joined['day'],
                              
$account->profile_date_joined['year']))
      .
". " . $interests . "</td></tr> \n");
  print (
$row);
}
}

print (
"</table>\n");
?>

Comments

Which file should i modify

Hi Nancy i dont know which file should modify?

New page

You put this code into a PHP formatted page. There is no file to modify.