| 1 |
<?php |
|---|
| 2 |
global $CFG,$USER; |
|---|
| 3 |
global $page_owner; |
|---|
| 4 |
$textlib = textlib_get_instance(); |
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
$run_result .= "<li id=\"sidebar_user\">"; |
|---|
| 8 |
|
|---|
| 9 |
$info = get_record('users','ident',$page_owner); |
|---|
| 10 |
|
|---|
| 11 |
if (!$tagline = get_field_sql('SELECT value FROM '.$CFG->prefix.'profile_data |
|---|
| 12 |
WHERE owner = '.$page_owner." AND name = 'minibio' |
|---|
| 13 |
AND (".run("users:access_level_sql_where",$USER->ident).")")) { |
|---|
| 14 |
$tagline = " "; |
|---|
| 15 |
} |
|---|
| 16 |
|
|---|
| 17 |
$ul_username = user_info('username', $page_owner); |
|---|
| 18 |
|
|---|
| 19 |
$info->icon = run("icons:get", $page_owner); |
|---|
| 20 |
|
|---|
| 21 |
$icon = user_icon_html($info->ident,67); |
|---|
| 22 |
$name = stripslashes(user_name($info->ident)); |
|---|
| 23 |
|
|---|
| 24 |
$url = url . $info->username . "/"; |
|---|
| 25 |
|
|---|
| 26 |
$lmshosts = ''; |
|---|
| 27 |
if ($info->ident == $USER->ident) { |
|---|
| 28 |
|
|---|
| 29 |
if ($aliases = get_records('users_alias','user_id',$USER->ident)) { |
|---|
| 30 |
foreach ($aliases as $alias) { |
|---|
| 31 |
if (!empty($CFG->lmshosts) && is_array($CFG->lmshosts) && array_key_exists($alias->installid,$CFG->lmshosts)) { |
|---|
| 32 |
$name = $alias->installid; |
|---|
| 33 |
if (!empty($CFG->lmshosts[$alias->installid]['name'])) { |
|---|
| 34 |
$name = $CFG->lmshosts[$alias->installid]['name']; |
|---|
| 35 |
} |
|---|
| 36 |
$lmshosts .= '<a href="'.$CFG->lmshosts[$alias->installid]['baseurl'].'">'.$name.'</a><br />'; |
|---|
| 37 |
} |
|---|
| 38 |
} |
|---|
| 39 |
} |
|---|
| 40 |
} |
|---|
| 41 |
if (!empty($lmshosts)) { |
|---|
| 42 |
$lmshosts = __gettext('Your LMS hosts').':<br />'.$lmshosts; |
|---|
| 43 |
} |
|---|
| 44 |
|
|---|
| 45 |
$body = templates_draw(array( |
|---|
| 46 |
'context' => 'ownerbox', |
|---|
| 47 |
'name' => $name, |
|---|
| 48 |
'profileurl' => $url, |
|---|
| 49 |
'usericon' => $icon, |
|---|
| 50 |
'tagline' => $tagline, |
|---|
| 51 |
'lmshosts' => $lmshosts, |
|---|
| 52 |
'usermenu' => run("users:infobox:menu:text",array($page_owner)) |
|---|
| 53 |
) |
|---|
| 54 |
); |
|---|
| 55 |
|
|---|
| 56 |
if ($page_owner != -1) { |
|---|
| 57 |
if ($page_owner != $_SESSION['userid']) { |
|---|
| 58 |
$title = __gettext("Profile Owner"); |
|---|
| 59 |
} else { |
|---|
| 60 |
$title = __gettext("You"); |
|---|
| 61 |
} |
|---|
| 62 |
} |
|---|
| 63 |
|
|---|
| 64 |
$run_result .= templates_draw(array( |
|---|
| 65 |
'context' => 'sidebarholder', |
|---|
| 66 |
'title' => $title, |
|---|
| 67 |
'body' => $body |
|---|
| 68 |
) |
|---|
| 69 |
); |
|---|
| 70 |
$run_result .= "</li>"; |
|---|
| 71 |
|
|---|
| 72 |
?> |
|---|