[pLog-svn] r2834 -
plog/branches/lifetype-1.0.3/class/template/smarty/plugins
mark at devel.lifetype.net
mark at devel.lifetype.net
Fri Jan 20 10:37:46 GMT 2006
Author: mark
Date: 2006-01-20 10:37:46 +0000 (Fri, 20 Jan 2006)
New Revision: 2834
Added:
plog/branches/lifetype-1.0.3/class/template/smarty/plugins/modifier.stars.php
Log:
Add a new plugin to hide password in installation wizard
Added: plog/branches/lifetype-1.0.3/class/template/smarty/plugins/modifier.stars.php
===================================================================
--- plog/branches/lifetype-1.0.3/class/template/smarty/plugins/modifier.stars.php 2006-01-20 08:40:41 UTC (rev 2833)
+++ plog/branches/lifetype-1.0.3/class/template/smarty/plugins/modifier.stars.php 2006-01-20 10:37:46 UTC (rev 2834)
@@ -0,0 +1,24 @@
+<?php
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type: modifier
+ * Name: stars
+ * Purpose: convert chars to stars, excluding N suffix chars
+ * Date: April 15th, 2004
+ * Version: 1.0
+ * Author: Monte Ohrt <monte at ohrt dot com>
+ * -------------------------------------------------------------
+ */
+function smarty_modifier_stars($string, $suffix = 0, $char = '*')
+{
+ $_prefix_len = strlen($string) - $suffix;
+ if($_prefix_len > 0) {
+ return str_repeat($char, $_prefix_len) . substr($string, - $suffix);
+ } else {
+ return $string;
+ }
+}
+
+?>
\ No newline at end of file
More information about the pLog-svn
mailing list