Ignore:
Timestamp:
Jan 17, 2012, 10:58:18 PM (12 years ago)
Author:
rvelices
Message:

feature 2548 multisize - code cleanup + better usage in category_cats + i.php logs memory usage peak

File:
1 edited

Legend:

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

    r12878 r12920  
    3434include_once( PHPWG_ROOT_PATH .'include/derivative_std_params.inc.php');
    3535include_once( PHPWG_ROOT_PATH .'include/derivative.inc.php');
     36require_once( PHPWG_ROOT_PATH .'include/smarty/libs/Smarty.class.php');
     37include_once( PHPWG_ROOT_PATH .'include/template.class.php');
    3638
    3739//----------------------------------------------------------- generic functions
     
    5355function get_moment()
    5456{
    55   $t1 = explode( ' ', microtime() );
    56   $t2 = explode( '.', $t1[0] );
    57   $t2 = $t1[1].'.'.$t2[1];
    58   return $t2;
     57  return microtime(true);
    5958}
    6059
     
    664663    return '';
    665664  }
    666  
     665
    667666  $query_string = '';
    668667
     
    817816
    818817/**
    819  * returns the title of the thumbnail based on photo properties
    820  */
    821 function get_thumbnail_title($info)
    822 {
    823   global $conf, $user;
    824 
    825   $title = get_picture_title($info);
    826 
    827   $details = array();
    828 
    829   if (!empty($info['hit']))
    830   {
    831     $details[] = $info['hit'].' '.strtolower(l10n('Visits'));
    832   }
    833 
    834   if ($conf['rate'] and !empty($info['rating_score']))
    835   {
    836     $details[] = strtolower(l10n('Rating score')).' '.$info['rating_score'];
    837   }
    838 
    839   if (isset($info['nb_comments']) and $info['nb_comments'] != 0)
    840   {
    841     $details[] = l10n_dec('%d comment', '%d comments', $info['nb_comments']);
    842   }
    843 
    844   if (count($details) > 0)
    845   {
    846     $title.= ' ('.implode(', ', $details).')';
    847   }
    848 
    849   if (!empty($info['comment']))
    850   {
    851     $info['comment'] = trigger_event('render_element_description', $info['comment']);
    852     $title.= ' '.substr($info['comment'], 0, 100).(strlen($info['comment']) > 100 ? '...' : '');
    853   }
    854 
    855   $title = htmlspecialchars(strip_tags($title));
    856 
    857   $title = trigger_event('get_thumbnail_title', $title, $info);
    858 
    859   return $title;
    860 }
    861 
    862 /**
    863818 * fill the current user caddie with given elements, if not already in
    864819 * caddie
     
    902857{
    903858  return str_replace('_',' ',get_filename_wo_extension($filename));
    904 }
    905 
    906 /**
    907  */
    908 function get_picture_title($info)
    909 {
    910   if (isset($info['name']) and !empty($info['name']))
    911   {
    912     return trigger_event('render_element_description', $info['name']);
    913   }
    914 
    915   return  get_name_from_file($info['file']);
    916859}
    917860
     
    14361379        return $time.':'.$valid_after_seconds.':'
    14371380                .hash_hmac(
    1438                         'md5', 
    1439                         $time.substr($_SERVER['REMOTE_ADDR'],0,5).$valid_after_seconds.$aditionnal_data_to_hash, 
     1381                        'md5',
     1382                        $time.substr($_SERVER['REMOTE_ADDR'],0,5).$valid_after_seconds.$aditionnal_data_to_hash,
    14401383                        $conf['secret_key']);
    14411384}
Note: See TracChangeset for help on using the changeset viewer.