| 1 |
<?php |
<?php |
| 2 |
|
// $Id$ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Provides a callback URL that lists, on one page, |
* Provides a callback URL that lists, on one page, |
| 18 |
$result = db_query("SELECT fid,name,title,type from {profile_fields}"); |
$result = db_query("SELECT fid,name,title,type from {profile_fields}"); |
| 19 |
if ($may_cache) { |
if ($may_cache) { |
| 20 |
while ($field = db_fetch_object($result)) { |
while ($field = db_fetch_object($result)) { |
| 21 |
$items[] = array('path' => "profile_pages/".$field->name, 'title' => $field->title, |
$items[] = array('path' => "profile_pages/". check_plain($field->name), 'title' => check_plain($field->title), |
| 22 |
'access' => user_access('view profile pages'), |
'access' => user_access('view profile pages'), |
| 23 |
'callback' => 'profile_pages_view', |
'callback' => 'profile_pages_view', |
| 24 |
'callback arguments' => array($field->fid,$field->type), |
'callback arguments' => array($field->fid, $field->type), |
| 25 |
'type' => MENU_CALLBACK); |
'type' => MENU_CALLBACK); |
| 26 |
/* $items[] = array('path' => "profile/".$field->name, 'title' => $field->title, |
/* $items[] = array('path' => "profile/".$field->name, 'title' => $field->title, |
| 27 |
'access' => user_access('view profile pages'), |
'access' => user_access('view profile pages'), |
| 34 |
} |
} |
| 35 |
|
|
| 36 |
function profile_pages_view($fid, $type) { |
function profile_pages_view($fid, $type) { |
| 37 |
if (!$fid || !is_numeric($fid) || !$type) { |
if (!$fid || !is_numeric($fid) || !$type || !user_access('view profile pages')) { |
| 38 |
drupal_not_found(); |
drupal_not_found(); |
| 39 |
return; |
return; |
| 40 |
} |
} |
| 68 |
* @return string |
* @return string |
| 69 |
*/ |
*/ |
| 70 |
function theme_profile_page_listing($user) { |
function theme_profile_page_listing($user) { |
| 71 |
return $user->name .': '. $user->value .'<br />'; |
return check_plain($user->name) .': '. check_plain($user->value) .'<br />'; |
| 72 |
} |
} |
| 73 |
?> |
?> |