Show
Ignore:
Timestamp:
02/14/09 03:28:21 (4 years ago)
Author:
rvelices
Message:

merge 3145-3146 from trunk
Last (I hope) paranoic optims ...
- move get_uysername and get_groupname from public to admin/functions.inc.php
- optim in index.php
- tags.tpl does not need smarty modifier included
- move func get_comment_post_key from functions_comment to functions (avoid extra inclusion every time on picture page)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/2.0/include/functions_user.inc.php

    r3127 r3147  
    674674 
    675675/** 
    676  * returns the username corresponding to the given user identifier if exists 
    677  * 
    678  * @param int user_id 
    679  * @return mixed 
    680  */ 
    681 function get_username($user_id) 
    682 { 
    683   global $conf; 
    684  
    685   $query = ' 
    686 SELECT '.$conf['user_fields']['username'].' 
    687   FROM '.USERS_TABLE.' 
    688   WHERE '.$conf['user_fields']['id'].' = '.intval($user_id).' 
    689 ;'; 
    690   $result = pwg_query($query); 
    691   if (mysql_num_rows($result) > 0) 
    692   { 
    693     list($username) = mysql_fetch_row($result); 
    694   } 
    695   else 
    696   { 
    697     return false; 
    698   } 
    699  
    700   return $username; 
    701 } 
    702  
    703 /** 
    704676 * returns user identifier thanks to his name, false if not found 
    705677 * 
     
    933905  } 
    934906} 
    935  
    936 /** 
    937  * returns the groupname corresponding to the given group identifier if 
    938  * exists 
    939  * 
    940  * @param int group_id 
    941  * @return mixed 
    942  */ 
    943 function get_groupname($group_id) 
    944 { 
    945   $query = ' 
    946 SELECT name 
    947   FROM '.GROUPS_TABLE.' 
    948   WHERE id = '.intval($group_id).' 
    949 ;'; 
    950   $result = pwg_query($query); 
    951   if (mysql_num_rows($result) > 0) 
    952   { 
    953     list($groupname) = mysql_fetch_row($result); 
    954   } 
    955   else 
    956   { 
    957     return false; 
    958   } 
    959  
    960   return $groupname; 
    961 } 
    962  
    963907 
    964908/**