+++ /dev/null
-<?php\r
-/**\r
- * Smarty plugin\r
- * @package Smarty\r
- * @subpackage plugins\r
- */\r
-\r
-\r
-/**\r
- * Smarty count_words modifier plugin\r
- *\r
- * Type: modifier<br>\r
- * Name: count_words<br>\r
- * Purpose: count the number of words in a text\r
- * @link http://smarty.php.net/manual/en/language.modifier.count.words.php\r
- * count_words (Smarty online manual)\r
- * @param string\r
- * @return integer\r
- */\r
-function smarty_modifier_count_words($string)\r
-{\r
- // split text by ' ',\r,\n,\f,\t\r
- $split_array = preg_split('/\s+/',$string);\r
- // count matches that contain alphanumerics\r
- $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array);\r
-\r
- return count($word_count);\r
-}\r
-\r
-/* vim: set expandtab: */\r
-\r
-?>\r