Show
Ignore:
Timestamp:
03/12/07 12:10:28 (2 years ago)
Author:
ben
Message:

All icons are now displayed using the user_icon_html function; all user full names are displayed using the user_name function. This is to allow potential plugins to do things like hide names if required (eg in a school situation), and add bling to the icon.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/units/profile/function_display_name.php

    r557 r1022  
    11<?php 
    22 
    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 
    144     
    155    if (empty($parameter)) { 
     6        global $profile_id; 
     7        $profile_id = (int) $profile_id; 
    168        $user_id = $profile_id; 
    179    } else { 
     
    1911    } 
    2012     
    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); 
    2814     
    2915?> 
  • devel/units/profile/function_rss_publish.php

    r659 r1022  
    3636             
    3737            $info = get_record('users','ident',$userid); 
    38             $name = stripslashes($info->name); 
     38            $name = stripslashes(user_name($info->ident)); 
    3939            //$username = $info->username; 
    4040            $mainurl = url . $username . "/"; 
  • devel/units/profile/function_search.php

    r876 r1022  
    5454                foreach($result as $key => $info) { 
    5555                    $friends_username = $info->username; 
    56                     // $friends_name = htmlspecialchars(stripslashes($info->name), ENT_COMPAT, 'utf-8'); 
    5756                    $friends_name = run("profile:display:name",$info->ident); 
    5857                    $info->icon = run("icons:get",$info->ident); 
     58                    $friends_icon = user_icon_html($info->ident,$w); 
    5959                    $body .= <<< END 
    6060        <td align="center"> 
    6161            <p> 
    6262            <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 /> 
    6464            <span class="userdetails"> 
    6565                <a href="{$CFG->wwwroot}{$friends_username}/">{$friends_name}</a> 
  • devel/units/profile/function_search_ecl.php

    r876 r1022  
    2424                foreach($result as $key => $info) { 
    2525                     
    26                     $icon = url . "_icon/user/".$info->icon
     26                    $icon = user_icon_html($info->ident,100,true)
    2727                     
    2828                    $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"; 
    3030                    $sub_result .= "\t\t\t\t<link>" . url . htmlspecialchars($info->username, ENT_COMPAT, 'utf-8') . "</link>\n"; 
    3131                    $sub_result .= "\t\t\t\t<link>$icon</link>\n"; 
  • devel/units/profile/function_search_rss.php

    r876 r1022  
    2222                foreach($result as $key => $info) { 
    2323                    $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"; 
    2525                    $run_result .= "\t\t<link>" . url . htmlspecialchars($info->username, ENT_COMPAT, 'utf-8') . "</link>\n"; 
    2626                    $run_result .= "\t</item>\n"; 
  • devel/units/profile/profile_user_info.php

    r690 r1022  
    1919$info->icon = run("icons:get", $page_owner); 
    2020 
    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));  
    2323//$name = run("profile:display:name"); 
    2424$url = url . $info->username . "/";