diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-07-08 21:46:32 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-07-08 21:46:32 +0200 |
commit | 5425b0dd82863d548f49dcbd81636ed8dabd7866 (patch) | |
tree | db5631725be9be0fc1a179af414041a09de05032 /inc/poche/Tools.class.php | |
parent | 4247b37551ae8aa35840ddadcec1c781a8e56d4b (diff) | |
download | wallabag-5425b0dd82863d548f49dcbd81636ed8dabd7866.tar.gz wallabag-5425b0dd82863d548f49dcbd81636ed8dabd7866.tar.zst wallabag-5425b0dd82863d548f49dcbd81636ed8dabd7866.zip |
new fields in database, reading time / date and domain name are stored
Diffstat (limited to 'inc/poche/Tools.class.php')
-rwxr-xr-x | inc/poche/Tools.class.php | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 1ef875c9..13f48903 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -214,20 +214,6 @@ class Tools | |||
214 | return ((isset ($_REQUEST["$var"])) ? htmlentities($_REQUEST["$var"]) : $default); | 214 | return ((isset ($_REQUEST["$var"])) ? htmlentities($_REQUEST["$var"]) : $default); |
215 | } | 215 | } |
216 | 216 | ||
217 | public static function getDomain($url) | ||
218 | { | ||
219 | return parse_url($url, PHP_URL_HOST); | ||
220 | } | ||
221 | |||
222 | public static function getReadingTime($text) { | ||
223 | $word = str_word_count(strip_tags($text)); | ||
224 | $minutes = floor($word / 200); | ||
225 | $seconds = floor($word % 200 / (200 / 60)); | ||
226 | $time = array('minutes' => $minutes, 'seconds' => $seconds); | ||
227 | |||
228 | return $minutes; | ||
229 | } | ||
230 | |||
231 | public static function getDocLanguage($userlanguage) { | 217 | public static function getDocLanguage($userlanguage) { |
232 | $lang = explode('.', $userlanguage); | 218 | $lang = explode('.', $userlanguage); |
233 | return str_replace('_', '-', $lang[0]); | 219 | return str_replace('_', '-', $lang[0]); |