Changeset 1022
- Timestamp:
- 03/12/07 12:10:28 (2 years ago)
- Files:
-
- devel/_files/rss2.php (modified) (1 diff)
- devel/_weblog/rss091.php (modified) (1 diff)
- devel/_weblog/rss2.php (modified) (1 diff)
- devel/lib/elgglib.php (modified) (1 diff)
- devel/lib/templates.php (modified) (1 diff)
- devel/lib/userlib.php (modified) (1 diff)
- devel/mod/adash/index.php (modified) (1 diff)
- devel/mod/blog/lib.php (modified) (3 diffs)
- devel/mod/browser/index.php (modified) (1 diff)
- devel/profile/edit.php (modified) (1 diff)
- devel/profile/profile.class.php (modified) (4 diffs)
- devel/profile/rss2.php (modified) (1 diff)
- devel/search/personaltags.php (modified) (1 diff)
- devel/units/communities/communities_edit.php (modified) (1 diff)
- devel/units/communities/communities_edit_wrapper.php (modified) (1 diff)
- devel/units/communities/communities_members.php (modified) (1 diff)
- devel/units/communities/communities_membership_requests.php (modified) (1 diff)
- devel/units/communities/communities_moderator_of.php (modified) (1 diff)
- devel/units/communities/userdetails_edit.php (modified) (1 diff)
- devel/units/files/function_rss_publish.php (modified) (1 diff)
- devel/units/files/function_search.php (modified) (1 diff)
- devel/units/files/function_search_ecl.php (modified) (1 diff)
- devel/units/friends/friends_actions.php (modified) (2 diffs)
- devel/units/friends/friends_edit.php (modified) (1 diff)
- devel/units/friends/friends_of_edit.php (modified) (1 diff)
- devel/units/friends/generate_foaf.php (modified) (2 diffs)
- devel/units/friends/user_friendship_requests.php (modified) (1 diff)
- devel/units/profile/function_display_name.php (modified) (2 diffs)
- devel/units/profile/function_rss_publish.php (modified) (1 diff)
- devel/units/profile/function_search.php (modified) (1 diff)
- devel/units/profile/function_search_ecl.php (modified) (1 diff)
- devel/units/profile/function_search_rss.php (modified) (1 diff)
- devel/units/profile/profile_user_info.php (modified) (1 diff)
- devel/units/rpc/lib/class_user.php (modified) (2 diffs)
- devel/units/users/main.php (modified) (1 diff)
- devel/units/users/user_info.php (modified) (1 diff)
- devel/units/users/userdetails_edit.php (modified) (1 diff)
- devel/units/weblogs/default_template.php (modified) (1 diff)
- devel/units/weblogs/function_rss_publish.php (modified) (1 diff)
- devel/units/weblogs/function_search.php (modified) (1 diff)
- devel/units/weblogs/function_search_ecl.php (modified) (1 diff)
- devel/units/weblogs/weblogs_posts_view.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/_files/rss2.php
r659 r1022 26 26 27 27 if ($info = get_record('users','ident',$page_owner)) { 28 $name = stripslashes( $info->name);28 $name = stripslashes(user_name($info->ident)); 29 29 $mainurl = $CFG->wwwroot . $info->username . "/files/"; 30 30 $rssurl = $mainurl . "rss/" . urlencode($tag); devel/_weblog/rss091.php
r454 r1022 33 33 END; 34 34 if ($info = get_record('users','ident',$page_owner)) { 35 $name = htmlspecialchars(stripslashes( $info->name), ENT_COMPAT, 'utf-8');35 $name = htmlspecialchars(stripslashes(user_name($info->ident)), ENT_COMPAT, 'utf-8'); 36 36 $username = htmlspecialchars($info->username, ENT_COMPAT, 'utf-8'); 37 37 $sitename = sitename; devel/_weblog/rss2.php
r659 r1022 75 75 $rssweblog = $rssdescription; 76 76 break; 77 default: $name = (stripslashes( $info->name));77 default: $name = (stripslashes(user_name($info->ident))); 78 78 $rssdescription = sprintf(__gettext("The weblog for %s, hosted on %s."),$name,$sitename); 79 79 break; devel/lib/elgglib.php
r1019 r1022 4115 4115 $title = "[" . __gettext("Restricted") . "] "; 4116 4116 if (substr_count($accessvalue, "community") > 0) { 4117 $name = run("profile:display:name",str_replace("community", '', $accessvalue));4117 $name = user_name(str_replace("community", '', $accessvalue)); 4118 4118 $title = '<span title="' . __gettext('Restricted to Community: ') . $name . '">' . $title . '</span>'; 4119 4119 } else if (substr_count($accessvalue, "group") > 0) { devel/lib/templates.php
r1021 r1022 1403 1403 1404 1404 foreach($users as $user) { 1405 $icon_html = user_icon_html($user->ident,67); 1405 1406 $result .= <<< END 1406 1407 1407 1408 <td align="center"> 1408 1409 <div class="image_holder"> 1409 <a href="{$CFG->wwwroot}{$user->username}/"> <img src="{$CFG->wwwroot}_icon/user/{$user->iconid}/w/80/h/80" border="0" /></a>1410 <a href="{$CFG->wwwroot}{$user->username}/">{$icon_html}</a> 1410 1411 </div> 1411 1412 <div class="userdetails"> devel/lib/userlib.php
r1016 r1022 87 87 88 88 } 89 90 /** 91 * Returns a user's name, with event hooks allowing for interception. 92 * Internally passes around a "user_name" "display" event, with an object 93 * containing the elements 'name' and 'owner'. 94 * 95 * @uses $CFG 96 * @param integer $user_id The unique ID of the user we want to find the name for. 97 * @return string Returns the user's name, or a blank string if something went wrong (eg the user didn't exist). 98 */ 99 function user_name($user_id) { 100 global $CFG; 101 $user_name = new stdClass; 102 $user_name->owner = $user_id; 103 if ($user_name->name = user_info("name",$user_id)) { 104 if ($user_name = plugin_hook("user_name","display",$user_name)) { 105 return $user_name->name; 106 } 107 } 108 return ""; 109 } 110 /** 111 * Returns the HTML to display a user's icon, with event hooks allowing for interception. 112 * Internally passes around a "user_icon" "display" event, with an object 113 * containing the elements 'html', 'icon' (being the icon ID), 'size', 'owner' and 'url'. 114 * 115 * @uses $CFG 116 * @param integer $user_id The unique ID of the user we want to display the icon for. 117 * @param integer $size The size of the icon we want to display (max: 100). 118 * @param boolean $urlonly If true, returns the URL of the icon rather than the full HTML. 119 * @return string Returns the icon HTML, or the default icon if something went wrong (eg the user didn't exist). 120 */ 121 function user_icon_html($user_id, $size = 100, $urlonly = false) { 122 global $CFG; 123 $extra = ""; 124 $user_icon = new stdClass; 125 $user_icon->owner = $user_id; 126 $user_icon->size = $size; 127 if ($size < 100) { 128 $extra = "/h/$size/w/$size"; 129 } 130 if ($user_icon->icon = user_info("icon",$user_id)) { 131 $user_icon->url = "{$CFG->wwwroot}_icon/user/{$user_icon->icon}{$extra}"; 132 $user_icon->html = "<img src=\"{$user_icon->url}\" border=\"0\" />"; 133 if ($user_icon = plugin_hook("user_icon","display",$user_icon)) { 134 if ($urlonly) { 135 return $user_icon->url; 136 } else { 137 return $user_icon->html; 138 } 139 } 140 } 141 if ($urlonly) { 142 return -1; 143 } else { 144 return "<img src=\"{$CFG->wwwroot}_icon/user/-1{$extra}\" border=\"0\" />"; 145 } 146 } 89 147 90 148 // USER FLAGS ////////////////////////////////////////////////////////////////// devel/mod/adash/index.php
r758 r1022 36 36 // Initialise page body and title 37 37 $body = ""; 38 $title = run("profile:display:name",$user_id) . " :: " . __gettext("Dashboard");38 $title = user_name( $user_id) . " :: " . __gettext("Dashboard"); 39 39 40 40 templates_page_setup(); devel/mod/blog/lib.php
r1016 r1022 133 133 $data = new stdClass; 134 134 $data->ident = $page_owner; 135 $data->name = run("profile:display:name",$page_owner);135 $data->name = user_name($page_owner); 136 136 $connections[] = $data; 137 137 if ($page_owner != $_SESSION['userid']) { 138 138 $data = new stdClass; 139 139 $data->ident = $_SESSION['userid']; 140 $data->name = run("profile:display:name",$_SESSION['userid']);140 $data->name = user_name($_SESSION['userid']); 141 141 $connections[] = $data; 142 142 } … … 195 195 $body .= "<p class=\"frontpage-blog-date\">" . strftime("%B %d, %Y",$post->posted) . "</p>"; 196 196 $body .= "<p class=\"frontpage-blog-body\">" . run("weblogs:text:process", $post->body) . "</p>"; 197 $body .= "<p class=\"frontpage-blog-from\">" . __gettext("From:") . " <a href=\"{$CFG->wwwroot}" . user_info("username",$post->weblog) . "\">" . user_ info("name",$post->weblog) . "</a> - ";197 $body .= "<p class=\"frontpage-blog-from\">" . __gettext("From:") . " <a href=\"{$CFG->wwwroot}" . user_info("username",$post->weblog) . "\">" . user_name($post->weblog) . "</a> - "; 198 198 $body .= "<a href=\"{$CFG->wwwroot}" . user_info("username",$post->weblog) . "/weblog/" . $post->ident . ".html\">" . __gettext("Read more") . "</a></p>"; 199 199 $body .= "</div>"; … … 229 229 $body .= "<h4>" . $post->title . "</h4>"; 230 230 $body .= "<p class=\"frontpage-blog-date\">" . strftime("%B %d, %Y",$post->posted) . "</p>"; 231 $body .= "<p class=\"frontpage-blog-from\">" . __gettext("From:") . " <a href=\"{$CFG->wwwroot}" . user_info("username",$post->weblog) . "\">" . user_ info("name",$post->weblog) . "</a> - ";231 $body .= "<p class=\"frontpage-blog-from\">" . __gettext("From:") . " <a href=\"{$CFG->wwwroot}" . user_info("username",$post->weblog) . "\">" . user_name($post->weblog) . "</a> - "; 232 232 $body .= "<a href=\"{$CFG->wwwroot}" . user_info("username",$post->weblog) . "/weblog/" . $post->ident . ".html\">" . __gettext("Read more") . "</a></p>"; 233 233 $body .= "</div>"; devel/mod/browser/index.php
r971 r1022 161 161 $description = get_field("profile_data", "value", "owner", $result->ident, "name", 'minibio'); 162 162 163 $icon = "{$CFG->wwwroot}_icon/user/{$result->icon}";163 $icon = user_icon_html($result->ident); 164 164 165 165 $name = htmlspecialchars($result->name); 166 166 167 $iconcode = "<a href=\"{$CFG->wwwroot}{$result->username}\"> <img src=\"{$icon}\" border=\"0\" alt=\"{$result->username}\" /></a>";167 $iconcode = "<a href=\"{$CFG->wwwroot}{$result->username}\">{$icon_html}</a>"; 168 168 if (!$displayicons) { 169 169 // Uncomment this if we move to Javascript unhide devel/profile/edit.php
r1007 r1022 43 43 } 44 44 45 $title = run("profile:display:name",$page_owner) . " :: ". __gettext("Edit profile") ."";45 $title = user_name($page_owner) . " :: ". __gettext("Edit profile") .""; 46 46 templates_page_setup(); 47 47 devel/profile/profile.class.php
r1007 r1022 382 382 } 383 383 $friends_username = $info->username; 384 $friends_name = htmlspecialchars(stripslashes( $info->name), ENT_COMPAT, 'utf-8');384 $friends_name = htmlspecialchars(stripslashes(user_name($info->ident)), ENT_COMPAT, 'utf-8'); 385 385 $friends_menu = run("users:infobox:menu",array($info->ident)); 386 $friends_icon = user_icon_html($info->ident,$width); 386 387 $body .= <<< END 387 388 <td align="center"> 388 389 <p> 389 390 <a href="{$CFG->wwwroot}{$friends_username}/"> 390 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$width}" alt="{$friends_name}" border="0" /></a><br />391 {$friends_icon}</a><br /> 391 392 <span class="userdetails"> 392 393 {$friends_name} … … 460 461 WHERE '.$searchline)) { 461 462 foreach($result as $key => $info) { 462 $icon = u rl . '_icon/user/'.$post->icon;463 $icon = user_icon_html($info->ident,100,true); 463 464 $sub_result .= "\t\t\t<item>\n"; 464 $sub_result .= "\t\t\t\t<name><![CDATA[" . htmlspecialchars(stripslashes( $info->name), ENT_COMPAT, 'utf-8') . "]]></name>\n";465 $sub_result .= "\t\t\t\t<name><![CDATA[" . htmlspecialchars(stripslashes(user_info($info->ident)), ENT_COMPAT, 'utf-8') . "]]></name>\n"; 465 466 $sub_result .= "\t\t\t\t<link>" . url . htmlspecialchars($info->username, ENT_COMPAT, 'utf-8') . "</link>\n"; 466 467 $sub_result .= "\t\t\t\t<link>$icon</link>\n"; … … 503 504 foreach($result as $key => $info) { 504 505 $run_result .= "\t<item>\n"; 505 $run_result .= "\t\t<title><![CDATA['" . htmlspecialchars($tagtype, ENT_COMPAT, 'utf-8') . "' = " . htmlspecialchars($tagvalue, ENT_COMPAT, 'utf-8') . " :: " . htmlspecialchars(stripslashes( $info->name), ENT_COMPAT, 'utf-8') . "]]></title>\n";506 $run_result .= "\t\t<title><![CDATA['" . htmlspecialchars($tagtype, ENT_COMPAT, 'utf-8') . "' = " . htmlspecialchars($tagvalue, ENT_COMPAT, 'utf-8') . " :: " . htmlspecialchars(stripslashes(user_info($info->ident)), ENT_COMPAT, 'utf-8') . "]]></title>\n"; 506 507 $run_result .= "\t\t<link>" . url . htmlspecialchars($info->username, ENT_COMPAT, 'utf-8') . "</link>\n"; 507 508 $run_result .= "\t</item>\n"; … … 919 920 } 920 921 921 $icon = '<img alt="" src="' . url . '_icon/user/' . $info->icon . '/w/67" />';922 $name = stripslashes( $info->name);922 $icon = user_icon_html($info->ident,67); 923 $name = stripslashes(user_name($info->ident)); 923 924 $url = url . $info->username . "/"; 924 925 devel/profile/rss2.php
r659 r1022 26 26 27 27 if ($info = get_record('users','ident',$page_owner)) { 28 $name = stripslashes( $info->name);28 $name = stripslashes(user_name($info->ident)); 29 29 $username = $info->username; 30 30 $mainurl = url . $username . "/"; devel/search/personaltags.php
r667 r1022 24 24 templates_page_setup(); 25 25 26 $title = run("profile:display:name",$user_id) . " :: " . __gettext("Tags");26 $title = user_name($user_id) . " :: " . __gettext("Tags"); 27 27 28 28 $body = run("content:tags"); devel/units/communities/communities_edit.php
r776 r1022 23 23 } 24 24 foreach($result as $key => $info) { 25 $friends_name = run("profile:display:name",$info->ident);25 $friends_name = user_name($info->ident); 26 26 $info->icon = run("icons:get",$info->ident); 27 27 $friends_menu = run("users:infobox:menu",array($info->ident)); 28 $friends_icon = user_icon_html($info->ident,$w); 28 29 $body .= <<< END 29 30 <td> 30 31 <p> 31 32 <a href="{$CFG->wwwroot}{$info->username}/"> 32 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />33 {$friends_icon}</a><br /> 33 34 <span class="userdetails"> 34 35 <a href="{$CFG->wwwroot}{$info->username}/">{$friends_name}</a> devel/units/communities/communities_edit_wrapper.php
r659 r1022 3 3 global $page_owner; 4 4 5 $title = run("profile:display:name") . " :: ". __gettext("Communities") ."";5 $title = user_name($page_owner) . " :: ". __gettext("Communities") .""; 6 6 7 7 $body = run("content:communities:manage"); devel/units/communities/communities_members.php
r777 r1022 23 23 } 24 24 foreach($result as $key => $info) { 25 $friends_name = run("profile:display:name",$info->ident);25 $friends_name = user_name($info->ident); 26 26 $info->icon = run("icons:get",$info->ident); 27 27 // $friends_menu = run("users:infobox:menu",array($info->ident)); 28 $friends_icon = user_icon_html($info->ident,$w); 28 29 $body .= <<< END 29 30 <td> 30 31 <p> 31 32 <a href="{$CFG->wwwroot}{$info->username}/"> 32 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />33 {$friends_icon}</a><br /> 33 34 <span class="userdetails"> 34 35 {$friends_name} devel/units/communities/communities_membership_requests.php
r697 r1022 37 37 $body .= templates_draw(array( 38 38 'context' => 'adminTable', 39 'name' => '<img src="' . url . '_icon/user/' . $pending_user->icon . '" />',39 'name' => user_icon_html($pending_user->ident), 40 40 'column1' => $col1, 41 41 'column2' => $col2 devel/units/communities/communities_moderator_of.php
r690 r1022 23 23 // $w = 100; 24 24 //} 25 // $friends_name = htmlspecialchars(stripslashes($info->name), ENT_COMPAT, 'utf-8'); 26 $friends_name = run("profile:display:name", $info->ident); 25 $friends_name = user_name($info->ident); 27 26 $info->icon = run("icons:get",$info->ident); 28 27 // $friends_menu = run("users:infobox:menu",array($info->ident)); 28 $friends_icon = user_icon_html($info->ident,$w); 29 29 $body .= <<< END 30 30 <td> 31 31 <p> 32 32 <a href="{$CFG->wwwroot}{$info->username}/"> 33 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />33 {$friends_icon}</a><br /> 34 34 <span class="userdetails"> 35 35 <a href="{$CFG->wwwroot}{$info->username}/">{$friends_name}</a> devel/units/communities/userdetails_edit.php
r687 r1022 6 6 7 7 $info = get_record('users','ident',$page_owner); 8 $name = htmlspecialchars(stripslashes( $info->name), ENT_COMPAT, 'utf-8');8 $name = htmlspecialchars(stripslashes(user_name($info->ident)), ENT_COMPAT, 'utf-8'); 9 9 $email = htmlspecialchars(stripslashes($info->email), ENT_COMPAT, 'utf-8'); 10 10 devel/units/files/function_rss_publish.php
r659 r1022 36 36 37 37 $info = get_record('users','ident',$userid); 38 $name = stripslashes( $info->name);38 $name = stripslashes(user_name($info->ident)); 39 39 $username = $info->username; 40 40 $mainurl = $CFG->wwwroot . $username . "/files/"; devel/units/files/function_search.php
r935 r1022 129 129 foreach($users as $key => $info) { 130 130 $friends_userid = $info->ident; 131 // $friends_name = htmlspecialchars(stripslashes($info->name), ENT_COMPAT, 'utf-8'); 132 $friends_name = run("profile:display:name",$info->ident); 131 $friends_name = user_name($info->ident); 133 132 $info->icon = run("icons:get",$info->ident); 134 133 $friends_menu = run("users:infobox:menu",array($info->ident)); 135 134 $link_keyword = urlencode($parameter[1]); 135 $friends_icon = user_icon_html($info->ident,$w); 136 136 $body .= <<< END 137 137 <td align="center"> 138 138 <p> 139 139 <a href="{$CFG->wwwroot}search/index.php?file={$link_keyword}&owner={$friends_userid}"> 140 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />140 {$friends_icon}</a><br /> 141 141 <span class="userdetails"> 142 142 {$friends_name} devel/units/files/function_search_ecl.php
r454 r1022 25 25 END; 26 26 if ($info = get_record('users','ident',$page_owner)) { 27 $name = htmlspecialchars(stripslashes( $info->name), ENT_COMPAT, 'utf-8');27 $name = htmlspecialchars(stripslashes(user_name($info->ident)), ENT_COMPAT, 'utf-8'); 28 28 $username = htmlspecialchars($info->username, ENT_COMPAT, 'utf-8'); 29 29 $mainurl = url . $username . "/files/"; devel/units/friends/friends_actions.php
r861 r1022 81 81 delete_records('friends_requests','ident',$request_id); 82 82 $messages[] = sprintf(__gettext("You approved the friendship request. %s now lists you as a friend."),stripslashes($request->name)); 83 $message_body = sprintf(__gettext("%s has approved your friendship request!\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all your friends, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."),user_ info("name",$request->friend), $CFG->wwwroot . user_info("username",$request->friend) . "/", $CFG->wwwroot . user_info("username",$request->owner) . "/friends/",$CFG->sitename);83 $message_body = sprintf(__gettext("%s has approved your friendship request!\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all your friends, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."),user_name($request->friend), $CFG->wwwroot . user_info("username",$request->friend) . "/", $CFG->wwwroot . user_info("username",$request->owner) . "/friends/",$CFG->sitename); 84 84 $title = sprintf(__gettext("%s friend request approved!"), $CFG->sitename); 85 85 notify_user($request->owner,$title,$message_body); … … 106 106 delete_records('friends_requests','ident',$request_id); 107 107 $messages[] = sprintf(__gettext("You declined the friendship request. %s does not list you as a friend."),stripslashes($request->name)); 108 $message_body = sprintf(__gettext("%s has denied your friendship request.\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all your existing friends, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."),user_ info("name",$request->friend), $CFG->wwwroot . user_info("username",$request->friend) . "/", $CFG->wwwroot . user_info("username",$request->owner) . "/friends/",$CFG->sitename);108 $message_body = sprintf(__gettext("%s has denied your friendship request.\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all your existing friends, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."),user_name($request->friend), $CFG->wwwroot . user_info("username",$request->friend) . "/", $CFG->wwwroot . user_info("username",$request->owner) . "/friends/",$CFG->sitename); 109 109 $title = sprintf(__gettext("%s friend request denied"), $CFG->sitename); 110 110 notify_user($request->owner,$title,$message_body); devel/units/friends/friends_edit.php
r776 r1022 26 26 $info->icon = run("icons:get",$info->ident); 27 27 $friends_menu = run("users:infobox:menu",array($info->ident)); 28 $friends_icon = user_icon_html($info->ident,$w); 28 29 $body .= <<< END 29 30 <td> 30 31 <p> 31 32 <a href="{$CFG->wwwroot}{$info->username}/"> 32 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />33 {$friends_icon}</a><br /> 33 34 <span class="userdetails"> 34 35 <a href="{$CFG->wwwroot}{$info->username}/">{$friends_name}</a> devel/units/friends/friends_of_edit.php
r776 r1022 37 37 $info->icon = run("icons:get",$info->ident); 38 38 $friends_menu = run("users:infobox:menu",array($info->ident)); 39 $friends_icon = user_icon_html($info->ident,$w); 39 40 $body .= <<< END 40 41 <td> 41 42 <p> 42 43 <a href="{$CFG->wwwroot}{$info->username}/"> 43 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />44 {$friends_icon}</a><br /> 44 45 <span class="userdetails"> 45 46 <a href="{$CFG->wwwroot}{$info->username}/">{$friends_name}</a> devel/units/friends/generate_foaf.php
r690 r1022 12 12 13 13 if ($user->icon != -1) { 14 $iconstring = "<foaf:depiction rdf:resource=\"". $CFG->wwwroot . "_icon/user/".$user->icon."\" />"; 14 $iconurl = user_icon_html($user->ident,100,true); 15 $iconstring = "<foaf:depiction rdf:resource=\"{$iconurl}\" />"; 15 16 } else { 16 17 $iconstring = ""; … … 57 58 $foafurl = $personalurl . "foaf/"; 58 59 if ($friend->icon != -1) { 59 $iconstring = "<foaf:depiction rdf:resource=\"". url . "_icon/user/".$friend->icon."\" />"; 60 $iconurl = user_icon_html($friend->ident,100,true); 61 $iconstring = "<foaf:depiction rdf:resource=\"{$iconurl}\" />"; 60 62 } else { 61 63 $iconstring = ""; devel/units/friends/user_friendship_requests.php
r690 r1022 40 40 $body .= templates_draw(array( 41 41 'context' => 'adminTable', 42 'name' => "<img src=\"" . url . "_icon/user/{$pending_user->icon}\" />",42 'name' => user_icon_html($pending_user->ident), 43 43 'column1' => $col1, 44 44 'column2' => $col2 devel/units/profile/function_display_name.php
r557 r1022 1 1 <?php 2 2 3 // TODO: This should almost certainly be a function rather than a run() command 4 5 if (!defined('profileinit')) { 6 run("profile:init"); 7 } 8 9 global $profile_id; 10 11 $profile_id = (int) $profile_id; 12 13 global $name_cache; 3 // TODO: remove all references to this that aren't a direct reference to the function 14 4 15 5 if (empty($parameter)) { 6 global $profile_id; 7 $profile_id = (int) $profile_id; 16 8 $user_id = $profile_id; 17 9 } else { … … 19 11 } 20 12 21 if (!isset($name_cache[$user_id]) || (time() - $name_cache[$user_id]->created > 60)) { 22 23 $name_cache[$user_id]->created = time(); 24 $name_cache[$user_id]->data = htmlspecialchars(user_info('name',$user_id), ENT_COMPAT, 'utf-8'); 25 26 } 27 $run_result = $name_cache[$user_id]->data; 13 $run_result = user_name($user_id); 28 14 29 15 ?> devel/units/profile/function_rss_publish.php
r659 r1022 36 36 37 37 $info = get_record('users','ident',$userid); 38 $name = stripslashes( $info->name);38 $name = stripslashes(user_name($info->ident)); 39 39 //$username = $info->username; 40 40 $mainurl = url . $username . "/"; devel/units/profile/function_search.php
r876 r1022 54 54 foreach($result as $key => $info) { 55 55 $friends_username = $info->username; 56 // $friends_name = htmlspecialchars(stripslashes($info->name), ENT_COMPAT, 'utf-8');57 56 $friends_name = run("profile:display:name",$info->ident); 58 57 $info->icon = run("icons:get",$info->ident); 58 $friends_icon = user_icon_html($info->ident,$w); 59 59 $body .= <<< END 60 60 <td align="center"> 61 61 <p> 62 62 <a href="{$CFG->wwwroot}{$friends_username}/"> 63 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />63 {$friends_icon}</a><br /> 64 64 <span class="userdetails"> 65 65 <a href="{$CFG->wwwroot}{$friends_username}/">{$friends_name}</a> devel/units/profile/function_search_ecl.php
r876 r1022 24 24 foreach($result as $key => $info) { 25 25 26 $icon = u rl . "_icon/user/".$info->icon;26 $icon = user_icon_html($info->ident,100,true); 27 27 28 28 $sub_result .= "\t\t\t<item>\n"; 29 $sub_result .= "\t\t\t\t<name><![CDATA[" . htmlspecialchars(stripslashes( $info->name), ENT_COMPAT, 'utf-8') . "]]></name>\n";29 $sub_result .= "\t\t\t\t<name><![CDATA[" . htmlspecialchars(stripslashes(user_name($info->ident)), ENT_COMPAT, 'utf-8') . "]]></name>\n"; 30 30 $sub_result .= "\t\t\t\t<link>" . url . htmlspecialchars($info->username, ENT_COMPAT, 'utf-8') . "</link>\n"; 31 31 $sub_result .= "\t\t\t\t<link>$icon</link>\n"; devel/units/profile/function_search_rss.php
r876 r1022 22 22 foreach($result as $key => $info) { 23 23 $run_result .= "\t<item>\n"; 24 $run_result .= "\t\t<title><![CDATA['" . htmlspecialchars($parameter[0], ENT_COMPAT, 'utf-8') . "' = " . htmlspecialchars($parameter[1], ENT_COMPAT, 'utf-8') . " :: " . htmlspecialchars(stripslashes( $info->name), ENT_COMPAT, 'utf-8') . "]]></title>\n";24 $run_result .= "\t\t<title><![CDATA['" . htmlspecialchars($parameter[0], ENT_COMPAT, 'utf-8') . "' = " . htmlspecialchars($parameter[1], ENT_COMPAT, 'utf-8') . " :: " . htmlspecialchars(stripslashes(user_name($info->ident)), ENT_COMPAT, 'utf-8') . "]]></title>\n"; 25 25 $run_result .= "\t\t<link>" . url . htmlspecialchars($info->username, ENT_COMPAT, 'utf-8') . "</link>\n"; 26 26 $run_result .= "\t</item>\n"; devel/units/profile/profile_user_info.php
r690 r1022 19 19 $info->icon = run("icons:get", $page_owner); 20 20 21 $icon = '<img alt="" src="'.url. '_icon/user/'.$info->icon.'/h/67/w/67" border="0" />'; // height is the important one here.22 $name = stripslashes( $info->name);21 $icon = user_icon_html($info->ident,67); 22 $name = stripslashes(user_name($info->ident)); 23 23 //$name = run("profile:display:name"); 24 24 $url = url . $info->username . "/"; devel/units/rpc/lib/class_user.php
r690 r1022 49 49 $this->username = $info->username; 50 50 $this->email = $info->email; 51 $this->name = $info->name;51 $this->name = user_name($info->ident); 52 52 $this->alias = $info->alias; 53 53 $this->code = $info->code; … … 84 84 } 85 85 86 $this->icon = u rl . '_icon/user/' . $info->icon;86 $this->icon = user_icon_html($info->ident,100,true); 87 87 } 88 88 } devel/units/users/main.php
r963 r1022 44 44 45 45 // Display a user's name, given a user ID 46 $function['users:display:name'][] = $CFG->dirroot . "units/users/function_display_name.php";// DEPRECATED - use run("profile:display:name", $ident) or user_info("name", $ident)46 $function['users:display:name'][] = $CFG->dirroot . "units/users/function_display_name.php";// DEPRECATED - use user_name($id) 47 47 48 48 // User details edit screen devel/units/users/user_info.php
r659 r1022 45 45 } 46 46 47 // $username = htmlspecialchars(stripslashes($info->name), ENT_COMPAT, 'utf-8'); 48 $username = run("profile:display:name", $info->ident); 47 $username = user_name($info->ident); 49 48 $usermenu = ''; 50 49 devel/units/users/userdetails_edit.php
r1014 r1022 6 6 7 7 $info = get_record('users','ident',$page_owner); 8 $name = htmlspecialchars(stripslashes( $info->name), ENT_COMPAT, 'utf-8');8 $name = htmlspecialchars(stripslashes(user_name($info->ident)), ENT_COMPAT, 'utf-8'); 9 9 $email = htmlspecialchars(stripslashes($info->email), ENT_COMPAT, 'utf-8'); 10 10 devel/units/weblogs/default_template.php
r819 r1022 27 27 <div class="weblog-post"><!-- Holds all aspects of a blog post --> 28 28 <div class="user"><!-- Open class user --> 29 <a href="{{url}}{{username}}/weblog/"> <img alt="" src="{{url}}_icon/user/{{usericon}}"/></a><br /><a href="{{url}}{{username}}/weblog/">{{fullname}}</a>29 <a href="{{url}}{{username}}/weblog/">{{usericon}}</a><br /><a href="{{url}}{{username}}/weblog/">{{fullname}}</a> 30 30 </div><!-- Close class user --> 31 31 <div class="weblog-title"><h3>{{title}}</h3></div> devel/units/weblogs/function_rss_publish.php
