summaryrefslogtreecommitdiffstats
path: root/code/subst.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'code/subst.inc.php')
-rw-r--r--code/subst.inc.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/code/subst.inc.php b/code/subst.inc.php
new file mode 100644
index 0000000..9696ec9
--- /dev/null
+++ b/code/subst.inc.php
@@ -0,0 +1,13 @@
+<?PHP
+ $GLOBALS['messages'] = array();
+
+ if($GLOBALS['config']['language'] != 'en') @include('lang/' . $GLOBALS['config']['language'] . '.inc.php');
+
+ function Subst($data) {
+ $subst = array_map(create_function('$key', 'return \'(\\{\\{\' . $key . \'\\}\\})\';'), array_keys($GLOBALS['messages']));
+
+ $data = preg_replace($subst, $GLOBALS['messages'], $data);
+
+ return preg_replace('({{(.+?)}})', '$1', $data);
+ }
+?>