Changeset 12920 for trunk/include/functions.inc.php
- Timestamp:
- Jan 17, 2012, 10:58:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r12878 r12920 34 34 include_once( PHPWG_ROOT_PATH .'include/derivative_std_params.inc.php'); 35 35 include_once( PHPWG_ROOT_PATH .'include/derivative.inc.php'); 36 require_once( PHPWG_ROOT_PATH .'include/smarty/libs/Smarty.class.php'); 37 include_once( PHPWG_ROOT_PATH .'include/template.class.php'); 36 38 37 39 //----------------------------------------------------------- generic functions … … 53 55 function get_moment() 54 56 { 55 $t1 = explode( ' ', microtime() ); 56 $t2 = explode( '.', $t1[0] ); 57 $t2 = $t1[1].'.'.$t2[1]; 58 return $t2; 57 return microtime(true); 59 58 } 60 59 … … 664 663 return ''; 665 664 } 666 665 667 666 $query_string = ''; 668 667 … … 817 816 818 817 /** 819 * returns the title of the thumbnail based on photo properties820 */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 /**863 818 * fill the current user caddie with given elements, if not already in 864 819 * caddie … … 902 857 { 903 858 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']);916 859 } 917 860 … … 1436 1379 return $time.':'.$valid_after_seconds.':' 1437 1380 .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, 1440 1383 $conf['secret_key']); 1441 1384 }
Note: See TracChangeset
for help on using the changeset viewer.