Ignore:
Timestamp:
Feb 14, 2009, 3:24:10 AM (16 years ago)
Author:
rvelices
Message:

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)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_user.inc.php

    r3126 r3145  
    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/**
Note: See TracChangeset for help on using the changeset viewer.