Changeset 2252
- Timestamp:
- 05/21/10 14:52:30 (14 years ago)
- Location:
- plugins/timeago
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/timeago/_define.php
r2249 r2252 18 18 /* Description*/ "Adds twitter-like dates for posts and comments, such as '3 hours ago'", 19 19 /* Author */ "Bruno Hondelatte", 20 /* Version */ "1. 1",20 /* Version */ "1.2", 21 21 /* Permissions */ null 22 22 ); -
plugins/timeago/_public.php
r2250 r2252 63 63 64 64 $plur = ($delta==1)?'':'s'; 65 $res = sprintf($l10n[$unit.$plur],$delta); 65 if (isset($l10n[$unit.$plur])) { 66 $res = sprintf($l10n[$unit.$plur],$delta); 67 } else { 68 $res = sprintf(TimeAgoTpl::$l10n[$unit.$plur],$delta); 69 } 66 70 if ($cap) 67 71 $res = ucfirst($res); … … 72 76 73 77 // Parse l10n attributes, if specified 74 $inter = array_intersect_key($attr->getArrayCopy(),TimeAgoTpl::$l10n); 75 if (sizeof($inter)==0) { 78 $l10n = array(); 79 foreach(TimeAgoTpl::$l10n as $k=>$v) { 80 if (isset($attr[$k])) 81 $l10n[$k]=$attr[$k]; 82 } 83 if (sizeof($l10n)==0) { 76 84 $l10nArgs = ''; 77 85 } else { 78 $l10n = array_replace(TimeAgoTpl::$l10n,$inter);79 86 array_walk($l10n,create_function('&$v, $k', '$v = addslashes($v);')); 80 87 $args = array();
Note: See TracChangeset
for help on using the changeset viewer.