]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote branch 'upstream/master'
authorMichael Vogel <icarus@dabo.de>
Fri, 13 Jul 2012 21:39:51 +0000 (23:39 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 13 Jul 2012 21:39:51 +0000 (23:39 +0200)
Conflicts:
include/bb2diaspora.php

282 files changed:
boot.php
database.sql
include/Photo.php
include/Scrape.php
include/bb2diaspora.php
include/bbcode.php
include/conversation.php
include/crypto.php
include/dba.php
include/diaspora.php
include/enotify.php
include/html2bbcode.php
include/items.php
include/lock.php [new file with mode: 0644]
include/nav.php
include/network.php
include/queue.php
include/security.php [changed mode: 0755->0644]
include/text.php
include/user.php
js/main.js
library/Smarty/COPYING.lib [new file with mode: 0644]
library/Smarty/README [new file with mode: 0644]
library/Smarty/SMARTY_2_BC_NOTES.txt [new file with mode: 0644]
library/Smarty/SMARTY_3.0_BC_NOTES.txt [new file with mode: 0644]
library/Smarty/SMARTY_3.1_NOTES.txt [new file with mode: 0644]
library/Smarty/change_log.txt [new file with mode: 0644]
library/Smarty/demo/configs/test.conf [new file with mode: 0644]
library/Smarty/demo/index.php [new file with mode: 0644]
library/Smarty/demo/plugins/cacheresource.apc.php [new file with mode: 0644]
library/Smarty/demo/plugins/cacheresource.memcache.php [new file with mode: 0644]
library/Smarty/demo/plugins/cacheresource.mysql.php [new file with mode: 0644]
library/Smarty/demo/plugins/resource.extendsall.php [new file with mode: 0644]
library/Smarty/demo/plugins/resource.mysql.php [new file with mode: 0644]
library/Smarty/demo/plugins/resource.mysqls.php [new file with mode: 0644]
library/Smarty/demo/templates/footer.tpl [new file with mode: 0644]
library/Smarty/demo/templates/header.tpl [new file with mode: 0644]
library/Smarty/demo/templates/index.tpl [new file with mode: 0644]
library/Smarty/libs/Smarty.class.php [new file with mode: 0644]
library/Smarty/libs/SmartyBC.class.php [new file with mode: 0644]
library/Smarty/libs/debug.tpl [new file with mode: 0644]
library/Smarty/libs/plugins/block.textformat.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.counter.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.cycle.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.fetch.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.html_checkboxes.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.html_image.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.html_options.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.html_radios.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.html_select_date.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.html_select_time.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.html_table.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.mailto.php [new file with mode: 0644]
library/Smarty/libs/plugins/function.math.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifier.capitalize.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifier.date_format.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifier.debug_print_var.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifier.escape.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifier.regex_replace.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifier.replace.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifier.spacify.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifier.truncate.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.cat.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.count_characters.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.count_paragraphs.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.count_sentences.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.count_words.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.default.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.escape.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.from_charset.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.indent.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.lower.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.noprint.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.string_format.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.strip.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.strip_tags.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.to_charset.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.unescape.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.upper.php [new file with mode: 0644]
library/Smarty/libs/plugins/modifiercompiler.wordwrap.php [new file with mode: 0644]
library/Smarty/libs/plugins/outputfilter.trimwhitespace.php [new file with mode: 0644]
library/Smarty/libs/plugins/shared.escape_special_chars.php [new file with mode: 0644]
library/Smarty/libs/plugins/shared.literal_compiler_param.php [new file with mode: 0644]
library/Smarty/libs/plugins/shared.make_timestamp.php [new file with mode: 0644]
library/Smarty/libs/plugins/shared.mb_str_replace.php [new file with mode: 0644]
library/Smarty/libs/plugins/shared.mb_unicode.php [new file with mode: 0644]
library/Smarty/libs/plugins/shared.mb_wordwrap.php [new file with mode: 0644]
library/Smarty/libs/plugins/variablefilter.htmlspecialchars.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_cacheresource.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_cacheresource_custom.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_config_source.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_cacheresource_file.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_append.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_block.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_break.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_call.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_capture.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_config_load.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_continue.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_debug.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_eval.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_extends.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_for.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_foreach.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_function.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_if.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_include.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_insert.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_ldelim.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_nocache.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_private_object_function.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_function.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_rdelim.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_section.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_setfilter.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compile_while.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_compilebase.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_config.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_config_file_compiler.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_configfilelexer.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_configfileparser.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_data.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_debug.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_filter_handler.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_function_call_handler.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_get_include_path.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_nocache_insert.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_parsetree.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_resource_eval.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_resource_extends.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_resource_file.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_resource_php.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_resource_registered.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_resource_stream.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_resource_string.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_template.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_templatebase.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_templatelexer.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_templateparser.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_utility.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_internal_write_file.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_resource.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_resource_custom.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_resource_recompiled.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_resource_uncompiled.php [new file with mode: 0644]
library/Smarty/libs/sysplugins/smarty_security.php [new file with mode: 0644]
library/mcefixes/plugins.bbcode.editor_plugin_src.js
library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
mod/admin.php
mod/babel.php [new file with mode: 0644]
mod/content.php [new file with mode: 0644]
mod/directory.php
mod/events.php
mod/item.php
mod/like.php
mod/message.php
mod/network.php
mod/photos.php
mod/profile.php
mod/profile_photo.php
mod/profiles.php
mod/share.php
mod/wall_upload.php
update.php
util/messages.po
util/run_xgettext.sh [changed mode: 0644->0755]
view/content.tpl [new file with mode: 0644]
view/eo/lostpass_eml.tpl
view/eo/messages.po
view/eo/strings.php
view/theme/darkzero-NS/style.css
view/theme/darkzero/style.css
view/theme/diabook/bottom.tpl
view/theme/diabook/ch_directory_item.tpl [changed mode: 0755->0644]
view/theme/diabook/communityhome.tpl [changed mode: 0755->0644]
view/theme/diabook/contact_template.tpl [changed mode: 0755->0644]
view/theme/diabook/diabook-aerith/icons/block.png [changed mode: 0755->0644]
view/theme/diabook/diabook-aerith/style-wide.css
view/theme/diabook/diabook-aerith/style.css
view/theme/diabook/diabook-blue/icons/block.png [changed mode: 0755->0644]
view/theme/diabook/diabook-blue/style-wide.css
view/theme/diabook/diabook-blue/style.css
view/theme/diabook/diabook-dark/icons/block.png [changed mode: 0755->0644]
view/theme/diabook/diabook-dark/style.css
view/theme/diabook/diabook-green/icons/block.png [changed mode: 0755->0644]
view/theme/diabook/diabook-green/icons/notifications3.png [changed mode: 0755->0644]
view/theme/diabook/diabook-green/icons/notify3.png [changed mode: 0755->0644]
view/theme/diabook/diabook-green/style-wide.css
view/theme/diabook/diabook-green/style.css
view/theme/diabook/diabook-pink/icons/block.png [changed mode: 0755->0644]
view/theme/diabook/diabook-pink/icons/notifications3.png [changed mode: 0755->0644]
view/theme/diabook/diabook-pink/icons/notify3.png [changed mode: 0755->0644]
view/theme/diabook/diabook-pink/style-wide.css
view/theme/diabook/diabook-pink/style.css
view/theme/diabook/diabook-red/icons/block.png [changed mode: 0755->0644]
view/theme/diabook/diabook-red/style-wide.css
view/theme/diabook/diabook-red/style.css
view/theme/diabook/directory_item.tpl [changed mode: 0755->0644]
view/theme/diabook/group_side.tpl [changed mode: 0755->0644]
view/theme/diabook/icons/attach.png [changed mode: 0755->0644]
view/theme/diabook/icons/audio.png [changed mode: 0755->0644]
view/theme/diabook/icons/block.png [changed mode: 0755->0644]
view/theme/diabook/icons/camera.png [changed mode: 0755->0644]
view/theme/diabook/icons/close_box.png [changed mode: 0755->0644]
view/theme/diabook/icons/contacts2.png [changed mode: 0755->0644]
view/theme/diabook/icons/drop.png [changed mode: 0755->0644]
view/theme/diabook/icons/expand.png [changed mode: 0755->0644]
view/theme/diabook/icons/file_as.png [changed mode: 0755->0644]
view/theme/diabook/icons/link.png [changed mode: 0755->0644]
view/theme/diabook/icons/lock.png [changed mode: 0755->0644]
view/theme/diabook/icons/lupe.png [changed mode: 0755->0644]
view/theme/diabook/icons/next.png [changed mode: 0755->0644]
view/theme/diabook/icons/notifications.png [changed mode: 0755->0644]
view/theme/diabook/icons/notifications3.png [changed mode: 0755->0644]
view/theme/diabook/icons/notify.png [changed mode: 0755->0644]
view/theme/diabook/icons/notify3.png [changed mode: 0755->0644]
view/theme/diabook/icons/pencil.png [changed mode: 0755->0644]
view/theme/diabook/icons/prev.png [changed mode: 0755->0644]
view/theme/diabook/icons/recycle.png [changed mode: 0755->0644]
view/theme/diabook/icons/remote.png [changed mode: 0755->0644]
view/theme/diabook/icons/scroll_top.png [changed mode: 0755->0644]
view/theme/diabook/icons/star.png [changed mode: 0755->0644]
view/theme/diabook/icons/starred.png [changed mode: 0755->0644]
view/theme/diabook/icons/tagged.png [changed mode: 0755->0644]
view/theme/diabook/icons/unlock.png [changed mode: 0755->0644]
view/theme/diabook/icons/unstarred.png [changed mode: 0755->0644]
view/theme/diabook/icons/video.png [changed mode: 0755->0644]
view/theme/diabook/icons/weblink.png [changed mode: 0755->0644]
view/theme/diabook/jot.tpl [changed mode: 0755->0644]
view/theme/diabook/mail_conv.tpl [changed mode: 0755->0644]
view/theme/diabook/nav.tpl
view/theme/diabook/search_item.tpl [changed mode: 0755->0644]
view/theme/diabook/style.css
view/theme/diabook/theme.php [changed mode: 0755->0644]
view/theme/diabook/wall_item.tpl
view/theme/diabook/wallwall_item.tpl
view/theme/dispy/bottom.tpl
view/theme/dispy/dark/style.css
view/theme/dispy/dark/style.less
view/theme/dispy/icons/sparkle.cur [new file with mode: 0644]
view/theme/dispy/light/style.css
view/theme/dispy/light/style.less
view/theme/dispy/wall_item.tpl
view/theme/dispy/wallwall_item.tpl
view/theme/duepuntozero/style.css
view/theme/facepark/screenshot.jpg [new file with mode: 0644]
view/theme/quattro/Makefile [new file with mode: 0644]
view/theme/quattro/dark/style.css
view/theme/quattro/green/style.css
view/theme/quattro/icons.less
view/theme/quattro/icons/addon_off.png
view/theme/quattro/icons/addon_on.png
view/theme/quattro/icons/dislike.png [new file with mode: 0644]
view/theme/quattro/icons/like.png [new file with mode: 0644]
view/theme/quattro/icons/lock.cur [new file with mode: 0644]
view/theme/quattro/icons/next.png [new file with mode: 0644]
view/theme/quattro/icons/prev.png [new file with mode: 0644]
view/theme/quattro/photo_view.tpl [new file with mode: 0644]
view/theme/quattro/quattro.less
view/theme/quattro/wall_item.tpl
view/theme/quattro/wallwall_item.tpl
view/theme/slackr/style.css
view/theme/testbubble/lock.cur [new file with mode: 0644]
view/theme/testbubble/style.css
view/theme/vier/lock.cur [new file with mode: 0644]
view/theme/vier/style.css
view/wall_item.tpl
view/wallwall_item.tpl
view/xrd_host.tpl
view/xrd_person.tpl

index 973e3578a66804c1f4fd7aea2819b73a6aaac5b4..78c952a61bfdf43123c2a9a2a10ae895936b531a 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -10,9 +10,9 @@ require_once('include/nav.php');
 require_once('include/cache.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
-define ( 'FRIENDICA_VERSION',      '3.0.1388' );
+define ( 'FRIENDICA_VERSION',      '3.0.1402' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.23'    );
-define ( 'DB_UPDATE_VERSION',      1151      );
+define ( 'DB_UPDATE_VERSION',      1153      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -34,6 +34,24 @@ define ( 'JPEG_QUALITY',            100  );
  */
 define ( 'PNG_QUALITY',             8  );
 
+/**
+ *
+ * An alternate way of limiting picture upload sizes. Specify the maximum pixel
+ * length that pictures are allowed to be (for non-square pictures, it will apply
+ * to the longest side). Pictures longer than this length will be resized to be
+ * this length (on the longest side, the other side will be scaled appropriately).
+ * Modify this value using
+ *
+ *    $a->config['system']['max_image_length'] = n;
+ *
+ * in .htconfig.php
+ *
+ * If you don't want to set a maximum length, set to -1. The default value is
+ * defined by 'MAX_IMAGE_LENGTH' below.
+ *
+ */
+define ( 'MAX_IMAGE_LENGTH',        -1  );
+
 
 /**
  * Not yet used
@@ -177,6 +195,22 @@ define ( 'NOTIFY_TAGSHARE', 0x0100 );
 define ( 'NOTIFY_SYSTEM',   0x8000 );
 
 
+/**
+ * Tag/term types
+ */
+
+define ( 'TERM_UNKNOWN',   0 );
+define ( 'TERM_HASHTAG',   1 );
+define ( 'TERM_MENTION',   2 );   
+define ( 'TERM_CATEGORY',  3 );
+define ( 'TERM_PCATEGORY', 4 );
+define ( 'TERM_FILE',      5 );
+
+define ( 'TERM_OBJ_POST',  1 );
+define ( 'TERM_OBJ_PHOTO', 2 );
+
+
+
 /**
  * various namespaces we may need to parse
  */
@@ -352,6 +386,16 @@ if(! class_exists('App')) {
 
                        if(x($_SERVER,'SERVER_NAME')) {
                                $this->hostname = $_SERVER['SERVER_NAME'];
+
+                               // See bug 437 - this didn't work so disabling it
+                               //if(stristr($this->hostname,'xn--')) {
+                                       // PHP or webserver may have converted idn to punycode, so
+                                       // convert punycode back to utf-8
+                               //      require_once('library/simplepie/idn/idna_convert.class.php');
+                               //      $x = new idna_convert();
+                               //      $this->hostname = $x->decode($_SERVER['SERVER_NAME']);
+                               //}
+
                                if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443)
                                        $this->hostname .= ':' . $_SERVER['SERVER_PORT'];
                                /**
@@ -369,6 +413,7 @@ if(! class_exists('App')) {
                                        . 'include' . PATH_SEPARATOR
                                        . 'library' . PATH_SEPARATOR
                                        . 'library/phpsec' . PATH_SEPARATOR
+                                       . 'library/langdet' . PATH_SEPARATOR
                                        . '.' );
 
                        if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
@@ -434,8 +479,8 @@ if(! class_exists('App')) {
                        $this->pager['page'] = ((x($_GET,'page') && intval($_GET['page']) > 0) ? intval($_GET['page']) : 1);
                        $this->pager['itemspage'] = 50;
                        $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
-                       if($this->pager['start'] < 1)
-                               $this->pager['start'] = 1;
+                       if($this->pager['start'] < 0)
+                               $this->pager['start'] = 0;
                        $this->pager['total'] = 0;
                }
 
index b3b8c3a060a0b54432d8121c174bd16af501624d..1d0a321760cbe9c3b77baf5d020d80b7ac81841a 100644 (file)
@@ -598,6 +598,19 @@ CREATE TABLE IF NOT EXISTS `item_id` (
 
 -- --------------------------------------------------------
 
+--
+-- Table structure for table `locks`
+--
+
+CREATE TABLE `locks` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `name` char(128) NOT NULL,
+  `locked` tinyint(1) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
 --
 -- Table structure for table `mail`
 --
@@ -987,6 +1000,26 @@ CREATE TABLE IF NOT EXISTS `spam` (
 
 -- --------------------------------------------------------
 
+--
+-- Table structure for table `term`
+--
+
+CREATE TABLE IF NOT EXISTS `term` (
+  `tid` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+  `oid` INT UNSIGNED NOT NULL ,
+  `otype` TINYINT( 3 ) UNSIGNED NOT NULL ,
+  `type` TINYINT( 3 ) UNSIGNED NOT NULL ,
+  `term` CHAR( 255 ) NOT NULL ,
+  `url` CHAR( 255 ) NOT NULL, 
+  PRIMARY KEY (`tid`),
+  KEY `oid` ( `oid` ),
+  KEY `otype` ( `otype` ),
+  KEY `type`  ( `type` ),
+  KEY `term`  ( `term` )
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
 --
 -- Table structure for table `tokens`
 --
index 3af1691ee7250880479de51ec3573fb5e2839a05..ba4241a7b819ad0c99e3d4ee08781efb1c7869f2 100644 (file)
@@ -143,7 +143,7 @@ class Photo {
        public function orient($filename) {
                // based off comment on http://php.net/manual/en/function.imagerotate.php
 
-               if(! function_exists('exif_read_data'))
+               if( (! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg') )
                        return;
 
                $exif = exif_read_data($filename);
index 4f53effe92b3653ea99a2688a2484736721af7bd..b784650cd168722cb462d4031e1a9fb888b9e7a8 100644 (file)
@@ -432,7 +432,7 @@ function probe_url($url, $mode = PROBE_NORMAL) {
                                        intval(local_user())
                                );
                                if(count($x) && count($r)) {
-                                   $mailbox = construct_mailbox_name($r[0]);
+                                       $mailbox = construct_mailbox_name($r[0]);
                                        $password = '';
                                        openssl_private_decrypt(hex2bin($r[0]['pass']),$password,$x[0]['prvkey']);
                                        $mbox = email_connect($mailbox,$r[0]['user'],$password);
index 4a82635e57f065246adc702dc8d9d49b042ede47..436412dbd487bc700465314ab812d5670f417df8 100644 (file)
@@ -7,6 +7,66 @@ require_once("include/html2bbcode.php");
 require_once("include/bbcode.php");
 require_once("include/markdownify/markdownify.php");
 
+
+function get_bb_tag_pos($s, $name, $occurance = 1) {
+
+       if($occurance < 1)
+               $occurance = 1;
+
+       $start_open = -1;
+       for($i = 1; $i <= $occurance; $i++) {
+               if( $start_open !== false)
+                       $start_open = strpos($s, '[' . $name, $start_open + 1); // allow [name= type tags
+       }
+
+       if( $start_open === false)
+               return false;
+
+       $start_equal = strpos($s, '=', $start_open);
+       $start_close = strpos($s, ']', $start_open);
+
+       if( $start_close === false)
+               return false;
+
+       $start_close++;
+
+       $end_open = strpos($s, '[/' . $name . ']', $start_close);
+
+       if( $end_open === false)
+               return false;
+
+       $res = array( 'start' => array('open' => $start_open, 'close' => $start_close),
+                     'end' => array('open' => $end_open, 'close' => $end_open + strlen('[/' . $name . ']')) );
+       if( $start_equal !== false)
+               $res['start']['equal'] = $start_equal + 1;
+
+       return $res;
+}
+
+function bb_tag_preg_replace($pattern, $replace, $name, $s) {
+
+       $string = $s;
+
+       $occurance = 1;
+       $pos = get_bb_tag_pos($string, $name, $occurance);
+       while($pos !== false && $occurance < 1000) {
+
+               $start = substr($string, 0, $pos['start']['open']);
+               $subject = substr($string, $pos['start']['open'], $pos['end']['close'] - $pos['start']['open']);
+               $end = substr($string, $pos['end']['close']);
+               if($end === false)
+                       $end = '';
+
+               $subject = preg_replace($pattern, $replace, $subject);
+               $string = $start . $subject . $end;
+
+               $occurance++;
+               $pos = get_bb_tag_pos($string, $name, $occurance);
+       }
+
+       return $string;
+}
+
 // we don't want to support a bbcode specific markdown interpreter
 // and the markdown library we have is pretty good, but provides HTML output.
 // So we'll use that to convert to HTML, then convert the HTML back to bbcode,
@@ -38,20 +98,23 @@ function diaspora2bb($s) {
        $s = Markdown($s);
 
        $s = str_replace('&#35;','#',$s);
-
-       $s = str_replace("\n",'<br />',$s);
+// we seem to have double linebreaks
+//     $s = str_replace("\n",'<br />',$s);
 
        $s = html2bbcode($s);
 //     $s = str_replace('&#42;','*',$s);
 
+       // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands
+       $s = str_replace('&#x2672;',html_entity_decode('&#x2672;',ENT_QUOTES,'UTF-8'),$s);
+
        // Convert everything that looks like a link to a link
        $s = preg_replace("/([^\]\=]|^)(https?\:\/\/)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url=$2$3]$2$3[/url]',$s);
 
        //$s = preg_replace("/([^\]\=]|^)(https?\:\/\/)(vimeo|youtu|www\.youtube|soundcloud)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url=$2$3$4]$2$3$4[/url]',$s);
-       $s = preg_replace("/\[url\=?(.*?)\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/url\]/ism",'[youtube]$2[/youtube]',$s);
-       $s = preg_replace("/\[url\=https?:\/\/www.youtube.com\/watch\?v\=(.*?)\].*?\[\/url\]/ism",'[youtube]$1[/youtube]',$s);
-       $s = preg_replace("/\[url\=?(.*?)\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/url\]/ism",'[vimeo]$2[/vimeo]',$s);
-       $s = preg_replace("/\[url\=https?:\/\/vimeo.com\/([0-9]+)\](.*?)\[\/url\]/ism",'[vimeo]$1[/vimeo]',$s);
+       $s = bb_tag_preg_replace("/\[url\=?(.*?)\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/url\]/ism",'[youtube]$2[/youtube]','url',$s);
+       $s = bb_tag_preg_replace("/\[url\=https?:\/\/www.youtube.com\/watch\?v\=(.*?)\].*?\[\/url\]/ism",'[youtube]$1[/youtube]','url',$s);
+       $s = bb_tag_preg_replace("/\[url\=?(.*?)\]https?:\/     \/vimeo.com\/([0-9]+)(.*?)\[\/url\]/ism",'[vimeo]$2[/vimeo]','url',$s);
+       $s = bb_tag_preg_replace("/\[url\=https?:\/\/vimeo.com\/([0-9]+)\](.*?)\[\/url\]/ism",'[vimeo]$1[/vimeo]','url',$s);
        // remove duplicate adjacent code tags
        $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);
 
@@ -67,6 +130,12 @@ function stripdcode_br_cb($s) {
 }
 
 
+//////////////////////
+// The following "diaspora_ul" and "diaspora_ol" are only appropriate for the
+// pre-Markdownify conversion. If Markdownify isn't used, use the non-Markdownify
+// versions below
+//////////////////////
+/*
 function diaspora_ul($s) {
        // Replace "[*]" followed by any number (including zero) of
        // spaces by "* " to match Diaspora's list format
@@ -100,32 +169,33 @@ function diaspora_ol($s) {
        else
                return $s[0];
 }
+*/
+
+//////////////////////
+// Non-Markdownify versions of "diaspora_ol" and "diaspora_ul"
+//////////////////////
+function diaspora_ul($s) {
+       // Replace "[\\*]" followed by any number (including zero) of
+       // spaces by "* " to match Diaspora's list format
+       return preg_replace("/\[\\\\\*\]( *)/", "* ", $s[1]);
+}
+
+function diaspora_ol($s) {
+       // A hack: Diaspora will create a properly-numbered ordered list even
+       // if you use '1.' for each element of the list, like:
+       // 1. First element
+       // 1. Second element
+       // 1. Third element
+       return preg_replace("/\[\\\\\*\]( *)/", "1. ", $s[1]);
+}
 
 
 function bb2diaspora($Text,$preserve_nl = false) {
 
-       // bbcode() will convert "[*]" into "<li>" with no closing "</li>"
-       // Markdownify() is unable to handle these, as it makes each new
-       // "<li>" into a deeper nested element until it crashes. So pre-format
-       // the lists as Diaspora lists before sending the $Text to bbcode()
-       //
-       // Note that to get nested lists to work for Diaspora, we would need
-       // to define the closing tag for the list elements. So nested lists
-       // are going to be flattened out in Diaspora for now
-/*     $endlessloop = 0;
-       while ((((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false)) ||
-              ((strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false)) || 
-              ((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false))) && (++$endlessloop < 20)) {
-               $Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text);
-               $Text = preg_replace_callback("/\[list=1\](.*?)\[\/list\]/is", 'diaspora_ol', $Text);
-               $Text = preg_replace_callback("/\[list=i\](.*?)\[\/list\]/s",'diaspora_ol', $Text);
-               $Text = preg_replace_callback("/\[list=I\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
-               $Text = preg_replace_callback("/\[list=a\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
-               $Text = preg_replace_callback("/\[list=A\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
-               $Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/is", 'diaspora_ul', $Text);
-               $Text = preg_replace_callback("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text);
-       }
-*/
+       // Re-enabling the converter again.
+       // The bbcode parser now handles youtube-links (and the other stuff) correctly.
+       // Additionally the html code is now fixed so that lists are now working.
+
        // Convert it to HTML - don't try oembed
        $Text = bbcode($Text, $preserve_nl, false);
 
@@ -142,7 +212,9 @@ function bb2diaspora($Text,$preserve_nl = false) {
        // Remove all unconverted tags
        $Text = strip_tags($Text);
 
-/*
+
+/* Old routine
+
        $ev = bbtoevent($Text);
 
        // Replace any html brackets with HTML Entities to prevent executing HTML or script
@@ -225,15 +297,21 @@ function bb2diaspora($Text,$preserve_nl = false) {
        $Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])is","$2",$Text);
 
        // Check for list text
-       $Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text);
-       $Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/is", 'diaspora_ul', $Text);
-       $Text = preg_replace_callback("/\[list=1\](.*?)\[\/list\]/is", 'diaspora_ol', $Text);
-       $Text = preg_replace_callback("/\[list=i\](.*?)\[\/list\]/s",'diaspora_ol', $Text);
-       $Text = preg_replace_callback("/\[list=I\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
-       $Text = preg_replace_callback("/\[list=a\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
-       $Text = preg_replace_callback("/\[list=A\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
-       $Text = preg_replace_callback("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text);
-//     $Text = preg_replace("/\[li\](.*?)\[\/li\]/s", '<li>$1</li>' ,$Text);
+       $endlessloop = 0;
+       while ((((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false)) ||
+              ((strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false)) || 
+              ((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false)) || 
+              ((strpos($Text, "[/li]") !== false) && (strpos($Text, "[li]") !== false))) && (++$endlessloop < 20)) {
+               $Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text);
+               $Text = preg_replace_callback("/\[list=1\](.*?)\[\/list\]/is", 'diaspora_ol', $Text);
+               $Text = preg_replace_callback("/\[list=i\](.*?)\[\/list\]/s",'diaspora_ol', $Text);
+               $Text = preg_replace_callback("/\[list=I\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
+               $Text = preg_replace_callback("/\[list=a\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
+               $Text = preg_replace_callback("/\[list=A\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
+               $Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/is", 'diaspora_ul', $Text);
+               $Text = preg_replace_callback("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text);
+               $Text = preg_replace("/\[li\]( *)(.*?)\[\/li\]/s", '* $2' ,$Text);
+       }
 
        // Just get rid of table tags since Diaspora doesn't support tables
        $Text = preg_replace("/\[th\](.*?)\[\/th\]/s", '$1' ,$Text);
@@ -295,12 +373,13 @@ function bb2diaspora($Text,$preserve_nl = false) {
 
        // If we found an event earlier, strip out all the event code and replace with a reformatted version.
 
-       if(x($ev,'desc') && x($ev,'start')) {
+       if(x($ev,'start')) {
 
                $sub = format_event_diaspora($ev);
 
-               $Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/is",$sub,$Text);
-               $Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/is",'',$Text);
+               $Text = preg_replace("/\[event\-summary\](.*?)\[\/event\-summary\]/is",'',$Text);
+               $Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/is",'',$Text);
+               $Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/is",$sub,$Text);
                $Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/is",'',$Text);
                $Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/is",'',$Text);
                $Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",'',$Text);
@@ -309,6 +388,7 @@ function bb2diaspora($Text,$preserve_nl = false) {
        $Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
 
        $Text = preg_replace_callback('/\[(.*?)\]\((.*?)\)/ism','unescape_underscores_in_links',$Text);
+
 */
 
        // Remove any leading or trailing whitespace, as this will mess up
@@ -336,7 +416,7 @@ function format_event_diaspora($ev) {
 
        $o = 'Friendica event notification:' . "\n";
 
-       $o .= '**' . bb2diaspora($ev['desc']) .  '**' . "\n";
+       $o .= '**' . (($ev['summary']) ? bb2diaspora($ev['summary']) : bb2diaspora($ev['desc'])) .  '**' . "\n";
 
        $o .= t('Starts:') . ' ' . '['
                . (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC', 
index e212ec4aed0f1016282d43a0c4e702cca9f2f203..4aac33f112e9badf10953d260baabae11ebece90 100644 (file)
@@ -47,6 +47,67 @@ function bb_unspacefy_and_trim($st) {
   return $unspacefied;
 }
 
+if(! function_exists('bb_extract_images')) {
+function bb_extract_images($body) {
+
+       $saved_image = array();
+       $orig_body = $body;
+       $new_body = '';
+
+       $cnt = 0;
+       $img_start = strpos($orig_body, '[img');
+       $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+       $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
+       while(($img_st_close !== false) && ($img_end !== false)) {
+
+               $img_st_close++; // make it point to AFTER the closing bracket
+               $img_end += $img_start;
+
+               if(! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
+                       // This is an embedded image
+
+                       $saved_image[$cnt] = substr($orig_body, $img_start + $img_st_close, $img_end - ($img_start + $img_st_close));
+                       $new_body = $new_body . substr($orig_body, 0, $img_start) . '[$#saved_image' . $cnt . '#$]';
+
+                       $cnt++;
+               }
+               else
+                       $new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]'));
+
+               $orig_body = substr($orig_body, $img_end + strlen('[/img]'));
+
+               if($orig_body === false) // in case the body ends on a closing image tag
+                       $orig_body = '';
+
+               $img_start = strpos($orig_body, '[img');
+               $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+               $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
+       }
+
+       $new_body = $new_body . $orig_body;
+
+       return array('body' => $new_body, 'images' => $saved_image);
+}}
+
+if(! function_exists('bb_replace_images')) {
+function bb_replace_images($body, $images) {
+
+       $newbody = $body;
+
+       $cnt = 0;
+       foreach($images as $image) {
+               // We're depending on the property of 'foreach' (specified on the PHP website) that
+               // it loops over the array starting from the first element and going sequentially
+               // to the last element
+               $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '<img src="' . $image .'" alt="' . t('Image/photo') . '" />', $newbody);
+               $cnt++;
+       }
+
+       return $newbody;
+}}
+
+
+
        // BBcode 2 HTML was written by WAY2WEB.net
        // extended to work with Mistpark/Friendica - Mike Macgirvin
 
@@ -54,29 +115,21 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
 
        $a = get_app();
 
-       // Hide all [noparse] contained bbtags spacefying them
+       // Hide all [noparse] contained bbtags by spacefying them
+       // POSSIBLE BUG --> Will the 'preg' functions crash if there's an embedded image?
 
        $Text = preg_replace_callback("/\[noparse\](.*?)\[\/noparse\]/ism", 'bb_spacefy',$Text);
        $Text = preg_replace_callback("/\[nobb\](.*?)\[\/nobb\]/ism", 'bb_spacefy',$Text);
        $Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$Text);
 
 
-       // Extract a single private image which uses data url's since preg has issues with
-       // large data sizes. Stash it away while we do bbcode conversion, and then put it back
+       // Extract the private images which use data url's since preg has issues with
+       // large data sizes. Stash them away while we do bbcode conversion, and then put them back
        // in after we've done all the regex matching. We cannot use any preg functions to do this.
 
-       $saved_image = '';
-       $img_start = strpos($Text,'[img]data:');
-       $img_end = strpos($Text,'[/img]');
-
-       if($img_start !== false && $img_end !== false && $img_end > $img_start) {
-               $start_fragment = substr($Text,0,$img_start);
-               $img_start += strlen('[img]');
-               $saved_image = substr($Text,$img_start,$img_end - $img_start);
-               $end_fragment = substr($Text,$img_end + strlen('[/img]'));
-//             logger('saved_image: ' . $saved_image,LOGGER_DEBUG);
-               $Text = $start_fragment . '[$#saved_image#$]' . $end_fragment;
-       }
+       $extracted = bb_extract_images($Text);
+       $Text = $extracted['body'];
+       $saved_image = $extracted['images'];
 
        // If we find any event code, turn it into an event.
        // After we're finished processing the bbcode we'll
@@ -93,11 +146,19 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
 
        // Convert new line chars to html <br /> tags
 
-       $Text = nl2br($Text);
+       // nlbr seems to be hopelessly messed up
+       //      $Text = nl2br($Text);
+
+       // We'll emulate it.
+
+       $Text = str_replace("\r\n","\n", $Text);
+       $Text = str_replace(array("\r","\n"), array('<br />','<br />'), $Text);
+
        if($preserve_nl)
                $Text = str_replace(array("\n","\r"), array('',''),$Text);
 
 
+
        // Set up the parameters for a URL search string
        $URLSearchString = "^\[\]";
        // Set up the parameters for a MAIL search string
@@ -158,14 +219,14 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
 
        // Check for list text
        $Text = str_replace("[*]", "<li>", $Text);
-       $Text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '<li>$1</li>' ,$Text);
 
        // handle nested lists
        $endlessloop = 0;
 
        while ((((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false)) ||
               ((strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false)) || 
-              ((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false))) && (++$endlessloop < 20)) {
+              ((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false)) || 
+              ((strpos($Text, "[/li]") !== false) && (strpos($Text, "[li]") !== false))) && (++$endlessloop < 20)) {
                $Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text);
                $Text = preg_replace("/\[list=\](.*?)\[\/list\]/ism", '<ul class="listnone" style="list-style-type: none;">$1</ul>' ,$Text);
                $Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>' ,$Text);
@@ -175,6 +236,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
                $Text = preg_replace("/\[list=((?-i)A)\](.*?)\[\/list\]/ism", '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$2</ul>' ,$Text);
                $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text);
                $Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>' ,$Text);
+               $Text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '<li>$1</li>' ,$Text);
        }
 
        $Text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '<th>$1</th>' ,$Text);
@@ -196,7 +258,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
 
        // Declare the format for [code] layout
 
-       $Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/ism",'stripcode_br_cb',$Text);
+//     $Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/ism",'stripcode_br_cb',$Text);
 
        $CodeLayout = '<code>$1</code>';
        // Check for [code] text
@@ -335,8 +397,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
 
        // fix any escaped ampersands that may have been converted into links
        $Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
-       if(strlen($saved_image))
-               $Text = str_replace('[$#saved_image#$]','<img src="' . $saved_image .'" alt="' . t('Image/photo') . '" />',$Text);
+
+       if($saved_image)
+               $Text = bb_replace_images($Text, $saved_image);
 
        // Clean up the HTML by loading and saving the HTML with the DOM
        // Only do it when it has to be done - for performance reasons
index f2fb2e97b4c1c7994d9f5a2e16ab094142f9afc9..6c3f13477fdf4cd16371e504d6a8baedc26be032 100644 (file)
@@ -1,30 +1,91 @@
 <?php
 
+// Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
+// is identical to the code in mod/message.php for 'item_extract_images' and
+// 'item_redir_and_replace_images'
+if(! function_exists('item_extract_images')) {
+function item_extract_images($body) {
+
+       $saved_image = array();
+       $orig_body = $body;
+       $new_body = '';
+
+       $cnt = 0;
+       $img_start = strpos($orig_body, '[img');
+       $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+       $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
+       while(($img_st_close !== false) && ($img_end !== false)) {
+
+               $img_st_close++; // make it point to AFTER the closing bracket
+               $img_end += $img_start;
+
+               if(! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
+                       // This is an embedded image
+
+                       $saved_image[$cnt] = substr($orig_body, $img_start + $img_st_close, $img_end - ($img_start + $img_st_close));
+                       $new_body = $new_body . substr($orig_body, 0, $img_start) . '[!#saved_image' . $cnt . '#!]';
+
+                       $cnt++;
+               }
+               else
+                       $new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]'));
+
+               $orig_body = substr($orig_body, $img_end + strlen('[/img]'));
+
+               if($orig_body === false) // in case the body ends on a closing image tag
+                       $orig_body = '';
+
+               $img_start = strpos($orig_body, '[img');
+               $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+               $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
+       }
+
+       $new_body = $new_body . $orig_body;
+
+       return array('body' => $new_body, 'images' => $saved_image);
+}}
+
+if(! function_exists('item_redir_and_replace_images')) {
+function item_redir_and_replace_images($body, $images, $cid) {
+
+       $origbody = $body;
+       $newbody = '';
+
+       for($i = 0; $i < count($images); $i++) {
+               $search = '/\[url\=(.*?)\]\[!#saved_image' . $i . '#!\]\[\/url\]' . '/is';
+               $replace = '[url=' . z_path() . '/redir/' . $cid 
+                          . '?f=1&url=' . '$1' . '][!#saved_image' . $i . '#!][/url]' ;
+
+               $img_end = strpos($origbody, '[!#saved_image' . $i . '#!][/url]') + strlen('[!#saved_image' . $i . '#!][/url]');
+               $process_part = substr($origbody, 0, $img_end);
+               $origbody = substr($origbody, $img_end);
+
+               $process_part = preg_replace($search, $replace, $process_part);
+               $newbody = $newbody . $process_part;
+       }
+       $newbody = $newbody . $origbody;
+
+       $cnt = 0;
+       foreach($images as $image) {
+               // We're depending on the property of 'foreach' (specified on the PHP website) that
+               // it loops over the array starting from the first element and going sequentially
+               // to the last element
+               $newbody = str_replace('[!#saved_image' . $cnt . '#!]', '[img]' . $image . '[/img]', $newbody);
+               $cnt++;
+       }
+       return $newbody;
+}}
+
+
+
 /**
  * Render actions localized
  */
 function localize_item(&$item){
 
-       $Text = $item['body'];
-       $saved_image = '';
-       $img_start = strpos($Text,'[img]data:');
-       $img_end = strpos($Text,'[/img]');
-
-       if($img_start !== false && $img_end !== false && $img_end > $img_start) {
-               $start_fragment = substr($Text,0,$img_start);
-               $img_start += strlen('[img]');
-               $saved_image = substr($Text,$img_start,$img_end - $img_start);
-               $end_fragment = substr($Text,$img_end + strlen('[/img]'));              
-               $Text = $start_fragment . '[!#saved_image#!]' . $end_fragment;
-               $search = '/\[url\=(.*?)\]\[!#saved_image#!\]\[\/url\]' . '/is';
-               $replace = '[url=' . z_path() . '/redir/' . $item['contact-id'] 
-                       . '?f=1&url=' . '$1' . '][!#saved_image#!][/url]' ;
-
-               $Text = preg_replace($search,$replace,$Text);
-
-               if(strlen($saved_image))
-                       $item['body'] = str_replace('[!#saved_image#!]', '[img]' . $saved_image . '[/img]',$Text);
-       }
+       $extracted = item_extract_images($item['body']);
+       if($extracted['images'])
+               $item['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $item['contact-id']);
 
        $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
        if ($item['verb']=== ACTIVITY_LIKE || $item['verb']=== ACTIVITY_DISLIKE){
@@ -173,6 +234,7 @@ function localize_item(&$item){
                                $item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']);
                }
        }
+
        // add zrl's to public images
        if(preg_match_all('/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is',$item['body'],$matches,PREG_SET_ORDER)) {
                foreach($matches as $mtch) {
@@ -180,6 +242,17 @@ function localize_item(&$item){
                }
        }
 
+       // add sparkle links to appropriate permalinks
+
+       $x = stristr($item['plink'],'/display/');
+       if($x) {
+               $sparkle = false;
+               $y = best_link_url($item,$sparkle,true);
+               if(strstr($y,'/redir/'))
+                       $item['plink'] = $y . '?f=&url=' . $item['plink'];
+       } 
+
+
 
 }
 
@@ -546,7 +619,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                }
 
                                $likebuttons = '';
-                               $shareable = ((($profile_owner == local_user()) && (! $item['private'] == 1)) ? true : false); 
+                               $shareable = ((($profile_owner == local_user()) && ($item['private'] != 1)) ? true : false); 
 
                                if($page_writeable) {
 /*                                     if($toplevelpost) {  */
index 6fc9a287e4238ca5743c35920fab1d2c48afc91d..ed0a35704e8a5c8f97ab7f26038828fd5b2fd53b 100644 (file)
@@ -261,39 +261,6 @@ function aes_unencapsulate($data,$prvkey) {
        return AES256CBC_decrypt(base64url_decode($data['data']),$k,$i);
 }
 
-
-// This has been superceded.
-
-function zot_encapsulate($data,$envelope,$pubkey) {
-$res = aes_encapsulate($data,$pubkey);
-
-return <<< EOT
-<?xml version='1.0' encoding='UTF-8'?>
-<zot:msg xmlns:zot='http://purl.org/zot/1.0'>
- <zot:key>{$res['key']}</zot:key>
- <zot:iv>{$res['iv']}</zot:iv>
- <zot:env>$s1</zot:env>
- <zot:sig key_id="$keyid">$sig</zot:sig>
- <zot:alg>AES-256-CBC</zot:alg>
- <zot:data type='application/magic-envelope+xml'>{$res['data']}</zot:data>
-</zot:msg>
-EOT;
-
-}
-
-// so has this
-
-function zot_unencapsulate($data,$prvkey) {
-       $ret = array();
-       $c = array();
-       $x = parse_xml_string($data);
-       $c = array('key' => $x->key,'iv' => $x->iv,'data' => $x->data);
-       openssl_private_decrypt(base64url_decode($x->sender),$s,$prvkey);
-       $ret['sender'] = $s;
-       $ret['data'] = aes_unencapsulate($x,$prvkey);
-       return $ret;
-}
-
 function new_keypair($bits) {
 
        $openssl_options = array(
index d37b756aeee7840e8e1edb650cfb13dd4fab7dc4..879d7e67e12d33c1c997faa6edcd4a57797dba20 100644 (file)
@@ -285,3 +285,9 @@ function dbesc_array(&$arr) {
                array_walk($arr,'dbesc_array_cb');
        }
 }}
+
+
+function dba_timer() {
+       return microtime(true);
+}
+
index a398007e197d206629caa3b17cd92fd5845eb27b..af9a91f02888c3496610167dc4dc82de66738911 100755 (executable)
@@ -5,6 +5,7 @@ require_once('include/items.php');
 require_once('include/bb2diaspora.php');
 require_once('include/contact_selectors.php');
 require_once('include/queue_fn.php');
+require_once('include/lock.php');
 
 
 function diaspora_dispatch_public($msg) {
@@ -60,10 +61,10 @@ function diaspora_dispatch($importer,$msg) {
                $ret = diaspora_request($importer,$xmlbase->request);
        }
        elseif($xmlbase->status_message) {
-               $ret = diaspora_post($importer,$xmlbase->status_message);
+               $ret = diaspora_post($importer,$xmlbase->status_message,$msg);
        }
        elseif($xmlbase->profile) {
-               $ret = diaspora_profile($importer,$xmlbase->profile);
+               $ret = diaspora_profile($importer,$xmlbase->profile,$msg);
        }
        elseif($xmlbase->comment) {
                $ret = diaspora_comment($importer,$xmlbase->comment,$msg);
@@ -72,10 +73,10 @@ function diaspora_dispatch($importer,$msg) {
                $ret = diaspora_like($importer,$xmlbase->like,$msg);
        }
        elseif($xmlbase->asphoto) {
-               $ret = diaspora_asphoto($importer,$xmlbase->asphoto);
+               $ret = diaspora_asphoto($importer,$xmlbase->asphoto,$msg);
        }
        elseif($xmlbase->reshare) {
-               $ret = diaspora_reshare($importer,$xmlbase->reshare);
+               $ret = diaspora_reshare($importer,$xmlbase->reshare,$msg);
        }
        elseif($xmlbase->retraction) {
                $ret = diaspora_retraction($importer,$xmlbase->retraction,$msg);
@@ -113,27 +114,93 @@ function diaspora_get_contact_by_handle($uid,$handle) {
 }
 
 function find_diaspora_person_by_handle($handle) {
+
+       $person = false;
        $update = false;
-       $r = q("select * from fcontact where network = '%s' and addr = '%s' limit 1",
-               dbesc(NETWORK_DIASPORA),
-               dbesc($handle)
-       );
-       if(count($r)) {
-               logger('find_diaspora_person_by handle: in cache ' . print_r($r,true), LOGGER_DEBUG);
-               // update record occasionally so it doesn't get stale
-               $d = strtotime($r[0]['updated'] . ' +00:00');
-               if($d > strtotime('now - 14 days'))
-                       return $r[0];
-               $update = true;
-       }
-       logger('find_diaspora_person_by_handle: refresh',LOGGER_DEBUG);
-       require_once('include/Scrape.php');
-       $r = probe_url($handle, PROBE_DIASPORA);
-       if((count($r)) && ($r['network'] === NETWORK_DIASPORA)) {
-               add_fcontact($r,$update);
-               return ($r);
-       }
-       return false;
+       $got_lock = false;
+
+       $endlessloop = 0;
+       $maxloops = 10;
+
+       do {
+               $r = q("select * from fcontact where network = '%s' and addr = '%s' limit 1",
+                       dbesc(NETWORK_DIASPORA),
+                       dbesc($handle)
+               );
+               if(count($r)) {
+                       $person = $r[0];
+                       logger('find_diaspora_person_by handle: in cache ' . print_r($r,true), LOGGER_DEBUG);
+
+                       // update record occasionally so it doesn't get stale
+                       $d = strtotime($person['updated'] . ' +00:00');
+                       if($d < strtotime('now - 14 days'))
+                               $update = true;
+               }
+
+
+               // FETCHING PERSON INFORMATION FROM REMOTE SERVER
+               //
+               // If the person isn't in our 'fcontact' table, or if he/she is but
+               // his/her information hasn't been updated for more than 14 days, then
+               // we want to fetch the person's information from the remote server.
+               //
+               // Note that $person isn't changed by this block of code unless the
+               // person's information has been successfully fetched from the remote
+               // server. So if $person was 'false' to begin with (because he/she wasn't
+               // in the local cache), it'll stay false, and if $person held the local
+               // cache information to begin with, it'll keep that information. That way
+               // if there's a problem with the remote fetch, we can at least use our
+               // cached information--it's better than nothing.
+
+               if((! $person) || ($update))  {
+                       // Lock the function to prevent race conditions if multiple items
+                       // come in at the same time from a person who doesn't exist in
+                       // fcontact
+                       //
+                       // Don't loop forever. On the last loop, try to create the contact
+                       // whether the function is locked or not. Maybe the locking thread
+                       // has died or something. At any rate, a duplicate in 'fcontact'
+                       // is a much smaller problem than a deadlocked thread
+                       $got_lock = lock_function('find_diaspora_person_by_handle', false);
+                       if(($endlessloop + 1) >= $maxloops)
+                               $got_lock = true;
+
+                       if($got_lock) {
+                               logger('find_diaspora_person_by_handle: create or refresh', LOGGER_DEBUG);
+                               require_once('include/Scrape.php');
+                               $r = probe_url($handle, PROBE_DIASPORA);
+
+                               // Note that Friendica contacts can return a "Diaspora person"
+                               // if Diaspora connectivity is enabled on their server
+                               if((count($r)) && ($r['network'] === NETWORK_DIASPORA)) {
+                                       add_fcontact($r,$update);
+                                       $person = ($r);
+                               }
+
+                               unlock_function('find_diaspora_person_by_handle');
+                       }
+                       else {
+                               logger('find_diaspora_person_by_handle: couldn\'t lock function', LOGGER_DEBUG);
+                               if(! $person)
+                                       block_on_function_lock('find_diaspora_person_by_handle');
+                       }
+               }
+       } while((! $person) && (! $got_lock) && (++$endlessloop < $maxloops));
+       // We need to try again if the person wasn't in 'fcontact' but the function was locked.
+       // The fact that the function was locked may mean that another process was creating the
+       // person's record. It could also mean another process was creating or updating an unrelated
+       // person.
+       //
+       // At any rate, we need to keep trying until we've either got the person or had a chance to
+       // try to fetch his/her remote information. But we don't want to block on locking the
+       // function, because if the other process is creating the record, then when we acquire the lock
+       // we'll dive right into creating another, duplicate record. We DO want to at least wait
+       // until the lock is released, so we don't flood the database with requests.
+       //
+       // If the person was in the 'fcontact' table, don't try again. It's not worth the time, since
+       // we do have some information for the person
+
+       return $person;
 }
 
 
@@ -654,12 +721,17 @@ function diaspora_post_allow($importer,$contact) {
 }
 
 
-function diaspora_post($importer,$xml) {
+function diaspora_post($importer,$xml,$msg) {
 
        $a = get_app();
        $guid = notags(unxmlify($xml->guid));
        $diaspora_handle = notags(unxmlify($xml->diaspora_handle));
 
+       if($diaspora_handle != $msg['author']) {
+               logger('diaspora_post: Potential forgery. Message handle is not the same as envelope sender.');
+               return 202;
+       }
+
        $contact = diaspora_get_contact_by_handle($importer['uid'],$diaspora_handle);
        if(! $contact)
                return;
@@ -770,7 +842,7 @@ function diaspora_post($importer,$xml) {
 
 }
 
-function diaspora_reshare($importer,$xml) {
+function diaspora_reshare($importer,$xml,$msg) {
 
        logger('diaspora_reshare: init: ' . print_r($xml,true));
 
@@ -779,6 +851,11 @@ function diaspora_reshare($importer,$xml) {
        $diaspora_handle = notags(unxmlify($xml->diaspora_handle));
 
 
+       if($diaspora_handle != $msg['author']) {
+               logger('diaspora_post: Potential forgery. Message handle is not the same as envelope sender.');
+               return 202;
+       }
+
        $contact = diaspora_get_contact_by_handle($importer['uid'],$diaspora_handle);
        if(! $contact)
                return;
@@ -844,7 +921,7 @@ function diaspora_reshare($importer,$xml) {
        else
                $details = $orig_author;
        
-       $prefix = '&#x2672; ' . $details . "\n"; 
+       $prefix = html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8') . $details . "\n"; 
 
 
        // allocate a guid on our system - we aren't fixing any collisions.
@@ -924,13 +1001,18 @@ function diaspora_reshare($importer,$xml) {
 }
 
 
-function diaspora_asphoto($importer,$xml) {
+function diaspora_asphoto($importer,$xml,$msg) {
        logger('diaspora_asphoto called');
 
        $a = get_app();
        $guid = notags(unxmlify($xml->guid));
        $diaspora_handle = notags(unxmlify($xml->diaspora_handle));
 
+       if($diaspora_handle != $msg['author']) {
+               logger('diaspora_post: Potential forgery. Message handle is not the same as envelope sender.');
+               return 202;
+       }
+
        $contact = diaspora_get_contact_by_handle($importer['uid'],$diaspora_handle);
        if(! $contact)
                return;
@@ -1154,6 +1236,7 @@ function diaspora_comment($importer,$xml,$msg) {
 
        $datarray['uid'] = $importer['uid'];
        $datarray['contact-id'] = $contact['id'];
+       $datarray['type'] = 'remote-comment';
        $datarray['wall'] = $parent_item['wall'];
        $datarray['gravity'] = GRAVITY_COMMENT;
        $datarray['guid'] = $guid;
@@ -1190,7 +1273,7 @@ function diaspora_comment($importer,$xml,$msg) {
        if(($parent_item['origin']) && (! $parent_author_signature)) {
                q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
                        intval($message_id),
-                       dbesc($author_signed_data),
+                       dbesc($signed_data),
                        dbesc(base64_encode($author_signature)),
                        dbesc($diaspora_handle)
                );
@@ -1591,8 +1674,8 @@ function diaspora_like($importer,$xml,$msg) {
 
        // likes on comments not supported here and likes on photos not supported by Diaspora
 
-       if($target_type !== 'Post')
-               return;
+//     if($target_type !== 'Post')
+//             return;
 
        $contact = diaspora_get_contact_by_handle($importer['uid'],$msg['author']);
        if(! $contact) {
@@ -1773,7 +1856,7 @@ EOT;
        if(! $parent_author_signature) {
                q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
                        intval($message_id),
-                       dbesc($author_signed_data),
+                       dbesc($signed_data),
                        dbesc(base64_encode($author_signature)),
                        dbesc($diaspora_handle)
                );
@@ -1923,11 +2006,17 @@ function diaspora_signed_retraction($importer,$xml,$msg) {
        // NOTREACHED
 }
 
-function diaspora_profile($importer,$xml) {
+function diaspora_profile($importer,$xml,$msg) {
 
        $a = get_app();
        $diaspora_handle = notags(unxmlify($xml->diaspora_handle));
 
+
+       if($diaspora_handle != $msg['author']) {
+               logger('diaspora_post: Potential forgery. Message handle is not the same as envelope sender.');
+               return 202;
+       }
+
        $contact = diaspora_get_contact_by_handle($importer['uid'],$diaspora_handle);
        if(! $contact)
                return;
@@ -2165,22 +2254,30 @@ function diaspora_send_followup($item,$owner,$contact,$public_batch = false) {
        $myaddr = $owner['nickname'] . '@' .  substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
 //     $theiraddr = $contact['addr'];
 
-       // The first item in the `item` table with the parent id is the parent. However, MySQL doesn't always
-       // return the items ordered by `item`.`id`, in which case the wrong item is chosen as the parent.
-       // The only item with `parent` and `id` as the parent id is the parent item.
-       $p = q("select guid from item where parent = %d and id = %d limit 1",
-               intval($item['parent']),
-               intval($item['parent'])
-       );
+       if($item['thr-parent']) {
+               $p = q("select guid, type, uri, `parent-uri` from item where uri = '%s' limit 1",
+                       dbesc($item['thr-parent'])
+                     );
+       }
+       else {
+               // The first item in the `item` table with the parent id is the parent. However, MySQL doesn't always
+               // return the items ordered by `item`.`id`, in which case the wrong item is chosen as the parent.
+               // The only item with `parent` and `id` as the parent id is the parent item.
+               $p = q("select guid, type, uri, `parent-uri` from item where parent = %d and id = %d limit 1",
+                       intval($item['parent']),
+                       intval($item['parent'])
+               );
+       }
        if(count($p))
-               $parent_guid = $p[0]['guid'];
+               $parent = $p[0];
        else
                return;
 
        if($item['verb'] === ACTIVITY_LIKE) {
                $tpl = get_markup_template('diaspora_like.tpl');
                $like = true;
-               $target_type = 'Post';
+               $target_type = ( $parent['uri'] === $parent['parent-uri']  ? 'Post' : 'Comment');
+//             $target_type = (strpos($parent['type'], 'comment') ? 'Comment' : 'Post');
 //             $positive = (($item['deleted']) ? 'false' : 'true');
                $positive = 'true';
 
@@ -2197,15 +2294,15 @@ function diaspora_send_followup($item,$owner,$contact,$public_batch = false) {
        // sign it
 
        if($like)
-               $signed_text = $item['guid'] . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $myaddr;
+               $signed_text = $item['guid'] . ';' . $target_type . ';' . $parent['guid'] . ';' . $positive . ';' . $myaddr;
        else
-               $signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . ';' . $myaddr;
+               $signed_text = $item['guid'] . ';' . $parent['guid'] . ';' . $text . ';' . $myaddr;
 
        $authorsig = base64_encode(rsa_sign($signed_text,$owner['uprvkey'],'sha256'));
 
        $msg = replace_macros($tpl,array(
                '$guid' => xmlify($item['guid']),
-               '$parent_guid' => xmlify($parent_guid),
+               '$parent_guid' => xmlify($parent['guid']),
                '$target_type' =>xmlify($target_type),
                '$authorsig' => xmlify($authorsig),
                '$body' => xmlify($text),
@@ -2233,15 +2330,22 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
        $text = html_entity_decode(bb2diaspora($body));
 
 
-       // The first item in the `item` table with the parent id is the parent. However, MySQL doesn't always
-       // return the items ordered by `item`.`id`, in which case the wrong item is chosen as the parent.
-       // The only item with `parent` and `id` as the parent id is the parent item.
-       $p = q("select guid from item where parent = %d and id = %d limit 1",
-               intval($item['parent']),
-               intval($item['parent'])
-       );
+       if($item['thr-parent']) {
+               $p = q("select guid, type, uri, `parent-uri` from item where uri = '%s' limit 1",
+                       dbesc($item['thr-parent'])
+                     );
+       }
+       else {
+               // The first item in the `item` table with the parent id is the parent. However, MySQL doesn't always
+               // return the items ordered by `item`.`id`, in which case the wrong item is chosen as the parent.
+               // The only item with `parent` and `id` as the parent id is the parent item.
+               $p = q("select guid, type, uri, `parent-uri` from item where parent = %d and id = %d limit 1",
+                       intval($item['parent']),
+                       intval($item['parent'])
+                     );
+       }
        if(count($p))
-               $parent_guid = $p[0]['guid'];
+               $parent = $p[0];
        else
                return;
 
@@ -2259,7 +2363,8 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
        elseif($item['verb'] === ACTIVITY_LIKE) {
                $like = true;
 
-               $target_type = 'Post';
+               $target_type = ( $parent['uri'] === $parent['parent-uri']  ? 'Post' : 'Comment');
+//             $target_type = (strpos($parent['type'], 'comment') ? 'Comment' : 'Post');
 //             $positive = (($item['deleted']) ? 'false' : 'true');
                $positive = 'true';
 
@@ -2294,9 +2399,9 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
        if($relay_retract)
                $sender_signed_text = $item['guid'] . ';' . $target_type;
        elseif($like)
-               $sender_signed_text = $item['guid'] . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $handle;
+               $sender_signed_text = $item['guid'] . ';' . $target_type . ';' . $parent['guid'] . ';' . $positive . ';' . $handle;
        else
-               $sender_signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . ';' . $handle;
+               $sender_signed_text = $item['guid'] . ';' . $parent['guid'] . ';' . $text . ';' . $handle;
 
        // Sign the relayable with the top-level owner's signature
        //
@@ -2313,7 +2418,7 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
 
        $msg = replace_macros($tpl,array(
                '$guid' => xmlify($item['guid']),
-               '$parent_guid' => xmlify($parent_guid),
+               '$parent_guid' => xmlify($parent['guid']),
                '$target_type' =>xmlify($target_type),
                '$authorsig' => xmlify($authorsig),
                '$parentsig' => xmlify($parentauthorsig),
@@ -2429,7 +2534,7 @@ function diaspora_send_mail($item,$owner,$contact) {
 
 }
 
-function diaspora_transmit($owner,$contact,$slap,$public_batch) {
+function diaspora_transmit($owner,$contact,$slap,$public_batch,$queue_run=false) {
 
        $enabled = intval(get_config('system','diaspora_enabled'));
        if(! $enabled) {
@@ -2446,7 +2551,7 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch) {
 
        logger('diaspora_transmit: ' . $logid . ' ' . $dest_url);
 
-       if(was_recently_delayed($contact['id'])) {
+       if( (! $queue_run) && (was_recently_delayed($contact['id'])) ) {
                $return_code = 0;
        }
        else {
index 134e42f8e3b25345d1a040019d99e2e883167c2e..814bd06a4ce2501e97da19ac542b8c56eddd6f0a 100644 (file)
@@ -54,6 +54,20 @@ function notification($params) {
 
                $parent_id = $params['parent'];
 
+               // Check to see if there was already a tag notify for this post.
+               // If so don't create a second notification
+               
+               $p = null;
+               $p = q("select id from notify where type = %d and link = '%s' and uid = %d limit 1",
+                       intval(NOTIFY_TAGSELF),
+                       dbesc($params['link']),
+                       intval($params['uid'])
+               );
+               if($p and count($p)) {
+                       pop_lang();
+                       return;
+               }
+       
 
                // if it's a post figure out who's post it is.
 
@@ -110,9 +124,9 @@ function notification($params) {
 
                $preamble = sprintf( t('%1$s posted to your profile wall at %2$s') , $params['source_name'], $sitename);
                
-               $epreamble = sprintf( t('%1$s posted to [url=%2s]your wall[/url]') , 
+               $epreamble = sprintf( t('%1$s posted to [url=%2$s]your wall[/url]') , 
                                                                '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]',
-                                                               $itemlink); 
+                                                               $params['link']); 
                
                $sitelink = t('Please visit %s to view and/or reply to the conversation.');
                $tsitelink = sprintf( $sitelink, $siteurl );
index 69ccf41b71de3f2212217997358c59966e898fdc..985c36eaa4499e5f03acbe72dbd52bb1159947ea 100644 (file)
@@ -124,7 +124,7 @@ function html2bbcode($message)
                $node->nodeValue = str_replace("\n", "\r", $node->nodeValue);
 
        $message = $doc->saveHTML();
-       $message = str_replace(array("\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"), array("<", ">", "<br>", " ", ""), $message);
+       $message = str_replace(array("\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"), array("<", ">", "<br />", " ", ""), $message);
        $message = preg_replace('= [\s]*=i', " ", $message);
        @$doc->loadHTML($message);
 
index d888f314de1a366ac9e4ffddb600bebd8f7d94a6..b81208f3666bda612614011667979fb2fa119084 100755 (executable)
@@ -4,6 +4,8 @@ require_once('include/bbcode.php');
 require_once('include/oembed.php');
 require_once('include/salmon.php');
 require_once('include/crypto.php');
+require_once('include/Photo.php');
+
 
 function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) {
 
@@ -278,7 +280,99 @@ function construct_activity_target($item) {
        }
 
        return '';
-} 
+}
+
+/* limit_body_size()
+ *
+ *             The purpose of this function is to apply system message length limits to
+ *             imported messages without including any embedded photos in the length
+ */
+if(! function_exists('limit_body_size')) {
+function limit_body_size($body) {
+
+       logger('limit_body_size: start', LOGGER_DEBUG);
+
+       $maxlen = get_max_import_size();
+
+       // If the length of the body, including the embedded images, is smaller
+       // than the maximum, then don't waste time looking for the images
+       if($maxlen && (strlen($body) > $maxlen)) {
+
+               logger('limit_body_size: the total body length exceeds the limit', LOGGER_DEBUG);
+
+               $orig_body = $body;
+               $new_body = '';
+               $textlen = 0;
+               $max_found = false;
+
+               $img_start = strpos($orig_body, '[img');
+               $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+               $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
+               while(($img_st_close !== false) && ($img_end !== false)) {
+
+                       $img_st_close++; // make it point to AFTER the closing bracket
+                       $img_end += $img_start;
+                       $img_end += strlen('[/img]');
+
+                       if(! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
+                               // This is an embedded image
+
+                               if( ($textlen + $img_start) > $maxlen ) {
+                                       if($textlen < $maxlen) {
+                                               logger('limit_body_size: the limit happens before an embedded image', LOGGER_DEBUG);
+                                               $new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
+                                               $textlen = $maxlen;
+                                       }
+                               }
+                               else {
+                                       $new_body = $new_body . substr($orig_body, 0, $img_start);
+                                       $textlen += $img_start;
+                               }
+
+                               $new_body = $new_body . substr($orig_body, $img_start, $img_end - $img_start);
+                       }
+                       else {
+
+                               if( ($textlen + $img_end) > $maxlen ) {
+                                       if($textlen < $maxlen) {
+                                               logger('limit_body_size: the limit happens before the end of a non-embedded image', LOGGER_DEBUG);
+                                               $new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
+                                               $textlen = $maxlen;
+                                       }
+                               }
+                               else {
+                                       $new_body = $new_body . substr($orig_body, 0, $img_end);
+                                       $textlen += $img_end;
+                               }
+                       }
+                       $orig_body = substr($orig_body, $img_end);
+
+                       if($orig_body === false) // in case the body ends on a closing image tag
+                               $orig_body = '';
+
+                       $img_start = strpos($orig_body, '[img');
+                       $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+                       $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
+               }
+
+               if( ($textlen + strlen($orig_body)) > $maxlen) {
+                       if($textlen < $maxlen) {
+                               logger('limit_body_size: the limit happens after the end of the last image', LOGGER_DEBUG);
+                               $new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
+                               $textlen = $maxlen;
+                       }
+               }
+               else {
+                       logger('limit_body_size: the text size with embedded images extracted did not violate the limit', LOGGER_DEBUG);
+                       $new_body = $new_body . $orig_body;
+                       $textlen += strlen($orig_body);
+               }
+
+               return $new_body;
+       }
+       else
+               return $body;
+}}
 
 function title_is_body($title, $body) {
 
@@ -442,9 +536,8 @@ function get_atom_elements($feed,$item) {
                $res['body'] = notags(base64url_decode($res['body']));
        }
 
-       $maxlen = get_max_import_size();
-       if($maxlen && (strlen($res['body']) > $maxlen))
-               $res['body'] = substr($res['body'],0, $maxlen);
+       
+       $res['body'] = limit_body_size($res['body']);
 
        // It isn't certain at this point whether our content is plaintext or html and we'd be foolish to trust 
        // the content type. Our own network only emits text normally, though it might have been converted to 
@@ -757,6 +850,12 @@ function item_store($arr,$force_parent = false) {
        if((strpos($arr['body'],'<') !== false) || (strpos($arr['body'],'>') !== false)) 
                $arr['body'] = strip_tags($arr['body']);
 
+       require_once('Text/LanguageDetect.php');
+       $naked_body = preg_replace('/\[(.+?)\]/','',$arr['body']);
+       $l = new Text_LanguageDetect;
+       $lng = $l->detectConfidence($naked_body);
+       $arr['postopts'] = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : '');
+
 
        $arr['wall']          = ((x($arr,'wall'))          ? intval($arr['wall'])                : 0);
        $arr['uri']           = ((x($arr,'uri'))           ? notags(trim($arr['uri']))           : random_string());
@@ -825,7 +924,7 @@ function item_store($arr,$force_parent = false) {
                        if($r[0]['uri'] != $r[0]['parent-uri']) {
                                $arr['thr-parent'] = $arr['parent-uri'];
                                $arr['parent-uri'] = $r[0]['parent-uri'];
-                               $z = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `parent-uri` = '%s' AND `uid` = %d 
+                               $z = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `parent-uri` = '%s' AND `uid` = %d 
                                        ORDER BY `id` ASC LIMIT 1",
                                        dbesc($r[0]['parent-uri']),
                                        dbesc($r[0]['parent-uri']),
@@ -2304,7 +2403,8 @@ function local_delivery($importer,$data) {
                                        }
 
                                        if($item['uri'] == $item['parent-uri']) {
-                                               $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s'
+                                               $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s',
+                                                       `body` = '', `title` = ''
                                                        WHERE `parent-uri` = '%s' AND `uid` = %d",
                                                        dbesc($when),
                                                        dbesc(datetime_convert()),
@@ -2313,7 +2413,8 @@ function local_delivery($importer,$data) {
                                                );
                                        }
                                        else {
-                                               $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' 
+                                               $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s',
+                                                       `body` = '', `title` = ''
                                                        WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
                                                        dbesc($when),
                                                        dbesc(datetime_convert()),
@@ -3119,20 +3220,33 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
        return $o;
 }
 
-function fix_private_photos($s,$uid, $item = null, $cid = 0) {
+function fix_private_photos($s, $uid, $item = null, $cid = 0) {
        $a = get_app();
 
        logger('fix_private_photos', LOGGER_DEBUG);
        $site = substr($a->get_baseurl(),strpos($a->get_baseurl(),'://'));
 
-       if(preg_match("/\[img(.*?)\](.*?)\[\/img\]/is",$s,$matches)) {
-               $image = $matches[2];
+       $orig_body = $s;
+       $new_body = '';
+
+       $img_start = strpos($orig_body, '[img');
+       $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+       $img_len = ($img_start !== false ? strpos(substr($orig_body, $img_start + $img_st_close + 1), '[/img]') : false);
+       while( ($img_st_close !== false) && ($img_len !== false) ) {
+
+               $img_st_close++; // make it point to AFTER the closing bracket
+               $image = substr($orig_body, $img_start + $img_st_close, $img_len);
+
                logger('fix_private_photos: found photo ' . $image, LOGGER_DEBUG);
+
+
                if(stristr($image , $site . '/photo/')) {
+                       // Only embed locally hosted photos
                        $replace = false;
                        $i = basename($image);
                        $i = str_replace(array('.jpg','.png'),array('',''),$i);
                        $x = strpos($i,'-');
+
                        if($x) {
                                $res = substr($i,$x+1);
                                $i = substr($i,0,$x);
@@ -3150,14 +3264,6 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) {
                                        // 3. Otherwise, if we have an item, see if the item permissions match the photo
                                        //    permissions, regardless of order but first check to see if they're an exact
                                        //    match to save some processing overhead.
-                               
-                                       // Currently we only embed one private photo per message so as not to hit import 
-                                       // size limits at the receiving end.
-
-                                       // To embed multiples, we would need to parse out the embedded photos on message
-                                       // receipt and limit size based only on the text component. Would also need to
-                                       // ignore all photos during bbcode translation and item localisation, as these
-                                       // will hit internal regex backtrace limits.  
 
                                        if(has_permissions($r[0])) {
                                                if($cid) {
@@ -3172,15 +3278,45 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) {
                                                }
                                        }
                                        if($replace) {
+                                               $data = $r[0]['data'];
+                                               $type = $r[0]['type'];
+
+                                               // If a custom width and height were specified, apply before embedding
+                                               if(preg_match("/\[img\=([0-9]*)x([0-9]*)\]/is", substr($orig_body, $img_start, $img_st_close), $match)) {
+                                                       logger('fix_private_photos: scaling photo', LOGGER_DEBUG);
+
+                                                       $width = intval($match[1]);
+                                                       $height = intval($match[2]);
+
+                                                       $ph = new Photo($data, $type);
+                                                       if($ph->is_valid()) {
+                                                               $ph->scaleImage(max($width, $height));
+                                                               $data = $ph->imageString();
+                                                               $type = $ph->getType();
+                                                       }
+                                               }
+
                                                logger('fix_private_photos: replacing photo', LOGGER_DEBUG);
-                                               $s = str_replace($image, 'data:' . $r[0]['type'] . ';base64,' . base64_encode($r[0]['data']), $s);
-                                               logger('fix_private_photos: replaced: ' . $s, LOGGER_DATA);
+                                               $image = 'data:' . $type . ';base64,' . base64_encode($data);
+                                               logger('fix_private_photos: replaced: ' . $image, LOGGER_DATA);
                                        }
                                }
                        }
                }       
+
+               $new_body = $new_body . substr($orig_body, 0, $img_start + $img_st_close) . $image . '[/img]';
+               $orig_body = substr($orig_body, $img_start + $img_st_close + $img_len + strlen('[/img]'));
+               if($orig_body === false)
+                       $orig_body = '';
+
+               $img_start = strpos($orig_body, '[img');
+               $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+               $img_len = ($img_start !== false ? strpos(substr($orig_body, $img_start + $img_st_close + 1), '[/img]') : false);
        }
-       return($s);
+
+       $new_body = $new_body . $orig_body;
+
+       return($new_body);
 }
 
 
@@ -3524,7 +3660,9 @@ function posted_dates($uid,$wall) {
                $dnow = substr($dthen,0,8) . '28';
 
        $ret = array();
-       while($dnow >= $dthen) {
+       // Starting with the current month, get the first and last days of every
+       // month down to and including the month of the first post
+       while(substr($dnow, 0, 7) >= substr($dthen, 0, 7)) {
                $dstart = substr($dnow,0,8) . '01';
                $dend = substr($dnow,0,8) . get_dim(intval($dnow),intval(substr($dnow,5)));
                $start_month = datetime_convert('','',$dstart,'Y-m-d');
@@ -3583,7 +3721,7 @@ function store_diaspora_retract_sig($item, $user, $baseurl) {
        }
        else {
                $r = q("SELECT `nick`, `url` FROM `contact` WHERE `id` = '%d' LIMIT 1",
-                       $item['contact-id']
+                       $item['contact-id'] // If this function gets called, drop_item() has already checked remote_user() == $item['contact-id']
                );
                if(count($r)) {
                        // The below handle only works for NETWORK_DFRN. I think that's ok, because this function
diff --git a/include/lock.php b/include/lock.php
new file mode 100644 (file)
index 0000000..707e336
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+
+// Provide some ability to lock a PHP function so that multiple processes
+// can't run the function concurrently
+if(! function_exists('lock_function')) {
+function lock_function($fn_name, $block = true, $wait_sec = 2, $timeout = 30) {
+       if( $wait_sec == 0 )
+               $wait_sec = 2;  // don't let the user pick a value that's likely to crash the system
+
+       $got_lock = false;
+       $start = time();
+
+       do {
+               q("LOCK TABLE locks WRITE");
+               $r = q("SELECT locked FROM locks WHERE name = '%s' LIMIT 1",
+                       dbesc($fn_name)
+               );
+
+               if((count($r)) && (! $r[0]['locked'])) {
+                       q("UPDATE locks SET locked = 1 WHERE name = '%s' LIMIT 1",
+                               dbesc($fn_name)
+                       );
+                       $got_lock = true;
+               }
+               elseif(! $r) { // the Boolean value for count($r) should be equivalent to the Boolean value of $r
+                       q("INSERT INTO locks ( name, locked ) VALUES ( '%s', 1 )",
+                               dbesc($fn_name)
+                       );
+                       $got_lock = true;
+               }
+
+               q("UNLOCK TABLES");
+
+               if(($block) && (! $got_lock))
+                       sleep($wait_sec);
+
+       } while(($block) && (! $got_lock) && ((time() - $start) < $timeout));
+
+       logger('lock_function: function ' . $fn_name . ' with blocking = ' . $block . ' got_lock = ' . $got_lock . ' time = ' . (time() - $start), LOGGER_DEBUG);
+       
+       return $got_lock;
+}}
+
+
+if(! function_exists('block_on_function_lock')) {
+function block_on_function_lock($fn_name, $wait_sec = 2, $timeout = 30) {
+       if( $wait_sec == 0 )
+               $wait_sec = 2;  // don't let the user pick a value that's likely to crash the system
+
+       $start = time();
+
+       do {
+               $r = q("SELECT locked FROM locks WHERE name = '%s' LIMIT 1",
+                               dbesc($fn_name)
+                    );
+
+               if(count($r) && $r[0]['locked'])
+                       sleep($wait_sec);
+
+       } while(count($r) && $r[0]['locked'] && ((time() - $start) < $timeout));
+
+       return;
+}}
+
+
+if(! function_exists('unlock_function')) {
+function unlock_function($fn_name) {
+       $r = q("UPDATE locks SET locked = 0 WHERE name = '%s' LIMIT 1",
+                       dbesc($fn_name)
+            );
+
+       logger('unlock_function: released lock for function ' . $fn_name, LOGGER_DEBUG);
+
+       return;
+}}
index a67a8b614182f90716cfea6eb0bc140d043450e1..e26cc8889a916ebae6d1c807a6651e3e6540cd8e 100644 (file)
@@ -162,6 +162,7 @@ function nav(&$a) {
        $tpl = get_markup_template('nav.tpl');
 
        $a->page['nav'] .= replace_macros($tpl, array(
+        '$baseurl' => $a->get_baseurl(),
                '$langselector' => lang_selector(),
                '$sitelocation' => $sitelocation,
                '$nav' => $nav,
index d69454899a7438673d301c552644fc273aae54e3..a95dde535c9fa967156b28806f9c508b9ed1b064 100644 (file)
@@ -605,6 +605,9 @@ function validate_url(&$url) {
 if(! function_exists('validate_email')) {
 function validate_email($addr) {
 
+       if(get_config('system','disable_email_validation'))
+               return true;
+
        if(! strpos($addr,'@'))
                return false;
        $h = substr($addr,strpos($addr,'@') + 1);
index 7e92705be27db7e639c547b8a6c2a45853aeef96..ba3babe70dd3c4538876dc691dba385edebfafc6 100644 (file)
@@ -161,7 +161,7 @@ function queue_run($argv, $argc){
                        case NETWORK_DIASPORA:
                                if($contact['notify']) {
                                        logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name']);
-                                       $deliver_status = diaspora_transmit($owner,$contact,$data,$public);
+                                       $deliver_status = diaspora_transmit($owner,$contact,$data,$public,true);
 
                                        if($deliver_status == (-1))
                                                update_queue_time($q_item['id']);
old mode 100755 (executable)
new mode 100644 (file)
index 3b0050d387a559c93fc391f59c27fc775f5b98e7..409d40d59f6155a6a5533e986ff7a29b99ea9329 100644 (file)
@@ -656,6 +656,10 @@ function search($s,$id='search-box',$url='/search',$save = false) {
 
 if(! function_exists('valid_email')) {
 function valid_email($x){
+
+       if(get_config('system','disable_email_validation'))
+               return true;
+
        if(preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/',$x))
                return true;
        return false;
@@ -1533,7 +1537,6 @@ function undo_post_tagging($s) {
 
 function fix_mce_lf($s) {
        $s = str_replace("\r\n","\n",$s);
-       $s = str_replace("\n\n","\n",$s);
        return $s;
 }
 
index 383a3b3e1cf76fe7a9ba484b5443d7e9c2071130..039b30bbd10ef7eee76be202f58cd5b93e5476cf 100644 (file)
@@ -99,11 +99,11 @@ function create_user($arr) {
 
 
        if(! allowed_email($email))
-                       $result['message'] .= t('Your email domain is not among those allowed on this site.') . EOL;
+               $result['message'] .= t('Your email domain is not among those allowed on this site.') . EOL;
 
        if((! valid_email($email)) || (! validate_email($email)))
                $result['message'] .= t('Not a valid email address.') . EOL;
-
+               
        // Disallow somebody creating an account using openid that uses the admin email address,
        // since openid bypasses email verification. We'll allow it if there is not yet an admin account.
 
index 885e042aa34b5e0e8f9e11bbcbc141c5cf365aae..a5ce894601e312e8a422adc1e31fb716c093636d 100644 (file)
        function dolike(ident,verb) {
                unpause();
                $('#like-rotator-' + ident.toString()).show();
-               $.get('like/' + ident.toString() + '?verb=' + verb );
-               if(timer) clearTimeout(timer);
-               timer = setTimeout(NavUpdate,3000);
+               $.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
+//             if(timer) clearTimeout(timer);
+//             timer = setTimeout(NavUpdate,3000);
                liking = 1;
        }
 
diff --git a/library/Smarty/COPYING.lib b/library/Smarty/COPYING.lib
new file mode 100644 (file)
index 0000000..02bbb60
--- /dev/null
@@ -0,0 +1,165 @@
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
\ No newline at end of file
diff --git a/library/Smarty/README b/library/Smarty/README
new file mode 100644 (file)
index 0000000..1674628
--- /dev/null
@@ -0,0 +1,574 @@
+Smarty 3.1.11
+
+Author: Monte Ohrt <monte at ohrt dot com >
+Author: Uwe Tews
+
+AN INTRODUCTION TO SMARTY 3
+
+NOTICE FOR 3.1 release:
+
+Please see the SMARTY_3.1_NOTES.txt file that comes with the distribution.
+
+NOTICE for 3.0.5 release:
+
+Smarty now follows the PHP error_reporting level by default. If PHP does not mask E_NOTICE and you try to access an unset template variable, you will now get an E_NOTICE warning. To revert to the old behavior:
+
+$smarty->error_reporting = E_ALL & ~E_NOTICE;
+
+NOTICE for 3.0 release:
+
+IMPORTANT: Some API adjustments have been made between the RC4 and 3.0 release.
+We felt it is better to make these now instead of after a 3.0 release, then have to
+immediately deprecate APIs in 3.1. Online documentation has been updated
+to reflect these changes. Specifically:
+
+---- API CHANGES RC4 -> 3.0 ----
+
+$smarty->register->*
+$smarty->unregister->*
+$smarty->utility->*
+$samrty->cache->*
+
+Have all been changed to local method calls such as:
+
+$smarty->clearAllCache()
+$smarty->registerFoo()
+$smarty->unregisterFoo()
+$smarty->testInstall()
+etc.
+
+Registration of function, block, compiler, and modifier plugins have been
+consolidated under two API calls:
+
+$smarty->registerPlugin(...)
+$smarty->unregisterPlugin(...)
+
+Registration of pre, post, output and variable filters have been
+consolidated under two API calls:
+
+$smarty->registerFilter(...)
+$smarty->unregisterFilter(...)
+
+Please refer to the online documentation for all specific changes:
+
+http://www.smarty.net/documentation
+
+----
+
+The Smarty 3 API has been refactored to a syntax geared
+for consistency and modularity. The Smarty 2 API syntax is still supported, but
+will throw a deprecation notice. You can disable the notices, but it is highly
+recommended to adjust your syntax to Smarty 3, as the Smarty 2 syntax must run
+through an extra rerouting wrapper.
+
+Basically, all Smarty methods now follow the "fooBarBaz" camel case syntax. Also,
+all Smarty properties now have getters and setters. So for example, the property
+$smarty->cache_dir can be set with $smarty->setCacheDir('foo/') and can be
+retrieved with $smarty->getCacheDir().
+
+Some of the Smarty 3 APIs have been revoked such as the "is*" methods that were
+just duplicate functions of the now available "get*" methods.
+
+Here is a rundown of the Smarty 3 API:
+
+$smarty->fetch($template, $cache_id = null, $compile_id = null, $parent = null)
+$smarty->display($template, $cache_id = null, $compile_id = null, $parent = null)
+$smarty->isCached($template, $cache_id = null, $compile_id = null)
+$smarty->createData($parent = null)
+$smarty->createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
+$smarty->enableSecurity()
+$smarty->disableSecurity()
+$smarty->setTemplateDir($template_dir)
+$smarty->addTemplateDir($template_dir)
+$smarty->templateExists($resource_name)
+$smarty->loadPlugin($plugin_name, $check = true)
+$smarty->loadFilter($type, $name)
+$smarty->setExceptionHandler($handler)
+$smarty->addPluginsDir($plugins_dir)
+$smarty->getGlobal($varname = null)
+$smarty->getRegisteredObject($name)
+$smarty->getDebugTemplate()
+$smarty->setDebugTemplate($tpl_name)
+$smarty->assign($tpl_var, $value = null, $nocache = false)
+$smarty->assignGlobal($varname, $value = null, $nocache = false)
+$smarty->assignByRef($tpl_var, &$value, $nocache = false)
+$smarty->append($tpl_var, $value = null, $merge = false, $nocache = false)
+$smarty->appendByRef($tpl_var, &$value, $merge = false)
+$smarty->clearAssign($tpl_var)
+$smarty->clearAllAssign()
+$smarty->configLoad($config_file, $sections = null)
+$smarty->getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true)
+$smarty->getConfigVariable($variable)
+$smarty->getStreamVariable($variable)
+$smarty->getConfigVars($varname = null)
+$smarty->clearConfig($varname = null)
+$smarty->getTemplateVars($varname = null, $_ptr = null, $search_parents = true)
+$smarty->clearAllCache($exp_time = null, $type = null)
+$smarty->clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)
+
+$smarty->registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = array())
+
+$smarty->registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
+
+$smarty->registerFilter($type, $function_name)
+$smarty->registerResource($resource_type, $function_names)
+$smarty->registerDefaultPluginHandler($function_name)
+$smarty->registerDefaultTemplateHandler($function_name)
+
+$smarty->unregisterPlugin($type, $tag)
+$smarty->unregisterObject($object_name)
+$smarty->unregisterFilter($type, $function_name)
+$smarty->unregisterResource($resource_type)
+
+$smarty->compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
+$smarty->clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)
+$smarty->testInstall()
+
+// then all the getters/setters, available for all properties. Here are a few:
+
+$caching = $smarty->getCaching();      // get $smarty->caching
+$smarty->setCaching(true);             // set $smarty->caching
+$smarty->setDeprecationNotices(false); // set $smarty->deprecation_notices
+$smarty->setCacheId($id);              // set $smarty->cache_id
+$debugging = $smarty->getDebugging();  // get $smarty->debugging
+
+
+FILE STRUCTURE
+
+The Smarty 3 file structure is similar to Smarty 2:
+
+/libs/
+  Smarty.class.php
+/libs/sysplugins/
+  internal.*
+/libs/plugins/
+  function.mailto.php
+  modifier.escape.php
+  ...
+
+A lot of Smarty 3 core functionality lies in the sysplugins directory; you do
+not need to change any files here. The /libs/plugins/ folder is where Smarty
+plugins are located. You can add your own here, or create a separate plugin
+directory, just the same as Smarty 2. You will still need to create your own
+/cache/, /templates/, /templates_c/, /configs/ folders. Be sure /cache/ and
+/templates_c/ are writable.
+
+The typical way to use Smarty 3 should also look familiar:
+
+require('Smarty.class.php');
+$smarty = new Smarty;
+$smarty->assign('foo','bar');
+$smarty->display('index.tpl');
+
+
+However, Smarty 3 works completely different on the inside. Smarty 3 is mostly
+backward compatible with Smarty 2, except for the following items:
+
+*) Smarty 3 is PHP 5 only. It will not work with PHP 4.
+*) The {php} tag is disabled by default. Enable with $smarty->allow_php_tag=true.
+*) Delimiters surrounded by whitespace are no longer treated as Smarty tags.
+   Therefore, { foo } will not compile as a tag, you must use {foo}. This change
+   Makes Javascript/CSS easier to work with, eliminating the need for {literal}.
+   This can be disabled by setting $smarty->auto_literal = false;
+*) The Smarty 3 API is a bit different. Many Smarty 2 API calls are deprecated
+   but still work. You will want to update your calls to Smarty 3 for maximum
+   efficiency.
+
+
+There are many things that are new to Smarty 3. Here are the notable items:
+   
+LEXER/PARSER
+============
+
+Smarty 3 now uses a lexing tokenizer for its parser/compiler. Basically, this
+means Smarty has some syntax additions that make life easier such as in-template
+math, shorter/intuitive function parameter options, infinite function recursion,
+more accurate error handling, etc.
+
+
+WHAT IS NEW IN SMARTY TEMPLATE SYNTAX
+=====================================
+
+Smarty 3 allows expressions almost anywhere. Expressions can include PHP
+functions as long as they are not disabled by the security policy, object
+methods and properties, etc. The {math} plugin is no longer necessary but
+is still supported for BC.
+
+Examples:
+{$x+$y}                           will output the sum of x and y.
+{$foo = strlen($bar)}             function in assignment
+{assign var=foo value= $x+$y}     in attributes 
+{$foo = myfunct( ($x+$y)*3 )}     as function parameter 
+{$foo[$x+3]}                      as array index
+
+Smarty tags can be used as values within other tags.
+Example:  {$foo={counter}+3}
+
+Smarty tags can also be used inside double quoted strings.
+Example:  {$foo="this is message {counter}"}
+
+You can define arrays within templates.
+Examples:
+{assign var=foo value=[1,2,3]}
+{assign var=foo value=['y'=>'yellow','b'=>'blue']}
+Arrays can be nested.
+{assign var=foo value=[1,[9,8],3]}
+
+There is a new short syntax supported for assigning variables.
+Example: {$foo=$bar+2}
+
+You can assign a value to a specific array element. If the variable exists but
+is not an array, it is converted to an array before the new values are assigned.
+Examples:
+{$foo['bar']=1}
+{$foo['bar']['blar']=1}
+
+You can append values to an array. If the variable exists but is not an array,
+it is converted to an array before the new values are assigned.
+Example: {$foo[]=1}
+
+You can use a PHP-like syntax for accessing array elements, as well as the
+original "dot" notation.
+Examples:
+{$foo[1]}             normal access
+{$foo['bar']}
+{$foo['bar'][1]}
+{$foo[$x+$x]}         index may contain any expression
+{$foo[$bar[1]]}       nested index
+{$foo[section_name]}  smarty section access, not array access!
+
+The original "dot" notation stays, and with improvements.
+Examples:
+{$foo.a.b.c}        =>  $foo['a']['b']['c'] 
+{$foo.a.$b.c}       =>  $foo['a'][$b]['c']        with variable index
+{$foo.a.{$b+4}.c}   =>  $foo['a'][$b+4]['c']       with expression as index
+{$foo.a.{$b.c}}     =>  $foo['a'][$b['c']]         with nested index
+
+note that { and } are used to address ambiguties when nesting the dot syntax. 
+
+Variable names themselves can be variable and contain expressions.
+Examples:
+$foo         normal variable
+$foo_{$bar}  variable name containing other variable 
+$foo_{$x+$y} variable name containing expressions 
+$foo_{$bar}_buh_{$blar}  variable name with multiple segments
+{$foo_{$x}}  will output the variable $foo_1 if $x has a value of 1.
+
+Object method chaining is implemented.
+Example: {$object->method1($x)->method2($y)}
+
+{for} tag added for looping (replacement for {section} tag):
+{for $x=0, $y=count($foo); $x<$y; $x++}  ....  {/for}
+Any number of statements can be used separated by comma as the first
+inital expression at {for}.
+
+{for $x = $start to $end step $step} ... {/for}is in the SVN now .
+You can use also
+{for $x = $start to $end} ... {/for}
+In this case the step value will be automaticall 1 or -1 depending on the start and end values.
+Instead of $start and $end you can use any valid expression.
+Inside the loop the following special vars can be accessed:
+$x@iteration = number of iteration
+$x@total = total number of iterations
+$x@first = true on first iteration
+$x@last = true on last iteration
+
+
+The Smarty 2 {section} syntax is still supported.
+
+New shorter {foreach} syntax to loop over an array.
+Example: {foreach $myarray as $var}...{/foreach}
+
+Within the foreach loop, properties are access via:
+
+$var@key            foreach $var array key
+$var@iteration      foreach current iteration count (1,2,3...)
+$var@index          foreach current index count (0,1,2...)
+$var@total          foreach $var array total
+$var@first          true on first iteration
+$var@last           true on last iteration
+
+The Smarty 2 {foreach} tag syntax is still supported.
+
+NOTE: {$bar[foo]} still indicates a variable inside of a {section} named foo. 
+If you want to access an array element with index foo, you must use quotes
+such as {$bar['foo']}, or use the dot syntax {$bar.foo}.
+
+while block tag is now implemented:
+{while $foo}...{/while}
+{while $x lt 10}...{/while}
+
+Direct access to PHP functions:
+Just as you can use PHP functions as modifiers directly, you can now access
+PHP functions directly, provided they are permitted by security settings:
+{time()}
+
+There is a new {function}...{/function} block tag to implement a template function.
+This enables reuse of code sequences like a plugin function. It can call itself recursively.
+Template function must be called with the new {call name=foo...} tag.
+
+Example:
+
+Template file:
+{function name=menu level=0}
+  <ul class="level{$level}">
+  {foreach $data as $entry}
+    {if is_array($entry)}
+      <li>{$entry@key}</li>
+       {call name=menu data=$entry level=$level+1}
+    {else}
+      <li>{$entry}</li>
+    {/if}
+  {/foreach}
+  </ul>
+{/function}
+
+{$menu = ['item1','item2','item3' => ['item3-1','item3-2','item3-3' =>
+  ['item3-3-1','item3-3-2']],'item4']}
+
+{call name=menu data=$menu}
+
+
+Generated output:
+    * item1
+    * item2
+    * item3
+          o item3-1
+          o item3-2
+          o item3-3
+                + item3-3-1
+                + item3-3-2
+    * item4
+
+The function tag itself must have the "name" attribute. This name is the tag
+name when calling the function. The function tag may have any number of
+additional attributes. These will be default settings for local variables.
+
+New {nocache} block function:
+{nocache}...{/nocache} will declare a section of the template to be non-cached
+when template caching is enabled.
+
+New nocache attribute:
+You can declare variable/function output as non-cached with the nocache attribute.
+Examples:
+
+{$foo nocache=true}
+{$foo nocache} /* same */
+
+{foo bar="baz" nocache=true}
+{foo bar="baz" nocache} /* same */
+
+{time() nocache=true}
+{time() nocache} /* same */
+
+Or you can also assign the variable in your script as nocache:
+$smarty->assign('foo',$something,true); // third param is nocache setting
+{$foo} /* non-cached */
+
+$smarty.current_dir returns the directory name of the current template.
+
+You can use strings directly as templates with the "string" resource type.
+Examples:
+$smarty->display('string:This is my template, {$foo}!'); // php
+{include file="string:This is my template, {$foo}!"} // template
+
+
+
+VARIABLE SCOPE / VARIABLE STORAGE
+=================================
+
+In Smarty 2, all assigned variables were stored within the Smarty object. 
+Therefore, all variables assigned in PHP were accessible by all subsequent 
+fetch and display template calls.
+
+In Smarty 3, we have the choice to assign variables to the main Smarty object, 
+to user-created data objects, and to user-created template objects. 
+These objects can be chained. The object at the end of a chain can access all
+variables belonging to that template and all variables within the parent objects.
+The Smarty object can only be the root of a chain, but a chain can be isolated
+from the Smarty object.
+
+All known Smarty assignment interfaces will work on the data and template objects.
+
+Besides the above mentioned objects, there is also a special storage area for
+global variables.
+
+A Smarty data object can be created as follows:
+$data = $smarty->createData();    // create root data object
+$data->assign('foo','bar');       // assign variables as usual
+$data->config_load('my.conf');                                                                  // load config file    
+
+$data= $smarty->createData($smarty);  // create data object having a parent link to
+the Smarty object
+
+$data2= $smarty->createData($data);   // create data object having a parent link to
+the $data data object
+
+A template object can be created by using the createTemplate method. It has the
+same parameter assignments as the fetch() or display() method.
+Function definition:
+function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
+
+The first parameter can be a template name, a smarty object or a data object.
+
+Examples:
+$tpl = $smarty->createTemplate('mytpl.tpl'); // create template object not linked to any parent
+$tpl->assign('foo','bar');                   // directly assign variables
+$tpl->config_load('my.conf');                                                                   // load config file    
+
+$tpl = $smarty->createTemplate('mytpl.tpl',$smarty);  // create template having a parent link to the Smarty object
+$tpl = $smarty->createTemplate('mytpl.tpl',$data);    // create template having a parent link to the $data object
+
+The standard fetch() and display() methods will implicitly create a template object.
+If the $parent parameter is not specified in these method calls, the template object
+is will link back to the Smarty object as it's parent.
+
+If a template is called by an {include...} tag from another template, the
+subtemplate links back to the calling template as it's parent. 
+
+All variables assigned locally or from a parent template are accessible. If the
+template creates or modifies a variable by using the {assign var=foo...} or
+{$foo=...} tags, these new values are only known locally (local scope). When the
+template exits, none of the new variables or modifications can be seen in the
+parent template(s). This is same behavior as in Smarty 2. 
+
+With Smarty 3, we can assign variables with a scope attribute which allows the
+availablility of these new variables or modifications globally (ie in the parent
+templates.)
+
+Possible scopes are local, parent, root and global. 
+Examples:
+{assign var=foo value='bar'}       // no scope is specified, the default 'local'
+{$foo='bar'}                       // same, local scope
+{assign var=foo value='bar' scope='local'} // same, local scope
+
+{assign var=foo value='bar' scope='parent'} // Values will be available to the parent object 
+{$foo='bar' scope='parent'}                 // (normally the calling template)
+
+{assign var=foo value='bar' scope='root'}   // Values will be exported up to the root object, so they can 
+{$foo='bar' scope='root'}                   // be seen from all templates using the same root.
+
+{assign var=foo value='bar' scope='global'} // Values will be exported to global variable storage, 
+{$foo='bar' scope='global'}                 // they are available to any and all templates.
+
+
+The scope attribute can also be attached to the {include...} tag. In this case,
+the specified scope will be the default scope for all assignments within the
+included template.
+
+
+PLUGINS
+=======
+
+Smarty3 are following the same coding rules as in Smarty2. 
+The only difference is that the template object is passed as additional third parameter.
+
+smarty_plugintype_name (array $params, object $smarty, object $template)
+
+The Smarty 2 plugins are still compatible as long as they do not make use of specific Smarty2 internals.
+
+
+TEMPLATE INHERITANCE:
+=====================
+
+With template inheritance you can define blocks, which are areas that can be
+overriden by child templates, so your templates could look like this: 
+
+parent.tpl:
+<html>
+  <head>
+    <title>{block name='title'}My site name{/block}</title>
+  </head>
+  <body>
+    <h1>{block name='page-title'}Default page title{/block}</h1>
+    <div id="content">
+      {block name='content'}
+        Default content
+      {/block}
+    </div>
+  </body>
+</html>
+
+child.tpl:
+{extends file='parent.tpl'} 
+{block name='title'}
+Child title
+{/block}
+
+grandchild.tpl:
+{extends file='child.tpl'} 
+{block name='title'}Home - {$smarty.block.parent}{/block} 
+{block name='page-title'}My home{/block}
+{block name='content'}
+  {foreach $images as $img}
+    <img src="{$img.url}" alt="{$img.description}" />
+  {/foreach}
+{/block}
+
+We redefined all the blocks here, however in the title block we used {$smarty.block.parent},
+which tells Smarty to insert the default content from the parent template in its place.
+The content block was overriden to display the image files, and page-title has also be 
+overriden to display a completely different title. 
+
+If we render grandchild.tpl we will get this: 
+<html>
+  <head>
+    <title>Home - Child title</title>
+  </head>
+  <body>
+    <h1>My home</h1>
+    <div id="content">
+      <img src="/example.jpg" alt="image" />
+      <img src="/example2.jpg" alt="image" />
+      <img src="/example3.jpg" alt="image" />
+    </div>
+  </body>
+</html>
+
+NOTE: In the child templates everything outside the {extends} or {block} tag sections
+is ignored.
+
+The inheritance tree can be as big as you want (meaning you can extend a file that 
+extends another one that extends another one and so on..), but be aware that all files 
+have to be checked for modifications at runtime so the more inheritance the more overhead you add.
+
+Instead of defining the parent/child relationships with the {extends} tag in the child template you
+can use the resource as follow:
+
+$smarty->display('extends:parent.tpl|child.tpl|grandchild.tpl');
+
+Child {block} tags may optionally have a append or prepend attribute. In this case the parent block content 
+is appended or prepended to the child block content.
+
+{block name='title' append} My title {/block}
+
+
+PHP STREAMS:
+============
+
+(see online documentation)
+
+VARIBLE FILTERS:
+================
+
+(see online documentation)
+
+
+STATIC CLASS ACCESS AND NAMESPACE SUPPORT
+=========================================
+
+You can register a class with optional namespace for the use in the template like:
+
+$smarty->register->templateClass('foo','name\name2\myclass');
+
+In the template you can use it like this:
+{foo::method()}  etc.
+
+
+=======================
+
+Please look through it and send any questions/suggestions/etc to the forums.
+
+http://www.phpinsider.com/smarty-forum/viewtopic.php?t=14168
+
+Monte and Uwe
diff --git a/library/Smarty/SMARTY_2_BC_NOTES.txt b/library/Smarty/SMARTY_2_BC_NOTES.txt
new file mode 100644 (file)
index 0000000..79a2cb1
--- /dev/null
@@ -0,0 +1,109 @@
+= Known incompatibilities with Smarty 2 =
+
+== Syntax ==
+
+Smarty 3 API has a new syntax. Much of the Smarty 2 syntax is supported 
+by a wrapper but deprecated. See the README that comes with Smarty 3 for more 
+information.
+
+The {$array|@mod} syntax has always been a bit confusing, where an "@" is required
+to apply a modifier to an array instead of the individual elements. Normally you
+always want the modifier to apply to the variable regardless of its type. In Smarty 3,
+{$array|mod} and {$array|@mod} behave identical. It is safe to drop the "@" and the
+modifier will still apply to the array. If you really want the modifier to apply to
+each array element, you must loop the array in-template, or use a custom modifier that
+supports array iteration. Most smarty functions already escape values where necessary
+such as {html_options}
+
+== PHP Version ==
+Smarty 3 is PHP 5 only. It will not work with PHP 4.
+
+== {php} Tag ==
+The {php} tag is disabled by default. The use of {php} tags is
+deprecated. It can be enabled with $smarty->allow_php_tag=true.
+
+But if you scatter PHP code which belongs together into several
+{php} tags it may not work any longer.
+
+== Delimiters and whitespace ==
+Delimiters surrounded by whitespace are no longer treated as Smarty tags.
+Therefore, { foo } will not compile as a tag, you must use {foo}. This change
+Makes Javascript/CSS easier to work with, eliminating the need for {literal}.
+This can be disabled by setting $smarty->auto_literal = false;
+
+== Unquoted Strings ==
+Smarty 2 was a bit more forgiving (and ambiguous) when it comes to unquoted strings 
+in parameters. Smarty3 is more restrictive. You can still pass strings without quotes 
+so long as they contain no special characters. (anything outside of A-Za-z0-9_) 
+
+For example filename strings must be quoted
+<source lang="smarty">
+{include file='path/foo.tpl'}
+</source>
+
+== Extending the Smarty class ==
+Smarty 3 makes use of the __construct method for initialization. If you are extending 
+the Smarty class, its constructor is not called implicitly if the your child class defines 
+its own constructor. In order to run Smarty's constructor, a call to parent::__construct() 
+within your child constructor is required. 
+
+<source lang="php">
+class MySmarty extends Smarty {
+   function __construct() {
+       parent::__construct();
+    
+       // your initialization code goes here
+
+   }
+}
+</source>
+
+== Autoloader ==
+Smarty 3 does register its own autoloader with spl_autoload_register. If your code has 
+an existing __autoload function then this function must be explicitly registered on 
+the __autoload stack. See http://us3.php.net/manual/en/function.spl-autoload-register.php 
+for further details.
+
+== Plugin Filenames ==
+Smarty 3 optionally supports the PHP spl_autoloader. The autoloader requires filenames 
+to be lower case. Because of this, Smarty plugin file names must also be lowercase. 
+In Smarty 2, mixed case file names did work.
+
+== Scope of Special Smarty Variables ==
+In Smarty 2 the special Smarty variables $smarty.section... and $smarty.foreach... 
+had global scope. If you had loops with the same name in subtemplates you could accidentally 
+overwrite values of parent template.
+
+In Smarty 3 these special Smarty variable have only local scope in the template which 
+is defining the loop. If you need their value in a subtemplate you have to pass them 
+as parameter.
+<source lang="smarty">
+{include file='path/foo.tpl' index=$smarty.section.foo.index}
+</source>
+
+== SMARTY_RESOURCE_CHAR_SET ==
+Smarty 3 sets the constant SMARTY_RESOURCE_CHAR_SET to utf-8 as default template charset. 
+This is now used also on modifiers like escape as default charset. If your templates use 
+other charsets make sure that you define the constant accordingly. Otherwise you may not 
+get any output.
+
+== newline at {if} tags ==
+A \n was added to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source. 
+If one of the {if} tags is at the line end you will now get a newline in the HTML output.
+
+== trigger_error() ==
+The API function trigger_error() has been removed because it did just map to PHP trigger_error.
+However it's still included in the Smarty2 API wrapper.
+
+== Smarty constants ==
+The constants 
+SMARTY_PHP_PASSTHRU
+SMARTY_PHP_QUOTE
+SMARTY_PHP_REMOVE
+SMARTY_PHP_ALLOW
+have been replaced with class constants
+Smarty::PHP_PASSTHRU
+Smarty::PHP_QUOTE
+Smarty::PHP_REMOVE
+Smarty::PHP_ALLOW
+
diff --git a/library/Smarty/SMARTY_3.0_BC_NOTES.txt b/library/Smarty/SMARTY_3.0_BC_NOTES.txt
new file mode 100644 (file)
index 0000000..fd8b540
--- /dev/null
@@ -0,0 +1,24 @@
+== Smarty2 backward compatibility ==
+All Smarty2 specific API functions and deprecated functionallity has been moved
+to the SmartyBC class.
+
+== {php} Tag ==
+The {php} tag is no longer available in the standard Smarty calls. 
+The use of {php} tags is deprecated and only available in the SmartyBC class. 
+
+== {include_php} Tag ==
+The {include_php} tag is no longer available in the standard Smarty calls. 
+The use of {include_php} tags is deprecated and only available in the SmartyBC class. 
+
+== php template resource ==
+The support of the php template resource is removed.
+
+== $cache_dir, $compile_dir, $config_dir, $template_dir access ==
+The mentioned properties can't be accessed directly any longer. You must use
+corresponding getter/setters like addConfigDir(), setConfigDir(), getConfigDir()
+
+== obsolete Smarty class properties ==
+The following no longer used properties are removed:
+$allow_php_tag
+$allow_php_template
+$deprecation_notices
\ No newline at end of file
diff --git a/library/Smarty/SMARTY_3.1_NOTES.txt b/library/Smarty/SMARTY_3.1_NOTES.txt
new file mode 100644 (file)
index 0000000..e56e56f
--- /dev/null
@@ -0,0 +1,306 @@
+Smarty 3.1 Notes
+================
+
+Smarty 3.1 is a departure from 2.0 compatibility. Most notably, all
+backward compatibility has been moved to a separate class file named
+SmartyBC.class.php. If you require compatibility with 2.0, you will
+need to use this class.
+
+Some differences from 3.0 are also present. 3.1 begins the journey of
+requiring setters/getters for property access. So far this is only
+implemented on the five directory properties: template_dir,
+plugins_dir, configs_dir, compile_dir and cache_dir. These properties
+are now protected, it is required to use the setters/getters instead.
+That said, direct property access will still work, however slightly
+slower since they will now fall through __set() and __get() and in
+turn passed through the setter/getter methods. 3.2 will exhibit a full
+list of setter/getter methods for all (currently) public properties,
+so code-completion in your IDE will work as expected.
+
+There is absolutely no PHP allowed in templates any more. All
+deprecated features of Smarty 2.0 are gone. Again, use the SmartyBC
+class if you need any backward compatibility.
+
+Internal Changes
+
+  Full UTF-8 Compatibility
+
+The plugins shipped with Smarty 3.1 have been rewritten to fully
+support UTF-8 strings if Multibyte String is available. Without
+MBString UTF-8 cannot be handled properly. For those rare cases where
+templates themselves have to juggle encodings, the new modifiers
+to_charset and from_charset may come in handy.
+
+  Plugin API and Performance
+
+All Plugins (modifiers, functions, blocks, resources,
+default_template_handlers, etc) are now receiving the
+Smarty_Internal_Template instance, where they were supplied with the
+Smarty instance in Smarty 3.0. *. As The Smarty_Internal_Template
+mimics the behavior of Smarty, this API simplification should not
+require any changes to custom plugins.
+
+The plugins shipped with Smarty 3.1 have been rewritten for better
+performance. Most notably {html_select_date} and {html_select_time}
+have been improved vastly. Performance aside, plugins have also been
+reviewed and generalized in their API. {html_select_date} and
+{html_select_time} now share almost all available options.
+
+The escape modifier now knows the $double_encode option, which will
+prevent entities from being encoded again.
+
+The capitalize modifier now know the $lc_rest option, which makes sure
+all letters following a captial letter are lower-cased.
+
+The count_sentences modifier now accepts (.?!) as
+legitimate endings of a sentence - previously only (.) was
+accepted
+
+The new unescape modifier is there to reverse the effects of the
+escape modifier. This applies to the escape formats html, htmlall and
+entity.
+
+  default_template_handler_func
+
+The invocation of $smarty->$default_template_handler_func had to be 
+altered. Instead of a Smarty_Internal_Template, the fifth argument is
+now provided with the Smarty instance. New footprint:
+
+
+/**
+ * Default Template Handler
+ *
+ * called when Smarty's file: resource is unable to load a requested file
+ * 
+ * @param string   $type     resource type (e.g. "file", "string", "eval", "resource")
+ * @param string   $name     resource name (e.g. "foo/bar.tpl")
+ * @param string  &$content  template's content
+ * @param integer &$modified template's modification time
+ * @param Smarty   $smarty   Smarty instance
+ * @return string|boolean   path to file or boolean true if $content and $modified 
+ *                          have been filled, boolean false if no default template 
+ *                          could be loaded
+ */
+function default_template_handler_func($type, $name, &$content, &$modified, Smarty $smarty) {
+    if (false) {
+        // return corrected filepath
+        return "/tmp/some/foobar.tpl";
+    } elseif (false) {
+        // return a template directly
+        $content = "the template source";
+        $modified = time();
+        return true;
+    } else {
+        // tell smarty that we failed
+        return false;
+    }
+}
+
+  Stuff done to the compiler
+
+Many performance improvements have happened internally. One notable
+improvement is that all compiled templates are now handled as PHP
+functions. This speeds up repeated templates tremendously, as each one
+calls an (in-memory) PHP function instead of performing another file
+include/scan.
+
+New Features
+
+  Template syntax
+
+ {block}..{/block}
+
+The {block} tag has a new hide option flag. It does suppress the block
+content if no corresponding child block exists.
+EXAMPLE:
+parent.tpl
+{block name=body hide} child content "{$smarty.block.child}" was
+inserted {block}
+In the above example the whole block will be suppressed if no child
+block "body" is existing.
+
+ {setfilter}..{/setfilter}
+
+The new {setfilter} block tag allows the definition of filters which
+run on variable output.
+SYNTAX:
+{setfilter filter1|filter2|filter3....}
+Smarty3 will lookup up matching filters in the following search order:
+1. varibale filter plugin in plugins_dir.
+2. a valid modifier. A modifier specification will also accept
+additional parameter like filter2:'foo'
+3. a PHP function
+{/setfilter} will turn previous filter setting off again.
+{setfilter} tags can be nested.
+EXAMPLE:
+{setfilter filter1}
+  {$foo}
+  {setfilter filter2}
+    {$bar}
+  {/setfilter}
+  {$buh}
+{/setfilter}
+{$blar}
+In the above example filter1 will run on the output of $foo, filter2
+on $bar, filter1 again on $buh and no filter on $blar.
+NOTES:
+- {$foo nofilter} will suppress the filters
+- These filters will run in addition to filters defined by
+registerFilter('variable',...), autoLoadFilter('variable',...) and
+defined default modifier.
+- {setfilter} will effect only the current template, not included
+subtemplates.
+
+  Resource API
+
+Smarty 3.1 features a new approach to resource management. The
+Smarty_Resource API allows simple, yet powerful integration of custom
+resources for templates and configuration files. It offers simple
+functions for loading data from a custom resource (e.g. database) as
+well as define new template types adhering to the special
+non-compiling (e,g, plain php) and non-compile-caching (e.g. eval:
+resource type) resources.
+
+See demo/plugins/resource.mysql.php for an example custom database
+resource.
+
+Note that old-fashioned registration of callbacks for resource
+management has been deprecated but is still possible with SmartyBC.
+
+  CacheResource API
+
+In line with the Resource API, the CacheResource API offers a more
+comfortable handling of output-cache data. With the
+Smarty_CacheResource_Custom accessing databases is made simple. With
+the introduction of Smarty_CacheResource_KeyValueStore the
+implementation of resources like memcache or APC became a no-brainer;
+simple hash-based storage systems are now supporting hierarchical
+output-caches.
+
+See demo/plugins/cacheresource.mysql.php for an example custom
+database CacheResource.
+See demo/plugins/cacheresource.memcache.php for an example custom
+memcache CacheResource using the KeyValueStore helper.
+
+Note that old-fashioned registration of $cache_handler is not possible
+anymore. As the functionality had not been ported to Smarty 3.0.x
+properly, it has been dropped from 3.1 completely.
+
+Locking facilities have been implemented to avoid concurrent cache 
+generation. Enable cache locking by setting 
+$smarty->cache_locking = true;
+
+  Relative Paths in Templates (File-Resource)
+
+As of Smarty 3.1 {include file="../foo.tpl"} and {include
+file="./foo.tpl"} will resolve relative to the template they're in.
+Relative paths are available with {include file="..."} and
+{extends file="..."}. As $smarty->fetch('../foo.tpl') and
+$smarty->fetch('./foo.tpl') cannot be relative to a template, an
+exception is thrown.
+
+  Adressing a specific $template_dir
+
+Smarty 3.1 introduces the $template_dir index notation.
+$smarty->fetch('[foo]bar.tpl') and {include file="[foo]bar.tpl"}
+require the template bar.tpl to be loaded from $template_dir['foo'];
+Smarty::setTemplateDir() and Smarty::addTemplateDir() offer ways to
+define indexes along with the actual directories.
+
+  Mixing Resources in extends-Resource
+
+Taking the php extends: template resource one step further, it is now
+possible to mix resources within an extends: call like
+$smarty->fetch("extends:file:foo.tpl|db:bar.tpl");
+
+To make eval: and string: resources available to the inheritance
+chain, eval:base64:TPL_STRING and eval:urlencode:TPL_STRING have been
+introduced. Supplying the base64 or urlencode flags will trigger
+decoding the TPL_STRING in with either base64_decode() or urldecode().
+
+  extends-Resource in template inheritance
+
+Template based inheritance may now inherit from php's extends:
+resource like {extends file="extends:foo.tpl|db:bar.tpl"}.
+
+  New Smarty property escape_html
+
+$smarty->escape_html = true will autoescape all template variable
+output by calling htmlspecialchars({$output}, ENT_QUOTES,
+SMARTY_RESOURCE_CHAR_SET).
+NOTE:
+This is a compile time option. If you change the setting you must make
+sure that the templates get recompiled.
+
+  New option at Smarty property compile_check
+
+The automatic recompilation of modified templates can now be
+controlled by the following settings:
+$smarty->compile_check = COMPILECHECK_OFF (false) - template files
+will not be checked
+$smarty->compile_check = COMPILECHECK_ON (true) - template files will
+always be checked
+$smarty->compile_check = COMPILECHECK_CACHEMISS - template files will
+be checked if caching is enabled and there is no existing cache file
+or it has expired
+
+  Automatic recompilation on Smarty version change
+
+Templates will now be automatically recompiled on Smarty version
+changes to avoide incompatibillities in the compiled code. Compiled
+template checked against the current setting of the SMARTY_VERSION
+constant.
+
+  default_config_handler_func()
+
+Analogous to the default_template_handler_func()
+default_config_handler_func() has been introduced.
+
+  default_plugin_handler_func()
+
+An optional default_plugin_handler_func() can be defined which gets called 
+by the compiler on tags which can't be resolved internally or by plugins.
+The default_plugin_handler() can map tags to plugins on the fly.
+
+New getters/setters
+
+The following setters/getters will be part of the official
+documentation, and will be strongly recommended. Direct property
+access will still work for the foreseeable future... it will be
+transparently routed through the setters/getters, and consequently a
+bit slower.
+
+array|string getTemplateDir( [string $index] )
+replaces $smarty->template_dir; and $smarty->template_dir[$index];
+Smarty setTemplateDir( array|string $path )
+replaces $smarty->template_dir = "foo"; and $smarty->template_dir =
+array("foo", "bar");
+Smarty addTemplateDir( array|string $path, [string $index])
+replaces $smarty->template_dir[] = "bar"; and
+$smarty->template_dir[$index] = "bar";
+
+array|string getConfigDir( [string $index] )
+replaces $smarty->config_dir; and $smarty->config_dir[$index];
+Smarty setConfigDir( array|string $path )
+replaces $smarty->config_dir = "foo"; and $smarty->config_dir =
+array("foo", "bar");
+Smarty addConfigDir( array|string $path, [string $index])
+replaces $smarty->config_dir[] = "bar"; and
+$smarty->config_dir[$index] = "bar";
+
+array getPluginsDir()
+replaces $smarty->plugins_dir;
+Smarty setPluginsDir( array|string $path )
+replaces $smarty->plugins_dir = "foo";
+Smarty addPluginsDir( array|string $path )
+replaces $smarty->plugins_dir[] = "bar";
+
+string getCompileDir()
+replaces $smarty->compile_dir;
+Smarty setCompileDir( string $path )
+replaces $smarty->compile_dir = "foo";
+
+string getCacheDir()
+replaces $smarty->cache_dir;
+Smarty setCacheDir( string $path )
+replaces $smarty->cache_dir;
diff --git a/library/Smarty/change_log.txt b/library/Smarty/change_log.txt
new file mode 100644 (file)
index 0000000..27c506d
--- /dev/null
@@ -0,0 +1,2078 @@
+===== trunk  =====
+===== Smarty-3.1.11  =====
+30.06.2012
+- bugfix {block.. hide} did not work as nested child (Forum Topic 22216)
+
+25.06.2012
+- bugfix the default plugin handler did not allow static class methods for modifier (issue 85)
+
+24.06.2012
+- bugfix escape modifier support for PHP < 5.2.3 (Forum Topic 21176)
+
+11.06.2012
+- bugfix the patch for Topic 21856 did break tabs between tag attributes (Forum Topic 22124)
+
+===== Smarty-3.1.10  =====
+09.06.2012
+- bugfix the compiler did ignore registered compiler plugins for closing tags (Forum Topic 22094)
+- bugfix the patch for Topic 21856 did break multiline tags (Forum Topic 22124)
+
+===== Smarty-3.1.9 =====
+07.06.2012
+- bugfix fetch() and display() with relative paths (Issue 104)
+- bugfix treat "0000-00-00" as 0 in modifier.date_format (Issue 103)
+
+24.05.2012
+- bugfix Smarty_Internal_Write_File::writeFile() could cause race-conditions on linux systems (Issue 101)
+- bugfix attribute parameter names of plugins may now contain also "-"  and ":"  (Forum Topic 21856)
+- bugfix add compile_id to cache key of of source (Issue 97)
+
+22.05.2012
+- bugfix recursive {include} within {section} did fail (Smarty developer group)
+
+12.05.2012
+- bugfix {html_options} did not properly escape values (Issue 98)
+
+03.05.2012
+- bugfix make HTTP protocall version variable (issue 96)
+
+02.05.2012
+- bugfix  {nocache}{block}{plugin}... did produce wrong compiled code when caching is disabled (Forum Topic 21572, issue 95)
+
+12.04.2012
+- bugfix Smarty did eat the linebreak after the <?xml...?> closing tag (Issue 93)
+- bugfix concurrent cache updates could create a warning (Forum Topic 21403)
+
+08.04.2012
+- bugfix "\\" was not escaped correctly when generating nocache code (Forum Topic 21364)
+
+30.03.2012
+- bugfix template inheritance did  not throw exception when a parent template was deleted (issue 90)
+
+27.03.2012
+- bugfix prefilter did run multiple times on inline subtemplates compiled into several main templates (Forum Topic 21325)
+- bugfix implement Smarty2's behaviour of variables assigned by reference in SmartyBC. {assign} will affect all references.
+  (issue 88)
+
+21.03.2012
+- bugfix compileAllTemplates() and compileAllConfig() did not return the number of compiled files (Forum Topic 21286)
+
+13.03.2012
+- correction of yesterdays bugfix (Forum Topic 21175 and 21182)
+
+12.03.2012
+- bugfix a double quoted string of "$foo" did not compile into PHP "$foo" (Forum Topic 21175)
+- bugfix template inheritance did set $merge_compiled_includes globally true
+
+03.03.2012
+- optimization of compiling speed when same modifier was used several times
+
+02.03.2012
+- enhancement the default plugin handler can now also resolve undefined modifier (Smarty::PLUGIN_MODIFIER)
+  (Issue 85)
+
+===== Smarty-3.1.8  =====
+19.02.2012
+- bugfix {include} could result in a fatal error if used in appended or prepended nested {block} tags
+  (reported by mh and Issue 83)
+- enhancement added Smarty special variable $smarty.template_object to return the current template object (Forum Topic 20289)
+
+
+07.02.2012
+- bugfix increase entropy of internal function names in compiled and cached template files (Forum Topic 20996)
+- enhancement cacheable parameter added to default plugin handler, same functionality as in registerPlugin (request by calguy1000)
+
+06.02.2012
+- improvement stream_resolve_include_path() added to Smarty_Internal_Get_Include_Path (Forum Topic 20980)
+- bugfix fetch('extends:foo.tpl') always yielded $source->exists == true (Forum Topic 20980)
+- added modifier unescape:"url", fix (Forum Topic 20980)
+- improvement replaced some calls of preg_replace with str_replace (Issue 73)
+
+30.01.2012
+- bugfix Smarty_Security internal $_resource_dir cache wasn't properly propagated
+
+27.01.2012
+- bugfix Smarty did not a template name of "0" (Forum Topic 20895)
+
+20.01.2012
+- bugfix typo in Smarty_Internal_Get_IncludePath did cause runtime overhead (Issue 74)
+- improvment remove unneeded assigments (Issue 75 and 76)
+- fixed typo in template parser
+- bugfix output filter must not run before writing cache when template does contain nocache code (Issue 71)
+
+02.01.2012
+- bugfix {block foo nocache} did not load plugins within child {block} in nocache mode (Forum Topic 20753)
+
+29.12.2011
+- bugfix enable more entropy in Smarty_Internal_Write_File for "more uniqueness" and Cygwin compatibility (Forum Topic 20724)
+- bugfix embedded quotes in single quoted strings did not compile correctly in {nocache} sections (Forum Topic 20730)
+
+28.12.2011
+- bugfix Smarty's internal header code must be excluded from postfilters (issue 71)
+
+22.12.2011
+- bugfix the new lexer of 17.12.2011 did fail if mbstring.func_overload != 0 (issue 70) (Forum Topic 20680)
+- bugfix template inheritace did fail if mbstring.func_overload != 0 (issue 70) (Forum Topic 20680)
+
+20.12.2011
+- bugfix template inheritance: {$smarty.block.child} in nested child {block} tags did not return 
+  content after {$smarty.block.child} (Forum Topic 20564)
+
+===== Smarty-3.1.7 =====
+18.12.2011
+- bugfix strings ending with " in multiline strings of config files failed to compile (issue #67)
+- added chaining to Smarty_Internal_Templatebase
+- changed unloadFilter() to not return a boolean in favor of chaining and API conformity
+- bugfix unregisterObject() raised notice when object to unregister did not exist
+- changed internals to use Smarty::$_MBSTRING ($_CHARSET, $_DATE_FORMAT) for better unit testing
+- added Smarty::$_UTF8_MODIFIER for proper PCRE charset handling (Forum Topic 20452)
+- added Smarty_Security::isTrustedUri() and Smarty_Security::$trusted_uri to validate 
+  remote resource calls through {fetch} and {html_image} (Forum Topic 20627)
+
+17.12.2011
+- improvement of compiling speed by new handling of plain text blocks in the lexer/parser (issue #68)
+
+16.12.2011
+- bugfix the source exits flag and timestamp was not setup when template was in php include path (issue #69)
+
+9.12.2011
+- bugfix {capture} tags around recursive {include} calls did throw exception (Forum Topic 20549)
+- bugfix $auto_literal = false did not work with { block} tags in child templates (Forum Topic 20581)
+- bugfix template inheritance: do not include code of {include} in overloaded {block} into compiled 
+  parent template (Issue #66}
+- bugfix template inheritance: {$smarty.block.child} in nested child {block} tags did not return expected
+  result (Forum Topic 20564)
+    
+===== Smarty-3.1.6  =====
+30.11.2011
+- bugfix is_cache() for individual cached subtemplates with $smarty->caching = CACHING_OFF did produce
+  an exception (Forum Topic 20531)
+
+29.11.2011
+- bugfix added exception if the default plugin handler did return a not static callback (Forum Topic 20512)
+
+25.11.2011
+- bugfix {html_select_date} and {html_slecet_time} did not default to current time if "time" was not specified 
+  since r4432 (issue 60)
+
+24.11.2011
+- bugfix a subtemplate later used as main template did use old variable values
+
+21.11.2011
+- bugfix cache file could include unneeded modifier plugins under certain condition
+
+18.11.2011
+- bugfix declare all directory properties private to map direct access to getter/setter also on extended Smarty class
+
+16.11.2011
+- bugfix Smarty_Resource::load() did not always return a proper resource handler (Forum Topic 20414)
+- added escape argument to html_checkboxes and html_radios (Forum Topic 20425)
+
+===== Smarty-3.1.5  =====
+14.11.2011
+- bugfix allow space between function name and open bracket (forum topic 20375)
+
+09.11.2011
+- bugfix different behaviour of uniqid() on cygwin. See https://bugs.php.net/bug.php?id=34908
+  (forum topic 20343)
+
+01.11.2011
+- bugfix {if} and {while} tags without condition did not throw a SmartyCompilerException (Issue #57)
+- bugfix multiline strings in config files could fail on longer strings (reopened Issue #55)
+
+22.10.2011
+- bugfix smarty_mb_from_unicode() would not decode unicode-points properly
+- bugfix use catch Exception instead UnexpectedValueException in 
+  clearCompiledTemplate to be PHP 5.2 compatible
+
+21.10.2011
+- bugfix apostrophe in plugins_dir path name failed (forum topic 20199)
+- improvement sha1() for array keys longer than 150 characters
+- add Smarty::$allow_ambiguous_resources to activate unique resource handling (Forum Topic 20128)
+
+20.10.2011
+- @silenced unlink() in Smarty_Internal_Write_File since debuggers go haywire without it.
+- bugfix Smarty::clearCompiledTemplate() threw an Exception if $cache_id was not present in $compile_dir when $use_sub_dirs = true.
+- bugfix {html_select_date} and {html_select_time} did not properly handle empty time arguments (Forum Topic 20190)
+- improvement removed unnecessary sha1()
+
+19.10.2011
+- revert PHP4 constructor message
+- fixed PHP4 constructor message
+
+===== Smarty-3.1.4 =====
+19.10.2011
+- added exception when using PHP4 style constructor
+
+16.10.2011
+- bugfix testInstall() did not propery check cache_dir and compile_dir
+
+15.10.2011
+- bugfix Smarty_Resource and Smarty_CacheResource runtime caching (Forum Post 75264)
+
+14.10.2011
+- bugfix unique_resource did not properly apply to compiled resources (Forum Topic 20128)
+- add locking to custom resources (Forum Post 75252)
+- add Smarty_Internal_Template::clearCache() to accompany isCached() fetch() etc.
+
+13.10.2011
+- add caching for config files in Smarty_Resource
+- bugfix disable of caching after isCached() call did not work (Forum Topic 20131)
+- add concept unique_resource to combat potentially ambiguous template_resource values when custom resource handlers are used (Forum Topic 20128)
+- bugfix multiline strings in config files could fail on longer strings (Issue #55)
+
+11.10.2011
+- add runtime checks for not matching {capture}/{/capture} calls (Forum Topic 20120)
+10.10.2011
+- bugfix variable name typo in {html_options} and {html_checkboxes} (Issue #54)
+- bugfix <?xml> tag did create wrong output when caching enabled and the tag was in included subtemplate
+- bugfix Smarty_CacheResource_mysql example was missing strtotime() calls
+
+===== Smarty-3.1.3  =====
+07.10.2011
+- improvement removed html comments from {mailto} (Forum Topic 20092)
+- bugfix testInstall() would not show path to internal plugins_dir (Forum Post 74627)
+- improvement testInstall() now showing resolved paths and checking the include_path if necessary
+- bugfix html_options plugin did not handle object values properly (Issue #49, Forum Topic 20049)
+- improvement html_checkboxes and html_radios to accept null- and object values, and label_ids attribute
+- improvement removed some unnecessary count()s
+- bugfix parent pointer was not set when fetch() for other template was called on template object
+
+06.10.2011
+- bugfix switch lexer internals depending on mbstring.func_overload
+- bugfix start_year and end_year of {html_select_date} did not use current year as offset base (Issue #53)
+
+05.10.2011
+- bugfix of problem introduced with r4342 by replacing strlen() with isset()
+- add environment configuration issue with mbstring.func_overload Smarty cannot compensate for (Issue #45)
+- bugfix nofilter tag option did not disable default modifier
+- bugfix html_options plugin did not handle null- and object values properly (Issue #49, Forum Topic 20049)
+
+04.10.2011
+- bugfix assign() in plugins called in subtemplates did change value also in parent template
+- bugfix of problem introduced with r4342 on math plugin 
+- bugfix output filter should not run on individually cached subtemplates
+- add unloadFilter() method
+- bugfix has_nocache_code flag was not reset before compilation
+
+===== Smarty-3.1.2  =====
+03.10.2011
+- improvement add internal $joined_template_dir property instead computing it on the fly several times
+
+01.10.2011
+- improvement replaced most in_array() calls by more efficient isset() on array_flip()ed haystacks
+- improvement replaced some strlen($foo) > 3 calls by isset($foo[3])
+- improvement Smarty_Internal_Utility::clearCompiledTemplate() removed redundant strlen()s
+
+29.09.2011
+- improvement of Smarty_Internal_Config::loadConfigVars() dropped the in_array for index look up
+
+28.09.2011
+- bugfix on template functions called nocache calling other template functions
+
+27.09.2011
+- bugfix possible warning "attempt to modify property of non-object" in {section} (issue #34)
+- added chaining to Smarty_Internal_Data so $smarty->assign('a',1)->assign('b',2); is possible now
+- bugfix remove race condition when a custom resource did change timestamp during compilation
+- bugfix variable property did not work on objects variable in template
+- bugfix smarty_make_timestamp() failed to process DateTime objects properly
+- bugfix wrong resource could be used on compile check of custom resource
+
+26.09.2011
+- bugfix repeated calls to same subtemplate did not make use of cached template object
+
+24.09.2011
+- removed internal muteExpectedErrors() calls in favor of having the implementor call this once from his application
+- optimized muteExpectedErrors() to pass errors to the latest registered error handler, if appliccable
+- added compile_dir and cache_dir to list of muted directories
+- improvment better error message for undefined templates at {include}
+
+23.09.2011
+- remove unused properties
+- optimization use real function instead anonymous function for preg_replace_callback
+- bugfix a relative {include} in child template blocks failed
+- bugfix direct setting of $template_dir, $config_dir, $plugins_dir in __construct() of an 
+  extended Smarty class created problems
+- bugfix error muting was not implemented for cache locking
+
+===== Smarty 3.1.1  =====
+22.09.2011
+- bugfix {foreachelse} does fail if {section} was nested inside {foreach}
+- bugfix debug.tpl did not display correctly when it was compiled with escape_html = true
+
+21.09.2011
+- bugfix look for mixed case plugin file names as in 3.0 if not found try all lowercase
+- added $error_muting to suppress error messages even for badly implemented error_handlers
+- optimized autoloader
+- reverted ./ and ../ handling in fetch() and display() - they're allowed again
+
+20.09.2011
+- bugfix removed debug echo output while compiling template inheritance
+- bugfix relative paths in $template_dir broke relative path resolving in {include "../foo.tpl"}
+- bugfix {include} did not work inside nested {block} tags
+- bugfix {assign} with scope root and global did not work in all cases
+
+19.09.2011
+- bugfix regression in Smarty_CacheReource_KeyValueStore introduced by r4261
+- bugfix output filter shall not run on included subtemplates
+
+18.09.2011
+- bugfix template caching did not care about file.tpl in different template_dir
+- bugfix {include $file} was broken when merge_compiled_incluges = true
+- bugfix {include} was broken when merge_compiled_incluges = true and same indluded template
+  was used in different main templates in one compilation run
+- bugfix for Smarty2 style compiler plugins on unnamed attribute passing like {tag $foo $bar}
+- bugfix debug.tpl did not display correctly when it was compiled with escape_html = true
+
+17.09.2011
+- bugfix lock_id for file resource would create invalid filepath
+- bugfix resource caching did not care about file.tpl in different template_dir
+
+===== Smarty 3.1.0  =====
+15/09/2011
+- optimization of {foreach}; call internal _count() method only when "total" or "last" {foreach} properties are used
+
+11/09/2011
+- added  unregisterObject() method
+
+06/09/2011
+- bugfix  isset() did not work in templates on config variables
+
+03/09/2011
+- bugfix createTemplate() must default to cache_id and compile_id of Smarty object
+- bugfix Smarty_CacheResource_KeyValueStore must include $source->uid in cache filepath to keep templates with same
+  name but different folders seperated
+- added cacheresource.apc.php example in demo folder
+
+02/09/2011
+- bugfix cache lock file must use absolute filepath
+
+01/09/2011
+- update of cache locking
+
+30/08/2011
+- added locking mechanism to CacheResource API (implemented with File and KeyValueStores)
+
+28/08/2011
+- bugfix clearCompileTemplate() did not work for specific template subfolder or resource
+
+27/08/2011
+- bugfix {$foo|bar+1} did create syntax error
+
+26/08/2011
+- bugfix when generating nocache code which contains double \
+- bugfix handle race condition if cache file was deleted between filemtime and include
+
+17/08/2011
+- bugfix CacheResource_Custom bad internal fetch() call
+
+15/08/2011
+- bugfix CacheResource would load content twice for KeyValueStore and Custom handlers
+
+06/08/2011
+- bugfix {include} with scope attribute could execute in wrong scope
+- optimization of compile_check processing
+
+03/08/2011
+- allow comment tags to comment {block} tags out in child templates
+
+26/07/2011
+- bugfix experimental getTags() method did not work
+
+24/07/2011
+- sure opened output buffers are closed on exception
+- bugfix {foreach} did not work on IteratorAggregate
+
+22/07/2011
+- clear internal caches on clearAllCache(), clearCache(), clearCompiledTemplate()
+
+21/07/2011
+- bugfix value changes of variable values assigned to Smarty object could not be seen on repeated $smarty->fetch() calls
+
+17/07/2011
+- bugfix {$smarty.block.child} did drop a notice at undefined child
+
+15/07/2011
+- bugfix individual cache_lifetime of {include} did not work correctly inside {block} tags
+- added caches for Smarty_Template_Source and Smarty_Template_Compiled to reduce I/O for multiple cache_id rendering
+
+14/07/2011
+- made Smarty::loadPlugin() respect the include_path if required
+
+13/07/2011
+- optimized internal file write functionality
+- bugfix PHP did eat line break on nocache sections
+- fixed typo of Smarty_Security properties $allowed_modifiers and $disabled_modifiers
+
+06/07/2011
+- bugfix variable modifier must run befor gereral filtering/escaping
+
+04/07/2011
+- bugfix use (?P<name>) syntax at preg_match as some pcre libraries failed on (?<name>)
+- some performance improvement when using generic getter/setter on template objects
+
+30/06/2011
+- bugfix generic getter/setter of Smarty properties used on template objects did throw exception
+- removed is_dir and is_readable checks from directory setters for better performance
+
+28/06/2011
+- added back support of php template resource as undocumented feature
+- bugfix automatic recompilation on version change could drop undefined index notice on old 3.0 cache and compiled files
+- update of README_3_1_DEV.txt and moved into the distribution folder
+- improvement show first characters of eval and string templates instead sha1 Uid in debug window
+
+===== Smarty 3.1-RC1 =====
+25/06/2011
+- revert change of 17/06/2011. $_smarty varibale removed. call loadPlugin() from inside plugin code if required
+- code cleanup, remove no longer used properties and methods
+- update of PHPdoc comments
+
+23/06/2011
+- bugfix {html_select_date} would not respect current time zone
+
+19/06/2011
+- added $errors argument to testInstall() functions to suppress output.
+- added plugin-file checks to testInstall()
+
+18/06/2011
+- bugfix mixed use of same subtemplate inline and not inline in same script could cause a warning during compilation
+
+17/06/2011
+- bugfix/change use $_smarty->loadPlugin() when loading nested depending plugins via loadPlugin
+- bugfix {include ... inline} within {block}...{/block} did fail
+
+16/06/2011
+- bugfix do not overwrite '$smarty' template variable when {include ... scope=parent} is called
+- bugfix complete empty inline subtemplates did fail
+
+15/06/2011
+- bugfix template variables where not accessable within inline subtemplates
+
+12/06/2011
+- bugfix removed unneeded merging of template variable when fetching includled subtemplates
+
+10/06/2011
+- made protected properties $template_dir, $plugins_dir, $cache_dir, $compile_dir, $config_dir accessible via magic methods
+
+09/06/2011
+- fix smarty security_policy issue in plugins {html_image} and {fetch}
+
+05/06/2011
+- update of SMARTY_VERSION
+- bugfix made getTags() working again
+
+04/06/2011
+- allow extends resource in file attribute of {extends} tag
+
+03/06/2011
+- added {setfilter} tag to set filters for variable output
+- added escape_html property to control autoescaping of variable output
+
+27/05/2011
+- added allowed/disabled tags and modifiers in security for sandboxing
+
+23/05/2011
+- added base64: and urlencode: arguments to eval and string resource types
+
+22/05/2011
+- made time-attribute of {html_select_date} and {html_select_time} accept arrays as defined by attributes prefix and field_array
+
+13/05/2011
+- remove setOption / getOption calls from SamrtyBC class
+
+02/05/2011
+- removed experimental setOption() getOption() methods
+- output returned content also on opening tag calls of block plugins
+- rewrite of default plugin handler
+- compile code of variable filters for better performance 
+
+20/04/2011
+- allow {php} {include_php} tags and PHP_ALLOW handling only with the SmartyBC class
+- removed support of php template resource
+
+20/04/2011
+- added extendsall resource example
+- optimization of template variable access
+- optimization of subtemplate handling {include}
+- optimization of template class
+
+01/04/2011
+- bugfix quote handling in capitalize modifier
+
+28/03/2011
+- bugfix stripslashes() requried when using PCRE e-modifier
+
+04/03/2011
+- upgrade to new PHP_LexerGenerator version 0.4.0 for better performance
+
+27/02/2011
+- ignore .svn folders when clearing cache and compiled files
+- string resources do not need a modify check
+
+26/02/2011
+- replaced smarty_internal_wrapper by SmartyBC class
+- load utility functions as static methods instead through __call()
+- bugfix in extends resource when subresources are used
+- optimization of modify checks
+
+25/02/2011
+- use $smarty->error_unassigned to control NOTICE handling on unassigned variables
+
+21/02/2011
+- added new new compile_check mode COMPILECHECK_CACHEMISS
+- corrected new cloning behaviour of createTemplate()
+- do no longer store the compiler object as property in the compile_tag classes to avoid possible memory leaks 
+  during compilation
+
+19/02/2011
+- optimizations on merge_compiled_includes handling
+- a couple of optimizations and bugfixes related to new resource structure
+
+17/02/2011
+- changed ./ and ../ behaviour
+
+14/02/2011
+- added {block ... hide} option to supress block if no child is defined
+
+13/02/2011
+- update handling of recursive subtemplate calls
+- bugfix replace $smarty->triggerError() by exception in smarty_internal_resource_extends.php
+
+12/02/2011
+- new class Smarty_Internal_TemplateBase with shared methods of Smarty and Template objects
+- optimizations of template processing
+- made register... methods permanet
+- code for default_plugin_handler
+- add automatic recompilation at version change
+
+04/02/2011
+- change in Smarty_CacheResource_Custom
+- bugfix cache_lifetime did not compile correctly at {include} after last update
+- moved isCached processing into CacheResource class
+- bugfix new CacheResource API did not work with disabled compile_check
+
+03/02/2011
+- handle template content as function to improve speed on multiple calls of same subtemplate and isCached()/display() calls
+- bugfixes and improvents in the new resource API
+- optimizations of template class code
+
+25/01/2011
+- optimized function html_select_time
+
+22/01/2011
+- added Smarty::$use_include_path configuration directive for Resource API
+
+21/01/2011
+- optimized function html_select_date
+
+19/01/2011
+- optimized outputfilter trimwhitespace
+
+18/01/2011
+- bugfix Config to use Smarty_Resource to fetch sources
+- optimized Smarty_Security's isTrustedDir() and isTrustedPHPDir()
+
+17/01/2011
+- bugfix HTTP headers for CGI SAPIs
+
+16/01/2011
+- optimized internals of Smarty_Resource and Smarty_CacheResource
+
+14/01/2011
+- added modifiercompiler escape to improve performance of escaping html, htmlall, url, urlpathinfo, quotes, javascript
+- added support to choose template_dir to load from: [index]filename.tpl
+
+12/01/2011
+- added unencode modifier to revert results of encode modifier
+- added to_charset and from_charset modifier for character encoding
+
+11/01/2011
+- added SMARTY_MBSTRING to generalize MBString detection
+- added argument $lc_rest to modifier.capitalize to lower-case anything but the first character of a word
+- changed strip modifier to consider unicode white-space, too
+- changed wordwrap modifier to accept UTF-8 strings
+- changed count_sentences modifier to consider unicode characters and treat sequences delimited by ? and ! as sentences, too
+- added argument $double_encode to modifier.escape (applies to html and htmlall only)
+- changed escape modifier to be UTF-8 compliant
+- changed textformat block to be UTF-8 compliant
+- optimized performance of mailto function
+- fixed spacify modifier so characters are not prepended and appended, made it unicode compatible
+- fixed truncate modifier to properly use mb_string if possible
+- removed UTF-8 frenzy from count_characters modifier
+- fixed count_words modifier to treat "hello-world" as a single word like str_count_words() does
+- removed UTF-8 frenzy from upper modifier
+- removed UTF-8 frenzy from lower modifier
+
+01/01/2011
+- optimize smarty_modified_escape for hex, hexentity, decentity.
+
+28/12/2010
+- changed $tpl_vars, $config_vars and $parent to belong to Smarty_Internal_Data
+- added Smarty::registerCacheResource() for dynamic cache resource object registration
+
+27/12/2010
+- added Smarty_CacheResource API and refactored existing cache resources accordingly
+- added Smarty_CacheResource_Custom and Smarty_CacheResource_Mysql
+
+26/12/2010
+- added Smarty_Resource API and refactored existing resources accordingly
+- added Smarty_Resource_Custom and Smarty_Resource_Mysql
+- bugfix Smarty::createTemplate() to return properly cloned template instances
+
+24/12/2010
+- optimize smarty_function_escape_special_chars() for PHP >= 5.2.3
+
+===== SVN 3.0 trunk  =====
+14/05/2011
+- bugfix error handling at stream resources
+
+13/05/2011
+- bugfix condition starting with "-" did fail at {if} and {while} tags
+
+22/04/2011
+- bugfix allow only fixed string as file attribute at {extends} tag
+
+01/04/2011
+- bugfix do not run filters and default modifier when displaying the debug template
+- bugfix of embedded double quotes within multi line strings (""")
+
+29/03/2011
+- bugfix on error message in smarty_internal_compile_block.php
+- bugfix mb handling in strip modifier
+- bugfix for Smarty2 style registered compiler function on unnamed attribute passing like {tag $foo $bar}
+
+17/03/2011
+- bugfix on default {function} parameters when {function} was used in nocache sections
+- bugfix on compiler object destruction. compiler_object property was by mistake unset.
+
+09/03/2011
+-bugfix a variable filter should run before modifers on an output tag (see change of 23/07/2010)
+
+08/03/2011
+- bugfix loading config file without section should load only defaults
+
+03/03/2011
+- bugfix "smarty" template variable was not recreated when cached templated had expired
+- bugfix internal rendered_content must be cleared after subtemplate was included
+
+01/03/2011
+- bugfix replace modifier did not work in 3.0.7 on systems without multibyte support
+- bugfix {$smarty.template} could return in 3.0.7 parent template name instead of 
+         child name when it needed to compile
+
+25/02/2011
+- bugfix for Smarty2 style compiler plugins on unnamed attribute passing like {tag $foo $bar}
+
+24/02/2011
+- bugfix $smarty->clearCache('some.tpl') did by mistake cache the template object
+
+18/02/2011
+- bugfix removed possible race condition when isCached() was called for an individually cached subtemplate
+- bugfix force default debug.tpl to be loaded by the file resource
+
+17/02/2011
+-improvement not to delete files starting with '.' from cache and template_c folders on clearCompiledTemplate() and clearCache()
+
+16/02/2011
+-fixed typo in exception message of Smarty_Internal_Template
+-improvement allow leading spaces on } tag closing if auto_literal is enabled
+
+13/02/2011
+- bufix replace $smarty->triggerError() by exception
+- removed obsolete {popup_init..} plugin from demo templates
+- bugfix replace $smarty->triggerError() by exception in smarty_internal_resource_extends.php
+
+===== Smarty 3.0.7  =====
+09/02/2011
+- patched vulnerability when using {$smarty.template}
+
+01/02/2011
+- removed assert() from config and template parser
+
+31/01/2011
+- bugfix the lexer/parser did fail on special characters like VT
+
+16/01/2011
+-bugfix of ArrayAccess object handling in internal _count() method
+-bugfix of Iterator object handling in internal _count() method
+
+14/01/2011
+-bugfix removed memory leak while processing compileAllTemplates
+
+12/01/2011
+- bugfix in {if} and {while} tag compiler when using assignments as condition and nocache mode
+
+10/01/2011
+- bugfix when using {$smarty.block.child} and name of {block} was in double quoted string
+- bugfix updateParentVariables() was called twice when leaving {include} processing
+
+- bugfix mb_str_replace in replace and escape modifiers work with utf8
+
+31/12/2010
+- bugfix dynamic configuration of $debugging_crtl did not work
+- bugfix default value of $config_read_hidden changed to false
+- bugfix format of attribute array on compiler plugins
+- bugfix getTemplateVars() could return value from wrong scope
+
+28/12/2010
+- bugfix multiple {append} tags failed to compile.
+
+22/12/2010
+- update do not clone the Smarty object an internal createTemplate() calls to increase performance
+
+21/12/2010
+- update html_options to support class and id attrs
+
+17/12/2010
+- bugfix added missing support of $cache_attrs for registered plugins
+
+15/12/2010
+- bugfix assignment as condition in {while} did drop an E_NOTICE
+
+14/12/2010
+- bugfix when passing an array as default parameter at {function} tag
+
+13/12/2010
+- bugfix {$smarty.template} in child template did not return right content
+- bugfix Smarty3 did not search the PHP include_path for template files
+
+===== Smarty 3.0.6  =====
+
+12/12/2010
+- bugfix fixed typo regarding yesterdays change to allow streamWrapper
+
+11/12/2010
+- bugfix nested block tags in template inheritance child templates did not work correctly
+- bugfix {$smarty.current_dir} in child template did not point to dir of child template
+- bugfix changed code when writing temporary compiled files to allow stream_wrapper
+
+06/12/2010
+- bugfix getTemplateVars() should return 'null' instead dropping E_NOTICE on an unassigned variable
+
+05/12/2010
+- bugfix missing declaration of $smarty in Smarty class
+- bugfix empty($foo) in {if} did drop a notice when $foo was not assigned
+
+01/12/2010
+- improvement of {debug} tag output
+
+27/11/2010
+-change run output filter before cache file is written. (same as in Smarty2)
+
+24/11/2011
+-bugfix on parser at  !$foo|modifier
+-change parser logic when assignments used as condition in {if] and {while} to allow assign to array element
+
+23/11/2011
+-bugfix allow integer as attribute name in plugin calls
+-change  trimm whitespace from error message, removed long list of expected tokens
+
+22/11/2010
+- bugfix on template inheritance when an {extends} tag was inserted by a prefilter
+- added error message for illegal variable file attributes at {extends...} tags
+
+===== Smarty 3.0.5  =====
+
+
+19/11/2010
+- bugfix on block plugins with modifiers
+
+18/11/2010
+- change on handling of unassigned template variable -- default will drop E_NOTICE
+- bugfix on Smarty2 wrapper load_filter() did not work
+
+17/11/2010
+- bugfix on {call} with variable function name
+- bugfix on {block} if name did contain '-'
+- bugfix in function.fetch.php , referece to undefined $smarty
+
+16/11/2010
+- bugfix whitespace in front of "<?php" in smarty_internal_compile_private_block_plugin.php
+- bugfix {$smarty.now} did compile incorrectly
+- bugfix on reset(),end(),next(),prev(),current() within templates
+- bugfix on default parameter for {function}
+
+15/11/2010
+- bugfix when using {$smarty.session} as object
+- bugfix scoping problem on $smarty object passed to filters
+- bugfix captured content could not be accessed globally
+- bugfix Smarty2 wrapper functions could not be call from within plugins
+
+===== Smarty 3.0.4  =====
+
+14/11/2010
+- bugfix isset() did not allow multiple parameter
+- improvment of some error messages
+- bugfix html_image did use removed property $request_use_auto_globals
+- small performace patch in Smarty class
+
+13/11/2010
+- bugfix  overloading problem when $smarty->fetch()/display() have been used in plugins
+                               (introduced with 3.0.2)
+- code cleanup
+                                                               
+===== Smarty 3.0.3  =====
+
+13/11/2010
+- bugfix on {debug}
+- reverted location of loadPlugin() to Smarty class
+- fixed comments in plugins
+- fixed internal_config (removed unwanted code line)
+- improvement  remove last linebreak from {function} definition
+
+===== Smarty 3.0.2  =====
+
+12/11/2010
+- reactivated $error_reporting property handling
+- fixed typo in compile_continue
+- fixed security in {fetch} plugin
+- changed back plugin parameters to two. second is template object 
+  with transparent access to Smarty object
+- fixed {config_load} scoping form compile time to run time
+
+===== Smarty 3.0.0  =====
+
+
+
+11/11/2010
+- major update including some API changes
+
+10/11/2010
+- observe compile_id also for config files
+
+09/11/2010
+-bugfix on  complex expressions as start value for {for} tag
+request_use_auto_globals
+04/11/2010
+- bugfix do not allow access of dynamic and private object members of assigned objects when
+  security is enabled.
+
+01/11/2010
+- bugfix related to E_NOTICE change.  {if empty($foo)} did fail when $foo contained a string 
+
+28/10/2010
+- bugfix on compiling modifiers within $smarty special vars like {$smarty.post.{$foo|lower}}
+
+27/10/2010
+- bugfix default parameter values did not work for template functions included with {include}
+
+25/10/2010
+- bugfix for E_NOTICE change, array elements did not work as modifier parameter
+
+20/10/2010
+- bugfix for the E_NOTICE change
+
+19/10/2010
+- change Smarty does no longer mask out E_NOTICE by default during template processing
+
+13/10/2010
+- bugfix removed ambiguity between ternary and stream variable in template syntax
+- bugfix use caching properties of template instead of smarty object when compiling child {block}
+- bugfix {*block}...{/block*} did throw an exception in template inheritance
+- bugfix on template inheritance using nested eval or string resource in {extends} tags
+- bugfix on output buffer handling in isCached() method
+
+=====  RC4 =====
+
+01/10/2010
+- added {break} and {continue} tags for flow control of {foreach},{section},{for} and {while} loops
+- change of 'string' resource. It's no longer evaluated and compiled files are now stored
+- new 'eval' resource which evaluates a template without saving the compiled file
+- change in isCached() method to allow multiple calls for the same template
+
+25/09/2010
+- bugfix on some compiling modifiers
+
+24/09/2010
+- bugfix merge_compiled_includes flag was not restored correctly in {block} tag
+
+22/09/2010
+- bugfix on default modifier
+
+18/09/2010
+- bugfix untility compileAllConfig() did not create sha1 code for compiled template file names if template_dir was defined with no trailing DS
+- bugfix on templateExists() for extends resource
+
+17/09/2010
+- bugfix {$smarty.template} and {$smarty.current_dir} did not compile correctly within {block} tags
+- bugfix corrected error message on missing template files in extends resource
+- bugfix untility compileAllTemplates() did not create sha1 code for compiled template file names if template_dir was defined with no trailing DS
+
+16/09/2010
+- bugfix when a doublequoted modifier parameter did contain Smarty tags and ':'
+
+15/09/2010
+- bugfix resolving conflict between '<%'/'%>' as custom Smarty delimiter and ASP tags
+- use ucfirst for resource name on internal resource class names
+
+12/09/2010
+- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results)
+
+10/09/2010
+- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results)
+
+08/09/2010
+- allow multiple template inheritance branches starting in subtemplates
+
+07/09/2010
+- bugfix {counter} and {cycle} plugin assigned result to smarty variable not in local(template) scope
+- bugfix templates containing just {strip} {/strip} tags did produce an error
+
+
+23/08/2010
+- fixed E_STRICT errors for uninitialized variables
+
+22/08/2010
+- added attribute cache_id to {include} tag
+
+13/08/2010
+- remove exception_handler property from Smarty class
+- added Smarty's own exceptions SmartyException and SmartyCompilerException
+
+09/08/2010
+- bugfix on modifier with doublequoted strings as parameter containing embedded tags
+
+06/08/2010
+- bugfix when cascading some modifier like |strip|strip_tags modifier
+
+05/08/2010
+- added plugin type modifiercompiler to produce compiled modifier code
+- changed standard modifier plugins to the compiling versions whenever possible
+- bugfix in nocache sections {include} must not cache the subtemplate
+
+02/08/2010
+- bugfix strip did not work correctly in conjunction with comment lines
+
+31/07/2010
+- bugfix on nocache attribute at {assign} and {append}
+
+30/07/2010
+- bugfix passing scope attributes in doublequoted strings did not work at {include} {assign} and {append}
+
+25/07/2010
+- another bugfix of change from 23/07/2010 when compiling modifer
+
+24/07/2010
+- bugfix of change from 23/07/2010 when compiling modifer
+
+23/07/2010
+- changed execution order. A variable filter does now run before modifiers on output of variables
+- bugfix use always { and } as delimiter for debug.tpl
+
+
+22/07/2010
+- bugfix in templateExists() method
+
+20/07/2010
+- fixed handling of { strip } tag with whitespaces
+
+15/07/2010
+- bufix  {$smarty.template} does include now the relative path, not just filename
+
+=====  RC3 =====
+
+
+
+
+15/07/2010
+- make the date_format modifier work also on objects of the DateTime class
+- implementation of parsetrees in the parser to close security holes and remove unwanted empty line in HTML output
+
+08/07/2010
+- bugfix on assigning multidimensional arrays within templates
+- corrected bugfix for truncate modifier
+
+07/07/2010
+- bugfix the truncate modifier needs to check if the string is utf-8 encoded or not
+- bugfix support of script files relative to trusted_dir
+
+06/07/2010
+- create exception on recursive {extends} calls
+- fixed reported line number at "unexpected closing tag " exception
+- bugfix on escape:'mail' modifier
+- drop exception if 'item' variable is equal 'from' variable in {foreach} tag
+
+01/07/2010
+- removed call_user_func_array calls for optimization of compiled code when using registered modifiers and plugins
+
+25/06/2010
+- bugfix escaping " when block tags are used within doublequoted strings
+
+24/06/2010
+- replace internal get_time() calls with standard PHP5 microtime(true) calls in Smarty_Internal_Utility
+- added $smarty->register->templateClass() and $smarty->unregister->templateClass() methods for supporting static classes with namespace
+
+
+22/06/2010
+- allow spaces between typecast and value in template syntax
+- bugfix get correct count of traversables in {foreach} tag
+
+21/06/2010
+- removed use of PHP shortags SMARTY_PHP_PASSTHRU mode
+- improved speed of cache->clear() when a compile_id was specified and use_sub_dirs is true 
+
+20/06/2010
+- replace internal get_time() calls with standard PHP5 microtime(true) calls
+- closed security hole when php.ini asp_tags = on
+
+18/06/2010
+- added __toString method to the Smarty_Variable class
+
+
+14/06/2010
+- make handling of Smarty comments followed by newline BC to Smarty2
+
+
+=====  RC2 =====
+
+
+
+13/06/2010
+- bugfix Smarty3 did not handle hexadecimals like 0x0F as numerical value
+- bugifx Smarty3 did not accept numerical constants like .1 or 2. (without a leading or trailing digit)
+
+11/06/2010
+- bugfix the lexer did fail on larger {literal} ... {/literal} sections
+
+03/06/2010
+- bugfix on calling template functions like Smarty tags
+
+01/06/2010
+- bugfix on template functions used with template inheritance
+- removed /* vim: set expandtab: */ comments
+- bugfix of auto literal problem introduce with fix of 31/05/2010
+
+31/05/2010
+- bugfix the parser did not allow some smarty variables with special name like $for, $if, $else and others.
+
+27/05/2010
+- bugfix on object chaining using variable properties
+- make scope of {counter} and {cycle} tags again global as in Smarty2
+
+26/05/2010
+- bugfix removed decrepated register_resource call in smarty_internal_template.php
+
+25/05/2010
+- rewrite of template function handling to improve speed
+- bugfix on file dependency when merge_compiled_includes = true
+
+
+16/05/2010
+- bugfix when passing parameter with numeric name like {foo 1='bar' 2='blar'}
+
+14/05/2010
+- bugfix compile new config files if compile_check and force_compile = false
+- added variable static classes names to template syntax
+
+11/05/2010
+- bugfix  make sure that the cache resource is loaded in all conditions when template methods getCached... are called externally
+- reverted the change 0f 30/04/2010. With the exception of forward references template functions can be again called by a standard tag.
+
+10/05/2010
+- bugfix on {foreach} and {for} optimizations of 27/04/2010 
+
+09/05/2010
+- update of template and config file parser because of minor parser generator bugs 
+
+07/05/2010
+- bugfix on {insert} 
+
+06/05/2010
+- bugfix when merging compiled templates and objects are passed as parameter of the {include} tag
+
+05/05/2010
+- bugfix on {insert} to cache parameter
+- implementation of $smarty->default_modifiers as in Smarty2
+- bugfix on getTemplateVars method 
+
+01/05/2010
+- bugfix on handling of variable method names at object chaning
+
+30/04/2010
+- bugfix when comparing timestamps in sysplugins/smarty_internal_config.php
+- work around of a substr_compare bug in older PHP5 versions
+- bugfix on template inheritance for tag names starting with "block"
+- bugfix on {function} tag with name attribute in doublequoted strings
+- fix to make calling of template functions unambiguously by madatory usage of the {call} tag
+
+=====  RC1 =====
+
+27/04/2010
+- change default of $debugging_ctrl to 'NONE'
+- optimization of compiled code of {foreach} and {for} loops
+- change of compiler for config variables
+
+27/04/2010
+- bugfix in $smarty->cache->clear() method. (do not cache template object)
+
+
+17/04/2010
+- security fix in {math} plugin
+
+
+12/04/2010
+- bugfix in smarty_internal_templatecompilerbase (overloaded property)
+- removed parser restrictions in using true,false and null as ID
+
+07/04/2010
+- bugfix typo in smarty_internal_templatecompilerbase 
+
+31/03/2010
+- compile locking by touching old compiled files to avoid concurrent compilations
+
+29/03/2010
+- bugfix allow array definitions as modifier parameter
+- bugfix observe compile_check property when loading config files
+- added the template object as third filter parameter
+
+25/03/2010
+- change of utility->compileAllTemplates() log messages
+- bugfix on nocache code in {function} tags 
+- new method utility->compileAllConfig() to compile all config files
+
+24/03/2010
+- bugfix on register->modifier() error messages
+
+23/03/2010
+- bugfix on template inheritance when calling multiple child/parent relations
+- bugfix on caching mode SMARTY_CACHING_LIFETIME_SAVED and cache_lifetime = 0
+
+22/03/2010
+- bugfix make directory separator operating system independend in compileAllTemplates()
+
+21/03/2010
+- removed unused code in compileAllTemplates()
+
+19/03/2010
+- bugfix for multiple {/block} tags on same line
+
+17/03/2010
+- bugfix make $smarty->cache->clear() function independent from caching status
+
+16/03/2010
+- bugfix on assign attribute at registered template objects
+- make handling of modifiers on expression BC to Smarty2
+15/03/2010
+- bugfix on block plugin calls
+
+11/03/2010
+- changed parsing of <?php and ?> back to Smarty2 behaviour
+
+08/03/2010
+- bugfix on uninitialized properties in smarty_internal_template
+- bugfix on $smarty->disableSecurity()
+
+04/03/2010
+- bugfix allow uppercase chars in registered resource names
+- bugfix on accessing chained objects of static classes
+
+01/03/2010
+- bugfix on nocache code in {block} tags if child template was included by {include}
+
+27/02/2010
+- allow block tags inside double quoted string 
+
+26/02/2010
+- cache modified check implemented
+- support of access to a class constant from an object (since PHP 5.3)
+
+24/02/2010
+- bugfix on expressions in doublequoted string enclosed in backticks
+- added security property $static_classes for static class security
+
+18/02/2010
+- bugfix on parsing Smarty tags inside <?xml ... ?>
+- bugfix on truncate modifier
+
+17/02/2010
+- removed restriction that modifiers did require surrounding parenthesis in some cases
+- added {$smarty.block.child} special variable for template inheritance
+
+16/02/2010
+- bugfix on <?xml ... ?> tags for all php_handling modes
+- bugfix on parameter of variablefilter.htmlspecialchars.php plugin
+
+14/02/2010
+- added missing _plugins property in smarty.class.php
+- bugfix $smarty.const... inside doublequoted strings and backticks was compiled into wrong PHP code
+
+12/02/2010
+- bugfix on nested {block} tags
+- changed Smarty special variable $smarty.parent to $smarty.block.parent
+- added support of nested {bock} tags
+
+10/02/2010
+- avoid possible notice on $smarty->cache->clear(...), $smarty->clear_cache(....)
+- allow Smarty tags inside <? ... ?> tags in SMARTY_PHP_QUOTE and SMARTY_PHP_PASSTHRU mode
+- bugfix at new "for" syntax like {for $x=1 to 10 step 2}
+
+09/02/2010
+- added $smarty->_tag_stack for tracing block tag hierarchy
+
+08/02/2010
+- bugfix  use template fullpath at §smarty->cache->clear(...), $smarty->clear_cache(....)
+- bugfix of cache filename on extended templates when force_compile=true
+
+07/02/2010
+- bugfix on changes of 05/02/2010
+- preserve line endings type form template source
+- API changes (see README file)
+
+05/02/2010
+- bugfix on modifier and block plugins with same name
+
+02/02/2010
+- retaining newlines at registered functions and function plugins
+
+01/25/2010
+- bugfix cache resource was not loaded when caching was globally off but enabled at a template object
+- added test that $_SERVER['SCRIPT_NAME'] does exist in Smarty.class.php
+
+01/22/2010
+- new method $smarty->createData([$parent]) for creating a data object (required for bugfixes below)
+- bugfix config_load() method now works also on a data object
+- bugfix get_config_vars() method now works also on a data and template objects
+- bugfix clear_config() method now works also on a data and template objects
+
+01/19/2010
+- bugfix on plugins if same plugin was called from a nocache section first and later from a cached section
+
+
+###beta 7###
+
+
+01/17/2010
+- bugfix on $smarty.const... in double quoted strings
+
+01/16/2010
+- internal change of config file lexer/parser on handling of section names
+- bugfix on registered objects (format parameter of register_object was not handled correctly)
+
+01/14/2010
+- bugfix on backslash within single quoted strings
+- bugfix allow absolute filepath for config files
+- bugfix on special Smarty variable $smarty.cookies
+- revert handling of newline on no output tags like {if...} 
+- allow special characters in config file section names for Smarty2 BC
+
+01/13/2010
+- bugfix on {if} tags 
+
+01/12/2010
+- changed back modifer handling in parser. Some restrictions still apply:
+    if modifiers are used in side {if...} expression or in mathematical expressions 
+    parentheses must be used.
+- bugfix the {function..} tag did not accept the name attribute in double quotes
+- closed possible security hole at <?php ... ?> tags
+- bugfix of config file parser on large config files
+
+
+###beta 6####
+
+01/11/2010
+- added \n to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source
+- added missing support of insert plugins
+- added optional nocache attribute to {block} tags in parent template
+- updated <?php...?> handling supporting now heredocs and newdocs. (thanks to Thue Jnaus Kristensen)
+
+01/09/2010
+- bugfix on nocache {block} tags in parent templates
+
+01/08/2010
+- bugfix on variable filters. filter/nofilter attributes did not work on output statements
+
+01/07/2010
+- bugfix on file dependency at template inheritance
+- bugfix on nocache code at template inheritance
+
+01/06/2010
+- fixed typo in smarty_internal_resource_registered
+- bugfix for custom delimiter at extends resource and {extends} tag
+
+01/05/2010
+- bugfix sha1() calculations at extends resource and some general improvments on sha1() handling 
+
+
+01/03/2010
+- internal change on building cache files
+
+01/02/2010
+- update cached_timestamp at the template object after cache file is written to avoid possible side effects
+- use internally always SMARTY_CACHING_LIFETIME_* constants
+
+01/01/2010
+- bugfix for obtaining plugins which must be included (related to change of 12/30/2009)
+- bugfix for {php} tag (trow an exception if allow_php_tag = false)
+
+12/31/2009
+- optimization of generated code for doublequoted strings containing variables
+- rewrite of {function} tag handling
+  - can now be declared in an external subtemplate
+  - can contain nocache sections (nocache_hash handling)
+  - can be called in noccache sections (nocache_hash handling)
+  - new {call..} tag to call template functions with a variable name {call name=$foo}
+- fixed nocache_hash handling in merged compiled templates
+
+12/30/2009
+- bugfix for plugins defined in the script as smarty_function_foo
+
+12/29/2009
+- use sha1() for filepath encoding
+- updates on nocache_hash handling
+- internal change on merging some data
+- fixed cache filename for custom resources 
+
+12/28/2009
+- update for security fixes
+- make modifier plugins always trusted
+- fixed bug loading modifiers in child template at template inheritance
+
+12/27/2009
+--- this is a major update with a couple of internal changes ---
+- new config file lexer/parser (thanks to Thue Jnaus Kristensen)
+- template lexer/parser fixes for PHP and {literal} handing (thanks to Thue Jnaus Kristensen)
+- fix on registered plugins with different type but same name
+- rewrite of plugin handling (optimized execution speed)
+- closed a security hole regarding PHP code injection into cache files
+- fixed bug in clear cache handling
+- Renamed a couple of internal classes
+- code cleanup for merging compiled templates
+- couple of runtime optimizations (still not all done)
+- update of getCachedTimestamp()
+- fixed bug on modifier plugins at nocache output
+
+12/19/2009
+- bugfix on comment lines in config files
+
+12/17/2009
+- bugfix of parent/global variable update at included/merged subtemplates
+- encode final template filepath into filename of compiled and cached files
+- fixed {strip} handling in auto literals
+
+12/16/2009
+- update of changelog
+- added {include file='foo.tpl' inline}  inline option to merge compiled code of subtemplate into the calling template
+
+12/14/2009
+- fixed sideefect of last modification (objects in array index did not work anymore)
+
+12/13/2009
+- allow boolean negation ("!") as operator on variables outside {if} tag
+
+12/12/2009
+- bugfix on single quotes inside {function} tag
+- fix short append/prepend attributes in {block} tags
+
+12/11/2009
+- bugfix on clear_compiled_tpl (avoid possible warning)
+
+12/10/2009
+- bugfix on {function} tags and template inheritance
+
+12/05/2009
+- fixed problem when a cached file was fetched several times
+- removed unneeded lexer code
+
+12/04/2009
+- added max attribute to for loop
+- added security mode allow_super_globals
+
+12/03/2009
+- template inheritance: child templates can now call functions defined by the {function} tag in the parent template
+- added {for $foo = 1 to 5 step 2}  syntax
+- bugfix for {$foo.$x.$y.$z}
+
+12/01/2009
+- fixed parsing of names of special formated tags like if,elseif,while,for,foreach
+- removed direct access to constants in templates because of some syntax problems
+- removed cache resource plugin for mysql from the distribution
+- replaced most hard errors (exceptions) by softerrors(trigger_error) in plugins
+- use $template_class property for template class name when compiling {include},{eval} and {extends} tags
+
+11/30/2009
+- map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter
+- allow {function} tags within {block} tags
+
+11/28/2009
+- ignore compile_id at debug template
+- added direct access to constants in templates
+- some lexer/parser optimizations
+
+11/27/2009
+- added cache resource MYSQL plugin
+
+11/26/2009
+- bugfix on nested doublequoted strings
+- correct line number on unknown tag error message
+- changed {include} compiled code
+- fix on checking dynamic varibales with error_unassigned = true
+
+11/25/2009
+- allow the following writing for boolean: true, TRUE, True, false, FALSE, False
+- {strip} tag functionality rewritten
+
+11/24/2009
+- bugfix for $smarty->config_overwrite = false
+
+11/23/2009
+- suppress warnings on unlink caused by race conditions
+- correct line number on unknown tag error message
+
+------- beta 5
+11/23/2009
+- fixed configfile parser for text starting with a numeric char
+- the default_template_handler_func may now return a filepath to a template source
+
+11/20/2009
+- bugfix for empty config files
+- convert timestamps of registered resources to integer
+
+11/19/2009
+- compiled templates are no longer touched with the filemtime of template source
+
+11/18/2009
+- allow integer as attribute name in plugin calls
+
+------- beta 4
+11/18/2009
+- observe umask settings when setting file permissions
+- avoide unneeded cache file creation for subtemplates which did occur in some situations
+- make $smarty->_current_file available during compilation for Smarty2 BC
+
+11/17/2009
+- sanitize compile_id and cache_id (replace illegal chars with _)
+- use _dir_perms and _file_perms properties at file creation
+- new constant SMARTY_RESOURCE_DATE_FORMAT (default '%b %e, %Y') which is used as default format in modifier date_format
+- added {foreach $array as $key=>$value} syntax
+- renamed extend tag and resource to extends: {extends file='foo.tol'} , $smarty->display('extends:foo.tpl|bar.tpl);
+- bugfix cycle plugin
+
+11/15/2009
+- lexer/parser optimizations on quoted strings
+
+11/14/2009
+- bugfix on merging compiled templates when source files got removed or renamed.
+- bugfix modifiers on registered object tags
+- fixed locaion where outputfilters are running
+- fixed config file definitions at EOF
+- fix on merging compiled templates with nocache sections in nocache includes
+- parser could run into a PHP error on wrong file attribute
+
+11/12/2009
+- fixed variable filenames in {include_php} and {insert}
+- added scope to Smarty variables in the {block} tag compiler
+- fix on nocache code in child {block} tags
+
+11/11/2009
+- fixed {foreachelse}, {forelse}, {sectionelse} compiled code at nocache variables
+- removed checking for reserved variables
+- changed debugging handling
+
+11/10/2009
+- fixed preg_qoute on delimiters
+
+11/09/2009
+- lexer/parser bugfix 
+- new SMARTY_SPL_AUTOLOAD constant to control the autoloader option
+- bugfix for {function} block tags in included templates
+
+11/08/2009
+- fixed alphanumeric array index 
+- bugfix on complex double quoted strings
+
+11/05/2009
+- config_load method can now be called on data and template objects
+
+11/04/2009
+- added typecasting support for template variables
+- bugfix on complex indexed special Smarty variables
+
+11/03/2009
+- fixed parser error on objects with special smarty vars
+- fixed file dependency for {incude} inside {block} tag
+- fixed not compiling on non existing compiled templates when compile_check = false
+- renamed function names of autoloaded Smarty methods to Smarty_Method_....
+- new security_class property (default is Smarty_Security)
+
+11/02/2009
+- added neq,lte,gte,mod as aliases to if conditions 
+- throw exception on illegal Smarty() constructor calls
+
+10/31/2009
+- change of filenames in sysplugins folder for internal spl_autoload function
+- lexer/parser changed for increased compilation speed
+
+10/27/2009
+- fixed missing quotes in include_php.php
+
+10/27/2009
+- fixed typo in method.register_resource
+- pass {} through as literal
+
+10/26/2009
+- merge only compiled subtemplates into the compiled code of the main template
+
+10/24/2009
+- fixed nocache vars at internal block tags
+- fixed merging of recursive includes
+
+10/23/2009
+- fixed nocache var problem
+
+10/22/2009
+- fix trimwhitespace outputfilter parameter
+
+10/21/2009
+- added {$foo++}{$foo--} syntax
+- buxfix changed PHP "if (..):" to "if (..){" because of possible bad code when concenating PHP tags
+- autoload Smarty internal classes
+- fixed file dependency for config files 
+- some code optimizations
+- fixed function definitions on some autoloaded methods
+- fixed nocache variable inside if condition of {if} tag
+
+10/20/2009
+- check at compile time for variable filter to improve rendering speed if no filter is used
+- fixed bug at combination of {elseif} tag and {...} in double quoted strings of static class parameter
+
+10/19/2009
+- fixed compiled template merging on variable double quoted strings as name
+- fixed bug in caching mode 2 and cache_lifetime -1 
+- fixed modifier support on block tags
+
+10/17/2009
+- remove ?>\n<?php and ?><?php sequences from compiled template
+
+10/15/2009
+- buxfix on assigning array elements inside templates
+- parser bugfix on array access
+
+10/15/2009
+- allow bit operator '&' inside {if} tag
+- implementation of ternary operator
+
+10/13/2009
+- do not recompile evaluated templates if reused just with other data
+- recompile config files when config properties did change
+- some lexer/parser otimizations
+
+10/11/2009
+- allow {block} tags inside included templates
+- bugfix for resource plugins in Smarty2 format
+- some optimizations of internal.template.php
+
+10/11/2009
+- fixed bug when template with same name is used with different data objects
+- fixed bug with double quoted name attribute at {insert} tag
+- reenabled assign_by_ref and append_by_ref methods
+
+10/07/2009
+- removed block nesting checks for {capture}
+
+10/05/2009
+- added support of "isinstance" to {if} tag
+
+10/03/2009
+- internal changes to improve performance
+- fix registering of filters for classes
+
+10/01/2009
+- removed default timezone setting
+- reactivated PHP resource for simple PHP templates. Must set allow_php_templates = true to enable
+- {PHP} tag can be enabled by allow_php_tag = true
+
+09/30/2009
+- fixed handling template_exits method for all resource types
+- bugfix for other cache resources than file
+- the methods assign_by_ref is now wrapped to assign, append_by_ref to append
+- allow arrays of variables pass in display, fetch and createTemplate calls
+  $data = array('foo'=>'bar','foo2'=>'blar');
+  $smarty->display('my.tpl',$data);
+
+09/29/2009
+- changed {php} tag handling
+- removed support of Smarty::instance()
+- removed support of PHP resource type
+- improved execution speed of {foreach} tags
+- fixed bug in {section} tag
+
+09/23/2009
+- improvements and bugfix on {include} tag handling
+NOTICE: existing compiled template and cache files must be deleted
+
+09/19/2009
+- replace internal "eval()" calls by "include" during rendering process
+- speed improvment for templates which have included subtemplates
+    the compiled code of included templates is merged into the compiled code of the parent template
+- added logical operator "xor" for {if} tag
+- changed parameter ordering for Smarty2 BC
+    fetch($template, $cache_id = null, $compile_id = null, $parent = null)
+    display($template, $cache_id = null, $compile_id = null, $parent = null)
+    createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
+- property resource_char_set is now replaced by constant SMARTY_RESOURCE_CHAR_SET
+- fixed handling of classes in registered blocks
+- speed improvement of lexer on text sections
+
+09/01/2009
+- dropped nl2br as plugin
+- added '<>' as comparission operator in {if} tags
+- cached caching_lifetime property to cache_liftime for backward compatibility with Smarty2.
+  {include} optional attribute is also now cache_lifetime
+- fixed trigger_error method (moved into Smarty class)
+- version is now  Beta!!!
+
+
+08/30/2009
+- some speed optimizations on loading internal plugins
+
+
+08/29/2009
+- implemented caching of registered Resources
+- new property 'auto_literal'. if true(default)  '{ ' and ' }' interpreted as literal, not as Smarty delimiter
+
+
+08/28/2009
+- Fix on line breaks inside {if} tags
+
+08/26/2009
+- implemented registered resources as in Smarty2. NOTE: caching does not work yet
+- new property 'force_cache'. if true it forces the creation of a new cache file
+- fixed modifiers on arrays
+- some speed optimization on loading internal classes
+
+
+08/24/2009
+- fixed typo in lexer definition for '!==' operator
+- bugfix - the ouput of plugins was not cached
+- added global variable SCRIPT_NAME
+
+08/21/2009
+- fixed problems whitespace in conjuction with custom delimiters
+- Smarty tags can now be used as value anywhere
+
+08/18/2009
+- definition of template class name moded in internal.templatebase.php
+- whitespace parser changes
+
+08/12/2009
+- fixed parser problems
+
+08/11/2009
+- fixed parser problems with custom delimiter
+
+08/10/2009
+- update of mb support in plugins
+
+
+08/09/2009
+- fixed problems with doublequoted strings at name attribute of {block} tag
+- bugfix at scope attribute of {append} tag
+
+08/08/2009
+- removed all internal calls of Smarty::instance()
+- fixed code in double quoted strings
+
+08/05/2009
+- bugfix mb_string support
+- bugfix of \n.\t etc in double quoted strings
+
+07/29/2009
+- added syntax for variable config vars  like  #$foo#
+
+07/28/2009
+- fixed parsing of $smarty.session vars containing objects
+
+07/22/2009
+- fix of "$" handling in double quoted strings
+
+07/21/2009
+- fix that {$smarty.current_dir} return correct value within {block} tags.
+
+07/20/2009
+- drop error message on unmatched {block} {/block} pairs
+
+07/01/2009
+- fixed smarty_function_html_options call in plugin function.html_select_date.php (missing ,)
+
+06/24/2009
+- fixed smarty_function_html_options call in plugin function.html_select_date.php
+
+06/22/2009
+- fix on \n and spaces inside smarty tags
+- removed request_use_auto_globals propert as it is no longer needed because Smarty 3 will always run under PHP 5
+
+
+06/18/2009
+- fixed compilation of block plugins when caching enabled
+- added $smarty.current_dir  which returns the current working directory
+
+06/14/2009
+- fixed array access on super globals
+- allow smarty tags within xml tags
+
+06/13/2009
+- bugfix at extend resource: create unique files for compiled template and cache for each combination of template files
+- update extend resource to handle appen and prepend block attributes
+- instantiate classes of plugins instead of calling them static
+
+06/03/2009
+- fixed repeat at block plugins
+
+05/25/2009
+- fixed problem with caching of compiler plugins
+
+05/14/2009
+- fixed directory separator handling
+
+05/09/2009
+- syntax change for stream variables
+- fixed bug when using absolute template filepath and caching
+
+05/08/2009
+- fixed bug of {nocache}  tag in included templates
+
+05/06/2009
+- allow that plugins_dir folder names can end without directory separator
+
+05/05/2009
+- fixed E_STRICT incompabilities
+- {function} tag bug fix 
+- security policy definitions have been moved from plugins folder to file Security.class.php in libs folder
+- added allow_super_global configuration to security
+
+04/30/2009
+- functions defined with the {function} tag now always have global scope
+
+04/29/2009
+- fixed problem with directory setter methods
+- allow that cache_dir can end without directory separator
+
+04/28/2009
+- the {function} tag can no longer overwrite standard smarty tags
+- inherit functions defined by the {fuction} tag into subtemplates
+- added {while <statement>} sytax to while tag
+
+04/26/2009
+- added trusted stream checking to security
+- internal changes at file dependency check for caching
+
+04/24/2009
+- changed name of {template} tag to {function}
+- added new {template} tag
+
+04/23/2009
+- fixed access of special smarty variables from included template
+
+04/22/2009
+- unified template stream syntax with standard Smarty resource syntax  $smarty->display('mystream:mytemplate')
+
+04/21/2009
+- change of new style syntax for forach. Now:  {foreach $array as $var}  like in PHP
+
+04/20/2009
+- fixed "$foo.bar  ..." variable replacement in double quoted strings
+- fixed error in {include} tag with variable file attribute
+
+04/18/2009
+- added stream resources  ($smarty->display('mystream://mytemplate'))
+- added stream variables  {$mystream:myvar}
+
+04/14/2009
+- fixed compile_id handling on {include} tags
+- fixed append/prepend attributes in {block} tag
+- added  {if  'expression' is in 'array'}  syntax
+- use crc32 as hash for compiled config files.
+
+04/13/2009
+- fixed scope problem with parent variables when appending variables within templates.
+- fixed code for {block} without childs (possible sources for notice errors removed)
+
+04/12/2009
+- added append and prepend attribute to {block} tag
+
+04/11/2009
+- fixed variables in 'file' attribute of {extend} tag
+- fixed problems in modifiers (if mb string functions not present)
+
+04/10/2009
+- check if mb string functions available otherwise fallback to normal string functions
+- added global variable scope SMARTY_GLOBAL_SCOPE 
+- enable 'variable' filter by default
+- fixed {$smarty.block.parent.foo} 
+- implementation of a 'variable' filter as replacement for default modifier
+
+04/09/2009
+- fixed execution of filters defined by classes
+- compile the always the content of {block} tags to make shure that the filters are running over it
+- syntax corrections on variable object property
+- syntax corrections on array access in dot syntax
+
+04/08/2009
+- allow variable object property
+
+04/07/2009
+- changed variable scopes to SMARTY_LOCAL_SCOPE, SMARTY_PARENT_SCOPE, SMARTY_ROOT_SCOPE to avoid possible conflicts with user constants
+- Smarty variable global attribute replaced with scope attribute
+
+04/06/2009
+- variable scopes LOCAL_SCOPE, PARENT_SCOPE, ROOT_SCOPE
+- more getter/setter methods
+
+04/05/2009
+- replaced new array looping syntax {for $foo in $array} with {foreach $foo in $array} to avoid confusion
+- added append array for short form of assign  {$foo[]='bar'} and allow assignments to nested arrays {$foo['bla']['blue']='bar'}
+
+04/04/2009
+- make output of template default handlers cachable and save compiled source
+- some fixes on yesterdays update
+
+04/03/2006
+- added registerDefaultTemplateHandler method and functionallity
+- added registerDefaultPluginHandler method and functionallity
+- added {append} tag to extend Smarty array variabled
+
+04/02/2009
+- added setter/getter methods
+- added $foo@first and $foo@last properties at {for} tag
+- added $set_timezone (true/false) property to setup optionally the default time zone
+
+03/31/2009
+- bugfix smarty.class and internal.security_handler
+- added compile_check configuration 
+- added setter/getter methods
+
+03/30/2009
+- added all major setter/getter methods
+
+03/28/2009
+- {block} tags can be nested now
+- md5 hash function replace with crc32 for speed optimization
+- file order for exted resource inverted
+- clear_compiled_tpl and clear_cache_all will not touch .svn folder any longer
+
+03/27/2009
+- added extend resource
+
+03/26/2009
+- fixed parser not to create error on `word` in double quoted strings
+- allow PHP  array(...)
+- implemented  $smarty.block.name.parent to access parent block content
+- fixed smarty.class
+
+
+03/23/2009
+- fixed {foreachelse} and {forelse} tags
+
+03/22/2009
+- fixed possible sources for notice errors
+- rearrange SVN into distribution and development folders
+
+03/21/2009
+- fixed exceptions in function plugins
+- fixed notice error in Smarty.class.php
+- allow chained objects to span multiple lines
+- fixed error in modifers 
+
+03/20/2009
+- moved /plugins folder into /libs folder
+- added noprint modifier
+- autoappend a directory separator if the xxxxx_dir definition have no trailing one
+
+03/19/2009
+- allow array definition as modifer parameter
+- changed modifier to use multi byte string funktions. 
+
+03/17/2009
+- bugfix 
+
+03/15/2009
+- added {include_php} tag for BC
+- removed @ error suppression 
+- bugfix fetch did always repeat output of first call when calling same template several times
+- PHPunit tests extended
+
+03/13/2009
+- changed block syntax to be Smarty like  {block:titel} -> {block name=titel}
+- compiling of {block} and {extend} tags rewriten for better performance
+- added special Smarty variable block  ($smarty.block.foo} returns the parent definition of block foo
+- optimization of {block} tag compiled code.
+- fixed problem with escaped double quotes in double quoted strings
+
+03/12/2009
+- added support of template inheritance by {extend } and {block } tags.
+- bugfix comments within literals
+- added scope attribuie to {include} tag
+
+03/10/2009
+- couple of bugfixes and improvements
+- PHPunit tests extended
+
+03/09/2009
+- added support for global template vars.  {assign_global...}  $smarty->assign_global(...)
+- added direct_access_security
+- PHPunit tests extended
+- added missing {if} tag conditions like "is div by" etc.
+
+03/08/2009
+- splitted up the Compiler class to make it easier to use a coustom compiler
+- made default plugins_dir relative to Smarty root and not current working directory
+- some changes to make the lexer parser better configurable
+- implemented {section} tag for Smarty2 BC
+
+03/07/2009
+- fixed problem with comment tags
+- fixed problem with #xxxx in double quoted string
+- new {while} tag implemented
+- made lexer and paser class configurable as $smarty property
+- Smarty method get_template_vars implemented
+- Smarty method get_registered_object implemented
+- Smarty method trigger_error implemented
+- PHPunit tests extended
+
+03/06/2009
+- final changes on config variable handling
+- parser change - unquoted strings will by be converted into single quoted strings
+- PHPunit tests extended
+- some code cleanup
+- fixed problem on catenate strings with expression
+- update of count_words modifier
+- bugfix on comment tags
+
+
+03/05/2009
+- bugfix on <?xml...> tag with caching enabled
+- changes on exception handling (by Monte)
+
+03/04/2009
+- added support for config variables
+- bugfix on <?xml...> tag
+
+03/02/2009
+- fixed unqouted strings within modifier parameter
+- bugfix parsing of mofifier parameter
+
+03/01/2009
+- modifier chaining works now as in Smarty2
+
+02/28/2009
+- changed handling of unqouted strings
+
+02/26/2009
+- bugfix
+- changed $smarty.capture.foo to be global for Smarty2 BC.
+
+02/24/2009
+- bugfix {php} {/php} tags for backward compatibility
+- bugfix for expressions on arrays
+- fixed usage of "null" value
+- added $smarty.foreach.foo.first and $smarty.foreach.foo.last
+
+02/06/2009
+- bugfix for request variables without index  for example $smarty.get
+- experimental solution for variable functions in static class
+
+02/05/2009
+- update of popup plugin
+- added config variables to template parser (load config functions still missing)
+- parser bugfix for empty quoted strings
+
+02/03/2009
+- allow array of objects as static class variabales.
+- use htmlentities at source output at template errors.
+
+02/02/2009
+- changed search order on modifiers to look at plugins folder first
+- parser bug fix for modifier on array elements  $foo.bar|modifier
+- parser bug fix on single quoted srings
+- internal: splitted up compiler plugin files 
+
+02/01/2009
+- allow method chaining on static classes
+- special Smarty variables  $smarty.... implemented
+- added {PHP} {/PHP} tags for backward compatibility
+
+01/31/2009
+- added {math} plugin for Smarty2 BC
+- added template_exists method
+- changed Smarty3 method enable_security() to enableSecurity() to follow camelCase standards
+
+01/30/2009
+- bugfix in single quoted strings
+- changed syntax for variable property access from $foo:property to $foo@property because of ambiguous syntax at modifiers
+
+01/29/2009
+- syntax for array definition changed from (1,2,3) to [1,2,3] to remove ambiguous syntax
+- allow  {for $foo in [1,2,3]} syntax
+- bugfix in double quoted strings
+- allow <?xml...?> tags in template even if short_tags are enabled
+
+01/28/2009
+- fixed '!==' if condition.
+
+01/28/2009
+- added support of {strip} {/strip} tag.
+
+01/27/2009
+- bug fix on backticks in double quoted strings at objects
+
+01/25/2009
+- Smarty2 modfiers added to SVN
+
+01/25/2009
+- bugfix allow arrays at object properties in Smarty syntax
+- the template object is now passed as additional parameter at plugin calls
+- clear_compiled_tpl method completed
+
+01/20/2009
+- access to class constants implemented  ( class::CONSTANT )
+- access to static class variables implemented ( class::$variable )
+- call of static class methods implemented ( class::method() )
+
+01/16/2009
+- reallow leading _ in variable names  {$_var}
+- allow array of objects  {$array.index->method()} syntax
+- finished work on clear_cache and clear_cache_all methods
+
+01/11/2009
+- added support of {literal} tag
+- added support of {ldelim} and {rdelim} tags
+- make code compatible to run with E_STRICT error setting
+
+01/08/2009
+- moved clear_assign and clear_all_assign to internal.templatebase.php
+- added assign_by_ref, append and append_by_ref methods
+
+01/02/2009
+- added load_filter method
+- fished work on filter handling
+- optimization of plugin loading
+
+12/30/2008
+- added compiler support of registered object 
+- added backtick support in doubled quoted strings for backward compatibility
+- some minor bug fixes and improvments
+
+12/23/2008
+- fixed problem of not working "not" operator in if-expressions
+- added handling of compiler function plugins
+- finished work on (un)register_compiler_function method
+- finished work on (un)register_modifier method
+- plugin handling from plugins folder changed for modifier plugins
+  deleted - internal.modifier.php
+- added modifier chaining to parser 
+
+12/17/2008
+- finished (un)register_function method
+- finished (un)register_block method
+- added security checking for PHP functions in PHP templates
+- plugin handling from plugins folder rewritten
+  new - internal.plugin_handler.php
+  deleted - internal.block.php
+  deleted - internal.function.php
+- removed plugin checking from security handler
+
+12/16/2008
+
+- new start of this change_log file
diff --git a/library/Smarty/demo/configs/test.conf b/library/Smarty/demo/configs/test.conf
new file mode 100644 (file)
index 0000000..5eac748
--- /dev/null
@@ -0,0 +1,5 @@
+title = Welcome to Smarty!
+cutoff_size = 40
+
+[setup]
+bold = true
diff --git a/library/Smarty/demo/index.php b/library/Smarty/demo/index.php
new file mode 100644 (file)
index 0000000..74c8e89
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+ /**
+ * Example Application
+
+ * @package Example-application
+ */
+
+require('../libs/Smarty.class.php');
+
+$smarty = new Smarty;
+
+
+
+//$smarty->force_compile = true;
+$smarty->debugging = true;
+$smarty->caching = true;
+$smarty->cache_lifetime = 120;
+
+$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill",true);
+$smarty->assign("FirstName",array("John","Mary","James","Henry"));
+$smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
+$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
+         array("I", "J", "K", "L"), array("M", "N", "O", "P")));
+
+$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
+         array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
+
+$smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
+$smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
+$smarty->assign("option_selected", "NE");
+
+$smarty->display('index.tpl');
+?>
diff --git a/library/Smarty/demo/plugins/cacheresource.apc.php b/library/Smarty/demo/plugins/cacheresource.apc.php
new file mode 100644 (file)
index 0000000..00ba598
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+/**
+ * APC CacheResource
+ *
+ * CacheResource Implementation based on the KeyValueStore API to use
+ * memcache as the storage resource for Smarty's output caching.
+ * *
+ * @package CacheResource-examples
+ * @author Uwe Tews
+ */
+class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore {
+
+    public function __construct()
+    {
+        // test if APC is present
+        if(!function_exists('apc_cache_info')) {
+            throw new Exception('APC Template Caching Error: APC is not installed');
+        }
+    }
+
+    /**
+     * Read values for a set of keys from cache
+     *
+     * @param array $keys list of keys to fetch
+     * @return array list of values with the given keys used as indexes
+     * @return boolean true on success, false on failure
+     */
+    protected function read(array $keys)
+    {
+        $_res = array();
+        $res = apc_fetch($keys);
+        foreach ($res as $k => $v) {
+            $_res[$k] = $v;
+        }
+        return $_res;
+    }
+
+    /**
+     * Save values for a set of keys to cache
+     *
+     * @param array $keys list of values to save
+     * @param int $expire expiration time
+     * @return boolean true on success, false on failure
+     */
+    protected function write(array $keys, $expire=null)
+    {
+        foreach ($keys as $k => $v) {
+            apc_store($k, $v, $expire);
+        }
+        return true;
+    }
+
+    /**
+     * Remove values from cache
+     *
+     * @param array $keys list of keys to delete
+     * @return boolean true on success, false on failure
+     */
+    protected function delete(array $keys)
+    {
+        foreach ($keys as $k) {
+            apc_delete($k);
+        }
+        return true;
+    }
+
+    /**
+     * Remove *all* values from cache
+     *
+     * @return boolean true on success, false on failure
+     */
+    protected function purge()
+    {
+        return apc_clear_cache('user');
+    }
+}
diff --git a/library/Smarty/demo/plugins/cacheresource.memcache.php b/library/Smarty/demo/plugins/cacheresource.memcache.php
new file mode 100644 (file)
index 0000000..230607d
--- /dev/null
@@ -0,0 +1,91 @@
+<?php
+
+/**
+ * Memcache CacheResource
+ *
+ * CacheResource Implementation based on the KeyValueStore API to use
+ * memcache as the storage resource for Smarty's output caching.
+ *
+ * Note that memcache has a limitation of 256 characters per cache-key.
+ * To avoid complications all cache-keys are translated to a sha1 hash.
+ *
+ * @package CacheResource-examples
+ * @author Rodney Rehm
+ */
+class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore {
+    /**
+     * memcache instance
+     * @var Memcache
+     */
+    protected $memcache = null;
+    
+    public function __construct()
+    {
+        $this->memcache = new Memcache();
+        $this->memcache->addServer( '127.0.0.1', 11211 );
+    }
+    
+    /**
+     * Read values for a set of keys from cache
+     *
+     * @param array $keys list of keys to fetch
+     * @return array list of values with the given keys used as indexes
+     * @return boolean true on success, false on failure
+     */
+    protected function read(array $keys)
+    {
+        $_keys = $lookup = array();
+        foreach ($keys as $k) {
+            $_k = sha1($k);
+            $_keys[] = $_k;
+            $lookup[$_k] = $k;
+        }
+        $_res = array();
+        $res = $this->memcache->get($_keys);
+        foreach ($res as $k => $v) {
+            $_res[$lookup[$k]] = $v;
+        }
+        return $_res;
+    }
+    
+    /**
+     * Save values for a set of keys to cache
+     *
+     * @param array $keys list of values to save
+     * @param int $expire expiration time
+     * @return boolean true on success, false on failure
+     */
+    protected function write(array $keys, $expire=null)
+    {
+        foreach ($keys as $k => $v) {
+            $k = sha1($k);
+            $this->memcache->set($k, $v, 0, $expire);
+        }
+        return true;
+    }
+
+    /**
+     * Remove values from cache
+     *
+     * @param array $keys list of keys to delete
+     * @return boolean true on success, false on failure
+     */
+    protected function delete(array $keys)
+    {
+        foreach ($keys as $k) {
+            $k = sha1($k);
+            $this->memcache->delete($k);
+        }
+        return true;
+    }
+
+    /**
+     * Remove *all* values from cache
+     *
+     * @return boolean true on success, false on failure
+     */
+    protected function purge()
+    {
+        return $this->memcache->flush();
+    }
+}
diff --git a/library/Smarty/demo/plugins/cacheresource.mysql.php b/library/Smarty/demo/plugins/cacheresource.mysql.php
new file mode 100644 (file)
index 0000000..ab8c475
--- /dev/null
@@ -0,0 +1,152 @@
+<?php
+
+/**
+ * MySQL CacheResource
+ *
+ * CacheResource Implementation based on the Custom API to use
+ * MySQL as the storage resource for Smarty's output caching.
+ *
+ * Table definition:
+ * <pre>CREATE TABLE IF NOT EXISTS `output_cache` (
+ *   `id` CHAR(40) NOT NULL COMMENT 'sha1 hash',
+ *   `name` VARCHAR(250) NOT NULL,
+ *   `cache_id` VARCHAR(250) NULL DEFAULT NULL,
+ *   `compile_id` VARCHAR(250) NULL DEFAULT NULL,
+ *   `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ *   `content` LONGTEXT NOT NULL,
+ *   PRIMARY KEY (`id`),
+ *   INDEX(`name`),
+ *   INDEX(`cache_id`),
+ *   INDEX(`compile_id`),
+ *   INDEX(`modified`)
+ * ) ENGINE = InnoDB;</pre>
+ *
+ * @package CacheResource-examples
+ * @author Rodney Rehm
+ */
+class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom {
+    // PDO instance
+    protected $db;
+    protected $fetch;
+    protected $fetchTimestamp;
+    protected $save;
+    
+    public function __construct() {
+        try {
+            $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty", "smarty");
+        } catch (PDOException $e) {
+            throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
+        }
+        $this->fetch = $this->db->prepare('SELECT modified, content FROM output_cache WHERE id = :id');
+        $this->fetchTimestamp = $this->db->prepare('SELECT modified FROM output_cache WHERE id = :id');
+        $this->save = $this->db->prepare('REPLACE INTO output_cache (id, name, cache_id, compile_id, content)
+            VALUES  (:id, :name, :cache_id, :compile_id, :content)');
+    }
+
+    /**
+     * fetch cached content and its modification time from data source
+     *
+     * @param string $id unique cache content identifier
+     * @param string $name template name
+     * @param string $cache_id cache id
+     * @param string $compile_id compile id
+     * @param string $content cached content
+     * @param integer $mtime cache modification timestamp (epoch)
+     * @return void
+     */
+    protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime)
+    {
+        $this->fetch->execute(array('id' => $id));
+        $row = $this->fetch->fetch();
+        $this->fetch->closeCursor();        
+        if ($row) {
+            $content = $row['content'];
+            $mtime = strtotime($row['modified']);
+        } else {
+            $content = null;
+            $mtime = null;
+        }
+    }
+    
+    /**
+     * Fetch cached content's modification timestamp from data source
+     *
+     * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the complete cached content.
+     * @param string $id unique cache content identifier
+     * @param string $name template name
+     * @param string $cache_id cache id
+     * @param string $compile_id compile id
+     * @return integer|boolean timestamp (epoch) the template was modified, or false if not found
+     */
+    protected function fetchTimestamp($id, $name, $cache_id, $compile_id)
+    {
+        $this->fetchTimestamp->execute(array('id' => $id));
+        $mtime = strtotime($this->fetchTimestamp->fetchColumn());
+        $this->fetchTimestamp->closeCursor();
+        return $mtime;
+    }
+    
+    /**
+     * Save content to cache
+     *
+     * @param string $id unique cache content identifier
+     * @param string $name template name
+     * @param string $cache_id cache id
+     * @param string $compile_id compile id
+     * @param integer|null $exp_time seconds till expiration time in seconds or null
+     * @param string $content content to cache
+     * @return boolean success
+     */
+    protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content)
+    {
+        $this->save->execute(array(
+            'id' => $id,
+            'name' => $name,
+            'cache_id' => $cache_id,
+            'compile_id' => $compile_id,
+            'content' => $content,
+        ));
+        return !!$this->save->rowCount();
+    }
+    
+    /**
+     * Delete content from cache
+     *
+     * @param string $name template name
+     * @param string $cache_id cache id
+     * @param string $compile_id compile id
+     * @param integer|null $exp_time seconds till expiration or null
+     * @return integer number of deleted caches
+     */
+    protected function delete($name, $cache_id, $compile_id, $exp_time)
+    {
+        // delete the whole cache
+        if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) {
+            // returning the number of deleted caches would require a second query to count them
+            $query = $this->db->query('TRUNCATE TABLE output_cache');
+            return -1;
+        }
+        // build the filter
+        $where = array();
+        // equal test name
+        if ($name !== null) {
+            $where[] = 'name = ' . $this->db->quote($name);
+        }
+        // equal test compile_id
+        if ($compile_id !== null) {
+            $where[] = 'compile_id = ' . $this->db->quote($compile_id);
+        }
+        // range test expiration time
+        if ($exp_time !== null) {
+            $where[] = 'modified < DATE_SUB(NOW(), INTERVAL ' . intval($exp_time) . ' SECOND)';
+        }
+        // equal test cache_id and match sub-groups
+        if ($cache_id !== null) {
+            $where[] = '(cache_id = '. $this->db->quote($cache_id)
+                . ' OR cache_id LIKE '. $this->db->quote($cache_id .'|%') .')';
+        }
+        // run delete query
+        $query = $this->db->query('DELETE FROM output_cache WHERE ' . join(' AND ', $where));
+        return $query->rowCount();
+    }
+}
diff --git a/library/Smarty/demo/plugins/resource.extendsall.php b/library/Smarty/demo/plugins/resource.extendsall.php
new file mode 100644 (file)
index 0000000..d8c40b5
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * Extends All Resource
+ * 
+ * Resource Implementation modifying the extends-Resource to walk
+ * through the template_dirs and inherit all templates of the same name
+ * 
+ * @package Resource-examples
+ * @author Rodney Rehm
+ */
+class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends {
+    
+    /**
+     * populate Source Object with meta data from Resource
+     *
+     * @param Smarty_Template_Source $source source object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     */
+    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+    {
+        $uid = '';
+        $sources = array();
+        $exists = true;
+        foreach ($_template->smarty->getTemplateDir() as $key => $directory) {
+            try {
+                $s = Smarty_Resource::source(null, $source->smarty, '[' . $key . ']' . $source->name );
+                if (!$s->exists) {
+                    continue;
+                }
+                $sources[$s->uid] = $s;
+                $uid .= $s->filepath;
+            }
+            catch (SmartyException $e) {}
+        }
+        
+        if (!$sources) {
+            $source->exists = false;
+            $source->template = $_template;
+            return;
+        }
+        
+        $sources = array_reverse($sources, true);
+        reset($sources);
+        $s = current($sources);
+        
+        $source->components = $sources;
+        $source->filepath = $s->filepath;
+        $source->uid = sha1($uid);
+        $source->exists = $exists;
+        if ($_template && $_template->smarty->compile_check) {
+            $source->timestamp = $s->timestamp;
+        }
+        // need the template at getContent()
+        $source->template = $_template;
+    }
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/demo/plugins/resource.mysql.php b/library/Smarty/demo/plugins/resource.mysql.php
new file mode 100644 (file)
index 0000000..312f3fc
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * MySQL Resource
+ *
+ * Resource Implementation based on the Custom API to use
+ * MySQL as the storage resource for Smarty's templates and configs.
+ *
+ * Table definition:
+ * <pre>CREATE TABLE IF NOT EXISTS `templates` (
+ *   `name` varchar(100) NOT NULL,
+ *   `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ *   `source` text,
+ *   PRIMARY KEY (`name`)
+ * ) ENGINE=InnoDB DEFAULT CHARSET=utf8;</pre>
+ *
+ * Demo data:
+ * <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');</pre>
+ *
+ * @package Resource-examples
+ * @author Rodney Rehm
+ */
+class Smarty_Resource_Mysql extends Smarty_Resource_Custom {
+    // PDO instance
+    protected $db;
+    // prepared fetch() statement
+    protected $fetch;
+    // prepared fetchTimestamp() statement
+    protected $mtime;
+
+    public function __construct() {
+        try {
+            $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty", "smarty");
+        } catch (PDOException $e) {
+            throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
+        }
+        $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name');
+        $this->mtime = $this->db->prepare('SELECT modified FROM templates WHERE name = :name');
+    }
+    
+    /**
+     * Fetch a template and its modification time from database
+     *
+     * @param string $name template name
+     * @param string $source template source
+     * @param integer $mtime template modification timestamp (epoch)
+     * @return void
+     */
+    protected function fetch($name, &$source, &$mtime)
+    {
+        $this->fetch->execute(array('name' => $name));
+        $row = $this->fetch->fetch();
+        $this->fetch->closeCursor();
+        if ($row) {
+            $source = $row['source'];
+            $mtime = strtotime($row['modified']);
+        } else {
+            $source = null;
+            $mtime = null;
+        }
+    }
+    
+    /**
+     * Fetch a template's modification time from database
+     *
+     * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source.
+     * @param string $name template name
+     * @return integer timestamp (epoch) the template was modified
+     */
+    protected function fetchTimestamp($name) {
+        $this->mtime->execute(array('name' => $name));
+        $mtime = $this->mtime->fetchColumn();
+        $this->mtime->closeCursor();
+        return strtotime($mtime);
+    }
+}
diff --git a/library/Smarty/demo/plugins/resource.mysqls.php b/library/Smarty/demo/plugins/resource.mysqls.php
new file mode 100644 (file)
index 0000000..f9fe1c2
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * MySQL Resource
+ *
+ * Resource Implementation based on the Custom API to use
+ * MySQL as the storage resource for Smarty's templates and configs.
+ *
+ * Note that this MySQL implementation fetches the source and timestamps in
+ * a single database query, instead of two seperate like resource.mysql.php does.
+ *
+ * Table definition:
+ * <pre>CREATE TABLE IF NOT EXISTS `templates` (
+ *   `name` varchar(100) NOT NULL,
+ *   `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ *   `source` text,
+ *   PRIMARY KEY (`name`)
+ * ) ENGINE=InnoDB DEFAULT CHARSET=utf8;</pre>
+ *
+ * Demo data:
+ * <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');</pre>
+ *
+ * @package Resource-examples
+ * @author Rodney Rehm
+ */
+class Smarty_Resource_Mysqls extends Smarty_Resource_Custom {
+    // PDO instance
+    protected $db;
+    // prepared fetch() statement
+    protected $fetch;
+
+    public function __construct() {
+        try {
+            $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty", "smarty");
+        } catch (PDOException $e) {
+            throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
+        }
+        $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name');
+    }
+    
+    /**
+     * Fetch a template and its modification time from database
+     *
+     * @param string $name template name
+     * @param string $source template source
+     * @param integer $mtime template modification timestamp (epoch)
+     * @return void
+     */
+    protected function fetch($name, &$source, &$mtime)
+    {
+        $this->fetch->execute(array('name' => $name));
+        $row = $this->fetch->fetch();
+        $this->fetch->closeCursor();
+        if ($row) {
+            $source = $row['source'];
+            $mtime = strtotime($row['modified']);
+        } else {
+            $source = null;
+            $mtime = null;
+        }
+    }
+}
diff --git a/library/Smarty/demo/templates/footer.tpl b/library/Smarty/demo/templates/footer.tpl
new file mode 100644 (file)
index 0000000..e04310f
--- /dev/null
@@ -0,0 +1,2 @@
+</BODY>
+</HTML>
diff --git a/library/Smarty/demo/templates/header.tpl b/library/Smarty/demo/templates/header.tpl
new file mode 100644 (file)
index 0000000..783210a
--- /dev/null
@@ -0,0 +1,5 @@
+<HTML>
+<HEAD>
+<TITLE>{$title} - {$Name}</TITLE>
+</HEAD>
+<BODY bgcolor="#ffffff">
diff --git a/library/Smarty/demo/templates/index.tpl b/library/Smarty/demo/templates/index.tpl
new file mode 100644 (file)
index 0000000..38d2334
--- /dev/null
@@ -0,0 +1,82 @@
+{config_load file="test.conf" section="setup"}
+{include file="header.tpl" title=foo}
+
+<PRE>
+
+{* bold and title are read from the config file *}
+{if #bold#}<b>{/if}
+{* capitalize the first letters of each word of the title *}
+Title: {#title#|capitalize}
+{if #bold#}</b>{/if}
+
+The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
+
+The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
+
+Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
+
+The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>
+
+variable modifier example of {ldelim}$Name|upper{rdelim}
+
+<b>{$Name|upper}</b>
+
+
+An example of a section loop:
+
+{section name=outer 
+loop=$FirstName}
+{if $smarty.section.outer.index is odd by 2}
+       {$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
+{else}
+       {$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
+{/if}
+{sectionelse}
+       none
+{/section}
+
+An example of section looped key values:
+
+{section name=sec1 loop=$contacts}
+       phone: {$contacts[sec1].phone}<br>
+       fax: {$contacts[sec1].fax}<br>
+       cell: {$contacts[sec1].cell}<br>
+{/section}
+<p>
+
+testing strip tags
+{strip}
+<table border=0>
+       <tr>
+               <td>
+                       <A HREF="{$SCRIPT_NAME}">
+                       <font color="red">This is a  test     </font>
+                       </A>
+               </td>
+       </tr>
+</table>
+{/strip}
+
+</PRE>
+
+This is an example of the html_select_date function:
+
+<form>
+{html_select_date start_year=1998 end_year=2010}
+</form>
+
+This is an example of the html_select_time function:
+
+<form>
+{html_select_time use_24_hours=false}
+</form>
+
+This is an example of the html_options function:
+
+<form>
+<select name=states>
+{html_options values=$option_values selected=$option_selected output=$option_output}
+</select>
+</form>
+
+{include file="footer.tpl"}
diff --git a/library/Smarty/libs/Smarty.class.php b/library/Smarty/libs/Smarty.class.php
new file mode 100644 (file)
index 0000000..f776aaf
--- /dev/null
@@ -0,0 +1,1517 @@
+<?php
+/**
+ * Project:     Smarty: the PHP compiling template engine
+ * File:        Smarty.class.php
+ * SVN:         $Id: Smarty.class.php 4614 2012-05-24 15:13:19Z rodneyrehm $
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * For questions, help, comments, discussion, etc., please join the
+ * Smarty mailing list. Send a blank e-mail to
+ * smarty-discussion-subscribe@googlegroups.com
+ *
+ * @link http://www.smarty.net/
+ * @copyright 2008 New Digital Group, Inc.
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ * @package Smarty
+ * @version 3.1-DEV
+ */
+
+/**
+ * define shorthand directory separator constant
+ */
+if (!defined('DS')) {
+    define('DS', DIRECTORY_SEPARATOR);
+}
+
+/**
+ * set SMARTY_DIR to absolute path to Smarty library files.
+ * Sets SMARTY_DIR only if user application has not already defined it.
+ */
+if (!defined('SMARTY_DIR')) {
+    define('SMARTY_DIR', dirname(__FILE__) . DS);
+}
+
+/**
+ * set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins.
+ * Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it.
+ */
+if (!defined('SMARTY_SYSPLUGINS_DIR')) {
+    define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DS);
+}
+if (!defined('SMARTY_PLUGINS_DIR')) {
+    define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DS);
+}
+if (!defined('SMARTY_MBSTRING')) {
+    define('SMARTY_MBSTRING', function_exists('mb_strlen'));
+}
+if (!defined('SMARTY_RESOURCE_CHAR_SET')) {
+    // UTF-8 can only be done properly when mbstring is available!
+    /**
+     * @deprecated in favor of Smarty::$_CHARSET
+     */
+    define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1');
+}
+if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) {
+    /**
+     * @deprecated in favor of Smarty::$_DATE_FORMAT
+     */
+    define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y');
+}
+
+/**
+ * register the class autoloader
+ */
+if (!defined('SMARTY_SPL_AUTOLOAD')) {
+    define('SMARTY_SPL_AUTOLOAD', 0);
+}
+
+if (SMARTY_SPL_AUTOLOAD && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false) {
+    $registeredAutoLoadFunctions = spl_autoload_functions();
+    if (!isset($registeredAutoLoadFunctions['spl_autoload'])) {
+        spl_autoload_register();
+    }
+} else {
+    spl_autoload_register('smartyAutoload');
+}
+
+/**
+ * Load always needed external class files
+ */
+include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_data.php';
+include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_templatebase.php';
+include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_template.php';
+include_once SMARTY_SYSPLUGINS_DIR.'smarty_resource.php';
+include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_resource_file.php';
+include_once SMARTY_SYSPLUGINS_DIR.'smarty_cacheresource.php';
+include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_cacheresource_file.php';
+
+/**
+ * This is the main Smarty class
+ * @package Smarty
+ */
+class Smarty extends Smarty_Internal_TemplateBase {
+
+    /**#@+
+     * constant definitions
+     */
+
+    /**
+     * smarty version
+     */
+    const SMARTY_VERSION = 'Smarty-3.1.11';
+
+    /**
+     * define variable scopes
+     */
+    const SCOPE_LOCAL = 0;
+    const SCOPE_PARENT = 1;
+    const SCOPE_ROOT = 2;
+    const SCOPE_GLOBAL = 3;
+    /**
+     * define caching modes
+     */
+    const CACHING_OFF = 0;
+    const CACHING_LIFETIME_CURRENT = 1;
+    const CACHING_LIFETIME_SAVED = 2;
+    /**
+     * define compile check modes
+     */
+    const COMPILECHECK_OFF = 0;
+    const COMPILECHECK_ON = 1;
+    const COMPILECHECK_CACHEMISS = 2;
+    /**
+     * modes for handling of "<?php ... ?>" tags in templates.
+     */
+    const PHP_PASSTHRU = 0; //-> print tags as plain text
+    const PHP_QUOTE = 1; //-> escape tags as entities
+    const PHP_REMOVE = 2; //-> escape tags as entities
+    const PHP_ALLOW = 3; //-> escape tags as entities
+    /**
+     * filter types
+     */
+    const FILTER_POST = 'post';
+    const FILTER_PRE = 'pre';
+    const FILTER_OUTPUT = 'output';
+    const FILTER_VARIABLE = 'variable';
+    /**
+     * plugin types
+     */
+    const PLUGIN_FUNCTION = 'function';
+    const PLUGIN_BLOCK = 'block';
+    const PLUGIN_COMPILER = 'compiler';
+    const PLUGIN_MODIFIER = 'modifier';
+    const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler';
+
+    /**#@-*/
+
+    /**
+     * assigned global tpl vars
+     */
+    public static $global_tpl_vars = array();
+
+    /**
+     * error handler returned by set_error_hanlder() in Smarty::muteExpectedErrors()
+     */
+    public static $_previous_error_handler = null;
+    /**
+     * contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors()
+     */
+    public static $_muted_directories = array();
+    /**
+     * Flag denoting if Multibyte String functions are available
+     */
+    public static $_MBSTRING = SMARTY_MBSTRING;
+    /**
+     * The character set to adhere to (e.g. "UTF-8")
+     */
+    public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET;
+    /**
+     * The date format to be used internally
+     * (accepts date() and strftime())
+     */
+    public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT;
+    /**
+     * Flag denoting if PCRE should run in UTF-8 mode
+     */
+    public static $_UTF8_MODIFIER = 'u';
+    
+    /**
+     * Flag denoting if operating system is windows
+     */
+    public static $_IS_WINDOWS = false;
+    
+    /**#@+
+     * variables
+     */
+
+    /**
+     * auto literal on delimiters with whitspace
+     * @var boolean
+     */
+    public $auto_literal = true;
+    /**
+     * display error on not assigned variables
+     * @var boolean
+     */
+    public $error_unassigned = false;
+    /**
+     * look up relative filepaths in include_path
+     * @var boolean
+     */
+    public $use_include_path = false;
+    /**
+     * template directory
+     * @var array
+     */
+    private $template_dir = array();
+    /**
+     * joined template directory string used in cache keys
+     * @var string
+     */
+    public $joined_template_dir = null;
+    /**
+     * joined config directory string used in cache keys
+     * @var string
+     */
+    public $joined_config_dir = null;
+    /**
+     * default template handler
+     * @var callable
+     */
+    public $default_template_handler_func = null;
+    /**
+     * default config handler
+     * @var callable
+     */
+    public $default_config_handler_func = null;
+    /**
+     * default plugin handler
+     * @var callable
+     */
+    public $default_plugin_handler_func = null;
+    /**
+     * compile directory
+     * @var string
+     */
+    private $compile_dir = null;
+    /**
+     * plugins directory
+     * @var array
+     */
+    private $plugins_dir = array();
+    /**
+     * cache directory
+     * @var string
+     */
+    private $cache_dir = null;
+    /**
+     * config directory
+     * @var array
+     */
+    private $config_dir = array();
+    /**
+     * force template compiling?
+     * @var boolean
+     */
+    public $force_compile = false;
+    /**
+     * check template for modifications?
+     * @var boolean
+     */
+    public $compile_check = true;
+    /**
+     * use sub dirs for compiled/cached files?
+     * @var boolean
+     */
+    public $use_sub_dirs = false;
+    /**
+     * allow ambiguous resources (that are made unique by the resource handler)
+     * @var boolean
+     */
+    public $allow_ambiguous_resources = false;
+    /**
+     * caching enabled
+     * @var boolean
+     */
+    public $caching = false;
+    /**
+     * merge compiled includes
+     * @var boolean
+     */
+    public $merge_compiled_includes = false;
+    /**
+     * cache lifetime in seconds
+     * @var integer
+     */
+    public $cache_lifetime = 3600;
+    /**
+     * force cache file creation
+     * @var boolean
+     */
+    public $force_cache = false;
+    /**
+     * Set this if you want different sets of cache files for the same
+     * templates.
+     *
+     * @var string
+     */
+    public $cache_id = null;
+    /**
+     * Set this if you want different sets of compiled files for the same
+     * templates.
+     *
+     * @var string
+     */
+    public $compile_id = null;
+    /**
+     * template left-delimiter
+     * @var string
+     */
+    public $left_delimiter = "{";
+    /**
+     * template right-delimiter
+     * @var string
+     */
+    public $right_delimiter = "}";
+    /**#@+
+     * security
+     */
+    /**
+     * class name
+     *
+     * This should be instance of Smarty_Security.
+     *
+     * @var string
+     * @see Smarty_Security
+     */
+    public $security_class = 'Smarty_Security';
+    /**
+     * implementation of security class
+     *
+     * @var Smarty_Security
+     */
+    public $security_policy = null;
+    /**
+     * controls handling of PHP-blocks
+     *
+     * @var integer
+     */
+    public $php_handling = self::PHP_PASSTHRU;
+    /**
+     * controls if the php template file resource is allowed
+     *
+     * @var bool
+     */
+    public $allow_php_templates = false;
+    /**
+     * Should compiled-templates be prevented from being called directly?
+     *
+     * {@internal
+     * Currently used by Smarty_Internal_Template only.
+     * }}
+     *
+     * @var boolean
+     */
+    public $direct_access_security = true;
+    /**#@-*/
+    /**
+     * debug mode
+     *
+     * Setting this to true enables the debug-console.
+     *
+     * @var boolean
+     */
+    public $debugging = false;
+    /**
+     * This determines if debugging is enable-able from the browser.
+     * <ul>
+     *  <li>NONE => no debugging control allowed</li>
+     *  <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>
+     * </ul>
+     * @var string
+     */
+    public $debugging_ctrl = 'NONE';
+    /**
+     * Name of debugging URL-param.
+     *
+     * Only used when $debugging_ctrl is set to 'URL'.
+     * The name of the URL-parameter that activates debugging.
+     *
+     * @var type
+     */
+    public $smarty_debug_id = 'SMARTY_DEBUG';
+    /**
+     * Path of debug template.
+     * @var string
+     */
+    public $debug_tpl = null;
+    /**
+     * When set, smarty uses this value as error_reporting-level.
+     * @var int
+     */
+    public $error_reporting = null;
+    /**
+     * Internal flag for getTags()
+     * @var boolean
+     */
+    public $get_used_tags = false;
+
+    /**#@+
+     * config var settings
+     */
+
+    /**
+     * Controls whether variables with the same name overwrite each other.
+     * @var boolean
+     */
+    public $config_overwrite = true;
+    /**
+     * Controls whether config values of on/true/yes and off/false/no get converted to boolean.
+     * @var boolean
+     */
+    public $config_booleanize = true;
+    /**
+     * Controls whether hidden config sections/vars are read from the file.
+     * @var boolean
+     */
+    public $config_read_hidden = false;
+
+    /**#@-*/
+
+    /**#@+
+     * resource locking
+     */
+
+    /**
+     * locking concurrent compiles
+     * @var boolean
+     */
+    public $compile_locking = true;
+    /**
+     * Controls whether cache resources should emply locking mechanism
+     * @var boolean
+     */
+    public $cache_locking = false;
+    /**
+     * seconds to wait for acquiring a lock before ignoring the write lock
+     * @var float
+     */
+    public $locking_timeout = 10;
+
+    /**#@-*/
+
+    /**
+     * global template functions
+     * @var array
+     */
+    public $template_functions = array();
+    /**
+     * resource type used if none given
+     *
+     * Must be an valid key of $registered_resources.
+     * @var string
+     */
+    public $default_resource_type = 'file';
+    /**
+     * caching type
+     *
+     * Must be an element of $cache_resource_types.
+     *
+     * @var string
+     */
+    public $caching_type = 'file';
+    /**
+     * internal config properties
+     * @var array
+     */
+    public $properties = array();
+    /**
+     * config type
+     * @var string
+     */
+    public $default_config_type = 'file';
+    /**
+     * cached template objects
+     * @var array
+     */
+    public $template_objects = array();
+    /**
+     * check If-Modified-Since headers
+     * @var boolean
+     */
+    public $cache_modified_check = false;
+    /**
+     * registered plugins
+     * @var array
+     */
+    public $registered_plugins = array();
+    /**
+     * plugin search order
+     * @var array
+     */
+    public $plugin_search_order = array('function', 'block', 'compiler', 'class');
+    /**
+     * registered objects
+     * @var array
+     */
+    public $registered_objects = array();
+    /**
+     * registered classes
+     * @var array
+     */
+    public $registered_classes = array();
+    /**
+     * registered filters
+     * @var array
+     */
+    public $registered_filters = array();
+    /**
+     * registered resources
+     * @var array
+     */
+    public $registered_resources = array();
+    /**
+     * resource handler cache
+     * @var array
+     */
+    public $_resource_handlers = array();
+    /**
+     * registered cache resources
+     * @var array
+     */
+    public $registered_cache_resources = array();
+    /**
+     * cache resource handler cache
+     * @var array
+     */
+    public $_cacheresource_handlers = array();
+    /**
+     * autoload filter
+     * @var array
+     */
+    public $autoload_filters = array();
+    /**
+     * default modifier
+     * @var array
+     */
+    public $default_modifiers = array();
+    /**
+     * autoescape variable output
+     * @var boolean
+     */
+    public $escape_html = false;
+    /**
+     * global internal smarty vars
+     * @var array
+     */
+    public static $_smarty_vars = array();
+    /**
+     * start time for execution time calculation
+     * @var int
+     */
+    public $start_time = 0;
+    /**
+     * default file permissions
+     * @var int
+     */
+    public $_file_perms = 0644;
+    /**
+     * default dir permissions
+     * @var int
+     */
+    public $_dir_perms = 0771;
+    /**
+     * block tag hierarchy
+     * @var array
+     */
+    public $_tag_stack = array();
+    /**
+     * self pointer to Smarty object
+     * @var Smarty
+     */
+    public $smarty;
+    /**
+     * required by the compiler for BC
+     * @var string
+     */
+    public $_current_file = null;
+    /**
+     * internal flag to enable parser debugging
+     * @var bool
+     */
+    public $_parserdebug = false;
+    /**
+     * Saved parameter of merged templates during compilation
+     *
+     * @var array
+     */
+    public $merged_templates_func = array();
+    /**#@-*/
+
+    /**
+     * Initialize new Smarty object
+     *
+     */
+    public function __construct()
+    {
+        // selfpointer needed by some other class methods
+        $this->smarty = $this;
+        if (is_callable('mb_internal_encoding')) {
+            mb_internal_encoding(Smarty::$_CHARSET);
+        }
+        $this->start_time = microtime(true);
+        // set default dirs
+        $this->setTemplateDir('.' . DS . 'templates' . DS)
+            ->setCompileDir('.' . DS . 'templates_c' . DS)
+            ->setPluginsDir(SMARTY_PLUGINS_DIR)
+            ->setCacheDir('.' . DS . 'cache' . DS)
+            ->setConfigDir('.' . DS . 'configs' . DS);
+
+        $this->debug_tpl = 'file:' . dirname(__FILE__) . '/debug.tpl';
+        if (isset($_SERVER['SCRIPT_NAME'])) {
+            $this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);
+        }
+    }
+
+
+    /**
+     * Class destructor
+     */
+    public function __destruct()
+    {
+        // intentionally left blank
+    }
+
+    /**
+     * <<magic>> set selfpointer on cloned object
+     */
+    public function __clone()
+    {
+        $this->smarty = $this;
+    }
+
+
+    /**
+     * <<magic>> Generic getter.
+     *
+     * Calls the appropriate getter function.
+     * Issues an E_USER_NOTICE if no valid getter is found.
+     *
+     * @param string $name property name
+     * @return mixed
+     */
+    public function __get($name)
+    {
+        $allowed = array(
+        'template_dir' => 'getTemplateDir',
+        'config_dir' => 'getConfigDir',
+        'plugins_dir' => 'getPluginsDir',
+        'compile_dir' => 'getCompileDir',
+        'cache_dir' => 'getCacheDir',
+        );
+
+        if (isset($allowed[$name])) {
+            return $this->{$allowed[$name]}();
+        } else {
+            trigger_error('Undefined property: '. get_class($this) .'::$'. $name, E_USER_NOTICE);
+        }
+    }
+
+    /**
+     * <<magic>> Generic setter.
+     *
+     * Calls the appropriate setter function.
+     * Issues an E_USER_NOTICE if no valid setter is found.
+     *
+     * @param string $name  property name
+     * @param mixed  $value parameter passed to setter
+     */
+    public function __set($name, $value)
+    {
+        $allowed = array(
+        'template_dir' => 'setTemplateDir',
+        'config_dir' => 'setConfigDir',
+        'plugins_dir' => 'setPluginsDir',
+        'compile_dir' => 'setCompileDir',
+        'cache_dir' => 'setCacheDir',
+        );
+
+        if (isset($allowed[$name])) {
+            $this->{$allowed[$name]}($value);
+        } else {
+            trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);
+        }
+    }
+
+    /**
+     * Check if a template resource exists
+     *
+     * @param string $resource_name template name
+     * @return boolean status
+     */
+    public function templateExists($resource_name)
+    {
+        // create template object
+        $save = $this->template_objects;
+        $tpl = new $this->template_class($resource_name, $this);
+        // check if it does exists
+        $result = $tpl->source->exists;
+        $this->template_objects = $save;
+        return $result;
+    }
+
+    /**
+     * Returns a single or all global  variables
+     *
+     * @param object $smarty
+     * @param string $varname variable name or null
+     * @return string variable value or or array of variables
+     */
+    public function getGlobal($varname = null)
+    {
+        if (isset($varname)) {
+            if (isset(self::$global_tpl_vars[$varname])) {
+                return self::$global_tpl_vars[$varname]->value;
+            } else {
+                return '';
+            }
+        } else {
+            $_result = array();
+            foreach (self::$global_tpl_vars AS $key => $var) {
+                $_result[$key] = $var->value;
+            }
+            return $_result;
+        }
+    }
+
+    /**
+     * Empty cache folder
+     *
+     * @param integer $exp_time expiration time
+     * @param string  $type     resource type
+     * @return integer number of cache files deleted
+     */
+    function clearAllCache($exp_time = null, $type = null)
+    {
+        // load cache resource and call clearAll
+        $_cache_resource = Smarty_CacheResource::load($this, $type);
+        Smarty_CacheResource::invalidLoadedCache($this);
+        return $_cache_resource->clearAll($this, $exp_time);
+    }
+
+    /**
+     * Empty cache for a specific template
+     *
+     * @param string  $template_name template name
+     * @param string  $cache_id      cache id
+     * @param string  $compile_id    compile id
+     * @param integer $exp_time      expiration time
+     * @param string  $type          resource type
+     * @return integer number of cache files deleted
+     */
+    public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)
+    {
+        // load cache resource and call clear
+        $_cache_resource = Smarty_CacheResource::load($this, $type);
+        Smarty_CacheResource::invalidLoadedCache($this);
+        return $_cache_resource->clear($this, $template_name, $cache_id, $compile_id, $exp_time);
+    }
+
+    /**
+     * Loads security class and enables security
+     *
+     * @param string|Smarty_Security $security_class if a string is used, it must be class-name
+     * @return Smarty current Smarty instance for chaining
+     * @throws SmartyException when an invalid class name is provided
+     */
+    public function enableSecurity($security_class = null)
+    {
+        if ($security_class instanceof Smarty_Security) {
+            $this->security_policy = $security_class;
+            return $this;
+        } elseif (is_object($security_class)) {
+            throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security.");
+        }
+        if ($security_class == null) {
+            $security_class = $this->security_class;
+        }
+        if (!class_exists($security_class)) {
+            throw new SmartyException("Security class '$security_class' is not defined");
+        } elseif ($security_class !== 'Smarty_Security' && !is_subclass_of($security_class, 'Smarty_Security')) {
+            throw new SmartyException("Class '$security_class' must extend Smarty_Security.");
+        } else {
+            $this->security_policy = new $security_class($this);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Disable security
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function disableSecurity()
+    {
+        $this->security_policy = null;
+
+        return $this;
+    }
+
+    /**
+     * Set template directory
+     *
+     * @param string|array $template_dir directory(s) of template sources
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function setTemplateDir($template_dir)
+    {
+        $this->template_dir = array();
+        foreach ((array) $template_dir as $k => $v) {
+            $this->template_dir[$k] = rtrim($v, '/\\') . DS;
+        }
+
+        $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);
+        return $this;
+    }
+
+    /**
+     * Add template directory(s)
+     *
+     * @param string|array $template_dir directory(s) of template sources
+     * @param string       $key          of the array element to assign the template dir to
+     * @return Smarty current Smarty instance for chaining
+     * @throws SmartyException when the given template directory is not valid
+     */
+    public function addTemplateDir($template_dir, $key=null)
+    {
+        // make sure we're dealing with an array
+        $this->template_dir = (array) $this->template_dir;
+
+        if (is_array($template_dir)) {
+            foreach ($template_dir as $k => $v) {
+                if (is_int($k)) {
+                    // indexes are not merged but appended
+                    $this->template_dir[] = rtrim($v, '/\\') . DS;
+                } else {
+                    // string indexes are overridden
+                    $this->template_dir[$k] = rtrim($v, '/\\') . DS;
+                }
+            }
+        } elseif ($key !== null) {
+            // override directory at specified index
+            $this->template_dir[$key] = rtrim($template_dir, '/\\') . DS;
+        } else {
+            // append new directory
+            $this->template_dir[] = rtrim($template_dir, '/\\') . DS;
+        }
+        $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);
+        return $this;
+    }
+
+    /**
+     * Get template directories
+     *
+     * @param mixed index of directory to get, null to get all
+     * @return array|string list of template directories, or directory of $index
+     */
+    public function getTemplateDir($index=null)
+    {
+        if ($index !== null) {
+            return isset($this->template_dir[$index]) ? $this->template_dir[$index] : null;
+        }
+
+        return (array)$this->template_dir;
+    }
+
+    /**
+     * Set config directory
+     *
+     * @param string|array $template_dir directory(s) of configuration sources
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function setConfigDir($config_dir)
+    {
+        $this->config_dir = array();
+        foreach ((array) $config_dir as $k => $v) {
+            $this->config_dir[$k] = rtrim($v, '/\\') . DS;
+        }
+
+        $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);
+        return $this;
+    }
+
+    /**
+     * Add config directory(s)
+     *
+     * @param string|array $config_dir directory(s) of config sources
+     * @param string key of the array element to assign the config dir to
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function addConfigDir($config_dir, $key=null)
+    {
+        // make sure we're dealing with an array
+        $this->config_dir = (array) $this->config_dir;
+
+        if (is_array($config_dir)) {
+            foreach ($config_dir as $k => $v) {
+                if (is_int($k)) {
+                    // indexes are not merged but appended
+                    $this->config_dir[] = rtrim($v, '/\\') . DS;
+                } else {
+                    // string indexes are overridden
+                    $this->config_dir[$k] = rtrim($v, '/\\') . DS;
+                }
+            }
+        } elseif( $key !== null ) {
+            // override directory at specified index
+            $this->config_dir[$key] = rtrim($config_dir, '/\\') . DS;
+        } else {
+            // append new directory
+            $this->config_dir[] = rtrim($config_dir, '/\\') . DS;
+        }
+
+        $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);
+        return $this;
+    }
+
+    /**
+     * Get config directory
+     *
+     * @param mixed index of directory to get, null to get all
+     * @return array|string configuration directory
+     */
+    public function getConfigDir($index=null)
+    {
+        if ($index !== null) {
+            return isset($this->config_dir[$index]) ? $this->config_dir[$index] : null;
+        }
+
+        return (array)$this->config_dir;
+    }
+
+    /**
+     * Set plugins directory
+     *
+     * @param string|array $plugins_dir directory(s) of plugins
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function setPluginsDir($plugins_dir)
+    {
+        $this->plugins_dir = array();
+        foreach ((array)$plugins_dir as $k => $v) {
+            $this->plugins_dir[$k] = rtrim($v, '/\\') . DS;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Adds directory of plugin files
+     *
+     * @param object $smarty
+     * @param string $ |array $ plugins folder
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function addPluginsDir($plugins_dir)
+    {
+        // make sure we're dealing with an array
+        $this->plugins_dir = (array) $this->plugins_dir;
+
+        if (is_array($plugins_dir)) {
+            foreach ($plugins_dir as $k => $v) {
+                if (is_int($k)) {
+                    // indexes are not merged but appended
+                    $this->plugins_dir[] = rtrim($v, '/\\') . DS;
+                } else {
+                    // string indexes are overridden
+                    $this->plugins_dir[$k] = rtrim($v, '/\\') . DS;
+                }
+            }
+        } else {
+            // append new directory
+            $this->plugins_dir[] = rtrim($plugins_dir, '/\\') . DS;
+        }
+
+        $this->plugins_dir = array_unique($this->plugins_dir);
+        return $this;
+    }
+
+    /**
+     * Get plugin directories
+     *
+     * @return array list of plugin directories
+     */
+    public function getPluginsDir()
+    {
+        return (array)$this->plugins_dir;
+    }
+
+    /**
+     * Set compile directory
+     *
+     * @param string $compile_dir directory to store compiled templates in
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function setCompileDir($compile_dir)
+    {
+        $this->compile_dir = rtrim($compile_dir, '/\\') . DS;
+        if (!isset(Smarty::$_muted_directories[$this->compile_dir])) {
+            Smarty::$_muted_directories[$this->compile_dir] = null;
+        }
+        return $this;
+    }
+
+    /**
+     * Get compiled directory
+     *
+     * @return string path to compiled templates
+     */
+    public function getCompileDir()
+    {
+        return $this->compile_dir;
+    }
+
+    /**
+     * Set cache directory
+     *
+     * @param string $cache_dir directory to store cached templates in
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function setCacheDir($cache_dir)
+    {
+        $this->cache_dir = rtrim($cache_dir, '/\\') . DS;
+        if (!isset(Smarty::$_muted_directories[$this->cache_dir])) {
+            Smarty::$_muted_directories[$this->cache_dir] = null;
+        }
+        return $this;
+    }
+
+    /**
+     * Get cache directory
+     *
+     * @return string path of cache directory
+     */
+    public function getCacheDir()
+    {
+        return $this->cache_dir;
+    }
+
+    /**
+     * Set default modifiers
+     *
+     * @param array|string $modifiers modifier or list of modifiers to set
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function setDefaultModifiers($modifiers)
+    {
+        $this->default_modifiers = (array) $modifiers;
+        return $this;
+    }
+
+    /**
+     * Add default modifiers
+     *
+     * @param array|string $modifiers modifier or list of modifiers to add
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function addDefaultModifiers($modifiers)
+    {
+        if (is_array($modifiers)) {
+            $this->default_modifiers = array_merge($this->default_modifiers, $modifiers);
+        } else {
+            $this->default_modifiers[] = $modifiers;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get default modifiers
+     *
+     * @return array list of default modifiers
+     */
+    public function getDefaultModifiers()
+    {
+        return $this->default_modifiers;
+    }
+
+
+    /**
+     * Set autoload filters
+     *
+     * @param array $filters filters to load automatically
+     * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function setAutoloadFilters($filters, $type=null)
+    {
+        if ($type !== null) {
+            $this->autoload_filters[$type] = (array) $filters;
+        } else {
+            $this->autoload_filters = (array) $filters;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Add autoload filters
+     *
+     * @param array $filters filters to load automatically
+     * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types
+     * @return Smarty current Smarty instance for chaining
+     */
+    public function addAutoloadFilters($filters, $type=null)
+    {
+        if ($type !== null) {
+            if (!empty($this->autoload_filters[$type])) {
+                $this->autoload_filters[$type] = array_merge($this->autoload_filters[$type], (array) $filters);
+            } else {
+                $this->autoload_filters[$type] = (array) $filters;
+            }
+        } else {
+            foreach ((array) $filters as $key => $value) {
+                if (!empty($this->autoload_filters[$key])) {
+                    $this->autoload_filters[$key] = array_merge($this->autoload_filters[$key], (array) $value);
+                } else {
+                    $this->autoload_filters[$key] = (array) $value;
+                }
+            }
+        }
+
+        return $this;
+    }
+
+    /**
+     * Get autoload filters
+     *
+     * @param string $type type of filter to get autoloads for. Defaults to all autoload filters
+     * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified
+     */
+    public function getAutoloadFilters($type=null)
+    {
+        if ($type !== null) {
+            return isset($this->autoload_filters[$type]) ? $this->autoload_filters[$type] : array();
+        }
+
+        return $this->autoload_filters;
+    }
+
+    /**
+     * return name of debugging template
+     *
+     * @return string
+     */
+    public function getDebugTemplate()
+    {
+        return $this->debug_tpl;
+    }
+
+    /**
+     * set the debug template
+     *
+     * @param string $tpl_name
+     * @return Smarty current Smarty instance for chaining
+     * @throws SmartyException if file is not readable
+     */
+    public function setDebugTemplate($tpl_name)
+    {
+        if (!is_readable($tpl_name)) {
+            throw new SmartyException("Unknown file '{$tpl_name}'");
+        }
+        $this->debug_tpl = $tpl_name;
+
+        return $this;
+    }
+
+    /**
+     * creates a template object
+     *
+     * @param string $template the resource handle of the template file
+     * @param mixed $cache_id cache id to be used with this template
+     * @param mixed $compile_id compile id to be used with this template
+     * @param object $parent next higher level of Smarty variables
+     * @param boolean $do_clone flag is Smarty object shall be cloned
+     * @return object template object
+     */
+    public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
+    {
+        if (!empty($cache_id) && (is_object($cache_id) || is_array($cache_id))) {
+            $parent = $cache_id;
+            $cache_id = null;
+        }
+        if (!empty($parent) && is_array($parent)) {
+            $data = $parent;
+            $parent = null;
+        } else {
+            $data = null;
+        }
+        // default to cache_id and compile_id of Smarty object
+        $cache_id = $cache_id === null ? $this->cache_id : $cache_id;
+        $compile_id = $compile_id === null ? $this->compile_id : $compile_id;
+        // already in template cache?
+        if ($this->allow_ambiguous_resources) {
+            $_templateId = Smarty_Resource::getUniqueTemplateName($this, $template) . $cache_id . $compile_id;
+        } else {
+            $_templateId = $this->joined_template_dir . '#' . $template . $cache_id . $compile_id;
+        }
+        if (isset($_templateId[150])) {
+            $_templateId = sha1($_templateId);
+        }
+        if ($do_clone) {
+            if (isset($this->template_objects[$_templateId])) {
+                // return cached template object
+                $tpl = clone $this->template_objects[$_templateId];
+                $tpl->smarty = clone $tpl->smarty;
+                $tpl->parent = $parent;
+                $tpl->tpl_vars = array();
+                $tpl->config_vars = array();
+            } else {
+                $tpl = new $this->template_class($template, clone $this, $parent, $cache_id, $compile_id);
+            }
+        } else {
+            if (isset($this->template_objects[$_templateId])) {
+                // return cached template object
+                $tpl = $this->template_objects[$_templateId];
+                $tpl->parent = $parent;
+                $tpl->tpl_vars = array();
+                $tpl->config_vars = array();
+            } else {
+                $tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id);
+            }
+        }
+        // fill data if present
+        if (!empty($data) && is_array($data)) {
+            // set up variable values
+            foreach ($data as $_key => $_val) {
+                $tpl->tpl_vars[$_key] = new Smarty_variable($_val);
+            }
+        }
+        return $tpl;
+    }
+
+
+    /**
+     * Takes unknown classes and loads plugin files for them
+     * class name format: Smarty_PluginType_PluginName
+     * plugin filename format: plugintype.pluginname.php
+     *
+     * @param string $plugin_name    class plugin name to load
+     * @param bool   $check          check if already loaded
+     * @return string |boolean filepath of loaded file or false
+     */
+    public function loadPlugin($plugin_name, $check = true)
+    {
+        // if function or class exists, exit silently (already loaded)
+        if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) {
+            return true;
+        }
+        // Plugin name is expected to be: Smarty_[Type]_[Name]
+        $_name_parts = explode('_', $plugin_name, 3);
+        // class name must have three parts to be valid plugin
+        // count($_name_parts) < 3 === !isset($_name_parts[2])
+        if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') {
+            throw new SmartyException("plugin {$plugin_name} is not a valid name format");
+            return false;
+        }
+        // if type is "internal", get plugin from sysplugins
+        if (strtolower($_name_parts[1]) == 'internal') {
+            $file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';
+            if (file_exists($file)) {
+                require_once($file);
+                return $file;
+            } else {
+                return false;
+            }
+        }
+        // plugin filename is expected to be: [type].[name].php
+        $_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.php";
+        
+        $_stream_resolve_include_path = function_exists('stream_resolve_include_path');
+
+        // loop through plugin dirs and find the plugin
+        foreach($this->getPluginsDir() as $_plugin_dir) {
+            $names = array(
+                $_plugin_dir . $_plugin_filename,
+                $_plugin_dir . strtolower($_plugin_filename),
+            );
+            foreach ($names as $file) {
+                if (file_exists($file)) {
+                    require_once($file);
+                    return $file;
+                }
+                if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
+                    // try PHP include_path
+                    if ($_stream_resolve_include_path) {
+                        $file = stream_resolve_include_path($file);
+                    } else {
+                        $file = Smarty_Internal_Get_Include_Path::getIncludePath($file);
+                    }
+                    
+                    if ($file !== false) {
+                        require_once($file);
+                        return $file;
+                    }
+                }
+            }
+        }
+        // no plugin loaded
+        return false;
+    }
+
+    /**
+     * Compile all template files
+     *
+     * @param string $extension file extension
+     * @param bool $force_compile force all to recompile
+     * @param int $time_limit
+     * @param int $max_errors
+     * @return integer number of template files recompiled
+     */
+    public function compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
+    {
+        return Smarty_Internal_Utility::compileAllTemplates($extention, $force_compile, $time_limit, $max_errors, $this);
+    }
+
+    /**
+     * Compile all config files
+     *
+     * @param string $extension file extension
+     * @param bool $force_compile force all to recompile
+     * @param int $time_limit
+     * @param int $max_errors
+     * @return integer number of template files recompiled
+     */
+    public function compileAllConfig($extention = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null)
+    {
+        return Smarty_Internal_Utility::compileAllConfig($extention, $force_compile, $time_limit, $max_errors, $this);
+    }
+
+    /**
+     * Delete compiled template file
+     *
+     * @param string $resource_name template name
+     * @param string $compile_id compile id
+     * @param integer $exp_time expiration time
+     * @return integer number of template files deleted
+     */
+    public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)
+    {
+        return Smarty_Internal_Utility::clearCompiledTemplate($resource_name, $compile_id, $exp_time, $this);
+    }
+
+
+    /**
+     * Return array of tag/attributes of all tags used by an template
+     *
+     * @param object $templae template object
+     * @return array of tag/attributes
+     */
+    public function getTags(Smarty_Internal_Template $template)
+    {
+        return Smarty_Internal_Utility::getTags($template);
+    }
+
+    /**
+     * Run installation test
+     *
+     * @param array $errors Array to write errors into, rather than outputting them
+     * @return boolean true if setup is fine, false if something is wrong
+     */
+    public function testInstall(&$errors=null)
+    {
+        return Smarty_Internal_Utility::testInstall($this, $errors);
+    }
+
+    /**
+     * Error Handler to mute expected messages
+     *
+     * @link http://php.net/set_error_handler
+     * @param integer $errno Error level
+     * @return boolean
+     */
+    public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)
+    {
+        $_is_muted_directory = false;
+
+        // add the SMARTY_DIR to the list of muted directories
+        if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) {
+            $smarty_dir = realpath(SMARTY_DIR);
+            Smarty::$_muted_directories[SMARTY_DIR] = array(
+                'file' => $smarty_dir,
+                'length' => strlen($smarty_dir),
+            );
+        }
+
+        // walk the muted directories and test against $errfile
+        foreach (Smarty::$_muted_directories as $key => &$dir) {
+            if (!$dir) {
+                // resolve directory and length for speedy comparisons
+                $file = realpath($key);
+                $dir = array(
+                    'file' => $file,
+                    'length' => strlen($file),
+                );
+            }
+            if (!strncmp($errfile, $dir['file'], $dir['length'])) {
+                $_is_muted_directory = true;
+                break;
+            }
+        }
+
+        // pass to next error handler if this error did not occur inside SMARTY_DIR
+        // or the error was within smarty but masked to be ignored
+        if (!$_is_muted_directory || ($errno && $errno & error_reporting())) {
+            if (Smarty::$_previous_error_handler) {
+                return call_user_func(Smarty::$_previous_error_handler, $errno, $errstr, $errfile, $errline, $errcontext);
+            } else {
+                return false;
+            }
+        }
+    }
+
+    /**
+     * Enable error handler to mute expected messages
+     *
+     * @return void
+     */
+    public static function muteExpectedErrors()
+    {
+        /*
+            error muting is done because some people implemented custom error_handlers using
+            http://php.net/set_error_handler and for some reason did not understand the following paragraph:
+
+                It is important to remember that the standard PHP error handler is completely bypassed for the
+                error types specified by error_types unless the callback function returns FALSE.
+                error_reporting() settings will have no effect and your error handler will be called regardless -
+                however you are still able to read the current value of error_reporting and act appropriately.
+                Of particular note is that this value will be 0 if the statement that caused the error was
+                prepended by the @ error-control operator.
+
+            Smarty deliberately uses @filemtime() over file_exists() and filemtime() in some places. Reasons include
+                - @filemtime() is almost twice as fast as using an additional file_exists()
+                - between file_exists() and filemtime() a possible race condition is opened,
+                  which does not exist using the simple @filemtime() approach.
+        */
+        $error_handler = array('Smarty', 'mutingErrorHandler');
+        $previous = set_error_handler($error_handler);
+
+        // avoid dead loops
+        if ($previous !== $error_handler) {
+            Smarty::$_previous_error_handler = $previous;
+        }
+    }
+
+    /**
+     * Disable error handler muting expected messages
+     *
+     * @return void
+     */
+    public static function unmuteExpectedErrors()
+    {
+        restore_error_handler();
+    }
+}
+
+// Check if we're running on windows
+Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
+
+// let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8
+if (Smarty::$_CHARSET !== 'UTF-8') {
+    Smarty::$_UTF8_MODIFIER = '';
+}
+
+/**
+ * Smarty exception class
+ * @package Smarty
+ */
+class SmartyException extends Exception {
+}
+
+/**
+ * Smarty compiler exception class
+ * @package Smarty
+ */
+class SmartyCompilerException extends SmartyException  {
+}
+
+/**
+ * Autoloader
+ */
+function smartyAutoload($class)
+{
+    $_class = strtolower($class);
+    $_classes = array(
+        'smarty_config_source' => true,
+        'smarty_config_compiled' => true,
+        'smarty_security' => true,
+        'smarty_cacheresource' => true,
+        'smarty_cacheresource_custom' => true,
+        'smarty_cacheresource_keyvaluestore' => true,
+        'smarty_resource' => true,
+        'smarty_resource_custom' => true,
+        'smarty_resource_uncompiled' => true,
+        'smarty_resource_recompiled' => true,
+    );
+
+    if (!strncmp($_class, 'smarty_internal_', 16) || isset($_classes[$_class])) {
+        include SMARTY_SYSPLUGINS_DIR . $_class . '.php';
+    }
+}
+
+?>
diff --git a/library/Smarty/libs/SmartyBC.class.php b/library/Smarty/libs/SmartyBC.class.php
new file mode 100644 (file)
index 0000000..f8f0a13
--- /dev/null
@@ -0,0 +1,460 @@
+<?php\r
+/**\r
+ * Project:     Smarty: the PHP compiling template engine\r
+ * File:        SmartyBC.class.php\r
+ * SVN:         $Id: $\r
+ *\r
+ * This library is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU Lesser General Public\r
+ * License as published by the Free Software Foundation; either\r
+ * version 2.1 of the License, or (at your option) any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+ * Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with this library; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ *\r
+ * For questions, help, comments, discussion, etc., please join the\r
+ * Smarty mailing list. Send a blank e-mail to\r
+ * smarty-discussion-subscribe@googlegroups.com\r
+ *\r
+ * @link http://www.smarty.net/\r
+ * @copyright 2008 New Digital Group, Inc.\r
+ * @author Monte Ohrt <monte at ohrt dot com>\r
+ * @author Uwe Tews\r
+ * @author Rodney Rehm\r
+ * @package Smarty\r
+ */\r
+/**\r
+ * @ignore\r
+ */\r
+require(dirname(__FILE__) . '/Smarty.class.php');\r
+\r
+/**\r
+ * Smarty Backward Compatability Wrapper Class\r
+ *\r
+ * @package Smarty\r
+ */\r
+class SmartyBC extends Smarty {\r
+\r
+    /**\r
+     * Smarty 2 BC\r
+     * @var string\r
+     */\r
+    public $_version = self::SMARTY_VERSION;\r
+\r
+    /**\r
+     * Initialize new SmartyBC object\r
+     *\r
+     * @param array $options options to set during initialization, e.g. array( 'forceCompile' => false )\r
+     */\r
+    public function __construct(array $options=array())\r
+    {\r
+        parent::__construct($options);\r
+        // register {php} tag\r
+        $this->registerPlugin('block', 'php', 'smarty_php_tag');\r
+    }\r
+\r
+    /**\r
+     * wrapper for assign_by_ref\r
+     *\r
+     * @param string $tpl_var the template variable name\r
+     * @param mixed  &$value  the referenced value to assign\r
+     */\r
+    public function assign_by_ref($tpl_var, &$value)\r
+    {\r
+        $this->assignByRef($tpl_var, $value);\r
+    }\r
+\r
+    /**\r
+     * wrapper for append_by_ref\r
+     *\r
+     * @param string  $tpl_var the template variable name\r
+     * @param mixed   &$value  the referenced value to append\r
+     * @param boolean $merge   flag if array elements shall be merged\r
+     */\r
+    public function append_by_ref($tpl_var, &$value, $merge = false)\r
+    {\r
+        $this->appendByRef($tpl_var, $value, $merge);\r
+    }\r
+\r
+    /**\r
+     * clear the given assigned template variable.\r
+     *\r
+     * @param string $tpl_var the template variable to clear\r
+     */\r
+    public function clear_assign($tpl_var)\r
+    {\r
+        $this->clearAssign($tpl_var);\r
+    }\r
+\r
+    /**\r
+     * Registers custom function to be used in templates\r
+     *\r
+     * @param string $function      the name of the template function\r
+     * @param string $function_impl the name of the PHP function to register\r
+     * @param bool   $cacheable\r
+     * @param mixed  $cache_attrs\r
+     */\r
+    public function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)\r
+    {\r
+        $this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs);\r
+    }\r
+\r
+    /**\r
+     * Unregisters custom function\r
+     *\r
+     * @param string $function name of template function\r
+     */\r
+    public function unregister_function($function)\r
+    {\r
+        $this->unregisterPlugin('function', $function);\r
+    }\r
+\r
+    /**\r
+     * Registers object to be used in templates\r
+     *\r
+     * @param string  $object      name of template object\r
+     * @param object  $object_impl the referenced PHP object to register\r
+     * @param array   $allowed     list of allowed methods (empty = all)\r
+     * @param boolean $smarty_args smarty argument format, else traditional\r
+     * @param array   $block_functs list of methods that are block format\r
+     */\r
+    public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())\r
+    {\r
+        settype($allowed, 'array');\r
+        settype($smarty_args, 'boolean');\r
+        $this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods);\r
+    }\r
+\r
+    /**\r
+     * Unregisters object\r
+     *\r
+     * @param string $object name of template object\r
+     */\r
+    public function unregister_object($object)\r
+    {\r
+        $this->unregisterObject($object);\r
+    }\r
+\r
+    /**\r
+     * Registers block function to be used in templates\r
+     *\r
+     * @param string $block      name of template block\r
+     * @param string $block_impl PHP function to register\r
+     * @param bool   $cacheable\r
+     * @param mixed  $cache_attrs\r
+     */\r
+    public function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)\r
+    {\r
+        $this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs);\r
+    }\r
+\r
+    /**\r
+     * Unregisters block function\r
+     *\r
+     * @param string $block name of template function\r
+     */\r
+    public function unregister_block($block)\r
+    {\r
+        $this->unregisterPlugin('block', $block);\r
+    }\r
+\r
+    /**\r
+     * Registers compiler function\r
+     *\r
+     * @param string $function      name of template function\r
+     * @param string $function_impl name of PHP function to register\r
+     * @param bool   $cacheable\r
+     */\r
+    public function register_compiler_function($function, $function_impl, $cacheable=true)\r
+    {\r
+        $this->registerPlugin('compiler', $function, $function_impl, $cacheable);\r
+    }\r
+\r
+    /**\r
+     * Unregisters compiler function\r
+     *\r
+     * @param string $function name of template function\r
+     */\r
+    public function unregister_compiler_function($function)\r
+    {\r
+        $this->unregisterPlugin('compiler', $function);\r
+    }\r
+\r
+    /**\r
+     * Registers modifier to be used in templates\r
+     *\r
+     * @param string $modifier name of template modifier\r
+     * @param string $modifier_impl name of PHP function to register\r
+     */\r
+    public function register_modifier($modifier, $modifier_impl)\r
+    {\r
+        $this->registerPlugin('modifier', $modifier, $modifier_impl);\r
+    }\r
+\r
+    /**\r
+     * Unregisters modifier\r
+     *\r
+     * @param string $modifier name of template modifier\r
+     */\r
+    public function unregister_modifier($modifier)\r
+    {\r
+        $this->unregisterPlugin('modifier', $modifier);\r
+    }\r
+\r
+    /**\r
+     * Registers a resource to fetch a template\r
+     *\r
+     * @param string $type      name of resource\r
+     * @param array  $functions array of functions to handle resource\r
+     */\r
+    public function register_resource($type, $functions)\r
+    {\r
+        $this->registerResource($type, $functions);\r
+    }\r
+\r
+    /**\r
+     * Unregisters a resource\r
+     *\r
+     * @param string $type name of resource\r
+     */\r
+    public function unregister_resource($type)\r
+    {\r
+        $this->unregisterResource($type);\r
+    }\r
+\r
+    /**\r
+     * Registers a prefilter function to apply\r
+     * to a template before compiling\r
+     *\r
+     * @param callable $function\r
+     */\r
+    public function register_prefilter($function)\r
+    {\r
+        $this->registerFilter('pre', $function);\r
+    }\r
+\r
+    /**\r
+     * Unregisters a prefilter function\r
+     *\r
+     * @param callable $function\r
+     */\r
+    public function unregister_prefilter($function)\r
+    {\r
+        $this->unregisterFilter('pre', $function);\r
+    }\r
+\r
+    /**\r
+     * Registers a postfilter function to apply\r
+     * to a compiled template after compilation\r
+     *\r
+     * @param callable $function\r
+     */\r
+    public function register_postfilter($function)\r
+    {\r
+        $this->registerFilter('post', $function);\r
+    }\r
+\r
+    /**\r
+     * Unregisters a postfilter function\r
+     *\r
+     * @param callable $function\r
+     */\r
+    public function unregister_postfilter($function)\r
+    {\r
+        $this->unregisterFilter('post', $function);\r
+    }\r
+\r
+    /**\r
+     * Registers an output filter function to apply\r
+     * to a template output\r
+     *\r
+     * @param callable $function\r
+     */\r
+    public function register_outputfilter($function)\r
+    {\r
+        $this->registerFilter('output', $function);\r
+    }\r
+\r
+    /**\r
+     * Unregisters an outputfilter function\r
+     *\r
+     * @param callable $function\r
+     */\r
+    public function unregister_outputfilter($function)\r
+    {\r
+        $this->unregisterFilter('output', $function);\r
+    }\r
+\r
+    /**\r
+     * load a filter of specified type and name\r
+     *\r
+     * @param string $type filter type\r
+     * @param string $name filter name\r
+     */\r
+    public function load_filter($type, $name)\r
+    {\r
+        $this->loadFilter($type, $name);\r
+    }\r
+\r
+    /**\r
+     * clear cached content for the given template and cache id\r
+     *\r
+     * @param string $tpl_file   name of template file\r
+     * @param string $cache_id   name of cache_id\r
+     * @param string $compile_id name of compile_id\r
+     * @param string $exp_time   expiration time\r
+     * @return boolean\r
+     */\r
+    public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)\r
+    {\r
+        return $this->clearCache($tpl_file, $cache_id, $compile_id, $exp_time);\r
+    }\r
+\r
+    /**\r
+     * clear the entire contents of cache (all templates)\r
+     *\r
+     * @param string $exp_time expire time\r
+     * @return boolean\r
+     */\r
+    public function clear_all_cache($exp_time = null)\r
+    {\r
+        return $this->clearCache(null, null, null, $exp_time);\r
+    }\r
+\r
+    /**\r
+     * test to see if valid cache exists for this template\r
+     *\r
+     * @param string $tpl_file name of template file\r
+     * @param string $cache_id\r
+     * @param string $compile_id\r
+     * @return boolean\r
+     */\r
+    public function is_cached($tpl_file, $cache_id = null, $compile_id = null)\r
+    {\r
+        return $this->isCached($tpl_file, $cache_id, $compile_id);\r
+    }\r
+\r
+    /**\r
+     * clear all the assigned template variables.\r
+     */\r
+    public function clear_all_assign()\r
+    {\r
+        $this->clearAllAssign();\r
+    }\r
+\r
+    /**\r
+     * clears compiled version of specified template resource,\r
+     * or all compiled template files if one is not specified.\r
+     * This function is for advanced use only, not normally needed.\r
+     *\r
+     * @param string $tpl_file\r
+     * @param string $compile_id\r
+     * @param string $exp_time\r
+     * @return boolean results of {@link smarty_core_rm_auto()}\r
+     */\r
+    public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)\r
+    {\r
+        return $this->clearCompiledTemplate($tpl_file, $compile_id, $exp_time);\r
+    }\r
+\r
+    /**\r
+     * Checks whether requested template exists.\r
+     *\r
+     * @param string $tpl_file\r
+     * @return boolean\r
+     */\r
+    public function template_exists($tpl_file)\r
+    {\r
+        return $this->templateExists($tpl_file);\r
+    }\r
+\r
+    /**\r
+     * Returns an array containing template variables\r
+     *\r
+     * @param string $name\r
+     * @return array\r
+     */\r
+    public function get_template_vars($name=null)\r
+    {\r
+        return $this->getTemplateVars($name);\r
+    }\r
+\r
+    /**\r
+     * Returns an array containing config variables\r
+     *\r
+     * @param string $name\r
+     * @return array\r
+     */\r
+    public function get_config_vars($name=null)\r
+    {\r
+        return $this->getConfigVars($name);\r
+    }\r
+\r
+    /**\r
+     * load configuration values\r
+     *\r
+     * @param string $file\r
+     * @param string $section\r
+     * @param string $scope\r
+     */\r
+    public function config_load($file, $section = null, $scope = 'global')\r
+    {\r
+        $this->ConfigLoad($file, $section, $scope);\r
+    }\r
+\r
+    /**\r
+     * return a reference to a registered object\r
+     *\r
+     * @param string $name\r
+     * @return object\r
+     */\r
+    public function get_registered_object($name)\r
+    {\r
+        return $this->getRegisteredObject($name);\r
+    }\r
+\r
+    /**\r
+     * clear configuration values\r
+     *\r
+     * @param string $var\r
+     */\r
+    public function clear_config($var = null)\r
+    {\r
+        $this->clearConfig($var);\r
+    }\r
+\r
+    /**\r
+     * trigger Smarty error\r
+     *\r
+     * @param string $error_msg\r
+     * @param integer $error_type\r
+     */\r
+    public function trigger_error($error_msg, $error_type = E_USER_WARNING)\r
+    {\r
+        trigger_error("Smarty error: $error_msg", $error_type);\r
+    }\r
+\r
+}\r
+\r
+/**\r
+ * Smarty {php}{/php} block function\r
+ *\r
+ * @param array   $params   parameter list\r
+ * @param string  $content  contents of the block\r
+ * @param object  $template template object\r
+ * @param boolean &$repeat  repeat flag\r
+ * @return string content re-formatted\r
+ */\r
+function smarty_php_tag($params, $content, $template, &$repeat)\r
+{\r
+    eval($content);\r
+    return '';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/debug.tpl b/library/Smarty/libs/debug.tpl
new file mode 100644 (file)
index 0000000..12eef0f
--- /dev/null
@@ -0,0 +1,133 @@
+{capture name='_smarty_debug' assign=debug_output}
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+    <title>Smarty Debug Console</title>
+<style type="text/css">
+{literal}
+body, h1, h2, td, th, p {
+    font-family: sans-serif;
+    font-weight: normal;
+    font-size: 0.9em;
+    margin: 1px;
+    padding: 0;
+}
+
+h1 {
+    margin: 0;
+    text-align: left;
+    padding: 2px;
+    background-color: #f0c040;
+    color:  black;
+    font-weight: bold;
+    font-size: 1.2em;
+ }
+
+h2 {
+    background-color: #9B410E;
+    color: white;
+    text-align: left;
+    font-weight: bold;
+    padding: 2px;
+    border-top: 1px solid black;
+}
+
+body {
+    background: black; 
+}
+
+p, table, div {
+    background: #f0ead8;
+} 
+
+p {
+    margin: 0;
+    font-style: italic;
+    text-align: center;
+}
+
+table {
+    width: 100%;
+}
+
+th, td {
+    font-family: monospace;
+    vertical-align: top;
+    text-align: left;
+    width: 50%;
+}
+
+td {
+    color: green;
+}
+
+.odd {
+    background-color: #eeeeee;
+}
+
+.even {
+    background-color: #fafafa;
+}
+
+.exectime {
+    font-size: 0.8em;
+    font-style: italic;
+}
+
+#table_assigned_vars th {
+    color: blue;
+}
+
+#table_config_vars th {
+    color: maroon;
+}
+{/literal}
+</style>
+</head>
+<body>
+
+<h1>Smarty Debug Console  -  {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1>
+
+{if !empty($template_data)}
+<h2>included templates &amp; config files (load time in seconds)</h2>
+
+<div>
+{foreach $template_data as $template}
+  <font color=brown>{$template.name}</font>
+  <span class="exectime">
+   (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"})
+  </span>
+  <br>
+{/foreach}
+</div>
+{/if}
+
+<h2>assigned template variables</h2>
+
+<table id="table_assigned_vars">
+    {foreach $assigned_vars as $vars}
+       <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">   
+       <th>${$vars@key|escape:'html'}</th>
+       <td>{$vars|debug_print_var nofilter}</td></tr>
+    {/foreach}
+</table>
+
+<h2>assigned config file variables (outer template scope)</h2>
+
+<table id="table_config_vars">
+    {foreach $config_vars as $vars}
+       <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">   
+       <th>{$vars@key|escape:'html'}</th>
+       <td>{$vars|debug_print_var nofilter}</td></tr>
+    {/foreach}
+
+</table>
+</body>
+</html>
+{/capture}
+<script type="text/javascript">
+{$id = $template_name|default:''|md5}
+    _smarty_console = window.open("","console{$id}","width=680,height=600,resizable,scrollbars=yes");
+    _smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}");
+    _smarty_console.document.close();
+</script>
diff --git a/library/Smarty/libs/plugins/block.textformat.php b/library/Smarty/libs/plugins/block.textformat.php
new file mode 100644 (file)
index 0000000..b22b104
--- /dev/null
@@ -0,0 +1,113 @@
+<?php
+/**
+ * Smarty plugin to format text blocks
+ *
+ * @package Smarty
+ * @subpackage PluginsBlock
+ */
+
+/**
+ * Smarty {textformat}{/textformat} block plugin
+ *
+ * Type:     block function<br>
+ * Name:     textformat<br>
+ * Purpose:  format text a certain way with preset styles
+ *           or custom wrap/indent settings<br>
+ * Params:
+ * <pre>
+ * - style         - string (email)
+ * - indent        - integer (0)
+ * - wrap          - integer (80)
+ * - wrap_char     - string ("\n")
+ * - indent_char   - string (" ")
+ * - wrap_boundary - boolean (true)
+ * </pre>
+ *
+ * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat}
+ *       (Smarty online manual)
+ * @param array                    $params   parameters
+ * @param string                   $content  contents of the block
+ * @param Smarty_Internal_Template $template template object
+ * @param boolean                  &$repeat  repeat flag
+ * @return string content re-formatted
+ * @author Monte Ohrt <monte at ohrt dot com>
+ */
+function smarty_block_textformat($params, $content, $template, &$repeat)
+{
+    if (is_null($content)) {
+        return;
+    }
+
+    $style = null;
+    $indent = 0;
+    $indent_first = 0;
+    $indent_char = ' ';
+    $wrap = 80;
+    $wrap_char = "\n";
+    $wrap_cut = false;
+    $assign = null;
+
+    foreach ($params as $_key => $_val) {
+        switch ($_key) {
+            case 'style':
+            case 'indent_char':
+            case 'wrap_char':
+            case 'assign':
+                $$_key = (string)$_val;
+                break;
+
+            case 'indent':
+            case 'indent_first':
+            case 'wrap':
+                $$_key = (int)$_val;
+                break;
+
+            case 'wrap_cut':
+                $$_key = (bool)$_val;
+                break;
+
+            default:
+                trigger_error("textformat: unknown attribute '$_key'");
+        }
+    }
+
+    if ($style == 'email') {
+        $wrap = 72;
+    }
+    // split into paragraphs
+    $_paragraphs = preg_split('![\r\n]{2}!', $content);
+    $_output = '';
+
+
+    foreach ($_paragraphs as &$_paragraph) {
+        if (!$_paragraph) {
+            continue;
+        }
+        // convert mult. spaces & special chars to single space
+        $_paragraph = preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), array(' ', ''), $_paragraph);
+        // indent first line
+        if ($indent_first > 0) {
+            $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph;
+        }
+        // wordwrap sentences
+        if (Smarty::$_MBSTRING) {
+            require_once(SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php');
+            $_paragraph = smarty_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
+        } else {
+            $_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
+        }
+        // indent lines
+        if ($indent > 0) {
+            $_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph);
+        }
+    }
+    $_output = implode($wrap_char . $wrap_char, $_paragraphs);
+    
+    if ($assign) {
+        $template->assign($assign, $_output);
+    } else {
+        return $_output;
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.counter.php b/library/Smarty/libs/plugins/function.counter.php
new file mode 100644 (file)
index 0000000..3906bad
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {counter} function plugin
+ *
+ * Type:     function<br>
+ * Name:     counter<br>
+ * Purpose:  print out a counter value
+ *
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @link http://www.smarty.net/manual/en/language.function.counter.php {counter}
+ *       (Smarty online manual)
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string|null
+ */
+function smarty_function_counter($params, $template)
+{
+    static $counters = array();
+
+    $name = (isset($params['name'])) ? $params['name'] : 'default';
+    if (!isset($counters[$name])) {
+        $counters[$name] = array(
+            'start'=>1,
+            'skip'=>1,
+            'direction'=>'up',
+            'count'=>1
+            );
+    }
+    $counter =& $counters[$name];
+
+    if (isset($params['start'])) {
+        $counter['start'] = $counter['count'] = (int)$params['start'];
+    }
+
+    if (!empty($params['assign'])) {
+        $counter['assign'] = $params['assign'];
+    }
+
+    if (isset($counter['assign'])) {
+        $template->assign($counter['assign'], $counter['count']);
+    }
+    
+    if (isset($params['print'])) {
+        $print = (bool)$params['print'];
+    } else {
+        $print = empty($counter['assign']);
+    }
+
+    if ($print) {
+        $retval = $counter['count'];
+    } else {
+        $retval = null;
+    }
+
+    if (isset($params['skip'])) {
+        $counter['skip'] = $params['skip'];
+    }
+    
+    if (isset($params['direction'])) {
+        $counter['direction'] = $params['direction'];
+    }
+
+    if ($counter['direction'] == "down")
+        $counter['count'] -= $counter['skip'];
+    else
+        $counter['count'] += $counter['skip'];
+    
+    return $retval;
+    
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.cycle.php b/library/Smarty/libs/plugins/function.cycle.php
new file mode 100644 (file)
index 0000000..1778ffb
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {cycle} function plugin
+ *
+ * Type:     function<br>
+ * Name:     cycle<br>
+ * Date:     May 3, 2002<br>
+ * Purpose:  cycle through given values<br>
+ * Params:
+ * <pre>
+ * - name      - name of cycle (optional)
+ * - values    - comma separated list of values to cycle, or an array of values to cycle
+ *               (this can be left out for subsequent calls)
+ * - reset     - boolean - resets given var to true
+ * - print     - boolean - print var or not. default is true
+ * - advance   - boolean - whether or not to advance the cycle
+ * - delimiter - the value delimiter, default is ","
+ * - assign    - boolean, assigns to template var instead of printed.
+ * </pre>
+ * Examples:<br>
+ * <pre>
+ * {cycle values="#eeeeee,#d0d0d0d"}
+ * {cycle name=row values="one,two,three" reset=true}
+ * {cycle name=row}
+ * </pre>
+ *
+ * @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credit to Mark Priatel <mpriatel@rogers.com>
+ * @author credit to Gerard <gerard@interfold.com>
+ * @author credit to Jason Sweat <jsweat_php@yahoo.com>
+ * @version  1.3
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string|null
+ */
+
+function smarty_function_cycle($params, $template)
+{
+    static $cycle_vars;
+
+    $name = (empty($params['name'])) ? 'default' : $params['name'];
+    $print = (isset($params['print'])) ? (bool)$params['print'] : true;
+    $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true;
+    $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false;
+
+    if (!isset($params['values'])) {
+        if(!isset($cycle_vars[$name]['values'])) {
+            trigger_error("cycle: missing 'values' parameter");
+            return;
+        }
+    } else {
+        if(isset($cycle_vars[$name]['values'])
+            && $cycle_vars[$name]['values'] != $params['values'] ) {
+            $cycle_vars[$name]['index'] = 0;
+        }
+        $cycle_vars[$name]['values'] = $params['values'];
+    }
+
+    if (isset($params['delimiter'])) {
+        $cycle_vars[$name]['delimiter'] = $params['delimiter'];
+    } elseif (!isset($cycle_vars[$name]['delimiter'])) {
+        $cycle_vars[$name]['delimiter'] = ',';
+    }
+
+    if(is_array($cycle_vars[$name]['values'])) {
+        $cycle_array = $cycle_vars[$name]['values'];
+    } else {
+        $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']);
+    }
+
+    if(!isset($cycle_vars[$name]['index']) || $reset ) {
+        $cycle_vars[$name]['index'] = 0;
+    }
+
+    if (isset($params['assign'])) {
+        $print = false;
+        $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
+    }
+
+    if($print) {
+        $retval = $cycle_array[$cycle_vars[$name]['index']];
+    } else {
+        $retval = null;
+    }
+
+    if($advance) {
+        if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) {
+            $cycle_vars[$name]['index'] = 0;
+        } else {
+            $cycle_vars[$name]['index']++;
+        }
+    }
+
+    return $retval;
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.fetch.php b/library/Smarty/libs/plugins/function.fetch.php
new file mode 100644 (file)
index 0000000..eca1182
--- /dev/null
@@ -0,0 +1,214 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {fetch} plugin
+ *
+ * Type:     function<br>
+ * Name:     fetch<br>
+ * Purpose:  fetch file, web or ftp data and display results
+ *
+ * @link http://www.smarty.net/manual/en/language.function.fetch.php {fetch}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable
+ */
+function smarty_function_fetch($params, $template)
+{
+    if (empty($params['file'])) {
+        trigger_error("[plugin] fetch parameter 'file' cannot be empty",E_USER_NOTICE);
+        return;
+    }
+    
+    // strip file protocol
+    if (stripos($params['file'], 'file://') === 0) {
+        $params['file'] = substr($params['file'], 7);
+    }
+    
+    $protocol = strpos($params['file'], '://');
+    if ($protocol !== false) {
+        $protocol = strtolower(substr($params['file'], 0, $protocol));
+    }
+    
+    if (isset($template->smarty->security_policy)) {
+        if ($protocol) {
+            // remote resource (or php stream, …)
+            if(!$template->smarty->security_policy->isTrustedUri($params['file'])) {
+                return;
+            }
+        } else {
+            // local file
+            if(!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) {
+                return;
+            }
+        }
+    }
+
+    $content = '';
+    if ($protocol == 'http') {
+        // http fetch
+        if($uri_parts = parse_url($params['file'])) {
+            // set defaults
+            $host = $server_name = $uri_parts['host'];
+            $timeout = 30;
+            $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
+            $agent = "Smarty Template Engine ". Smarty::SMARTY_VERSION;
+            $referer = "";
+            $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/';
+            $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : '';
+            $_is_proxy = false;
+            if(empty($uri_parts['port'])) {
+                $port = 80;
+            } else {
+                $port = $uri_parts['port'];
+            }
+            if(!empty($uri_parts['user'])) {
+                $user = $uri_parts['user'];
+            }
+            if(!empty($uri_parts['pass'])) {
+                $pass = $uri_parts['pass'];
+            }
+            // loop through parameters, setup headers
+            foreach($params as $param_key => $param_value) {
+                switch($param_key) {
+                    case "file":
+                    case "assign":
+                    case "assign_headers":
+                        break;
+                    case "user":
+                        if(!empty($param_value)) {
+                            $user = $param_value;
+                        }
+                        break;
+                    case "pass":
+                        if(!empty($param_value)) {
+                            $pass = $param_value;
+                        }
+                        break;
+                    case "accept":
+                        if(!empty($param_value)) {
+                            $accept = $param_value;
+                        }
+                        break;
+                    case "header":
+                        if(!empty($param_value)) {
+                            if(!preg_match('![\w\d-]+: .+!',$param_value)) {
+                                trigger_error("[plugin] invalid header format '".$param_value."'",E_USER_NOTICE);
+                                return;
+                            } else {
+                                $extra_headers[] = $param_value;
+                            }
+                        }
+                        break;
+                    case "proxy_host":
+                        if(!empty($param_value)) {
+                            $proxy_host = $param_value;
+                        }
+                        break;
+                    case "proxy_port":
+                        if(!preg_match('!\D!', $param_value)) {
+                            $proxy_port = (int) $param_value;
+                        } else {
+                            trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE);
+                            return;
+                        }
+                        break;
+                    case "agent":
+                        if(!empty($param_value)) {
+                            $agent = $param_value;
+                        }
+                        break;
+                    case "referer":
+                        if(!empty($param_value)) {
+                            $referer = $param_value;
+                        }
+                        break;
+                    case "timeout":
+                        if(!preg_match('!\D!', $param_value)) {
+                            $timeout = (int) $param_value;
+                        } else {
+                            trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE);
+                            return;
+                        }
+                        break;
+                    default:
+                        trigger_error("[plugin] unrecognized attribute '".$param_key."'",E_USER_NOTICE);
+                        return;
+                }
+            }
+            if(!empty($proxy_host) && !empty($proxy_port)) {
+                $_is_proxy = true;
+                $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout);
+            } else {
+                $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout);
+            }
+
+            if(!$fp) {
+                trigger_error("[plugin] unable to fetch: $errstr ($errno)",E_USER_NOTICE);
+                return;
+            } else {
+                if($_is_proxy) {
+                    fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n");
+                } else {
+                    fputs($fp, "GET $uri HTTP/1.0\r\n");
+                }
+                if(!empty($host)) {
+                    fputs($fp, "Host: $host\r\n");
+                }
+                if(!empty($accept)) {
+                    fputs($fp, "Accept: $accept\r\n");
+                }
+                if(!empty($agent)) {
+                    fputs($fp, "User-Agent: $agent\r\n");
+                }
+                if(!empty($referer)) {
+                    fputs($fp, "Referer: $referer\r\n");
+                }
+                if(isset($extra_headers) && is_array($extra_headers)) {
+                    foreach($extra_headers as $curr_header) {
+                        fputs($fp, $curr_header."\r\n");
+                    }
+                }
+                if(!empty($user) && !empty($pass)) {
+                    fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n");
+                }
+
+                fputs($fp, "\r\n");
+                while(!feof($fp)) {
+                    $content .= fgets($fp,4096);
+                }
+                fclose($fp);
+                $csplit = preg_split("!\r\n\r\n!",$content,2);
+
+                $content = $csplit[1];
+
+                if(!empty($params['assign_headers'])) {
+                    $template->assign($params['assign_headers'],preg_split("!\r\n!",$csplit[0]));
+                }
+            }
+        } else {
+            trigger_error("[plugin fetch] unable to parse URL, check syntax",E_USER_NOTICE);
+            return;
+        }
+    } else {
+        $content = @file_get_contents($params['file']);
+        if ($content === false) {
+            throw new SmartyException("{fetch} cannot read resource '" . $params['file'] ."'");
+        }
+    }
+
+    if (!empty($params['assign'])) {
+        $template->assign($params['assign'], $content);
+    } else {
+        return $content;
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.html_checkboxes.php b/library/Smarty/libs/plugins/function.html_checkboxes.php
new file mode 100644 (file)
index 0000000..fb9584b
--- /dev/null
@@ -0,0 +1,216 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {html_checkboxes} function plugin
+ *
+ * File:       function.html_checkboxes.php<br>
+ * Type:       function<br>
+ * Name:       html_checkboxes<br>
+ * Date:       24.Feb.2003<br>
+ * Purpose:    Prints out a list of checkbox input types<br>
+ * Examples:
+ * <pre>
+ * {html_checkboxes values=$ids output=$names}
+ * {html_checkboxes values=$ids name='box' separator='<br>' output=$names}
+ * {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * Params:
+ * <pre>
+ * - name       (optional) - string default "checkbox"
+ * - values     (required) - array
+ * - options    (optional) - associative array
+ * - checked    (optional) - array default not set
+ * - separator  (optional) - ie <br> or &nbsp;
+ * - output     (optional) - the output next to each checkbox
+ * - assign     (optional) - assign the output as an array to this variable
+ * - escape     (optional) - escape the content (not value), defaults to true
+ * </pre>
+ *
+ * @link http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
+ *      (Smarty online manual)
+ * @author     Christopher Kvarme <christopher.kvarme@flashjab.com>
+ * @author credits to Monte Ohrt <monte at ohrt dot com>
+ * @version    1.0
+ * @param array $params parameters
+ * @param object $template template object
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_checkboxes($params, $template)
+{
+    require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
+
+    $name = 'checkbox';
+    $values = null;
+    $options = null;
+    $selected = array();
+    $separator = '';
+    $escape = true;
+    $labels = true;
+    $label_ids = false;
+    $output = null;
+
+    $extra = '';
+
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'name':
+            case 'separator':
+                $$_key = (string) $_val;
+                break;
+
+            case 'escape':
+            case 'labels':
+            case 'label_ids':
+                $$_key = (bool) $_val;
+                break;
+
+            case 'options':
+                $$_key = (array) $_val;
+                break;
+
+            case 'values':
+            case 'output':
+                $$_key = array_values((array) $_val);
+                break;
+
+            case 'checked':
+            case 'selected':
+                if (is_array($_val)) {
+                    $selected = array();
+                    foreach ($_val as $_sel) {
+                        if (is_object($_sel)) {
+                            if (method_exists($_sel, "__toString")) {
+                                $_sel = smarty_function_escape_special_chars((string) $_sel->__toString());
+                            } else {
+                                trigger_error("html_checkboxes: selected attribute contains an object of class '". get_class($_sel) ."' without __toString() method", E_USER_NOTICE);
+                                continue;
+                            }
+                        } else {
+                            $_sel = smarty_function_escape_special_chars((string) $_sel);
+                        }
+                        $selected[$_sel] = true;
+                    }
+                } elseif (is_object($_val)) {
+                    if (method_exists($_val, "__toString")) {
+                        $selected = smarty_function_escape_special_chars((string) $_val->__toString());
+                    } else {
+                        trigger_error("html_checkboxes: selected attribute is an object of class '". get_class($_val) ."' without __toString() method", E_USER_NOTICE);
+                    }
+                } else {
+                    $selected = smarty_function_escape_special_chars((string) $_val);
+                }
+                break;
+
+            case 'checkboxes':
+                trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
+                $options = (array) $_val;
+                break;
+
+            case 'assign':
+                break;
+
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (!isset($options) && !isset($values))
+        return ''; /* raise error here? */
+
+    $_html_result = array();
+
+    if (isset($options)) {
+        foreach ($options as $_key=>$_val) {
+            $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape);
+        }
+    } else {
+        foreach ($values as $_i=>$_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape);
+        }
+    }
+
+    if(!empty($params['assign'])) {
+        $template->assign($params['assign'], $_html_result);
+    } else {
+        return implode("\n", $_html_result);
+    }
+
+}
+
+function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape=true) {
+    $_output = '';
+    
+    if (is_object($value)) {
+        if (method_exists($value, "__toString")) {
+            $value = (string) $value->__toString();
+        } else {
+            trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE);
+            return '';
+        }
+    } else {
+        $value = (string) $value;
+    }
+    
+    if (is_object($output)) {
+        if (method_exists($output, "__toString")) {
+            $output = (string) $output->__toString();
+        } else {
+            trigger_error("html_options: output is an object of class '". get_class($output) ."' without __toString() method", E_USER_NOTICE);
+            return '';
+        }
+    } else {
+        $output = (string) $output;
+    }
+    
+    if ($labels) {
+        if ($label_ids) {
+            $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value));
+            $_output .= '<label for="' . $_id . '">';
+        } else {
+            $_output .= '<label>';
+        } 
+    }
+    
+    $name = smarty_function_escape_special_chars($name);
+    $value = smarty_function_escape_special_chars($value);
+    if ($escape) {
+        $output = smarty_function_escape_special_chars($output);
+    }
+    
+    $_output .= '<input type="checkbox" name="' . $name . '[]" value="' . $value . '"';
+    
+    if ($labels && $label_ids) {
+        $_output .= ' id="' . $_id . '"';
+    }
+    
+    if (is_array($selected)) {
+        if (isset($selected[$value])) {
+            $_output .= ' checked="checked"';
+        }
+    } elseif ($value === $selected) {
+        $_output .= ' checked="checked"';
+    }
+    
+    $_output .= $extra . ' />' . $output;
+    if ($labels) {
+        $_output .= '</label>';
+    }
+    
+    $_output .=  $separator;
+    return $_output;
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.html_image.php b/library/Smarty/libs/plugins/function.html_image.php
new file mode 100644 (file)
index 0000000..6521966
--- /dev/null
@@ -0,0 +1,159 @@
+<?php
+/**
+ * Smarty plugin
+ * 
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {html_image} function plugin
+ * 
+ * Type:     function<br>
+ * Name:     html_image<br>
+ * Date:     Feb 24, 2003<br>
+ * Purpose:  format HTML tags for the image<br>
+ * Examples: {html_image file="/images/masthead.gif"}<br>
+ * Output:   <img src="/images/masthead.gif" width=400 height=23><br>
+ * Params:
+ * <pre>
+ * - file        - (required) - file (and path) of image
+ * - height      - (optional) - image height (default actual height)
+ * - width       - (optional) - image width (default actual width)
+ * - basedir     - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT
+ * - path_prefix - prefix for path output (optional, default empty)
+ * </pre>
+ * 
+ * @link http://www.smarty.net/manual/en/language.function.html.image.php {html_image}
+ *      (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com> 
+ * @author credits to Duda <duda@big.hu> 
+ * @version 1.0
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string 
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_image($params, $template)
+{
+    require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
+    $alt = '';
+    $file = '';
+    $height = '';
+    $width = '';
+    $extra = '';
+    $prefix = '';
+    $suffix = '';
+    $path_prefix = '';
+    $basedir = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : '';
+    foreach($params as $_key => $_val) {
+        switch ($_key) {
+            case 'file':
+            case 'height':
+            case 'width':
+            case 'dpi':
+            case 'path_prefix':
+            case 'basedir':
+                $$_key = $_val;
+                break;
+
+            case 'alt':
+                if (!is_array($_val)) {
+                    $$_key = smarty_function_escape_special_chars($_val);
+                } else {
+                    throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                } 
+                break;
+
+            case 'link':
+            case 'href':
+                $prefix = '<a href="' . $_val . '">';
+                $suffix = '</a>';
+                break;
+
+            default:
+                if (!is_array($_val)) {
+                    $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
+                } else {
+                    throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                } 
+                break;
+        } 
+    } 
+
+    if (empty($file)) {
+        trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE);
+        return;
+    } 
+
+    if ($file[0] == '/') {
+        $_image_path = $basedir . $file;
+    } else {
+        $_image_path = $file;
+    }
+    
+    // strip file protocol
+    if (stripos($params['file'], 'file://') === 0) {
+        $params['file'] = substr($params['file'], 7);
+    }
+    
+    $protocol = strpos($params['file'], '://');
+    if ($protocol !== false) {
+        $protocol = strtolower(substr($params['file'], 0, $protocol));
+    }
+    
+    if (isset($template->smarty->security_policy)) {
+        if ($protocol) {
+            // remote resource (or php stream, …)
+            if(!$template->smarty->security_policy->isTrustedUri($params['file'])) {
+                return;
+            }
+        } else {
+            // local file
+            if(!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) {
+                return;
+            }
+        }
+    }
+
+    if (!isset($params['width']) || !isset($params['height'])) {
+        // FIXME: (rodneyrehm) getimagesize() loads the complete file off a remote resource, use custom [jpg,png,gif]header reader!
+        if (!$_image_data = @getimagesize($_image_path)) {
+            if (!file_exists($_image_path)) {
+                trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE);
+                return;
+            } else if (!is_readable($_image_path)) {
+                trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE);
+                return;
+            } else {
+                trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
+                return;
+            } 
+        }
+
+        if (!isset($params['width'])) {
+            $width = $_image_data[0];
+        } 
+        if (!isset($params['height'])) {
+            $height = $_image_data[1];
+        } 
+    } 
+
+    if (isset($params['dpi'])) {
+        if (strstr($_SERVER['HTTP_USER_AGENT'], 'Mac')) {
+            // FIXME: (rodneyrehm) wrong dpi assumption
+            // don't know who thought this up… even if it was true in 1998, it's definitely wrong in 2011.
+            $dpi_default = 72;
+        } else {
+            $dpi_default = 96;
+        } 
+        $_resize = $dpi_default / $params['dpi'];
+        $width = round($width * $_resize);
+        $height = round($height * $_resize);
+    } 
+
+    return $prefix . '<img src="' . $path_prefix . $file . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"' . $extra . ' />' . $suffix;
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.html_options.php b/library/Smarty/libs/plugins/function.html_options.php
new file mode 100644 (file)
index 0000000..46330e8
--- /dev/null
@@ -0,0 +1,176 @@
+<?php
+/**
+ * Smarty plugin
+ * 
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {html_options} function plugin
+ * 
+ * Type:     function<br>
+ * Name:     html_options<br>
+ * Purpose:  Prints the list of <option> tags generated from
+ *           the passed parameters<br>
+ * Params:
+ * <pre>
+ * - name       (optional) - string default "select"
+ * - values     (required) - if no options supplied) - array
+ * - options    (required) - if no values supplied) - associative array
+ * - selected   (optional) - string default not set
+ * - output     (required) - if not options supplied) - array
+ * - id         (optional) - string default not set
+ * - class      (optional) - string default not set
+ * </pre>
+ * 
+ * @link http://www.smarty.net/manual/en/language.function.html.options.php {html_image}
+ *      (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com> 
+ * @author Ralf Strehle (minor optimization) <ralf dot strehle at yahoo dot de>
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string 
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_options($params, $template)
+{
+    require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
+
+    $name = null;
+    $values = null;
+    $options = null;
+    $selected = null;
+    $output = null;
+    $id = null;
+    $class = null;
+
+    $extra = '';
+
+    foreach ($params as $_key => $_val) {
+        switch ($_key) {
+            case 'name':
+            case 'class':
+            case 'id':
+                $$_key = (string) $_val;
+                break;
+
+            case 'options':
+                $options = (array) $_val;
+                break;
+
+            case 'values':
+            case 'output':
+                $$_key = array_values((array) $_val);
+                break;
+
+            case 'selected':
+                if (is_array($_val)) {
+                    $selected = array();
+                    foreach ($_val as $_sel) {
+                        if (is_object($_sel)) {
+                            if (method_exists($_sel, "__toString")) {
+                                $_sel = smarty_function_escape_special_chars((string) $_sel->__toString());
+                            } else {
+                                trigger_error("html_options: selected attribute contains an object of class '". get_class($_sel) ."' without __toString() method", E_USER_NOTICE);
+                                continue;
+                            }
+                        } else {
+                            $_sel = smarty_function_escape_special_chars((string) $_sel);
+                        }
+                        $selected[$_sel] = true;
+                    }
+                } elseif (is_object($_val)) {
+                    if (method_exists($_val, "__toString")) {
+                        $selected = smarty_function_escape_special_chars((string) $_val->__toString());
+                    } else {
+                        trigger_error("html_options: selected attribute is an object of class '". get_class($_val) ."' without __toString() method", E_USER_NOTICE);
+                    }
+                } else {
+                    $selected = smarty_function_escape_special_chars((string) $_val);
+                }
+                break;
+
+            default:
+                if (!is_array($_val)) {
+                    $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
+                } else {
+                    trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                } 
+                break;
+        } 
+    }
+
+    if (!isset($options) && !isset($values)) {
+        /* raise error here? */
+        return '';
+    }
+
+    $_html_result = '';
+    $_idx = 0;
+
+    if (isset($options)) {
+        foreach ($options as $_key => $_val) {
+            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);
+        }
+    } else {
+        foreach ($values as $_i => $_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);
+        } 
+    }
+
+    if (!empty($name)) {
+        $_html_class = !empty($class) ? ' class="'.$class.'"' : '';
+        $_html_id = !empty($id) ? ' id="'.$id.'"' : '';
+        $_html_result = '<select name="' . $name . '"' . $_html_class . $_html_id . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
+    } 
+
+    return $_html_result;
+}
+
+function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
+{
+    if (!is_array($value)) {
+        $_key = smarty_function_escape_special_chars($key);
+        $_html_result = '<option value="' . $_key . '"';
+        if (is_array($selected)) {
+            if (isset($selected[$_key])) {
+                $_html_result .= ' selected="selected"';
+            }
+        } elseif ($_key === $selected) {
+            $_html_result .= ' selected="selected"';
+        }
+        $_html_class = !empty($class) ? ' class="'.$class.' option"' : '';
+        $_html_id = !empty($id) ? ' id="'.$id.'-'.$idx.'"' : '';
+        if (is_object($value)) {
+            if (method_exists($value, "__toString")) {
+                $value = smarty_function_escape_special_chars((string) $value->__toString());
+            } else {
+                trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE);
+                return '';
+            }
+        } else {
+            $value = smarty_function_escape_special_chars((string) $value);
+        }
+        $_html_result .= $_html_class . $_html_id . '>' . $value . '</option>' . "\n";
+        $idx++;
+    } else {
+        $_idx = 0;
+        $_html_result = smarty_function_html_options_optgroup($key, $value, $selected, !empty($id) ? ($id.'-'.$idx) : null, $class, $_idx);
+        $idx++;
+    }
+    return $_html_result;
+} 
+
+function smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx)
+{
+    $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
+    foreach ($values as $key => $value) {
+        $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, $idx);
+    } 
+    $optgroup_html .= "</optgroup>\n";
+    return $optgroup_html;
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.html_radios.php b/library/Smarty/libs/plugins/function.html_radios.php
new file mode 100644 (file)
index 0000000..7c83072
--- /dev/null
@@ -0,0 +1,200 @@
+<?php
+/**
+ * Smarty plugin
+ * 
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {html_radios} function plugin
+ * 
+ * File:       function.html_radios.php<br>
+ * Type:       function<br>
+ * Name:       html_radios<br>
+ * Date:       24.Feb.2003<br>
+ * Purpose:    Prints out a list of radio input types<br>
+ * Params:
+ * <pre>
+ * - name       (optional) - string default "radio"
+ * - values     (required) - array
+ * - options    (required) - associative array
+ * - checked    (optional) - array default not set
+ * - separator  (optional) - ie <br> or &nbsp;
+ * - output     (optional) - the output next to each radio button
+ * - assign     (optional) - assign the output as an array to this variable
+ * - escape     (optional) - escape the content (not value), defaults to true
+ * </pre>
+ * Examples:
+ * <pre>
+ * {html_radios values=$ids output=$names}
+ * {html_radios values=$ids name='box' separator='<br>' output=$names}
+ * {html_radios values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * 
+ * @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}
+ *      (Smarty online manual)
+ * @author Christopher Kvarme <christopher.kvarme@flashjab.com> 
+ * @author credits to Monte Ohrt <monte at ohrt dot com> 
+ * @version 1.0
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string 
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_radios($params, $template)
+{
+    require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
+
+    $name = 'radio';
+    $values = null;
+    $options = null;
+    $selected = null;
+    $separator = '';
+    $escape = true;
+    $labels = true;
+    $label_ids = false;
+    $output = null;
+    $extra = '';
+
+    foreach($params as $_key => $_val) {
+        switch ($_key) {
+            case 'name':
+            case 'separator':
+                $$_key = (string) $_val;
+                break;
+
+            case 'checked':
+            case 'selected':
+                if (is_array($_val)) {
+                    trigger_error('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING);
+                } elseif (is_object($_val)) {
+                    if (method_exists($_val, "__toString")) {
+                        $selected = smarty_function_escape_special_chars((string) $_val->__toString());
+                    } else {
+                        trigger_error("html_radios: selected attribute is an object of class '". get_class($_val) ."' without __toString() method", E_USER_NOTICE);
+                    }
+                } else {
+                    $selected = (string) $_val;
+                } 
+                break;
+
+            case 'escape':
+            case 'labels':
+            case 'label_ids':
+                $$_key = (bool) $_val;
+                break;
+
+            case 'options':
+                $$_key = (array) $_val;
+                break;
+
+            case 'values':
+            case 'output':
+                $$_key = array_values((array) $_val);
+                break;
+
+            case 'radios':
+                trigger_error('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING);
+                $options = (array) $_val;
+                break;
+
+            case 'assign':
+                break;
+
+            default:
+                if (!is_array($_val)) {
+                    $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
+                } else {
+                    trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                } 
+                break;
+        } 
+    } 
+
+    if (!isset($options) && !isset($values)) {
+        /* raise error here? */
+        return '';
+    }
+
+    $_html_result = array();
+
+    if (isset($options)) {
+        foreach ($options as $_key => $_val) {
+            $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape);
+        }
+    } else {
+        foreach ($values as $_i => $_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape);
+        } 
+    } 
+
+    if (!empty($params['assign'])) {
+        $template->assign($params['assign'], $_html_result);
+    } else {
+        return implode("\n", $_html_result);
+    } 
+} 
+
+function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape)
+{
+    $_output = '';
+    
+    if (is_object($value)) {
+        if (method_exists($value, "__toString")) {
+            $value = (string) $value->__toString();
+        } else {
+            trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE);
+            return '';
+        }
+    } else {
+        $value = (string) $value;
+    }
+    
+    if (is_object($output)) {
+        if (method_exists($output, "__toString")) {
+            $output = (string) $output->__toString();
+        } else {
+            trigger_error("html_options: output is an object of class '". get_class($output) ."' without __toString() method", E_USER_NOTICE);
+            return '';
+        }
+    } else {
+        $output = (string) $output;
+    }
+    
+    if ($labels) {
+        if ($label_ids) {
+            $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value));
+            $_output .= '<label for="' . $_id . '">';
+        } else {
+            $_output .= '<label>';
+        } 
+    }
+    
+    $name = smarty_function_escape_special_chars($name);
+    $value = smarty_function_escape_special_chars($value);
+    if ($escape) {
+        $output = smarty_function_escape_special_chars($output);
+    }
+    
+    $_output .= '<input type="radio" name="' . $name . '" value="' . $value . '"';
+
+    if ($labels && $label_ids) {
+        $_output .= ' id="' . $_id . '"';
+    }
+
+    if ($value === $selected) {
+        $_output .= ' checked="checked"';
+    }
+    
+    $_output .= $extra . ' />' . $output;
+    if ($labels) {
+        $_output .= '</label>';
+    }
+    
+    $_output .= $separator;
+    return $_output;
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.html_select_date.php b/library/Smarty/libs/plugins/function.html_select_date.php
new file mode 100644 (file)
index 0000000..13c5003
--- /dev/null
@@ -0,0 +1,394 @@
+<?php
+/**
+ * Smarty plugin
+ * 
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * @ignore
+ */
+require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
+/**
+ * @ignore
+ */
+require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
+
+/**
+ * Smarty {html_select_date} plugin
+ * 
+ * Type:     function<br>
+ * Name:     html_select_date<br>
+ * Purpose:  Prints the dropdowns for date selection.
+ * 
+ * ChangeLog:
+ * <pre>
+ *            - 1.0 initial release
+ *            - 1.1 added support for +/- N syntax for begin
+ *              and end year values. (Monte)
+ *            - 1.2 added support for yyyy-mm-dd syntax for
+ *              time value. (Jan Rosier)
+ *            - 1.3 added support for choosing format for
+ *              month values (Gary Loescher)
+ *            - 1.3.1 added support for choosing format for
+ *              day values (Marcus Bointon)
+ *            - 1.3.2 support negative timestamps, force year
+ *              dropdown to include given date unless explicitly set (Monte)
+ *            - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that
+ *              of 0000-00-00 dates (cybot, boots)
+ *            - 2.0 complete rewrite for performance,  
+ *              added attributes month_names, *_id
+ * </pre>
+ * 
+ * @link http://www.smarty.net/manual/en/language.function.html.select.date.php {html_select_date}
+ *      (Smarty online manual)
+ * @version 2.0
+ * @author Andrei Zmievski 
+ * @author Monte Ohrt <monte at ohrt dot com> 
+ * @author Rodney Rehm
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string 
+ */
+function smarty_function_html_select_date($params, $template)
+{
+    // generate timestamps used for month names only
+    static $_month_timestamps = null;
+    static $_current_year = null;
+    if ($_month_timestamps === null) {
+        $_current_year = date('Y');
+        $_month_timestamps = array();
+        for ($i = 1; $i <= 12; $i++) {
+            $_month_timestamps[$i] = mktime(0, 0, 0, $i, 1, 2000);
+        }
+    }
+
+    /* Default values. */
+    $prefix = "Date_";
+    $start_year = null;
+    $end_year = null;
+    $display_days = true;
+    $display_months = true;
+    $display_years = true;
+    $month_format = "%B";
+    /* Write months as numbers by default  GL */
+    $month_value_format = "%m";
+    $day_format = "%02d";
+    /* Write day values using this format MB */
+    $day_value_format = "%d";
+    $year_as_text = false;
+    /* Display years in reverse order? Ie. 2000,1999,.... */
+    $reverse_years = false;
+    /* Should the select boxes be part of an array when returned from PHP?
+       e.g. setting it to "birthday", would create "birthday[Day]",
+       "birthday[Month]" & "birthday[Year]". Can be combined with prefix */
+    $field_array = null;
+    /* <select size>'s of the different <select> tags.
+       If not set, uses default dropdown. */
+    $day_size = null;
+    $month_size = null;
+    $year_size = null;
+    /* Unparsed attributes common to *ALL* the <select>/<input> tags.
+       An example might be in the template: all_extra ='class ="foo"'. */
+    $all_extra = null;
+    /* Separate attributes for the tags. */
+    $day_extra = null;
+    $month_extra = null;
+    $year_extra = null;
+    /* Order in which to display the fields.
+       "D" -> day, "M" -> month, "Y" -> year. */
+    $field_order = 'MDY';
+    /* String printed between the different fields. */
+    $field_separator = "\n";
+    $option_separator = "\n";
+    $time = null;
+    // $all_empty = null;
+    // $day_empty = null;
+    // $month_empty = null;
+    // $year_empty = null;
+    $extra_attrs = '';
+    $all_id = null;
+    $day_id = null;
+    $month_id = null;
+    $year_id = null;
+
+    foreach ($params as $_key => $_value) {
+        switch ($_key) {
+            case 'time':
+                if (!is_array($_value) && $_value !== null) {
+                    $time = smarty_make_timestamp($_value);
+                }
+                break;
+                
+            case 'month_names':
+                if (is_array($_value) && count($_value) == 12) {
+                    $$_key = $_value;
+                } else {
+                    trigger_error("html_select_date: month_names must be an array of 12 strings", E_USER_NOTICE);
+                }
+                break;
+                
+            case 'prefix':
+            case 'field_array':
+            case 'start_year':
+            case 'end_year':
+            case 'day_format':
+            case 'day_value_format':
+            case 'month_format':
+            case 'month_value_format':
+            case 'day_size':
+            case 'month_size':
+            case 'year_size':
+            case 'all_extra':
+            case 'day_extra':
+            case 'month_extra':
+            case 'year_extra':
+            case 'field_order':
+            case 'field_separator':
+            case 'option_separator':
+            case 'all_empty':
+            case 'month_empty':
+            case 'day_empty':
+            case 'year_empty':
+            case 'all_id':
+            case 'month_id':
+            case 'day_id':
+            case 'year_id':
+                $$_key = (string)$_value;
+                break;
+
+            case 'display_days':
+            case 'display_months':
+            case 'display_years':
+            case 'year_as_text':
+            case 'reverse_years':
+                $$_key = (bool)$_value;
+                break;
+
+            default:
+                if (!is_array($_value)) {
+                    $extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"';
+                } else {
+                    trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                } 
+                break;
+        } 
+    }
+    
+    // Note: date() is faster than strftime()
+    // Note: explode(date()) is faster than date() date() date()
+    if (isset($params['time']) && is_array($params['time'])) {
+        if (isset($params['time'][$prefix . 'Year'])) {
+            // $_REQUEST[$field_array] given
+            foreach (array('Y' => 'Year',  'm' => 'Month', 'd' => 'Day') as $_elementKey => $_elementName) {
+                $_variableName = '_' . strtolower($_elementName);
+                $$_variableName = isset($params['time'][$prefix . $_elementName])
+                    ? $params['time'][$prefix . $_elementName]
+                    : date($_elementKey);
+            }
+            $time = mktime(0, 0, 0, $_month, $_day, $_year);
+        } elseif (isset($params['time'][$field_array][$prefix . 'Year'])) {
+            // $_REQUEST given
+            foreach (array('Y' => 'Year',  'm' => 'Month', 'd' => 'Day') as $_elementKey => $_elementName) {
+                $_variableName = '_' . strtolower($_elementName);
+                $$_variableName = isset($params['time'][$field_array][$prefix . $_elementName])
+                    ? $params['time'][$field_array][$prefix . $_elementName]
+                    : date($_elementKey);
+            }
+            $time = mktime(0, 0, 0, $_month, $_day, $_year);
+        } else {
+            // no date found, use NOW
+            list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));
+        }
+    } elseif ($time === null) {
+        if (array_key_exists('time', $params)) {
+            $_year = $_month = $_day = $time = null;
+        } else {
+            list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));
+        }
+    } else {
+        list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d', $time));
+    }
+
+    // make syntax "+N" or "-N" work with $start_year and $end_year
+    // Note preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match) is slower than trim+substr
+    foreach (array('start', 'end') as $key) {
+        $key .= '_year';
+        $t = $$key;
+        if ($t === null) {
+            $$key = (int)$_current_year;
+        } else if ($t[0] == '+') {
+            $$key = (int)($_current_year + trim(substr($t, 1)));
+        } else if ($t[0] == '-') {
+            $$key = (int)($_current_year - trim(substr($t, 1)));
+        } else {
+            $$key = (int)$$key;
+        }
+    }
+
+    // flip for ascending or descending
+    if (($start_year > $end_year && !$reverse_years) || ($start_year < $end_year && $reverse_years)) {
+        $t = $end_year;
+        $end_year = $start_year;
+        $start_year = $t;
+    }
+
+    // generate year <select> or <input>
+    if ($display_years) {
+        $_html_years = '';
+        $_extra = '';
+        $_name = $field_array ? ($field_array . '[' . $prefix . 'Year]') : ($prefix . 'Year');
+        if ($all_extra) {
+            $_extra .= ' ' . $all_extra;
+        } 
+        if ($year_extra) {
+            $_extra .= ' ' . $year_extra;
+        }
+        
+        if ($year_as_text) {
+            $_html_years = '<input type="text" name="' . $_name . '" value="' . $_year . '" size="4" maxlength="4"' . $_extra . $extra_attrs . ' />';
+        } else {
+            $_html_years = '<select name="' . $_name . '"';
+            if ($year_id !== null || $all_id !== null) {
+                $_html_years .= ' id="' . smarty_function_escape_special_chars( 
+                    $year_id !== null ? ( $year_id ? $year_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name ) 
+                ) . '"';
+            }
+            if ($year_size) {
+                $_html_years .= ' size="' . $year_size . '"';
+            } 
+            $_html_years .= $_extra . $extra_attrs . '>' . $option_separator;
+            
+            if (isset($year_empty) || isset($all_empty)) {
+                $_html_years .= '<option value="">' . ( isset($year_empty) ? $year_empty : $all_empty ) . '</option>' . $option_separator;
+            }
+            
+            $op = $start_year > $end_year ? -1 : 1;
+            for ($i=$start_year; $op > 0 ? $i <= $end_year : $i >= $end_year; $i += $op) {
+                $_html_years .= '<option value="' . $i . '"'
+                    . ($_year == $i ? ' selected="selected"' : '')
+                    . '>' . $i . '</option>' . $option_separator;
+            }
+            
+            $_html_years .= '</select>';
+        }
+    }
+    
+    // generate month <select> or <input>
+    if ($display_months) {
+        $_html_month = '';
+        $_extra = '';
+        $_name = $field_array ? ($field_array . '[' . $prefix . 'Month]') : ($prefix . 'Month');
+        if ($all_extra) {
+            $_extra .= ' ' . $all_extra;
+        } 
+        if ($month_extra) {
+            $_extra .= ' ' . $month_extra;
+        }
+        
+        $_html_months = '<select name="' . $_name . '"';
+        if ($month_id !== null || $all_id !== null) {
+            $_html_months .= ' id="' . smarty_function_escape_special_chars( 
+                $month_id !== null ? ( $month_id ? $month_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name ) 
+            ) . '"';
+        }
+        if ($month_size) {
+            $_html_months .= ' size="' . $month_size . '"';
+        } 
+        $_html_months .= $_extra . $extra_attrs . '>' . $option_separator;
+        
+        if (isset($month_empty) || isset($all_empty)) {
+            $_html_months .= '<option value="">' . ( isset($month_empty) ? $month_empty : $all_empty ) . '</option>' . $option_separator;
+        }
+        
+        for ($i = 1; $i <= 12; $i++) {
+            $_val = sprintf('%02d', $i);
+            $_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[$i]) : ($month_format == "%m" ? $_val : strftime($month_format, $_month_timestamps[$i]));
+            $_value = $month_value_format == "%m" ? $_val : strftime($month_value_format, $_month_timestamps[$i]);
+            $_html_months .= '<option value="' . $_value . '"'
+                . ($_val == $_month ? ' selected="selected"' : '')
+                . '>' . $_text . '</option>' . $option_separator;
+        }
+        
+        $_html_months .= '</select>';
+    }
+    
+    // generate day <select> or <input>
+    if ($display_days) {
+        $_html_day = '';
+        $_extra = '';
+        $_name = $field_array ? ($field_array . '[' . $prefix . 'Day]') : ($prefix . 'Day');
+        if ($all_extra) {
+            $_extra .= ' ' . $all_extra;
+        } 
+        if ($day_extra) {
+            $_extra .= ' ' . $day_extra;
+        }
+        
+        $_html_days = '<select name="' . $_name . '"';
+        if ($day_id !== null || $all_id !== null) {
+            $_html_days .= ' id="' . smarty_function_escape_special_chars( 
+                $day_id !== null ? ( $day_id ? $day_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name ) 
+            ) . '"';
+        }
+        if ($day_size) {
+            $_html_days .= ' size="' . $day_size . '"';
+        } 
+        $_html_days .= $_extra . $extra_attrs . '>' . $option_separator;
+        
+        if (isset($day_empty) || isset($all_empty)) {
+            $_html_days .= '<option value="">' . ( isset($day_empty) ? $day_empty : $all_empty ) . '</option>' . $option_separator;
+        }
+        
+        for ($i = 1; $i <= 31; $i++) {
+            $_val = sprintf('%02d', $i);
+            $_text = $day_format == '%02d' ? $_val : sprintf($day_format, $i);
+            $_value = $day_value_format ==  '%02d' ? $_val : sprintf($day_value_format, $i);
+            $_html_days .= '<option value="' . $_value . '"'
+                . ($_val == $_day ? ' selected="selected"' : '')
+                . '>' . $_text . '</option>' . $option_separator;
+        }
+        
+        $_html_days .= '</select>';
+    }
+
+    // order the fields for output
+    $_html = '';
+    for ($i=0; $i <= 2; $i++) {
+        switch ($field_order[$i]) {
+            case 'Y':
+            case 'y':
+                if (isset($_html_years)) {
+                    if ($_html) {
+                        $_html .= $field_separator;
+                    }
+                    $_html .= $_html_years;
+                }
+            break;
+            
+            case 'm':
+            case 'M':
+                if (isset($_html_months)) {
+                    if ($_html) {
+                        $_html .= $field_separator;
+                    }
+                    $_html .= $_html_months;
+                }
+            break;
+            
+            case 'd':
+            case 'D':
+                if (isset($_html_days)) {
+                    if ($_html) {
+                        $_html .= $field_separator;
+                    }
+                    $_html .= $_html_days;
+                }
+            break;
+        }
+    }
+    return $_html;
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.html_select_time.php b/library/Smarty/libs/plugins/function.html_select_time.php
new file mode 100644 (file)
index 0000000..9fb8038
--- /dev/null
@@ -0,0 +1,366 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * @ignore
+ */
+require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
+/**
+ * @ignore
+ */
+require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
+
+/**
+ * Smarty {html_select_time} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_select_time<br>
+ * Purpose:  Prints the dropdowns for time selection
+ *
+ * @link http://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time}
+ *          (Smarty online manual)
+ * @author Roberto Berto <roberto@berto.net>
+ * @author Monte Ohrt <monte AT ohrt DOT com>
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string
+ * @uses smarty_make_timestamp()
+ */
+function smarty_function_html_select_time($params, $template)
+{
+    $prefix = "Time_";
+    $field_array = null;
+    $field_separator = "\n";
+    $option_separator = "\n";
+    $time = null;
+
+    $display_hours = true;
+    $display_minutes = true;
+    $display_seconds = true;
+    $display_meridian = true;
+
+    $hour_format = '%02d';
+    $hour_value_format = '%02d';
+    $minute_format = '%02d';
+    $minute_value_format = '%02d';
+    $second_format = '%02d';
+    $second_value_format = '%02d';
+
+    $hour_size = null;
+    $minute_size = null;
+    $second_size = null;
+    $meridian_size = null;
+
+    $all_empty = null;
+    $hour_empty = null;
+    $minute_empty = null;
+    $second_empty = null;
+    $meridian_empty = null;
+
+    $all_id = null;
+    $hour_id = null;
+    $minute_id = null;
+    $second_id = null;
+    $meridian_id = null;
+
+    $use_24_hours = true;
+    $minute_interval = 1;
+    $second_interval = 1;
+
+    $extra_attrs = '';
+    $all_extra = null;
+    $hour_extra = null;
+    $minute_extra = null;
+    $second_extra = null;
+    $meridian_extra = null;
+
+    foreach ($params as $_key => $_value) {
+        switch ($_key) {
+            case 'time':
+                if (!is_array($_value) && $_value !== null) {
+                    $time = smarty_make_timestamp($_value);
+                }
+                break;
+
+            case 'prefix':
+            case 'field_array':
+
+            case 'field_separator':
+            case 'option_separator':
+
+            case 'all_extra':
+            case 'hour_extra':
+            case 'minute_extra':
+            case 'second_extra':
+            case 'meridian_extra':
+
+            case 'all_empty':
+            case 'hour_empty':
+            case 'minute_empty':
+            case 'second_empty':
+            case 'meridian_empty':
+
+            case 'all_id':
+            case 'hour_id':
+            case 'minute_id':
+            case 'second_id':
+            case 'meridian_id':
+
+            case 'hour_format':
+            case 'hour_value_format':
+            case 'minute_format':
+            case 'minute_value_format':
+            case 'second_format':
+            case 'second_value_format':
+                $$_key = (string)$_value;
+                break;
+
+            case 'display_hours':
+            case 'display_minutes':
+            case 'display_seconds':
+            case 'display_meridian':
+            case 'use_24_hours':
+                $$_key = (bool)$_value;
+                break;
+
+            case 'minute_interval':
+            case 'second_interval':
+
+            case 'hour_size':
+            case 'minute_size':
+            case 'second_size':
+            case 'meridian_size':
+                $$_key = (int)$_value;
+                break;
+
+            default:
+                if (!is_array($_value)) {
+                    $extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"';
+                } else {
+                    trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (isset($params['time']) && is_array($params['time'])) {
+        if (isset($params['time'][$prefix . 'Hour'])) {
+            // $_REQUEST[$field_array] given
+            foreach (array('H' => 'Hour',  'i' => 'Minute', 's' => 'Second') as $_elementKey => $_elementName) {
+                $_variableName = '_' . strtolower($_elementName);
+                $$_variableName = isset($params['time'][$prefix . $_elementName])
+                    ? $params['time'][$prefix . $_elementName]
+                    : date($_elementKey);
+            }
+            $_meridian = isset($params['time'][$prefix . 'Meridian'])
+                ? (' ' . $params['time'][$prefix . 'Meridian'])
+                : '';
+            $time = strtotime( $_hour . ':' . $_minute . ':' . $_second . $_meridian );
+            list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));
+        } elseif (isset($params['time'][$field_array][$prefix . 'Hour'])) {
+            // $_REQUEST given
+            foreach (array('H' => 'Hour',  'i' => 'Minute', 's' => 'Second') as $_elementKey => $_elementName) {
+                $_variableName = '_' . strtolower($_elementName);
+                $$_variableName = isset($params['time'][$field_array][$prefix . $_elementName])
+                    ? $params['time'][$field_array][$prefix . $_elementName]
+                    : date($_elementKey);
+            }
+            $_meridian = isset($params['time'][$field_array][$prefix . 'Meridian'])
+                ? (' ' . $params['time'][$field_array][$prefix . 'Meridian'])
+                : '';
+            $time = strtotime( $_hour . ':' . $_minute . ':' . $_second . $_meridian );
+            list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));
+        } else {
+            // no date found, use NOW
+            list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));
+        }
+    } elseif ($time === null) {
+        if (array_key_exists('time', $params)) {
+            $_hour = $_minute = $_second = $time = null;
+        } else {
+            list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s'));
+        }
+    } else {
+        list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));
+    }
+
+    // generate hour <select>
+    if ($display_hours) {
+        $_html_hours = '';
+        $_extra = '';
+        $_name = $field_array ? ($field_array . '[' . $prefix . 'Hour]') : ($prefix . 'Hour');
+        if ($all_extra) {
+            $_extra .= ' ' . $all_extra;
+        }
+        if ($hour_extra) {
+            $_extra .= ' ' . $hour_extra;
+        }
+
+        $_html_hours = '<select name="' . $_name . '"';
+        if ($hour_id !== null || $all_id !== null) {
+            $_html_hours .= ' id="' . smarty_function_escape_special_chars(
+                $hour_id !== null ? ( $hour_id ? $hour_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
+            ) . '"';
+        }
+        if ($hour_size) {
+            $_html_hours .= ' size="' . $hour_size . '"';
+        }
+        $_html_hours .= $_extra . $extra_attrs . '>' . $option_separator;
+
+        if (isset($hour_empty) || isset($all_empty)) {
+            $_html_hours .= '<option value="">' . ( isset($hour_empty) ? $hour_empty : $all_empty ) . '</option>' . $option_separator;
+        }
+
+        $start = $use_24_hours ? 0 : 1;
+        $end = $use_24_hours ? 23 : 12;
+        for ($i=$start; $i <= $end; $i++) {
+            $_val = sprintf('%02d', $i);
+            $_text = $hour_format == '%02d' ? $_val : sprintf($hour_format, $i);
+            $_value = $hour_value_format == '%02d' ? $_val : sprintf($hour_value_format, $i);
+
+            if (!$use_24_hours) {
+                $_hour12 = $_hour == 0
+                    ? 12
+                    : ($_hour <= 12 ? $_hour : $_hour -12);
+            }
+
+            $selected = $_hour !== null ? ($use_24_hours ? $_hour == $_val : $_hour12 == $_val) : null;
+            $_html_hours .= '<option value="' . $_value . '"'
+                . ($selected ? ' selected="selected"' : '')
+                . '>' . $_text . '</option>' . $option_separator;
+        }
+
+        $_html_hours .= '</select>';
+    }
+
+    // generate minute <select>
+    if ($display_minutes) {
+        $_html_minutes = '';
+        $_extra = '';
+        $_name = $field_array ? ($field_array . '[' . $prefix . 'Minute]') : ($prefix . 'Minute');
+        if ($all_extra) {
+            $_extra .= ' ' . $all_extra;
+        }
+        if ($minute_extra) {
+            $_extra .= ' ' . $minute_extra;
+        }
+
+        $_html_minutes = '<select name="' . $_name . '"';
+        if ($minute_id !== null || $all_id !== null) {
+            $_html_minutes .= ' id="' . smarty_function_escape_special_chars(
+                $minute_id !== null ? ( $minute_id ? $minute_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
+            ) . '"';
+        }
+        if ($minute_size) {
+            $_html_minutes .= ' size="' . $minute_size . '"';
+        }
+        $_html_minutes .= $_extra . $extra_attrs . '>' . $option_separator;
+
+        if (isset($minute_empty) || isset($all_empty)) {
+            $_html_minutes .= '<option value="">' . ( isset($minute_empty) ? $minute_empty : $all_empty ) . '</option>' . $option_separator;
+        }
+
+        $selected = $_minute !== null ? ($_minute - $_minute % $minute_interval) : null;
+        for ($i=0; $i <= 59; $i += $minute_interval) {
+            $_val = sprintf('%02d', $i);
+            $_text = $minute_format == '%02d' ? $_val : sprintf($minute_format, $i);
+            $_value = $minute_value_format == '%02d' ? $_val : sprintf($minute_value_format, $i);
+            $_html_minutes .= '<option value="' . $_value . '"'
+                . ($selected === $i ? ' selected="selected"' : '')
+                . '>' . $_text . '</option>' . $option_separator;
+        }
+
+        $_html_minutes .= '</select>';
+    }
+
+    // generate second <select>
+    if ($display_seconds) {
+        $_html_seconds = '';
+        $_extra = '';
+        $_name = $field_array ? ($field_array . '[' . $prefix . 'Second]') : ($prefix . 'Second');
+        if ($all_extra) {
+            $_extra .= ' ' . $all_extra;
+        }
+        if ($second_extra) {
+            $_extra .= ' ' . $second_extra;
+        }
+
+        $_html_seconds = '<select name="' . $_name . '"';
+        if ($second_id !== null || $all_id !== null) {
+            $_html_seconds .= ' id="' . smarty_function_escape_special_chars(
+                $second_id !== null ? ( $second_id ? $second_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
+            ) . '"';
+        }
+        if ($second_size) {
+            $_html_seconds .= ' size="' . $second_size . '"';
+        }
+        $_html_seconds .= $_extra . $extra_attrs . '>' . $option_separator;
+
+        if (isset($second_empty) || isset($all_empty)) {
+            $_html_seconds .= '<option value="">' . ( isset($second_empty) ? $second_empty : $all_empty ) . '</option>' . $option_separator;
+        }
+
+        $selected = $_second !== null ? ($_second - $_second % $second_interval) : null;
+        for ($i=0; $i <= 59; $i += $second_interval) {
+            $_val = sprintf('%02d', $i);
+            $_text = $second_format == '%02d' ? $_val : sprintf($second_format, $i);
+            $_value = $second_value_format == '%02d' ? $_val : sprintf($second_value_format, $i);
+            $_html_seconds .= '<option value="' . $_value . '"'
+                . ($selected === $i ? ' selected="selected"' : '')
+                . '>' . $_text . '</option>' . $option_separator;
+        }
+
+        $_html_seconds .= '</select>';
+    }
+
+    // generate meridian <select>
+    if ($display_meridian && !$use_24_hours) {
+        $_html_meridian = '';
+        $_extra = '';
+        $_name = $field_array ? ($field_array . '[' . $prefix . 'Meridian]') : ($prefix . 'Meridian');
+        if ($all_extra) {
+            $_extra .= ' ' . $all_extra;
+        }
+        if ($meridian_extra) {
+            $_extra .= ' ' . $meridian_extra;
+        }
+
+        $_html_meridian = '<select name="' . $_name . '"';
+        if ($meridian_id !== null || $all_id !== null) {
+            $_html_meridian .= ' id="' . smarty_function_escape_special_chars(
+                $meridian_id !== null ? ( $meridian_id ? $meridian_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
+            ) . '"';
+        }
+        if ($meridian_size) {
+            $_html_meridian .= ' size="' . $meridian_size . '"';
+        }
+        $_html_meridian .= $_extra . $extra_attrs . '>' . $option_separator;
+
+        if (isset($meridian_empty) || isset($all_empty)) {
+            $_html_meridian .= '<option value="">' . ( isset($meridian_empty) ? $meridian_empty : $all_empty ) . '</option>' . $option_separator;
+        }
+
+        $_html_meridian .= '<option value="am"'. ($_hour < 12 ? ' selected="selected"' : '') .'>AM</option>' . $option_separator
+            . '<option value="pm"'. ($_hour < 12 ? '' : ' selected="selected"') .'>PM</option>' . $option_separator
+            . '</select>';
+    }
+
+    $_html = '';
+    foreach (array('_html_hours', '_html_minutes', '_html_seconds', '_html_meridian') as $k) {
+        if (isset($$k)) {
+            if ($_html) {
+                $_html .= $field_separator;
+            }
+            $_html .= $$k;
+        }
+    }
+
+    return $_html;
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.html_table.php b/library/Smarty/libs/plugins/function.html_table.php
new file mode 100644 (file)
index 0000000..6b9cb9d
--- /dev/null
@@ -0,0 +1,177 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {html_table} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_table<br>
+ * Date:     Feb 17, 2003<br>
+ * Purpose:  make an html table from an array of data<br>
+ * Params:
+ * <pre>
+ * - loop       - array to loop through
+ * - cols       - number of columns, comma separated list of column names
+ *                or array of column names
+ * - rows       - number of rows
+ * - table_attr - table attributes
+ * - th_attr    - table heading attributes (arrays are cycled)
+ * - tr_attr    - table row attributes (arrays are cycled)
+ * - td_attr    - table cell attributes (arrays are cycled)
+ * - trailpad   - value to pad trailing cells with
+ * - caption    - text for caption element
+ * - vdir       - vertical direction (default: "down", means top-to-bottom)
+ * - hdir       - horizontal direction (default: "right", means left-to-right)
+ * - inner      - inner loop (default "cols": print $loop line by line,
+ *                $loop will be printed column by column otherwise)
+ * </pre>
+ * Examples:
+ * <pre>
+ * {table loop=$data}
+ * {table loop=$data cols=4 tr_attr='"bgcolor=red"'}
+ * {table loop=$data cols="first,second,third" tr_attr=$colors}
+ * </pre>
+ *
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credit to Messju Mohr <messju at lammfellpuschen dot de>
+ * @author credit to boots <boots dot smarty at yahoo dot com>
+ * @version 1.1
+ * @link http://www.smarty.net/manual/en/language.function.html.table.php {html_table}
+ *          (Smarty online manual)
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string
+ */
+function smarty_function_html_table($params, $template)
+{
+    $table_attr = 'border="1"';
+    $tr_attr = '';
+    $th_attr = '';
+    $td_attr = '';
+    $cols = $cols_count = 3;
+    $rows = 3;
+    $trailpad = '&nbsp;';
+    $vdir = 'down';
+    $hdir = 'right';
+    $inner = 'cols';
+    $caption = '';
+    $loop = null;
+
+    if (!isset($params['loop'])) {
+        trigger_error("html_table: missing 'loop' parameter",E_USER_WARNING);
+        return;
+    }
+
+    foreach ($params as $_key => $_value) {
+        switch ($_key) {
+            case 'loop':
+                $$_key = (array)$_value;
+                break;
+
+            case 'cols':
+                if (is_array($_value) && !empty($_value)) {
+                    $cols = $_value;
+                    $cols_count = count($_value);
+                } elseif (!is_numeric($_value) && is_string($_value) && !empty($_value)) {
+                    $cols = explode(',', $_value);
+                    $cols_count = count($cols);
+                } elseif (!empty($_value)) {
+                    $cols_count = (int)$_value;
+                } else {
+                    $cols_count = $cols;
+                }
+                break;
+
+            case 'rows':
+                $$_key = (int)$_value;
+                break;
+
+            case 'table_attr':
+            case 'trailpad':
+            case 'hdir':
+            case 'vdir':
+            case 'inner':
+            case 'caption':
+                $$_key = (string)$_value;
+                break;
+
+            case 'tr_attr':
+            case 'td_attr':
+            case 'th_attr':
+                $$_key = $_value;
+                break;
+        }
+    }
+
+    $loop_count = count($loop);
+    if (empty($params['rows'])) {
+        /* no rows specified */
+        $rows = ceil($loop_count / $cols_count);
+    } elseif (empty($params['cols'])) {
+        if (!empty($params['rows'])) {
+            /* no cols specified, but rows */
+            $cols_count = ceil($loop_count / $rows);
+        }
+    }
+
+    $output = "<table $table_attr>\n";
+
+    if (!empty($caption)) {
+        $output .= '<caption>' . $caption . "</caption>\n";
+    }
+
+    if (is_array($cols)) {
+        $cols = ($hdir == 'right') ? $cols : array_reverse($cols);
+        $output .= "<thead><tr>\n";
+
+        for ($r = 0; $r < $cols_count; $r++) {
+            $output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>';
+            $output .= $cols[$r];
+            $output .= "</th>\n";
+        }
+        $output .= "</tr></thead>\n";
+    }
+
+    $output .= "<tbody>\n";
+    for ($r = 0; $r < $rows; $r++) {
+        $output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n";
+        $rx = ($vdir == 'down') ? $r * $cols_count : ($rows-1 - $r) * $cols_count;
+
+        for ($c = 0; $c < $cols_count; $c++) {
+            $x = ($hdir == 'right') ? $rx + $c : $rx + $cols_count-1 - $c;
+            if ($inner != 'cols') {
+                /* shuffle x to loop over rows*/
+                $x = floor($x / $cols_count) + ($x % $cols_count) * $rows;
+            }
+
+            if ($x < $loop_count) {
+                $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">" . $loop[$x] . "</td>\n";
+            } else {
+                $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">$trailpad</td>\n";
+            }
+        }
+        $output .= "</tr>\n";
+    }
+    $output .= "</tbody>\n";
+    $output .= "</table>\n";
+
+    return $output;
+}
+
+function smarty_function_html_table_cycle($name, $var, $no)
+{
+    if (!is_array($var)) {
+        $ret = $var;
+    } else {
+        $ret = $var[$no % count($var)];
+    }
+
+    return ($ret) ? ' ' . $ret : '';
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.mailto.php b/library/Smarty/libs/plugins/function.mailto.php
new file mode 100644 (file)
index 0000000..55d5c06
--- /dev/null
@@ -0,0 +1,152 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {mailto} function plugin
+ *
+ * Type:     function<br>
+ * Name:     mailto<br>
+ * Date:     May 21, 2002
+ * Purpose:  automate mailto address link creation, and optionally encode them.<br>
+ * Params:
+ * <pre>
+ * - address    - (required) - e-mail address
+ * - text       - (optional) - text to display, default is address
+ * - encode     - (optional) - can be one of:
+ *                             * none : no encoding (default)
+ *                             * javascript : encode with javascript
+ *                             * javascript_charcode : encode with javascript charcode
+ *                             * hex : encode with hexidecimal (no javascript)
+ * - cc         - (optional) - address(es) to carbon copy
+ * - bcc        - (optional) - address(es) to blind carbon copy
+ * - subject    - (optional) - e-mail subject
+ * - newsgroups - (optional) - newsgroup(s) to post to
+ * - followupto - (optional) - address(es) to follow up to
+ * - extra      - (optional) - extra tags for the href link
+ * </pre>
+ * Examples:
+ * <pre>
+ * {mailto address="me@domain.com"}
+ * {mailto address="me@domain.com" encode="javascript"}
+ * {mailto address="me@domain.com" encode="hex"}
+ * {mailto address="me@domain.com" subject="Hello to you!"}
+ * {mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
+ * {mailto address="me@domain.com" extra='class="mailto"'}
+ * </pre>
+ *
+ * @link http://www.smarty.net/manual/en/language.function.mailto.php {mailto}
+ *          (Smarty online manual)
+ * @version 1.2
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credits to Jason Sweat (added cc, bcc and subject functionality)
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string
+ */
+function smarty_function_mailto($params, $template)
+{
+    static $_allowed_encoding = array('javascript' => true, 'javascript_charcode' => true, 'hex' => true, 'none' => true);
+    $extra = '';
+
+    if (empty($params['address'])) {
+        trigger_error("mailto: missing 'address' parameter",E_USER_WARNING);
+        return;
+    } else {
+        $address = $params['address'];
+    }
+
+    $text = $address;
+    // netscape and mozilla do not decode %40 (@) in BCC field (bug?)
+    // so, don't encode it.
+    $search = array('%40', '%2C');
+    $replace = array('@', ',');
+    $mail_parms = array();
+    foreach ($params as $var => $value) {
+        switch ($var) {
+            case 'cc':
+            case 'bcc':
+            case 'followupto':
+                if (!empty($value))
+                    $mail_parms[] = $var . '=' . str_replace($search, $replace, rawurlencode($value));
+                break;
+
+            case 'subject':
+            case 'newsgroups':
+                $mail_parms[] = $var . '=' . rawurlencode($value);
+                break;
+
+            case 'extra':
+            case 'text':
+                $$var = $value;
+
+            default:
+        }
+    }
+
+    if ($mail_parms) {
+        $address .= '?' . join('&', $mail_parms);
+    }
+    
+    $encode = (empty($params['encode'])) ? 'none' : $params['encode'];
+    if (!isset($_allowed_encoding[$encode])) {
+        trigger_error("mailto: 'encode' parameter must be none, javascript, javascript_charcode or hex", E_USER_WARNING);
+        return;
+    }
+    // FIXME: (rodneyrehm) document.write() excues me what? 1998 has passed!
+    if ($encode == 'javascript') {
+        $string = 'document.write(\'<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>\');';
+
+        $js_encode = '';
+        for ($x = 0, $_length = strlen($string); $x < $_length; $x++) {
+            $js_encode .= '%' . bin2hex($string[$x]);
+        }
+
+        return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>';
+    } elseif ($encode == 'javascript_charcode') {
+        $string = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>';
+
+        for($x = 0, $y = strlen($string); $x < $y; $x++) {
+            $ord[] = ord($string[$x]);
+        }
+
+        $_ret = "<script type=\"text/javascript\" language=\"javascript\">\n"
+            . "{document.write(String.fromCharCode("
+            . implode(',', $ord)
+            . "))"
+            . "}\n"
+            . "</script>\n";
+
+        return $_ret;
+    } elseif ($encode == 'hex') {
+        preg_match('!^(.*)(\?.*)$!', $address, $match);
+        if (!empty($match[2])) {
+            trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.",E_USER_WARNING);
+            return;
+        }
+        $address_encode = '';
+        for ($x = 0, $_length = strlen($address); $x < $_length; $x++) {
+            if (preg_match('!\w!' . Smarty::$_UTF8_MODIFIER, $address[$x])) {
+                $address_encode .= '%' . bin2hex($address[$x]);
+            } else {
+                $address_encode .= $address[$x];
+            }
+        }
+        $text_encode = '';
+        for ($x = 0, $_length = strlen($text); $x < $_length; $x++) {
+            $text_encode .= '&#x' . bin2hex($text[$x]) . ';';
+        }
+
+        $mailto = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
+        return '<a href="' . $mailto . $address_encode . '" ' . $extra . '>' . $text_encode . '</a>';
+    } else {
+        // no encoding
+        return '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>';
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/function.math.php b/library/Smarty/libs/plugins/function.math.php
new file mode 100644 (file)
index 0000000..f4d3f05
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * This plugin is only for Smarty2 BC
+ * @package Smarty
+ * @subpackage PluginsFunction
+ */
+
+/**
+ * Smarty {math} function plugin
+ *
+ * Type:     function<br>
+ * Name:     math<br>
+ * Purpose:  handle math computations in template
+ *
+ * @link http://www.smarty.net/manual/en/language.function.math.php {math}
+ *          (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
+ * @return string|null
+ */
+function smarty_function_math($params, $template)
+{
+    static $_allowed_funcs = array(
+        'int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true,
+        'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true,
+        'rand' => true, 'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true ,'tan' => true
+    );
+    // be sure equation parameter is present
+    if (empty($params['equation'])) {
+        trigger_error("math: missing equation parameter",E_USER_WARNING);
+        return;
+    }
+
+    $equation = $params['equation'];
+
+    // make sure parenthesis are balanced
+    if (substr_count($equation,"(") != substr_count($equation,")")) {
+        trigger_error("math: unbalanced parenthesis",E_USER_WARNING);
+        return;
+    }
+
+    // match all vars in equation, make sure all are passed
+    preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!",$equation, $match);
+
+    foreach($match[1] as $curr_var) {
+        if ($curr_var && !isset($params[$curr_var]) && !isset($_allowed_funcs[$curr_var])) {
+            trigger_error("math: function call $curr_var not allowed",E_USER_WARNING);
+            return;
+        }
+    }
+
+    foreach($params as $key => $val) {
+        if ($key != "equation" && $key != "format" && $key != "assign") {
+            // make sure value is not empty
+            if (strlen($val)==0) {
+                trigger_error("math: parameter $key is empty",E_USER_WARNING);
+                return;
+            }
+            if (!is_numeric($val)) {
+                trigger_error("math: parameter $key: is not numeric",E_USER_WARNING);
+                return;
+            }
+            $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation);
+        }
+    }
+    $smarty_math_result = null;
+    eval("\$smarty_math_result = ".$equation.";");
+
+    if (empty($params['format'])) {
+        if (empty($params['assign'])) {
+            return $smarty_math_result;
+        } else {
+            $template->assign($params['assign'],$smarty_math_result);
+        }
+    } else {
+        if (empty($params['assign'])){
+            printf($params['format'],$smarty_math_result);
+        } else {
+            $template->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
+        }
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifier.capitalize.php b/library/Smarty/libs/plugins/modifier.capitalize.php
new file mode 100644 (file)
index 0000000..a78e363
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Smarty plugin
+ * 
+ * @package Smarty
+ * @subpackage PluginsModifier
+ */
+
+/**
+ * Smarty capitalize modifier plugin
+ * 
+ * Type:     modifier<br>
+ * Name:     capitalize<br>
+ * Purpose:  capitalize words in the string
+ *
+ * {@internal {$string|capitalize:true:true} is the fastest option for MBString enabled systems }}
+ *
+ * @param string  $string    string to capitalize
+ * @param boolean $uc_digits also capitalize "x123" to "X123"
+ * @param boolean $lc_rest   capitalize first letters, lowercase all following letters "aAa" to "Aaa"
+ * @return string capitalized string
+ * @author Monte Ohrt <monte at ohrt dot com> 
+ * @author Rodney Rehm
+ */
+function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false)
+{
+    if (Smarty::$_MBSTRING) {
+        if ($lc_rest) {
+            // uppercase (including hyphenated words)
+            $upper_string = mb_convert_case( $string, MB_CASE_TITLE, Smarty::$_CHARSET );
+        } else {
+            // uppercase word breaks
+            $upper_string = preg_replace("!(^|[^\p{L}'])([\p{Ll}])!eS" . Smarty::$_UTF8_MODIFIER, "stripslashes('\\1').mb_convert_case(stripslashes('\\2'),MB_CASE_UPPER, '" . addslashes(Smarty::$_CHARSET) . "')", $string);
+        }
+        // check uc_digits case
+        if (!$uc_digits) {
+            if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) {
+                foreach($matches[1] as $match) {
+                    $upper_string = substr_replace($upper_string, mb_strtolower($match[0], Smarty::$_CHARSET), $match[1], strlen($match[0]));
+                }
+            } 
+        }
+        $upper_string = preg_replace("!((^|\s)['\"])(\w)!e" . Smarty::$_UTF8_MODIFIER, "stripslashes('\\1').mb_convert_case(stripslashes('\\3'),MB_CASE_UPPER, '" . addslashes(Smarty::$_CHARSET) . "')", $upper_string);
+        return $upper_string;
+    }
+    
+    // lowercase first
+    if ($lc_rest) {
+        $string = strtolower($string);
+    }
+    // uppercase (including hyphenated words)
+    $upper_string = preg_replace("!(^|[^\p{L}'])([\p{Ll}])!eS" . Smarty::$_UTF8_MODIFIER, "stripslashes('\\1').ucfirst(stripslashes('\\2'))", $string); 
+    // check uc_digits case
+    if (!$uc_digits) {
+        if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) {
+            foreach($matches[1] as $match) {
+                $upper_string = substr_replace($upper_string, strtolower($match[0]), $match[1], strlen($match[0]));
+            }
+        } 
+    }
+    $upper_string = preg_replace("!((^|\s)['\"])(\w)!e" . Smarty::$_UTF8_MODIFIER, "stripslashes('\\1').strtoupper(stripslashes('\\3'))", $upper_string);
+    return $upper_string;
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifier.date_format.php b/library/Smarty/libs/plugins/modifier.date_format.php
new file mode 100644 (file)
index 0000000..f3eaba0
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Smarty plugin
+ * 
+ * @package Smarty
+ * @subpackage PluginsModifier
+ */
+
+/**
+ * Smarty date_format modifier plugin
+ * 
+ * Type:     modifier<br>
+ * Name:     date_format<br>
+ * Purpose:  format datestamps via strftime<br>
+ * Input:<br>
+ *          - string: input date string
+ *          - format: strftime format for output
+ *          - default_date: default date if $string is empty
+ * 
+ * @link http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com> 
+ * @param string $string       input date string
+ * @param string $format       strftime format for output
+ * @param string $default_date default date if $string is empty
+ * @param string $formatter    either 'strftime' or 'auto'
+ * @return string |void
+ * @uses smarty_make_timestamp()
+ */
+function smarty_modifier_date_format($string, $format=null, $default_date='', $formatter='auto')
+{
+    if ($format === null) {
+        $format = Smarty::$_DATE_FORMAT;
+    }
+    /**
+    * Include the {@link shared.make_timestamp.php} plugin
+    */
+    require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
+    if ($string != '' && $string != '0000-00-00' && $string != '0000-00-00 00:00:00') {
+        $timestamp = smarty_make_timestamp($string);
+    } elseif ($default_date != '') {
+        $timestamp = smarty_make_timestamp($default_date);
+    } else {
+        return;
+    } 
+    if($formatter=='strftime'||($formatter=='auto'&&strpos($format,'%')!==false)) {
+        if (DS == '\\') {
+            $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T');
+            $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S');
+            if (strpos($format, '%e') !== false) {
+                $_win_from[] = '%e';
+                $_win_to[] = sprintf('%\' 2d', date('j', $timestamp));
+            } 
+            if (strpos($format, '%l') !== false) {
+                $_win_from[] = '%l';
+                $_win_to[] = sprintf('%\' 2d', date('h', $timestamp));
+            } 
+            $format = str_replace($_win_from, $_win_to, $format);
+        } 
+        return strftime($format, $timestamp);
+    } else {
+        return date($format, $timestamp);
+    }
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifier.debug_print_var.php b/library/Smarty/libs/plugins/modifier.debug_print_var.php
new file mode 100644 (file)
index 0000000..fa44100
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Smarty plugin
+ * 
+ * @package Smarty
+ * @subpackage Debug
+ */
+
+/**
+ * Smarty debug_print_var modifier plugin
+ * 
+ * Type:     modifier<br>
+ * Name:     debug_print_var<br>
+ * Purpose:  formats variable contents for display in the console
+ *
+ * @author Monte Ohrt <monte at ohrt dot com> 
+ * @param array|object $var     variable to be formatted
+ * @param integer      $depth   maximum recursion depth if $var is an array
+ * @param integer      $length  maximum string length if $var is a string
+ * @return string 
+ */
+function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
+{
+    $_replace = array("\n" => '<i>\n</i>',
+        "\r" => '<i>\r</i>',
+        "\t" => '<i>\t</i>'
+        );
+
+    switch (gettype($var)) {
+        case 'array' :
+            $results = '<b>Array (' . count($var) . ')</b>';
+            foreach ($var as $curr_key => $curr_val) {
+                $results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
+                 . '<b>' . strtr($curr_key, $_replace) . '</b> =&gt; '
+                 . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
+                $depth--;
+            } 
+            break;
+            
+        case 'object' :
+            $object_vars = get_object_vars($var);
+            $results = '<b>' . get_class($var) . ' Object (' . count($object_vars) . ')</b>';
+            foreach ($object_vars as $curr_key => $curr_val) {
+                $results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
+                 . '<b> -&gt;' . strtr($curr_key, $_replace) . '</b> = '
+                 . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
+                $depth--;
+            } 
+            break;
+            
+        case 'boolean' :
+        case 'NULL' :
+        case 'resource' :
+            if (true === $var) {
+                $results = 'true';
+            } elseif (false === $var) {
+                $results = 'false';
+            } elseif (null === $var) {
+                $results = 'null';
+            } else {
+                $results = htmlspecialchars((string) $var);
+            } 
+            $results = '<i>' . $results . '</i>';
+            break;
+            
+        case 'integer' :
+        case 'float' :
+            $results = htmlspecialchars((string) $var);
+            break;
+            
+        case 'string' :
+            $results = strtr($var, $_replace);
+            if (Smarty::$_MBSTRING) {
+                if (mb_strlen($var, Smarty::$_CHARSET) > $length) {
+                    $results = mb_substr($var, 0, $length - 3, Smarty::$_CHARSET) . '...';
+                }
+            } else {
+                if (isset($var[$length])) {
+                    $results = substr($var, 0, $length - 3) . '...';
+                }
+            }
+
+            $results = htmlspecialchars('"' . $results . '"');
+            break;
+            
+        case 'unknown type' :
+        default :
+            $results = strtr((string) $var, $_replace);
+            if (Smarty::$_MBSTRING) {
+                if (mb_strlen($results, Smarty::$_CHARSET) > $length) {
+                    $results = mb_substr($results, 0, $length - 3, Smarty::$_CHARSET) . '...';
+                }
+            } else {
+                if (strlen($results) > $length) {
+                    $results = substr($results, 0, $length - 3) . '...';
+                }
+            }
+             
+            $results = htmlspecialchars($results);
+    } 
+
+    return $results;
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifier.escape.php b/library/Smarty/libs/plugins/modifier.escape.php
new file mode 100644 (file)
index 0000000..32d185f
--- /dev/null
@@ -0,0 +1,188 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifier
+ */
+
+/**
+ * Smarty escape modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     escape<br>
+ * Purpose:  escape string for output
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param string  $string        input string
+ * @param string  $esc_type      escape type
+ * @param string  $char_set      character set, used for htmlspecialchars() or htmlentities()
+ * @param boolean $double_encode encode already encoded entitites again, used for htmlspecialchars() or htmlentities()
+ * @return string escaped input string
+ */
+function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true)
+{
+    static $_double_encode = null;
+    if ($_double_encode === null) {
+        $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');
+    }
+    
+    if (!$char_set) {
+        $char_set = Smarty::$_CHARSET;
+    }
+
+    switch ($esc_type) {
+        case 'html':
+            if ($_double_encode) {
+                // php >=5.3.2 - go native
+                return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);
+            } else {
+                if ($double_encode) {
+                    // php <5.3.2 - only handle double encoding
+                    return htmlspecialchars($string, ENT_QUOTES, $char_set);
+                } else {
+                    // php <5.3.2 - prevent double encoding
+                    $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
+                    $string = htmlspecialchars($string, ENT_QUOTES, $char_set);
+                    $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);
+                    return $string;
+                }
+            }
+
+        case 'htmlall':
+            if (Smarty::$_MBSTRING) {
+                // mb_convert_encoding ignores htmlspecialchars()
+                if ($_double_encode) {
+                    // php >=5.3.2 - go native
+                    $string = htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);
+                } else {
+                    if ($double_encode) {
+                        // php <5.3.2 - only handle double encoding
+                        $string = htmlspecialchars($string, ENT_QUOTES, $char_set);
+                    } else {
+                        // php <5.3.2 - prevent double encoding
+                        $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
+                        $string = htmlspecialchars($string, ENT_QUOTES, $char_set);
+                        $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);
+                        return $string;
+                    }
+                }
+                
+                // htmlentities() won't convert everything, so use mb_convert_encoding
+                return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set);
+            }
+
+            // no MBString fallback
+            if ($_double_encode) {
+                return htmlentities($string, ENT_QUOTES, $char_set, $double_encode);
+            } else {
+                if ($double_encode) {
+                    return htmlentities($string, ENT_QUOTES, $char_set);
+                } else {
+                    $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
+                    $string = htmlentities($string, ENT_QUOTES, $char_set);
+                    $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);
+                    return $string;
+                }
+            }
+
+        case 'url':
+            return rawurlencode($string);
+
+        case 'urlpathinfo':
+            return str_replace('%2F', '/', rawurlencode($string));
+
+        case 'quotes':
+            // escape unescaped single quotes
+            return preg_replace("%(?<!\\\\)'%", "\\'", $string);
+
+        case 'hex':
+            // escape every byte into hex
+            // Note that the UTF-8 encoded character ä will be represented as %c3%a4
+            $return = '';
+            $_length = strlen($string);
+            for ($x = 0; $x < $_length; $x++) {
+                $return .= '%' . bin2hex($string[$x]);
+            }
+            return $return;
+
+        case 'hexentity':
+            $return = '';
+            if (Smarty::$_MBSTRING) {
+                require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');
+                $return = '';
+                foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {
+                    $return .= '&#x' . strtoupper(dechex($unicode)) . ';';
+                }
+                return $return;
+            }
+            // no MBString fallback
+            $_length = strlen($string);
+            for ($x = 0; $x < $_length; $x++) {
+                $return .= '&#x' . bin2hex($string[$x]) . ';';
+            }
+            return $return;
+
+        case 'decentity':
+            $return = '';
+            if (Smarty::$_MBSTRING) {
+                require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');
+                $return = '';
+                foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {
+                    $return .= '&#' . $unicode . ';';
+                }
+                return $return;
+            }
+            // no MBString fallback
+            $_length = strlen($string);
+            for ($x = 0; $x < $_length; $x++) {
+                $return .= '&#' . ord($string[$x]) . ';';
+            }
+            return $return;
+
+        case 'javascript':
+            // escape quotes and backslashes, newlines, etc.
+            return strtr($string, array('\\' => '\\\\', "'" => "\\'", '"' => '\\"', "\r" => '\\r', "\n" => '\\n', '</' => '<\/'));
+
+        case 'mail':
+            if (Smarty::$_MBSTRING) {
+                require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');
+                return smarty_mb_str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
+            }
+            // no MBString fallback
+            return str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
+
+        case 'nonstd':
+            // escape non-standard chars, such as ms document quotes
+            $return = '';
+            if (Smarty::$_MBSTRING) {
+                require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');
+                foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {
+                    if ($unicode >= 126) {
+                        $return .= '&#' . $unicode . ';';
+                    } else {
+                        $return .= chr($unicode);
+                    }
+                }
+                return $return;
+            }
+
+            $_length = strlen($string);
+            for ($_i = 0; $_i < $_length; $_i++) {
+                $_ord = ord(substr($string, $_i, 1));
+                // non-standard char, escape it
+                if ($_ord >= 126) {
+                    $return .= '&#' . $_ord . ';';
+                } else {
+                    $return .= substr($string, $_i, 1);
+                }
+            }
+            return $return;
+
+        default:
+            return $string;
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifier.regex_replace.php b/library/Smarty/libs/plugins/modifier.regex_replace.php
new file mode 100644 (file)
index 0000000..f9fd5fa
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifier
+ */
+
+/**
+ * Smarty regex_replace modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     regex_replace<br>
+ * Purpose:  regular expression search/replace
+ *
+ * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php
+ *          regex_replace (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param string       $string   input string
+ * @param string|array $search   regular expression(s) to search for
+ * @param string|array $replace  string(s) that should be replaced
+ * @return string
+ */
+function smarty_modifier_regex_replace($string, $search, $replace)
+{
+    if(is_array($search)) {
+        foreach($search as $idx => $s) {
+            $search[$idx] = _smarty_regex_replace_check($s);
+        }
+    } else {
+        $search = _smarty_regex_replace_check($search);
+    }
+    return preg_replace($search, $replace, $string);
+}
+
+/**
+ * @param  string $search string(s) that should be replaced
+ * @return string
+ * @ignore
+ */
+function _smarty_regex_replace_check($search)
+{
+    // null-byte injection detection
+    // anything behind the first null-byte is ignored
+    if (($pos = strpos($search,"\0")) !== false) {
+        $search = substr($search,0,$pos);
+    }
+    // remove eval-modifier from $search
+    if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
+        $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]);
+    }
+    return $search;
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifier.replace.php b/library/Smarty/libs/plugins/modifier.replace.php
new file mode 100644 (file)
index 0000000..4d71a6e
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage PluginsModifier
+ */
+
+/**
+ * Smarty replace modifier plugin
+ * 
+ * Type:     modifier<br>
+ * Name:     replace<br>
+ * Purpose:  simple search/replace
+ * 
+ * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com> 
+ * @author Uwe Tews 
+ * @param string $string  input string
+ * @param string $search  text to search for
+ * @param string $replace replacement text
+ * @return string 
+ */
+function smarty_modifier_replace($string, $search, $replace)
+{
+    if (Smarty::$_MBSTRING) {
+        require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');
+        return smarty_mb_str_replace($search, $replace, $string);
+    }
+    
+    return str_replace($search, $replace, $string);
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifier.spacify.php b/library/Smarty/libs/plugins/modifier.spacify.php
new file mode 100644 (file)
index 0000000..a907232
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage PluginsModifier
+ */
+
+/**
+ * Smarty spacify modifier plugin
+ * 
+ * Type:     modifier<br>
+ * Name:     spacify<br>
+ * Purpose:  add spaces between characters in a string
+ * 
+ * @link http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com> 
+ * @param string $string       input string
+ * @param string $spacify_char string to insert between characters.
+ * @return string
+ */
+function smarty_modifier_spacify($string, $spacify_char = ' ')
+{
+    // well… what about charsets besides latin and UTF-8?
+    return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, -1, PREG_SPLIT_NO_EMPTY));
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifier.truncate.php b/library/Smarty/libs/plugins/modifier.truncate.php
new file mode 100644 (file)
index 0000000..9a803ec
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifier
+ */
+/**
+ * Smarty truncate modifier plugin
+ * 
+ * Type:     modifier<br>
+ * Name:     truncate<br>
+ * Purpose:  Truncate a string to a certain length if necessary,
+ *               optionally splitting in the middle of a word, and
+ *               appending the $etc string or inserting $etc into the middle.
+ * 
+ * @link http://smarty.php.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com> 
+ * @param string  $string      input string
+ * @param integer $length      length of truncated text
+ * @param string  $etc         end string
+ * @param boolean $break_words truncate at word boundary
+ * @param boolean $middle      truncate in the middle of text
+ * @return string truncated string
+ */
+function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false) {
+    if ($length == 0)
+        return '';
+
+    if (Smarty::$_MBSTRING) {
+        if (mb_strlen($string, Smarty::$_CHARSET) > $length) {
+            $length -= min($length, mb_strlen($etc, Smarty::$_CHARSET));
+            if (!$break_words && !$middle) {
+                $string = preg_replace('/\s+?(\S+)?$/' . Smarty::$_UTF8_MODIFIER, '', mb_substr($string, 0, $length + 1, Smarty::$_CHARSET));
+            } 
+            if (!$middle) {
+                return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc;
+            }
+            return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc . mb_substr($string, - $length / 2, $length, Smarty::$_CHARSET);
+        }
+        return $string;
+    }
+    
+    // no MBString fallback
+    if (isset($string[$length])) {
+        $length -= min($length, strlen($etc));
+        if (!$break_words && !$middle) {
+            $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1));
+        } 
+        if (!$middle) {
+            return substr($string, 0, $length) . $etc;
+        }
+        return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2);
+    }
+    return $string;
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.cat.php b/library/Smarty/libs/plugins/modifiercompiler.cat.php
new file mode 100644 (file)
index 0000000..1cfe630
--- /dev/null
@@ -0,0 +1,30 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty cat modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     cat<br>\r
+ * Date:     Feb 24, 2003<br>\r
+ * Purpose:  catenate a value to a variable<br>\r
+ * Input:    string to catenate<br>\r
+ * Example:  {$var|cat:"foo"}\r
+ *\r
+ * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat\r
+ *          (Smarty online manual)\r
+ * @author   Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_cat($params, $compiler)\r
+{\r
+    return '('.implode(').(', $params).')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.count_characters.php b/library/Smarty/libs/plugins/modifiercompiler.count_characters.php
new file mode 100644 (file)
index 0000000..98e8efa
--- /dev/null
@@ -0,0 +1,33 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty count_characters modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     count_characteres<br>\r
+ * Purpose:  count the number of characters in a text\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_count_characters($params, $compiler)\r
+{\r
+    if (!isset($params[1]) || $params[1] != 'true') {\r
+        return 'preg_match_all(\'/[^\s]/' . Smarty::$_UTF8_MODIFIER . '\',' . $params[0] . ', $tmp)';\r
+    }\r
+    if (Smarty::$_MBSTRING) {\r
+        return 'mb_strlen(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')';\r
+    }\r
+    // no MBString fallback\r
+    return 'strlen(' . $params[0] . ')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.count_paragraphs.php b/library/Smarty/libs/plugins/modifiercompiler.count_paragraphs.php
new file mode 100644 (file)
index 0000000..0e1b0af
--- /dev/null
@@ -0,0 +1,28 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty count_paragraphs modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     count_paragraphs<br>\r
+ * Purpose:  count the number of paragraphs in a text\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php\r
+ *          count_paragraphs (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_count_paragraphs($params, $compiler)\r
+{\r
+    // count \r or \n characters\r
+    return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.count_sentences.php b/library/Smarty/libs/plugins/modifiercompiler.count_sentences.php
new file mode 100644 (file)
index 0000000..2f517be
--- /dev/null
@@ -0,0 +1,28 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty count_sentences modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     count_sentences\r
+ * Purpose:  count the number of sentences in a text\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php\r
+ *          count_sentences (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_count_sentences($params, $compiler)\r
+{\r
+    // find periods, question marks, exclamation marks with a word before but not after.\r
+    return 'preg_match_all("#\w[\.\?\!](\W|$)#S' . Smarty::$_UTF8_MODIFIER . '", ' . $params[0] . ', $tmp)';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.count_words.php b/library/Smarty/libs/plugins/modifiercompiler.count_words.php
new file mode 100644 (file)
index 0000000..e05738c
--- /dev/null
@@ -0,0 +1,32 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\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
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+*/\r
+function smarty_modifiercompiler_count_words($params, $compiler)\r
+{\r
+    if (Smarty::$_MBSTRING) {\r
+        // return 'preg_match_all(\'#[\w\pL]+#' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)';\r
+        // expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592\r
+        return 'preg_match_all(\'/\p{L}[\p{L}\p{Mn}\p{Pd}\\\'\x{2019}]*/' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)';\r
+    }\r
+    // no MBString fallback\r
+    return 'str_word_count(' . $params[0] . ')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.default.php b/library/Smarty/libs/plugins/modifiercompiler.default.php
new file mode 100644 (file)
index 0000000..4f831a5
--- /dev/null
@@ -0,0 +1,35 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty default modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     default<br>\r
+ * Purpose:  designate default value for empty variables\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_default ($params, $compiler)\r
+{\r
+    $output = $params[0];\r
+    if (!isset($params[1])) {\r
+        $params[1] = "''";\r
+    }\r
+    \r
+    array_shift($params);\r
+    foreach ($params as $param) {\r
+        $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)';\r
+    }\r
+    return $output;\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.escape.php b/library/Smarty/libs/plugins/modifiercompiler.escape.php
new file mode 100644 (file)
index 0000000..48b74d1
--- /dev/null
@@ -0,0 +1,125 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * @ignore\r
+ */\r
+require_once( SMARTY_PLUGINS_DIR .'shared.literal_compiler_param.php' );\r
+\r
+/**\r
+ * Smarty escape modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     escape<br>\r
+ * Purpose:  escape string for output\r
+ *\r
+ * @link http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual)\r
+ * @author Rodney Rehm\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_escape($params, $compiler)\r
+{\r
+    static $_double_encode = null;\r
+    if ($_double_encode === null) {\r
+        $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');\r
+    }\r
+    \r
+    try {\r
+        $esc_type = smarty_literal_compiler_param($params, 1, 'html');\r
+        $char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET);\r
+        $double_encode = smarty_literal_compiler_param($params, 3, true);\r
+\r
+        if (!$char_set) {\r
+            $char_set = Smarty::$_CHARSET;\r
+        }\r
+\r
+        switch ($esc_type) {\r
+            case 'html':\r
+                if ($_double_encode) {\r
+                    return 'htmlspecialchars('\r
+                        . $params[0] .', ENT_QUOTES, '\r
+                        . var_export($char_set, true) . ', '\r
+                        . var_export($double_encode, true) . ')';\r
+                } else if ($double_encode) {\r
+                    return 'htmlspecialchars('\r
+                        . $params[0] .', ENT_QUOTES, '\r
+                        . var_export($char_set, true) . ')';\r
+                } else {\r
+                    // fall back to modifier.escape.php\r
+                }\r
+\r
+            case 'htmlall':\r
+                if (Smarty::$_MBSTRING) {\r
+                    if ($_double_encode) {\r
+                        // php >=5.3.2 - go native\r
+                        return 'mb_convert_encoding(htmlspecialchars('\r
+                            . $params[0] .', ENT_QUOTES, '\r
+                            . var_export($char_set, true) . ', '\r
+                            . var_export($double_encode, true)\r
+                            . '), "HTML-ENTITIES", '\r
+                            . var_export($char_set, true) . ')';\r
+                    } else if ($double_encode) {\r
+                        // php <5.3.2 - only handle double encoding\r
+                        return 'mb_convert_encoding(htmlspecialchars('\r
+                            . $params[0] .', ENT_QUOTES, '\r
+                            . var_export($char_set, true)\r
+                            . '), "HTML-ENTITIES", '\r
+                            . var_export($char_set, true) . ')';\r
+                    } else {\r
+                        // fall back to modifier.escape.php\r
+                    }\r
+                }\r
+\r
+                // no MBString fallback\r
+                if ($_double_encode) {\r
+                    // php >=5.3.2 - go native\r
+                    return 'htmlentities('\r
+                        . $params[0] .', ENT_QUOTES, '\r
+                        . var_export($char_set, true) . ', '\r
+                        . var_export($double_encode, true) . ')';\r
+                } else if ($double_encode) {\r
+                    // php <5.3.2 - only handle double encoding\r
+                    return 'htmlentities('\r
+                        . $params[0] .', ENT_QUOTES, '\r
+                        . var_export($char_set, true) . ')';\r
+                } else {\r
+                    // fall back to modifier.escape.php\r
+                }\r
+\r
+            case 'url':\r
+                return 'rawurlencode(' . $params[0] . ')';\r
+\r
+            case 'urlpathinfo':\r
+                return 'str_replace("%2F", "/", rawurlencode(' . $params[0] . '))';\r
+\r
+            case 'quotes':\r
+                // escape unescaped single quotes\r
+                return 'preg_replace("%(?<!\\\\\\\\)\'%", "\\\'",' . $params[0] . ')';\r
+\r
+            case 'javascript':\r
+                // escape quotes and backslashes, newlines, etc.\r
+                return 'strtr(' . $params[0] . ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "</" => "<\/" ))';\r
+\r
+        }\r
+    } catch(SmartyException $e) {\r
+        // pass through to regular plugin fallback\r
+    }\r
+\r
+    // could not optimize |escape call, so fallback to regular plugin\r
+    if ($compiler->tag_nocache | $compiler->nocache) {\r
+        $compiler->template->required_plugins['nocache']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php';\r
+        $compiler->template->required_plugins['nocache']['escape']['modifier']['function'] = 'smarty_modifier_escape';\r
+    } else {\r
+        $compiler->template->required_plugins['compiled']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php';\r
+        $compiler->template->required_plugins['compiled']['escape']['modifier']['function'] = 'smarty_modifier_escape';\r
+    }\r
+    return 'smarty_modifier_escape(' . join( ', ', $params ) . ')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.from_charset.php b/library/Smarty/libs/plugins/modifiercompiler.from_charset.php
new file mode 100644 (file)
index 0000000..93b568a
--- /dev/null
@@ -0,0 +1,34 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty from_charset modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     from_charset<br>\r
+ * Purpose:  convert character encoding from $charset to internal encoding\r
+ *\r
+ * @author Rodney Rehm\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_from_charset($params, $compiler)\r
+{\r
+    if (!Smarty::$_MBSTRING) {\r
+        // FIXME: (rodneyrehm) shouldn't this throw an error?\r
+        return $params[0];\r
+    }\r
+\r
+    if (!isset($params[1])) {\r
+        $params[1] = '"ISO-8859-1"';\r
+    }\r
+\r
+    return 'mb_convert_encoding(' . $params[0] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[1] . ')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.indent.php b/library/Smarty/libs/plugins/modifiercompiler.indent.php
new file mode 100644 (file)
index 0000000..020c4fd
--- /dev/null
@@ -0,0 +1,32 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty indent modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     indent<br>\r
+ * Purpose:  indent lines of text\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+\r
+function smarty_modifiercompiler_indent($params, $compiler)\r
+{\r
+    if (!isset($params[1])) {\r
+        $params[1] = 4;\r
+    }\r
+    if (!isset($params[2])) {\r
+        $params[2] = "' '";\r
+    }\r
+    return 'preg_replace(\'!^!m\',str_repeat(' . $params[2] . ',' . $params[1] . '),' . $params[0] . ')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.lower.php b/library/Smarty/libs/plugins/modifiercompiler.lower.php
new file mode 100644 (file)
index 0000000..1845cc1
--- /dev/null
@@ -0,0 +1,31 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty lower modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     lower<br>\r
+ * Purpose:  convert string to lowercase\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual)\r
+ * @author Monte Ohrt <monte at ohrt dot com>\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+\r
+function smarty_modifiercompiler_lower($params, $compiler)\r
+{\r
+    if (Smarty::$_MBSTRING) {\r
+        return 'mb_strtolower(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')' ;\r
+    }\r
+    // no MBString fallback\r
+    return 'strtolower(' . $params[0] . ')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.noprint.php b/library/Smarty/libs/plugins/modifiercompiler.noprint.php
new file mode 100644 (file)
index 0000000..3ca2657
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty noprint modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     noprint<br>\r
+ * Purpose:  return an empty string\r
+ *\r
+ * @author   Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_noprint($params, $compiler)\r
+{\r
+    return "''";\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.string_format.php b/library/Smarty/libs/plugins/modifiercompiler.string_format.php
new file mode 100644 (file)
index 0000000..8334597
--- /dev/null
@@ -0,0 +1,26 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty string_format modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     string_format<br>\r
+ * Purpose:  format strings via sprintf\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_string_format($params, $compiler)\r
+{\r
+    return 'sprintf(' . $params[1] . ',' . $params[0] . ')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.strip.php b/library/Smarty/libs/plugins/modifiercompiler.strip.php
new file mode 100644 (file)
index 0000000..f1d5db0
--- /dev/null
@@ -0,0 +1,33 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty strip modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     strip<br>\r
+ * Purpose:  Replace all repeated spaces, newlines, tabs\r
+ *              with a single space or supplied replacement string.<br>\r
+ * Example:  {$var|strip} {$var|strip:"&nbsp;"}<br>\r
+ * Date:     September 25th, 2002\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+\r
+function smarty_modifiercompiler_strip($params, $compiler)\r
+{\r
+    if (!isset($params[1])) {\r
+        $params[1] = "' '";\r
+    }\r
+    return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})";\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.strip_tags.php b/library/Smarty/libs/plugins/modifiercompiler.strip_tags.php
new file mode 100644 (file)
index 0000000..296a3a2
--- /dev/null
@@ -0,0 +1,33 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty strip_tags modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     strip_tags<br>\r
+ * Purpose:  strip html tags from text\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_strip_tags($params, $compiler)\r
+{\r
+   if (!isset($params[1])) {\r
+        $params[1] = true;\r
+    }\r
+    if ($params[1] === true) {\r
+        return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})";\r
+    } else {\r
+        return 'strip_tags(' . $params[0] . ')';\r
+    }\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.to_charset.php b/library/Smarty/libs/plugins/modifiercompiler.to_charset.php
new file mode 100644 (file)
index 0000000..f5cdf45
--- /dev/null
@@ -0,0 +1,34 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty to_charset modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     to_charset<br>\r
+ * Purpose:  convert character encoding from internal encoding to $charset\r
+ *\r
+ * @author Rodney Rehm\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_to_charset($params, $compiler)\r
+{\r
+    if (!Smarty::$_MBSTRING) {\r
+        // FIXME: (rodneyrehm) shouldn't this throw an error?\r
+        return $params[0];\r
+    }\r
+\r
+    if (!isset($params[1])) {\r
+        $params[1] = '"ISO-8859-1"';\r
+    }\r
+\r
+    return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', "' . addslashes(Smarty::$_CHARSET) . '")';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.unescape.php b/library/Smarty/libs/plugins/modifiercompiler.unescape.php
new file mode 100644 (file)
index 0000000..4321ff1
--- /dev/null
@@ -0,0 +1,51 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty unescape modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     unescape<br>\r
+ * Purpose:  unescape html entities\r
+ *\r
+ * @author Rodney Rehm\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_unescape($params, $compiler)\r
+{\r
+    if (!isset($params[1])) {\r
+        $params[1] = 'html';\r
+    }\r
+    if (!isset($params[2])) {\r
+        $params[2] = '\'' . addslashes(Smarty::$_CHARSET) . '\'';\r
+    } else {\r
+        $params[2] = "'" . $params[2] . "'";\r
+    }\r
+\r
+    switch (trim($params[1], '"\'')) {\r
+        case 'entity':\r
+        case 'htmlall':\r
+            if (Smarty::$_MBSTRING) {\r
+                return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')';\r
+            }\r
+\r
+            return 'html_entity_decode(' . $params[0] . ', ENT_NOQUOTES, ' . $params[2] . ')';\r
+\r
+        case 'html':\r
+            return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)';\r
+\r
+        case 'url':\r
+            return 'rawurldecode(' . $params[0] . ')';\r
+\r
+        default:\r
+            return $params[0];\r
+    }\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.upper.php b/library/Smarty/libs/plugins/modifiercompiler.upper.php
new file mode 100644 (file)
index 0000000..f368e37
--- /dev/null
@@ -0,0 +1,30 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty upper modifier plugin\r
+ * \r
+ * Type:     modifier<br>\r
+ * Name:     lower<br>\r
+ * Purpose:  convert string to uppercase\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_upper($params, $compiler)\r
+{\r
+    if (Smarty::$_MBSTRING) {\r
+        return 'mb_strtoupper(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')' ;\r
+    }\r
+    // no MBString fallback\r
+    return 'strtoupper(' . $params[0] . ')';\r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/modifiercompiler.wordwrap.php b/library/Smarty/libs/plugins/modifiercompiler.wordwrap.php
new file mode 100644 (file)
index 0000000..f6845ad
--- /dev/null
@@ -0,0 +1,46 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty wordwrap modifier plugin\r
+ * \r
+ * Type:     modifier<br>\r
+ * Name:     wordwrap<br>\r
+ * Purpose:  wrap a string of text at a given length\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_wordwrap($params, $compiler)\r
+{\r
+    if (!isset($params[1])) {\r
+        $params[1] = 80;\r
+    } \r
+    if (!isset($params[2])) {\r
+        $params[2] = '"\n"';\r
+    } \r
+    if (!isset($params[3])) {\r
+        $params[3] = 'false';\r
+    } \r
+    $function = 'wordwrap';\r
+    if (Smarty::$_MBSTRING) {\r
+        if ($compiler->tag_nocache | $compiler->nocache) {\r
+            $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php';\r
+            $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap';\r
+        } else {\r
+            $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php';\r
+            $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap';\r
+        }\r
+        $function = 'smarty_mb_wordwrap';\r
+    }\r
+    return $function . '(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')';\r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/outputfilter.trimwhitespace.php b/library/Smarty/libs/plugins/outputfilter.trimwhitespace.php
new file mode 100644 (file)
index 0000000..87cf8c7
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsFilter
+ */
+
+/**
+ * Smarty trimwhitespace outputfilter plugin
+ *
+ * Trim unnecessary whitespace from HTML markup.
+ *
+ * @author   Rodney Rehm
+ * @param string                   $source input string
+ * @param Smarty_Internal_Template $smarty Smarty object
+ * @return string filtered output
+ * @todo substr_replace() is not overloaded by mbstring.func_overload - so this function might fail!
+ */
+function smarty_outputfilter_trimwhitespace($source, Smarty_Internal_Template $smarty)
+{
+    $store = array();
+    $_store = 0;
+    $_offset = 0;
+
+    // Unify Line-Breaks to \n
+    $source = preg_replace("/\015\012|\015|\012/", "\n", $source);
+
+    // capture Internet Explorer Conditional Comments
+    if (preg_match_all('#<!--\[[^\]]+\]>.*?<!\[[^\]]+\]-->#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
+        foreach ($matches as $match) {
+            $store[] = $match[0][0];
+            $_length = strlen($match[0][0]);
+            $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@';
+            $source = substr_replace($source, $replace, $match[0][1] - $_offset, $_length);
+
+            $_offset += $_length - strlen($replace);
+            $_store++;
+        }
+    }
+
+    // Strip all HTML-Comments
+    // yes, even the ones in <script> - see http://stackoverflow.com/a/808850/515124
+    $source = preg_replace( '#<!--.*?-->#ms', '', $source );
+
+    // capture html elements not to be messed with
+    $_offset = 0;
+    if (preg_match_all('#<(script|pre|textarea)[^>]*>.*?</\\1>#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
+        foreach ($matches as $match) {
+            $store[] = $match[0][0];
+            $_length = strlen($match[0][0]);
+            $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@';
+            $source = substr_replace($source, $replace, $match[0][1] - $_offset, $_length);
+
+            $_offset += $_length - strlen($replace);
+            $_store++;
+        }
+    }
+
+    $expressions = array(
+        // replace multiple spaces between tags by a single space
+        // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements
+        '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s' => '\1 \2',
+        // remove spaces between attributes (but not in attribute values!)
+        '#(([a-z0-9]\s*=\s*(["\'])[^\3]*?\3)|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \4',
+        // note: for some very weird reason trim() seems to remove spaces inside attributes.
+        // maybe a \0 byte or something is interfering?
+        '#^\s+<#Ss' => '<',
+        '#>\s+$#Ss' => '>',
+    );
+
+    $source = preg_replace( array_keys($expressions), array_values($expressions), $source );
+    // note: for some very weird reason trim() seems to remove spaces inside attributes.
+    // maybe a \0 byte or something is interfering?
+    // $source = trim( $source );
+
+    // capture html elements not to be messed with
+    $_offset = 0;
+    if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
+        foreach ($matches as $match) {
+            $store[] = $match[0][0];
+            $_length = strlen($match[0][0]);
+            $replace = array_shift($store);
+            $source = substr_replace($source, $replace, $match[0][1] + $_offset, $_length);
+
+            $_offset += strlen($replace) - $_length;
+            $_store++;
+        }
+    }
+
+    return $source;
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/shared.escape_special_chars.php b/library/Smarty/libs/plugins/shared.escape_special_chars.php
new file mode 100644 (file)
index 0000000..d2609b6
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Smarty shared plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+
+if (version_compare(PHP_VERSION, '5.2.3', '>=')) {
+    /**
+     * escape_special_chars common function
+     *
+     * Function: smarty_function_escape_special_chars<br>
+     * Purpose:  used by other smarty functions to escape
+     *           special chars except for already escaped ones
+     *
+     * @author   Monte Ohrt <monte at ohrt dot com>
+     * @param string $string text that should by escaped
+     * @return string
+     */
+    function smarty_function_escape_special_chars($string)
+    {
+        if (!is_array($string)) {
+            $string = htmlspecialchars($string, ENT_COMPAT, Smarty::$_CHARSET, false);
+        }
+        return $string;
+    }  
+} else {         
+    /**
+     * escape_special_chars common function
+     *
+     * Function: smarty_function_escape_special_chars<br>
+     * Purpose:  used by other smarty functions to escape
+     *           special chars except for already escaped ones
+     *
+     * @author   Monte Ohrt <monte at ohrt dot com>
+     * @param string $string text that should by escaped
+     * @return string
+     */
+    function smarty_function_escape_special_chars($string)
+    {
+        if (!is_array($string)) {
+            $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
+            $string = htmlspecialchars($string);
+            $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); 
+        }
+        return $string;
+    }                                                                                                             
+} 
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/shared.literal_compiler_param.php b/library/Smarty/libs/plugins/shared.literal_compiler_param.php
new file mode 100644 (file)
index 0000000..dbcd937
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+
+/**
+ * evaluate compiler parameter
+ *
+ * @param array   $params  parameter array as given to the compiler function
+ * @param integer $index   array index of the parameter to convert
+ * @param mixed   $default value to be returned if the parameter is not present
+ * @return mixed evaluated value of parameter or $default
+ * @throws SmartyException if parameter is not a literal (but an expression, variable, …)
+ * @author Rodney Rehm
+ */
+function smarty_literal_compiler_param($params, $index, $default=null)
+{
+    // not set, go default
+    if (!isset($params[$index])) {
+        return $default;
+    }
+    // test if param is a literal
+    if (!preg_match('/^([\'"]?)[a-zA-Z0-9]+(\\1)$/', $params[$index])) {
+        throw new SmartyException('$param[' . $index . '] is not a literal and is thus not evaluatable at compile time');
+    }
+
+    $t = null;
+    eval("\$t = " . $params[$index] . ";");
+    return $t;
+}
diff --git a/library/Smarty/libs/plugins/shared.make_timestamp.php b/library/Smarty/libs/plugins/shared.make_timestamp.php
new file mode 100644 (file)
index 0000000..5d7c97e
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Smarty shared plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+
+/**
+ * Function: smarty_make_timestamp<br>
+ * Purpose:  used by other smarty functions to make a timestamp from a string.
+ *
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param DateTime|int|string $string  date object, timestamp or string that can be converted using strtotime()
+ * @return int
+ */
+function smarty_make_timestamp($string)
+{
+    if (empty($string)) {
+        // use "now":
+        return time();
+    } elseif ($string instanceof DateTime) {
+        return $string->getTimestamp();
+    } elseif (strlen($string) == 14 && ctype_digit($string)) {
+        // it is mysql timestamp format of YYYYMMDDHHMMSS?
+        return mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),
+                       substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4));
+    } elseif (is_numeric($string)) {
+        // it is a numeric string, we handle it as timestamp
+        return (int) $string;
+    } else {
+        // strtotime should handle it
+        $time = strtotime($string);
+        if ($time == -1 || $time === false) {
+            // strtotime() was not able to parse $string, use "now":
+            return time();
+        }
+        return $time;
+    }
+}
+
+?>
diff --git a/library/Smarty/libs/plugins/shared.mb_str_replace.php b/library/Smarty/libs/plugins/shared.mb_str_replace.php
new file mode 100644 (file)
index 0000000..ecafeb7
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Smarty shared plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+if (!function_exists('smarty_mb_str_replace')) {
+
+    /**
+     * Multibyte string replace
+     *
+     * @param string $search  the string to be searched
+     * @param string $replace the replacement string
+     * @param string $subject the source string
+     * @param int    &$count  number of matches found
+     * @return string replaced string
+     * @author Rodney Rehm
+     */
+    function smarty_mb_str_replace($search, $replace, $subject, &$count=0)
+    {
+        if (!is_array($search) && is_array($replace)) {
+            return false;
+        }
+        if (is_array($subject)) {
+            // call mb_replace for each single string in $subject
+            foreach ($subject as &$string) {
+                $string = &smarty_mb_str_replace($search, $replace, $string, $c);
+                $count += $c;
+            }
+        } elseif (is_array($search)) {
+            if (!is_array($replace)) {
+                foreach ($search as &$string) {
+                    $subject = smarty_mb_str_replace($string, $replace, $subject, $c);
+                    $count += $c;
+                }
+            } else {
+                $n = max(count($search), count($replace));
+                while ($n--) {
+                    $subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c);
+                    $count += $c;
+                    next($search);
+                    next($replace);
+                }
+            }
+        } else {
+            $parts = mb_split(preg_quote($search), $subject);
+            $count = count($parts) - 1;
+            $subject = implode($replace, $parts);
+        }
+        return $subject;
+    }
+
+}
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/shared.mb_unicode.php b/library/Smarty/libs/plugins/shared.mb_unicode.php
new file mode 100644 (file)
index 0000000..e7f839e
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Smarty shared plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+
+/**
+ * convert characters to their decimal unicode equivalents
+ *
+ * @link http://www.ibm.com/developerworks/library/os-php-unicode/index.html#listing3 for inspiration
+ * @param string $string   characters to calculate unicode of
+ * @param string $encoding encoding of $string, if null mb_internal_encoding() is used
+ * @return array sequence of unicodes
+ * @author Rodney Rehm
+ */
+function smarty_mb_to_unicode($string, $encoding=null) {
+    if ($encoding) {
+        $expanded = mb_convert_encoding($string, "UTF-32BE", $encoding);
+    } else {
+        $expanded = mb_convert_encoding($string, "UTF-32BE");
+    }
+    return unpack("N*", $expanded);
+}
+
+/**
+ * convert unicodes to the character of given encoding
+ *
+ * @link http://www.ibm.com/developerworks/library/os-php-unicode/index.html#listing3 for inspiration
+ * @param integer|array $unicode  single unicode or list of unicodes to convert
+ * @param string        $encoding encoding of returned string, if null mb_internal_encoding() is used
+ * @return string unicode as character sequence in given $encoding
+ * @author Rodney Rehm
+ */
+function smarty_mb_from_unicode($unicode, $encoding=null) {
+    $t = '';
+    if (!$encoding) {
+        $encoding = mb_internal_encoding();
+    }
+    foreach((array) $unicode as $utf32be) {
+        $character = pack("N*", $utf32be);
+        $t .= mb_convert_encoding($character, $encoding, "UTF-32BE");
+    }
+    return $t;
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/shared.mb_wordwrap.php b/library/Smarty/libs/plugins/shared.mb_wordwrap.php
new file mode 100644 (file)
index 0000000..ba3498c
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Smarty shared plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+
+if(!function_exists('smarty_mb_wordwrap')) {
+
+    /**
+     * Wrap a string to a given number of characters
+     *
+     * @link http://php.net/manual/en/function.wordwrap.php for similarity
+     * @param string  $str   the string to wrap
+     * @param int     $width the width of the output
+     * @param string  $break the character used to break the line
+     * @param boolean $cut   ignored parameter, just for the sake of
+     * @return string wrapped string
+     * @author Rodney Rehm
+     */
+    function smarty_mb_wordwrap($str, $width=75, $break="\n", $cut=false)
+    {
+        // break words into tokens using white space as a delimiter
+        $tokens = preg_split('!(\s)!S' . Smarty::$_UTF8_MODIFIER, $str, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);
+        $length = 0;
+        $t = '';
+        $_previous = false;
+
+        foreach ($tokens as $_token) {
+            $token_length = mb_strlen($_token, Smarty::$_CHARSET);
+            $_tokens = array($_token);
+            if ($token_length > $width) {
+                // remove last space
+                $t = mb_substr($t, 0, -1, Smarty::$_CHARSET);
+                $_previous = false;
+                $length = 0;
+
+                if ($cut) {
+                    $_tokens = preg_split('!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER, $_token, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);
+                    // broken words go on a new line
+                    $t .= $break;
+                }
+            }
+
+            foreach ($_tokens as $token) {
+                $_space = !!preg_match('!^\s$!S' . Smarty::$_UTF8_MODIFIER, $token);
+                $token_length = mb_strlen($token, Smarty::$_CHARSET);
+                $length += $token_length;
+
+                if ($length > $width) {
+                    // remove space before inserted break
+                    if ($_previous && $token_length < $width) {
+                        $t = mb_substr($t, 0, -1, Smarty::$_CHARSET);
+                    }
+
+                    // add the break before the token
+                    $t .= $break;
+                    $length = $token_length;
+
+                    // skip space after inserting a break
+                    if ($_space) {
+                        $length = 0;
+                        continue;
+                    }
+                } else if ($token == "\n") {
+                    // hard break must reset counters
+                    $_previous = 0;
+                    $length = 0;
+                } else {
+                    // remember if we had a space or not
+                    $_previous = $_space;
+                }
+                // add the token
+                $t .= $token;
+            }
+        }
+
+        return $t;
+    }
+
+}
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/plugins/variablefilter.htmlspecialchars.php b/library/Smarty/libs/plugins/variablefilter.htmlspecialchars.php
new file mode 100644 (file)
index 0000000..aff711e
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsFilter
+ */
+
+/**
+ * Smarty htmlspecialchars variablefilter plugin
+ *
+ * @param string                   $source input string
+ * @param Smarty_Internal_Template $smarty Smarty object
+ * @return string filtered output
+ */
+function smarty_variablefilter_htmlspecialchars($source, $smarty)
+{
+    return htmlspecialchars($source, ENT_QUOTES, Smarty::$_CHARSET);
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_cacheresource.php b/library/Smarty/libs/sysplugins/smarty_cacheresource.php
new file mode 100644 (file)
index 0000000..ca18add
--- /dev/null
@@ -0,0 +1,381 @@
+<?php
+/**
+* Smarty Internal Plugin
+*
+* @package Smarty
+* @subpackage Cacher
+*/
+
+/**
+* Cache Handler API
+*
+* @package Smarty
+* @subpackage Cacher
+* @author Rodney Rehm
+*/
+abstract class Smarty_CacheResource {
+    /**
+    * cache for Smarty_CacheResource instances
+    * @var array
+    */
+    public static $resources = array();
+
+    /**
+    * resource types provided by the core
+    * @var array
+    */
+    protected static $sysplugins = array(
+        'file' => true,
+    );
+
+    /**
+    * populate Cached Object with meta data from Resource
+    *
+    * @param Smarty_Template_Cached $cached cached object
+    * @param Smarty_Internal_Template $_template template object
+    * @return void
+    */
+    public abstract function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template);
+
+    /**
+    * populate Cached Object with timestamp and exists from Resource
+    *
+    * @param Smarty_Template_Cached $source cached object
+    * @return void
+    */
+    public abstract function populateTimestamp(Smarty_Template_Cached $cached);
+
+    /**
+    * Read the cached template and process header
+    *
+    * @param Smarty_Internal_Template $_template template object
+    * @param Smarty_Template_Cached $cached cached object
+    * @return booelan true or false if the cached content does not exist
+    */
+    public abstract function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null);
+
+    /**
+    * Write the rendered template output to cache
+    *
+    * @param Smarty_Internal_Template $_template template object
+    * @param string $content content to cache
+    * @return boolean success
+    */
+    public abstract function writeCachedContent(Smarty_Internal_Template $_template, $content);
+
+    /**
+    * Return cached content
+    *
+    * @param Smarty_Internal_Template $_template template object
+    * @param string $content content of cache
+    */
+    public function getCachedContent(Smarty_Internal_Template $_template)
+    {
+        if ($_template->cached->handler->process($_template)) {
+            ob_start();
+            $_template->properties['unifunc']($_template);
+            return ob_get_clean();
+        }
+        return null;
+    }
+
+    /**
+    * Empty cache
+    *
+    * @param Smarty $smarty Smarty object
+    * @param integer $exp_time expiration time (number of seconds, not timestamp)
+    * @return integer number of cache files deleted
+    */
+    public abstract function clearAll(Smarty $smarty, $exp_time=null);
+
+    /**
+    * Empty cache for a specific template
+    *
+    * @param Smarty $smarty Smarty object
+    * @param string $resource_name template name
+    * @param string $cache_id cache id
+    * @param string $compile_id compile id
+    * @param integer $exp_time expiration time (number of seconds, not timestamp)
+    * @return integer number of cache files deleted
+    */
+    public abstract function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time);
+
+
+    public function locked(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        // theoretically locking_timeout should be checked against time_limit (max_execution_time)
+        $start = microtime(true);
+        $hadLock = null;
+        while ($this->hasLock($smarty, $cached)) {
+            $hadLock = true;
+            if (microtime(true) - $start > $smarty->locking_timeout) {
+                // abort waiting for lock release
+                return false;
+            }
+            sleep(1);
+        }
+        return $hadLock;
+    }
+
+    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        // check if lock exists
+        return false;
+    }
+
+    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        // create lock
+        return true;
+    }
+
+    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        // release lock
+        return true;
+    }
+
+
+    /**
+    * Load Cache Resource Handler
+    *
+    * @param Smarty $smarty Smarty object
+    * @param string $type name of the cache resource
+    * @return Smarty_CacheResource Cache Resource Handler
+    */
+    public static function load(Smarty $smarty, $type = null)
+    {
+        if (!isset($type)) {
+            $type = $smarty->caching_type;
+        }
+
+        // try smarty's cache
+        if (isset($smarty->_cacheresource_handlers[$type])) {
+            return $smarty->_cacheresource_handlers[$type];
+        }
+        
+        // try registered resource
+        if (isset($smarty->registered_cache_resources[$type])) {
+            // do not cache these instances as they may vary from instance to instance
+            return $smarty->_cacheresource_handlers[$type] = $smarty->registered_cache_resources[$type];
+        }
+        // try sysplugins dir
+        if (isset(self::$sysplugins[$type])) {
+            if (!isset(self::$resources[$type])) {
+                $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);
+                self::$resources[$type] = new $cache_resource_class();
+            }
+            return $smarty->_cacheresource_handlers[$type] = self::$resources[$type];
+        }
+        // try plugins dir
+        $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);
+        if ($smarty->loadPlugin($cache_resource_class)) {
+            if (!isset(self::$resources[$type])) {
+                self::$resources[$type] = new $cache_resource_class();
+            }
+            return $smarty->_cacheresource_handlers[$type] = self::$resources[$type];
+        }
+        // give up
+        throw new SmartyException("Unable to load cache resource '{$type}'");
+    }
+
+    /**
+    * Invalid Loaded Cache Files
+    *
+    * @param Smarty $smarty Smarty object
+    */
+    public static function invalidLoadedCache(Smarty $smarty)
+    {
+        foreach ($smarty->template_objects as $tpl) {
+            if (isset($tpl->cached)) {
+                $tpl->cached->valid = false;
+                $tpl->cached->processed = false;
+            }
+        }
+    }
+}
+
+/**
+* Smarty Resource Data Object
+*
+* Cache Data Container for Template Files
+*
+* @package Smarty
+* @subpackage TemplateResources
+* @author Rodney Rehm
+*/
+class Smarty_Template_Cached {
+    /**
+    * Source Filepath
+    * @var string
+    */
+    public $filepath = false;
+
+    /**
+    * Source Content
+    * @var string
+    */
+    public $content = null;
+
+    /**
+    * Source Timestamp
+    * @var integer
+    */
+    public $timestamp = false;
+
+    /**
+    * Source Existance
+    * @var boolean
+    */
+    public $exists = false;
+
+    /**
+    * Cache Is Valid
+    * @var boolean
+    */
+    public $valid = false;
+
+    /**
+    * Cache was processed
+    * @var boolean
+    */
+    public $processed = false;
+
+    /**
+    * CacheResource Handler
+    * @var Smarty_CacheResource
+    */
+    public $handler = null;
+
+    /**
+    * Template Compile Id (Smarty_Internal_Template::$compile_id)
+    * @var string
+    */
+    public $compile_id = null;
+
+    /**
+    * Template Cache Id (Smarty_Internal_Template::$cache_id)
+    * @var string
+    */
+    public $cache_id = null;
+
+    /**
+    * Id for cache locking
+    * @var string
+    */
+    public $lock_id = null;
+
+    /**
+    * flag that cache is locked by this instance
+    * @var bool
+    */
+    public $is_locked = false;
+
+    /**
+    * Source Object
+    * @var Smarty_Template_Source
+    */
+    public $source = null;
+
+    /**
+    * create Cached Object container
+    *
+    * @param Smarty_Internal_Template $_template template object
+    */
+    public function __construct(Smarty_Internal_Template $_template)
+    {
+        $this->compile_id = $_template->compile_id;
+        $this->cache_id = $_template->cache_id;
+        $this->source = $_template->source;
+        $_template->cached = $this;
+        $smarty = $_template->smarty;
+
+        //
+        // load resource handler
+        //
+        $this->handler = $handler = Smarty_CacheResource::load($smarty); // Note: prone to circular references
+
+        //
+        //    check if cache is valid
+        //
+        if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || $_template->source->recompiled) {
+            $handler->populate($this, $_template);
+            return;
+        }
+        while (true) {
+            while (true) {
+                $handler->populate($this, $_template);
+                if ($this->timestamp === false || $smarty->force_compile || $smarty->force_cache) {
+                    $this->valid = false;
+                } else {
+                    $this->valid = true;
+                }
+                if ($this->valid && $_template->caching == Smarty::CACHING_LIFETIME_CURRENT && $_template->cache_lifetime >= 0 && time() > ($this->timestamp + $_template->cache_lifetime)) {
+                    // lifetime expired
+                    $this->valid = false;
+                }
+                if ($this->valid || !$_template->smarty->cache_locking) {
+                    break;
+                }
+                if (!$this->handler->locked($_template->smarty, $this)) {
+                    $this->handler->acquireLock($_template->smarty, $this);
+                    break 2;
+                }
+            }
+            if ($this->valid) {
+                if (!$_template->smarty->cache_locking || $this->handler->locked($_template->smarty, $this) === null) {
+                    // load cache file for the following checks
+                    if ($smarty->debugging) {
+                        Smarty_Internal_Debug::start_cache($_template);
+                    }
+                    if($handler->process($_template, $this) === false) {
+                        $this->valid = false;
+                    } else {
+                        $this->processed = true;
+                    }
+                    if ($smarty->debugging) {
+                        Smarty_Internal_Debug::end_cache($_template);
+                    }
+                } else {
+                    continue;
+                }
+            } else {
+                return;
+            }
+            if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_SAVED && $_template->properties['cache_lifetime'] >= 0 && (time() > ($_template->cached->timestamp + $_template->properties['cache_lifetime']))) {
+                $this->valid = false;
+            }
+            if (!$this->valid && $_template->smarty->cache_locking) {
+                $this->handler->acquireLock($_template->smarty, $this);
+                return;
+            } else {
+                return;
+            }
+        }
+    }
+
+    /**
+    * Write this cache object to handler
+    *
+    * @param Smarty_Internal_Template $_template template object
+    * @param string $content content to cache
+    * @return boolean success
+    */
+    public function write(Smarty_Internal_Template $_template, $content)
+    {
+        if (!$_template->source->recompiled) {
+            if ($this->handler->writeCachedContent($_template, $content)) {
+                $this->timestamp = time();
+                $this->exists = true;
+                $this->valid = true;
+                if ($_template->smarty->cache_locking) {
+                    $this->handler->releaseLock($_template->smarty, $this);
+                }
+                return true;
+            }
+        }
+        return false;
+    }
+
+}
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_cacheresource_custom.php b/library/Smarty/libs/sysplugins/smarty_cacheresource_custom.php
new file mode 100644 (file)
index 0000000..ee9de15
--- /dev/null
@@ -0,0 +1,237 @@
+<?php
+/**
+ * Smarty Internal Plugin
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ */
+
+/**
+ * Cache Handler API
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ * @author Rodney Rehm
+ */
+abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource {
+
+    /**
+     * fetch cached content and its modification time from data source
+     *
+     * @param string $id         unique cache content identifier
+     * @param string $name       template name
+     * @param string $cache_id   cache id
+     * @param string $compile_id compile id
+     * @param string $content    cached content
+     * @param integer $mtime cache modification timestamp (epoch)
+     * @return void
+     */
+    protected abstract function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime);
+
+    /**
+     * Fetch cached content's modification timestamp from data source
+     *
+     * {@internal implementing this method is optional.
+     *  Only implement it if modification times can be accessed faster than loading the complete cached content.}}
+     *
+     * @param string $id         unique cache content identifier
+     * @param string $name       template name
+     * @param string $cache_id   cache id
+     * @param string $compile_id compile id
+     * @return integer|boolean timestamp (epoch) the template was modified, or false if not found
+     */
+    protected function fetchTimestamp($id, $name, $cache_id, $compile_id)
+    {
+        return null;
+    }
+
+    /**
+     * Save content to cache
+     *
+     * @param string       $id         unique cache content identifier
+     * @param string       $name       template name
+     * @param string       $cache_id   cache id
+     * @param string       $compile_id compile id
+     * @param integer|null $exp_time   seconds till expiration or null
+     * @param string $content content to cache
+     * @return boolean success
+     */
+    protected abstract function save($id, $name, $cache_id, $compile_id, $exp_time, $content);
+
+    /**
+     * Delete content from cache
+     *
+     * @param string       $name       template name
+     * @param string       $cache_id   cache id
+     * @param string       $compile_id compile id
+     * @param integer|null $exp_time   seconds till expiration time in seconds or null
+     * @return integer number of deleted caches
+     */
+    protected abstract function delete($name, $cache_id, $compile_id, $exp_time);
+
+    /**
+     * populate Cached Object with meta data from Resource
+     *
+     * @param Smarty_Template_Cached   $cached    cached object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     */
+    public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
+    {
+        $_cache_id = isset($cached->cache_id) ? preg_replace('![^\w\|]+!', '_', $cached->cache_id) : null;
+        $_compile_id = isset($cached->compile_id) ? preg_replace('![^\w\|]+!', '_', $cached->compile_id) : null;
+
+        $cached->filepath = sha1($cached->source->filepath . $_cache_id . $_compile_id);
+        $this->populateTimestamp($cached);
+    }
+
+    /**
+     * populate Cached Object with timestamp and exists from Resource
+     *
+     * @param Smarty_Template_Cached $source cached object
+     * @return void
+     */
+    public function populateTimestamp(Smarty_Template_Cached $cached)
+    {
+        $mtime = $this->fetchTimestamp($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id);
+        if ($mtime !== null) {
+            $cached->timestamp = $mtime;
+            $cached->exists = !!$cached->timestamp;
+            return;
+        }
+        $timestamp = null;
+        $this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $cached->content, $timestamp);
+        $cached->timestamp = isset($timestamp) ? $timestamp : false;
+        $cached->exists = !!$cached->timestamp;
+    }
+
+    /**
+     * Read the cached template and process the header
+     *
+     * @param Smarty_Internal_Template $_template template object
+     * @param Smarty_Template_Cached $cached cached object
+     * @return booelan true or false if the cached content does not exist
+     */
+    public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
+    {
+        if (!$cached) {
+            $cached = $_template->cached;
+        }
+        $content = $cached->content ? $cached->content : null;
+        $timestamp = $cached->timestamp ? $cached->timestamp : null;
+        if ($content === null || !$timestamp) {
+            $this->fetch(
+                $_template->cached->filepath,
+                $_template->source->name,
+                $_template->cache_id,
+                $_template->compile_id,
+                $content,
+                $timestamp
+            );
+        }
+        if (isset($content)) {
+            $_smarty_tpl = $_template;
+            eval("?>" . $content);
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Write the rendered template output to cache
+     *
+     * @param Smarty_Internal_Template $_template template object
+     * @param string                   $content   content to cache
+     * @return boolean success
+     */
+    public function writeCachedContent(Smarty_Internal_Template $_template, $content)
+    {
+        return $this->save(
+            $_template->cached->filepath,
+            $_template->source->name,
+            $_template->cache_id,
+            $_template->compile_id,
+            $_template->properties['cache_lifetime'],
+            $content
+        );
+    }
+
+    /**
+     * Empty cache
+     *
+     * @param Smarty  $smarty   Smarty object
+     * @param integer $exp_time expiration time (number of seconds, not timestamp)
+     * @return integer number of cache files deleted
+     */
+    public function clearAll(Smarty $smarty, $exp_time=null)
+    {
+        $this->cache = array();
+        return $this->delete(null, null, null, $exp_time);
+    }
+
+    /**
+     * Empty cache for a specific template
+     *
+     * @param Smarty  $smarty        Smarty object
+     * @param string  $resource_name template name
+     * @param string  $cache_id      cache id
+     * @param string  $compile_id    compile id
+     * @param integer $exp_time      expiration time (number of seconds, not timestamp)
+     * @return integer number of cache files deleted
+     */
+    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
+    {
+        $this->cache = array();
+        return $this->delete($resource_name, $cache_id, $compile_id, $exp_time);
+    }
+
+    /**
+     * Check is cache is locked for this template
+     *
+     * @param Smarty $smarty Smarty object
+     * @param Smarty_Template_Cached $cached cached object
+     * @return booelan true or false if cache is locked
+     */
+    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        $id = $cached->filepath;
+        $name = $cached->source->name . '.lock';
+
+        $mtime = $this->fetchTimestamp($id, $name, null, null);
+        if ($mtime === null) {
+            $this->fetch($id, $name, null, null, $content, $mtime);
+        }
+
+        return $mtime && time() - $mtime < $smarty->locking_timeout;
+    }
+
+    /**
+     * Lock cache for this template
+     *
+     * @param Smarty $smarty Smarty object
+     * @param Smarty_Template_Cached $cached cached object
+     */
+    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        $cached->is_locked = true;
+
+        $id = $cached->filepath;
+        $name = $cached->source->name . '.lock';
+        $this->save($id, $name, null, null, $smarty->locking_timeout, '');
+    }
+
+    /**
+     * Unlock cache for this template
+     *
+     * @param Smarty $smarty Smarty object
+     * @param Smarty_Template_Cached $cached cached object
+     */
+    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        $cached->is_locked = false;
+
+        $name = $cached->source->name . '.lock';
+        $this->delete($name, null, null, null);
+    }
+}
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php b/library/Smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php
new file mode 100644 (file)
index 0000000..dff9b65
--- /dev/null
@@ -0,0 +1,463 @@
+<?php
+/**
+ * Smarty Internal Plugin
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ */
+
+/**
+ * Smarty Cache Handler Base for Key/Value Storage Implementations
+ *
+ * This class implements the functionality required to use simple key/value stores
+ * for hierarchical cache groups. key/value stores like memcache or APC do not support
+ * wildcards in keys, therefore a cache group cannot be cleared like "a|*" - which
+ * is no problem to filesystem and RDBMS implementations.
+ *
+ * This implementation is based on the concept of invalidation. While one specific cache
+ * can be identified and cleared, any range of caches cannot be identified. For this reason
+ * each level of the cache group hierarchy can have its own value in the store. These values
+ * are nothing but microtimes, telling us when a particular cache group was cleared for the
+ * last time. These keys are evaluated for every cache read to determine if the cache has
+ * been invalidated since it was created and should hence be treated as inexistent.
+ *
+ * Although deep hierarchies are possible, they are not recommended. Try to keep your
+ * cache groups as shallow as possible. Anything up 3-5 parents should be ok. So
+ * »a|b|c« is a good depth where »a|b|c|d|e|f|g|h|i|j|k« isn't. Try to join correlating
+ * cache groups: if your cache groups look somewhat like »a|b|$page|$items|$whatever«
+ * consider using »a|b|c|$page-$items-$whatever« instead.
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ * @author Rodney Rehm
+ */
+abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource {
+
+    /**
+     * cache for contents
+     * @var array
+     */
+    protected $contents = array();
+    /**
+     * cache for timestamps
+     * @var array
+     */
+    protected $timestamps = array();
+
+    /**
+     * populate Cached Object with meta data from Resource
+     *
+     * @param Smarty_Template_Cached   $cached    cached object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     */
+    public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
+    {
+        $cached->filepath = $_template->source->uid
+                . '#' . $this->sanitize($cached->source->name)
+                . '#' . $this->sanitize($cached->cache_id)
+                . '#' . $this->sanitize($cached->compile_id);
+
+        $this->populateTimestamp($cached);
+    }
+
+    /**
+     * populate Cached Object with timestamp and exists from Resource
+     *
+     * @param Smarty_Template_Cached $cached cached object
+     * @return void
+     */
+    public function populateTimestamp(Smarty_Template_Cached $cached)
+    {
+        if (!$this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $content, $timestamp, $cached->source->uid)) {
+            return;
+        }
+        $cached->content = $content;
+        $cached->timestamp = (int) $timestamp;
+        $cached->exists = $cached->timestamp;
+    }
+
+    /**
+     * Read the cached template and process the header
+     *
+     * @param Smarty_Internal_Template $_template template object
+     * @param Smarty_Template_Cached $cached cached object
+     * @return booelan true or false if the cached content does not exist
+     */
+    public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
+    {
+        if (!$cached) {
+            $cached = $_template->cached;
+        }
+        $content = $cached->content ? $cached->content : null;
+        $timestamp = $cached->timestamp ? $cached->timestamp : null;
+        if ($content === null || !$timestamp) {
+            if (!$this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id, $_template->compile_id, $content, $timestamp, $_template->source->uid)) {
+                return false;
+            }
+        }
+        if (isset($content)) {
+            $_smarty_tpl = $_template;
+            eval("?>" . $content);
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Write the rendered template output to cache
+     *
+     * @param Smarty_Internal_Template $_template template object
+     * @param string $content content to cache
+     * @return boolean success
+     */
+    public function writeCachedContent(Smarty_Internal_Template $_template, $content)
+    {
+        $this->addMetaTimestamp($content);
+        return $this->write(array($_template->cached->filepath => $content), $_template->properties['cache_lifetime']);
+    }
+
+    /**
+     * Empty cache
+     *
+     * {@internal the $exp_time argument is ignored altogether }}
+     *
+     * @param Smarty  $smarty   Smarty object
+     * @param integer $exp_time expiration time [being ignored]
+     * @return integer number of cache files deleted [always -1]
+     * @uses purge() to clear the whole store
+     * @uses invalidate() to mark everything outdated if purge() is inapplicable
+     */
+    public function clearAll(Smarty $smarty, $exp_time=null)
+    {
+        if (!$this->purge()) {
+            $this->invalidate(null);
+        }
+        return -1;
+    }
+
+    /**
+     * Empty cache for a specific template
+     *
+     * {@internal the $exp_time argument is ignored altogether}}
+     *
+     * @param Smarty  $smarty        Smarty object
+     * @param string  $resource_name template name
+     * @param string  $cache_id      cache id
+     * @param string  $compile_id    compile id
+     * @param integer $exp_time      expiration time [being ignored]
+     * @return integer number of cache files deleted [always -1]
+     * @uses buildCachedFilepath() to generate the CacheID
+     * @uses invalidate() to mark CacheIDs parent chain as outdated
+     * @uses delete() to remove CacheID from cache
+     */
+    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
+    {
+        $uid = $this->getTemplateUid($smarty, $resource_name, $cache_id, $compile_id);
+        $cid = $uid . '#' . $this->sanitize($resource_name) . '#' . $this->sanitize($cache_id) . '#' . $this->sanitize($compile_id);
+        $this->delete(array($cid));
+        $this->invalidate($cid, $resource_name, $cache_id, $compile_id, $uid);
+        return -1;
+    }
+    /**
+     * Get template's unique ID
+     *
+     * @param Smarty $smarty        Smarty object
+     * @param string $resource_name template name
+     * @param string $cache_id      cache id
+     * @param string $compile_id    compile id
+     * @return string filepath of cache file
+     */
+    protected function getTemplateUid(Smarty $smarty, $resource_name, $cache_id, $compile_id)
+    {
+        $uid = '';
+        if (isset($resource_name)) {
+            $tpl = new $smarty->template_class($resource_name, $smarty);
+            if ($tpl->source->exists) {
+                $uid = $tpl->source->uid;
+            }
+            
+            // remove from template cache
+            if ($smarty->allow_ambiguous_resources) {
+                $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
+            } else {
+                $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
+            }
+            if (isset($_templateId[150])) {
+                $_templateId = sha1($_templateId);
+            }
+            unset($smarty->template_objects[$_templateId]);
+        }
+        return $uid;
+    }
+
+    /**
+     * Sanitize CacheID components
+     *
+     * @param string $string CacheID component to sanitize
+     * @return string sanitized CacheID component
+     */
+    protected function sanitize($string)
+    {
+        // some poeple smoke bad weed
+        $string = trim($string, '|');
+        if (!$string) {
+            return null;
+        }
+        return preg_replace('#[^\w\|]+#S', '_', $string);
+    }
+
+    /**
+     * Fetch and prepare a cache object.
+     *
+     * @param string  $cid           CacheID to fetch
+     * @param string  $resource_name template name
+     * @param string  $cache_id      cache id
+     * @param string  $compile_id    compile id
+     * @param string  $content       cached content
+     * @param integer &$timestamp    cached timestamp (epoch)
+     * @param string  $resource_uid  resource's uid
+     * @return boolean success
+     */
+    protected function fetch($cid, $resource_name = null, $cache_id = null, $compile_id = null, &$content = null, &$timestamp = null, $resource_uid = null)
+    {
+        $t = $this->read(array($cid));
+        $content = !empty($t[$cid]) ? $t[$cid] : null;
+        $timestamp = null;
+
+        if ($content && ($timestamp = $this->getMetaTimestamp($content))) {
+            $invalidated = $this->getLatestInvalidationTimestamp($cid, $resource_name, $cache_id, $compile_id, $resource_uid);
+            if ($invalidated > $timestamp) {
+                $timestamp = null;
+                $content = null;
+            }
+        }
+
+        return !!$content;
+    }
+
+    /**
+     * Add current microtime to the beginning of $cache_content
+     *
+     * {@internal the header uses 8 Bytes, the first 4 Bytes are the seconds, the second 4 Bytes are the microseconds}}
+     *
+     * @param string &$content the content to be cached
+     */
+    protected function addMetaTimestamp(&$content)
+    {
+        $mt = explode(" ", microtime());
+        $ts = pack("NN", $mt[1], (int) ($mt[0] * 100000000));
+        $content = $ts . $content;
+    }
+
+    /**
+     * Extract the timestamp the $content was cached
+     *
+     * @param string &$content the cached content
+     * @return float the microtime the content was cached
+     */
+    protected function getMetaTimestamp(&$content)
+    {
+        $s = unpack("N", substr($content, 0, 4));
+        $m = unpack("N", substr($content, 4, 4));
+        $content = substr($content, 8);
+        return $s[1] + ($m[1] / 100000000);
+    }
+
+    /**
+     * Invalidate CacheID
+     *
+     * @param string $cid           CacheID
+     * @param string $resource_name template name
+     * @param string $cache_id      cache id
+     * @param string $compile_id    compile id
+     * @param string $resource_uid  source's uid
+     * @return void
+     */
+    protected function invalidate($cid = null, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
+    {
+        $now = microtime(true);
+        $key = null;
+        // invalidate everything
+        if (!$resource_name && !$cache_id && !$compile_id) {
+            $key = 'IVK#ALL';
+        }
+        // invalidate all caches by template
+        else if ($resource_name && !$cache_id && !$compile_id) {
+            $key = 'IVK#TEMPLATE#' . $resource_uid . '#' . $this->sanitize($resource_name);
+        }
+        // invalidate all caches by cache group
+        else if (!$resource_name && $cache_id && !$compile_id) {
+            $key = 'IVK#CACHE#' . $this->sanitize($cache_id);
+        }
+        // invalidate all caches by compile id
+        else if (!$resource_name && !$cache_id && $compile_id) {
+            $key = 'IVK#COMPILE#' . $this->sanitize($compile_id);
+        }
+        // invalidate by combination
+        else {
+            $key = 'IVK#CID#' . $cid;
+        }
+        $this->write(array($key => $now));
+    }
+
+    /**
+     * Determine the latest timestamp known to the invalidation chain
+     *
+     * @param string $cid           CacheID to determine latest invalidation timestamp of
+     * @param string $resource_name template name
+     * @param string $cache_id      cache id
+     * @param string $compile_id    compile id
+     * @param string $resource_uid  source's filepath
+     * @return float the microtime the CacheID was invalidated
+     */
+    protected function getLatestInvalidationTimestamp($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
+    {
+        // abort if there is no CacheID
+        if (false && !$cid) {
+            return 0;
+        }
+        // abort if there are no InvalidationKeys to check
+        if (!($_cid = $this->listInvalidationKeys($cid, $resource_name, $cache_id, $compile_id, $resource_uid))) {
+            return 0;
+        }
+        
+        // there are no InValidationKeys
+        if (!($values = $this->read($_cid))) {
+            return 0;
+        }
+        // make sure we're dealing with floats
+        $values = array_map('floatval', $values);
+        return max($values);
+    }
+
+    /**
+     * Translate a CacheID into the list of applicable InvalidationKeys.
+     *
+     * Splits "some|chain|into|an|array" into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... )
+     *
+     * @param string $cid           CacheID to translate
+     * @param string $resource_name template name
+     * @param string $cache_id      cache id
+     * @param string $compile_id    compile id
+     * @param string $resource_uid  source's filepath
+     * @return array list of InvalidationKeys
+     * @uses $invalidationKeyPrefix to prepend to each InvalidationKey
+     */
+    protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
+    {
+        $t = array('IVK#ALL');
+        $_name = $_compile = '#';
+        if ($resource_name) {
+            $_name .= $resource_uid . '#' . $this->sanitize($resource_name);
+            $t[] = 'IVK#TEMPLATE' . $_name;
+        }
+        if ($compile_id) {
+            $_compile .= $this->sanitize($compile_id);
+            $t[] = 'IVK#COMPILE' . $_compile;
+        }
+        $_name .= '#';
+        // some poeple smoke bad weed
+        $cid = trim($cache_id, '|');
+        if (!$cid) {
+            return $t;
+        }
+        $i = 0;
+        while (true) {
+            // determine next delimiter position
+            $i = strpos($cid, '|', $i);
+            // add complete CacheID if there are no more delimiters
+            if ($i === false) {
+                $t[] = 'IVK#CACHE#' . $cid;
+                $t[] = 'IVK#CID' . $_name . $cid . $_compile;
+                $t[] = 'IVK#CID' . $_name . $_compile;
+                break;
+            }
+            $part = substr($cid, 0, $i);
+            // add slice to list
+            $t[] = 'IVK#CACHE#' . $part;
+            $t[] = 'IVK#CID' . $_name . $part . $_compile;
+            // skip past delimiter position
+            $i++;
+        }
+        return $t;
+    }
+
+    /**
+     * Check is cache is locked for this template
+     *
+     * @param Smarty $smarty Smarty object
+     * @param Smarty_Template_Cached $cached cached object
+     * @return booelan true or false if cache is locked
+     */
+    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        $key = 'LOCK#' . $cached->filepath;
+        $data = $this->read(array($key));
+        return $data && time() - $data[$key] < $smarty->locking_timeout;
+    }
+
+    /**
+     * Lock cache for this template
+     *
+     * @param Smarty $smarty Smarty object
+     * @param Smarty_Template_Cached $cached cached object
+     */
+    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        $cached->is_locked = true;
+        $key = 'LOCK#' . $cached->filepath;
+        $this->write(array($key => time()), $smarty->locking_timeout);
+    }
+
+    /**
+     * Unlock cache for this template
+     *
+     * @param Smarty $smarty Smarty object
+     * @param Smarty_Template_Cached $cached cached object
+     */
+    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        $cached->is_locked = false;
+        $key = 'LOCK#' . $cached->filepath;
+        $this->delete(array($key));
+    }
+
+    /**
+     * Read values for a set of keys from cache
+     *
+     * @param array $keys list of keys to fetch
+     * @return array list of values with the given keys used as indexes
+     */
+    protected abstract function read(array $keys);
+
+    /**
+     * Save values for a set of keys to cache
+     *
+     * @param array $keys   list of values to save
+     * @param int   $expire expiration time
+     * @return boolean true on success, false on failure
+     */
+    protected abstract function write(array $keys, $expire=null);
+
+    /**
+     * Remove values from cache
+     *
+     * @param array $keys list of keys to delete
+     * @return boolean true on success, false on failure
+     */
+    protected abstract function delete(array $keys);
+
+    /**
+     * Remove *all* values from cache
+     *
+     * @return boolean true on success, false on failure
+     */
+    protected function purge()
+    {
+        return false;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_config_source.php b/library/Smarty/libs/sysplugins/smarty_config_source.php
new file mode 100644 (file)
index 0000000..043ff13
--- /dev/null
@@ -0,0 +1,95 @@
+<?php
+/**
+ * Smarty Internal Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+
+/**
+ * Smarty Resource Data Object
+ *
+ * Meta Data Container for Config Files
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ *
+ * @property string $content
+ * @property int    $timestamp
+ * @property bool   $exists
+ */
+class Smarty_Config_Source extends Smarty_Template_Source {
+
+    /**
+     * create Config Object container
+     *
+     * @param Smarty_Resource $handler          Resource Handler this source object communicates with
+     * @param Smarty          $smarty           Smarty instance this source object belongs to
+     * @param string          $resource         full config_resource
+     * @param string          $type             type of resource
+     * @param string          $name             resource name
+     * @param string          $unique_resource  unqiue resource name
+     */
+    public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource)
+    {
+        $this->handler = $handler; // Note: prone to circular references
+
+        // Note: these may be ->config_compiler_class etc in the future
+        //$this->config_compiler_class = $handler->config_compiler_class;
+        //$this->config_lexer_class = $handler->config_lexer_class;
+        //$this->config_parser_class = $handler->config_parser_class;
+
+        $this->smarty = $smarty;
+        $this->resource = $resource;
+        $this->type = $type;
+        $this->name = $name;
+        $this->unique_resource = $unique_resource;
+    }
+
+    /**
+     * <<magic>> Generic setter.
+     *
+     * @param string $property_name valid: content, timestamp, exists
+     * @param mixed  $value         newly assigned value (not check for correct type)
+     * @throws SmartyException when the given property name is not valid
+     */
+    public function __set($property_name, $value)
+    {
+        switch ($property_name) {
+            case 'content':
+            case 'timestamp':
+            case 'exists':
+                $this->$property_name = $value;
+                break;
+
+            default:
+                throw new SmartyException("invalid config property '$property_name'.");
+        }
+    }
+
+    /**
+     * <<magic>> Generic getter.
+     *
+     * @param string $property_name valid: content, timestamp, exists
+     * @throws SmartyException when the given property name is not valid
+     */
+    public function __get($property_name)
+    {
+        switch ($property_name) {
+            case 'timestamp':
+            case 'exists':
+                $this->handler->populateTimestamp($this);
+                return $this->$property_name;
+
+            case 'content':
+                return $this->content = $this->handler->getContent($this);
+
+            default:
+                throw new SmartyException("config property '$property_name' does not exist.");
+        }
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_cacheresource_file.php b/library/Smarty/libs/sysplugins/smarty_internal_cacheresource_file.php
new file mode 100644 (file)
index 0000000..e5d20bd
--- /dev/null
@@ -0,0 +1,266 @@
+<?php
+/**
+ * Smarty Internal Plugin CacheResource File
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ */
+
+/**
+ * This class does contain all necessary methods for the HTML cache on file system
+ *
+ * Implements the file system as resource for the HTML cache Version ussing nocache inserts.
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ */
+class Smarty_Internal_CacheResource_File extends Smarty_CacheResource {
+
+    /**
+     * populate Cached Object with meta data from Resource
+     *
+     * @param Smarty_Template_Cached   $cached    cached object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     */
+    public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
+    {
+        $_source_file_path = str_replace(':', '.', $_template->source->filepath);
+        $_cache_id = isset($_template->cache_id) ? preg_replace('![^\w\|]+!', '_', $_template->cache_id) : null;
+        $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
+        $_filepath = $_template->source->uid;
+        // if use_sub_dirs, break file into directories
+        if ($_template->smarty->use_sub_dirs) {
+            $_filepath = substr($_filepath, 0, 2) . DS
+                . substr($_filepath, 2, 2) . DS
+                . substr($_filepath, 4, 2) . DS
+                . $_filepath;
+        }
+        $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
+        if (isset($_cache_id)) {
+            $_cache_id = str_replace('|', $_compile_dir_sep, $_cache_id) . $_compile_dir_sep;
+        } else {
+            $_cache_id = '';
+        }
+        if (isset($_compile_id)) {
+            $_compile_id = $_compile_id . $_compile_dir_sep;
+        } else {
+            $_compile_id = '';
+        }
+        $_cache_dir = $_template->smarty->getCacheDir();
+        if ($_template->smarty->cache_locking) {
+            // create locking file name
+            // relative file name?
+            if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_cache_dir)) {
+                $_lock_dir = rtrim(getcwd(), '/\\') . DS . $_cache_dir;
+            } else {
+                $_lock_dir = $_cache_dir;
+            }
+            $cached->lock_id = $_lock_dir.sha1($_cache_id.$_compile_id.$_template->source->uid).'.lock';
+        }
+        $cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
+        $cached->timestamp = @filemtime($cached->filepath);
+        $cached->exists = !!$cached->timestamp;
+    }
+
+    /**
+     * populate Cached Object with timestamp and exists from Resource
+     *
+     * @param Smarty_Template_Cached $cached cached object
+     * @return void
+     */
+    public function populateTimestamp(Smarty_Template_Cached $cached)
+    {
+        $cached->timestamp = @filemtime($cached->filepath);
+        $cached->exists = !!$cached->timestamp;
+    }
+
+    /**
+     * Read the cached template and process its header
+     *
+     * @param Smarty_Internal_Template $_template template object
+     * @param Smarty_Template_Cached $cached cached object
+     * @return booelan true or false if the cached content does not exist
+     */
+    public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
+    {
+        $_smarty_tpl = $_template;
+        return @include $_template->cached->filepath;
+    }
+
+    /**
+     * Write the rendered template output to cache
+     *
+     * @param Smarty_Internal_Template $_template template object
+     * @param string                   $content   content to cache
+     * @return boolean success
+     */
+    public function writeCachedContent(Smarty_Internal_Template $_template, $content)
+    {
+        if (Smarty_Internal_Write_File::writeFile($_template->cached->filepath, $content, $_template->smarty) === true) {
+            $_template->cached->timestamp = @filemtime($_template->cached->filepath);
+            $_template->cached->exists = !!$_template->cached->timestamp;
+            if ($_template->cached->exists) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Empty cache
+     *
+     * @param Smarty_Internal_Template $_template template object
+     * @param integer                  $exp_time  expiration time (number of seconds, not timestamp)
+     * @return integer number of cache files deleted
+     */
+    public function clearAll(Smarty $smarty, $exp_time = null)
+    {
+        return $this->clear($smarty, null, null, null, $exp_time);
+    }
+
+    /**
+     * Empty cache for a specific template
+     *
+     * @param Smarty  $_template     template object
+     * @param string  $resource_name template name
+     * @param string  $cache_id      cache id
+     * @param string  $compile_id    compile id
+     * @param integer $exp_time      expiration time (number of seconds, not timestamp)
+     * @return integer number of cache files deleted
+    */
+    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
+    {
+        $_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null;
+        $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
+        $_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
+        $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
+        $_dir = $smarty->getCacheDir();
+        $_dir_length = strlen($_dir);
+        if (isset($_cache_id)) {
+            $_cache_id_parts = explode('|', $_cache_id);
+            $_cache_id_parts_count = count($_cache_id_parts);
+            if ($smarty->use_sub_dirs) {
+                foreach ($_cache_id_parts as $id_part) {
+                    $_dir .= $id_part . DS;
+                }
+            }
+        }
+        if (isset($resource_name)) {
+            $_save_stat = $smarty->caching;
+            $smarty->caching = true;
+            $tpl = new $smarty->template_class($resource_name, $smarty);
+            $smarty->caching = $_save_stat;
+
+            // remove from template cache
+            $tpl->source; // have the template registered before unset()
+            if ($smarty->allow_ambiguous_resources) {
+                $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
+            } else {
+                $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
+            }
+            if (isset($_templateId[150])) {
+                $_templateId = sha1($_templateId);
+            }
+            unset($smarty->template_objects[$_templateId]);
+
+            if ($tpl->source->exists) {
+                $_resourcename_parts = basename(str_replace('^', '/', $tpl->cached->filepath));
+            } else {
+                return 0;
+            }
+        }
+        $_count = 0;
+        $_time = time();
+        if (file_exists($_dir)) {
+            $_cacheDirs = new RecursiveDirectoryIterator($_dir);
+            $_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
+            foreach ($_cache as $_file) {
+                if (substr($_file->getBasename(),0,1) == '.' || strpos($_file, '.svn') !== false) continue;
+                // directory ?
+                if ($_file->isDir()) {
+                    if (!$_cache->isDot()) {
+                        // delete folder if empty
+                        @rmdir($_file->getPathname());
+                    }
+                } else {
+                    $_parts = explode($_dir_sep, str_replace('\\', '/', substr((string)$_file, $_dir_length)));
+                    $_parts_count = count($_parts);
+                    // check name
+                    if (isset($resource_name)) {
+                        if ($_parts[$_parts_count-1] != $_resourcename_parts) {
+                            continue;
+                        }
+                    }
+                    // check compile id
+                    if (isset($_compile_id) && (!isset($_parts[$_parts_count-2 - $_compile_id_offset]) || $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id)) {
+                        continue;
+                    }
+                    // check cache id
+                    if (isset($_cache_id)) {
+                        // count of cache id parts
+                        $_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset : $_parts_count - 1 - $_compile_id_offset;
+                        if ($_parts_count < $_cache_id_parts_count) {
+                            continue;
+                        }
+                        for ($i = 0; $i < $_cache_id_parts_count; $i++) {
+                            if ($_parts[$i] != $_cache_id_parts[$i]) continue 2;
+                        }
+                    }
+                    // expired ?
+                    if (isset($exp_time) && $_time - @filemtime($_file) < $exp_time) {
+                        continue;
+                    }
+                    $_count += @unlink((string) $_file) ? 1 : 0;
+                }
+            }
+        }
+        return $_count;
+    }
+
+    /**
+     * Check is cache is locked for this template
+     *
+     * @param Smarty $smarty Smarty object
+     * @param Smarty_Template_Cached $cached cached object
+     * @return booelan true or false if cache is locked
+     */
+    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
+            clearstatcache(true, $cached->lock_id);
+        } else {
+            clearstatcache();
+        }
+        $t = @filemtime($cached->lock_id);
+        return $t && (time() - $t < $smarty->locking_timeout);
+    }
+
+    /**
+     * Lock cache for this template
+     *
+     * @param Smarty $smarty Smarty object
+     * @param Smarty_Template_Cached $cached cached object
+     */
+    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        $cached->is_locked = true;
+        touch($cached->lock_id);
+    }
+
+    /**
+     * Unlock cache for this template
+     *
+     * @param Smarty $smarty Smarty object
+     * @param Smarty_Template_Cached $cached cached object
+     */
+    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
+    {
+        $cached->is_locked = false;
+        @unlink($cached->lock_id);
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_append.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_append.php
new file mode 100644 (file)
index 0000000..f6036e8
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Append
+ *
+ * Compiles the {append} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Append Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign {
+
+    /**
+     * Compiles code for the {append} tag
+     *
+     * @param array $args array with attributes from parser
+     * @param object $compiler compiler object
+     * @param array $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        // the following must be assigned at runtime because it will be overwritten in parent class
+        $this->required_attributes = array('var', 'value');
+        $this->shorttag_order = array('var', 'value');
+        $this->optional_attributes = array('scope', 'index');
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        // map to compile assign attributes
+        if (isset($_attr['index'])) {
+            $_params['smarty_internal_index'] = '[' . $_attr['index'] . ']';
+            unset($_attr['index']);
+        } else {
+            $_params['smarty_internal_index'] = '[]';
+        }
+        $_new_attr = array();
+        foreach ($_attr as $key => $value) {
+            $_new_attr[] = array($key => $value);
+        }
+        // call compile assign
+        return parent::compile($_new_attr, $compiler, $_params);
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php
new file mode 100644 (file)
index 0000000..0ac3f68
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Assign
+ *
+ * Compiles the {assign} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Assign Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {assign} tag
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        // the following must be assigned at runtime because it will be overwritten in Smarty_Internal_Compile_Append
+        $this->required_attributes = array('var', 'value');
+        $this->shorttag_order = array('var', 'value');
+        $this->optional_attributes = array('scope');
+        $_nocache = 'null';
+        $_scope = Smarty::SCOPE_LOCAL;
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        // nocache ?
+        if ($compiler->tag_nocache || $compiler->nocache) {
+            $_nocache = 'true';
+            // create nocache var to make it know for further compiling
+            $compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_variable(null, true);
+        }
+        // scope setup
+        if (isset($_attr['scope'])) {
+            $_attr['scope'] = trim($_attr['scope'], "'\"");
+            if ($_attr['scope'] == 'parent') {
+                $_scope = Smarty::SCOPE_PARENT;
+            } elseif ($_attr['scope'] == 'root') {
+                $_scope = Smarty::SCOPE_ROOT;
+            } elseif ($_attr['scope'] == 'global') {
+                $_scope = Smarty::SCOPE_GLOBAL;
+            } else {
+                $compiler->trigger_template_error('illegal value for "scope" attribute', $compiler->lex->taglineno);
+            }
+        }
+        // compiled output
+        if (isset($parameter['smarty_internal_index'])) {
+            $output = "<?php \$_smarty_tpl->createLocalArrayVariable($_attr[var], $_nocache, $_scope);\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value$parameter[smarty_internal_index] = $_attr[value];";
+        } else {
+            // implement Smarty2's behaviour of variables assigned by reference
+            if ($compiler->template->smarty instanceof SmartyBC) {
+                $output = "<?php if (isset(\$_smarty_tpl->tpl_vars[$_attr[var]])) {\$_smarty_tpl->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];";
+                $output .= "\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value = $_attr[value]; \$_smarty_tpl->tpl_vars[$_attr[var]]->nocache = $_nocache; \$_smarty_tpl->tpl_vars[$_attr[var]]->scope = $_scope;";
+                $output .= "\n} else \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_variable($_attr[value], $_nocache, $_scope);";
+            } else {
+                $output = "<?php \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_variable($_attr[value], $_nocache, $_scope);";
+            }
+        }
+        if ($_scope == Smarty::SCOPE_PARENT) {
+            $output .= "\nif (\$_smarty_tpl->parent != null) \$_smarty_tpl->parent->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];";
+        } elseif ($_scope == Smarty::SCOPE_ROOT || $_scope == Smarty::SCOPE_GLOBAL) {
+            $output .= "\n\$_ptr = \$_smarty_tpl->parent; while (\$_ptr != null) {\$_ptr->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]]; \$_ptr = \$_ptr->parent; }";
+        }
+        if ( $_scope == Smarty::SCOPE_GLOBAL) {
+            $output .= "\nSmarty::\$global_tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];";
+        }
+        $output .= '?>';
+        return $output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_block.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_block.php
new file mode 100644 (file)
index 0000000..03abf49
--- /dev/null
@@ -0,0 +1,277 @@
+<?php
+
+/**
+ * Smarty Internal Plugin Compile Block
+ *
+ * Compiles the {block}{/block} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Block Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array('name');
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('name', 'hide');
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('hide');
+
+    /**
+     * Compiles code for the {block} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return boolean true
+     */
+    public function compile($args, $compiler) {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        $save = array($_attr, $compiler->parser->current_buffer, $compiler->nocache, $compiler->smarty->merge_compiled_includes, $compiler->merged_templates, $compiler->smarty->merged_templates_func, $compiler->template->properties, $compiler->template->has_nocache_code);
+        $this->openTag($compiler, 'block', $save);
+        if ($_attr['nocache'] == true) {
+            $compiler->nocache = true;
+        }
+        // set flag for {block} tag
+        $compiler->inheritance = true;
+        // must merge includes
+        $compiler->smarty->merge_compiled_includes = true;
+
+        $compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser);
+        $compiler->has_code = false;
+        return true;
+    }
+
+    /**
+     * Save or replace child block source by block name during parsing
+     *
+     * @param string $block_content     block source content
+     * @param string $block_tag         opening block tag
+     * @param object $template          template object
+     * @param string $filepath          filepath of template source
+     */
+    public static function saveBlockData($block_content, $block_tag, $template, $filepath) {
+        $_rdl = preg_quote($template->smarty->right_delimiter);
+        $_ldl = preg_quote($template->smarty->left_delimiter);
+        if ($template->smarty->auto_literal) {
+            $al = '\s*';
+        } else {
+            $al = '';
+        }
+        if (0 == preg_match("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")(\s*?)?((append|prepend|nocache)?(\s*)?(hide)?)?(\s*{$_rdl})!", $block_tag, $_match)) {
+            $error_text = 'Syntax Error in template "' . $template->source->filepath . '"   "' . htmlspecialchars($block_tag) . '" illegal options';
+            throw new SmartyCompilerException($error_text);
+        } else {
+            $_name = trim($_match[3], '\'"');
+            if ($_match[8] != 'hide' || isset($template->block_data[$_name])) {        // replace {$smarty.block.child}
+                // do we have {$smart.block.child} in nested {block} tags?
+                if (0 != preg_match_all("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")([\s\S]*?)(hide)?(\s*{$_rdl})([\s\S]*?)({$_ldl}{$al}\\\$smarty\.block\.child{$_rdl})([\s\S]*?{$_ldl}{$al}/block{$_rdl})!", $block_content, $_match2)) {
+                    foreach ($_match2[3] as $key => $name) {
+                        // get it's replacement
+                        $_name2 = trim($name, '\'"');
+                        if ($_match2[5][$key] != 'hide' || isset($template->block_data[$_name2])) {
+                            if (isset($template->block_data[$_name2])) {
+                                $replacement = $template->block_data[$_name2]['source'];
+                            } else {
+                                $replacement = '';
+                            }
+                            // replace {$smarty.block.child} tag
+                            $search = array("%({$_ldl}{$al}block[\s\S]*?{$name}[\s\S]*?{$_rdl})([\s\S]*?)({$_ldl}{$al}\\\$smarty\.block\.child{$_rdl})([\s\S]*?)({$_ldl}{$al}/block{$_rdl})%", "/§§§child§§§/");
+                            $replace = array('\2§§§child§§§\4', $replacement);
+                            $block_content = preg_replace($search, $replace, $block_content);
+                        } else {
+                            // remove hidden blocks
+                            $block_content = preg_replace("%({$_ldl}{$al}block[\s\S]*?{$name}[\s\S]*?{$_rdl}[\s\S]*?{$_ldl}{$al}/block{$_rdl})%", '', $block_content);
+                        }
+                    }
+                }
+                // do we have not nested {$smart.block.child}
+                if (0 != preg_match("/({$_ldl}{$al}\\\$smarty\.block\.child{$_rdl})/", $block_content, $_match2)) {
+                    // get child replacement for this block
+                    if (isset($template->block_data[$_name])) {
+                        $replacement = $template->block_data[$_name]['source'];
+                        unset($template->block_data[$_name]);
+                    } else {
+                        $replacement = '';
+                    }
+                    $block_content = preg_replace("/({$_ldl}{$al}\\\$smarty\.block\.child{$_rdl})/", $replacement, $block_content);
+                }
+                if (isset($template->block_data[$_name])) {
+                    if (strpos($template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
+                        $template->block_data[$_name]['source'] =
+                                str_replace('%%%%SMARTY_PARENT%%%%', $block_content, $template->block_data[$_name]['source']);
+                    } elseif ($template->block_data[$_name]['mode'] == 'prepend') {
+                        $template->block_data[$_name]['source'] .= $block_content;
+                    } elseif ($template->block_data[$_name]['mode'] == 'append') {
+                        $template->block_data[$_name]['source'] = $block_content . $template->block_data[$_name]['source'];
+                    }
+                } else {
+                    $template->block_data[$_name]['source'] = $block_content;
+                    $template->block_data[$_name]['file'] = $filepath;
+                }
+                if ($_match[6] == 'append') {
+                    $template->block_data[$_name]['mode'] = 'append';
+                } elseif ($_match[6] == 'prepend') {
+                    $template->block_data[$_name]['mode'] = 'prepend';
+                } else {
+                    $template->block_data[$_name]['mode'] = 'replace';
+                }
+            }
+        }
+    }
+
+    /**
+     * Compile saved child block source
+     *
+     * @param object $compiler  compiler object
+     * @param string $_name     optional name of child block
+     * @return string   compiled code of schild block
+     */
+    public static function compileChildBlock($compiler, $_name = null) {
+        $_output = '';
+        // if called by {$smarty.block.child} we must search the name of enclosing {block}
+        if ($_name == null) {
+            $stack_count = count($compiler->_tag_stack);
+            while (--$stack_count >= 0) {
+                if ($compiler->_tag_stack[$stack_count][0] == 'block') {
+                    $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'], "'\"");
+                    break;
+                }
+            }
+            // flag that child is already compile by {$smarty.block.child} inclusion
+            $compiler->template->block_data[$_name]['compiled'] = true;
+        }
+        if ($_name == null) {
+            $compiler->trigger_template_error('{$smarty.block.child} used out of context', $compiler->lex->taglineno);
+        }
+        // undefined child?
+        if (!isset($compiler->template->block_data[$_name]['source'])) {
+            return '';
+        }
+        $_tpl = new Smarty_Internal_template('string:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id,
+                        $compiler->template->compile_id = null, $compiler->template->caching, $compiler->template->cache_lifetime);
+        $_tpl->variable_filters = $compiler->template->variable_filters;
+        $_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
+        $_tpl->source->filepath = $compiler->template->block_data[$_name]['file'];
+        $_tpl->allow_relative_path = true;
+        if ($compiler->nocache) {
+            $_tpl->compiler->forceNocache = 2;
+        } else {
+            $_tpl->compiler->forceNocache = 1;
+        }
+        $_tpl->compiler->suppressHeader = true;
+        $_tpl->compiler->suppressTemplatePropertyHeader = true;
+        $_tpl->compiler->suppressMergedTemplates = true;
+        if (strpos($compiler->template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
+            $_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->parser->current_buffer->to_smarty_php(), $_tpl->compiler->compileTemplate($_tpl));
+        } elseif ($compiler->template->block_data[$_name]['mode'] == 'prepend') {
+            $_output = $_tpl->compiler->compileTemplate($_tpl) . $compiler->parser->current_buffer->to_smarty_php();
+        } elseif ($compiler->template->block_data[$_name]['mode'] == 'append') {
+            $_output = $compiler->parser->current_buffer->to_smarty_php() . $_tpl->compiler->compileTemplate($_tpl);
+        } elseif (!empty($compiler->template->block_data[$_name])) {
+            $_output = $_tpl->compiler->compileTemplate($_tpl);
+        }
+        $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']);
+        $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']);
+        $compiler->merged_templates = array_merge($compiler->merged_templates, $_tpl->compiler->merged_templates);
+        $compiler->template->variable_filters = $_tpl->variable_filters;
+        if ($_tpl->has_nocache_code) {
+            $compiler->template->has_nocache_code = true;
+        }
+        foreach ($_tpl->required_plugins as $key => $tmp1) {
+            if ($compiler->nocache && $compiler->template->caching) {
+                $code = 'nocache';
+            } else {
+                $code = $key;
+            }
+            foreach ($tmp1 as $name => $tmp) {
+                foreach ($tmp as $type => $data) {
+                    $compiler->template->required_plugins[$code][$name][$type] = $data;
+                }
+            }
+        }
+        unset($_tpl);
+        return $_output;
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile BlockClose Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {/block} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler) {
+        $compiler->has_code = true;
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        $saved_data = $this->closeTag($compiler, array('block'));
+        $_name = trim($saved_data[0]['name'], "\"'");
+        if (isset($compiler->template->block_data[$_name]) && !isset($compiler->template->block_data[$_name]['compiled'])) {
+            // restore to status before {block} tag as new subtemplate code of parent {block} is not needed
+            // TODO: Below code was disabled in 3.1.8 because of problems with {include} in nested {block} tags in child templates
+            //       combined with append/prepend or $smarty.block.parent
+            //       For later versions it should be checked under which conditions it could run for optimisation
+            //
+            //$compiler->merged_templates = $saved_data[4];
+            //$compiler->smarty->merged_templates_func = $saved_data[5];
+            //$compiler->template->properties = $saved_data[6];
+            //$compiler->template->has_nocache_code = $saved_data[7];
+            $_output = Smarty_Internal_Compile_Block::compileChildBlock($compiler, $_name);
+        } else {
+            if (isset($saved_data[0]['hide']) && !isset($compiler->template->block_data[$_name]['source'])) {
+                $_output = '';
+            } else {
+                $_output = $compiler->parser->current_buffer->to_smarty_php();
+            }
+            unset($compiler->template->block_data[$_name]['compiled']);
+        }
+        // reset flags
+        $compiler->parser->current_buffer = $saved_data[1];
+        $compiler->nocache = $saved_data[2];
+        $compiler->smarty->merge_compiled_includes = $saved_data[3];
+        // reset flag for {block} tag
+        $compiler->inheritance = false;
+        // $_output content has already nocache code processed
+        $compiler->suppressNocacheProcessing = true;
+        return $_output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_break.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_break.php
new file mode 100644 (file)
index 0000000..259c66e
--- /dev/null
@@ -0,0 +1,77 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Compile Break\r
+ *\r
+ * Compiles the {break} tag\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews\r
+ */\r
+/**\r
+ * Smarty Internal Plugin Compile Break Class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ */\r
+class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase {\r
+\r
+    /**\r
+     * Attribute definition: Overwrites base class.\r
+     *\r
+     * @var array\r
+     * @see Smarty_Internal_CompileBase\r
+     */\r
+    public $optional_attributes = array('levels');\r
+    /**\r
+     * Attribute definition: Overwrites base class.\r
+     *\r
+     * @var array\r
+     * @see Smarty_Internal_CompileBase\r
+     */\r
+    public $shorttag_order = array('levels');\r
+\r
+    /**\r
+     * Compiles code for the {break} tag\r
+     *\r
+     * @param array  $args array with attributes from parser\r
+     * @param object $compiler   compiler object\r
+     * @param array  $parameter  array with compilation parameter\r
+     * @return string compiled code\r
+     */\r
+    public function compile($args, $compiler, $parameter)\r
+    {\r
+        static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true);\r
+        // check and get attributes\r
+        $_attr = $this->getAttributes($compiler, $args);\r
+\r
+        if ($_attr['nocache'] === true) {\r
+            $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);\r
+        }\r
+\r
+        if (isset($_attr['levels'])) {\r
+            if (!is_numeric($_attr['levels'])) {\r
+                $compiler->trigger_template_error('level attribute must be a numeric constant', $compiler->lex->taglineno);\r
+            }\r
+            $_levels = $_attr['levels'];\r
+        } else {\r
+            $_levels = 1;\r
+        }\r
+        $level_count = $_levels;\r
+        $stack_count = count($compiler->_tag_stack) - 1;\r
+        while ($level_count > 0 && $stack_count >= 0) {\r
+            if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) {\r
+                $level_count--;\r
+            }\r
+            $stack_count--;\r
+        }\r
+        if ($level_count != 0) {\r
+            $compiler->trigger_template_error("cannot break {$_levels} level(s)", $compiler->lex->taglineno);\r
+        }\r
+        $compiler->has_code = true;\r
+        return "<?php break {$_levels}?>";\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_call.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_call.php
new file mode 100644 (file)
index 0000000..af12a04
--- /dev/null
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Function_Call
+ *
+ * Compiles the calls of user defined tags defined by {function}
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Function_Call Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array('name');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('name');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('_any');
+
+    /**
+     * Compiles the calls of user defined tags defined by {function}
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        // save possible attributes
+        if (isset($_attr['assign'])) {
+            // output will be stored in a smarty variable instead of beind displayed
+            $_assign = $_attr['assign'];
+        }
+        $_name = $_attr['name'];
+        if ($compiler->compiles_template_function) {
+            $compiler->called_functions[] = trim($_name, "'\"");
+        }
+        unset($_attr['name'], $_attr['assign'], $_attr['nocache']);
+        // set flag (compiled code of {function} must be included in cache file
+        if ($compiler->nocache || $compiler->tag_nocache) {
+            $_nocache = 'true';
+        } else {
+            $_nocache = 'false';
+        }
+        $_paramsArray = array();
+        foreach ($_attr as $_key => $_value) {
+            if (is_int($_key)) {
+                $_paramsArray[] = "$_key=>$_value";
+            } else {
+                $_paramsArray[] = "'$_key'=>$_value";
+            }
+        }
+        if (isset($compiler->template->properties['function'][$_name]['parameter'])) {
+            foreach ($compiler->template->properties['function'][$_name]['parameter'] as $_key => $_value) {
+                if (!isset($_attr[$_key])) {
+                    if (is_int($_key)) {
+                        $_paramsArray[] = "$_key=>$_value";
+                    } else {
+                        $_paramsArray[] = "'$_key'=>$_value";
+                    }
+                }
+            }
+        } elseif (isset($compiler->smarty->template_functions[$_name]['parameter'])) {
+            foreach ($compiler->smarty->template_functions[$_name]['parameter'] as $_key => $_value) {
+                if (!isset($_attr[$_key])) {
+                    if (is_int($_key)) {
+                        $_paramsArray[] = "$_key=>$_value";
+                    } else {
+                        $_paramsArray[] = "'$_key'=>$_value";
+                    }
+                }
+            }
+        }
+        //varibale name?
+        if (!(strpos($_name, '$') === false)) {
+            $call_cache = $_name;
+            $call_function = '$tmp = "smarty_template_function_".' . $_name . '; $tmp';
+        } else {
+            $_name = trim($_name, "'\"");
+            $call_cache = "'{$_name}'";
+            $call_function = 'smarty_template_function_' . $_name;
+        }
+
+        $_params = 'array(' . implode(",", $_paramsArray) . ')';
+        $_hash = str_replace('-', '_', $compiler->template->properties['nocache_hash']);
+        // was there an assign attribute
+        if (isset($_assign)) {
+            if ($compiler->template->caching) {
+                $_output = "<?php ob_start(); Smarty_Internal_Function_Call_Handler::call ({$call_cache},\$_smarty_tpl,{$_params},'{$_hash}',{$_nocache}); \$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
+            } else {
+                $_output = "<?php ob_start(); {$call_function}(\$_smarty_tpl,{$_params}); \$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
+            }
+        } else {
+            if ($compiler->template->caching) {
+                $_output = "<?php Smarty_Internal_Function_Call_Handler::call ({$call_cache},\$_smarty_tpl,{$_params},'{$_hash}',{$_nocache});?>\n";
+            } else {
+                $_output = "<?php {$call_function}(\$_smarty_tpl,{$_params});?>\n";
+            }
+        }
+        return $_output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_capture.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_capture.php
new file mode 100644 (file)
index 0000000..9a5071e
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Capture
+ *
+ * Compiles the {capture} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Capture Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('name');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('name', 'assign', 'append');
+
+    /**
+     * Compiles code for the {capture} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        $buffer = isset($_attr['name']) ? $_attr['name'] : "'default'";
+        $assign = isset($_attr['assign']) ? $_attr['assign'] : 'null';
+        $append = isset($_attr['append']) ? $_attr['append'] : 'null';
+
+        $compiler->_capture_stack[0][] = array($buffer, $assign, $append, $compiler->nocache);
+        // maybe nocache because of nocache variables
+        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+        $_output = "<?php \$_smarty_tpl->_capture_stack[0][] = array($buffer, $assign, $append); ob_start(); ?>";
+
+        return $_output;
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Captureclose Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {/capture} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        // must endblock be nocache?
+        if ($compiler->nocache) {
+            $compiler->tag_nocache = true;
+        }
+
+        list($buffer, $assign, $append, $compiler->nocache) = array_pop($compiler->_capture_stack[0]);
+
+        $_output = "<?php list(\$_capture_buffer, \$_capture_assign, \$_capture_append) = array_pop(\$_smarty_tpl->_capture_stack[0]);\n";
+        $_output .= "if (!empty(\$_capture_buffer)) {\n";
+        $_output .= " if (isset(\$_capture_assign)) \$_smarty_tpl->assign(\$_capture_assign, ob_get_contents());\n";
+        $_output .= " if (isset( \$_capture_append)) \$_smarty_tpl->append( \$_capture_append, ob_get_contents());\n";
+        $_output .= " Smarty::\$_smarty_vars['capture'][\$_capture_buffer]=ob_get_clean();\n";
+        $_output .= "} else \$_smarty_tpl->capture_error();?>";
+        return $_output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_config_load.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_config_load.php
new file mode 100644 (file)
index 0000000..deaa052
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Config Load
+ *
+ * Compiles the {config load} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Config Load Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array('file');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('file','section');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('section', 'scope');
+
+    /**
+     * Compiles code for the {config_load} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        static $_is_legal_scope = array('local' => true,'parent' => true,'root' => true,'global' => true);
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        if ($_attr['nocache'] === true) {
+            $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
+        }
+
+
+        // save posible attributes
+        $conf_file = $_attr['file'];
+        if (isset($_attr['section'])) {
+            $section = $_attr['section'];
+        } else {
+            $section = 'null';
+        }
+        $scope = 'local';
+        // scope setup
+        if (isset($_attr['scope'])) {
+            $_attr['scope'] = trim($_attr['scope'], "'\"");
+            if (isset($_is_legal_scope[$_attr['scope']])) {
+                $scope = $_attr['scope'];
+           } else {
+                $compiler->trigger_template_error('illegal value for "scope" attribute', $compiler->lex->taglineno);
+           }
+        }
+        // create config object
+        $_output = "<?php  \$_config = new Smarty_Internal_Config($conf_file, \$_smarty_tpl->smarty, \$_smarty_tpl);";
+        $_output .= "\$_config->loadConfigVars($section, '$scope'); ?>";
+        return $_output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_continue.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_continue.php
new file mode 100644 (file)
index 0000000..4082a93
--- /dev/null
@@ -0,0 +1,78 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Compile Continue\r
+ *\r
+ * Compiles the {continue} tag\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Continue Class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ */\r
+class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase {\r
+\r
+    /**\r
+     * Attribute definition: Overwrites base class.\r
+     *\r
+     * @var array\r
+     * @see Smarty_Internal_CompileBase\r
+     */\r
+    public $optional_attributes = array('levels');\r
+    /**\r
+     * Attribute definition: Overwrites base class.\r
+     *\r
+     * @var array\r
+     * @see Smarty_Internal_CompileBase\r
+     */\r
+    public $shorttag_order = array('levels');\r
+\r
+    /**\r
+     * Compiles code for the {continue} tag\r
+     *\r
+     * @param array  $args      array with attributes from parser\r
+     * @param object $compiler  compiler object\r
+     * @param array  $parameter array with compilation parameter\r
+     * @return string compiled code\r
+     */\r
+    public function compile($args, $compiler, $parameter)\r
+    {\r
+        static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true);\r
+        // check and get attributes\r
+        $_attr = $this->getAttributes($compiler, $args);\r
+\r
+        if ($_attr['nocache'] === true) {\r
+            $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);\r
+        }\r
+\r
+        if (isset($_attr['levels'])) {\r
+            if (!is_numeric($_attr['levels'])) {\r
+                $compiler->trigger_template_error('level attribute must be a numeric constant', $compiler->lex->taglineno);\r
+            }\r
+            $_levels = $_attr['levels'];\r
+        } else {\r
+            $_levels = 1;\r
+        }\r
+        $level_count = $_levels;\r
+        $stack_count = count($compiler->_tag_stack) - 1;\r
+        while ($level_count > 0 && $stack_count >= 0) {\r
+            if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) {\r
+                $level_count--;\r
+            }\r
+            $stack_count--;\r
+        }\r
+        if ($level_count != 0) {\r
+            $compiler->trigger_template_error("cannot continue {$_levels} level(s)", $compiler->lex->taglineno);\r
+        }\r
+        $compiler->has_code = true;\r
+        return "<?php continue {$_levels}?>";\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_debug.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_debug.php
new file mode 100644 (file)
index 0000000..f50c7ae
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Debug
+ *
+ * Compiles the {debug} tag.
+ * It opens a window the the Smarty Debugging Console.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Debug Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {debug} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        // compile always as nocache
+        $compiler->tag_nocache = true;
+
+        // display debug template
+        $_output = "<?php \$_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>";
+        return $_output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_eval.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_eval.php
new file mode 100644 (file)
index 0000000..6cf481b
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Eval
+ *
+ * Compiles the {eval} tag.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Eval Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array('var');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('assign');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('var','assign');
+
+    /**
+     * Compiles code for the {eval} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        $this->required_attributes = array('var');
+        $this->optional_attributes = array('assign');
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        if (isset($_attr['assign'])) {
+              // output will be stored in a smarty variable instead of beind displayed
+            $_assign = $_attr['assign'];
+        }
+
+        // create template object
+        $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";
+        //was there an assign attribute?
+        if (isset($_assign)) {
+            $_output .= "\$_smarty_tpl->assign($_assign,\$_template->fetch());";
+        } else {
+            $_output .= "echo \$_template->fetch();";
+        }
+        return "<?php $_output ?>";
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_extends.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_extends.php
new file mode 100644 (file)
index 0000000..9042aa2
--- /dev/null
@@ -0,0 +1,128 @@
+<?php
+
+/**
+* Smarty Internal Plugin Compile extend
+*
+* Compiles the {extends} tag
+*
+* @package Smarty
+* @subpackage Compiler
+* @author Uwe Tews
+*/
+
+/**
+* Smarty Internal Plugin Compile extend Class
+*
+* @package Smarty
+* @subpackage Compiler
+*/
+class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
+
+    /**
+    * Attribute definition: Overwrites base class.
+    *
+    * @var array
+    * @see Smarty_Internal_CompileBase
+    */
+    public $required_attributes = array('file');
+    /**
+    * Attribute definition: Overwrites base class.
+    *
+    * @var array
+    * @see Smarty_Internal_CompileBase
+    */
+    public $shorttag_order = array('file');
+    /**
+    * mbstring.overload flag
+    *
+    * @var int
+    */
+    public $mbstring_overload = 0;
+
+    /**
+    * Compiles code for the {extends} tag
+    *
+    * @param array  $args     array with attributes from parser
+    * @param object $compiler compiler object
+    * @return string compiled code
+    */
+    public function compile($args, $compiler)
+    {
+        static $_is_stringy = array('string' => true, 'eval' => true);
+        $this->_rdl = preg_quote($compiler->smarty->right_delimiter);
+        $this->_ldl = preg_quote($compiler->smarty->left_delimiter);
+        $filepath = $compiler->template->source->filepath;
+        $this->mbstring_overload = ini_get('mbstring.func_overload') & 2;
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        if ($_attr['nocache'] === true) {
+            $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
+        }
+
+        $_smarty_tpl = $compiler->template;
+        $include_file = null;
+        if (strpos($_attr['file'], '$_tmp') !== false) {
+            $compiler->trigger_template_error('illegal value for file attribute', $compiler->lex->taglineno);
+        }
+        eval('$include_file = ' . $_attr['file'] . ';');
+        // create template object
+        $_template = new $compiler->smarty->template_class($include_file, $compiler->smarty, $compiler->template);
+        // save file dependency
+        if (isset($_is_stringy[$_template->source->type])) {
+            $template_sha1 = sha1($include_file);
+        } else {
+            $template_sha1 = sha1($_template->source->filepath);
+        }
+        if (isset($compiler->template->properties['file_dependency'][$template_sha1])) {
+            $compiler->trigger_template_error("illegal recursive call of \"{$include_file}\"", $compiler->lex->line - 1);
+        }
+        $compiler->template->properties['file_dependency'][$template_sha1] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type);
+        $_content = ($this->mbstring_overload ? mb_substr($compiler->template->source->content, $compiler->lex->counter - 1, 20000000, 'latin1') : substr($compiler->template->source->content, $compiler->lex->counter - 1));
+        if (preg_match_all("!({$this->_ldl}block\s(.+?){$this->_rdl})!", $_content, $s) !=
+        preg_match_all("!({$this->_ldl}/block{$this->_rdl})!", $_content, $c)) {
+            $compiler->trigger_template_error('unmatched {block} {/block} pairs');
+        }
+        preg_match_all("!{$this->_ldl}block\s(.+?){$this->_rdl}|{$this->_ldl}/block{$this->_rdl}|{$this->_ldl}\*([\S\s]*?)\*{$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE);
+        $_result_count = count($_result[0]);
+        $_start = 0;
+        while ($_start+1 < $_result_count) {
+            $_end = 0;
+            $_level = 1;
+            if (($this->mbstring_overload ? mb_substr($_result[0][$_start][0],0,mb_strlen($compiler->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start][0],0,strlen($compiler->smarty->left_delimiter)+1)) == $compiler->smarty->left_delimiter.'*') {
+                $_start++;
+                continue;
+            }
+            while ($_level != 0) {
+                $_end++;
+                if (($this->mbstring_overload ? mb_substr($_result[0][$_start + $_end][0],0,mb_strlen($compiler->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start + $_end][0],0,strlen($compiler->smarty->left_delimiter)+1)) == $compiler->smarty->left_delimiter.'*') {
+                    continue;
+                }
+                if (!strpos($_result[0][$_start + $_end][0], '/')) {
+                    $_level++;
+                } else {
+                    $_level--;
+                }
+            }
+            $_block_content = str_replace($compiler->smarty->left_delimiter . '$smarty.block.parent' . $compiler->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%',
+            ($this->mbstring_overload ? mb_substr($_content, $_result[0][$_start][1] + mb_strlen($_result[0][$_start][0], 'latin1'), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + mb_strlen($_result[0][$_start][0], 'latin1'), 'latin1') : substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0]))));
+            Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $compiler->template, $filepath);
+            $_start = $_start + $_end + 1;
+        }
+        if ($_template->source->type == 'extends') {
+            $_template->block_data = $compiler->template->block_data;
+        }
+        $compiler->template->source->content = $_template->source->content;
+        if ($_template->source->type == 'extends') {
+            $compiler->template->block_data = $_template->block_data;
+            foreach ($_template->source->components as $key => $component) {
+                $compiler->template->properties['file_dependency'][$key] = array($component->filepath, $component->timestamp, $component->type);
+            }
+        }
+        $compiler->template->source->filepath = $_template->source->filepath;
+        $compiler->abort_and_recompile = true;
+        return '';
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_for.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_for.php
new file mode 100644 (file)
index 0000000..057f4fb
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile For
+ *
+ * Compiles the {for} {forelse} {/for} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile For Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {for} tag
+     *
+     * Smarty 3 does implement two different sytaxes:
+     *
+     * - {for $var in $array}
+     * For looping over arrays or iterators
+     *
+     * - {for $x=0; $x<$y; $x++}
+     * For general loops
+     *
+     * The parser is gereration different sets of attribute by which this compiler can
+     * determin which syntax is used.
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        if ($parameter == 0) {
+            $this->required_attributes = array('start', 'to');
+            $this->optional_attributes = array('max', 'step');
+        } else {
+            $this->required_attributes = array('start', 'ifexp', 'var', 'step');
+            $this->optional_attributes = array();
+        }
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        $output = "<?php ";
+        if ($parameter == 1) {
+            foreach ($_attr['start'] as $_statement) {
+                $output .= " \$_smarty_tpl->tpl_vars[$_statement[var]] = new Smarty_Variable;";
+                $output .= " \$_smarty_tpl->tpl_vars[$_statement[var]]->value = $_statement[value];\n";
+            }
+            $output .= "  if ($_attr[ifexp]){ for (\$_foo=true;$_attr[ifexp]; \$_smarty_tpl->tpl_vars[$_attr[var]]->value$_attr[step]){\n";
+        } else {
+            $_statement = $_attr['start'];
+            $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]] = new Smarty_Variable;";
+            if (isset($_attr['step'])) {
+                $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->step = $_attr[step];";
+            } else {
+                $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->step = 1;";
+            }
+            if (isset($_attr['max'])) {
+                $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int)min(ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step)),$_attr[max]);\n";
+            } else {
+                $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int)ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step));\n";
+            }
+            $output .= "if (\$_smarty_tpl->tpl_vars[$_statement[var]]->total > 0){\n";
+            $output .= "for (\$_smarty_tpl->tpl_vars[$_statement[var]]->value = $_statement[value], \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration = 1;\$_smarty_tpl->tpl_vars[$_statement[var]]->iteration <= \$_smarty_tpl->tpl_vars[$_statement[var]]->total;\$_smarty_tpl->tpl_vars[$_statement[var]]->value += \$_smarty_tpl->tpl_vars[$_statement[var]]->step, \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration++){\n";
+            $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->first = \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration == 1;";
+            $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->last = \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration == \$_smarty_tpl->tpl_vars[$_statement[var]]->total;";
+        }
+        $output .= "?>";
+
+        $this->openTag($compiler, 'for', array('for', $compiler->nocache));
+        // maybe nocache because of nocache variables
+        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+        // return compiled code
+        return $output;
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Forelse Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {forelse} tag
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr  = $this->getAttributes($compiler, $args);
+
+        list($openTag, $nocache) = $this->closeTag($compiler, array('for'));
+        $this->openTag($compiler, 'forelse', array('forelse', $nocache));
+        return "<?php }} else { ?>";
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Forclose Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {/for} tag
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        // must endblock be nocache?
+        if ($compiler->nocache) {
+            $compiler->tag_nocache = true;
+        }
+
+        list($openTag, $compiler->nocache) = $this->closeTag($compiler, array('for', 'forelse'));
+
+        if ($openTag == 'forelse') {
+            return "<?php }  ?>";
+        } else {
+            return "<?php }} ?>";
+        }
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_foreach.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_foreach.php
new file mode 100644 (file)
index 0000000..1354c89
--- /dev/null
@@ -0,0 +1,231 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Foreach
+ *
+ * Compiles the {foreach} {foreachelse} {/foreach} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Foreach Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase {
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array('from', 'item');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('name', 'key');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('from','item','key','name');
+
+    /**
+     * Compiles code for the {foreach} tag
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        $tpl = $compiler->template;
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        $from = $_attr['from'];
+        $item = $_attr['item'];
+        if (!strncmp("\$_smarty_tpl->tpl_vars[$item]", $from, strlen($item) + 24)) {
+            $compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $compiler->lex->taglineno);
+        }
+
+        if (isset($_attr['key'])) {
+            $key = $_attr['key'];
+        } else {
+            $key = null;
+        }
+
+        $this->openTag($compiler, 'foreach', array('foreach', $compiler->nocache, $item, $key));
+        // maybe nocache because of nocache variables
+        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+
+        if (isset($_attr['name'])) {
+            $name = $_attr['name'];
+            $has_name = true;
+            $SmartyVarName = '$smarty.foreach.' . trim($name, '\'"') . '.';
+        } else {
+            $name = null;
+            $has_name = false;
+        }
+        $ItemVarName = '$' . trim($item, '\'"') . '@';
+        // evaluates which Smarty variables and properties have to be computed
+        if ($has_name) {
+            $usesSmartyFirst = strpos($tpl->source->content, $SmartyVarName . 'first') !== false;
+            $usesSmartyLast = strpos($tpl->source->content, $SmartyVarName . 'last') !== false;
+            $usesSmartyIndex = strpos($tpl->source->content, $SmartyVarName . 'index') !== false;
+            $usesSmartyIteration = strpos($tpl->source->content, $SmartyVarName . 'iteration') !== false;
+            $usesSmartyShow = strpos($tpl->source->content, $SmartyVarName . 'show') !== false;
+            $usesSmartyTotal = strpos($tpl->source->content, $SmartyVarName . 'total') !== false;
+        } else {
+            $usesSmartyFirst = false;
+            $usesSmartyLast = false;
+            $usesSmartyTotal = false;
+            $usesSmartyShow = false;
+        }
+
+        $usesPropFirst = $usesSmartyFirst || strpos($tpl->source->content, $ItemVarName . 'first') !== false;
+        $usesPropLast = $usesSmartyLast || strpos($tpl->source->content, $ItemVarName . 'last') !== false;
+        $usesPropIndex = $usesPropFirst || strpos($tpl->source->content, $ItemVarName . 'index') !== false;
+        $usesPropIteration = $usesPropLast || strpos($tpl->source->content, $ItemVarName . 'iteration') !== false;
+        $usesPropShow = strpos($tpl->source->content, $ItemVarName . 'show') !== false;
+        $usesPropTotal = $usesSmartyTotal || $usesSmartyShow || $usesPropShow || $usesPropLast || strpos($tpl->source->content, $ItemVarName . 'total') !== false;
+        // generate output code
+        $output = "<?php ";
+        $output .= " \$_smarty_tpl->tpl_vars[$item] = new Smarty_Variable; \$_smarty_tpl->tpl_vars[$item]->_loop = false;\n";
+        if ($key != null) {
+            $output .= " \$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable;\n";
+        }
+        $output .= " \$_from = $from; if (!is_array(\$_from) && !is_object(\$_from)) { settype(\$_from, 'array');}\n";
+        if ($usesPropTotal) {
+            $output .= " \$_smarty_tpl->tpl_vars[$item]->total= \$_smarty_tpl->_count(\$_from);\n";
+        }
+        if ($usesPropIteration) {
+            $output .= " \$_smarty_tpl->tpl_vars[$item]->iteration=0;\n";
+        }
+        if ($usesPropIndex) {
+            $output .= " \$_smarty_tpl->tpl_vars[$item]->index=-1;\n";
+        }
+        if ($usesPropShow) {
+            $output .= " \$_smarty_tpl->tpl_vars[$item]->show = (\$_smarty_tpl->tpl_vars[$item]->total > 0);\n";
+        }
+        if ($has_name) {
+            if ($usesSmartyTotal) {
+                $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['total'] = \$_smarty_tpl->tpl_vars[$item]->total;\n";
+            }
+            if ($usesSmartyIteration) {
+                $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['iteration']=0;\n";
+            }
+            if ($usesSmartyIndex) {
+                $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['index']=-1;\n";
+            }
+            if ($usesSmartyShow) {
+                $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['show']=(\$_smarty_tpl->tpl_vars[$item]->total > 0);\n";
+            }
+        }
+        $output .= "foreach (\$_from as \$_smarty_tpl->tpl_vars[$item]->key => \$_smarty_tpl->tpl_vars[$item]->value){\n\$_smarty_tpl->tpl_vars[$item]->_loop = true;\n";
+        if ($key != null) {
+            $output .= " \$_smarty_tpl->tpl_vars[$key]->value = \$_smarty_tpl->tpl_vars[$item]->key;\n";
+        }
+        if ($usesPropIteration) {
+            $output .= " \$_smarty_tpl->tpl_vars[$item]->iteration++;\n";
+        }
+        if ($usesPropIndex) {
+            $output .= " \$_smarty_tpl->tpl_vars[$item]->index++;\n";
+        }
+        if ($usesPropFirst) {
+            $output .= " \$_smarty_tpl->tpl_vars[$item]->first = \$_smarty_tpl->tpl_vars[$item]->index === 0;\n";
+        }
+        if ($usesPropLast) {
+            $output .= " \$_smarty_tpl->tpl_vars[$item]->last = \$_smarty_tpl->tpl_vars[$item]->iteration === \$_smarty_tpl->tpl_vars[$item]->total;\n";
+        }
+        if ($has_name) {
+            if ($usesSmartyFirst) {
+                $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['first'] = \$_smarty_tpl->tpl_vars[$item]->first;\n";
+            }
+            if ($usesSmartyIteration) {
+                $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['iteration']++;\n";
+            }
+            if ($usesSmartyIndex) {
+                $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['index']++;\n";
+            }
+            if ($usesSmartyLast) {
+                $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['last'] = \$_smarty_tpl->tpl_vars[$item]->last;\n";
+            }
+        }
+        $output .= "?>";
+
+        return $output;
+    }
+}
+
+/**
+ * Smarty Internal Plugin Compile Foreachelse Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {foreachelse} tag
+     *
+     * @param array  $args array with attributes from parser
+     * @param object $compiler compiler object
+     * @param array  $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        list($openTag, $nocache, $item, $key) = $this->closeTag($compiler, array('foreach'));
+        $this->openTag($compiler, 'foreachelse', array('foreachelse', $nocache, $item, $key));
+
+        return "<?php }\nif (!\$_smarty_tpl->tpl_vars[$item]->_loop) {\n?>";
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Foreachclose Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {/foreach} tag
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        // must endblock be nocache?
+        if ($compiler->nocache) {
+            $compiler->tag_nocache = true;
+        }
+
+        list($openTag, $compiler->nocache, $item, $key) = $this->closeTag($compiler, array('foreach', 'foreachelse'));
+
+        return "<?php } ?>";
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_function.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_function.php
new file mode 100644 (file)
index 0000000..876b13d
--- /dev/null
@@ -0,0 +1,165 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Function
+ *
+ * Compiles the {function} {/function} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Function Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array('name');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('name');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('_any');
+
+    /**
+     * Compiles code for the {function} tag
+     *
+     * @param array $args array with attributes from parser
+     * @param object $compiler compiler object
+     * @param array $parameter array with compilation parameter
+     * @return boolean true
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        if ($_attr['nocache'] === true) {
+            $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
+        }
+        unset($_attr['nocache']);
+        $save = array($_attr, $compiler->parser->current_buffer,
+            $compiler->template->has_nocache_code, $compiler->template->required_plugins);
+        $this->openTag($compiler, 'function', $save);
+        $_name = trim($_attr['name'], "'\"");
+        unset($_attr['name']);
+        // set flag that we are compiling a template function
+        $compiler->compiles_template_function = true;
+        $compiler->template->properties['function'][$_name]['parameter'] = array();
+        $_smarty_tpl = $compiler->template;
+        foreach ($_attr as $_key => $_data) {
+            eval ('$tmp='.$_data.';');
+            $compiler->template->properties['function'][$_name]['parameter'][$_key] = $tmp;
+        }
+        $compiler->smarty->template_functions[$_name]['parameter'] = $compiler->template->properties['function'][$_name]['parameter'];
+        if ($compiler->template->caching) {
+            $output = '';
+        } else {
+            $output = "<?php if (!function_exists('smarty_template_function_{$_name}')) {
+    function smarty_template_function_{$_name}(\$_smarty_tpl,\$params) {
+    \$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
+    foreach (\$_smarty_tpl->smarty->template_functions['{$_name}']['parameter'] as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);};
+    foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
+        }
+        // Init temporay context
+        $compiler->template->required_plugins = array('compiled' => array(), 'nocache' => array());
+        $compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser);
+        $compiler->parser->current_buffer->append_subtree(new _smarty_tag($compiler->parser, $output));
+        $compiler->template->has_nocache_code = false;
+        $compiler->has_code = false;
+        $compiler->template->properties['function'][$_name]['compiled'] = '';
+        return true;
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Functionclose Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {/function} tag
+     *
+     * @param array $args array with attributes from parser
+     * @param object $compiler compiler object
+     * @param array $parameter array with compilation parameter
+     * @return boolean true
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        $_attr = $this->getAttributes($compiler, $args);
+        $saved_data = $this->closeTag($compiler, array('function'));
+        $_name = trim($saved_data[0]['name'], "'\"");
+        // build plugin include code
+        $plugins_string = '';
+        if (!empty($compiler->template->required_plugins['compiled'])) {
+            $plugins_string = '<?php ';
+            foreach($compiler->template->required_plugins['compiled'] as $tmp) {
+                foreach($tmp as $data) {
+                    $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$data['file']}';\n";
+                }
+            }
+            $plugins_string .= '?>';
+        }
+        if (!empty($compiler->template->required_plugins['nocache'])) {
+            $plugins_string .= "<?php echo '/*%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/<?php ";
+            foreach($compiler->template->required_plugins['nocache'] as $tmp) {
+                foreach($tmp as $data) {
+                    $plugins_string .= "if (!is_callable(\'{$data['function']}\')) include \'{$data['file']}\';\n";
+                }
+            }
+            $plugins_string .= "?>/*/%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/';?>\n";
+        }
+         // remove last line break from function definition
+         $last = count($compiler->parser->current_buffer->subtrees) - 1;
+         if ($compiler->parser->current_buffer->subtrees[$last] instanceof _smarty_linebreak) {
+             unset($compiler->parser->current_buffer->subtrees[$last]);
+         }
+        // if caching save template function for possible nocache call
+        if ($compiler->template->caching) {
+            $compiler->template->properties['function'][$_name]['compiled'] .= $plugins_string
+             . $compiler->parser->current_buffer->to_smarty_php();
+            $compiler->template->properties['function'][$_name]['nocache_hash'] = $compiler->template->properties['nocache_hash'];
+            $compiler->template->properties['function'][$_name]['has_nocache_code'] = $compiler->template->has_nocache_code;
+            $compiler->template->properties['function'][$_name]['called_functions'] = $compiler->called_functions;
+            $compiler->called_functions = array();
+            $compiler->smarty->template_functions[$_name] = $compiler->template->properties['function'][$_name];
+            $compiler->has_code = false;
+            $output = true;
+        } else {
+            $output = $plugins_string . $compiler->parser->current_buffer->to_smarty_php() . "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;}}?>\n";
+        }
+        // reset flag that we are compiling a template function
+        $compiler->compiles_template_function = false;
+        // restore old compiler status
+        $compiler->parser->current_buffer = $saved_data[1];
+        $compiler->template->has_nocache_code = $compiler->template->has_nocache_code | $saved_data[2];
+        $compiler->template->required_plugins = $saved_data[3];
+        return $output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_if.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_if.php
new file mode 100644 (file)
index 0000000..8794b01
--- /dev/null
@@ -0,0 +1,207 @@
+<?php
+/**
+* Smarty Internal Plugin Compile If
+*
+* Compiles the {if} {else} {elseif} {/if} tags
+*
+* @package Smarty
+* @subpackage Compiler
+* @author Uwe Tews
+*/
+
+/**
+* Smarty Internal Plugin Compile If Class
+*
+* @package Smarty
+* @subpackage Compiler
+*/
+class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase {
+
+    /**
+    * Compiles code for the {if} tag
+    *
+    * @param array  $args       array with attributes from parser
+    * @param object $compiler   compiler object
+    * @param array  $parameter  array with compilation parameter
+    * @return string compiled code
+    */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        $this->openTag($compiler, 'if', array(1, $compiler->nocache));
+        // must whole block be nocache ?
+        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+
+        if (!array_key_exists("if condition",$parameter)) {
+            $compiler->trigger_template_error("missing if condition", $compiler->lex->taglineno);
+        }
+
+        if (is_array($parameter['if condition'])) {
+            if ($compiler->nocache) {
+                $_nocache = ',true';
+                // create nocache var to make it know for further compiling
+                if (is_array($parameter['if condition']['var'])) {
+                    $compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
+                } else {
+                    $compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
+                }
+            } else {
+                $_nocache = '';
+            }
+            if (is_array($parameter['if condition']['var'])) {
+                $_output = "<?php if (!isset(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]) || !is_array(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value)) \$_smarty_tpl->createLocalArrayVariable(".$parameter['if condition']['var']['var']."$_nocache);\n";
+                $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value".$parameter['if condition']['var']['smarty_internal_index']." = ".$parameter['if condition']['value']."){?>";
+            } else {
+                $_output = "<?php if (!isset(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."])) \$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."] = new Smarty_Variable(null{$_nocache});";
+                $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."]->value = ".$parameter['if condition']['value']."){?>";
+            }
+            return $_output;
+        } else {
+            return "<?php if ({$parameter['if condition']}){?>";
+        }
+    }
+
+}
+
+/**
+* Smarty Internal Plugin Compile Else Class
+*
+* @package Smarty
+* @subpackage Compiler
+*/
+class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase {
+
+    /**
+    * Compiles code for the {else} tag
+    *
+    * @param array  $args       array with attributes from parser
+    * @param object $compiler   compiler object
+    * @param array  $parameter  array with compilation parameter
+    * @return string compiled code
+    */
+    public function compile($args, $compiler, $parameter)
+    {
+        list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));
+        $this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache));
+
+        return "<?php }else{ ?>";
+    }
+
+}
+
+/**
+* Smarty Internal Plugin Compile ElseIf Class
+*
+* @package Smarty
+* @subpackage Compiler
+*/
+class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase {
+
+    /**
+    * Compiles code for the {elseif} tag
+    *
+    * @param array  $args       array with attributes from parser
+    * @param object $compiler   compiler object
+    * @param array  $parameter  array with compilation parameter
+    * @return string compiled code
+    */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));
+
+        if (!array_key_exists("if condition",$parameter)) {
+            $compiler->trigger_template_error("missing elseif condition", $compiler->lex->taglineno);
+        }
+
+        if (is_array($parameter['if condition'])) {
+            $condition_by_assign = true;
+            if ($compiler->nocache) {
+                $_nocache = ',true';
+                // create nocache var to make it know for further compiling
+                if (is_array($parameter['if condition']['var'])) {
+                    $compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
+                } else {
+                    $compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
+                }
+            } else {
+                $_nocache = '';
+            }
+        } else {
+            $condition_by_assign = false;
+        }
+
+        if (empty($compiler->prefix_code)) {
+            if ($condition_by_assign) {
+                $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache));
+                if (is_array($parameter['if condition']['var'])) {
+                    $_output = "<?php }else{ if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n";
+                    $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . "){?>";
+                } else {
+                    $_output = "<?php  }else{ if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});";
+                    $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . "){?>";
+                }
+                return $_output;
+            } else {
+                $this->openTag($compiler, 'elseif', array($nesting, $compiler->tag_nocache));
+                return "<?php }elseif({$parameter['if condition']}){?>";
+            }
+        } else {
+            $tmp = '';
+            foreach ($compiler->prefix_code as $code)
+            $tmp .= $code;
+            $compiler->prefix_code = array();
+            $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache));
+            if ($condition_by_assign) {
+                if (is_array($parameter['if condition']['var'])) {
+                    $_output = "<?php }else{?>{$tmp}<?php  if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n";
+                    $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . "){?>";
+                } else {
+                    $_output = "<?php }else{?>{$tmp}<?php if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});";
+                    $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . "){?>";
+                }
+                return $_output;
+            } else {
+                return "<?php }else{?>{$tmp}<?php if ({$parameter['if condition']}){?>";
+            }
+        }
+    }
+
+}
+
+/**
+* Smarty Internal Plugin Compile Ifclose Class
+*
+* @package Smarty
+* @subpackage Compiler
+*/
+class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase {
+
+    /**
+    * Compiles code for the {/if} tag
+    *
+    * @param array  $args       array with attributes from parser
+    * @param object $compiler   compiler object
+    * @param array  $parameter  array with compilation parameter
+    * @return string compiled code
+    */
+    public function compile($args, $compiler, $parameter)
+    {
+        // must endblock be nocache?
+        if ($compiler->nocache) {
+            $compiler->tag_nocache = true;
+        }
+        list($nesting, $compiler->nocache) = $this->closeTag($compiler, array('if', 'else', 'elseif'));
+        $tmp = '';
+        for ($i = 0; $i < $nesting; $i++) {
+            $tmp .= '}';
+        }
+        return "<?php {$tmp}?>";
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_include.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_include.php
new file mode 100644 (file)
index 0000000..43a144f
--- /dev/null
@@ -0,0 +1,215 @@
+<?php
+/**
+* Smarty Internal Plugin Compile Include
+*
+* Compiles the {include} tag
+*
+* @package Smarty
+* @subpackage Compiler
+* @author Uwe Tews
+*/
+
+/**
+* Smarty Internal Plugin Compile Include Class
+*
+* @package Smarty
+* @subpackage Compiler
+*/
+class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
+
+    /**
+    * caching mode to create nocache code but no cache file
+    */
+    const CACHING_NOCACHE_CODE = 9999;
+    /**
+    * Attribute definition: Overwrites base class.
+    *
+    * @var array
+    * @see Smarty_Internal_CompileBase
+    */
+    public $required_attributes = array('file');
+    /**
+    * Attribute definition: Overwrites base class.
+    *
+    * @var array
+    * @see Smarty_Internal_CompileBase
+    */
+    public $shorttag_order = array('file');
+    /**
+    * Attribute definition: Overwrites base class.
+    *
+    * @var array
+    * @see Smarty_Internal_CompileBase
+    */
+    public $option_flags = array('nocache', 'inline', 'caching');
+    /**
+    * Attribute definition: Overwrites base class.
+    *
+    * @var array
+    * @see Smarty_Internal_CompileBase
+    */
+    public $optional_attributes = array('_any');
+
+    /**
+    * Compiles code for the {include} tag
+    *
+     * @param array $args array with attributes from parser
+     * @param object $compiler compiler object
+     * @param array $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        // save posible attributes
+        $include_file = $_attr['file'];
+
+        if (isset($_attr['assign'])) {
+            // output will be stored in a smarty variable instead of beind displayed
+            $_assign = $_attr['assign'];
+        }
+
+        $_parent_scope = Smarty::SCOPE_LOCAL;
+        if (isset($_attr['scope'])) {
+            $_attr['scope'] = trim($_attr['scope'], "'\"");
+            if ($_attr['scope'] == 'parent') {
+                $_parent_scope = Smarty::SCOPE_PARENT;
+            } elseif ($_attr['scope'] == 'root') {
+                $_parent_scope = Smarty::SCOPE_ROOT;
+            } elseif ($_attr['scope'] == 'global') {
+                $_parent_scope = Smarty::SCOPE_GLOBAL;
+            }
+        }
+        $_caching = 'null';
+        if ($compiler->nocache || $compiler->tag_nocache) {
+            $_caching = Smarty::CACHING_OFF;
+        }
+        // default for included templates
+        if ($compiler->template->caching && !$compiler->nocache && !$compiler->tag_nocache) {
+            $_caching = self::CACHING_NOCACHE_CODE;
+        }
+        /*
+        * if the {include} tag provides individual parameter for caching
+        * it will not be included into the common cache file and treated like
+        * a nocache section
+        */
+        if (isset($_attr['cache_lifetime'])) {
+            $_cache_lifetime = $_attr['cache_lifetime'];
+            $compiler->tag_nocache = true;
+            $_caching = Smarty::CACHING_LIFETIME_CURRENT;
+        } else {
+            $_cache_lifetime = 'null';
+        }
+        if (isset($_attr['cache_id'])) {
+            $_cache_id = $_attr['cache_id'];
+            $compiler->tag_nocache = true;
+            $_caching = Smarty::CACHING_LIFETIME_CURRENT;
+        } else {
+            $_cache_id = '$_smarty_tpl->cache_id';
+        }
+        if (isset($_attr['compile_id'])) {
+            $_compile_id = $_attr['compile_id'];
+        } else {
+            $_compile_id = '$_smarty_tpl->compile_id';
+        }
+        if ($_attr['caching'] === true) {
+            $_caching = Smarty::CACHING_LIFETIME_CURRENT;
+        }
+        if ($_attr['nocache'] === true) {
+            $compiler->tag_nocache = true;
+            $_caching = Smarty::CACHING_OFF;
+        }
+
+        $has_compiled_template = false;
+        if (($compiler->smarty->merge_compiled_includes || $_attr['inline'] === true) && !$compiler->template->source->recompiled
+            && !($compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache)) && $_caching != Smarty::CACHING_LIFETIME_CURRENT) {
+            // check if compiled code can be merged (contains no variable part)
+            if (!$compiler->has_variable_string && (substr_count($include_file, '"') == 2 or substr_count($include_file, "'") == 2)
+               and substr_count($include_file, '(') == 0 and substr_count($include_file, '$_smarty_tpl->') == 0) {
+                $tpl_name = null;
+                eval("\$tpl_name = $include_file;");
+                if (!isset($compiler->smarty->merged_templates_func[$tpl_name]) || $compiler->inheritance) {
+                    $tpl = new $compiler->smarty->template_class ($tpl_name, $compiler->smarty, $compiler->template, $compiler->template->cache_id, $compiler->template->compile_id);
+                    // save unique function name
+                    $compiler->smarty->merged_templates_func[$tpl_name]['func'] = $tpl->properties['unifunc'] = 'content_'. str_replace('.', '_', uniqid('', true));
+                    // use current nocache hash for inlined code
+                    $compiler->smarty->merged_templates_func[$tpl_name]['nocache_hash'] = $tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
+                    if ($compiler->template->caching) {
+                        // needs code for cached page but no cache file
+                        $tpl->caching = self::CACHING_NOCACHE_CODE;
+                    }
+                    // make sure whole chain gest compiled
+                    $tpl->mustCompile = true;
+                    if (!($tpl->source->uncompiled) && $tpl->source->exists) {
+                        // get compiled code
+                        $compiled_code = $tpl->compiler->compileTemplate($tpl);
+                        // release compiler object to free memory
+                        unset($tpl->compiler);
+                        // merge compiled code for {function} tags
+                        $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $tpl->properties['function']);
+                        // merge filedependency
+                        $tpl->properties['file_dependency'][$tpl->source->uid] = array($tpl->source->filepath, $tpl->source->timestamp,$tpl->source->type);
+                        $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $tpl->properties['file_dependency']);
+                        // remove header code
+                        $compiled_code = preg_replace("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", '', $compiled_code);
+                        if ($tpl->has_nocache_code) {
+                            // replace nocache_hash
+                            $compiled_code = str_replace("{$tpl->properties['nocache_hash']}", $compiler->template->properties['nocache_hash'], $compiled_code);
+                            $compiler->template->has_nocache_code = true;
+                        }
+                        $compiler->merged_templates[$tpl->properties['unifunc']] = $compiled_code;
+                        $has_compiled_template = true;
+                    }
+                } else {
+                    $has_compiled_template = true;
+                }
+            }
+        }
+        // delete {include} standard attributes
+        unset($_attr['file'], $_attr['assign'], $_attr['cache_id'], $_attr['compile_id'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']);
+        // remaining attributes must be assigned as smarty variable
+        if (!empty($_attr)) {
+            if ($_parent_scope == Smarty::SCOPE_LOCAL) {
+                // create variables
+                foreach ($_attr as $key => $value) {
+                    $_pairs[] = "'$key'=>$value";
+                }
+                $_vars = 'array('.join(',',$_pairs).')';
+                $_has_vars = true;
+            } else {
+                $compiler->trigger_template_error('variable passing not allowed in parent/global scope', $compiler->lex->taglineno);
+            }
+        } else {
+            $_vars = 'array()';
+            $_has_vars = false;
+        }
+        if ($has_compiled_template) {
+            $_hash = $compiler->smarty->merged_templates_func[$tpl_name]['nocache_hash'];
+            $_output = "<?php /*  Call merged included template \"" . $tpl_name . "\" */\n";
+            $_output .= "\$_tpl_stack[] = \$_smarty_tpl;\n";
+            $_output .= " \$_smarty_tpl = \$_smarty_tpl->setupInlineSubTemplate($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope, '$_hash');\n";
+            if (isset($_assign)) {
+                $_output .= 'ob_start(); ';
+            }
+            $_output .= $compiler->smarty->merged_templates_func[$tpl_name]['func']. "(\$_smarty_tpl);\n";
+            $_output .= "\$_smarty_tpl = array_pop(\$_tpl_stack); ";
+            if (isset($_assign)) {
+                $_output .= " \$_smarty_tpl->tpl_vars[$_assign] = new Smarty_variable(ob_get_clean());";
+            }
+            $_output .= "/*  End of included template \"" . $tpl_name . "\" */?>";
+            return $_output;
+        }
+
+        // was there an assign attribute
+        if (isset($_assign)) {
+            $_output = "<?php \$_smarty_tpl->tpl_vars[$_assign] = new Smarty_variable(\$_smarty_tpl->getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope));?>\n";;
+        } else {
+            $_output = "<?php echo \$_smarty_tpl->getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope);?>\n";
+        }
+        return $_output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php
new file mode 100644 (file)
index 0000000..d527123
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Include PHP
+ *
+ * Compiles the {include_php} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Insert Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array('file');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('file');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('once', 'assign');
+
+    /**
+     * Compiles code for the {include_php} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        if (!($compiler->smarty instanceof SmartyBC)) {
+            throw new SmartyException("{include_php} is deprecated, use SmartyBC class to enable");
+        }
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        $_output = '<?php ';
+
+        $_smarty_tpl = $compiler->template;
+        $_filepath = false;
+        eval('$_file = ' . $_attr['file'] . ';');
+        if (!isset($compiler->smarty->security_policy) && file_exists($_file)) {
+            $_filepath = $_file;
+        } else {
+            if (isset($compiler->smarty->security_policy)) {
+                $_dir = $compiler->smarty->security_policy->trusted_dir;
+            } else {
+                $_dir = $compiler->smarty->trusted_dir;
+            }
+            if (!empty($_dir)) {
+                foreach((array)$_dir as $_script_dir) {
+                    $_script_dir = rtrim($_script_dir, '/\\') . DS;
+                    if (file_exists($_script_dir . $_file)) {
+                        $_filepath = $_script_dir .  $_file;
+                        break;
+                    }
+                }
+            }
+        }
+        if ($_filepath == false) {
+            $compiler->trigger_template_error("{include_php} file '{$_file}' is not readable", $compiler->lex->taglineno);
+        }
+
+        if (isset($compiler->smarty->security_policy)) {
+            $compiler->smarty->security_policy->isTrustedPHPDir($_filepath);
+        }
+
+        if (isset($_attr['assign'])) {
+            // output will be stored in a smarty variable instead of being displayed
+            $_assign = $_attr['assign'];
+        }
+        $_once = '_once';
+        if (isset($_attr['once'])) {
+            if ($_attr['once'] == 'false') {
+                $_once = '';
+            }
+        }
+
+        if (isset($_assign)) {
+            return "<?php ob_start(); include{$_once} ('{$_filepath}'); \$_smarty_tpl->assign({$_assign},ob_get_contents()); ob_end_clean();?>";
+        } else {
+            return "<?php include{$_once} ('{$_filepath}');?>\n";
+        }
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_insert.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_insert.php
new file mode 100644 (file)
index 0000000..e4d3f93
--- /dev/null
@@ -0,0 +1,142 @@
+<?php
+
+/**
+ * Smarty Internal Plugin Compile Insert
+ *
+ * Compiles the {insert} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Insert Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array('name');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('name');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('_any');
+
+    /**
+     * Compiles code for the {insert} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        // never compile as nocache code
+        $compiler->suppressNocacheProcessing = true;
+        $compiler->tag_nocache = true;
+        $_smarty_tpl = $compiler->template;
+        $_name = null;
+        $_script = null;
+
+        $_output = '<?php ';
+        // save posible attributes
+        eval('$_name = ' . $_attr['name'] . ';');
+        if (isset($_attr['assign'])) {
+            // output will be stored in a smarty variable instead of being displayed
+            $_assign = $_attr['assign'];
+            // create variable to make shure that the compiler knows about its nocache status
+            $compiler->template->tpl_vars[trim($_attr['assign'], "'")] = new Smarty_Variable(null, true);
+        }
+        if (isset($_attr['script'])) {
+            // script which must be included
+            $_function = "smarty_insert_{$_name}";
+            $_smarty_tpl = $compiler->template;
+            $_filepath = false;
+            eval('$_script = ' . $_attr['script'] . ';');
+            if (!isset($compiler->smarty->security_policy) && file_exists($_script)) {
+                $_filepath = $_script;
+            } else {
+                if (isset($compiler->smarty->security_policy)) {
+                    $_dir = $compiler->smarty->security_policy->trusted_dir;
+                } else {
+                    $_dir = $compiler->smarty->trusted_dir;
+                }
+                if (!empty($_dir)) {
+                    foreach((array)$_dir as $_script_dir) {
+                        $_script_dir = rtrim($_script_dir, '/\\') . DS;
+                        if (file_exists($_script_dir . $_script)) {
+                            $_filepath = $_script_dir . $_script;
+                            break;
+                        }
+                    }
+                }
+            }
+            if ($_filepath == false) {
+                $compiler->trigger_template_error("{insert} missing script file '{$_script}'", $compiler->lex->taglineno);
+            }
+            // code for script file loading
+            $_output .= "require_once '{$_filepath}' ;";
+            require_once $_filepath;
+            if (!is_callable($_function)) {
+                $compiler->trigger_template_error(" {insert} function '{$_function}' is not callable in script file '{$_script}'", $compiler->lex->taglineno);
+            }
+        } else {
+            $_filepath = 'null';
+            $_function = "insert_{$_name}";
+            // function in PHP script ?
+            if (!is_callable($_function)) {
+                // try plugin
+                if (!$_function = $compiler->getPlugin($_name, 'insert')) {
+                    $compiler->trigger_template_error("{insert} no function or plugin found for '{$_name}'", $compiler->lex->taglineno);
+                }
+            }
+        }
+        // delete {insert} standard attributes
+        unset($_attr['name'], $_attr['assign'], $_attr['script'], $_attr['nocache']);
+        // convert attributes into parameter array string
+        $_paramsArray = array();
+        foreach ($_attr as $_key => $_value) {
+            $_paramsArray[] = "'$_key' => $_value";
+        }
+        $_params = 'array(' . implode(", ", $_paramsArray) . ')';
+        // call insert
+        if (isset($_assign)) {
+            if ($_smarty_tpl->caching) {
+                $_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}',{$_assign});?>";
+            } else {
+                $_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl), true);?>";
+            }
+        } else {
+            $compiler->has_output = true;
+            if ($_smarty_tpl->caching) {
+                $_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}');?>";
+            } else {
+                $_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>";
+            }
+        }
+        return $_output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_ldelim.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_ldelim.php
new file mode 100644 (file)
index 0000000..9906325
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Ldelim
+ *
+ * Compiles the {ldelim} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Ldelim Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {ldelim} tag
+     *
+     * This tag does output the left delimiter
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        $_attr = $this->getAttributes($compiler, $args);
+        if ($_attr['nocache'] === true) {
+            $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
+        }
+        // this tag does not return compiled code
+        $compiler->has_code = true;
+        return $compiler->smarty->left_delimiter;
+    }
+
+}
+
+?>
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_nocache.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_nocache.php
new file mode 100644 (file)
index 0000000..5fb71b7
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Nocache
+ *
+ * Compiles the {nocache} {/nocache} tags.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Nocache Classv
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {nocache} tag
+     *
+     * This tag does not generate compiled output. It only sets a compiler flag.
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return bool
+     */
+    public function compile($args, $compiler)
+    {
+        $_attr = $this->getAttributes($compiler, $args);
+        if ($_attr['nocache'] === true) {
+            $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
+        }
+        // enter nocache mode
+        $compiler->nocache = true;
+        // this tag does not return compiled code
+        $compiler->has_code = false;
+        return true;
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Nocacheclose Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {/nocache} tag
+     *
+     * This tag does not generate compiled output. It only sets a compiler flag.
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return bool
+     */
+    public function compile($args, $compiler)
+    {
+        $_attr = $this->getAttributes($compiler, $args);
+        // leave nocache mode
+        $compiler->nocache = false;
+        // this tag does not return compiled code
+        $compiler->has_code = false;
+        return true;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php
new file mode 100644 (file)
index 0000000..5288f45
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Block Plugin
+ *
+ * Compiles code for the execution of block plugin
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Block Plugin Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('_any');
+
+    /**
+     * Compiles code for the execution of block plugin
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @param string $tag       name of block plugin
+     * @param string $function  PHP function name
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter, $tag, $function)
+    {
+        if (!isset($tag[5]) || substr($tag, -5) != 'close') {
+            // opening tag of block plugin
+            // check and get attributes
+            $_attr = $this->getAttributes($compiler, $args);
+            if ($_attr['nocache'] === true) {
+                $compiler->tag_nocache = true;
+            }
+               unset($_attr['nocache']);
+            // convert attributes into parameter array string
+            $_paramsArray = array();
+            foreach ($_attr as $_key => $_value) {
+                if (is_int($_key)) {
+                    $_paramsArray[] = "$_key=>$_value";
+                } else {
+                    $_paramsArray[] = "'$_key'=>$_value";
+                }
+            }
+            $_params = 'array(' . implode(",", $_paramsArray) . ')';
+
+            $this->openTag($compiler, $tag, array($_params, $compiler->nocache));
+            // maybe nocache because of nocache variables or nocache plugin
+            $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+            // compile code
+            $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
+        } else {
+            // must endblock be nocache?
+            if ($compiler->nocache) {
+                $compiler->tag_nocache = true;
+            }
+            // closing tag of block plugin, restore nocache
+            list($_params, $compiler->nocache) = $this->closeTag($compiler, substr($tag, 0, -5));
+            // This tag does create output
+            $compiler->has_output = true;
+            // compile code
+            if (!isset($parameter['modifier_list'])) {
+                $mod_pre = $mod_post ='';
+            } else {
+                $mod_pre = ' ob_start(); ';
+                $mod_post = 'echo '.$compiler->compileTag('private_modifier',array(),array('modifierlist'=>$parameter['modifier_list'],'value'=>'ob_get_clean()')).';';
+            }
+            $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;".$mod_pre." echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); ".$mod_post." } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+        }
+        return $output . "\n";
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
new file mode 100644 (file)
index 0000000..70e7643
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Function Plugin
+ *
+ * Compiles code for the execution of function plugin
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Function Plugin Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array();
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('_any');
+
+    /**
+     * Compiles code for the execution of function plugin
+     *
+     * @param array $args array with attributes from parser
+     * @param object $compiler compiler object
+     * @param array $parameter array with compilation parameter
+     * @param string $tag name of function plugin
+     * @param string $function PHP function name
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter, $tag, $function)
+    {
+        // This tag does create output
+        $compiler->has_output = true;
+
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        if ($_attr['nocache'] === true) {
+            $compiler->tag_nocache = true;
+        }
+        unset($_attr['nocache']);
+        // convert attributes into parameter array string
+        $_paramsArray = array();
+        foreach ($_attr as $_key => $_value) {
+            if (is_int($_key)) {
+                $_paramsArray[] = "$_key=>$_value";
+            } else {
+                $_paramsArray[] = "'$_key'=>$_value";
+            }
+        }
+        $_params = 'array(' . implode(",", $_paramsArray) . ')';
+        // compile code
+        $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
+        return $output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php
new file mode 100644 (file)
index 0000000..120f3ff
--- /dev/null
@@ -0,0 +1,140 @@
+<?php\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Modifier\r
+ *\r
+ * Compiles code for modifier execution\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Modifier Class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ */\r
+class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBase {\r
+\r
+    /**\r
+     * Compiles code for modifier execution\r
+     *\r
+     * @param array  $args      array with attributes from parser\r
+     * @param object $compiler  compiler object\r
+     * @param array  $parameter array with compilation parameter\r
+     * @return string compiled code\r
+     */\r
+    public function compile($args, $compiler, $parameter) {\r
+        // check and get attributes\r
+        $_attr = $this->getAttributes($compiler, $args);\r
+        $output = $parameter['value'];\r
+        // loop over list of modifiers\r
+        foreach ($parameter['modifierlist'] as $single_modifier) {\r
+            $modifier = $single_modifier[0];\r
+            $single_modifier[0] = $output;\r
+            $params = implode(',', $single_modifier);\r
+            // check if we know already the type of modifier\r
+            if (isset($compiler->known_modifier_type[$modifier])) {\r
+                $modifier_types = array($compiler->known_modifier_type[$modifier]);\r
+            } else {\r
+                $modifier_types = array(1, 2, 3, 4, 5, 6);\r
+            }\r
+            foreach ($modifier_types as $type) {\r
+                switch ($type) {\r
+                    case 1:\r
+                        // registered modifier\r
+                        if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier])) {\r
+                            $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0];\r
+                            if (!is_array($function)) {\r
+                                $output = "{$function}({$params})";\r
+                            } else {\r
+                                if (is_object($function[0])) {\r
+                                    $output = '$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . $modifier . '\'][0][0]->' . $function[1] . '(' . $params . ')';\r
+                                } else {\r
+                                    $output = $function[0] . '::' . $function[1] . '(' . $params . ')';\r
+                                }\r
+                            }\r
+                            $compiler->known_modifier_type[$modifier] = $type;\r
+                            break 2;\r
+                        }\r
+                        break;\r
+                    case 2:\r
+                        // registered modifier compiler\r
+                        if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0])) {\r
+                            $output = call_user_func($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0], $single_modifier, $compiler->smarty);\r
+                            $compiler->known_modifier_type[$modifier] = $type;\r
+                            break 2;\r
+                        }\r
+                        break;\r
+                    case 3:\r
+                        // modifiercompiler plugin\r
+                        if ($compiler->smarty->loadPlugin('smarty_modifiercompiler_' . $modifier)) {\r
+                            // check if modifier allowed\r
+                            if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {\r
+                                $plugin = 'smarty_modifiercompiler_' . $modifier;\r
+                                $output = $plugin($single_modifier, $compiler);\r
+                            }\r
+                            $compiler->known_modifier_type[$modifier] = $type;\r
+                            break 2;\r
+                        }\r
+                        break;\r
+                    case 4:\r
+                        // modifier plugin\r
+                        if ($function = $compiler->getPlugin($modifier, Smarty::PLUGIN_MODIFIER)) {\r
+                            // check if modifier allowed\r
+                            if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {\r
+                                $output = "{$function}({$params})";\r
+                            }\r
+                            $compiler->known_modifier_type[$modifier] = $type;\r
+                            break 2;\r
+                        }\r
+                        break;\r
+                    case 5:\r
+                        // PHP function\r
+                        if (is_callable($modifier)) {\r
+                            // check if modifier allowed\r
+                            if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler)) {\r
+                                $output = "{$modifier}({$params})";\r
+                            }\r
+                            $compiler->known_modifier_type[$modifier] = $type;\r
+                            break 2;\r
+                        }\r
+                        break;\r
+                    case 6:\r
+                        // default plugin handler\r
+                        if (isset($compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier]) || (is_callable($compiler->smarty->default_plugin_handler_func) && $compiler->getPluginFromDefaultHandler($modifier, Smarty::PLUGIN_MODIFIER))) {\r
+                            $function = $compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0];\r
+                            // check if modifier allowed\r
+                            if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {\r
+                                if (!is_array($function)) {\r
+                                    $output = "{$function}({$params})";\r
+                                } else {\r
+                                    if (is_object($function[0])) {\r
+                                        $output = '$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . $modifier . '\'][0][0]->' . $function[1] . '(' . $params . ')';\r
+                                    } else {\r
+                                        $output = $function[0] . '::' . $function[1] . '(' . $params . ')';\r
+                                    }\r
+                                }\r
+                            }\r
+                            if (isset($compiler->template->required_plugins['nocache'][$modifier][Smarty::PLUGIN_MODIFIER]['file']) || isset($compiler->template->required_plugins['compiled'][$modifier][Smarty::PLUGIN_MODIFIER]['file'])) {\r
+                                // was a plugin\r
+                                $compiler->known_modifier_type[$modifier] = 4;\r
+                            } else {\r
+                                $compiler->known_modifier_type[$modifier] = $type;\r
+                            }\r
+                            break 2;\r
+                        }\r
+                }\r
+            }\r
+            if (!isset($compiler->known_modifier_type[$modifier])) {\r
+                $compiler->trigger_template_error("unknown modifier \"" . $modifier . "\"", $compiler->lex->taglineno);\r
+            }\r
+        }\r
+        return $output;\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php
new file mode 100644 (file)
index 0000000..cca924d
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Object Block Function
+ *
+ * Compiles code for registered objects as block function
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Object Block Function Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('_any');
+
+    /**
+     * Compiles code for the execution of block plugin
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @param string $tag       name of block object
+     * @param string $method    name of method to call
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter, $tag, $method)
+    {
+        if (!isset($tag[5]) || substr($tag, -5) != 'close') {
+            // opening tag of block plugin
+            // check and get attributes
+            $_attr = $this->getAttributes($compiler, $args);
+            if ($_attr['nocache'] === true) {
+                $compiler->tag_nocache = true;
+            }
+            unset($_attr['nocache']);
+            // convert attributes into parameter array string
+            $_paramsArray = array();
+            foreach ($_attr as $_key => $_value) {
+                if (is_int($_key)) {
+                    $_paramsArray[] = "$_key=>$_value";
+                } else {
+                    $_paramsArray[] = "'$_key'=>$_value";
+                }
+            }
+            $_params = 'array(' . implode(",", $_paramsArray) . ')';
+
+            $this->openTag($compiler, $tag . '->' . $method, array($_params, $compiler->nocache));
+            // maybe nocache because of nocache variables or nocache plugin
+            $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+            // compile code
+            $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}->{$method}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
+        } else {
+            $base_tag = substr($tag, 0, -5);
+            // must endblock be nocache?
+            if ($compiler->nocache) {
+                $compiler->tag_nocache = true;
+            }
+            // closing tag of block plugin, restore nocache
+            list($_params, $compiler->nocache) = $this->closeTag($compiler, $base_tag . '->' . $method);
+            // This tag does create output
+            $compiler->has_output = true;
+            // compile code
+            if (!isset($parameter['modifier_list'])) {
+                $mod_pre = $mod_post = '';
+            } else {
+                $mod_pre = ' ob_start(); ';
+                $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], 'value' => 'ob_get_clean()')) . ';';
+            }
+            $output = "<?php \$_block_content = ob_get_contents(); ob_end_clean(); \$_block_repeat=false;" . $mod_pre . " echo \$_smarty_tpl->smarty->registered_objects['{$base_tag}'][0]->{$method}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . $mod_post . "  } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+        }
+        return $output . "\n";
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_object_function.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_object_function.php
new file mode 100644 (file)
index 0000000..f649084
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Object Funtion
+ *
+ * Compiles code for registered objects as function
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Object Function Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('_any');
+
+    /**
+     * Compiles code for the execution of function plugin
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @param string $tag       name of function
+     * @param string $method    name of method to call
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter, $tag, $method)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        if ($_attr['nocache'] === true) {
+            $compiler->tag_nocache = true;
+        }
+        unset($_attr['nocache']);
+        $_assign = null;
+        if (isset($_attr['assign'])) {
+            $_assign = $_attr['assign'];
+            unset($_attr['assign']);
+        }
+        // convert attributes into parameter array string
+        if ($compiler->smarty->registered_objects[$tag][2]) {
+            $_paramsArray = array();
+            foreach ($_attr as $_key => $_value) {
+                if (is_int($_key)) {
+                    $_paramsArray[] = "$_key=>$_value";
+                } else {
+                    $_paramsArray[] = "'$_key'=>$_value";
+                }
+            }
+            $_params = 'array(' . implode(",", $_paramsArray) . ')';
+            $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\$_smarty_tpl)";
+        } else {
+            $_params = implode(",", $_attr);
+            $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})";
+        }
+        if (empty($_assign)) {
+            // This tag does create output
+            $compiler->has_output = true;
+            $output = "<?php echo {$return};?>\n";
+        } else {
+            $output = "<?php \$_smarty_tpl->assign({$_assign},{$return});?>\n";
+        }
+        return $output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php
new file mode 100644 (file)
index 0000000..a371195
--- /dev/null
@@ -0,0 +1,156 @@
+<?php
+/**
+* Smarty Internal Plugin Compile Print Expression
+*
+* Compiles any tag which will output an expression or variable
+*
+* @package Smarty
+* @subpackage Compiler
+* @author Uwe Tews
+*/
+
+/**
+* Smarty Internal Plugin Compile Print Expression Class
+*
+* @package Smarty
+* @subpackage Compiler
+*/
+class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase {
+
+    /**
+    * Attribute definition: Overwrites base class.
+    *
+    * @var array
+    * @see Smarty_Internal_CompileBase
+    */
+    public $optional_attributes = array('assign');
+    /**
+    * Attribute definition: Overwrites base class.
+    *
+    * @var array
+    * @see Smarty_Internal_CompileBase
+    */
+    public $option_flags = array('nocache', 'nofilter');
+
+    /**
+    * Compiles code for gererting output from any expression
+    *
+    * @param array  $args      array with attributes from parser
+    * @param object $compiler  compiler object
+    * @param array  $parameter array with compilation parameter
+    * @return string compiled code
+    */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        // nocache option
+        if ($_attr['nocache'] === true) {
+            $compiler->tag_nocache = true;
+        }
+        // filter handling
+        if ($_attr['nofilter'] === true) {
+            $_filter = 'false';
+        } else {
+            $_filter = 'true';
+        }
+        if (isset($_attr['assign'])) {
+            // assign output to variable
+            $output = "<?php \$_smarty_tpl->assign({$_attr['assign']},{$parameter['value']});?>";
+        } else {
+            // display value
+            $output = $parameter['value'];
+            // tag modifier
+            if (!empty($parameter['modifierlist'])) {
+                $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifierlist'], 'value' => $output));
+            }
+            if (!$_attr['nofilter']) {
+                // default modifier
+                if (!empty($compiler->smarty->default_modifiers)) {
+                    if (empty($compiler->default_modifier_list)) {
+                        $modifierlist = array();
+                        foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) {
+                            preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', $single_default_modifier, $mod_array);
+                            for ($i = 0, $count = count($mod_array[0]);$i < $count;$i++) {
+                                if ($mod_array[0][$i] != ':') {
+                                    $modifierlist[$key][] = $mod_array[0][$i];
+                                }
+                            }
+                        }
+                        $compiler->default_modifier_list  = $modifierlist;
+                    }
+                    $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $compiler->default_modifier_list, 'value' => $output));
+                }
+                // autoescape html
+                if ($compiler->template->smarty->escape_html) {
+                    $output = "htmlspecialchars({$output}, ENT_QUOTES, '" . addslashes(Smarty::$_CHARSET) . "')";
+                }
+                // loop over registerd filters
+                if (!empty($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE])) {
+                    foreach ($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE] as $key => $function) {
+                        if (!is_array($function)) {
+                            $output = "{$function}({$output},\$_smarty_tpl)";
+                        } else if (is_object($function[0])) {
+                            $output = "\$_smarty_tpl->smarty->registered_filters[Smarty::FILTER_VARIABLE][{$key}][0]->{$function[1]}({$output},\$_smarty_tpl)";
+                        } else {
+                            $output = "{$function[0]}::{$function[1]}({$output},\$_smarty_tpl)";
+                        }
+                    }
+                }
+                // auto loaded filters
+                if (isset($compiler->smarty->autoload_filters[Smarty::FILTER_VARIABLE])) {
+                    foreach ((array)$compiler->template->smarty->autoload_filters[Smarty::FILTER_VARIABLE] as $name) {
+                        $result = $this->compile_output_filter($compiler, $name, $output);
+                        if ($result !== false) {
+                            $output = $result;
+                        } else {
+                            // not found, throw exception
+                            throw new SmartyException("Unable to load filter '{$name}'");
+                        }
+                    }
+                }
+                if (isset($compiler->template->variable_filters)) {
+                    foreach ($compiler->template->variable_filters as $filter) {
+                        if (count($filter) == 1 && ($result = $this->compile_output_filter($compiler, $filter[0], $output)) !== false) {
+                            $output = $result;
+                        } else {
+                            $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => array($filter), 'value' => $output));
+                        }
+                    }
+                }
+            }
+
+            $compiler->has_output = true;
+            $output = "<?php echo {$output};?>";
+        }
+        return $output;
+    }
+
+    /**
+    * @param object $compiler compiler object
+    * @param string $name     name of variable filter
+    * @param type   $output   embedded output
+    * @return string
+    */
+    private function compile_output_filter($compiler, $name, $output)
+    {
+        $plugin_name = "smarty_variablefilter_{$name}";
+        $path = $compiler->smarty->loadPlugin($plugin_name, false);
+        if ($path) {
+            if ($compiler->template->caching) {
+                $compiler->template->required_plugins['nocache'][$name][Smarty::FILTER_VARIABLE]['file'] = $path;
+                $compiler->template->required_plugins['nocache'][$name][Smarty::FILTER_VARIABLE]['function'] = $plugin_name;
+            } else {
+                $compiler->template->required_plugins['compiled'][$name][Smarty::FILTER_VARIABLE]['file'] = $path;
+                $compiler->template->required_plugins['compiled'][$name][Smarty::FILTER_VARIABLE]['function'] = $plugin_name;
+            }
+        } else {
+            // not found
+            return false;
+        }
+        return "{$plugin_name}({$output},\$_smarty_tpl)";
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php
new file mode 100644 (file)
index 0000000..9fed36c
--- /dev/null
@@ -0,0 +1,113 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Compile Registered Block\r
+ *\r
+ * Compiles code for the execution of a registered block function\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Registered Block Class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ */\r
+class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_CompileBase {\r
+\r
+    /**\r
+     * Attribute definition: Overwrites base class.\r
+     *\r
+     * @var array\r
+     * @see Smarty_Internal_CompileBase\r
+     */\r
+    public $optional_attributes = array('_any');\r
+\r
+    /**\r
+     * Compiles code for the execution of a block function\r
+     *\r
+     * @param array  $args      array with attributes from parser\r
+     * @param object $compiler  compiler object\r
+     * @param array  $parameter array with compilation parameter\r
+     * @param string $tag       name of block function\r
+     * @return string compiled code\r
+     */\r
+    public function compile($args, $compiler, $parameter, $tag)\r
+    {\r
+        if (!isset($tag[5]) || substr($tag,-5) != 'close') {\r
+            // opening tag of block plugin\r
+            // check and get attributes\r
+            $_attr = $this->getAttributes($compiler, $args);\r
+            if ($_attr['nocache']) {\r
+                $compiler->tag_nocache = true;\r
+            }\r
+               unset($_attr['nocache']);\r
+               if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag])) {\r
+                   $tag_info = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag];\r
+               } else {\r
+                   $tag_info = $compiler->default_handler_plugins[Smarty::PLUGIN_BLOCK][$tag];\r
+               }\r
+            // convert attributes into parameter array string\r
+            $_paramsArray = array();\r
+            foreach ($_attr as $_key => $_value) {\r
+                if (is_int($_key)) {\r
+                    $_paramsArray[] = "$_key=>$_value";\r
+                } elseif ($compiler->template->caching && in_array($_key,$tag_info[2])) {\r
+                    $_value = str_replace("'","^#^",$_value);\r
+                    $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";\r
+                } else {\r
+                    $_paramsArray[] = "'$_key'=>$_value";\r
+                }\r
+            }\r
+            $_params = 'array(' . implode(",", $_paramsArray) . ')';\r
+\r
+            $this->openTag($compiler, $tag, array($_params, $compiler->nocache));\r
+            // maybe nocache because of nocache variables or nocache plugin\r
+            $compiler->nocache = !$tag_info[1] | $compiler->nocache | $compiler->tag_nocache;\r
+            $function = $tag_info[0];\r
+            // compile code\r
+            if (!is_array($function)) {\r
+                $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";\r
+            } else if (is_object($function[0])) {\r
+                $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";\r
+            } else {\r
+                $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";\r
+            }\r
+        } else {\r
+            // must endblock be nocache?\r
+            if ($compiler->nocache) {\r
+                $compiler->tag_nocache = true;\r
+            }\r
+            $base_tag = substr($tag, 0, -5);\r
+            // closing tag of block plugin, restore nocache\r
+            list($_params, $compiler->nocache) = $this->closeTag($compiler, $base_tag);\r
+            // This tag does create output\r
+            $compiler->has_output = true;\r
+               if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) {\r
+                   $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0];\r
+               } else {\r
+                   $function = $compiler->default_handler_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0];\r
+               }\r
+            // compile code\r
+            if (!isset($parameter['modifier_list'])) {\r
+                $mod_pre = $mod_post ='';\r
+            } else {\r
+                $mod_pre = ' ob_start(); ';\r
+                $mod_post = 'echo '.$compiler->compileTag('private_modifier',array(),array('modifierlist'=>$parameter['modifier_list'],'value'=>'ob_get_clean()')).';';\r
+            }\r
+            if (!is_array($function)) {\r
+                $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;".$mod_pre." echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat);".$mod_post." } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";\r
+            } else if (is_object($function[0])) {\r
+                $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;".$mod_pre." echo \$_smarty_tpl->smarty->registered_plugins['block']['{$base_tag}'][0][0]->{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); ".$mod_post."} array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";\r
+            } else {\r
+                $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;".$mod_pre." echo {$function[0]}::{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); ".$mod_post."} array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";\r
+            }\r
+        }\r
+        return $output . "\n";\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_function.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_function.php
new file mode 100644 (file)
index 0000000..5058bfb
--- /dev/null
@@ -0,0 +1,81 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Compile Registered Function\r
+ *\r
+ * Compiles code for the execution of a registered function\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Registered Function Class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ */\r
+class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Internal_CompileBase {\r
+\r
+    /**\r
+     * Attribute definition: Overwrites base class.\r
+     *\r
+     * @var array\r
+     * @see Smarty_Internal_CompileBase\r
+     */\r
+    public $optional_attributes = array('_any');\r
+\r
+    /**\r
+     * Compiles code for the execution of a registered function\r
+     *\r
+     * @param array  $args      array with attributes from parser\r
+     * @param object $compiler  compiler object\r
+     * @param array  $parameter array with compilation parameter\r
+     * @param string $tag       name of function\r
+     * @return string compiled code\r
+     */\r
+    public function compile($args, $compiler, $parameter, $tag)\r
+    {\r
+        // This tag does create output\r
+        $compiler->has_output = true;\r
+        // check and get attributes\r
+        $_attr = $this->getAttributes($compiler, $args);\r
+        if ($_attr['nocache']) {\r
+            $compiler->tag_nocache = true;\r
+        }\r
+        unset($_attr['nocache']);\r
+               if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag])) {\r
+                   $tag_info = $compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag];\r
+               } else {\r
+                   $tag_info = $compiler->default_handler_plugins[Smarty::PLUGIN_FUNCTION][$tag];\r
+               }\r
+        // not cachable?\r
+        $compiler->tag_nocache =  $compiler->tag_nocache || !$tag_info[1];\r
+        // convert attributes into parameter array string\r
+        $_paramsArray = array();\r
+        foreach ($_attr as $_key => $_value) {\r
+            if (is_int($_key)) {\r
+                $_paramsArray[] = "$_key=>$_value";\r
+            } elseif ($compiler->template->caching && in_array($_key,$tag_info[2])) {\r
+                $_value = str_replace("'","^#^",$_value);\r
+                $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";\r
+            } else {\r
+                $_paramsArray[] = "'$_key'=>$_value";\r
+            }\r
+        }\r
+        $_params = 'array(' . implode(",", $_paramsArray) . ')';\r
+        $function = $tag_info[0];\r
+        // compile code\r
+        if (!is_array($function)) {\r
+            $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";\r
+        } else if (is_object($function[0])) {\r
+            $output = "<?php echo \$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0][0]->{$function[1]}({$_params},\$_smarty_tpl);?>\n";\r
+        } else {\r
+            $output = "<?php echo {$function[0]}::{$function[1]}({$_params},\$_smarty_tpl);?>\n";\r
+        }\r
+        return $output;\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php
new file mode 100644 (file)
index 0000000..4760dbe
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Special Smarty Variable
+ *
+ * Compiles the special $smarty variables
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile special Smarty Variable Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the speical $smarty variables
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        $_index = preg_split("/\]\[/",substr($parameter, 1, strlen($parameter)-2));
+        $compiled_ref = ' ';
+        $variable = trim($_index[0], "'");
+        switch ($variable) {
+            case 'foreach':
+                return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
+            case 'section':
+                return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
+            case 'capture':
+                return "Smarty::\$_smarty_vars$parameter";
+            case 'now':
+                return 'time()';
+            case 'cookies':
+                if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) {
+                    $compiler->trigger_template_error("(secure mode) super globals not permitted");
+                    break;
+                }
+                $compiled_ref = '$_COOKIE';
+                break;
+
+            case 'get':
+            case 'post':
+            case 'env':
+            case 'server':
+            case 'session':
+            case 'request':
+                if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) {
+                    $compiler->trigger_template_error("(secure mode) super globals not permitted");
+                    break;
+                }
+                $compiled_ref = '$_'.strtoupper($variable);
+                break;
+
+            case 'template':
+                return 'basename($_smarty_tpl->source->filepath)';
+
+            case 'template_object':
+                return '$_smarty_tpl';
+
+            case 'current_dir':
+                return 'dirname($_smarty_tpl->source->filepath)';
+
+            case 'version':
+                $_version = Smarty::SMARTY_VERSION;
+                return "'$_version'";
+
+            case 'const':
+                if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_constants) {
+                    $compiler->trigger_template_error("(secure mode) constants not permitted");
+                    break;
+                }
+                return '@' . trim($_index[1], "'");
+
+            case 'config':
+                return "\$_smarty_tpl->getConfigVariable($_index[1])";
+            case 'ldelim':
+                $_ldelim = $compiler->smarty->left_delimiter;
+                return "'$_ldelim'";
+
+            case 'rdelim':
+                $_rdelim = $compiler->smarty->right_delimiter;
+                return "'$_rdelim'";
+
+            default:
+                $compiler->trigger_template_error('$smarty.' . trim($_index[0], "'") . ' is invalid');
+                break;
+        }
+        if (isset($_index[1])) {
+            array_shift($_index);
+            foreach ($_index as $_ind) {
+                $compiled_ref = $compiled_ref . "[$_ind]";
+            }
+        }
+        return $compiled_ref;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_rdelim.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_rdelim.php
new file mode 100644 (file)
index 0000000..807c7e2
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Rdelim
+ *
+ * Compiles the {rdelim} tag
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Rdelim Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {rdelim} tag
+     *
+     * This tag does output the right delimiter.
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        $_attr = $this->getAttributes($compiler, $args);
+        if ($_attr['nocache'] === true) {
+            $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
+        }
+        // this tag does not return compiled code
+        $compiler->has_code = true;
+        return $compiler->smarty->right_delimiter;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_section.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_section.php
new file mode 100644 (file)
index 0000000..ccb7673
--- /dev/null
@@ -0,0 +1,203 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Section
+ *
+ * Compiles the {section} {sectionelse} {/section} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Section Class
+ * 
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase {
+
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $required_attributes = array('name', 'loop');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $shorttag_order = array('name', 'loop');
+    /**
+     * Attribute definition: Overwrites base class.
+     *
+     * @var array
+     * @see Smarty_Internal_CompileBase
+     */
+    public $optional_attributes = array('start', 'step', 'max', 'show');
+
+    /**
+     * Compiles code for the {section} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        $this->openTag($compiler, 'section', array('section', $compiler->nocache));
+        // maybe nocache because of nocache variables
+        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+
+        $output = "<?php ";
+
+        $section_name = $_attr['name'];
+
+        $output .= "if (isset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name])) unset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]);\n";
+        $section_props = "\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]";
+
+        foreach ($_attr as $attr_name => $attr_value) {
+            switch ($attr_name) {
+                case 'loop':
+                    $output .= "{$section_props}['loop'] = is_array(\$_loop=$attr_value) ? count(\$_loop) : max(0, (int)\$_loop); unset(\$_loop);\n";
+                    break;
+
+                case 'show':
+                    if (is_bool($attr_value))
+                        $show_attr_value = $attr_value ? 'true' : 'false';
+                    else
+                        $show_attr_value = "(bool)$attr_value";
+                    $output .= "{$section_props}['show'] = $show_attr_value;\n";
+                    break;
+
+                case 'name':
+                    $output .= "{$section_props}['$attr_name'] = $attr_value;\n";
+                    break;
+
+                case 'max':
+                case 'start':
+                    $output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n";
+                    break;
+
+                case 'step':
+                    $output .= "{$section_props}['$attr_name'] = ((int)$attr_value) == 0 ? 1 : (int)$attr_value;\n";
+                    break;
+            }
+        }
+
+        if (!isset($_attr['show']))
+            $output .= "{$section_props}['show'] = true;\n";
+
+        if (!isset($_attr['loop']))
+            $output .= "{$section_props}['loop'] = 1;\n";
+
+        if (!isset($_attr['max']))
+            $output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
+        else
+            $output .= "if ({$section_props}['max'] < 0)\n" . "    {$section_props}['max'] = {$section_props}['loop'];\n";
+
+        if (!isset($_attr['step']))
+            $output .= "{$section_props}['step'] = 1;\n";
+
+        if (!isset($_attr['start']))
+            $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
+        else {
+            $output .= "if ({$section_props}['start'] < 0)\n" . "    {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" . "else\n" . "    {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n";
+        }
+
+        $output .= "if ({$section_props}['show']) {\n";
+        if (!isset($_attr['start']) && !isset($_attr['step']) && !isset($_attr['max'])) {
+            $output .= "    {$section_props}['total'] = {$section_props}['loop'];\n";
+        } else {
+            $output .= "    {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n";
+        }
+        $output .= "    if ({$section_props}['total'] == 0)\n" . "        {$section_props}['show'] = false;\n" . "} else\n" . "    {$section_props}['total'] = 0;\n";
+
+        $output .= "if ({$section_props}['show']):\n";
+        $output .= "
+            for ({$section_props}['index'] = {$section_props}['start'], {$section_props}['iteration'] = 1;
+                 {$section_props}['iteration'] <= {$section_props}['total'];
+                 {$section_props}['index'] += {$section_props}['step'], {$section_props}['iteration']++):\n";
+        $output .= "{$section_props}['rownum'] = {$section_props}['iteration'];\n";
+        $output .= "{$section_props}['index_prev'] = {$section_props}['index'] - {$section_props}['step'];\n";
+        $output .= "{$section_props}['index_next'] = {$section_props}['index'] + {$section_props}['step'];\n";
+        $output .= "{$section_props}['first']      = ({$section_props}['iteration'] == 1);\n";
+        $output .= "{$section_props}['last']       = ({$section_props}['iteration'] == {$section_props}['total']);\n";
+
+        $output .= "?>";
+        return $output;
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Sectionelse Class
+ * 
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {sectionelse} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        list($openTag, $nocache) = $this->closeTag($compiler, array('section'));
+        $this->openTag($compiler, 'sectionelse', array('sectionelse', $nocache));
+
+        return "<?php endfor; else: ?>";
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Sectionclose Class
+ * 
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {/section} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+
+        // must endblock be nocache?
+        if ($compiler->nocache) {
+            $compiler->tag_nocache = true;
+        }
+
+        list($openTag, $compiler->nocache) = $this->closeTag($compiler, array('section', 'sectionelse'));
+
+        if ($openTag == 'sectionelse') {
+            return "<?php endif; ?>";
+        } else {
+            return "<?php endfor; endif; ?>";
+        }
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_setfilter.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_setfilter.php
new file mode 100644 (file)
index 0000000..d1dd90c
--- /dev/null
@@ -0,0 +1,72 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Compile Setfilter\r
+ *\r
+ * Compiles code for setfilter tag\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Setfilter Class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ */\r
+class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase {\r
+\r
+    /**\r
+     * Compiles code for setfilter tag\r
+     *\r
+     * @param array  $args      array with attributes from parser\r
+     * @param object $compiler  compiler object\r
+     * @param array  $parameter array with compilation parameter\r
+     * @return string compiled code\r
+     */\r
+    public function compile($args, $compiler, $parameter)\r
+    {\r
+        $compiler->variable_filter_stack[] = $compiler->template->variable_filters;\r
+        $compiler->template->variable_filters = $parameter['modifier_list'];\r
+        // this tag does not return compiled code\r
+        $compiler->has_code = false;\r
+        return true;\r
+    }\r
+\r
+}\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Setfilterclose Class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ */\r
+class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase {\r
+\r
+    /**\r
+     * Compiles code for the {/setfilter} tag\r
+     *\r
+     * This tag does not generate compiled output. It resets variable filter.\r
+     *\r
+     * @param array  $args     array with attributes from parser\r
+     * @param object $compiler compiler object\r
+     * @return string compiled code\r
+     */\r
+    public function compile($args, $compiler)\r
+    {\r
+        $_attr = $this->getAttributes($compiler, $args);\r
+        // reset variable filter to previous state\r
+        if (count($compiler->variable_filter_stack)) {\r
+            $compiler->template->variable_filters = array_pop($compiler->variable_filter_stack);\r
+        } else {\r
+            $compiler->template->variable_filters = array();\r
+        }\r
+        // this tag does not return compiled code\r
+        $compiler->has_code = false;\r
+        return true;\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_while.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_while.php
new file mode 100644 (file)
index 0000000..d7d986c
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile While
+ *
+ * Compiles the {while} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile While Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {while} tag
+     *
+     * @param array  $args      array with attributes from parser
+     * @param object $compiler  compiler object
+     * @param array  $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compile($args, $compiler, $parameter)
+    {
+        // check and get attributes
+        $_attr = $this->getAttributes($compiler, $args);
+        $this->openTag($compiler, 'while', $compiler->nocache);
+
+        if (!array_key_exists("if condition",$parameter)) {
+            $compiler->trigger_template_error("missing while condition", $compiler->lex->taglineno);
+        }
+
+        // maybe nocache because of nocache variables
+        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+        if (is_array($parameter['if condition'])) {
+            if ($compiler->nocache) {
+                $_nocache = ',true';
+                // create nocache var to make it know for further compiling
+                if (is_array($parameter['if condition']['var'])) {
+                    $compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
+                } else {
+                    $compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
+                }
+            } else {
+                $_nocache = '';
+            }
+            if (is_array($parameter['if condition']['var'])) {
+                $_output = "<?php if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n";
+                $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . "){?>";
+            } else {
+                $_output = "<?php if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});";
+                $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . "){?>";
+            }
+            return $_output;
+        } else {
+            return "<?php while ({$parameter['if condition']}){?>";
+        }
+    }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Whileclose Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase {
+
+    /**
+     * Compiles code for the {/while} tag
+     *
+     * @param array  $args     array with attributes from parser
+     * @param object $compiler compiler object
+     * @return string compiled code
+     */
+    public function compile($args, $compiler)
+    {
+        // must endblock be nocache?
+        if ($compiler->nocache) {
+            $compiler->tag_nocache = true;
+        }
+        $compiler->nocache = $this->closeTag($compiler, array('while'));
+        return "<?php }?>";
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compilebase.php b/library/Smarty/libs/sysplugins/smarty_internal_compilebase.php
new file mode 100644 (file)
index 0000000..5fb56f3
--- /dev/null
@@ -0,0 +1,176 @@
+<?php
+/**
+ * Smarty Internal Plugin CompileBase
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * This class does extend all internal compile plugins
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+abstract class Smarty_Internal_CompileBase {
+
+    /**
+     * Array of names of required attribute required by tag
+     *
+     * @var array
+     */
+    public $required_attributes = array();
+    /**
+     * Array of names of optional attribute required by tag
+     * use array('_any') if there is no restriction of attributes names
+     *
+     * @var array
+     */
+    public $optional_attributes = array();
+    /**
+     * Shorttag attribute order defined by its names
+     *
+     * @var array
+     */
+    public $shorttag_order = array();
+    /**
+     * Array of names of valid option flags
+     *
+     * @var array
+     */
+    public $option_flags = array('nocache');
+
+    /**
+     * This function checks if the attributes passed are valid
+     *
+     * The attributes passed for the tag to compile are checked against the list of required and
+     * optional attributes. Required attributes must be present. Optional attributes are check against
+     * the corresponding list. The keyword '_any' specifies that any attribute will be accepted
+     * as valid
+     *
+     * @param object $compiler   compiler object
+     * @param array  $attributes attributes applied to the tag
+     * @return array of mapped attributes for further processing
+     */
+    public function getAttributes($compiler, $attributes)
+    {
+        $_indexed_attr = array();
+        // loop over attributes
+        foreach ($attributes as $key => $mixed) {
+            // shorthand ?
+            if (!is_array($mixed)) {
+                // option flag ?
+                if (in_array(trim($mixed, '\'"'), $this->option_flags)) {
+                    $_indexed_attr[trim($mixed, '\'"')] = true;
+                    // shorthand attribute ?
+                } else if (isset($this->shorttag_order[$key])) {
+                    $_indexed_attr[$this->shorttag_order[$key]] = $mixed;
+                } else {
+                    // too many shorthands
+                    $compiler->trigger_template_error('too many shorthand attributes', $compiler->lex->taglineno);
+                }
+                // named attribute
+            } else {
+                $kv = each($mixed);
+                // option flag?
+                if (in_array($kv['key'], $this->option_flags)) {
+                    if (is_bool($kv['value'])) {
+                        $_indexed_attr[$kv['key']] = $kv['value'];
+                    } else if (is_string($kv['value']) && in_array(trim($kv['value'], '\'"'), array('true', 'false'))) {
+                        if (trim($kv['value']) == 'true') {
+                            $_indexed_attr[$kv['key']] = true;
+                        } else {
+                            $_indexed_attr[$kv['key']] = false;
+                        }
+                    } else if (is_numeric($kv['value']) && in_array($kv['value'], array(0, 1))) {
+                        if ($kv['value'] == 1) {
+                            $_indexed_attr[$kv['key']] = true;
+                        } else {
+                            $_indexed_attr[$kv['key']] = false;
+                        }
+                    } else {
+                        $compiler->trigger_template_error("illegal value of option flag \"{$kv['key']}\"", $compiler->lex->taglineno);
+                    }
+                    // must be named attribute
+                } else {
+                    reset($mixed);
+                    $_indexed_attr[key($mixed)] = $mixed[key($mixed)];
+                }
+            }
+        }
+        // check if all required attributes present
+        foreach ($this->required_attributes as $attr) {
+            if (!array_key_exists($attr, $_indexed_attr)) {
+                $compiler->trigger_template_error("missing \"" . $attr . "\" attribute", $compiler->lex->taglineno);
+            }
+        }
+        // check for unallowed attributes
+        if ($this->optional_attributes != array('_any')) {
+            $tmp_array = array_merge($this->required_attributes, $this->optional_attributes, $this->option_flags);
+            foreach ($_indexed_attr as $key => $dummy) {
+                if (!in_array($key, $tmp_array) && $key !== 0) {
+                    $compiler->trigger_template_error("unexpected \"" . $key . "\" attribute", $compiler->lex->taglineno);
+                }
+            }
+        }
+        // default 'false' for all option flags not set
+        foreach ($this->option_flags as $flag) {
+            if (!isset($_indexed_attr[$flag])) {
+                $_indexed_attr[$flag] = false;
+            }
+        }
+
+        return $_indexed_attr;
+    }
+
+    /**
+     * Push opening tag name on stack
+     *
+     * Optionally additional data can be saved on stack
+     *
+     * @param object    $compiler   compiler object
+     * @param string    $openTag    the opening tag's name
+     * @param mixed     $data       optional data saved
+     */
+    public function openTag($compiler, $openTag, $data = null)
+    {
+        array_push($compiler->_tag_stack, array($openTag, $data));
+    }
+
+    /**
+     * Pop closing tag
+     *
+     * Raise an error if this stack-top doesn't match with expected opening tags
+     *
+     * @param object       $compiler    compiler object
+     * @param array|string $expectedTag the expected opening tag names
+     * @return mixed any type the opening tag's name or saved data
+     */
+    public function closeTag($compiler, $expectedTag)
+    {
+        if (count($compiler->_tag_stack) > 0) {
+            // get stacked info
+            list($_openTag, $_data) = array_pop($compiler->_tag_stack);
+            // open tag must match with the expected ones
+            if (in_array($_openTag, (array) $expectedTag)) {
+                if (is_null($_data)) {
+                    // return opening tag
+                    return $_openTag;
+                } else {
+                    // return restored data
+                    return $_data;
+                }
+            }
+            // wrong nesting of tags
+            $compiler->trigger_template_error("unclosed {" . $_openTag . "} tag");
+            return;
+        }
+        // wrong nesting of tags
+        $compiler->trigger_template_error("unexpected closing tag", $compiler->lex->taglineno);
+        return;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_config.php b/library/Smarty/libs/sysplugins/smarty_internal_config.php
new file mode 100644 (file)
index 0000000..a309ec9
--- /dev/null
@@ -0,0 +1,303 @@
+<?php
+/**
+ * Smarty Internal Plugin Config
+ *
+ * @package Smarty
+ * @subpackage Config
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Config
+ *
+ * Main class for config variables
+ *
+ * @package Smarty
+ * @subpackage Config
+ *
+ * @property Smarty_Config_Source   $source
+ * @property Smarty_Config_Compiled $compiled
+ * @ignore
+ */
+class Smarty_Internal_Config {
+
+    /**
+     * Samrty instance
+     *
+     * @var Smarty object
+     */
+    public $smarty = null;
+    /**
+     * Object of config var storage
+     *
+     * @var object
+     */
+    public $data = null;
+    /**
+     * Config resource
+     * @var string
+     */
+    public $config_resource = null;
+    /**
+     * Compiled config file
+     *
+     * @var string
+     */
+    public $compiled_config = null;
+    /**
+     * filepath of compiled config file
+     *
+     * @var string
+     */
+    public $compiled_filepath = null;
+    /**
+     * Filemtime of compiled config Filemtime
+     *
+     * @var int
+     */
+    public $compiled_timestamp = null;
+    /**
+     * flag if compiled config file is invalid and must be (re)compiled
+     * @var bool
+     */
+    public $mustCompile = null;
+    /**
+     * Config file compiler object
+     *
+     * @var Smarty_Internal_Config_File_Compiler object
+     */
+    public $compiler_object = null;
+
+    /**
+     * Constructor of config file object
+     *
+     * @param string $config_resource config file resource name
+     * @param Smarty $smarty Smarty instance
+     * @param object $data object for config vars storage
+     */
+    public function __construct($config_resource, $smarty, $data = null)
+    {
+        $this->data = $data;
+        $this->smarty = $smarty;
+        $this->config_resource = $config_resource;
+    }
+
+    /**
+     * Returns the compiled  filepath
+     *
+     * @return string the compiled filepath
+     */
+    public function getCompiledFilepath()
+    {
+        return $this->compiled_filepath === null ?
+                ($this->compiled_filepath = $this->buildCompiledFilepath()) :
+                $this->compiled_filepath;
+    }
+
+    /**
+     * Get file path.
+     *
+     * @return string
+     */
+    public function buildCompiledFilepath()
+    {
+        $_compile_id = isset($this->smarty->compile_id) ? preg_replace('![^\w\|]+!', '_', $this->smarty->compile_id) : null;
+        $_flag = (int) $this->smarty->config_read_hidden + (int) $this->smarty->config_booleanize * 2
+                + (int) $this->smarty->config_overwrite * 4;
+        $_filepath = sha1($this->source->name . $_flag);
+        // if use_sub_dirs, break file into directories
+        if ($this->smarty->use_sub_dirs) {
+            $_filepath = substr($_filepath, 0, 2) . DS
+                    . substr($_filepath, 2, 2) . DS
+                    . substr($_filepath, 4, 2) . DS
+                    . $_filepath;
+        }
+        $_compile_dir_sep = $this->smarty->use_sub_dirs ? DS : '^';
+        if (isset($_compile_id)) {
+            $_filepath = $_compile_id . $_compile_dir_sep . $_filepath;
+        }
+        $_compile_dir = $this->smarty->getCompileDir();
+        return $_compile_dir . $_filepath . '.' . basename($this->source->name) . '.config' . '.php';
+    }
+
+    /**
+     * Returns the timpestamp of the compiled file
+     *
+     * @return integer the file timestamp
+     */
+    public function getCompiledTimestamp()
+    {
+        return $this->compiled_timestamp === null
+            ? ($this->compiled_timestamp = (file_exists($this->getCompiledFilepath())) ? filemtime($this->getCompiledFilepath()) : false)
+            : $this->compiled_timestamp;
+    }
+
+    /**
+     * Returns if the current config file must be compiled
+     *
+     * It does compare the timestamps of config source and the compiled config and checks the force compile configuration
+     *
+     * @return boolean true if the file must be compiled
+     */
+    public function mustCompile()
+    {
+        return $this->mustCompile === null ?
+            $this->mustCompile = ($this->smarty->force_compile || $this->getCompiledTimestamp () === false || $this->smarty->compile_check && $this->getCompiledTimestamp () < $this->source->timestamp):
+            $this->mustCompile;
+    }
+
+    /**
+     * Returns the compiled config file
+     *
+     * It checks if the config file must be compiled or just read the compiled version
+     *
+     * @return string the compiled config file
+     */
+    public function getCompiledConfig()
+    {
+        if ($this->compiled_config === null) {
+            // see if template needs compiling.
+            if ($this->mustCompile()) {
+                $this->compileConfigSource();
+            } else {
+                $this->compiled_config = file_get_contents($this->getCompiledFilepath());
+            }
+        }
+        return $this->compiled_config;
+    }
+
+    /**
+     * Compiles the config files
+     *
+     * @throws Exception
+     */
+    public function compileConfigSource()
+    {
+        // compile template
+        if (!is_object($this->compiler_object)) {
+            // load compiler
+            $this->compiler_object = new Smarty_Internal_Config_File_Compiler($this->smarty);
+        }
+        // compile locking
+        if ($this->smarty->compile_locking) {
+            if ($saved_timestamp = $this->getCompiledTimestamp()) {
+                touch($this->getCompiledFilepath());
+            }
+        }
+        // call compiler
+        try {
+            $this->compiler_object->compileSource($this);
+        } catch (Exception $e) {
+            // restore old timestamp in case of error
+            if ($this->smarty->compile_locking && $saved_timestamp) {
+                touch($this->getCompiledFilepath(), $saved_timestamp);
+            }
+            throw $e;
+        }
+        // compiling succeded
+        // write compiled template
+        Smarty_Internal_Write_File::writeFile($this->getCompiledFilepath(), $this->getCompiledConfig(), $this->smarty);
+    }
+
+    /**
+     * load config variables
+     *
+     * @param mixed $sections array of section names, single section or null
+     * @param object $scope global,parent or local
+     */
+    public function loadConfigVars($sections = null, $scope = 'local')
+    {
+        if ($this->data instanceof Smarty_Internal_Template) {
+            $this->data->properties['file_dependency'][sha1($this->source->filepath)] = array($this->source->filepath, $this->source->timestamp, 'file');
+        }
+        if ($this->mustCompile()) {
+            $this->compileConfigSource();
+        }
+        // pointer to scope
+        if ($scope == 'local') {
+            $scope_ptr = $this->data;
+        } elseif ($scope == 'parent') {
+            if (isset($this->data->parent)) {
+                $scope_ptr = $this->data->parent;
+            } else {
+                $scope_ptr = $this->data;
+            }
+        } elseif ($scope == 'root' || $scope == 'global') {
+            $scope_ptr = $this->data;
+            while (isset($scope_ptr->parent)) {
+                $scope_ptr = $scope_ptr->parent;
+            }
+        }
+        $_config_vars = array();
+        include($this->getCompiledFilepath());
+        // copy global config vars
+        foreach ($_config_vars['vars'] as $variable => $value) {
+            if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
+                $scope_ptr->config_vars[$variable] = $value;
+            } else {
+                $scope_ptr->config_vars[$variable] = array_merge((array) $scope_ptr->config_vars[$variable], (array) $value);
+            }
+        }
+        // scan sections
+        if (!empty($sections)) {
+            $sections = array_flip((array) $sections);
+            foreach ($_config_vars['sections'] as $this_section => $dummy) {
+                if (isset($sections[$this_section])) {
+                    foreach ($_config_vars['sections'][$this_section]['vars'] as $variable => $value) {
+                        if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
+                            $scope_ptr->config_vars[$variable] = $value;
+                        } else {
+                            $scope_ptr->config_vars[$variable] = array_merge((array) $scope_ptr->config_vars[$variable], (array) $value);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * set Smarty property in template context
+     *
+     * @param string $property_name property name
+     * @param mixed  $value         value
+     * @throws SmartyException if $property_name is not valid
+     */
+    public function __set($property_name, $value)
+    {
+        switch ($property_name) {
+            case 'source':
+            case 'compiled':
+                $this->$property_name = $value;
+                return;
+        }
+
+        throw new SmartyException("invalid config property '$property_name'.");
+    }
+
+    /**
+     * get Smarty property in template context
+     *
+     * @param string $property_name property name
+     * @throws SmartyException if $property_name is not valid
+     */
+    public function __get($property_name)
+    {
+        switch ($property_name) {
+            case 'source':
+                if (empty($this->config_resource)) {
+                    throw new SmartyException("Unable to parse resource name \"{$this->config_resource}\"");
+                }
+                $this->source = Smarty_Resource::config($this);
+                return $this->source;
+
+            case 'compiled':
+                $this->compiled = $this->source->getCompiled($this);
+                return $this->compiled;
+        }
+
+        throw new SmartyException("config attribute '$property_name' does not exist.");
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_config_file_compiler.php b/library/Smarty/libs/sysplugins/smarty_internal_config_file_compiler.php
new file mode 100644 (file)
index 0000000..b16a694
--- /dev/null
@@ -0,0 +1,144 @@
+<?php
+/**
+ * Smarty Internal Plugin Config File Compiler
+ *
+ * This is the config file compiler class. It calls the lexer and parser to
+ * perform the compiling.
+ *
+ * @package Smarty
+ * @subpackage Config
+ * @author Uwe Tews
+ */
+
+/**
+ * Main config file compiler class
+ *
+ * @package Smarty
+ * @subpackage Config
+ */
+class Smarty_Internal_Config_File_Compiler {
+
+    /**
+     * Lexer object
+     *
+     * @var object
+     */
+    public $lex;
+
+    /**
+     * Parser object
+     *
+     * @var object
+     */
+    public $parser;
+
+    /**
+     * Smarty object
+     *
+     * @var Smarty object
+     */
+    public $smarty;
+
+    /**
+     * Smarty object
+     *
+     * @var Smarty_Internal_Config object
+     */
+    public $config;
+
+    /**
+     * Compiled config data sections and variables
+     *
+     * @var array
+     */
+    public $config_data = array();
+
+    /**
+     * Initialize compiler
+     *
+     * @param Smarty $smarty base instance
+     */
+    public function __construct($smarty)
+    {
+        $this->smarty = $smarty;
+        $this->config_data['sections'] = array();
+        $this->config_data['vars'] = array();
+    }
+
+    /**
+     * Method to compile a Smarty template.
+     *
+     * @param  Smarty_Internal_Config $config config object
+     * @return bool true if compiling succeeded, false if it failed
+     */
+    public function compileSource(Smarty_Internal_Config $config)
+    {
+        /* here is where the compiling takes place. Smarty
+          tags in the templates are replaces with PHP code,
+          then written to compiled files. */
+        $this->config = $config;
+        // get config file source
+        $_content = $config->source->content . "\n";
+        // on empty template just return
+        if ($_content == '') {
+            return true;
+        }
+        // init the lexer/parser to compile the config file
+        $lex = new Smarty_Internal_Configfilelexer($_content, $this->smarty);
+        $parser = new Smarty_Internal_Configfileparser($lex, $this);
+        if ($this->smarty->_parserdebug) $parser->PrintTrace();
+        // get tokens from lexer and parse them
+        while ($lex->yylex()) {
+            if ($this->smarty->_parserdebug) echo "<br>Parsing  {$parser->yyTokenName[$lex->token]} Token {$lex->value} Line {$lex->line} \n";
+            $parser->doParse($lex->token, $lex->value);
+        }
+        // finish parsing process
+        $parser->doParse(0, 0);
+        $config->compiled_config = '<?php $_config_vars = ' . var_export($this->config_data, true) . '; ?>';
+    }
+
+    /**
+     * display compiler error messages without dying
+     *
+     * If parameter $args is empty it is a parser detected syntax error.
+     * In this case the parser is called to obtain information about exspected tokens.
+     *
+     * If parameter $args contains a string this is used as error message
+     *
+     * @param string $args individual error message or null
+     */
+    public function trigger_config_file_error($args = null)
+    {
+        $this->lex = Smarty_Internal_Configfilelexer::instance();
+        $this->parser = Smarty_Internal_Configfileparser::instance();
+        // get template source line which has error
+        $line = $this->lex->line;
+        if (isset($args)) {
+            // $line--;
+        }
+        $match = preg_split("/\n/", $this->lex->data);
+        $error_text = "Syntax error in config file '{$this->config->source->filepath}' on line {$line} '{$match[$line-1]}' ";
+        if (isset($args)) {
+            // individual error message
+            $error_text .= $args;
+        } else {
+            // exspected token from parser
+            foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
+                $exp_token = $this->parser->yyTokenName[$token];
+                if (isset($this->lex->smarty_token_names[$exp_token])) {
+                    // token type from lexer
+                    $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';
+                } else {
+                    // otherwise internal token name
+                    $expect[] = $this->parser->yyTokenName[$token];
+                }
+            }
+            // output parser error message
+            $error_text .= ' - Unexpected "' . $this->lex->value . '", expected one of: ' . implode(' , ', $expect);
+        }
+        throw new SmartyCompilerException($error_text);
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_configfilelexer.php b/library/Smarty/libs/sysplugins/smarty_internal_configfilelexer.php
new file mode 100644 (file)
index 0000000..bade2fe
--- /dev/null
@@ -0,0 +1,622 @@
+<?php
+/**
+* Smarty Internal Plugin Configfilelexer
+*
+* This is the lexer to break the config file source into tokens
+* @package Smarty
+* @subpackage Config
+* @author Uwe Tews
+*/
+/**
+* Smarty Internal Plugin Configfilelexer
+*/
+class Smarty_Internal_Configfilelexer
+{
+
+    public $data;
+    public $counter;
+    public $token;
+    public $value;
+    public $node;
+    public $line;
+    private $state = 1;
+    public $smarty_token_names = array (               // Text for parser error messages
+                               );
+
+
+    function __construct($data, $smarty)
+    {
+        // set instance object
+        self::instance($this);
+        $this->data = $data . "\n"; //now all lines are \n-terminated
+        $this->counter = 0;
+        $this->line = 1;
+        $this->smarty = $smarty;
+        $this->mbstring_overload = ini_get('mbstring.func_overload') & 2;
+    }
+    public static function &instance($new_instance = null)
+    {
+        static $instance = null;
+        if (isset($new_instance) && is_object($new_instance))
+            $instance = $new_instance;
+        return $instance;
+    }
+
+
+
+    private $_yy_state = 1;
+    private $_yy_stack = array();
+
+    function yylex()
+    {
+        return $this->{'yylex' . $this->_yy_state}();
+    }
+
+    function yypushstate($state)
+    {
+        array_push($this->_yy_stack, $this->_yy_state);
+        $this->_yy_state = $state;
+    }
+
+    function yypopstate()
+    {
+        $this->_yy_state = array_pop($this->_yy_stack);
+    }
+
+    function yybegin($state)
+    {
+        $this->_yy_state = $state;
+    }
+
+
+
+
+    function yylex1()
+    {
+        $tokenMap = array (
+              1 => 0,
+              2 => 0,
+              3 => 0,
+              4 => 0,
+              5 => 0,
+              6 => 0,
+              7 => 0,
+              8 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G(#|;)|\G(\\[)|\G(\\])|\G(=)|\G([ \t\r]+)|\G(\n)|\G([0-9]*[a-zA-Z_]\\w*)|\G([\S\s])/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state START');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const START = 1;
+    function yy_r1_1($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART;
+    $this->yypushstate(self::COMMENT);
+    }
+    function yy_r1_2($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_OPENB;
+    $this->yypushstate(self::SECTION);
+    }
+    function yy_r1_3($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB;
+    }
+    function yy_r1_4($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL;
+    $this->yypushstate(self::VALUE);
+    }
+    function yy_r1_5($yy_subpatterns)
+    {
+
+    return false;
+    }
+    function yy_r1_6($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;
+    }
+    function yy_r1_7($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_ID;
+    }
+    function yy_r1_8($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_OTHER;
+    }
+
+
+
+    function yylex2()
+    {
+        $tokenMap = array (
+              1 => 0,
+              2 => 0,
+              3 => 0,
+              4 => 0,
+              5 => 0,
+              6 => 0,
+              7 => 0,
+              8 => 0,
+              9 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G([ \t\r]+)|\G(\\d+\\.\\d+(?=[ \t\r]*[\n#;]))|\G(\\d+(?=[ \t\r]*[\n#;]))|\G(\"\"\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#;]))|\G(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#;]))|\G([a-zA-Z]+(?=[ \t\r]*[\n#;]))|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state VALUE');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r2_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const VALUE = 2;
+    function yy_r2_1($yy_subpatterns)
+    {
+
+    return false;
+    }
+    function yy_r2_2($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_FLOAT;
+    $this->yypopstate();
+    }
+    function yy_r2_3($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_INT;
+    $this->yypopstate();
+    }
+    function yy_r2_4($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES;
+    $this->yypushstate(self::TRIPPLE);
+    }
+    function yy_r2_5($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_SINGLE_QUOTED_STRING;
+    $this->yypopstate();
+    }
+    function yy_r2_6($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING;
+    $this->yypopstate();
+    }
+    function yy_r2_7($yy_subpatterns)
+    {
+
+    if (!$this->smarty->config_booleanize || !in_array(strtolower($this->value), Array("true", "false", "on", "off", "yes", "no")) ) {
+        $this->yypopstate();
+        $this->yypushstate(self::NAKED_STRING_VALUE);
+        return true; //reprocess in new state
+    } else {
+        $this->token = Smarty_Internal_Configfileparser::TPC_BOOL;
+        $this->yypopstate();
+    }
+    }
+    function yy_r2_8($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
+    $this->yypopstate();
+    }
+    function yy_r2_9($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
+    $this->value = "";
+    $this->yypopstate();
+    }
+
+
+
+    function yylex3()
+    {
+        $tokenMap = array (
+              1 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G([^\n]+?(?=[ \t\r]*\n))/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state NAKED_STRING_VALUE');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r3_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const NAKED_STRING_VALUE = 3;
+    function yy_r3_1($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
+    $this->yypopstate();
+    }
+
+
+
+    function yylex4()
+    {
+        $tokenMap = array (
+              1 => 0,
+              2 => 0,
+              3 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state COMMENT');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r4_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const COMMENT = 4;
+    function yy_r4_1($yy_subpatterns)
+    {
+
+    return false;
+    }
+    function yy_r4_2($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
+    }
+    function yy_r4_3($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;
+    $this->yypopstate();
+    }
+
+
+
+    function yylex5()
+    {
+        $tokenMap = array (
+              1 => 0,
+              2 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state SECTION');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r5_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const SECTION = 5;
+    function yy_r5_1($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_DOT;
+    }
+    function yy_r5_2($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_SECTION;
+    $this->yypopstate();
+    }
+
+
+    function yylex6()
+    {
+        $tokenMap = array (
+              1 => 0,
+              2 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state TRIPPLE');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r6_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const TRIPPLE = 6;
+    function yy_r6_1($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES_END;
+    $this->yypopstate();
+    $this->yypushstate(self::START);
+    }
+    function yy_r6_2($yy_subpatterns)
+    {
+
+  if ($this->mbstring_overload) {
+    $to = mb_strlen($this->data,'latin1');
+  } else {
+    $to = strlen($this->data);
+  }
+  preg_match("/\"\"\"[ \t\r]*[\n#;]/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter);
+  if (isset($match[0][1])) {
+    $to = $match[0][1];
+  } else {
+    $this->compiler->trigger_template_error ("missing or misspelled literal closing tag");
+  }
+  if ($this->mbstring_overload) {
+    $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1');
+  } else {
+    $this->value = substr($this->data,$this->counter,$to-$this->counter);
+  }
+  $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_TEXT;
+    }
+
+
+}
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_configfileparser.php b/library/Smarty/libs/sysplugins/smarty_internal_configfileparser.php
new file mode 100644 (file)
index 0000000..784bc68
--- /dev/null
@@ -0,0 +1,921 @@
+<?php
+/**
+* Smarty Internal Plugin Configfileparser
+*
+* This is the config file parser.
+* It is generated from the internal.configfileparser.y file
+* @package Smarty
+* @subpackage Compiler
+* @author Uwe Tews
+*/
+
+class TPC_yyToken implements ArrayAccess
+{
+    public $string = '';
+    public $metadata = array();
+
+    function __construct($s, $m = array())
+    {
+        if ($s instanceof TPC_yyToken) {
+            $this->string = $s->string;
+            $this->metadata = $s->metadata;
+        } else {
+            $this->string = (string) $s;
+            if ($m instanceof TPC_yyToken) {
+                $this->metadata = $m->metadata;
+            } elseif (is_array($m)) {
+                $this->metadata = $m;
+            }
+        }
+    }
+
+    function __toString()
+    {
+        return $this->_string;
+    }
+
+    function offsetExists($offset)
+    {
+        return isset($this->metadata[$offset]);
+    }
+
+    function offsetGet($offset)
+    {
+        return $this->metadata[$offset];
+    }
+
+    function offsetSet($offset, $value)
+    {
+        if ($offset === null) {
+            if (isset($value[0])) {
+                $x = ($value instanceof TPC_yyToken) ?
+                    $value->metadata : $value;
+                $this->metadata = array_merge($this->metadata, $x);
+                return;
+            }
+            $offset = count($this->metadata);
+        }
+        if ($value === null) {
+            return;
+        }
+        if ($value instanceof TPC_yyToken) {
+            if ($value->metadata) {
+                $this->metadata[$offset] = $value->metadata;
+            }
+        } elseif ($value) {
+            $this->metadata[$offset] = $value;
+        }
+    }
+
+    function offsetUnset($offset)
+    {
+        unset($this->metadata[$offset]);
+    }
+}
+
+class TPC_yyStackEntry
+{
+    public $stateno;       /* The state-number */
+    public $major;         /* The major token value.  This is the code
+                     ** number for the token at this stack level */
+    public $minor; /* The user-supplied minor token value.  This
+                     ** is the value of the token  */
+};
+
+
+#line 12 "smarty_internal_configfileparser.y"
+class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser.php"
+{
+#line 14 "smarty_internal_configfileparser.y"
+
+    // states whether the parse was successful or not
+    public $successful = true;
+    public $retvalue = 0;
+    private $lex;
+    private $internalError = false;
+
+    function __construct($lex, $compiler) {
+        // set instance object
+        self::instance($this);
+        $this->lex = $lex;
+        $this->smarty = $compiler->smarty;
+        $this->compiler = $compiler;
+    }
+    public static function &instance($new_instance = null)
+    {
+        static $instance = null;
+        if (isset($new_instance) && is_object($new_instance))
+            $instance = $new_instance;
+        return $instance;
+    }
+
+    private function parse_bool($str) {
+        if (in_array(strtolower($str) ,array('on','yes','true'))) {
+            $res = true;
+        } else {
+            $res = false;
+        }
+        return $res;
+    }
+
+    private static $escapes_single = Array('\\' => '\\',
+                                          '\'' => '\'');
+    private static function parse_single_quoted_string($qstr) {
+        $escaped_string = substr($qstr, 1, strlen($qstr)-2); //remove outer quotes
+
+        $ss = preg_split('/(\\\\.)/', $escaped_string, -1, PREG_SPLIT_DELIM_CAPTURE);
+
+        $str = "";
+        foreach ($ss as $s) {
+            if (strlen($s) === 2 && $s[0] === '\\') {
+                if (isset(self::$escapes_single[$s[1]])) {
+                    $s = self::$escapes_single[$s[1]];
+                }
+             }
+
+             $str .= $s;
+        }
+
+        return $str;
+    }
+
+    private static function parse_double_quoted_string($qstr) {
+        $inner_str = substr($qstr, 1, strlen($qstr)-2);
+        return stripcslashes($inner_str);
+    }
+
+    private static function parse_tripple_double_quoted_string($qstr) {
+        return stripcslashes($qstr);
+    }
+
+    private function set_var(Array $var, Array &$target_array) {
+        $key = $var["key"];
+        $value = $var["value"];
+
+        if ($this->smarty->config_overwrite || !isset($target_array['vars'][$key])) {
+            $target_array['vars'][$key] = $value;
+        } else {
+            settype($target_array['vars'][$key], 'array');
+            $target_array['vars'][$key][] = $value;
+        }
+    }
+
+    private function add_global_vars(Array $vars) {
+        if (!isset($this->compiler->config_data['vars'])) {
+      $this->compiler->config_data['vars'] = Array();
+        }
+        foreach ($vars as $var) {
+            $this->set_var($var, $this->compiler->config_data);
+        }
+    }
+
+    private function add_section_vars($section_name, Array $vars) {
+        if (!isset($this->compiler->config_data['sections'][$section_name]['vars'])) {
+            $this->compiler->config_data['sections'][$section_name]['vars'] = Array();
+        }
+        foreach ($vars as $var) {
+            $this->set_var($var, $this->compiler->config_data['sections'][$section_name]);
+        }
+    }
+#line 173 "smarty_internal_configfileparser.php"
+
+    const TPC_OPENB                          =  1;
+    const TPC_SECTION                        =  2;
+    const TPC_CLOSEB                         =  3;
+    const TPC_DOT                            =  4;
+    const TPC_ID                             =  5;
+    const TPC_EQUAL                          =  6;
+    const TPC_FLOAT                          =  7;
+    const TPC_INT                            =  8;
+    const TPC_BOOL                           =  9;
+    const TPC_SINGLE_QUOTED_STRING           = 10;
+    const TPC_DOUBLE_QUOTED_STRING           = 11;
+    const TPC_TRIPPLE_QUOTES                 = 12;
+    const TPC_TRIPPLE_TEXT                   = 13;
+    const TPC_TRIPPLE_QUOTES_END             = 14;
+    const TPC_NAKED_STRING                   = 15;
+    const TPC_OTHER                          = 16;
+    const TPC_NEWLINE                        = 17;
+    const TPC_COMMENTSTART                   = 18;
+    const YY_NO_ACTION = 60;
+    const YY_ACCEPT_ACTION = 59;
+    const YY_ERROR_ACTION = 58;
+
+    const YY_SZ_ACTTAB = 38;
+static public $yy_action = array(
+ /*     0 */    29,   30,   34,   33,   24,   13,   19,   25,   35,   21,
+ /*    10 */    59,    8,    3,    1,   20,   12,   14,   31,   20,   12,
+ /*    20 */    15,   17,   23,   18,   27,   26,    4,    5,    6,   32,
+ /*    30 */     2,   11,   28,   22,   16,    9,    7,   10,
+    );
+    static public $yy_lookahead = array(
+ /*     0 */     7,    8,    9,   10,   11,   12,    5,   27,   15,   16,
+ /*    10 */    20,   21,   23,   23,   17,   18,   13,   14,   17,   18,
+ /*    20 */    15,    2,   17,    4,   25,   26,    6,    3,    3,   14,
+ /*    30 */    23,    1,   24,   17,    2,   25,   22,   25,
+);
+    const YY_SHIFT_USE_DFLT = -8;
+    const YY_SHIFT_MAX = 19;
+    static public $yy_shift_ofst = array(
+ /*     0 */    -8,    1,    1,    1,   -7,   -3,   -3,   30,   -8,   -8,
+ /*    10 */    -8,   19,    5,    3,   15,   16,   24,   25,   32,   20,
+);
+    const YY_REDUCE_USE_DFLT = -21;
+    const YY_REDUCE_MAX = 10;
+    static public $yy_reduce_ofst = array(
+ /*     0 */   -10,   -1,   -1,   -1,  -20,   10,   12,    8,   14,    7,
+ /*    10 */   -11,
+);
+    static public $yyExpectedTokens = array(
+        /* 0 */ array(),
+        /* 1 */ array(5, 17, 18, ),
+        /* 2 */ array(5, 17, 18, ),
+        /* 3 */ array(5, 17, 18, ),
+        /* 4 */ array(7, 8, 9, 10, 11, 12, 15, 16, ),
+        /* 5 */ array(17, 18, ),
+        /* 6 */ array(17, 18, ),
+        /* 7 */ array(1, ),
+        /* 8 */ array(),
+        /* 9 */ array(),
+        /* 10 */ array(),
+        /* 11 */ array(2, 4, ),
+        /* 12 */ array(15, 17, ),
+        /* 13 */ array(13, 14, ),
+        /* 14 */ array(14, ),
+        /* 15 */ array(17, ),
+        /* 16 */ array(3, ),
+        /* 17 */ array(3, ),
+        /* 18 */ array(2, ),
+        /* 19 */ array(6, ),
+        /* 20 */ array(),
+        /* 21 */ array(),
+        /* 22 */ array(),
+        /* 23 */ array(),
+        /* 24 */ array(),
+        /* 25 */ array(),
+        /* 26 */ array(),
+        /* 27 */ array(),
+        /* 28 */ array(),
+        /* 29 */ array(),
+        /* 30 */ array(),
+        /* 31 */ array(),
+        /* 32 */ array(),
+        /* 33 */ array(),
+        /* 34 */ array(),
+        /* 35 */ array(),
+);
+    static public $yy_default = array(
+ /*     0 */    44,   37,   41,   40,   58,   58,   58,   36,   39,   44,
+ /*    10 */    44,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+ /*    20 */    55,   54,   57,   56,   50,   45,   43,   42,   38,   46,
+ /*    30 */    47,   52,   51,   49,   48,   53,
+);
+    const YYNOCODE = 29;
+    const YYSTACKDEPTH = 100;
+    const YYNSTATE = 36;
+    const YYNRULE = 22;
+    const YYERRORSYMBOL = 19;
+    const YYERRSYMDT = 'yy0';
+    const YYFALLBACK = 0;
+    static public $yyFallback = array(
+    );
+    static function Trace($TraceFILE, $zTracePrompt)
+    {
+        if (!$TraceFILE) {
+            $zTracePrompt = 0;
+        } elseif (!$zTracePrompt) {
+            $TraceFILE = 0;
+        }
+        self::$yyTraceFILE = $TraceFILE;
+        self::$yyTracePrompt = $zTracePrompt;
+    }
+
+    static function PrintTrace()
+    {
+        self::$yyTraceFILE = fopen('php://output', 'w');
+        self::$yyTracePrompt = '<br>';
+    }
+
+    static public $yyTraceFILE;
+    static public $yyTracePrompt;
+    public $yyidx;                    /* Index of top element in stack */
+    public $yyerrcnt;                 /* Shifts left before out of the error */
+    public $yystack = array();  /* The parser's stack */
+
+    public $yyTokenName = array(
+  '$',             'OPENB',         'SECTION',       'CLOSEB',
+  'DOT',           'ID',            'EQUAL',         'FLOAT',
+  'INT',           'BOOL',          'SINGLE_QUOTED_STRING',  'DOUBLE_QUOTED_STRING',
+  'TRIPPLE_QUOTES',  'TRIPPLE_TEXT',  'TRIPPLE_QUOTES_END',  'NAKED_STRING',
+  'OTHER',         'NEWLINE',       'COMMENTSTART',  'error',
+  'start',         'global_vars',   'sections',      'var_list',
+  'section',       'newline',       'var',           'value',
+    );
+
+    static public $yyRuleName = array(
+ /*   0 */ "start ::= global_vars sections",
+ /*   1 */ "global_vars ::= var_list",
+ /*   2 */ "sections ::= sections section",
+ /*   3 */ "sections ::=",
+ /*   4 */ "section ::= OPENB SECTION CLOSEB newline var_list",
+ /*   5 */ "section ::= OPENB DOT SECTION CLOSEB newline var_list",
+ /*   6 */ "var_list ::= var_list newline",
+ /*   7 */ "var_list ::= var_list var",
+ /*   8 */ "var_list ::=",
+ /*   9 */ "var ::= ID EQUAL value",
+ /*  10 */ "value ::= FLOAT",
+ /*  11 */ "value ::= INT",
+ /*  12 */ "value ::= BOOL",
+ /*  13 */ "value ::= SINGLE_QUOTED_STRING",
+ /*  14 */ "value ::= DOUBLE_QUOTED_STRING",
+ /*  15 */ "value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END",
+ /*  16 */ "value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END",
+ /*  17 */ "value ::= NAKED_STRING",
+ /*  18 */ "value ::= OTHER",
+ /*  19 */ "newline ::= NEWLINE",
+ /*  20 */ "newline ::= COMMENTSTART NEWLINE",
+ /*  21 */ "newline ::= COMMENTSTART NAKED_STRING NEWLINE",
+    );
+
+    function tokenName($tokenType)
+    {
+        if ($tokenType === 0) {
+            return 'End of Input';
+        }
+        if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {
+            return $this->yyTokenName[$tokenType];
+        } else {
+            return "Unknown";
+        }
+    }
+
+    static function yy_destructor($yymajor, $yypminor)
+    {
+        switch ($yymajor) {
+            default:  break;   /* If no destructor action specified: do nothing */
+        }
+    }
+
+    function yy_pop_parser_stack()
+    {
+        if (!count($this->yystack)) {
+            return;
+        }
+        $yytos = array_pop($this->yystack);
+        if (self::$yyTraceFILE && $this->yyidx >= 0) {
+            fwrite(self::$yyTraceFILE,
+                self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .
+                    "\n");
+        }
+        $yymajor = $yytos->major;
+        self::yy_destructor($yymajor, $yytos->minor);
+        $this->yyidx--;
+        return $yymajor;
+    }
+
+    function __destruct()
+    {
+        while ($this->yystack !== Array()) {
+            $this->yy_pop_parser_stack();
+        }
+        if (is_resource(self::$yyTraceFILE)) {
+            fclose(self::$yyTraceFILE);
+        }
+    }
+
+    function yy_get_expected_tokens($token)
+    {
+        $state = $this->yystack[$this->yyidx]->stateno;
+        $expected = self::$yyExpectedTokens[$state];
+        if (in_array($token, self::$yyExpectedTokens[$state], true)) {
+            return $expected;
+        }
+        $stack = $this->yystack;
+        $yyidx = $this->yyidx;
+        do {
+            $yyact = $this->yy_find_shift_action($token);
+            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
+                // reduce action
+                $done = 0;
+                do {
+                    if ($done++ == 100) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // too much recursion prevents proper detection
+                        // so give up
+                        return array_unique($expected);
+                    }
+                    $yyruleno = $yyact - self::YYNSTATE;
+                    $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
+                    $nextstate = $this->yy_find_reduce_action(
+                        $this->yystack[$this->yyidx]->stateno,
+                        self::$yyRuleInfo[$yyruleno]['lhs']);
+                    if (isset(self::$yyExpectedTokens[$nextstate])) {
+                       $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
+                            if (in_array($token,
+                                  self::$yyExpectedTokens[$nextstate], true)) {
+                            $this->yyidx = $yyidx;
+                            $this->yystack = $stack;
+                            return array_unique($expected);
+                        }
+                    }
+                    if ($nextstate < self::YYNSTATE) {
+                        // we need to shift a non-terminal
+                        $this->yyidx++;
+                        $x = new TPC_yyStackEntry;
+                        $x->stateno = $nextstate;
+                        $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
+                        $this->yystack[$this->yyidx] = $x;
+                        continue 2;
+                    } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // the last token was just ignored, we can't accept
+                        // by ignoring input, this is in essence ignoring a
+                        // syntax error!
+                        return array_unique($expected);
+                    } elseif ($nextstate === self::YY_NO_ACTION) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // input accepted, but not shifted (I guess)
+                        return $expected;
+                    } else {
+                        $yyact = $nextstate;
+                    }
+                } while (true);
+            }
+            break;
+        } while (true);
+       $this->yyidx = $yyidx;
+       $this->yystack = $stack;
+        return array_unique($expected);
+    }
+
+    function yy_is_expected_token($token)
+    {
+        if ($token === 0) {
+            return true; // 0 is not part of this
+        }
+        $state = $this->yystack[$this->yyidx]->stateno;
+        if (in_array($token, self::$yyExpectedTokens[$state], true)) {
+            return true;
+        }
+        $stack = $this->yystack;
+        $yyidx = $this->yyidx;
+        do {
+            $yyact = $this->yy_find_shift_action($token);
+            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
+                // reduce action
+                $done = 0;
+                do {
+                    if ($done++ == 100) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // too much recursion prevents proper detection
+                        // so give up
+                        return true;
+                    }
+                    $yyruleno = $yyact - self::YYNSTATE;
+                    $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
+                    $nextstate = $this->yy_find_reduce_action(
+                        $this->yystack[$this->yyidx]->stateno,
+                        self::$yyRuleInfo[$yyruleno]['lhs']);
+                    if (isset(self::$yyExpectedTokens[$nextstate]) &&
+                          in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        return true;
+                    }
+                    if ($nextstate < self::YYNSTATE) {
+                        // we need to shift a non-terminal
+                        $this->yyidx++;
+                        $x = new TPC_yyStackEntry;
+                        $x->stateno = $nextstate;
+                        $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
+                        $this->yystack[$this->yyidx] = $x;
+                        continue 2;
+                    } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        if (!$token) {
+                            // end of input: this is valid
+                            return true;
+                        }
+                        // the last token was just ignored, we can't accept
+                        // by ignoring input, this is in essence ignoring a
+                        // syntax error!
+                        return false;
+                    } elseif ($nextstate === self::YY_NO_ACTION) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // input accepted, but not shifted (I guess)
+                        return true;
+                    } else {
+                        $yyact = $nextstate;
+                    }
+                } while (true);
+            }
+            break;
+        } while (true);
+        $this->yyidx = $yyidx;
+        $this->yystack = $stack;
+        return true;
+    }
+
+   function yy_find_shift_action($iLookAhead)
+    {
+        $stateno = $this->yystack[$this->yyidx]->stateno;
+
+        /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */
+        if (!isset(self::$yy_shift_ofst[$stateno])) {
+            // no shift actions
+            return self::$yy_default[$stateno];
+        }
+        $i = self::$yy_shift_ofst[$stateno];
+        if ($i === self::YY_SHIFT_USE_DFLT) {
+            return self::$yy_default[$stateno];
+        }
+        if ($iLookAhead == self::YYNOCODE) {
+            return self::YY_NO_ACTION;
+        }
+        $i += $iLookAhead;
+        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
+              self::$yy_lookahead[$i] != $iLookAhead) {
+            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
+                   && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
+                if (self::$yyTraceFILE) {
+                    fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " .
+                        $this->yyTokenName[$iLookAhead] . " => " .
+                        $this->yyTokenName[$iFallback] . "\n");
+                }
+                return $this->yy_find_shift_action($iFallback);
+            }
+            return self::$yy_default[$stateno];
+        } else {
+            return self::$yy_action[$i];
+        }
+    }
+
+    function yy_find_reduce_action($stateno, $iLookAhead)
+    {
+        /* $stateno = $this->yystack[$this->yyidx]->stateno; */
+
+        if (!isset(self::$yy_reduce_ofst[$stateno])) {
+            return self::$yy_default[$stateno];
+        }
+        $i = self::$yy_reduce_ofst[$stateno];
+        if ($i == self::YY_REDUCE_USE_DFLT) {
+            return self::$yy_default[$stateno];
+        }
+        if ($iLookAhead == self::YYNOCODE) {
+            return self::YY_NO_ACTION;
+        }
+        $i += $iLookAhead;
+        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
+              self::$yy_lookahead[$i] != $iLookAhead) {
+            return self::$yy_default[$stateno];
+        } else {
+            return self::$yy_action[$i];
+        }
+    }
+
+    function yy_shift($yyNewState, $yyMajor, $yypMinor)
+    {
+        $this->yyidx++;
+        if ($this->yyidx >= self::YYSTACKDEPTH) {
+            $this->yyidx--;
+            if (self::$yyTraceFILE) {
+                fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt);
+            }
+            while ($this->yyidx >= 0) {
+                $this->yy_pop_parser_stack();
+            }
+#line 125 "smarty_internal_configfileparser.y"
+
+    $this->internalError = true;
+    $this->compiler->trigger_config_file_error("Stack overflow in configfile parser");
+#line 593 "smarty_internal_configfileparser.php"
+            return;
+        }
+        $yytos = new TPC_yyStackEntry;
+        $yytos->stateno = $yyNewState;
+        $yytos->major = $yyMajor;
+        $yytos->minor = $yypMinor;
+        array_push($this->yystack, $yytos);
+        if (self::$yyTraceFILE && $this->yyidx > 0) {
+            fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt,
+                $yyNewState);
+            fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt);
+            for($i = 1; $i <= $this->yyidx; $i++) {
+                fprintf(self::$yyTraceFILE, " %s",
+                    $this->yyTokenName[$this->yystack[$i]->major]);
+            }
+            fwrite(self::$yyTraceFILE,"\n");
+        }
+    }
+
+    static public $yyRuleInfo = array(
+  array( 'lhs' => 20, 'rhs' => 2 ),
+  array( 'lhs' => 21, 'rhs' => 1 ),
+  array( 'lhs' => 22, 'rhs' => 2 ),
+  array( 'lhs' => 22, 'rhs' => 0 ),
+  array( 'lhs' => 24, 'rhs' => 5 ),
+  array( 'lhs' => 24, 'rhs' => 6 ),
+  array( 'lhs' => 23, 'rhs' => 2 ),
+  array( 'lhs' => 23, 'rhs' => 2 ),
+  array( 'lhs' => 23, 'rhs' => 0 ),
+  array( 'lhs' => 26, 'rhs' => 3 ),
+  array( 'lhs' => 27, 'rhs' => 1 ),
+  array( 'lhs' => 27, 'rhs' => 1 ),
+  array( 'lhs' => 27, 'rhs' => 1 ),
+  array( 'lhs' => 27, 'rhs' => 1 ),
+  array( 'lhs' => 27, 'rhs' => 1 ),
+  array( 'lhs' => 27, 'rhs' => 3 ),
+  array( 'lhs' => 27, 'rhs' => 2 ),
+  array( 'lhs' => 27, 'rhs' => 1 ),
+  array( 'lhs' => 27, 'rhs' => 1 ),
+  array( 'lhs' => 25, 'rhs' => 1 ),
+  array( 'lhs' => 25, 'rhs' => 2 ),
+  array( 'lhs' => 25, 'rhs' => 3 ),
+    );
+
+    static public $yyReduceMap = array(
+        0 => 0,
+        2 => 0,
+        3 => 0,
+        19 => 0,
+        20 => 0,
+        21 => 0,
+        1 => 1,
+        4 => 4,
+        5 => 5,
+        6 => 6,
+        7 => 7,
+        8 => 8,
+        9 => 9,
+        10 => 10,
+        11 => 11,
+        12 => 12,
+        13 => 13,
+        14 => 14,
+        15 => 15,
+        16 => 16,
+        17 => 17,
+        18 => 17,
+    );
+#line 131 "smarty_internal_configfileparser.y"
+    function yy_r0(){
+    $this->_retvalue = null;
+    }
+#line 666 "smarty_internal_configfileparser.php"
+#line 136 "smarty_internal_configfileparser.y"
+    function yy_r1(){
+    $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = null;
+    }
+#line 671 "smarty_internal_configfileparser.php"
+#line 149 "smarty_internal_configfileparser.y"
+    function yy_r4(){
+    $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor);
+    $this->_retvalue = null;
+    }
+#line 677 "smarty_internal_configfileparser.php"
+#line 154 "smarty_internal_configfileparser.y"
+    function yy_r5(){
+    if ($this->smarty->config_read_hidden) {
+        $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor);
+    }
+    $this->_retvalue = null;
+    }
+#line 685 "smarty_internal_configfileparser.php"
+#line 162 "smarty_internal_configfileparser.y"
+    function yy_r6(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;
+    }
+#line 690 "smarty_internal_configfileparser.php"
+#line 166 "smarty_internal_configfileparser.y"
+    function yy_r7(){
+    $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor, Array($this->yystack[$this->yyidx + 0]->minor));
+    }
+#line 695 "smarty_internal_configfileparser.php"
+#line 170 "smarty_internal_configfileparser.y"
+    function yy_r8(){
+    $this->_retvalue = Array();
+    }
+#line 700 "smarty_internal_configfileparser.php"
+#line 176 "smarty_internal_configfileparser.y"
+    function yy_r9(){
+    $this->_retvalue = Array("key" => $this->yystack[$this->yyidx + -2]->minor, "value" => $this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 705 "smarty_internal_configfileparser.php"
+#line 181 "smarty_internal_configfileparser.y"
+    function yy_r10(){
+    $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 710 "smarty_internal_configfileparser.php"
+#line 185 "smarty_internal_configfileparser.y"
+    function yy_r11(){
+    $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 715 "smarty_internal_configfileparser.php"
+#line 189 "smarty_internal_configfileparser.y"
+    function yy_r12(){
+    $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 720 "smarty_internal_configfileparser.php"
+#line 193 "smarty_internal_configfileparser.y"
+    function yy_r13(){
+    $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 725 "smarty_internal_configfileparser.php"
+#line 197 "smarty_internal_configfileparser.y"
+    function yy_r14(){
+    $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 730 "smarty_internal_configfileparser.php"
+#line 201 "smarty_internal_configfileparser.y"
+    function yy_r15(){
+    $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + -1]->minor);
+    }
+#line 735 "smarty_internal_configfileparser.php"
+#line 205 "smarty_internal_configfileparser.y"
+    function yy_r16(){
+    $this->_retvalue = '';
+    }
+#line 740 "smarty_internal_configfileparser.php"
+#line 209 "smarty_internal_configfileparser.y"
+    function yy_r17(){
+    $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 745 "smarty_internal_configfileparser.php"
+
+    private $_retvalue;
+
+    function yy_reduce($yyruleno)
+    {
+        $yymsp = $this->yystack[$this->yyidx];
+        if (self::$yyTraceFILE && $yyruleno >= 0
+              && $yyruleno < count(self::$yyRuleName)) {
+            fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n",
+                self::$yyTracePrompt, $yyruleno,
+                self::$yyRuleName[$yyruleno]);
+        }
+
+        $this->_retvalue = $yy_lefthand_side = null;
+        if (array_key_exists($yyruleno, self::$yyReduceMap)) {
+            // call the action
+            $this->_retvalue = null;
+            $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
+            $yy_lefthand_side = $this->_retvalue;
+        }
+        $yygoto = self::$yyRuleInfo[$yyruleno]['lhs'];
+        $yysize = self::$yyRuleInfo[$yyruleno]['rhs'];
+        $this->yyidx -= $yysize;
+        for($i = $yysize; $i; $i--) {
+            // pop all of the right-hand side parameters
+            array_pop($this->yystack);
+        }
+        $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
+        if ($yyact < self::YYNSTATE) {
+            if (!self::$yyTraceFILE && $yysize) {
+                $this->yyidx++;
+                $x = new TPC_yyStackEntry;
+                $x->stateno = $yyact;
+                $x->major = $yygoto;
+                $x->minor = $yy_lefthand_side;
+                $this->yystack[$this->yyidx] = $x;
+            } else {
+                $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
+            }
+        } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {
+            $this->yy_accept();
+        }
+    }
+
+    function yy_parse_failed()
+    {
+        if (self::$yyTraceFILE) {
+            fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt);
+        }
+        while ($this->yyidx >= 0) {
+            $this->yy_pop_parser_stack();
+        }
+    }
+
+    function yy_syntax_error($yymajor, $TOKEN)
+    {
+#line 118 "smarty_internal_configfileparser.y"
+
+    $this->internalError = true;
+    $this->yymajor = $yymajor;
+    $this->compiler->trigger_config_file_error();
+#line 808 "smarty_internal_configfileparser.php"
+    }
+
+    function yy_accept()
+    {
+        if (self::$yyTraceFILE) {
+            fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt);
+        }
+        while ($this->yyidx >= 0) {
+            $stack = $this->yy_pop_parser_stack();
+        }
+#line 110 "smarty_internal_configfileparser.y"
+
+    $this->successful = !$this->internalError;
+    $this->internalError = false;
+    $this->retvalue = $this->_retvalue;
+    //echo $this->retvalue."\n\n";
+#line 826 "smarty_internal_configfileparser.php"
+    }
+
+    function doParse($yymajor, $yytokenvalue)
+    {
+        $yyerrorhit = 0;   /* True if yymajor has invoked an error */
+
+        if ($this->yyidx === null || $this->yyidx < 0) {
+            $this->yyidx = 0;
+            $this->yyerrcnt = -1;
+            $x = new TPC_yyStackEntry;
+            $x->stateno = 0;
+            $x->major = 0;
+            $this->yystack = array();
+            array_push($this->yystack, $x);
+        }
+        $yyendofinput = ($yymajor==0);
+
+        if (self::$yyTraceFILE) {
+            fprintf(self::$yyTraceFILE, "%sInput %s\n",
+                self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
+        }
+
+        do {
+            $yyact = $this->yy_find_shift_action($yymajor);
+            if ($yymajor < self::YYERRORSYMBOL &&
+                  !$this->yy_is_expected_token($yymajor)) {
+                // force a syntax error
+                $yyact = self::YY_ERROR_ACTION;
+            }
+            if ($yyact < self::YYNSTATE) {
+                $this->yy_shift($yyact, $yymajor, $yytokenvalue);
+                $this->yyerrcnt--;
+                if ($yyendofinput && $this->yyidx >= 0) {
+                    $yymajor = 0;
+                } else {
+                    $yymajor = self::YYNOCODE;
+                }
+            } elseif ($yyact < self::YYNSTATE + self::YYNRULE) {
+                $this->yy_reduce($yyact - self::YYNSTATE);
+            } elseif ($yyact == self::YY_ERROR_ACTION) {
+                if (self::$yyTraceFILE) {
+                    fprintf(self::$yyTraceFILE, "%sSyntax Error!\n",
+                        self::$yyTracePrompt);
+                }
+                if (self::YYERRORSYMBOL) {
+                    if ($this->yyerrcnt < 0) {
+                        $this->yy_syntax_error($yymajor, $yytokenvalue);
+                    }
+                    $yymx = $this->yystack[$this->yyidx]->major;
+                    if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){
+                        if (self::$yyTraceFILE) {
+                            fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n",
+                                self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
+                        }
+                        $this->yy_destructor($yymajor, $yytokenvalue);
+                        $yymajor = self::YYNOCODE;
+                    } else {
+                        while ($this->yyidx >= 0 &&
+                                 $yymx != self::YYERRORSYMBOL &&
+        ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
+                              ){
+                            $this->yy_pop_parser_stack();
+                        }
+                        if ($this->yyidx < 0 || $yymajor==0) {
+                            $this->yy_destructor($yymajor, $yytokenvalue);
+                            $this->yy_parse_failed();
+                            $yymajor = self::YYNOCODE;
+                        } elseif ($yymx != self::YYERRORSYMBOL) {
+                            $u2 = 0;
+                            $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);
+                        }
+                    }
+                    $this->yyerrcnt = 3;
+                    $yyerrorhit = 1;
+                } else {
+                    if ($this->yyerrcnt <= 0) {
+                        $this->yy_syntax_error($yymajor, $yytokenvalue);
+                    }
+                    $this->yyerrcnt = 3;
+                    $this->yy_destructor($yymajor, $yytokenvalue);
+                    if ($yyendofinput) {
+                        $this->yy_parse_failed();
+                    }
+                    $yymajor = self::YYNOCODE;
+                }
+            } else {
+                $this->yy_accept();
+                $yymajor = self::YYNOCODE;
+            }
+        } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
+    }
+}
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_data.php b/library/Smarty/libs/sysplugins/smarty_internal_data.php
new file mode 100644 (file)
index 0000000..5baf3b7
--- /dev/null
@@ -0,0 +1,551 @@
+<?php
+/**
+ * Smarty Internal Plugin Data
+ *
+ * This file contains the basic classes and methodes for template and variable creation
+ *
+ * @package Smarty
+ * @subpackage Template
+ * @author Uwe Tews
+ */
+
+/**
+ * Base class with template and variable methodes
+ *
+ * @package Smarty
+ * @subpackage Template
+ */
+class Smarty_Internal_Data {
+
+    /**
+     * name of class used for templates
+     *
+     * @var string
+     */
+    public $template_class = 'Smarty_Internal_Template';
+    /**
+     * template variables
+     *
+     * @var array
+     */
+    public $tpl_vars = array();
+    /**
+     * parent template (if any)
+     *
+     * @var Smarty_Internal_Template
+     */
+    public $parent = null;
+    /**
+     * configuration settings
+     *
+     * @var array
+     */
+    public $config_vars = array();
+
+    /**
+     * assigns a Smarty variable
+     *
+     * @param array|string $tpl_var the template variable name(s)
+     * @param mixed        $value   the value to assign
+     * @param boolean      $nocache if true any output of this variable will be not cached
+     * @param boolean $scope the scope the variable will have  (local,parent or root)
+     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function assign($tpl_var, $value = null, $nocache = false)
+    {
+        if (is_array($tpl_var)) {
+            foreach ($tpl_var as $_key => $_val) {
+                if ($_key != '') {
+                    $this->tpl_vars[$_key] = new Smarty_variable($_val, $nocache);
+                }
+            }
+        } else {
+            if ($tpl_var != '') {
+                $this->tpl_vars[$tpl_var] = new Smarty_variable($value, $nocache);
+            }
+        }
+
+        return $this;
+    }
+
+    /**
+     * assigns a global Smarty variable
+     *
+     * @param string $varname the global variable name
+     * @param mixed  $value   the value to assign
+     * @param boolean $nocache if true any output of this variable will be not cached
+     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function assignGlobal($varname, $value = null, $nocache = false)
+    {
+        if ($varname != '') {
+            Smarty::$global_tpl_vars[$varname] = new Smarty_variable($value, $nocache);
+        }
+
+        return $this;
+    }
+    /**
+     * assigns values to template variables by reference
+     *
+     * @param string $tpl_var the template variable name
+     * @param mixed $ &$value the referenced value to assign
+     * @param boolean $nocache if true any output of this variable will be not cached
+     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function assignByRef($tpl_var, &$value, $nocache = false)
+    {
+        if ($tpl_var != '') {
+            $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache);
+            $this->tpl_vars[$tpl_var]->value = &$value;
+        }
+
+        return $this;
+    }
+
+    /**
+     * appends values to template variables
+     *
+     * @param array|string $tpl_var the template variable name(s)
+     * @param mixed        $value   the value to append
+     * @param boolean      $merge   flag if array elements shall be merged
+     * @param boolean $nocache if true any output of this variable will be not cached
+     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function append($tpl_var, $value = null, $merge = false, $nocache = false)
+    {
+        if (is_array($tpl_var)) {
+            // $tpl_var is an array, ignore $value
+            foreach ($tpl_var as $_key => $_val) {
+                if ($_key != '') {
+                    if (!isset($this->tpl_vars[$_key])) {
+                        $tpl_var_inst = $this->getVariable($_key, null, true, false);
+                        if ($tpl_var_inst instanceof Undefined_Smarty_Variable) {
+                            $this->tpl_vars[$_key] = new Smarty_variable(null, $nocache);
+                        } else {
+                            $this->tpl_vars[$_key] = clone $tpl_var_inst;
+                        }
+                    }
+                    if (!(is_array($this->tpl_vars[$_key]->value) || $this->tpl_vars[$_key]->value instanceof ArrayAccess)) {
+                        settype($this->tpl_vars[$_key]->value, 'array');
+                    }
+                    if ($merge && is_array($_val)) {
+                        foreach($_val as $_mkey => $_mval) {
+                            $this->tpl_vars[$_key]->value[$_mkey] = $_mval;
+                        }
+                    } else {
+                        $this->tpl_vars[$_key]->value[] = $_val;
+                    }
+                }
+            }
+        } else {
+            if ($tpl_var != '' && isset($value)) {
+                if (!isset($this->tpl_vars[$tpl_var])) {
+                    $tpl_var_inst = $this->getVariable($tpl_var, null, true, false);
+                    if ($tpl_var_inst instanceof Undefined_Smarty_Variable) {
+                        $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache);
+                    } else {
+                        $this->tpl_vars[$tpl_var] = clone $tpl_var_inst;
+                    }
+                }
+                if (!(is_array($this->tpl_vars[$tpl_var]->value) || $this->tpl_vars[$tpl_var]->value instanceof ArrayAccess)) {
+                    settype($this->tpl_vars[$tpl_var]->value, 'array');
+                }
+                if ($merge && is_array($value)) {
+                    foreach($value as $_mkey => $_mval) {
+                        $this->tpl_vars[$tpl_var]->value[$_mkey] = $_mval;
+                    }
+                } else {
+                    $this->tpl_vars[$tpl_var]->value[] = $value;
+                }
+            }
+        }
+
+        return $this;
+    }
+
+    /**
+     * appends values to template variables by reference
+     *
+     * @param string $tpl_var the template variable name
+     * @param mixed  &$value  the referenced value to append
+     * @param boolean $merge  flag if array elements shall be merged
+     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function appendByRef($tpl_var, &$value, $merge = false)
+    {
+        if ($tpl_var != '' && isset($value)) {
+            if (!isset($this->tpl_vars[$tpl_var])) {
+                $this->tpl_vars[$tpl_var] = new Smarty_variable();
+            }
+            if (!is_array($this->tpl_vars[$tpl_var]->value)) {
+                settype($this->tpl_vars[$tpl_var]->value, 'array');
+            }
+            if ($merge && is_array($value)) {
+                foreach($value as $_key => $_val) {
+                    $this->tpl_vars[$tpl_var]->value[$_key] = &$value[$_key];
+                }
+            } else {
+                $this->tpl_vars[$tpl_var]->value[] = &$value;
+            }
+        }
+
+        return $this;
+    }
+
+    /**
+     * Returns a single or all template variables
+     *
+     * @param string  $varname        variable name or null
+     * @param string  $_ptr           optional pointer to data object
+     * @param boolean $search_parents include parent templates?
+     * @return string variable value or or array of variables
+     */
+    public function getTemplateVars($varname = null, $_ptr = null, $search_parents = true)
+    {
+        if (isset($varname)) {
+            $_var = $this->getVariable($varname, $_ptr, $search_parents, false);
+            if (is_object($_var)) {
+                return $_var->value;
+            } else {
+                return null;
+            }
+        } else {
+            $_result = array();
+            if ($_ptr === null) {
+                $_ptr = $this;
+            } while ($_ptr !== null) {
+                foreach ($_ptr->tpl_vars AS $key => $var) {
+                    if (!array_key_exists($key, $_result)) {
+                        $_result[$key] = $var->value;
+                    }
+                }
+                // not found, try at parent
+                if ($search_parents) {
+                    $_ptr = $_ptr->parent;
+                } else {
+                    $_ptr = null;
+                }
+            }
+            if ($search_parents && isset(Smarty::$global_tpl_vars)) {
+                foreach (Smarty::$global_tpl_vars AS $key => $var) {
+                    if (!array_key_exists($key, $_result)) {
+                        $_result[$key] = $var->value;
+                    }
+                }
+            }
+            return $_result;
+        }
+    }
+
+    /**
+     * clear the given assigned template variable.
+     *
+     * @param string|array $tpl_var the template variable(s) to clear
+     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function clearAssign($tpl_var)
+    {
+        if (is_array($tpl_var)) {
+            foreach ($tpl_var as $curr_var) {
+                unset($this->tpl_vars[$curr_var]);
+            }
+        } else {
+            unset($this->tpl_vars[$tpl_var]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * clear all the assigned template variables.
+     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function clearAllAssign()
+    {
+        $this->tpl_vars = array();
+        return $this;
+    }
+
+    /**
+     * load a config file, optionally load just selected sections
+     *
+     * @param string $config_file filename
+     * @param mixed  $sections    array of section names, single section or null
+     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function configLoad($config_file, $sections = null)
+    {
+        // load Config class
+        $config = new Smarty_Internal_Config($config_file, $this->smarty, $this);
+        $config->loadConfigVars($sections);
+        return $this;
+    }
+
+    /**
+     * gets the object of a Smarty variable
+     *
+     * @param string  $variable the name of the Smarty variable
+     * @param object  $_ptr     optional pointer to data object
+     * @param boolean $search_parents search also in parent data
+     * @return object the object of the variable
+     */
+    public function getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true)
+    {
+        if ($_ptr === null) {
+            $_ptr = $this;
+        } while ($_ptr !== null) {
+            if (isset($_ptr->tpl_vars[$variable])) {
+                // found it, return it
+                return $_ptr->tpl_vars[$variable];
+            }
+            // not found, try at parent
+            if ($search_parents) {
+                $_ptr = $_ptr->parent;
+            } else {
+                $_ptr = null;
+            }
+        }
+        if (isset(Smarty::$global_tpl_vars[$variable])) {
+            // found it, return it
+            return Smarty::$global_tpl_vars[$variable];
+        }
+        if ($this->smarty->error_unassigned && $error_enable) {
+            // force a notice
+            $x = $$variable;
+        }
+        return new Undefined_Smarty_Variable;
+    }
+
+    /**
+     * gets  a config variable
+     *
+     * @param string $variable the name of the config variable
+     * @return mixed the value of the config variable
+     */
+    public function getConfigVariable($variable, $error_enable = true)
+    {
+        $_ptr = $this;
+        while ($_ptr !== null) {
+            if (isset($_ptr->config_vars[$variable])) {
+                // found it, return it
+                return $_ptr->config_vars[$variable];
+            }
+            // not found, try at parent
+            $_ptr = $_ptr->parent;
+        }
+        if ($this->smarty->error_unassigned && $error_enable) {
+            // force a notice
+            $x = $$variable;
+        }
+        return null;
+    }
+
+    /**
+     * gets  a stream variable
+     *
+     * @param string $variable the stream of the variable
+     * @return mixed the value of the stream variable
+     */
+    public function getStreamVariable($variable)
+    {
+        $_result = '';
+        $fp = fopen($variable, 'r+');
+        if ($fp) {
+            while (!feof($fp) && ($current_line = fgets($fp)) !== false ) {
+                $_result .= $current_line;
+            }
+            fclose($fp);
+            return $_result;
+        }
+
+        if ($this->smarty->error_unassigned) {
+            throw new SmartyException('Undefined stream variable "' . $variable . '"');
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Returns a single or all config variables
+     *
+     * @param string $varname variable name or null
+     * @return string variable value or or array of variables
+     */
+    public function getConfigVars($varname = null, $search_parents = true)
+    {
+        $_ptr = $this;
+        $var_array = array();
+        while ($_ptr !== null) {
+            if (isset($varname)) {
+                if (isset($_ptr->config_vars[$varname])) {
+                    return $_ptr->config_vars[$varname];
+                }
+            } else {
+                $var_array = array_merge($_ptr->config_vars, $var_array);
+            }
+             // not found, try at parent
+            if ($search_parents) {
+                $_ptr = $_ptr->parent;
+            } else {
+                $_ptr = null;
+            }
+        }
+        if (isset($varname)) {
+            return '';
+        } else {
+            return $var_array;
+        }
+    }
+
+    /**
+     * Deassigns a single or all config variables
+     *
+     * @param string $varname variable name or null
+     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function clearConfig($varname = null)
+    {
+        if (isset($varname)) {
+            unset($this->config_vars[$varname]);
+        } else {
+            $this->config_vars = array();
+        }
+        return $this;
+    }
+
+}
+
+/**
+ * class for the Smarty data object
+ *
+ * The Smarty data object will hold Smarty variables in the current scope
+ *
+ * @package Smarty
+ * @subpackage Template
+ */
+class Smarty_Data extends Smarty_Internal_Data {
+
+    /**
+     * Smarty object
+     *
+     * @var Smarty
+     */
+    public $smarty = null;
+
+    /**
+     * create Smarty data object
+     *
+     * @param Smarty|array $_parent  parent template
+     * @param Smarty       $smarty   global smarty instance
+     */
+    public function __construct ($_parent = null, $smarty = null)
+    {
+        $this->smarty = $smarty;
+        if (is_object($_parent)) {
+            // when object set up back pointer
+            $this->parent = $_parent;
+        } elseif (is_array($_parent)) {
+            // set up variable values
+            foreach ($_parent as $_key => $_val) {
+                $this->tpl_vars[$_key] = new Smarty_variable($_val);
+            }
+        } elseif ($_parent != null) {
+            throw new SmartyException("Wrong type for template variables");
+        }
+    }
+
+}
+
+/**
+ * class for the Smarty variable object
+ *
+ * This class defines the Smarty variable object
+ *
+ * @package Smarty
+ * @subpackage Template
+ */
+class Smarty_Variable {
+
+    /**
+     * template variable
+     *
+     * @var mixed
+     */
+    public $value = null;
+    /**
+     * if true any output of this variable will be not cached
+     *
+     * @var boolean
+     */
+    public $nocache = false;
+    /**
+     * the scope the variable will have  (local,parent or root)
+     *
+     * @var int
+     */
+    public $scope = Smarty::SCOPE_LOCAL;
+
+    /**
+     * create Smarty variable object
+     *
+     * @param mixed   $value   the value to assign
+     * @param boolean $nocache if true any output of this variable will be not cached
+     * @param int     $scope   the scope the variable will have  (local,parent or root)
+     */
+    public function __construct($value = null, $nocache = false, $scope = Smarty::SCOPE_LOCAL)
+    {
+        $this->value = $value;
+        $this->nocache = $nocache;
+        $this->scope = $scope;
+    }
+
+    /**
+     * <<magic>> String conversion
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return (string) $this->value;
+    }
+
+}
+
+/**
+ * class for undefined variable object
+ *
+ * This class defines an object for undefined variable handling
+ *
+ * @package Smarty
+ * @subpackage Template
+ */
+class Undefined_Smarty_Variable {
+
+    /**
+     * Returns FALSE for 'nocache' and NULL otherwise.
+     *
+     * @param string $name
+     * @return bool
+     */
+    public function __get($name)
+    {
+        if ($name == 'nocache') {
+            return false;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Always returns an empty string.
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return "";
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_debug.php b/library/Smarty/libs/sysplugins/smarty_internal_debug.php
new file mode 100644 (file)
index 0000000..2aea13f
--- /dev/null
@@ -0,0 +1,206 @@
+<?php
+/**
+ * Smarty Internal Plugin Debug
+ *
+ * Class to collect data for the Smarty Debugging Consol
+ *
+ * @package Smarty
+ * @subpackage Debug
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Debug Class
+ *
+ * @package Smarty
+ * @subpackage Debug
+ */
+class Smarty_Internal_Debug extends Smarty_Internal_Data {
+
+    /**
+     * template data
+     *
+     * @var array
+     */
+    public static $template_data = array();
+
+    /**
+     * Start logging of compile time
+     *
+     * @param object $template
+     */
+    public static function start_compile($template)
+    {
+        $key = self::get_key($template);
+        self::$template_data[$key]['start_time'] = microtime(true);
+    }
+
+    /**
+     * End logging of compile time
+     *
+     * @param object $template
+     */
+    public static function end_compile($template)
+    {
+        $key = self::get_key($template);
+        self::$template_data[$key]['compile_time'] += microtime(true) - self::$template_data[$key]['start_time'];
+    }
+
+    /**
+     * Start logging of render time
+     *
+     * @param object $template
+     */
+    public static function start_render($template)
+    {
+        $key = self::get_key($template);
+        self::$template_data[$key]['start_time'] = microtime(true);
+    }
+
+    /**
+     * End logging of compile time
+     *
+     * @param object $template
+     */
+    public static function end_render($template)
+    {
+        $key = self::get_key($template);
+        self::$template_data[$key]['render_time'] += microtime(true) - self::$template_data[$key]['start_time'];
+    }
+
+    /**
+     * Start logging of cache time
+     *
+     * @param object $template cached template
+     */
+    public static function start_cache($template)
+    {
+        $key = self::get_key($template);
+        self::$template_data[$key]['start_time'] = microtime(true);
+    }
+
+    /**
+     * End logging of cache time
+     *
+     * @param object $template cached template
+     */
+    public static function end_cache($template)
+    {
+        $key = self::get_key($template);
+        self::$template_data[$key]['cache_time'] += microtime(true) - self::$template_data[$key]['start_time'];
+    }
+
+    /**
+     * Opens a window for the Smarty Debugging Consol and display the data
+     *
+     * @param Smarty_Internal_Template|Smarty $obj object to debug
+     */
+    public static function display_debug($obj)
+    {
+        // prepare information of assigned variables
+        $ptr = self::get_debug_vars($obj);
+        if ($obj instanceof Smarty) {
+            $smarty = clone $obj;
+        } else {
+            $smarty = clone $obj->smarty;
+        }
+        $_assigned_vars = $ptr->tpl_vars;
+        ksort($_assigned_vars);
+        $_config_vars = $ptr->config_vars;
+        ksort($_config_vars);
+        $smarty->registered_filters = array();
+        $smarty->autoload_filters = array();
+        $smarty->default_modifiers = array();
+        $smarty->force_compile = false;
+        $smarty->left_delimiter = '{';
+        $smarty->right_delimiter = '}';
+        $smarty->debugging = false;
+        $smarty->force_compile = false;
+        $_template = new Smarty_Internal_Template($smarty->debug_tpl, $smarty);
+        $_template->caching = false;
+        $_template->disableSecurity();
+        $_template->cache_id = null;
+        $_template->compile_id = null;
+        if ($obj instanceof Smarty_Internal_Template) {
+            $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);
+        }
+        if ($obj instanceof Smarty) {
+            $_template->assign('template_data', self::$template_data);
+        } else {
+            $_template->assign('template_data', null);
+        }
+        $_template->assign('assigned_vars', $_assigned_vars);
+        $_template->assign('config_vars', $_config_vars);
+        $_template->assign('execution_time', microtime(true) - $smarty->start_time);
+        echo $_template->fetch();
+    }
+
+    /**
+     * Recursively gets variables from all template/data scopes
+     *
+     * @param Smarty_Internal_Template|Smarty_Data $obj object to debug
+     * @return StdClass
+     */
+    public static function get_debug_vars($obj)
+    {
+        $config_vars = $obj->config_vars;
+        $tpl_vars = array();
+        foreach ($obj->tpl_vars as $key => $var) {
+            $tpl_vars[$key] = clone $var;
+            if ($obj instanceof Smarty_Internal_Template) {
+                $tpl_vars[$key]->scope = $obj->source->type . ':' . $obj->source->name;
+            } elseif ($obj instanceof Smarty_Data) {
+                $tpl_vars[$key]->scope = 'Data object';
+            } else {
+                $tpl_vars[$key]->scope = 'Smarty root';
+            }
+        }
+
+        if (isset($obj->parent)) {
+            $parent = self::get_debug_vars($obj->parent);
+            $tpl_vars = array_merge($parent->tpl_vars, $tpl_vars);
+            $config_vars = array_merge($parent->config_vars, $config_vars);
+        } else {
+            foreach (Smarty::$global_tpl_vars as $name => $var) {
+                if (!array_key_exists($name, $tpl_vars)) {
+                    $clone = clone $var;
+                    $clone->scope = 'Global';
+                    $tpl_vars[$name] = $clone;
+                }
+            }
+        }
+        return (object) array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars);
+    }
+
+    /**
+     * Return key into $template_data for template
+     *
+     * @param object $template  template object
+     * @return string   key into $template_data
+     */
+    private static function get_key($template)
+    {
+        static $_is_stringy = array('string' => true, 'eval' => true);
+        // calculate Uid if not already done
+        if ($template->source->uid == '') {
+            $template->source->filepath;
+        }
+        $key = $template->source->uid;
+        if (isset(self::$template_data[$key])) {
+            return $key;
+        } else {
+            if (isset($_is_stringy[$template->source->type])) {
+                self::$template_data[$key]['name'] = '\''.substr($template->source->name,0,25).'...\'';
+            } else {
+                self::$template_data[$key]['name'] = $template->source->filepath;
+            }
+            self::$template_data[$key]['compile_time'] = 0;
+            self::$template_data[$key]['render_time'] = 0;
+            self::$template_data[$key]['cache_time'] = 0;
+            return $key;
+        }
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_filter_handler.php b/library/Smarty/libs/sysplugins/smarty_internal_filter_handler.php
new file mode 100644 (file)
index 0000000..c9370e1
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Smarty Internal Plugin Filter Handler
+ *
+ * Smarty filter handler class
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @author Uwe Tews
+ */
+
+/**
+ * Class for filter processing
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ */
+class Smarty_Internal_Filter_Handler {
+
+    /**
+     * Run filters over content
+     *
+     * The filters will be lazy loaded if required
+     * class name format: Smarty_FilterType_FilterName
+     * plugin filename format: filtertype.filtername.php
+     * Smarty2 filter plugins could be used
+     *
+     * @param string                   $type     the type of filter ('pre','post','output') which shall run
+     * @param string                   $content  the content which shall be processed by the filters
+     * @param Smarty_Internal_Template $template template object
+     * @return string the filtered content
+     */
+    public static function runFilter($type, $content, Smarty_Internal_Template $template)
+    {
+        $output = $content;
+        // loop over autoload filters of specified type
+        if (!empty($template->smarty->autoload_filters[$type])) {
+            foreach ((array)$template->smarty->autoload_filters[$type] as $name) {
+                $plugin_name = "Smarty_{$type}filter_{$name}";
+                if ($template->smarty->loadPlugin($plugin_name)) {
+                    if (function_exists($plugin_name)) {
+                        // use loaded Smarty2 style plugin
+                        $output = $plugin_name($output, $template);
+                    } elseif (class_exists($plugin_name, false)) {
+                        // loaded class of filter plugin
+                        $output = call_user_func(array($plugin_name, 'execute'), $output, $template);
+                    }
+                } else {
+                    // nothing found, throw exception
+                    throw new SmartyException("Unable to load filter {$plugin_name}");
+                }
+            }
+        }
+        // loop over registerd filters of specified type
+        if (!empty($template->smarty->registered_filters[$type])) {
+            foreach ($template->smarty->registered_filters[$type] as $key => $name) {
+                if (is_array($template->smarty->registered_filters[$type][$key])) {
+                    $output = call_user_func($template->smarty->registered_filters[$type][$key], $output, $template);
+                } else {
+                    $output = $template->smarty->registered_filters[$type][$key]($output, $template);
+                }
+            }
+        }
+        // return filtered output
+        return $output;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_function_call_handler.php b/library/Smarty/libs/sysplugins/smarty_internal_function_call_handler.php
new file mode 100644 (file)
index 0000000..010d635
--- /dev/null
@@ -0,0 +1,55 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Function Call Handler\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsInternal\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * This class does call function defined with the {function} tag\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsInternal\r
+ */\r
+class Smarty_Internal_Function_Call_Handler {\r
+\r
+    /**\r
+     * This function handles calls to template functions defined by {function}\r
+     * It does create a PHP function at the first call\r
+     *\r
+     * @param string                   $_name       template function name\r
+     * @param Smarty_Internal_Template $_template   template object\r
+     * @param array                    $_params     Smarty variables passed as call parameter\r
+     * @param string                   $_hash       nocache hash value\r
+     * @param bool                     $_nocache    nocache flag\r
+     */\r
+    public static function call($_name, Smarty_Internal_Template $_template, $_params, $_hash, $_nocache)\r
+    {\r
+        if ($_nocache) {\r
+            $_function = "smarty_template_function_{$_name}_nocache";\r
+        } else {\r
+            $_function = "smarty_template_function_{$_hash}_{$_name}";\r
+        }\r
+        if (!is_callable($_function)) {\r
+            $_code = "function {$_function}(\$_smarty_tpl,\$params) {\r
+    \$saved_tpl_vars = \$_smarty_tpl->tpl_vars;\r
+    foreach (\$_smarty_tpl->smarty->template_functions['{$_name}']['parameter'] as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);};\r
+    foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";\r
+            if ($_nocache) {\r
+                $_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!",\r
+                        "!\\\'!"), array('', "'"), $_template->smarty->template_functions[$_name]['compiled']);\r
+                $_template->smarty->template_functions[$_name]['called_nocache'] = true;\r
+            } else {\r
+                $_code .= preg_replace("/{$_template->smarty->template_functions[$_name]['nocache_hash']}/", $_template->properties['nocache_hash'], $_template->smarty->template_functions[$_name]['compiled']);\r
+            }\r
+            $_code .= "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;}";\r
+            eval($_code);\r
+        }\r
+        $_function($_template, $_params);\r
+    }\r
+\r
+}\r
+\r
+?>\r
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_get_include_path.php b/library/Smarty/libs/sysplugins/smarty_internal_get_include_path.php
new file mode 100644 (file)
index 0000000..518c406
--- /dev/null
@@ -0,0 +1,48 @@
+<?php\r
+/**\r
+ * Smarty read include path plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsInternal\r
+ * @author Monte Ohrt\r
+ */\r
+\r
+/**\r
+ * Smarty Internal Read Include Path Class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsInternal\r
+ */\r
+class Smarty_Internal_Get_Include_Path {\r
+\r
+    /**\r
+     * Return full file path from PHP include_path\r
+     *\r
+     * @param string $filepath filepath\r
+     * @return string|boolean full filepath or false\r
+     */\r
+    public static function getIncludePath($filepath)\r
+    {\r
+        static $_include_path = null;\r
+        \r
+        if (function_exists('stream_resolve_include_path')) {\r
+            // available since PHP 5.3.2\r
+            return stream_resolve_include_path($filepath);\r
+        }\r
+\r
+        if ($_include_path === null) {\r
+            $_include_path = explode(PATH_SEPARATOR, get_include_path());\r
+        }\r
+\r
+        foreach ($_include_path as $_path) {\r
+            if (file_exists($_path . DS . $filepath)) {\r
+                return $_path . DS . $filepath;\r
+            }\r
+        }\r
+\r
+        return false;\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_nocache_insert.php b/library/Smarty/libs/sysplugins/smarty_internal_nocache_insert.php
new file mode 100644 (file)
index 0000000..faae49a
--- /dev/null
@@ -0,0 +1,53 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Nocache Insert\r
+ *\r
+ * Compiles the {insert} tag into the cache file\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Insert Class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ */\r
+class Smarty_Internal_Nocache_Insert {\r
+\r
+    /**\r
+     * Compiles code for the {insert} tag into cache file\r
+     *\r
+     * @param string                   $_function insert function name\r
+     * @param array                    $_attr     array with parameter\r
+     * @param Smarty_Internal_Template $_template template object\r
+     * @param string                   $_script   script name to load or 'null'\r
+     * @param string                   $_assign   optional variable name\r
+     * @return string compiled code\r
+     */\r
+    public static function compile($_function, $_attr, $_template, $_script, $_assign = null)\r
+    {\r
+        $_output = '<?php ';\r
+        if ($_script != 'null') {\r
+            // script which must be included\r
+            // code for script file loading\r
+            $_output .= "require_once '{$_script}';";\r
+        }\r
+        // call insert\r
+        if (isset($_assign)) {\r
+            $_output .= "\$_smarty_tpl->assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl), true);?>";\r
+        } else {\r
+            $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>";\r
+        }\r
+        $_tpl = $_template;\r
+        while ($_tpl->parent instanceof Smarty_Internal_Template) {\r
+            $_tpl = $_tpl->parent;\r
+        }\r
+        return "/*%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/";\r
+    }\r
+\r
+}\r
+\r
+?>\r
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_parsetree.php b/library/Smarty/libs/sysplugins/smarty_internal_parsetree.php
new file mode 100644 (file)
index 0000000..c9fb1f7
--- /dev/null
@@ -0,0 +1,395 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Templateparser Parsetrees\r
+ *\r
+ * These are classes to build parsetrees in the template parser\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Thue Kristensen\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @ignore\r
+ */\r
+abstract class _smarty_parsetree {\r
+\r
+    /**\r
+     * Parser object\r
+     * @var object\r
+     */\r
+    public $parser;\r
+    /**\r
+     * Buffer content\r
+     * @var mixed\r
+     */\r
+    public $data;\r
+\r
+    /**\r
+     * Return buffer\r
+     *\r
+     * @return string  buffer content\r
+     */\r
+    abstract public function to_smarty_php();\r
+\r
+}\r
+\r
+/**\r
+ * A complete smarty tag.\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @ignore\r
+ */\r
+class _smarty_tag extends _smarty_parsetree {\r
+\r
+    /**\r
+     * Saved block nesting level\r
+     * @var int\r
+     */\r
+    public $saved_block_nesting;\r
+\r
+    /**\r
+     * Create parse tree buffer for Smarty tag\r
+     *\r
+     * @param object $parser    parser object\r
+     * @param string $data      content\r
+     */\r
+    public function __construct($parser, $data)\r
+    {\r
+        $this->parser = $parser;\r
+        $this->data = $data;\r
+        $this->saved_block_nesting = $parser->block_nesting_level;\r
+    }\r
+\r
+    /**\r
+     * Return buffer content\r
+     *\r
+     * @return string  content\r
+     */\r
+    public function to_smarty_php()\r
+    {\r
+        return $this->data;\r
+    }\r
+\r
+    /**\r
+     * Return complied code that loads the evaluated outout of buffer content into a temporary variable\r
+     *\r
+     * @return string template code\r
+     */\r
+    public function assign_to_var()\r
+    {\r
+        $var = sprintf('$_tmp%d', ++$this->parser->prefix_number);\r
+        $this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>', $this->data, $var);\r
+        return $var;\r
+    }\r
+\r
+}\r
+\r
+/**\r
+ * Code fragment inside a tag.\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @ignore\r
+ */\r
+class _smarty_code extends _smarty_parsetree {\r
+\r
+\r
+    /**\r
+     * Create parse tree buffer for code fragment\r
+     *\r
+     * @param object $parser    parser object\r
+     * @param string $data      content\r
+     */\r
+    public function __construct($parser, $data)\r
+    {\r
+        $this->parser = $parser;\r
+        $this->data = $data;\r
+    }\r
+\r
+    /**\r
+     * Return buffer content in parentheses\r
+     *\r
+     * @return string  content\r
+     */\r
+    public function to_smarty_php()\r
+    {\r
+        return sprintf("(%s)", $this->data);\r
+    }\r
+\r
+}\r
+\r
+/**\r
+ * Double quoted string inside a tag.\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @ignore\r
+ */\r
+class _smarty_doublequoted extends _smarty_parsetree {\r
+\r
+    /**\r
+     * Create parse tree buffer for double quoted string subtrees\r
+     *\r
+     * @param object $parser    parser object\r
+     * @param _smarty_parsetree $subtree    parsetree buffer\r
+     */\r
+    public function __construct($parser, _smarty_parsetree $subtree)\r
+    {\r
+        $this->parser = $parser;\r
+        $this->subtrees[] = $subtree;\r
+        if ($subtree instanceof _smarty_tag) {\r
+            $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Append buffer to subtree\r
+     *\r
+     * @param _smarty_parsetree $subtree  parsetree buffer\r
+     */\r
+    public function append_subtree(_smarty_parsetree $subtree)\r
+    {\r
+        $last_subtree = count($this->subtrees) - 1;\r
+        if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {\r
+            if ($subtree instanceof _smarty_code) {\r
+                $this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';\r
+            } elseif ($subtree instanceof _smarty_dq_content) {\r
+                $this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';\r
+            } else {\r
+                $this->subtrees[$last_subtree]->data .= $subtree->data;\r
+            }\r
+        } else {\r
+            $this->subtrees[] = $subtree;\r
+        }\r
+        if ($subtree instanceof _smarty_tag) {\r
+            $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Merge subtree buffer content together\r
+     *\r
+     * @return string  compiled template code\r
+     */\r
+    public function to_smarty_php()\r
+    {\r
+        $code = '';\r
+        foreach ($this->subtrees as $subtree) {\r
+            if ($code !== "") {\r
+                $code .= ".";\r
+            }\r
+            if ($subtree instanceof _smarty_tag) {\r
+                $more_php = $subtree->assign_to_var();\r
+            } else {\r
+                $more_php = $subtree->to_smarty_php();\r
+            }\r
+\r
+            $code .= $more_php;\r
+\r
+            if (!$subtree instanceof _smarty_dq_content) {\r
+                $this->parser->compiler->has_variable_string = true;\r
+            }\r
+        }\r
+        return $code;\r
+    }\r
+\r
+}\r
+\r
+/**\r
+ * Raw chars as part of a double quoted string.\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @ignore\r
+ */\r
+class _smarty_dq_content extends _smarty_parsetree {\r
+\r
+\r
+    /**\r
+     * Create parse tree buffer with string content\r
+     *\r
+     * @param object $parser  parser object\r
+     * @param string $data    string section\r
+     */\r
+    public function __construct($parser, $data)\r
+    {\r
+        $this->parser = $parser;\r
+        $this->data = $data;\r
+    }\r
+\r
+    /**\r
+     * Return content as double quoted string\r
+     *\r
+     * @return string doubled quoted string\r
+     */\r
+    public function to_smarty_php()\r
+    {\r
+        return '"' . $this->data . '"';\r
+    }\r
+\r
+}\r
+\r
+/**\r
+ * Template element\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @ignore\r
+ */\r
+class _smarty_template_buffer extends _smarty_parsetree {\r
+\r
+    /**\r
+     * Array of template elements\r
+     *\r
+     * @var array\r
+     */\r
+    public $subtrees = Array();\r
+\r
+    /**\r
+     * Create root of parse tree for template elements\r
+     *\r
+     * @param object $parser    parse object\r
+     */\r
+    public function __construct($parser)\r
+    {\r
+        $this->parser = $parser;\r
+    }\r
+\r
+    /**\r
+     * Append buffer to subtree\r
+     *\r
+     * @param _smarty_parsetree $subtree\r
+     */\r
+    public function append_subtree(_smarty_parsetree $subtree)\r
+    {\r
+        $this->subtrees[] = $subtree;\r
+    }\r
+\r
+    /**\r
+     * Sanitize and merge subtree buffers together\r
+     *\r
+     * @return string template code content\r
+     */\r
+    public function to_smarty_php()\r
+    {\r
+        $code = '';\r
+        for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {\r
+            if ($key + 2 < $cnt) {\r
+                if ($this->subtrees[$key] instanceof _smarty_linebreak && $this->subtrees[$key + 1] instanceof _smarty_tag && $this->subtrees[$key + 1]->data == '' && $this->subtrees[$key + 2] instanceof _smarty_linebreak) {\r
+                    $key = $key + 1;\r
+                    continue;\r
+                }\r
+                if (substr($this->subtrees[$key]->data, -1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, -1) == '?') {\r
+                    $key = $key + 2;\r
+                    continue;\r
+                }\r
+            }\r
+            if (substr($code, -1) == '<') {\r
+                $subtree = $this->subtrees[$key]->to_smarty_php();\r
+                if (substr($subtree, 0, 1) == '?') {\r
+                    $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>?' . substr($subtree, 1);\r
+                } elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {\r
+                    $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>%' . substr($subtree, 1);\r
+                } else {\r
+                    $code .= $subtree;\r
+                }\r
+                continue;\r
+            }\r
+            if ($this->parser->asp_tags && substr($code, -1) == '%') {\r
+                $subtree = $this->subtrees[$key]->to_smarty_php();\r
+                if (substr($subtree, 0, 1) == '>') {\r
+                    $code = substr($code, 0, strlen($code) - 1) . '%<?php ?>>' . substr($subtree, 1);\r
+                } else {\r
+                    $code .= $subtree;\r
+                }\r
+                continue;\r
+            }\r
+            if (substr($code, -1) == '?') {\r
+                $subtree = $this->subtrees[$key]->to_smarty_php();\r
+                if (substr($subtree, 0, 1) == '>') {\r
+                    $code = substr($code, 0, strlen($code) - 1) . '?<?php ?>>' . substr($subtree, 1);\r
+                } else {\r
+                    $code .= $subtree;\r
+                }\r
+                continue;\r
+            }\r
+            $code .= $this->subtrees[$key]->to_smarty_php();\r
+        }\r
+        return $code;\r
+    }\r
+\r
+}\r
+\r
+/**\r
+ * template text\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @ignore\r
+ */\r
+class _smarty_text extends _smarty_parsetree {\r
+\r
+\r
+    /**\r
+     * Create template text buffer\r
+     *\r
+     * @param object $parser    parser object\r
+     * @param string $data      text\r
+     */\r
+    public function __construct($parser, $data)\r
+    {\r
+        $this->parser = $parser;\r
+        $this->data = $data;\r
+    }\r
+\r
+    /**\r
+     * Return buffer content\r
+     *\r
+     * @return strint text\r
+     */\r
+    public function to_smarty_php()\r
+    {\r
+        return $this->data;\r
+    }\r
+\r
+}\r
+\r
+/**\r
+ * template linebreaks\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @ignore\r
+ */\r
+class _smarty_linebreak extends _smarty_parsetree {\r
+\r
+    /**\r
+     * Create buffer with linebreak content\r
+     *\r
+     * @param object $parser    parser object\r
+     * @param string  $data     linebreak string\r
+     */\r
+    public function __construct($parser, $data)\r
+    {\r
+        $this->parser = $parser;\r
+        $this->data = $data;\r
+    }\r
+\r
+    /**\r
+     * Return linebrak\r
+     *\r
+     * @return string linebreak\r
+     */\r
+    public function to_smarty_php()\r
+    {\r
+        return $this->data;\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_resource_eval.php b/library/Smarty/libs/sysplugins/smarty_internal_resource_eval.php
new file mode 100644 (file)
index 0000000..cf2ec3e
--- /dev/null
@@ -0,0 +1,94 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Resource Eval\r
+ *\r
+ * @package Smarty\r
+ * @subpackage TemplateResources\r
+ * @author Uwe Tews\r
+ * @author Rodney Rehm\r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Resource Eval\r
+ *\r
+ * Implements the strings as resource for Smarty template\r
+ *\r
+ * {@internal unlike string-resources the compiled state of eval-resources is NOT saved for subsequent access}}\r
+ *\r
+ * @package Smarty\r
+ * @subpackage TemplateResources\r
+ */\r
+class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled {\r
+\r
+    /**\r
+     * populate Source Object with meta data from Resource\r
+     *\r
+     * @param Smarty_Template_Source   $source    source object\r
+     * @param Smarty_Internal_Template $_template template object\r
+     * @return void\r
+     */\r
+    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)\r
+    {\r
+        $source->uid = $source->filepath = sha1($source->name);\r
+        $source->timestamp = false;\r
+        $source->exists = true;\r
+    }\r
+\r
+    /**\r
+     * Load template's source from $resource_name into current template object\r
+     *\r
+     * @uses decode() to decode base64 and urlencoded template_resources\r
+     * @param Smarty_Template_Source $source source object\r
+     * @return string template source\r
+     */\r
+    public function getContent(Smarty_Template_Source $source)\r
+    {\r
+        return $this->decode($source->name);\r
+    }\r
+    \r
+    /**\r
+     * decode base64 and urlencode\r
+     *\r
+     * @param string $string template_resource to decode\r
+     * @return string decoded template_resource\r
+     */\r
+    protected function decode($string)\r
+    {\r
+        // decode if specified\r
+        if (($pos = strpos($string, ':')) !== false) {\r
+            if (!strncmp($string, 'base64', 6)) {\r
+                return base64_decode(substr($string, 7));\r
+            } elseif (!strncmp($string, 'urlencode', 9)) {\r
+                return urldecode(substr($string, 10));\r
+            }\r
+        }\r
+        \r
+        return $string;\r
+    }\r
+    \r
+    /**\r
+     * modify resource_name according to resource handlers specifications\r
+     *\r
+     * @param Smarty $smarty        Smarty instance\r
+     * @param string $resource_name resource_name to make unique\r
+     * @return string unique resource name\r
+     */\r
+    protected function buildUniqueResourceName(Smarty $smarty, $resource_name)\r
+    {\r
+        return get_class($this) . '#' .$this->decode($resource_name);\r
+    }\r
+\r
+    /**\r
+     * Determine basename for compiled filename\r
+     *\r
+     * @param Smarty_Template_Source $source source object\r
+     * @return string resource's basename\r
+     */\r
+    protected function getBasename(Smarty_Template_Source $source)\r
+    {\r
+        return '';\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_resource_extends.php b/library/Smarty/libs/sysplugins/smarty_internal_resource_extends.php
new file mode 100644 (file)
index 0000000..9481d99
--- /dev/null
@@ -0,0 +1,157 @@
+<?php
+/**
+* Smarty Internal Plugin Resource Extends
+*
+* @package Smarty
+* @subpackage TemplateResources
+* @author Uwe Tews
+* @author Rodney Rehm
+*/
+
+/**
+* Smarty Internal Plugin Resource Extends
+*
+* Implements the file system as resource for Smarty which {extend}s a chain of template files templates
+*
+* @package Smarty
+* @subpackage TemplateResources
+*/
+class Smarty_Internal_Resource_Extends extends Smarty_Resource {
+
+    /**
+    * mbstring.overload flag
+    *
+    * @var int
+    */
+    public $mbstring_overload = 0;
+
+    /**
+    * populate Source Object with meta data from Resource
+    *
+    * @param Smarty_Template_Source   $source    source object
+    * @param Smarty_Internal_Template $_template template object
+    */
+    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+    {
+        $uid = '';
+        $sources = array();
+        $components = explode('|', $source->name);
+        $exists = true;
+        foreach ($components as $component) {
+            $s = Smarty_Resource::source(null, $source->smarty, $component);
+            if ($s->type == 'php') {
+                throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type");
+            }
+            $sources[$s->uid] = $s;
+            $uid .= $s->filepath;
+            if ($_template && $_template->smarty->compile_check) {
+                $exists = $exists && $s->exists;
+            }
+        }
+        $source->components = $sources;
+        $source->filepath = $s->filepath;
+        $source->uid = sha1($uid);
+        if ($_template && $_template->smarty->compile_check) {
+            $source->timestamp = $s->timestamp;
+            $source->exists = $exists;
+        }
+        // need the template at getContent()
+        $source->template = $_template;
+    }
+
+    /**
+    * populate Source Object with timestamp and exists from Resource
+    *
+    * @param Smarty_Template_Source $source source object
+    */
+    public function populateTimestamp(Smarty_Template_Source $source)
+    {
+        $source->exists = true;
+        foreach ($source->components as $s) {
+            $source->exists = $source->exists && $s->exists;
+        }
+        $source->timestamp = $s->timestamp;
+    }
+
+    /**
+    * Load template's source from files into current template object
+    *
+    * @param Smarty_Template_Source $source source object
+    * @return string template source
+    * @throws SmartyException if source cannot be loaded
+    */
+    public function getContent(Smarty_Template_Source $source)
+    {
+        if (!$source->exists) {
+            throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
+        }
+
+        $this->mbstring_overload = ini_get('mbstring.func_overload') & 2;
+        $_rdl = preg_quote($source->smarty->right_delimiter);
+        $_ldl = preg_quote($source->smarty->left_delimiter);
+        $_components = array_reverse($source->components);
+        $_first = reset($_components);
+        $_last = end($_components);
+
+        foreach ($_components as $_component) {
+            // register dependency
+            if ($_component != $_first) {
+                $source->template->properties['file_dependency'][$_component->uid] = array($_component->filepath, $_component->timestamp, $_component->type);
+            }
+
+            // read content
+            $source->filepath = $_component->filepath;
+            $_content = $_component->content;
+
+            // extend sources
+            if ($_component != $_last) {
+                if (preg_match_all("!({$_ldl}block\s(.+?){$_rdl})!", $_content, $_open) !=
+                preg_match_all("!({$_ldl}/block{$_rdl})!", $_content, $_close)) {
+                    throw new SmartyException("unmatched {block} {/block} pairs in template {$_component->type} '{$_component->name}'");
+                }
+                preg_match_all("!{$_ldl}block\s(.+?){$_rdl}|{$_ldl}/block{$_rdl}|{$_ldl}\*([\S\s]*?)\*{$_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE);
+                $_result_count = count($_result[0]);
+                $_start = 0;
+                while ($_start+1 < $_result_count) {
+                    $_end = 0;
+                    $_level = 1;
+                    if (($this->mbstring_overload ? mb_substr($_result[0][$_start][0],0,mb_strlen($source->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start][0],0,strlen($source->smarty->left_delimiter)+1)) == $source->smarty->left_delimiter.'*') {
+                        $_start++;
+                        continue;
+                    }
+                    while ($_level != 0) {
+                        $_end++;
+                        if (($this->mbstring_overload ? mb_substr($_result[0][$_start + $_end][0],0,mb_strlen($source->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start + $_end][0],0,strlen($source->smarty->left_delimiter)+1)) == $source->smarty->left_delimiter.'*') {
+                            continue;
+                        }
+                        if (!strpos($_result[0][$_start + $_end][0], '/')) {
+                            $_level++;
+                        } else {
+                            $_level--;
+                        }
+                    }
+                    $_block_content = str_replace($source->smarty->left_delimiter . '$smarty.block.parent' . $source->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%',
+                    ($this->mbstring_overload ? mb_substr($_content, $_result[0][$_start][1] + mb_strlen($_result[0][$_start][0], 'latin1'), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + mb_strlen($_result[0][$_start][0], 'latin1'), 'latin1') : substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0]))));
+                    Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $source->template, $_component->filepath);
+                    $_start = $_start + $_end + 1;
+                }
+            } else {
+                return $_content;
+            }
+        }
+    }
+
+    /**
+    * Determine basename for compiled filename
+    *
+    * @param Smarty_Template_Source $source source object
+    * @return string resource's basename
+    */
+    public function getBasename(Smarty_Template_Source $source)
+    {
+        return str_replace(':', '.', basename($source->filepath));
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_resource_file.php b/library/Smarty/libs/sysplugins/smarty_internal_resource_file.php
new file mode 100644 (file)
index 0000000..48b391d
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/**
+ * Smarty Internal Plugin Resource File
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Internal Plugin Resource File
+ *
+ * Implements the file system as resource for Smarty templates
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+class Smarty_Internal_Resource_File extends Smarty_Resource {
+
+    /**
+     * populate Source Object with meta data from Resource
+     *
+     * @param Smarty_Template_Source   $source    source object
+     * @param Smarty_Internal_Template $_template template object
+     */
+    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+    {
+        $source->filepath = $this->buildFilepath($source, $_template);
+
+        if ($source->filepath !== false) {
+            if (is_object($source->smarty->security_policy)) {
+                $source->smarty->security_policy->isTrustedResourceDir($source->filepath);
+            }
+
+            $source->uid = sha1($source->filepath);
+            if ($source->smarty->compile_check && !isset($source->timestamp)) {
+                $source->timestamp = @filemtime($source->filepath);
+                $source->exists = !!$source->timestamp;
+            }
+        }
+    }
+
+    /**
+     * populate Source Object with timestamp and exists from Resource
+     *
+     * @param Smarty_Template_Source $source source object
+     */
+    public function populateTimestamp(Smarty_Template_Source $source)
+    {
+        $source->timestamp = @filemtime($source->filepath);
+        $source->exists = !!$source->timestamp;
+    }
+
+    /**
+     * Load template's source from file into current template object
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string template source
+     * @throws SmartyException if source cannot be loaded
+     */
+    public function getContent(Smarty_Template_Source $source)
+    {
+        if ($source->timestamp) {
+            return file_get_contents($source->filepath);
+        }
+        if ($source instanceof Smarty_Config_Source) {
+            throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
+        }
+        throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
+    }
+
+    /**
+     * Determine basename for compiled filename
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string resource's basename
+     */
+    public function getBasename(Smarty_Template_Source $source)
+    {
+        $_file = $source->name;
+        if (($_pos = strpos($_file, ']')) !== false) {
+            $_file = substr($_file, $_pos + 1);
+        }
+        return basename($_file);
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_resource_php.php b/library/Smarty/libs/sysplugins/smarty_internal_resource_php.php
new file mode 100644 (file)
index 0000000..7cd8bae
--- /dev/null
@@ -0,0 +1,114 @@
+<?php
+
+/**
+ * Smarty Internal Plugin Resource PHP
+ *
+ * Implements the file system as resource for PHP templates
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ */
+class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled {
+    /**
+     * container for short_open_tag directive's value before executing PHP templates
+     * @var string
+     */
+    protected $short_open_tag;
+
+    /**
+     * Create a new PHP Resource
+     *
+     */
+    public function __construct()
+    {
+        $this->short_open_tag = ini_get( 'short_open_tag' );
+    }
+
+    /**
+     * populate Source Object with meta data from Resource
+     *
+     * @param Smarty_Template_Source $source source object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     */
+    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+    {
+        $source->filepath = $this->buildFilepath($source, $_template);
+
+        if ($source->filepath !== false) {
+            if (is_object($source->smarty->security_policy)) {
+                $source->smarty->security_policy->isTrustedResourceDir($source->filepath);
+            }
+
+            $source->uid = sha1($source->filepath);
+            if ($source->smarty->compile_check) {
+                $source->timestamp = @filemtime($source->filepath);
+                $source->exists = !!$source->timestamp;
+            }
+        }
+    }
+
+    /**
+     * populate Source Object with timestamp and exists from Resource
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return void
+     */
+    public function populateTimestamp(Smarty_Template_Source $source)
+    {
+        $source->timestamp = @filemtime($source->filepath);
+        $source->exists = !!$source->timestamp;
+    }
+
+    /**
+     * Load template's source from file into current template object
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string template source
+     * @throws SmartyException if source cannot be loaded
+     */
+    public function getContent(Smarty_Template_Source $source)
+    {
+        if ($source->timestamp) {
+            return '';
+        }
+        throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
+    }
+
+    /**
+     * Render and output the template (without using the compiler)
+     *
+     * @param Smarty_Template_Source $source source object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     * @throws SmartyException if template cannot be loaded or allow_php_templates is disabled
+     */
+    public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template)
+    {
+        $_smarty_template = $_template;
+
+        if (!$source->smarty->allow_php_templates) {
+            throw new SmartyException("PHP templates are disabled");
+        }
+        if (!$source->exists) {
+            if ($_template->parent instanceof Smarty_Internal_Template) {
+                $parent_resource = " in '{$_template->parent->template_resource}'";
+            } else {
+                $parent_resource = '';
+            }
+            throw new SmartyException("Unable to load template {$source->type} '{$source->name}'{$parent_resource}");
+        }
+
+        // prepare variables
+        extract($_template->getTemplateVars());
+
+        // include PHP template with short open tags enabled
+        ini_set( 'short_open_tag', '1' );
+        include($source->filepath);
+        ini_set( 'short_open_tag', $this->short_open_tag );
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_resource_registered.php b/library/Smarty/libs/sysplugins/smarty_internal_resource_registered.php
new file mode 100644 (file)
index 0000000..44497b9
--- /dev/null
@@ -0,0 +1,95 @@
+<?php
+/**
+ * Smarty Internal Plugin Resource Registered
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Internal Plugin Resource Registered
+ *
+ * Implements the registered resource for Smarty template
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @deprecated
+ */
+class Smarty_Internal_Resource_Registered extends Smarty_Resource {
+
+    /**
+     * populate Source Object with meta data from Resource
+     *
+     * @param Smarty_Template_Source   $source    source object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     */
+    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+    {
+        $source->filepath = $source->type . ':' . $source->name;
+        $source->uid = sha1($source->filepath);
+        if ($source->smarty->compile_check) {
+            $source->timestamp = $this->getTemplateTimestamp($source);
+            $source->exists = !!$source->timestamp;
+        }
+    }
+
+    /**
+     * populate Source Object with timestamp and exists from Resource
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return void
+     */
+    public function populateTimestamp(Smarty_Template_Source $source)
+    {
+        $source->timestamp = $this->getTemplateTimestamp($source);
+        $source->exists = !!$source->timestamp;
+    }
+
+    /**
+     * Get timestamp (epoch) the template source was modified
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return integer|boolean timestamp (epoch) the template was modified, false if resources has no timestamp
+     */
+    public function getTemplateTimestamp(Smarty_Template_Source $source)
+    {
+        // return timestamp
+        $time_stamp = false;
+        call_user_func_array($source->smarty->registered_resources[$source->type][0][1], array($source->name, &$time_stamp, $source->smarty));
+        return is_numeric($time_stamp) ? (int) $time_stamp : $time_stamp;
+    }
+
+    /**
+     * Load template's source by invoking the registered callback into current template object
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string template source
+     * @throws SmartyException if source cannot be loaded
+     */
+    public function getContent(Smarty_Template_Source $source)
+    {
+        // return template string
+        $t = call_user_func_array($source->smarty->registered_resources[$source->type][0][0], array($source->name, &$source->content, $source->smarty));
+        if (is_bool($t) && !$t) {
+            throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
+        }
+        return $source->content;
+    }
+
+    /**
+     * Determine basename for compiled filename
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string resource's basename
+     */
+    protected function getBasename(Smarty_Template_Source $source)
+    {
+        return basename($source->name);
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_resource_stream.php b/library/Smarty/libs/sysplugins/smarty_internal_resource_stream.php
new file mode 100644 (file)
index 0000000..85698c2
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Smarty Internal Plugin Resource Stream
+ *
+ * Implements the streams as resource for Smarty template
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Internal Plugin Resource Stream
+ *
+ * Implements the streams as resource for Smarty template
+ *
+ * @link http://php.net/streams
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled {
+
+    /**
+     * populate Source Object with meta data from Resource
+     *
+     * @param Smarty_Template_Source   $source    source object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     */
+    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+    {
+        $source->filepath = str_replace(':', '://', $source->resource);
+        $source->uid = false;
+        $source->content = $this->getContent($source);
+        $source->timestamp = false;
+        $source->exists = !!$source->content;
+    }
+
+    /**
+     * Load template's source from stream into current template object
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string template source
+     * @throws SmartyException if source cannot be loaded
+     */
+    public function getContent(Smarty_Template_Source $source)
+    {
+        $t = '';
+        // the availability of the stream has already been checked in Smarty_Resource::fetch()
+        $fp = fopen($source->filepath, 'r+');
+        if ($fp) {
+            while (!feof($fp) && ($current_line = fgets($fp)) !== false) {
+                $t .= $current_line;
+            }
+            fclose($fp);
+            return $t;
+        } else {
+            return false;
+        }
+    }
+    
+    /**
+     * modify resource_name according to resource handlers specifications
+     *
+     * @param Smarty $smarty        Smarty instance
+     * @param string $resource_name resource_name to make unique
+     * @return string unique resource name
+     */
+    protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
+    {
+        return get_class($this) . '#' . $resource_name;
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_resource_string.php b/library/Smarty/libs/sysplugins/smarty_internal_resource_string.php
new file mode 100644 (file)
index 0000000..9571337
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Smarty Internal Plugin Resource String
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Internal Plugin Resource String
+ *
+ * Implements the strings as resource for Smarty template
+ *
+ * {@internal unlike eval-resources the compiled state of string-resources is saved for subsequent access}}
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+class Smarty_Internal_Resource_String extends Smarty_Resource {
+
+    /**
+     * populate Source Object with meta data from Resource
+     *
+     * @param Smarty_Template_Source   $source    source object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     */
+    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+    {
+        $source->uid = $source->filepath = sha1($source->name);
+        $source->timestamp = 0;
+        $source->exists = true;
+    }
+
+    /**
+     * Load template's source from $resource_name into current template object
+     *
+     * @uses decode() to decode base64 and urlencoded template_resources
+     * @param Smarty_Template_Source $source source object
+     * @return string template source
+     */
+    public function getContent(Smarty_Template_Source $source)
+    {
+        return $this->decode($source->name);
+    }
+    
+    /**
+     * decode base64 and urlencode
+     *
+     * @param string $string template_resource to decode
+     * @return string decoded template_resource
+     */
+    protected function decode($string)
+    {
+        // decode if specified
+        if (($pos = strpos($string, ':')) !== false) {
+            if (!strncmp($string, 'base64', 6)) {
+                return base64_decode(substr($string, 7));
+            } elseif (!strncmp($string, 'urlencode', 9)) {
+                return urldecode(substr($string, 10));
+            }
+        }
+        
+        return $string;
+    }
+    
+    /**
+     * modify resource_name according to resource handlers specifications
+     *
+     * @param Smarty $smarty        Smarty instance
+     * @param string $resource_name resource_name to make unique
+     * @return string unique resource name
+     */
+    protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
+    {
+        return get_class($this) . '#' .$this->decode($resource_name);
+    }
+
+    /**
+     * Determine basename for compiled filename
+     *
+     * Always returns an empty string.
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string resource's basename
+     */
+    protected function getBasename(Smarty_Template_Source $source)
+    {
+        return '';
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php b/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php
new file mode 100644 (file)
index 0000000..1ec1aa4
--- /dev/null
@@ -0,0 +1,127 @@
+<?php
+/**
+ * Smarty Internal Plugin Smarty Template Compiler Base
+ *
+ * This file contains the basic classes and methodes for compiling Smarty templates with lexer/parser
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * @ignore
+ */
+include ("smarty_internal_parsetree.php");
+
+/**
+ * Class SmartyTemplateCompiler
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCompilerBase {
+
+    /**
+     * Lexer class name
+     *
+     * @var string
+     */
+    public $lexer_class;
+
+    /**
+     * Parser class name
+     *
+     * @var string
+     */
+    public $parser_class;
+
+    /**
+     * Lexer object
+     *
+     * @var object
+     */
+    public $lex;
+
+    /**
+     * Parser object
+     *
+     * @var object
+     */
+    public $parser;
+
+    /**
+     * Smarty object
+     *
+     * @var object
+     */
+    public $smarty;
+
+    /**
+     * array of vars which can be compiled in local scope
+     *
+     * @var array
+     */
+    public $local_var = array();
+
+    /**
+     * Initialize compiler
+     *
+     * @param string $lexer_class  class name
+     * @param string $parser_class class name
+     * @param Smarty $smarty       global instance
+     */
+    public function __construct($lexer_class, $parser_class, $smarty)
+    {
+        $this->smarty = $smarty;
+        parent::__construct();
+        // get required plugins
+        $this->lexer_class = $lexer_class;
+        $this->parser_class = $parser_class;
+    }
+
+    /**
+     * Methode to compile a Smarty template
+     *
+     * @param  mixed $_content template source
+     * @return bool true if compiling succeeded, false if it failed
+     */
+    protected function doCompile($_content)
+    {
+        /* here is where the compiling takes place. Smarty
+          tags in the templates are replaces with PHP code,
+          then written to compiled files. */
+        // init the lexer/parser to compile the template
+        $this->lex = new $this->lexer_class($_content, $this);
+        $this->parser = new $this->parser_class($this->lex, $this);
+        if ($this->smarty->_parserdebug)
+            $this->parser->PrintTrace();
+        // get tokens from lexer and parse them
+        while ($this->lex->yylex() && !$this->abort_and_recompile) {
+            if ($this->smarty->_parserdebug) {
+                echo "<pre>Line {$this->lex->line} Parsing  {$this->parser->yyTokenName[$this->lex->token]} Token " .
+                    htmlentities($this->lex->value) . "</pre>";
+            }
+            $this->parser->doParse($this->lex->token, $this->lex->value);
+        }
+
+        if ($this->abort_and_recompile) {
+            // exit here on abort
+            return false;
+        }
+        // finish parsing process
+        $this->parser->doParse(0, 0);
+        // check for unclosed tags
+        if (count($this->_tag_stack) > 0) {
+            // get stacked info
+            list($openTag, $_data) = array_pop($this->_tag_stack);
+            $this->trigger_template_error("unclosed {" . $openTag . "} tag");
+        }
+        // return compiled code
+        // return str_replace(array("? >\n<?php","? ><?php"), array('',''), $this->parser->retvalue);
+        return $this->parser->retvalue;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_template.php b/library/Smarty/libs/sysplugins/smarty_internal_template.php
new file mode 100644 (file)
index 0000000..de9d54c
--- /dev/null
@@ -0,0 +1,684 @@
+<?php
+/**
+ * Smarty Internal Plugin Template
+ *
+ * This file contains the Smarty template engine
+ *
+ * @package Smarty
+ * @subpackage Template
+ * @author Uwe Tews
+ */
+
+/**
+ * Main class with template data structures and methods
+ *
+ * @package Smarty
+ * @subpackage Template
+ *
+ * @property Smarty_Template_Source   $source
+ * @property Smarty_Template_Compiled $compiled
+ * @property Smarty_Template_Cached   $cached
+ */
+class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
+
+    /**
+     * cache_id
+     * @var string
+     */
+    public $cache_id = null;
+    /**
+     * $compile_id
+     * @var string
+     */
+    public $compile_id = null;
+    /**
+     * caching enabled
+     * @var boolean
+     */
+    public $caching = null;
+    /**
+     * cache lifetime in seconds
+     * @var integer
+     */
+    public $cache_lifetime = null;
+    /**
+     * Template resource
+     * @var string
+     */
+    public $template_resource = null;
+    /**
+     * flag if compiled template is invalid and must be (re)compiled
+     * @var bool
+     */
+    public $mustCompile = null;
+    /**
+     * flag if template does contain nocache code sections
+     * @var bool
+     */
+    public $has_nocache_code = false;
+    /**
+     * special compiled and cached template properties
+     * @var array
+     */
+    public $properties = array('file_dependency' => array(),
+        'nocache_hash' => '',
+        'function' => array());
+    /**
+     * required plugins
+     * @var array
+     */
+    public $required_plugins = array('compiled' => array(), 'nocache' => array());
+    /**
+     * Global smarty instance
+     * @var Smarty
+     */
+    public $smarty = null;
+    /**
+     * blocks for template inheritance
+     * @var array
+     */
+    public $block_data = array();
+    /**
+     * variable filters
+     * @var array
+     */
+    public $variable_filters = array();
+    /**
+     * optional log of tag/attributes
+     * @var array
+     */
+    public $used_tags = array();
+    /**
+     * internal flag to allow relative path in child template blocks
+     * @var bool
+     */
+    public $allow_relative_path = false;
+    /**
+     * internal capture runtime stack
+     * @var array
+     */
+    public $_capture_stack = array(0 => array());
+
+    /**
+     * Create template data object
+     *
+     * Some of the global Smarty settings copied to template scope
+     * It load the required template resources and cacher plugins
+     *
+     * @param string                   $template_resource template resource string
+     * @param Smarty                   $smarty            Smarty instance
+     * @param Smarty_Internal_Template $_parent           back pointer to parent object with variables or null
+     * @param mixed                    $_cache_id cache   id or null
+     * @param mixed                    $_compile_id       compile id or null
+     * @param bool                     $_caching          use caching?
+     * @param int                      $_cache_lifetime   cache life-time in seconds
+     */
+    public function __construct($template_resource, $smarty, $_parent = null, $_cache_id = null, $_compile_id = null, $_caching = null, $_cache_lifetime = null)
+    {
+        $this->smarty = &$smarty;
+        // Smarty parameter
+        $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id;
+        $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id;
+        $this->caching = $_caching === null ? $this->smarty->caching : $_caching;
+        if ($this->caching === true)
+            $this->caching = Smarty::CACHING_LIFETIME_CURRENT;
+        $this->cache_lifetime = $_cache_lifetime === null ? $this->smarty->cache_lifetime : $_cache_lifetime;
+        $this->parent = $_parent;
+        // Template resource
+        $this->template_resource = $template_resource;
+        // copy block data of template inheritance
+        if ($this->parent instanceof Smarty_Internal_Template) {
+            $this->block_data = $this->parent->block_data;
+        }
+    }
+
+    /**
+     * Returns if the current template must be compiled by the Smarty compiler
+     *
+     * It does compare the timestamps of template source and the compiled templates and checks the force compile configuration
+     *
+     * @return boolean true if the template must be compiled
+     */
+    public function mustCompile()
+    {
+        if (!$this->source->exists) {
+            if ($this->parent instanceof Smarty_Internal_Template) {
+                $parent_resource = " in '$this->parent->template_resource}'";
+            } else {
+                $parent_resource = '';
+            }
+            throw new SmartyException("Unable to load template {$this->source->type} '{$this->source->name}'{$parent_resource}");
+        }
+        if ($this->mustCompile === null) {
+            $this->mustCompile = (!$this->source->uncompiled && ($this->smarty->force_compile || $this->source->recompiled || $this->compiled->timestamp === false ||
+                    ($this->smarty->compile_check && $this->compiled->timestamp < $this->source->timestamp)));
+        }
+        return $this->mustCompile;
+    }
+
+    /**
+     * Compiles the template
+     *
+     * If the template is not evaluated the compiled template is saved on disk
+     */
+    public function compileTemplateSource()
+    {
+        if (!$this->source->recompiled) {
+            $this->properties['file_dependency'] = array();
+            if ($this->source->components) {
+                // uses real resource for file dependency
+                $source = end($this->source->components);
+                $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $source->type);
+            } else {
+                $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $this->source->type);
+            }
+        }
+        if ($this->smarty->debugging) {
+            Smarty_Internal_Debug::start_compile($this);
+        }
+        // compile locking
+        if ($this->smarty->compile_locking && !$this->source->recompiled) {
+            if ($saved_timestamp = $this->compiled->timestamp) {
+                touch($this->compiled->filepath);
+            }
+        }
+        // call compiler
+        try {
+            $code = $this->compiler->compileTemplate($this);
+        } catch (Exception $e) {
+            // restore old timestamp in case of error
+            if ($this->smarty->compile_locking && !$this->source->recompiled && $saved_timestamp) {
+                touch($this->compiled->filepath, $saved_timestamp);
+            }
+            throw $e;
+        }
+        // compiling succeded
+        if (!$this->source->recompiled && $this->compiler->write_compiled_code) {
+            // write compiled template
+            $_filepath = $this->compiled->filepath;
+            if ($_filepath === false)
+                throw new SmartyException('getCompiledFilepath() did not return a destination to save the compiled template to');
+            Smarty_Internal_Write_File::writeFile($_filepath, $code, $this->smarty);
+            $this->compiled->exists = true;
+            $this->compiled->isCompiled = true;
+        }
+        if ($this->smarty->debugging) {
+            Smarty_Internal_Debug::end_compile($this);
+        }
+        // release compiler object to free memory
+        unset($this->compiler);
+    }
+
+    /**
+     * Writes the cached template output
+     *
+     * @return bool
+     */
+    public function writeCachedContent($content)
+    {
+        if ($this->source->recompiled || !($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED)) {
+            // don't write cache file
+            return false;
+        }
+        $this->properties['cache_lifetime'] = $this->cache_lifetime;
+        $this->properties['unifunc'] = 'content_' . str_replace('.', '_', uniqid('', true));
+        $content = $this->createTemplateCodeFrame($content, true);
+        $_smarty_tpl = $this;
+        eval("?>" . $content);
+        $this->cached->valid = true;
+        $this->cached->processed = true;
+        return $this->cached->write($this, $content);
+    }
+
+    /**
+     * Template code runtime function to get subtemplate content
+     *
+     * @param string  $template       the resource handle of the template file
+     * @param mixed   $cache_id       cache id to be used with this template
+     * @param mixed   $compile_id     compile id to be used with this template
+     * @param integer $caching        cache mode
+     * @param integer $cache_lifetime life time of cache data
+     * @param array   $vars optional  variables to assign
+     * @param int     $parent_scope   scope in which {include} should execute
+     * @returns string template content
+     */
+    public function getSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope)
+    {
+        // already in template cache?
+        if ($this->smarty->allow_ambiguous_resources) {
+            $_templateId = Smarty_Resource::getUniqueTemplateName($this->smarty, $template) . $cache_id . $compile_id;
+        } else {
+            $_templateId = $this->smarty->joined_template_dir . '#' . $template . $cache_id . $compile_id;
+        }
+
+        if (isset($_templateId[150])) {
+            $_templateId = sha1($_templateId);
+        }
+        if (isset($this->smarty->template_objects[$_templateId])) {
+            // clone cached template object because of possible recursive call
+            $tpl = clone $this->smarty->template_objects[$_templateId];
+            $tpl->parent = $this;
+            $tpl->caching = $caching;
+            $tpl->cache_lifetime = $cache_lifetime;
+        } else {
+            $tpl = new $this->smarty->template_class($template, $this->smarty, $this, $cache_id, $compile_id, $caching, $cache_lifetime);
+        }
+        // get variables from calling scope
+        if ($parent_scope == Smarty::SCOPE_LOCAL) {
+            $tpl->tpl_vars = $this->tpl_vars;
+            $tpl->tpl_vars['smarty'] = clone $this->tpl_vars['smarty'];
+        } elseif ($parent_scope == Smarty::SCOPE_PARENT) {
+            $tpl->tpl_vars = &$this->tpl_vars;
+        } elseif ($parent_scope == Smarty::SCOPE_GLOBAL) {
+            $tpl->tpl_vars = &Smarty::$global_tpl_vars;
+        } elseif (($scope_ptr = $this->getScopePointer($parent_scope)) == null) {
+            $tpl->tpl_vars = &$this->tpl_vars;
+        } else {
+            $tpl->tpl_vars = &$scope_ptr->tpl_vars;
+        }
+        $tpl->config_vars = $this->config_vars;
+        if (!empty($data)) {
+            // set up variable values
+            foreach ($data as $_key => $_val) {
+                $tpl->tpl_vars[$_key] = new Smarty_variable($_val);
+            }
+        }
+        return $tpl->fetch(null, null, null, null, false, false, true);
+    }
+
+    /**
+     * Template code runtime function to set up an inline subtemplate
+     *
+     * @param string  $template       the resource handle of the template file
+     * @param mixed   $cache_id       cache id to be used with this template
+     * @param mixed   $compile_id     compile id to be used with this template
+     * @param integer $caching        cache mode
+     * @param integer $cache_lifetime life time of cache data
+     * @param array   $vars optional  variables to assign
+     * @param int     $parent_scope   scope in which {include} should execute
+     * @param string  $hash           nocache hash code
+     * @returns string template content
+     */
+    public function setupInlineSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope, $hash)
+    {
+        $tpl = new $this->smarty->template_class($template, $this->smarty, $this, $cache_id, $compile_id, $caching, $cache_lifetime);
+        $tpl->properties['nocache_hash']  = $hash;
+        // get variables from calling scope
+        if ($parent_scope == Smarty::SCOPE_LOCAL ) {
+            $tpl->tpl_vars = $this->tpl_vars;
+            $tpl->tpl_vars['smarty'] = clone $this->tpl_vars['smarty'];
+        } elseif ($parent_scope == Smarty::SCOPE_PARENT) {
+            $tpl->tpl_vars = &$this->tpl_vars;
+        } elseif ($parent_scope == Smarty::SCOPE_GLOBAL) {
+            $tpl->tpl_vars = &Smarty::$global_tpl_vars;
+        } elseif (($scope_ptr = $this->getScopePointer($parent_scope)) == null) {
+            $tpl->tpl_vars = &$this->tpl_vars;
+        } else {
+            $tpl->tpl_vars = &$scope_ptr->tpl_vars;
+        }
+        $tpl->config_vars = $this->config_vars;
+        if (!empty($data)) {
+            // set up variable values
+            foreach ($data as $_key => $_val) {
+                $tpl->tpl_vars[$_key] = new Smarty_variable($_val);
+            }
+        }
+        return $tpl;
+    }
+
+
+    /**
+     * Create code frame for compiled and cached templates
+     *
+     * @param string $content   optional template content
+     * @param bool   $cache     flag for cache file
+     * @return string
+     */
+    public function createTemplateCodeFrame($content = '', $cache = false)
+    {
+        $plugins_string = '';
+        // include code for plugins
+        if (!$cache) {
+            if (!empty($this->required_plugins['compiled'])) {
+                $plugins_string = '<?php ';
+                foreach ($this->required_plugins['compiled'] as $tmp) {
+                    foreach ($tmp as $data) {
+                        $file = addslashes($data['file']);
+                        $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$file}';\n";
+                    }
+                }
+                $plugins_string .= '?>';
+            }
+            if (!empty($this->required_plugins['nocache'])) {
+                $this->has_nocache_code = true;
+                $plugins_string .= "<?php echo '/*%%SmartyNocache:{$this->properties['nocache_hash']}%%*/<?php \$_smarty = \$_smarty_tpl->smarty; ";
+                foreach ($this->required_plugins['nocache'] as $tmp) {
+                    foreach ($tmp as $data) {
+                        $file = addslashes($data['file']);
+                        $plugins_string .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n");
+                    }
+                }
+                $plugins_string .= "?>/*/%%SmartyNocache:{$this->properties['nocache_hash']}%%*/';?>\n";
+            }
+        }
+        // build property code
+        $this->properties['has_nocache_code'] = $this->has_nocache_code;
+        $output = '';
+        if (!$this->source->recompiled) {
+            $output = "<?php /*%%SmartyHeaderCode:{$this->properties['nocache_hash']}%%*/";
+            if ($this->smarty->direct_access_security) {
+                $output .= "if(!defined('SMARTY_DIR')) exit('no direct access allowed');\n";
+            }
+        }
+        if ($cache) {
+            // remove compiled code of{function} definition
+            unset($this->properties['function']);
+            if (!empty($this->smarty->template_functions)) {
+                // copy code of {function} tags called in nocache mode
+                foreach ($this->smarty->template_functions as $name => $function_data) {
+                    if (isset($function_data['called_nocache'])) {
+                        foreach ($function_data['called_functions'] as $func_name) {
+                            $this->smarty->template_functions[$func_name]['called_nocache'] = true;
+                        }
+                    }
+                }
+                 foreach ($this->smarty->template_functions as $name => $function_data) {
+                    if (isset($function_data['called_nocache'])) {
+                        unset($function_data['called_nocache'], $function_data['called_functions'], $this->smarty->template_functions[$name]['called_nocache']);
+                        $this->properties['function'][$name] = $function_data;
+                    }
+                }
+            }
+        }
+        $this->properties['version'] = Smarty::SMARTY_VERSION;
+        if (!isset($this->properties['unifunc'])) {
+            $this->properties['unifunc'] = 'content_' . str_replace('.', '_', uniqid('', true));
+        }
+        if (!$this->source->recompiled) {
+            $output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($this->properties, true) . ',' . ($cache ? 'true' : 'false') . "); /*/%%SmartyHeaderCode%%*/?>\n";
+            $output .= '<?php if ($_valid && !is_callable(\'' . $this->properties['unifunc'] . '\')) {function ' . $this->properties['unifunc'] . '($_smarty_tpl) {?>';
+        }
+        $output .= $plugins_string;
+        $output .= $content;
+        if (!$this->source->recompiled) {
+            $output .= '<?php }} ?>';
+        }
+        return $output;
+    }
+
+    /**
+     * This function is executed automatically when a compiled or cached template file is included
+     *
+     * - Decode saved properties from compiled template and cache files
+     * - Check if compiled or cache file is valid
+     *
+     * @param array $properties     special template properties
+     * @param bool  $cache          flag if called from cache file
+     * @return bool                 flag if compiled or cache file is valid
+     */
+    public function decodeProperties($properties, $cache = false)
+    {
+        $this->has_nocache_code = $properties['has_nocache_code'];
+        $this->properties['nocache_hash'] = $properties['nocache_hash'];
+        if (isset($properties['cache_lifetime'])) {
+            $this->properties['cache_lifetime'] = $properties['cache_lifetime'];
+        }
+        if (isset($properties['file_dependency'])) {
+            $this->properties['file_dependency'] = array_merge($this->properties['file_dependency'], $properties['file_dependency']);
+        }
+        if (!empty($properties['function'])) {
+            $this->properties['function'] = array_merge($this->properties['function'], $properties['function']);
+            $this->smarty->template_functions = array_merge($this->smarty->template_functions, $properties['function']);
+        }
+        $this->properties['version'] = (isset($properties['version'])) ? $properties['version'] : '';
+        $this->properties['unifunc'] = $properties['unifunc'];
+        // check file dependencies at compiled code
+        $is_valid = true;
+        if ($this->properties['version'] != Smarty::SMARTY_VERSION) {
+            $is_valid = false;
+        } else if (((!$cache && $this->smarty->compile_check && empty($this->compiled->_properties) && !$this->compiled->isCompiled) || $cache && ($this->smarty->compile_check === true || $this->smarty->compile_check === Smarty::COMPILECHECK_ON)) && !empty($this->properties['file_dependency'])) {
+            foreach ($this->properties['file_dependency'] as $_file_to_check) {
+                if ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'php') {
+                    if ($this->source->filepath == $_file_to_check[0] && isset($this->source->timestamp)) {
+                        // do not recheck current template
+                        $mtime = $this->source->timestamp;
+                    } else {
+                        // file and php types can be checked without loading the respective resource handlers
+                        $mtime = @filemtime($_file_to_check[0]);
+                    }
+                } elseif ($_file_to_check[2] == 'string') {
+                    continue;
+                } else {
+                    $source = Smarty_Resource::source(null, $this->smarty, $_file_to_check[0]);
+                    $mtime = $source->timestamp;
+                }
+                if (!$mtime || $mtime > $_file_to_check[1]) {
+                    $is_valid = false;
+                    break;
+                }
+            }
+        }
+        if ($cache) {
+            $this->cached->valid = $is_valid;
+        } else {
+            $this->mustCompile = !$is_valid;
+        }
+        // store data in reusable Smarty_Template_Compiled
+        if (!$cache) {
+            $this->compiled->_properties = $properties;
+        }
+        return $is_valid;
+    }
+
+    /**
+     * Template code runtime function to create a local Smarty variable for array assignments
+     *
+     * @param string $tpl_var   tempate variable name
+     * @param bool   $nocache   cache mode of variable
+     * @param int    $scope     scope of variable
+     */
+    public function createLocalArrayVariable($tpl_var, $nocache = false, $scope = Smarty::SCOPE_LOCAL)
+    {
+        if (!isset($this->tpl_vars[$tpl_var])) {
+            $this->tpl_vars[$tpl_var] = new Smarty_variable(array(), $nocache, $scope);
+        } else {
+            $this->tpl_vars[$tpl_var] = clone $this->tpl_vars[$tpl_var];
+            if ($scope != Smarty::SCOPE_LOCAL) {
+                $this->tpl_vars[$tpl_var]->scope = $scope;
+            }
+            if (!(is_array($this->tpl_vars[$tpl_var]->value) || $this->tpl_vars[$tpl_var]->value instanceof ArrayAccess)) {
+                settype($this->tpl_vars[$tpl_var]->value, 'array');
+            }
+        }
+    }
+
+    /**
+     * Template code runtime function to get pointer to template variable array of requested scope
+     *
+     * @param int $scope    requested variable scope
+     * @return array        array of template variables
+     */
+    public function &getScope($scope)
+    {
+        if ($scope == Smarty::SCOPE_PARENT && !empty($this->parent)) {
+            return $this->parent->tpl_vars;
+        } elseif ($scope == Smarty::SCOPE_ROOT && !empty($this->parent)) {
+            $ptr = $this->parent;
+            while (!empty($ptr->parent)) {
+                $ptr = $ptr->parent;
+            }
+            return $ptr->tpl_vars;
+        } elseif ($scope == Smarty::SCOPE_GLOBAL) {
+            return Smarty::$global_tpl_vars;
+        }
+        $null = null;
+        return $null;
+    }
+
+    /**
+     * Get parent or root of template parent chain
+     *
+     * @param int $scope    pqrent or root scope
+     * @return mixed object
+     */
+    public function getScopePointer($scope)
+    {
+        if ($scope == Smarty::SCOPE_PARENT && !empty($this->parent)) {
+            return $this->parent;
+        } elseif ($scope == Smarty::SCOPE_ROOT && !empty($this->parent)) {
+            $ptr = $this->parent;
+            while (!empty($ptr->parent)) {
+                $ptr = $ptr->parent;
+            }
+            return $ptr;
+        }
+        return null;
+    }
+
+    /**
+     * [util function] counts an array, arrayaccess/traversable or PDOStatement object
+     *
+     * @param mixed $value
+     * @return int the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 for empty elements
+     */
+    public function _count($value)
+    {
+        if (is_array($value) === true || $value instanceof Countable) {
+            return count($value);
+        } elseif ($value instanceof IteratorAggregate) {
+            // Note: getIterator() returns a Traversable, not an Iterator
+            // thus rewind() and valid() methods may not be present
+            return iterator_count($value->getIterator());
+        } elseif ($value instanceof Iterator) {
+            return iterator_count($value);
+        } elseif ($value instanceof PDOStatement) {
+            return $value->rowCount();
+        } elseif ($value instanceof Traversable) {
+            return iterator_count($value);
+        } elseif ($value instanceof ArrayAccess) {
+            if ($value->offsetExists(0)) {
+                return 1;
+            }
+        } elseif (is_object($value)) {
+            return count($value);
+        }
+        return 0;
+    }
+
+    /**
+     * runtime error not matching capture tags
+     *
+     */
+    public function capture_error()
+    {
+        throw new SmartyException("Not matching {capture} open/close in \"{$this->template_resource}\"");
+    }
+
+    /**
+    * Empty cache for this template
+    *
+    * @param integer $exp_time      expiration time
+    * @return integer number of cache files deleted
+    */
+    public function clearCache($exp_time=null)
+    {
+        Smarty_CacheResource::invalidLoadedCache($this->smarty);
+        return $this->cached->handler->clear($this->smarty, $this->template_name, $this->cache_id, $this->compile_id, $exp_time);
+    }
+
+     /**
+     * set Smarty property in template context
+     *
+     * @param string $property_name property name
+     * @param mixed  $value         value
+     */
+    public function __set($property_name, $value)
+    {
+        switch ($property_name) {
+            case 'source':
+            case 'compiled':
+            case 'cached':
+            case 'compiler':
+                $this->$property_name = $value;
+                return;
+
+            // FIXME: routing of template -> smarty attributes
+            default:
+                if (property_exists($this->smarty, $property_name)) {
+                    $this->smarty->$property_name = $value;
+                    return;
+                }
+        }
+
+        throw new SmartyException("invalid template property '$property_name'.");
+    }
+
+    /**
+     * get Smarty property in template context
+     *
+     * @param string $property_name property name
+     */
+    public function __get($property_name)
+    {
+        switch ($property_name) {
+            case 'source':
+                if (strlen($this->template_resource) == 0) {
+                    throw new SmartyException('Missing template name');
+                }
+                $this->source = Smarty_Resource::source($this);
+                // cache template object under a unique ID
+                // do not cache eval resources
+                if ($this->source->type != 'eval') {
+                    if ($this->smarty->allow_ambiguous_resources) {
+                        $_templateId = $this->source->unique_resource . $this->cache_id . $this->compile_id;
+                    } else {
+                        $_templateId = $this->smarty->joined_template_dir . '#' . $this->template_resource . $this->cache_id . $this->compile_id;
+                    }
+
+                    if (isset($_templateId[150])) {
+                        $_templateId = sha1($_templateId);
+                    }
+                    $this->smarty->template_objects[$_templateId] = $this;
+                }
+                return $this->source;
+
+            case 'compiled':
+                $this->compiled = $this->source->getCompiled($this);
+                return $this->compiled;
+
+            case 'cached':
+                if (!class_exists('Smarty_Template_Cached')) {
+                    include SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php';
+                }
+                $this->cached = new Smarty_Template_Cached($this);
+                return $this->cached;
+
+            case 'compiler':
+                $this->smarty->loadPlugin($this->source->compiler_class);
+                $this->compiler = new $this->source->compiler_class($this->source->template_lexer_class, $this->source->template_parser_class, $this->smarty);
+                return $this->compiler;
+
+            // FIXME: routing of template -> smarty attributes
+            default:
+                if (property_exists($this->smarty, $property_name)) {
+                    return $this->smarty->$property_name;
+                }
+        }
+
+        throw new SmartyException("template property '$property_name' does not exist.");
+    }
+
+    /**
+     * Template data object destrutor
+     *
+     */
+    public function __destruct()
+    {
+        if ($this->smarty->cache_locking && isset($this->cached) && $this->cached->is_locked) {
+            $this->cached->handler->releaseLock($this->smarty, $this->cached);
+        }
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_templatebase.php b/library/Smarty/libs/sysplugins/smarty_internal_templatebase.php
new file mode 100644 (file)
index 0000000..abd48b7
--- /dev/null
@@ -0,0 +1,811 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Smarty Template  Base\r
+ *\r
+ * This file contains the basic shared methodes for template handling\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Template\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * Class with shared template methodes\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Template\r
+ */\r
+abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {\r
+\r
+    /**\r
+     * fetches a rendered Smarty template\r
+     *\r
+     * @param string $template          the resource handle of the template file or template object\r
+     * @param mixed  $cache_id          cache id to be used with this template\r
+     * @param mixed  $compile_id        compile id to be used with this template\r
+     * @param object $parent            next higher level of Smarty variables\r
+     * @param bool   $display           true: display, false: fetch\r
+     * @param bool   $merge_tpl_vars    if true parent template variables merged in to local scope\r
+     * @param bool   $no_output_filter  if true do not run output filter\r
+     * @return string rendered template output\r
+     */\r
+    public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)\r
+    {\r
+        if ($template === null && $this instanceof $this->template_class) {\r
+            $template = $this;\r
+        }\r
+        if (!empty($cache_id) && is_object($cache_id)) {\r
+            $parent = $cache_id;\r
+            $cache_id = null;\r
+        }\r
+        if ($parent === null && ($this instanceof Smarty || is_string($template))) {\r
+            $parent = $this;\r
+        }\r
+        // create template object if necessary\r
+        $_template = ($template instanceof $this->template_class)\r
+        ? $template\r
+        : $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);\r
+        // if called by Smarty object make sure we use current caching status\r
+        if ($this instanceof Smarty) {\r
+            $_template->caching = $this->caching;\r
+        }\r
+        // merge all variable scopes into template\r
+        if ($merge_tpl_vars) {\r
+            // save local variables\r
+            $save_tpl_vars = $_template->tpl_vars;\r
+            $save_config_vars = $_template->config_vars;\r
+            $ptr_array = array($_template);\r
+            $ptr = $_template;\r
+            while (isset($ptr->parent)) {\r
+                $ptr_array[] = $ptr = $ptr->parent;\r
+            }\r
+            $ptr_array = array_reverse($ptr_array);\r
+            $parent_ptr = reset($ptr_array);\r
+            $tpl_vars = $parent_ptr->tpl_vars;\r
+            $config_vars = $parent_ptr->config_vars;\r
+            while ($parent_ptr = next($ptr_array)) {\r
+                if (!empty($parent_ptr->tpl_vars)) {\r
+                    $tpl_vars = array_merge($tpl_vars, $parent_ptr->tpl_vars);\r
+                }\r
+                if (!empty($parent_ptr->config_vars)) {\r
+                    $config_vars = array_merge($config_vars, $parent_ptr->config_vars);\r
+                }\r
+            }\r
+            if (!empty(Smarty::$global_tpl_vars)) {\r
+                $tpl_vars = array_merge(Smarty::$global_tpl_vars, $tpl_vars);\r
+            }\r
+            $_template->tpl_vars = $tpl_vars;\r
+            $_template->config_vars = $config_vars;\r
+        }\r
+        // dummy local smarty variable\r
+        if (!isset($_template->tpl_vars['smarty'])) {\r
+            $_template->tpl_vars['smarty'] = new Smarty_Variable;\r
+        }\r
+        if (isset($this->smarty->error_reporting)) {\r
+            $_smarty_old_error_level = error_reporting($this->smarty->error_reporting);\r
+        }\r
+        // check URL debugging control\r
+        if (!$this->smarty->debugging && $this->smarty->debugging_ctrl == 'URL') {\r
+            if (isset($_SERVER['QUERY_STRING'])) {\r
+                $_query_string = $_SERVER['QUERY_STRING'];\r
+            } else {\r
+                $_query_string = '';\r
+            }\r
+            if (false !== strpos($_query_string, $this->smarty->smarty_debug_id)) {\r
+                if (false !== strpos($_query_string, $this->smarty->smarty_debug_id . '=on')) {\r
+                    // enable debugging for this browser session\r
+                    setcookie('SMARTY_DEBUG', true);\r
+                    $this->smarty->debugging = true;\r
+                } elseif (false !== strpos($_query_string, $this->smarty->smarty_debug_id . '=off')) {\r
+                    // disable debugging for this browser session\r
+                    setcookie('SMARTY_DEBUG', false);\r
+                    $this->smarty->debugging = false;\r
+                } else {\r
+                    // enable debugging for this page\r
+                    $this->smarty->debugging = true;\r
+                }\r
+            } else {\r
+                if (isset($_COOKIE['SMARTY_DEBUG'])) {\r
+                    $this->smarty->debugging = true;\r
+                }\r
+            }\r
+        }\r
+        // must reset merge template date\r
+        $_template->smarty->merged_templates_func = array();\r
+        // get rendered template\r
+        // disable caching for evaluated code\r
+        if ($_template->source->recompiled) {\r
+            $_template->caching = false;\r
+        }\r
+        // checks if template exists\r
+        if (!$_template->source->exists) {\r
+            if ($_template->parent instanceof Smarty_Internal_Template) {\r
+                $parent_resource = " in '{$_template->parent->template_resource}'";\r
+            } else {\r
+                $parent_resource = '';\r
+            }\r
+            throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}");\r
+        }\r
+        // read from cache or render\r
+        if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || !$_template->cached->valid) {\r
+            // render template (not loaded and not in cache)\r
+            if (!$_template->source->uncompiled) {\r
+                $_smarty_tpl = $_template;\r
+                if ($_template->source->recompiled) {\r
+                    if ($this->smarty->debugging) {\r
+                        Smarty_Internal_Debug::start_compile($_template);\r
+                    }\r
+                    $code = $_template->compiler->compileTemplate($_template);\r
+                    if ($this->smarty->debugging) {\r
+                        Smarty_Internal_Debug::end_compile($_template);\r
+                    }\r
+                    if ($this->smarty->debugging) {\r
+                        Smarty_Internal_Debug::start_render($_template);\r
+                    }\r
+                    try {\r
+                        ob_start();\r
+                        eval("?>" . $code);\r
+                        unset($code);\r
+                    } catch (Exception $e) {\r
+                        ob_get_clean();\r
+                        throw $e;\r
+                    }\r
+                } else {\r
+                    if (!$_template->compiled->exists || ($_template->smarty->force_compile && !$_template->compiled->isCompiled)) {\r
+                        $_template->compileTemplateSource();\r
+                    }\r
+                    if ($this->smarty->debugging) {\r
+                        Smarty_Internal_Debug::start_render($_template);\r
+                    }\r
+                    if (!$_template->compiled->loaded) {\r
+                        include($_template->compiled->filepath);\r
+                        if ($_template->mustCompile) {\r
+                            // recompile and load again\r
+                            $_template->compileTemplateSource();\r
+                            include($_template->compiled->filepath);\r
+                        }\r
+                        $_template->compiled->loaded = true;\r
+                    } else {\r
+                        $_template->decodeProperties($_template->compiled->_properties, false);\r
+                    }\r
+                    try {\r
+                        ob_start();\r
+                        if (empty($_template->properties['unifunc']) || !is_callable($_template->properties['unifunc'])) {\r
+                            throw new SmartyException("Invalid compiled template for '{$_template->template_resource}'");\r
+                        }\r
+                        array_unshift($_template->_capture_stack,array());\r
+                        //\r
+                        // render compiled template\r
+                        //\r
+                        $_template->properties['unifunc']($_template);\r
+                        // any unclosed {capture} tags ?\r
+                        if (isset($_template->_capture_stack[0][0])) {\r
+                            $_template->capture_error();\r
+                        }\r
+                        array_shift($_template->_capture_stack);\r
+                    } catch (Exception $e) {\r
+                        ob_get_clean();\r
+                        throw $e;\r
+                    }\r
+                }\r
+            } else {\r
+                if ($_template->source->uncompiled) {\r
+                    if ($this->smarty->debugging) {\r
+                        Smarty_Internal_Debug::start_render($_template);\r
+                    }\r
+                    try {\r
+                        ob_start();\r
+                        $_template->source->renderUncompiled($_template);\r
+                    } catch (Exception $e) {\r
+                        ob_get_clean();\r
+                        throw $e;\r
+                    }\r
+                } else {\r
+                    throw new SmartyException("Resource '$_template->source->type' must have 'renderUncompiled' method");\r
+                }\r
+            }\r
+            $_output = ob_get_clean();\r
+            if (!$_template->source->recompiled && empty($_template->properties['file_dependency'][$_template->source->uid])) {\r
+                $_template->properties['file_dependency'][$_template->source->uid] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type);\r
+            }\r
+            if ($_template->parent instanceof Smarty_Internal_Template) {\r
+                $_template->parent->properties['file_dependency'] = array_merge($_template->parent->properties['file_dependency'], $_template->properties['file_dependency']);\r
+                foreach ($_template->required_plugins as $code => $tmp1) {\r
+                    foreach ($tmp1 as $name => $tmp) {\r
+                        foreach ($tmp as $type => $data) {\r
+                            $_template->parent->required_plugins[$code][$name][$type] = $data;\r
+                        }\r
+                    }\r
+                }\r
+            }\r
+            if ($this->smarty->debugging) {\r
+                Smarty_Internal_Debug::end_render($_template);\r
+            }\r
+            // write to cache when nessecary\r
+            if (!$_template->source->recompiled && ($_template->caching == Smarty::CACHING_LIFETIME_SAVED || $_template->caching == Smarty::CACHING_LIFETIME_CURRENT)) {\r
+                if ($this->smarty->debugging) {\r
+                    Smarty_Internal_Debug::start_cache($_template);\r
+                }\r
+                $_template->properties['has_nocache_code'] = false;\r
+                // get text between non-cached items\r
+                $cache_split = preg_split("!/\*%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!s", $_output);\r
+                // get non-cached items\r
+                preg_match_all("!/\*%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!s", $_output, $cache_parts);\r
+                $output = '';\r
+                // loop over items, stitch back together\r
+                foreach ($cache_split as $curr_idx => $curr_split) {\r
+                    // escape PHP tags in template content\r
+                    $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php echo \'$1\'; ?>', $curr_split);\r
+                    if (isset($cache_parts[0][$curr_idx])) {\r
+                        $_template->properties['has_nocache_code'] = true;\r
+                        // remove nocache tags from cache output\r
+                        $output .= preg_replace("!/\*/?%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!", '', $cache_parts[0][$curr_idx]);\r
+                    }\r
+                }\r
+                if (!$no_output_filter && !$_template->has_nocache_code && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {\r
+                    $output = Smarty_Internal_Filter_Handler::runFilter('output', $output, $_template);\r
+                }\r
+                // rendering (must be done before writing cache file because of {function} nocache handling)\r
+                $_smarty_tpl = $_template;\r
+                try {\r
+                    ob_start();\r
+                    eval("?>" . $output);\r
+                    $_output = ob_get_clean();\r
+                } catch (Exception $e) {\r
+                    ob_get_clean();\r
+                    throw $e;\r
+                }\r
+                // write cache file content\r
+                $_template->writeCachedContent($output);\r
+                if ($this->smarty->debugging) {\r
+                    Smarty_Internal_Debug::end_cache($_template);\r
+                }\r
+            } else {\r
+                // var_dump('renderTemplate', $_template->has_nocache_code, $_template->template_resource, $_template->properties['nocache_hash'], $_template->parent->properties['nocache_hash'], $_output);\r
+                if (!empty($_template->properties['nocache_hash']) && !empty($_template->parent->properties['nocache_hash'])) {\r
+                    // replace nocache_hash\r
+                    $_output = str_replace("{$_template->properties['nocache_hash']}", $_template->parent->properties['nocache_hash'], $_output);\r
+                    $_template->parent->has_nocache_code = $_template->parent->has_nocache_code || $_template->has_nocache_code;\r
+                }\r
+            }\r
+        } else {\r
+            if ($this->smarty->debugging) {\r
+                Smarty_Internal_Debug::start_cache($_template);\r
+            }\r
+            try {\r
+                ob_start();\r
+                array_unshift($_template->_capture_stack,array());\r
+                //\r
+                // render cached template\r
+                //\r
+                $_template->properties['unifunc']($_template);\r
+                // any unclosed {capture} tags ?\r
+                if (isset($_template->_capture_stack[0][0])) {\r
+                    $_template->capture_error();\r
+                }\r
+                array_shift($_template->_capture_stack);\r
+                $_output = ob_get_clean();\r
+            } catch (Exception $e) {\r
+                ob_get_clean();\r
+                throw $e;\r
+            }\r
+            if ($this->smarty->debugging) {\r
+                Smarty_Internal_Debug::end_cache($_template);\r
+            }\r
+        }\r
+        if ((!$this->caching || $_template->has_nocache_code || $_template->source->recompiled) && !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {\r
+            $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_output, $_template);\r
+        }\r
+        if (isset($this->error_reporting)) {\r
+            error_reporting($_smarty_old_error_level);\r
+        }\r
+        // display or fetch\r
+        if ($display) {\r
+            if ($this->caching && $this->cache_modified_check) {\r
+                $_isCached = $_template->isCached() && !$_template->has_nocache_code;\r
+                $_last_modified_date = @substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);\r
+                if ($_isCached && $_template->cached->timestamp <= strtotime($_last_modified_date)) {\r
+                    switch (PHP_SAPI) {\r
+                        case 'cgi':         // php-cgi < 5.3\r
+                        case 'cgi-fcgi':    // php-cgi >= 5.3\r
+                        case 'fpm-fcgi':    // php-fpm >= 5.3.3\r
+                        header('Status: 304 Not Modified');\r
+                        break;\r
+\r
+                        case 'cli':\r
+                        if (/* ^phpunit */!empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS'])/* phpunit$ */) {\r
+                            $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = '304 Not Modified';\r
+                        }\r
+                        break;\r
+\r
+                        default:\r
+                        header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');\r
+                        break;\r
+                    }\r
+                } else {\r
+                    switch (PHP_SAPI) {\r
+                        case 'cli':\r
+                        if (/* ^phpunit */!empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS'])/* phpunit$ */) {\r
+                            $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = 'Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->cached->timestamp) . ' GMT';\r
+                        }\r
+                        break;\r
+\r
+                        default:\r
+                        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->cached->timestamp) . ' GMT');\r
+                        break;\r
+                    }\r
+                    echo $_output;\r
+                }\r
+            } else {\r
+                echo $_output;\r
+            }\r
+            // debug output\r
+            if ($this->smarty->debugging) {\r
+                Smarty_Internal_Debug::display_debug($this);\r
+            }\r
+            if ($merge_tpl_vars) {\r
+                // restore local variables\r
+                $_template->tpl_vars = $save_tpl_vars;\r
+                $_template->config_vars =  $save_config_vars;\r
+            }\r
+            return;\r
+        } else {\r
+            if ($merge_tpl_vars) {\r
+                // restore local variables\r
+                $_template->tpl_vars = $save_tpl_vars;\r
+                $_template->config_vars =  $save_config_vars;\r
+            }\r
+            // return fetched content\r
+            return $_output;\r
+        }\r
+    }\r
+\r
+    /**\r
+     * displays a Smarty template\r
+     *\r
+     * @param string $template   the resource handle of the template file or template object\r
+     * @param mixed  $cache_id   cache id to be used with this template\r
+     * @param mixed  $compile_id compile id to be used with this template\r
+     * @param object $parent     next higher level of Smarty variables\r
+     */\r
+    public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)\r
+    {\r
+        // display template\r
+        $this->fetch($template, $cache_id, $compile_id, $parent, true);\r
+    }\r
+\r
+    /**\r
+     * test if cache is valid\r
+     *\r
+     * @param string|object $template   the resource handle of the template file or template object\r
+     * @param mixed         $cache_id   cache id to be used with this template\r
+     * @param mixed         $compile_id compile id to be used with this template\r
+     * @param object        $parent     next higher level of Smarty variables\r
+     * @return boolean cache status\r
+     */\r
+    public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null)\r
+    {\r
+        if ($template === null && $this instanceof $this->template_class) {\r
+            return $this->cached->valid;\r
+        }\r
+        if (!($template instanceof $this->template_class)) {\r
+            if ($parent === null) {\r
+                $parent = $this;\r
+            }\r
+            $template = $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);\r
+        }\r
+        // return cache status of template\r
+        return $template->cached->valid;\r
+    }\r
+\r
+    /**\r
+     * creates a data object\r
+     *\r
+     * @param object $parent next higher level of Smarty variables\r
+     * @returns Smarty_Data data object\r
+     */\r
+    public function createData($parent = null)\r
+    {\r
+        return new Smarty_Data($parent, $this);\r
+    }\r
+\r
+    /**\r
+     * Registers plugin to be used in templates\r
+     *\r
+     * @param string   $type       plugin type\r
+     * @param string   $tag        name of template tag\r
+     * @param callback $callback   PHP callback to register\r
+     * @param boolean  $cacheable  if true (default) this fuction is cachable\r
+     * @param array    $cache_attr caching attributes if any\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     * @throws SmartyException when the plugin tag is invalid\r
+     */\r
+    public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null)\r
+    {\r
+        if (isset($this->smarty->registered_plugins[$type][$tag])) {\r
+            throw new SmartyException("Plugin tag \"{$tag}\" already registered");\r
+        } elseif (!is_callable($callback)) {\r
+            throw new SmartyException("Plugin \"{$tag}\" not callable");\r
+        } else {\r
+            $this->smarty->registered_plugins[$type][$tag] = array($callback, (bool) $cacheable, (array) $cache_attr);\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Unregister Plugin\r
+     *\r
+     * @param string $type of plugin\r
+     * @param string $tag name of plugin\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     */\r
+    public function unregisterPlugin($type, $tag)\r
+    {\r
+        if (isset($this->smarty->registered_plugins[$type][$tag])) {\r
+            unset($this->smarty->registered_plugins[$type][$tag]);\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Registers a resource to fetch a template\r
+     *\r
+     * @param string $type name of resource type\r
+     * @param Smarty_Resource|array $callback or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated)\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     */\r
+    public function registerResource($type, $callback)\r
+    {\r
+        $this->smarty->registered_resources[$type] = $callback instanceof Smarty_Resource ? $callback : array($callback, false);\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Unregisters a resource\r
+     *\r
+     * @param string $type name of resource type\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     */\r
+    public function unregisterResource($type)\r
+    {\r
+        if (isset($this->smarty->registered_resources[$type])) {\r
+            unset($this->smarty->registered_resources[$type]);\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Registers a cache resource to cache a template's output\r
+     *\r
+     * @param string               $type     name of cache resource type\r
+     * @param Smarty_CacheResource $callback instance of Smarty_CacheResource to handle output caching\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     */\r
+    public function registerCacheResource($type, Smarty_CacheResource $callback)\r
+    {\r
+        $this->smarty->registered_cache_resources[$type] = $callback;\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Unregisters a cache resource\r
+     *\r
+     * @param string $type name of cache resource type\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     */\r
+    public function unregisterCacheResource($type)\r
+    {\r
+        if (isset($this->smarty->registered_cache_resources[$type])) {\r
+            unset($this->smarty->registered_cache_resources[$type]);\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Registers object to be used in templates\r
+     *\r
+     * @param string  $object        name of template object\r
+     * @param object  $object_impl   the referenced PHP object to register\r
+     * @param array   $allowed       list of allowed methods (empty = all)\r
+     * @param boolean $smarty_args   smarty argument format, else traditional\r
+     * @param array   $block_methods list of block-methods\r
+     * @param array $block_functs list of methods that are block format\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     * @throws SmartyException if any of the methods in $allowed or $block_methods are invalid\r
+     */\r
+    public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())\r
+    {\r
+        // test if allowed methodes callable\r
+        if (!empty($allowed)) {\r
+            foreach ((array) $allowed as $method) {\r
+                if (!is_callable(array($object_impl, $method))) {\r
+                    throw new SmartyException("Undefined method '$method' in registered object");\r
+                }\r
+            }\r
+        }\r
+        // test if block methodes callable\r
+        if (!empty($block_methods)) {\r
+            foreach ((array) $block_methods as $method) {\r
+                if (!is_callable(array($object_impl, $method))) {\r
+                    throw new SmartyException("Undefined method '$method' in registered object");\r
+                }\r
+            }\r
+        }\r
+        // register the object\r
+        $this->smarty->registered_objects[$object_name] =\r
+        array($object_impl, (array) $allowed, (boolean) $smarty_args, (array) $block_methods);\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * return a reference to a registered object\r
+     *\r
+     * @param string $name object name\r
+     * @return object\r
+     * @throws SmartyException if no such object is found\r
+     */\r
+    public function getRegisteredObject($name)\r
+    {\r
+        if (!isset($this->smarty->registered_objects[$name])) {\r
+            throw new SmartyException("'$name' is not a registered object");\r
+        }\r
+        if (!is_object($this->smarty->registered_objects[$name][0])) {\r
+            throw new SmartyException("registered '$name' is not an object");\r
+        }\r
+        return $this->smarty->registered_objects[$name][0];\r
+    }\r
+\r
+    /**\r
+     * unregister an object\r
+     *\r
+     * @param string $name object name\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     */\r
+    public function unregisterObject($name)\r
+    {\r
+        if (isset($this->smarty->registered_objects[$name])) {\r
+            unset($this->smarty->registered_objects[$name]);\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Registers static classes to be used in templates\r
+     *\r
+     * @param string $class name of template class\r
+     * @param string $class_impl the referenced PHP class to register\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     * @throws SmartyException if $class_impl does not refer to an existing class\r
+     */\r
+    public function registerClass($class_name, $class_impl)\r
+    {\r
+        // test if exists\r
+        if (!class_exists($class_impl)) {\r
+            throw new SmartyException("Undefined class '$class_impl' in register template class");\r
+        }\r
+        // register the class\r
+        $this->smarty->registered_classes[$class_name] = $class_impl;\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Registers a default plugin handler\r
+     *\r
+     * @param callable $callback class/method name\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     * @throws SmartyException if $callback is not callable\r
+     */\r
+    public function registerDefaultPluginHandler($callback)\r
+    {\r
+        if (is_callable($callback)) {\r
+            $this->smarty->default_plugin_handler_func = $callback;\r
+        } else {\r
+            throw new SmartyException("Default plugin handler '$callback' not callable");\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Registers a default template handler\r
+     *\r
+     * @param callable $callback class/method name\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     * @throws SmartyException if $callback is not callable\r
+     */\r
+    public function registerDefaultTemplateHandler($callback)\r
+    {\r
+        if (is_callable($callback)) {\r
+            $this->smarty->default_template_handler_func = $callback;\r
+        } else {\r
+            throw new SmartyException("Default template handler '$callback' not callable");\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Registers a default template handler\r
+     *\r
+     * @param callable $callback class/method name\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     * @throws SmartyException if $callback is not callable\r
+     */\r
+    public function registerDefaultConfigHandler($callback)\r
+    {\r
+        if (is_callable($callback)) {\r
+            $this->smarty->default_config_handler_func = $callback;\r
+        } else {\r
+            throw new SmartyException("Default config handler '$callback' not callable");\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Registers a filter function\r
+     *\r
+     * @param string $type filter type\r
+     * @param callback $callback\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     */\r
+    public function registerFilter($type, $callback)\r
+    {\r
+        $this->smarty->registered_filters[$type][$this->_get_filter_name($callback)] = $callback;\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Unregisters a filter function\r
+     *\r
+     * @param string $type filter type\r
+     * @param callback $callback\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     */\r
+    public function unregisterFilter($type, $callback)\r
+    {\r
+        $name = $this->_get_filter_name($callback);\r
+        if (isset($this->smarty->registered_filters[$type][$name])) {\r
+            unset($this->smarty->registered_filters[$type][$name]);\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * Return internal filter name\r
+     *\r
+     * @param callback $function_name\r
+     * @return string internal filter name\r
+     */\r
+    public function _get_filter_name($function_name)\r
+    {\r
+        if (is_array($function_name)) {\r
+            $_class_name = (is_object($function_name[0]) ?\r
+            get_class($function_name[0]) : $function_name[0]);\r
+            return $_class_name . '_' . $function_name[1];\r
+        } else {\r
+            return $function_name;\r
+        }\r
+    }\r
+\r
+    /**\r
+     * load a filter of specified type and name\r
+     *\r
+     * @param string $type filter type\r
+     * @param string $name filter name\r
+     * @throws SmartyException if filter could not be loaded\r
+     */\r
+    public function loadFilter($type, $name)\r
+    {\r
+        $_plugin = "smarty_{$type}filter_{$name}";\r
+        $_filter_name = $_plugin;\r
+        if ($this->smarty->loadPlugin($_plugin)) {\r
+            if (class_exists($_plugin, false)) {\r
+                $_plugin = array($_plugin, 'execute');\r
+            }\r
+            if (is_callable($_plugin)) {\r
+                $this->smarty->registered_filters[$type][$_filter_name] = $_plugin;\r
+                return true;\r
+            }\r
+        }\r
+        throw new SmartyException("{$type}filter \"{$name}\" not callable");\r
+    }\r
+\r
+    /**\r
+     * unload a filter of specified type and name\r
+     *\r
+     * @param string $type filter type\r
+     * @param string $name filter name\r
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining\r
+     */\r
+    public function unloadFilter($type, $name)\r
+    {\r
+        $_filter_name = "smarty_{$type}filter_{$name}";\r
+        if (isset($this->smarty->registered_filters[$type][$_filter_name])) {\r
+            unset ($this->smarty->registered_filters[$type][$_filter_name]);\r
+        }\r
+\r
+        return $this;\r
+    }\r
+\r
+    /**\r
+     * preg_replace callback to convert camelcase getter/setter to underscore property names\r
+     *\r
+     * @param string $match match string\r
+     * @return string replacemant\r
+     */\r
+    private function replaceCamelcase($match) {\r
+        return "_" . strtolower($match[1]);\r
+    }\r
+\r
+    /**\r
+     * Handle unknown class methods\r
+     *\r
+     * @param string $name unknown method-name\r
+     * @param array  $args argument array\r
+     */\r
+    public function __call($name, $args)\r
+    {\r
+        static $_prefixes = array('set' => true, 'get' => true);\r
+        static $_resolved_property_name = array();\r
+        static $_resolved_property_source = array();\r
+\r
+        // method of Smarty object?\r
+        if (method_exists($this->smarty, $name)) {\r
+            return call_user_func_array(array($this->smarty, $name), $args);\r
+        }\r
+        // see if this is a set/get for a property\r
+        $first3 = strtolower(substr($name, 0, 3));\r
+        if (isset($_prefixes[$first3]) && isset($name[3]) && $name[3] !== '_') {\r
+            if (isset($_resolved_property_name[$name])) {\r
+                $property_name = $_resolved_property_name[$name];\r
+            } else {\r
+                // try to keep case correct for future PHP 6.0 case-sensitive class methods\r
+                // lcfirst() not available < PHP 5.3.0, so improvise\r
+                $property_name = strtolower(substr($name, 3, 1)) . substr($name, 4);\r
+                // convert camel case to underscored name\r
+                $property_name = preg_replace_callback('/([A-Z])/', array($this,'replaceCamelcase'), $property_name);\r
+                $_resolved_property_name[$name] = $property_name;\r
+            }\r
+            if (isset($_resolved_property_source[$property_name])) {\r
+                $_is_this = $_resolved_property_source[$property_name];\r
+            } else {\r
+                $_is_this = null;\r
+                if (property_exists($this, $property_name)) {\r
+                    $_is_this = true;\r
+                } else if (property_exists($this->smarty, $property_name)) {\r
+                    $_is_this = false;\r
+                }\r
+                $_resolved_property_source[$property_name] = $_is_this;\r
+            }\r
+            if ($_is_this) {\r
+                if ($first3 == 'get')\r
+                return $this->$property_name;\r
+                else\r
+                return $this->$property_name = $args[0];\r
+            } else if ($_is_this === false) {\r
+                if ($first3 == 'get')\r
+                return $this->smarty->$property_name;\r
+                else\r
+                return $this->smarty->$property_name = $args[0];\r
+            } else {\r
+                throw new SmartyException("property '$property_name' does not exist.");\r
+                return false;\r
+            }\r
+        }\r
+        if ($name == 'Smarty') {\r
+            throw new SmartyException("PHP5 requires you to call __construct() instead of Smarty()");\r
+        }\r
+        // must be unknown\r
+        throw new SmartyException("Call of unknown method '$name'.");\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php b/library/Smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php
new file mode 100644 (file)
index 0000000..8590623
--- /dev/null
@@ -0,0 +1,661 @@
+<?php\r
+\r
+/**\r
+ * Smarty Internal Plugin Smarty Template Compiler Base\r
+ *\r
+ * This file contains the basic classes and methodes for compiling Smarty templates with lexer/parser\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * Main abstract compiler class\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ */\r
+abstract class Smarty_Internal_TemplateCompilerBase {\r
+\r
+    /**\r
+     * hash for nocache sections\r
+     *\r
+     * @var mixed\r
+     */\r
+    private $nocache_hash = null;\r
+\r
+    /**\r
+     * suppress generation of nocache code\r
+     *\r
+     * @var bool\r
+     */\r
+    public $suppressNocacheProcessing = false;\r
+\r
+    /**\r
+     * suppress generation of merged template code\r
+     *\r
+     * @var bool\r
+     */\r
+    public $suppressMergedTemplates = false;\r
+\r
+    /**\r
+     * compile tag objects\r
+     *\r
+     * @var array\r
+     */\r
+    public static $_tag_objects = array();\r
+\r
+    /**\r
+     * tag stack\r
+     *\r
+     * @var array\r
+     */\r
+    public $_tag_stack = array();\r
+\r
+    /**\r
+     * current template\r
+     *\r
+     * @var Smarty_Internal_Template\r
+     */\r
+    public $template = null;\r
+\r
+    /**\r
+     * merged templates\r
+     *\r
+     * @var array\r
+     */\r
+    public $merged_templates = array();\r
+\r
+    /**\r
+     * flag when compiling {block}\r
+     *\r
+     * @var bool\r
+     */\r
+    public $inheritance = false;\r
+\r
+    /**\r
+     * plugins loaded by default plugin handler\r
+     *\r
+     * @var array\r
+     */\r
+    public $default_handler_plugins = array();\r
+\r
+    /**\r
+     * saved preprocessed modifier list\r
+     *\r
+     * @var mixed\r
+     */\r
+    public $default_modifier_list = null;\r
+\r
+    /**\r
+     * force compilation of complete template as nocache\r
+     * @var boolean\r
+     */\r
+    public $forceNocache = false;\r
+\r
+    /**\r
+     * suppress Smarty header code in compiled template\r
+     * @var bool\r
+     */\r
+    public $suppressHeader = false;\r
+\r
+    /**\r
+     * suppress template property header code in compiled template\r
+     * @var bool\r
+     */\r
+    public $suppressTemplatePropertyHeader = false;\r
+\r
+    /**\r
+     * flag if compiled template file shall we written\r
+     * @var bool\r
+     */\r
+    public $write_compiled_code = true;\r
+\r
+    /**\r
+     * flag if currently a template function is compiled\r
+     * @var bool\r
+     */\r
+    public $compiles_template_function = false;\r
+\r
+    /**\r
+     * called subfuntions from template function\r
+     * @var array\r
+     */\r
+    public $called_functions = array();\r
+\r
+    /**\r
+     * flags for used modifier plugins\r
+     * @var array\r
+     */\r
+    public $modifier_plugins = array();\r
+\r
+    /**\r
+     * type of already compiled modifier\r
+     * @var array\r
+     */\r
+    public $known_modifier_type = array();\r
+\r
+    /**\r
+     * Initialize compiler\r
+     */\r
+    public function __construct() {\r
+        $this->nocache_hash = str_replace('.', '-', uniqid(rand(), true));\r
+    }\r
+\r
+    /**\r
+     * Method to compile a Smarty template\r
+     *\r
+     * @param  Smarty_Internal_Template $template template object to compile\r
+     * @return bool true if compiling succeeded, false if it failed\r
+     */\r
+    public function compileTemplate(Smarty_Internal_Template $template) {\r
+        if (empty($template->properties['nocache_hash'])) {\r
+            $template->properties['nocache_hash'] = $this->nocache_hash;\r
+        } else {\r
+            $this->nocache_hash = $template->properties['nocache_hash'];\r
+        }\r
+        // flag for nochache sections\r
+        $this->nocache = false;\r
+        $this->tag_nocache = false;\r
+        // save template object in compiler class\r
+        $this->template = $template;\r
+        // reset has noche code flag\r
+        $this->template->has_nocache_code = false;\r
+        $this->smarty->_current_file = $saved_filepath = $this->template->source->filepath;\r
+        // template header code\r
+        $template_header = '';\r
+        if (!$this->suppressHeader) {\r
+            $template_header .= "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n";\r
+            $template_header .= "         compiled from \"" . $this->template->source->filepath . "\" */ ?>\n";\r
+        }\r
+\r
+        do {\r
+            // flag for aborting current and start recompile\r
+            $this->abort_and_recompile = false;\r
+            // get template source\r
+            $_content = $template->source->content;\r
+            // run prefilter if required\r
+            if (isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) {\r
+                $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $template);\r
+            }\r
+            // on empty template just return header\r
+            if ($_content == '') {\r
+                if ($this->suppressTemplatePropertyHeader) {\r
+                    $code = '';\r
+                } else {\r
+                    $code = $template_header . $template->createTemplateCodeFrame();\r
+                }\r
+                return $code;\r
+            }\r
+            // call compiler\r
+            $_compiled_code = $this->doCompile($_content);\r
+        } while ($this->abort_and_recompile);\r
+        $this->template->source->filepath = $saved_filepath;\r
+        // free memory\r
+        unset($this->parser->root_buffer, $this->parser->current_buffer, $this->parser, $this->lex, $this->template);\r
+        self::$_tag_objects = array();\r
+        // return compiled code to template object\r
+        $merged_code = '';\r
+        if (!$this->suppressMergedTemplates && !empty($this->merged_templates)) {\r
+            foreach ($this->merged_templates as $code) {\r
+                $merged_code .= $code;\r
+            }\r
+            // run postfilter if required on merged code\r
+            if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) {\r
+                $merged_code = Smarty_Internal_Filter_Handler::runFilter('post', $merged_code, $template);\r
+            }\r
+        }\r
+        // run postfilter if required on compiled template code\r
+        if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) {\r
+            $_compiled_code = Smarty_Internal_Filter_Handler::runFilter('post', $_compiled_code, $template);\r
+        }\r
+        if ($this->suppressTemplatePropertyHeader) {\r
+            $code = $_compiled_code . $merged_code;\r
+        } else {\r
+            $code = $template_header . $template->createTemplateCodeFrame($_compiled_code) . $merged_code;\r
+        }\r
+        return $code;\r
+    }\r
+\r
+    /**\r
+     * Compile Tag\r
+     *\r
+     * This is a call back from the lexer/parser\r
+     * It executes the required compile plugin for the Smarty tag\r
+     *\r
+     * @param string $tag       tag name\r
+     * @param array  $args      array with tag attributes\r
+     * @param array  $parameter array with compilation parameter\r
+     * @return string compiled code\r
+     */\r
+    public function compileTag($tag, $args, $parameter = array()) {\r
+        // $args contains the attributes parsed and compiled by the lexer/parser\r
+        // assume that tag does compile into code, but creates no HTML output\r
+        $this->has_code = true;\r
+        $this->has_output = false;\r
+        // log tag/attributes\r
+        if (isset($this->smarty->get_used_tags) && $this->smarty->get_used_tags) {\r
+            $this->template->used_tags[] = array($tag, $args);\r
+        }\r
+        // check nocache option flag\r
+        if (in_array("'nocache'", $args) || in_array(array('nocache' => 'true'), $args)\r
+                || in_array(array('nocache' => '"true"'), $args) || in_array(array('nocache' => "'true'"), $args)) {\r
+            $this->tag_nocache = true;\r
+        }\r
+        // compile the smarty tag (required compile classes to compile the tag are autoloaded)\r
+        if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) {\r
+            if (isset($this->smarty->template_functions[$tag])) {\r
+                // template defined by {template} tag\r
+                $args['_attr']['name'] = "'" . $tag . "'";\r
+                $_output = $this->callTagCompiler('call', $args, $parameter);\r
+            }\r
+        }\r
+        if ($_output !== false) {\r
+            if ($_output !== true) {\r
+                // did we get compiled code\r
+                if ($this->has_code) {\r
+                    // Does it create output?\r
+                    if ($this->has_output) {\r
+                        $_output .= "\n";\r
+                    }\r
+                    // return compiled code\r
+                    return $_output;\r
+                }\r
+            }\r
+            // tag did not produce compiled code\r
+            return '';\r
+        } else {\r
+            // map_named attributes\r
+            if (isset($args['_attr'])) {\r
+                foreach ($args['_attr'] as $key => $attribute) {\r
+                    if (is_array($attribute)) {\r
+                        $args = array_merge($args, $attribute);\r
+                    }\r
+                }\r
+            }\r
+            // not an internal compiler tag\r
+            if (strlen($tag) < 6 || substr($tag, -5) != 'close') {\r
+                // check if tag is a registered object\r
+                if (isset($this->smarty->registered_objects[$tag]) && isset($parameter['object_methode'])) {\r
+                    $methode = $parameter['object_methode'];\r
+                    if (!in_array($methode, $this->smarty->registered_objects[$tag][3]) &&\r
+                            (empty($this->smarty->registered_objects[$tag][1]) || in_array($methode, $this->smarty->registered_objects[$tag][1]))) {\r
+                        return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $methode);\r
+                    } elseif (in_array($methode, $this->smarty->registered_objects[$tag][3])) {\r
+                        return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);\r
+                    } else {\r
+                        return $this->trigger_template_error('unallowed methode "' . $methode . '" in registered object "' . $tag . '"', $this->lex->taglineno);\r
+                    }\r
+                }\r
+                // check if tag is registered\r
+                foreach (array(Smarty::PLUGIN_COMPILER, Smarty::PLUGIN_FUNCTION, Smarty::PLUGIN_BLOCK) as $plugin_type) {\r
+                    if (isset($this->smarty->registered_plugins[$plugin_type][$tag])) {\r
+                        // if compiler function plugin call it now\r
+                        if ($plugin_type == Smarty::PLUGIN_COMPILER) {\r
+                            $new_args = array();\r
+                            foreach ($args as $key => $mixed) {\r
+                                if (is_array($mixed)) {\r
+                                    $new_args = array_merge($new_args, $mixed);\r
+                                } else {\r
+                                    $new_args[$key] = $mixed;\r
+                                }\r
+                            }\r
+                            if (!$this->smarty->registered_plugins[$plugin_type][$tag][1]) {\r
+                                $this->tag_nocache = true;\r
+                            }\r
+                            $function = $this->smarty->registered_plugins[$plugin_type][$tag][0];\r
+                            if (!is_array($function)) {\r
+                                return $function($new_args, $this);\r
+                            } else if (is_object($function[0])) {\r
+                                return $this->smarty->registered_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);\r
+                            } else {\r
+                                return call_user_func_array($function, array($new_args, $this));\r
+                            }\r
+                        }\r
+                        // compile registered function or block function\r
+                        if ($plugin_type == Smarty::PLUGIN_FUNCTION || $plugin_type == Smarty::PLUGIN_BLOCK) {\r
+                            return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, $tag);\r
+                        }\r
+                    }\r
+                }\r
+                // check plugins from plugins folder\r
+                foreach ($this->smarty->plugin_search_order as $plugin_type) {\r
+                    if ($plugin_type == Smarty::PLUGIN_BLOCK && $this->smarty->loadPlugin('smarty_compiler_' . $tag) && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))) {\r
+                        $plugin = 'smarty_compiler_' . $tag;\r
+                        if (is_callable($plugin)) {\r
+                            // convert arguments format for old compiler plugins\r
+                            $new_args = array();\r
+                            foreach ($args as $key => $mixed) {\r
+                                if (is_array($mixed)) {\r
+                                    $new_args = array_merge($new_args, $mixed);\r
+                                } else {\r
+                                    $new_args[$key] = $mixed;\r
+                                }\r
+                            }\r
+                            return $plugin($new_args, $this->smarty);\r
+                        }\r
+                        if (class_exists($plugin, false)) {\r
+                            $plugin_object = new $plugin;\r
+                            if (method_exists($plugin_object, 'compile')) {\r
+                                return $plugin_object->compile($args, $this);\r
+                            }\r
+                        }\r
+                        throw new SmartyException("Plugin \"{$tag}\" not callable");\r
+                    } else {\r
+                        if ($function = $this->getPlugin($tag, $plugin_type)) {\r
+                            if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {\r
+                                return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $parameter, $tag, $function);\r
+                            }\r
+                        }\r
+                    }\r
+                }\r
+                if (is_callable($this->smarty->default_plugin_handler_func)) {\r
+                    $found = false;\r
+                    // look for already resolved tags\r
+                    foreach ($this->smarty->plugin_search_order as $plugin_type) {\r
+                        if (isset($this->default_handler_plugins[$plugin_type][$tag])) {\r
+                            $found = true;\r
+                            break;\r
+                        }\r
+                    }\r
+                    if (!$found) {\r
+                        // call default handler\r
+                        foreach ($this->smarty->plugin_search_order as $plugin_type) {\r
+                            if ($this->getPluginFromDefaultHandler($tag, $plugin_type)) {\r
+                                $found = true;\r
+                                break;\r
+                            }\r
+                        }\r
+                    }\r
+                    if ($found) {\r
+                        // if compiler function plugin call it now\r
+                        if ($plugin_type == Smarty::PLUGIN_COMPILER) {\r
+                            $new_args = array();\r
+                            foreach ($args as $mixed) {\r
+                                $new_args = array_merge($new_args, $mixed);\r
+                            }\r
+                            $function = $this->default_handler_plugins[$plugin_type][$tag][0];\r
+                            if (!is_array($function)) {\r
+                                return $function($new_args, $this);\r
+                            } else if (is_object($function[0])) {\r
+                                return $this->default_handler_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);\r
+                            } else {\r
+                                return call_user_func_array($function, array($new_args, $this));\r
+                            }\r
+                        } else {\r
+                            return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, $tag);\r
+                        }\r
+                    }\r
+                }\r
+            } else {\r
+                // compile closing tag of block function\r
+                $base_tag = substr($tag, 0, -5);\r
+                // check if closing tag is a registered object\r
+                if (isset($this->smarty->registered_objects[$base_tag]) && isset($parameter['object_methode'])) {\r
+                    $methode = $parameter['object_methode'];\r
+                    if (in_array($methode, $this->smarty->registered_objects[$base_tag][3])) {\r
+                        return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);\r
+                    } else {\r
+                        return $this->trigger_template_error('unallowed closing tag methode "' . $methode . '" in registered object "' . $base_tag . '"', $this->lex->taglineno);\r
+                    }\r
+                }\r
+                // registered block tag ?\r
+                if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag]) || isset($this->default_handler_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) {\r
+                    return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag);\r
+                }\r
+                // block plugin?\r
+                if ($function = $this->getPlugin($base_tag, Smarty::PLUGIN_BLOCK)) {\r
+                    return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function);\r
+                }\r
+                // registered compiler plugin ?\r
+                if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag])) {\r
+                    // if compiler function plugin call it now\r
+                    $args = array();\r
+                    if (!$this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][1]) {\r
+                        $this->tag_nocache = true;\r
+                    }\r
+                    $function = $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0];\r
+                    if (!is_array($function)) {\r
+                        return $function($args, $this);\r
+                    } else if (is_object($function[0])) {\r
+                        return $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0][0]->$function[1]($args, $this);\r
+                    } else {\r
+                        return call_user_func_array($function, array($args, $this));\r
+                    }\r
+                }\r
+                if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {\r
+                    $plugin = 'smarty_compiler_' . $tag;\r
+                    if (is_callable($plugin)) {\r
+                        return $plugin($args, $this->smarty);\r
+                    }\r
+                    if (class_exists($plugin, false)) {\r
+                        $plugin_object = new $plugin;\r
+                        if (method_exists($plugin_object, 'compile')) {\r
+                            return $plugin_object->compile($args, $this);\r
+                        }\r
+                    }\r
+                    throw new SmartyException("Plugin \"{$tag}\" not callable");\r
+                }\r
+            }\r
+            $this->trigger_template_error("unknown tag \"" . $tag . "\"", $this->lex->taglineno);\r
+        }\r
+    }\r
+\r
+    /**\r
+     * lazy loads internal compile plugin for tag and calls the compile methode\r
+     *\r
+     * compile objects cached for reuse.\r
+     * class name format:  Smarty_Internal_Compile_TagName\r
+     * plugin filename format: Smarty_Internal_Tagname.php\r
+     *\r
+     * @param string $tag   tag name\r
+     * @param array $args   list of tag attributes\r
+     * @param mixed $param1 optional parameter\r
+     * @param mixed $param2 optional parameter\r
+     * @param mixed $param3 optional parameter\r
+     * @return string compiled code\r
+     */\r
+    public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null) {\r
+        // re-use object if already exists\r
+        if (isset(self::$_tag_objects[$tag])) {\r
+            // compile this tag\r
+            return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);\r
+        }\r
+        // lazy load internal compiler plugin\r
+        $class_name = 'Smarty_Internal_Compile_' . $tag;\r
+        if ($this->smarty->loadPlugin($class_name)) {\r
+            // check if tag allowed by security\r
+            if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {\r
+                // use plugin if found\r
+                self::$_tag_objects[$tag] = new $class_name;\r
+                // compile this tag\r
+                return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);\r
+            }\r
+        }\r
+        // no internal compile plugin for this tag\r
+        return false;\r
+    }\r
+\r
+    /**\r
+     * Check for plugins and return function name\r
+     *\r
+     * @param string $pugin_name  name of plugin or function\r
+     * @param string $plugin_type type of plugin\r
+     * @return string call name of function\r
+     */\r
+    public function getPlugin($plugin_name, $plugin_type) {\r
+        $function = null;\r
+        if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {\r
+            if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {\r
+                $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'];\r
+            } else if (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) {\r
+                $this->template->required_plugins['nocache'][$plugin_name][$plugin_type] = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type];\r
+                $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'];\r
+            }\r
+        } else {\r
+            if (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) {\r
+                $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'];\r
+            } else if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {\r
+                $this->template->required_plugins['compiled'][$plugin_name][$plugin_type] = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type];\r
+                $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'];\r
+            }\r
+        }\r
+        if (isset($function)) {\r
+            if ($plugin_type == 'modifier') {\r
+                $this->modifier_plugins[$plugin_name] = true;\r
+            }\r
+            return $function;\r
+        }\r
+        // loop through plugin dirs and find the plugin\r
+        $function = 'smarty_' . $plugin_type . '_' . $plugin_name;\r
+        $file = $this->smarty->loadPlugin($function, false);\r
+\r
+        if (is_string($file)) {\r
+            if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {\r
+                $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['file'] = $file;\r
+                $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'] = $function;\r
+            } else {\r
+                $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['file'] = $file;\r
+                $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'] = $function;\r
+            }\r
+            if ($plugin_type == 'modifier') {\r
+                $this->modifier_plugins[$plugin_name] = true;\r
+            }\r
+            return $function;\r
+        }\r
+        if (is_callable($function)) {\r
+            // plugin function is defined in the script\r
+            return $function;\r
+        }\r
+        return false;\r
+    }\r
+\r
+    /**\r
+     * Check for plugins by default plugin handler\r
+     *\r
+     * @param string $tag         name of tag\r
+     * @param string $plugin_type type of plugin\r
+     * @return boolean true if found\r
+     */\r
+    public function getPluginFromDefaultHandler($tag, $plugin_type) {\r
+        $callback = null;\r
+        $script = null;\r
+        $cacheable = true;\r
+        $result = call_user_func_array(\r
+                $this->smarty->default_plugin_handler_func, array($tag, $plugin_type, $this->template, &$callback, &$script, &$cacheable)\r
+        );\r
+        if ($result) {\r
+            $this->tag_nocache = $this->tag_nocache || !$cacheable;\r
+            if ($script !== null) {\r
+                if (is_file($script)) {\r
+                    if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {\r
+                        $this->template->required_plugins['nocache'][$tag][$plugin_type]['file'] = $script;\r
+                        $this->template->required_plugins['nocache'][$tag][$plugin_type]['function'] = $callback;\r
+                    } else {\r
+                        $this->template->required_plugins['compiled'][$tag][$plugin_type]['file'] = $script;\r
+                        $this->template->required_plugins['compiled'][$tag][$plugin_type]['function'] = $callback;\r
+                    }\r
+                    include_once $script;\r
+                } else {\r
+                    $this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found");\r
+                }\r
+            }\r
+            if (!is_string($callback) && !(is_array($callback) && is_string($callback[0]) && is_string($callback[1]))) {\r
+                $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" must be a static function name or array of class and function name");\r
+            }\r
+            if (is_callable($callback)) {\r
+                $this->default_handler_plugins[$plugin_type][$tag] = array($callback, true, array());\r
+                return true;\r
+            } else {\r
+                $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" not callable");\r
+            }\r
+        }\r
+        return false;\r
+    }\r
+\r
+    /**\r
+     * Inject inline code for nocache template sections\r
+     *\r
+     * This method gets the content of each template element from the parser.\r
+     * If the content is compiled code and it should be not cached the code is injected\r
+     * into the rendered output.\r
+     *\r
+     * @param string  $content content of template element\r
+     * @param boolean $is_code true if content is compiled code\r
+     * @return string content\r
+     */\r
+    public function processNocacheCode($content, $is_code) {\r
+        // If the template is not evaluated and we have a nocache section and or a nocache tag\r
+        if ($is_code && !empty($content)) {\r
+            // generate replacement code\r
+            if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&\r
+                    ($this->nocache || $this->tag_nocache || $this->forceNocache == 2)) {\r
+                $this->template->has_nocache_code = true;\r
+                $_output = str_replace("'", "\'", $content);\r
+                $_output = str_replace('\\\\', '\\\\\\\\', $_output);\r
+                $_output = str_replace("^#^", "'", $_output);\r
+                $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";\r
+                // make sure we include modifer plugins for nocache code\r
+                foreach ($this->modifier_plugins as $plugin_name => $dummy) {\r
+                    if (isset($this->template->required_plugins['compiled'][$plugin_name]['modifier'])) {\r
+                        $this->template->required_plugins['nocache'][$plugin_name]['modifier'] = $this->template->required_plugins['compiled'][$plugin_name]['modifier'];\r
+                    }\r
+                }\r
+            } else {\r
+                $_output = $content;\r
+            }\r
+        } else {\r
+            $_output = $content;\r
+        }\r
+        $this->modifier_plugins = array();\r
+        $this->suppressNocacheProcessing = false;\r
+        $this->tag_nocache = false;\r
+        return $_output;\r
+    }\r
+\r
+    /**\r
+     * display compiler error messages without dying\r
+     *\r
+     * If parameter $args is empty it is a parser detected syntax error.\r
+     * In this case the parser is called to obtain information about expected tokens.\r
+     *\r
+     * If parameter $args contains a string this is used as error message\r
+     *\r
+     * @param string $args individual error message or null\r
+     * @param string $line line-number\r
+     * @throws SmartyCompilerException when an unexpected token is found\r
+     */\r
+    public function trigger_template_error($args = null, $line = null) {\r
+        // get template source line which has error\r
+        if (!isset($line)) {\r
+            $line = $this->lex->line;\r
+        }\r
+        $match = preg_split("/\n/", $this->lex->data);\r
+        $error_text = 'Syntax Error in template "' . $this->template->source->filepath . '"  on line ' . $line . ' "' . htmlspecialchars(trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1]))) . '" ';\r
+        if (isset($args)) {\r
+            // individual error message\r
+            $error_text .= $args;\r
+        } else {\r
+            // expected token from parser\r
+            $error_text .= ' - Unexpected "' . $this->lex->value . '"';\r
+            if (count($this->parser->yy_get_expected_tokens($this->parser->yymajor)) <= 4) {\r
+                foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {\r
+                    $exp_token = $this->parser->yyTokenName[$token];\r
+                    if (isset($this->lex->smarty_token_names[$exp_token])) {\r
+                        // token type from lexer\r
+                        $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';\r
+                    } else {\r
+                        // otherwise internal token name\r
+                        $expect[] = $this->parser->yyTokenName[$token];\r
+                    }\r
+                }\r
+                $error_text .= ', expected one of: ' . implode(' , ', $expect);\r
+            }\r
+        }\r
+        throw new SmartyCompilerException($error_text);\r
+    }\r
+\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_templatelexer.php b/library/Smarty/libs/sysplugins/smarty_internal_templatelexer.php
new file mode 100644 (file)
index 0000000..bfc413a
--- /dev/null
@@ -0,0 +1,1190 @@
+<?php
+/**
+* Smarty Internal Plugin Templatelexer
+*
+* This is the lexer to break the template source into tokens
+* @package Smarty
+* @subpackage Compiler
+* @author Uwe Tews
+*/
+/**
+* Smarty Internal Plugin Templatelexer
+*/
+class Smarty_Internal_Templatelexer
+{
+    public $data;
+    public $counter;
+    public $token;
+    public $value;
+    public $node;
+    public $line;
+    public $taglineno;
+    public $state = 1;
+    private $heredoc_id_stack = Array();
+    public $smarty_token_names = array (               // Text for parser error messages
+                               'IDENTITY'      => '===',
+                               'NONEIDENTITY'  => '!==',
+                               'EQUALS'        => '==',
+                               'NOTEQUALS'     => '!=',
+                               'GREATEREQUAL' => '(>=,ge)',
+                               'LESSEQUAL' => '(<=,le)',
+                               'GREATERTHAN' => '(>,gt)',
+                               'LESSTHAN' => '(<,lt)',
+                               'MOD' => '(%,mod)',
+                               'NOT'                   => '(!,not)',
+                               'LAND'          => '(&&,and)',
+                               'LOR'                   => '(||,or)',
+                               'LXOR'                  => 'xor',
+                               'OPENP'         => '(',
+                               'CLOSEP'        => ')',
+                               'OPENB'         => '[',
+                               'CLOSEB'        => ']',
+                               'PTR'                   => '->',
+                               'APTR'          => '=>',
+                               'EQUAL'         => '=',
+                               'NUMBER'        => 'number',
+                               'UNIMATH'       => '+" , "-',
+                               'MATH'          => '*" , "/" , "%',
+                               'INCDEC'        => '++" , "--',
+                               'SPACE'         => ' ',
+                               'DOLLAR'        => '$',
+                               'SEMICOLON' => ';',
+                               'COLON'         => ':',
+                               'DOUBLECOLON'           => '::',
+                               'AT'            => '@',
+                               'HATCH'         => '#',
+                               'QUOTE'         => '"',
+                               'BACKTICK'              => '`',
+                               'VERT'          => '|',
+                               'DOT'                   => '.',
+                               'COMMA'         => '","',
+                               'ANDSYM'                => '"&"',
+                               'QMARK'         => '"?"',
+                               'ID'                    => 'identifier',
+                               'TEXT'          => 'text',
+                               'FAKEPHPSTARTTAG'       => 'Fake PHP start tag',
+                               'PHPSTARTTAG'   => 'PHP start tag',
+                               'PHPENDTAG'     => 'PHP end tag',
+                                               'LITERALSTART'  => 'Literal start',
+                                               'LITERALEND'    => 'Literal end',
+                               'LDELSLASH' => 'closing tag',
+                               'COMMENT' => 'comment',
+                               'AS' => 'as',
+                               'TO' => 'to',
+                               );
+
+
+    function __construct($data,$compiler)
+    {
+//        $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
+        $this->data = $data;
+        $this->counter = 0;
+        $this->line = 1;
+        $this->smarty = $compiler->smarty;
+        $this->compiler = $compiler;
+        $this->ldel = preg_quote($this->smarty->left_delimiter,'/');
+        $this->ldel_length = strlen($this->smarty->left_delimiter);
+        $this->rdel = preg_quote($this->smarty->right_delimiter,'/');
+        $this->smarty_token_names['LDEL'] =    $this->smarty->left_delimiter;
+        $this->smarty_token_names['RDEL'] =    $this->smarty->right_delimiter;
+        $this->mbstring_overload = ini_get('mbstring.func_overload') & 2;
+     }
+
+
+    private $_yy_state = 1;
+    private $_yy_stack = array();
+
+    function yylex()
+    {
+        return $this->{'yylex' . $this->_yy_state}();
+    }
+
+    function yypushstate($state)
+    {
+        array_push($this->_yy_stack, $this->_yy_state);
+        $this->_yy_state = $state;
+    }
+
+    function yypopstate()
+    {
+        $this->_yy_state = array_pop($this->_yy_stack);
+    }
+
+    function yybegin($state)
+    {
+        $this->_yy_state = $state;
+    }
+
+
+
+    function yylex1()
+    {
+        $tokenMap = array (
+              1 => 0,
+              2 => 0,
+              3 => 1,
+              5 => 0,
+              6 => 0,
+              7 => 0,
+              8 => 0,
+              9 => 0,
+              10 => 0,
+              11 => 1,
+              13 => 0,
+              14 => 0,
+              15 => 0,
+              16 => 0,
+              17 => 0,
+              18 => 0,
+              19 => 0,
+              20 => 0,
+              21 => 0,
+              22 => 0,
+              23 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G(".$this->ldel."[$]smarty\\.block\\.child".$this->rdel.")|\G(\\{\\})|\G(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|\G(".$this->ldel."strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s*setfilter\\s+)|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(<%)|\G(%>)|\G([\S\s])/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state TEXT');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const TEXT = 1;
+    function yy_r1_1($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILD;
+    }
+    function yy_r1_2($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+    }
+    function yy_r1_3($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_COMMENT;
+    }
+    function yy_r1_5($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Templateparser::TP_STRIPON;
+    }
+    function yy_r1_6($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal) {
+    $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+    $this->token = Smarty_Internal_Templateparser::TP_STRIPON;
+  }
+    }
+    function yy_r1_7($yy_subpatterns)
+    {
+
+    $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF;
+    }
+    function yy_r1_8($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal) {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+    $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF;
+  }
+    }
+    function yy_r1_9($yy_subpatterns)
+    {
+
+   $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
+   $this->yypushstate(self::LITERAL);
+    }
+    function yy_r1_10($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal) {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r1_11($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r1_13($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r1_14($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r1_15($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r1_16($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal) {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDEL;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r1_17($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+    }
+    function yy_r1_18($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LDEL;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+    }
+    function yy_r1_19($yy_subpatterns)
+    {
+
+  if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
+    $this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
+  } elseif ($this->value == '<?xml') {
+      $this->token = Smarty_Internal_Templateparser::TP_XMLTAG;
+  } else {
+    $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
+    $this->value = substr($this->value, 0, 2);
+  }
+     }
+    function yy_r1_20($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
+    }
+    function yy_r1_21($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
+    }
+    function yy_r1_22($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
+    }
+    function yy_r1_23($yy_subpatterns)
+    {
+
+  if ($this->mbstring_overload) {
+    $to = mb_strlen($this->data,'latin1');
+  } else {
+    $to = strlen($this->data);
+  }
+  preg_match("/{$this->ldel}|<\?|\?>|<%|%>/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter);
+  if (isset($match[0][1])) {
+    $to = $match[0][1];
+  }
+  if ($this->mbstring_overload) {
+    $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1');
+  } else {
+    $this->value = substr($this->data,$this->counter,$to-$this->counter);
+  }
+  $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+    }
+
+
+    function yylex2()
+    {
+        $tokenMap = array (
+              1 => 0,
+              2 => 0,
+              3 => 1,
+              5 => 0,
+              6 => 0,
+              7 => 0,
+              8 => 0,
+              9 => 0,
+              10 => 0,
+              11 => 0,
+              12 => 0,
+              13 => 0,
+              14 => 0,
+              15 => 0,
+              16 => 0,
+              17 => 0,
+              18 => 0,
+              19 => 0,
+              20 => 1,
+              22 => 1,
+              24 => 1,
+              26 => 0,
+              27 => 0,
+              28 => 0,
+              29 => 0,
+              30 => 0,
+              31 => 0,
+              32 => 0,
+              33 => 0,
+              34 => 0,
+              35 => 0,
+              36 => 0,
+              37 => 0,
+              38 => 0,
+              39 => 0,
+              40 => 0,
+              41 => 0,
+              42 => 0,
+              43 => 3,
+              47 => 0,
+              48 => 0,
+              49 => 0,
+              50 => 0,
+              51 => 0,
+              52 => 0,
+              53 => 0,
+              54 => 0,
+              55 => 1,
+              57 => 1,
+              59 => 0,
+              60 => 0,
+              61 => 0,
+              62 => 0,
+              63 => 0,
+              64 => 0,
+              65 => 0,
+              66 => 0,
+              67 => 0,
+              68 => 0,
+              69 => 0,
+              70 => 0,
+              71 => 0,
+              72 => 0,
+              73 => 0,
+              74 => 0,
+              75 => 0,
+              76 => 0,
+              77 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(".$this->rdel.")|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*===\\s*)|\G(\\s*!==\\s*)|\G(\\s*==\\s*|\\s+eq\\s+)|\G(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|\G(\\s*>=\\s*|\\s+(ge|gte)\\s+)|\G(\\s*<=\\s*|\\s+(le|lte)\\s+)|\G(\\s*>\\s*|\\s+gt\\s+)|\G(\\s*<\\s*|\\s+lt\\s+)|\G(\\s+mod\\s+)|\G(!\\s*|not\\s+)|\G(\\s*&&\\s*|\\s*and\\s+)|\G(\\s*\\|\\|\\s*|\\s*or\\s+)|\G(\\s*xor\\s+)|\G(\\s+is\\s+odd\\s+by\\s+)|\G(\\s+is\\s+not\\s+odd\\s+by\\s+)|\G(\\s+is\\s+odd)|\G(\\s+is\\s+not\\s+odd)|\G(\\s+is\\s+even\\s+by\\s+)|\G(\\s+is\\s+not\\s+even\\s+by\\s+)|\G(\\s+is\\s+even)|\G(\\s+is\\s+not\\s+even)|\G(\\s+is\\s+div\\s+by\\s+)|\G(\\s+is\\s+not\\s+div\\s+by\\s+)|\G(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\)\\s*)|\G(\\s*\\(\\s*)|\G(\\s*\\))|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*->\\s*)|\G(\\s*=>\\s*)|\G(\\s*=\\s*)|\G(\\+\\+|--)|\G(\\s*(\\+|-)\\s*)|\G(\\s*(\\*|\/|%)\\s*)|\G(\\$)|\G(\\s*;)|\G(::)|\G(\\s*:\\s*)|\G(@)|\G(#)|\G(\")|\G(`)|\G(\\|)|\G(\\.)|\G(\\s*,\\s*)|\G(\\s*&\\s*)|\G(\\s*\\?\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s?=\\s?)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G(\\s+)|\G([\S\s])/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state SMARTY');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r2_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const SMARTY = 2;
+    function yy_r2_1($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;
+    }
+    function yy_r2_2($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal) {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r2_3($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r2_5($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r2_6($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r2_7($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal) {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDEL;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r2_8($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_RDEL;
+  $this->yypopstate();
+    }
+    function yy_r2_9($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+    }
+    function yy_r2_10($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LDEL;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+    }
+    function yy_r2_11($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_RDEL;
+     $this->yypopstate();
+    }
+    function yy_r2_12($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISIN;
+    }
+    function yy_r2_13($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_AS;
+    }
+    function yy_r2_14($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_TO;
+    }
+    function yy_r2_15($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_STEP;
+    }
+    function yy_r2_16($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
+    }
+    function yy_r2_17($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_IDENTITY;
+    }
+    function yy_r2_18($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY;
+    }
+    function yy_r2_19($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_EQUALS;
+    }
+    function yy_r2_20($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS;
+    }
+    function yy_r2_22($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL;
+    }
+    function yy_r2_24($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL;
+    }
+    function yy_r2_26($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN;
+    }
+    function yy_r2_27($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LESSTHAN;
+    }
+    function yy_r2_28($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_MOD;
+    }
+    function yy_r2_29($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_NOT;
+    }
+    function yy_r2_30($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LAND;
+    }
+    function yy_r2_31($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LOR;
+    }
+    function yy_r2_32($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LXOR;
+    }
+    function yy_r2_33($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISODDBY;
+    }
+    function yy_r2_34($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY;
+    }
+    function yy_r2_35($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISODD;
+    }
+    function yy_r2_36($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISNOTODD;
+    }
+    function yy_r2_37($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISEVENBY;
+    }
+    function yy_r2_38($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY;
+    }
+    function yy_r2_39($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISEVEN;
+    }
+    function yy_r2_40($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN;
+    }
+    function yy_r2_41($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISDIVBY;
+    }
+    function yy_r2_42($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY;
+    }
+    function yy_r2_43($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
+    }
+    function yy_r2_47($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_OPENP;
+    }
+    function yy_r2_48($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
+    }
+    function yy_r2_49($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_OPENB;
+    }
+    function yy_r2_50($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
+    }
+    function yy_r2_51($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_PTR;
+    }
+    function yy_r2_52($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_APTR;
+    }
+    function yy_r2_53($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_EQUAL;
+    }
+    function yy_r2_54($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_INCDEC;
+    }
+    function yy_r2_55($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
+    }
+    function yy_r2_57($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_MATH;
+    }
+    function yy_r2_59($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
+    }
+    function yy_r2_60($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
+    }
+    function yy_r2_61($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
+    }
+    function yy_r2_62($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_COLON;
+    }
+    function yy_r2_63($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_AT;
+    }
+    function yy_r2_64($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_HATCH;
+    }
+    function yy_r2_65($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
+  $this->yypushstate(self::DOUBLEQUOTEDSTRING);
+    }
+    function yy_r2_66($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
+  $this->yypopstate();
+    }
+    function yy_r2_67($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_VERT;
+    }
+    function yy_r2_68($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_DOT;
+    }
+    function yy_r2_69($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_COMMA;
+    }
+    function yy_r2_70($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ANDSYM;
+    }
+    function yy_r2_71($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_QMARK;
+    }
+    function yy_r2_72($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_HEX;
+    }
+    function yy_r2_73($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ATTR;
+    }
+    function yy_r2_74($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ID;
+    }
+    function yy_r2_75($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_INTEGER;
+    }
+    function yy_r2_76($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_SPACE;
+    }
+    function yy_r2_77($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+    }
+
+
+
+    function yylex3()
+    {
+        $tokenMap = array (
+              1 => 0,
+              2 => 0,
+              3 => 0,
+              4 => 0,
+              5 => 0,
+              6 => 0,
+              7 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s*\/literal\\s*".$this->rdel.")|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(<%)|\G(%>)|\G([\S\s])/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state LITERAL');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r3_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const LITERAL = 3;
+    function yy_r3_1($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
+  $this->yypushstate(self::LITERAL);
+    }
+    function yy_r3_2($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
+  $this->yypopstate();
+    }
+    function yy_r3_3($yy_subpatterns)
+    {
+
+  if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
+    $this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
+   } else {
+    $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
+    $this->value = substr($this->value, 0, 2);
+   }
+    }
+    function yy_r3_4($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
+    }
+    function yy_r3_5($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
+    }
+    function yy_r3_6($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
+    }
+    function yy_r3_7($yy_subpatterns)
+    {
+
+  if ($this->mbstring_overload) {
+    $to = mb_strlen($this->data,'latin1');
+  } else {
+    $to = strlen($this->data);
+  }
+  preg_match("/{$this->ldel}\/?literal{$this->rdel}|<\?|<%|\?>|%>/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter);
+  if (isset($match[0][1])) {
+    $to = $match[0][1];
+  } else {
+    $this->compiler->trigger_template_error ("missing or misspelled literal closing tag");
+  }
+  if ($this->mbstring_overload) {
+    $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1');
+  } else {
+    $this->value = substr($this->data,$this->counter,$to-$this->counter);
+  }
+  $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
+    }
+
+
+    function yylex4()
+    {
+        $tokenMap = array (
+              1 => 0,
+              2 => 1,
+              4 => 0,
+              5 => 0,
+              6 => 0,
+              7 => 0,
+              8 => 0,
+              9 => 0,
+              10 => 0,
+              11 => 0,
+              12 => 0,
+              13 => 3,
+              17 => 0,
+            );
+        if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+            return false; // end of input
+        }
+        $yy_global_pattern = "/\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(".$this->ldel."|\\$|`\\$|\")))|\G([\S\s])/iS";
+
+        do {
+            if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
+                if (!count($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' .
+                        ' an empty string.  Input "' . substr($this->data,
+                        $this->counter, 5) . '... state DOUBLEQUOTEDSTRING');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                if ($tokenMap[$this->token]) {
+                    // extract sub-patterns for passing to lex function
+                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
+                        $tokenMap[$this->token]);
+                } else {
+                    $yysubmatches = array();
+                }
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r4_' . $this->token}($yysubmatches);
+                if ($r === null) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value));
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }            } else {
+                throw new Exception('Unexpected input at line' . $this->line .
+                    ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+
+    } // end function
+
+
+    const DOUBLEQUOTEDSTRING = 4;
+    function yy_r4_1($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal) {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r4_2($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r4_4($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r4_5($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r4_6($yy_subpatterns)
+    {
+
+  if ($this->smarty->auto_literal) {
+     $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+  } else {
+     $this->token = Smarty_Internal_Templateparser::TP_LDEL;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+  }
+    }
+    function yy_r4_7($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+    }
+    function yy_r4_8($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_LDEL;
+     $this->yypushstate(self::SMARTY);
+     $this->taglineno = $this->line;
+    }
+    function yy_r4_9($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
+  $this->yypopstate();
+    }
+    function yy_r4_10($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
+  $this->value = substr($this->value,0,-1);
+  $this->yypushstate(self::SMARTY);
+  $this->taglineno = $this->line;
+    }
+    function yy_r4_11($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
+    }
+    function yy_r4_12($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+    }
+    function yy_r4_13($yy_subpatterns)
+    {
+
+  $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+    }
+    function yy_r4_17($yy_subpatterns)
+    {
+
+  if ($this->mbstring_overload) {
+    $to = mb_strlen($this->data,'latin1');
+  } else {
+    $to = strlen($this->data);
+  }
+  if ($this->mbstring_overload) {
+    $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1');
+  } else {
+    $this->value = substr($this->data,$this->counter,$to-$this->counter);
+  }
+  $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+    }
+
+}
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_templateparser.php b/library/Smarty/libs/sysplugins/smarty_internal_templateparser.php
new file mode 100644 (file)
index 0000000..ed20e82
--- /dev/null
@@ -0,0 +1,3250 @@
+<?php
+/**
+* Smarty Internal Plugin Templateparser
+*
+* This is the template parser.
+* It is generated from the internal.templateparser.y file
+* @package Smarty
+* @subpackage Compiler
+* @author Uwe Tews
+*/
+
+class TP_yyToken implements ArrayAccess
+{
+    public $string = '';
+    public $metadata = array();
+
+    function __construct($s, $m = array())
+    {
+        if ($s instanceof TP_yyToken) {
+            $this->string = $s->string;
+            $this->metadata = $s->metadata;
+        } else {
+            $this->string = (string) $s;
+            if ($m instanceof TP_yyToken) {
+                $this->metadata = $m->metadata;
+            } elseif (is_array($m)) {
+                $this->metadata = $m;
+            }
+        }
+    }
+
+    function __toString()
+    {
+        return $this->_string;
+    }
+
+    function offsetExists($offset)
+    {
+        return isset($this->metadata[$offset]);
+    }
+
+    function offsetGet($offset)
+    {
+        return $this->metadata[$offset];
+    }
+
+    function offsetSet($offset, $value)
+    {
+        if ($offset === null) {
+            if (isset($value[0])) {
+                $x = ($value instanceof TP_yyToken) ?
+                    $value->metadata : $value;
+                $this->metadata = array_merge($this->metadata, $x);
+                return;
+            }
+            $offset = count($this->metadata);
+        }
+        if ($value === null) {
+            return;
+        }
+        if ($value instanceof TP_yyToken) {
+            if ($value->metadata) {
+                $this->metadata[$offset] = $value->metadata;
+            }
+        } elseif ($value) {
+            $this->metadata[$offset] = $value;
+        }
+    }
+
+    function offsetUnset($offset)
+    {
+        unset($this->metadata[$offset]);
+    }
+}
+
+class TP_yyStackEntry
+{
+    public $stateno;       /* The state-number */
+    public $major;         /* The major token value.  This is the code
+                     ** number for the token at this stack level */
+    public $minor; /* The user-supplied minor token value.  This
+                     ** is the value of the token  */
+};
+
+
+#line 12 "smarty_internal_templateparser.y"
+class Smarty_Internal_Templateparser#line 79 "smarty_internal_templateparser.php"
+{
+#line 14 "smarty_internal_templateparser.y"
+
+    const Err1 = "Security error: Call to private object member not allowed";
+    const Err2 = "Security error: Call to dynamic object member not allowed";
+    const Err3 = "PHP in template not allowed. Use SmartyBC to enable it";
+    // states whether the parse was successful or not
+    public $successful = true;
+    public $retvalue = 0;
+    private $lex;
+    private $internalError = false;
+    private $strip = false;
+
+    function __construct($lex, $compiler) {
+        $this->lex = $lex;
+        $this->compiler = $compiler;
+        $this->smarty = $this->compiler->smarty;
+        $this->template = $this->compiler->template;
+        $this->compiler->has_variable_string = false;
+        $this->compiler->prefix_code = array();
+        $this->prefix_number = 0;
+        $this->block_nesting_level = 0;
+        if ($this->security = isset($this->smarty->security_policy)) {
+            $this->php_handling = $this->smarty->security_policy->php_handling;
+        } else {
+            $this->php_handling = $this->smarty->php_handling;
+        }
+        $this->is_xml = false;
+        $this->asp_tags = (ini_get('asp_tags') != '0');
+        $this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this);
+    }
+
+    public static function escape_start_tag($tag_text) {
+        $tag = preg_replace('/\A<\?(.*)\z/', '<<?php ?>?\1', $tag_text, -1 , $count); //Escape tag
+        return $tag;
+    }
+
+    public static function escape_end_tag($tag_text) {
+        return '?<?php ?>>';
+    }
+
+    public function compileVariable($variable) {
+        if (strpos($variable,'(') == 0) {
+            // not a variable variable
+            $var = trim($variable,'\'');
+            $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable($var, null, true, false)->nocache;
+            $this->template->properties['variables'][$var] = $this->compiler->tag_nocache|$this->compiler->nocache;
+        }
+//       return '(isset($_smarty_tpl->tpl_vars['. $variable .'])?$_smarty_tpl->tpl_vars['. $variable .']->value:$_smarty_tpl->getVariable('. $variable .')->value)';
+        return '$_smarty_tpl->tpl_vars['. $variable .']->value';
+    }
+#line 132 "smarty_internal_templateparser.php"
+
+    const TP_VERT                           =  1;
+    const TP_COLON                          =  2;
+    const TP_COMMENT                        =  3;
+    const TP_PHPSTARTTAG                    =  4;
+    const TP_PHPENDTAG                      =  5;
+    const TP_ASPSTARTTAG                    =  6;
+    const TP_ASPENDTAG                      =  7;
+    const TP_FAKEPHPSTARTTAG                =  8;
+    const TP_XMLTAG                         =  9;
+    const TP_TEXT                           = 10;
+    const TP_STRIPON                        = 11;
+    const TP_STRIPOFF                       = 12;
+    const TP_LITERALSTART                   = 13;
+    const TP_LITERALEND                     = 14;
+    const TP_LITERAL                        = 15;
+    const TP_LDEL                           = 16;
+    const TP_RDEL                           = 17;
+    const TP_DOLLAR                         = 18;
+    const TP_ID                             = 19;
+    const TP_EQUAL                          = 20;
+    const TP_PTR                            = 21;
+    const TP_LDELIF                         = 22;
+    const TP_LDELFOR                        = 23;
+    const TP_SEMICOLON                      = 24;
+    const TP_INCDEC                         = 25;
+    const TP_TO                             = 26;
+    const TP_STEP                           = 27;
+    const TP_LDELFOREACH                    = 28;
+    const TP_SPACE                          = 29;
+    const TP_AS                             = 30;
+    const TP_APTR                           = 31;
+    const TP_LDELSETFILTER                  = 32;
+    const TP_SMARTYBLOCKCHILD               = 33;
+    const TP_LDELSLASH                      = 34;
+    const TP_ATTR                           = 35;
+    const TP_INTEGER                        = 36;
+    const TP_COMMA                          = 37;
+    const TP_OPENP                          = 38;
+    const TP_CLOSEP                         = 39;
+    const TP_MATH                           = 40;
+    const TP_UNIMATH                        = 41;
+    const TP_ANDSYM                         = 42;
+    const TP_ISIN                           = 43;
+    const TP_ISDIVBY                        = 44;
+    const TP_ISNOTDIVBY                     = 45;
+    const TP_ISEVEN                         = 46;
+    const TP_ISNOTEVEN                      = 47;
+    const TP_ISEVENBY                       = 48;
+    const TP_ISNOTEVENBY                    = 49;
+    const TP_ISODD                          = 50;
+    const TP_ISNOTODD                       = 51;
+    const TP_ISODDBY                        = 52;
+    const TP_ISNOTODDBY                     = 53;
+    const TP_INSTANCEOF                     = 54;
+    const TP_QMARK                          = 55;
+    const TP_NOT                            = 56;
+    const TP_TYPECAST                       = 57;
+    const TP_HEX                            = 58;
+    const TP_DOT                            = 59;
+    const TP_SINGLEQUOTESTRING              = 60;
+    const TP_DOUBLECOLON                    = 61;
+    const TP_AT                             = 62;
+    const TP_HATCH                          = 63;
+    const TP_OPENB                          = 64;
+    const TP_CLOSEB                         = 65;
+    const TP_EQUALS                         = 66;
+    const TP_NOTEQUALS                      = 67;
+    const TP_GREATERTHAN                    = 68;
+    const TP_LESSTHAN                       = 69;
+    const TP_GREATEREQUAL                   = 70;
+    const TP_LESSEQUAL                      = 71;
+    const TP_IDENTITY                       = 72;
+    const TP_NONEIDENTITY                   = 73;
+    const TP_MOD                            = 74;
+    const TP_LAND                           = 75;
+    const TP_LOR                            = 76;
+    const TP_LXOR                           = 77;
+    const TP_QUOTE                          = 78;
+    const TP_BACKTICK                       = 79;
+    const TP_DOLLARID                       = 80;
+    const YY_NO_ACTION = 593;
+    const YY_ACCEPT_ACTION = 592;
+    const YY_ERROR_ACTION = 591;
+
+    const YY_SZ_ACTTAB = 2453;
+static public $yy_action = array(
+ /*     0 */   210,  320,  317,  316,  312,  311,  313,  314,  315,  322,
+ /*    10 */   323,  189,  191,  340,   43,  168,  292,  290,  161,   25,
+ /*    20 */     3,  108,  284,   29,  294,  199,  146,  294,   15,   15,
+ /*    30 */   244,  296,  243,  277,   18,   18,  285,   12,  127,   48,
+ /*    40 */    52,   50,   44,    9,   14,  384,  385,   17,   16,  386,
+ /*    50 */   283,   41,   39,  210,  592,   95,  260,  319,  321,    6,
+ /*    60 */    21,  194,  135,  374,  193,  387,  383,  382,  378,  377,
+ /*    70 */   379,  380,  381,  363,  362,  345,  344,   28,   31,   34,
+ /*    80 */   370,   15,   19,  237,  137,  187,   25,   18,  203,  284,
+ /*    90 */    29,  203,   48,   52,   50,   44,    9,   14,  384,  385,
+ /*   100 */    17,   16,  386,  283,   41,   39,  329,  324,  326,  327,
+ /*   110 */   325,   24,  288,    4,    4,  189,  332,  330,  387,  383,
+ /*   120 */   382,  378,  377,  379,  380,  381,  363,  362,  345,  344,
+ /*   130 */   210,  368,  231,  210,  251,  117,  139,  139,   84,  132,
+ /*   140 */   278,   25,   10,  162,  284,  359,  338,  302,  346,  459,
+ /*   150 */   226,  228,  369,  364,   15,  375,  230,   15,   15,  177,
+ /*   160 */    18,  459,  240,   18,   18,  212,  257,  459,  294,   48,
+ /*   170 */    52,   50,   44,    9,   14,  384,  385,   17,   16,  386,
+ /*   180 */   283,   41,   39,  131,  101,  159,   47,  196,  340,  371,
+ /*   190 */    25,  190,  340,  284,  294,  387,  383,  382,  378,  377,
+ /*   200 */   379,  380,  381,  363,  362,  345,  344,  210,  368,  208,
+ /*   210 */   210,  203,  140,  210,    8,   56,  123,  118,  210,  457,
+ /*   220 */   366,  261,  234,  343,  302,  346,  453,  147,  228,  369,
+ /*   230 */   364,  457,  375,   15,  342,   15,  231,  457,   15,   18,
+ /*   240 */     4,   18,  307,   37,   18,  195,   48,   52,   50,   44,
+ /*   250 */     9,   14,  384,  385,   17,   16,  386,  283,   41,   39,
+ /*   260 */   210,   25,    2,  139,  284,   11,   47,  185,  210,   45,
+ /*   270 */   266,   47,  387,  383,  382,  378,  377,  379,  380,  381,
+ /*   280 */   363,  362,  345,  344,  286,  242,  104,  166,   15,  210,
+ /*   290 */   276,  184,  188,   23,   18,  272,  294,   22,  162,   48,
+ /*   300 */    52,   50,   44,    9,   14,  384,  385,   17,   16,  386,
+ /*   310 */   283,   41,   39,  203,  106,  170,   13,   15,  203,  288,
+ /*   320 */   318,  319,  321,   18,  294,  387,  383,  382,  378,  377,
+ /*   330 */   379,  380,  381,  363,  362,  345,  344,  210,  131,  105,
+ /*   340 */   210,  203,   23,  368,  268,  130,  249,  152,  355,   25,
+ /*   350 */   197,  132,  284,  271,   32,  162,  287,  155,  354,  210,
+ /*   360 */     3,  108,   15,  228,  369,  364,  146,  375,   18,  252,
+ /*   370 */   244,  296,  243,  375,  303,  305,   48,   52,   50,   44,
+ /*   380 */     9,   14,  384,  385,   17,   16,  386,  283,   41,   39,
+ /*   390 */   103,  210,   36,  208,  109,  388,  303,  232,    8,    4,
+ /*   400 */   248,  246,  387,  383,  382,  378,  377,  379,  380,  381,
+ /*   410 */   363,  362,  345,  344,  198,   40,  361,   27,  353,  179,
+ /*   420 */   175,   20,  139,  236,  239,  211,  116,   18,  294,  294,
+ /*   430 */    48,   52,   50,   44,    9,   14,  384,  385,   17,   16,
+ /*   440 */   386,  283,   41,   39,  178,  200,  200,   23,   25,  267,
+ /*   450 */   351,  284,  186,  294,  285,  201,  387,  383,  382,  378,
+ /*   460 */   377,  379,  380,  381,  363,  362,  345,  344,  210,  368,
+ /*   470 */   200,  210,  210,  140,  301,  181,   69,  123,  238,   25,
+ /*   480 */   210,  147,  284,  347,  202,  302,  346,  459,  304,  228,
+ /*   490 */   369,  364,   15,  375,  241,   15,  297,  172,   18,  459,
+ /*   500 */   235,   18,  203,  306,  129,  459,  294,   48,   52,   50,
+ /*   510 */    44,    9,   14,  384,  385,   17,   16,  386,  283,   41,
+ /*   520 */    39,  210,   25,  200,   47,  229,   25,  134,  210,  233,
+ /*   530 */   120,  119,  210,  387,  383,  382,  378,  377,  379,  380,
+ /*   540 */   381,  363,  362,  345,  344,  373,  373,  143,  308,  180,
+ /*   550 */   236,  282,   25,   25,   42,  284,  216,  236,  238,  250,
+ /*   560 */    48,   52,   50,   44,    9,   14,  384,  385,   17,   16,
+ /*   570 */   386,  283,   41,   39,  210,   30,  203,  360,  182,   25,
+ /*   580 */   285,   47,  222,  126,  167,  303,  387,  383,  382,  378,
+ /*   590 */   377,  379,  380,  381,  363,  362,  345,  344,  245,  373,
+ /*   600 */    15,  372,  160,  334,    6,  333,   18,  247,  254,   35,
+ /*   610 */   255,  294,  114,   48,   52,   50,   44,    9,   14,  384,
+ /*   620 */   385,   17,   16,  386,  283,   41,   39,  373,  192,  281,
+ /*   630 */   253,  145,   38,  298,  300,  226,   94,  124,  102,  387,
+ /*   640 */   383,  382,  378,  377,  379,  380,  381,  363,  362,  345,
+ /*   650 */   344,  210,  368,  373,  210,  141,  140,  368,  336,   71,
+ /*   660 */   132,  149,  136,    7,   10,  132,  165,  204,  302,  346,
+ /*   670 */   456,   98,  228,  369,  364,  294,  375,  228,  369,  364,
+ /*   680 */   279,  375,  456,  220,  232,  335,  373,  285,  456,  162,
+ /*   690 */    48,   52,   50,   44,    9,   14,  384,  385,   17,   16,
+ /*   700 */   386,  283,   41,   39,  210,  210,  309,   47,  285,  200,
+ /*   710 */   371,   45,  162,  183,  144,   97,  387,  383,  382,  378,
+ /*   720 */   377,  379,  380,  381,  363,  362,  345,  344,  285,  131,
+ /*   730 */   373,  354,  331,  107,  110,  256,  376,  327,  327,  327,
+ /*   740 */   327,  327,  115,   48,   52,   50,   44,    9,   14,  384,
+ /*   750 */   385,   17,   16,  386,  283,   41,   39,  373,  327,  327,
+ /*   760 */   327,  327,  327,  327,  327,  327,  327,  327,  356,  387,
+ /*   770 */   383,  382,  378,  377,  379,  380,  381,  363,  362,  345,
+ /*   780 */   344,  210,  352,  368,  327,  210,  327,  140,  327,  327,
+ /*   790 */    71,  132,  327,  100,  339,  327,  138,  269,  337,  302,
+ /*   800 */   346,  328,  327,  228,  369,  364,   15,  375,  373,  327,
+ /*   810 */    15,  373,   18,   15,  219,  327,   18,  327,  327,   18,
+ /*   820 */    48,   52,   50,   44,    9,   14,  384,  385,   17,   16,
+ /*   830 */   386,  283,   41,   39,  210,  327,  327,  327,   47,  327,
+ /*   840 */   327,  327,  327,  327,  327,  327,  387,  383,  382,  378,
+ /*   850 */   377,  379,  380,  381,  363,  362,  345,  344,  327,  327,
+ /*   860 */   327,  327,  327,  327,  327,  327,  327,  327,  327,  327,
+ /*   870 */   327,  327,  274,   48,   52,   50,   44,    9,   14,  384,
+ /*   880 */   385,   17,   16,  386,  283,   41,   39,  210,  327,  327,
+ /*   890 */   327,  327,  327,  327,  327,  327,  327,  327,  327,  387,
+ /*   900 */   383,  382,  378,  377,  379,  380,  381,  363,  362,  345,
+ /*   910 */   344,  327,  327,  327,  327,  327,  327,  327,  327,  327,
+ /*   920 */   327,  327,  327,  327,  327,  327,   48,   52,   50,   44,
+ /*   930 */     9,   14,  384,  385,   17,   16,  386,  283,   41,   39,
+ /*   940 */   210,  327,  327,  327,  327,  327,  327,  327,  327,  327,
+ /*   950 */   327,  265,  387,  383,  382,  378,  377,  379,  380,  381,
+ /*   960 */   363,  362,  345,  344,  327,  327,  327,  327,  327,  224,
+ /*   970 */   327,  327,  327,  327,  327,  327,  327,  327,  327,   48,
+ /*   980 */    52,   50,   44,    9,   14,  384,  385,   17,   16,  386,
+ /*   990 */   283,   41,   39,  210,  327,  327,  327,  327,  327,  327,
+ /*  1000 */   327,  327,  327,  327,  327,  387,  383,  382,  378,  377,
+ /*  1010 */   379,  380,  381,  363,  362,  345,  344,  327,  327,  327,
+ /*  1020 */   327,  327,  327,  327,  327,  327,  327,  327,  327,  327,
+ /*  1030 */   327,  327,   48,   52,   50,   44,    9,   14,  384,  385,
+ /*  1040 */    17,   16,  386,  283,   41,   39,  327,  327,  327,  327,
+ /*  1050 */   327,  327,  327,  327,  327,  327,  327,  327,  387,  383,
+ /*  1060 */   382,  378,  377,  379,  380,  381,  363,  362,  345,  344,
+ /*  1070 */   327,  327,  327,   48,   52,   50,   44,    9,   14,  384,
+ /*  1080 */   385,   17,   16,  386,  283,   41,   39,  327,  327,  327,
+ /*  1090 */   327,  327,  327,  327,  327,  327,  327,  327,  327,  387,
+ /*  1100 */   383,  382,  378,  377,  379,  380,  381,  363,  362,  345,
+ /*  1110 */   344,  327,  327,  327,  327,  327,   43,  327,  142,  207,
+ /*  1120 */   327,  327,    3,  108,  327,  264,  327,  368,  146,  327,
+ /*  1130 */   327,  151,  244,  296,  243,  132,  227,   15,   33,  327,
+ /*  1140 */   327,   51,  327,   18,  367,  327,  368,  228,  369,  364,
+ /*  1150 */   150,  375,  327,  174,  132,  327,   49,   46,  299,  225,
+ /*  1160 */   365,  327,  294,  103,    1,  280,  228,  369,  364,  262,
+ /*  1170 */   375,  327,  327,   43,  285,  142,  218,  327,   96,    3,
+ /*  1180 */   108,   15,  289,  327,  327,  146,  327,   18,  327,  244,
+ /*  1190 */   296,  243,  327,  227,   15,   33,  327,  327,   51,  327,
+ /*  1200 */    18,  327,  368,  327,  327,  327,  121,  327,  327,   54,
+ /*  1210 */   132,  327,  327,   49,   46,  299,  225,  365,  302,  346,
+ /*  1220 */   103,    1,  228,  369,  364,  327,  375,  350,  327,  327,
+ /*  1230 */    43,  327,  142,  205,  327,   96,    3,  108,  327,   15,
+ /*  1240 */   169,  327,  146,  327,  358,   18,  244,  296,  243,  294,
+ /*  1250 */   227,  327,   33,  327,  327,   51,   15,  327,  327,  368,
+ /*  1260 */   327,  285,   18,  140,  327,  327,   66,  132,  327,  327,
+ /*  1270 */    49,   46,  299,  225,  365,  302,  346,  103,    1,  228,
+ /*  1280 */   369,  364,  327,  375,  295,  327,  327,   43,  327,  130,
+ /*  1290 */   218,  327,   96,    3,  108,  327,   15,  327,  327,  146,
+ /*  1300 */   327,  293,   18,  244,  296,  243,  327,  227,  327,   26,
+ /*  1310 */   327,  327,   51,   15,  327,  327,  368,  327,  327,   18,
+ /*  1320 */   140,  327,  327,   60,  132,  327,  327,   49,   46,  299,
+ /*  1330 */   225,  365,  302,  346,  103,    1,  228,  369,  364,  327,
+ /*  1340 */   375,  258,  327,  327,   43,  327,  128,  218,  327,   96,
+ /*  1350 */     3,  108,  327,   15,  327,  327,  146,  327,  291,   18,
+ /*  1360 */   244,  296,  243,  327,  227,  327,    5,  327,  327,   51,
+ /*  1370 */    15,  327,  327,  368,  327,  327,   18,  140,  327,  327,
+ /*  1380 */    75,  132,  327,  327,   49,   46,  299,  225,  365,  302,
+ /*  1390 */   346,  103,    1,  228,  369,  364,  327,  375,  259,  327,
+ /*  1400 */   327,   43,  327,  142,  209,  327,   96,    3,  108,  327,
+ /*  1410 */    15,  327,  327,  146,  327,  273,   18,  244,  296,  243,
+ /*  1420 */   327,  227,  327,   33,  327,  327,   51,   15,  327,  327,
+ /*  1430 */   368,  327,  327,   18,  140,  327,  327,   87,  132,  327,
+ /*  1440 */   327,   49,   46,  299,  225,  365,  302,  346,  103,    1,
+ /*  1450 */   228,  369,  364,  327,  375,  275,  327,  327,   43,  327,
+ /*  1460 */   125,   92,  327,   96,    3,  108,  327,   15,  327,  327,
+ /*  1470 */   146,  327,  310,   18,  244,  296,  243,  327,  227,  327,
+ /*  1480 */    33,  327,  327,   51,   15,  327,  327,  368,  327,  327,
+ /*  1490 */    18,  140,  327,  327,   58,  132,  327,  327,   49,   46,
+ /*  1500 */   299,  225,  365,  302,  346,  103,    1,  228,  369,  364,
+ /*  1510 */   327,  375,  341,  327,  327,   43,  327,  133,  218,  327,
+ /*  1520 */    96,    3,  108,  327,   15,  327,  327,  146,  327,  348,
+ /*  1530 */    18,  244,  296,  243,  327,  227,  327,   33,  327,  327,
+ /*  1540 */    51,   15,  327,  327,  368,  327,  327,   18,  140,  327,
+ /*  1550 */   327,   68,  132,  327,  327,   49,   46,  299,  225,  365,
+ /*  1560 */   302,  346,  103,    1,  215,  369,  364,  327,  375,  327,
+ /*  1570 */   327,  327,   43,  327,  142,  206,  327,   96,    3,  108,
+ /*  1580 */   327,  327,  327,  327,  146,  327,  327,  327,  244,  296,
+ /*  1590 */   243,  327,  213,  327,   33,  327,  327,   51,  327,  327,
+ /*  1600 */   327,  368,  327,  327,  327,  140,  327,  327,   89,  132,
+ /*  1610 */   327,  327,   49,   46,  299,  225,  365,  302,  346,  103,
+ /*  1620 */     1,  228,  369,  364,  327,  375,  327,  327,  327,   43,
+ /*  1630 */   327,  130,  214,  327,   96,    3,  108,  327,  327,  327,
+ /*  1640 */   327,  146,  327,  327,  327,  244,  296,  243,  327,  227,
+ /*  1650 */   327,   26,  327,  327,   51,  327,  327,  327,  368,  327,
+ /*  1660 */   327,  327,   93,  327,  327,   53,  122,  327,  327,   49,
+ /*  1670 */    46,  299,  225,  365,  302,  346,  103,  327,  221,  369,
+ /*  1680 */   364,  327,  375,  327,  327,  327,   43,  327,  130,  218,
+ /*  1690 */   327,   96,    3,  108,  327,  327,  327,  327,  146,  327,
+ /*  1700 */   327,  327,  244,  296,  243,  327,  227,  327,   26,  327,
+ /*  1710 */   327,   51,  327,  327,  327,  368,  327,  327,  327,  140,
+ /*  1720 */   327,  327,   71,  132,  327,  327,   49,   46,  299,  225,
+ /*  1730 */   365,  302,  346,  103,  327,  228,  369,  364,  327,  375,
+ /*  1740 */   327,  327,  327,  327,  502,  327,  217,  327,   96,  327,
+ /*  1750 */   327,  502,  327,  502,  502,  355,  502,  502,  327,  327,
+ /*  1760 */   327,   32,  502,  327,  502,    4,  502,    3,  108,  327,
+ /*  1770 */    99,  171,  327,  146,  327,  327,  327,  244,  296,  243,
+ /*  1780 */   294,  502,  327,   28,   31,  327,  327,  327,  139,  327,
+ /*  1790 */   327,  327,  502,  327,  368,  193,  163,  203,  117,  327,
+ /*  1800 */   327,   84,  132,  327,  327,  294,  502,  327,   28,   31,
+ /*  1810 */   302,  346,  327,  368,  228,  369,  364,  157,  375,  327,
+ /*  1820 */   327,  132,  203,  357,   27,  353,  327,  327,  327,  263,
+ /*  1830 */   270,  327,  368,  228,  369,  364,  140,  375,  327,   69,
+ /*  1840 */   132,  327,  210,  368,  327,  327,  327,  140,  302,  346,
+ /*  1850 */    79,  132,  228,  369,  364,  327,  375,  327,  349,  302,
+ /*  1860 */   346,  327,  223,  228,  369,  364,  327,  375,  327,  327,
+ /*  1870 */    15,  327,  327,  327,  368,  327,   18,  327,  140,    4,
+ /*  1880 */   327,   91,  132,  327,  327,  327,  327,  327,  327,  327,
+ /*  1890 */   302,  346,  327,  327,  228,  369,  364,  368,  375,  327,
+ /*  1900 */   327,  140,  139,  368,   76,  132,  327,  153,  327,  327,
+ /*  1910 */   327,  132,  327,  302,  346,  327,  327,  228,  369,  364,
+ /*  1920 */   327,  375,  368,  228,  369,  364,  140,  375,  327,   63,
+ /*  1930 */   132,  327,  327,  368,  327,  327,  327,  111,  302,  346,
+ /*  1940 */    62,  132,  228,  369,  364,  327,  375,  327,  327,  302,
+ /*  1950 */   346,  327,  327,  228,  369,  364,  327,  375,  327,  327,
+ /*  1960 */   368,  193,  176,  327,  140,  327,  327,   78,  132,  327,
+ /*  1970 */   327,  294,  327,  327,   28,   31,  302,  346,  327,  327,
+ /*  1980 */   228,  369,  364,  368,  375,  327,  327,  140,  203,  368,
+ /*  1990 */    64,  132,  327,  154,  327,  327,  327,  132,  327,  302,
+ /*  2000 */   346,  327,  327,  228,  369,  364,  327,  375,  368,  228,
+ /*  2010 */   369,  364,  140,  375,  327,   77,  132,  327,  327,  368,
+ /*  2020 */   327,  327,  327,  140,  302,  346,   80,  132,  228,  369,
+ /*  2030 */   364,  327,  375,  327,  327,  302,  346,  327,  327,  228,
+ /*  2040 */   369,  364,  327,  375,  327,  327,  368,  327,  327,  327,
+ /*  2050 */   140,  327,  327,   61,  132,  327,  327,  327,  327,  327,
+ /*  2060 */   327,  327,  302,  346,  327,  327,  228,  369,  364,  368,
+ /*  2070 */   375,  327,  327,  140,  327,  368,   65,  132,  327,  156,
+ /*  2080 */   327,  327,  327,  132,  327,  302,  346,  327,  327,  228,
+ /*  2090 */   369,  364,  327,  375,  368,  228,  369,  364,  140,  375,
+ /*  2100 */   327,   81,  132,  327,  327,  368,  327,  327,  327,  113,
+ /*  2110 */   302,  346,   88,  132,  228,  369,  364,  327,  375,  327,
+ /*  2120 */   327,  302,  346,  327,  327,  228,  369,  364,  327,  375,
+ /*  2130 */   327,  327,  368,  327,  327,  327,  140,  327,  327,   67,
+ /*  2140 */   132,  327,  327,  327,  327,  327,  327,  327,  302,  346,
+ /*  2150 */   327,  327,  228,  369,  364,  368,  375,  327,  327,  140,
+ /*  2160 */   327,  368,   86,  132,  327,  148,  327,  327,  327,  132,
+ /*  2170 */   327,  302,  346,  327,  327,  228,  369,  364,  327,  375,
+ /*  2180 */   368,  228,  369,  364,  140,  375,  327,   85,  132,  327,
+ /*  2190 */   327,  368,  327,  327,  327,  112,  302,  346,   73,  132,
+ /*  2200 */   228,  369,  364,  327,  375,  327,  327,  302,  346,  327,
+ /*  2210 */   327,  228,  369,  364,  327,  375,  327,  327,  368,  327,
+ /*  2220 */   327,  327,  140,  327,  327,   70,  132,  327,  327,  327,
+ /*  2230 */   327,  327,  327,  327,  302,  346,  327,  327,  228,  369,
+ /*  2240 */   364,  368,  375,  327,  327,  140,  327,  327,   57,  132,
+ /*  2250 */   327,  327,  327,  327,  327,  327,  327,  302,  346,  327,
+ /*  2260 */   327,  228,  369,  364,  327,  375,  368,  327,  327,  327,
+ /*  2270 */   140,  327,  327,   90,  132,  327,  327,  368,  327,  327,
+ /*  2280 */   327,  140,  302,  346,   83,  132,  228,  369,  364,  327,
+ /*  2290 */   375,  327,  327,  302,  346,  327,  327,  228,  369,  364,
+ /*  2300 */   327,  375,  327,  327,  368,  327,  327,  327,  140,  327,
+ /*  2310 */   327,   82,  132,  327,  327,  327,  327,  327,  327,  327,
+ /*  2320 */   302,  346,  327,  327,  228,  369,  364,  368,  375,  327,
+ /*  2330 */   327,  140,  327,  327,   55,  132,  327,  327,  327,  327,
+ /*  2340 */   327,  327,  327,  302,  346,  327,  327,  228,  369,  364,
+ /*  2350 */   327,  375,  368,  327,  327,  327,  140,  327,  327,   72,
+ /*  2360 */   132,  327,  327,  368,  327,  327,  327,   93,  302,  346,
+ /*  2370 */    59,  122,  228,  369,  364,  327,  375,  327,  327,  302,
+ /*  2380 */   346,  327,  327,  228,  369,  364,  327,  375,  327,  327,
+ /*  2390 */   368,  327,  327,  327,  140,  327,  327,   74,  132,  327,
+ /*  2400 */   327,  327,  327,  193,  158,  327,  302,  346,  327,  327,
+ /*  2410 */   228,  369,  364,  294,  375,  327,   28,   31,  193,  173,
+ /*  2420 */   327,  327,  327,  327,  327,  193,  164,  327,  294,  327,
+ /*  2430 */   203,   28,   31,  327,  327,  294,  327,  327,   28,   31,
+ /*  2440 */   327,  327,  327,  327,  327,  203,  327,  327,  327,  327,
+ /*  2450 */   327,  327,  203,
+    );
+    static public $yy_lookahead = array(
+ /*     0 */     1,    3,    4,    5,    6,    7,    8,    9,   10,   11,
+ /*    10 */    12,   13,  113,  114,   16,   91,   17,   17,   91,   16,
+ /*    20 */    22,   23,   19,   20,  100,   24,   28,  100,   29,   29,
+ /*    30 */    32,   33,   34,   29,   35,   35,  112,   16,   37,   40,
+ /*    40 */    41,   42,   43,   44,   45,   46,   47,   48,   49,   50,
+ /*    50 */    51,   52,   53,    1,   82,   83,   84,   85,   86,   38,
+ /*    60 */    16,   90,   18,   19,   90,   66,   67,   68,   69,   70,
+ /*    70 */    71,   72,   73,   74,   75,   76,   77,  103,  104,   27,
+ /*    80 */    36,   29,   16,   96,   18,   19,   16,   35,  117,   19,
+ /*    90 */    20,  117,   40,   41,   42,   43,   44,   45,   46,   47,
+ /*   100 */    48,   49,   50,   51,   52,   53,    4,    5,    6,    7,
+ /*   110 */     8,   20,  118,   38,   38,   13,   14,   15,   66,   67,
+ /*   120 */    68,   69,   70,   71,   72,   73,   74,   75,   76,   77,
+ /*   130 */     1,   85,   62,    1,   59,   89,   61,   61,   92,   93,
+ /*   140 */    65,   16,   20,   21,   19,   17,   17,  101,  102,   17,
+ /*   150 */    59,  105,  106,  107,   29,  109,   31,   29,   29,   91,
+ /*   160 */    35,   29,   30,   35,   35,  119,  120,   35,  100,   40,
+ /*   170 */    41,   42,   43,   44,   45,   46,   47,   48,   49,   50,
+ /*   180 */    51,   52,   53,   61,   90,   91,   54,  113,  114,  111,
+ /*   190 */    16,  113,  114,   19,  100,   66,   67,   68,   69,   70,
+ /*   200 */    71,   72,   73,   74,   75,   76,   77,    1,   85,   59,
+ /*   210 */     1,  117,   89,    1,   64,   92,   93,   94,    1,   17,
+ /*   220 */   108,   17,   20,   17,  101,  102,   17,  115,  105,  106,
+ /*   230 */   107,   29,  109,   29,   17,   29,   62,   35,   29,   35,
+ /*   240 */    38,   35,   19,   31,   35,   99,   40,   41,   42,   43,
+ /*   250 */    44,   45,   46,   47,   48,   49,   50,   51,   52,   53,
+ /*   260 */     1,   16,   37,   61,   19,   20,   54,  110,    1,    2,
+ /*   270 */    25,   54,   66,   67,   68,   69,   70,   71,   72,   73,
+ /*   280 */    74,   75,   76,   77,   17,   62,   90,   91,   29,    1,
+ /*   290 */    65,   90,  110,   37,   35,   39,  100,   20,   21,   40,
+ /*   300 */    41,   42,   43,   44,   45,   46,   47,   48,   49,   50,
+ /*   310 */    51,   52,   53,  117,   90,   91,   96,   29,  117,  118,
+ /*   320 */    84,   85,   86,   35,  100,   66,   67,   68,   69,   70,
+ /*   330 */    71,   72,   73,   74,   75,   76,   77,    1,   61,   99,
+ /*   340 */     1,  117,   37,   85,   39,   18,   19,   89,   10,   16,
+ /*   350 */    99,   93,   19,   17,   16,   21,   17,   93,   85,    1,
+ /*   360 */    22,   23,   29,  105,  106,  107,   28,  109,   35,  105,
+ /*   370 */    32,   33,   34,  109,   25,   17,   40,   41,   42,   43,
+ /*   380 */    44,   45,   46,   47,   48,   49,   50,   51,   52,   53,
+ /*   390 */    63,    1,   31,   59,  121,  122,   25,    2,   64,   38,
+ /*   400 */    18,   19,   66,   67,   68,   69,   70,   71,   72,   73,
+ /*   410 */    74,   75,   76,   77,   24,   20,   78,   79,   80,   91,
+ /*   420 */    91,   29,   61,   93,   94,   95,   19,   35,  100,  100,
+ /*   430 */    40,   41,   42,   43,   44,   45,   46,   47,   48,   49,
+ /*   440 */    50,   51,   52,   53,   91,  117,  117,   37,   16,   39,
+ /*   450 */    79,   19,  110,  100,  112,   19,   66,   67,   68,   69,
+ /*   460 */    70,   71,   72,   73,   74,   75,   76,   77,    1,   85,
+ /*   470 */   117,    1,    1,   89,  108,   90,   92,   93,   94,   16,
+ /*   480 */     1,  115,   19,   17,   17,  101,  102,   17,   17,  105,
+ /*   490 */   106,  107,   29,  109,   31,   29,   17,   91,   35,   29,
+ /*   500 */    21,   35,  117,   19,   18,   35,  100,   40,   41,   42,
+ /*   510 */    43,   44,   45,   46,   47,   48,   49,   50,   51,   52,
+ /*   520 */    53,    1,   16,  117,   54,   19,   16,   18,    1,   19,
+ /*   530 */    97,   97,    1,   66,   67,   68,   69,   70,   71,   72,
+ /*   540 */    73,   74,   75,   76,   77,  112,  112,   38,   17,   90,
+ /*   550 */    93,   94,   16,   16,   26,   19,   19,   93,   94,   39,
+ /*   560 */    40,   41,   42,   43,   44,   45,   46,   47,   48,   49,
+ /*   570 */    50,   51,   52,   53,    1,    2,  117,   17,  110,   16,
+ /*   580 */   112,   54,   19,   18,   97,   25,   66,   67,   68,   69,
+ /*   590 */    70,   71,   72,   73,   74,   75,   76,   77,   62,  112,
+ /*   600 */    29,   19,   91,   86,   38,   88,   35,   19,   63,   55,
+ /*   610 */    63,  100,   97,   40,   41,   42,   43,   44,   45,   46,
+ /*   620 */    47,   48,   49,   50,   51,   52,   53,  112,   19,   65,
+ /*   630 */    39,   18,    2,   36,   36,   59,   19,   18,   97,   66,
+ /*   640 */    67,   68,   69,   70,   71,   72,   73,   74,   75,   76,
+ /*   650 */    77,    1,   85,  112,    1,   18,   89,   85,   19,   92,
+ /*   660 */    93,   89,   19,   38,   20,   93,   91,   17,  101,  102,
+ /*   670 */    17,   97,  105,  106,  107,  100,  109,  105,  106,  107,
+ /*   680 */    19,  109,   29,  116,    2,   19,  112,  112,   35,   21,
+ /*   690 */    40,   41,   42,   43,   44,   45,   46,   47,   48,   49,
+ /*   700 */    50,   51,   52,   53,    1,    1,  100,   54,  112,  117,
+ /*   710 */   111,    2,   21,  110,   98,   97,   66,   67,   68,   69,
+ /*   720 */    70,   71,   72,   73,   74,   75,   76,   77,  112,   61,
+ /*   730 */   112,   85,   14,  110,   87,  115,  114,  123,  123,  123,
+ /*   740 */   123,  123,   97,   40,   41,   42,   43,   44,   45,   46,
+ /*   750 */    47,   48,   49,   50,   51,   52,   53,  112,  123,  123,
+ /*   760 */   123,  123,  123,  123,  123,  123,  123,  123,  122,   66,
+ /*   770 */    67,   68,   69,   70,   71,   72,   73,   74,   75,   76,
+ /*   780 */    77,    1,   79,   85,  123,    1,  123,   89,  123,  123,
+ /*   790 */    92,   93,  123,   97,   17,  123,   97,   17,   17,  101,
+ /*   800 */   102,   17,  123,  105,  106,  107,   29,  109,  112,  123,
+ /*   810 */    29,  112,   35,   29,  116,  123,   35,  123,  123,   35,
+ /*   820 */    40,   41,   42,   43,   44,   45,   46,   47,   48,   49,
+ /*   830 */    50,   51,   52,   53,    1,  123,  123,  123,   54,  123,
+ /*   840 */   123,  123,  123,  123,  123,  123,   66,   67,   68,   69,
+ /*   850 */    70,   71,   72,   73,   74,   75,   76,   77,  123,  123,
+ /*   860 */   123,  123,  123,  123,  123,  123,  123,  123,  123,  123,
+ /*   870 */   123,  123,   39,   40,   41,   42,   43,   44,   45,   46,
+ /*   880 */    47,   48,   49,   50,   51,   52,   53,    1,  123,  123,
+ /*   890 */   123,  123,  123,  123,  123,  123,  123,  123,  123,   66,
+ /*   900 */    67,   68,   69,   70,   71,   72,   73,   74,   75,   76,
+ /*   910 */    77,  123,  123,  123,  123,  123,  123,  123,  123,  123,
+ /*   920 */   123,  123,  123,  123,  123,  123,   40,   41,   42,   43,
+ /*   930 */    44,   45,   46,   47,   48,   49,   50,   51,   52,   53,
+ /*   940 */     1,  123,  123,  123,  123,  123,  123,  123,  123,  123,
+ /*   950 */   123,   65,   66,   67,   68,   69,   70,   71,   72,   73,
+ /*   960 */    74,   75,   76,   77,  123,  123,  123,  123,  123,   30,
+ /*   970 */   123,  123,  123,  123,  123,  123,  123,  123,  123,   40,
+ /*   980 */    41,   42,   43,   44,   45,   46,   47,   48,   49,   50,
+ /*   990 */    51,   52,   53,    1,  123,  123,  123,  123,  123,  123,
+ /*  1000 */   123,  123,  123,  123,  123,   66,   67,   68,   69,   70,
+ /*  1010 */    71,   72,   73,   74,   75,   76,   77,  123,  123,  123,
+ /*  1020 */   123,  123,  123,  123,  123,  123,  123,  123,  123,  123,
+ /*  1030 */   123,  123,   40,   41,   42,   43,   44,   45,   46,   47,
+ /*  1040 */    48,   49,   50,   51,   52,   53,  123,  123,  123,  123,
+ /*  1050 */   123,  123,  123,  123,  123,  123,  123,  123,   66,   67,
+ /*  1060 */    68,   69,   70,   71,   72,   73,   74,   75,   76,   77,
+ /*  1070 */   123,  123,  123,   40,   41,   42,   43,   44,   45,   46,
+ /*  1080 */    47,   48,   49,   50,   51,   52,   53,  123,  123,  123,
+ /*  1090 */   123,  123,  123,  123,  123,  123,  123,  123,  123,   66,
+ /*  1100 */    67,   68,   69,   70,   71,   72,   73,   74,   75,   76,
+ /*  1110 */    77,  123,  123,  123,  123,  123,   16,  123,   18,   19,
+ /*  1120 */   123,  123,   22,   23,  123,   17,  123,   85,   28,  123,
+ /*  1130 */   123,   89,   32,   33,   34,   93,   36,   29,   38,  123,
+ /*  1140 */   123,   41,  123,   35,  102,  123,   85,  105,  106,  107,
+ /*  1150 */    89,  109,  123,   91,   93,  123,   56,   57,   58,   59,
+ /*  1160 */    60,  123,  100,   63,   64,   65,  105,  106,  107,   17,
+ /*  1170 */   109,  123,  123,   16,  112,   18,   19,  123,   78,   22,
+ /*  1180 */    23,   29,   17,  123,  123,   28,  123,   35,  123,   32,
+ /*  1190 */    33,   34,  123,   36,   29,   38,  123,  123,   41,  123,
+ /*  1200 */    35,  123,   85,  123,  123,  123,   89,  123,  123,   92,
+ /*  1210 */    93,  123,  123,   56,   57,   58,   59,   60,  101,  102,
+ /*  1220 */    63,   64,  105,  106,  107,  123,  109,   17,  123,  123,
+ /*  1230 */    16,  123,   18,   19,  123,   78,   22,   23,  123,   29,
+ /*  1240 */    91,  123,   28,  123,   17,   35,   32,   33,   34,  100,
+ /*  1250 */    36,  123,   38,  123,  123,   41,   29,  123,  123,   85,
+ /*  1260 */   123,  112,   35,   89,  123,  123,   92,   93,  123,  123,
+ /*  1270 */    56,   57,   58,   59,   60,  101,  102,   63,   64,  105,
+ /*  1280 */   106,  107,  123,  109,   17,  123,  123,   16,  123,   18,
+ /*  1290 */    19,  123,   78,   22,   23,  123,   29,  123,  123,   28,
+ /*  1300 */   123,   17,   35,   32,   33,   34,  123,   36,  123,   38,
+ /*  1310 */   123,  123,   41,   29,  123,  123,   85,  123,  123,   35,
+ /*  1320 */    89,  123,  123,   92,   93,  123,  123,   56,   57,   58,
+ /*  1330 */    59,   60,  101,  102,   63,   64,  105,  106,  107,  123,
+ /*  1340 */   109,   17,  123,  123,   16,  123,   18,   19,  123,   78,
+ /*  1350 */    22,   23,  123,   29,  123,  123,   28,  123,   17,   35,
+ /*  1360 */    32,   33,   34,  123,   36,  123,   38,  123,  123,   41,
+ /*  1370 */    29,  123,  123,   85,  123,  123,   35,   89,  123,  123,
+ /*  1380 */    92,   93,  123,  123,   56,   57,   58,   59,   60,  101,
+ /*  1390 */   102,   63,   64,  105,  106,  107,  123,  109,   17,  123,
+ /*  1400 */   123,   16,  123,   18,   19,  123,   78,   22,   23,  123,
+ /*  1410 */    29,  123,  123,   28,  123,   17,   35,   32,   33,   34,
+ /*  1420 */   123,   36,  123,   38,  123,  123,   41,   29,  123,  123,
+ /*  1430 */    85,  123,  123,   35,   89,  123,  123,   92,   93,  123,
+ /*  1440 */   123,   56,   57,   58,   59,   60,  101,  102,   63,   64,
+ /*  1450 */   105,  106,  107,  123,  109,   17,  123,  123,   16,  123,
+ /*  1460 */    18,   19,  123,   78,   22,   23,  123,   29,  123,  123,
+ /*  1470 */    28,  123,   17,   35,   32,   33,   34,  123,   36,  123,
+ /*  1480 */    38,  123,  123,   41,   29,  123,  123,   85,  123,  123,
+ /*  1490 */    35,   89,  123,  123,   92,   93,  123,  123,   56,   57,
+ /*  1500 */    58,   59,   60,  101,  102,   63,   64,  105,  106,  107,
+ /*  1510 */   123,  109,   17,  123,  123,   16,  123,   18,   19,  123,
+ /*  1520 */    78,   22,   23,  123,   29,  123,  123,   28,  123,   17,
+ /*  1530 */    35,   32,   33,   34,  123,   36,  123,   38,  123,  123,
+ /*  1540 */    41,   29,  123,  123,   85,  123,  123,   35,   89,  123,
+ /*  1550 */   123,   92,   93,  123,  123,   56,   57,   58,   59,   60,
+ /*  1560 */   101,  102,   63,   64,  105,  106,  107,  123,  109,  123,
+ /*  1570 */   123,  123,   16,  123,   18,   19,  123,   78,   22,   23,
+ /*  1580 */   123,  123,  123,  123,   28,  123,  123,  123,   32,   33,
+ /*  1590 */    34,  123,   36,  123,   38,  123,  123,   41,  123,  123,
+ /*  1600 */   123,   85,  123,  123,  123,   89,  123,  123,   92,   93,
+ /*  1610 */   123,  123,   56,   57,   58,   59,   60,  101,  102,   63,
+ /*  1620 */    64,  105,  106,  107,  123,  109,  123,  123,  123,   16,
+ /*  1630 */   123,   18,   19,  123,   78,   22,   23,  123,  123,  123,
+ /*  1640 */   123,   28,  123,  123,  123,   32,   33,   34,  123,   36,
+ /*  1650 */   123,   38,  123,  123,   41,  123,  123,  123,   85,  123,
+ /*  1660 */   123,  123,   89,  123,  123,   92,   93,  123,  123,   56,
+ /*  1670 */    57,   58,   59,   60,  101,  102,   63,  123,  105,  106,
+ /*  1680 */   107,  123,  109,  123,  123,  123,   16,  123,   18,   19,
+ /*  1690 */   123,   78,   22,   23,  123,  123,  123,  123,   28,  123,
+ /*  1700 */   123,  123,   32,   33,   34,  123,   36,  123,   38,  123,
+ /*  1710 */   123,   41,  123,  123,  123,   85,  123,  123,  123,   89,
+ /*  1720 */   123,  123,   92,   93,  123,  123,   56,   57,   58,   59,
+ /*  1730 */    60,  101,  102,   63,  123,  105,  106,  107,  123,  109,
+ /*  1740 */   123,  123,  123,  123,   17,  123,  116,  123,   78,  123,
+ /*  1750 */   123,   24,  123,   26,   27,   10,   29,   30,  123,  123,
+ /*  1760 */   123,   16,   35,  123,   37,   38,   39,   22,   23,  123,
+ /*  1770 */    90,   91,  123,   28,  123,  123,  123,   32,   33,   34,
+ /*  1780 */   100,   54,  123,  103,  104,  123,  123,  123,   61,  123,
+ /*  1790 */   123,  123,   65,  123,   85,   90,   91,  117,   89,  123,
+ /*  1800 */   123,   92,   93,  123,  123,  100,   79,  123,  103,  104,
+ /*  1810 */   101,  102,  123,   85,  105,  106,  107,   89,  109,  123,
+ /*  1820 */   123,   93,  117,   78,   79,   80,  123,  123,  123,  120,
+ /*  1830 */   102,  123,   85,  105,  106,  107,   89,  109,  123,   92,
+ /*  1840 */    93,  123,    1,   85,  123,  123,  123,   89,  101,  102,
+ /*  1850 */    92,   93,  105,  106,  107,  123,  109,  123,   17,  101,
+ /*  1860 */   102,  123,   21,  105,  106,  107,  123,  109,  123,  123,
+ /*  1870 */    29,  123,  123,  123,   85,  123,   35,  123,   89,   38,
+ /*  1880 */   123,   92,   93,  123,  123,  123,  123,  123,  123,  123,
+ /*  1890 */   101,  102,  123,  123,  105,  106,  107,   85,  109,  123,
+ /*  1900 */   123,   89,   61,   85,   92,   93,  123,   89,  123,  123,
+ /*  1910 */   123,   93,  123,  101,  102,  123,  123,  105,  106,  107,
+ /*  1920 */   123,  109,   85,  105,  106,  107,   89,  109,  123,   92,
+ /*  1930 */    93,  123,  123,   85,  123,  123,  123,   89,  101,  102,
+ /*  1940 */    92,   93,  105,  106,  107,  123,  109,  123,  123,  101,
+ /*  1950 */   102,  123,  123,  105,  106,  107,  123,  109,  123,  123,
+ /*  1960 */    85,   90,   91,  123,   89,  123,  123,   92,   93,  123,
+ /*  1970 */   123,  100,  123,  123,  103,  104,  101,  102,  123,  123,
+ /*  1980 */   105,  106,  107,   85,  109,  123,  123,   89,  117,   85,
+ /*  1990 */    92,   93,  123,   89,  123,  123,  123,   93,  123,  101,
+ /*  2000 */   102,  123,  123,  105,  106,  107,  123,  109,   85,  105,
+ /*  2010 */   106,  107,   89,  109,  123,   92,   93,  123,  123,   85,
+ /*  2020 */   123,  123,  123,   89,  101,  102,   92,   93,  105,  106,
+ /*  2030 */   107,  123,  109,  123,  123,  101,  102,  123,  123,  105,
+ /*  2040 */   106,  107,  123,  109,  123,  123,   85,  123,  123,  123,
+ /*  2050 */    89,  123,  123,   92,   93,  123,  123,  123,  123,  123,
+ /*  2060 */   123,  123,  101,  102,  123,  123,  105,  106,  107,   85,
+ /*  2070 */   109,  123,  123,   89,  123,   85,   92,   93,  123,   89,
+ /*  2080 */   123,  123,  123,   93,  123,  101,  102,  123,  123,  105,
+ /*  2090 */   106,  107,  123,  109,   85,  105,  106,  107,   89,  109,
+ /*  2100 */   123,   92,   93,  123,  123,   85,  123,  123,  123,   89,
+ /*  2110 */   101,  102,   92,   93,  105,  106,  107,  123,  109,  123,
+ /*  2120 */   123,  101,  102,  123,  123,  105,  106,  107,  123,  109,
+ /*  2130 */   123,  123,   85,  123,  123,  123,   89,  123,  123,   92,
+ /*  2140 */    93,  123,  123,  123,  123,  123,  123,  123,  101,  102,
+ /*  2150 */   123,  123,  105,  106,  107,   85,  109,  123,  123,   89,
+ /*  2160 */   123,   85,   92,   93,  123,   89,  123,  123,  123,   93,
+ /*  2170 */   123,  101,  102,  123,  123,  105,  106,  107,  123,  109,
+ /*  2180 */    85,  105,  106,  107,   89,  109,  123,   92,   93,  123,
+ /*  2190 */   123,   85,  123,  123,  123,   89,  101,  102,   92,   93,
+ /*  2200 */   105,  106,  107,  123,  109,  123,  123,  101,  102,  123,
+ /*  2210 */   123,  105,  106,  107,  123,  109,  123,  123,   85,  123,
+ /*  2220 */   123,  123,   89,  123,  123,   92,   93,  123,  123,  123,
+ /*  2230 */   123,  123,  123,  123,  101,  102,  123,  123,  105,  106,
+ /*  2240 */   107,   85,  109,  123,  123,   89,  123,  123,   92,   93,
+ /*  2250 */   123,  123,  123,  123,  123,  123,  123,  101,  102,  123,
+ /*  2260 */   123,  105,  106,  107,  123,  109,   85,  123,  123,  123,
+ /*  2270 */    89,  123,  123,   92,   93,  123,  123,   85,  123,  123,
+ /*  2280 */   123,   89,  101,  102,   92,   93,  105,  106,  107,  123,
+ /*  2290 */   109,  123,  123,  101,  102,  123,  123,  105,  106,  107,
+ /*  2300 */   123,  109,  123,  123,   85,  123,  123,  123,   89,  123,
+ /*  2310 */   123,   92,   93,  123,  123,  123,  123,  123,  123,  123,
+ /*  2320 */   101,  102,  123,  123,  105,  106,  107,   85,  109,  123,
+ /*  2330 */   123,   89,  123,  123,   92,   93,  123,  123,  123,  123,
+ /*  2340 */   123,  123,  123,  101,  102,  123,  123,  105,  106,  107,
+ /*  2350 */   123,  109,   85,  123,  123,  123,   89,  123,  123,   92,
+ /*  2360 */    93,  123,  123,   85,  123,  123,  123,   89,  101,  102,
+ /*  2370 */    92,   93,  105,  106,  107,  123,  109,  123,  123,  101,
+ /*  2380 */   102,  123,  123,  105,  106,  107,  123,  109,  123,  123,
+ /*  2390 */    85,  123,  123,  123,   89,  123,  123,   92,   93,  123,
+ /*  2400 */   123,  123,  123,   90,   91,  123,  101,  102,  123,  123,
+ /*  2410 */   105,  106,  107,  100,  109,  123,  103,  104,   90,   91,
+ /*  2420 */   123,  123,  123,  123,  123,   90,   91,  123,  100,  123,
+ /*  2430 */   117,  103,  104,  123,  123,  100,  123,  123,  103,  104,
+ /*  2440 */   123,  123,  123,  123,  123,  117,  123,  123,  123,  123,
+ /*  2450 */   123,  123,  117,
+);
+    const YY_SHIFT_USE_DFLT = -3;
+    const YY_SHIFT_MAX = 252;
+    static public $yy_shift_ofst = array(
+ /*     0 */    -2, 1385, 1385, 1328, 1157, 1328, 1157, 1157, 1100, 1157,
+ /*    10 */  1157, 1157, 1157, 1157, 1157, 1556, 1157, 1157, 1157, 1157,
+ /*    20 */  1556, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157,
+ /*    30 */  1157, 1157, 1442, 1157, 1157, 1499, 1157, 1157, 1214, 1157,
+ /*    40 */  1157, 1157, 1157, 1442, 1271, 1271, 1670, 1613, 1670, 1670,
+ /*    50 */  1670, 1670, 1670,  206,  129,   52,   -1,  259,  259,  259,
+ /*    60 */   833,  886,  939,  780,  650,  390,  336,  467,  703,  520,
+ /*    70 */   573,  992,  992,  992,  992,  992,  992,  992,  992,  992,
+ /*    80 */   992,  992,  992,  992,  992,  992,  992,  992,  992,  992,
+ /*    90 */  1033, 1033, 1841,  784,  288,   -2,  338,  125,  463,  209,
+ /*   100 */   333,  209,  333,  327,  288,  267,  288,  334,  509, 1745,
+ /*   110 */   102,  132,  470,  653,   70,  245,  479,  212,  204,    3,
+ /*   120 */   174,  217,  277,  122,  432,  537,  432,  509,  510,  432,
+ /*   130 */   432,  382,  668,  506,  432,  432,  531,  563,  432,  382,
+ /*   140 */   527,  432,  510,  509,  571,  432,  392,  691,  704,  704,
+ /*   150 */   704,  704,  704,  704,  704,  691,  704,   -3, 1341, 1381,
+ /*   160 */  1284, 1267,   66, 1108, 1152, 1165, 1210,  536, 1438, 1398,
+ /*   170 */  1495, 1512,  466,  777,    0,  128,  781, 1324, 1455, 1227,
+ /*   180 */   471,  358,  150,  150,  339,  150,  150,   21,  150,  718,
+ /*   190 */   691,  691,  625,  704,  704,  709,  691,  709,    4,    4,
+ /*   200 */    -3,   -3,   -3,   -3,   -3, 1727,  202,   75,   44,  361,
+ /*   210 */   223,    1,  225,   91,   76,  371,  395,  410,   76,  256,
+ /*   220 */   305,  560,  625,  617,  619,  598,  597,  576,  349,  630,
+ /*   230 */   637,  639,  666,  682,  661,  643,  644,  613,  591,  528,
+ /*   240 */   565,  486,  484,  407,  436,  582,  566,  564,  609,  547,
+ /*   250 */   554,  588,  545,
+);
+    const YY_REDUCE_USE_DFLT = -102;
+    const YY_REDUCE_MAX = 204;
+    static public $yy_reduce_ofst = array(
+ /*     0 */   -28,   46, 1709,  123,  567,  384, 1630,  698, 1961, 1934,
+ /*    10 */  1923, 1875, 1898, 1984, 2009, 2106, 2095, 2070, 2020, 2047,
+ /*    20 */  1848, 1837, 1402, 1345, 1288, 1174, 1231, 1459, 1516, 1812,
+ /*    30 */  1789, 1758, 1573, 1747, 2156, 2133, 2305, 2267, 2181, 2192,
+ /*    40 */  1117, 2219, 2242, 2278, 1042, 1728,  258, 1061,  572, 2076,
+ /*    50 */  1990, 1904, 1818, 1680, 1871, 1705, 2313, 2335, 2328, 1680,
+ /*    60 */   -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
+ /*    70 */   -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
+ /*    80 */   -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
+ /*    90 */   -26,  -26,  224,   94,  196,  236,  273, 1149, 1062,  406,
+ /*   100 */   -76,  353,  575,  264,  328,  201,  329,   78,  330,  646,
+ /*   110 */   517,  -29,  -29,  -29,  342,  616,  385,  -29,   68,  342,
+ /*   120 */   342,  -29,   74,   74,  618,  433,  574,  457,  515,  541,
+ /*   130 */   433,  112,   74,  433,  434,  487,  459,  699,  468,  366,
+ /*   140 */   -29,  696,  433,  464,  511,  645,  -73, -101,  -29,  -29,
+ /*   150 */   -29,  -29,  -29,  -29,  -29,   74,  -29,  -29,  606,  606,
+ /*   160 */   606,  606,  620,  606,  606,  606,  606,  596,  606,  606,
+ /*   170 */   606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
+ /*   180 */   592,  592,  599,  599,  592,  599,  599,  603,  599,  647,
+ /*   190 */   622,  622,  623,  592,  592,   -6,  622,   -6,  -13,  220,
+ /*   200 */   251,  240,  182,  146,  157,
+);
+    static public $yyExpectedTokens = array(
+        /* 0 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 22, 23, 28, 32, 33, 34, ),
+        /* 1 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 2 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 3 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 4 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 5 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 6 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 7 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 8 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 65, 78, ),
+        /* 9 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 10 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 11 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 12 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 13 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 14 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 15 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 16 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 17 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 18 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 19 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 20 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 21 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 22 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 23 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 24 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 25 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 26 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 27 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 28 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 29 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 30 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 31 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 32 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 33 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 34 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 35 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 36 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 37 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 38 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 39 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 40 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 41 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 42 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 43 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 44 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 45 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ),
+        /* 46 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ),
+        /* 47 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ),
+        /* 48 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ),
+        /* 49 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ),
+        /* 50 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ),
+        /* 51 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ),
+        /* 52 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ),
+        /* 53 */ array(1, 17, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 54 */ array(1, 17, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 55 */ array(1, 27, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 56 */ array(1, 17, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 57 */ array(1, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 58 */ array(1, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 59 */ array(1, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 60 */ array(1, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 61 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 62 */ array(1, 30, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 63 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 64 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 65 */ array(1, 24, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 66 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 67 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 68 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, ),
+        /* 69 */ array(1, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 70 */ array(1, 2, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 71 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 72 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 73 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 74 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 75 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 76 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 77 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 78 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 79 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 80 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 81 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 82 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 83 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 84 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 85 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 86 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 87 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 88 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 89 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 90 */ array(40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 91 */ array(40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),
+        /* 92 */ array(1, 17, 21, 29, 35, 38, 61, ),
+        /* 93 */ array(1, 17, 29, 35, 54, ),
+        /* 94 */ array(1, 29, 35, ),
+        /* 95 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 22, 23, 28, 32, 33, 34, ),
+        /* 96 */ array(10, 16, 22, 23, 28, 32, 33, 34, 78, 79, 80, ),
+        /* 97 */ array(16, 19, 29, 31, 35, ),
+        /* 98 */ array(16, 19, 29, 31, 35, ),
+        /* 99 */ array(1, 17, 29, 35, ),
+        /* 100 */ array(16, 19, 29, 35, ),
+        /* 101 */ array(1, 17, 29, 35, ),
+        /* 102 */ array(16, 19, 29, 35, ),
+        /* 103 */ array(18, 19, 63, ),
+        /* 104 */ array(1, 29, 35, ),
+        /* 105 */ array(1, 2, 17, ),
+        /* 106 */ array(1, 29, 35, ),
+        /* 107 */ array(21, 59, 64, ),
+        /* 108 */ array(18, 38, ),
+        /* 109 */ array(10, 16, 22, 23, 28, 32, 33, 34, 78, 79, 80, ),
+        /* 110 */ array(4, 5, 6, 7, 8, 13, 14, 15, ),
+        /* 111 */ array(1, 17, 29, 30, 35, 54, ),
+        /* 112 */ array(1, 17, 29, 35, 54, ),
+        /* 113 */ array(1, 17, 29, 35, 54, ),
+        /* 114 */ array(16, 19, 20, 62, ),
+        /* 115 */ array(16, 19, 20, 25, ),
+        /* 116 */ array(1, 17, 21, ),
+        /* 117 */ array(1, 31, 54, ),
+        /* 118 */ array(17, 29, 35, ),
+        /* 119 */ array(16, 19, 20, ),
+        /* 120 */ array(16, 19, 62, ),
+        /* 121 */ array(1, 17, 54, ),
+        /* 122 */ array(20, 21, 61, ),
+        /* 123 */ array(20, 21, 61, ),
+        /* 124 */ array(16, 19, ),
+        /* 125 */ array(16, 19, ),
+        /* 126 */ array(16, 19, ),
+        /* 127 */ array(18, 38, ),
+        /* 128 */ array(16, 19, ),
+        /* 129 */ array(16, 19, ),
+        /* 130 */ array(16, 19, ),
+        /* 131 */ array(18, 19, ),
+        /* 132 */ array(21, 61, ),
+        /* 133 */ array(16, 19, ),
+        /* 134 */ array(16, 19, ),
+        /* 135 */ array(16, 19, ),
+        /* 136 */ array(1, 17, ),
+        /* 137 */ array(16, 19, ),
+        /* 138 */ array(16, 19, ),
+        /* 139 */ array(18, 19, ),
+        /* 140 */ array(1, 54, ),
+        /* 141 */ array(16, 19, ),
+        /* 142 */ array(16, 19, ),
+        /* 143 */ array(18, 38, ),
+        /* 144 */ array(29, 35, ),
+        /* 145 */ array(16, 19, ),
+        /* 146 */ array(29, 35, ),
+        /* 147 */ array(21, ),
+        /* 148 */ array(1, ),
+        /* 149 */ array(1, ),
+        /* 150 */ array(1, ),
+        /* 151 */ array(1, ),
+        /* 152 */ array(1, ),
+        /* 153 */ array(1, ),
+        /* 154 */ array(1, ),
+        /* 155 */ array(21, ),
+        /* 156 */ array(1, ),
+        /* 157 */ array(),
+        /* 158 */ array(17, 29, 35, ),
+        /* 159 */ array(17, 29, 35, ),
+        /* 160 */ array(17, 29, 35, ),
+        /* 161 */ array(17, 29, 35, ),
+        /* 162 */ array(16, 18, 19, ),
+        /* 163 */ array(17, 29, 35, ),
+        /* 164 */ array(17, 29, 35, ),
+        /* 165 */ array(17, 29, 35, ),
+        /* 166 */ array(17, 29, 35, ),
+        /* 167 */ array(16, 19, 62, ),
+        /* 168 */ array(17, 29, 35, ),
+        /* 169 */ array(17, 29, 35, ),
+        /* 170 */ array(17, 29, 35, ),
+        /* 171 */ array(17, 29, 35, ),
+        /* 172 */ array(17, 29, 35, ),
+        /* 173 */ array(17, 29, 35, ),
+        /* 174 */ array(17, 29, 35, ),
+        /* 175 */ array(17, 29, 35, ),
+        /* 176 */ array(17, 29, 35, ),
+        /* 177 */ array(17, 29, 35, ),
+        /* 178 */ array(17, 29, 35, ),
+        /* 179 */ array(17, 29, 35, ),
+        /* 180 */ array(1, 17, ),
+        /* 181 */ array(1, 17, ),
+        /* 182 */ array(59, 64, ),
+        /* 183 */ array(59, 64, ),
+        /* 184 */ array(1, 17, ),
+        /* 185 */ array(59, 64, ),
+        /* 186 */ array(59, 64, ),
+        /* 187 */ array(16, 38, ),
+        /* 188 */ array(59, 64, ),
+        /* 189 */ array(14, ),
+        /* 190 */ array(21, ),
+        /* 191 */ array(21, ),
+        /* 192 */ array(38, ),
+        /* 193 */ array(1, ),
+        /* 194 */ array(1, ),
+        /* 195 */ array(2, ),
+        /* 196 */ array(21, ),
+        /* 197 */ array(2, ),
+        /* 198 */ array(29, ),
+        /* 199 */ array(29, ),
+        /* 200 */ array(),
+        /* 201 */ array(),
+        /* 202 */ array(),
+        /* 203 */ array(),
+        /* 204 */ array(),
+        /* 205 */ array(17, 24, 26, 27, 29, 30, 35, 37, 38, 39, 54, 61, 65, 79, ),
+        /* 206 */ array(17, 20, 29, 35, 38, 61, ),
+        /* 207 */ array(38, 59, 61, 65, ),
+        /* 208 */ array(16, 18, 19, 36, ),
+        /* 209 */ array(31, 38, 61, ),
+        /* 210 */ array(19, 62, ),
+        /* 211 */ array(24, 37, ),
+        /* 212 */ array(37, 65, ),
+        /* 213 */ array(20, 59, ),
+        /* 214 */ array(38, 61, ),
+        /* 215 */ array(25, 79, ),
+        /* 216 */ array(2, 20, ),
+        /* 217 */ array(37, 39, ),
+        /* 218 */ array(38, 61, ),
+        /* 219 */ array(37, 39, ),
+        /* 220 */ array(37, 39, ),
+        /* 221 */ array(17, 25, ),
+        /* 222 */ array(38, ),
+        /* 223 */ array(19, ),
+        /* 224 */ array(18, ),
+        /* 225 */ array(36, ),
+        /* 226 */ array(36, ),
+        /* 227 */ array(59, ),
+        /* 228 */ array(25, ),
+        /* 229 */ array(2, ),
+        /* 230 */ array(18, ),
+        /* 231 */ array(19, ),
+        /* 232 */ array(19, ),
+        /* 233 */ array(2, ),
+        /* 234 */ array(19, ),
+        /* 235 */ array(19, ),
+        /* 236 */ array(20, ),
+        /* 237 */ array(18, ),
+        /* 238 */ array(39, ),
+        /* 239 */ array(26, ),
+        /* 240 */ array(18, ),
+        /* 241 */ array(18, ),
+        /* 242 */ array(19, ),
+        /* 243 */ array(19, ),
+        /* 244 */ array(19, ),
+        /* 245 */ array(19, ),
+        /* 246 */ array(38, ),
+        /* 247 */ array(65, ),
+        /* 248 */ array(19, ),
+        /* 249 */ array(63, ),
+        /* 250 */ array(55, ),
+        /* 251 */ array(19, ),
+        /* 252 */ array(63, ),
+        /* 253 */ array(),
+        /* 254 */ array(),
+        /* 255 */ array(),
+        /* 256 */ array(),
+        /* 257 */ array(),
+        /* 258 */ array(),
+        /* 259 */ array(),
+        /* 260 */ array(),
+        /* 261 */ array(),
+        /* 262 */ array(),
+        /* 263 */ array(),
+        /* 264 */ array(),
+        /* 265 */ array(),
+        /* 266 */ array(),
+        /* 267 */ array(),
+        /* 268 */ array(),
+        /* 269 */ array(),
+        /* 270 */ array(),
+        /* 271 */ array(),
+        /* 272 */ array(),
+        /* 273 */ array(),
+        /* 274 */ array(),
+        /* 275 */ array(),
+        /* 276 */ array(),
+        /* 277 */ array(),
+        /* 278 */ array(),
+        /* 279 */ array(),
+        /* 280 */ array(),
+        /* 281 */ array(),
+        /* 282 */ array(),
+        /* 283 */ array(),
+        /* 284 */ array(),
+        /* 285 */ array(),
+        /* 286 */ array(),
+        /* 287 */ array(),
+        /* 288 */ array(),
+        /* 289 */ array(),
+        /* 290 */ array(),
+        /* 291 */ array(),
+        /* 292 */ array(),
+        /* 293 */ array(),
+        /* 294 */ array(),
+        /* 295 */ array(),
+        /* 296 */ array(),
+        /* 297 */ array(),
+        /* 298 */ array(),
+        /* 299 */ array(),
+        /* 300 */ array(),
+        /* 301 */ array(),
+        /* 302 */ array(),
+        /* 303 */ array(),
+        /* 304 */ array(),
+        /* 305 */ array(),
+        /* 306 */ array(),
+        /* 307 */ array(),
+        /* 308 */ array(),
+        /* 309 */ array(),
+        /* 310 */ array(),
+        /* 311 */ array(),
+        /* 312 */ array(),
+        /* 313 */ array(),
+        /* 314 */ array(),
+        /* 315 */ array(),
+        /* 316 */ array(),
+        /* 317 */ array(),
+        /* 318 */ array(),
+        /* 319 */ array(),
+        /* 320 */ array(),
+        /* 321 */ array(),
+        /* 322 */ array(),
+        /* 323 */ array(),
+        /* 324 */ array(),
+        /* 325 */ array(),
+        /* 326 */ array(),
+        /* 327 */ array(),
+        /* 328 */ array(),
+        /* 329 */ array(),
+        /* 330 */ array(),
+        /* 331 */ array(),
+        /* 332 */ array(),
+        /* 333 */ array(),
+        /* 334 */ array(),
+        /* 335 */ array(),
+        /* 336 */ array(),
+        /* 337 */ array(),
+        /* 338 */ array(),
+        /* 339 */ array(),
+        /* 340 */ array(),
+        /* 341 */ array(),
+        /* 342 */ array(),
+        /* 343 */ array(),
+        /* 344 */ array(),
+        /* 345 */ array(),
+        /* 346 */ array(),
+        /* 347 */ array(),
+        /* 348 */ array(),
+        /* 349 */ array(),
+        /* 350 */ array(),
+        /* 351 */ array(),
+        /* 352 */ array(),
+        /* 353 */ array(),
+        /* 354 */ array(),
+        /* 355 */ array(),
+        /* 356 */ array(),
+        /* 357 */ array(),
+        /* 358 */ array(),
+        /* 359 */ array(),
+        /* 360 */ array(),
+        /* 361 */ array(),
+        /* 362 */ array(),
+        /* 363 */ array(),
+        /* 364 */ array(),
+        /* 365 */ array(),
+        /* 366 */ array(),
+        /* 367 */ array(),
+        /* 368 */ array(),
+        /* 369 */ array(),
+        /* 370 */ array(),
+        /* 371 */ array(),
+        /* 372 */ array(),
+        /* 373 */ array(),
+        /* 374 */ array(),
+        /* 375 */ array(),
+        /* 376 */ array(),
+        /* 377 */ array(),
+        /* 378 */ array(),
+        /* 379 */ array(),
+        /* 380 */ array(),
+        /* 381 */ array(),
+        /* 382 */ array(),
+        /* 383 */ array(),
+        /* 384 */ array(),
+        /* 385 */ array(),
+        /* 386 */ array(),
+        /* 387 */ array(),
+        /* 388 */ array(),
+);
+    static public $yy_default = array(
+ /*     0 */   392,  574,  591,  591,  545,  591,  545,  545,  591,  591,
+ /*    10 */   591,  591,  591,  591,  591,  591,  591,  591,  591,  591,
+ /*    20 */   591,  591,  591,  591,  591,  591,  591,  591,  591,  591,
+ /*    30 */   591,  591,  591,  591,  591,  591,  591,  591,  591,  591,
+ /*    40 */   591,  591,  591,  591,  591,  591,  591,  591,  591,  591,
+ /*    50 */   591,  591,  591,  591,  591,  453,  591,  453,  453,  453,
+ /*    60 */   591,  591,  458,  591,  591,  591,  591,  591,  591,  591,
+ /*    70 */   591,  544,  575,  458,  576,  460,  463,  464,  435,  477,
+ /*    80 */   478,  479,  486,  487,  577,  483,  482,  543,  455,  474,
+ /*    90 */   490,  491,  502,  466,  453,  389,  591,  453,  453,  473,
+ /*   100 */   453,  510,  453,  591,  453,  591,  453,  557,  591,  591,
+ /*   110 */   591,  466,  466,  466,  518,  591,  591,  466,  591,  518,
+ /*   120 */   518,  466,  511,  511,  591,  591,  591,  591,  591,  591,
+ /*   130 */   591,  591,  511,  591,  591,  591,  591,  591,  518,  591,
+ /*   140 */   466,  591,  591,  591,  453,  591,  453,  554,  494,  469,
+ /*   150 */   489,  476,  495,  470,  493,  511,  471,  552,  591,  591,
+ /*   160 */   591,  591,  591,  591,  591,  591,  591,  519,  591,  591,
+ /*   170 */   591,  591,  591,  591,  591,  591,  591,  591,  591,  591,
+ /*   180 */   591,  591,  536,  535,  591,  538,  516,  518,  537,  408,
+ /*   190 */   558,  555,  518,  473,  510,  547,  532,  546,  590,  590,
+ /*   200 */   551,  551,  518,  551,  518,  468,  502,  502,  591,  502,
+ /*   210 */   591,  591,  591,  498,  488,  492,  530,  591,  502,  591,
+ /*   220 */   591,  492,  530,  591,  591,  591,  500,  498,  492,  530,
+ /*   230 */   591,  591,  591,  530,  591,  591,  591,  591,  591,  461,
+ /*   240 */   591,  591,  591,  591,  591,  591,  556,  591,  591,  591,
+ /*   250 */   504,  591,  591,  465,  515,  514,  539,  572,  433,  418,
+ /*   260 */   390,  432,  438,  573,  437,  526,  436,  541,  540,  523,
+ /*   270 */   553,  531,  542,  442,  504,  443,  571,  589,  524,  454,
+ /*   280 */   527,  525,  462,  485,  530,  529,  444,  445,  550,  441,
+ /*   290 */   440,  431,  430,  434,  452,  439,  446,  447,  499,  497,
+ /*   300 */   501,  507,  467,  496,  450,  448,  548,  549,  449,  451,
+ /*   310 */   417,  399,  398,  400,  401,  402,  397,  396,  391,  393,
+ /*   320 */   394,  395,  403,  404,  413,  412,  414,  415,  416,  411,
+ /*   330 */   410,  405,  406,  407,  409,  468,  512,  423,  422,  424,
+ /*   340 */   533,  425,  421,  586,  570,  569,  472,  419,  420,  426,
+ /*   350 */   427,  582,  583,  584,  587,  588,  580,  579,  429,  428,
+ /*   360 */   585,  578,  568,  567,  506,  505,  508,  475,  509,  503,
+ /*   370 */   522,  517,  520,  528,  521,  513,  534,  563,  562,  564,
+ /*   380 */   565,  566,  561,  560,  480,  481,  484,  559,  581,
+);
+    const YYNOCODE = 124;
+    const YYSTACKDEPTH = 100;
+    const YYNSTATE = 389;
+    const YYNRULE = 202;
+    const YYERRORSYMBOL = 81;
+    const YYERRSYMDT = 'yy0';
+    const YYFALLBACK = 0;
+    static public $yyFallback = array(
+    );
+    static function Trace($TraceFILE, $zTracePrompt)
+    {
+        if (!$TraceFILE) {
+            $zTracePrompt = 0;
+        } elseif (!$zTracePrompt) {
+            $TraceFILE = 0;
+        }
+        self::$yyTraceFILE = $TraceFILE;
+        self::$yyTracePrompt = $zTracePrompt;
+    }
+
+    static function PrintTrace()
+    {
+        self::$yyTraceFILE = fopen('php://output', 'w');
+        self::$yyTracePrompt = '<br>';
+    }
+
+    static public $yyTraceFILE;
+    static public $yyTracePrompt;
+    public $yyidx;                    /* Index of top element in stack */
+    public $yyerrcnt;                 /* Shifts left before out of the error */
+    public $yystack = array();  /* The parser's stack */
+
+    public $yyTokenName = array(
+  '$',             'VERT',          'COLON',         'COMMENT',
+  'PHPSTARTTAG',   'PHPENDTAG',     'ASPSTARTTAG',   'ASPENDTAG',
+  'FAKEPHPSTARTTAG',  'XMLTAG',        'TEXT',          'STRIPON',
+  'STRIPOFF',      'LITERALSTART',  'LITERALEND',    'LITERAL',
+  'LDEL',          'RDEL',          'DOLLAR',        'ID',
+  'EQUAL',         'PTR',           'LDELIF',        'LDELFOR',
+  'SEMICOLON',     'INCDEC',        'TO',            'STEP',
+  'LDELFOREACH',   'SPACE',         'AS',            'APTR',
+  'LDELSETFILTER',  'SMARTYBLOCKCHILD',  'LDELSLASH',     'ATTR',
+  'INTEGER',       'COMMA',         'OPENP',         'CLOSEP',
+  'MATH',          'UNIMATH',       'ANDSYM',        'ISIN',
+  'ISDIVBY',       'ISNOTDIVBY',    'ISEVEN',        'ISNOTEVEN',
+  'ISEVENBY',      'ISNOTEVENBY',   'ISODD',         'ISNOTODD',
+  'ISODDBY',       'ISNOTODDBY',    'INSTANCEOF',    'QMARK',
+  'NOT',           'TYPECAST',      'HEX',           'DOT',
+  'SINGLEQUOTESTRING',  'DOUBLECOLON',   'AT',            'HATCH',
+  'OPENB',         'CLOSEB',        'EQUALS',        'NOTEQUALS',
+  'GREATERTHAN',   'LESSTHAN',      'GREATEREQUAL',  'LESSEQUAL',
+  'IDENTITY',      'NONEIDENTITY',  'MOD',           'LAND',
+  'LOR',           'LXOR',          'QUOTE',         'BACKTICK',
+  'DOLLARID',      'error',         'start',         'template',
+  'template_element',  'smartytag',     'literal',       'literal_elements',
+  'literal_element',  'value',         'modifierlist',  'attributes',
+  'expr',          'varindexed',    'statement',     'statements',
+  'optspace',      'varvar',        'foraction',     'modparameters',
+  'attribute',     'ternary',       'array',         'ifcond',
+  'lop',           'variable',      'function',      'doublequoted_with_quotes',
+  'static_class_access',  'object',        'arrayindex',    'indexdef',
+  'varvarele',     'objectchain',   'objectelement',  'method',
+  'params',        'modifier',      'modparameter',  'arrayelements',
+  'arrayelement',  'doublequoted',  'doublequotedcontent',
+    );
+
+    static public $yyRuleName = array(
+ /*   0 */ "start ::= template",
+ /*   1 */ "template ::= template_element",
+ /*   2 */ "template ::= template template_element",
+ /*   3 */ "template ::=",
+ /*   4 */ "template_element ::= smartytag",
+ /*   5 */ "template_element ::= COMMENT",
+ /*   6 */ "template_element ::= literal",
+ /*   7 */ "template_element ::= PHPSTARTTAG",
+ /*   8 */ "template_element ::= PHPENDTAG",
+ /*   9 */ "template_element ::= ASPSTARTTAG",
+ /*  10 */ "template_element ::= ASPENDTAG",
+ /*  11 */ "template_element ::= FAKEPHPSTARTTAG",
+ /*  12 */ "template_element ::= XMLTAG",
+ /*  13 */ "template_element ::= TEXT",
+ /*  14 */ "template_element ::= STRIPON",
+ /*  15 */ "template_element ::= STRIPOFF",
+ /*  16 */ "literal ::= LITERALSTART LITERALEND",
+ /*  17 */ "literal ::= LITERALSTART literal_elements LITERALEND",
+ /*  18 */ "literal_elements ::= literal_elements literal_element",
+ /*  19 */ "literal_elements ::=",
+ /*  20 */ "literal_element ::= literal",
+ /*  21 */ "literal_element ::= LITERAL",
+ /*  22 */ "literal_element ::= PHPSTARTTAG",
+ /*  23 */ "literal_element ::= FAKEPHPSTARTTAG",
+ /*  24 */ "literal_element ::= PHPENDTAG",
+ /*  25 */ "literal_element ::= ASPSTARTTAG",
+ /*  26 */ "literal_element ::= ASPENDTAG",
+ /*  27 */ "smartytag ::= LDEL value RDEL",
+ /*  28 */ "smartytag ::= LDEL value modifierlist attributes RDEL",
+ /*  29 */ "smartytag ::= LDEL value attributes RDEL",
+ /*  30 */ "smartytag ::= LDEL expr modifierlist attributes RDEL",
+ /*  31 */ "smartytag ::= LDEL expr attributes RDEL",
+ /*  32 */ "smartytag ::= LDEL DOLLAR ID EQUAL value RDEL",
+ /*  33 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr RDEL",
+ /*  34 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr attributes RDEL",
+ /*  35 */ "smartytag ::= LDEL varindexed EQUAL expr attributes RDEL",
+ /*  36 */ "smartytag ::= LDEL ID attributes RDEL",
+ /*  37 */ "smartytag ::= LDEL ID RDEL",
+ /*  38 */ "smartytag ::= LDEL ID PTR ID attributes RDEL",
+ /*  39 */ "smartytag ::= LDEL ID modifierlist attributes RDEL",
+ /*  40 */ "smartytag ::= LDEL ID PTR ID modifierlist attributes RDEL",
+ /*  41 */ "smartytag ::= LDELIF expr RDEL",
+ /*  42 */ "smartytag ::= LDELIF expr attributes RDEL",
+ /*  43 */ "smartytag ::= LDELIF statement RDEL",
+ /*  44 */ "smartytag ::= LDELIF statement attributes RDEL",
+ /*  45 */ "smartytag ::= LDELFOR statements SEMICOLON optspace expr SEMICOLON optspace DOLLAR varvar foraction attributes RDEL",
+ /*  46 */ "foraction ::= EQUAL expr",
+ /*  47 */ "foraction ::= INCDEC",
+ /*  48 */ "smartytag ::= LDELFOR statement TO expr attributes RDEL",
+ /*  49 */ "smartytag ::= LDELFOR statement TO expr STEP expr attributes RDEL",
+ /*  50 */ "smartytag ::= LDELFOREACH attributes RDEL",
+ /*  51 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar attributes RDEL",
+ /*  52 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL",
+ /*  53 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar attributes RDEL",
+ /*  54 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL",
+ /*  55 */ "smartytag ::= LDELSETFILTER ID modparameters RDEL",
+ /*  56 */ "smartytag ::= LDELSETFILTER ID modparameters modifierlist RDEL",
+ /*  57 */ "smartytag ::= SMARTYBLOCKCHILD",
+ /*  58 */ "smartytag ::= LDELSLASH ID RDEL",
+ /*  59 */ "smartytag ::= LDELSLASH ID modifierlist RDEL",
+ /*  60 */ "smartytag ::= LDELSLASH ID PTR ID RDEL",
+ /*  61 */ "smartytag ::= LDELSLASH ID PTR ID modifierlist RDEL",
+ /*  62 */ "attributes ::= attributes attribute",
+ /*  63 */ "attributes ::= attribute",
+ /*  64 */ "attributes ::=",
+ /*  65 */ "attribute ::= SPACE ID EQUAL ID",
+ /*  66 */ "attribute ::= ATTR expr",
+ /*  67 */ "attribute ::= ATTR value",
+ /*  68 */ "attribute ::= SPACE ID",
+ /*  69 */ "attribute ::= SPACE expr",
+ /*  70 */ "attribute ::= SPACE value",
+ /*  71 */ "attribute ::= SPACE INTEGER EQUAL expr",
+ /*  72 */ "statements ::= statement",
+ /*  73 */ "statements ::= statements COMMA statement",
+ /*  74 */ "statement ::= DOLLAR varvar EQUAL expr",
+ /*  75 */ "statement ::= varindexed EQUAL expr",
+ /*  76 */ "statement ::= OPENP statement CLOSEP",
+ /*  77 */ "expr ::= value",
+ /*  78 */ "expr ::= ternary",
+ /*  79 */ "expr ::= DOLLAR ID COLON ID",
+ /*  80 */ "expr ::= expr MATH value",
+ /*  81 */ "expr ::= expr UNIMATH value",
+ /*  82 */ "expr ::= expr ANDSYM value",
+ /*  83 */ "expr ::= array",
+ /*  84 */ "expr ::= expr modifierlist",
+ /*  85 */ "expr ::= expr ifcond expr",
+ /*  86 */ "expr ::= expr ISIN array",
+ /*  87 */ "expr ::= expr ISIN value",
+ /*  88 */ "expr ::= expr lop expr",
+ /*  89 */ "expr ::= expr ISDIVBY expr",
+ /*  90 */ "expr ::= expr ISNOTDIVBY expr",
+ /*  91 */ "expr ::= expr ISEVEN",
+ /*  92 */ "expr ::= expr ISNOTEVEN",
+ /*  93 */ "expr ::= expr ISEVENBY expr",
+ /*  94 */ "expr ::= expr ISNOTEVENBY expr",
+ /*  95 */ "expr ::= expr ISODD",
+ /*  96 */ "expr ::= expr ISNOTODD",
+ /*  97 */ "expr ::= expr ISODDBY expr",
+ /*  98 */ "expr ::= expr ISNOTODDBY expr",
+ /*  99 */ "expr ::= value INSTANCEOF ID",
+ /* 100 */ "expr ::= value INSTANCEOF value",
+ /* 101 */ "ternary ::= OPENP expr CLOSEP QMARK DOLLAR ID COLON expr",
+ /* 102 */ "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr",
+ /* 103 */ "value ::= variable",
+ /* 104 */ "value ::= UNIMATH value",
+ /* 105 */ "value ::= NOT value",
+ /* 106 */ "value ::= TYPECAST value",
+ /* 107 */ "value ::= variable INCDEC",
+ /* 108 */ "value ::= HEX",
+ /* 109 */ "value ::= INTEGER",
+ /* 110 */ "value ::= INTEGER DOT INTEGER",
+ /* 111 */ "value ::= INTEGER DOT",
+ /* 112 */ "value ::= DOT INTEGER",
+ /* 113 */ "value ::= ID",
+ /* 114 */ "value ::= function",
+ /* 115 */ "value ::= OPENP expr CLOSEP",
+ /* 116 */ "value ::= SINGLEQUOTESTRING",
+ /* 117 */ "value ::= doublequoted_with_quotes",
+ /* 118 */ "value ::= ID DOUBLECOLON static_class_access",
+ /* 119 */ "value ::= varindexed DOUBLECOLON static_class_access",
+ /* 120 */ "value ::= smartytag",
+ /* 121 */ "value ::= value modifierlist",
+ /* 122 */ "variable ::= varindexed",
+ /* 123 */ "variable ::= DOLLAR varvar AT ID",
+ /* 124 */ "variable ::= object",
+ /* 125 */ "variable ::= HATCH ID HATCH",
+ /* 126 */ "variable ::= HATCH variable HATCH",
+ /* 127 */ "varindexed ::= DOLLAR varvar arrayindex",
+ /* 128 */ "arrayindex ::= arrayindex indexdef",
+ /* 129 */ "arrayindex ::=",
+ /* 130 */ "indexdef ::= DOT DOLLAR varvar",
+ /* 131 */ "indexdef ::= DOT DOLLAR varvar AT ID",
+ /* 132 */ "indexdef ::= DOT ID",
+ /* 133 */ "indexdef ::= DOT INTEGER",
+ /* 134 */ "indexdef ::= DOT LDEL expr RDEL",
+ /* 135 */ "indexdef ::= OPENB ID CLOSEB",
+ /* 136 */ "indexdef ::= OPENB ID DOT ID CLOSEB",
+ /* 137 */ "indexdef ::= OPENB expr CLOSEB",
+ /* 138 */ "indexdef ::= OPENB CLOSEB",
+ /* 139 */ "varvar ::= varvarele",
+ /* 140 */ "varvar ::= varvar varvarele",
+ /* 141 */ "varvarele ::= ID",
+ /* 142 */ "varvarele ::= LDEL expr RDEL",
+ /* 143 */ "object ::= varindexed objectchain",
+ /* 144 */ "objectchain ::= objectelement",
+ /* 145 */ "objectchain ::= objectchain objectelement",
+ /* 146 */ "objectelement ::= PTR ID arrayindex",
+ /* 147 */ "objectelement ::= PTR DOLLAR varvar arrayindex",
+ /* 148 */ "objectelement ::= PTR LDEL expr RDEL arrayindex",
+ /* 149 */ "objectelement ::= PTR ID LDEL expr RDEL arrayindex",
+ /* 150 */ "objectelement ::= PTR method",
+ /* 151 */ "function ::= ID OPENP params CLOSEP",
+ /* 152 */ "method ::= ID OPENP params CLOSEP",
+ /* 153 */ "method ::= DOLLAR ID OPENP params CLOSEP",
+ /* 154 */ "params ::= params COMMA expr",
+ /* 155 */ "params ::= expr",
+ /* 156 */ "params ::=",
+ /* 157 */ "modifierlist ::= modifierlist modifier modparameters",
+ /* 158 */ "modifierlist ::= modifier modparameters",
+ /* 159 */ "modifier ::= VERT AT ID",
+ /* 160 */ "modifier ::= VERT ID",
+ /* 161 */ "modparameters ::= modparameters modparameter",
+ /* 162 */ "modparameters ::=",
+ /* 163 */ "modparameter ::= COLON value",
+ /* 164 */ "modparameter ::= COLON array",
+ /* 165 */ "static_class_access ::= method",
+ /* 166 */ "static_class_access ::= method objectchain",
+ /* 167 */ "static_class_access ::= ID",
+ /* 168 */ "static_class_access ::= DOLLAR ID arrayindex",
+ /* 169 */ "static_class_access ::= DOLLAR ID arrayindex objectchain",
+ /* 170 */ "ifcond ::= EQUALS",
+ /* 171 */ "ifcond ::= NOTEQUALS",
+ /* 172 */ "ifcond ::= GREATERTHAN",
+ /* 173 */ "ifcond ::= LESSTHAN",
+ /* 174 */ "ifcond ::= GREATEREQUAL",
+ /* 175 */ "ifcond ::= LESSEQUAL",
+ /* 176 */ "ifcond ::= IDENTITY",
+ /* 177 */ "ifcond ::= NONEIDENTITY",
+ /* 178 */ "ifcond ::= MOD",
+ /* 179 */ "lop ::= LAND",
+ /* 180 */ "lop ::= LOR",
+ /* 181 */ "lop ::= LXOR",
+ /* 182 */ "array ::= OPENB arrayelements CLOSEB",
+ /* 183 */ "arrayelements ::= arrayelement",
+ /* 184 */ "arrayelements ::= arrayelements COMMA arrayelement",
+ /* 185 */ "arrayelements ::=",
+ /* 186 */ "arrayelement ::= value APTR expr",
+ /* 187 */ "arrayelement ::= ID APTR expr",
+ /* 188 */ "arrayelement ::= expr",
+ /* 189 */ "doublequoted_with_quotes ::= QUOTE QUOTE",
+ /* 190 */ "doublequoted_with_quotes ::= QUOTE doublequoted QUOTE",
+ /* 191 */ "doublequoted ::= doublequoted doublequotedcontent",
+ /* 192 */ "doublequoted ::= doublequotedcontent",
+ /* 193 */ "doublequotedcontent ::= BACKTICK variable BACKTICK",
+ /* 194 */ "doublequotedcontent ::= BACKTICK expr BACKTICK",
+ /* 195 */ "doublequotedcontent ::= DOLLARID",
+ /* 196 */ "doublequotedcontent ::= LDEL variable RDEL",
+ /* 197 */ "doublequotedcontent ::= LDEL expr RDEL",
+ /* 198 */ "doublequotedcontent ::= smartytag",
+ /* 199 */ "doublequotedcontent ::= TEXT",
+ /* 200 */ "optspace ::= SPACE",
+ /* 201 */ "optspace ::=",
+    );
+
+    function tokenName($tokenType)
+    {
+        if ($tokenType === 0) {
+            return 'End of Input';
+        }
+        if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {
+            return $this->yyTokenName[$tokenType];
+        } else {
+            return "Unknown";
+        }
+    }
+
+    static function yy_destructor($yymajor, $yypminor)
+    {
+        switch ($yymajor) {
+            default:  break;   /* If no destructor action specified: do nothing */
+        }
+    }
+
+    function yy_pop_parser_stack()
+    {
+        if (!count($this->yystack)) {
+            return;
+        }
+        $yytos = array_pop($this->yystack);
+        if (self::$yyTraceFILE && $this->yyidx >= 0) {
+            fwrite(self::$yyTraceFILE,
+                self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .
+                    "\n");
+        }
+        $yymajor = $yytos->major;
+        self::yy_destructor($yymajor, $yytos->minor);
+        $this->yyidx--;
+        return $yymajor;
+    }
+
+    function __destruct()
+    {
+        while ($this->yystack !== Array()) {
+            $this->yy_pop_parser_stack();
+        }
+        if (is_resource(self::$yyTraceFILE)) {
+            fclose(self::$yyTraceFILE);
+        }
+    }
+
+    function yy_get_expected_tokens($token)
+    {
+        $state = $this->yystack[$this->yyidx]->stateno;
+        $expected = self::$yyExpectedTokens[$state];
+        if (in_array($token, self::$yyExpectedTokens[$state], true)) {
+            return $expected;
+        }
+        $stack = $this->yystack;
+        $yyidx = $this->yyidx;
+        do {
+            $yyact = $this->yy_find_shift_action($token);
+            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
+                // reduce action
+                $done = 0;
+                do {
+                    if ($done++ == 100) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // too much recursion prevents proper detection
+                        // so give up
+                        return array_unique($expected);
+                    }
+                    $yyruleno = $yyact - self::YYNSTATE;
+                    $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
+                    $nextstate = $this->yy_find_reduce_action(
+                        $this->yystack[$this->yyidx]->stateno,
+                        self::$yyRuleInfo[$yyruleno]['lhs']);
+                    if (isset(self::$yyExpectedTokens[$nextstate])) {
+                       $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
+                            if (in_array($token,
+                                  self::$yyExpectedTokens[$nextstate], true)) {
+                            $this->yyidx = $yyidx;
+                            $this->yystack = $stack;
+                            return array_unique($expected);
+                        }
+                    }
+                    if ($nextstate < self::YYNSTATE) {
+                        // we need to shift a non-terminal
+                        $this->yyidx++;
+                        $x = new TP_yyStackEntry;
+                        $x->stateno = $nextstate;
+                        $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
+                        $this->yystack[$this->yyidx] = $x;
+                        continue 2;
+                    } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // the last token was just ignored, we can't accept
+                        // by ignoring input, this is in essence ignoring a
+                        // syntax error!
+                        return array_unique($expected);
+                    } elseif ($nextstate === self::YY_NO_ACTION) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // input accepted, but not shifted (I guess)
+                        return $expected;
+                    } else {
+                        $yyact = $nextstate;
+                    }
+                } while (true);
+            }
+            break;
+        } while (true);
+       $this->yyidx = $yyidx;
+       $this->yystack = $stack;
+        return array_unique($expected);
+    }
+
+    function yy_is_expected_token($token)
+    {
+        if ($token === 0) {
+            return true; // 0 is not part of this
+        }
+        $state = $this->yystack[$this->yyidx]->stateno;
+        if (in_array($token, self::$yyExpectedTokens[$state], true)) {
+            return true;
+        }
+        $stack = $this->yystack;
+        $yyidx = $this->yyidx;
+        do {
+            $yyact = $this->yy_find_shift_action($token);
+            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
+                // reduce action
+                $done = 0;
+                do {
+                    if ($done++ == 100) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // too much recursion prevents proper detection
+                        // so give up
+                        return true;
+                    }
+                    $yyruleno = $yyact - self::YYNSTATE;
+                    $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
+                    $nextstate = $this->yy_find_reduce_action(
+                        $this->yystack[$this->yyidx]->stateno,
+                        self::$yyRuleInfo[$yyruleno]['lhs']);
+                    if (isset(self::$yyExpectedTokens[$nextstate]) &&
+                          in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        return true;
+                    }
+                    if ($nextstate < self::YYNSTATE) {
+                        // we need to shift a non-terminal
+                        $this->yyidx++;
+                        $x = new TP_yyStackEntry;
+                        $x->stateno = $nextstate;
+                        $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
+                        $this->yystack[$this->yyidx] = $x;
+                        continue 2;
+                    } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        if (!$token) {
+                            // end of input: this is valid
+                            return true;
+                        }
+                        // the last token was just ignored, we can't accept
+                        // by ignoring input, this is in essence ignoring a
+                        // syntax error!
+                        return false;
+                    } elseif ($nextstate === self::YY_NO_ACTION) {
+                        $this->yyidx = $yyidx;
+                        $this->yystack = $stack;
+                        // input accepted, but not shifted (I guess)
+                        return true;
+                    } else {
+                        $yyact = $nextstate;
+                    }
+                } while (true);
+            }
+            break;
+        } while (true);
+        $this->yyidx = $yyidx;
+        $this->yystack = $stack;
+        return true;
+    }
+
+   function yy_find_shift_action($iLookAhead)
+    {
+        $stateno = $this->yystack[$this->yyidx]->stateno;
+
+        /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */
+        if (!isset(self::$yy_shift_ofst[$stateno])) {
+            // no shift actions
+            return self::$yy_default[$stateno];
+        }
+        $i = self::$yy_shift_ofst[$stateno];
+        if ($i === self::YY_SHIFT_USE_DFLT) {
+            return self::$yy_default[$stateno];
+        }
+        if ($iLookAhead == self::YYNOCODE) {
+            return self::YY_NO_ACTION;
+        }
+        $i += $iLookAhead;
+        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
+              self::$yy_lookahead[$i] != $iLookAhead) {
+            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
+                   && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
+                if (self::$yyTraceFILE) {
+                    fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " .
+                        $this->yyTokenName[$iLookAhead] . " => " .
+                        $this->yyTokenName[$iFallback] . "\n");
+                }
+                return $this->yy_find_shift_action($iFallback);
+            }
+            return self::$yy_default[$stateno];
+        } else {
+            return self::$yy_action[$i];
+        }
+    }
+
+    function yy_find_reduce_action($stateno, $iLookAhead)
+    {
+        /* $stateno = $this->yystack[$this->yyidx]->stateno; */
+
+        if (!isset(self::$yy_reduce_ofst[$stateno])) {
+            return self::$yy_default[$stateno];
+        }
+        $i = self::$yy_reduce_ofst[$stateno];
+        if ($i == self::YY_REDUCE_USE_DFLT) {
+            return self::$yy_default[$stateno];
+        }
+        if ($iLookAhead == self::YYNOCODE) {
+            return self::YY_NO_ACTION;
+        }
+        $i += $iLookAhead;
+        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
+              self::$yy_lookahead[$i] != $iLookAhead) {
+            return self::$yy_default[$stateno];
+        } else {
+            return self::$yy_action[$i];
+        }
+    }
+
+    function yy_shift($yyNewState, $yyMajor, $yypMinor)
+    {
+        $this->yyidx++;
+        if ($this->yyidx >= self::YYSTACKDEPTH) {
+            $this->yyidx--;
+            if (self::$yyTraceFILE) {
+                fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt);
+            }
+            while ($this->yyidx >= 0) {
+                $this->yy_pop_parser_stack();
+            }
+#line 84 "smarty_internal_templateparser.y"
+
+    $this->internalError = true;
+    $this->compiler->trigger_template_error("Stack overflow in template parser");
+#line 1733 "smarty_internal_templateparser.php"
+            return;
+        }
+        $yytos = new TP_yyStackEntry;
+        $yytos->stateno = $yyNewState;
+        $yytos->major = $yyMajor;
+        $yytos->minor = $yypMinor;
+        array_push($this->yystack, $yytos);
+        if (self::$yyTraceFILE && $this->yyidx > 0) {
+            fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt,
+                $yyNewState);
+            fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt);
+            for($i = 1; $i <= $this->yyidx; $i++) {
+                fprintf(self::$yyTraceFILE, " %s",
+                    $this->yyTokenName[$this->yystack[$i]->major]);
+            }
+            fwrite(self::$yyTraceFILE,"\n");
+        }
+    }
+
+    static public $yyRuleInfo = array(
+  array( 'lhs' => 82, 'rhs' => 1 ),
+  array( 'lhs' => 83, 'rhs' => 1 ),
+  array( 'lhs' => 83, 'rhs' => 2 ),
+  array( 'lhs' => 83, 'rhs' => 0 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 84, 'rhs' => 1 ),
+  array( 'lhs' => 86, 'rhs' => 2 ),
+  array( 'lhs' => 86, 'rhs' => 3 ),
+  array( 'lhs' => 87, 'rhs' => 2 ),
+  array( 'lhs' => 87, 'rhs' => 0 ),
+  array( 'lhs' => 88, 'rhs' => 1 ),
+  array( 'lhs' => 88, 'rhs' => 1 ),
+  array( 'lhs' => 88, 'rhs' => 1 ),
+  array( 'lhs' => 88, 'rhs' => 1 ),
+  array( 'lhs' => 88, 'rhs' => 1 ),
+  array( 'lhs' => 88, 'rhs' => 1 ),
+  array( 'lhs' => 88, 'rhs' => 1 ),
+  array( 'lhs' => 85, 'rhs' => 3 ),
+  array( 'lhs' => 85, 'rhs' => 5 ),
+  array( 'lhs' => 85, 'rhs' => 4 ),
+  array( 'lhs' => 85, 'rhs' => 5 ),
+  array( 'lhs' => 85, 'rhs' => 4 ),
+  array( 'lhs' => 85, 'rhs' => 6 ),
+  array( 'lhs' => 85, 'rhs' => 6 ),
+  array( 'lhs' => 85, 'rhs' => 7 ),
+  array( 'lhs' => 85, 'rhs' => 6 ),
+  array( 'lhs' => 85, 'rhs' => 4 ),
+  array( 'lhs' => 85, 'rhs' => 3 ),
+  array( 'lhs' => 85, 'rhs' => 6 ),
+  array( 'lhs' => 85, 'rhs' => 5 ),
+  array( 'lhs' => 85, 'rhs' => 7 ),
+  array( 'lhs' => 85, 'rhs' => 3 ),
+  array( 'lhs' => 85, 'rhs' => 4 ),
+  array( 'lhs' => 85, 'rhs' => 3 ),
+  array( 'lhs' => 85, 'rhs' => 4 ),
+  array( 'lhs' => 85, 'rhs' => 12 ),
+  array( 'lhs' => 98, 'rhs' => 2 ),
+  array( 'lhs' => 98, 'rhs' => 1 ),
+  array( 'lhs' => 85, 'rhs' => 6 ),
+  array( 'lhs' => 85, 'rhs' => 8 ),
+  array( 'lhs' => 85, 'rhs' => 3 ),
+  array( 'lhs' => 85, 'rhs' => 8 ),
+  array( 'lhs' => 85, 'rhs' => 11 ),
+  array( 'lhs' => 85, 'rhs' => 8 ),
+  array( 'lhs' => 85, 'rhs' => 11 ),
+  array( 'lhs' => 85, 'rhs' => 4 ),
+  array( 'lhs' => 85, 'rhs' => 5 ),
+  array( 'lhs' => 85, 'rhs' => 1 ),
+  array( 'lhs' => 85, 'rhs' => 3 ),
+  array( 'lhs' => 85, 'rhs' => 4 ),
+  array( 'lhs' => 85, 'rhs' => 5 ),
+  array( 'lhs' => 85, 'rhs' => 6 ),
+  array( 'lhs' => 91, 'rhs' => 2 ),
+  array( 'lhs' => 91, 'rhs' => 1 ),
+  array( 'lhs' => 91, 'rhs' => 0 ),
+  array( 'lhs' => 100, 'rhs' => 4 ),
+  array( 'lhs' => 100, 'rhs' => 2 ),
+  array( 'lhs' => 100, 'rhs' => 2 ),
+  array( 'lhs' => 100, 'rhs' => 2 ),
+  array( 'lhs' => 100, 'rhs' => 2 ),
+  array( 'lhs' => 100, 'rhs' => 2 ),
+  array( 'lhs' => 100, 'rhs' => 4 ),
+  array( 'lhs' => 95, 'rhs' => 1 ),
+  array( 'lhs' => 95, 'rhs' => 3 ),
+  array( 'lhs' => 94, 'rhs' => 4 ),
+  array( 'lhs' => 94, 'rhs' => 3 ),
+  array( 'lhs' => 94, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 1 ),
+  array( 'lhs' => 92, 'rhs' => 1 ),
+  array( 'lhs' => 92, 'rhs' => 4 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 1 ),
+  array( 'lhs' => 92, 'rhs' => 2 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 2 ),
+  array( 'lhs' => 92, 'rhs' => 2 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 2 ),
+  array( 'lhs' => 92, 'rhs' => 2 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 92, 'rhs' => 3 ),
+  array( 'lhs' => 101, 'rhs' => 8 ),
+  array( 'lhs' => 101, 'rhs' => 7 ),
+  array( 'lhs' => 89, 'rhs' => 1 ),
+  array( 'lhs' => 89, 'rhs' => 2 ),
+  array( 'lhs' => 89, 'rhs' => 2 ),
+  array( 'lhs' => 89, 'rhs' => 2 ),
+  array( 'lhs' => 89, 'rhs' => 2 ),
+  array( 'lhs' => 89, 'rhs' => 1 ),
+  array( 'lhs' => 89, 'rhs' => 1 ),
+  array( 'lhs' => 89, 'rhs' => 3 ),
+  array( 'lhs' => 89, 'rhs' => 2 ),
+  array( 'lhs' => 89, 'rhs' => 2 ),
+  array( 'lhs' => 89, 'rhs' => 1 ),
+  array( 'lhs' => 89, 'rhs' => 1 ),
+  array( 'lhs' => 89, 'rhs' => 3 ),
+  array( 'lhs' => 89, 'rhs' => 1 ),
+  array( 'lhs' => 89, 'rhs' => 1 ),
+  array( 'lhs' => 89, 'rhs' => 3 ),
+  array( 'lhs' => 89, 'rhs' => 3 ),
+  array( 'lhs' => 89, 'rhs' => 1 ),
+  array( 'lhs' => 89, 'rhs' => 2 ),
+  array( 'lhs' => 105, 'rhs' => 1 ),
+  array( 'lhs' => 105, 'rhs' => 4 ),
+  array( 'lhs' => 105, 'rhs' => 1 ),
+  array( 'lhs' => 105, 'rhs' => 3 ),
+  array( 'lhs' => 105, 'rhs' => 3 ),
+  array( 'lhs' => 93, 'rhs' => 3 ),
+  array( 'lhs' => 110, 'rhs' => 2 ),
+  array( 'lhs' => 110, 'rhs' => 0 ),
+  array( 'lhs' => 111, 'rhs' => 3 ),
+  array( 'lhs' => 111, 'rhs' => 5 ),
+  array( 'lhs' => 111, 'rhs' => 2 ),
+  array( 'lhs' => 111, 'rhs' => 2 ),
+  array( 'lhs' => 111, 'rhs' => 4 ),
+  array( 'lhs' => 111, 'rhs' => 3 ),
+  array( 'lhs' => 111, 'rhs' => 5 ),
+  array( 'lhs' => 111, 'rhs' => 3 ),
+  array( 'lhs' => 111, 'rhs' => 2 ),
+  array( 'lhs' => 97, 'rhs' => 1 ),
+  array( 'lhs' => 97, 'rhs' => 2 ),
+  array( 'lhs' => 112, 'rhs' => 1 ),
+  array( 'lhs' => 112, 'rhs' => 3 ),
+  array( 'lhs' => 109, 'rhs' => 2 ),
+  array( 'lhs' => 113, 'rhs' => 1 ),
+  array( 'lhs' => 113, 'rhs' => 2 ),
+  array( 'lhs' => 114, 'rhs' => 3 ),
+  array( 'lhs' => 114, 'rhs' => 4 ),
+  array( 'lhs' => 114, 'rhs' => 5 ),
+  array( 'lhs' => 114, 'rhs' => 6 ),
+  array( 'lhs' => 114, 'rhs' => 2 ),
+  array( 'lhs' => 106, 'rhs' => 4 ),
+  array( 'lhs' => 115, 'rhs' => 4 ),
+  array( 'lhs' => 115, 'rhs' => 5 ),
+  array( 'lhs' => 116, 'rhs' => 3 ),
+  array( 'lhs' => 116, 'rhs' => 1 ),
+  array( 'lhs' => 116, 'rhs' => 0 ),
+  array( 'lhs' => 90, 'rhs' => 3 ),
+  array( 'lhs' => 90, 'rhs' => 2 ),
+  array( 'lhs' => 117, 'rhs' => 3 ),
+  array( 'lhs' => 117, 'rhs' => 2 ),
+  array( 'lhs' => 99, 'rhs' => 2 ),
+  array( 'lhs' => 99, 'rhs' => 0 ),
+  array( 'lhs' => 118, 'rhs' => 2 ),
+  array( 'lhs' => 118, 'rhs' => 2 ),
+  array( 'lhs' => 108, 'rhs' => 1 ),
+  array( 'lhs' => 108, 'rhs' => 2 ),
+  array( 'lhs' => 108, 'rhs' => 1 ),
+  array( 'lhs' => 108, 'rhs' => 3 ),
+  array( 'lhs' => 108, 'rhs' => 4 ),
+  array( 'lhs' => 103, 'rhs' => 1 ),
+  array( 'lhs' => 103, 'rhs' => 1 ),
+  array( 'lhs' => 103, 'rhs' => 1 ),
+  array( 'lhs' => 103, 'rhs' => 1 ),
+  array( 'lhs' => 103, 'rhs' => 1 ),
+  array( 'lhs' => 103, 'rhs' => 1 ),
+  array( 'lhs' => 103, 'rhs' => 1 ),
+  array( 'lhs' => 103, 'rhs' => 1 ),
+  array( 'lhs' => 103, 'rhs' => 1 ),
+  array( 'lhs' => 104, 'rhs' => 1 ),
+  array( 'lhs' => 104, 'rhs' => 1 ),
+  array( 'lhs' => 104, 'rhs' => 1 ),
+  array( 'lhs' => 102, 'rhs' => 3 ),
+  array( 'lhs' => 119, 'rhs' => 1 ),
+  array( 'lhs' => 119, 'rhs' => 3 ),
+  array( 'lhs' => 119, 'rhs' => 0 ),
+  array( 'lhs' => 120, 'rhs' => 3 ),
+  array( 'lhs' => 120, 'rhs' => 3 ),
+  array( 'lhs' => 120, 'rhs' => 1 ),
+  array( 'lhs' => 107, 'rhs' => 2 ),
+  array( 'lhs' => 107, 'rhs' => 3 ),
+  array( 'lhs' => 121, 'rhs' => 2 ),
+  array( 'lhs' => 121, 'rhs' => 1 ),
+  array( 'lhs' => 122, 'rhs' => 3 ),
+  array( 'lhs' => 122, 'rhs' => 3 ),
+  array( 'lhs' => 122, 'rhs' => 1 ),
+  array( 'lhs' => 122, 'rhs' => 3 ),
+  array( 'lhs' => 122, 'rhs' => 3 ),
+  array( 'lhs' => 122, 'rhs' => 1 ),
+  array( 'lhs' => 122, 'rhs' => 1 ),
+  array( 'lhs' => 96, 'rhs' => 1 ),
+  array( 'lhs' => 96, 'rhs' => 0 ),
+    );
+
+    static public $yyReduceMap = array(
+        0 => 0,
+        1 => 1,
+        2 => 1,
+        4 => 4,
+        5 => 5,
+        6 => 6,
+        7 => 7,
+        8 => 8,
+        9 => 9,
+        10 => 10,
+        11 => 11,
+        12 => 12,
+        13 => 13,
+        14 => 14,
+        15 => 15,
+        16 => 16,
+        19 => 16,
+        201 => 16,
+        17 => 17,
+        76 => 17,
+        18 => 18,
+        104 => 18,
+        106 => 18,
+        107 => 18,
+        128 => 18,
+        166 => 18,
+        20 => 20,
+        21 => 20,
+        47 => 20,
+        69 => 20,
+        70 => 20,
+        77 => 20,
+        78 => 20,
+        83 => 20,
+        103 => 20,
+        108 => 20,
+        109 => 20,
+        114 => 20,
+        116 => 20,
+        117 => 20,
+        124 => 20,
+        139 => 20,
+        165 => 20,
+        167 => 20,
+        183 => 20,
+        188 => 20,
+        200 => 20,
+        22 => 22,
+        23 => 22,
+        24 => 24,
+        25 => 25,
+        26 => 26,
+        27 => 27,
+        28 => 28,
+        29 => 29,
+        31 => 29,
+        30 => 30,
+        32 => 32,
+        33 => 32,
+        34 => 34,
+        35 => 35,
+        36 => 36,
+        37 => 37,
+        38 => 38,
+        39 => 39,
+        40 => 40,
+        41 => 41,
+        42 => 42,
+        44 => 42,
+        43 => 43,
+        45 => 45,
+        46 => 46,
+        48 => 48,
+        49 => 49,
+        50 => 50,
+        51 => 51,
+        52 => 52,
+        53 => 53,
+        54 => 54,
+        55 => 55,
+        56 => 56,
+        57 => 57,
+        58 => 58,
+        59 => 59,
+        60 => 60,
+        61 => 61,
+        62 => 62,
+        63 => 63,
+        72 => 63,
+        155 => 63,
+        159 => 63,
+        163 => 63,
+        164 => 63,
+        64 => 64,
+        156 => 64,
+        162 => 64,
+        65 => 65,
+        66 => 66,
+        67 => 66,
+        68 => 68,
+        71 => 71,
+        73 => 73,
+        74 => 74,
+        75 => 74,
+        79 => 79,
+        80 => 80,
+        81 => 80,
+        82 => 80,
+        84 => 84,
+        121 => 84,
+        85 => 85,
+        88 => 85,
+        99 => 85,
+        86 => 86,
+        87 => 87,
+        89 => 89,
+        90 => 90,
+        91 => 91,
+        96 => 91,
+        92 => 92,
+        95 => 92,
+        93 => 93,
+        98 => 93,
+        94 => 94,
+        97 => 94,
+        100 => 100,
+        101 => 101,
+        102 => 102,
+        105 => 105,
+        110 => 110,
+        111 => 111,
+        112 => 112,
+        113 => 113,
+        115 => 115,
+        118 => 118,
+        119 => 119,
+        120 => 120,
+        122 => 122,
+        123 => 123,
+        125 => 125,
+        126 => 126,
+        127 => 127,
+        129 => 129,
+        185 => 129,
+        130 => 130,
+        131 => 131,
+        132 => 132,
+        133 => 133,
+        134 => 134,
+        137 => 134,
+        135 => 135,
+        136 => 136,
+        138 => 138,
+        140 => 140,
+        141 => 141,
+        142 => 142,
+        143 => 143,
+        144 => 144,
+        145 => 145,
+        146 => 146,
+        147 => 147,
+        148 => 148,
+        149 => 149,
+        150 => 150,
+        151 => 151,
+        152 => 152,
+        153 => 153,
+        154 => 154,
+        157 => 157,
+        158 => 158,
+        160 => 160,
+        161 => 161,
+        168 => 168,
+        169 => 169,
+        170 => 170,
+        171 => 171,
+        172 => 172,
+        173 => 173,
+        174 => 174,
+        175 => 175,
+        176 => 176,
+        177 => 177,
+        178 => 178,
+        179 => 179,
+        180 => 180,
+        181 => 181,
+        182 => 182,
+        184 => 184,
+        186 => 186,
+        187 => 187,
+        189 => 189,
+        190 => 190,
+        191 => 191,
+        192 => 192,
+        193 => 193,
+        194 => 193,
+        196 => 193,
+        195 => 195,
+        197 => 197,
+        198 => 198,
+        199 => 199,
+    );
+#line 95 "smarty_internal_templateparser.y"
+    function yy_r0(){
+    $this->_retvalue = $this->root_buffer->to_smarty_php();
+    }
+#line 2165 "smarty_internal_templateparser.php"
+#line 103 "smarty_internal_templateparser.y"
+    function yy_r1(){
+    $this->current_buffer->append_subtree($this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2170 "smarty_internal_templateparser.php"
+#line 119 "smarty_internal_templateparser.y"
+    function yy_r4(){
+    if ($this->compiler->has_code) {
+        $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array();
+        $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode($tmp.$this->yystack[$this->yyidx + 0]->minor,true));
+    } else {
+        $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor);
+    }
+    $this->compiler->has_variable_string = false;
+    $this->block_nesting_level = count($this->compiler->_tag_stack);
+    }
+#line 2182 "smarty_internal_templateparser.php"
+#line 131 "smarty_internal_templateparser.y"
+    function yy_r5(){
+    $this->_retvalue = new _smarty_tag($this, '');
+    }
+#line 2187 "smarty_internal_templateparser.php"
+#line 136 "smarty_internal_templateparser.y"
+    function yy_r6(){
+    $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2192 "smarty_internal_templateparser.php"
+#line 141 "smarty_internal_templateparser.y"
+    function yy_r7(){
+    if ($this->php_handling == Smarty::PHP_PASSTHRU) {
+        $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor));
+    } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
+        $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES));
+    } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
+        if (!($this->smarty instanceof SmartyBC)) {
+            $this->compiler->trigger_template_error (self::Err3);
+        }
+        $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('<?php', true));
+    } elseif ($this->php_handling == Smarty::PHP_REMOVE) {
+        $this->_retvalue = new _smarty_text($this, '');
+    }
+    }
+#line 2208 "smarty_internal_templateparser.php"
+#line 157 "smarty_internal_templateparser.y"
+    function yy_r8(){
+    if ($this->is_xml) {
+        $this->compiler->tag_nocache = true;
+        $this->is_xml = false;
+        $save = $this->template->has_nocache_code;
+        $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("<?php echo '?>';?>\n", $this->compiler, true));
+        $this->template->has_nocache_code = $save;
+    } elseif ($this->php_handling == Smarty::PHP_PASSTHRU) {
+        $this->_retvalue = new _smarty_text($this, '?<?php ?>>');
+    } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
+        $this->_retvalue = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES));
+    } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
+        $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('?>', true));
+    } elseif ($this->php_handling == Smarty::PHP_REMOVE) {
+        $this->_retvalue = new _smarty_text($this, '');
+    }
+    }
+#line 2227 "smarty_internal_templateparser.php"
+#line 176 "smarty_internal_templateparser.y"
+    function yy_r9(){
+    if ($this->php_handling == Smarty::PHP_PASSTHRU) {
+        $this->_retvalue = new _smarty_text($this, '<<?php ?>%');
+    } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
+        $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES));
+    } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
+        if ($this->asp_tags) {
+            if (!($this->smarty instanceof SmartyBC)) {
+                $this->compiler->trigger_template_error (self::Err3);
+            }
+            $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('<%', true));
+        } else {
+            $this->_retvalue = new _smarty_text($this, '<<?php ?>%');
+        }
+    } elseif ($this->php_handling == Smarty::PHP_REMOVE) {
+        if ($this->asp_tags) {
+            $this->_retvalue = new _smarty_text($this, '');
+        } else {
+            $this->_retvalue = new _smarty_text($this, '<<?php ?>%');
+        }
+    }
+    }
+#line 2251 "smarty_internal_templateparser.php"
+#line 200 "smarty_internal_templateparser.y"
+    function yy_r10(){
+    if ($this->php_handling == Smarty::PHP_PASSTHRU) {
+        $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
+    } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
+        $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES));
+    } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
+        if ($this->asp_tags) {
+            $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('%>', true));
+        } else {
+            $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
+        }
+    } elseif ($this->php_handling == Smarty::PHP_REMOVE) {
+        if ($this->asp_tags) {
+            $this->_retvalue = new _smarty_text($this, '');
+        } else {
+            $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
+        }
+    }
+    }
+#line 2272 "smarty_internal_templateparser.php"
+#line 220 "smarty_internal_templateparser.y"
+    function yy_r11(){
+    if ($this->strip) {
+        $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)));
+    } else {
+        $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor));
+    }
+    }
+#line 2281 "smarty_internal_templateparser.php"
+#line 229 "smarty_internal_templateparser.y"
+    function yy_r12(){
+    $this->compiler->tag_nocache = true;
+    $this->is_xml = true;
+    $save = $this->template->has_nocache_code;
+    $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("<?php echo '<?xml';?>", $this->compiler, true));
+    $this->template->has_nocache_code = $save;
+    }
+#line 2290 "smarty_internal_templateparser.php"
+#line 238 "smarty_internal_templateparser.y"
+    function yy_r13(){
+    if ($this->strip) {
+        $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor));
+    } else {
+        $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor);
+    }
+    }
+#line 2299 "smarty_internal_templateparser.php"
+#line 247 "smarty_internal_templateparser.y"
+    function yy_r14(){
+    $this->strip = true;
+    $this->_retvalue = new _smarty_text($this, '');
+    }
+#line 2305 "smarty_internal_templateparser.php"
+#line 252 "smarty_internal_templateparser.y"
+    function yy_r15(){
+    $this->strip = false;
+    $this->_retvalue = new _smarty_text($this, '');
+    }
+#line 2311 "smarty_internal_templateparser.php"
+#line 258 "smarty_internal_templateparser.y"
+    function yy_r16(){
+    $this->_retvalue = '';
+    }
+#line 2316 "smarty_internal_templateparser.php"
+#line 262 "smarty_internal_templateparser.y"
+    function yy_r17(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;
+    }
+#line 2321 "smarty_internal_templateparser.php"
+#line 266 "smarty_internal_templateparser.y"
+    function yy_r18(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2326 "smarty_internal_templateparser.php"
+#line 274 "smarty_internal_templateparser.y"
+    function yy_r20(){
+    $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2331 "smarty_internal_templateparser.php"
+#line 282 "smarty_internal_templateparser.y"
+    function yy_r22(){
+    $this->_retvalue = self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2336 "smarty_internal_templateparser.php"
+#line 290 "smarty_internal_templateparser.y"
+    function yy_r24(){
+    $this->_retvalue = self::escape_end_tag($this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2341 "smarty_internal_templateparser.php"
+#line 294 "smarty_internal_templateparser.y"
+    function yy_r25(){
+    $this->_retvalue = '<<?php ?>%';
+    }
+#line 2346 "smarty_internal_templateparser.php"
+#line 298 "smarty_internal_templateparser.y"
+    function yy_r26(){
+    $this->_retvalue = '%<?php ?>>';
+    }
+#line 2351 "smarty_internal_templateparser.php"
+#line 307 "smarty_internal_templateparser.y"
+    function yy_r27(){
+    $this->_retvalue = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor));
+    }
+#line 2356 "smarty_internal_templateparser.php"
+#line 311 "smarty_internal_templateparser.y"
+    function yy_r28(){
+    $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor, 'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor));
+    }
+#line 2361 "smarty_internal_templateparser.php"
+#line 315 "smarty_internal_templateparser.y"
+    function yy_r29(){
+    $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -2]->minor));
+    }
+#line 2366 "smarty_internal_templateparser.php"
+#line 319 "smarty_internal_templateparser.y"
+    function yy_r30(){
+    $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor,'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor));
+    }
+#line 2371 "smarty_internal_templateparser.php"
+#line 332 "smarty_internal_templateparser.y"
+    function yy_r32(){
+    $this->_retvalue = $this->compiler->compileTag('assign',array(array('value'=>$this->yystack[$this->yyidx + -1]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -3]->minor."'")));
+    }
+#line 2376 "smarty_internal_templateparser.php"
+#line 340 "smarty_internal_templateparser.y"
+    function yy_r34(){
+    $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -4]->minor."'")),$this->yystack[$this->yyidx + -1]->minor));
+    }
+#line 2381 "smarty_internal_templateparser.php"
+#line 344 "smarty_internal_templateparser.y"
+    function yy_r35(){
+    $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>$this->yystack[$this->yyidx + -4]->minor['var'])),$this->yystack[$this->yyidx + -1]->minor),array('smarty_internal_index'=>$this->yystack[$this->yyidx + -4]->minor['smarty_internal_index']));
+    }
+#line 2386 "smarty_internal_templateparser.php"
+#line 349 "smarty_internal_templateparser.y"
+    function yy_r36(){
+    $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + -1]->minor);
+    }
+#line 2391 "smarty_internal_templateparser.php"
+#line 353 "smarty_internal_templateparser.y"
+    function yy_r37(){
+    $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,array());
+    }
+#line 2396 "smarty_internal_templateparser.php"
+#line 358 "smarty_internal_templateparser.y"
+    function yy_r38(){
+    $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor));
+    }
+#line 2401 "smarty_internal_templateparser.php"
+#line 363 "smarty_internal_templateparser.y"
+    function yy_r39(){
+    $this->_retvalue = '<?php ob_start();?>'.$this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + -1]->minor).'<?php echo ';
+    $this->_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>';
+    }
+#line 2407 "smarty_internal_templateparser.php"
+#line 369 "smarty_internal_templateparser.y"
+    function yy_r40(){
+    $this->_retvalue = '<?php ob_start();?>'.$this->compiler->compileTag($this->yystack[$this->yyidx + -5]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -3]->minor)).'<?php echo ';
+    $this->_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>';
+    }
+#line 2413 "smarty_internal_templateparser.php"
+#line 375 "smarty_internal_templateparser.y"
+    function yy_r41(){
+    $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length));
+    $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + -1]->minor));
+    }
+#line 2419 "smarty_internal_templateparser.php"
+#line 380 "smarty_internal_templateparser.y"
+    function yy_r42(){
+    $tag = trim(substr($this->yystack[$this->yyidx + -3]->minor,$this->lex->ldel_length));
+    $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,$this->yystack[$this->yyidx + -1]->minor,array('if condition'=>$this->yystack[$this->yyidx + -2]->minor));
+    }
+#line 2425 "smarty_internal_templateparser.php"
+#line 385 "smarty_internal_templateparser.y"
+    function yy_r43(){
+    $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length));
+    $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + -1]->minor));
+    }
+#line 2431 "smarty_internal_templateparser.php"
+#line 396 "smarty_internal_templateparser.y"
+    function yy_r45(){
+    $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -10]->minor),array('ifexp'=>$this->yystack[$this->yyidx + -7]->minor),array('var'=>$this->yystack[$this->yyidx + -3]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),1);
+    }
+#line 2436 "smarty_internal_templateparser.php"
+#line 400 "smarty_internal_templateparser.y"
+    function yy_r46(){
+    $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2441 "smarty_internal_templateparser.php"
+#line 408 "smarty_internal_templateparser.y"
+    function yy_r48(){
+    $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -4]->minor),array('to'=>$this->yystack[$this->yyidx + -2]->minor))),0);
+    }
+#line 2446 "smarty_internal_templateparser.php"
+#line 412 "smarty_internal_templateparser.y"
+    function yy_r49(){
+    $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -6]->minor),array('to'=>$this->yystack[$this->yyidx + -4]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),0);
+    }
+#line 2451 "smarty_internal_templateparser.php"
+#line 417 "smarty_internal_templateparser.y"
+    function yy_r50(){
+    $this->_retvalue = $this->compiler->compileTag('foreach',$this->yystack[$this->yyidx + -1]->minor);
+    }
+#line 2456 "smarty_internal_templateparser.php"
+#line 422 "smarty_internal_templateparser.y"
+    function yy_r51(){
+    $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor))));
+    }
+#line 2461 "smarty_internal_templateparser.php"
+#line 426 "smarty_internal_templateparser.y"
+    function yy_r52(){
+    $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor))));
+    }
+#line 2466 "smarty_internal_templateparser.php"
+#line 430 "smarty_internal_templateparser.y"
+    function yy_r53(){
+    $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor))));
+    }
+#line 2471 "smarty_internal_templateparser.php"
+#line 434 "smarty_internal_templateparser.y"
+    function yy_r54(){
+    $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor))));
+    }
+#line 2476 "smarty_internal_templateparser.php"
+#line 439 "smarty_internal_templateparser.y"
+    function yy_r55(){
+    $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array(array_merge(array($this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor))));
+    }
+#line 2481 "smarty_internal_templateparser.php"
+#line 443 "smarty_internal_templateparser.y"
+    function yy_r56(){
+    $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array_merge(array(array_merge(array($this->yystack[$this->yyidx + -3]->minor),$this->yystack[$this->yyidx + -2]->minor)),$this->yystack[$this->yyidx + -1]->minor)));
+    }
+#line 2486 "smarty_internal_templateparser.php"
+#line 448 "smarty_internal_templateparser.y"
+    function yy_r57(){
+    $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileChildBlock($this->compiler);
+    }
+#line 2491 "smarty_internal_templateparser.php"
+#line 454 "smarty_internal_templateparser.y"
+    function yy_r58(){
+    $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array());
+    }
+#line 2496 "smarty_internal_templateparser.php"
+#line 458 "smarty_internal_templateparser.y"
+    function yy_r59(){
+    $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',array(),array('modifier_list'=>$this->yystack[$this->yyidx + -1]->minor));
+    }
+#line 2501 "smarty_internal_templateparser.php"
+#line 463 "smarty_internal_templateparser.y"
+    function yy_r60(){
+    $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor));
+    }
+#line 2506 "smarty_internal_templateparser.php"
+#line 467 "smarty_internal_templateparser.y"
+    function yy_r61(){
+    $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor, 'modifier_list'=>$this->yystack[$this->yyidx + -1]->minor));
+    }
+#line 2511 "smarty_internal_templateparser.php"
+#line 475 "smarty_internal_templateparser.y"
+    function yy_r62(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;
+    $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2517 "smarty_internal_templateparser.php"
+#line 481 "smarty_internal_templateparser.y"
+    function yy_r63(){
+    $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2522 "smarty_internal_templateparser.php"
+#line 486 "smarty_internal_templateparser.y"
+    function yy_r64(){
+    $this->_retvalue = array();
+    }
+#line 2527 "smarty_internal_templateparser.php"
+#line 491 "smarty_internal_templateparser.y"
+    function yy_r65(){
+    if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+        $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'true');
+    } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+        $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'false');
+    } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+        $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'null');
+    } else {
+        $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>"'".$this->yystack[$this->yyidx + 0]->minor."'");
+    }
+    }
+#line 2540 "smarty_internal_templateparser.php"
+#line 503 "smarty_internal_templateparser.y"
+    function yy_r66(){
+    $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor," =\n\r\t")=>$this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2545 "smarty_internal_templateparser.php"
+#line 511 "smarty_internal_templateparser.y"
+    function yy_r68(){
+    $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'";
+    }
+#line 2550 "smarty_internal_templateparser.php"
+#line 523 "smarty_internal_templateparser.y"
+    function yy_r71(){
+    $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2555 "smarty_internal_templateparser.php"
+#line 536 "smarty_internal_templateparser.y"
+    function yy_r73(){
+    $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor;
+    $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor;
+    }
+#line 2561 "smarty_internal_templateparser.php"
+#line 541 "smarty_internal_templateparser.y"
+    function yy_r74(){
+    $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2566 "smarty_internal_templateparser.php"
+#line 569 "smarty_internal_templateparser.y"
+    function yy_r79(){
+    $this->_retvalue = '$_smarty_tpl->getStreamVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'://'. $this->yystack[$this->yyidx + 0]->minor . '\')';
+    }
+#line 2571 "smarty_internal_templateparser.php"
+#line 574 "smarty_internal_templateparser.y"
+    function yy_r80(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2576 "smarty_internal_templateparser.php"
+#line 593 "smarty_internal_templateparser.y"
+    function yy_r84(){
+    $this->_retvalue = $this->compiler->compileTag('private_modifier',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor,'modifierlist'=>$this->yystack[$this->yyidx + 0]->minor));
+    }
+#line 2581 "smarty_internal_templateparser.php"
+#line 599 "smarty_internal_templateparser.y"
+    function yy_r85(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2586 "smarty_internal_templateparser.php"
+#line 603 "smarty_internal_templateparser.y"
+    function yy_r86(){
+    $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')';
+    }
+#line 2591 "smarty_internal_templateparser.php"
+#line 607 "smarty_internal_templateparser.y"
+    function yy_r87(){
+    $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')';
+    }
+#line 2596 "smarty_internal_templateparser.php"
+#line 615 "smarty_internal_templateparser.y"
+    function yy_r89(){
+    $this->_retvalue = '!('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')';
+    }
+#line 2601 "smarty_internal_templateparser.php"
+#line 619 "smarty_internal_templateparser.y"
+    function yy_r90(){
+    $this->_retvalue = '('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')';
+    }
+#line 2606 "smarty_internal_templateparser.php"
+#line 623 "smarty_internal_templateparser.y"
+    function yy_r91(){
+    $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')';
+    }
+#line 2611 "smarty_internal_templateparser.php"
+#line 627 "smarty_internal_templateparser.y"
+    function yy_r92(){
+    $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -1]->minor.')';
+    }
+#line 2616 "smarty_internal_templateparser.php"
+#line 631 "smarty_internal_templateparser.y"
+    function yy_r93(){
+    $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')';
+    }
+#line 2621 "smarty_internal_templateparser.php"
+#line 635 "smarty_internal_templateparser.y"
+    function yy_r94(){
+    $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')';
+    }
+#line 2626 "smarty_internal_templateparser.php"
+#line 659 "smarty_internal_templateparser.y"
+    function yy_r100(){
+    $this->prefix_number++;
+    $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'='.$this->yystack[$this->yyidx + 0]->minor.';?>';
+    $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.'$_tmp'.$this->prefix_number;
+    }
+#line 2633 "smarty_internal_templateparser.php"
+#line 668 "smarty_internal_templateparser.y"
+    function yy_r101(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -6]->minor.' ? '. $this->compileVariable("'".$this->yystack[$this->yyidx + -2]->minor."'") . ' : '.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2638 "smarty_internal_templateparser.php"
+#line 672 "smarty_internal_templateparser.y"
+    function yy_r102(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2643 "smarty_internal_templateparser.php"
+#line 687 "smarty_internal_templateparser.y"
+    function yy_r105(){
+    $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2648 "smarty_internal_templateparser.php"
+#line 708 "smarty_internal_templateparser.y"
+    function yy_r110(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2653 "smarty_internal_templateparser.php"
+#line 712 "smarty_internal_templateparser.y"
+    function yy_r111(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.';
+    }
+#line 2658 "smarty_internal_templateparser.php"
+#line 716 "smarty_internal_templateparser.y"
+    function yy_r112(){
+    $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2663 "smarty_internal_templateparser.php"
+#line 721 "smarty_internal_templateparser.y"
+    function yy_r113(){
+    if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+        $this->_retvalue = 'true';
+    } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+        $this->_retvalue = 'false';
+    } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+        $this->_retvalue = 'null';
+    } else {
+        $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'";
+    }
+    }
+#line 2676 "smarty_internal_templateparser.php"
+#line 739 "smarty_internal_templateparser.y"
+    function yy_r115(){
+    $this->_retvalue = "(". $this->yystack[$this->yyidx + -1]->minor .")";
+    }
+#line 2681 "smarty_internal_templateparser.php"
+#line 754 "smarty_internal_templateparser.y"
+    function yy_r118(){
+    if (!$this->security || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor]) || $this->smarty->security_policy->isTrustedStaticClass($this->yystack[$this->yyidx + -2]->minor, $this->compiler)) {
+        if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) {
+            $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor;
+        } else {
+            $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor;
+        }
+    } else {
+        $this->compiler->trigger_template_error ("static class '".$this->yystack[$this->yyidx + -2]->minor."' is undefined or not allowed by security setting");
+    }
+    }
+#line 2694 "smarty_internal_templateparser.php"
+#line 766 "smarty_internal_templateparser.y"
+    function yy_r119(){
+    if ($this->yystack[$this->yyidx + -2]->minor['var'] == '\'smarty\'') {
+        $this->_retvalue =  $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index']).'::'.$this->yystack[$this->yyidx + 0]->minor;
+    } else {
+        $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -2]->minor['var']).$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index'].'::'.$this->yystack[$this->yyidx + 0]->minor;
+    }
+    }
+#line 2703 "smarty_internal_templateparser.php"
+#line 775 "smarty_internal_templateparser.y"
+    function yy_r120(){
+    $this->prefix_number++;
+    $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>';
+    $this->_retvalue = '$_tmp'.$this->prefix_number;
+    }
+#line 2710 "smarty_internal_templateparser.php"
+#line 790 "smarty_internal_templateparser.y"
+    function yy_r122(){
+    if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') {
+        $smarty_var = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);
+        $this->_retvalue = $smarty_var;
+    } else {
+        // used for array reset,next,prev,end,current
+        $this->last_variable = $this->yystack[$this->yyidx + 0]->minor['var'];
+        $this->last_index = $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];
+        $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']).$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];
+    }
+    }
+#line 2723 "smarty_internal_templateparser.php"
+#line 803 "smarty_internal_templateparser.y"
+    function yy_r123(){
+    $this->_retvalue = '$_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + -2]->minor .']->'.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2728 "smarty_internal_templateparser.php"
+#line 813 "smarty_internal_templateparser.y"
+    function yy_r125(){
+    $this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')';
+    }
+#line 2733 "smarty_internal_templateparser.php"
+#line 817 "smarty_internal_templateparser.y"
+    function yy_r126(){
+    $this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')';
+    }
+#line 2738 "smarty_internal_templateparser.php"
+#line 821 "smarty_internal_templateparser.y"
+    function yy_r127(){
+    $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2743 "smarty_internal_templateparser.php"
+#line 834 "smarty_internal_templateparser.y"
+    function yy_r129(){
+    return;
+    }
+#line 2748 "smarty_internal_templateparser.php"
+#line 840 "smarty_internal_templateparser.y"
+    function yy_r130(){
+    $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + 0]->minor).']';
+    }
+#line 2753 "smarty_internal_templateparser.php"
+#line 844 "smarty_internal_templateparser.y"
+    function yy_r131(){
+    $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']';
+    }
+#line 2758 "smarty_internal_templateparser.php"
+#line 848 "smarty_internal_templateparser.y"
+    function yy_r132(){
+    $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']";
+    }
+#line 2763 "smarty_internal_templateparser.php"
+#line 852 "smarty_internal_templateparser.y"
+    function yy_r133(){
+    $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]";
+    }
+#line 2768 "smarty_internal_templateparser.php"
+#line 856 "smarty_internal_templateparser.y"
+    function yy_r134(){
+    $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]";
+    }
+#line 2773 "smarty_internal_templateparser.php"
+#line 861 "smarty_internal_templateparser.y"
+    function yy_r135(){
+    $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']';
+    }
+#line 2778 "smarty_internal_templateparser.php"
+#line 865 "smarty_internal_templateparser.y"
+    function yy_r136(){
+    $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']';
+    }
+#line 2783 "smarty_internal_templateparser.php"
+#line 875 "smarty_internal_templateparser.y"
+    function yy_r138(){
+    $this->_retvalue = '[]';
+    }
+#line 2788 "smarty_internal_templateparser.php"
+#line 888 "smarty_internal_templateparser.y"
+    function yy_r140(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2793 "smarty_internal_templateparser.php"
+#line 893 "smarty_internal_templateparser.y"
+    function yy_r141(){
+    $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\'';
+    }
+#line 2798 "smarty_internal_templateparser.php"
+#line 898 "smarty_internal_templateparser.y"
+    function yy_r142(){
+    $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')';
+    }
+#line 2803 "smarty_internal_templateparser.php"
+#line 905 "smarty_internal_templateparser.y"
+    function yy_r143(){
+    if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') {
+        $this->_retvalue =  $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor;
+    } else {
+        $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -1]->minor['var']).$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor;
+    }
+    }
+#line 2812 "smarty_internal_templateparser.php"
+#line 914 "smarty_internal_templateparser.y"
+    function yy_r144(){
+    $this->_retvalue  = $this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2817 "smarty_internal_templateparser.php"
+#line 919 "smarty_internal_templateparser.y"
+    function yy_r145(){
+    $this->_retvalue  = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2822 "smarty_internal_templateparser.php"
+#line 924 "smarty_internal_templateparser.y"
+    function yy_r146(){
+    if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '_') {
+        $this->compiler->trigger_template_error (self::Err1);
+    }
+    $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2830 "smarty_internal_templateparser.php"
+#line 931 "smarty_internal_templateparser.y"
+    function yy_r147(){
+    if ($this->security) {
+        $this->compiler->trigger_template_error (self::Err2);
+    }
+    $this->_retvalue = '->{'.$this->compileVariable($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor.'}';
+    }
+#line 2838 "smarty_internal_templateparser.php"
+#line 938 "smarty_internal_templateparser.y"
+    function yy_r148(){
+    if ($this->security) {
+        $this->compiler->trigger_template_error (self::Err2);
+    }
+    $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}';
+    }
+#line 2846 "smarty_internal_templateparser.php"
+#line 945 "smarty_internal_templateparser.y"
+    function yy_r149(){
+    if ($this->security) {
+        $this->compiler->trigger_template_error (self::Err2);
+    }
+    $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}';
+    }
+#line 2854 "smarty_internal_templateparser.php"
+#line 953 "smarty_internal_templateparser.y"
+    function yy_r150(){
+    $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2859 "smarty_internal_templateparser.php"
+#line 961 "smarty_internal_templateparser.y"
+    function yy_r151(){
+    if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) {
+        if (strcasecmp($this->yystack[$this->yyidx + -3]->minor,'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'array') === 0 || is_callable($this->yystack[$this->yyidx + -3]->minor)) {
+            $func_name = strtolower($this->yystack[$this->yyidx + -3]->minor);
+            if ($func_name == 'isset') {
+                if (count($this->yystack[$this->yyidx + -1]->minor) == 0) {
+                    $this->compiler->trigger_template_error ('Illegal number of paramer in "isset()"');
+                }
+                $par = implode(',',$this->yystack[$this->yyidx + -1]->minor);
+                if (strncasecmp($par,'$_smarty_tpl->getConfigVariable',strlen('$_smarty_tpl->getConfigVariable')) === 0) {
+                    $this->prefix_number++;
+                    $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'='.str_replace(')',', false)',$par).';?>';
+                    $isset_par = '$_tmp'.$this->prefix_number;
+                } else {
+                    $isset_par=str_replace("')->value","',null,true,false)->value",$par);
+                }
+                $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $isset_par .")";
+            } elseif (in_array($func_name,array('empty','reset','current','end','prev','next'))){
+                if (count($this->yystack[$this->yyidx + -1]->minor) != 1) {
+                    $this->compiler->trigger_template_error ('Illegal number of paramer in "empty()"');
+                }
+                if ($func_name == 'empty') {
+                    $this->_retvalue = $func_name.'('.str_replace("')->value","',null,true,false)->value",$this->yystack[$this->yyidx + -1]->minor[0]).')';
+                } else {
+                    $this->_retvalue = $func_name.'('.$this->yystack[$this->yyidx + -1]->minor[0].')';
+                }
+            } else {
+                $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")";
+            }
+        } else {
+            $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\"");
+        }
+    }
+    }
+#line 2895 "smarty_internal_templateparser.php"
+#line 999 "smarty_internal_templateparser.y"
+    function yy_r152(){
+    if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) == '_') {
+        $this->compiler->trigger_template_error (self::Err1);
+    }
+    $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")";
+    }
+#line 2903 "smarty_internal_templateparser.php"
+#line 1006 "smarty_internal_templateparser.y"
+    function yy_r153(){
+    if ($this->security) {
+        $this->compiler->trigger_template_error (self::Err2);
+    }
+    $this->prefix_number++;
+    $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'='.$this->compileVariable("'".$this->yystack[$this->yyidx + -3]->minor."'").';?>';
+    $this->_retvalue = '$_tmp'.$this->prefix_number.'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')';
+    }
+#line 2913 "smarty_internal_templateparser.php"
+#line 1017 "smarty_internal_templateparser.y"
+    function yy_r154(){
+    $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor));
+    }
+#line 2918 "smarty_internal_templateparser.php"
+#line 1034 "smarty_internal_templateparser.y"
+    function yy_r157(){
+    $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)));
+    }
+#line 2923 "smarty_internal_templateparser.php"
+#line 1038 "smarty_internal_templateparser.y"
+    function yy_r158(){
+    $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor));
+    }
+#line 2928 "smarty_internal_templateparser.php"
+#line 1046 "smarty_internal_templateparser.y"
+    function yy_r160(){
+    $this->_retvalue =  array($this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2933 "smarty_internal_templateparser.php"
+#line 1054 "smarty_internal_templateparser.y"
+    function yy_r161(){
+    $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 2938 "smarty_internal_templateparser.php"
+#line 1088 "smarty_internal_templateparser.y"
+    function yy_r168(){
+    $this->_retvalue = '$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2943 "smarty_internal_templateparser.php"
+#line 1093 "smarty_internal_templateparser.y"
+    function yy_r169(){
+    $this->_retvalue = '$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 2948 "smarty_internal_templateparser.php"
+#line 1099 "smarty_internal_templateparser.y"
+    function yy_r170(){
+    $this->_retvalue = '==';
+    }
+#line 2953 "smarty_internal_templateparser.php"
+#line 1103 "smarty_internal_templateparser.y"
+    function yy_r171(){
+    $this->_retvalue = '!=';
+    }
+#line 2958 "smarty_internal_templateparser.php"
+#line 1107 "smarty_internal_templateparser.y"
+    function yy_r172(){
+    $this->_retvalue = '>';
+    }
+#line 2963 "smarty_internal_templateparser.php"
+#line 1111 "smarty_internal_templateparser.y"
+    function yy_r173(){
+    $this->_retvalue = '<';
+    }
+#line 2968 "smarty_internal_templateparser.php"
+#line 1115 "smarty_internal_templateparser.y"
+    function yy_r174(){
+    $this->_retvalue = '>=';
+    }
+#line 2973 "smarty_internal_templateparser.php"
+#line 1119 "smarty_internal_templateparser.y"
+    function yy_r175(){
+    $this->_retvalue = '<=';
+    }
+#line 2978 "smarty_internal_templateparser.php"
+#line 1123 "smarty_internal_templateparser.y"
+    function yy_r176(){
+    $this->_retvalue = '===';
+    }
+#line 2983 "smarty_internal_templateparser.php"
+#line 1127 "smarty_internal_templateparser.y"
+    function yy_r177(){
+    $this->_retvalue = '!==';
+    }
+#line 2988 "smarty_internal_templateparser.php"
+#line 1131 "smarty_internal_templateparser.y"
+    function yy_r178(){
+    $this->_retvalue = '%';
+    }
+#line 2993 "smarty_internal_templateparser.php"
+#line 1135 "smarty_internal_templateparser.y"
+    function yy_r179(){
+    $this->_retvalue = '&&';
+    }
+#line 2998 "smarty_internal_templateparser.php"
+#line 1139 "smarty_internal_templateparser.y"
+    function yy_r180(){
+    $this->_retvalue = '||';
+    }
+#line 3003 "smarty_internal_templateparser.php"
+#line 1143 "smarty_internal_templateparser.y"
+    function yy_r181(){
+    $this->_retvalue = ' XOR ';
+    }
+#line 3008 "smarty_internal_templateparser.php"
+#line 1150 "smarty_internal_templateparser.y"
+    function yy_r182(){
+    $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')';
+    }
+#line 3013 "smarty_internal_templateparser.php"
+#line 1158 "smarty_internal_templateparser.y"
+    function yy_r184(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 3018 "smarty_internal_templateparser.php"
+#line 1166 "smarty_internal_templateparser.y"
+    function yy_r186(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 3023 "smarty_internal_templateparser.php"
+#line 1170 "smarty_internal_templateparser.y"
+    function yy_r187(){
+    $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor;
+    }
+#line 3028 "smarty_internal_templateparser.php"
+#line 1182 "smarty_internal_templateparser.y"
+    function yy_r189(){
+    $this->_retvalue = "''";
+    }
+#line 3033 "smarty_internal_templateparser.php"
+#line 1186 "smarty_internal_templateparser.y"
+    function yy_r190(){
+    $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php();
+    }
+#line 3038 "smarty_internal_templateparser.php"
+#line 1191 "smarty_internal_templateparser.y"
+    function yy_r191(){
+    $this->yystack[$this->yyidx + -1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor);
+    $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;
+    }
+#line 3044 "smarty_internal_templateparser.php"
+#line 1196 "smarty_internal_templateparser.y"
+    function yy_r192(){
+    $this->_retvalue = new _smarty_doublequoted($this, $this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 3049 "smarty_internal_templateparser.php"
+#line 1200 "smarty_internal_templateparser.y"
+    function yy_r193(){
+    $this->_retvalue = new _smarty_code($this, '(string)'.$this->yystack[$this->yyidx + -1]->minor);
+    }
+#line 3054 "smarty_internal_templateparser.php"
+#line 1208 "smarty_internal_templateparser.y"
+    function yy_r195(){
+    $this->_retvalue = new _smarty_code($this, '(string)$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value');
+    }
+#line 3059 "smarty_internal_templateparser.php"
+#line 1216 "smarty_internal_templateparser.y"
+    function yy_r197(){
+    $this->_retvalue = new _smarty_code($this, '(string)('.$this->yystack[$this->yyidx + -1]->minor.')');
+    }
+#line 3064 "smarty_internal_templateparser.php"
+#line 1220 "smarty_internal_templateparser.y"
+    function yy_r198(){
+    $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 3069 "smarty_internal_templateparser.php"
+#line 1224 "smarty_internal_templateparser.y"
+    function yy_r199(){
+    $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor);
+    }
+#line 3074 "smarty_internal_templateparser.php"
+
+    private $_retvalue;
+
+    function yy_reduce($yyruleno)
+    {
+        $yymsp = $this->yystack[$this->yyidx];
+        if (self::$yyTraceFILE && $yyruleno >= 0
+              && $yyruleno < count(self::$yyRuleName)) {
+            fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n",
+                self::$yyTracePrompt, $yyruleno,
+                self::$yyRuleName[$yyruleno]);
+        }
+
+        $this->_retvalue = $yy_lefthand_side = null;
+        if (array_key_exists($yyruleno, self::$yyReduceMap)) {
+            // call the action
+            $this->_retvalue = null;
+            $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
+            $yy_lefthand_side = $this->_retvalue;
+        }
+        $yygoto = self::$yyRuleInfo[$yyruleno]['lhs'];
+        $yysize = self::$yyRuleInfo[$yyruleno]['rhs'];
+        $this->yyidx -= $yysize;
+        for($i = $yysize; $i; $i--) {
+            // pop all of the right-hand side parameters
+            array_pop($this->yystack);
+        }
+        $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
+        if ($yyact < self::YYNSTATE) {
+            if (!self::$yyTraceFILE && $yysize) {
+                $this->yyidx++;
+                $x = new TP_yyStackEntry;
+                $x->stateno = $yyact;
+                $x->major = $yygoto;
+                $x->minor = $yy_lefthand_side;
+                $this->yystack[$this->yyidx] = $x;
+            } else {
+                $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
+            }
+        } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {
+            $this->yy_accept();
+        }
+    }
+
+    function yy_parse_failed()
+    {
+        if (self::$yyTraceFILE) {
+            fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt);
+        }
+        while ($this->yyidx >= 0) {
+            $this->yy_pop_parser_stack();
+        }
+    }
+
+    function yy_syntax_error($yymajor, $TOKEN)
+    {
+#line 77 "smarty_internal_templateparser.y"
+
+    $this->internalError = true;
+    $this->yymajor = $yymajor;
+    $this->compiler->trigger_template_error();
+#line 3137 "smarty_internal_templateparser.php"
+    }
+
+    function yy_accept()
+    {
+        if (self::$yyTraceFILE) {
+            fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt);
+        }
+        while ($this->yyidx >= 0) {
+            $stack = $this->yy_pop_parser_stack();
+        }
+#line 69 "smarty_internal_templateparser.y"
+
+    $this->successful = !$this->internalError;
+    $this->internalError = false;
+    $this->retvalue = $this->_retvalue;
+    //echo $this->retvalue."\n\n";
+#line 3155 "smarty_internal_templateparser.php"
+    }
+
+    function doParse($yymajor, $yytokenvalue)
+    {
+        $yyerrorhit = 0;   /* True if yymajor has invoked an error */
+
+        if ($this->yyidx === null || $this->yyidx < 0) {
+            $this->yyidx = 0;
+            $this->yyerrcnt = -1;
+            $x = new TP_yyStackEntry;
+            $x->stateno = 0;
+            $x->major = 0;
+            $this->yystack = array();
+            array_push($this->yystack, $x);
+        }
+        $yyendofinput = ($yymajor==0);
+
+        if (self::$yyTraceFILE) {
+            fprintf(self::$yyTraceFILE, "%sInput %s\n",
+                self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
+        }
+
+        do {
+            $yyact = $this->yy_find_shift_action($yymajor);
+            if ($yymajor < self::YYERRORSYMBOL &&
+                  !$this->yy_is_expected_token($yymajor)) {
+                // force a syntax error
+                $yyact = self::YY_ERROR_ACTION;
+            }
+            if ($yyact < self::YYNSTATE) {
+                $this->yy_shift($yyact, $yymajor, $yytokenvalue);
+                $this->yyerrcnt--;
+                if ($yyendofinput && $this->yyidx >= 0) {
+                    $yymajor = 0;
+                } else {
+                    $yymajor = self::YYNOCODE;
+                }
+            } elseif ($yyact < self::YYNSTATE + self::YYNRULE) {
+                $this->yy_reduce($yyact - self::YYNSTATE);
+            } elseif ($yyact == self::YY_ERROR_ACTION) {
+                if (self::$yyTraceFILE) {
+                    fprintf(self::$yyTraceFILE, "%sSyntax Error!\n",
+                        self::$yyTracePrompt);
+                }
+                if (self::YYERRORSYMBOL) {
+                    if ($this->yyerrcnt < 0) {
+                        $this->yy_syntax_error($yymajor, $yytokenvalue);
+                    }
+                    $yymx = $this->yystack[$this->yyidx]->major;
+                    if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){
+                        if (self::$yyTraceFILE) {
+                            fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n",
+                                self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
+                        }
+                        $this->yy_destructor($yymajor, $yytokenvalue);
+                        $yymajor = self::YYNOCODE;
+                    } else {
+                        while ($this->yyidx >= 0 &&
+                                 $yymx != self::YYERRORSYMBOL &&
+        ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
+                              ){
+                            $this->yy_pop_parser_stack();
+                        }
+                        if ($this->yyidx < 0 || $yymajor==0) {
+                            $this->yy_destructor($yymajor, $yytokenvalue);
+                            $this->yy_parse_failed();
+                            $yymajor = self::YYNOCODE;
+                        } elseif ($yymx != self::YYERRORSYMBOL) {
+                            $u2 = 0;
+                            $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);
+                        }
+                    }
+                    $this->yyerrcnt = 3;
+                    $yyerrorhit = 1;
+                } else {
+                    if ($this->yyerrcnt <= 0) {
+                        $this->yy_syntax_error($yymajor, $yytokenvalue);
+                    }
+                    $this->yyerrcnt = 3;
+                    $this->yy_destructor($yymajor, $yytokenvalue);
+                    if ($yyendofinput) {
+                        $this->yy_parse_failed();
+                    }
+                    $yymajor = self::YYNOCODE;
+                }
+            } else {
+                $this->yy_accept();
+                $yymajor = self::YYNOCODE;
+            }
+        } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
+    }
+}
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_utility.php b/library/Smarty/libs/sysplugins/smarty_internal_utility.php
new file mode 100644 (file)
index 0000000..3e36285
--- /dev/null
@@ -0,0 +1,830 @@
+<?php
+/**
+ * Project:     Smarty: the PHP compiling template engine
+ * File:        smarty_internal_utility.php
+ * SVN:         $Id: $
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * For questions, help, comments, discussion, etc., please join the
+ * Smarty mailing list. Send a blank e-mail to
+ * smarty-discussion-subscribe@googlegroups.com
+ *
+ * @link http://www.smarty.net/
+ * @copyright 2008 New Digital Group, Inc.
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Uwe Tews
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @version 3-SVN$Rev: 3286 $
+ */
+
+
+/**
+ * Utility class
+ *
+ * @package Smarty
+ * @subpackage Security
+ */
+class Smarty_Internal_Utility {
+
+    /**
+     * private constructor to prevent calls creation of new instances
+     */
+    private final function __construct()
+    {
+        // intentionally left blank
+    }
+
+    /**
+     * Compile all template files
+     *
+     * @param string $extension     template file name extension
+     * @param bool   $force_compile force all to recompile
+     * @param int    $time_limit    set maximum execution time
+     * @param int    $max_errors    set maximum allowed errors
+     * @param Smarty $smarty        Smarty instance
+     * @return integer number of template files compiled
+     */
+    public static function compileAllTemplates($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty)
+    {
+        // switch off time limit
+        if (function_exists('set_time_limit')) {
+            @set_time_limit($time_limit);
+        }
+        $smarty->force_compile = $force_compile;
+        $_count = 0;
+        $_error_count = 0;
+        // loop over array of template directories
+        foreach($smarty->getTemplateDir() as $_dir) {
+            $_compileDirs = new RecursiveDirectoryIterator($_dir);
+            $_compile = new RecursiveIteratorIterator($_compileDirs);
+            foreach ($_compile as $_fileinfo) {
+                if (substr($_fileinfo->getBasename(),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
+                $_file = $_fileinfo->getFilename();
+                if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
+                if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
+                   $_template_file = $_file;
+                } else {
+                   $_template_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
+                }
+                echo '<br>', $_dir, '---', $_template_file;
+                flush();
+                $_start_time = microtime(true);
+                try {
+                    $_tpl = $smarty->createTemplate($_template_file,null,null,null,false);
+                    if ($_tpl->mustCompile()) {
+                        $_tpl->compileTemplateSource();
+                        $_count++;
+                        echo ' compiled in  ', microtime(true) - $_start_time, ' seconds';
+                        flush();
+                    } else {
+                        echo ' is up to date';
+                        flush();
+                    }
+                }
+                catch (Exception $e) {
+                    echo 'Error: ', $e->getMessage(), "<br><br>";
+                    $_error_count++;
+                }
+                // free memory
+                $smarty->template_objects = array();
+                $_tpl->smarty->template_objects = array();
+                $_tpl = null;
+                if ($max_errors !== null && $_error_count == $max_errors) {
+                    echo '<br><br>too many errors';
+                    exit();
+                }
+            }
+        }
+        return $_count;
+    }
+
+    /**
+     * Compile all config files
+     *
+     * @param string $extension     config file name extension
+     * @param bool   $force_compile force all to recompile
+     * @param int    $time_limit    set maximum execution time
+     * @param int    $max_errors    set maximum allowed errors
+     * @param Smarty $smarty        Smarty instance
+     * @return integer number of config files compiled
+     */
+    public static function compileAllConfig($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty)
+    {
+        // switch off time limit
+        if (function_exists('set_time_limit')) {
+            @set_time_limit($time_limit);
+        }
+        $smarty->force_compile = $force_compile;
+        $_count = 0;
+        $_error_count = 0;
+        // loop over array of template directories
+        foreach($smarty->getConfigDir() as $_dir) {
+            $_compileDirs = new RecursiveDirectoryIterator($_dir);
+            $_compile = new RecursiveIteratorIterator($_compileDirs);
+            foreach ($_compile as $_fileinfo) {
+                if (substr($_fileinfo->getBasename(),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
+                $_file = $_fileinfo->getFilename();
+                if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
+                if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
+                    $_config_file = $_file;
+                } else {
+                    $_config_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
+                }
+                echo '<br>', $_dir, '---', $_config_file;
+                flush();
+                $_start_time = microtime(true);
+                try {
+                    $_config = new Smarty_Internal_Config($_config_file, $smarty);
+                    if ($_config->mustCompile()) {
+                        $_config->compileConfigSource();
+                        $_count++;
+                        echo ' compiled in  ', microtime(true) - $_start_time, ' seconds';
+                        flush();
+                    } else {
+                        echo ' is up to date';
+                        flush();
+                    }
+                }
+                catch (Exception $e) {
+                    echo 'Error: ', $e->getMessage(), "<br><br>";
+                    $_error_count++;
+                }
+                if ($max_errors !== null && $_error_count == $max_errors) {
+                    echo '<br><br>too many errors';
+                    exit();
+                }
+            }
+        }
+        return $_count;
+    }
+
+    /**
+     * Delete compiled template file
+     *
+     * @param string  $resource_name template name
+     * @param string  $compile_id    compile id
+     * @param integer $exp_time      expiration time
+     * @param Smarty  $smarty        Smarty instance
+     * @return integer number of template files deleted
+     */
+    public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty)
+    {
+        $_compile_dir = $smarty->getCompileDir();
+        $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
+        $_dir_sep = $smarty->use_sub_dirs ? DS : '^';
+        if (isset($resource_name)) {
+            $_save_stat = $smarty->caching;
+            $smarty->caching = false;
+            $tpl = new $smarty->template_class($resource_name, $smarty);
+            $smarty->caching = $_save_stat;
+
+            // remove from template cache
+            $tpl->source; // have the template registered before unset()
+            if ($smarty->allow_ambiguous_resources) {
+                $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
+            } else {
+                $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
+            }
+            if (isset($_templateId[150])) {
+                $_templateId = sha1($_templateId);
+            }
+            unset($smarty->template_objects[$_templateId]);
+
+            if ($tpl->source->exists) {
+                 $_resource_part_1 = basename(str_replace('^', '/', $tpl->compiled->filepath));
+                 $_resource_part_1_length = strlen($_resource_part_1);
+            } else {
+                return 0;
+            }
+
+            $_resource_part_2 = str_replace('.php','.cache.php',$_resource_part_1);
+            $_resource_part_2_length = strlen($_resource_part_2);
+        }
+        $_dir = $_compile_dir;
+        if ($smarty->use_sub_dirs && isset($_compile_id)) {
+            $_dir .= $_compile_id . $_dir_sep;
+        }
+        if (isset($_compile_id)) {
+            $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep;
+            $_compile_id_part_length = strlen($_compile_id_part);
+        }
+        $_count = 0;
+        try {
+            $_compileDirs = new RecursiveDirectoryIterator($_dir);
+        // NOTE: UnexpectedValueException thrown for PHP >= 5.3
+        } catch (Exception $e) {
+            return 0;
+        }
+        $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);
+        foreach ($_compile as $_file) {
+            if (substr($_file->getBasename(), 0, 1) == '.' || strpos($_file, '.svn') !== false)
+                continue;
+
+            $_filepath = (string) $_file;
+
+            if ($_file->isDir()) {
+                if (!$_compile->isDot()) {
+                    // delete folder if empty
+                    @rmdir($_file->getPathname());
+                }
+            } else {
+                $unlink = false;
+                if ((!isset($_compile_id) || (isset($_filepath[$_compile_id_part_length]) && !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length)))
+                    && (!isset($resource_name)
+                        || (isset($_filepath[$_resource_part_1_length])
+                            && substr_compare($_filepath, $_resource_part_1, -$_resource_part_1_length, $_resource_part_1_length) == 0)
+                        || (isset($_filepath[$_resource_part_2_length])
+                            && substr_compare($_filepath, $_resource_part_2, -$_resource_part_2_length, $_resource_part_2_length) == 0))) {
+                    if (isset($exp_time)) {
+                        if (time() - @filemtime($_filepath) >= $exp_time) {
+                            $unlink = true;
+                        }
+                    } else {
+                        $unlink = true;
+                    }
+                }
+
+                if ($unlink && @unlink($_filepath)) {
+                    $_count++;
+                }
+            }
+        }
+        // clear compiled cache
+        Smarty_Resource::$sources = array();
+        Smarty_Resource::$compileds = array();
+        return $_count;
+    }
+
+    /**
+     * Return array of tag/attributes of all tags used by an template
+     *
+     * @param Smarty_Internal_Template $templae template object
+     * @return array of tag/attributes
+     */
+    public static function getTags(Smarty_Internal_Template $template)
+    {
+        $template->smarty->get_used_tags = true;
+        $template->compileTemplateSource();
+        return $template->used_tags;
+    }
+
+
+    /**
+     * diagnose Smarty setup
+     *
+     * If $errors is secified, the diagnostic report will be appended to the array, rather than being output.
+     *
+     * @param Smarty $smarty  Smarty instance to test
+     * @param array  $errors array to push results into rather than outputting them
+     * @return bool status, true if everything is fine, false else
+     */
+    public static function testInstall(Smarty $smarty, &$errors=null)
+    {
+        $status = true;
+
+        if ($errors === null) {
+            echo "<PRE>\n";
+            echo "Smarty Installation test...\n";
+            echo "Testing template directory...\n";
+        }
+
+        $_stream_resolve_include_path = function_exists('stream_resolve_include_path');
+
+        // test if all registered template_dir are accessible
+        foreach($smarty->getTemplateDir() as $template_dir) {
+            $_template_dir = $template_dir;
+            $template_dir = realpath($template_dir);
+            // resolve include_path or fail existance
+            if (!$template_dir) {
+                if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) {
+                    // try PHP include_path
+                    if ($_stream_resolve_include_path) {
+                        $template_dir = stream_resolve_include_path($_template_dir);
+                    } else {
+                        $template_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_template_dir);
+                    }
+
+                    if ($template_dir !== false) {
+                        if ($errors === null) {
+                            echo "$template_dir is OK.\n";
+                        }
+
+                        continue;
+                    } else {
+                        $status = false;
+                        $message = "FAILED: $_template_dir does not exist (and couldn't be found in include_path either)";
+                        if ($errors === null) {
+                            echo $message . ".\n";
+                        } else {
+                            $errors['template_dir'] = $message;
+                        }
+
+                        continue;
+                    }
+                } else {
+                    $status = false;
+                    $message = "FAILED: $_template_dir does not exist";
+                    if ($errors === null) {
+                        echo $message . ".\n";
+                    } else {
+                        $errors['template_dir'] = $message;
+                    }
+
+                    continue;
+                }
+            }
+
+            if (!is_dir($template_dir)) {
+                $status = false;
+                $message = "FAILED: $template_dir is not a directory";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['template_dir'] = $message;
+                }
+            } elseif (!is_readable($template_dir)) {
+                $status = false;
+                $message = "FAILED: $template_dir is not readable";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['template_dir'] = $message;
+                }
+            } else {
+                if ($errors === null) {
+                    echo "$template_dir is OK.\n";
+                }
+            }
+        }
+
+
+        if ($errors === null) {
+            echo "Testing compile directory...\n";
+        }
+
+        // test if registered compile_dir is accessible
+        $__compile_dir = $smarty->getCompileDir();
+        $_compile_dir = realpath($__compile_dir);
+        if (!$_compile_dir) {
+            $status = false;
+            $message = "FAILED: {$__compile_dir} does not exist";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['compile_dir'] = $message;
+            }
+        } elseif (!is_dir($_compile_dir)) {
+            $status = false;
+            $message = "FAILED: {$_compile_dir} is not a directory";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['compile_dir'] = $message;
+            }
+        } elseif (!is_readable($_compile_dir)) {
+            $status = false;
+            $message = "FAILED: {$_compile_dir} is not readable";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['compile_dir'] = $message;
+            }
+        } elseif (!is_writable($_compile_dir)) {
+            $status = false;
+            $message = "FAILED: {$_compile_dir} is not writable";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['compile_dir'] = $message;
+            }
+        } else {
+            if ($errors === null) {
+                echo "{$_compile_dir} is OK.\n";
+            }
+        }
+
+
+        if ($errors === null) {
+            echo "Testing plugins directory...\n";
+        }
+
+        // test if all registered plugins_dir are accessible
+        // and if core plugins directory is still registered
+        $_core_plugins_dir = realpath(dirname(__FILE__) .'/../plugins');
+        $_core_plugins_available = false;
+        foreach($smarty->getPluginsDir() as $plugin_dir) {
+            $_plugin_dir = $plugin_dir;
+            $plugin_dir = realpath($plugin_dir);
+            // resolve include_path or fail existance
+            if (!$plugin_dir) {
+                if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
+                    // try PHP include_path
+                    if ($_stream_resolve_include_path) {
+                        $plugin_dir = stream_resolve_include_path($_plugin_dir);
+                    } else {
+                        $plugin_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_plugin_dir);
+                    }
+
+                    if ($plugin_dir !== false) {
+                        if ($errors === null) {
+                            echo "$plugin_dir is OK.\n";
+                        }
+
+                        continue;
+                    } else {
+                        $status = false;
+                        $message = "FAILED: $_plugin_dir does not exist (and couldn't be found in include_path either)";
+                        if ($errors === null) {
+                            echo $message . ".\n";
+                        } else {
+                            $errors['plugins_dir'] = $message;
+                        }
+
+                        continue;
+                    }
+                } else {
+                    $status = false;
+                    $message = "FAILED: $_plugin_dir does not exist";
+                    if ($errors === null) {
+                        echo $message . ".\n";
+                    } else {
+                        $errors['plugins_dir'] = $message;
+                    }
+
+                    continue;
+                }
+            }
+
+            if (!is_dir($plugin_dir)) {
+                $status = false;
+                $message = "FAILED: $plugin_dir is not a directory";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['plugins_dir'] = $message;
+                }
+            } elseif (!is_readable($plugin_dir)) {
+                $status = false;
+                $message = "FAILED: $plugin_dir is not readable";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['plugins_dir'] = $message;
+                }
+            } elseif ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) {
+                $_core_plugins_available = true;
+                if ($errors === null) {
+                    echo "$plugin_dir is OK.\n";
+                }
+            } else {
+                if ($errors === null) {
+                    echo "$plugin_dir is OK.\n";
+                }
+            }
+        }
+        if (!$_core_plugins_available) {
+            $status = false;
+            $message = "WARNING: Smarty's own libs/plugins is not available";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } elseif (!isset($errors['plugins_dir'])) {
+                $errors['plugins_dir'] = $message;
+            }
+        }
+
+        if ($errors === null) {
+            echo "Testing cache directory...\n";
+        }
+
+
+        // test if all registered cache_dir is accessible
+        $__cache_dir = $smarty->getCacheDir();
+        $_cache_dir = realpath($__cache_dir);
+        if (!$_cache_dir) {
+            $status = false;
+            $message = "FAILED: {$__cache_dir} does not exist";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['cache_dir'] = $message;
+            }
+        } elseif (!is_dir($_cache_dir)) {
+            $status = false;
+            $message = "FAILED: {$_cache_dir} is not a directory";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['cache_dir'] = $message;
+            }
+        } elseif (!is_readable($_cache_dir)) {
+            $status = false;
+            $message = "FAILED: {$_cache_dir} is not readable";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['cache_dir'] = $message;
+            }
+        } elseif (!is_writable($_cache_dir)) {
+            $status = false;
+            $message = "FAILED: {$_cache_dir} is not writable";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['cache_dir'] = $message;
+            }
+        } else {
+            if ($errors === null) {
+                echo "{$_cache_dir} is OK.\n";
+            }
+        }
+
+
+        if ($errors === null) {
+            echo "Testing configs directory...\n";
+        }
+
+        // test if all registered config_dir are accessible
+        foreach($smarty->getConfigDir() as $config_dir) {
+            $_config_dir = $config_dir;
+            $config_dir = realpath($config_dir);
+            // resolve include_path or fail existance
+            if (!$config_dir) {
+                if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_config_dir)) {
+                    // try PHP include_path
+                    if ($_stream_resolve_include_path) {
+                        $config_dir = stream_resolve_include_path($_config_dir);
+                    } else {
+                        $config_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_config_dir);
+                    }
+
+                    if ($config_dir !== false) {
+                        if ($errors === null) {
+                            echo "$config_dir is OK.\n";
+                        }
+
+                        continue;
+                    } else {
+                        $status = false;
+                        $message = "FAILED: $_config_dir does not exist (and couldn't be found in include_path either)";
+                        if ($errors === null) {
+                            echo $message . ".\n";
+                        } else {
+                            $errors['config_dir'] = $message;
+                        }
+
+                        continue;
+                    }
+                } else {
+                    $status = false;
+                    $message = "FAILED: $_config_dir does not exist";
+                    if ($errors === null) {
+                        echo $message . ".\n";
+                    } else {
+                        $errors['config_dir'] = $message;
+                    }
+
+                    continue;
+                }
+            }
+
+            if (!is_dir($config_dir)) {
+                $status = false;
+                $message = "FAILED: $config_dir is not a directory";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['config_dir'] = $message;
+                }
+            } elseif (!is_readable($config_dir)) {
+                $status = false;
+                $message = "FAILED: $config_dir is not readable";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['config_dir'] = $message;
+                }
+            } else {
+                if ($errors === null) {
+                    echo "$config_dir is OK.\n";
+                }
+            }
+        }
+
+
+        if ($errors === null) {
+            echo "Testing sysplugin files...\n";
+        }
+        // test if sysplugins are available
+        $source = SMARTY_SYSPLUGINS_DIR;
+        if (is_dir($source)) {
+            $expected = array(
+                "smarty_cacheresource.php" => true,
+                "smarty_cacheresource_custom.php" => true,
+                "smarty_cacheresource_keyvaluestore.php" => true,
+                "smarty_config_source.php" => true,
+                "smarty_internal_cacheresource_file.php" => true,
+                "smarty_internal_compile_append.php" => true,
+                "smarty_internal_compile_assign.php" => true,
+                "smarty_internal_compile_block.php" => true,
+                "smarty_internal_compile_break.php" => true,
+                "smarty_internal_compile_call.php" => true,
+                "smarty_internal_compile_capture.php" => true,
+                "smarty_internal_compile_config_load.php" => true,
+                "smarty_internal_compile_continue.php" => true,
+                "smarty_internal_compile_debug.php" => true,
+                "smarty_internal_compile_eval.php" => true,
+                "smarty_internal_compile_extends.php" => true,
+                "smarty_internal_compile_for.php" => true,
+                "smarty_internal_compile_foreach.php" => true,
+                "smarty_internal_compile_function.php" => true,
+                "smarty_internal_compile_if.php" => true,
+                "smarty_internal_compile_include.php" => true,
+                "smarty_internal_compile_include_php.php" => true,
+                "smarty_internal_compile_insert.php" => true,
+                "smarty_internal_compile_ldelim.php" => true,
+                "smarty_internal_compile_nocache.php" => true,
+                "smarty_internal_compile_private_block_plugin.php" => true,
+                "smarty_internal_compile_private_function_plugin.php" => true,
+                "smarty_internal_compile_private_modifier.php" => true,
+                "smarty_internal_compile_private_object_block_function.php" => true,
+                "smarty_internal_compile_private_object_function.php" => true,
+                "smarty_internal_compile_private_print_expression.php" => true,
+                "smarty_internal_compile_private_registered_block.php" => true,
+                "smarty_internal_compile_private_registered_function.php" => true,
+                "smarty_internal_compile_private_special_variable.php" => true,
+                "smarty_internal_compile_rdelim.php" => true,
+                "smarty_internal_compile_section.php" => true,
+                "smarty_internal_compile_setfilter.php" => true,
+                "smarty_internal_compile_while.php" => true,
+                "smarty_internal_compilebase.php" => true,
+                "smarty_internal_config.php" => true,
+                "smarty_internal_config_file_compiler.php" => true,
+                "smarty_internal_configfilelexer.php" => true,
+                "smarty_internal_configfileparser.php" => true,
+                "smarty_internal_data.php" => true,
+                "smarty_internal_debug.php" => true,
+                "smarty_internal_filter_handler.php" => true,
+                "smarty_internal_function_call_handler.php" => true,
+                "smarty_internal_get_include_path.php" => true,
+                "smarty_internal_nocache_insert.php" => true,
+                "smarty_internal_parsetree.php" => true,
+                "smarty_internal_resource_eval.php" => true,
+                "smarty_internal_resource_extends.php" => true,
+                "smarty_internal_resource_file.php" => true,
+                "smarty_internal_resource_registered.php" => true,
+                "smarty_internal_resource_stream.php" => true,
+                "smarty_internal_resource_string.php" => true,
+                "smarty_internal_smartytemplatecompiler.php" => true,
+                "smarty_internal_template.php" => true,
+                "smarty_internal_templatebase.php" => true,
+                "smarty_internal_templatecompilerbase.php" => true,
+                "smarty_internal_templatelexer.php" => true,
+                "smarty_internal_templateparser.php" => true,
+                "smarty_internal_utility.php" => true,
+                "smarty_internal_write_file.php" => true,
+                "smarty_resource.php" => true,
+                "smarty_resource_custom.php" => true,
+                "smarty_resource_recompiled.php" => true,
+                "smarty_resource_uncompiled.php" => true,
+                "smarty_security.php" => true,
+            );
+            $iterator = new DirectoryIterator($source);
+            foreach ($iterator as $file) {
+                if (!$file->isDot()) {
+                    $filename = $file->getFilename();
+                    if (isset($expected[$filename])) {
+                        unset($expected[$filename]);
+                    }
+                }
+            }
+            if ($expected) {
+                $status = false;
+                $message = "FAILED: files missing from libs/sysplugins: ". join(', ', array_keys($expected));
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['sysplugins'] = $message;
+                }
+            } elseif ($errors === null) {
+                echo "... OK\n";
+            }
+        } else {
+            $status = false;
+            $message = "FAILED: ". SMARTY_SYSPLUGINS_DIR .' is not a directory';
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['sysplugins_dir_constant'] = $message;
+            }
+        }
+
+        if ($errors === null) {
+            echo "Testing plugin files...\n";
+        }
+        // test if core plugins are available
+        $source = SMARTY_PLUGINS_DIR;
+        if (is_dir($source)) {
+            $expected = array(
+                "block.textformat.php" => true,
+                "function.counter.php" => true,
+                "function.cycle.php" => true,
+                "function.fetch.php" => true,
+                "function.html_checkboxes.php" => true,
+                "function.html_image.php" => true,
+                "function.html_options.php" => true,
+                "function.html_radios.php" => true,
+                "function.html_select_date.php" => true,
+                "function.html_select_time.php" => true,
+                "function.html_table.php" => true,
+                "function.mailto.php" => true,
+                "function.math.php" => true,
+                "modifier.capitalize.php" => true,
+                "modifier.date_format.php" => true,
+                "modifier.debug_print_var.php" => true,
+                "modifier.escape.php" => true,
+                "modifier.regex_replace.php" => true,
+                "modifier.replace.php" => true,
+                "modifier.spacify.php" => true,
+                "modifier.truncate.php" => true,
+                "modifiercompiler.cat.php" => true,
+                "modifiercompiler.count_characters.php" => true,
+                "modifiercompiler.count_paragraphs.php" => true,
+                "modifiercompiler.count_sentences.php" => true,
+                "modifiercompiler.count_words.php" => true,
+                "modifiercompiler.default.php" => true,
+                "modifiercompiler.escape.php" => true,
+                "modifiercompiler.from_charset.php" => true,
+                "modifiercompiler.indent.php" => true,
+                "modifiercompiler.lower.php" => true,
+                "modifiercompiler.noprint.php" => true,
+                "modifiercompiler.string_format.php" => true,
+                "modifiercompiler.strip.php" => true,
+                "modifiercompiler.strip_tags.php" => true,
+                "modifiercompiler.to_charset.php" => true,
+                "modifiercompiler.unescape.php" => true,
+                "modifiercompiler.upper.php" => true,
+                "modifiercompiler.wordwrap.php" => true,
+                "outputfilter.trimwhitespace.php" => true,
+                "shared.escape_special_chars.php" => true,
+                "shared.literal_compiler_param.php" => true,
+                "shared.make_timestamp.php" => true,
+                "shared.mb_str_replace.php" => true,
+                "shared.mb_unicode.php" => true,
+                "shared.mb_wordwrap.php" => true,
+                "variablefilter.htmlspecialchars.php" => true,
+            );
+            $iterator = new DirectoryIterator($source);
+            foreach ($iterator as $file) {
+                if (!$file->isDot()) {
+                    $filename = $file->getFilename();
+                    if (isset($expected[$filename])) {
+                        unset($expected[$filename]);
+                    }
+                }
+            }
+            if ($expected) {
+                $status = false;
+                $message = "FAILED: files missing from libs/plugins: ". join(', ', array_keys($expected));
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['plugins'] = $message;
+                }
+            } elseif ($errors === null) {
+                echo "... OK\n";
+            }
+        } else {
+            $status = false;
+            $message = "FAILED: ". SMARTY_PLUGINS_DIR .' is not a directory';
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['plugins_dir_constant'] = $message;
+            }
+        }
+
+        if ($errors === null) {
+            echo "Tests complete.\n";
+            echo "</PRE>\n";
+        }
+
+        return $status;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_write_file.php b/library/Smarty/libs/sysplugins/smarty_internal_write_file.php
new file mode 100644 (file)
index 0000000..e5d19ce
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Smarty write file plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @author Monte Ohrt
+ */
+
+/**
+ * Smarty Internal Write File Class
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ */
+class Smarty_Internal_Write_File {
+
+    /**
+     * Writes file in a safe way to disk
+     *
+     * @param string $_filepath complete filepath
+     * @param string $_contents file content
+     * @param Smarty $smarty    smarty instance
+     * @return boolean true
+     */
+    public static function writeFile($_filepath, $_contents, Smarty $smarty)
+    {
+        $_error_reporting = error_reporting();
+        error_reporting($_error_reporting & ~E_NOTICE & ~E_WARNING);
+        if ($smarty->_file_perms !== null) {
+            $old_umask = umask(0);
+        }
+
+        $_dirpath = dirname($_filepath);
+        // if subdirs, create dir structure
+        if ($_dirpath !== '.' && !file_exists($_dirpath)) {
+            mkdir($_dirpath, $smarty->_dir_perms === null ? 0777 : $smarty->_dir_perms, true);
+        }
+
+        // write to tmp file, then move to overt file lock race condition
+        $_tmp_file = $_dirpath . DS . uniqid('wrt', true);
+        if (!file_put_contents($_tmp_file, $_contents)) {
+            error_reporting($_error_reporting);
+            throw new SmartyException("unable to write file {$_tmp_file}");
+            return false;
+        }
+        
+        /*
+         * Windows' rename() fails if the destination exists,
+         * Linux' rename() properly handles the overwrite.
+         * Simply unlink()ing a file might cause other processes 
+         * currently reading that file to fail, but linux' rename()
+         * seems to be smart enough to handle that for us.
+         */
+        if (Smarty::$_IS_WINDOWS) {
+            // remove original file
+            @unlink($_filepath);
+            // rename tmp file
+            $success = @rename($_tmp_file, $_filepath);
+        } else {
+            // rename tmp file
+            $success = @rename($_tmp_file, $_filepath);
+            if (!$success) {
+                // remove original file
+                @unlink($_filepath);
+                // rename tmp file
+                $success = @rename($_tmp_file, $_filepath);
+            }
+        }
+
+        if (!$success) {
+            error_reporting($_error_reporting);
+            throw new SmartyException("unable to write file {$_filepath}");
+            return false;
+        }
+
+        if ($smarty->_file_perms !== null) {
+            // set file permissions
+            chmod($_filepath, $smarty->_file_perms);
+            umask($old_umask);
+        }
+        error_reporting($_error_reporting);
+        return true;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_resource.php b/library/Smarty/libs/sysplugins/smarty_resource.php
new file mode 100644 (file)
index 0000000..f79373a
--- /dev/null
@@ -0,0 +1,860 @@
+<?php
+/**
+ * Smarty Resource Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Resource Plugin
+ *
+ * Base implementation for resource plugins
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+abstract class Smarty_Resource {
+    /**
+     * cache for Smarty_Template_Source instances
+     * @var array
+     */
+    public static $sources = array();
+    /**
+     * cache for Smarty_Template_Compiled instances
+     * @var array
+     */
+    public static $compileds = array();
+    /**
+     * cache for Smarty_Resource instances
+     * @var array
+     */
+    public static $resources = array();
+    /**
+     * resource types provided by the core
+     * @var array
+     */
+    protected static $sysplugins = array(
+        'file' => true,
+        'string' => true,
+        'extends' => true,
+        'stream' => true,
+        'eval' => true,
+        'php' => true
+    );
+
+    /**
+     * Name of the Class to compile this resource's contents with
+     * @var string
+     */
+    public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
+
+    /**
+     * Name of the Class to tokenize this resource's contents with
+     * @var string
+     */
+    public $template_lexer_class = 'Smarty_Internal_Templatelexer';
+
+    /**
+     * Name of the Class to parse this resource's contents with
+     * @var string
+     */
+    public $template_parser_class = 'Smarty_Internal_Templateparser';
+
+    /**
+     * Load template's source into current template object
+     *
+     * {@internal The loaded source is assigned to $_template->source->content directly.}}
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string template source
+     * @throws SmartyException if source cannot be loaded
+     */
+    public abstract function getContent(Smarty_Template_Source $source);
+
+    /**
+     * populate Source Object with meta data from Resource
+     *
+     * @param Smarty_Template_Source   $source source object
+     * @param Smarty_Internal_Template $_template     template object
+     */
+    public abstract function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null);
+
+    /**
+     * populate Source Object with timestamp and exists from Resource
+     *
+     * @param Smarty_Template_Source $source source object
+     */
+    public function populateTimestamp(Smarty_Template_Source $source)
+    {
+        // intentionally left blank
+    }
+
+
+    /**
+     * modify resource_name according to resource handlers specifications
+     *
+     * @param Smarty $smarty        Smarty instance
+     * @param string $resource_name resource_name to make unique
+     * @return string unique resource name
+     */
+    protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
+    {
+        return get_class($this) . '#' . $smarty->joined_template_dir . '#' . $resource_name;
+    }
+
+    /**
+     * populate Compiled Object with compiled filepath
+     *
+     * @param Smarty_Template_Compiled $compiled  compiled object
+     * @param Smarty_Internal_Template $_template template object
+     */
+    public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
+    {
+        $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
+        $_filepath = $compiled->source->uid;
+        // if use_sub_dirs, break file into directories
+        if ($_template->smarty->use_sub_dirs) {
+            $_filepath = substr($_filepath, 0, 2) . DS
+             . substr($_filepath, 2, 2) . DS
+             . substr($_filepath, 4, 2) . DS
+             . $_filepath;
+        }
+        $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
+        if (isset($_compile_id)) {
+            $_filepath = $_compile_id . $_compile_dir_sep . $_filepath;
+        }
+        // caching token
+        if ($_template->caching) {
+            $_cache = '.cache';
+        } else {
+            $_cache = '';
+        }
+        $_compile_dir = $_template->smarty->getCompileDir();
+        // set basename if not specified
+        $_basename = $this->getBasename($compiled->source);
+        if ($_basename === null) {
+            $_basename = basename( preg_replace('![^\w\/]+!', '_', $compiled->source->name) );
+        }
+        // separate (optional) basename by dot
+        if ($_basename) {
+            $_basename = '.' . $_basename;
+        }
+
+        $compiled->filepath = $_compile_dir . $_filepath . '.' . $compiled->source->type . $_basename . $_cache . '.php';
+    }
+    
+    /**
+     * Normalize Paths "foo/../bar" to "bar" 
+     *
+     * @param string $_path path to normalize
+     * @param boolean $ds respect windows directory separator
+     * @return string normalized path
+     */
+    protected function normalizePath($_path, $ds=true)
+    {
+        if ($ds) {
+            // don't we all just love windows?
+            $_path = str_replace('\\', '/', $_path);
+        }
+        
+        // resolve simples
+        $_path = preg_replace('#(/\./(\./)*)|/{2,}#', '/', $_path);
+        // resolve parents
+        while (true) {
+            $_parent = strpos($_path, '/../');
+            if ($_parent === false) {
+                break;
+            } else if ($_parent === 0) {
+                $_path = substr($_path, 3);
+                break;
+            }
+            
+            $_pos = strrpos($_path, '/', $_parent - strlen($_path) - 1);
+            if ($_pos === false) {
+                // don't we all just love windows?
+                $_pos = $_parent;
+            }
+            
+            $_path = substr_replace($_path, '', $_pos, $_parent + 3 - $_pos);
+        }
+        
+        if ($ds && DS != '/') {
+            // don't we all just love windows?
+            $_path = str_replace('/', '\\', $_path);
+        }
+        
+        return $_path;
+    }
+    
+    /**
+     * build template filepath by traversing the template_dir array
+     *
+     * @param Smarty_Template_Source   $source    source object
+     * @param Smarty_Internal_Template $_template template object
+     * @return string fully qualified filepath
+     * @throws SmartyException if default template handler is registered but not callable
+     */
+    protected function buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+    {
+        $file = $source->name;
+        if ($source instanceof Smarty_Config_Source) {
+            $_directories = $source->smarty->getConfigDir();
+            $_default_handler = $source->smarty->default_config_handler_func;
+        } else {
+            $_directories = $source->smarty->getTemplateDir();
+            $_default_handler = $source->smarty->default_template_handler_func;
+        }
+
+        // go relative to a given template?
+        $_file_is_dotted = $file[0] == '.' && ($file[1] == '.' || $file[1] == '/' || $file[1] == "\\");
+        if ($_template && $_template->parent instanceof Smarty_Internal_Template && $_file_is_dotted) {
+            if ($_template->parent->source->type != 'file' && $_template->parent->source->type != 'extends' && !$_template->parent->allow_relative_path) {
+                throw new SmartyException("Template '{$file}' cannot be relative to template of resource type '{$_template->parent->source->type}'");
+            }
+            $file = dirname($_template->parent->source->filepath) . DS . $file;
+            $_file_exact_match = true;
+            if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
+                // the path gained from the parent template is relative to the current working directory
+                // as expansions (like include_path) have already been done
+                $file = getcwd() . DS . $file;
+            }
+        }
+
+        // resolve relative path
+        if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
+            // don't we all just love windows?
+            $_path = str_replace('\\', '/', $file);
+            $_was_relative_prefix = $file[0] == '.' ? substr($file, 0, strpos($_path, '/')) : null;
+            $_path = DS . trim($file, '/');
+            $_was_relative = true;
+        } else {
+            // don't we all just love windows?
+            $_path = str_replace('\\', '/', $file);
+        }
+        $_path = $this->normalizePath($_path, false);
+        if (DS != '/') {
+            // don't we all just love windows?
+            $_path = str_replace('/', '\\', $_path);
+        }
+        // revert to relative
+        if (isset($_was_relative)) {
+            if (isset($_was_relative_prefix)){
+                $_path = $_was_relative_prefix . $_path;
+            } else {
+                $_path = substr($_path, 1);
+            }
+        }
+
+        // this is only required for directories
+        $file = rtrim($_path, '/\\');
+
+        // files relative to a template only get one shot
+        if (isset($_file_exact_match)) {
+            return $this->fileExists($source, $file) ? $file : false;
+        }
+
+        // template_dir index?
+        if (preg_match('#^\[(?P<key>[^\]]+)\](?P<file>.+)$#', $file, $match)) {
+            $_directory = null;
+            // try string indexes
+            if (isset($_directories[$match['key']])) {
+                $_directory = $_directories[$match['key']];
+            } else if (is_numeric($match['key'])) {
+                // try numeric index
+                $match['key'] = (int) $match['key'];
+                if (isset($_directories[$match['key']])) {
+                    $_directory = $_directories[$match['key']];
+                } else {
+                    // try at location index
+                    $keys = array_keys($_directories);
+                    $_directory = $_directories[$keys[$match['key']]];
+                }
+            }
+
+            if ($_directory) {
+                $_file = substr($file, strpos($file, ']') + 1);
+                $_filepath = $_directory . $_file;
+                if ($this->fileExists($source, $_filepath)) {
+                    return $_filepath;
+                }
+            }
+        }
+
+        $_stream_resolve_include_path = function_exists('stream_resolve_include_path');
+
+        // relative file name?
+        if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
+            foreach ($_directories as $_directory) {
+                $_filepath = $_directory . $file;
+                if ($this->fileExists($source, $_filepath)) {
+                    return $this->normalizePath($_filepath);
+                }
+                if ($source->smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_directory)) {
+                    // try PHP include_path
+                    if ($_stream_resolve_include_path) {
+                        $_filepath = stream_resolve_include_path($_filepath);
+                    } else {
+                        $_filepath = Smarty_Internal_Get_Include_Path::getIncludePath($_filepath);
+                    }
+
+                    if ($_filepath !== false) {
+                        if ($this->fileExists($source, $_filepath)) {
+                            return $this->normalizePath($_filepath);
+                        }
+                    }
+                }
+            }
+        }
+
+        // try absolute filepath
+        if ($this->fileExists($source, $file)) {
+            return $file;
+        }
+
+        // no tpl file found
+        if ($_default_handler) {
+            if (!is_callable($_default_handler)) {
+                if ($source instanceof Smarty_Config_Source) {
+                    throw new SmartyException("Default config handler not callable");
+                } else {
+                    throw new SmartyException("Default template handler not callable");
+                }
+            }
+            $_return = call_user_func_array($_default_handler,
+                array($source->type, $source->name, &$_content, &$_timestamp, $source->smarty));
+            if (is_string($_return)) {
+                $source->timestamp = @filemtime($_return);
+                $source->exists = !!$source->timestamp;
+                return $_return;
+            } elseif ($_return === true) {
+                $source->content = $_content;
+                $source->timestamp = $_timestamp;
+                $source->exists = true;
+                return $_filepath;
+            }
+        }
+
+        // give up
+        return false;
+    }
+
+    /**
+     * test is file exists and save timestamp
+     *
+     * @param Smarty_Template_Source   $source    source object
+     * @param string $file file name
+     * @return bool  true if file exists
+     */
+    protected function fileExists(Smarty_Template_Source $source, $file)
+    {
+        $source->timestamp = @filemtime($file);
+        return $source->exists = !!$source->timestamp;
+
+    }
+
+    /**
+     * Determine basename for compiled filename
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string resource's basename
+     */
+    protected function getBasename(Smarty_Template_Source $source)
+    {
+        return null;
+    }
+
+    /**
+     * Load Resource Handler
+     *
+     * @param Smarty $smarty    smarty object
+     * @param string $type      name of the resource
+     * @return Smarty_Resource Resource Handler
+     */
+    public static function load(Smarty $smarty, $type)
+    {
+        // try smarty's cache
+        if (isset($smarty->_resource_handlers[$type])) {
+            return $smarty->_resource_handlers[$type];
+        }
+
+        // try registered resource
+        if (isset($smarty->registered_resources[$type])) {
+            if ($smarty->registered_resources[$type] instanceof Smarty_Resource) {
+                $smarty->_resource_handlers[$type] = $smarty->registered_resources[$type];
+                // note registered to smarty is not kept unique!
+                return $smarty->_resource_handlers[$type];
+            }
+
+            if (!isset(self::$resources['registered'])) {
+                self::$resources['registered'] = new Smarty_Internal_Resource_Registered();
+            }
+            if (!isset($smarty->_resource_handlers[$type])) {
+                $smarty->_resource_handlers[$type] = self::$resources['registered'];
+            }
+
+            return $smarty->_resource_handlers[$type];
+        }
+
+        // try sysplugins dir
+        if (isset(self::$sysplugins[$type])) {
+            if (!isset(self::$resources[$type])) {
+                $_resource_class = 'Smarty_Internal_Resource_' . ucfirst($type);
+                self::$resources[$type] = new $_resource_class();
+            }
+            return $smarty->_resource_handlers[$type] = self::$resources[$type];
+        }
+
+        // try plugins dir
+        $_resource_class = 'Smarty_Resource_' . ucfirst($type);
+        if ($smarty->loadPlugin($_resource_class)) {
+            if (isset(self::$resources[$type])) {
+                return $smarty->_resource_handlers[$type] = self::$resources[$type];
+            }
+
+            if (class_exists($_resource_class, false)) {
+                self::$resources[$type] = new $_resource_class();
+                return $smarty->_resource_handlers[$type] = self::$resources[$type];
+            } else {
+                $smarty->registerResource($type, array(
+                    "smarty_resource_{$type}_source",
+                    "smarty_resource_{$type}_timestamp",
+                    "smarty_resource_{$type}_secure",
+                    "smarty_resource_{$type}_trusted"
+                ));
+
+                // give it another try, now that the resource is registered properly
+                return self::load($smarty, $type);
+            }
+        }
+
+        // try streams
+        $_known_stream = stream_get_wrappers();
+        if (in_array($type, $_known_stream)) {
+            // is known stream
+            if (is_object($smarty->security_policy)) {
+                $smarty->security_policy->isTrustedStream($type);
+            }
+            if (!isset(self::$resources['stream'])) {
+                self::$resources['stream'] = new Smarty_Internal_Resource_Stream();
+            }
+            return $smarty->_resource_handlers[$type] = self::$resources['stream'];
+        }
+
+        // TODO: try default_(template|config)_handler
+
+        // give up
+        throw new SmartyException("Unkown resource type '{$type}'");
+    }
+
+    /**
+     * extract resource_type and resource_name from template_resource and config_resource
+     *
+     * @note "C:/foo.tpl" was forced to file resource up till Smarty 3.1.3 (including).
+     * @param string  $resource_name    template_resource or config_resource to parse
+     * @param string  $default_resource the default resource_type defined in $smarty
+     * @param string &$name             the parsed resource name
+     * @param string &$type             the parsed resource type
+     * @return void
+     */
+    protected static function parseResourceName($resource_name, $default_resource, &$name, &$type)
+    {
+        $parts = explode(':', $resource_name, 2);
+        if (!isset($parts[1]) || !isset($parts[0][1])) {
+            // no resource given, use default
+            // or single character before the colon is not a resource type, but part of the filepath
+            $type = $default_resource;
+            $name = $resource_name;
+        } else {
+            $type = $parts[0];
+            $name = $parts[1];
+        }
+    }
+
+
+    /**
+     * modify resource_name according to resource handlers specifications
+     *
+     * @param Smarty $smarty        Smarty instance
+     * @param string $resource_name resource_name to make unique
+     * @return string unique resource name
+     */
+
+    /**
+     * modify template_resource according to resource handlers specifications
+     *
+     * @param string $smarty            Smarty instance
+     * @param string $template_resource template_resource to extracate resource handler and name of
+     * @return string unique resource name
+     */
+    public static function getUniqueTemplateName($smarty, $template_resource)
+    {
+        self::parseResourceName($template_resource, $smarty->default_resource_type, $name, $type);
+        // TODO: optimize for Smarty's internal resource types
+        $resource = Smarty_Resource::load($smarty, $type);
+        return $resource->buildUniqueResourceName($smarty, $name);
+    }
+
+    /**
+     * initialize Source Object for given resource
+     *
+     * Either [$_template] or [$smarty, $template_resource] must be specified
+     *
+     * @param Smarty_Internal_Template $_template         template object
+     * @param Smarty                   $smarty            smarty object
+     * @param string                   $template_resource resource identifier
+     * @return Smarty_Template_Source Source Object
+     */
+    public static function source(Smarty_Internal_Template $_template=null, Smarty $smarty=null, $template_resource=null)
+    {
+        if ($_template) {
+            $smarty = $_template->smarty;
+            $template_resource = $_template->template_resource;
+        }
+
+        // parse resource_name, load resource handler, identify unique resource name
+        self::parseResourceName($template_resource, $smarty->default_resource_type, $name, $type);
+        $resource = Smarty_Resource::load($smarty, $type);
+        $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name);
+
+        // check runtime cache
+        $_cache_key = 'template|' . $unique_resource_name;
+        if ($smarty->compile_id) {
+            $_cache_key .= '|'.$smarty->compile_id;
+        }
+        if (isset(self::$sources[$_cache_key])) {
+            return self::$sources[$_cache_key];
+        }
+
+        // create source
+        $source = new Smarty_Template_Source($resource, $smarty, $template_resource, $type, $name, $unique_resource_name);
+        $resource->populate($source, $_template);
+
+        // runtime cache
+        self::$sources[$_cache_key] = $source;
+        return $source;
+    }
+
+    /**
+     * initialize Config Source Object for given resource
+     *
+     * @param Smarty_Internal_Config $_config config object
+     * @return Smarty_Config_Source Source Object
+     */
+    public static function config(Smarty_Internal_Config $_config)
+    {
+        static $_incompatible_resources = array('eval' => true, 'string' => true, 'extends' => true, 'php' => true);
+        $config_resource = $_config->config_resource;
+        $smarty = $_config->smarty;
+
+        // parse resource_name
+        self::parseResourceName($config_resource, $smarty->default_config_type, $name, $type);
+
+        // make sure configs are not loaded via anything smarty can't handle
+        if (isset($_incompatible_resources[$type])) {
+            throw new SmartyException ("Unable to use resource '{$type}' for config");
+        }
+
+        // load resource handler, identify unique resource name
+        $resource = Smarty_Resource::load($smarty, $type);
+        $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name);
+
+        // check runtime cache
+        $_cache_key = 'config|' . $unique_resource_name;
+        if (isset(self::$sources[$_cache_key])) {
+            return self::$sources[$_cache_key];
+        }
+
+        // create source
+        $source = new Smarty_Config_Source($resource, $smarty, $config_resource, $type, $name, $unique_resource_name);
+        $resource->populate($source, null);
+
+        // runtime cache
+        self::$sources[$_cache_key] = $source;
+        return $source;
+    }
+
+}
+
+/**
+ * Smarty Resource Data Object
+ *
+ * Meta Data Container for Template Files
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ *
+ * @property integer $timestamp Source Timestamp
+ * @property boolean $exists    Source Existance
+ * @property boolean $template  Extended Template reference
+ * @property string  $content   Source Content
+ */
+class Smarty_Template_Source {
+
+    /**
+     * Name of the Class to compile this resource's contents with
+     * @var string
+     */
+    public $compiler_class = null;
+
+    /**
+     * Name of the Class to tokenize this resource's contents with
+     * @var string
+     */
+    public $template_lexer_class = null;
+
+    /**
+     * Name of the Class to parse this resource's contents with
+     * @var string
+     */
+    public $template_parser_class = null;
+
+    /**
+     * Unique Template ID
+     * @var string
+     */
+    public $uid = null;
+
+    /**
+     * Template Resource (Smarty_Internal_Template::$template_resource)
+     * @var string
+     */
+    public $resource = null;
+
+    /**
+     * Resource Type
+     * @var string
+     */
+    public $type = null;
+
+    /**
+     * Resource Name
+     * @var string
+     */
+    public $name = null;
+
+    /**
+     * Unique Resource Name
+     * @var string
+     */
+    public $unique_resource = null;
+
+    /**
+     * Source Filepath
+     * @var string
+     */
+    public $filepath = null;
+
+    /**
+     * Source is bypassing compiler
+     * @var boolean
+     */
+    public $uncompiled = null;
+
+    /**
+     * Source must be recompiled on every occasion
+     * @var boolean
+     */
+    public $recompiled = null;
+
+    /**
+     * The Components an extended template is made of
+     * @var array
+     */
+    public $components = null;
+
+    /**
+     * Resource Handler
+     * @var Smarty_Resource
+     */
+    public $handler = null;
+
+    /**
+     * Smarty instance
+     * @var Smarty
+     */
+    public $smarty = null;
+
+    /**
+     * create Source Object container
+     *
+     * @param Smarty_Resource $handler          Resource Handler this source object communicates with
+     * @param Smarty          $smarty           Smarty instance this source object belongs to
+     * @param string          $resource         full template_resource
+     * @param string          $type             type of resource
+     * @param string          $name             resource name
+     * @param string          $unique_resource  unqiue resource name
+     */
+    public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource)
+    {
+        $this->handler = $handler; // Note: prone to circular references
+
+        $this->compiler_class = $handler->compiler_class;
+        $this->template_lexer_class = $handler->template_lexer_class;
+        $this->template_parser_class = $handler->template_parser_class;
+        $this->uncompiled = $this->handler instanceof Smarty_Resource_Uncompiled;
+        $this->recompiled = $this->handler instanceof Smarty_Resource_Recompiled;
+
+        $this->smarty = $smarty;
+        $this->resource = $resource;
+        $this->type = $type;
+        $this->name = $name;
+        $this->unique_resource = $unique_resource;
+    }
+
+    /**
+     * get a Compiled Object of this source
+     *
+     * @param Smarty_Internal_Template $_template template objet
+     * @return Smarty_Template_Compiled compiled object
+     */
+    public function getCompiled(Smarty_Internal_Template $_template)
+    {
+        // check runtime cache
+        $_cache_key = $this->unique_resource . '#' . $_template->compile_id;
+        if (isset(Smarty_Resource::$compileds[$_cache_key])) {
+            return Smarty_Resource::$compileds[$_cache_key];
+        }
+
+        $compiled = new Smarty_Template_Compiled($this);
+        $this->handler->populateCompiledFilepath($compiled, $_template);
+        $compiled->timestamp = @filemtime($compiled->filepath);
+        $compiled->exists = !!$compiled->timestamp;
+
+        // runtime cache
+        Smarty_Resource::$compileds[$_cache_key] = $compiled;
+
+        return $compiled;
+    }
+
+    /**
+     * render the uncompiled source
+     *
+     * @param Smarty_Internal_Template $_template template object
+     */
+    public function renderUncompiled(Smarty_Internal_Template $_template)
+    {
+        return $this->handler->renderUncompiled($this, $_template);
+    }
+
+    /**
+     * <<magic>> Generic Setter.
+     *
+     * @param string $property_name valid: timestamp, exists, content, template
+     * @param mixed  $value        new value (is not checked)
+     * @throws SmartyException if $property_name is not valid
+     */
+    public function __set($property_name, $value)
+    {
+        switch ($property_name) {
+            // regular attributes
+            case 'timestamp':
+            case 'exists':
+            case 'content':
+            // required for extends: only
+            case 'template':
+                $this->$property_name = $value;
+                break;
+
+            default:
+                throw new SmartyException("invalid source property '$property_name'.");
+        }
+    }
+
+    /**
+     * <<magic>> Generic getter.
+     *
+     * @param string $property_name valid: timestamp, exists, content
+     * @return mixed
+     * @throws SmartyException if $property_name is not valid
+     */
+    public function __get($property_name)
+    {
+        switch ($property_name) {
+            case 'timestamp':
+            case 'exists':
+                $this->handler->populateTimestamp($this);
+                return $this->$property_name;
+
+            case 'content':
+                return $this->content = $this->handler->getContent($this);
+
+            default:
+                throw new SmartyException("source property '$property_name' does not exist.");
+        }
+    }
+
+}
+
+/**
+ * Smarty Resource Data Object
+ *
+ * Meta Data Container for Template Files
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ *
+ * @property string $content compiled content
+ */
+class Smarty_Template_Compiled {
+
+    /**
+     * Compiled Filepath
+     * @var string
+     */
+    public $filepath = null;
+
+    /**
+     * Compiled Timestamp
+     * @var integer
+     */
+    public $timestamp = null;
+
+    /**
+     * Compiled Existance
+     * @var boolean
+     */
+    public $exists = false;
+
+    /**
+     * Compiled Content Loaded
+     * @var boolean
+     */
+    public $loaded = false;
+
+    /**
+     * Template was compiled
+     * @var boolean
+     */
+    public $isCompiled = false;
+
+    /**
+     * Source Object
+     * @var Smarty_Template_Source
+     */
+    public $source = null;
+
+    /**
+     * Metadata properties
+     *
+     * populated by Smarty_Internal_Template::decodeProperties()
+     * @var array
+     */
+    public $_properties = null;
+
+    /**
+     * create Compiled Object container
+     *
+     * @param Smarty_Template_Source $source source object this compiled object belongs to
+     */
+    public function __construct(Smarty_Template_Source $source)
+    {
+        $this->source = $source;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_resource_custom.php b/library/Smarty/libs/sysplugins/smarty_resource_custom.php
new file mode 100644 (file)
index 0000000..9ec1f35
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Smarty Resource Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Resource Plugin
+ *
+ * Wrapper Implementation for custom resource plugins
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+abstract class Smarty_Resource_Custom extends Smarty_Resource {
+
+    /**
+     * fetch template and its modification time from data source
+     *
+     * @param string  $name    template name
+     * @param string  &$source template source
+     * @param integer &$mtime  template modification timestamp (epoch)
+     */
+    protected abstract function fetch($name, &$source, &$mtime);
+
+    /**
+     * Fetch template's modification timestamp from data source
+     *
+     * {@internal implementing this method is optional.
+     *  Only implement it if modification times can be accessed faster than loading the complete template source.}}
+     *
+     * @param string $name template name
+     * @return integer|boolean timestamp (epoch) the template was modified, or false if not found
+     */
+    protected function fetchTimestamp($name)
+    {
+        return null;
+    }
+
+    /**
+     * populate Source Object with meta data from Resource
+     *
+     * @param Smarty_Template_Source   $source    source object
+     * @param Smarty_Internal_Template $_template template object
+     */
+    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+    {
+        $source->filepath = strtolower($source->type . ':' . $source->name);
+        $source->uid = sha1($source->type . ':' . $source->name);
+
+        $mtime = $this->fetchTimestamp($source->name);
+        if ($mtime !== null) {
+            $source->timestamp = $mtime;
+        } else {
+            $this->fetch($source->name, $content, $timestamp);
+            $source->timestamp = isset($timestamp) ? $timestamp : false;
+            if( isset($content) )
+                $source->content = $content;
+        }
+        $source->exists = !!$source->timestamp;
+    }
+
+    /**
+     * Load template's source into current template object
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string template source
+     * @throws SmartyException if source cannot be loaded
+     */
+    public function getContent(Smarty_Template_Source $source)
+    {
+        $this->fetch($source->name, $content, $timestamp);
+        if (isset($content)) {
+            return $content;
+        }
+
+        throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
+    }
+
+    /**
+     * Determine basename for compiled filename
+     *
+     * @param Smarty_Template_Source $source source object
+     * @return string resource's basename
+     */
+    protected function getBasename(Smarty_Template_Source $source)
+    {
+        return basename($source->name);
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_resource_recompiled.php b/library/Smarty/libs/sysplugins/smarty_resource_recompiled.php
new file mode 100644 (file)
index 0000000..ab55b93
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Smarty Resource Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Resource Plugin
+ *
+ * Base implementation for resource plugins that don't compile cache
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+abstract class Smarty_Resource_Recompiled extends Smarty_Resource {
+
+    /**
+     * populate Compiled Object with compiled filepath
+     *
+     * @param Smarty_Template_Compiled $compiled compiled object
+     * @param Smarty_Internal_Template $_template template object
+     * @return void
+     */
+    public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
+    {
+        $compiled->filepath = false;
+        $compiled->timestamp = false;
+        $compiled->exists = false;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_resource_uncompiled.php b/library/Smarty/libs/sysplugins/smarty_resource_uncompiled.php
new file mode 100644 (file)
index 0000000..ea80235
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Smarty Resource Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Resource Plugin
+ *
+ * Base implementation for resource plugins that don't use the compiler
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+abstract class Smarty_Resource_Uncompiled extends Smarty_Resource {
+
+    /**
+     * Render and output the template (without using the compiler)
+     *
+     * @param Smarty_Template_Source   $source    source object
+     * @param Smarty_Internal_Template $_template template object
+     * @throws SmartyException on failure
+     */
+    public abstract function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template);
+
+    /**
+     * populate compiled object with compiled filepath
+     *
+     * @param Smarty_Template_Compiled $compiled  compiled object
+     * @param Smarty_Internal_Template $_template template object (is ignored)
+     */
+    public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
+    {
+        $compiled->filepath = false;
+        $compiled->timestamp = false;
+        $compiled->exists = false;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/library/Smarty/libs/sysplugins/smarty_security.php b/library/Smarty/libs/sysplugins/smarty_security.php
new file mode 100644 (file)
index 0000000..f8b31d9
--- /dev/null
@@ -0,0 +1,459 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage Security
+ * @author Uwe Tews
+ */
+/*
+ * FIXME: Smarty_Security API
+ *      - getter and setter instead of public properties would allow cultivating an internal cache properly
+ *      - current implementation of isTrustedResourceDir() assumes that Smarty::$template_dir and Smarty::$config_dir are immutable
+ *        the cache is killed every time either of the variables change. That means that two distinct Smarty objects with differing
+ *        $template_dir or $config_dir should NOT share the same Smarty_Security instance, 
+ *        as this would lead to (severe) performance penalty! how should this be handled? 
+ */
+
+/**
+ * This class does contain the security settings
+ */
+class Smarty_Security {
+
+    /**
+     * This determines how Smarty handles "<?php ... ?>" tags in templates.
+     * possible values:
+     * <ul>
+     *   <li>Smarty::PHP_PASSTHRU -> echo PHP tags as they are</li>
+     *   <li>Smarty::PHP_QUOTE    -> escape tags as entities</li>
+     *   <li>Smarty::PHP_REMOVE   -> remove php tags</li>
+     *   <li>Smarty::PHP_ALLOW    -> execute php tags</li>
+     * </ul>
+     *
+     * @var integer
+     */
+    public $php_handling = Smarty::PHP_PASSTHRU;
+    /**
+     * This is the list of template directories that are considered secure.
+     * $template_dir is in this list implicitly.
+     *
+     * @var array
+     */
+    public $secure_dir = array();
+    /**
+     * This is an array of directories where trusted php scripts reside.
+     * {@link $security} is disabled during their inclusion/execution.
+     *
+     * @var array
+     */
+    public $trusted_dir = array();
+    /**
+     * List of regular expressions (PCRE) that include trusted URIs
+     *
+     * @var array
+     */
+    public $trusted_uri = array();
+    /**
+     * This is an array of trusted static classes.
+     *
+     * If empty access to all static classes is allowed.
+     * If set to 'none' none is allowed.
+     * @var array
+     */
+    public $static_classes = array();
+    /**
+     * This is an array of trusted PHP functions.
+     *
+     * If empty all functions are allowed.
+     * To disable all PHP functions set $php_functions = null.
+     * @var array
+     */
+    public $php_functions = array(
+        'isset', 'empty',
+        'count', 'sizeof',
+        'in_array', 'is_array',
+        'time',
+        'nl2br',
+    );
+    /**
+     * This is an array of trusted PHP modifers.
+     *
+     * If empty all modifiers are allowed.
+     * To disable all modifier set $modifiers = null.
+     * @var array
+     */
+    public $php_modifiers = array(
+        'escape',
+        'count'
+    );
+    /**
+     * This is an array of allowed tags.
+     *
+     * If empty no restriction by allowed_tags.
+     * @var array
+     */
+    public $allowed_tags = array();
+    /**
+     * This is an array of disabled tags.
+     *
+     * If empty no restriction by disabled_tags.
+     * @var array
+     */
+    public $disabled_tags = array();
+    /**
+     * This is an array of allowed modifier plugins.
+     *
+     * If empty no restriction by allowed_modifiers.
+     * @var array
+     */
+    public $allowed_modifiers = array();
+    /**
+     * This is an array of disabled modifier plugins.
+     *
+     * If empty no restriction by disabled_modifiers.
+     * @var array
+     */
+    public $disabled_modifiers = array();
+    /**
+     * This is an array of trusted streams.
+     *
+     * If empty all streams are allowed.
+     * To disable all streams set $streams = null.
+     * @var array
+     */
+    public $streams = array('file');
+    /**
+     * + flag if constants can be accessed from template
+     * @var boolean
+     */
+    public $allow_constants = true;
+    /**
+     * + flag if super globals can be accessed from template
+     * @var boolean
+     */
+    public $allow_super_globals = true;
+
+    /**
+     * Cache for $resource_dir lookups
+     * @var array
+     */
+    protected $_resource_dir = null;
+    /**
+     * Cache for $template_dir lookups
+     * @var array
+     */
+    protected $_template_dir = null;
+    /**
+     * Cache for $config_dir lookups
+     * @var array
+     */
+    protected $_config_dir = null;
+    /**
+     * Cache for $secure_dir lookups
+     * @var array
+     */
+    protected $_secure_dir = null;
+    /**
+     * Cache for $php_resource_dir lookups
+     * @var array
+     */
+    protected $_php_resource_dir = null;
+    /**
+     * Cache for $trusted_dir lookups
+     * @var array
+     */
+    protected $_trusted_dir = null;
+    
+    
+    /**
+     * @param Smarty $smarty
+     */
+    public function __construct($smarty)
+    {
+        $this->smarty = $smarty;
+    }
+    
+    /**
+     * Check if PHP function is trusted.
+     *
+     * @param string $function_name
+     * @param object $compiler compiler object
+     * @return boolean true if function is trusted
+     * @throws SmartyCompilerException if php function is not trusted
+     */
+    public function isTrustedPhpFunction($function_name, $compiler)
+    {
+        if (isset($this->php_functions) && (empty($this->php_functions) || in_array($function_name, $this->php_functions))) {
+            return true;
+        }
+
+        $compiler->trigger_template_error("PHP function '{$function_name}' not allowed by security setting");
+        return false; // should not, but who knows what happens to the compiler in the future?
+    }
+
+    /**
+     * Check if static class is trusted.
+     *
+     * @param string $class_name
+     * @param object $compiler compiler object
+     * @return boolean true if class is trusted
+     * @throws SmartyCompilerException if static class is not trusted
+     */
+    public function isTrustedStaticClass($class_name, $compiler)
+    {
+        if (isset($this->static_classes) && (empty($this->static_classes) || in_array($class_name, $this->static_classes))) {
+            return true;
+        }
+
+        $compiler->trigger_template_error("access to static class '{$class_name}' not allowed by security setting");
+        return false; // should not, but who knows what happens to the compiler in the future?
+    }
+
+    /**
+     * Check if PHP modifier is trusted.
+     *
+     * @param string $modifier_name
+     * @param object $compiler compiler object
+     * @return boolean true if modifier is trusted
+     * @throws SmartyCompilerException if modifier is not trusted
+     */
+    public function isTrustedPhpModifier($modifier_name, $compiler)
+    {
+        if (isset($this->php_modifiers) && (empty($this->php_modifiers) || in_array($modifier_name, $this->php_modifiers))) {
+            return true;
+        }
+
+        $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting");
+        return false; // should not, but who knows what happens to the compiler in the future?
+    }
+
+    /**
+     * Check if tag is trusted.
+     *
+     * @param string $tag_name
+     * @param object $compiler compiler object
+     * @return boolean true if tag is trusted
+     * @throws SmartyCompilerException if modifier is not trusted
+     */
+    public function isTrustedTag($tag_name, $compiler)
+    {
+        // check for internal always required tags
+        if (in_array($tag_name, array('assign', 'call', 'private_filter', 'private_block_plugin', 'private_function_plugin', 'private_object_block_function',
+                    'private_object_function', 'private_registered_function', 'private_registered_block', 'private_special_variable', 'private_print_expression', 'private_modifier'))) {
+            return true;
+        }
+        // check security settings
+        if (empty($this->allowed_tags)) {
+            if (empty($this->disabled_tags) || !in_array($tag_name, $this->disabled_tags)) {
+                return true;
+            } else {
+                $compiler->trigger_template_error("tag '{$tag_name}' disabled by security setting", $compiler->lex->taglineno);
+            }
+        } else if (in_array($tag_name, $this->allowed_tags) && !in_array($tag_name, $this->disabled_tags)) {
+            return true;
+        } else {
+            $compiler->trigger_template_error("tag '{$tag_name}' not allowed by security setting", $compiler->lex->taglineno);
+        }
+        return false; // should not, but who knows what happens to the compiler in the future?
+    }
+
+    /**
+     * Check if modifier plugin is trusted.
+     *
+     * @param string $modifier_name
+     * @param object $compiler compiler object
+     * @return boolean true if tag is trusted
+     * @throws SmartyCompilerException if modifier is not trusted
+     */
+    public function isTrustedModifier($modifier_name, $compiler)
+    {
+        // check for internal always allowed modifier
+        if (in_array($modifier_name, array('default'))) {
+            return true;
+        }
+        // check security settings
+        if (empty($this->allowed_modifiers)) {
+            if (empty($this->disabled_modifiers) || !in_array($modifier_name, $this->disabled_modifiers)) {
+                return true;
+            } else {
+                $compiler->trigger_template_error("modifier '{$modifier_name}' disabled by security setting", $compiler->lex->taglineno);
+            }
+        } else if (in_array($modifier_name, $this->allowed_modifiers) && !in_array($modifier_name, $this->disabled_modifiers)) {
+            return true;
+        } else {
+            $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting", $compiler->lex->taglineno);
+        }
+        return false; // should not, but who knows what happens to the compiler in the future?
+    }
+
+    /**
+     * Check if stream is trusted.
+     *
+     * @param string $stream_name
+     * @return boolean true if stream is trusted
+     * @throws SmartyException if stream is not trusted
+     */
+    public function isTrustedStream($stream_name)
+    {
+        if (isset($this->streams) && (empty($this->streams) || in_array($stream_name, $this->streams))) {
+            return true;
+        }
+
+        throw new SmartyException("stream '{$stream_name}' not allowed by security setting");
+    }
+
+    /**
+     * Check if directory of file resource is trusted.
+     *
+     * @param string $filepath
+     * @return boolean true if directory is trusted
+     * @throws SmartyException if directory is not trusted
+     */
+    public function isTrustedResourceDir($filepath)
+    {
+        $_template = false;
+        $_config = false;
+        $_secure = false;
+
+        $_template_dir = $this->smarty->getTemplateDir();
+        $_config_dir = $this->smarty->getConfigDir();
+
+        // check if index is outdated
+        if ((!$this->_template_dir || $this->_template_dir !== $_template_dir)
+                || (!$this->_config_dir || $this->_config_dir !== $_config_dir)
+                || (!empty($this->secure_dir) && (!$this->_secure_dir || $this->_secure_dir !== $this->secure_dir))
+        ) {
+            $this->_resource_dir = array();
+            $_template = true;
+            $_config = true;
+            $_secure = !empty($this->secure_dir);
+        }
+
+        // rebuild template dir index
+        if ($_template) {
+            $this->_template_dir = $_template_dir;
+            foreach ($_template_dir as $directory) {
+                $directory = realpath($directory);
+                $this->_resource_dir[$directory] = true;
+            }
+        }
+
+        // rebuild config dir index
+        if ($_config) {
+            $this->_config_dir = $_config_dir;
+            foreach ($_config_dir as $directory) {
+                $directory = realpath($directory);
+                $this->_resource_dir[$directory] = true;
+            }
+        }
+
+        // rebuild secure dir index
+        if ($_secure) {
+            $this->_secure_dir = $this->secure_dir;
+            foreach ((array) $this->secure_dir as $directory) {
+                $directory = realpath($directory);
+                $this->_resource_dir[$directory] = true;
+            }
+        }
+
+        $_filepath = realpath($filepath);
+        $directory = dirname($_filepath);
+        $_directory = array();
+        while (true) {
+            // remember the directory to add it to _resource_dir in case we're successful
+            $_directory[$directory] = true;
+            // test if the directory is trusted
+            if (isset($this->_resource_dir[$directory])) {
+                // merge sub directories of current $directory into _resource_dir to speed up subsequent lookups
+                $this->_resource_dir = array_merge($this->_resource_dir, $_directory);
+                return true;
+            }
+            // abort if we've reached root
+            if (($pos = strrpos($directory, DS)) === false || !isset($directory[1])) {
+                break;
+            }
+            // bubble up one level
+            $directory = substr($directory, 0, $pos);
+        }
+
+        // give up
+        throw new SmartyException("directory '{$_filepath}' not allowed by security setting");
+    }
+    
+    /**
+     * Check if URI (e.g. {fetch} or {html_image}) is trusted
+     *
+     * To simplify things, isTrustedUri() resolves all input to "{$PROTOCOL}://{$HOSTNAME}".
+     * So "http://username:password@hello.world.example.org:8080/some-path?some=query-string"
+     * is reduced to "http://hello.world.example.org" prior to applying the patters from {@link $trusted_uri}.
+     * @param string $uri 
+     * @return boolean true if URI is trusted
+     * @throws SmartyException if URI is not trusted
+     * @uses $trusted_uri for list of patterns to match against $uri
+     */
+    public function isTrustedUri($uri)
+    {
+        $_uri = parse_url($uri);
+        if (!empty($_uri['scheme']) && !empty($_uri['host'])) {
+            $_uri = $_uri['scheme'] . '://' . $_uri['host'];
+            foreach ($this->trusted_uri as $pattern) {
+                if (preg_match($pattern, $_uri)) {
+                    return true;
+                }
+            }
+        }
+        
+        throw new SmartyException("URI '{$uri}' not allowed by security setting");
+    }
+    
+    /**
+     * Check if directory of file resource is trusted.
+     *
+     * @param string $filepath
+     * @return boolean true if directory is trusted
+     * @throws SmartyException if PHP directory is not trusted
+     */
+    public function isTrustedPHPDir($filepath)
+    {
+        if (empty($this->trusted_dir)) {
+            throw new SmartyException("directory '{$filepath}' not allowed by security setting (no trusted_dir specified)");
+        }
+
+        // check if index is outdated
+        if (!$this->_trusted_dir || $this->_trusted_dir !== $this->trusted_dir) {
+            $this->_php_resource_dir = array();
+
+            $this->_trusted_dir = $this->trusted_dir;
+            foreach ((array) $this->trusted_dir as $directory) {
+                $directory = realpath($directory);
+                $this->_php_resource_dir[$directory] = true;
+            }
+        }
+
+        $_filepath = realpath($filepath);
+        $directory = dirname($_filepath);
+        $_directory = array();
+        while (true) {
+            // remember the directory to add it to _resource_dir in case we're successful
+            $_directory[] = $directory;
+            // test if the directory is trusted
+            if (isset($this->_php_resource_dir[$directory])) {
+                // merge sub directories of current $directory into _resource_dir to speed up subsequent lookups
+                $this->_php_resource_dir = array_merge($this->_php_resource_dir, $_directory);
+                return true;
+            }
+            // abort if we've reached root
+            if (($pos = strrpos($directory, DS)) === false || !isset($directory[2])) {
+                break;
+            }
+            // bubble up one level
+            $directory = substr($directory, 0, $pos);
+        }
+
+        throw new SmartyException("directory '{$_filepath}' not allowed by security setting");
+    }
+
+}
+
+?>
\ No newline at end of file
index a2829a21c1cd12474a3bd9a4d433608746a702d4..f94fbc5d719b4e936d0e54224a8f9cfacef7e8da 100644 (file)
 \r
                        function rep(re, str) {\r
 \r
+\r
+s = s.replace(re,str);\r
+\r
                                //modify code to keep stuff intact within [code][/code] blocks\r
                                //Waitman Gobble NO WARRANTY\r
 \r
+/* This doesn't seem to work well with\r
+[code]line1\r
+line2[/code]\r
+commenting out for now\r
+*/\r
 \r
+/*\r
                                var o = new Array();\r
                                var x = s.split("[code]");\r
                                var i = 0;\r
@@ -71,7 +80,7 @@
                                }\r
 \r
                                s = o.join("[code]");\r
-\r
+*/\r
                        };\r
 \r
 \r
                        rep(/<blockquote[^>]*>/gi,"[quote]");\r
                        rep(/<\/blockquote>/gi,"[/quote]");\r
                        rep(/<hr \/>/gi,"[hr]");\r
-                       rep(/<br (.*?)\/>/gi,"\n\n");\r
-                       rep(/<br\/>/gi,"\n\n");\r
+                       rep(/<br (.*?)\/>/gi,"\n");\r
+                       rep(/<br\/>/gi,"\n");\r
                        rep(/<br>/gi,"\n");\r
                        rep(/<p>/gi,"");\r
                        rep(/<\/p>/gi,"\n");\r
 \r
                         function rep(re, str) {\r
 \r
+\r
                                 //modify code to keep stuff intact within [code][/code] blocks\r
                                 //Waitman Gobble NO WARRANTY\r
 \r
index a2829a21c1cd12474a3bd9a4d433608746a702d4..f94fbc5d719b4e936d0e54224a8f9cfacef7e8da 100644 (file)
 \r
                        function rep(re, str) {\r
 \r
+\r
+s = s.replace(re,str);\r
+\r
                                //modify code to keep stuff intact within [code][/code] blocks\r
                                //Waitman Gobble NO WARRANTY\r
 \r
+/* This doesn't seem to work well with\r
+[code]line1\r
+line2[/code]\r
+commenting out for now\r
+*/\r
 \r
+/*\r
                                var o = new Array();\r
                                var x = s.split("[code]");\r
                                var i = 0;\r
@@ -71,7 +80,7 @@
                                }\r
 \r
                                s = o.join("[code]");\r
-\r
+*/\r
                        };\r
 \r
 \r
                        rep(/<blockquote[^>]*>/gi,"[quote]");\r
                        rep(/<\/blockquote>/gi,"[/quote]");\r
                        rep(/<hr \/>/gi,"[hr]");\r
-                       rep(/<br (.*?)\/>/gi,"\n\n");\r
-                       rep(/<br\/>/gi,"\n\n");\r
+                       rep(/<br (.*?)\/>/gi,"\n");\r
+                       rep(/<br\/>/gi,"\n");\r
                        rep(/<br>/gi,"\n");\r
                        rep(/<p>/gi,"");\r
                        rep(/<\/p>/gi,"\n");\r
 \r
                         function rep(re, str) {\r
 \r
+\r
                                 //modify code to keep stuff intact within [code][/code] blocks\r
                                 //Waitman Gobble NO WARRANTY\r
 \r
index 56f88a489a71eade7a2365ead909fad332623cb5..c8ed7a53bb1ab91f5b05cf4c771a4968fa79a2d4 100644 (file)
@@ -183,13 +183,15 @@ function admin_page_summary(&$a) {
                Array( t('Normal Account'), 0),
                Array( t('Soapbox Account'), 0),
                Array( t('Community/Celebrity Account'), 0),
-               Array( t('Automatic Friend Account'), 0)
+               Array( t('Automatic Friend Account'), 0),
+               Array( t('Blog Account'), 0),
+               Array( t('Private Forum'), 0)
        );
 
        $users=0;
        foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+= $u['count']; }
 
-       logger('accounts: ' . print_r($accounts,true));
+       logger('accounts: ' . print_r($accounts,true),LOGGER_DATA);
 
        $r = q("SELECT COUNT(id) as `count` FROM `register`");
        $pending = $r[0]['count'];
diff --git a/mod/babel.php b/mod/babel.php
new file mode 100644 (file)
index 0000000..ca2c068
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+
+require_once('include/bbcode.php');
+require_once('library/markdown.php');
+require_once('include/bb2diaspora.php');
+require_once('include/html2bbcode.php');
+
+function visible_lf($s) {
+       return str_replace("\n",'<br />', $s);
+}
+
+function babel_content(&$a) {
+
+       $o .= '<h3>Babel Diagnostic</h3>';
+
+       $o .= '<form action="babel" method="post">';
+       $o .= t('Source (bbcode) text:') . EOL . '<textarea name="text" >' . htmlspecialchars($_REQUEST['text']) .'</textarea>' . EOL;
+       $o .= '<input type="submit" name="submit" value="Submit" /></form>'; 
+
+       $o .= '<br /><br />';
+
+       $o .= '<form action="babel" method="post">';
+       $o .= t('Source (Diaspora) text to convert to BBcode:') . EOL . '<textarea name="d2bbtext" >' . htmlspecialchars($_REQUEST['d2bbtext']) .'</textarea>' . EOL;
+       $o .= '<input type="submit" name="submit" value="Submit" /></form>'; 
+
+       $o .= '<br /><br />';
+
+       if(x($_REQUEST,'text')) {
+
+               $text = trim($_REQUEST['text']);
+               $o .= t("Source input: ") . EOL. EOL; 
+               $o .= visible_lf($text) . EOL. EOL; 
+
+               $html = bbcode($text);
+               $o .= t("bb2html: ") . EOL. EOL; 
+               $o .= $html. EOL. EOL; 
+
+               $bbcode = html2bbcode($html);
+               $o .= t("bb2html2bb: ") . EOL. EOL; 
+               $o .= visible_lf($bbcode) . EOL. EOL; 
+
+               $diaspora = bb2diaspora($text);
+               $o .= t("bb2md: ") . EOL. EOL; 
+               $o .= visible_lf($diaspora) . EOL. EOL; 
+
+               $html = Markdown($diaspora);
+               $o .= t("bb2md2html: ") . EOL. EOL; 
+               $o .= $html. EOL. EOL; 
+
+               $bbcode = diaspora2bb($diaspora);
+               $o .= t("bb2dia2bb: ") . EOL. EOL; 
+               $o .= visible_lf($bbcode) . EOL. EOL; 
+
+               $bbcode = html2bbcode($html);
+               $o .= t("bb2md2html2bb: ") . EOL. EOL; 
+               $o .= visible_lf($bbcode) . EOL. EOL; 
+
+
+
+       }
+
+       if(x($_REQUEST,'d2bbtext')) {
+
+               $d2bbtext = trim($_REQUEST['d2bbtext']);
+               $o .= t("Source input (Diaspora format): ") . EOL. EOL; 
+               $o .= visible_lf($d2bbtext) . EOL. EOL; 
+
+
+               $bb = diaspora2bb($d2bbtext);
+               $o .= t("diaspora2bb: ") . EOL. EOL; 
+               $o .= visible_lf($bb) . EOL. EOL; 
+       }
+
+       return $o;
+}
diff --git a/mod/content.php b/mod/content.php
new file mode 100644 (file)
index 0000000..5f3e954
--- /dev/null
@@ -0,0 +1,858 @@
+<?php
+
+// This is a purely experimental module and is not yet generally useful.
+
+// The eventual goal is to provide a json backend to fetch content and fill the current page.
+// The page will be filled in on the frontend using javascript.
+// At the present time this page is based on "network", but the hope is to extend to serving
+// any content (wall, community, search, etc.).
+// All search parameters, etc. will be managed in javascript and sent as request params.
+// Security will be managed on the backend.
+// There is no "pagination query", but we will manage the "current page" on the client
+// and provide a link to fetch the next page - until there are no pages left to fetch.
+
+// With the exception of complex tag and text searches, this prototype is incredibly 
+// fast - e.g. one or two milliseconds to fetch parent items for the current content, 
+// and 10-20 milliseconds to fetch all the child items.
+
+
+function content_content(&$a, $update = 0) {
+
+       require_once('include/conversation.php');
+
+
+       // Currently security is based on the logged in user
+
+       if(! local_user()) {
+               return;
+       }
+
+       $arr = array('query' => $a->query_string);
+
+       call_hooks('content_content_init', $arr);
+
+
+       $datequery = $datequery2 = '';
+
+       $group = 0;
+
+       $nouveau = false;
+
+       if($a->argc > 1) {
+               for($x = 1; $x < $a->argc; $x ++) {
+                       if(is_a_date_arg($a->argv[$x])) {
+                               if($datequery)
+                                       $datequery2 = escape_tags($a->argv[$x]);
+                               else {
+                                       $datequery = escape_tags($a->argv[$x]);
+                                       $_GET['order'] = 'post';
+                               }
+                       }
+                       elseif($a->argv[$x] === 'new') {
+                               $nouveau = true;
+                       }
+                       elseif(intval($a->argv[$x])) {
+                               $group = intval($a->argv[$x]);
+                               $def_acl = array('allow_gid' => '<' . $group . '>');
+                       }
+               }
+       }
+
+
+       $o = '';
+
+       
+
+       $contact_id = $a->cid;
+
+       require_once('include/acl_selectors.php');
+
+       $cid = ((x($_GET,'cid')) ? intval($_GET['cid']) : 0);
+       $star = ((x($_GET,'star')) ? intval($_GET['star']) : 0);
+       $bmark = ((x($_GET,'bmark')) ? intval($_GET['bmark']) : 0);
+       $order = ((x($_GET,'order')) ? notags($_GET['order']) : 'comment');
+       $liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0);
+       $conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0);
+       $spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0);
+       $nets = ((x($_GET,'nets')) ? $_GET['nets'] : '');
+       $cmin = ((x($_GET,'cmin')) ? intval($_GET['cmin']) : 0);
+       $cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99);
+       $file = ((x($_GET,'file')) ? $_GET['file'] : '');
+
+
+
+       if(x($_GET,'search') || x($_GET,'file'))
+               $nouveau = true;
+       if($cid)
+               $def_acl = array('allow_cid' => '<' . intval($cid) . '>');
+
+       if($nets) {
+               $r = q("select id from contact where uid = %d and network = '%s' and self = 0",
+                       intval(local_user()),
+                       dbesc($nets)
+               );
+
+               $str = '';
+               if(count($r))
+                       foreach($r as $rr)
+                               $str .= '<' . $rr['id'] . '>';
+               if(strlen($str))
+                       $def_acl = array('allow_cid' => $str);
+       }
+
+       
+       $sql_options  = (($star) ? " and starred = 1 " : '');
+       $sql_options .= (($bmark) ? " and bookmark = 1 " : '');
+
+       $sql_nets = (($nets) ? sprintf(" and `contact`.`network` = '%s' ", dbesc($nets)) : '');
+
+       $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $sql_options ) ";
+
+       if($group) {
+               $r = q("SELECT `name`, `id` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
+                       intval($group),
+                       intval($_SESSION['uid'])
+               );
+               if(! count($r)) {
+                       if($update)
+                               killme();
+                       notice( t('No such group') . EOL );
+                       goaway($a->get_baseurl(true) . '/network');
+                       // NOTREACHED
+               }
+
+               $contacts = expand_groups(array($group));
+               if((is_array($contacts)) && count($contacts)) {
+                       $contact_str = implode(',',$contacts);
+               }
+               else {
+                               $contact_str = ' 0 ';
+                               info( t('Group is empty'));
+               }
+
+               $sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $sql_options AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` like '" . protect_sprintf('%<' . intval($group) . '>%') . "' ) and deleted = 0 ) ";
+               $o = '<h2>' . t('Group: ') . $r[0]['name'] . '</h2>' . $o;
+       }
+       elseif($cid) {
+
+               $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d 
+                               AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
+                       intval($cid)
+               );
+               if(count($r)) {
+                       $sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $sql_options AND `contact-id` = " . intval($cid) . " and deleted = 0 ) ";
+
+               }
+               else {
+                       killme();
+               }
+       }
+
+
+       $sql_extra3 = '';
+
+       if($datequery) {
+               $sql_extra3 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery))));
+       }
+       if($datequery2) {
+               $sql_extra3 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
+       }
+
+       $sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` ");
+       $sql_extra3 = (($nouveau) ? '' : $sql_extra3);
+
+       if(x($_GET,'search')) {
+               $search = escape_tags($_GET['search']);
+               if (get_config('system','use_fulltext_engine')) {
+                       if(strpos($search,'#') === 0)
+                               $sql_extra .= sprintf(" AND (MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode)) ",
+                                       dbesc(protect_sprintf($search))
+                               );
+                       else
+                               $sql_extra .= sprintf(" AND (MATCH(`item`.`body`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode)) ",
+                                       dbesc(protect_sprintf($search)),
+                                       dbesc(protect_sprintf($search))
+                               );
+               } else {
+                       $sql_extra .= sprintf(" AND ( `item`.`body` like '%s' OR `item`.`tag` like '%s' ) ",
+                                       dbesc(protect_sprintf('%' . $search . '%')),
+                                       dbesc(protect_sprintf('%]' . $search . '[%'))
+                       );
+               }
+       }
+       if(strlen($file)) {
+               $sql_extra .= file_tag_file_query('item',unxmlify($file));
+       }
+
+       if($conv) {
+               $myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
+               $myurl = substr($myurl,strpos($myurl,'://')+3);
+               $myurl = str_replace('www.','',$myurl);
+               $diasp_url = str_replace('/profile/','/u/',$myurl);
+               if (get_config('system','use_fulltext_engine'))
+                       $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where (MATCH(`author-link`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(`tag`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode))) ",
+                               dbesc(protect_sprintf($myurl)),
+                               dbesc(protect_sprintf($myurl)),
+                               dbesc(protect_sprintf($diasp_url))
+                       );
+               else
+                       $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ",
+                               dbesc(protect_sprintf('%' . $myurl)),
+                               dbesc(protect_sprintf('%' . $myurl . ']%')),
+                               dbesc(protect_sprintf('%' . $diasp_url . ']%'))
+                       );
+
+       }
+
+       $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
+
+
+
+
+       if($nouveau) {
+               // "New Item View" - show all items unthreaded in reverse created date order
+
+               $items = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
+                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`,
+                       `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
+                       `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+                       FROM `item`, `contact`
+                       WHERE `item`.`uid` = %d AND `item`.`visible` = 1 
+                       AND `item`.`deleted` = 0 and `item`.`moderated` = 0
+                       $simple_update
+                       AND `contact`.`id` = `item`.`contact-id`
+                       AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+                       $sql_extra $sql_nets
+                       ORDER BY `item`.`received` DESC $pager_sql ",
+                       intval($_SESSION['uid'])
+               );
+
+       }
+       else {
+
+               // Normal conversation view
+
+
+               if($order === 'post')
+                               $ordering = "`created`";
+               else
+                               $ordering = "`commented`";
+
+               $start = dba_timer();
+
+               $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid`
+                       FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+                       WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+                       AND `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+                       AND `item`.`parent` = `item`.`id`
+                       $sql_extra3 $sql_extra $sql_nets
+                       ORDER BY `item`.$ordering DESC $pager_sql ",
+                       intval(local_user())
+               );
+
+               $first = dba_timer();
+
+
+               // Then fetch all the children of the parents that are on this page
+
+               $parents_arr = array();
+               $parents_str = '';
+
+               if(count($r)) {
+                       foreach($r as $rr)
+                               if(! in_array($rr['item_id'],$parents_arr))
+                                       $parents_arr[] = $rr['item_id'];
+                       $parents_str = implode(', ', $parents_arr);
+
+                       $items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+                               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`writable`,
+                               `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
+                               `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+                               FROM `item`, `contact`
+                               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+                               AND `item`.`moderated` = 0 AND `contact`.`id` = `item`.`contact-id`
+                               AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+                               AND `item`.`parent` IN ( %s )
+                               $sql_extra ",
+                               intval(local_user()),
+                               dbesc($parents_str)
+                       );
+
+                       $second = dba_timer();
+
+                       $items = conv_sort($items,$ordering);
+
+               } else {
+                       $items = array();
+               }
+       }
+
+       
+       logger('parent dba_timer: ' . sprintf('%01.4f',$first - $start));
+       logger('child  dba_timer: ' . sprintf('%01.4f',$second - $first));
+
+       // Set this so that the conversation function can find out contact info for our wall-wall items
+       $a->page_contact = $a->contact;
+
+       $mode = (($nouveau) ? 'network-new' : 'network');
+
+       $o = render_content($a,$items,$mode,false);
+
+       
+       header('Content-type: application/json');
+       echo json_encode($o);
+       killme();
+}
+
+
+
+function render_content(&$a, $items, $mode, $update, $preview = false) {
+
+
+       require_once('bbcode.php');
+
+       $ssl_state = ((local_user()) ? true : false);
+
+       $profile_owner = 0;
+       $page_writeable      = false;
+
+       $previewing = (($preview) ? ' preview ' : '');
+
+       if($mode === 'network') {
+               $profile_owner = local_user();
+               $page_writeable = true;
+       }
+
+       if($mode === 'profile') {
+               $profile_owner = $a->profile['profile_uid'];
+               $page_writeable = can_write_wall($a,$profile_owner);
+       }
+
+       if($mode === 'notes') {
+               $profile_owner = local_user();
+               $page_writeable = true;
+       }
+
+       if($mode === 'display') {
+               $profile_owner = $a->profile['uid'];
+               $page_writeable = can_write_wall($a,$profile_owner);
+       }
+
+       if($mode === 'community') {
+               $profile_owner = 0;
+               $page_writeable = false;
+       }
+
+       if($update)
+               $return_url = $_SESSION['return_url'];
+       else
+               $return_url = $_SESSION['return_url'] = $a->query_string;
+
+       load_contact_links(local_user());
+
+       $cb = array('items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview);
+       call_hooks('conversation_start',$cb);
+
+       $items = $cb['items'];
+
+       $cmnt_tpl    = get_markup_template('comment_item.tpl');
+       $tpl         = 'wall_item.tpl';
+       $wallwall    = 'wallwall_item.tpl';
+       $hide_comments_tpl = get_markup_template('hide_comments.tpl');
+
+       $alike = array();
+       $dlike = array();
+       
+       
+       // array with html for each thread (parent+comments)
+       $threads = array();
+       $threadsid = -1;
+       
+       if($items && count($items)) {
+
+               if($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
+
+                       // "New Item View" on network page or search page results 
+                       // - just loop through the items and format them minimally for display
+
+                       //$tpl = get_markup_template('search_item.tpl');
+                       $tpl = 'search_item.tpl';
+
+                       foreach($items as $item) {
+                               $threadsid++;
+
+                               $comment     = '';
+                               $owner_url   = '';
+                               $owner_photo = '';
+                               $owner_name  = '';
+                               $sparkle     = '';
+
+                               if($mode === 'search' || $mode === 'community') {
+                                       if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) 
+                                               && ($item['id'] != $item['parent']))
+                                               continue;
+                                       $nickname = $item['nickname'];
+                               }
+                               else
+                                       $nickname = $a->user['nickname'];
+                               
+                               // prevent private email from leaking.
+                               if($item['network'] === NETWORK_MAIL && local_user() != $item['uid'])
+                                               continue;
+                       
+                               $profile_name   = ((strlen($item['author-name']))   ? $item['author-name']   : $item['name']);
+                               if($item['author-link'] && (! $item['author-name']))
+                                       $profile_name = $item['author-link'];
+
+
+
+                               $sp = false;
+                               $profile_link = best_link_url($item,$sp);
+                               if($profile_link === 'mailbox')
+                                       $profile_link = '';
+                               if($sp)
+                                       $sparkle = ' sparkle';
+                               else
+                                       $profile_link = zrl($profile_link);                                     
+
+                               $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
+                               if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
+                                       $profile_avatar = $a->contacts[$normalised]['thumb'];
+                               else
+                                       $profile_avatar = ((strlen($item['author-avatar'])) ? $a->get_cached_avatar_image($item['author-avatar']) : $item['thumb']);
+
+                               $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
+                               call_hooks('render_location',$locate);
+
+                               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
+
+                               localize_item($item);
+                               if($mode === 'network-new')
+                                       $dropping = true;
+                               else
+                                       $dropping = false;
+
+
+                               $drop = array(
+                                       'dropping' => $dropping,
+                                       'select' => t('Select'), 
+                                       'delete' => t('Delete'),
+                               );
+
+                               $star = false;
+                               $isstarred = "unstarred";
+                               
+                               $lock = false;
+                               $likebuttons = false;
+                               $shareable = false;
+
+                               $body = prepare_body($item,true);
+                               
+                               //$tmp_item = replace_macros($tpl,array(
+                               $tmp_item = array(
+                                       'template' => $tpl,
+                                       'id' => (($preview) ? 'P0' : $item['item_id']),
+                                       'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
+                                       'profile_url' => $profile_link,
+                                       'item_photo_menu' => item_photo_menu($item),
+                                       'name' => template_escape($profile_name),
+                                       'sparkle' => $sparkle,
+                                       'lock' => $lock,
+                                       'thumb' => $profile_avatar,
+                                       'title' => template_escape($item['title']),
+                                       'body' => template_escape($body),
+                                       'text' => strip_tags(template_escape($body)),
+                                       'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
+                                       'location' => template_escape($location),
+                                       'indent' => '',
+                                       'owner_name' => template_escape($owner_name),
+                                       'owner_url' => $owner_url,
+                                       'owner_photo' => $owner_photo,
+                                       'plink' => get_plink($item),
+                                       'edpost' => false,
+                                       'isstarred' => $isstarred,
+                                       'star' => $star,
+                                       'drop' => $drop,
+                                       'vote' => $likebuttons,
+                                       'like' => '',
+                                       'dislike' => '',
+                                       'comment' => '',
+                                       'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
+                                       'previewing' => $previewing,
+                                       'wait' => t('Please wait'),
+                               );
+
+                               $arr = array('item' => $item, 'output' => $tmp_item);
+                               call_hooks('display_item', $arr);
+
+                               $threads[$threadsid]['id'] = $item['item_id'];
+                               $threads[$threadsid]['items'] = array($arr['output']);
+
+                       }
+
+               }
+               else
+               {
+                       // Normal View
+
+
+                       // Figure out how many comments each parent has
+                       // (Comments all have gravity of 6)
+                       // Store the result in the $comments array
+
+                       $comments = array();
+                       foreach($items as $item) {
+                               if((intval($item['gravity']) == 6) && ($item['id'] != $item['parent'])) {
+                                       if(! x($comments,$item['parent']))
+                                               $comments[$item['parent']] = 1;
+                                       else
+                                               $comments[$item['parent']] += 1;
+                               } elseif(! x($comments,$item['parent'])) 
+                                       $comments[$item['parent']] = 0; // avoid notices later on
+                       }
+
+                       // map all the like/dislike activities for each parent item 
+                       // Store these in the $alike and $dlike arrays
+
+                       foreach($items as $item) {
+                               like_puller($a,$item,$alike,'like');
+                               like_puller($a,$item,$dlike,'dislike');
+                       }
+
+                       $comments_collapsed = false;
+                       $comments_seen = 0;
+                       $comment_lastcollapsed = false;
+                       $comment_firstcollapsed = false;
+                       $blowhard = 0;
+                       $blowhard_count = 0;
+
+
+                       foreach($items as $item) {
+
+                               $comment = '';
+                               $template = $tpl;
+                               $commentww = '';
+                               $sparkle = '';
+                               $owner_url = $owner_photo = $owner_name = '';
+
+                               // We've already parsed out like/dislike for special treatment. We can ignore them now
+
+                               if(((activity_match($item['verb'],ACTIVITY_LIKE)) 
+                                       || (activity_match($item['verb'],ACTIVITY_DISLIKE))) 
+                                       && ($item['id'] != $item['parent']))
+                                       continue;
+
+                               $toplevelpost = (($item['id'] == $item['parent']) ? true : false);
+
+
+                               // Take care of author collapsing and comment collapsing
+                               // (author collapsing is currently disabled)
+                               // If a single author has more than 3 consecutive top-level posts, squash the remaining ones.
+                               // If there are more than two comments, squash all but the last 2.
+                       
+                               if($toplevelpost) {
+
+                                       $item_writeable = (($item['writable'] || $item['self']) ? true : false);
+
+                                       $comments_seen = 0;
+                                       $comments_collapsed = false;
+                                       $comment_lastcollapsed  = false;
+                                       $comment_firstcollapsed = false;
+                                       
+                                       $threadsid++;
+                                       $threads[$threadsid]['id'] = $item['item_id'];
+                                       $threads[$threadsid]['private'] = $item['private'];
+                                       $threads[$threadsid]['items'] = array();
+
+                               }
+                               else {
+
+                                       // prevent private email reply to public conversation from leaking.
+                                       if($item['network'] === NETWORK_MAIL && local_user() != $item['uid'])
+                                                       continue;
+
+                                       $comments_seen ++;
+                                       $comment_lastcollapsed  = false;
+                                       $comment_firstcollapsed = false;
+                               }       
+
+                               $override_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
+                               $show_comment_box = ((($page_writeable) && ($item_writeable) && ($comments_seen == $comments[$item['parent']])) ? true : false);
+
+
+                               if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
+
+                                       if (!$comments_collapsed){
+                                               $threads[$threadsid]['num_comments'] = sprintf( tt('%d comment','%d comments',$comments[$item['parent']]),$comments[$item['parent']] );
+                                               $threads[$threadsid]['hide_text'] = t('show more');
+                                               $comments_collapsed = true;
+                                               $comment_firstcollapsed = true;
+                                       }
+                               }
+                               if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) {
+
+                                       $comment_lastcollapsed = true;
+                               }
+
+                               $redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $item['cid'] ;
+
+                               $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
+                                       || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
+                                       ? t('Private Message')
+                                       : false);
+
+
+                               // Top-level wall post not written by the wall owner (wall-to-wall)
+                               // First figure out who owns it. 
+
+                               $osparkle = '';
+
+                               if(($toplevelpost) && (! $item['self']) && ($mode !== 'profile')) {
+
+                                       if($item['wall']) {
+
+                                               // On the network page, I am the owner. On the display page it will be the profile owner.
+                                               // This will have been stored in $a->page_contact by our calling page.
+                                               // Put this person as the wall owner of the wall-to-wall notice.
+
+                                               $owner_url = zrl($a->page_contact['url']);
+                                               $owner_photo = $a->page_contact['thumb'];
+                                               $owner_name = $a->page_contact['name'];
+                                               $template = $wallwall;
+                                               $commentww = 'ww';      
+                                       }
+
+                                       if((! $item['wall']) && $item['owner-link']) {
+
+                                               $owner_linkmatch = (($item['owner-link']) && link_compare($item['owner-link'],$item['author-link']));
+                                               $alias_linkmatch = (($item['alias']) && link_compare($item['alias'],$item['author-link']));
+                                               $owner_namematch = (($item['owner-name']) && $item['owner-name'] == $item['author-name']);
+                                               if((! $owner_linkmatch) && (! $alias_linkmatch) && (! $owner_namematch)) {
+
+                                                       // The author url doesn't match the owner (typically the contact)
+                                                       // and also doesn't match the contact alias. 
+                                                       // The name match is a hack to catch several weird cases where URLs are 
+                                                       // all over the park. It can be tricked, but this prevents you from
+                                                       // seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
+                                                       // well that it's the same Bob Smith. 
+
+                                                       // But it could be somebody else with the same name. It just isn't highly likely. 
+                                                       
+
+                                                       $owner_url = $item['owner-link'];
+                                                       $owner_photo = $item['owner-avatar'];
+                                                       $owner_name = $item['owner-name'];
+                                                       $template = $wallwall;
+                                                       $commentww = 'ww';
+                                                       // If it is our contact, use a friendly redirect link
+                                                       if((link_compare($item['owner-link'],$item['url'])) 
+                                                               && ($item['network'] === NETWORK_DFRN)) {
+                                                               $owner_url = $redirect_url;
+                                                               $osparkle = ' sparkle';
+                                                       }
+                                                       else
+                                                               $owner_url = zrl($owner_url);
+                                               }
+                                       }
+                               }
+
+                               $likebuttons = '';
+                               $shareable = ((($profile_owner == local_user()) && ($item['private'] != 1)) ? true : false); 
+
+                               if($page_writeable) {
+/*                                     if($toplevelpost) {  */
+                                               $likebuttons = array(
+                                                       'like' => array( t("I like this \x28toggle\x29"), t("like")),
+                                                       'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")),
+                                               );
+                                               if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
+/*                                     } */
+
+                                       $qc = $qcomment =  null;
+
+                                       if(in_array('qcomment',$a->plugins)) {
+                                               $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
+                                               $qcomment = (($qc) ? explode("\n",$qc) : null);
+                                       }
+
+                                       if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
+                                               $comment = replace_macros($cmnt_tpl,array(
+                                                       '$return_path' => '', 
+                                                       '$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
+                                                       '$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
+                                                       '$id' => $item['item_id'],
+                                                       '$parent' => $item['parent'],
+                                                       '$qcomment' => $qcomment,
+                                                       '$profile_uid' =>  $profile_owner,
+                                                       '$mylink' => $a->contact['url'],
+                                                       '$mytitle' => t('This is you'),
+                                                       '$myphoto' => $a->contact['thumb'],
+                                                       '$comment' => t('Comment'),
+                                                       '$submit' => t('Submit'),
+                                                       '$edbold' => t('Bold'),
+                                                       '$editalic' => t('Italic'),
+                                                       '$eduline' => t('Underline'),
+                                                       '$edquote' => t('Quote'),
+                                                       '$edcode' => t('Code'),
+                                                       '$edimg' => t('Image'),
+                                                       '$edurl' => t('Link'),
+                                                       '$edvideo' => t('Video'),
+                                                       '$preview' => t('Preview'),
+                                                       '$ww' => (($mode === 'network') ? $commentww : '')
+                                               ));
+                                       }
+                               }
+
+                               if(local_user() && link_compare($a->contact['url'],$item['author-link']))
+                                       $edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"));
+                               else
+                                       $edpost = false;
+
+                               $drop = '';
+                               $dropping = false;
+
+                               if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user()))
+                                       $dropping = true;
+
+                               $drop = array(
+                                       'dropping' => $dropping,
+                                       'select' => t('Select'), 
+                                       'delete' => t('Delete'),
+                               );
+
+                               $star = false;
+                               $filer = false;
+
+                               $isstarred = "unstarred";
+                               if ($profile_owner == local_user()) {
+                                       if($toplevelpost) {
+                                               $isstarred = (($item['starred']) ? "starred" : "unstarred");
+
+                                               $star = array(
+                                                       'do' => t("add star"),
+                                                       'undo' => t("remove star"),
+                                                       'toggle' => t("toggle star status"),
+                                                       'classdo' => (($item['starred']) ? "hidden" : ""),
+                                                       'classundo' => (($item['starred']) ? "" : "hidden"),
+                                                       'starred' =>  t('starred'),
+                                                       'tagger' => t("add tag"),
+                                                       'classtagger' => "",
+                                               );
+                                       }
+                                       $filer = t("save to folder");
+                               }
+
+
+                               $photo = $item['photo'];
+                               $thumb = $item['thumb'];
+
+                               // Post was remotely authored.
+
+                               $diff_author    = ((link_compare($item['url'],$item['author-link'])) ? false : true);
+
+                               $profile_name   = (((strlen($item['author-name']))   && $diff_author) ? $item['author-name']   : $item['name']);
+
+                               if($item['author-link'] && (! $item['author-name']))
+                                       $profile_name = $item['author-link'];
+
+                               $sp = false;
+                               $profile_link = best_link_url($item,$sp);
+                               if($profile_link === 'mailbox')
+                                       $profile_link = '';
+                               if($sp)
+                                       $sparkle = ' sparkle';
+                               else
+                                       $profile_link = zrl($profile_link);                                     
+
+                               $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
+                               if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
+                                       $profile_avatar = $a->contacts[$normalised]['thumb'];
+                               else
+                                       $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb));
+
+                               $like    = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
+                               $dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
+
+                               $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
+                               call_hooks('render_location',$locate);
+
+                               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
+
+                               $indent = (($toplevelpost) ? '' : ' comment');
+
+                               if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
+                                       $indent .= ' shiny'; 
+
+                               // 
+                               localize_item($item);
+
+
+                               $tags=array();
+                               foreach(explode(',',$item['tag']) as $tag){
+                                       $tag = trim($tag);
+                                       if ($tag!="") $tags[] = bbcode($tag);
+                               }
+
+                               // Build the HTML
+
+                               $body = prepare_body($item,true);
+                               //$tmp_item = replace_macros($template,
+                               $tmp_item = array(
+                                       // collapse comments in template. I don't like this much...
+                                       'comment_firstcollapsed' => $comment_firstcollapsed,
+                                       'comment_lastcollapsed' => $comment_lastcollapsed,
+                                       // template to use to render item (wall, walltowall, search)
+                                       'template' => $template,
+                                       
+                                       'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
+                                       'tags' => $tags,
+                                       'body' => template_escape($body),
+                                       'text' => strip_tags(template_escape($body)),
+                                       'id' => $item['item_id'],
+                                       'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
+                                       'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
+                                       'to' => t('to'),
+                                       'wall' => t('Wall-to-Wall'),
+                                       'vwall' => t('via Wall-To-Wall:'),
+                                       'profile_url' => $profile_link,
+                                       'item_photo_menu' => item_photo_menu($item),
+                                       'name' => template_escape($profile_name),
+                                       'thumb' => $profile_avatar,
+                                       'osparkle' => $osparkle,
+                                       'sparkle' => $sparkle,
+                                       'title' => template_escape($item['title']),
+                                       'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
+                                       'lock' => $lock,
+                                       'location' => template_escape($location),
+                                       'indent' => $indent,
+                                       'owner_url' => $owner_url,
+                                       'owner_photo' => $owner_photo,
+                                       'owner_name' => template_escape($owner_name),
+                                       'plink' => get_plink($item),
+                                       'edpost' => $edpost,
+                                       'isstarred' => $isstarred,
+                                       'star' => $star,
+                                       'filer' => $filer,
+                                       'drop' => $drop,
+                                       'vote' => $likebuttons,
+                                       'like' => $like,
+                                       'dislike' => $dislike,
+                                       'comment' => $comment,
+                                       'previewing' => $previewing,
+                                       'wait' => t('Please wait'),
+
+                               );
+
+
+                               $arr = array('item' => $item, 'output' => $tmp_item);
+                               call_hooks('display_item', $arr);
+
+                               $threads[$threadsid]['items'][] = $arr['output'];
+                       }
+               }
+       }
+
+
+       return $threads;
+
+}
index 930a575b6698095a0f5bfea371e24855c73721f9..8a5685c9a5b34dfb5235bfbdc378839996a89a32 100644 (file)
@@ -73,14 +73,12 @@ function directory_content(&$a) {
        $order = " ORDER BY `name` ASC "; 
 
 
-       $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
+       $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
                intval($a->pager['start']),
                intval($a->pager['itemspage'])
        );
        if(count($r)) {
 
-               $tpl = get_markup_template('directory_item.tpl');
-
                if(in_array('small', $a->argv))
                        $photo = 'thumb';
                else
@@ -113,20 +111,60 @@ function directory_content(&$a) {
                        if(strlen($rr['gender']))
                                $details .= '<br />' . t('Gender: ') . $rr['gender'];
 
+                       if($rr['page-flags'] == PAGE_NORMAL)
+                               $page_type = "Personal Profile";
+                       if($rr['page-flags'] == PAGE_SOAPBOX)
+                               $page_type = "Fan Page";
+                       if($rr['page-flags'] == PAGE_COMMUNITY)
+                               $page_type = "Community Forum";
+                       if($rr['page-flags'] == PAGE_FREELOVE)
+                               $page_type = "Open Forum";
+                       if($rr['page-flags'] == PAGE_PRVGROUP)
+                               $page_type = "Private Group";
+
+                       $profile = $rr;
+
+                       if((x($profile,'address') == 1)
+                               || (x($profile,'locality') == 1)
+                               || (x($profile,'region') == 1)
+                               || (x($profile,'postal-code') == 1)
+                               || (x($profile,'country-name') == 1))
+                       $location = t('Location:');
+
+                       $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False);
+
+                       $marital = ((x($profile,'marital') == 1) ?  t('Status:') : False);
+
+                       $homepage = ((x($profile,'homepage') == 1) ?  t('Homepage:') : False);
+
+                       $about = ((x($profile,'about') == 1) ?  t('About:') : False);
+                       
+                       $tpl = get_markup_template('directory_item.tpl');
+
                        $entry = replace_macros($tpl,array(
                                '$id' => $rr['id'],
                                '$profile-link' => $profile_link,
                                '$photo' => $a->get_cached_avatar_image($rr[$photo]),
                                '$alt-text' => $rr['name'],
                                '$name' => $rr['name'],
-                               '$details' => $pdesc . $details  
-
+                               '$details' => $pdesc . $details,
+                               '$page-type' => $page_type,
+                               '$profile' => $profile,
+                               '$location' => template_escape($location),
+                               '$gender'   => $gender,
+                               '$pdesc'        => $pdesc,
+                               '$marital'  => $marital,
+                               '$homepage' => $homepage,
+                               '$about' => $about,
 
                        ));
 
                        $arr = array('contact' => $rr, 'entry' => $entry);
 
                        call_hooks('directory_item', $arr);
+                       
+                       unset($profile);
+                       unset($location);
 
                        $o .= $entry;
 
index 7940e79a420a6056ea9070010bdd93cc95745790..bf02f83099f8a96d74b1961ca9fe79732be6da74 100755 (executable)
@@ -280,10 +280,10 @@ function events_content(&$a) {
                                        
                                $last_date = $d;
                                $edit = ((! $rr['cid']) ? array($a->get_baseurl().'/events/event/'.$rr['id'],t('Edit event'),'','') : null);
-                               $title = strip_tags(bbcode($rr['summary']));
+                               $title = strip_tags(html_entity_decode(bbcode($rr['summary']),ENT_QUOTES,'UTF-8'));
                                if(! $title) {
                                        list($title, $_trash) = explode("<br",bbcode($rr['desc']),2);
-                                       $title = strip_tags($title);
+                                       $title = strip_tags(html_entity_decode($title,ENT_QUOTES,'UTF-8'));
                                }
                                $html = format_event_html($rr);
                                $rr['desc'] = bbcode($rr['desc']);
index 554e97fe46a0d595b2df122a3c32b5c3f4830865..b4e894337e3c9073c00507d45491cac7583a1411 100644 (file)
@@ -18,6 +18,7 @@
 require_once('include/crypto.php');
 require_once('include/enotify.php');
 require_once('include/email.php');
+require_once('Text/LanguageDetect.php');
 
 function item_post(&$a) {
 
@@ -216,6 +217,15 @@ function item_post(&$a) {
                $emailcc           = notags(trim($_REQUEST['emailcc']));
                $body              = escape_tags(trim($_REQUEST['body']));
 
+
+               $naked_body = preg_replace('/\[(.+?)\]/','',$body);
+               $l = new Text_LanguageDetect;
+               $lng = $l->detectConfidence($naked_body);
+
+               $postopts = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : '');
+
+               logger('mod_item: detect language' . print_r($lng,true) . $naked_body, LOGGER_DATA);
+
                $private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0);
 
                // If this is a comment, set the permissions from the parent.
@@ -561,7 +571,7 @@ function item_post(&$a) {
        $datarray['attach']        = $attachments;
        $datarray['bookmark']      = intval($bookmark);
        $datarray['thr-parent']    = $thr_parent;
-       $datarray['postopts']      = '';
+       $datarray['postopts']      = $postopts;
        $datarray['origin']        = $origin;
        $datarray['moderated']     = $allow_moderated;
 
@@ -1039,16 +1049,11 @@ function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item,
        require_once('include/bb2diaspora.php');
        $signed_body = html_entity_decode(bb2diaspora($datarray['body']));
 
-//     $myaddr = $user['nickname'] . '@' . substr($baseurl, strpos($baseurl,'://') + 3);
-//     if( $author['network'] === NETWORK_DIASPORA)
-//             $diaspora_handle = $author['addr'];
-//     else {
        // Only works for NETWORK_DFRN
        $contact_baseurl_start = strpos($author['url'],'://') + 3;
        $contact_baseurl_length = strpos($author['url'],'/profile') - $contact_baseurl_start;
        $contact_baseurl = substr($author['url'], $contact_baseurl_start, $contact_baseurl_length);
        $diaspora_handle = $author['nick'] . '@' . $contact_baseurl;
-//     }
 
        $signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $diaspora_handle;
 
index 1176c31101000390043e8da0e441bfede9d1c3cf..aaa85928c7c81059984e47bf55c9995480c1e9bf 100755 (executable)
@@ -106,17 +106,18 @@ function like_content(&$a) {
 
 
        $r = q("SELECT * FROM `item` WHERE `verb` = '%s' AND `deleted` = 0 
-               AND `contact-id` = %d AND ( `parent` = '%s' OR `parent-uri` = '%s') LIMIT 1",
+               AND `contact-id` = %d AND ( `parent` = '%s' OR `parent-uri` = '%s' OR `thr-parent` = '%s') LIMIT 1",
                dbesc($activity),
                intval($contact['id']),
                dbesc($item_id),
-               dbesc($item_id)
+               dbesc($item_id),
+               dbesc($item['uri'])
        );
        if(count($r)) {
                $like_item = $r[0];
 
                // Already voted, undo it
-               $r = q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1",
+               $r = q("UPDATE `item` SET `deleted` = 1, `unseen` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1",
                        dbesc(datetime_convert()),
                        intval($like_item['id'])
                );
@@ -245,9 +246,6 @@ function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact)
        if(($activity === ACTIVITY_LIKE) && (! $item['resource-id'])) {
                $signed_text = $like_item['guid'] . ';' . 'Like';
 
-//             if( $contact['network'] === NETWORK_DIASPORA)
-//                     $diaspora_handle = $contact['addr'];
-//             else {
                // Only works for NETWORK_DFRN
                $contact_baseurl_start = strpos($contact['url'],'://') + 3;
                $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start;
@@ -268,7 +266,6 @@ function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact)
                        if( $r)
                                $authorsig = base64_encode(rsa_sign($signed_text,$r['prvkey'],'sha256'));
                }
-//             }
 
                if(! isset($authorsig))
                        $authorsig = '';
@@ -299,9 +296,6 @@ function store_diaspora_like_sig($activity, $post_type, $contact, $post_id) {
        logger('mod_like: storing diaspora like signature');
 
        if(($activity === ACTIVITY_LIKE) && ($post_type === t('status'))) {
-//             if( $contact['network'] === NETWORK_DIASPORA)
-//                     $diaspora_handle = $contact['addr'];
-//             else {
                // Only works for NETWORK_DFRN
                $contact_baseurl_start = strpos($contact['url'],'://') + 3;
                $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start;
@@ -322,7 +316,6 @@ function store_diaspora_like_sig($activity, $post_type, $contact, $post_id) {
                        if( $r)
                                $contact_uprvkey = $r['prvkey'];
                }
-//             }
 
                $r = q("SELECT guid, parent FROM `item` WHERE id = %d LIMIT 1",
                        intval($post_id)
index 519634be5be58d61e4f6ead0e20c6c7fa9ead239..1e9d731a4502064c39f830150a601d967fd0bff2 100644 (file)
@@ -88,6 +88,84 @@ function message_post(&$a) {
 
 }
 
+// Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
+// is identical to the code in include/conversation.php
+if(! function_exists('item_extract_images')) {
+function item_extract_images($body) {
+
+       $saved_image = array();
+       $orig_body = $body;
+       $new_body = '';
+
+       $cnt = 0;
+       $img_start = strpos($orig_body, '[img');
+       $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+       $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
+       while(($img_st_close !== false) && ($img_end !== false)) {
+
+               $img_st_close++; // make it point to AFTER the closing bracket
+               $img_end += $img_start;
+
+               if(! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
+                       // This is an embedded image
+
+                       $saved_image[$cnt] = substr($orig_body, $img_start + $img_st_close, $img_end - ($img_start + $img_st_close));
+                       $new_body = $new_body . substr($orig_body, 0, $img_start) . '[!#saved_image' . $cnt . '#!]';
+
+                       $cnt++;
+               }
+               else
+                       $new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]'));
+
+               $orig_body = substr($orig_body, $img_end + strlen('[/img]'));
+
+               if($orig_body === false) // in case the body ends on a closing image tag
+                       $orig_body = '';
+
+               $img_start = strpos($orig_body, '[img');
+               $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
+               $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
+       }
+
+       $new_body = $new_body . $orig_body;
+
+       return array('body' => $new_body, 'images' => $saved_image);
+}}
+
+if(! function_exists('item_redir_and_replace_images')) {
+function item_redir_and_replace_images($body, $images, $cid) {
+
+       $origbody = $body;
+       $newbody = '';
+
+       for($i = 0; $i < count($images); $i++) {
+               $search = '/\[url\=(.*?)\]\[!#saved_image' . $i . '#!\]\[\/url\]' . '/is';
+               $replace = '[url=' . z_path() . '/redir/' . $cid 
+                          . '?f=1&url=' . '$1' . '][!#saved_image' . $i . '#!][/url]' ;
+
+               $img_end = strpos($origbody, '[!#saved_image' . $i . '#!][/url]') + strlen('[!#saved_image' . $i . '#!][/url]');
+               $process_part = substr($origbody, 0, $img_end);
+               $origbody = substr($origbody, $img_end);
+
+               $process_part = preg_replace($search, $replace, $process_part);
+               $newbody = $newbody . $process_part;
+       }
+       $newbody = $newbody . $origbody;
+
+       $cnt = 0;
+       foreach($images as $image) {
+               // We're depending on the property of 'foreach' (specified on the PHP website) that
+               // it loops over the array starting from the first element and going sequentially
+               // to the last element
+               $newbody = str_replace('[!#saved_image' . $cnt . '#!]', '[img]' . $image . '[/img]', $newbody);
+               $cnt++;
+       }
+
+       return $newbody;
+}}
+
+
+
 function message_content(&$a) {
 
        $o = '';
@@ -224,6 +302,7 @@ function message_content(&$a) {
                // list messages
 
                $o .= $header;
+
                
                $r = q("SELECT count(*) AS `total` FROM `mail` 
                        WHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `created` DESC",
@@ -232,7 +311,7 @@ function message_content(&$a) {
                );
                if(count($r))
                        $a->set_pager_total($r[0]['total']);
-       
+
                $r = q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`, 
                        `mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` , `contact`.`network`,
                        count( * ) as count
@@ -243,6 +322,7 @@ function message_content(&$a) {
                        intval($a->pager['start']),
                        intval($a->pager['itemspage'])
                );
+
                if(! count($r)) {
                        info( t('No messages.') . EOL);
                        return $o;
@@ -343,26 +423,9 @@ function message_content(&$a) {
                        }
 
 
-                       $Text = $message['body'];
-                       $saved_image = '';
-                       $img_start = strpos($Text,'[img]data:');
-                       $img_end = strpos($Text,'[/img]');
-
-                       if($img_start !== false && $img_end !== false && $img_end > $img_start) {
-                               $start_fragment = substr($Text,0,$img_start);
-                               $img_start += strlen('[img]');
-                               $saved_image = substr($Text,$img_start,$img_end - $img_start);
-                               $end_fragment = substr($Text,$img_end + strlen('[/img]'));              
-                               $Text = $start_fragment . '[!#saved_image#!]' . $end_fragment;
-                               $search = '/\[url\=(.*?)\]\[!#saved_image#!\]\[\/url\]' . '/is';
-                               $replace = '[url=' . z_path() . '/redir/' . $message['contact-id'] 
-                                       . '?f=1&url=' . '$1' . '][!#saved_image#!][/url]' ;
-
-                               $Text = preg_replace($search,$replace,$Text);
-
-                       if(strlen($saved_image))
-                               $message['body'] = str_replace('[!#saved_image#!]', '[img]' . $saved_image . '[/img]',$Text);
-                       }
+                       $extracted = item_extract_images($message['body']);
+                       if($extracted['images'])
+                               $message['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $message['contact-id']);
 
                        $mails[] = array(
                                'id' => $message['id'],
index 5f009dacd1ffc5adfaa4804ed881263cebd236b6..3d8fa7c1443e4849280017246dcc0a68a1c38f74 100644 (file)
@@ -616,7 +616,8 @@ function network_content(&$a, $update = 0) {
                if($update) {
                        $r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid`
                                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
-                               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+                               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
+                               (`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
                                and `item`.`moderated` = 0 and `item`.`unseen` = 1
                                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                                $sql_extra3 $sql_extra $sql_nets ",
index ea4d7f81f50ffb7eda81fbe9d82fd8c44c60b713..624f0bdcaa2038367cffb47bd0780deeffade527 100644 (file)
@@ -743,6 +743,12 @@ function photos_post(&$a) {
        $ph->orient($src);
        @unlink($src);
 
+       $max_length = get_config('system','max_image_length');
+       if(! $max_length)
+               $max_length = MAX_IMAGE_LENGTH;
+       if($max_length > 0)
+               $ph->scaleImage($max_length);
+
        $width  = $ph->getWidth();
        $height = $ph->getHeight();
 
index 24e03d6eac25589bf2bab80e391dfd508d8d6225..b142943c1e9121f2fb80a769d7c2f9cb0d7877f3 100644 (file)
@@ -204,6 +204,8 @@ function profile_content(&$a, $update = 0) {
 
                $r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid`
                        FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+                       WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
+                       (`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
                        WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
                        and `item`.`moderated` = 0 and `item`.`unseen` = 1
                        AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
index e44707f9bba8396da0b69e399d6622c137f32138..67b2c4ab411f6ecd653bb0ec159134691662ee70 100644 (file)
@@ -128,6 +128,7 @@ function profile_photo_post(&$a) {
                return;
        }
 
+       $ph->orient($src);
        @unlink($src);
        return profile_photo_crop_ui_head($a, $ph);
        
@@ -237,6 +238,12 @@ function profile_photo_content(&$a) {
 
 if(! function_exists('_crop_ui_head')) {
 function profile_photo_crop_ui_head(&$a, $ph){
+       $max_length = get_config('system','max_image_length');
+       if(! $max_length)
+               $max_length = MAX_IMAGE_LENGTH;
+       if($max_length > 0)
+               $ph->scaleImage($max_length);
+
        $width = $ph->getWidth();
        $height = $ph->getHeight();
 
index 4df8a5af7e6b3d1da8c52c41ccdfa7810e17ff91..61f525e0fa29e8850d292cff625de922dfb09beb 100644 (file)
@@ -385,9 +385,17 @@ function profile_activity($changed, $value) {
        $arr['deny_gid']  = $a->user['deny_gid'];
 
        $i = item_store($arr);
-       if($i)
+       if($i) {
+
+               // give it a permanent link
+               q("update item set plink = '%s' where id = %d limit 1",
+                       dbesc($a->get_baseurl() . '/display/' . $a->user['nickname'] . '/' . $i),
+                       intval($i)
+               );
+
                proc_run('php',"include/notifier.php","activity","$i");
 
+       }
 }
 
 
index 29d31f6b51ea547862a719810fc2015f71d700f7..761220ad7fca94509f6a4d7cf3619d8eaacff821 100644 (file)
@@ -23,7 +23,9 @@ function share_init(&$a) {
        $o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]' . "\n";
        if($r[0]['title'])
                $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n";
-       $o .= $r[0]['body'] . "\n";
+       $o .= $r[0]['body'] . "\n" ;
+
+       $o .= (($r[0]['plink']) ? '[url=' . $r[0]['plink'] . ']' . t('link') . '[/url]' . "\n" : '');
 
        echo $o;
        killme();  
index 5990f28344b92b0c2007538d159e3aac15f6647e..07d97d17a9e21fa15809a7f325d81c554409657d 100644 (file)
@@ -101,8 +101,15 @@ function wall_upload_post(&$a) {
                killme();
        }
 
+       $ph->orient($src);
        @unlink($src);
 
+       $max_length = get_config('system','max_image_length');
+       if(! $max_length)
+               $max_length = MAX_IMAGE_LENGTH;
+       if($max_length > 0)
+               $ph->scaleImage($max_length);
+
        $width = $ph->getWidth();
        $height = $ph->getHeight();
 
index b8e247f57ce99f885714ce1467da93979ea0eb19..d752eaa6df99750d4047107855eec248dceaea34 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-define( 'UPDATE_VERSION' , 1151 );
+define( 'UPDATE_VERSION' , 1153 );
 
 /**
  *
@@ -1307,3 +1307,33 @@ function update_1150() {
        return UPDATE_SUCCESS;
 }
 
+
+function update_1151() {
+       $r = q("CREATE TABLE IF NOT EXISTS locks (
+                       id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+                       name CHAR( 128 ) NOT NULL ,
+                       locked TINYINT( 1 ) NOT NULL DEFAULT '0'
+                 ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
+       if (!$r)
+               return UPDATE_FAILED;
+       return UPDATE_SUCCESS;
+}
+
+function update_1152() {
+       $r = q("CREATE TABLE IF NOT EXISTS `term` (
+               `tid` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+               `oid` INT UNSIGNED NOT NULL ,
+               `otype` TINYINT( 3 ) UNSIGNED NOT NULL ,
+               `type` TINYINT( 3 ) UNSIGNED NOT NULL ,
+               `term` CHAR( 255 ) NOT NULL ,
+               `url` CHAR( 255 ) NOT NULL, 
+               KEY `oid` ( `oid` ),
+               KEY `otype` ( `otype` ),
+               KEY `type`  ( `type` ),
+               KEY `term`  ( `term` )
+               ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
+       if (!$r)
+               return UPDATE_FAILED;
+       return UPDATE_SUCCESS;
+}
+
index 8519651ae45d254e49f006ead01e8e3057b177d8..06a9c4f00778cdaa13268da7dd1568ba420987ac 100644 (file)
@@ -6,9 +6,9 @@
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: 3.0.1388\n"
+"Project-Id-Version: 3.0.1402\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-06-28 10:00-0700\n"
+"POT-Creation-Date: 2012-07-12 10:00-0700\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -36,7 +36,7 @@ msgstr ""
 
 #: ../../mod/crepair.php:115 ../../mod/wall_attach.php:44
 #: ../../mod/fsuggest.php:78 ../../mod/events.php:140 ../../mod/api.php:26
-#: ../../mod/api.php:31 ../../mod/photos.php:135 ../../mod/photos.php:951
+#: ../../mod/api.php:31 ../../mod/photos.php:135 ../../mod/photos.php:957
 #: ../../mod/editpost.php:10 ../../mod/install.php:151
 #: ../../mod/notifications.php:66 ../../mod/contacts.php:145
 #: ../../mod/settings.php:106 ../../mod/settings.php:537
@@ -45,18 +45,18 @@ msgstr ""
 #: ../../mod/wallmessage.php:33 ../../mod/wallmessage.php:79
 #: ../../mod/wallmessage.php:103 ../../mod/attach.php:33
 #: ../../mod/group.php:19 ../../mod/viewcontacts.php:22
-#: ../../mod/register.php:38 ../../mod/regmod.php:116 ../../mod/item.php:124
-#: ../../mod/item.php:140 ../../mod/profile_photo.php:19
-#: ../../mod/profile_photo.php:141 ../../mod/profile_photo.php:152
-#: ../../mod/profile_photo.php:165 ../../mod/message.php:45
-#: ../../mod/message.php:97 ../../mod/allfriends.php:9
+#: ../../mod/register.php:38 ../../mod/regmod.php:116 ../../mod/item.php:125
+#: ../../mod/item.php:141 ../../mod/profile_photo.php:19
+#: ../../mod/profile_photo.php:142 ../../mod/profile_photo.php:153
+#: ../../mod/profile_photo.php:166 ../../mod/message.php:45
+#: ../../mod/message.php:175 ../../mod/allfriends.php:9
 #: ../../mod/nogroup.php:25 ../../mod/wall_upload.php:53
 #: ../../mod/follow.php:9 ../../mod/display.php:138 ../../mod/profiles.php:7
 #: ../../mod/profiles.php:400 ../../mod/delegate.php:6
 #: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81
-#: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:508
-#: ../../addon/facebook/facebook.php:514 ../../addon/dav/layout.fnk.php:353
-#: ../../include/items.php:3447 ../../index.php:309
+#: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:510
+#: ../../addon/facebook/facebook.php:516 ../../addon/dav/layout.fnk.php:353
+#: ../../include/items.php:3591 ../../index.php:309
 msgid "Permission denied."
 msgstr ""
 
@@ -86,7 +86,7 @@ msgid "Return to contact editor"
 msgstr ""
 
 #: ../../mod/crepair.php:148 ../../mod/settings.php:557
-#: ../../mod/settings.php:583 ../../mod/admin.php:659 ../../mod/admin.php:668
+#: ../../mod/settings.php:583 ../../mod/admin.php:661 ../../mod/admin.php:670
 msgid "Name"
 msgstr ""
 
@@ -123,21 +123,22 @@ msgid "New photo from this URL"
 msgstr ""
 
 #: ../../mod/crepair.php:166 ../../mod/fsuggest.php:107
-#: ../../mod/events.php:436 ../../mod/photos.php:986 ../../mod/photos.php:1057
-#: ../../mod/photos.php:1303 ../../mod/photos.php:1343
-#: ../../mod/photos.php:1383 ../../mod/photos.php:1414
+#: ../../mod/events.php:436 ../../mod/photos.php:992 ../../mod/photos.php:1063
+#: ../../mod/photos.php:1309 ../../mod/photos.php:1349
+#: ../../mod/photos.php:1389 ../../mod/photos.php:1420
 #: ../../mod/install.php:246 ../../mod/install.php:284
-#: ../../mod/localtime.php:45 ../../mod/contacts.php:343
-#: ../../mod/settings.php:555 ../../mod/settings.php:709
-#: ../../mod/settings.php:770 ../../mod/settings.php:971
-#: ../../mod/group.php:85 ../../mod/message.php:216 ../../mod/message.php:410
-#: ../../mod/admin.php:420 ../../mod/admin.php:656 ../../mod/admin.php:792
-#: ../../mod/admin.php:991 ../../mod/admin.php:1078 ../../mod/profiles.php:569
-#: ../../mod/invite.php:119 ../../addon/fromgplus/fromgplus.php:40
-#: ../../addon/facebook/facebook.php:617
+#: ../../mod/localtime.php:45 ../../mod/content.php:691
+#: ../../mod/contacts.php:343 ../../mod/settings.php:555
+#: ../../mod/settings.php:709 ../../mod/settings.php:770
+#: ../../mod/settings.php:971 ../../mod/group.php:85 ../../mod/message.php:294
+#: ../../mod/message.php:473 ../../mod/admin.php:422 ../../mod/admin.php:658
+#: ../../mod/admin.php:794 ../../mod/admin.php:993 ../../mod/admin.php:1080
+#: ../../mod/profiles.php:569 ../../mod/invite.php:119
+#: ../../addon/fromgplus/fromgplus.php:40
+#: ../../addon/facebook/facebook.php:619
 #: ../../addon/snautofollow/snautofollow.php:64
 #: ../../addon/yourls/yourls.php:76 ../../addon/ljpost/ljpost.php:93
-#: ../../addon/nsfw/nsfw.php:57 ../../addon/page/page.php:164
+#: ../../addon/nsfw/nsfw.php:57 ../../addon/page/page.php:210
 #: ../../addon/planets/planets.php:158
 #: ../../addon/uhremotestorage/uhremotestorage.php:89
 #: ../../addon/randplace/randplace.php:177 ../../addon/dwpost/dwpost.php:93
@@ -168,7 +169,7 @@ msgstr ""
 #: ../../view/theme/diabook/theme.php:757
 #: ../../view/theme/diabook/config.php:190
 #: ../../view/theme/quattro/config.php:52 ../../view/theme/dispy/config.php:70
-#: ../../include/conversation.php:580
+#: ../../include/conversation.php:652
 msgid "Submit"
 msgstr ""
 
@@ -223,12 +224,12 @@ msgstr ""
 msgid "Edit event"
 msgstr ""
 
-#: ../../mod/events.php:304 ../../include/text.php:1065
+#: ../../mod/events.php:304 ../../include/text.php:1069
 msgid "link to source"
 msgstr ""
 
 #: ../../mod/events.php:328 ../../view/theme/diabook/theme.php:131
-#: ../../include/nav.php:52 ../../boot.php:1549
+#: ../../include/nav.php:52 ../../boot.php:1596
 msgid "Events"
 msgstr ""
 
@@ -282,8 +283,9 @@ msgstr ""
 msgid "Description:"
 msgstr ""
 
-#: ../../mod/events.php:429 ../../include/event.php:40
-#: ../../include/bb2diaspora.php:357 ../../boot.php:1126
+#: ../../mod/events.php:429 ../../mod/directory.php:132
+#: ../../include/event.php:40 ../../include/bb2diaspora.php:409
+#: ../../boot.php:1173
 msgid "Location:"
 msgstr ""
 
@@ -364,19 +366,19 @@ msgstr ""
 msgid "No"
 msgstr ""
 
-#: ../../mod/photos.php:46 ../../boot.php:1543
+#: ../../mod/photos.php:46 ../../boot.php:1590
 msgid "Photo Albums"
 msgstr ""
 
-#: ../../mod/photos.php:54 ../../mod/photos.php:156 ../../mod/photos.php:965
-#: ../../mod/photos.php:1049 ../../mod/photos.php:1064
-#: ../../mod/photos.php:1492 ../../mod/photos.php:1504
+#: ../../mod/photos.php:54 ../../mod/photos.php:156 ../../mod/photos.php:971
+#: ../../mod/photos.php:1055 ../../mod/photos.php:1070
+#: ../../mod/photos.php:1498 ../../mod/photos.php:1510
 #: ../../addon/communityhome/communityhome.php:110
 #: ../../view/theme/diabook/theme.php:598
 msgid "Contact Photos"
 msgstr ""
 
-#: ../../mod/photos.php:61 ../../mod/photos.php:1074 ../../mod/photos.php:1542
+#: ../../mod/photos.php:61 ../../mod/photos.php:1080 ../../mod/photos.php:1548
 msgid "Upload New Photos"
 msgstr ""
 
@@ -388,11 +390,11 @@ msgstr ""
 msgid "Contact information unavailable"
 msgstr ""
 
-#: ../../mod/photos.php:156 ../../mod/photos.php:660 ../../mod/photos.php:1049
-#: ../../mod/photos.php:1064 ../../mod/profile_photo.php:60
+#: ../../mod/photos.php:156 ../../mod/photos.php:660 ../../mod/photos.php:1055
+#: ../../mod/photos.php:1070 ../../mod/profile_photo.php:60
 #: ../../mod/profile_photo.php:67 ../../mod/profile_photo.php:74
-#: ../../mod/profile_photo.php:176 ../../mod/profile_photo.php:254
-#: ../../mod/profile_photo.php:263
+#: ../../mod/profile_photo.php:177 ../../mod/profile_photo.php:261
+#: ../../mod/profile_photo.php:270
 #: ../../addon/communityhome/communityhome.php:111
 #: ../../view/theme/diabook/theme.php:599 ../../include/user.php:304
 #: ../../include/user.php:311 ../../include/user.php:318
@@ -403,11 +405,11 @@ msgstr ""
 msgid "Album not found."
 msgstr ""
 
-#: ../../mod/photos.php:184 ../../mod/photos.php:1058
+#: ../../mod/photos.php:184 ../../mod/photos.php:1064
 msgid "Delete Album"
 msgstr ""
 
-#: ../../mod/photos.php:247 ../../mod/photos.php:1304
+#: ../../mod/photos.php:247 ../../mod/photos.php:1310
 msgid "Delete Photo"
 msgstr ""
 
@@ -417,9 +419,9 @@ msgstr ""
 
 #: ../../mod/photos.php:591 ../../mod/like.php:144 ../../mod/tagger.php:70
 #: ../../addon/communityhome/communityhome.php:163
-#: ../../view/theme/diabook/theme.php:570 ../../include/text.php:1316
-#: ../../include/diaspora.php:1710 ../../include/conversation.php:53
-#: ../../include/conversation.php:126
+#: ../../view/theme/diabook/theme.php:570 ../../include/text.php:1321
+#: ../../include/diaspora.php:1792 ../../include/conversation.php:114
+#: ../../include/conversation.php:187
 msgid "photo"
 msgstr ""
 
@@ -440,169 +442,176 @@ msgstr ""
 msgid "Unable to process image."
 msgstr ""
 
-#: ../../mod/photos.php:757 ../../mod/profile_photo.php:259
-#: ../../mod/wall_upload.php:118
+#: ../../mod/photos.php:763 ../../mod/profile_photo.php:266
+#: ../../mod/wall_upload.php:125
 msgid "Image upload failed."
 msgstr ""
 
-#: ../../mod/photos.php:843 ../../mod/community.php:16
+#: ../../mod/photos.php:849 ../../mod/community.php:16
 #: ../../mod/dfrn_request.php:759 ../../mod/viewcontacts.php:17
 #: ../../mod/display.php:7 ../../mod/search.php:71 ../../mod/directory.php:29
 msgid "Public access denied."
 msgstr ""
 
-#: ../../mod/photos.php:853
+#: ../../mod/photos.php:859
 msgid "No photos selected"
 msgstr ""
 
-#: ../../mod/photos.php:932
+#: ../../mod/photos.php:938
 msgid "Access to this item is restricted."
 msgstr ""
 
-#: ../../mod/photos.php:996
+#: ../../mod/photos.php:1002
 #, php-format
 msgid "You have used %1$.2f Mbytes of %2$.2f Mbytes photo storage."
 msgstr ""
 
-#: ../../mod/photos.php:999
+#: ../../mod/photos.php:1005
 #, php-format
 msgid "You have used %1$.2f Mbytes of photo storage."
 msgstr ""
 
-#: ../../mod/photos.php:1005
+#: ../../mod/photos.php:1011
 msgid "Upload Photos"
 msgstr ""
 
-#: ../../mod/photos.php:1009 ../../mod/photos.php:1053
+#: ../../mod/photos.php:1015 ../../mod/photos.php:1059
 msgid "New album name: "
 msgstr ""
 
-#: ../../mod/photos.php:1010
+#: ../../mod/photos.php:1016
 msgid "or existing album name: "
 msgstr ""
 
-#: ../../mod/photos.php:1011
+#: ../../mod/photos.php:1017
 msgid "Do not show a status post for this upload"
 msgstr ""
 
-#: ../../mod/photos.php:1013 ../../mod/photos.php:1299
+#: ../../mod/photos.php:1019 ../../mod/photos.php:1305
 msgid "Permissions"
 msgstr ""
 
-#: ../../mod/photos.php:1068
+#: ../../mod/photos.php:1074
 msgid "Edit Album"
 msgstr ""
 
-#: ../../mod/photos.php:1092 ../../mod/photos.php:1525
+#: ../../mod/photos.php:1098 ../../mod/photos.php:1531
 msgid "View Photo"
 msgstr ""
 
-#: ../../mod/photos.php:1127
+#: ../../mod/photos.php:1133
 msgid "Permission denied. Access to this item may be restricted."
 msgstr ""
 
-#: ../../mod/photos.php:1129
+#: ../../mod/photos.php:1135
 msgid "Photo not available"
 msgstr ""
 
-#: ../../mod/photos.php:1179
+#: ../../mod/photos.php:1185
 msgid "View photo"
 msgstr ""
 
-#: ../../mod/photos.php:1179
+#: ../../mod/photos.php:1185
 msgid "Edit photo"
 msgstr ""
 
-#: ../../mod/photos.php:1180
+#: ../../mod/photos.php:1186
 msgid "Use as profile photo"
 msgstr ""
 
-#: ../../mod/photos.php:1186 ../../include/conversation.php:490
+#: ../../mod/photos.php:1192 ../../mod/content.php:601
+#: ../../include/conversation.php:562
 msgid "Private Message"
 msgstr ""
 
-#: ../../mod/photos.php:1208
+#: ../../mod/photos.php:1214
 msgid "View Full Size"
 msgstr ""
 
-#: ../../mod/photos.php:1276
+#: ../../mod/photos.php:1282
 msgid "Tags: "
 msgstr ""
 
-#: ../../mod/photos.php:1279
+#: ../../mod/photos.php:1285
 msgid "[Remove any tag]"
 msgstr ""
 
-#: ../../mod/photos.php:1289
+#: ../../mod/photos.php:1295
 msgid "Rotate CW (right)"
 msgstr ""
 
-#: ../../mod/photos.php:1290
+#: ../../mod/photos.php:1296
 msgid "Rotate CCW (left)"
 msgstr ""
 
-#: ../../mod/photos.php:1292
+#: ../../mod/photos.php:1298
 msgid "New album name"
 msgstr ""
 
-#: ../../mod/photos.php:1295
+#: ../../mod/photos.php:1301
 msgid "Caption"
 msgstr ""
 
-#: ../../mod/photos.php:1297
+#: ../../mod/photos.php:1303
 msgid "Add a Tag"
 msgstr ""
 
-#: ../../mod/photos.php:1301
+#: ../../mod/photos.php:1307
 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping"
 msgstr ""
 
-#: ../../mod/photos.php:1321 ../../include/conversation.php:554
+#: ../../mod/photos.php:1327 ../../mod/content.php:665
+#: ../../include/conversation.php:626
 msgid "I like this (toggle)"
 msgstr ""
 
-#: ../../mod/photos.php:1322 ../../include/conversation.php:555
+#: ../../mod/photos.php:1328 ../../mod/content.php:666
+#: ../../include/conversation.php:627
 msgid "I don't like this (toggle)"
 msgstr ""
 
-#: ../../mod/photos.php:1323 ../../include/conversation.php:993
+#: ../../mod/photos.php:1329 ../../include/conversation.php:1065
 msgid "Share"
 msgstr ""
 
-#: ../../mod/photos.php:1324 ../../mod/editpost.php:104
-#: ../../mod/wallmessage.php:145 ../../mod/message.php:215
-#: ../../mod/message.php:411 ../../include/conversation.php:371
-#: ../../include/conversation.php:731 ../../include/conversation.php:1012
+#: ../../mod/photos.php:1330 ../../mod/editpost.php:104
+#: ../../mod/content.php:482 ../../mod/content.php:842
+#: ../../mod/wallmessage.php:145 ../../mod/message.php:293
+#: ../../mod/message.php:474 ../../include/conversation.php:443
+#: ../../include/conversation.php:803 ../../include/conversation.php:1084
 msgid "Please wait"
 msgstr ""
 
-#: ../../mod/photos.php:1340 ../../mod/photos.php:1380
-#: ../../mod/photos.php:1411 ../../include/conversation.php:577
+#: ../../mod/photos.php:1346 ../../mod/photos.php:1386
+#: ../../mod/photos.php:1417 ../../mod/content.php:688
+#: ../../include/conversation.php:649
 msgid "This is you"
 msgstr ""
 
-#: ../../mod/photos.php:1342 ../../mod/photos.php:1382
-#: ../../mod/photos.php:1413 ../../include/conversation.php:579
-#: ../../boot.php:518
+#: ../../mod/photos.php:1348 ../../mod/photos.php:1388
+#: ../../mod/photos.php:1419 ../../mod/content.php:690
+#: ../../include/conversation.php:651 ../../boot.php:565
 msgid "Comment"
 msgstr ""
 
-#: ../../mod/photos.php:1344 ../../mod/editpost.php:125
-#: ../../include/conversation.php:589 ../../include/conversation.php:1030
+#: ../../mod/photos.php:1350 ../../mod/editpost.php:125
+#: ../../mod/content.php:700 ../../include/conversation.php:661
+#: ../../include/conversation.php:1102
 msgid "Preview"
 msgstr ""
 
-#: ../../mod/photos.php:1441 ../../mod/settings.php:618
-#: ../../mod/settings.php:707 ../../mod/group.php:168 ../../mod/admin.php:663
-#: ../../include/conversation.php:328 ../../include/conversation.php:609
+#: ../../mod/photos.php:1447 ../../mod/content.php:439
+#: ../../mod/content.php:720 ../../mod/settings.php:618
+#: ../../mod/settings.php:707 ../../mod/group.php:168 ../../mod/admin.php:665
+#: ../../include/conversation.php:400 ../../include/conversation.php:681
 msgid "Delete"
 msgstr ""
 
-#: ../../mod/photos.php:1531
+#: ../../mod/photos.php:1537
 msgid "View Album"
 msgstr ""
 
-#: ../../mod/photos.php:1540
+#: ../../mod/photos.php:1546
 msgid "Recent Photos"
 msgstr ""
 
@@ -659,28 +668,28 @@ msgstr ""
 msgid "Edit post"
 msgstr ""
 
-#: ../../mod/editpost.php:80 ../../include/conversation.php:979
+#: ../../mod/editpost.php:80 ../../include/conversation.php:1051
 msgid "Post to Email"
 msgstr ""
 
-#: ../../mod/editpost.php:95 ../../mod/settings.php:617
-#: ../../include/conversation.php:596
+#: ../../mod/editpost.php:95 ../../mod/content.php:707
+#: ../../mod/settings.php:617 ../../include/conversation.php:668
 msgid "Edit"
 msgstr ""
 
 #: ../../mod/editpost.php:96 ../../mod/wallmessage.php:143
-#: ../../mod/message.php:213 ../../mod/message.php:408
-#: ../../include/conversation.php:994
+#: ../../mod/message.php:291 ../../mod/message.php:471
+#: ../../include/conversation.php:1066
 msgid "Upload photo"
 msgstr ""
 
-#: ../../mod/editpost.php:97 ../../include/conversation.php:996
+#: ../../mod/editpost.php:97 ../../include/conversation.php:1068
 msgid "Attach file"
 msgstr ""
 
 #: ../../mod/editpost.php:98 ../../mod/wallmessage.php:144
-#: ../../mod/message.php:214 ../../mod/message.php:409
-#: ../../include/conversation.php:998
+#: ../../mod/message.php:292 ../../mod/message.php:472
+#: ../../include/conversation.php:1070
 msgid "Insert web link"
 msgstr ""
 
@@ -696,35 +705,35 @@ msgstr ""
 msgid "Insert Vorbis [.ogg] audio"
 msgstr ""
 
-#: ../../mod/editpost.php:102 ../../include/conversation.php:1004
+#: ../../mod/editpost.php:102 ../../include/conversation.php:1076
 msgid "Set your location"
 msgstr ""
 
-#: ../../mod/editpost.php:103 ../../include/conversation.php:1006
+#: ../../mod/editpost.php:103 ../../include/conversation.php:1078
 msgid "Clear browser location"
 msgstr ""
 
-#: ../../mod/editpost.php:105 ../../include/conversation.php:1013
+#: ../../mod/editpost.php:105 ../../include/conversation.php:1085
 msgid "Permission settings"
 msgstr ""
 
-#: ../../mod/editpost.php:113 ../../include/conversation.php:1022
+#: ../../mod/editpost.php:113 ../../include/conversation.php:1094
 msgid "CC: email addresses"
 msgstr ""
 
-#: ../../mod/editpost.php:114 ../../include/conversation.php:1023
+#: ../../mod/editpost.php:114 ../../include/conversation.php:1095
 msgid "Public post"
 msgstr ""
 
-#: ../../mod/editpost.php:117 ../../include/conversation.php:1009
+#: ../../mod/editpost.php:117 ../../include/conversation.php:1081
 msgid "Set title"
 msgstr ""
 
-#: ../../mod/editpost.php:119 ../../include/conversation.php:1011
+#: ../../mod/editpost.php:119 ../../include/conversation.php:1083
 msgid "Categories (comma-separated list)"
 msgstr ""
 
-#: ../../mod/editpost.php:120 ../../include/conversation.php:1025
+#: ../../mod/editpost.php:120 ../../include/conversation.php:1097
 msgid "Example: bob@example.com, mary@example.com"
 msgstr ""
 
@@ -845,7 +854,7 @@ msgstr ""
 msgid "Confirm"
 msgstr ""
 
-#: ../../mod/dfrn_request.php:715 ../../include/items.php:2873
+#: ../../mod/dfrn_request.php:715 ../../include/items.php:2982
 msgid "[Name Withheld]"
 msgstr ""
 
@@ -1171,7 +1180,7 @@ msgid ""
 msgstr ""
 
 #: ../../mod/localtime.php:12 ../../include/event.php:11
-#: ../../include/bb2diaspora.php:335
+#: ../../include/bb2diaspora.php:387
 msgid "l F d, Y \\@ g:i A"
 msgstr ""
 
@@ -1217,7 +1226,7 @@ msgid "is interested in:"
 msgstr ""
 
 #: ../../mod/match.php:58 ../../mod/suggest.php:59
-#: ../../include/contact_widgets.php:9 ../../boot.php:1070
+#: ../../include/contact_widgets.php:9 ../../boot.php:1117
 msgid "Connect"
 msgstr ""
 
@@ -1233,6 +1242,138 @@ msgstr ""
 msgid "Visible to:"
 msgstr ""
 
+#: ../../mod/content.php:119 ../../mod/network.php:436
+msgid "No such group"
+msgstr ""
+
+#: ../../mod/content.php:130 ../../mod/network.php:447
+msgid "Group is empty"
+msgstr ""
+
+#: ../../mod/content.php:134 ../../mod/network.php:451
+msgid "Group: "
+msgstr ""
+
+#: ../../mod/content.php:438 ../../mod/content.php:719
+#: ../../include/conversation.php:399 ../../include/conversation.php:680
+msgid "Select"
+msgstr ""
+
+#: ../../mod/content.php:455 ../../mod/content.php:812
+#: ../../mod/content.php:813 ../../include/conversation.php:416
+#: ../../include/conversation.php:773 ../../include/conversation.php:774
+#, php-format
+msgid "View %s's profile @ %s"
+msgstr ""
+
+#: ../../mod/content.php:465 ../../mod/content.php:824
+#: ../../include/conversation.php:426 ../../include/conversation.php:785
+#, php-format
+msgid "%s from %s"
+msgstr ""
+
+#: ../../mod/content.php:480 ../../include/conversation.php:441
+msgid "View in context"
+msgstr ""
+
+#: ../../mod/content.php:586 ../../include/conversation.php:547
+#, php-format
+msgid "%d comment"
+msgid_plural "%d comments"
+msgstr[0] ""
+msgstr[1] ""
+
+#: ../../mod/content.php:587 ../../addon/page/page.php:76
+#: ../../addon/page/page.php:110 ../../addon/showmore/showmore.php:87
+#: ../../include/contact_widgets.php:188 ../../include/conversation.php:548
+#: ../../boot.php:566
+msgid "show more"
+msgstr ""
+
+#: ../../mod/content.php:665 ../../include/conversation.php:626
+msgid "like"
+msgstr ""
+
+#: ../../mod/content.php:666 ../../include/conversation.php:627
+msgid "dislike"
+msgstr ""
+
+#: ../../mod/content.php:668 ../../include/conversation.php:629
+msgid "Share this"
+msgstr ""
+
+#: ../../mod/content.php:668 ../../include/conversation.php:629
+msgid "share"
+msgstr ""
+
+#: ../../mod/content.php:692 ../../include/conversation.php:653
+msgid "Bold"
+msgstr ""
+
+#: ../../mod/content.php:693 ../../include/conversation.php:654
+msgid "Italic"
+msgstr ""
+
+#: ../../mod/content.php:694 ../../include/conversation.php:655
+msgid "Underline"
+msgstr ""
+
+#: ../../mod/content.php:695 ../../include/conversation.php:656
+msgid "Quote"
+msgstr ""
+
+#: ../../mod/content.php:696 ../../include/conversation.php:657
+msgid "Code"
+msgstr ""
+
+#: ../../mod/content.php:697 ../../include/conversation.php:658
+msgid "Image"
+msgstr ""
+
+#: ../../mod/content.php:698 ../../include/conversation.php:659
+msgid "Link"
+msgstr ""
+
+#: ../../mod/content.php:699 ../../include/conversation.php:660
+msgid "Video"
+msgstr ""
+
+#: ../../mod/content.php:732 ../../include/conversation.php:693
+msgid "add star"
+msgstr ""
+
+#: ../../mod/content.php:733 ../../include/conversation.php:694
+msgid "remove star"
+msgstr ""
+
+#: ../../mod/content.php:734 ../../include/conversation.php:695
+msgid "toggle star status"
+msgstr ""
+
+#: ../../mod/content.php:737 ../../include/conversation.php:698
+msgid "starred"
+msgstr ""
+
+#: ../../mod/content.php:738 ../../include/conversation.php:699
+msgid "add tag"
+msgstr ""
+
+#: ../../mod/content.php:742 ../../include/conversation.php:703
+msgid "save to folder"
+msgstr ""
+
+#: ../../mod/content.php:814 ../../include/conversation.php:775
+msgid "to"
+msgstr ""
+
+#: ../../mod/content.php:815 ../../include/conversation.php:776
+msgid "Wall-to-Wall"
+msgstr ""
+
+#: ../../mod/content.php:816 ../../include/conversation.php:777
+msgid "via Wall-To-Wall:"
+msgstr ""
+
 #: ../../mod/home.php:26 ../../addon/communityhome/communityhome.php:179
 #, php-format
 msgid "Welcome to %s"
@@ -1274,7 +1415,7 @@ msgstr ""
 msgid "Introductions"
 msgstr ""
 
-#: ../../mod/notifications.php:100 ../../mod/message.php:105
+#: ../../mod/notifications.php:100 ../../mod/message.php:183
 #: ../../include/nav.php:128
 msgid "Messages"
 msgstr ""
@@ -1314,7 +1455,7 @@ msgid "if applicable"
 msgstr ""
 
 #: ../../mod/notifications.php:157 ../../mod/notifications.php:204
-#: ../../mod/admin.php:661
+#: ../../mod/admin.php:663
 msgid "Approve"
 msgstr ""
 
@@ -1515,12 +1656,12 @@ msgid "View all contacts"
 msgstr ""
 
 #: ../../mod/contacts.php:310 ../../mod/contacts.php:369
-#: ../../mod/admin.php:665
+#: ../../mod/admin.php:667
 msgid "Unblock"
 msgstr ""
 
 #: ../../mod/contacts.php:310 ../../mod/contacts.php:369
-#: ../../mod/admin.php:664
+#: ../../mod/admin.php:666
 msgid "Block"
 msgstr ""
 
@@ -1617,7 +1758,7 @@ msgstr ""
 msgid "Update public posts"
 msgstr ""
 
-#: ../../mod/contacts.php:366 ../../mod/admin.php:1136
+#: ../../mod/contacts.php:366 ../../mod/admin.php:1138
 msgid "Update now"
 msgstr ""
 
@@ -1744,11 +1885,11 @@ msgstr ""
 #: ../../mod/lostpass.php:45 ../../mod/lostpass.php:107
 #: ../../mod/register.php:90 ../../mod/register.php:144
 #: ../../mod/regmod.php:54 ../../mod/dfrn_confirm.php:752
-#: ../../addon/facebook/facebook.php:700
-#: ../../addon/facebook/facebook.php:1190
+#: ../../addon/facebook/facebook.php:702
+#: ../../addon/facebook/facebook.php:1192
 #: ../../addon/public_server/public_server.php:62
-#: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2882
-#: ../../boot.php:720
+#: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2991
+#: ../../boot.php:767
 msgid "Administrator"
 msgstr ""
 
@@ -1758,7 +1899,7 @@ msgid ""
 "Password reset failed."
 msgstr ""
 
-#: ../../mod/lostpass.php:83 ../../boot.php:852
+#: ../../mod/lostpass.php:83 ../../boot.php:899
 msgid "Password Reset"
 msgstr ""
 
@@ -1830,7 +1971,7 @@ msgstr ""
 msgid "Remove account"
 msgstr ""
 
-#: ../../mod/settings.php:89 ../../mod/admin.php:751 ../../mod/admin.php:956
+#: ../../mod/settings.php:89 ../../mod/admin.php:753 ../../mod/admin.php:958
 #: ../../addon/dav/layout.fnk.php:116 ../../addon/mathjax/mathjax.php:36
 #: ../../view/theme/diabook/theme.php:643
 #: ../../view/theme/diabook/theme.php:773 ../../include/nav.php:137
@@ -1893,7 +2034,7 @@ msgstr ""
 msgid "Private forum has no privacy permissions and no default privacy group."
 msgstr ""
 
-#: ../../mod/settings.php:484 ../../addon/facebook/facebook.php:493
+#: ../../mod/settings.php:484 ../../addon/facebook/facebook.php:495
 #: ../../addon/impressum/impressum.php:77
 #: ../../addon/openstreetmap/openstreetmap.php:80
 #: ../../addon/mathjax/mathjax.php:66 ../../addon/piwik/piwik.php:105
@@ -2151,7 +2292,7 @@ msgstr ""
 msgid "Profile is <strong>not published</strong>."
 msgstr ""
 
-#: ../../mod/settings.php:939 ../../mod/profile_photo.php:213
+#: ../../mod/settings.php:939 ../../mod/profile_photo.php:214
 msgid "or"
 msgstr ""
 
@@ -2409,18 +2550,6 @@ msgstr[1] ""
 msgid "Private messages to this group are at risk of public disclosure."
 msgstr ""
 
-#: ../../mod/network.php:436
-msgid "No such group"
-msgstr ""
-
-#: ../../mod/network.php:447
-msgid "Group is empty"
-msgstr ""
-
-#: ../../mod/network.php:451
-msgid "Group: "
-msgstr ""
-
 #: ../../mod/network.php:461
 msgid "Contact: "
 msgstr ""
@@ -2433,12 +2562,12 @@ msgstr ""
 msgid "Invalid contact."
 msgstr ""
 
-#: ../../mod/notes.php:44 ../../boot.php:1555
+#: ../../mod/notes.php:44 ../../boot.php:1602
 msgid "Personal Notes"
 msgstr ""
 
 #: ../../mod/notes.php:63 ../../mod/filer.php:30
-#: ../../addon/facebook/facebook.php:768
+#: ../../addon/facebook/facebook.php:770
 #: ../../addon/privacy_image_cache/privacy_image_cache.php:187
 #: ../../addon/dav/layout.fnk.php:384 ../../include/text.php:652
 msgid "Save"
@@ -2473,12 +2602,12 @@ msgstr ""
 msgid "No recipient."
 msgstr ""
 
-#: ../../mod/wallmessage.php:124 ../../mod/message.php:172
-#: ../../include/conversation.php:947
+#: ../../mod/wallmessage.php:124 ../../mod/message.php:250
+#: ../../include/conversation.php:1019
 msgid "Please enter a link URL:"
 msgstr ""
 
-#: ../../mod/wallmessage.php:131 ../../mod/message.php:200
+#: ../../mod/wallmessage.php:131 ../../mod/message.php:278
 msgid "Send Private Message"
 msgstr ""
 
@@ -2489,18 +2618,18 @@ msgid ""
 "your site allow private mail from unknown senders."
 msgstr ""
 
-#: ../../mod/wallmessage.php:133 ../../mod/message.php:201
-#: ../../mod/message.php:399
+#: ../../mod/wallmessage.php:133 ../../mod/message.php:279
+#: ../../mod/message.php:462
 msgid "To:"
 msgstr ""
 
-#: ../../mod/wallmessage.php:134 ../../mod/message.php:206
-#: ../../mod/message.php:401
+#: ../../mod/wallmessage.php:134 ../../mod/message.php:284
+#: ../../mod/message.php:464
 msgid "Subject:"
 msgstr ""
 
-#: ../../mod/wallmessage.php:140 ../../mod/message.php:210
-#: ../../mod/message.php:404 ../../mod/invite.php:113
+#: ../../mod/wallmessage.php:140 ../../mod/message.php:288
+#: ../../mod/message.php:467 ../../mod/invite.php:113
 msgid "Your message:"
 msgstr ""
 
@@ -2684,7 +2813,7 @@ msgstr ""
 
 #: ../../mod/profperm.php:103 ../../view/theme/diabook/theme.php:128
 #: ../../include/profile_advanced.php:7 ../../include/profile_advanced.php:84
-#: ../../include/nav.php:50 ../../boot.php:1534
+#: ../../include/nav.php:50 ../../boot.php:1581
 msgid "Profile"
 msgstr ""
 
@@ -2765,7 +2894,7 @@ msgstr ""
 msgid "Your invitation ID: "
 msgstr ""
 
-#: ../../mod/register.php:255 ../../mod/admin.php:421
+#: ../../mod/register.php:255 ../../mod/admin.php:423
 msgid "Registration"
 msgstr ""
 
@@ -2788,7 +2917,7 @@ msgstr ""
 msgid "Choose a nickname: "
 msgstr ""
 
-#: ../../mod/register.php:269 ../../include/nav.php:81 ../../boot.php:818
+#: ../../mod/register.php:269 ../../include/nav.php:81 ../../boot.php:865
 msgid "Register"
 msgstr ""
 
@@ -2796,33 +2925,33 @@ msgstr ""
 msgid "People Search"
 msgstr ""
 
-#: ../../mod/like.php:144 ../../mod/like.php:301 ../../mod/tagger.php:70
-#: ../../addon/facebook/facebook.php:1584
+#: ../../mod/like.php:144 ../../mod/like.php:297 ../../mod/tagger.php:70
+#: ../../addon/facebook/facebook.php:1586
 #: ../../addon/communityhome/communityhome.php:158
 #: ../../addon/communityhome/communityhome.php:167
 #: ../../view/theme/diabook/theme.php:565
-#: ../../view/theme/diabook/theme.php:574 ../../include/diaspora.php:1710
-#: ../../include/conversation.php:48 ../../include/conversation.php:57
-#: ../../include/conversation.php:121 ../../include/conversation.php:130
+#: ../../view/theme/diabook/theme.php:574 ../../include/diaspora.php:1792
+#: ../../include/conversation.php:109 ../../include/conversation.php:118
+#: ../../include/conversation.php:182 ../../include/conversation.php:191
 msgid "status"
 msgstr ""
 
-#: ../../mod/like.php:161 ../../addon/facebook/facebook.php:1588
+#: ../../mod/like.php:161 ../../addon/facebook/facebook.php:1590
 #: ../../addon/communityhome/communityhome.php:172
-#: ../../view/theme/diabook/theme.php:579 ../../include/diaspora.php:1726
-#: ../../include/conversation.php:65
+#: ../../view/theme/diabook/theme.php:579 ../../include/diaspora.php:1808
+#: ../../include/conversation.php:126
 #, php-format
 msgid "%1$s likes %2$s's %3$s"
 msgstr ""
 
-#: ../../mod/like.php:163 ../../include/conversation.php:68
+#: ../../mod/like.php:163 ../../include/conversation.php:129
 #, php-format
 msgid "%1$s doesn't like %2$s's %3$s"
 msgstr ""
 
 #: ../../mod/notice.php:15 ../../mod/viewsrc.php:15 ../../mod/admin.php:159
-#: ../../mod/admin.php:700 ../../mod/admin.php:899 ../../mod/display.php:37
-#: ../../mod/display.php:142 ../../include/items.php:3326
+#: ../../mod/admin.php:702 ../../mod/admin.php:901 ../../mod/display.php:37
+#: ../../mod/display.php:142 ../../include/items.php:3470
 msgid "Item not found."
 msgstr ""
 
@@ -2831,7 +2960,7 @@ msgid "Access denied."
 msgstr ""
 
 #: ../../mod/fbrowser.php:25 ../../view/theme/diabook/theme.php:130
-#: ../../include/nav.php:51 ../../boot.php:1540
+#: ../../include/nav.php:51 ../../boot.php:1587
 msgid "Photos"
 msgstr ""
 
@@ -2852,42 +2981,42 @@ msgstr ""
 msgid "Please login."
 msgstr ""
 
-#: ../../mod/item.php:89
+#: ../../mod/item.php:90
 msgid "Unable to locate original post."
 msgstr ""
 
-#: ../../mod/item.php:258
+#: ../../mod/item.php:268
 msgid "Empty post discarded."
 msgstr ""
 
-#: ../../mod/item.php:379 ../../mod/wall_upload.php:115
-#: ../../mod/wall_upload.php:124 ../../mod/wall_upload.php:131
+#: ../../mod/item.php:389 ../../mod/wall_upload.php:122
+#: ../../mod/wall_upload.php:131 ../../mod/wall_upload.php:138
 #: ../../include/message.php:144
 msgid "Wall Photos"
 msgstr ""
 
-#: ../../mod/item.php:784
+#: ../../mod/item.php:794
 msgid "System error. Post not saved."
 msgstr ""
 
-#: ../../mod/item.php:809
+#: ../../mod/item.php:819
 #, php-format
 msgid ""
 "This message was sent to you by %s, a member of the Friendica social network."
 msgstr ""
 
-#: ../../mod/item.php:811
+#: ../../mod/item.php:821
 #, php-format
 msgid "You may visit them online at %s"
 msgstr ""
 
-#: ../../mod/item.php:812
+#: ../../mod/item.php:822
 msgid ""
 "Please contact the sender by replying to this post if you do not wish to "
 "receive these messages."
 msgstr ""
 
-#: ../../mod/item.php:814
+#: ../../mod/item.php:824
 #, php-format
 msgid "%s posted an update."
 msgstr ""
@@ -2897,7 +3026,7 @@ msgid "Image uploaded but image cropping failed."
 msgstr ""
 
 #: ../../mod/profile_photo.php:63 ../../mod/profile_photo.php:70
-#: ../../mod/profile_photo.php:77 ../../mod/profile_photo.php:266
+#: ../../mod/profile_photo.php:77 ../../mod/profile_photo.php:273
 #, php-format
 msgid "Image size reduction [%s] failed."
 msgstr ""
@@ -2917,39 +3046,39 @@ msgstr ""
 msgid "Image exceeds size limit of %d"
 msgstr ""
 
-#: ../../mod/profile_photo.php:209
+#: ../../mod/profile_photo.php:210
 msgid "Upload File:"
 msgstr ""
 
-#: ../../mod/profile_photo.php:210
+#: ../../mod/profile_photo.php:211
 msgid "Upload Profile Photo"
 msgstr ""
 
-#: ../../mod/profile_photo.php:211
+#: ../../mod/profile_photo.php:212
 msgid "Upload"
 msgstr ""
 
-#: ../../mod/profile_photo.php:213
+#: ../../mod/profile_photo.php:214
 msgid "skip this step"
 msgstr ""
 
-#: ../../mod/profile_photo.php:213
+#: ../../mod/profile_photo.php:214
 msgid "select a photo from your photo albums"
 msgstr ""
 
-#: ../../mod/profile_photo.php:226
+#: ../../mod/profile_photo.php:227
 msgid "Crop Image"
 msgstr ""
 
-#: ../../mod/profile_photo.php:227
+#: ../../mod/profile_photo.php:228
 msgid "Please adjust the image cropping for optimum viewing."
 msgstr ""
 
-#: ../../mod/profile_photo.php:229
+#: ../../mod/profile_photo.php:230
 msgid "Done Editing"
 msgstr ""
 
-#: ../../mod/profile_photo.php:257
+#: ../../mod/profile_photo.php:264
 msgid "Image uploaded successfully."
 msgstr ""
 
@@ -2979,63 +3108,63 @@ msgstr ""
 msgid "Unable to locate contact information."
 msgstr ""
 
-#: ../../mod/message.php:120
+#: ../../mod/message.php:198
 msgid "Message deleted."
 msgstr ""
 
-#: ../../mod/message.php:150
+#: ../../mod/message.php:228
 msgid "Conversation removed."
 msgstr ""
 
-#: ../../mod/message.php:247
+#: ../../mod/message.php:327
 msgid "No messages."
 msgstr ""
 
-#: ../../mod/message.php:254
+#: ../../mod/message.php:334
 #, php-format
 msgid "Unknown sender - %s"
 msgstr ""
 
-#: ../../mod/message.php:257
+#: ../../mod/message.php:337
 #, php-format
 msgid "You and %s"
 msgstr ""
 
-#: ../../mod/message.php:260
+#: ../../mod/message.php:340
 #, php-format
 msgid "%s and You"
 msgstr ""
 
-#: ../../mod/message.php:270 ../../mod/message.php:392
+#: ../../mod/message.php:350 ../../mod/message.php:455
 msgid "Delete conversation"
 msgstr ""
 
-#: ../../mod/message.php:273
+#: ../../mod/message.php:353
 msgid "D, d M Y - g:i A"
 msgstr ""
 
-#: ../../mod/message.php:275
+#: ../../mod/message.php:355
 #, php-format
 msgid "%d message"
 msgid_plural "%d messages"
 msgstr[0] ""
 msgstr[1] ""
 
-#: ../../mod/message.php:310
+#: ../../mod/message.php:390
 msgid "Message not available."
 msgstr ""
 
-#: ../../mod/message.php:375
+#: ../../mod/message.php:438
 msgid "Delete message"
 msgstr ""
 
-#: ../../mod/message.php:394
+#: ../../mod/message.php:457
 msgid ""
 "No secure communications available. You <strong>may</strong> be able to "
 "respond from the sender's profile page."
 msgstr ""
 
-#: ../../mod/message.php:398
+#: ../../mod/message.php:461
 msgid "Send Reply"
 msgstr ""
 
@@ -3052,19 +3181,19 @@ msgstr ""
 msgid "Theme settings updated."
 msgstr ""
 
-#: ../../mod/admin.php:96 ../../mod/admin.php:419
+#: ../../mod/admin.php:96 ../../mod/admin.php:421
 msgid "Site"
 msgstr ""
 
-#: ../../mod/admin.php:97 ../../mod/admin.php:655 ../../mod/admin.php:667
+#: ../../mod/admin.php:97 ../../mod/admin.php:657 ../../mod/admin.php:669
 msgid "Users"
 msgstr ""
 
-#: ../../mod/admin.php:98 ../../mod/admin.php:749 ../../mod/admin.php:791
+#: ../../mod/admin.php:98 ../../mod/admin.php:751 ../../mod/admin.php:793
 msgid "Plugins"
 msgstr ""
 
-#: ../../mod/admin.php:99 ../../mod/admin.php:954 ../../mod/admin.php:990
+#: ../../mod/admin.php:99 ../../mod/admin.php:956 ../../mod/admin.php:992
 msgid "Themes"
 msgstr ""
 
@@ -3072,7 +3201,7 @@ msgstr ""
 msgid "DB updates"
 msgstr ""
 
-#: ../../mod/admin.php:115 ../../mod/admin.php:122 ../../mod/admin.php:1077
+#: ../../mod/admin.php:115 ../../mod/admin.php:122 ../../mod/admin.php:1079
 msgid "Logs"
 msgstr ""
 
@@ -3088,553 +3217,561 @@ msgstr ""
 msgid "User registrations waiting for confirmation"
 msgstr ""
 
-#: ../../mod/admin.php:183 ../../mod/admin.php:637
+#: ../../mod/admin.php:183 ../../mod/admin.php:639
 msgid "Normal Account"
 msgstr ""
 
-#: ../../mod/admin.php:184 ../../mod/admin.php:638
+#: ../../mod/admin.php:184 ../../mod/admin.php:640
 msgid "Soapbox Account"
 msgstr ""
 
-#: ../../mod/admin.php:185 ../../mod/admin.php:639
+#: ../../mod/admin.php:185 ../../mod/admin.php:641
 msgid "Community/Celebrity Account"
 msgstr ""
 
-#: ../../mod/admin.php:186 ../../mod/admin.php:640
+#: ../../mod/admin.php:186 ../../mod/admin.php:642
 msgid "Automatic Friend Account"
 msgstr ""
 
-#: ../../mod/admin.php:205
+#: ../../mod/admin.php:187
+msgid "Blog Account"
+msgstr ""
+
+#: ../../mod/admin.php:188
+msgid "Private Forum"
+msgstr ""
+
+#: ../../mod/admin.php:207
 msgid "Message queues"
 msgstr ""
 
-#: ../../mod/admin.php:210 ../../mod/admin.php:418 ../../mod/admin.php:654
-#: ../../mod/admin.php:748 ../../mod/admin.php:790 ../../mod/admin.php:953
-#: ../../mod/admin.php:989 ../../mod/admin.php:1076
+#: ../../mod/admin.php:212 ../../mod/admin.php:420 ../../mod/admin.php:656
+#: ../../mod/admin.php:750 ../../mod/admin.php:792 ../../mod/admin.php:955
+#: ../../mod/admin.php:991 ../../mod/admin.php:1078
 msgid "Administration"
 msgstr ""
 
-#: ../../mod/admin.php:211
+#: ../../mod/admin.php:213
 msgid "Summary"
 msgstr ""
 
-#: ../../mod/admin.php:213
+#: ../../mod/admin.php:215
 msgid "Registered users"
 msgstr ""
 
-#: ../../mod/admin.php:215
+#: ../../mod/admin.php:217
 msgid "Pending registrations"
 msgstr ""
 
-#: ../../mod/admin.php:216
+#: ../../mod/admin.php:218
 msgid "Version"
 msgstr ""
 
-#: ../../mod/admin.php:218
+#: ../../mod/admin.php:220
 msgid "Active plugins"
 msgstr ""
 
-#: ../../mod/admin.php:357
+#: ../../mod/admin.php:359
 msgid "Site settings updated."
 msgstr ""
 
-#: ../../mod/admin.php:405
+#: ../../mod/admin.php:407
 msgid "Closed"
 msgstr ""
 
-#: ../../mod/admin.php:406
+#: ../../mod/admin.php:408
 msgid "Requires approval"
 msgstr ""
 
-#: ../../mod/admin.php:407
+#: ../../mod/admin.php:409
 msgid "Open"
 msgstr ""
 
-#: ../../mod/admin.php:411
+#: ../../mod/admin.php:413
 msgid "No SSL policy, links will track page SSL state"
 msgstr ""
 
-#: ../../mod/admin.php:412
+#: ../../mod/admin.php:414
 msgid "Force all links to use SSL"
 msgstr ""
 
-#: ../../mod/admin.php:413
+#: ../../mod/admin.php:415
 msgid "Self-signed certificate, use SSL for local links only (discouraged)"
 msgstr ""
 
-#: ../../mod/admin.php:422
+#: ../../mod/admin.php:424
 msgid "File upload"
 msgstr ""
 
-#: ../../mod/admin.php:423
+#: ../../mod/admin.php:425
 msgid "Policies"
 msgstr ""
 
-#: ../../mod/admin.php:424
+#: ../../mod/admin.php:426
 msgid "Advanced"
 msgstr ""
 
-#: ../../mod/admin.php:428 ../../addon/statusnet/statusnet.php:558
+#: ../../mod/admin.php:430 ../../addon/statusnet/statusnet.php:558
 msgid "Site name"
 msgstr ""
 
-#: ../../mod/admin.php:429
+#: ../../mod/admin.php:431
 msgid "Banner/Logo"
 msgstr ""
 
-#: ../../mod/admin.php:430
+#: ../../mod/admin.php:432
 msgid "System language"
 msgstr ""
 
-#: ../../mod/admin.php:431
+#: ../../mod/admin.php:433
 msgid "System theme"
 msgstr ""
 
-#: ../../mod/admin.php:431
+#: ../../mod/admin.php:433
 msgid ""
 "Default system theme - may be over-ridden by user profiles - <a href='#' "
 "id='cnftheme'>change theme settings</a>"
 msgstr ""
 
-#: ../../mod/admin.php:432
+#: ../../mod/admin.php:434
 msgid "SSL link policy"
 msgstr ""
 
-#: ../../mod/admin.php:432
+#: ../../mod/admin.php:434
 msgid "Determines whether generated links should be forced to use SSL"
 msgstr ""
 
-#: ../../mod/admin.php:433
+#: ../../mod/admin.php:435
 msgid "Maximum image size"
 msgstr ""
 
-#: ../../mod/admin.php:433
+#: ../../mod/admin.php:435
 msgid ""
 "Maximum size in bytes of uploaded images. Default is 0, which means no "
 "limits."
 msgstr ""
 
-#: ../../mod/admin.php:435
+#: ../../mod/admin.php:437
 msgid "Register policy"
 msgstr ""
 
-#: ../../mod/admin.php:436
+#: ../../mod/admin.php:438
 msgid "Register text"
 msgstr ""
 
-#: ../../mod/admin.php:436
+#: ../../mod/admin.php:438
 msgid "Will be displayed prominently on the registration page."
 msgstr ""
 
-#: ../../mod/admin.php:437
+#: ../../mod/admin.php:439
 msgid "Accounts abandoned after x days"
 msgstr ""
 
-#: ../../mod/admin.php:437
+#: ../../mod/admin.php:439
 msgid ""
 "Will not waste system resources polling external sites for abandonded "
 "accounts. Enter 0 for no time limit."
 msgstr ""
 
-#: ../../mod/admin.php:438
+#: ../../mod/admin.php:440
 msgid "Allowed friend domains"
 msgstr ""
 
-#: ../../mod/admin.php:438
+#: ../../mod/admin.php:440
 msgid ""
 "Comma separated list of domains which are allowed to establish friendships "
 "with this site. Wildcards are accepted. Empty to allow any domains"
 msgstr ""
 
-#: ../../mod/admin.php:439
+#: ../../mod/admin.php:441
 msgid "Allowed email domains"
 msgstr ""
 
-#: ../../mod/admin.php:439
+#: ../../mod/admin.php:441
 msgid ""
 "Comma separated list of domains which are allowed in email addresses for "
 "registrations to this site. Wildcards are accepted. Empty to allow any "
 "domains"
 msgstr ""
 
-#: ../../mod/admin.php:440
+#: ../../mod/admin.php:442
 msgid "Block public"
 msgstr ""
 
-#: ../../mod/admin.php:440
+#: ../../mod/admin.php:442
 msgid ""
 "Check to block public access to all otherwise public personal pages on this "
 "site unless you are currently logged in."
 msgstr ""
 
-#: ../../mod/admin.php:441
+#: ../../mod/admin.php:443
 msgid "Force publish"
 msgstr ""
 
-#: ../../mod/admin.php:441
+#: ../../mod/admin.php:443
 msgid ""
 "Check to force all profiles on this site to be listed in the site directory."
 msgstr ""
 
-#: ../../mod/admin.php:442
+#: ../../mod/admin.php:444
 msgid "Global directory update URL"
 msgstr ""
 
-#: ../../mod/admin.php:442
+#: ../../mod/admin.php:444
 msgid ""
 "URL to update the global directory. If this is not set, the global directory "
 "is completely unavailable to the application."
 msgstr ""
 
-#: ../../mod/admin.php:444
+#: ../../mod/admin.php:446
 msgid "Block multiple registrations"
 msgstr ""
 
-#: ../../mod/admin.php:444
+#: ../../mod/admin.php:446
 msgid "Disallow users to register additional accounts for use as pages."
 msgstr ""
 
-#: ../../mod/admin.php:445
+#: ../../mod/admin.php:447
 msgid "OpenID support"
 msgstr ""
 
-#: ../../mod/admin.php:445
+#: ../../mod/admin.php:447
 msgid "OpenID support for registration and logins."
 msgstr ""
 
-#: ../../mod/admin.php:446
+#: ../../mod/admin.php:448
 msgid "Fullname check"
 msgstr ""
 
-#: ../../mod/admin.php:446
+#: ../../mod/admin.php:448
 msgid ""
 "Force users to register with a space between firstname and lastname in Full "
 "name, as an antispam measure"
 msgstr ""
 
-#: ../../mod/admin.php:447
+#: ../../mod/admin.php:449
 msgid "UTF-8 Regular expressions"
 msgstr ""
 
-#: ../../mod/admin.php:447
+#: ../../mod/admin.php:449
 msgid "Use PHP UTF8 regular expressions"
 msgstr ""
 
-#: ../../mod/admin.php:448
+#: ../../mod/admin.php:450
 msgid "Show Community Page"
 msgstr ""
 
-#: ../../mod/admin.php:448
+#: ../../mod/admin.php:450
 msgid ""
 "Display a Community page showing all recent public postings on this site."
 msgstr ""
 
-#: ../../mod/admin.php:449
+#: ../../mod/admin.php:451
 msgid "Enable OStatus support"
 msgstr ""
 
-#: ../../mod/admin.php:449
+#: ../../mod/admin.php:451
 msgid ""
 "Provide built-in OStatus (identi.ca, status.net, etc.) compatibility. All "
 "communications in OStatus are public, so privacy warnings will be "
 "occasionally displayed."
 msgstr ""
 
-#: ../../mod/admin.php:450
+#: ../../mod/admin.php:452
 msgid "Enable Diaspora support"
 msgstr ""
 
-#: ../../mod/admin.php:450
+#: ../../mod/admin.php:452
 msgid "Provide built-in Diaspora network compatibility."
 msgstr ""
 
-#: ../../mod/admin.php:451
+#: ../../mod/admin.php:453
 msgid "Only allow Friendica contacts"
 msgstr ""
 
-#: ../../mod/admin.php:451
+#: ../../mod/admin.php:453
 msgid ""
 "All contacts must use Friendica protocols. All other built-in communication "
 "protocols disabled."
 msgstr ""
 
-#: ../../mod/admin.php:452
+#: ../../mod/admin.php:454
 msgid "Verify SSL"
 msgstr ""
 
-#: ../../mod/admin.php:452
+#: ../../mod/admin.php:454
 msgid ""
 "If you wish, you can turn on strict certificate checking. This will mean you "
 "cannot connect (at all) to self-signed SSL sites."
 msgstr ""
 
-#: ../../mod/admin.php:453
+#: ../../mod/admin.php:455
 msgid "Proxy user"
 msgstr ""
 
-#: ../../mod/admin.php:454
+#: ../../mod/admin.php:456
 msgid "Proxy URL"
 msgstr ""
 
-#: ../../mod/admin.php:455
+#: ../../mod/admin.php:457
 msgid "Network timeout"
 msgstr ""
 
-#: ../../mod/admin.php:455
+#: ../../mod/admin.php:457
 msgid "Value is in seconds. Set to 0 for unlimited (not recommended)."
 msgstr ""
 
-#: ../../mod/admin.php:456
+#: ../../mod/admin.php:458
 msgid "Delivery interval"
 msgstr ""
 
-#: ../../mod/admin.php:456
+#: ../../mod/admin.php:458
 msgid ""
 "Delay background delivery processes by this many seconds to reduce system "
 "load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 "
 "for large dedicated servers."
 msgstr ""
 
-#: ../../mod/admin.php:457
+#: ../../mod/admin.php:459
 msgid "Poll interval"
 msgstr ""
 
-#: ../../mod/admin.php:457
+#: ../../mod/admin.php:459
 msgid ""
 "Delay background polling processes by this many seconds to reduce system "
 "load. If 0, use delivery interval."
 msgstr ""
 
-#: ../../mod/admin.php:458
+#: ../../mod/admin.php:460
 msgid "Maximum Load Average"
 msgstr ""
 
-#: ../../mod/admin.php:458
+#: ../../mod/admin.php:460
 msgid ""
 "Maximum system load before delivery and poll processes are deferred - "
 "default 50."
 msgstr ""
 
-#: ../../mod/admin.php:472
+#: ../../mod/admin.php:474
 msgid "Update has been marked successful"
 msgstr ""
 
-#: ../../mod/admin.php:482
+#: ../../mod/admin.php:484
 #, php-format
 msgid "Executing %s failed. Check system logs."
 msgstr ""
 
-#: ../../mod/admin.php:485
+#: ../../mod/admin.php:487
 #, php-format
 msgid "Update %s was successfully applied."
 msgstr ""
 
-#: ../../mod/admin.php:489
+#: ../../mod/admin.php:491
 #, php-format
 msgid "Update %s did not return a status. Unknown if it succeeded."
 msgstr ""
 
-#: ../../mod/admin.php:492
+#: ../../mod/admin.php:494
 #, php-format
 msgid "Update function %s could not be found."
 msgstr ""
 
-#: ../../mod/admin.php:507
+#: ../../mod/admin.php:509
 msgid "No failed updates."
 msgstr ""
 
-#: ../../mod/admin.php:511
+#: ../../mod/admin.php:513
 msgid "Failed Updates"
 msgstr ""
 
-#: ../../mod/admin.php:512
+#: ../../mod/admin.php:514
 msgid ""
 "This does not include updates prior to 1139, which did not return a status."
 msgstr ""
 
-#: ../../mod/admin.php:513
+#: ../../mod/admin.php:515
 msgid "Mark success (if update was manually applied)"
 msgstr ""
 
-#: ../../mod/admin.php:514
+#: ../../mod/admin.php:516
 msgid "Attempt to execute this update step automatically"
 msgstr ""
 
-#: ../../mod/admin.php:539
+#: ../../mod/admin.php:541
 #, php-format
 msgid "%s user blocked/unblocked"
 msgid_plural "%s users blocked/unblocked"
 msgstr[0] ""
 msgstr[1] ""
 
-#: ../../mod/admin.php:546
+#: ../../mod/admin.php:548
 #, php-format
 msgid "%s user deleted"
 msgid_plural "%s users deleted"
 msgstr[0] ""
 msgstr[1] ""
 
-#: ../../mod/admin.php:585
+#: ../../mod/admin.php:587
 #, php-format
 msgid "User '%s' deleted"
 msgstr ""
 
-#: ../../mod/admin.php:593
+#: ../../mod/admin.php:595
 #, php-format
 msgid "User '%s' unblocked"
 msgstr ""
 
-#: ../../mod/admin.php:593
+#: ../../mod/admin.php:595
 #, php-format
 msgid "User '%s' blocked"
 msgstr ""
 
-#: ../../mod/admin.php:657
+#: ../../mod/admin.php:659
 msgid "select all"
 msgstr ""
 
-#: ../../mod/admin.php:658
+#: ../../mod/admin.php:660
 msgid "User registrations waiting for confirm"
 msgstr ""
 
-#: ../../mod/admin.php:659
+#: ../../mod/admin.php:661
 msgid "Request date"
 msgstr ""
 
-#: ../../mod/admin.php:659 ../../mod/admin.php:668
+#: ../../mod/admin.php:661 ../../mod/admin.php:670
 #: ../../include/contact_selectors.php:79
 msgid "Email"
 msgstr ""
 
-#: ../../mod/admin.php:660
+#: ../../mod/admin.php:662
 msgid "No registrations."
 msgstr ""
 
-#: ../../mod/admin.php:662
+#: ../../mod/admin.php:664
 msgid "Deny"
 msgstr ""
 
-#: ../../mod/admin.php:668
+#: ../../mod/admin.php:670
 msgid "Register date"
 msgstr ""
 
-#: ../../mod/admin.php:668
+#: ../../mod/admin.php:670
 msgid "Last login"
 msgstr ""
 
-#: ../../mod/admin.php:668
+#: ../../mod/admin.php:670
 msgid "Last item"
 msgstr ""
 
-#: ../../mod/admin.php:668
+#: ../../mod/admin.php:670
 msgid "Account"
 msgstr ""
 
-#: ../../mod/admin.php:670
+#: ../../mod/admin.php:672
 msgid ""
 "Selected users will be deleted!\\n\\nEverything these users had posted on "
 "this site will be permanently deleted!\\n\\nAre you sure?"
 msgstr ""
 
-#: ../../mod/admin.php:671
+#: ../../mod/admin.php:673
 msgid ""
 "The user {0} will be deleted!\\n\\nEverything this user has posted on this "
 "site will be permanently deleted!\\n\\nAre you sure?"
 msgstr ""
 
-#: ../../mod/admin.php:712
+#: ../../mod/admin.php:714
 #, php-format
 msgid "Plugin %s disabled."
 msgstr ""
 
-#: ../../mod/admin.php:716
+#: ../../mod/admin.php:718
 #, php-format
 msgid "Plugin %s enabled."
 msgstr ""
 
-#: ../../mod/admin.php:726 ../../mod/admin.php:924
+#: ../../mod/admin.php:728 ../../mod/admin.php:926
 msgid "Disable"
 msgstr ""
 
-#: ../../mod/admin.php:728 ../../mod/admin.php:926
+#: ../../mod/admin.php:730 ../../mod/admin.php:928
 msgid "Enable"
 msgstr ""
 
-#: ../../mod/admin.php:750 ../../mod/admin.php:955
+#: ../../mod/admin.php:752 ../../mod/admin.php:957
 msgid "Toggle"
 msgstr ""
 
-#: ../../mod/admin.php:758 ../../mod/admin.php:965
+#: ../../mod/admin.php:760 ../../mod/admin.php:967
 msgid "Author: "
 msgstr ""
 
-#: ../../mod/admin.php:759 ../../mod/admin.php:966
+#: ../../mod/admin.php:761 ../../mod/admin.php:968
 msgid "Maintainer: "
 msgstr ""
 
-#: ../../mod/admin.php:888
+#: ../../mod/admin.php:890
 msgid "No themes found."
 msgstr ""
 
-#: ../../mod/admin.php:947
+#: ../../mod/admin.php:949
 msgid "Screenshot"
 msgstr ""
 
-#: ../../mod/admin.php:995
+#: ../../mod/admin.php:997
 msgid "[Experimental]"
 msgstr ""
 
-#: ../../mod/admin.php:996
+#: ../../mod/admin.php:998
 msgid "[Unsupported]"
 msgstr ""
 
-#: ../../mod/admin.php:1023
+#: ../../mod/admin.php:1025
 msgid "Log settings updated."
 msgstr ""
 
-#: ../../mod/admin.php:1079
+#: ../../mod/admin.php:1081
 msgid "Clear"
 msgstr ""
 
-#: ../../mod/admin.php:1085
+#: ../../mod/admin.php:1087
 msgid "Debugging"
 msgstr ""
 
-#: ../../mod/admin.php:1086
+#: ../../mod/admin.php:1088
 msgid "Log file"
 msgstr ""
 
-#: ../../mod/admin.php:1086
+#: ../../mod/admin.php:1088
 msgid ""
 "Must be writable by web server. Relative to your Friendica top-level "
 "directory."
 msgstr ""
 
-#: ../../mod/admin.php:1087
+#: ../../mod/admin.php:1089
 msgid "Log level"
 msgstr ""
 
-#: ../../mod/admin.php:1137
+#: ../../mod/admin.php:1139
 msgid "Close"
 msgstr ""
 
-#: ../../mod/admin.php:1143
+#: ../../mod/admin.php:1145
 msgid "FTP Host"
 msgstr ""
 
-#: ../../mod/admin.php:1144
+#: ../../mod/admin.php:1146
 msgid "FTP Path"
 msgstr ""
 
-#: ../../mod/admin.php:1145
+#: ../../mod/admin.php:1147
 msgid "FTP User"
 msgstr ""
 
-#: ../../mod/admin.php:1146
+#: ../../mod/admin.php:1148
 msgid "FTP Password"
 msgstr ""
 
-#: ../../mod/profile.php:21 ../../boot.php:983
+#: ../../mod/profile.php:21 ../../boot.php:1030
 msgid "Requested profile is not available."
 msgstr ""
 
@@ -3721,6 +3858,10 @@ msgstr ""
 msgid "No contacts in common."
 msgstr ""
 
+#: ../../mod/share.php:28 ../../include/bb2diaspora.php:226
+msgid "link"
+msgstr ""
+
 #: ../../mod/display.php:135
 msgid "Item has been removed."
 msgstr ""
@@ -4017,7 +4158,7 @@ msgid ""
 "be visible to anybody using the internet."
 msgstr ""
 
-#: ../../mod/profiles.php:624 ../../mod/directory.php:111
+#: ../../mod/profiles.php:624 ../../mod/directory.php:109
 msgid "Age: "
 msgstr ""
 
@@ -4025,27 +4166,27 @@ msgstr ""
 msgid "Edit/Manage Profiles"
 msgstr ""
 
-#: ../../mod/profiles.php:664 ../../boot.php:1092
+#: ../../mod/profiles.php:664 ../../boot.php:1139
 msgid "Change profile photo"
 msgstr ""
 
-#: ../../mod/profiles.php:665 ../../boot.php:1093
+#: ../../mod/profiles.php:665 ../../boot.php:1140
 msgid "Create New Profile"
 msgstr ""
 
-#: ../../mod/profiles.php:676 ../../boot.php:1103
+#: ../../mod/profiles.php:676 ../../boot.php:1150
 msgid "Profile Image"
 msgstr ""
 
-#: ../../mod/profiles.php:678 ../../boot.php:1106
+#: ../../mod/profiles.php:678 ../../boot.php:1153
 msgid "visible to everybody"
 msgstr ""
 
-#: ../../mod/profiles.php:679 ../../boot.php:1107
+#: ../../mod/profiles.php:679 ../../boot.php:1154
 msgid "Edit visibility"
 msgstr ""
 
-#: ../../mod/filer.php:29 ../../include/conversation.php:951
+#: ../../mod/filer.php:29 ../../include/conversation.php:1023
 msgid "Save to Folder:"
 msgstr ""
 
@@ -4053,7 +4194,7 @@ msgstr ""
 msgid "- select -"
 msgstr ""
 
-#: ../../mod/tagger.php:103 ../../include/conversation.php:138
+#: ../../mod/tagger.php:103 ../../include/conversation.php:199
 #, php-format
 msgid "%1$s tagged %2$s's %3$s with %4$s"
 msgstr ""
@@ -4093,6 +4234,38 @@ msgstr ""
 msgid "No entries."
 msgstr ""
 
+#: ../../mod/babel.php:17
+msgid "Source (bbcode) text:"
+msgstr ""
+
+#: ../../mod/babel.php:25
+msgid "Source input: "
+msgstr ""
+
+#: ../../mod/babel.php:29
+msgid "bb2html: "
+msgstr ""
+
+#: ../../mod/babel.php:33
+msgid "bb2html2bb: "
+msgstr ""
+
+#: ../../mod/babel.php:37
+msgid "bb2md: "
+msgstr ""
+
+#: ../../mod/babel.php:41
+msgid "bb2md2html: "
+msgstr ""
+
+#: ../../mod/babel.php:45
+msgid "bb2dia2bb: "
+msgstr ""
+
+#: ../../mod/babel.php:49
+msgid "bb2md2html2bb: "
+msgstr ""
+
 #: ../../mod/suggest.php:38 ../../view/theme/diabook/theme.php:626
 #: ../../include/contact_widgets.php:34
 msgid "Friend Suggestions"
@@ -4120,11 +4293,30 @@ msgstr ""
 msgid "Site Directory"
 msgstr ""
 
-#: ../../mod/directory.php:114
+#: ../../mod/directory.php:112
 msgid "Gender: "
 msgstr ""
 
-#: ../../mod/directory.php:140
+#: ../../mod/directory.php:134 ../../include/profile_advanced.php:17
+#: ../../boot.php:1175
+msgid "Gender:"
+msgstr ""
+
+#: ../../mod/directory.php:136 ../../include/profile_advanced.php:37
+#: ../../boot.php:1178
+msgid "Status:"
+msgstr ""
+
+#: ../../mod/directory.php:138 ../../include/profile_advanced.php:48
+#: ../../boot.php:1180
+msgid "Homepage:"
+msgstr ""
+
+#: ../../mod/directory.php:140 ../../include/profile_advanced.php:58
+msgid "About:"
+msgstr ""
+
+#: ../../mod/directory.php:178
 msgid "No entries (some entries may be hidden)."
 msgstr ""
 
@@ -4247,8 +4439,8 @@ msgstr ""
 msgid "Unable to set contact photo."
 msgstr ""
 
-#: ../../mod/dfrn_confirm.php:477 ../../include/diaspora.php:510
-#: ../../include/conversation.php:101
+#: ../../mod/dfrn_confirm.php:477 ../../include/diaspora.php:577
+#: ../../include/conversation.php:162
 #, php-format
 msgid "%1$s is now friends with %2$s"
 msgstr ""
@@ -4315,83 +4507,83 @@ msgstr ""
 msgid "Google+ Import Settings saved."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:521
+#: ../../addon/facebook/facebook.php:523
 msgid "Facebook disabled"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:526
+#: ../../addon/facebook/facebook.php:528
 msgid "Updating contacts"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:549
+#: ../../addon/facebook/facebook.php:551
 msgid "Facebook API key is missing."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:556
+#: ../../addon/facebook/facebook.php:558
 msgid "Facebook Connect"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:562
+#: ../../addon/facebook/facebook.php:564
 msgid "Install Facebook connector for this account."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:569
+#: ../../addon/facebook/facebook.php:571
 msgid "Remove Facebook connector"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:574
+#: ../../addon/facebook/facebook.php:576
 msgid ""
 "Re-authenticate [This is necessary whenever your Facebook password is "
 "changed.]"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:581
+#: ../../addon/facebook/facebook.php:583
 msgid "Post to Facebook by default"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:587
+#: ../../addon/facebook/facebook.php:589
 msgid ""
 "Facebook friend linking has been disabled on this site. The following "
 "settings will have no effect."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:591
+#: ../../addon/facebook/facebook.php:593
 msgid ""
 "Facebook friend linking has been disabled on this site. If you disable it, "
 "you will be unable to re-enable it."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:594
+#: ../../addon/facebook/facebook.php:596
 msgid "Link all your Facebook friends and conversations on this website"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:596
+#: ../../addon/facebook/facebook.php:598
 msgid ""
 "Facebook conversations consist of your <em>profile wall</em> and your friend "
 "<em>stream</em>."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:597
+#: ../../addon/facebook/facebook.php:599
 msgid "On this website, your Facebook friend stream is only visible to you."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:598
+#: ../../addon/facebook/facebook.php:600
 msgid ""
 "The following settings determine the privacy of your Facebook profile wall "
 "on this website."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:602
+#: ../../addon/facebook/facebook.php:604
 msgid ""
 "On this website your Facebook profile wall conversations will only be "
 "visible to you"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:607
+#: ../../addon/facebook/facebook.php:609
 msgid "Do not import your Facebook profile wall conversations"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:609
+#: ../../addon/facebook/facebook.php:611
 msgid ""
 "If you choose to link conversations and leave both of these boxes unchecked, "
 "your Facebook profile wall will be merged with your profile wall on this "
@@ -4399,120 +4591,120 @@ msgid ""
 "who may see the conversations."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:614
+#: ../../addon/facebook/facebook.php:616
 msgid "Comma separated applications to ignore"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:698
+#: ../../addon/facebook/facebook.php:700
 msgid "Problems with Facebook Real-Time Updates"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:726
+#: ../../addon/facebook/facebook.php:728
 #: ../../include/contact_selectors.php:81
 msgid "Facebook"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:727
+#: ../../addon/facebook/facebook.php:729
 msgid "Facebook Connector Settings"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:742
+#: ../../addon/facebook/facebook.php:744
 msgid "Facebook API Key"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:752
+#: ../../addon/facebook/facebook.php:754
 msgid ""
 "Error: it appears that you have specified the App-ID and -Secret in your ."
 "htconfig.php file. As long as they are specified there, they cannot be set "
 "using this form.<br><br>"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:757
+#: ../../addon/facebook/facebook.php:759
 msgid ""
 "Error: the given API Key seems to be incorrect (the application access token "
 "could not be retrieved)."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:759
+#: ../../addon/facebook/facebook.php:761
 msgid "The given API Key seems to work correctly."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:761
+#: ../../addon/facebook/facebook.php:763
 msgid ""
-"The correctness of the API Key could not be detected. Somthing strange's "
+"The correctness of the API Key could not be detected. Something strange's "
 "going on."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:764
+#: ../../addon/facebook/facebook.php:766
 msgid "App-ID / API-Key"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:765
+#: ../../addon/facebook/facebook.php:767
 msgid "Application secret"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:766
+#: ../../addon/facebook/facebook.php:768
 #, php-format
 msgid "Polling Interval in minutes (minimum %1$s minutes)"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:767
+#: ../../addon/facebook/facebook.php:769
 msgid ""
 "Synchronize comments (no comments on Facebook are missed, at the cost of "
 "increased system load)"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:771
+#: ../../addon/facebook/facebook.php:773
 msgid "Real-Time Updates"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:775
+#: ../../addon/facebook/facebook.php:777
 msgid "Real-Time Updates are activated."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:776
+#: ../../addon/facebook/facebook.php:778
 msgid "Deactivate Real-Time Updates"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:778
+#: ../../addon/facebook/facebook.php:780
 msgid "Real-Time Updates not activated."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:778
+#: ../../addon/facebook/facebook.php:780
 msgid "Activate Real-Time Updates"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:797 ../../addon/dav/layout.fnk.php:360
+#: ../../addon/facebook/facebook.php:799 ../../addon/dav/layout.fnk.php:360
 msgid "The new values have been saved."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:821
+#: ../../addon/facebook/facebook.php:823
 msgid "Post to Facebook"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:919
+#: ../../addon/facebook/facebook.php:921
 msgid ""
 "Post to Facebook cancelled because of multi-network access permission "
 "conflict."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:1139
+#: ../../addon/facebook/facebook.php:1141
 msgid "View on Friendica"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:1172
+#: ../../addon/facebook/facebook.php:1174
 msgid "Facebook post failed. Queued for retry."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:1212
+#: ../../addon/facebook/facebook.php:1214
 msgid "Your Facebook connection became invalid. Please Re-authenticate."
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:1213
+#: ../../addon/facebook/facebook.php:1215
 msgid "Facebook connection became invalid"
 msgstr ""
 
-#: ../../addon/facebook/facebook.php:1214
+#: ../../addon/facebook/facebook.php:1216
 #, php-format
 msgid ""
 "Hi %1$s,\n"
@@ -4671,32 +4863,34 @@ msgstr ""
 msgid "%s - Click to open/close"
 msgstr ""
 
-#: ../../addon/page/page.php:58 ../../addon/page/page.php:88
+#: ../../addon/page/page.php:61 ../../addon/page/page.php:91
 msgid "Forums"
 msgstr ""
 
-#: ../../addon/page/page.php:73 ../../addon/page/page.php:107
-#: ../../addon/showmore/showmore.php:87 ../../include/contact_widgets.php:188
-#: ../../include/conversation.php:476 ../../boot.php:519
-msgid "show more"
+#: ../../addon/page/page.php:129
+msgid "Forums:"
 msgstr ""
 
-#: ../../addon/page/page.php:125
+#: ../../addon/page/page.php:165
 msgid "Page settings updated."
 msgstr ""
 
-#: ../../addon/page/page.php:151
+#: ../../addon/page/page.php:194
 msgid "Page Settings"
 msgstr ""
 
-#: ../../addon/page/page.php:153
+#: ../../addon/page/page.php:196
 msgid "How many forums to display on sidebar without paging"
 msgstr ""
 
-#: ../../addon/page/page.php:156
+#: ../../addon/page/page.php:199
 msgid "Randomise Page/Forum list"
 msgstr ""
 
+#: ../../addon/page/page.php:202
+msgid "Show pages/forums on profile page"
+msgstr ""
+
 #: ../../addon/planets/planets.php:150
 msgid "Planets Settings"
 msgstr ""
@@ -4709,7 +4903,7 @@ msgstr ""
 #: ../../addon/communityhome/communityhome.php:34
 #: ../../addon/communityhome/twillingham/communityhome.php:28
 #: ../../addon/communityhome/twillingham/communityhome.php:34
-#: ../../include/nav.php:64 ../../boot.php:839
+#: ../../include/nav.php:64 ../../boot.php:886
 msgid "Login"
 msgstr ""
 
@@ -4737,8 +4931,8 @@ msgid "Latest likes"
 msgstr ""
 
 #: ../../addon/communityhome/communityhome.php:155
-#: ../../view/theme/diabook/theme.php:562 ../../include/text.php:1314
-#: ../../include/conversation.php:45 ../../include/conversation.php:118
+#: ../../view/theme/diabook/theme.php:562 ../../include/text.php:1319
+#: ../../include/conversation.php:106 ../../include/conversation.php:179
 msgid "event"
 msgstr ""
 
@@ -6123,10 +6317,6 @@ msgstr ""
 msgid "Set colour scheme"
 msgstr ""
 
-#: ../../include/profile_advanced.php:17 ../../boot.php:1128
-msgid "Gender:"
-msgstr ""
-
 #: ../../include/profile_advanced.php:22
 msgid "j F, Y"
 msgstr ""
@@ -6143,19 +6333,11 @@ msgstr ""
 msgid "Age:"
 msgstr ""
 
-#: ../../include/profile_advanced.php:37 ../../boot.php:1131
-msgid "Status:"
-msgstr ""
-
 #: ../../include/profile_advanced.php:43
 #, php-format
 msgid "for %1$d %2$s"
 msgstr ""
 
-#: ../../include/profile_advanced.php:48 ../../boot.php:1133
-msgid "Homepage:"
-msgstr ""
-
 #: ../../include/profile_advanced.php:52
 msgid "Tags:"
 msgstr ""
@@ -6164,10 +6346,6 @@ msgstr ""
 msgid "Religion:"
 msgstr ""
 
-#: ../../include/profile_advanced.php:58
-msgid "About:"
-msgstr ""
-
 #: ../../include/profile_advanced.php:60
 msgid "Hobbies/Interests:"
 msgstr ""
@@ -6508,11 +6686,11 @@ msgstr ""
 msgid "Ask me"
 msgstr ""
 
-#: ../../include/event.php:20 ../../include/bb2diaspora.php:341
+#: ../../include/event.php:20 ../../include/bb2diaspora.php:393
 msgid "Starts:"
 msgstr ""
 
-#: ../../include/event.php:30 ../../include/bb2diaspora.php:349
+#: ../../include/event.php:30 ../../include/bb2diaspora.php:401
 msgid "Finishes:"
 msgstr ""
 
@@ -6556,139 +6734,139 @@ msgid_plural "%d Contacts"
 msgstr[0] ""
 msgstr[1] ""
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "Monday"
 msgstr ""
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "Tuesday"
 msgstr ""
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "Wednesday"
 msgstr ""
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "Thursday"
 msgstr ""
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "Friday"
 msgstr ""
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "Saturday"
 msgstr ""
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "Sunday"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "January"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "February"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "March"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "April"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "May"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "June"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "July"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "August"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "September"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "October"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "November"
 msgstr ""
 
-#: ../../include/text.php:839
+#: ../../include/text.php:843
 msgid "December"
 msgstr ""
 
-#: ../../include/text.php:925
+#: ../../include/text.php:929
 msgid "bytes"
 msgstr ""
 
-#: ../../include/text.php:945 ../../include/text.php:960
+#: ../../include/text.php:949 ../../include/text.php:964
 msgid "remove"
 msgstr ""
 
-#: ../../include/text.php:945 ../../include/text.php:960
+#: ../../include/text.php:949 ../../include/text.php:964
 msgid "[remove]"
 msgstr ""
 
-#: ../../include/text.php:948
+#: ../../include/text.php:952
 msgid "Categories:"
 msgstr ""
 
-#: ../../include/text.php:963
+#: ../../include/text.php:967
 msgid "Filed under:"
 msgstr ""
 
-#: ../../include/text.php:979 ../../include/text.php:991
+#: ../../include/text.php:983 ../../include/text.php:995
 msgid "Click to open/close"
 msgstr ""
 
-#: ../../include/text.php:1096 ../../include/user.php:236
+#: ../../include/text.php:1101 ../../include/user.php:236
 msgid "default"
 msgstr ""
 
-#: ../../include/text.php:1108
+#: ../../include/text.php:1113
 msgid "Select an alternate language"
 msgstr ""
 
-#: ../../include/text.php:1318
+#: ../../include/text.php:1323
 msgid "activity"
 msgstr ""
 
-#: ../../include/text.php:1320
+#: ../../include/text.php:1325
 msgid "comment"
 msgstr ""
 
-#: ../../include/text.php:1321
+#: ../../include/text.php:1326
 msgid "post"
 msgstr ""
 
-#: ../../include/text.php:1476
+#: ../../include/text.php:1481
 msgid "Item filed"
 msgstr ""
 
-#: ../../include/diaspora.php:593
+#: ../../include/diaspora.php:660
 msgid "Sharing notification from Diaspora network"
 msgstr ""
 
-#: ../../include/diaspora.php:2085
+#: ../../include/diaspora.php:2173
 msgid "Attachments:"
 msgstr ""
 
-#: ../../include/network.php:839
+#: ../../include/network.php:842
 msgid "view full size"
 msgstr ""
 
@@ -6735,7 +6913,7 @@ msgstr ""
 msgid "Contacts not in any group"
 msgstr ""
 
-#: ../../include/nav.php:46 ../../boot.php:838
+#: ../../include/nav.php:46 ../../boot.php:885
 msgid "Logout"
 msgstr ""
 
@@ -6743,7 +6921,7 @@ msgstr ""
 msgid "End this session"
 msgstr ""
 
-#: ../../include/nav.php:49 ../../boot.php:1528
+#: ../../include/nav.php:49 ../../boot.php:1575
 msgid "Status"
 msgstr ""
 
@@ -6823,11 +7001,11 @@ msgstr ""
 msgid "Manage other pages"
 msgstr ""
 
-#: ../../include/nav.php:138 ../../boot.php:1086
+#: ../../include/nav.php:138 ../../boot.php:1133
 msgid "Profiles"
 msgstr ""
 
-#: ../../include/nav.php:138 ../../boot.php:1086
+#: ../../include/nav.php:138 ../../boot.php:1133
 msgid "Manage/edit profiles"
 msgstr ""
 
@@ -6839,7 +7017,7 @@ msgstr ""
 msgid "Site setup and configuration"
 msgstr ""
 
-#: ../../include/nav.php:169
+#: ../../include/nav.php:170
 msgid "Nothing new here"
 msgstr ""
 
@@ -6989,12 +7167,12 @@ msgstr ""
 msgid "%1$d %2$s ago"
 msgstr ""
 
-#: ../../include/datetime.php:450 ../../include/items.php:1460
+#: ../../include/datetime.php:450 ../../include/items.php:1559
 #, php-format
 msgid "%s's birthday"
 msgstr ""
 
-#: ../../include/datetime.php:451 ../../include/items.php:1461
+#: ../../include/datetime.php:451 ../../include/items.php:1560
 #, php-format
 msgid "Happy Birthday %s"
 msgstr ""
@@ -7003,12 +7181,12 @@ msgstr ""
 msgid "From: "
 msgstr ""
 
-#: ../../include/bbcode.php:216 ../../include/bbcode.php:236
-msgid "$1 wrote:"
+#: ../../include/bbcode.php:102 ../../include/bbcode.php:313
+msgid "Image/photo"
 msgstr ""
 
-#: ../../include/bbcode.php:251 ../../include/bbcode.php:328
-msgid "Image/photo"
+#: ../../include/bbcode.php:278 ../../include/bbcode.php:298
+msgid "$1 wrote:"
 msgstr ""
 
 #: ../../include/dba.php:41
@@ -7066,129 +7244,129 @@ msgstr ""
 msgid "Please visit %s to view and/or reply to your private messages."
 msgstr ""
 
-#: ../../include/enotify.php:73
+#: ../../include/enotify.php:87
 #, php-format
 msgid "%1$s commented on [url=%2$s]a %3$s[/url]"
 msgstr ""
 
-#: ../../include/enotify.php:80
+#: ../../include/enotify.php:94
 #, php-format
 msgid "%1$s commented on [url=%2$s]%3$s's %4$s[/url]"
 msgstr ""
 
-#: ../../include/enotify.php:88
+#: ../../include/enotify.php:102
 #, php-format
 msgid "%1$s commented on [url=%2$s]your %3$s[/url]"
 msgstr ""
 
-#: ../../include/enotify.php:98
+#: ../../include/enotify.php:112
 #, php-format
 msgid "[Friendica:Notify] Comment to conversation #%1$d by %2$s"
 msgstr ""
 
-#: ../../include/enotify.php:99
+#: ../../include/enotify.php:113
 #, php-format
 msgid "%s commented on an item/conversation you have been following."
 msgstr ""
 
-#: ../../include/enotify.php:102 ../../include/enotify.php:117
-#: ../../include/enotify.php:130 ../../include/enotify.php:143
+#: ../../include/enotify.php:116 ../../include/enotify.php:131
+#: ../../include/enotify.php:144 ../../include/enotify.php:157
 #, php-format
 msgid "Please visit %s to view and/or reply to the conversation."
 msgstr ""
 
-#: ../../include/enotify.php:109
+#: ../../include/enotify.php:123
 #, php-format
 msgid "[Friendica:Notify] %s posted to your profile wall"
 msgstr ""
 
-#: ../../include/enotify.php:111
+#: ../../include/enotify.php:125
 #, php-format
 msgid "%1$s posted to your profile wall at %2$s"
 msgstr ""
 
-#: ../../include/enotify.php:113
+#: ../../include/enotify.php:127
 #, php-format
-msgid "%1$s posted to [url=%2s]your wall[/url]"
+msgid "%1$s posted to [url=%2$s]your wall[/url]"
 msgstr ""
 
-#: ../../include/enotify.php:124
+#: ../../include/enotify.php:138
 #, php-format
 msgid "[Friendica:Notify] %s tagged you"
 msgstr ""
 
-#: ../../include/enotify.php:125
+#: ../../include/enotify.php:139
 #, php-format
 msgid "%1$s tagged you at %2$s"
 msgstr ""
 
-#: ../../include/enotify.php:126
+#: ../../include/enotify.php:140
 #, php-format
 msgid "%1$s [url=%2$s]tagged you[/url]."
 msgstr ""
 
-#: ../../include/enotify.php:137
+#: ../../include/enotify.php:151
 #, php-format
 msgid "[Friendica:Notify] %s tagged your post"
 msgstr ""
 
-#: ../../include/enotify.php:138
+#: ../../include/enotify.php:152
 #, php-format
 msgid "%1$s tagged your post at %2$s"
 msgstr ""
 
-#: ../../include/enotify.php:139
+#: ../../include/enotify.php:153
 #, php-format
 msgid "%1$s tagged [url=%2$s]your post[/url]"
 msgstr ""
 
-#: ../../include/enotify.php:150
+#: ../../include/enotify.php:164
 msgid "[Friendica:Notify] Introduction received"
 msgstr ""
 
-#: ../../include/enotify.php:151
+#: ../../include/enotify.php:165
 #, php-format
 msgid "You've received an introduction from '%1$s' at %2$s"
 msgstr ""
 
-#: ../../include/enotify.php:152
+#: ../../include/enotify.php:166
 #, php-format
 msgid "You've received [url=%1$s]an introduction[/url] from %2$s."
 msgstr ""
 
-#: ../../include/enotify.php:155 ../../include/enotify.php:173
+#: ../../include/enotify.php:169 ../../include/enotify.php:187
 #, php-format
 msgid "You may visit their profile at %s"
 msgstr ""
 
-#: ../../include/enotify.php:157
+#: ../../include/enotify.php:171
 #, php-format
 msgid "Please visit %s to approve or reject the introduction."
 msgstr ""
 
-#: ../../include/enotify.php:164
+#: ../../include/enotify.php:178
 msgid "[Friendica:Notify] Friend suggestion received"
 msgstr ""
 
-#: ../../include/enotify.php:165
+#: ../../include/enotify.php:179
 #, php-format
 msgid "You've received a friend suggestion from '%1$s' at %2$s"
 msgstr ""
 
-#: ../../include/enotify.php:166
+#: ../../include/enotify.php:180
 #, php-format
 msgid "You've received [url=%1$s]a friend suggestion[/url] for %2$s from %3$s."
 msgstr ""
 
-#: ../../include/enotify.php:171
+#: ../../include/enotify.php:185
 msgid "Name:"
 msgstr ""
 
-#: ../../include/enotify.php:172
+#: ../../include/enotify.php:186
 msgid "Photo:"
 msgstr ""
 
-#: ../../include/enotify.php:175
+#: ../../include/enotify.php:189
 #, php-format
 msgid "Please visit %s to approve or reject the suggestion."
 msgstr ""
@@ -7248,18 +7426,23 @@ msgstr ""
 msgid "following"
 msgstr ""
 
-#: ../../include/items.php:2880
+#: ../../include/items.php:2989
 msgid "A new person is sharing with you at "
 msgstr ""
 
-#: ../../include/items.php:2880
+#: ../../include/items.php:2989
 msgid "You have a new follower at "
 msgstr ""
 
-#: ../../include/items.php:3512
+#: ../../include/items.php:3658
 msgid "Archives"
 msgstr ""
 
+#: ../../include/bb2diaspora.php:226 ../../include/bb2diaspora.php:236
+#: ../../include/bb2diaspora.php:237
+msgid "image/photo"
+msgstr ""
+
 #: ../../include/user.php:38
 msgid "An invitation is required."
 msgstr ""
@@ -7350,252 +7533,142 @@ msgstr ""
 msgid "stopped following"
 msgstr ""
 
-#: ../../include/Contact.php:218 ../../include/conversation.php:842
+#: ../../include/Contact.php:218 ../../include/conversation.php:914
 msgid "View Status"
 msgstr ""
 
-#: ../../include/Contact.php:219 ../../include/conversation.php:843
+#: ../../include/Contact.php:219 ../../include/conversation.php:915
 msgid "View Profile"
 msgstr ""
 
-#: ../../include/Contact.php:220 ../../include/conversation.php:844
+#: ../../include/Contact.php:220 ../../include/conversation.php:916
 msgid "View Photos"
 msgstr ""
 
 #: ../../include/Contact.php:221 ../../include/Contact.php:234
-#: ../../include/conversation.php:845
+#: ../../include/conversation.php:917
 msgid "Network Posts"
 msgstr ""
 
 #: ../../include/Contact.php:222 ../../include/Contact.php:234
-#: ../../include/conversation.php:846
+#: ../../include/conversation.php:918
 msgid "Edit Contact"
 msgstr ""
 
 #: ../../include/Contact.php:223 ../../include/Contact.php:234
-#: ../../include/conversation.php:847
+#: ../../include/conversation.php:919
 msgid "Send PM"
 msgstr ""
 
-#: ../../include/conversation.php:163
+#: ../../include/conversation.php:224
 msgid "post/item"
 msgstr ""
 
-#: ../../include/conversation.php:164
+#: ../../include/conversation.php:225
 #, php-format
 msgid "%1$s marked %2$s's %3$s as favorite"
 msgstr ""
 
-#: ../../include/conversation.php:327 ../../include/conversation.php:608
-msgid "Select"
-msgstr ""
-
-#: ../../include/conversation.php:344 ../../include/conversation.php:701
-#: ../../include/conversation.php:702
-#, php-format
-msgid "View %s's profile @ %s"
-msgstr ""
-
-#: ../../include/conversation.php:354 ../../include/conversation.php:713
-#, php-format
-msgid "%s from %s"
-msgstr ""
-
-#: ../../include/conversation.php:369
-msgid "View in context"
-msgstr ""
-
-#: ../../include/conversation.php:475
-#, php-format
-msgid "%d comment"
-msgid_plural "%d comments"
-msgstr[0] ""
-msgstr[1] ""
-
-#: ../../include/conversation.php:554
-msgid "like"
-msgstr ""
-
-#: ../../include/conversation.php:555
-msgid "dislike"
-msgstr ""
-
-#: ../../include/conversation.php:557
-msgid "Share this"
-msgstr ""
-
-#: ../../include/conversation.php:557
-msgid "share"
-msgstr ""
-
-#: ../../include/conversation.php:581
-msgid "Bold"
-msgstr ""
-
-#: ../../include/conversation.php:582
-msgid "Italic"
-msgstr ""
-
-#: ../../include/conversation.php:583
-msgid "Underline"
-msgstr ""
-
-#: ../../include/conversation.php:584
-msgid "Quote"
-msgstr ""
-
-#: ../../include/conversation.php:585
-msgid "Code"
-msgstr ""
-
-#: ../../include/conversation.php:586
-msgid "Image"
-msgstr ""
-
-#: ../../include/conversation.php:587
-msgid "Link"
-msgstr ""
-
-#: ../../include/conversation.php:588
-msgid "Video"
-msgstr ""
-
-#: ../../include/conversation.php:621
-msgid "add star"
-msgstr ""
-
-#: ../../include/conversation.php:622
-msgid "remove star"
-msgstr ""
-
-#: ../../include/conversation.php:623
-msgid "toggle star status"
-msgstr ""
-
-#: ../../include/conversation.php:626
-msgid "starred"
-msgstr ""
-
-#: ../../include/conversation.php:627
-msgid "add tag"
-msgstr ""
-
-#: ../../include/conversation.php:631
-msgid "save to folder"
-msgstr ""
-
-#: ../../include/conversation.php:703
-msgid "to"
-msgstr ""
-
-#: ../../include/conversation.php:704
-msgid "Wall-to-Wall"
-msgstr ""
-
-#: ../../include/conversation.php:705
-msgid "via Wall-To-Wall:"
-msgstr ""
-
-#: ../../include/conversation.php:750
+#: ../../include/conversation.php:822
 msgid "Delete Selected Items"
 msgstr ""
 
-#: ../../include/conversation.php:905
+#: ../../include/conversation.php:977
 #, php-format
 msgid "%s likes this."
 msgstr ""
 
-#: ../../include/conversation.php:905
+#: ../../include/conversation.php:977
 #, php-format
 msgid "%s doesn't like this."
 msgstr ""
 
-#: ../../include/conversation.php:909
+#: ../../include/conversation.php:981
 #, php-format
 msgid "<span  %1$s>%2$d people</span> like this."
 msgstr ""
 
-#: ../../include/conversation.php:911
+#: ../../include/conversation.php:983
 #, php-format
 msgid "<span  %1$s>%2$d people</span> don't like this."
 msgstr ""
 
-#: ../../include/conversation.php:917
+#: ../../include/conversation.php:989
 msgid "and"
 msgstr ""
 
-#: ../../include/conversation.php:920
+#: ../../include/conversation.php:992
 #, php-format
 msgid ", and %d other people"
 msgstr ""
 
-#: ../../include/conversation.php:921
+#: ../../include/conversation.php:993
 #, php-format
 msgid "%s like this."
 msgstr ""
 
-#: ../../include/conversation.php:921
+#: ../../include/conversation.php:993
 #, php-format
 msgid "%s don't like this."
 msgstr ""
 
-#: ../../include/conversation.php:946
+#: ../../include/conversation.php:1018
 msgid "Visible to <strong>everybody</strong>"
 msgstr ""
 
-#: ../../include/conversation.php:948
+#: ../../include/conversation.php:1020
 msgid "Please enter a video link/URL:"
 msgstr ""
 
-#: ../../include/conversation.php:949
+#: ../../include/conversation.php:1021
 msgid "Please enter an audio link/URL:"
 msgstr ""
 
-#: ../../include/conversation.php:950
+#: ../../include/conversation.php:1022
 msgid "Tag term:"
 msgstr ""
 
-#: ../../include/conversation.php:952
+#: ../../include/conversation.php:1024
 msgid "Where are you right now?"
 msgstr ""
 
-#: ../../include/conversation.php:995
+#: ../../include/conversation.php:1067
 msgid "upload photo"
 msgstr ""
 
-#: ../../include/conversation.php:997
+#: ../../include/conversation.php:1069
 msgid "attach file"
 msgstr ""
 
-#: ../../include/conversation.php:999
+#: ../../include/conversation.php:1071
 msgid "web link"
 msgstr ""
 
-#: ../../include/conversation.php:1000
+#: ../../include/conversation.php:1072
 msgid "Insert video link"
 msgstr ""
 
-#: ../../include/conversation.php:1001
+#: ../../include/conversation.php:1073
 msgid "video link"
 msgstr ""
 
-#: ../../include/conversation.php:1002
+#: ../../include/conversation.php:1074
 msgid "Insert audio link"
 msgstr ""
 
-#: ../../include/conversation.php:1003
+#: ../../include/conversation.php:1075
 msgid "audio link"
 msgstr ""
 
-#: ../../include/conversation.php:1005
+#: ../../include/conversation.php:1077
 msgid "set location"
 msgstr ""
 
-#: ../../include/conversation.php:1007
+#: ../../include/conversation.php:1079
 msgid "clear location"
 msgstr ""
 
-#: ../../include/conversation.php:1014
+#: ../../include/conversation.php:1086
 msgid "permissions"
 msgstr ""
 
@@ -7611,96 +7684,96 @@ msgstr ""
 msgid "This action is not available under your subscription plan."
 msgstr ""
 
-#: ../../boot.php:517
+#: ../../boot.php:564
 msgid "Delete this item?"
 msgstr ""
 
-#: ../../boot.php:520
+#: ../../boot.php:567
 msgid "show fewer"
 msgstr ""
 
-#: ../../boot.php:715
+#: ../../boot.php:762
 #, php-format
 msgid "Update %s failed. See error logs."
 msgstr ""
 
-#: ../../boot.php:717
+#: ../../boot.php:764
 #, php-format
 msgid "Update Error at %s"
 msgstr ""
 
-#: ../../boot.php:817
+#: ../../boot.php:864
 msgid "Create a New Account"
 msgstr ""
 
-#: ../../boot.php:841
+#: ../../boot.php:888
 msgid "Nickname or Email address: "
 msgstr ""
 
-#: ../../boot.php:842
+#: ../../boot.php:889
 msgid "Password: "
 msgstr ""
 
-#: ../../boot.php:845
+#: ../../boot.php:892
 msgid "Or login using OpenID: "
 msgstr ""
 
-#: ../../boot.php:851
+#: ../../boot.php:898
 msgid "Forgot your password?"
 msgstr ""
 
-#: ../../boot.php:1018
+#: ../../boot.php:1065
 msgid "Edit profile"
 msgstr ""
 
-#: ../../boot.php:1078
+#: ../../boot.php:1125
 msgid "Message"
 msgstr ""
 
-#: ../../boot.php:1194 ../../boot.php:1273
+#: ../../boot.php:1241 ../../boot.php:1320
 msgid "g A l F d"
 msgstr ""
 
-#: ../../boot.php:1195 ../../boot.php:1274
+#: ../../boot.php:1242 ../../boot.php:1321
 msgid "F d"
 msgstr ""
 
-#: ../../boot.php:1240 ../../boot.php:1314
+#: ../../boot.php:1287 ../../boot.php:1361
 msgid "[today]"
 msgstr ""
 
-#: ../../boot.php:1252
+#: ../../boot.php:1299
 msgid "Birthday Reminders"
 msgstr ""
 
-#: ../../boot.php:1253
+#: ../../boot.php:1300
 msgid "Birthdays this week:"
 msgstr ""
 
-#: ../../boot.php:1307
+#: ../../boot.php:1354
 msgid "[No description]"
 msgstr ""
 
-#: ../../boot.php:1325
+#: ../../boot.php:1372
 msgid "Event Reminders"
 msgstr ""
 
-#: ../../boot.php:1326
+#: ../../boot.php:1373
 msgid "Events this week:"
 msgstr ""
 
-#: ../../boot.php:1531
+#: ../../boot.php:1578
 msgid "Status Messages and Posts"
 msgstr ""
 
-#: ../../boot.php:1537
+#: ../../boot.php:1584
 msgid "Profile Details"
 msgstr ""
 
-#: ../../boot.php:1552
+#: ../../boot.php:1599
 msgid "Events and Calendar"
 msgstr ""
 
-#: ../../boot.php:1558
+#: ../../boot.php:1605
 msgid "Only You Can See This"
 msgstr ""
old mode 100644 (file)
new mode 100755 (executable)
diff --git a/view/content.tpl b/view/content.tpl
new file mode 100644 (file)
index 0000000..466045d
--- /dev/null
@@ -0,0 +1,2 @@
+<div id="content-begin"></div>
+<div id="content-end"></div>
index aad63b62ab85d35d13e0479c490223df94779bd7..26d1a3c23ab139efc279570c2a08caf8e3dcff29 100644 (file)
@@ -8,7 +8,7 @@ Se vi NE petis tiun ŝanĝon, bonvolu NE KLAKU la
 sekvantan ligilon kaj ignoru aŭ forvisu ĉi-mesaĝon. 
 
 Ni ne ŝanĝu vian pasvorton se ni ne povas kontroli ĉu estas vi
-kiu petis lala ŝanĝon. 
+kiu petis la ŝanĝon. 
 
 Sekvu ĉi tion ligilon por konfirmi vian identecon:
 
index 390dea96c0a5c38d2912ff4c169bf11a1899b937..26d823d7343f5897c8980cbecc2753612b4f3ea6 100644 (file)
@@ -9,10 +9,10 @@ msgid ""
 msgstr ""
 "Project-Id-Version: friendica\n"
 "Report-Msgid-Bugs-To: http://bugs.friendica.com/\n"
-"POT-Creation-Date: 2012-05-10 10:00-0700\n"
-"PO-Revision-Date: 2012-05-11 22:39+0000\n"
+"POT-Creation-Date: 2012-06-30 10:00-0700\n"
+"PO-Revision-Date: 2012-07-01 16:55+0000\n"
 "Last-Translator: Martin Schmitt <mas@scsy.de>\n"
-"Language-Team: Esperanto (http://www.transifex.net/projects/p/friendica/language/eo/)\n"
+"Language-Team: Esperanto (http://www.transifex.com/projects/p/friendica/language/eo/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -37,27 +37,28 @@ msgid "Contact update failed."
 msgstr "Ĝisdatigo de kontakto malsukcesis."
 
 #: ../../mod/crepair.php:115 ../../mod/wall_attach.php:44
-#: ../../mod/fsuggest.php:78 ../../mod/events.php:138 ../../mod/api.php:26
-#: ../../mod/api.php:31 ../../mod/photos.php:130 ../../mod/photos.php:865
-#: ../../mod/editpost.php:10 ../../mod/install.php:171
-#: ../../mod/notifications.php:66 ../../mod/contacts.php:125
-#: ../../mod/settings.php:104 ../../mod/settings.php:521
-#: ../../mod/settings.php:526 ../../mod/manage.php:86 ../../mod/network.php:6
+#: ../../mod/fsuggest.php:78 ../../mod/events.php:140 ../../mod/api.php:26
+#: ../../mod/api.php:31 ../../mod/photos.php:135 ../../mod/photos.php:951
+#: ../../mod/editpost.php:10 ../../mod/install.php:151
+#: ../../mod/notifications.php:66 ../../mod/contacts.php:145
+#: ../../mod/settings.php:106 ../../mod/settings.php:537
+#: ../../mod/settings.php:542 ../../mod/manage.php:86 ../../mod/network.php:6
 #: ../../mod/notes.php:20 ../../mod/wallmessage.php:9
 #: ../../mod/wallmessage.php:33 ../../mod/wallmessage.php:79
 #: ../../mod/wallmessage.php:103 ../../mod/attach.php:33
 #: ../../mod/group.php:19 ../../mod/viewcontacts.php:22
 #: ../../mod/register.php:38 ../../mod/regmod.php:116 ../../mod/item.php:124
 #: ../../mod/item.php:140 ../../mod/profile_photo.php:19
-#: ../../mod/profile_photo.php:139 ../../mod/profile_photo.php:150
-#: ../../mod/profile_photo.php:163 ../../mod/message.php:44
-#: ../../mod/message.php:96 ../../mod/allfriends.php:9
+#: ../../mod/profile_photo.php:141 ../../mod/profile_photo.php:152
+#: ../../mod/profile_photo.php:165 ../../mod/message.php:45
+#: ../../mod/message.php:97 ../../mod/allfriends.php:9
 #: ../../mod/nogroup.php:25 ../../mod/wall_upload.php:53
-#: ../../mod/follow.php:8 ../../mod/display.php:138 ../../mod/profiles.php:7
-#: ../../mod/profiles.php:365 ../../mod/delegate.php:6
+#: ../../mod/follow.php:9 ../../mod/display.php:138 ../../mod/profiles.php:7
+#: ../../mod/profiles.php:400 ../../mod/delegate.php:6
 #: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81
-#: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:495
-#: ../../include/items.php:3202 ../../index.php:306
+#: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:508
+#: ../../addon/facebook/facebook.php:514 ../../addon/dav/layout.fnk.php:353
+#: ../../include/items.php:3455 ../../index.php:309
 msgid "Permission denied."
 msgstr "Malpermesita."
 
@@ -86,8 +87,8 @@ msgstr "Bonvolu klaki 'malantaŭen' en via retesplorilo <strong>nun</strong> se
 msgid "Return to contact editor"
 msgstr "Reen al kontakta redaktilo"
 
-#: ../../mod/crepair.php:148 ../../mod/settings.php:541
-#: ../../mod/settings.php:567 ../../mod/admin.php:643 ../../mod/admin.php:652
+#: ../../mod/crepair.php:148 ../../mod/settings.php:557
+#: ../../mod/settings.php:583 ../../mod/admin.php:659 ../../mod/admin.php:668
 msgid "Name"
 msgstr "Nomo"
 
@@ -124,27 +125,33 @@ msgid "New photo from this URL"
 msgstr "Nova bildo el tiu adreso"
 
 #: ../../mod/crepair.php:166 ../../mod/fsuggest.php:107
-#: ../../mod/events.php:428 ../../mod/photos.php:900 ../../mod/photos.php:958
-#: ../../mod/photos.php:1193 ../../mod/photos.php:1233
-#: ../../mod/photos.php:1273 ../../mod/photos.php:1304
-#: ../../mod/install.php:251 ../../mod/install.php:289
-#: ../../mod/localtime.php:45 ../../mod/contacts.php:322
-#: ../../mod/settings.php:539 ../../mod/settings.php:685
-#: ../../mod/settings.php:746 ../../mod/settings.php:940
-#: ../../mod/manage.php:109 ../../mod/group.php:85 ../../mod/admin.php:404
-#: ../../mod/admin.php:640 ../../mod/admin.php:776 ../../mod/admin.php:975
-#: ../../mod/admin.php:1062 ../../mod/profiles.php:534
-#: ../../mod/invite.php:119 ../../addon/facebook/facebook.php:597
+#: ../../mod/events.php:436 ../../mod/photos.php:986 ../../mod/photos.php:1057
+#: ../../mod/photos.php:1303 ../../mod/photos.php:1343
+#: ../../mod/photos.php:1383 ../../mod/photos.php:1414
+#: ../../mod/install.php:246 ../../mod/install.php:284
+#: ../../mod/localtime.php:45 ../../mod/contacts.php:343
+#: ../../mod/settings.php:555 ../../mod/settings.php:709
+#: ../../mod/settings.php:770 ../../mod/settings.php:971
+#: ../../mod/group.php:85 ../../mod/message.php:216 ../../mod/message.php:410
+#: ../../mod/admin.php:420 ../../mod/admin.php:656 ../../mod/admin.php:792
+#: ../../mod/admin.php:991 ../../mod/admin.php:1078 ../../mod/profiles.php:569
+#: ../../mod/invite.php:119 ../../addon/fromgplus/fromgplus.php:40
+#: ../../addon/facebook/facebook.php:617
+#: ../../addon/snautofollow/snautofollow.php:64
 #: ../../addon/yourls/yourls.php:76 ../../addon/ljpost/ljpost.php:93
-#: ../../addon/nsfw/nsfw.php:57 ../../addon/planets/planets.php:158
+#: ../../addon/nsfw/nsfw.php:57 ../../addon/page/page.php:208
+#: ../../addon/planets/planets.php:158
 #: ../../addon/uhremotestorage/uhremotestorage.php:89
 #: ../../addon/randplace/randplace.php:177 ../../addon/dwpost/dwpost.php:93
-#: ../../addon/drpost/drpost.php:110 ../../addon/geonames/geonames.php:187
-#: ../../addon/oembed.old/oembed.php:41 ../../addon/impressum/impressum.php:82
-#: ../../addon/blockem/blockem.php:57 ../../addon/qcomment/qcomment.php:61
+#: ../../addon/drpost/drpost.php:110 ../../addon/startpage/startpage.php:92
+#: ../../addon/geonames/geonames.php:187 ../../addon/oembed.old/oembed.php:41
+#: ../../addon/impressum/impressum.php:82
+#: ../../addon/notimeline/notimeline.php:64 ../../addon/blockem/blockem.php:57
+#: ../../addon/qcomment/qcomment.php:61
 #: ../../addon/openstreetmap/openstreetmap.php:70
-#: ../../addon/mathjax/mathjax.php:42 ../../addon/editplain/editplain.php:84
-#: ../../addon/blackout/blackout.php:94 ../../addon/gravatar/gravatar.php:86
+#: ../../addon/libertree/libertree.php:90 ../../addon/mathjax/mathjax.php:42
+#: ../../addon/editplain/editplain.php:84 ../../addon/blackout/blackout.php:98
+#: ../../addon/gravatar/gravatar.php:86
 #: ../../addon/pageheader/pageheader.php:55 ../../addon/ijpost/ijpost.php:93
 #: ../../addon/jappixmini/jappixmini.php:302
 #: ../../addon/statusnet/statusnet.php:278
@@ -152,18 +159,18 @@ msgstr "Nova bildo el tiu adreso"
 #: ../../addon/statusnet/statusnet.php:318
 #: ../../addon/statusnet/statusnet.php:325
 #: ../../addon/statusnet/statusnet.php:353
-#: ../../addon/statusnet/statusnet.php:553 ../../addon/tumblr/tumblr.php:90
+#: ../../addon/statusnet/statusnet.php:567 ../../addon/tumblr/tumblr.php:90
 #: ../../addon/numfriends/numfriends.php:85 ../../addon/gnot/gnot.php:88
-#: ../../addon/wppost/wppost.php:102 ../../addon/showmore/showmore.php:48
+#: ../../addon/wppost/wppost.php:110 ../../addon/showmore/showmore.php:48
 #: ../../addon/piwik/piwik.php:89 ../../addon/twitter/twitter.php:180
-#: ../../addon/twitter/twitter.php:209 ../../addon/twitter/twitter.php:375
+#: ../../addon/twitter/twitter.php:209 ../../addon/twitter/twitter.php:387
 #: ../../addon/irc/irc.php:55 ../../addon/blogger/blogger.php:102
 #: ../../addon/posterous/posterous.php:103
 #: ../../view/theme/cleanzero/config.php:80
-#: ../../view/theme/diabook/theme.php:685
+#: ../../view/theme/diabook/theme.php:757
 #: ../../view/theme/diabook/config.php:190
 #: ../../view/theme/quattro/config.php:52 ../../view/theme/dispy/config.php:70
-#: ../../include/conversation.php:555
+#: ../../include/conversation.php:580
 msgid "Submit"
 msgstr "Sendi"
 
@@ -171,15 +178,16 @@ msgstr "Sendi"
 msgid "Help:"
 msgstr "Helpo:"
 
-#: ../../mod/help.php:34 ../../include/nav.php:86
+#: ../../mod/help.php:34 ../../addon/dav/layout.fnk.php:116
+#: ../../include/nav.php:86
 msgid "Help"
 msgstr "Helpo"
 
-#: ../../mod/help.php:38 ../../index.php:225
+#: ../../mod/help.php:38 ../../index.php:218
 msgid "Not Found"
 msgstr "Ne trovita"
 
-#: ../../mod/help.php:41 ../../index.php:228
+#: ../../mod/help.php:41 ../../index.php:221
 msgid "Page not found."
 msgstr "Paĝo ne trovita"
 
@@ -188,7 +196,7 @@ msgstr "Paĝo ne trovita"
 msgid "File exceeds size limit of %d"
 msgstr "Dosiero estas pli granda ol la limito de %d"
 
-#: ../../mod/wall_attach.php:86 ../../mod/wall_attach.php:97
+#: ../../mod/wall_attach.php:99 ../../mod/wall_attach.php:110
 msgid "File upload failed."
 msgstr "Alŝutado malsukcesis."
 
@@ -205,84 +213,93 @@ msgstr "Sugesti amikojn"
 msgid "Suggest a friend for %s"
 msgstr "Sugesti amikon por %s"
 
-#: ../../mod/events.php:65
-msgid "Event description and start time are required."
-msgstr "Okazo bezonas priskribon kaj startotempon."
+#: ../../mod/events.php:66
+msgid "Event title and start time are required."
+msgstr "Titolo kaj starttempo estas bezonataj por la okazo."
 
-#: ../../mod/events.php:258
+#: ../../mod/events.php:260
 msgid "l, F j"
 msgstr "l, F j"
 
-#: ../../mod/events.php:280
+#: ../../mod/events.php:282
 msgid "Edit event"
 msgstr "Redakti okazon"
 
-#: ../../mod/events.php:300 ../../include/text.php:1054
+#: ../../mod/events.php:304 ../../include/text.php:1065
 msgid "link to source"
 msgstr "ligilo al fonto"
 
-#: ../../mod/events.php:324 ../../view/theme/diabook/theme.php:127
-#: ../../include/nav.php:52 ../../boot.php:1499
+#: ../../mod/events.php:328 ../../view/theme/diabook/theme.php:131
+#: ../../include/nav.php:52 ../../boot.php:1559
 msgid "Events"
 msgstr "Okazoj"
 
-#: ../../mod/events.php:325
+#: ../../mod/events.php:329
 msgid "Create New Event"
 msgstr "Krei novan okazon"
 
-#: ../../mod/events.php:326
+#: ../../mod/events.php:330 ../../addon/dav/layout.fnk.php:154
 msgid "Previous"
 msgstr "antaŭa"
 
-#: ../../mod/events.php:327 ../../mod/install.php:210
+#: ../../mod/events.php:331 ../../mod/install.php:205
+#: ../../addon/dav/layout.fnk.php:157
 msgid "Next"
 msgstr "sekva"
 
-#: ../../mod/events.php:399
+#: ../../mod/events.php:404
 msgid "hour:minute"
 msgstr "horo:minuto"
 
-#: ../../mod/events.php:408
+#: ../../mod/events.php:414
 msgid "Event details"
 msgstr "Detaloj de okazo"
 
-#: ../../mod/events.php:409
+#: ../../mod/events.php:415
 #, php-format
-msgid "Format is %s %s. Starting date and Description are required."
-msgstr "Formato estas %s %s. Startotempo kaj priskribo estas bezonataj"
+msgid "Format is %s %s. Starting date and Title are required."
+msgstr "Format is %s %s. Titolo kaj starttempo estas bezonataj."
 
-#: ../../mod/events.php:411
+#: ../../mod/events.php:417
 msgid "Event Starts:"
 msgstr "Okazo startas:"
 
-#: ../../mod/events.php:414
+#: ../../mod/events.php:417 ../../mod/events.php:431
+msgid "Required"
+msgstr "Bezonata"
+
+#: ../../mod/events.php:420
 msgid "Finish date/time is not known or not relevant"
 msgstr "Fina dato/tempo ne estas konata aŭ ne bezonata"
 
-#: ../../mod/events.php:416
+#: ../../mod/events.php:422
 msgid "Event Finishes:"
 msgstr "Okazo finas:"
 
-#: ../../mod/events.php:419
+#: ../../mod/events.php:425
 msgid "Adjust for viewer timezone"
 msgstr "Agordi al horzono de la leganto"
 
-#: ../../mod/events.php:421
+#: ../../mod/events.php:427
 msgid "Description:"
 msgstr "Priskribo"
 
-#: ../../mod/events.php:423 ../../include/event.php:37
-#: ../../include/bb2diaspora.php:260 ../../boot.php:1098
+#: ../../mod/events.php:429 ../../include/event.php:40
+#: ../../include/bb2diaspora.php:357 ../../boot.php:1136
 msgid "Location:"
 msgstr "Loko:"
 
-#: ../../mod/events.php:425
+#: ../../mod/events.php:431
+msgid "Title:"
+msgstr "Titolo:"
+
+#: ../../mod/events.php:433
 msgid "Share this event"
 msgstr "Kunhavigi la okazon"
 
 #: ../../mod/tagrm.php:11 ../../mod/tagrm.php:94
-#: ../../mod/dfrn_request.php:818 ../../mod/settings.php:540
-#: ../../mod/settings.php:566 ../../addon/js_upload/js_upload.php:45
+#: ../../mod/dfrn_request.php:845 ../../mod/settings.php:556
+#: ../../mod/settings.php:582 ../../addon/js_upload/js_upload.php:45
 msgid "Cancel"
 msgstr "Nuligi"
 
@@ -325,249 +342,270 @@ msgid ""
 " and/or create new posts for you?"
 msgstr "Ĉu rajtigi ĉi tiun programon por atingi viajn afiŝojn kaj kontaktojn kaj/aŭ krei novajn afiŝojn?"
 
-#: ../../mod/api.php:105 ../../mod/dfrn_request.php:806
-#: ../../mod/settings.php:854 ../../mod/settings.php:860
-#: ../../mod/settings.php:868 ../../mod/settings.php:872
-#: ../../mod/settings.php:877 ../../mod/settings.php:883
-#: ../../mod/settings.php:889 ../../mod/settings.php:895
-#: ../../mod/settings.php:931 ../../mod/settings.php:932
-#: ../../mod/settings.php:933 ../../mod/settings.php:934
-#: ../../mod/register.php:532 ../../mod/profiles.php:511
+#: ../../mod/api.php:105 ../../mod/dfrn_request.php:833
+#: ../../mod/settings.php:887 ../../mod/settings.php:893
+#: ../../mod/settings.php:901 ../../mod/settings.php:905
+#: ../../mod/settings.php:910 ../../mod/settings.php:916
+#: ../../mod/settings.php:922 ../../mod/settings.php:928
+#: ../../mod/settings.php:958 ../../mod/settings.php:959
+#: ../../mod/settings.php:960 ../../mod/settings.php:961
+#: ../../mod/settings.php:962 ../../mod/register.php:234
+#: ../../mod/profiles.php:546
 msgid "Yes"
 msgstr "Jes"
 
-#: ../../mod/api.php:106 ../../mod/dfrn_request.php:807
-#: ../../mod/settings.php:854 ../../mod/settings.php:860
-#: ../../mod/settings.php:868 ../../mod/settings.php:872
-#: ../../mod/settings.php:877 ../../mod/settings.php:883
-#: ../../mod/settings.php:889 ../../mod/settings.php:895
-#: ../../mod/settings.php:931 ../../mod/settings.php:932
-#: ../../mod/settings.php:933 ../../mod/settings.php:934
-#: ../../mod/register.php:533 ../../mod/profiles.php:512
+#: ../../mod/api.php:106 ../../mod/dfrn_request.php:834
+#: ../../mod/settings.php:887 ../../mod/settings.php:893
+#: ../../mod/settings.php:901 ../../mod/settings.php:905
+#: ../../mod/settings.php:910 ../../mod/settings.php:916
+#: ../../mod/settings.php:922 ../../mod/settings.php:928
+#: ../../mod/settings.php:958 ../../mod/settings.php:959
+#: ../../mod/settings.php:960 ../../mod/settings.php:961
+#: ../../mod/settings.php:962 ../../mod/register.php:235
+#: ../../mod/profiles.php:547
 msgid "No"
 msgstr "Ne"
 
-#: ../../mod/photos.php:43 ../../boot.php:1493
+#: ../../mod/photos.php:46 ../../boot.php:1553
 msgid "Photo Albums"
 msgstr "Bildalbumoj"
 
-#: ../../mod/photos.php:51 ../../mod/photos.php:151 ../../mod/photos.php:879
-#: ../../mod/photos.php:950 ../../mod/photos.php:965 ../../mod/photos.php:1382
-#: ../../mod/photos.php:1394 ../../addon/communityhome/communityhome.php:110
-#: ../../view/theme/diabook/theme.php:526
+#: ../../mod/photos.php:54 ../../mod/photos.php:156 ../../mod/photos.php:965
+#: ../../mod/photos.php:1049 ../../mod/photos.php:1064
+#: ../../mod/photos.php:1492 ../../mod/photos.php:1504
+#: ../../addon/communityhome/communityhome.php:110
+#: ../../view/theme/diabook/theme.php:598
 msgid "Contact Photos"
 msgstr "Kontaktbildoj"
 
-#: ../../mod/photos.php:58 ../../mod/photos.php:975 ../../mod/photos.php:1424
+#: ../../mod/photos.php:61 ../../mod/photos.php:1074 ../../mod/photos.php:1542
 msgid "Upload New Photos"
 msgstr "Alŝuti novajn bildojn"
 
-#: ../../mod/photos.php:69 ../../mod/settings.php:20
+#: ../../mod/photos.php:72 ../../mod/settings.php:21
 msgid "everybody"
 msgstr "ĉiuj"
 
-#: ../../mod/photos.php:140
+#: ../../mod/photos.php:145
 msgid "Contact information unavailable"
 msgstr "Kontaktoj informoj ne disponeblas"
 
-#: ../../mod/photos.php:151 ../../mod/photos.php:597 ../../mod/photos.php:950
-#: ../../mod/photos.php:965 ../../mod/register.php:335
-#: ../../mod/register.php:342 ../../mod/register.php:349
-#: ../../mod/profile_photo.php:60 ../../mod/profile_photo.php:67
-#: ../../mod/profile_photo.php:74 ../../mod/profile_photo.php:174
-#: ../../mod/profile_photo.php:252 ../../mod/profile_photo.php:261
+#: ../../mod/photos.php:156 ../../mod/photos.php:660 ../../mod/photos.php:1049
+#: ../../mod/photos.php:1064 ../../mod/profile_photo.php:60
+#: ../../mod/profile_photo.php:67 ../../mod/profile_photo.php:74
+#: ../../mod/profile_photo.php:176 ../../mod/profile_photo.php:254
+#: ../../mod/profile_photo.php:263
 #: ../../addon/communityhome/communityhome.php:111
-#: ../../view/theme/diabook/theme.php:527
+#: ../../view/theme/diabook/theme.php:599 ../../include/user.php:304
+#: ../../include/user.php:311 ../../include/user.php:318
 msgid "Profile Photos"
 msgstr "Profilbildoj"
 
-#: ../../mod/photos.php:161
+#: ../../mod/photos.php:166
 msgid "Album not found."
 msgstr "Albumo ne trovita."
 
-#: ../../mod/photos.php:179 ../../mod/photos.php:959
+#: ../../mod/photos.php:184 ../../mod/photos.php:1058
 msgid "Delete Album"
 msgstr "Forviŝi albumon"
 
-#: ../../mod/photos.php:242 ../../mod/photos.php:1194
+#: ../../mod/photos.php:247 ../../mod/photos.php:1304
 msgid "Delete Photo"
 msgstr "Forviŝi bildon"
 
-#: ../../mod/photos.php:528
+#: ../../mod/photos.php:591
 msgid "was tagged in a"
 msgstr "estas markita en"
 
-#: ../../mod/photos.php:528 ../../mod/like.php:127 ../../mod/tagger.php:70
+#: ../../mod/photos.php:591 ../../mod/like.php:144 ../../mod/tagger.php:70
 #: ../../addon/communityhome/communityhome.php:163
-#: ../../view/theme/diabook/theme.php:498 ../../include/text.php:1305
-#: ../../include/diaspora.php:1654 ../../include/conversation.php:53
+#: ../../view/theme/diabook/theme.php:570 ../../include/text.php:1317
+#: ../../include/diaspora.php:1710 ../../include/conversation.php:53
 #: ../../include/conversation.php:126
 msgid "photo"
 msgstr "bildo"
 
-#: ../../mod/photos.php:528
+#: ../../mod/photos.php:591
 msgid "by"
 msgstr "de"
 
-#: ../../mod/photos.php:631 ../../addon/js_upload/js_upload.php:315
+#: ../../mod/photos.php:696 ../../addon/js_upload/js_upload.php:315
 msgid "Image exceeds size limit of "
 msgstr "Bildo estas pli granda ol la limito de"
 
-#: ../../mod/photos.php:639
+#: ../../mod/photos.php:704
 msgid "Image file is empty."
 msgstr "Bilddosiero estas malplena."
 
-#: ../../mod/photos.php:653 ../../mod/profile_photo.php:124
-#: ../../mod/wall_upload.php:83
+#: ../../mod/photos.php:736 ../../mod/profile_photo.php:126
+#: ../../mod/wall_upload.php:99
 msgid "Unable to process image."
 msgstr "Ne eblas procedi la bildon."
 
-#: ../../mod/photos.php:673 ../../mod/profile_photo.php:257
-#: ../../mod/wall_upload.php:102
+#: ../../mod/photos.php:757 ../../mod/profile_photo.php:259
+#: ../../mod/wall_upload.php:118
 msgid "Image upload failed."
 msgstr "Alŝuto de bildo malsukcesis."
 
-#: ../../mod/photos.php:759 ../../mod/community.php:16
-#: ../../mod/dfrn_request.php:732 ../../mod/viewcontacts.php:17
+#: ../../mod/photos.php:843 ../../mod/community.php:16
+#: ../../mod/dfrn_request.php:759 ../../mod/viewcontacts.php:17
 #: ../../mod/display.php:7 ../../mod/search.php:71 ../../mod/directory.php:29
 msgid "Public access denied."
 msgstr "Publika atingo ne permesita."
 
-#: ../../mod/photos.php:769
+#: ../../mod/photos.php:853
 msgid "No photos selected"
 msgstr "Neniu bildoj elektita"
 
-#: ../../mod/photos.php:846
+#: ../../mod/photos.php:932
 msgid "Access to this item is restricted."
 msgstr "Atingo al tio elemento estas limigita."
 
-#: ../../mod/photos.php:907
+#: ../../mod/photos.php:996
+#, php-format
+msgid "You have used %1$.2f Mbytes of %2$.2f Mbytes photo storage."
+msgstr "Vi uzas %1$.2f MB de %2$.2f MB bildkonservejo."
+
+#: ../../mod/photos.php:999
+#, php-format
+msgid "You have used %1$.2f Mbytes of photo storage."
+msgstr "Vi uzas %1$.2f MB de bildkonservejo."
+
+#: ../../mod/photos.php:1005
 msgid "Upload Photos"
 msgstr "Alŝuti bildojn"
 
-#: ../../mod/photos.php:910 ../../mod/photos.php:954
+#: ../../mod/photos.php:1009 ../../mod/photos.php:1053
 msgid "New album name: "
 msgstr "Nomo por nova albumo:"
 
-#: ../../mod/photos.php:911
+#: ../../mod/photos.php:1010
 msgid "or existing album name: "
 msgstr "aŭ nomo de estanta albumo:"
 
-#: ../../mod/photos.php:912
+#: ../../mod/photos.php:1011
 msgid "Do not show a status post for this upload"
 msgstr "Ne kreu statan afiŝon por tio alŝuto."
 
-#: ../../mod/photos.php:914 ../../mod/photos.php:1189
+#: ../../mod/photos.php:1013 ../../mod/photos.php:1299
 msgid "Permissions"
 msgstr "Permesoj"
 
-#: ../../mod/photos.php:969
+#: ../../mod/photos.php:1068
 msgid "Edit Album"
 msgstr "Redakti albumon"
 
-#: ../../mod/photos.php:984 ../../mod/photos.php:1407
+#: ../../mod/photos.php:1092 ../../mod/photos.php:1525
 msgid "View Photo"
 msgstr "Vidi bildon"
 
-#: ../../mod/photos.php:1019
+#: ../../mod/photos.php:1127
 msgid "Permission denied. Access to this item may be restricted."
 msgstr "Malpermesita. Atingo al tio elemento eble estas limigita."
 
-#: ../../mod/photos.php:1021
+#: ../../mod/photos.php:1129
 msgid "Photo not available"
 msgstr "La bildo ne disponeblas"
 
-#: ../../mod/photos.php:1071
+#: ../../mod/photos.php:1179
 msgid "View photo"
 msgstr "Vidi bildon"
 
-#: ../../mod/photos.php:1071
+#: ../../mod/photos.php:1179
 msgid "Edit photo"
 msgstr "Redakti bildon"
 
-#: ../../mod/photos.php:1072
+#: ../../mod/photos.php:1180
 msgid "Use as profile photo"
 msgstr "Uzi kiel profilbildo"
 
-#: ../../mod/photos.php:1078 ../../include/conversation.php:480
+#: ../../mod/photos.php:1186 ../../include/conversation.php:490
 msgid "Private Message"
 msgstr "Privata mesaĝo"
 
-#: ../../mod/photos.php:1100
+#: ../../mod/photos.php:1208
 msgid "View Full Size"
 msgstr "Vidi plengrande "
 
-#: ../../mod/photos.php:1168
+#: ../../mod/photos.php:1276
 msgid "Tags: "
 msgstr "Markoj:"
 
-#: ../../mod/photos.php:1171
+#: ../../mod/photos.php:1279
 msgid "[Remove any tag]"
 msgstr "[Forviŝi iun markon]"
 
-#: ../../mod/photos.php:1182
+#: ../../mod/photos.php:1289
+msgid "Rotate CW (right)"
+msgstr "Turni horloĝdirekte (dekstren)"
+
+#: ../../mod/photos.php:1290
+msgid "Rotate CCW (left)"
+msgstr "Turni kontraŭhorloĝdirekte (maldekstren)"
+
+#: ../../mod/photos.php:1292
 msgid "New album name"
 msgstr "Nova nomo de albumo"
 
-#: ../../mod/photos.php:1185
+#: ../../mod/photos.php:1295
 msgid "Caption"
 msgstr "Apudskribo"
 
-#: ../../mod/photos.php:1187
+#: ../../mod/photos.php:1297
 msgid "Add a Tag"
 msgstr "Aldoni markon"
 
-#: ../../mod/photos.php:1191
+#: ../../mod/photos.php:1301
 msgid ""
 "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping"
 msgstr "Ekzemple: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping"
 
-#: ../../mod/photos.php:1211 ../../include/conversation.php:529
+#: ../../mod/photos.php:1321 ../../include/conversation.php:554
 msgid "I like this (toggle)"
 msgstr "Mi ŝatas tion (ŝalti)"
 
-#: ../../mod/photos.php:1212 ../../include/conversation.php:530
+#: ../../mod/photos.php:1322 ../../include/conversation.php:555
 msgid "I don't like this (toggle)"
 msgstr "Mi malŝatas tion(ŝalti)"
 
-#: ../../mod/photos.php:1213 ../../include/conversation.php:964
+#: ../../mod/photos.php:1323 ../../include/conversation.php:993
 msgid "Share"
 msgstr "Kunhavigi"
 
-#: ../../mod/photos.php:1214 ../../mod/editpost.php:104
-#: ../../mod/wallmessage.php:145 ../../mod/message.php:213
-#: ../../mod/message.php:405 ../../include/conversation.php:361
-#: ../../include/conversation.php:706 ../../include/conversation.php:983
+#: ../../mod/photos.php:1324 ../../mod/editpost.php:104
+#: ../../mod/wallmessage.php:145 ../../mod/message.php:215
+#: ../../mod/message.php:411 ../../include/conversation.php:371
+#: ../../include/conversation.php:731 ../../include/conversation.php:1012
 msgid "Please wait"
 msgstr "Bonvolu atendi"
 
-#: ../../mod/photos.php:1230 ../../mod/photos.php:1270
-#: ../../mod/photos.php:1301 ../../include/conversation.php:552
+#: ../../mod/photos.php:1340 ../../mod/photos.php:1380
+#: ../../mod/photos.php:1411 ../../include/conversation.php:577
 msgid "This is you"
 msgstr "Tiu estas vi"
 
-#: ../../mod/photos.php:1232 ../../mod/photos.php:1272
-#: ../../mod/photos.php:1303 ../../include/conversation.php:554
-#: ../../boot.php:512
+#: ../../mod/photos.php:1342 ../../mod/photos.php:1382
+#: ../../mod/photos.php:1413 ../../include/conversation.php:579
+#: ../../boot.php:528
 msgid "Comment"
 msgstr "Komenti"
 
-#: ../../mod/photos.php:1234 ../../mod/editpost.php:125
-#: ../../include/conversation.php:564 ../../include/conversation.php:1001
+#: ../../mod/photos.php:1344 ../../mod/editpost.php:125
+#: ../../include/conversation.php:589 ../../include/conversation.php:1030
 msgid "Preview"
 msgstr "Antaŭrigardi"
 
-#: ../../mod/photos.php:1331 ../../mod/settings.php:602
-#: ../../mod/settings.php:683 ../../mod/group.php:168 ../../mod/admin.php:647
-#: ../../include/conversation.php:318 ../../include/conversation.php:584
+#: ../../mod/photos.php:1441 ../../mod/settings.php:618
+#: ../../mod/settings.php:707 ../../mod/group.php:168 ../../mod/admin.php:663
+#: ../../include/conversation.php:328 ../../include/conversation.php:609
 msgid "Delete"
 msgstr "Forviŝi"
 
-#: ../../mod/photos.php:1413
+#: ../../mod/photos.php:1531
 msgid "View Album"
 msgstr "Vidi albumon"
 
-#: ../../mod/photos.php:1422
+#: ../../mod/photos.php:1540
 msgid "Recent Photos"
 msgstr "̂Ĵusaj bildoj"
 
@@ -575,12 +613,12 @@ msgstr "̂Ĵusaj bildoj"
 msgid "Not available."
 msgstr "Ne disponebla."
 
-#: ../../mod/community.php:30 ../../view/theme/diabook/theme.php:129
+#: ../../mod/community.php:30 ../../view/theme/diabook/theme.php:133
 #: ../../include/nav.php:101
 msgid "Community"
 msgstr "Komunumo"
 
-#: ../../mod/community.php:61 ../../mod/search.php:128
+#: ../../mod/community.php:61 ../../mod/search.php:144
 msgid "No results."
 msgstr "Nenion trovita."
 
@@ -624,28 +662,28 @@ msgstr "Elemento ne trovita"
 msgid "Edit post"
 msgstr "Redakti afiŝon"
 
-#: ../../mod/editpost.php:80 ../../include/conversation.php:950
+#: ../../mod/editpost.php:80 ../../include/conversation.php:979
 msgid "Post to Email"
-msgstr "Sendi tra retpoŝto"
+msgstr "Sendi per retpoŝto"
 
-#: ../../mod/editpost.php:95 ../../mod/settings.php:601
-#: ../../include/conversation.php:571
+#: ../../mod/editpost.php:95 ../../mod/settings.php:617
+#: ../../include/conversation.php:596
 msgid "Edit"
 msgstr "Redakti"
 
 #: ../../mod/editpost.php:96 ../../mod/wallmessage.php:143
-#: ../../mod/message.php:211 ../../mod/message.php:403
-#: ../../include/conversation.php:965
+#: ../../mod/message.php:213 ../../mod/message.php:408
+#: ../../include/conversation.php:994
 msgid "Upload photo"
 msgstr "Alŝuti bildon"
 
-#: ../../mod/editpost.php:97 ../../include/conversation.php:967
+#: ../../mod/editpost.php:97 ../../include/conversation.php:996
 msgid "Attach file"
 msgstr "Kunligi dosieron"
 
 #: ../../mod/editpost.php:98 ../../mod/wallmessage.php:144
-#: ../../mod/message.php:212 ../../mod/message.php:404
-#: ../../include/conversation.php:969
+#: ../../mod/message.php:214 ../../mod/message.php:409
+#: ../../include/conversation.php:998
 msgid "Insert web link"
 msgstr "Enmeti retan adreson"
 
@@ -661,35 +699,35 @@ msgstr "Enmeti videton en formato Vorbis [.ogg]"
 msgid "Insert Vorbis [.ogg] audio"
 msgstr "Enmeti sonon en formato Vorbis [.ogg]"
 
-#: ../../mod/editpost.php:102 ../../include/conversation.php:975
+#: ../../mod/editpost.php:102 ../../include/conversation.php:1004
 msgid "Set your location"
 msgstr "Agordi vian lokon"
 
-#: ../../mod/editpost.php:103 ../../include/conversation.php:977
+#: ../../mod/editpost.php:103 ../../include/conversation.php:1006
 msgid "Clear browser location"
 msgstr "Forviŝu retesplorilan lokon"
 
-#: ../../mod/editpost.php:105 ../../include/conversation.php:984
+#: ../../mod/editpost.php:105 ../../include/conversation.php:1013
 msgid "Permission settings"
 msgstr "Permesagordoj"
 
-#: ../../mod/editpost.php:113 ../../include/conversation.php:993
+#: ../../mod/editpost.php:113 ../../include/conversation.php:1022
 msgid "CC: email addresses"
 msgstr "CC: retpoŝtadresojn"
 
-#: ../../mod/editpost.php:114 ../../include/conversation.php:994
+#: ../../mod/editpost.php:114 ../../include/conversation.php:1023
 msgid "Public post"
 msgstr "Publika afiŝo"
 
-#: ../../mod/editpost.php:117 ../../include/conversation.php:980
+#: ../../mod/editpost.php:117 ../../include/conversation.php:1009
 msgid "Set title"
 msgstr "Redakti titolon"
 
-#: ../../mod/editpost.php:119 ../../include/conversation.php:982
+#: ../../mod/editpost.php:119 ../../include/conversation.php:1011
 msgid "Categories (comma-separated list)"
 msgstr "Kategorioj (disigita per komo)"
 
-#: ../../mod/editpost.php:120 ../../include/conversation.php:996
+#: ../../mod/editpost.php:120 ../../include/conversation.php:1025
 msgid "Example: bob@example.com, mary@example.com"
 msgstr "Ekzemple: bob@example.com, mary@example.com"
 
@@ -697,201 +735,200 @@ msgstr "Ekzemple: bob@example.com, mary@example.com"
 msgid "This introduction has already been accepted."
 msgstr "Tia prezento jam estas akceptita"
 
-#: ../../mod/dfrn_request.php:117 ../../mod/dfrn_request.php:487
+#: ../../mod/dfrn_request.php:118 ../../mod/dfrn_request.php:512
 msgid "Profile location is not valid or does not contain profile information."
 msgstr "La adreso de la profilo ne validas aŭ ne enhavas profilinformojn."
 
-#: ../../mod/dfrn_request.php:122 ../../mod/dfrn_request.php:492
+#: ../../mod/dfrn_request.php:123 ../../mod/dfrn_request.php:517
 msgid "Warning: profile location has no identifiable owner name."
 msgstr "Averto: La adreso de la profilo ne enhavas identeblan personan nomon."
 
-#: ../../mod/dfrn_request.php:124 ../../mod/dfrn_request.php:494
+#: ../../mod/dfrn_request.php:125 ../../mod/dfrn_request.php:519
 msgid "Warning: profile location has no profile photo."
 msgstr "Averto: La adreso de la profilo ne enhavas bildon."
 
-#: ../../mod/dfrn_request.php:127 ../../mod/dfrn_request.php:497
+#: ../../mod/dfrn_request.php:128 ../../mod/dfrn_request.php:522
 #, php-format
 msgid "%d required parameter was not found at the given location"
 msgid_plural "%d required parameters were not found at the given location"
 msgstr[0] "%d bezonataj parametroj ne trovita ĉe la donata adreso."
 msgstr[1] "%d bezonataj parametroj ne trovita ĉe la donata adreso."
 
-#: ../../mod/dfrn_request.php:168
+#: ../../mod/dfrn_request.php:170
 msgid "Introduction complete."
 msgstr "Prezento sukcesis."
 
-#: ../../mod/dfrn_request.php:192
+#: ../../mod/dfrn_request.php:209
 msgid "Unrecoverable protocol error."
 msgstr "Neĝustigebla eraro en protokolo."
 
-#: ../../mod/dfrn_request.php:220
+#: ../../mod/dfrn_request.php:237
 msgid "Profile unavailable."
 msgstr "Profilo ne estas disponebla."
 
-#: ../../mod/dfrn_request.php:245
+#: ../../mod/dfrn_request.php:262
 #, php-format
 msgid "%s has received too many connection requests today."
 msgstr "%s hodiaŭ ricevis tro multe da konektpetoj."
 
-#: ../../mod/dfrn_request.php:246
+#: ../../mod/dfrn_request.php:263
 msgid "Spam protection measures have been invoked."
 msgstr "Kontraŭspamilo estas aktivita."
 
-#: ../../mod/dfrn_request.php:247
+#: ../../mod/dfrn_request.php:264
 msgid "Friends are advised to please try again in 24 hours."
 msgstr "Amikoj, vi bonvolu ripeti post 24 horoj."
 
-#: ../../mod/dfrn_request.php:309
+#: ../../mod/dfrn_request.php:326
 msgid "Invalid locator"
 msgstr "Nevalida adreso."
 
-#: ../../mod/dfrn_request.php:318
+#: ../../mod/dfrn_request.php:335
 msgid "Invalid email address."
 msgstr "Nevalida repoŝtadreso."
 
-#: ../../mod/dfrn_request.php:344
+#: ../../mod/dfrn_request.php:361
 msgid "This account has not been configured for email. Request failed."
 msgstr "La konto ne estas agordita por retpoŝto. La peto malsukcesis."
 
-#: ../../mod/dfrn_request.php:432
+#: ../../mod/dfrn_request.php:457
 msgid "Unable to resolve your name at the provided location."
 msgstr "Via nomo ne troveblas al la donita adreso."
 
-#: ../../mod/dfrn_request.php:445
+#: ../../mod/dfrn_request.php:470
 msgid "You have already introduced yourself here."
 msgstr "Vi vin jam prezentis tie."
 
-#: ../../mod/dfrn_request.php:449
+#: ../../mod/dfrn_request.php:474
 #, php-format
 msgid "Apparently you are already friends with %s."
 msgstr "Ŝajnas kvazaŭ vi jam amikiĝis kun %s."
 
-#: ../../mod/dfrn_request.php:470
+#: ../../mod/dfrn_request.php:495
 msgid "Invalid profile URL."
 msgstr "Nevalida adreso de profilo."
 
-#: ../../mod/dfrn_request.php:476 ../../mod/follow.php:23
+#: ../../mod/dfrn_request.php:501 ../../include/follow.php:27
 msgid "Disallowed profile URL."
 msgstr "Malpermesita adreso de profilo."
 
-#: ../../mod/dfrn_request.php:545 ../../mod/contacts.php:102
+#: ../../mod/dfrn_request.php:570 ../../mod/contacts.php:122
 msgid "Failed to update contact record."
 msgstr "Ĝisdatigo de via kontaktrikordo malsukcesis."
 
-#: ../../mod/dfrn_request.php:566
+#: ../../mod/dfrn_request.php:591
 msgid "Your introduction has been sent."
 msgstr "Via prezento estas sendita."
 
-#: ../../mod/dfrn_request.php:619
+#: ../../mod/dfrn_request.php:644
 msgid "Please login to confirm introduction."
 msgstr "Bonvolu ensaluti por jesigi la prezenton."
 
-#: ../../mod/dfrn_request.php:633
+#: ../../mod/dfrn_request.php:658
 msgid ""
 "Incorrect identity currently logged in. Please login to "
 "<strong>this</strong> profile."
 msgstr "Malĝusta identaĵo ensalutata. Bonvolu ensaluti en <strong>tiun</strong> profilon."
 
-#: ../../mod/dfrn_request.php:645
+#: ../../mod/dfrn_request.php:669
+msgid "Hide this contact"
+msgstr "Kaŝi tiun kontakton"
+
+#: ../../mod/dfrn_request.php:672
 #, php-format
 msgid "Welcome home %s."
 msgstr "Bonvenon hejme, %s."
 
-#: ../../mod/dfrn_request.php:646
+#: ../../mod/dfrn_request.php:673
 #, php-format
 msgid "Please confirm your introduction/connection request to %s."
 msgstr "Bonvolu konfirmi vian prezenton / kontaktpeton al %s."
 
-#: ../../mod/dfrn_request.php:647
+#: ../../mod/dfrn_request.php:674
 msgid "Confirm"
 msgstr "Konfirmi."
 
-#: ../../mod/dfrn_request.php:688 ../../include/items.php:2717
+#: ../../mod/dfrn_request.php:715 ../../include/items.php:2881
 msgid "[Name Withheld]"
 msgstr "[Kaŝita nomo]"
 
-#: ../../mod/dfrn_request.php:781
+#: ../../mod/dfrn_request.php:808
 msgid ""
 "Please enter your 'Identity Address' from one of the following supported "
 "communications networks:"
 msgstr "Bonvolu entajpi vian 'Identecan Adreson' de iu de tiuj subtenataj komunikaj retejoj: "
 
-#: ../../mod/dfrn_request.php:797
+#: ../../mod/dfrn_request.php:824
 msgid "<strike>Connect as an email follower</strike> (Coming soon)"
 msgstr "<strike>Konektu kiel retpoŝta sekvanto</strike> (Baldaŭ venos)"
 
-#: ../../mod/dfrn_request.php:799
+#: ../../mod/dfrn_request.php:826
 msgid ""
 "If you are not yet a member of the free social web, <a "
 "href=\"http://dir.friendica.com/siteinfo\">follow this link to find a public"
 " Friendica site and join us today</a>."
 msgstr "Se vi ne estas membro de la libra interkona reto, <a href=\"http://dir.friendica.com/siteinfo\">sekvu ĉi-ligilon por trovi publikan Friendica retejon kaj aliĝi kun ni hodiaŭ</a>."
 
-#: ../../mod/dfrn_request.php:802
+#: ../../mod/dfrn_request.php:829
 msgid "Friend/Connection Request"
 msgstr "Prezento / Konektpeto"
 
-#: ../../mod/dfrn_request.php:803
+#: ../../mod/dfrn_request.php:830
 msgid ""
 "Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, "
 "testuser@identi.ca"
 msgstr "Ekzemploj: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@identi.ca"
 
-#: ../../mod/dfrn_request.php:804
+#: ../../mod/dfrn_request.php:831
 msgid "Please answer the following:"
 msgstr "Bonvolu respondi:"
 
-#: ../../mod/dfrn_request.php:805
+#: ../../mod/dfrn_request.php:832
 #, php-format
 msgid "Does %s know you?"
 msgstr "Ĉu %s konas vin?"
 
-#: ../../mod/dfrn_request.php:808
+#: ../../mod/dfrn_request.php:835
 msgid "Add a personal note:"
 msgstr "Aldoni personan noton:"
 
-#: ../../mod/dfrn_request.php:810 ../../include/contact_selectors.php:76
+#: ../../mod/dfrn_request.php:837 ../../include/contact_selectors.php:76
 msgid "Friendica"
 msgstr "Friendica"
 
-#: ../../mod/dfrn_request.php:811
+#: ../../mod/dfrn_request.php:838
 msgid "StatusNet/Federated Social Web"
 msgstr "StatusNet/Federaciaj interkonaj retejoj"
 
-#: ../../mod/dfrn_request.php:812 ../../mod/settings.php:636
+#: ../../mod/dfrn_request.php:839 ../../mod/settings.php:652
 #: ../../include/contact_selectors.php:80
 msgid "Diaspora"
 msgstr "Diaspora"
 
-#: ../../mod/dfrn_request.php:813
+#: ../../mod/dfrn_request.php:840
 #, php-format
 msgid ""
 " - please do not use this form.  Instead, enter %s into your Diaspora search"
 " bar."
 msgstr " - bonvolu ne uzi ĉi formo.  Anstataŭe, entajpu %s en la Diaspora serĉilo."
 
-#: ../../mod/dfrn_request.php:814
+#: ../../mod/dfrn_request.php:841
 msgid "Your Identity Address:"
 msgstr "Via identeca adreso:"
 
-#: ../../mod/dfrn_request.php:817
+#: ../../mod/dfrn_request.php:844
 msgid "Submit Request"
 msgstr "Sendi peton"
 
-#: ../../mod/install.php:111
+#: ../../mod/install.php:117
 msgid "Friendica Social Communications Server - Setup"
 msgstr "Friendica Interkona Komunikada Servilo - Instalo"
 
-#: ../../mod/install.php:117 ../../mod/install.php:157
-#: ../../mod/install.php:230
-msgid "Database connection"
-msgstr "Datumbaza konekto"
-
-#: ../../mod/install.php:124
+#: ../../mod/install.php:123
 msgid "Could not connect to database."
 msgstr "Ne eblas konekti la datumbazon."
 
-#: ../../mod/install.php:128
+#: ../../mod/install.php:127
 msgid "Could not create table."
 msgstr "Ne eblas krei tabelon."
 
@@ -899,232 +936,246 @@ msgstr "Ne eblas krei tabelon."
 msgid "Your Friendica site database has been installed."
 msgstr "La datumbazo de vi Friendica retjo estas instalita."
 
-#: ../../mod/install.php:134
-msgid ""
-"IMPORTANT: You will need to [manually] setup a scheduled task for the "
-"poller."
-msgstr "GRAVA: Vi bezonas [mane] agordi planitan taskon por la Friendica poller."
-
-#: ../../mod/install.php:135 ../../mod/install.php:151
-#: ../../mod/install.php:209
-msgid "Please see the file \"INSTALL.txt\"."
-msgstr "Bonvolu legi la dosieron \"INSTALL.txt\"."
-
-#: ../../mod/install.php:137
-msgid "Proceed to registration"
-msgstr "Pluigi al la registrilo"
-
-#: ../../mod/install.php:143
-msgid "Proceed with Installation"
-msgstr "Pluigi la instalado"
-
-#: ../../mod/install.php:150
+#: ../../mod/install.php:138
 msgid ""
 "You may need to import the file \"database.sql\" manually using phpmyadmin "
 "or mysql."
-msgstr "Vi bezonas mane importi la dosieron \"database.sql\" tra phpmyadmin aŭ mysql."
+msgstr "Vi bezonas mane importi la dosieron \"database.sql\" per phpmyadmin aŭ mysql."
 
-#: ../../mod/install.php:158
-msgid "Database import failed."
-msgstr "Importo de la datumbazo malsukcesis."
+#: ../../mod/install.php:139 ../../mod/install.php:204
+#: ../../mod/install.php:489
+msgid "Please see the file \"INSTALL.txt\"."
+msgstr "Bonvolu legi la dosieron \"INSTALL.txt\"."
 
-#: ../../mod/install.php:206
+#: ../../mod/install.php:201
 msgid "System check"
 msgstr "Sistema kontrolo"
 
-#: ../../mod/install.php:211
+#: ../../mod/install.php:206
 msgid "Check again"
 msgstr "Ree kontroli"
 
-#: ../../mod/install.php:231
+#: ../../mod/install.php:225
+msgid "Database connection"
+msgstr "Datumbaza konekto"
+
+#: ../../mod/install.php:226
 msgid ""
 "In order to install Friendica we need to know how to connect to your "
 "database."
 msgstr "Por instali Friendica, ni bezonas scii kiel konekti al via datumbazo."
 
-#: ../../mod/install.php:232
+#: ../../mod/install.php:227
 msgid ""
 "Please contact your hosting provider or site administrator if you have "
 "questions about these settings."
 msgstr "Bonvolu kontakti vian servilprovizanton aŭ administranton se vi havas demandoj pri ĉi tiaj agordoj."
 
-#: ../../mod/install.php:233
+#: ../../mod/install.php:228
 msgid ""
 "The database you specify below should already exist. If it does not, please "
 "create it before continuing."
 msgstr "La datumbazo nomata malsupren jam ekzistu. Se ĝi ne ekzistas, bonvolu unue krei ĝin antaŭ progresi."
 
-#: ../../mod/install.php:237
+#: ../../mod/install.php:232
 msgid "Database Server Name"
 msgstr "Nomo de datumbaza servilo."
 
-#: ../../mod/install.php:238
+#: ../../mod/install.php:233
 msgid "Database Login Name"
 msgstr "Salutnomo ĉe la datumbazo."
 
-#: ../../mod/install.php:239
+#: ../../mod/install.php:234
 msgid "Database Login Password"
 msgstr "Pasvorto ĉe la datumbazo."
 
-#: ../../mod/install.php:240
+#: ../../mod/install.php:235
 msgid "Database Name"
 msgstr "Nomo de la datumbazo."
 
-#: ../../mod/install.php:241 ../../mod/install.php:280
+#: ../../mod/install.php:236 ../../mod/install.php:275
 msgid "Site administrator email address"
 msgstr "Retpoŝtadreso de la reteja administranto"
 
-#: ../../mod/install.php:241 ../../mod/install.php:280
+#: ../../mod/install.php:236 ../../mod/install.php:275
 msgid ""
 "Your account email address must match this in order to use the web admin "
 "panel."
 msgstr "La repoŝtadreso de via konto bezonas esti la sama por uzi la TTTa administrilo."
 
-#: ../../mod/install.php:245 ../../mod/install.php:283
+#: ../../mod/install.php:240 ../../mod/install.php:278
 msgid "Please select a default timezone for your website"
 msgstr "Bonvolu elekti defaŭltan horzonon por via retejo."
 
-#: ../../mod/install.php:270
+#: ../../mod/install.php:265
 msgid "Site settings"
 msgstr "Retejaj agordoj"
 
-#: ../../mod/install.php:323
+#: ../../mod/install.php:318
 msgid "Could not find a command line version of PHP in the web server PATH."
 msgstr "Komanda linia versio de PHP ne trovita en $PATH de la retservilo."
 
-#: ../../mod/install.php:326
+#: ../../mod/install.php:319
+msgid ""
+"If you don't have a command line version of PHP installed on server, you "
+"will not be able to run background polling via cron. See <a "
+"href='http://friendica.com/node/27'>'Activating scheduled tasks'</a>"
+msgstr "Se vi ne havas komandlinian version de PHP sur la servilo, vi ne eblas plenumi fonan planitan enketon per cron. Bonvolu legi <a href='http://friendica.com/node/27'>'Activating scheduled tasks'</a>"
+
+#: ../../mod/install.php:323
 msgid "PHP executable path"
 msgstr "Vojo de la komanda linia versio de PHP"
 
-#: ../../mod/install.php:326
-msgid "Enter full path to php executable"
-msgstr "Entajpu plenan vojon al la komanda linia versio de PHP"
+#: ../../mod/install.php:323
+msgid ""
+"Enter full path to php executable. You can leave this blank to continue the "
+"installation."
+msgstr "Entajpu la plenan vojon al la php komandodosiero. Vi eblas lasi tion malplena por pluigi la instalado."
 
-#: ../../mod/install.php:331
+#: ../../mod/install.php:328
 msgid "Command line PHP"
 msgstr "komanda linia versio de PHP"
 
-#: ../../mod/install.php:340
+#: ../../mod/install.php:337
 msgid ""
 "The command line version of PHP on your system does not have "
 "\"register_argc_argv\" enabled."
 msgstr "En via komanda linia versio de PHP je via sistemo, \"register_argc_argv\" ne estas aktivita."
 
-#: ../../mod/install.php:341
+#: ../../mod/install.php:338
 msgid "This is required for message delivery to work."
 msgstr "Tio estas bezonata por la livero de mesaĝoj."
 
-#: ../../mod/install.php:343
+#: ../../mod/install.php:340
 msgid "PHP register_argc_argv"
 msgstr "PHP register_argc_argv"
 
-#: ../../mod/install.php:364
+#: ../../mod/install.php:361
 msgid ""
 "Error: the \"openssl_pkey_new\" function on this system is not able to "
 "generate encryption keys"
 msgstr "Eraro: La funkcio \"openssl_pkey_new\" je tia sistemo ne eblas generi ĉifroŝlosilojn."
 
-#: ../../mod/install.php:365
+#: ../../mod/install.php:362
 msgid ""
 "If running under Windows, please see "
 "\"http://www.php.net/manual/en/openssl.installation.php\"."
 msgstr "Se la operaciumo sistemo estas Windows, bonvolu legi: http://www.php.net/manual/en/openssl.installation.php"
 
-#: ../../mod/install.php:367
+#: ../../mod/install.php:364
 msgid "Generate encryption keys"
 msgstr "Generi ĉifroŝlosilojn"
 
-#: ../../mod/install.php:374
+#: ../../mod/install.php:371
 msgid "libCurl PHP module"
 msgstr "PHP modulo libCurl"
 
-#: ../../mod/install.php:375
+#: ../../mod/install.php:372
 msgid "GD graphics PHP module"
 msgstr "PHP modulo GD"
 
-#: ../../mod/install.php:376
+#: ../../mod/install.php:373
 msgid "OpenSSL PHP module"
 msgstr "PHP modulo OpenSSL"
 
-#: ../../mod/install.php:377
+#: ../../mod/install.php:374
 msgid "mysqli PHP module"
 msgstr "PHP modulo mysqli"
 
-#: ../../mod/install.php:378
+#: ../../mod/install.php:375
 msgid "mb_string PHP module"
 msgstr "PHP modulo mb_string"
 
-#: ../../mod/install.php:383 ../../mod/install.php:385
+#: ../../mod/install.php:380 ../../mod/install.php:382
 msgid "Apache mod_rewrite module"
 msgstr "Apache mod_rewrite modulo"
 
-#: ../../mod/install.php:383
+#: ../../mod/install.php:380
 msgid ""
 "Error: Apache webserver mod-rewrite module is required but not installed."
 msgstr "Eraro: La modulo mod_rewrite en la Apache retservilo estas bezonata sed ne instalita."
 
-#: ../../mod/install.php:390
+#: ../../mod/install.php:388
 msgid "Error: libCURL PHP module required but not installed."
 msgstr "Eraro: La modulo libCURL en PHP estas bezonata sed ne instalita."
 
-#: ../../mod/install.php:394
+#: ../../mod/install.php:392
 msgid ""
 "Error: GD graphics PHP module with JPEG support required but not installed."
 msgstr "Eraro: La modulo GD en PHP kun subteno por JPEG estas bezonata sed ne instalita."
 
-#: ../../mod/install.php:398
+#: ../../mod/install.php:396
 msgid "Error: openssl PHP module required but not installed."
 msgstr "Eraro: La modulo OpenSSL en PHP estas bezonata sed ne instalita."
 
-#: ../../mod/install.php:402
+#: ../../mod/install.php:400
 msgid "Error: mysqli PHP module required but not installed."
 msgstr "Eraro: La modulo mysqli en PHP estas bezonata sed ne instalita."
 
-#: ../../mod/install.php:406
+#: ../../mod/install.php:404
 msgid "Error: mb_string PHP module required but not installed."
 msgstr "Eraro: La modulo mb_string en PHP estas bezonata sed ne instalita."
 
-#: ../../mod/install.php:423
+#: ../../mod/install.php:421
 msgid ""
 "The web installer needs to be able to create a file called \".htconfig.php\""
 " in the top folder of your web server and it is unable to do so."
 msgstr "La reta instalilo bezonas skribi dosieron nomata \".htconfig.php\" en la baza dosierujo de la retservilo, sed ne sukcesis."
 
-#: ../../mod/install.php:424
+#: ../../mod/install.php:422
 msgid ""
 "This is most often a permission setting, as the web server may not be able "
 "to write files in your folder - even if you can."
 msgstr "Tio ĉi plej ofte estas agordo rilate al permesoj, ĉar la servilo eble ne povas skribi en via dosierujo, eĉ se vi mem povas skribi."
 
-#: ../../mod/install.php:425
+#: ../../mod/install.php:423
 msgid ""
-"Please check with your site documentation or support people to see if this "
-"situation can be corrected."
-msgstr "Bonvolu kontroli la dokumentojn de via servilo aŭ teĥnikiston por ekscii ĉu la situacio ĝustigeblas."
+"At the end of this procedure, we will give you a text to save in a file "
+"named .htconfig.php in your Friendica top folder."
+msgstr "Post la fino de tiu proceduro, ni donos al vi tekston por konservi en dosiero .htconfig.php en via baza Friendica dosierujo."
 
-#: ../../mod/install.php:426
+#: ../../mod/install.php:424
 msgid ""
-"If not, you may be required to perform a manual installation. Please see the"
-" file \"INSTALL.txt\" for instructions."
-msgstr "Se ne, vi eble bezonas instali mane. Bonvolu legi la dosieron \"INSTALL.txt\" por pluaj instruaĵoj."
+"You can alternatively skip this procedure and perform a manual installation."
+" Please see the file \"INSTALL.txt\" for instructions."
+msgstr "Vi ankaŭ povas preterpasi tiun proceduron kaj fari permanan instaladon. Bonvolu legi la dosieron \"INSTALL.txt\" por trovi instrukciojn."
 
-#: ../../mod/install.php:429
+#: ../../mod/install.php:427
 msgid ".htconfig.php is writable"
 msgstr ".htconfig.php estas skribebla."
 
-#: ../../mod/install.php:436
+#: ../../mod/install.php:439
+msgid ""
+"Url rewrite in .htaccess is not working. Check your server configuration."
+msgstr "Url rewrite en .htaccess ne funkcias. Kontrolu la agordojn de la servilo."
+
+#: ../../mod/install.php:441
+msgid "Url rewrite is working"
+msgstr "URL rewrite funkcias."
+
+#: ../../mod/install.php:451
 msgid ""
 "The database configuration file \".htconfig.php\" could not be written. "
 "Please use the enclosed text to create a configuration file in your web "
 "server root."
 msgstr "Ne povis skribi la datumbaza agordoj en la dosiero \".htconfig.php\". Bonvolu uzi la inkluzivan tekston por krei agordan dosieron en la baza dosierujo de la retservilo."
 
-#: ../../mod/install.php:461
+#: ../../mod/install.php:476
 msgid "Errors encountered creating database tables."
 msgstr "Okazis eraroj dum la kreado de tabeloj en la datumbazo."
 
+#: ../../mod/install.php:487
+msgid "<h1>What next</h1>"
+msgstr "<h1>Kio sekvas nun?</h1>"
+
+#: ../../mod/install.php:488
+msgid ""
+"IMPORTANT: You will need to [manually] setup a scheduled task for the "
+"poller."
+msgstr "GRAVA: Vi bezonas [mane] agordi planitan taskon por la Friendica poller."
+
 #: ../../mod/localtime.php:12 ../../include/event.php:11
-#: ../../include/bb2diaspora.php:238
+#: ../../include/bb2diaspora.php:335
 msgid "l F d, Y \\@ g:i A"
 msgstr "l F d, Y \\@ g:i A"
 
@@ -1170,11 +1221,11 @@ msgid "is interested in:"
 msgstr "interesiĝas pri:"
 
 #: ../../mod/match.php:58 ../../mod/suggest.php:59
-#: ../../include/contact_widgets.php:9 ../../boot.php:1042
+#: ../../include/contact_widgets.php:9 ../../boot.php:1080
 msgid "Connect"
 msgstr "Konekti"
 
-#: ../../mod/match.php:65 ../../mod/dirfind.php:57
+#: ../../mod/match.php:65 ../../mod/dirfind.php:60
 msgid "No matches"
 msgstr "Nenio estas trovita"
 
@@ -1201,8 +1252,8 @@ msgid "Discard"
 msgstr "Forviŝi"
 
 #: ../../mod/notifications.php:51 ../../mod/notifications.php:160
-#: ../../mod/notifications.php:206 ../../mod/contacts.php:296
-#: ../../mod/contacts.php:348
+#: ../../mod/notifications.php:206 ../../mod/contacts.php:316
+#: ../../mod/contacts.php:370
 msgid "Ignore"
 msgstr "Ignori"
 
@@ -1214,11 +1265,11 @@ msgstr "Sistemo"
 msgid "Network"
 msgstr "Reto"
 
-#: ../../mod/notifications.php:85 ../../mod/network.php:184
+#: ../../mod/notifications.php:85 ../../mod/network.php:300
 msgid "Personal"
 msgstr "Propra"
 
-#: ../../mod/notifications.php:90 ../../view/theme/diabook/theme.php:123
+#: ../../mod/notifications.php:90 ../../view/theme/diabook/theme.php:127
 #: ../../include/nav.php:77 ../../include/nav.php:115
 msgid "Home"
 msgstr "Hejmo"
@@ -1227,7 +1278,7 @@ msgstr "Hejmo"
 msgid "Introductions"
 msgstr "Prezentoj"
 
-#: ../../mod/notifications.php:100 ../../mod/message.php:104
+#: ../../mod/notifications.php:100 ../../mod/message.php:105
 #: ../../include/nav.php:128
 msgid "Messages"
 msgstr "Mesaĝoj"
@@ -1254,7 +1305,7 @@ msgid "suggested by %s"
 msgstr "sugestita de %s"
 
 #: ../../mod/notifications.php:153 ../../mod/notifications.php:200
-#: ../../mod/contacts.php:354
+#: ../../mod/contacts.php:376
 msgid "Hide this contact from others"
 msgstr "Kaŝi ĉi tiun kontakton al aliaj"
 
@@ -1267,7 +1318,7 @@ msgid "if applicable"
 msgstr "se aplikebla"
 
 #: ../../mod/notifications.php:157 ../../mod/notifications.php:204
-#: ../../mod/admin.php:645
+#: ../../mod/admin.php:661
 msgid "Approve"
 msgstr "Aprobi"
 
@@ -1376,303 +1427,307 @@ msgstr "Ne pli da hejmrilataj atentigoj."
 msgid "Home Notifications"
 msgstr "Hejmrilataj atentigoj"
 
-#: ../../mod/contacts.php:63 ../../mod/contacts.php:143
+#: ../../mod/contacts.php:83 ../../mod/contacts.php:163
 msgid "Could not access contact record."
 msgstr "Ne eblis atingi kontaktrikordo."
 
-#: ../../mod/contacts.php:77
+#: ../../mod/contacts.php:97
 msgid "Could not locate selected profile."
 msgstr "Ne trovis elektitan profilon."
 
-#: ../../mod/contacts.php:100
+#: ../../mod/contacts.php:120
 msgid "Contact updated."
 msgstr "Kontakto estas ĝisdatigita."
 
-#: ../../mod/contacts.php:165
+#: ../../mod/contacts.php:185
 msgid "Contact has been blocked"
 msgstr "Kontakto estas blokita."
 
-#: ../../mod/contacts.php:165
+#: ../../mod/contacts.php:185
 msgid "Contact has been unblocked"
 msgstr "Kontakto estas malblokita."
 
-#: ../../mod/contacts.php:179
+#: ../../mod/contacts.php:199
 msgid "Contact has been ignored"
 msgstr "Kontakto estas ignorita."
 
-#: ../../mod/contacts.php:179
+#: ../../mod/contacts.php:199
 msgid "Contact has been unignored"
 msgstr "Kontakto estas malignorita."
 
-#: ../../mod/contacts.php:195
+#: ../../mod/contacts.php:215
 msgid "Contact has been archived"
 msgstr "Enarkivigis kontakton"
 
-#: ../../mod/contacts.php:195
+#: ../../mod/contacts.php:215
 msgid "Contact has been unarchived"
 msgstr "Elarkivigis kontakton"
 
-#: ../../mod/contacts.php:208
+#: ../../mod/contacts.php:228
 msgid "Contact has been removed."
 msgstr "Kontakto estas forigita."
 
-#: ../../mod/contacts.php:238
+#: ../../mod/contacts.php:258
 #, php-format
 msgid "You are mutual friends with %s"
 msgstr "Vi estas reciproka amiko de %s"
 
-#: ../../mod/contacts.php:242
+#: ../../mod/contacts.php:262
 #, php-format
 msgid "You are sharing with %s"
 msgstr "Vi kunhavigas kun %s"
 
-#: ../../mod/contacts.php:247
+#: ../../mod/contacts.php:267
 #, php-format
 msgid "%s is sharing with you"
 msgstr "%s kunhavigas kun vi"
 
-#: ../../mod/contacts.php:264
+#: ../../mod/contacts.php:284
 msgid "Private communications are not available for this contact."
 msgstr "Privataj komunikadoj ne disponeblas por ĉi tiu kontakto."
 
-#: ../../mod/contacts.php:267
+#: ../../mod/contacts.php:287
 msgid "Never"
 msgstr "Neniam"
 
-#: ../../mod/contacts.php:271
+#: ../../mod/contacts.php:291
 msgid "(Update was successful)"
 msgstr "(Ĝisdatigo sukcesis.)"
 
-#: ../../mod/contacts.php:271
+#: ../../mod/contacts.php:291
 msgid "(Update was not successful)"
 msgstr "(Ĝisdatigo malsukcesis.)"
 
-#: ../../mod/contacts.php:273
+#: ../../mod/contacts.php:293
 msgid "Suggest friends"
 msgstr "Sugesti amikojn"
 
-#: ../../mod/contacts.php:277
+#: ../../mod/contacts.php:297
 #, php-format
 msgid "Network type: %s"
 msgstr "Reta tipo: %s"
 
-#: ../../mod/contacts.php:280 ../../include/contact_widgets.php:183
+#: ../../mod/contacts.php:300 ../../include/contact_widgets.php:183
 #, php-format
 msgid "%d contact in common"
 msgid_plural "%d contacts in common"
 msgstr[0] "%d komuna kontakto"
 msgstr[1] "%d komunaj kontaktoj"
 
-#: ../../mod/contacts.php:285
+#: ../../mod/contacts.php:305
 msgid "View all contacts"
 msgstr "Vidi ĉiujn kontaktojn"
 
-#: ../../mod/contacts.php:290 ../../mod/contacts.php:347
-#: ../../mod/admin.php:649
+#: ../../mod/contacts.php:310 ../../mod/contacts.php:369
+#: ../../mod/admin.php:665
 msgid "Unblock"
 msgstr "Malbloki"
 
-#: ../../mod/contacts.php:290 ../../mod/contacts.php:347
-#: ../../mod/admin.php:648
+#: ../../mod/contacts.php:310 ../../mod/contacts.php:369
+#: ../../mod/admin.php:664
 msgid "Block"
 msgstr "Bloki"
 
-#: ../../mod/contacts.php:293
+#: ../../mod/contacts.php:313
 msgid "Toggle Blocked status"
 msgstr "Ŝalti/malŝalti Blokitan staton"
 
-#: ../../mod/contacts.php:296 ../../mod/contacts.php:348
+#: ../../mod/contacts.php:316 ../../mod/contacts.php:370
 msgid "Unignore"
 msgstr "Malignori"
 
-#: ../../mod/contacts.php:299
+#: ../../mod/contacts.php:319
 msgid "Toggle Ignored status"
 msgstr "Ŝalti/malŝalti Ignoritan staton"
 
-#: ../../mod/contacts.php:303
+#: ../../mod/contacts.php:323
 msgid "Unarchive"
 msgstr "Elarkivigi"
 
-#: ../../mod/contacts.php:303
+#: ../../mod/contacts.php:323
 msgid "Archive"
 msgstr "Enarkivigi"
 
-#: ../../mod/contacts.php:306
+#: ../../mod/contacts.php:326
 msgid "Toggle Archive status"
 msgstr "Ŝalti/malŝalti Enarkivigitan staton"
 
-#: ../../mod/contacts.php:309
+#: ../../mod/contacts.php:329
 msgid "Repair"
 msgstr "Ripari"
 
-#: ../../mod/contacts.php:312
+#: ../../mod/contacts.php:332
 msgid "Advanced Contact Settings"
 msgstr "Specialaj Kontaktagordoj"
 
-#: ../../mod/contacts.php:320
+#: ../../mod/contacts.php:338
+msgid "Communications lost with this contact!"
+msgstr "Mi perdis la kommunikadon kun tiu kontakto!"
+
+#: ../../mod/contacts.php:341
 msgid "Contact Editor"
 msgstr "Kontakta redaktilo."
 
-#: ../../mod/contacts.php:323
+#: ../../mod/contacts.php:344
 msgid "Profile Visibility"
 msgstr "Videbleco de profilo"
 
-#: ../../mod/contacts.php:324
+#: ../../mod/contacts.php:345
 #, php-format
 msgid ""
 "Please choose the profile you would like to display to %s when viewing your "
 "profile securely."
 msgstr "Bonvolu elekti la profilon kiu vi volas montri al %s aspektinde kiam sekure aspektante vian profilon."
 
-#: ../../mod/contacts.php:325
+#: ../../mod/contacts.php:346
 msgid "Contact Information / Notes"
 msgstr "Kontaktaj informoj / Notoj"
 
-#: ../../mod/contacts.php:326
+#: ../../mod/contacts.php:347
 msgid "Edit contact notes"
 msgstr "Redakti kontaktnotojn"
 
-#: ../../mod/contacts.php:331 ../../mod/contacts.php:522
+#: ../../mod/contacts.php:352 ../../mod/contacts.php:544
 #: ../../mod/viewcontacts.php:62 ../../mod/nogroup.php:40
 #, php-format
 msgid "Visit %s's profile [%s]"
 msgstr "Viziti la profilon de %s [%s]"
 
-#: ../../mod/contacts.php:332
+#: ../../mod/contacts.php:353
 msgid "Block/Unblock contact"
 msgstr "Bloki/Malbloki kontakton"
 
-#: ../../mod/contacts.php:333
+#: ../../mod/contacts.php:354
 msgid "Ignore contact"
 msgstr "Ignori kontakton"
 
-#: ../../mod/contacts.php:334
+#: ../../mod/contacts.php:355
 msgid "Repair URL settings"
 msgstr "Ripari URL agordoj"
 
-#: ../../mod/contacts.php:335
+#: ../../mod/contacts.php:356
 msgid "View conversations"
 msgstr "Vidi konversaciojn"
 
-#: ../../mod/contacts.php:337
+#: ../../mod/contacts.php:358
 msgid "Delete contact"
 msgstr "Forviŝi kontakton"
 
-#: ../../mod/contacts.php:341
+#: ../../mod/contacts.php:362
 msgid "Last update:"
 msgstr "Plej ĵusa ĝisdatigo:"
 
-#: ../../mod/contacts.php:342
+#: ../../mod/contacts.php:364
 msgid "Update public posts"
 msgstr "Ĝisdatigi publikajn afiŝojn"
 
-#: ../../mod/contacts.php:344 ../../mod/admin.php:1120
+#: ../../mod/contacts.php:366 ../../mod/admin.php:1136
 msgid "Update now"
 msgstr "Ĝisdatigi nun"
 
-#: ../../mod/contacts.php:351
+#: ../../mod/contacts.php:373
 msgid "Currently blocked"
 msgstr "Nuntempe blokata"
 
-#: ../../mod/contacts.php:352
+#: ../../mod/contacts.php:374
 msgid "Currently ignored"
 msgstr "Nuntempe ignorata"
 
-#: ../../mod/contacts.php:353
+#: ../../mod/contacts.php:375
 msgid "Currently archived"
 msgstr "Nuntempe enarkivigita"
 
-#: ../../mod/contacts.php:354
+#: ../../mod/contacts.php:376
 msgid ""
 "Replies/likes to your public posts <strong>may</strong> still be visible"
 msgstr "Rispondoj/ŝataĵo al viaj publikaj afiŝoj <strong>eble</strong> plu estos videbla"
 
-#: ../../mod/contacts.php:407
+#: ../../mod/contacts.php:429
 msgid "Suggestions"
 msgstr "Sugestoj"
 
-#: ../../mod/contacts.php:410
+#: ../../mod/contacts.php:432
 msgid "Suggest potential friends"
 msgstr "Sugesti amikojn"
 
-#: ../../mod/contacts.php:413 ../../mod/group.php:191
+#: ../../mod/contacts.php:435 ../../mod/group.php:191
 msgid "All Contacts"
 msgstr "Ĉiuj Kontaktoj"
 
-#: ../../mod/contacts.php:416
+#: ../../mod/contacts.php:438
 msgid "Show all contacts"
 msgstr "Montri ĉiujn kontaktojn"
 
-#: ../../mod/contacts.php:419
+#: ../../mod/contacts.php:441
 msgid "Unblocked"
 msgstr "Malblokita"
 
-#: ../../mod/contacts.php:422
+#: ../../mod/contacts.php:444
 msgid "Only show unblocked contacts"
 msgstr "Nur montri neblokitajn kontaktojn"
 
-#: ../../mod/contacts.php:426
+#: ../../mod/contacts.php:448
 msgid "Blocked"
 msgstr "Blokita"
 
-#: ../../mod/contacts.php:429
+#: ../../mod/contacts.php:451
 msgid "Only show blocked contacts"
 msgstr "Nur montri blokitajn kontaktojn"
 
-#: ../../mod/contacts.php:433
+#: ../../mod/contacts.php:455
 msgid "Ignored"
 msgstr "Ignorita"
 
-#: ../../mod/contacts.php:436
+#: ../../mod/contacts.php:458
 msgid "Only show ignored contacts"
 msgstr "Nur montri ignoritajn kontaktojn"
 
-#: ../../mod/contacts.php:440
+#: ../../mod/contacts.php:462
 msgid "Archived"
 msgstr "Enarkivigita"
 
-#: ../../mod/contacts.php:443
+#: ../../mod/contacts.php:465
 msgid "Only show archived contacts"
 msgstr "Nur montri enarkivigitajn kontaktojn"
 
-#: ../../mod/contacts.php:447
+#: ../../mod/contacts.php:469
 msgid "Hidden"
 msgstr "Kaŝita"
 
-#: ../../mod/contacts.php:450
+#: ../../mod/contacts.php:472
 msgid "Only show hidden contacts"
 msgstr "Nur montri kaŝitajn kontaktojn"
 
-#: ../../mod/contacts.php:498
+#: ../../mod/contacts.php:520
 msgid "Mutual Friendship"
 msgstr "Reciproka amikeco"
 
-#: ../../mod/contacts.php:502
+#: ../../mod/contacts.php:524
 msgid "is a fan of yours"
 msgstr "estas admiranto de vi"
 
-#: ../../mod/contacts.php:506
+#: ../../mod/contacts.php:528
 msgid "you are a fan of"
 msgstr "vi estas admiranto de"
 
-#: ../../mod/contacts.php:523 ../../mod/nogroup.php:41
+#: ../../mod/contacts.php:545 ../../mod/nogroup.php:41
 msgid "Edit contact"
 msgstr "Redakti kontakton"
 
-#: ../../mod/contacts.php:544 ../../view/theme/diabook/theme.php:125
+#: ../../mod/contacts.php:566 ../../view/theme/diabook/theme.php:129
 #: ../../include/nav.php:139
 msgid "Contacts"
 msgstr "Kontaktoj"
 
-#: ../../mod/contacts.php:548
+#: ../../mod/contacts.php:570
 msgid "Search your contacts"
 msgstr "Serĉi viajn kontaktojn"
 
-#: ../../mod/contacts.php:549 ../../mod/directory.php:57
+#: ../../mod/contacts.php:571 ../../mod/directory.php:57
 msgid "Finding: "
 msgstr "Trovata:"
 
-#: ../../mod/contacts.php:550 ../../mod/directory.php:59
+#: ../../mod/contacts.php:572 ../../mod/directory.php:59
 #: ../../include/contact_widgets.php:33
 msgid "Find"
 msgstr "Trovi"
@@ -1691,12 +1746,13 @@ msgid "Password reset requested at %s"
 msgstr "Pasvorta riparado petita je %s"
 
 #: ../../mod/lostpass.php:45 ../../mod/lostpass.php:107
-#: ../../mod/register.php:388 ../../mod/register.php:442
-#: ../../mod/regmod.php:54 ../../mod/dfrn_confirm.php:742
-#: ../../addon/facebook/facebook.php:680
-#: ../../addon/facebook/facebook.php:1170
-#: ../../addon/testdrive/testdrive.php:58 ../../include/items.php:2726
-#: ../../boot.php:692
+#: ../../mod/register.php:90 ../../mod/register.php:144
+#: ../../mod/regmod.php:54 ../../mod/dfrn_confirm.php:752
+#: ../../addon/facebook/facebook.php:700
+#: ../../addon/facebook/facebook.php:1190
+#: ../../addon/public_server/public_server.php:62
+#: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2890
+#: ../../boot.php:730
 msgid "Administrator"
 msgstr "Administranto"
 
@@ -1706,7 +1762,7 @@ msgid ""
 "Password reset failed."
 msgstr "Ne povis konfirmi la peton. (Eble vi sendis ĝin antaŭ.) Pasvorta riparado malsukcesis."
 
-#: ../../mod/lostpass.php:83 ../../boot.php:824
+#: ../../mod/lostpass.php:83 ../../boot.php:862
 msgid "Password Reset"
 msgstr "Pasvorta riparado"
 
@@ -1750,502 +1806,527 @@ msgstr "Salutnomo aŭ retpoŝtadreso: "
 msgid "Reset"
 msgstr "Repari"
 
-#: ../../mod/settings.php:49 ../../include/nav.php:137
+#: ../../mod/settings.php:50 ../../include/nav.php:137
 msgid "Account settings"
 msgstr "Konto"
 
-#: ../../mod/settings.php:54
+#: ../../mod/settings.php:55
 msgid "Display settings"
 msgstr "Ekrano"
 
-#: ../../mod/settings.php:60
+#: ../../mod/settings.php:61
 msgid "Connector settings"
 msgstr "Konektiloj"
 
-#: ../../mod/settings.php:65
+#: ../../mod/settings.php:66
 msgid "Plugin settings"
 msgstr "Kromprogramoj"
 
-#: ../../mod/settings.php:70
+#: ../../mod/settings.php:71
 msgid "Connected apps"
 msgstr "Konektitaj programoj"
 
-#: ../../mod/settings.php:75
+#: ../../mod/settings.php:76
 msgid "Export personal data"
 msgstr "Eksporto"
 
-#: ../../mod/settings.php:80
+#: ../../mod/settings.php:81
 msgid "Remove account"
 msgstr "Forigi konton"
 
-#: ../../mod/settings.php:88 ../../mod/admin.php:735 ../../mod/admin.php:940
-#: ../../addon/mathjax/mathjax.php:36 ../../view/theme/diabook/theme.php:571
-#: ../../view/theme/diabook/theme.php:701 ../../include/nav.php:137
+#: ../../mod/settings.php:89 ../../mod/admin.php:751 ../../mod/admin.php:956
+#: ../../addon/dav/layout.fnk.php:116 ../../addon/mathjax/mathjax.php:36
+#: ../../view/theme/diabook/theme.php:643
+#: ../../view/theme/diabook/theme.php:773 ../../include/nav.php:137
 msgid "Settings"
 msgstr "Agordoj"
 
-#: ../../mod/settings.php:131
+#: ../../mod/settings.php:133
 msgid "Missing some important data!"
 msgstr "Mankas importantaj datumoj!"
 
-#: ../../mod/settings.php:134 ../../mod/settings.php:565
+#: ../../mod/settings.php:136 ../../mod/settings.php:581
 msgid "Update"
 msgstr "Ĝisdatigi"
 
-#: ../../mod/settings.php:239
+#: ../../mod/settings.php:241
 msgid "Failed to connect with email account using the settings provided."
 msgstr "Ne sukcesis konekti al retpoŝtkonto kun la provizitaj agordoj."
 
-#: ../../mod/settings.php:244
+#: ../../mod/settings.php:246
 msgid "Email settings updated."
 msgstr "Retpoŝtagordoj ĝisdatigita"
 
-#: ../../mod/settings.php:303
+#: ../../mod/settings.php:305
 msgid "Passwords do not match. Password unchanged."
 msgstr "La pasvortoj ne estas egala. Pasvorto ne ŝanĝita."
 
-#: ../../mod/settings.php:308
+#: ../../mod/settings.php:310
 msgid "Empty passwords are not allowed. Password unchanged."
 msgstr "Malplenaj pasvortoj ne estas permesita. Pasvorto ne ŝanĝita."
 
-#: ../../mod/settings.php:319
+#: ../../mod/settings.php:321
 msgid "Password changed."
 msgstr "Pasvorto ŝanĝita."
 
-#: ../../mod/settings.php:321
+#: ../../mod/settings.php:323
 msgid "Password update failed. Please try again."
 msgstr "Ĝisdatigo de pasvorto malsukcesis. Bonvolu provi refoje."
 
-#: ../../mod/settings.php:385
+#: ../../mod/settings.php:386
 msgid " Please use a shorter name."
 msgstr " Bonvolu uzi pli mallongan nomon."
 
-#: ../../mod/settings.php:387
+#: ../../mod/settings.php:388
 msgid " Name too short."
 msgstr " Nomo estas tro mallonga."
 
-#: ../../mod/settings.php:393
+#: ../../mod/settings.php:394
 msgid " Not valid email."
 msgstr " Repoŝtadreso ne validas."
 
-#: ../../mod/settings.php:395
+#: ../../mod/settings.php:396
 msgid " Cannot change to that email."
 msgstr " Ne povas ŝanĝi al tio retpoŝtadreso."
 
-#: ../../mod/settings.php:468 ../../addon/facebook/facebook.php:480
+#: ../../mod/settings.php:450
+msgid "Private forum has no privacy permissions. Using default privacy group."
+msgstr "Privata forumo ne havas privatecajn agordojn. Defaŭlta privateca grupo estas uzata."
+
+#: ../../mod/settings.php:454
+msgid "Private forum has no privacy permissions and no default privacy group."
+msgstr "Privata forumo havas nek privatecajn agordojn nek defaŭltan privatecan grupon."
+
+#: ../../mod/settings.php:484 ../../addon/facebook/facebook.php:493
 #: ../../addon/impressum/impressum.php:77
 #: ../../addon/openstreetmap/openstreetmap.php:80
 #: ../../addon/mathjax/mathjax.php:66 ../../addon/piwik/piwik.php:105
-#: ../../addon/twitter/twitter.php:370
+#: ../../addon/twitter/twitter.php:382
 msgid "Settings updated."
 msgstr "Agordoj ĝisdatigita."
 
-#: ../../mod/settings.php:538 ../../mod/settings.php:564
-#: ../../mod/settings.php:600
+#: ../../mod/settings.php:554 ../../mod/settings.php:580
+#: ../../mod/settings.php:616
 msgid "Add application"
 msgstr "Aldoni programon"
 
-#: ../../mod/settings.php:542 ../../mod/settings.php:568
-#: ../../addon/statusnet/statusnet.php:547
+#: ../../mod/settings.php:558 ../../mod/settings.php:584
+#: ../../addon/statusnet/statusnet.php:561
 msgid "Consumer Key"
 msgstr "Ŝlosilo de kliento"
 
-#: ../../mod/settings.php:543 ../../mod/settings.php:569
-#: ../../addon/statusnet/statusnet.php:546
+#: ../../mod/settings.php:559 ../../mod/settings.php:585
+#: ../../addon/statusnet/statusnet.php:560
 msgid "Consumer Secret"
 msgstr "Sekreto de kliento"
 
-#: ../../mod/settings.php:544 ../../mod/settings.php:570
+#: ../../mod/settings.php:560 ../../mod/settings.php:586
 msgid "Redirect"
 msgstr "Alidirekto"
 
-#: ../../mod/settings.php:545 ../../mod/settings.php:571
+#: ../../mod/settings.php:561 ../../mod/settings.php:587
 msgid "Icon url"
 msgstr "Piktograma adreso"
 
-#: ../../mod/settings.php:556
+#: ../../mod/settings.php:572
 msgid "You can't edit this application."
 msgstr "Ĉi tio programo ne estas redaktebla."
 
-#: ../../mod/settings.php:599
+#: ../../mod/settings.php:615
 msgid "Connected Apps"
 msgstr "Konektitaj Programoj"
 
-#: ../../mod/settings.php:603
+#: ../../mod/settings.php:619
 msgid "Client key starts with"
 msgstr "Ŝlosilo de kliento komencas kun"
 
-#: ../../mod/settings.php:604
+#: ../../mod/settings.php:620
 msgid "No name"
 msgstr "Neniu nomo"
 
-#: ../../mod/settings.php:605
+#: ../../mod/settings.php:621
 msgid "Remove authorization"
 msgstr "Forviŝi rajtigon"
 
-#: ../../mod/settings.php:616
+#: ../../mod/settings.php:632
 msgid "No Plugin settings configured"
 msgstr "Neniom da kromprogramoagordoj farita"
 
-#: ../../mod/settings.php:624 ../../addon/widgets/widgets.php:123
+#: ../../mod/settings.php:640 ../../addon/widgets/widgets.php:123
 msgid "Plugin Settings"
 msgstr "Kromprogramoagordoj"
 
-#: ../../mod/settings.php:636 ../../mod/settings.php:637
+#: ../../mod/settings.php:652 ../../mod/settings.php:653
 #, php-format
 msgid "Built-in support for %s connectivity is %s"
 msgstr "Integrita subteno por %s koneto estas %s"
 
-#: ../../mod/settings.php:636 ../../mod/settings.php:637
+#: ../../mod/settings.php:652 ../../mod/settings.php:653
 msgid "enabled"
 msgstr "ŝaltita"
 
-#: ../../mod/settings.php:636 ../../mod/settings.php:637
+#: ../../mod/settings.php:652 ../../mod/settings.php:653
 msgid "disabled"
 msgstr "malŝaltita"
 
-#: ../../mod/settings.php:637
+#: ../../mod/settings.php:653
 msgid "StatusNet"
 msgstr "StatusNet"
 
-#: ../../mod/settings.php:667
+#: ../../mod/settings.php:685
+msgid "Email access is disabled on this site."
+msgstr "Retpoŝta atingo ne disponeblas ĉi tie."
+
+#: ../../mod/settings.php:691
 msgid "Connector Settings"
 msgstr "Konektiloagordoj"
 
-#: ../../mod/settings.php:672
+#: ../../mod/settings.php:696
 msgid "Email/Mailbox Setup"
 msgstr "Agordoj pri Retpoŝto"
 
-#: ../../mod/settings.php:673
+#: ../../mod/settings.php:697
 msgid ""
 "If you wish to communicate with email contacts using this service "
 "(optional), please specify how to connect to your mailbox."
-msgstr "Se vi volas uzi ĉi tiun servon por komuniki tra retpoŝto (nedeviga), bonvolu specifi kiel konekti al vian retpoŝtkonton."
+msgstr "Se vi volas uzi ĉi tiun servon por komuniki per retpoŝto (nedeviga), bonvolu specifi kiel konekti al vian retpoŝtkonton."
 
-#: ../../mod/settings.php:674
+#: ../../mod/settings.php:698
 msgid "Last successful email check:"
 msgstr "Plej ĵusa sukcesa kontrolo de poŝto:"
 
-#: ../../mod/settings.php:675
-msgid "Email access is disabled on this site."
-msgstr "Retpoŝta atingo ne disponeblas ĉi tie."
-
-#: ../../mod/settings.php:676
+#: ../../mod/settings.php:700
 msgid "IMAP server name:"
 msgstr "Nomo de IMAP servilo:"
 
-#: ../../mod/settings.php:677
+#: ../../mod/settings.php:701
 msgid "IMAP port:"
 msgstr "Numero de IMAP pordo:"
 
-#: ../../mod/settings.php:678
+#: ../../mod/settings.php:702
 msgid "Security:"
 msgstr "Sekureco:"
 
-#: ../../mod/settings.php:678 ../../mod/settings.php:683
+#: ../../mod/settings.php:702 ../../mod/settings.php:707
 msgid "None"
 msgstr "Nenio"
 
-#: ../../mod/settings.php:679
+#: ../../mod/settings.php:703
 msgid "Email login name:"
 msgstr "Retpoŝta salutnomo:"
 
-#: ../../mod/settings.php:680
+#: ../../mod/settings.php:704
 msgid "Email password:"
 msgstr "Retpoŝta pasvorto:"
 
-#: ../../mod/settings.php:681
+#: ../../mod/settings.php:705
 msgid "Reply-to address:"
 msgstr "Responda adreso (Reply-to):"
 
-#: ../../mod/settings.php:682
+#: ../../mod/settings.php:706
 msgid "Send public posts to all email contacts:"
 msgstr "Sendu publikajn afiŝojn al ĉiuj retpoŝtkontaktoj:"
 
-#: ../../mod/settings.php:683
+#: ../../mod/settings.php:707
 msgid "Action after import:"
 msgstr "Ago post la importado:"
 
-#: ../../mod/settings.php:683
+#: ../../mod/settings.php:707
 msgid "Mark as seen"
 msgstr "Marki kiel legita"
 
-#: ../../mod/settings.php:683
+#: ../../mod/settings.php:707
 msgid "Move to folder"
 msgstr "Movi al dosierujo"
 
-#: ../../mod/settings.php:684
+#: ../../mod/settings.php:708
 msgid "Move to folder:"
 msgstr "Movi al dosierujo:"
 
-#: ../../mod/settings.php:744
+#: ../../mod/settings.php:768
 msgid "Display Settings"
 msgstr "Ekranagordoj"
 
-#: ../../mod/settings.php:750
+#: ../../mod/settings.php:774
 msgid "Display Theme:"
 msgstr "Vidiga etoso:"
 
-#: ../../mod/settings.php:751
+#: ../../mod/settings.php:775
 msgid "Update browser every xx seconds"
 msgstr "Ĝisdatigu retesplorilon ĉiu xxx sekundoj"
 
-#: ../../mod/settings.php:751
+#: ../../mod/settings.php:775
 msgid "Minimum of 10 seconds, no maximum"
 msgstr "Minimume 10 sekundoj, sen maksimumo"
 
-#: ../../mod/settings.php:752
+#: ../../mod/settings.php:776
 msgid "Number of items to display on the network page:"
 msgstr "Kvanto da elementoj kiuj estos montrata ĉe la reto paĝo."
 
-#: ../../mod/settings.php:752
+#: ../../mod/settings.php:776
 msgid "Maximum of 100 items"
 msgstr "Maksimume 100 eroj"
 
-#: ../../mod/settings.php:753
+#: ../../mod/settings.php:777
 msgid "Don't show emoticons"
 msgstr "Ne montru ridetulojn"
 
-#: ../../mod/settings.php:821 ../../mod/admin.php:180 ../../mod/admin.php:621
-msgid "Normal Account"
-msgstr "Normala konto"
+#: ../../mod/settings.php:848
+msgid "Normal Account Page"
+msgstr "Normala Kontopaĝo"
 
-#: ../../mod/settings.php:822
+#: ../../mod/settings.php:849
 msgid "This account is a normal personal profile"
 msgstr "Tiu konto estas normala persona profilo"
 
-#: ../../mod/settings.php:825 ../../mod/admin.php:181 ../../mod/admin.php:622
-msgid "Soapbox Account"
-msgstr "Soapbox Konto"
+#: ../../mod/settings.php:852
+msgid "Soapbox Page"
+msgstr "Soapbox Paĝo"
 
-#: ../../mod/settings.php:826
+#: ../../mod/settings.php:853
 msgid "Automatically approve all connection/friend requests as read-only fans"
 msgstr "Aŭtomate konfirmi ĉiujn kontaktpetojn kiel nurlegaj admirantoj"
 
-#: ../../mod/settings.php:829 ../../mod/admin.php:182 ../../mod/admin.php:623
-msgid "Community/Celebrity Account"
-msgstr "Komunuma/eminentula Konto"
+#: ../../mod/settings.php:856
+msgid "Community Forum/Celebrity Account"
+msgstr "Komunuma Forumo/Eminentula Konto"
 
-#: ../../mod/settings.php:830
+#: ../../mod/settings.php:857
 msgid ""
 "Automatically approve all connection/friend requests as read-write fans"
 msgstr "Aŭtomate konfirmi ĉiujn kontaktpetojn kiel admirantoj kapable legi kaj skribi"
 
-#: ../../mod/settings.php:833 ../../mod/admin.php:183 ../../mod/admin.php:624
-msgid "Automatic Friend Account"
-msgstr "Aŭtomata Amika Konto"
+#: ../../mod/settings.php:860
+msgid "Automatic Friend Page"
+msgstr "Aŭtomata Amiko Paĝo"
 
-#: ../../mod/settings.php:834
+#: ../../mod/settings.php:861
 msgid "Automatically approve all connection/friend requests as friends"
 msgstr "Aŭtomate konfirmi ĉiujn kontaktpetojn kiel amikoj"
 
-#: ../../mod/settings.php:844
+#: ../../mod/settings.php:864
+msgid "Private Forum [Experimental]"
+msgstr "Privata Forumo [eksperimenta]"
+
+#: ../../mod/settings.php:865
+msgid "Private forum - approved members only"
+msgstr "Privata forumo - nur por aprobitaj membroj"
+
+#: ../../mod/settings.php:877
 msgid "OpenID:"
 msgstr "OpenID:"
 
-#: ../../mod/settings.php:844
+#: ../../mod/settings.php:877
 msgid "(Optional) Allow this OpenID to login to this account."
 msgstr "(Nedeviga) Permesi atingon al la konton al ĉi tio OpenID."
 
-#: ../../mod/settings.php:854
+#: ../../mod/settings.php:887
 msgid "Publish your default profile in your local site directory?"
 msgstr "Publikigi vian defaŭltan profilon en la loka reteja katalogo?"
 
-#: ../../mod/settings.php:860
+#: ../../mod/settings.php:893
 msgid "Publish your default profile in the global social directory?"
 msgstr "Publikigi vian defaŭltan profilon en la tutmonda interkona katalogo?"
 
-#: ../../mod/settings.php:868
+#: ../../mod/settings.php:901
 msgid "Hide your contact/friend list from viewers of your default profile?"
 msgstr "Kaŝi vian liston de kontaktoj/amiko al spektantoj de via defaŭlta profilo?"
 
-#: ../../mod/settings.php:872
+#: ../../mod/settings.php:905
 msgid "Hide your profile details from unknown viewers?"
 msgstr "Kaŝi viajn profilajn detalojn al nekonataj spektantoj?"
 
-#: ../../mod/settings.php:877
+#: ../../mod/settings.php:910
 msgid "Allow friends to post to your profile page?"
 msgstr "Ĉu amikoj povu afiŝi al via profilo?"
 
-#: ../../mod/settings.php:883
+#: ../../mod/settings.php:916
 msgid "Allow friends to tag your posts?"
 msgstr "Ĉu amikoj povu aldoni markojn al viaj afiŝoj?"
 
-#: ../../mod/settings.php:889
+#: ../../mod/settings.php:922
 msgid "Allow us to suggest you as a potential friend to new members?"
 msgstr "Ĉu ni povu sugesti vin kiel amiko al novaj membroj?"
 
-#: ../../mod/settings.php:895
+#: ../../mod/settings.php:928
 msgid "Permit unknown people to send you private mail?"
 msgstr "Permesigi nekonatulojn sendi retpoŝton al vi?"
 
-#: ../../mod/settings.php:906
+#: ../../mod/settings.php:936
 msgid "Profile is <strong>not published</strong>."
 msgstr "Profilo <strong>ne estas publika</strong>."
 
-#: ../../mod/settings.php:912 ../../mod/profile_photo.php:211
+#: ../../mod/settings.php:939 ../../mod/profile_photo.php:213
 msgid "or"
 msgstr "aŭ"
 
-#: ../../mod/settings.php:917
+#: ../../mod/settings.php:944
 msgid "Your Identity Address is"
 msgstr "Via identeca adreso estas"
 
-#: ../../mod/settings.php:928
+#: ../../mod/settings.php:955
 msgid "Automatically expire posts after this many days:"
 msgstr "Automatike senvalidigi afiŝojn post tiom da tagoj:"
 
-#: ../../mod/settings.php:928
+#: ../../mod/settings.php:955
 msgid "If empty, posts will not expire. Expired posts will be deleted"
 msgstr "Se malplena, afiŝoj neniam senvalidiĝos. Senvalidigitajn afiŝon estos forviŝata"
 
-#: ../../mod/settings.php:929
+#: ../../mod/settings.php:956
 msgid "Advanced expiration settings"
 msgstr "Detalaj agordoj rilate al senvalidiĝo"
 
-#: ../../mod/settings.php:930
+#: ../../mod/settings.php:957
 msgid "Advanced Expiration"
 msgstr "Detala senvalidiĝo"
 
-#: ../../mod/settings.php:931
+#: ../../mod/settings.php:958
 msgid "Expire posts:"
 msgstr "Senvalidigi afiŝojn:"
 
-#: ../../mod/settings.php:932
+#: ../../mod/settings.php:959
 msgid "Expire personal notes:"
 msgstr "Senvalidigi personajn notojn:"
 
-#: ../../mod/settings.php:933
+#: ../../mod/settings.php:960
 msgid "Expire starred posts:"
 msgstr "Senvalidigi steligitajn afiŝojn:"
 
-#: ../../mod/settings.php:934
+#: ../../mod/settings.php:961
 msgid "Expire photos:"
 msgstr "Senvalidigi bildojn:"
 
-#: ../../mod/settings.php:938
+#: ../../mod/settings.php:962
+msgid "Only expire posts by others:"
+msgstr "Nur senvalidigi afiŝojn de aliaj: "
+
+#: ../../mod/settings.php:969
 msgid "Account Settings"
 msgstr "Kontoagordoj"
 
-#: ../../mod/settings.php:947
+#: ../../mod/settings.php:977
 msgid "Password Settings"
 msgstr "Agordoj pri Pasvorto"
 
-#: ../../mod/settings.php:948
+#: ../../mod/settings.php:978
 msgid "New Password:"
 msgstr "Nova pasvorto:"
 
-#: ../../mod/settings.php:949
+#: ../../mod/settings.php:979
 msgid "Confirm:"
 msgstr "Konfirmi:"
 
-#: ../../mod/settings.php:949
+#: ../../mod/settings.php:979
 msgid "Leave password fields blank unless changing"
 msgstr "Lasu pasvortkampojn malplenaj se vi ne ŝanĝas la pasvorton."
 
-#: ../../mod/settings.php:953
+#: ../../mod/settings.php:983
 msgid "Basic Settings"
 msgstr "Bazaj Agordoj"
 
-#: ../../mod/settings.php:954 ../../include/profile_advanced.php:15
+#: ../../mod/settings.php:984 ../../include/profile_advanced.php:15
 msgid "Full Name:"
 msgstr "Plena Nomo:"
 
-#: ../../mod/settings.php:955
+#: ../../mod/settings.php:985
 msgid "Email Address:"
 msgstr "Retpoŝtadreso:"
 
-#: ../../mod/settings.php:956
+#: ../../mod/settings.php:986
 msgid "Your Timezone:"
 msgstr "Via Horzono:"
 
-#: ../../mod/settings.php:957
+#: ../../mod/settings.php:987
 msgid "Default Post Location:"
 msgstr "Defaŭlta Loko por Afiŝoj:"
 
-#: ../../mod/settings.php:958
+#: ../../mod/settings.php:988
 msgid "Use Browser Location:"
 msgstr "Uzu Lokon laŭ Retesplorilo:"
 
-#: ../../mod/settings.php:961
+#: ../../mod/settings.php:991
 msgid "Security and Privacy Settings"
 msgstr "Agordoj pri Sekureco kaj Privateco"
 
-#: ../../mod/settings.php:963
+#: ../../mod/settings.php:993
 msgid "Maximum Friend Requests/Day:"
 msgstr "Taga maksimumo da kontaktpetoj:"
 
-#: ../../mod/settings.php:963 ../../mod/settings.php:978
+#: ../../mod/settings.php:993 ../../mod/settings.php:1012
 msgid "(to prevent spam abuse)"
 msgstr "(por malhelpi spamaĵojn)"
 
-#: ../../mod/settings.php:964
+#: ../../mod/settings.php:994
 msgid "Default Post Permissions"
 msgstr "Defaŭltaj permesoj por afiŝoj"
 
-#: ../../mod/settings.php:965
+#: ../../mod/settings.php:995
 msgid "(click to open/close)"
 msgstr "(klaku por malfermi/fermi)"
 
-#: ../../mod/settings.php:978
+#: ../../mod/settings.php:1012
 msgid "Maximum private messages per day from unknown people:"
 msgstr "Taga maksimumo da privataj mesaĝoj."
 
-#: ../../mod/settings.php:981
+#: ../../mod/settings.php:1015
 msgid "Notification Settings"
 msgstr "Agordoj pri Atentigoj"
 
-#: ../../mod/settings.php:982
+#: ../../mod/settings.php:1016
 msgid "By default post a status message when:"
 msgstr "Defaŭlte afiŝi statmesaĝon okaze de:"
 
-#: ../../mod/settings.php:983
+#: ../../mod/settings.php:1017
 msgid "accepting a friend request"
 msgstr "akcepti kontaktpeton"
 
-#: ../../mod/settings.php:984
+#: ../../mod/settings.php:1018
 msgid "joining a forum/community"
 msgstr "aliĝi forumon/komunumon"
 
-#: ../../mod/settings.php:985
+#: ../../mod/settings.php:1019
 msgid "making an <em>interesting</em> profile change"
 msgstr "fari <em>interesan</em> profilŝanĝon"
 
-#: ../../mod/settings.php:986
+#: ../../mod/settings.php:1020
 msgid "Send a notification email when:"
 msgstr "Sendu atentiga repoŝton se:"
 
-#: ../../mod/settings.php:987
+#: ../../mod/settings.php:1021
 msgid "You receive an introduction"
 msgstr "Vi ricevas inviton"
 
-#: ../../mod/settings.php:988
+#: ../../mod/settings.php:1022
 msgid "Your introductions are confirmed"
 msgstr "Viaj prezentoj estas konfirmata."
 
-#: ../../mod/settings.php:989
+#: ../../mod/settings.php:1023
 msgid "Someone writes on your profile wall"
 msgstr "Iu skribas je via profila muro."
 
-#: ../../mod/settings.php:990
+#: ../../mod/settings.php:1024
 msgid "Someone writes a followup comment"
 msgstr "Iu skribas sekvan komenton"
 
-#: ../../mod/settings.php:991
+#: ../../mod/settings.php:1025
 msgid "You receive a private message"
 msgstr "Vi ricevas privatan mesaĝon."
 
-#: ../../mod/settings.php:992
+#: ../../mod/settings.php:1026
 msgid "You receive a friend suggestion"
 msgstr "Vi ricevas amikosugeston"
 
-#: ../../mod/settings.php:993
+#: ../../mod/settings.php:1027
 msgid "You are tagged in a post"
 msgstr "Vi estas markita en afiŝon"
 
-#: ../../mod/settings.php:996
-msgid "Advanced Page Settings"
-msgstr "Specialaj agordoj pri paĝoj"
+#: ../../mod/settings.php:1030
+msgid "Advanced Account/Page Type Settings"
+msgstr "Detalaj Agordoj pri Tipo de Konto/Paĝo."
+
+#: ../../mod/settings.php:1031
+msgid "Change the behaviour of this account for special situations"
+msgstr "Agordi la teniĝon de la konto en specialaj situacioj"
 
 #: ../../mod/manage.php:90
 msgid "Manage Identities and/or Pages"
@@ -2261,67 +2342,67 @@ msgstr "Ŝalti inter aliaj identecojn aj komunumaj/grupaj paĝoj kiuj kunhavas v
 msgid "Select an identity to manage: "
 msgstr "Elektu identencon por administrado:"
 
-#: ../../mod/network.php:43
+#: ../../mod/network.php:97
 msgid "Search Results For:"
 msgstr "Rezultoj de la serĉado pri:"
 
-#: ../../mod/network.php:82 ../../mod/search.php:16
+#: ../../mod/network.php:137 ../../mod/search.php:16
 msgid "Remove term"
 msgstr "Forviŝu terminon"
 
-#: ../../mod/network.php:91 ../../mod/search.php:13
+#: ../../mod/network.php:146 ../../mod/search.php:13
 msgid "Saved Searches"
 msgstr "Konservitaj Serĉadoj"
 
-#: ../../mod/network.php:92 ../../include/group.php:217
+#: ../../mod/network.php:147 ../../include/group.php:244
 msgid "add"
 msgstr "aldoni"
 
-#: ../../mod/network.php:171
+#: ../../mod/network.php:287
 msgid "Commented Order"
 msgstr "Komenta Ordo"
 
-#: ../../mod/network.php:174
+#: ../../mod/network.php:290
 msgid "Sort by Comment Date"
 msgstr "Ordigi laŭ Dato de Komento"
 
-#: ../../mod/network.php:177
+#: ../../mod/network.php:293
 msgid "Posted Order"
 msgstr "Afiŝita Ordo"
 
-#: ../../mod/network.php:180
+#: ../../mod/network.php:296
 msgid "Sort by Post Date"
 msgstr "Ordigi laŭ Dato de Afiŝado"
 
-#: ../../mod/network.php:187
+#: ../../mod/network.php:303
 msgid "Posts that mention or involve you"
 msgstr "Afiŝoj menciantaj vin aŭ pri vi"
 
-#: ../../mod/network.php:190
+#: ../../mod/network.php:306
 msgid "New"
 msgstr "Nova"
 
-#: ../../mod/network.php:193
+#: ../../mod/network.php:309
 msgid "Activity Stream - by date"
 msgstr "Fluo de Aktiveco - laŭ dato"
 
-#: ../../mod/network.php:196
+#: ../../mod/network.php:312
 msgid "Starred"
 msgstr "Steligita"
 
-#: ../../mod/network.php:199
+#: ../../mod/network.php:315
 msgid "Favourite Posts"
 msgstr "Favorigitaj Afiŝoj"
 
-#: ../../mod/network.php:202
+#: ../../mod/network.php:318
 msgid "Shared Links"
 msgstr "Kunhavigitaj Ligiloj"
 
-#: ../../mod/network.php:205
+#: ../../mod/network.php:321
 msgid "Interesting Links"
 msgstr "Interesaj Ligiloj"
 
-#: ../../mod/network.php:281
+#: ../../mod/network.php:388
 #, php-format
 msgid "Warning: This group contains %s member from an insecure network."
 msgid_plural ""
@@ -2329,42 +2410,42 @@ msgid_plural ""
 msgstr[0] "Averto: La grupo enhavas %s membron el nesekuraj retejoj."
 msgstr[1] "Averto: La grupo enhavas %s membrojn el nesekuraj retejoj."
 
-#: ../../mod/network.php:284
+#: ../../mod/network.php:391
 msgid "Private messages to this group are at risk of public disclosure."
 msgstr "La privateco de privataj mesaĝoj al ĉi tiu grupo ne ĉiam estas garantita."
 
-#: ../../mod/network.php:329
+#: ../../mod/network.php:436
 msgid "No such group"
 msgstr "Grupo ne estas trovita"
 
-#: ../../mod/network.php:340
+#: ../../mod/network.php:447
 msgid "Group is empty"
 msgstr "Grupo estas malplena"
 
-#: ../../mod/network.php:344
+#: ../../mod/network.php:451
 msgid "Group: "
 msgstr "Grupo:"
 
-#: ../../mod/network.php:354
+#: ../../mod/network.php:461
 msgid "Contact: "
 msgstr "Kontakto:"
 
-#: ../../mod/network.php:356
+#: ../../mod/network.php:463
 msgid "Private messages to this person are at risk of public disclosure."
 msgstr "La privateco de privataj mesaĝoj al ĉi tiu persono ne ĉiam estas garantita."
 
-#: ../../mod/network.php:361
+#: ../../mod/network.php:468
 msgid "Invalid contact."
 msgstr "Nevalida kontakto."
 
-#: ../../mod/notes.php:44 ../../boot.php:1505
+#: ../../mod/notes.php:44 ../../boot.php:1565
 msgid "Personal Notes"
 msgstr "Personaj Notoj"
 
 #: ../../mod/notes.php:63 ../../mod/filer.php:30
-#: ../../addon/facebook/facebook.php:748
-#: ../../addon/privacy_image_cache/privacy_image_cache.php:147
-#: ../../include/text.php:652
+#: ../../addon/facebook/facebook.php:768
+#: ../../addon/privacy_image_cache/privacy_image_cache.php:187
+#: ../../addon/dav/layout.fnk.php:384 ../../include/text.php:652
 msgid "Save"
 msgstr "Konservi"
 
@@ -2373,7 +2454,7 @@ msgstr "Konservi"
 msgid "Number of daily wall messages for %s exceeded. Message failed."
 msgstr "Number of daily wall messages for %s exceeded. Messaĝo malsukcesis."
 
-#: ../../mod/wallmessage.php:56 ../../mod/message.php:65
+#: ../../mod/wallmessage.php:56 ../../mod/message.php:66
 msgid "No recipient selected."
 msgstr "Neniom da ricevontoj."
 
@@ -2381,15 +2462,15 @@ msgstr "Neniom da ricevontoj."
 msgid "Unable to check your home location."
 msgstr "Ne eblas kontroli vian hejmlokon."
 
-#: ../../mod/wallmessage.php:62 ../../mod/message.php:72
+#: ../../mod/wallmessage.php:62 ../../mod/message.php:73
 msgid "Message could not be sent."
 msgstr "Ne povas sendi la mesaĝon."
 
-#: ../../mod/wallmessage.php:65 ../../mod/message.php:75
+#: ../../mod/wallmessage.php:65 ../../mod/message.php:76
 msgid "Message collection failure."
 msgstr "Malsukcese provis kolekti mesaĝojn."
 
-#: ../../mod/wallmessage.php:68 ../../mod/message.php:78
+#: ../../mod/wallmessage.php:68 ../../mod/message.php:79
 msgid "Message sent."
 msgstr "Mesaĝo estas sendita."
 
@@ -2397,12 +2478,12 @@ msgstr "Mesaĝo estas sendita."
 msgid "No recipient."
 msgstr "Neniom da ricevontoj."
 
-#: ../../mod/wallmessage.php:124 ../../mod/message.php:171
-#: ../../include/conversation.php:918
+#: ../../mod/wallmessage.php:124 ../../mod/message.php:172
+#: ../../include/conversation.php:947
 msgid "Please enter a link URL:"
 msgstr "Bonvolu entajpu adreson de ligilo:"
 
-#: ../../mod/wallmessage.php:131 ../../mod/message.php:199
+#: ../../mod/wallmessage.php:131 ../../mod/message.php:200
 msgid "Send Private Message"
 msgstr "Sendi Privatan Mesaĝon"
 
@@ -2413,18 +2494,18 @@ msgid ""
 "your site allow private mail from unknown senders."
 msgstr "Se vi deziras ke %s respondu, bonvolu kontroli ke la privatecaj agordoj je via retejo permesas privatajn mesaĝojn de nekonataj sendantoj."
 
-#: ../../mod/wallmessage.php:133 ../../mod/message.php:200
-#: ../../mod/message.php:395
+#: ../../mod/wallmessage.php:133 ../../mod/message.php:201
+#: ../../mod/message.php:399
 msgid "To:"
 msgstr "Al:"
 
-#: ../../mod/wallmessage.php:134 ../../mod/message.php:204
-#: ../../mod/message.php:396
+#: ../../mod/wallmessage.php:134 ../../mod/message.php:206
+#: ../../mod/message.php:401
 msgid "Subject:"
 msgstr "Temo:"
 
-#: ../../mod/wallmessage.php:140 ../../mod/message.php:208
-#: ../../mod/message.php:399 ../../mod/invite.php:113
+#: ../../mod/wallmessage.php:140 ../../mod/message.php:210
+#: ../../mod/message.php:404 ../../mod/invite.php:113
 msgid "Your message:"
 msgstr "Via mesaĝo:"
 
@@ -2490,7 +2571,7 @@ msgid ""
 "Enter your email access information on your Connector Settings page if you "
 "wish to import and interact with friends or mailing lists from your email "
 "INBOX"
-msgstr "Entajpu la akreditaĵojn por via retpoŝtkonto en la konektilagordoj se vi volas importi aŭ interagi kun amikoj aŭ dissendlistoj tra via retkesto."
+msgstr "Entajpu la akreditaĵojn por via retpoŝtkonto en la konektilagordoj se vi volas importi aŭ interagi kun amikoj aŭ dissendlistoj pere de via retkesto."
 
 #: ../../mod/newmember.php:34
 msgid ""
@@ -2566,7 +2647,7 @@ msgstr "Grupo ne estas trovita."
 msgid "Group name changed."
 msgstr "La nomo de la grupo estas ŝanĝita."
 
-#: ../../mod/group.php:72 ../../mod/profperm.php:19 ../../index.php:305
+#: ../../mod/group.php:72 ../../mod/profperm.php:19 ../../index.php:308
 msgid "Permission denied"
 msgstr "Malpermesita"
 
@@ -2606,9 +2687,9 @@ msgstr "Nevaliada profila identigilo."
 msgid "Profile Visibility Editor"
 msgstr "Redaktilo por profila videbleco."
 
-#: ../../mod/profperm.php:103 ../../view/theme/diabook/theme.php:124
-#: ../../include/profile_advanced.php:7 ../../include/profile_advanced.php:74
-#: ../../include/nav.php:50 ../../boot.php:1484
+#: ../../mod/profperm.php:103 ../../view/theme/diabook/theme.php:128
+#: ../../include/profile_advanced.php:7 ../../include/profile_advanced.php:84
+#: ../../include/nav.php:50 ../../boot.php:1544
 msgid "Profile"
 msgstr "Profilo"
 
@@ -2628,193 +2709,125 @@ msgstr "Neniu kontaktojn."
 msgid "View Contacts"
 msgstr "Vidi Kontaktojn"
 
-#: ../../mod/register.php:64
-msgid "An invitation is required."
-msgstr "Invio bezonata."
-
-#: ../../mod/register.php:69
-msgid "Invitation could not be verified."
-msgstr "Ne povis kontroli la inviton."
-
-#: ../../mod/register.php:77
-msgid "Invalid OpenID url"
-msgstr "Nevalida OpenID adreso"
-
-#: ../../mod/register.php:92
-msgid "Please enter the required information."
-msgstr "Bonvolu entajpi la bezonatajn informojn."
-
-#: ../../mod/register.php:106
-msgid "Please use a shorter name."
-msgstr "Bonvolu uzi pli mallongan nomon."
-
-#: ../../mod/register.php:108
-msgid "Name too short."
-msgstr "Nomo estas tro mallonga."
-
-#: ../../mod/register.php:123
-msgid "That doesn't appear to be your full (First Last) name."
-msgstr "Tio ŝajne ne estas via plena (persona, familia) nomo."
-
-#: ../../mod/register.php:128
-msgid "Your email domain is not among those allowed on this site."
-msgstr "Via retpoŝtodomajno ne estas permesita ĉi tie."
-
-#: ../../mod/register.php:131
-msgid "Not a valid email address."
-msgstr "Nevalida retpoŝtadreso."
-
-#: ../../mod/register.php:141
-msgid "Cannot use that email."
-msgstr "Neuzebla retpoŝtadreso."
-
-#: ../../mod/register.php:147
-msgid ""
-"Your \"nickname\" can only contain \"a-z\", \"0-9\", \"-\", and \"_\", and "
-"must also begin with a letter."
-msgstr "Via kaŝnomo nur povas enhavi \"a-z\", \"0-9\", \"-\", kaj \"_\". Ĝi ankaŭ devas komenci kun litero."
-
-#: ../../mod/register.php:153 ../../mod/register.php:264
-msgid "Nickname is already registered. Please choose another."
-msgstr "Tio kaŝnomo jam estas registrita. Bonvolu elekti alian."
-
-#: ../../mod/register.php:163
-msgid ""
-"Nickname was once registered here and may not be re-used. Please choose "
-"another."
-msgstr "Tiu kaŝnomo iam estis registrita ĉi tie kaj ne ree uzeblas. Bonvolu elekti alian."
-
-#: ../../mod/register.php:182
-msgid "SERIOUS ERROR: Generation of security keys failed."
-msgstr "GRAVA ERARO: La generacio de sekurecaj ĉifroŝlosiloj malsukcesis."
-
-#: ../../mod/register.php:250
-msgid "An error occurred during registration. Please try again."
-msgstr "Eraro okazis dum registrado. Bonvolu provi denove."
-
-#: ../../mod/register.php:286
-msgid "An error occurred creating your default profile. Please try again."
-msgstr "Eraro okazi dum kreado de via defaŭlta profilo. Bonvolu provi denove."
-
-#: ../../mod/register.php:386 ../../mod/regmod.php:52
+#: ../../mod/register.php:88 ../../mod/regmod.php:52
 #, php-format
 msgid "Registration details for %s"
 msgstr "Detaloj de la registrado por %s"
 
-#: ../../mod/register.php:394
+#: ../../mod/register.php:96
 msgid ""
 "Registration successful. Please check your email for further instructions."
 msgstr "Registrado sukcesis. Bonvolu kontroli vian retpoŝton por pli da instruoj."
 
-#: ../../mod/register.php:398
+#: ../../mod/register.php:100
 msgid "Failed to send email message. Here is the message that failed."
 msgstr "Malsukcesis sendi retpoŝton. Jen la malsukcesa mesaĝo."
 
-#: ../../mod/register.php:403
+#: ../../mod/register.php:105
 msgid "Your registration can not be processed."
 msgstr "Mi ne povas prilabori vian registradon."
 
-#: ../../mod/register.php:440
+#: ../../mod/register.php:142
 #, php-format
 msgid "Registration request at %s"
 msgstr "Peto de registrado al %s"
 
-#: ../../mod/register.php:449
+#: ../../mod/register.php:151
 msgid "Your registration is pending approval by the site owner."
 msgstr "Via registrado bezonas apropbon de la administranto."
 
-#: ../../mod/register.php:487
+#: ../../mod/register.php:189
 msgid ""
 "This site has exceeded the number of allowed daily account registrations. "
 "Please try again tomorrow."
 msgstr "La retejo transiras la maksimuman kvanton da ĉiutagaj kontaj registradoj. Bonvolu provi denove morgaŭ."
 
-#: ../../mod/register.php:513
+#: ../../mod/register.php:215
 msgid ""
 "You may (optionally) fill in this form via OpenID by supplying your OpenID "
 "and clicking 'Register'."
-msgstr "Vi ankaŭ (nedeviga) povas plenigi la formularon tra OpenID se vi provizas vian OpenID adreson kaj klakas 'Registri'."
+msgstr "Vi ankaŭ (nedeviga) povas plenigi la formularon per OpenID se vi provizas vian OpenID adreson kaj klakas 'Registri'."
 
-#: ../../mod/register.php:514
+#: ../../mod/register.php:216
 msgid ""
 "If you are not familiar with OpenID, please leave that field blank and fill "
 "in the rest of the items."
 msgstr "Se vi ne konas OpenID, bonvolu lasi tiun kampon malplena kaj entajpu la aliajn elementojn."
 
-#: ../../mod/register.php:515
+#: ../../mod/register.php:217
 msgid "Your OpenID (optional): "
 msgstr "Via OpenID (nedeviga):"
 
-#: ../../mod/register.php:529
+#: ../../mod/register.php:231
 msgid "Include your profile in member directory?"
 msgstr "Aldoni vian profilon al la membrokatalogo?"
 
-#: ../../mod/register.php:549
+#: ../../mod/register.php:251
 msgid "Membership on this site is by invitation only."
 msgstr "Membriĝi ĉi tie nur eblas laŭ invito."
 
-#: ../../mod/register.php:550
+#: ../../mod/register.php:252
 msgid "Your invitation ID: "
 msgstr "Via invita idento: "
 
-#: ../../mod/register.php:553 ../../mod/admin.php:405
+#: ../../mod/register.php:255 ../../mod/admin.php:421
 msgid "Registration"
 msgstr "Registrado"
 
-#: ../../mod/register.php:561
+#: ../../mod/register.php:263
 msgid "Your Full Name (e.g. Joe Smith): "
 msgstr "Via Plena Nomo (e.g. Joe Smith): "
 
-#: ../../mod/register.php:562
+#: ../../mod/register.php:264
 msgid "Your Email Address: "
 msgstr "Via Retpoŝtadreso: "
 
-#: ../../mod/register.php:563
+#: ../../mod/register.php:265
 msgid ""
 "Choose a profile nickname. This must begin with a text character. Your "
 "profile address on this site will then be "
 "'<strong>nickname@$sitename</strong>'."
 msgstr "Elektu kaŝnomon por la profilo. Tiu bezonas komenci kun teksta litero. Poste, via profila adreso ĉi tie estos: '<strong>kaŝnomo@$sitename</strong>'."
 
-#: ../../mod/register.php:564
+#: ../../mod/register.php:266
 msgid "Choose a nickname: "
 msgstr "Elektu kaŝnomon: "
 
-#: ../../mod/register.php:567 ../../include/nav.php:81 ../../boot.php:790
+#: ../../mod/register.php:269 ../../include/nav.php:81 ../../boot.php:828
 msgid "Register"
 msgstr "Registri"
 
-#: ../../mod/dirfind.php:23
+#: ../../mod/dirfind.php:26
 msgid "People Search"
 msgstr "Serĉi Membrojn"
 
-#: ../../mod/like.php:127 ../../mod/tagger.php:70
-#: ../../addon/facebook/facebook.php:1564
+#: ../../mod/like.php:144 ../../mod/like.php:301 ../../mod/tagger.php:70
+#: ../../addon/facebook/facebook.php:1584
 #: ../../addon/communityhome/communityhome.php:158
 #: ../../addon/communityhome/communityhome.php:167
-#: ../../view/theme/diabook/theme.php:493
-#: ../../view/theme/diabook/theme.php:502 ../../include/diaspora.php:1654
+#: ../../view/theme/diabook/theme.php:565
+#: ../../view/theme/diabook/theme.php:574 ../../include/diaspora.php:1710
 #: ../../include/conversation.php:48 ../../include/conversation.php:57
 #: ../../include/conversation.php:121 ../../include/conversation.php:130
 msgid "status"
 msgstr "staton"
 
-#: ../../mod/like.php:144 ../../addon/facebook/facebook.php:1568
+#: ../../mod/like.php:161 ../../addon/facebook/facebook.php:1588
 #: ../../addon/communityhome/communityhome.php:172
-#: ../../view/theme/diabook/theme.php:507 ../../include/diaspora.php:1670
+#: ../../view/theme/diabook/theme.php:579 ../../include/diaspora.php:1726
 #: ../../include/conversation.php:65
 #, php-format
 msgid "%1$s likes %2$s's %3$s"
 msgstr "%1$s ŝatas la %3$s de %2$s"
 
-#: ../../mod/like.php:146 ../../include/conversation.php:68
+#: ../../mod/like.php:163 ../../include/conversation.php:68
 #, php-format
 msgid "%1$s doesn't like %2$s's %3$s"
 msgstr "%1$s malŝatas la %3$s de %2$s"
 
-#: ../../mod/notice.php:15 ../../mod/viewsrc.php:15 ../../mod/admin.php:156
-#: ../../mod/admin.php:684 ../../mod/admin.php:883 ../../mod/display.php:37
-#: ../../mod/display.php:142 ../../include/items.php:3084
+#: ../../mod/notice.php:15 ../../mod/viewsrc.php:15 ../../mod/admin.php:159
+#: ../../mod/admin.php:700 ../../mod/admin.php:899 ../../mod/display.php:37
+#: ../../mod/display.php:142 ../../include/items.php:3334
 msgid "Item not found."
 msgstr "Elemento ne estas trovita."
 
@@ -2822,12 +2835,12 @@ msgstr "Elemento ne estas trovita."
 msgid "Access denied."
 msgstr "Atingo nepermesita."
 
-#: ../../mod/fbrowser.php:23 ../../view/theme/diabook/theme.php:126
-#: ../../include/nav.php:51 ../../boot.php:1490
+#: ../../mod/fbrowser.php:25 ../../view/theme/diabook/theme.php:130
+#: ../../include/nav.php:51 ../../boot.php:1550
 msgid "Photos"
 msgstr "Bildoj"
 
-#: ../../mod/fbrowser.php:86
+#: ../../mod/fbrowser.php:96
 msgid "Files"
 msgstr "Dosieroj"
 
@@ -2848,39 +2861,39 @@ msgstr "Bonvolu ensaluti."
 msgid "Unable to locate original post."
 msgstr "Ne eblas trovi originalan afiŝon."
 
-#: ../../mod/item.php:249
+#: ../../mod/item.php:258
 msgid "Empty post discarded."
 msgstr "Forviŝis malplenan afiŝon."
 
-#: ../../mod/item.php:372 ../../mod/wall_upload.php:99
-#: ../../mod/wall_upload.php:108 ../../mod/wall_upload.php:115
+#: ../../mod/item.php:379 ../../mod/wall_upload.php:115
+#: ../../mod/wall_upload.php:124 ../../mod/wall_upload.php:131
 #: ../../include/message.php:144
 msgid "Wall Photos"
 msgstr "Muraj Bildoj"
 
-#: ../../mod/item.php:781
+#: ../../mod/item.php:784
 msgid "System error. Post not saved."
 msgstr "Sistema eraro. Afiŝo ne registrita."
 
-#: ../../mod/item.php:806
+#: ../../mod/item.php:809
 #, php-format
 msgid ""
 "This message was sent to you by %s, a member of the Friendica social "
 "network."
 msgstr "Ĉi mesaĝo estas sendita al vi de %s, membro de la Friendica interkona reto."
 
-#: ../../mod/item.php:808
+#: ../../mod/item.php:811
 #, php-format
 msgid "You may visit them online at %s"
 msgstr "Vi povas viziti ilin rete ĉe %s"
 
-#: ../../mod/item.php:809
+#: ../../mod/item.php:812
 msgid ""
 "Please contact the sender by replying to this post if you do not wish to "
 "receive these messages."
 msgstr "Bonvolu rispondi al ĉi mesaĝo kaj kontaktu la sendinto se vi ne volas ricevi tiujn mesaĝojn."
 
-#: ../../mod/item.php:811
+#: ../../mod/item.php:814
 #, php-format
 msgid "%s posted an update."
 msgstr "%s publikigis afiŝon."
@@ -2890,7 +2903,7 @@ msgid "Image uploaded but image cropping failed."
 msgstr "Bildo estas alŝutita, sed malsukcesis tranĉi la bildon."
 
 #: ../../mod/profile_photo.php:63 ../../mod/profile_photo.php:70
-#: ../../mod/profile_photo.php:77 ../../mod/profile_photo.php:264
+#: ../../mod/profile_photo.php:77 ../../mod/profile_photo.php:266
 #, php-format
 msgid "Image size reduction [%s] failed."
 msgstr "Malsukcesis malpligrandigi [%s] la bildon."
@@ -2905,44 +2918,44 @@ msgstr "Reŝarĝu la paĝon au malplenigu la kaŝmemoro de la retesplorilo se la
 msgid "Unable to process image"
 msgstr "Ne eblas procezi bildon."
 
-#: ../../mod/profile_photo.php:115 ../../mod/wall_upload.php:74
+#: ../../mod/profile_photo.php:117 ../../mod/wall_upload.php:77
 #, php-format
 msgid "Image exceeds size limit of %d"
 msgstr "Bildo estas pli granda ol la limito %d"
 
-#: ../../mod/profile_photo.php:207
+#: ../../mod/profile_photo.php:209
 msgid "Upload File:"
 msgstr "Alŝuti dosieron:"
 
-#: ../../mod/profile_photo.php:208
+#: ../../mod/profile_photo.php:210
 msgid "Upload Profile Photo"
 msgstr "Alŝuti profilbildon"
 
-#: ../../mod/profile_photo.php:209
+#: ../../mod/profile_photo.php:211
 msgid "Upload"
 msgstr "Alŝuti"
 
-#: ../../mod/profile_photo.php:211
+#: ../../mod/profile_photo.php:213
 msgid "skip this step"
 msgstr "Preterpasi tian paŝon"
 
-#: ../../mod/profile_photo.php:211
+#: ../../mod/profile_photo.php:213
 msgid "select a photo from your photo albums"
 msgstr "elekti bildon el viaj albumoj"
 
-#: ../../mod/profile_photo.php:224
+#: ../../mod/profile_photo.php:226
 msgid "Crop Image"
 msgstr "Stuci Bildon"
 
-#: ../../mod/profile_photo.php:225
+#: ../../mod/profile_photo.php:227
 msgid "Please adjust the image cropping for optimum viewing."
 msgstr "Bonvolu agordi la stuco de la bildo por optimuma aspekto."
 
-#: ../../mod/profile_photo.php:227
+#: ../../mod/profile_photo.php:229
 msgid "Done Editing"
 msgstr "Finigi Redaktado"
 
-#: ../../mod/profile_photo.php:255
+#: ../../mod/profile_photo.php:257
 msgid "Image uploaded successfully."
 msgstr "Bildo estas sukcese enŝutita."
 
@@ -2968,67 +2981,67 @@ msgstr "Bonvolu entajpi vian pasvorton por kontrolado:"
 msgid "New Message"
 msgstr "Nova Mesaĝo"
 
-#: ../../mod/message.php:69
+#: ../../mod/message.php:70
 msgid "Unable to locate contact information."
 msgstr "Ne eblas trovi kontaktajn informojn."
 
-#: ../../mod/message.php:119
+#: ../../mod/message.php:120
 msgid "Message deleted."
 msgstr "Mesaĝo estas forviŝita."
 
-#: ../../mod/message.php:149
+#: ../../mod/message.php:150
 msgid "Conversation removed."
 msgstr "Dialogo estas forviŝita."
 
-#: ../../mod/message.php:244
+#: ../../mod/message.php:247
 msgid "No messages."
 msgstr "Neniom da mesaĝoj."
 
-#: ../../mod/message.php:251
+#: ../../mod/message.php:254
 #, php-format
 msgid "Unknown sender - %s"
 msgstr "Nekonata sendanto - %s"
 
-#: ../../mod/message.php:254
+#: ../../mod/message.php:257
 #, php-format
 msgid "You and %s"
 msgstr "Vi kaj %s"
 
-#: ../../mod/message.php:257
+#: ../../mod/message.php:260
 #, php-format
 msgid "%s and You"
 msgstr "%s kaj vi"
 
-#: ../../mod/message.php:267 ../../mod/message.php:388
+#: ../../mod/message.php:270 ../../mod/message.php:392
 msgid "Delete conversation"
 msgstr "Forviŝi dialogon"
 
-#: ../../mod/message.php:270
+#: ../../mod/message.php:273
 msgid "D, d M Y - g:i A"
 msgstr "D, d M Y - g:i A"
 
-#: ../../mod/message.php:272
+#: ../../mod/message.php:275
 #, php-format
 msgid "%d message"
 msgid_plural "%d messages"
 msgstr[0] "%d mesaĝo"
 msgstr[1] "%d mesaĝoj"
 
-#: ../../mod/message.php:307
+#: ../../mod/message.php:310
 msgid "Message not available."
 msgstr "Mesaĝo nedisponebla."
 
-#: ../../mod/message.php:372
+#: ../../mod/message.php:375
 msgid "Delete message"
 msgstr "Forviŝu mesaĝon"
 
-#: ../../mod/message.php:390
+#: ../../mod/message.php:394
 msgid ""
 "No secure communications available. You <strong>may</strong> be able to "
 "respond from the sender's profile page."
 msgstr "Sekura komunikado ne disponeblas. Vi <strong>eble</strong> povus respondi sur la profilpaĝo de la sendanto."
 
-#: ../../mod/message.php:394
+#: ../../mod/message.php:398
 msgid "Send Reply"
 msgstr "Respondi"
 
@@ -3045,19 +3058,19 @@ msgstr "Neniom da amiko al montri."
 msgid "Theme settings updated."
 msgstr "Gisdatigis agordojn pri etosoj."
 
-#: ../../mod/admin.php:96 ../../mod/admin.php:403
+#: ../../mod/admin.php:96 ../../mod/admin.php:419
 msgid "Site"
 msgstr "Retejo"
 
-#: ../../mod/admin.php:97 ../../mod/admin.php:639 ../../mod/admin.php:651
+#: ../../mod/admin.php:97 ../../mod/admin.php:655 ../../mod/admin.php:667
 msgid "Users"
 msgstr "Uzantoj"
 
-#: ../../mod/admin.php:98 ../../mod/admin.php:733 ../../mod/admin.php:775
+#: ../../mod/admin.php:98 ../../mod/admin.php:749 ../../mod/admin.php:791
 msgid "Plugins"
 msgstr "Kromprogramoj"
 
-#: ../../mod/admin.php:99 ../../mod/admin.php:938 ../../mod/admin.php:974
+#: ../../mod/admin.php:99 ../../mod/admin.php:954 ../../mod/admin.php:990
 msgid "Themes"
 msgstr "Etosoj"
 
@@ -3065,598 +3078,622 @@ msgstr "Etosoj"
 msgid "DB updates"
 msgstr "DB ĝisdatigoj"
 
-#: ../../mod/admin.php:101
-msgid "Software Update"
-msgstr "Friendica Ĝisdatigoj"
-
-#: ../../mod/admin.php:115 ../../mod/admin.php:1061
+#: ../../mod/admin.php:115 ../../mod/admin.php:122 ../../mod/admin.php:1077
 msgid "Logs"
 msgstr "Protokoloj"
 
-#: ../../mod/admin.php:120
+#: ../../mod/admin.php:120 ../../include/nav.php:146
+msgid "Admin"
+msgstr "Administrado"
+
+#: ../../mod/admin.php:121
+msgid "Plugin Features"
+msgstr "Kromprogramaj Trajtoj"
+
+#: ../../mod/admin.php:123
 msgid "User registrations waiting for confirmation"
 msgstr "Uzantaj registradoj atendante konfirmon"
 
-#: ../../mod/admin.php:195 ../../mod/admin.php:402 ../../mod/admin.php:638
-#: ../../mod/admin.php:732 ../../mod/admin.php:774 ../../mod/admin.php:937
-#: ../../mod/admin.php:973 ../../mod/admin.php:1060
+#: ../../mod/admin.php:183 ../../mod/admin.php:637
+msgid "Normal Account"
+msgstr "Normala konto"
+
+#: ../../mod/admin.php:184 ../../mod/admin.php:638
+msgid "Soapbox Account"
+msgstr "Soapbox Konto"
+
+#: ../../mod/admin.php:185 ../../mod/admin.php:639
+msgid "Community/Celebrity Account"
+msgstr "Komunuma/eminentula Konto"
+
+#: ../../mod/admin.php:186 ../../mod/admin.php:640
+msgid "Automatic Friend Account"
+msgstr "Aŭtomata Amika Konto"
+
+#: ../../mod/admin.php:205
+msgid "Message queues"
+msgstr "Mesaĝvicoj"
+
+#: ../../mod/admin.php:210 ../../mod/admin.php:418 ../../mod/admin.php:654
+#: ../../mod/admin.php:748 ../../mod/admin.php:790 ../../mod/admin.php:953
+#: ../../mod/admin.php:989 ../../mod/admin.php:1076
 msgid "Administration"
 msgstr "Administrado"
 
-#: ../../mod/admin.php:196
+#: ../../mod/admin.php:211
 msgid "Summary"
 msgstr "Resumo"
 
-#: ../../mod/admin.php:197
+#: ../../mod/admin.php:213
 msgid "Registered users"
 msgstr "Registrataj uzantoj"
 
-#: ../../mod/admin.php:199
+#: ../../mod/admin.php:215
 msgid "Pending registrations"
 msgstr "Okazontaj registradoj"
 
-#: ../../mod/admin.php:200
+#: ../../mod/admin.php:216
 msgid "Version"
 msgstr "Versio"
 
-#: ../../mod/admin.php:202
+#: ../../mod/admin.php:218
 msgid "Active plugins"
 msgstr "Ŝaltitaj kromprogramoj"
 
-#: ../../mod/admin.php:341
+#: ../../mod/admin.php:357
 msgid "Site settings updated."
 msgstr "Ĝisdatigis retejaj agordoj."
 
-#: ../../mod/admin.php:389
+#: ../../mod/admin.php:405
 msgid "Closed"
 msgstr "Ferma"
 
-#: ../../mod/admin.php:390
+#: ../../mod/admin.php:406
 msgid "Requires approval"
 msgstr "Bezonas aprobon"
 
-#: ../../mod/admin.php:391
+#: ../../mod/admin.php:407
 msgid "Open"
 msgstr "Malferma"
 
-#: ../../mod/admin.php:395
+#: ../../mod/admin.php:411
 msgid "No SSL policy, links will track page SSL state"
 msgstr "Sen SSL strategio. Ligiloj sekvos la SSL staton de la paĝo."
 
-#: ../../mod/admin.php:396
+#: ../../mod/admin.php:412
 msgid "Force all links to use SSL"
 msgstr "Devigi ke ĉiuj ligiloj uzu SSL."
 
-#: ../../mod/admin.php:397
+#: ../../mod/admin.php:413
 msgid "Self-signed certificate, use SSL for local links only (discouraged)"
 msgstr "Memsubskribita atestilo, nur uzu SSL por lokaj ligiloj (malkuraĝigata)"
 
-#: ../../mod/admin.php:406
+#: ../../mod/admin.php:422
 msgid "File upload"
 msgstr "Alŝuto"
 
-#: ../../mod/admin.php:407
+#: ../../mod/admin.php:423
 msgid "Policies"
 msgstr "Politiko"
 
-#: ../../mod/admin.php:408
+#: ../../mod/admin.php:424
 msgid "Advanced"
 msgstr "Altnivela"
 
-#: ../../mod/admin.php:412 ../../addon/statusnet/statusnet.php:544
+#: ../../mod/admin.php:428 ../../addon/statusnet/statusnet.php:558
 msgid "Site name"
 msgstr "Nomo de retejo"
 
-#: ../../mod/admin.php:413
+#: ../../mod/admin.php:429
 msgid "Banner/Logo"
 msgstr "Emblemo"
 
-#: ../../mod/admin.php:414
+#: ../../mod/admin.php:430
 msgid "System language"
 msgstr "Sistema lingvo"
 
-#: ../../mod/admin.php:415
+#: ../../mod/admin.php:431
 msgid "System theme"
 msgstr "Sistema etoso"
 
-#: ../../mod/admin.php:415
+#: ../../mod/admin.php:431
 msgid ""
 "Default system theme - may be over-ridden by user profiles - <a href='#' "
 "id='cnftheme'>change theme settings</a>"
 msgstr "Defaŭlta sistema etoso - transpasebla de uzantprofiloj -  <a href='#' id='cnftheme'>redakti agordoj pri etosoj</a>"
 
-#: ../../mod/admin.php:416
+#: ../../mod/admin.php:432
 msgid "SSL link policy"
 msgstr "Strategio por SSL ligiloj"
 
-#: ../../mod/admin.php:416
+#: ../../mod/admin.php:432
 msgid "Determines whether generated links should be forced to use SSL"
 msgstr "Difinas ĉu generotaj ligiloj devige uzu SSL."
 
-#: ../../mod/admin.php:417
+#: ../../mod/admin.php:433
 msgid "Maximum image size"
 msgstr "Maksimuma bildgrando"
 
-#: ../../mod/admin.php:417
+#: ../../mod/admin.php:433
 msgid ""
 "Maximum size in bytes of uploaded images. Default is 0, which means no "
 "limits."
 msgstr "Maksimuma grando en bajtoj por alŝutotaj bildoj. Defaŭlte 0, kio signifas neniu limito."
 
-#: ../../mod/admin.php:419
+#: ../../mod/admin.php:435
 msgid "Register policy"
 msgstr "Interkonsento pri registrado"
 
-#: ../../mod/admin.php:420
+#: ../../mod/admin.php:436
 msgid "Register text"
 msgstr "Interkonsento teksto"
 
-#: ../../mod/admin.php:420
+#: ../../mod/admin.php:436
 msgid "Will be displayed prominently on the registration page."
 msgstr "Tio estos eminente montrata en la registro paĝo."
 
-#: ../../mod/admin.php:421
+#: ../../mod/admin.php:437
 msgid "Accounts abandoned after x days"
 msgstr "Kontoj forlasitaj post x tagoj"
 
-#: ../../mod/admin.php:421
+#: ../../mod/admin.php:437
 msgid ""
 "Will not waste system resources polling external sites for abandonded "
 "accounts. Enter 0 for no time limit."
 msgstr "Mi ne malŝparu energion por enketi aliajn retejojn pri forlasitaj kontoj. Entajpu 0 por ne uzi templimo."
 
-#: ../../mod/admin.php:422
+#: ../../mod/admin.php:438
 msgid "Allowed friend domains"
 msgstr "Permesitaj amikaj domainoj"
 
-#: ../../mod/admin.php:422
+#: ../../mod/admin.php:438
 msgid ""
 "Comma separated list of domains which are allowed to establish friendships "
 "with this site. Wildcards are accepted. Empty to allow any domains"
 msgstr "Perkome disigita listo da domajnoj kiuj rajtas konstrui amikecojn kun ĉi tiu retejo. Ĵokeroj eblas. Malplena por rajtigi ĉiujn ajn domajnojn."
 
-#: ../../mod/admin.php:423
+#: ../../mod/admin.php:439
 msgid "Allowed email domains"
 msgstr "Permesitaj retpoŝtaj domajnoj"
 
-#: ../../mod/admin.php:423
+#: ../../mod/admin.php:439
 msgid ""
 "Comma separated list of domains which are allowed in email addresses for "
 "registrations to this site. Wildcards are accepted. Empty to allow any "
 "domains"
 msgstr "Perkome disigita listo da domajnoj kiuj uzeblas kiel retpoŝtaj adresoj en novaj registradoj. Ĵokeroj eblas. Malplena por rajtigi ĉiujn ajn domajnojn."
 
-#: ../../mod/admin.php:424
+#: ../../mod/admin.php:440
 msgid "Block public"
 msgstr "Bloki publike"
 
-#: ../../mod/admin.php:424
+#: ../../mod/admin.php:440
 msgid ""
 "Check to block public access to all otherwise public personal pages on this "
 "site unless you are currently logged in."
 msgstr "Elektu por bloki publikan atingon al ĉiuj alie publikajn paĝojn en ĉi tiu retejo kiam vi ne estas ensalutita."
 
-#: ../../mod/admin.php:425
+#: ../../mod/admin.php:441
 msgid "Force publish"
 msgstr "Devigi publikigon"
 
-#: ../../mod/admin.php:425
+#: ../../mod/admin.php:441
 msgid ""
 "Check to force all profiles on this site to be listed in the site directory."
 msgstr "Elektu por devigi la registradon en la loka katalogo al ĉiuj profiloj en ĉi tiu retejo."
 
-#: ../../mod/admin.php:426
+#: ../../mod/admin.php:442
 msgid "Global directory update URL"
 msgstr "Ĝenerala adreso por ĝisdatigi la katalogon"
 
-#: ../../mod/admin.php:426
+#: ../../mod/admin.php:442
 msgid ""
 "URL to update the global directory. If this is not set, the global directory"
 " is completely unavailable to the application."
 msgstr "URL adreso por ĝisdatigi la tutmondan katalogon. Se ne agordita, la tutmonda katatolge tute ne disponeblas al la programo."
 
-#: ../../mod/admin.php:428
+#: ../../mod/admin.php:444
 msgid "Block multiple registrations"
 msgstr "Bloki pluroblajn registradojn."
 
-#: ../../mod/admin.php:428
+#: ../../mod/admin.php:444
 msgid "Disallow users to register additional accounts for use as pages."
 msgstr "Malpermesi al uzantoj la permeson por registri pluajn kontojn kiel paĝoj."
 
-#: ../../mod/admin.php:429
+#: ../../mod/admin.php:445
 msgid "OpenID support"
 msgstr "Subteno por OpenID"
 
-#: ../../mod/admin.php:429
+#: ../../mod/admin.php:445
 msgid "OpenID support for registration and logins."
 msgstr "Subteni OpenID por registrado kaj ensaluto."
 
-#: ../../mod/admin.php:430
+#: ../../mod/admin.php:446
 msgid "Fullname check"
 msgstr "Kontroli plenan nomon"
 
-#: ../../mod/admin.php:430
+#: ../../mod/admin.php:446
 msgid ""
 "Force users to register with a space between firstname and lastname in Full "
 "name, as an antispam measure"
 msgstr "Kiel kontraŭspamilo, devigi uzantoj al registrado kun spaceto inter la persona nomo kaj la familia nomo."
 
-#: ../../mod/admin.php:431
+#: ../../mod/admin.php:447
 msgid "UTF-8 Regular expressions"
 msgstr "UTF-8 regulaj exprimoj"
 
-#: ../../mod/admin.php:431
+#: ../../mod/admin.php:447
 msgid "Use PHP UTF8 regular expressions"
 msgstr "Uzi PHP UTF8 regulajn esprimojn."
 
-#: ../../mod/admin.php:432
+#: ../../mod/admin.php:448
 msgid "Show Community Page"
 msgstr "Montri Komunuma Paĝo"
 
-#: ../../mod/admin.php:432
+#: ../../mod/admin.php:448
 msgid ""
 "Display a Community page showing all recent public postings on this site."
 msgstr "Montri komunuma paĝo kun ĉiuj ĵusaj afiŝoj en ĉi tiu retejo."
 
-#: ../../mod/admin.php:433
+#: ../../mod/admin.php:449
 msgid "Enable OStatus support"
 msgstr "Ŝalti subtenon por OStatus"
 
-#: ../../mod/admin.php:433
+#: ../../mod/admin.php:449
 msgid ""
 "Provide built-in OStatus (identi.ca, status.net, etc.) compatibility. All "
 "communications in OStatus are public, so privacy warnings will be "
 "occasionally displayed."
 msgstr "Provizi integritan OStatus (identi.ca, status.net ktp) subtenon. Ĉiuj komunikadoj en OStatus estas publikaj, do privatecaj avertoj aperos de tempo al tempo."
 
-#: ../../mod/admin.php:434
+#: ../../mod/admin.php:450
 msgid "Enable Diaspora support"
 msgstr "Ŝalti subtenon por Diaspora"
 
-#: ../../mod/admin.php:434
+#: ../../mod/admin.php:450
 msgid "Provide built-in Diaspora network compatibility."
 msgstr "Provizi integritan Diaspora subtenon."
 
-#: ../../mod/admin.php:435
+#: ../../mod/admin.php:451
 msgid "Only allow Friendica contacts"
 msgstr "Nur permesigi Friendica kontaktojn"
 
-#: ../../mod/admin.php:435
+#: ../../mod/admin.php:451
 msgid ""
 "All contacts must use Friendica protocols. All other built-in communication "
 "protocols disabled."
 msgstr "Ĉiuj kontaktoj devas uzi Friendica protokolojn. Ĉiuj aliaj komunikaj protokoloj malaktivita."
 
-#: ../../mod/admin.php:436
+#: ../../mod/admin.php:452
 msgid "Verify SSL"
 msgstr "Kontroli SSL"
 
-#: ../../mod/admin.php:436
+#: ../../mod/admin.php:452
 msgid ""
 "If you wish, you can turn on strict certificate checking. This will mean you"
 " cannot connect (at all) to self-signed SSL sites."
 msgstr "Se vi deziras, vi povas aktivigi severan kontroladon de SSL atestiloj. Pro tio, vie (tute) ne eblos konekti al SSL retejoj kun memsubskribitaj atestiloj."
 
-#: ../../mod/admin.php:437
+#: ../../mod/admin.php:453
 msgid "Proxy user"
 msgstr "Uzantnomo por retperanto"
 
-#: ../../mod/admin.php:438
+#: ../../mod/admin.php:454
 msgid "Proxy URL"
 msgstr "URL adreso de retperanto"
 
-#: ../../mod/admin.php:439
+#: ../../mod/admin.php:455
 msgid "Network timeout"
 msgstr "Reta tempolimo"
 
-#: ../../mod/admin.php:439
+#: ../../mod/admin.php:455
 msgid "Value is in seconds. Set to 0 for unlimited (not recommended)."
 msgstr "Valoro en sekundoj. Uzu 0 por mallimitigi (ne rekomendata)."
 
-#: ../../mod/admin.php:440
+#: ../../mod/admin.php:456
 msgid "Delivery interval"
 msgstr "Intervalo de liverado"
 
-#: ../../mod/admin.php:440
+#: ../../mod/admin.php:456
 msgid ""
 "Delay background delivery processes by this many seconds to reduce system "
 "load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 "
 "for large dedicated servers."
 msgstr "Malfruigi fonan liveradon dum tiom da sekundoj por malpliigi la ŝargon de la sistemo. Rekomendoj: 4-5 por komunaj serviloj, 2-3 por virtualaj privataj serviloj, 0-1 por grandaj dediĉitaj serviloj."
 
-#: ../../mod/admin.php:441
+#: ../../mod/admin.php:457
 msgid "Poll interval"
 msgstr "Enketintervalo"
 
-#: ../../mod/admin.php:441
+#: ../../mod/admin.php:457
 msgid ""
 "Delay background polling processes by this many seconds to reduce system "
 "load. If 0, use delivery interval."
 msgstr "Malfruigi fonajn enketprocesojn je tiom da sekundoj por malpliigi la ŝargon de la sistemo. Se 0, uzas la liverintervalon."
 
-#: ../../mod/admin.php:442
+#: ../../mod/admin.php:458
 msgid "Maximum Load Average"
 msgstr "Maksimuma Meza Sistemŝargo"
 
-#: ../../mod/admin.php:442
+#: ../../mod/admin.php:458
 msgid ""
 "Maximum system load before delivery and poll processes are deferred - "
 "default 50."
 msgstr "Maksimuma sistemŝargo post kiu livero- kaj enketprocesoj estos prokrastinataj. - Defaŭlte 50."
 
-#: ../../mod/admin.php:456
+#: ../../mod/admin.php:472
 msgid "Update has been marked successful"
 msgstr "Ĝisdatigo estas markita sukcesa"
 
-#: ../../mod/admin.php:466
+#: ../../mod/admin.php:482
 #, php-format
 msgid "Executing %s failed. Check system logs."
 msgstr "Ne sukcesis plenumi %s. Kontrolu la sistemprotokolojn."
 
-#: ../../mod/admin.php:469
+#: ../../mod/admin.php:485
 #, php-format
 msgid "Update %s was successfully applied."
 msgstr "Sukcese aplikis la ĝisdatigo %s."
 
-#: ../../mod/admin.php:473
+#: ../../mod/admin.php:489
 #, php-format
 msgid "Update %s did not return a status. Unknown if it succeeded."
 msgstr "Ĝisdatigo %s ne liveris elirstaton. "
 
-#: ../../mod/admin.php:476
+#: ../../mod/admin.php:492
 #, php-format
 msgid "Update function %s could not be found."
 msgstr "Ne troveblas ĝisdatigo funkcio %s."
 
-#: ../../mod/admin.php:491
+#: ../../mod/admin.php:507
 msgid "No failed updates."
 msgstr "Neniom da malsukcesaj ĝisdatigoj."
 
-#: ../../mod/admin.php:495
+#: ../../mod/admin.php:511
 msgid "Failed Updates"
 msgstr "Malsukcesaj Ĝisdatigoj"
 
-#: ../../mod/admin.php:496
+#: ../../mod/admin.php:512
 msgid ""
 "This does not include updates prior to 1139, which did not return a status."
 msgstr "Ne inkluzivas ĝisdatigojn antaŭ 1139, kiuj ne liveris elirstaton."
 
-#: ../../mod/admin.php:497
+#: ../../mod/admin.php:513
 msgid "Mark success (if update was manually applied)"
 msgstr "Marki sukcesa (se la ĝisdatigo estas instalita mane)"
 
-#: ../../mod/admin.php:498
+#: ../../mod/admin.php:514
 msgid "Attempt to execute this update step automatically"
 msgstr "Provi automate plenumi ĉi tian paŝon de la ĝisdatigo."
 
-#: ../../mod/admin.php:523
+#: ../../mod/admin.php:539
 #, php-format
 msgid "%s user blocked/unblocked"
 msgid_plural "%s users blocked/unblocked"
 msgstr[0] "Blokis/malblokis %s uzanton"
 msgstr[1] "Blokis/malblokis %s uzantojn"
 
-#: ../../mod/admin.php:530
+#: ../../mod/admin.php:546
 #, php-format
 msgid "%s user deleted"
 msgid_plural "%s users deleted"
 msgstr[0] "%s uzanto forviŝita"
 msgstr[1] "%s uzanto forviŝitaj"
 
-#: ../../mod/admin.php:569
+#: ../../mod/admin.php:585
 #, php-format
 msgid "User '%s' deleted"
 msgstr "Uzanto '%s' forviŝita"
 
-#: ../../mod/admin.php:577
+#: ../../mod/admin.php:593
 #, php-format
 msgid "User '%s' unblocked"
 msgstr "Uzanto '%s' malblokita"
 
-#: ../../mod/admin.php:577
+#: ../../mod/admin.php:593
 #, php-format
 msgid "User '%s' blocked"
 msgstr "Uzanto '%s' blokita"
 
-#: ../../mod/admin.php:641
+#: ../../mod/admin.php:657
 msgid "select all"
 msgstr "elekti ĉiujn"
 
-#: ../../mod/admin.php:642
+#: ../../mod/admin.php:658
 msgid "User registrations waiting for confirm"
 msgstr "Registriĝoj atendante aprobon"
 
-#: ../../mod/admin.php:643
+#: ../../mod/admin.php:659
 msgid "Request date"
 msgstr "Dato de peto"
 
-#: ../../mod/admin.php:643 ../../mod/admin.php:652
+#: ../../mod/admin.php:659 ../../mod/admin.php:668
 #: ../../include/contact_selectors.php:79
 msgid "Email"
 msgstr "Retpoŝto"
 
-#: ../../mod/admin.php:644
+#: ../../mod/admin.php:660
 msgid "No registrations."
 msgstr "Neniom da registriĝoj."
 
-#: ../../mod/admin.php:646
+#: ../../mod/admin.php:662
 msgid "Deny"
 msgstr "Negi"
 
-#: ../../mod/admin.php:652
+#: ../../mod/admin.php:668
 msgid "Register date"
 msgstr "Dato de registrado"
 
-#: ../../mod/admin.php:652
+#: ../../mod/admin.php:668
 msgid "Last login"
 msgstr "Plej ĵusa ensaluto"
 
-#: ../../mod/admin.php:652
+#: ../../mod/admin.php:668
 msgid "Last item"
 msgstr "Plej ĵusa elemento"
 
-#: ../../mod/admin.php:652
+#: ../../mod/admin.php:668
 msgid "Account"
 msgstr "Konto"
 
-#: ../../mod/admin.php:654
+#: ../../mod/admin.php:670
 msgid ""
 "Selected users will be deleted!\\n\\nEverything these users had posted on "
 "this site will be permanently deleted!\\n\\nAre you sure?"
 msgstr "La elektitaj uzantkontoj estas forviŝotaj!\\n\\nĈiuj elementoj kiujn ili afiŝis je la retpaĝo estos permanente forviŝitaj.\\n\\nĈu vi certas?"
 
-#: ../../mod/admin.php:655
+#: ../../mod/admin.php:671
 msgid ""
 "The user {0} will be deleted!\\n\\nEverything this user has posted on this "
 "site will be permanently deleted!\\n\\nAre you sure?"
 msgstr "La uzanto {0} estas forviŝota!\\n\\nĈiuj elementoj kiujn li afiŝis je la retpaĝo estos permanente forviŝitaj.\\n\\nĈu vi certas?"
 
-#: ../../mod/admin.php:696
+#: ../../mod/admin.php:712
 #, php-format
 msgid "Plugin %s disabled."
 msgstr "Kromprogramo %s estas malŝaltita."
 
-#: ../../mod/admin.php:700
+#: ../../mod/admin.php:716
 #, php-format
 msgid "Plugin %s enabled."
 msgstr "Kromprogramo %s estas ŝaltita."
 
-#: ../../mod/admin.php:710 ../../mod/admin.php:908
+#: ../../mod/admin.php:726 ../../mod/admin.php:924
 msgid "Disable"
 msgstr "Malŝalti"
 
-#: ../../mod/admin.php:712 ../../mod/admin.php:910
+#: ../../mod/admin.php:728 ../../mod/admin.php:926
 msgid "Enable"
 msgstr "Ŝalti"
 
-#: ../../mod/admin.php:734 ../../mod/admin.php:939
+#: ../../mod/admin.php:750 ../../mod/admin.php:955
 msgid "Toggle"
 msgstr "Ŝalti/Malŝalti"
 
-#: ../../mod/admin.php:742 ../../mod/admin.php:949
+#: ../../mod/admin.php:758 ../../mod/admin.php:965
 msgid "Author: "
 msgstr "Aŭtoro: "
 
-#: ../../mod/admin.php:743 ../../mod/admin.php:950
+#: ../../mod/admin.php:759 ../../mod/admin.php:966
 msgid "Maintainer: "
 msgstr "Prizorganto: "
 
-#: ../../mod/admin.php:872
+#: ../../mod/admin.php:888
 msgid "No themes found."
 msgstr "Ne trovis etosojn."
 
-#: ../../mod/admin.php:931
+#: ../../mod/admin.php:947
 msgid "Screenshot"
 msgstr "Ekrankopio"
 
-#: ../../mod/admin.php:979
+#: ../../mod/admin.php:995
 msgid "[Experimental]"
 msgstr "[Eksperimenta]"
 
-#: ../../mod/admin.php:980
+#: ../../mod/admin.php:996
 msgid "[Unsupported]"
 msgstr "[Nesubtenata]"
 
-#: ../../mod/admin.php:1007
+#: ../../mod/admin.php:1023
 msgid "Log settings updated."
 msgstr "Protokolagordoj ĝisdatigitaj."
 
-#: ../../mod/admin.php:1063
+#: ../../mod/admin.php:1079
 msgid "Clear"
 msgstr "Forviŝi"
 
-#: ../../mod/admin.php:1069
+#: ../../mod/admin.php:1085
 msgid "Debugging"
 msgstr "Sencimigado"
 
-#: ../../mod/admin.php:1070
+#: ../../mod/admin.php:1086
 msgid "Log file"
 msgstr "Protokolo"
 
-#: ../../mod/admin.php:1070
+#: ../../mod/admin.php:1086
 msgid ""
 "Must be writable by web server. Relative to your Friendica top-level "
 "directory."
 msgstr "Devas esti skribebla de la retservilo. Relativa al via plej supra Friendica dosierujo."
 
-#: ../../mod/admin.php:1071
+#: ../../mod/admin.php:1087
 msgid "Log level"
 msgstr "Protokolnivelo"
 
-#: ../../mod/admin.php:1121
+#: ../../mod/admin.php:1137
 msgid "Close"
 msgstr "Fermi"
 
-#: ../../mod/admin.php:1127
+#: ../../mod/admin.php:1143
 msgid "FTP Host"
 msgstr "FTP Servilo"
 
-#: ../../mod/admin.php:1128
+#: ../../mod/admin.php:1144
 msgid "FTP Path"
 msgstr "FTP Vojo"
 
-#: ../../mod/admin.php:1129
+#: ../../mod/admin.php:1145
 msgid "FTP User"
 msgstr "FTP Uzanto"
 
-#: ../../mod/admin.php:1130
+#: ../../mod/admin.php:1146
 msgid "FTP Password"
 msgstr "FTP Pasvorto"
 
-#: ../../mod/profile.php:21 ../../boot.php:955
+#: ../../mod/profile.php:21 ../../boot.php:993
 msgid "Requested profile is not available."
 msgstr "La petita profilo ne disponeblas."
 
-#: ../../mod/profile.php:126 ../../mod/display.php:75
+#: ../../mod/profile.php:141 ../../mod/display.php:75
 msgid "Access to this profile has been restricted."
 msgstr "Atingo al ĉi tio profilo estas limitigita"
 
-#: ../../mod/profile.php:151
+#: ../../mod/profile.php:166
 msgid "Tips for New Members"
 msgstr "Konsilo por novaj membroj"
 
-#: ../../mod/ping.php:177
+#: ../../mod/ping.php:185
 msgid "{0} wants to be your friend"
 msgstr "{0} volas amikiĝi kun vi"
 
-#: ../../mod/ping.php:182
+#: ../../mod/ping.php:190
 msgid "{0} sent you a message"
 msgstr "{0} sendis mesaĝon al vi"
 
-#: ../../mod/ping.php:187
+#: ../../mod/ping.php:195
 msgid "{0} requested registration"
 msgstr "{0} petis registradon"
 
-#: ../../mod/ping.php:193
+#: ../../mod/ping.php:201
 #, php-format
 msgid "{0} commented %s's post"
 msgstr "{0} komentis pri la afiŝo de %s"
 
-#: ../../mod/ping.php:198
+#: ../../mod/ping.php:206
 #, php-format
 msgid "{0} liked %s's post"
 msgstr "{0} satis la afiŝon de %s"
 
-#: ../../mod/ping.php:203
+#: ../../mod/ping.php:211
 #, php-format
 msgid "{0} disliked %s's post"
 msgstr "{0} malŝatis la afiŝon de %s"
 
-#: ../../mod/ping.php:208
+#: ../../mod/ping.php:216
 #, php-format
 msgid "{0} is now friends with %s"
 msgstr "{0} amikiĝis kun %s"
 
-#: ../../mod/ping.php:213
+#: ../../mod/ping.php:221
 msgid "{0} posted"
 msgstr "{0} afiŝis"
 
-#: ../../mod/ping.php:218
+#: ../../mod/ping.php:226
 #, php-format
 msgid "{0} tagged %s's post with #%s"
 msgstr "{0} markis la afiŝon de %s kun #%s"
 
-#: ../../mod/ping.php:224
+#: ../../mod/ping.php:232
 msgid "{0} mentioned you in a post"
 msgstr "{0} menciis vin en afiŝo"
 
@@ -3671,67 +3708,16 @@ msgstr "Eraro en OpenID protokolo. Ne resendis identecon."
 #: ../../mod/openid.php:53
 msgid ""
 "Account not found and OpenID registration is not permitted on this site."
-msgstr "Ne trovis kontoj, kaj registrado tra OpenID estas malpermesita ĉi tie."
+msgstr "Ne trovis kontoj, kaj registrado per OpenID estas malpermesita ĉi tie."
 
-#: ../../mod/openid.php:93 ../../include/auth.php:90
-#: ../../include/auth.php:153
+#: ../../mod/openid.php:93 ../../include/auth.php:99
+#: ../../include/auth.php:162
 msgid "Login failed."
 msgstr "Ensalutado malsukcesis."
 
-#: ../../mod/follow.php:30
-msgid "Connect URL missing."
-msgstr "Ne ekzistas URL adreso por konekti."
-
-#: ../../mod/follow.php:56
-msgid ""
-"This site is not configured to allow communications with other networks."
-msgstr "Tiu retpaĝo ne permesas komunikadon kun aliaj retoj."
-
-#: ../../mod/follow.php:57 ../../mod/follow.php:72
-msgid "No compatible communication protocols or feeds were discovered."
-msgstr "Ne malkovris kongruajn protokolojn por komunikado aŭ fluojn."
-
-#: ../../mod/follow.php:70
-msgid "The profile address specified does not provide adequate information."
-msgstr "La specifita profiladreso ne enhavas sufiĉe da informoj."
-
-#: ../../mod/follow.php:74
-msgid "An author or name was not found."
-msgstr "Ne trovis aŭtoron aŭ nomon."
-
-#: ../../mod/follow.php:76
-msgid "No browser URL could be matched to this address."
-msgstr "Neniu retuma URL adreso kongruas al la adreso."
-
-#: ../../mod/follow.php:78
-msgid ""
-"Unable to match @-style Identity Address with a known protocol or email "
-"contact."
-msgstr "Ne eblas kongrui @-stilan identecon adreson al iu konata protokolo au retpoŝtadreso."
-
-#: ../../mod/follow.php:79
-msgid "Use mailto: in front of address to force email check."
-msgstr "Uzu mailto: antaŭ la adreso por devigi la testadon per retpoŝto."
-
-#: ../../mod/follow.php:85
-msgid ""
-"The profile address specified belongs to a network which has been disabled "
-"on this site."
-msgstr "Tiu profila adreso apartenas al retejo kiu estas maŝaltita je ĉi tiu retejo."
-
-#: ../../mod/follow.php:90
-msgid ""
-"Limited profile. This person will be unable to receive direct/personal "
-"notifications from you."
-msgstr "Profilo limigata. Ĉi persono ne eblos ricevi rektajn/personajn atentigojn de vi. "
-
-#: ../../mod/follow.php:160
-msgid "Unable to retrieve contact information."
-msgstr "Ne eblas ricevi kontaktinformojn."
-
-#: ../../mod/follow.php:206
-msgid "following"
-msgstr "sekvanta"
+#: ../../mod/follow.php:27
+msgid "Contact added"
+msgstr "Aldonis kontakton"
 
 #: ../../mod/common.php:42
 msgid "Common Friends"
@@ -3753,12 +3739,13 @@ msgstr "Programoj"
 msgid "No installed applications."
 msgstr "Neniom da instalitaj programoj."
 
-#: ../../mod/search.php:83
-msgid "Search This Site"
-msgstr "Serĉi ĉi-tiun retejon"
+#: ../../mod/search.php:83 ../../include/text.php:649
+#: ../../include/text.php:650 ../../include/nav.php:91
+msgid "Search"
+msgstr "Serĉi"
 
-#: ../../mod/profiles.php:21 ../../mod/profiles.php:375
-#: ../../mod/profiles.php:489 ../../mod/dfrn_confirm.php:62
+#: ../../mod/profiles.php:21 ../../mod/profiles.php:410
+#: ../../mod/profiles.php:524 ../../mod/dfrn_confirm.php:62
 msgid "Profile not found."
 msgstr "Profilo ne trovita."
 
@@ -3766,272 +3753,305 @@ msgstr "Profilo ne trovita."
 msgid "Profile Name is required."
 msgstr "Nomo de profilo estas bezonata."
 
-#: ../../mod/profiles.php:145
+#: ../../mod/profiles.php:155
 msgid "Marital Status"
 msgstr "Amrilata Stato"
 
-#: ../../mod/profiles.php:149
+#: ../../mod/profiles.php:159
 msgid "Romantic Partner"
 msgstr "Kora Partnero"
 
-#: ../../mod/profiles.php:153
+#: ../../mod/profiles.php:163
+msgid "Likes"
+msgstr "Ŝatoj"
+
+#: ../../mod/profiles.php:167
+msgid "Dislikes"
+msgstr "Malŝatoj"
+
+#: ../../mod/profiles.php:171
 msgid "Work/Employment"
 msgstr "Laboro"
 
-#: ../../mod/profiles.php:156
+#: ../../mod/profiles.php:174
 msgid "Religion"
 msgstr "Religio"
 
-#: ../../mod/profiles.php:160
+#: ../../mod/profiles.php:178
 msgid "Political Views"
 msgstr "Politikaj Opinioj"
 
-#: ../../mod/profiles.php:164
+#: ../../mod/profiles.php:182
 msgid "Gender"
 msgstr "Sekso"
 
-#: ../../mod/profiles.php:168
+#: ../../mod/profiles.php:186
 msgid "Sexual Preference"
 msgstr "Seksa Prefero"
 
-#: ../../mod/profiles.php:172
+#: ../../mod/profiles.php:190
 msgid "Homepage"
 msgstr "Hejmpaĝo"
 
-#: ../../mod/profiles.php:176
+#: ../../mod/profiles.php:194
 msgid "Interests"
 msgstr "Interesoj"
 
-#: ../../mod/profiles.php:181
+#: ../../mod/profiles.php:198
+msgid "Address"
+msgstr "Adreso"
+
+#: ../../mod/profiles.php:205 ../../addon/dav/layout.fnk.php:310
 msgid "Location"
 msgstr "Loko"
 
-#: ../../mod/profiles.php:253
+#: ../../mod/profiles.php:288
 msgid "Profile updated."
 msgstr "Profilo ĝisdatigita."
 
-#: ../../mod/profiles.php:320
+#: ../../mod/profiles.php:355
 msgid " and "
 msgstr " kaj "
 
-#: ../../mod/profiles.php:328
+#: ../../mod/profiles.php:363
 msgid "public profile"
 msgstr "publika profilo"
 
-#: ../../mod/profiles.php:331
+#: ../../mod/profiles.php:366
 #, php-format
 msgid "%1$s changed %2$s to &ldquo;%3$s&rdquo;"
 msgstr "%1$s ŝanĝis %2$s al &ldquo;%3$s&rdquo;"
 
-#: ../../mod/profiles.php:335
+#: ../../mod/profiles.php:367
+#, php-format
+msgid " - Visit %1$s's %2$s"
+msgstr " - Vizitu la %2$s de %1$s"
+
+#: ../../mod/profiles.php:370
 #, php-format
 msgid "%1$s has an updated %2$s, changing %3$s."
 msgstr "%1$s havas ĝisdatigigan %2$s, ŝanĝas %3$s."
 
-#: ../../mod/profiles.php:394
+#: ../../mod/profiles.php:429
 msgid "Profile deleted."
 msgstr "Profilo forviŝita."
 
-#: ../../mod/profiles.php:412 ../../mod/profiles.php:446
+#: ../../mod/profiles.php:447 ../../mod/profiles.php:481
 msgid "Profile-"
 msgstr "Profilo-"
 
-#: ../../mod/profiles.php:431 ../../mod/profiles.php:473
+#: ../../mod/profiles.php:466 ../../mod/profiles.php:508
 msgid "New profile created."
 msgstr "Nova profilo kreita."
 
-#: ../../mod/profiles.php:452
+#: ../../mod/profiles.php:487
 msgid "Profile unavailable to clone."
 msgstr "Ne eblas kopii profilon."
 
-#: ../../mod/profiles.php:510
+#: ../../mod/profiles.php:545
 msgid "Hide your contact/friend list from viewers of this profile?"
 msgstr "Kaŝi vian liston de kontaktoj/amikoj al vidantoj de ĉi-tio profilo?"
 
-#: ../../mod/profiles.php:533
+#: ../../mod/profiles.php:568
 msgid "Edit Profile Details"
 msgstr "Redakti Detalojn de Profilo"
 
-#: ../../mod/profiles.php:535
+#: ../../mod/profiles.php:570
 msgid "View this profile"
 msgstr "Vidi la profilon."
 
-#: ../../mod/profiles.php:536
+#: ../../mod/profiles.php:571
 msgid "Create a new profile using these settings"
 msgstr "Krei novan profilon kun tiaj agordoj"
 
-#: ../../mod/profiles.php:537
+#: ../../mod/profiles.php:572
 msgid "Clone this profile"
 msgstr "Kopii ĉi tiun profilon"
 
-#: ../../mod/profiles.php:538
+#: ../../mod/profiles.php:573
 msgid "Delete this profile"
 msgstr "Forviŝi ĉi tiun profilon"
 
-#: ../../mod/profiles.php:539
+#: ../../mod/profiles.php:574
 msgid "Profile Name:"
 msgstr "Nomo de Profilo:"
 
-#: ../../mod/profiles.php:540
+#: ../../mod/profiles.php:575
 msgid "Your Full Name:"
 msgstr "Via Plena Nomo:"
 
-#: ../../mod/profiles.php:541
+#: ../../mod/profiles.php:576
 msgid "Title/Description:"
 msgstr "Titolo/Priskribo:"
 
-#: ../../mod/profiles.php:542
+#: ../../mod/profiles.php:577
 msgid "Your Gender:"
 msgstr "Via Sekso:"
 
-#: ../../mod/profiles.php:543
+#: ../../mod/profiles.php:578
 #, php-format
 msgid "Birthday (%s):"
 msgstr "Naskiĝtago (%s):"
 
-#: ../../mod/profiles.php:544
+#: ../../mod/profiles.php:579
 msgid "Street Address:"
 msgstr "Adreso:"
 
-#: ../../mod/profiles.php:545
+#: ../../mod/profiles.php:580
 msgid "Locality/City:"
 msgstr "Urbo:"
 
-#: ../../mod/profiles.php:546
+#: ../../mod/profiles.php:581
 msgid "Postal/Zip Code:"
 msgstr "Poŝtkodo:"
 
-#: ../../mod/profiles.php:547
+#: ../../mod/profiles.php:582
 msgid "Country:"
 msgstr "Lando:"
 
-#: ../../mod/profiles.php:548
+#: ../../mod/profiles.php:583
 msgid "Region/State:"
 msgstr "Ŝtato:"
 
-#: ../../mod/profiles.php:549
+#: ../../mod/profiles.php:584
 msgid "<span class=\"heart\">&hearts;</span> Marital Status:"
 msgstr "<span class=\"heart\">&hearts;</span> Civita Stato:"
 
-#: ../../mod/profiles.php:550
+#: ../../mod/profiles.php:585
 msgid "Who: (if applicable)"
 msgstr "Kiu (se aplikeble):"
 
-#: ../../mod/profiles.php:551
+#: ../../mod/profiles.php:586
 msgid "Examples: cathy123, Cathy Williams, cathy@example.com"
 msgstr "Ekzemploj: cathy123, Cathy Williams, cathy@example.com"
 
-#: ../../mod/profiles.php:552 ../../include/profile_advanced.php:43
+#: ../../mod/profiles.php:587
+msgid "Since [date]:"
+msgstr "Ekde [dato]:"
+
+#: ../../mod/profiles.php:588 ../../include/profile_advanced.php:46
 msgid "Sexual Preference:"
 msgstr "Seksa Prefero:"
 
-#: ../../mod/profiles.php:553
+#: ../../mod/profiles.php:589
 msgid "Homepage URL:"
 msgstr "Adreso de Hejmpaĝo:"
 
-#: ../../mod/profiles.php:554 ../../include/profile_advanced.php:49
+#: ../../mod/profiles.php:590 ../../include/profile_advanced.php:50
+msgid "Hometown:"
+msgstr "Hejmurbo:"
+
+#: ../../mod/profiles.php:591 ../../include/profile_advanced.php:54
 msgid "Political Views:"
 msgstr "Politikaj Opinioj:"
 
-#: ../../mod/profiles.php:555
+#: ../../mod/profiles.php:592
 msgid "Religious Views:"
 msgstr "Religiaj Opinioj:"
 
-#: ../../mod/profiles.php:556
+#: ../../mod/profiles.php:593
 msgid "Public Keywords:"
 msgstr "Publikaj ŝlosilvortoj:"
 
-#: ../../mod/profiles.php:557
+#: ../../mod/profiles.php:594
 msgid "Private Keywords:"
 msgstr "Privataj ŝlosilvortoj:"
 
-#: ../../mod/profiles.php:558
+#: ../../mod/profiles.php:595 ../../include/profile_advanced.php:62
+msgid "Likes:"
+msgstr "Ŝatoj:"
+
+#: ../../mod/profiles.php:596 ../../include/profile_advanced.php:64
+msgid "Dislikes:"
+msgstr "Malŝatoj:"
+
+#: ../../mod/profiles.php:597
 msgid "Example: fishing photography software"
 msgstr "Ekzemple: fiŝkapti fotografio programaro"
 
-#: ../../mod/profiles.php:559
+#: ../../mod/profiles.php:598
 msgid "(Used for suggesting potential friends, can be seen by others)"
 msgstr "(Por sugesti amikoj. Videbla al aliaj.)"
 
-#: ../../mod/profiles.php:560
+#: ../../mod/profiles.php:599
 msgid "(Used for searching profiles, never shown to others)"
 msgstr "(Por serĉi profilojn. Neniam videbla al aliaj.)"
 
-#: ../../mod/profiles.php:561
+#: ../../mod/profiles.php:600
 msgid "Tell us about yourself..."
 msgstr "Diru al ni pri vi..."
 
-#: ../../mod/profiles.php:562
+#: ../../mod/profiles.php:601
 msgid "Hobbies/Interests"
 msgstr "Ŝatokupoj/Interesoj"
 
-#: ../../mod/profiles.php:563
+#: ../../mod/profiles.php:602
 msgid "Contact information and Social Networks"
 msgstr "Kontaktaj informoj kaj Interkonaj Retejoj"
 
-#: ../../mod/profiles.php:564
+#: ../../mod/profiles.php:603
 msgid "Musical interests"
 msgstr "Muzikaj interesoj"
 
-#: ../../mod/profiles.php:565
+#: ../../mod/profiles.php:604
 msgid "Books, literature"
 msgstr "Libroj, literaturo"
 
-#: ../../mod/profiles.php:566
+#: ../../mod/profiles.php:605
 msgid "Television"
 msgstr "Televido"
 
-#: ../../mod/profiles.php:567
+#: ../../mod/profiles.php:606
 msgid "Film/dance/culture/entertainment"
 msgstr "Filmoj/dancoj/arto/amuzaĵoj"
 
-#: ../../mod/profiles.php:568
+#: ../../mod/profiles.php:607
 msgid "Love/romance"
 msgstr "Amo/romanco"
 
-#: ../../mod/profiles.php:569
+#: ../../mod/profiles.php:608
 msgid "Work/employment"
 msgstr "Laboro"
 
-#: ../../mod/profiles.php:570
+#: ../../mod/profiles.php:609
 msgid "School/education"
 msgstr "Lernejo/eduko"
 
-#: ../../mod/profiles.php:575
+#: ../../mod/profiles.php:614
 msgid ""
 "This is your <strong>public</strong> profile.<br />It <strong>may</strong> "
 "be visible to anybody using the internet."
 msgstr "Ĉi tio estas via <strong>publika</strong> profilo. Ĝi <strong>eble</strong> estas videbla al ĉiuj en interreto. "
 
-#: ../../mod/profiles.php:585 ../../mod/directory.php:111
+#: ../../mod/profiles.php:624 ../../mod/directory.php:111
 msgid "Age: "
 msgstr "Aĝo:"
 
-#: ../../mod/profiles.php:620
+#: ../../mod/profiles.php:663
 msgid "Edit/Manage Profiles"
 msgstr "Redakti/administri Profilojn"
 
-#: ../../mod/profiles.php:621 ../../boot.php:1064
+#: ../../mod/profiles.php:664 ../../boot.php:1102
 msgid "Change profile photo"
 msgstr "Ŝanĝi profilbildon"
 
-#: ../../mod/profiles.php:622 ../../boot.php:1065
+#: ../../mod/profiles.php:665 ../../boot.php:1103
 msgid "Create New Profile"
 msgstr "Krei novan profilon"
 
-#: ../../mod/profiles.php:633 ../../boot.php:1075
+#: ../../mod/profiles.php:676 ../../boot.php:1113
 msgid "Profile Image"
 msgstr "Profilbildo"
 
-#: ../../mod/profiles.php:635 ../../boot.php:1078
+#: ../../mod/profiles.php:678 ../../boot.php:1116
 msgid "visible to everybody"
 msgstr "videbla al ĉiuj"
 
-#: ../../mod/profiles.php:636 ../../boot.php:1079
+#: ../../mod/profiles.php:679 ../../boot.php:1117
 msgid "Edit visibility"
 msgstr "Redakti videblecon"
 
-#: ../../mod/filer.php:29 ../../include/conversation.php:922
+#: ../../mod/filer.php:29 ../../include/conversation.php:951
 msgid "Save to Folder:"
 msgstr "Konservi en Dosierujo:"
 
@@ -4079,7 +4099,7 @@ msgstr "Aldoni"
 msgid "No entries."
 msgstr "Neniom da afiŝoj."
 
-#: ../../mod/suggest.php:38 ../../view/theme/diabook/theme.php:554
+#: ../../mod/suggest.php:38 ../../view/theme/diabook/theme.php:626
 #: ../../include/contact_widgets.php:34
 msgid "Friend Suggestions"
 msgstr "Amikosugestoj"
@@ -4094,12 +4114,7 @@ msgstr "Neniu sugestoj disponeblas. Se ĉi tiu estas nova retejo, bonvolu reprov
 msgid "Ignore/Hide"
 msgstr "Ignori/Kaŝi"
 
-#: ../../mod/acl.php:134
-#, php-format
-msgid "%s [%s]"
-msgstr "%s [%s]"
-
-#: ../../mod/directory.php:47 ../../view/theme/diabook/theme.php:552
+#: ../../mod/directory.php:47 ../../view/theme/diabook/theme.php:624
 msgid "Global Directory"
 msgstr "Tutmonda Katalogo"
 
@@ -4195,7 +4210,7 @@ msgstr "Vi bezonas ĉi-tiun invitkodon: $invite_code"
 #: ../../mod/invite.php:116
 msgid ""
 "Once you have registered, please connect with me via my profile page at:"
-msgstr "Kiam vi registris, bonvolu konekti al mi tra mi profilo ĉe: "
+msgstr "Kiam vi registris, bonvolu konekti al mi pere de mi profilo ĉe: "
 
 #: ../../mod/invite.php:118
 msgid ""
@@ -4209,164 +4224,180 @@ msgid ""
 " has already been approved."
 msgstr "Tio ĉi okazis de tempo al tempo se ambaŭ personoj petas kontakton ka ĝi jam estas aprobita."
 
-#: ../../mod/dfrn_confirm.php:242
+#: ../../mod/dfrn_confirm.php:237
 msgid "Response from remote site was not understood."
 msgstr "Ne komprenis la rispondon de la fora retejo."
 
-#: ../../mod/dfrn_confirm.php:251
+#: ../../mod/dfrn_confirm.php:246
 msgid "Unexpected response from remote site: "
 msgstr "Neatendita rispondo de la fora retejo:"
 
-#: ../../mod/dfrn_confirm.php:259
+#: ../../mod/dfrn_confirm.php:254
 msgid "Confirmation completed successfully."
 msgstr "Konfirmo sukcese kompletigita."
 
-#: ../../mod/dfrn_confirm.php:261 ../../mod/dfrn_confirm.php:275
-#: ../../mod/dfrn_confirm.php:282
+#: ../../mod/dfrn_confirm.php:256 ../../mod/dfrn_confirm.php:270
+#: ../../mod/dfrn_confirm.php:277
 msgid "Remote site reported: "
 msgstr "La fora retejo raportis:"
 
-#: ../../mod/dfrn_confirm.php:273
+#: ../../mod/dfrn_confirm.php:268
 msgid "Temporary failure. Please wait and try again."
 msgstr "Dumtempa eraro. Bonvolu atendi kaj provi refoje."
 
-#: ../../mod/dfrn_confirm.php:280
+#: ../../mod/dfrn_confirm.php:275
 msgid "Introduction failed or was revoked."
 msgstr "La prezento malsukcesis au estas revokita."
 
-#: ../../mod/dfrn_confirm.php:425
+#: ../../mod/dfrn_confirm.php:420
 msgid "Unable to set contact photo."
 msgstr "Neeblas agordi la kontaktbildo."
 
-#: ../../mod/dfrn_confirm.php:482 ../../include/diaspora.php:507
+#: ../../mod/dfrn_confirm.php:477 ../../include/diaspora.php:510
 #: ../../include/conversation.php:101
 #, php-format
 msgid "%1$s is now friends with %2$s"
 msgstr "%1$s amikiĝis kun %2$s"
 
-#: ../../mod/dfrn_confirm.php:554
+#: ../../mod/dfrn_confirm.php:562
 #, php-format
 msgid "No user record found for '%s' "
 msgstr "Ne trovis uzanton '%s' "
 
-#: ../../mod/dfrn_confirm.php:564
+#: ../../mod/dfrn_confirm.php:572
 msgid "Our site encryption key is apparently messed up."
 msgstr "Ŝajnas kvazaŭ la ĉifroŝlosilo de nia retejo estas fuŝita."
 
-#: ../../mod/dfrn_confirm.php:575
+#: ../../mod/dfrn_confirm.php:583
 msgid "Empty site URL was provided or URL could not be decrypted by us."
 msgstr "Malplena adreso de retejo provizita, aŭ ni ne povis malĉifri la adreson."
 
-#: ../../mod/dfrn_confirm.php:596
+#: ../../mod/dfrn_confirm.php:604
 msgid "Contact record was not found for you on our site."
 msgstr "Kontakto ne trovita por vi en via retejo."
 
-#: ../../mod/dfrn_confirm.php:610
+#: ../../mod/dfrn_confirm.php:618
 #, php-format
 msgid "Site public key not available in contact record for URL %s."
 msgstr "Publika ŝlosilo de retejo ne disponeblas en la kontaktrikordo por la URL adreso %s."
 
-#: ../../mod/dfrn_confirm.php:630
+#: ../../mod/dfrn_confirm.php:638
 msgid ""
 "The ID provided by your system is a duplicate on our system. It should work "
 "if you try again."
 msgstr "La identeco provizita de via sistemo estas duoblo ĉe nia sistemo. Ĝi eble funkcias se vi provas refoje."
 
-#: ../../mod/dfrn_confirm.php:641
+#: ../../mod/dfrn_confirm.php:649
 msgid "Unable to set your contact credentials on our system."
 msgstr "Ne sukcesis agordi la legitimaĵojn de via kontakto ĉe nia sistemo."
 
-#: ../../mod/dfrn_confirm.php:706
+#: ../../mod/dfrn_confirm.php:716
 msgid "Unable to update your contact profile details on our system"
 msgstr "Neeblas ĝisdatigi viajn profildetalojn ĉe nia sistemo."
 
-#: ../../mod/dfrn_confirm.php:740
+#: ../../mod/dfrn_confirm.php:750
 #, php-format
 msgid "Connection accepted at %s"
 msgstr "Konekto akceptita je %s"
 
-#: ../../mod/dfrn_confirm.php:789
+#: ../../mod/dfrn_confirm.php:799
 #, php-format
 msgid "%1$s has joined %2$s"
 msgstr "%1$s aliĝis al %2$s"
 
-#: ../../addon/facebook/facebook.php:501
+#: ../../addon/fromgplus/fromgplus.php:29
+msgid "Google+ Import Settings"
+msgstr "Google+ Importo"
+
+#: ../../addon/fromgplus/fromgplus.php:32
+msgid "Enable Google+ Import"
+msgstr "Aktivigi Ĝoogle+ Importon"
+
+#: ../../addon/fromgplus/fromgplus.php:35
+msgid "Google Account ID"
+msgstr "Google Konto ID"
+
+#: ../../addon/fromgplus/fromgplus.php:55
+msgid "Google+ Import Settings saved."
+msgstr "Konservis Agordojn por Google+ Importo."
+
+#: ../../addon/facebook/facebook.php:521
 msgid "Facebook disabled"
 msgstr "Facebook malŝaltita"
 
-#: ../../addon/facebook/facebook.php:506
+#: ../../addon/facebook/facebook.php:526
 msgid "Updating contacts"
 msgstr "Mi ĝisdatigas la kontaktojn."
 
-#: ../../addon/facebook/facebook.php:529
+#: ../../addon/facebook/facebook.php:549
 msgid "Facebook API key is missing."
 msgstr "La API ŝlosilo de Facebook ne estas konata ĉi tie."
 
-#: ../../addon/facebook/facebook.php:536
+#: ../../addon/facebook/facebook.php:556
 msgid "Facebook Connect"
 msgstr "Kontekto al Facebook"
 
-#: ../../addon/facebook/facebook.php:542
+#: ../../addon/facebook/facebook.php:562
 msgid "Install Facebook connector for this account."
 msgstr "Instali la Facebook konektilo por ĉi tiu konto."
 
-#: ../../addon/facebook/facebook.php:549
+#: ../../addon/facebook/facebook.php:569
 msgid "Remove Facebook connector"
 msgstr "Forigi la Facebook konektilon."
 
-#: ../../addon/facebook/facebook.php:554
+#: ../../addon/facebook/facebook.php:574
 msgid ""
 "Re-authenticate [This is necessary whenever your Facebook password is "
 "changed.]"
 msgstr "Reaŭtentiĝi [Tio estas bezonata ĉiam kiam vi ŝanĝis vian pasvorton ĉe Facebook.]"
 
-#: ../../addon/facebook/facebook.php:561
+#: ../../addon/facebook/facebook.php:581
 msgid "Post to Facebook by default"
 msgstr "Ĉiam afiŝi al Facebook."
 
-#: ../../addon/facebook/facebook.php:567
+#: ../../addon/facebook/facebook.php:587
 msgid ""
 "Facebook friend linking has been disabled on this site. The following "
 "settings will have no effect."
 msgstr "Ligado kun Facebook amikoj estas malaktivita ĉe tiu retejo. La sekvantaj agordoj do ne havas validecon."
 
-#: ../../addon/facebook/facebook.php:571
+#: ../../addon/facebook/facebook.php:591
 msgid ""
 "Facebook friend linking has been disabled on this site. If you disable it, "
 "you will be unable to re-enable it."
 msgstr "Ligado kun Facebook amikoj estas malaktivita ĉe tiu retejo. Se vi malŝaltas ĝin, vi ne eblos ree ŝalti ĝin."
 
-#: ../../addon/facebook/facebook.php:574
+#: ../../addon/facebook/facebook.php:594
 msgid "Link all your Facebook friends and conversations on this website"
 msgstr "Alligu ĉiujn viajn Facebook amikojn kaj konversaciojn je ĉi-tiu retejo."
 
-#: ../../addon/facebook/facebook.php:576
+#: ../../addon/facebook/facebook.php:596
 msgid ""
 "Facebook conversations consist of your <em>profile wall</em> and your friend"
 " <em>stream</em>."
 msgstr "Facebok konversacioj konsistas el via <em>profilmuro</em> kaj la <em>fluo</em> de viaj amikoj."
 
-#: ../../addon/facebook/facebook.php:577
+#: ../../addon/facebook/facebook.php:597
 msgid "On this website, your Facebook friend stream is only visible to you."
 msgstr "Je ĉi-tiu retejo, la fluo de viaj amikoj ĉe Facebook nur videblas al vi."
 
-#: ../../addon/facebook/facebook.php:578
+#: ../../addon/facebook/facebook.php:598
 msgid ""
 "The following settings determine the privacy of your Facebook profile wall "
 "on this website."
 msgstr "La sekvontaj agordoj difinas la privatecon de via Facebook profilmuro je ĉi-tiu retejo."
 
-#: ../../addon/facebook/facebook.php:582
+#: ../../addon/facebook/facebook.php:602
 msgid ""
 "On this website your Facebook profile wall conversations will only be "
 "visible to you"
 msgstr "Je ĉi-tiu retejo, la conversacioj sur via Facebook profilmuro nur videblas al vi."
 
-#: ../../addon/facebook/facebook.php:587
+#: ../../addon/facebook/facebook.php:607
 msgid "Do not import your Facebook profile wall conversations"
 msgstr "Ne importi konversaciojn de via Facebook profilmuro"
 
-#: ../../addon/facebook/facebook.php:589
+#: ../../addon/facebook/facebook.php:609
 msgid ""
 "If you choose to link conversations and leave both of these boxes unchecked,"
 " your Facebook profile wall will be merged with your profile wall on this "
@@ -4374,120 +4405,120 @@ msgid ""
 "who may see the conversations."
 msgstr "Se vi elektas alligi conversaciojn kaj ne elektas tiujn butonojn, via Facebook profilmuro estas kunigota kun via profilmuro ĉi tie. Viaj privatecaj agordoj ĉi tie difinos kiu povas vidi la coversaciojn."
 
-#: ../../addon/facebook/facebook.php:594
+#: ../../addon/facebook/facebook.php:614
 msgid "Comma separated applications to ignore"
 msgstr "Ignorotaj programoj, disigita per komo"
 
-#: ../../addon/facebook/facebook.php:678
+#: ../../addon/facebook/facebook.php:698
 msgid "Problems with Facebook Real-Time Updates"
 msgstr "Problemoj kun Facebook Realtempaj Ĝisdatigoj"
 
-#: ../../addon/facebook/facebook.php:706
+#: ../../addon/facebook/facebook.php:726
 #: ../../include/contact_selectors.php:81
 msgid "Facebook"
 msgstr "Facebook"
 
-#: ../../addon/facebook/facebook.php:707
+#: ../../addon/facebook/facebook.php:727
 msgid "Facebook Connector Settings"
 msgstr "Agordoj por la Facebook konektilo"
 
-#: ../../addon/facebook/facebook.php:722
+#: ../../addon/facebook/facebook.php:742
 msgid "Facebook API Key"
 msgstr "Facebook API ŝlosilo"
 
-#: ../../addon/facebook/facebook.php:732
+#: ../../addon/facebook/facebook.php:752
 msgid ""
 "Error: it appears that you have specified the App-ID and -Secret in your "
 ".htconfig.php file. As long as they are specified there, they cannot be set "
 "using this form.<br><br>"
-msgstr "Eraro: Ŝajnas kvazaŭ vi agordis la App-ID kaj la sekreton en via .htconfig.php dosiero. Kiam ili estas agordita tie, vi ne povas agordi ĝin tra tiu ĉi formo.<br><br>"
+msgstr "Eraro: Ŝajnas kvazaŭ vi agordis la App-ID kaj la sekreton en via .htconfig.php dosiero. Kiam ili estas agordita tie, vi ne povas agordi ĝin en tiu ĉi formo.<br><br>"
 
-#: ../../addon/facebook/facebook.php:737
+#: ../../addon/facebook/facebook.php:757
 msgid ""
 "Error: the given API Key seems to be incorrect (the application access token"
 " could not be retrieved)."
 msgstr "Eraro: La API ŝlosilo aspektas malĝusta (ne eblas ricevi la programa atingoĵetono)."
 
-#: ../../addon/facebook/facebook.php:739
+#: ../../addon/facebook/facebook.php:759
 msgid "The given API Key seems to work correctly."
 msgstr "La API ŝlosilo ŝajne ĝuste funkcias."
 
-#: ../../addon/facebook/facebook.php:741
+#: ../../addon/facebook/facebook.php:761
 msgid ""
 "The correctness of the API Key could not be detected. Somthing strange's "
 "going on."
 msgstr "Ne povis kontroli la ĝustecon de la API ŝlosilo. Ia stranga afero okazas. "
 
-#: ../../addon/facebook/facebook.php:744
+#: ../../addon/facebook/facebook.php:764
 msgid "App-ID / API-Key"
 msgstr "Programo ID / API Ŝlosilo"
 
-#: ../../addon/facebook/facebook.php:745
+#: ../../addon/facebook/facebook.php:765
 msgid "Application secret"
 msgstr "Programo sekreto"
 
-#: ../../addon/facebook/facebook.php:746
+#: ../../addon/facebook/facebook.php:766
 #, php-format
 msgid "Polling Interval in minutes (minimum %1$s minutes)"
 msgstr "Intervalo de enketo en minutoj (minimume %1$s minutoj)"
 
-#: ../../addon/facebook/facebook.php:747
+#: ../../addon/facebook/facebook.php:767
 msgid ""
 "Synchronize comments (no comments on Facebook are missed, at the cost of "
 "increased system load)"
 msgstr "Sinkronigi komentojn (vi ricevas ĉiujn komentojn de Facebook, sed la ŝargo de la sistemo iom kreskas)"
 
-#: ../../addon/facebook/facebook.php:751
+#: ../../addon/facebook/facebook.php:771
 msgid "Real-Time Updates"
 msgstr "Realtempaj Ĝisdatigoj"
 
-#: ../../addon/facebook/facebook.php:755
+#: ../../addon/facebook/facebook.php:775
 msgid "Real-Time Updates are activated."
 msgstr "Realtempaj Ĝisdatigoj estas ŝaltita"
 
-#: ../../addon/facebook/facebook.php:756
+#: ../../addon/facebook/facebook.php:776
 msgid "Deactivate Real-Time Updates"
 msgstr "Malŝalti Realtempaj Ĝisdatigoj"
 
-#: ../../addon/facebook/facebook.php:758
+#: ../../addon/facebook/facebook.php:778
 msgid "Real-Time Updates not activated."
 msgstr "Realtempaj Ĝisdatigoj estas malŝaltita"
 
-#: ../../addon/facebook/facebook.php:758
+#: ../../addon/facebook/facebook.php:778
 msgid "Activate Real-Time Updates"
 msgstr "Ŝalti Realtempaj Ĝisdatigoj"
 
-#: ../../addon/facebook/facebook.php:777
+#: ../../addon/facebook/facebook.php:797 ../../addon/dav/layout.fnk.php:360
 msgid "The new values have been saved."
 msgstr "Konservis novajn valorojn."
 
-#: ../../addon/facebook/facebook.php:801
+#: ../../addon/facebook/facebook.php:821
 msgid "Post to Facebook"
 msgstr "Afiŝi al Facebook"
 
-#: ../../addon/facebook/facebook.php:899
+#: ../../addon/facebook/facebook.php:919
 msgid ""
 "Post to Facebook cancelled because of multi-network access permission "
 "conflict."
 msgstr "Afiŝado al Facebook nuligita ĉar okazis konflikto en la multretpermesoj."
 
-#: ../../addon/facebook/facebook.php:1119
+#: ../../addon/facebook/facebook.php:1139
 msgid "View on Friendica"
 msgstr "Vidi ĉe Friendica"
 
-#: ../../addon/facebook/facebook.php:1152
+#: ../../addon/facebook/facebook.php:1172
 msgid "Facebook post failed. Queued for retry."
 msgstr "Malsukcesis afiŝi ĉe Facebook. Enigita en vico."
 
-#: ../../addon/facebook/facebook.php:1192
+#: ../../addon/facebook/facebook.php:1212
 msgid "Your Facebook connection became invalid. Please Re-authenticate."
 msgstr "Via Facbook konekto iĝis nevalida. Bonvolu reaŭtentiĝi."
 
-#: ../../addon/facebook/facebook.php:1193
+#: ../../addon/facebook/facebook.php:1213
 msgid "Facebook connection became invalid"
 msgstr "Facebook konekto iĝis nevalida."
 
-#: ../../addon/facebook/facebook.php:1194
+#: ../../addon/facebook/facebook.php:1214
 #, php-format
 msgid ""
 "Hi %1$s,\n"
@@ -4495,23 +4526,35 @@ msgid ""
 "The connection between your accounts on %2$s and Facebook became invalid. This usually happens after you change your Facebook-password. To enable the connection again, you have to %3$sre-authenticate the Facebook-connector%4$s."
 msgstr "Saluton %1$s,\n\nla kontekto inter viaj kontoj ĉe %2$s kaj Facebook malvalidiĝis. Tio kutime okazas post kiam via ŝangas vian pasvorton ĉe Facebook. Por reaktivigi la konekto, vi bezonas %3$sreaŭtentiĝi la Facebook konektilon%4$s."
 
-#: ../../addon/privacy_image_cache/privacy_image_cache.php:144
+#: ../../addon/snautofollow/snautofollow.php:32
+msgid "StatusNet AutoFollow settings updated."
+msgstr "Ĝidatigis StatusNet AutoFollow agordojn."
+
+#: ../../addon/snautofollow/snautofollow.php:56
+msgid "StatusNet AutoFollow Settings"
+msgstr "StatusNet AutoFollow agordoj"
+
+#: ../../addon/snautofollow/snautofollow.php:58
+msgid "Automatically follow any StatusNet followers/mentioners"
+msgstr "Aŭtomate sekvu ĉiujn StatusNet sekvantojn/menciantojn."
+
+#: ../../addon/privacy_image_cache/privacy_image_cache.php:184
 msgid "Lifetime of the cache (in hours)"
 msgstr "Vivodaŭro de kaŝmemoro (horoj)"
 
-#: ../../addon/privacy_image_cache/privacy_image_cache.php:149
+#: ../../addon/privacy_image_cache/privacy_image_cache.php:189
 msgid "Cache Statistics"
 msgstr "Statistikoj pri kaŝmemoro"
 
-#: ../../addon/privacy_image_cache/privacy_image_cache.php:152
+#: ../../addon/privacy_image_cache/privacy_image_cache.php:192
 msgid "Number of items"
 msgstr "Kvanto da eroj"
 
-#: ../../addon/privacy_image_cache/privacy_image_cache.php:154
+#: ../../addon/privacy_image_cache/privacy_image_cache.php:194
 msgid "Size of the cache"
 msgstr "Grando de la kaŝmemoro"
 
-#: ../../addon/privacy_image_cache/privacy_image_cache.php:156
+#: ../../addon/privacy_image_cache/privacy_image_cache.php:196
 msgid "Delete the whole cache"
 msgstr "Forviŝi la kaŝmemoron"
 
@@ -4627,21 +4670,45 @@ msgstr "Uzu /expr/ por provizi regulajn esprimojn."
 msgid "NSFW Settings saved."
 msgstr "NSFW agordoj konservitaj."
 
-#: ../../addon/nsfw/nsfw.php:120
+#: ../../addon/nsfw/nsfw.php:121
 #, php-format
 msgid "%s - Click to open/close"
 msgstr "%s - Klaku por malfermi/fermi"
 
-#: ../../addon/page/page.php:48
+#: ../../addon/page/page.php:61 ../../addon/page/page.php:91
 msgid "Forums"
 msgstr "Forumoj"
 
-#: ../../addon/page/page.php:63 ../../addon/showmore/showmore.php:87
-#: ../../include/contact_widgets.php:188 ../../include/conversation.php:466
-#: ../../boot.php:513
+#: ../../addon/page/page.php:76 ../../addon/page/page.php:110
+#: ../../addon/showmore/showmore.php:87 ../../include/contact_widgets.php:188
+#: ../../include/conversation.php:476 ../../boot.php:529
 msgid "show more"
 msgstr "montri pli"
 
+#: ../../addon/page/page.php:129
+msgid "Forums:"
+msgstr "Forumoj:"
+
+#: ../../addon/page/page.php:163
+msgid "Page settings updated."
+msgstr "Paĝajn agordojn ĝisdatigita."
+
+#: ../../addon/page/page.php:192
+msgid "Page Settings"
+msgstr "Paĝaj Agordoj"
+
+#: ../../addon/page/page.php:194
+msgid "How many forums to display on sidebar without paging"
+msgstr "Montri tiom da forumoj en la flanka strio sen paĝigo"
+
+#: ../../addon/page/page.php:197
+msgid "Randomise Page/Forum list"
+msgstr "Hazardigi la liston de Paĝoj/Forumoj"
+
+#: ../../addon/page/page.php:200
+msgid "Show pages/forums on profile page"
+msgstr "Montri paĝojn/forumojn sur la profilpaĝo"
+
 #: ../../addon/planets/planets.php:150
 msgid "Planets Settings"
 msgstr "Agordo pri Planets"
@@ -4654,7 +4721,7 @@ msgstr "Ŝalti la Planets kromprogamon"
 #: ../../addon/communityhome/communityhome.php:34
 #: ../../addon/communityhome/twillingham/communityhome.php:28
 #: ../../addon/communityhome/twillingham/communityhome.php:34
-#: ../../include/nav.php:64 ../../boot.php:811
+#: ../../include/nav.php:64 ../../boot.php:849
 msgid "Login"
 msgstr "Ensaluti"
 
@@ -4682,11 +4749,208 @@ msgid "Latest likes"
 msgstr "Ĵusaj ŝatitaĵoj"
 
 #: ../../addon/communityhome/communityhome.php:155
-#: ../../view/theme/diabook/theme.php:490 ../../include/text.php:1303
+#: ../../view/theme/diabook/theme.php:562 ../../include/text.php:1315
 #: ../../include/conversation.php:45 ../../include/conversation.php:118
 msgid "event"
 msgstr "okazo"
 
+#: ../../addon/dav/common/wdcal_configuration.php:126
+msgid "U.S. Time Format (mm/dd/YYYY)"
+msgstr "Usona datformato (mm/dd/YYYY)"
+
+#: ../../addon/dav/common/wdcal_configuration.php:205
+msgid "German Time Format (dd.mm.YYYY)"
+msgstr "Germana datformato (dd.mm.YYYY)"
+
+#: ../../addon/dav/common/calendar.fnk.php:517
+#: ../../addon/dav/common/calendar.fnk.php:533
+#: ../../addon/dav/layout.fnk.php:200
+msgid "Error"
+msgstr "Eraro"
+
+#: ../../addon/dav/common/calendar.fnk.php:568
+#: ../../addon/dav/common/calendar.fnk.php:637
+#: ../../addon/dav/common/calendar.fnk.php:664
+#: ../../addon/dav/layout.fnk.php:231
+msgid "No access"
+msgstr "No access"
+
+#: ../../addon/dav/layout.fnk.php:119
+msgid "New event"
+msgstr "Nova okazo"
+
+#: ../../addon/dav/layout.fnk.php:123
+msgid "Today"
+msgstr "Hodiaŭ"
+
+#: ../../addon/dav/layout.fnk.php:132
+msgid "Day"
+msgstr "Tago"
+
+#: ../../addon/dav/layout.fnk.php:139
+msgid "Week"
+msgstr "Semajno"
+
+#: ../../addon/dav/layout.fnk.php:146
+msgid "Month"
+msgstr "Monato"
+
+#: ../../addon/dav/layout.fnk.php:151
+msgid "Reload"
+msgstr "Reŝargi"
+
+#: ../../addon/dav/layout.fnk.php:162
+msgid "Date"
+msgstr "Dato"
+
+#: ../../addon/dav/layout.fnk.php:224
+msgid "Not found"
+msgstr "Ne trovita"
+
+#: ../../addon/dav/layout.fnk.php:292 ../../addon/dav/layout.fnk.php:365
+msgid "Go back to the calendar"
+msgstr "Iri reen al la kalendaro"
+
+#: ../../addon/dav/layout.fnk.php:300
+msgid "Starts"
+msgstr "Komencas"
+
+#: ../../addon/dav/layout.fnk.php:305
+msgid "Ends"
+msgstr "Finas"
+
+#: ../../addon/dav/layout.fnk.php:312
+msgid "Description"
+msgstr "Priskribo"
+
+#: ../../addon/dav/layout.fnk.php:315
+msgid "Notification"
+msgstr "Atentigo"
+
+#: ../../addon/dav/layout.fnk.php:324
+msgid "Minutes"
+msgstr "Minutoj"
+
+#: ../../addon/dav/layout.fnk.php:327
+msgid "Hours"
+msgstr "Horoj"
+
+#: ../../addon/dav/layout.fnk.php:330
+msgid "Days"
+msgstr "Tagoj"
+
+#: ../../addon/dav/layout.fnk.php:331
+msgid "before"
+msgstr "antaŭ"
+
+#: ../../addon/dav/layout.fnk.php:367
+msgid "Calendar Settings"
+msgstr "Kalendaraj Agordoj"
+
+#: ../../addon/dav/layout.fnk.php:373
+msgid "Date format"
+msgstr "Datformato"
+
+#: ../../addon/dav/layout.fnk.php:382
+msgid "Time zone"
+msgstr "Horzono"
+
+#: ../../addon/dav/layout.fnk.php:387
+msgid "Limitations"
+msgstr "Limigoj"
+
+#: ../../addon/dav/layout.fnk.php:391
+msgid "Warning"
+msgstr "Averto"
+
+#: ../../addon/dav/layout.fnk.php:395
+msgid "Synchronization (iPhone, Thunderbird Lightning, Android, ...)"
+msgstr "Sinkronigo (iPhone, Thunderbird Lightning, Android, ...)"
+
+#: ../../addon/dav/layout.fnk.php:402
+msgid "Synchronizing this calendar with the iPhone"
+msgstr "Sinkronigi tiun kalendaron kun la iPhone"
+
+#: ../../addon/dav/layout.fnk.php:413
+msgid "Synchronizing your Friendica-Contacts with the iPhone"
+msgstr "Sinkronigi viajn Friendica kontaktojn kun la iPhone"
+
+#: ../../addon/dav/dav_carddav_backend_friendica_community.inc.php:37
+msgid "Friendica-Contacts"
+msgstr "Friendica Kontaktoj"
+
+#: ../../addon/dav/dav_carddav_backend_friendica_community.inc.php:38
+msgid "Your Friendica-Contacts"
+msgstr "Viaj Friendica Kontaktoj"
+
+#: ../../addon/dav/main.php:244
+msgid "Calendar"
+msgstr "Kalendaro"
+
+#: ../../addon/dav/main.php:247
+msgid "Extended calendar with CalDAV-support"
+msgstr "Etendita kalendaro kun CalDAV subteno"
+
+#: ../../addon/dav/main.php:263
+msgid "The database tables have been installed."
+msgstr "La tabeloj estas instalita en la datumbazo"
+
+#: ../../addon/dav/main.php:264
+msgid "An error occurred during the installation."
+msgstr "Eraro okazis dum instalado"
+
+#: ../../addon/dav/main.php:280
+msgid "No system-wide settings yet."
+msgstr "Ankoraŭ ne disponablas tutsistemaj agordoj"
+
+#: ../../addon/dav/main.php:283
+msgid "Database status"
+msgstr "Stato de datumbazo"
+
+#: ../../addon/dav/main.php:286
+msgid "Installed"
+msgstr "Instalita"
+
+#: ../../addon/dav/main.php:289
+msgid "Upgrade needed"
+msgstr "Ĝisdatigo bezonata"
+
+#: ../../addon/dav/main.php:289
+msgid "Upgrade"
+msgstr "Ĝisdatigo"
+
+#: ../../addon/dav/main.php:292
+msgid "Not installed"
+msgstr "Ne instalita"
+
+#: ../../addon/dav/main.php:292
+msgid "Install"
+msgstr "Instali"
+
+#: ../../addon/dav/main.php:297
+msgid "Troubleshooting"
+msgstr "Problemsolvado"
+
+#: ../../addon/dav/main.php:298
+msgid "Manual creation of the database tables:"
+msgstr "Mana kreado de tabeloj en la datumbazo:"
+
+#: ../../addon/dav/main.php:299
+msgid "Show SQL-statements"
+msgstr "Montru SQL ordonojn"
+
+#: ../../addon/dav/calendar.friendica.fnk.php:151
+msgid "Private Calendar"
+msgstr "Privata kalendaro"
+
+#: ../../addon/dav/calendar.friendica.fnk.php:158
+msgid "Friendica Events: Mine"
+msgstr "Friendica Okazoj: Miaj"
+
+#: ../../addon/dav/calendar.friendica.fnk.php:161
+msgid "Friendica Events: Contacts"
+msgstr "Friendica Okazoj: De Kontaktoj"
+
 #: ../../addon/uhremotestorage/uhremotestorage.php:84
 #, php-format
 msgid ""
@@ -4834,11 +5098,23 @@ msgstr "Drupal retejo uzas purajn URL adresojn"
 msgid "Post to Drupal by default"
 msgstr "Defaŭlte afiŝi ĉe Drupal"
 
-#: ../../addon/drpost/drpost.php:184 ../../addon/wppost/wppost.php:190
-#: ../../addon/blogger/blogger.php:172 ../../addon/posterous/posterous.php:192
+#: ../../addon/drpost/drpost.php:184 ../../addon/wppost/wppost.php:201
+#: ../../addon/blogger/blogger.php:172 ../../addon/posterous/posterous.php:189
 msgid "Post from Friendica"
 msgstr "Afiŝo de Friendica"
 
+#: ../../addon/startpage/startpage.php:83
+msgid "Startpage Settings"
+msgstr "Startpaĝaj Agordoj"
+
+#: ../../addon/startpage/startpage.php:85
+msgid "Home page to load after login  - leave blank for profile wall"
+msgstr "Hejmpaĝo ŝargonta post la ensaluto   - Lasu malplena por profilmuro."
+
+#: ../../addon/startpage/startpage.php:88
+msgid "Examples: &quot;network&quot; or &quot;notifications/system&quot;"
+msgstr "Ekzemple: &quot;network&quot; aŭ &quot;notifications/system&quot;"
+
 #: ../../addon/geonames/geonames.php:143
 msgid "Geonames settings updated."
 msgstr "Ĝidatigis la Geonames agordojn."
@@ -4851,6 +5127,24 @@ msgstr "Geonames Agordoj"
 msgid "Enable Geonames Plugin"
 msgstr "Ŝalti la Geonames Kromprogramon"
 
+#: ../../addon/public_server/public_server.php:126
+#: ../../addon/testdrive/testdrive.php:94
+#, php-format
+msgid "Your account on %s will expire in a few days."
+msgstr "Via konto ĉe %s senvalidiĝos post kelkaj tagoj."
+
+#: ../../addon/public_server/public_server.php:127
+msgid "Your Friendica account is about to expire."
+msgstr "Via konto ĉe Friendica baldaŭ senvalidiĝos."
+
+#: ../../addon/public_server/public_server.php:128
+#, php-format
+msgid ""
+"Hi %1$s,\n"
+"\n"
+"Your account on %2$s will expire in less than five days. You may keep your account by logging in at least once every 30 days"
+msgstr "Saluton %1$s,\n\nVia konto ĉe %2$s senvalidiĝos post malpli ol kvin tagoj. Vi povas konservi vian konton se vi ensalutas almenaŭ ĉiujn 30 tagojn. "
+
 #: ../../addon/js_upload/js_upload.php:43
 msgid "Upload a file"
 msgstr "Alŝuti dosieron"
@@ -4946,7 +5240,7 @@ msgstr "Pli da notoj kiuj aperas sub la kontaktinformoj. Vi eblas uzi BBCode ĉi
 
 #: ../../addon/impressum/impressum.php:87
 msgid "How to contact the operator via email. (will be displayed obfuscated)"
-msgstr "Kiel kontakti la funkciigiston de la retejo tra retpoŝto. (montriĝos vuale) "
+msgstr "Kiel kontakti la funkciigiston de la retejo per retpoŝto. (montriĝos vuale) "
 
 #: ../../addon/impressum/impressum.php:88
 msgid "Footer note"
@@ -4960,6 +5254,18 @@ msgstr "Teksto por la paĝpiedo. Vie eblas uzi BBCode ĉi tie."
 msgid "Report Bug"
 msgstr "Skribi cimraporton"
 
+#: ../../addon/notimeline/notimeline.php:32
+msgid "No Timeline settings updated."
+msgstr "No Timeline agordojn ĝisdatigita."
+
+#: ../../addon/notimeline/notimeline.php:56
+msgid "No Timeline Settings"
+msgstr "No Timeline Agordoj"
+
+#: ../../addon/notimeline/notimeline.php:58
+msgid "Disable Archive selector on profile wall"
+msgstr "Malaktivigi la Arkivo elektilo sur la profilmuro"
+
 #: ../../addon/blockem/blockem.php:51
 msgid "\"Blockem\" Settings"
 msgstr "\"Blockem\" Agordoj"
@@ -5037,6 +5343,30 @@ msgstr "Defaŭlta zoma faktoro"
 msgid "The default zoom level. (1:world, 18:highest)"
 msgstr "La defaŭlta zoma faktoro. (1:tutmonda, 18:plej proksima)"
 
+#: ../../addon/libertree/libertree.php:36
+msgid "Post to libertree"
+msgstr "Afiŝi al libertree"
+
+#: ../../addon/libertree/libertree.php:67
+msgid "libertree Post Settings"
+msgstr "Agordoj por Afiŝoj ĉe libertree"
+
+#: ../../addon/libertree/libertree.php:69
+msgid "Enable Libertree Post Plugin"
+msgstr "Aktivigi Kromprogramon por Afiŝoj ĉe libertree"
+
+#: ../../addon/libertree/libertree.php:74
+msgid "Libertree API token"
+msgstr "Libertree API ĵetono"
+
+#: ../../addon/libertree/libertree.php:79
+msgid "Libertree site URL"
+msgstr "URL adreso de libertree retejo:"
+
+#: ../../addon/libertree/libertree.php:84
+msgid "Post to Libertree by default"
+msgstr "Defaŭlte afiŝi ĉe Libertree"
+
 #: ../../addon/mathjax/mathjax.php:37
 msgid ""
 "The MathJax addon renders mathematical formulae written using the LaTeX "
@@ -5110,16 +5440,11 @@ msgstr "Elektu la ĝustan pritakson de via avataro por via retejo. Vidu README."
 msgid "Gravatar settings updated."
 msgstr "Gravatar agordoj ĝisdatigitaj."
 
-#: ../../addon/testdrive/testdrive.php:85
-#, php-format
-msgid "Your account on %s will expire in a few days."
-msgstr "Via konto ĉe %s senvalidiĝos post kelkaj tagoj."
-
-#: ../../addon/testdrive/testdrive.php:86
+#: ../../addon/testdrive/testdrive.php:95
 msgid "Your Friendica test account is about to expire."
 msgstr "Via Friendica provkonto baldaŭ malaktiviĝos."
 
-#: ../../addon/testdrive/testdrive.php:87
+#: ../../addon/testdrive/testdrive.php:96
 #, php-format
 msgid ""
 "Hi %1$s,\n"
@@ -5277,17 +5602,21 @@ msgid "Send public postings to StatusNet by default"
 msgstr "Defaŭlte sendi publikajn afiŝojn al StatusNet"
 
 #: ../../addon/statusnet/statusnet.php:345
-msgid "Send #tag links to StatusNet"
-msgstr "Sendu #marko ligilojn al StatusNet"
+msgid "Send linked #-tags and @-names to StatusNet"
+msgstr "Sendi ligitajn #-etikedojn kaj @-nomon al StatusNet"
 
 #: ../../addon/statusnet/statusnet.php:350 ../../addon/twitter/twitter.php:206
 msgid "Clear OAuth configuration"
 msgstr "Forviŝi OAuth agordojn"
 
-#: ../../addon/statusnet/statusnet.php:545
+#: ../../addon/statusnet/statusnet.php:559
 msgid "API URL"
 msgstr "API URL adreso"
 
+#: ../../addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php:19
+msgid "Infinite Improbability Drive"
+msgstr "Senfina Probableca Pelilo"
+
 #: ../../addon/tumblr/tumblr.php:36
 msgid "Post to Tumblr"
 msgstr "Afiŝi al Tumblr"
@@ -5351,30 +5680,38 @@ msgstr "[Friendica:Atentigo] Komento pri konversacio #%d"
 msgid "Post to Wordpress"
 msgstr "Afiŝi al Wordpress"
 
-#: ../../addon/wppost/wppost.php:74
+#: ../../addon/wppost/wppost.php:76
 msgid "WordPress Post Settings"
 msgstr "Agordoj por WordPress afiŝojn"
 
-#: ../../addon/wppost/wppost.php:76
+#: ../../addon/wppost/wppost.php:78
 msgid "Enable WordPress Post Plugin"
 msgstr "Ŝalti la Wordpress-afiŝo kromprogramon"
 
-#: ../../addon/wppost/wppost.php:81
+#: ../../addon/wppost/wppost.php:83
 msgid "WordPress username"
 msgstr "WordPress salutnomo"
 
-#: ../../addon/wppost/wppost.php:86
+#: ../../addon/wppost/wppost.php:88
 msgid "WordPress password"
 msgstr "WordPress pasvorto"
 
-#: ../../addon/wppost/wppost.php:91
+#: ../../addon/wppost/wppost.php:93
 msgid "WordPress API URL"
 msgstr "Wordpress API URL adreso"
 
-#: ../../addon/wppost/wppost.php:96
+#: ../../addon/wppost/wppost.php:98
 msgid "Post to WordPress by default"
 msgstr "Defaŭlte afiŝi al WordPress"
 
+#: ../../addon/wppost/wppost.php:103
+msgid "Provide a backlink to the Friendica post"
+msgstr "Provizi re-ligilon al la Friendica afiŝo"
+
+#: ../../addon/wppost/wppost.php:207
+msgid "Read the original post and comment stream on Friendica"
+msgstr "Legi la originalan afiŝon kaj komentfluo ĉe Friendica"
+
 #: ../../addon/showmore/showmore.php:38
 msgid "\"Show more\" Settings"
 msgstr "\"Montri pli\" agordoj"
@@ -5486,14 +5823,14 @@ msgid "Send public postings to Twitter by default"
 msgstr "Defaŭlte sendi publikajn afiŝojn al Twitter"
 
 #: ../../addon/twitter/twitter.php:201
-msgid "Send #tag links to Twitter"
-msgstr "Sendu #marko ligilon al Twitter"
+msgid "Send linked #-tags and @-names to Twitter"
+msgstr "Sendi ligitajn #-etikedojn kaj @-nomon al Twitter"
 
-#: ../../addon/twitter/twitter.php:377
+#: ../../addon/twitter/twitter.php:389
 msgid "Consumer key"
 msgstr "Ŝlosilo de Kliento"
 
-#: ../../addon/twitter/twitter.php:378
+#: ../../addon/twitter/twitter.php:390
 msgid "Consumer secret"
 msgstr "Sekreto de Kliento"
 
@@ -5606,157 +5943,155 @@ msgstr "Agordi la larĝo por la etoso"
 msgid "Color scheme"
 msgstr "Kolorskemo"
 
-#: ../../view/theme/diabook/theme.php:123 ../../include/nav.php:49
+#: ../../view/theme/diabook/theme.php:127 ../../include/nav.php:49
 #: ../../include/nav.php:115
 msgid "Your posts and conversations"
 msgstr "Viaj afiŝoj kaj komunikadoj"
 
-#: ../../view/theme/diabook/theme.php:124 ../../include/nav.php:50
+#: ../../view/theme/diabook/theme.php:128 ../../include/nav.php:50
 msgid "Your profile page"
 msgstr "Via profilo"
 
-#: ../../view/theme/diabook/theme.php:125
+#: ../../view/theme/diabook/theme.php:129
 msgid "Your contacts"
 msgstr "Viaj kontaktoj"
 
-#: ../../view/theme/diabook/theme.php:126 ../../include/nav.php:51
+#: ../../view/theme/diabook/theme.php:130 ../../include/nav.php:51
 msgid "Your photos"
 msgstr "Viaj bildoj"
 
-#: ../../view/theme/diabook/theme.php:127 ../../include/nav.php:52
+#: ../../view/theme/diabook/theme.php:131 ../../include/nav.php:52
 msgid "Your events"
 msgstr "Viaj okazoj"
 
-#: ../../view/theme/diabook/theme.php:128 ../../include/nav.php:53
+#: ../../view/theme/diabook/theme.php:132 ../../include/nav.php:53
 msgid "Personal notes"
 msgstr "Personaj notoj"
 
-#: ../../view/theme/diabook/theme.php:128 ../../include/nav.php:53
+#: ../../view/theme/diabook/theme.php:132 ../../include/nav.php:53
 msgid "Your personal photos"
 msgstr "Viaj personaj bildoj"
 
-#: ../../view/theme/diabook/theme.php:130
-#: ../../view/theme/diabook/theme.php:571
-#: ../../view/theme/diabook/theme.php:675
+#: ../../view/theme/diabook/theme.php:134
+#: ../../view/theme/diabook/theme.php:643
+#: ../../view/theme/diabook/theme.php:747
 #: ../../view/theme/diabook/config.php:201
 msgid "Community Pages"
 msgstr "Komunumaj paĝoj"
 
-#: ../../view/theme/diabook/theme.php:418
-#: ../../view/theme/diabook/theme.php:677
+#: ../../view/theme/diabook/theme.php:490
+#: ../../view/theme/diabook/theme.php:749
 #: ../../view/theme/diabook/config.php:203
 msgid "Community Profiles"
 msgstr "Komunumaj Profiloj"
 
-#: ../../view/theme/diabook/theme.php:439
-#: ../../view/theme/diabook/theme.php:682
+#: ../../view/theme/diabook/theme.php:511
+#: ../../view/theme/diabook/theme.php:754
 #: ../../view/theme/diabook/config.php:208
 msgid "Last users"
 msgstr "Ĵusaj uzantoj"
 
-#: ../../view/theme/diabook/theme.php:468
-#: ../../view/theme/diabook/theme.php:684
+#: ../../view/theme/diabook/theme.php:540
+#: ../../view/theme/diabook/theme.php:756
 #: ../../view/theme/diabook/config.php:210
 msgid "Last likes"
 msgstr "Ĵusaj ŝatitaj elementoj"
 
-#: ../../view/theme/diabook/theme.php:513
-#: ../../view/theme/diabook/theme.php:683
+#: ../../view/theme/diabook/theme.php:585
+#: ../../view/theme/diabook/theme.php:755
 #: ../../view/theme/diabook/config.php:209
 msgid "Last photos"
 msgstr "Ĵusaj bildoj"
 
-#: ../../view/theme/diabook/theme.php:550
-#: ../../view/theme/diabook/theme.php:680
+#: ../../view/theme/diabook/theme.php:622
+#: ../../view/theme/diabook/theme.php:752
 #: ../../view/theme/diabook/config.php:206
 msgid "Find Friends"
 msgstr "Trovi Amikojn"
 
-#: ../../view/theme/diabook/theme.php:551
+#: ../../view/theme/diabook/theme.php:623
 msgid "Local Directory"
 msgstr "Loka Katalogo"
 
-#: ../../view/theme/diabook/theme.php:553 ../../include/contact_widgets.php:35
+#: ../../view/theme/diabook/theme.php:625 ../../include/contact_widgets.php:35
 msgid "Similar Interests"
 msgstr "Similaj Interesoj"
 
-#: ../../view/theme/diabook/theme.php:555 ../../include/contact_widgets.php:37
+#: ../../view/theme/diabook/theme.php:627 ../../include/contact_widgets.php:37
 msgid "Invite Friends"
 msgstr "Inviti amikojn"
 
-#: ../../view/theme/diabook/theme.php:606
-#: ../../view/theme/diabook/theme.php:676
+#: ../../view/theme/diabook/theme.php:678
+#: ../../view/theme/diabook/theme.php:748
 #: ../../view/theme/diabook/config.php:202
 msgid "Earth Layers"
 msgstr "Tertavoloj (Earth Layers)"
 
-#: ../../view/theme/diabook/theme.php:611
-#: ../../view/theme/diabook/config.php:198
-msgid "Set zoomfactor for Earth Layer"
-msgstr "Agordi zoman faktoron de Tertavolo"
+#: ../../view/theme/diabook/theme.php:683
+msgid "Set zoomfactor for Earth Layers"
+msgstr "Agordi zoman faktoron por Tertavoloj"
 
-#: ../../view/theme/diabook/theme.php:612
+#: ../../view/theme/diabook/theme.php:684
 #: ../../view/theme/diabook/config.php:199
-msgid "Set longitude (X) for Earth Layer"
-msgstr "Agordi longitudon (X) de Tertavolo"
+msgid "Set longitude (X) for Earth Layers"
+msgstr "Agordi longitudon (X) por Tertavoloj"
 
-#: ../../view/theme/diabook/theme.php:613
+#: ../../view/theme/diabook/theme.php:685
 #: ../../view/theme/diabook/config.php:200
-msgid "Set latitude (Y) for Earth Layer"
-msgstr "Agordi latitudon (Y) de Tertavolo"
+msgid "Set latitude (Y) for Earth Layers"
+msgstr "Agordi latitudon (Y) por Tertavoloj"
 
-#: ../../view/theme/diabook/theme.php:626
-#: ../../view/theme/diabook/theme.php:678
+#: ../../view/theme/diabook/theme.php:698
+#: ../../view/theme/diabook/theme.php:750
 #: ../../view/theme/diabook/config.php:204
 msgid "Help or @NewHere ?"
 msgstr "Helpu aŭ @NewHere ?"
 
-#: ../../view/theme/diabook/theme.php:633
-#: ../../view/theme/diabook/theme.php:679
+#: ../../view/theme/diabook/theme.php:705
+#: ../../view/theme/diabook/theme.php:751
 #: ../../view/theme/diabook/config.php:205
 msgid "Connect Services"
 msgstr "Konekti Servojn"
 
-#: ../../view/theme/diabook/theme.php:640
-#: ../../view/theme/diabook/theme.php:681
-#: ../../view/theme/diabook/config.php:207
+#: ../../view/theme/diabook/theme.php:712
+#: ../../view/theme/diabook/theme.php:753
 msgid "Last Tweets"
 msgstr "Ĵusaj Pepaĵoj"
 
-#: ../../view/theme/diabook/theme.php:643
+#: ../../view/theme/diabook/theme.php:715
 #: ../../view/theme/diabook/config.php:197
 msgid "Set twitter search term"
 msgstr "Agordi Twitter serĉtekston"
 
-#: ../../view/theme/diabook/theme.php:663
-#: ../../view/theme/diabook/theme.php:664
-#: ../../view/theme/diabook/theme.php:665
-#: ../../view/theme/diabook/theme.php:666
-#: ../../view/theme/diabook/theme.php:667
-#: ../../view/theme/diabook/theme.php:668
-#: ../../view/theme/diabook/theme.php:669
-#: ../../view/theme/diabook/theme.php:670
-#: ../../view/theme/diabook/theme.php:671
-#: ../../view/theme/diabook/theme.php:672 ../../include/acl_selectors.php:288
+#: ../../view/theme/diabook/theme.php:735
+#: ../../view/theme/diabook/theme.php:736
+#: ../../view/theme/diabook/theme.php:737
+#: ../../view/theme/diabook/theme.php:738
+#: ../../view/theme/diabook/theme.php:739
+#: ../../view/theme/diabook/theme.php:740
+#: ../../view/theme/diabook/theme.php:741
+#: ../../view/theme/diabook/theme.php:742
+#: ../../view/theme/diabook/theme.php:743
+#: ../../view/theme/diabook/theme.php:744 ../../include/acl_selectors.php:288
 msgid "don't show"
 msgstr "kaŝi"
 
-#: ../../view/theme/diabook/theme.php:663
-#: ../../view/theme/diabook/theme.php:664
-#: ../../view/theme/diabook/theme.php:665
-#: ../../view/theme/diabook/theme.php:666
-#: ../../view/theme/diabook/theme.php:667
-#: ../../view/theme/diabook/theme.php:668
-#: ../../view/theme/diabook/theme.php:669
-#: ../../view/theme/diabook/theme.php:670
-#: ../../view/theme/diabook/theme.php:671
-#: ../../view/theme/diabook/theme.php:672 ../../include/acl_selectors.php:287
+#: ../../view/theme/diabook/theme.php:735
+#: ../../view/theme/diabook/theme.php:736
+#: ../../view/theme/diabook/theme.php:737
+#: ../../view/theme/diabook/theme.php:738
+#: ../../view/theme/diabook/theme.php:739
+#: ../../view/theme/diabook/theme.php:740
+#: ../../view/theme/diabook/theme.php:741
+#: ../../view/theme/diabook/theme.php:742
+#: ../../view/theme/diabook/theme.php:743
+#: ../../view/theme/diabook/theme.php:744 ../../include/acl_selectors.php:287
 msgid "show"
 msgstr "montri"
 
-#: ../../view/theme/diabook/theme.php:673
-msgid "Show/hide boxes at right-hand coloumn:"
-msgstr "Montri/kaŝi kestojn en la desktra kolumno:"
+#: ../../view/theme/diabook/theme.php:745
+msgid "Show/hide boxes at right-hand column:"
+msgstr "Kaŝi/montri kestojn ĉe dekstra kolumno:"
 
 #: ../../view/theme/diabook/config.php:194
 #: ../../view/theme/dispy/config.php:74
@@ -5771,6 +6106,14 @@ msgstr "Agordi la distingivon por la meza kolumno"
 msgid "Set color scheme"
 msgstr "Agordi Kolorskemon"
 
+#: ../../view/theme/diabook/config.php:198
+msgid "Set zoomfactor for Earth Layer"
+msgstr "Agordi zoman faktoron de Tertavolo"
+
+#: ../../view/theme/diabook/config.php:207
+msgid "Last tweets"
+msgstr "Ĵusaj pepaĵoj"
+
 #: ../../view/theme/quattro/config.php:55
 msgid "Alignment"
 msgstr "Ĝisrandigo"
@@ -5787,7 +6130,7 @@ msgstr "Centren"
 msgid "Set colour scheme"
 msgstr "Agordi Kolorskemon"
 
-#: ../../include/profile_advanced.php:17 ../../boot.php:1100
+#: ../../include/profile_advanced.php:17 ../../boot.php:1138
 msgid "Gender:"
 msgstr "Sekso:"
 
@@ -5799,8 +6142,7 @@ msgstr "j F, Y"
 msgid "j F"
 msgstr "j F"
 
-#: ../../include/profile_advanced.php:30 ../../include/datetime.php:448
-#: ../../include/items.php:1413
+#: ../../include/profile_advanced.php:30
 msgid "Birthday:"
 msgstr "Naskiĝtago:"
 
@@ -5808,59 +6150,64 @@ msgstr "Naskiĝtago:"
 msgid "Age:"
 msgstr "Aĝo:"
 
-#: ../../include/profile_advanced.php:37 ../../boot.php:1103
+#: ../../include/profile_advanced.php:37 ../../boot.php:1141
 msgid "Status:"
 msgstr "Stato:"
 
-#: ../../include/profile_advanced.php:45 ../../boot.php:1105
+#: ../../include/profile_advanced.php:43
+#, php-format
+msgid "for %1$d %2$s"
+msgstr "por %1$d %2$s"
+
+#: ../../include/profile_advanced.php:48 ../../boot.php:1143
 msgid "Homepage:"
 msgstr "Hejmpaĝo:"
 
-#: ../../include/profile_advanced.php:47
+#: ../../include/profile_advanced.php:52
 msgid "Tags:"
 msgstr "Markoj:"
 
-#: ../../include/profile_advanced.php:51
+#: ../../include/profile_advanced.php:56
 msgid "Religion:"
 msgstr "Religio:"
 
-#: ../../include/profile_advanced.php:53
+#: ../../include/profile_advanced.php:58
 msgid "About:"
 msgstr "Pri:"
 
-#: ../../include/profile_advanced.php:55
+#: ../../include/profile_advanced.php:60
 msgid "Hobbies/Interests:"
 msgstr "Ŝatokupoj/Interesoj:"
 
-#: ../../include/profile_advanced.php:57
+#: ../../include/profile_advanced.php:67
 msgid "Contact information and Social Networks:"
 msgstr "Kontaktinformoj kaj Interkonaj Retejoj:"
 
-#: ../../include/profile_advanced.php:59
+#: ../../include/profile_advanced.php:69
 msgid "Musical interests:"
 msgstr "Muzaikaj interesoj:"
 
-#: ../../include/profile_advanced.php:61
+#: ../../include/profile_advanced.php:71
 msgid "Books, literature:"
 msgstr "Libroj, literaturo:"
 
-#: ../../include/profile_advanced.php:63
+#: ../../include/profile_advanced.php:73
 msgid "Television:"
 msgstr "Televido:"
 
-#: ../../include/profile_advanced.php:65
+#: ../../include/profile_advanced.php:75
 msgid "Film/dance/culture/entertainment:"
 msgstr "Filmoj/dancoj/arto/amuzaĵoj:"
 
-#: ../../include/profile_advanced.php:67
+#: ../../include/profile_advanced.php:77
 msgid "Love/Romance:"
 msgstr "Amo/romanco:"
 
-#: ../../include/profile_advanced.php:69
+#: ../../include/profile_advanced.php:79
 msgid "Work/employment:"
 msgstr "Laboro:"
 
-#: ../../include/profile_advanced.php:71
+#: ../../include/profile_advanced.php:81
 msgid "School/education:"
 msgstr "Lernejo/eduko:"
 
@@ -5992,199 +6339,203 @@ msgstr "Alia"
 msgid "Undecided"
 msgstr "Nedecida"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Males"
 msgstr "Viroj"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Females"
 msgstr "Inoj"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Gay"
 msgstr "Geja"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Lesbian"
 msgstr "Lesba"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "No Preference"
 msgstr "Neniu Prefero"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Bisexual"
 msgstr "Ambaŭseksema"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Autosexual"
 msgstr "Memseksema"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Abstinent"
 msgstr "Abstinema"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Virgin"
 msgstr "Virgulino"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Deviant"
 msgstr "Devia"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Fetish"
 msgstr "Fetiĉo"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Oodles"
 msgstr "Amasa"
 
-#: ../../include/profile_selectors.php:21
+#: ../../include/profile_selectors.php:23
 msgid "Nonsexual"
 msgstr "Neseksa"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Single"
 msgstr "Sola"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Lonely"
 msgstr "Soleca"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Available"
 msgstr "Havebla"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Unavailable"
 msgstr "Nehavebla"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Has crush"
 msgstr "Sekrete enamiĝinta"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Infatuated"
 msgstr "Blinda amo"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Dating"
 msgstr "Rendevuanta"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Unfaithful"
 msgstr "Malfidela"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Sex Addict"
 msgstr "Seksmaniulo"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42 ../../include/user.php:278
 msgid "Friends"
 msgstr "Amikoj"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Friends/Benefits"
 msgstr "Amikoj/Avantaĝoj"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Casual"
 msgstr "Neformala"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Engaged"
 msgstr "Fianĉiginta"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Married"
 msgstr "Edziĝinta"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Imaginarily married"
 msgstr "Image edziĝinta"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Partners"
 msgstr "Geparuloj"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Cohabiting"
 msgstr "Kunloĝanta"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Common law"
 msgstr "Registrita partnereco "
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Happy"
 msgstr "Feliĉa"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Not looking"
 msgstr "Ne interesiĝis"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Swinger"
 msgstr "Swinger"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Betrayed"
 msgstr "Trompita"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Separated"
 msgstr "Disiĝinta"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Unstable"
 msgstr "Malfirma"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Divorced"
 msgstr "Eksedziĝinta"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Imaginarily divorced"
 msgstr "Image eksedziĝinta"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Widowed"
 msgstr "Vidva"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Uncertain"
 msgstr "Ne certa"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "It's complicated"
 msgstr "Estas komplika"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Don't care"
 msgstr "Egala"
 
-#: ../../include/profile_selectors.php:37
+#: ../../include/profile_selectors.php:42
 msgid "Ask me"
 msgstr "Demandu min"
 
-#: ../../include/event.php:17 ../../include/bb2diaspora.php:244
+#: ../../include/event.php:20 ../../include/bb2diaspora.php:341
 msgid "Starts:"
 msgstr "Ekas:"
 
-#: ../../include/event.php:27 ../../include/bb2diaspora.php:252
+#: ../../include/event.php:30 ../../include/bb2diaspora.php:349
 msgid "Finishes:"
 msgstr "Finas:"
 
-#: ../../include/delivery.php:452 ../../include/notifier.php:652
+#: ../../include/delivery.php:456 ../../include/notifier.php:678
 msgid "(no subject)"
 msgstr "(neniu temo)"
 
-#: ../../include/delivery.php:459 ../../include/enotify.php:23
-#: ../../include/notifier.php:659
+#: ../../include/delivery.php:463 ../../include/enotify.php:26
+#: ../../include/notifier.php:685
 msgid "noreply"
 msgstr "nerespondi"
 
+#: ../../include/Scrape.php:572
+msgid " on Last.fm"
+msgstr " ĉe Last.fm"
+
 #: ../../include/text.php:243
 msgid "prev"
 msgstr "antaŭa"
@@ -6212,156 +6563,147 @@ msgid_plural "%d Contacts"
 msgstr[0] "%d Kontakto"
 msgstr[1] "%d Kontaktoj"
 
-#: ../../include/text.php:650 ../../include/nav.php:91
-msgid "Search"
-msgstr "Serĉi"
-
-#: ../../include/text.php:831
+#: ../../include/text.php:835
 msgid "Monday"
 msgstr "Lundo"
 
-#: ../../include/text.php:831
+#: ../../include/text.php:835
 msgid "Tuesday"
 msgstr "Mardo"
 
-#: ../../include/text.php:831
+#: ../../include/text.php:835
 msgid "Wednesday"
 msgstr "Merkredo"
 
-#: ../../include/text.php:831
+#: ../../include/text.php:835
 msgid "Thursday"
 msgstr "Ĵaŭdo"
 
-#: ../../include/text.php:831
+#: ../../include/text.php:835
 msgid "Friday"
 msgstr "Vendredo"
 
-#: ../../include/text.php:831
+#: ../../include/text.php:835
 msgid "Saturday"
 msgstr "Sabato"
 
-#: ../../include/text.php:831
+#: ../../include/text.php:835
 msgid "Sunday"
 msgstr "Dimanĉo"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "January"
 msgstr "Januaro"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "February"
 msgstr "Februaro"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "March"
 msgstr "Marto"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "April"
 msgstr "Aprilo"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "May"
 msgstr "Majo"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "June"
 msgstr "Junio"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "July"
 msgstr "Julio"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "August"
 msgstr "Aŭgusto"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "September"
 msgstr "Septembro"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "October"
 msgstr "Oktobro"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "November"
 msgstr "Novembro"
 
-#: ../../include/text.php:835
+#: ../../include/text.php:839
 msgid "December"
 msgstr "Decembro"
 
-#: ../../include/text.php:919
+#: ../../include/text.php:925
 msgid "bytes"
 msgstr "bajtoj"
 
-#: ../../include/text.php:934 ../../include/text.php:949
+#: ../../include/text.php:945 ../../include/text.php:960
 msgid "remove"
 msgstr "forviŝi"
 
-#: ../../include/text.php:934 ../../include/text.php:949
+#: ../../include/text.php:945 ../../include/text.php:960
 msgid "[remove]"
 msgstr "[forviŝi]"
 
-#: ../../include/text.php:937
+#: ../../include/text.php:948
 msgid "Categories:"
 msgstr "Kategorioj:"
 
-#: ../../include/text.php:952
+#: ../../include/text.php:963
 msgid "Filed under:"
 msgstr "Enarkivigita kiel:"
 
-#: ../../include/text.php:968 ../../include/text.php:980
+#: ../../include/text.php:979 ../../include/text.php:991
 msgid "Click to open/close"
 msgstr "Klaku por malfermi/fermi"
 
-#: ../../include/text.php:1085
+#: ../../include/text.php:1097 ../../include/user.php:236
 msgid "default"
 msgstr "defaŭlta"
 
-#: ../../include/text.php:1097
+#: ../../include/text.php:1109
 msgid "Select an alternate language"
 msgstr "Elekti alian lingvon"
 
-#: ../../include/text.php:1307
+#: ../../include/text.php:1319
 msgid "activity"
 msgstr "aktiveco"
 
-#: ../../include/text.php:1309
+#: ../../include/text.php:1321
 msgid "comment"
 msgstr "komento"
 
-#: ../../include/text.php:1310
+#: ../../include/text.php:1322
 msgid "post"
 msgstr "afiŝo"
 
-#: ../../include/text.php:1465
+#: ../../include/text.php:1477
 msgid "Item filed"
 msgstr "Enarkivigis elementon "
 
-#: ../../include/diaspora.php:582
+#: ../../include/diaspora.php:593
 msgid "Sharing notification from Diaspora network"
 msgstr "Antentigo pri kunhavigado de la Diaspora reto"
 
-#: ../../include/diaspora.php:1969
+#: ../../include/diaspora.php:2085
 msgid "Attachments:"
 msgstr "Kunsendaĵoj:"
 
-#: ../../include/diaspora.php:2152
-#, php-format
-msgid "[Relayed] Comment authored by %s from network %s"
-msgstr "[Plusendita] %s en la reto %s skribis komenton"
-
-#: ../../include/network.php:824
+#: ../../include/network.php:839
 msgid "view full size"
 msgstr "vidi plengrande"
 
-#: ../../include/oembed.php:132
+#: ../../include/oembed.php:135
 msgid "Embedded content"
 msgstr "Enigita enhavo"
 
-#: ../../include/oembed.php:141
+#: ../../include/oembed.php:144
 msgid "Embedding disabled"
 msgstr "Malŝaltita enigitado"
 
@@ -6372,31 +6714,35 @@ msgid ""
 "not what you intended, please create another group with a different name."
 msgstr "Revivigis malnovan grupon kun la sama nomo. Permesoj por estantaj elementoj <strong>eble</strong> estas validaj por la grupo kaj estontaj membroj. Se tiu ne estas kiun vi atendis, bonvolu krei alian grupon kun alia nomo."
 
-#: ../../include/group.php:168
+#: ../../include/group.php:176
+msgid "Default privacy group for new contacts"
+msgstr "Defaŭlta privateca grupo por novaj kontaktoj"
+
+#: ../../include/group.php:195
 msgid "Everybody"
 msgstr "Ĉiuj"
 
-#: ../../include/group.php:191
+#: ../../include/group.php:218
 msgid "edit"
 msgstr "redakti"
 
-#: ../../include/group.php:212
+#: ../../include/group.php:239
 msgid "Groups"
 msgstr "Grupoj"
 
-#: ../../include/group.php:213
+#: ../../include/group.php:240
 msgid "Edit group"
 msgstr "Redakti grupon"
 
-#: ../../include/group.php:214
+#: ../../include/group.php:241
 msgid "Create a new group"
 msgstr "Krei novan grupon"
 
-#: ../../include/group.php:215
+#: ../../include/group.php:242
 msgid "Contacts not in any group"
 msgstr "Kontaktoj en neniu grupo"
 
-#: ../../include/nav.php:46 ../../boot.php:810
+#: ../../include/nav.php:46 ../../boot.php:848
 msgid "Logout"
 msgstr "Elsaluti"
 
@@ -6404,7 +6750,7 @@ msgstr "Elsaluti"
 msgid "End this session"
 msgstr "Fini ĉi-tiun seancon"
 
-#: ../../include/nav.php:49 ../../boot.php:1478
+#: ../../include/nav.php:49 ../../boot.php:1538
 msgid "Status"
 msgstr "Stato"
 
@@ -6484,11 +6830,11 @@ msgstr "Administri"
 msgid "Manage other pages"
 msgstr "Administri aliajn paĝojn"
 
-#: ../../include/nav.php:138 ../../boot.php:1058
+#: ../../include/nav.php:138 ../../boot.php:1096
 msgid "Profiles"
 msgstr "Profiloj"
 
-#: ../../include/nav.php:138 ../../boot.php:1058
+#: ../../include/nav.php:138 ../../boot.php:1096
 msgid "Manage/edit profiles"
 msgstr "Administri/redakti profilojn"
 
@@ -6496,15 +6842,11 @@ msgstr "Administri/redakti profilojn"
 msgid "Manage/edit friends and contacts"
 msgstr "Administri/redakti amikojn kaj kontaktojn"
 
-#: ../../include/nav.php:146
-msgid "Admin"
-msgstr "Administrado"
-
 #: ../../include/nav.php:146
 msgid "Site setup and configuration"
 msgstr "Agordoj pri la retejo"
 
-#: ../../include/nav.php:169
+#: ../../include/nav.php:170
 msgid "Nothing new here"
 msgstr "Estas neniu nova ĉi tie"
 
@@ -6567,17 +6909,17 @@ msgstr "Ĉio"
 msgid "Categories"
 msgstr "Kategorioj"
 
-#: ../../include/auth.php:29
+#: ../../include/auth.php:36
 msgid "Logged out."
 msgstr "Elsalutita."
 
-#: ../../include/auth.php:106
+#: ../../include/auth.php:115
 msgid ""
 "We encountered a problem while logging in with the OpenID you provided. "
 "Please check the correct spelling of the ID."
 msgstr "Okazis problemo ensalutinta kun via OpenID. Bonvolu kontroli la ID."
 
-#: ../../include/auth.php:106
+#: ../../include/auth.php:115
 msgid "The error message was:"
 msgstr "La erarmesaĝo estis:"
 
@@ -6649,20 +6991,30 @@ msgstr "sekundo"
 msgid "seconds"
 msgstr "sekundoj"
 
-#: ../../include/datetime.php:277
+#: ../../include/datetime.php:278
 #, php-format
 msgid "%1$d %2$s ago"
 msgstr "antaŭ %1$d %2$s"
 
-#: ../../include/onepoll.php:406
+#: ../../include/datetime.php:450 ../../include/items.php:1460
+#, php-format
+msgid "%s's birthday"
+msgstr "Naskiĝtago de %s"
+
+#: ../../include/datetime.php:451 ../../include/items.php:1461
+#, php-format
+msgid "Happy Birthday %s"
+msgstr "Feliĉan Naskiĝtagon al %s"
+
+#: ../../include/onepoll.php:399
 msgid "From: "
 msgstr "De: "
 
-#: ../../include/bbcode.php:203 ../../include/bbcode.php:223
+#: ../../include/bbcode.php:216 ../../include/bbcode.php:236
 msgid "$1 wrote:"
 msgstr "$1 skribis:"
 
-#: ../../include/bbcode.php:238 ../../include/bbcode.php:307
+#: ../../include/bbcode.php:251 ../../include/bbcode.php:328
 msgid "Image/photo"
 msgstr "Bildo"
 
@@ -6692,197 +7044,297 @@ msgstr "Dankon,"
 msgid "%s Administrator"
 msgstr "%s Administranto"
 
-#: ../../include/enotify.php:35
+#: ../../include/enotify.php:38
 #, php-format
 msgid "%s <!item_type!>"
 msgstr "%s <!item_type!>"
 
-#: ../../include/enotify.php:39
+#: ../../include/enotify.php:42
 #, php-format
 msgid "[Friendica:Notify] New mail received at %s"
 msgstr "[Friendica:Atentigo] Ricevis novan retpoŝton ĉe %s"
 
-#: ../../include/enotify.php:41
+#: ../../include/enotify.php:44
 #, php-format
-msgid "%s sent you a new private message at %s."
-msgstr "%s sendis novan mesaĝon al vi ĉe %s."
+msgid "%1$s sent you a new private message at %2$s."
+msgstr "%1$s sendis al vi novan privatan mesaĝon ĉe %2$s."
 
-#: ../../include/enotify.php:42
+#: ../../include/enotify.php:45
 #, php-format
-msgid "%s sent you %s."
-msgstr "%s sendis al vi %s."
+msgid "%1$s sent you %2$s."
+msgstr "%1$s sendis al vi %2$s."
 
-#: ../../include/enotify.php:42
+#: ../../include/enotify.php:45
 msgid "a private message"
 msgstr "privatan mesaĝon"
 
-#: ../../include/enotify.php:43
+#: ../../include/enotify.php:46
 #, php-format
 msgid "Please visit %s to view and/or reply to your private messages."
 msgstr "Bonvolu viziti %s por vidi aŭ respondi viajn privatajn mesaĝojn."
 
 #: ../../include/enotify.php:73
 #, php-format
-msgid "%s's"
-msgstr "de %s verkita"
+msgid "%1$s commented on [url=%2$s]a %3$s[/url]"
+msgstr "%1$s komentis pri [url=%2$s]%3$s[/url]"
 
-#: ../../include/enotify.php:77
-msgid "your"
-msgstr "via"
+#: ../../include/enotify.php:80
+#, php-format
+msgid "%1$s commented on [url=%2$s]%3$s's %4$s[/url]"
+msgstr "%1$s komentis pri [url=%2$s]%4$s de %3$s[/url]"
 
-#: ../../include/enotify.php:84
+#: ../../include/enotify.php:88
 #, php-format
-msgid "[Friendica:Notify] Comment to conversation #%d by %s"
-msgstr "[Friendica:Atentigo] Komento pri konversacio #%d de %s"
+msgid "%1$s commented on [url=%2$s]your %3$s[/url]"
+msgstr "%1$s komentis pri [url=%2$s]via %3$s[/url]"
 
-#: ../../include/enotify.php:85
+#: ../../include/enotify.php:98
 #, php-format
-msgid "%s commented on an item/conversation you have been following."
-msgstr "%s komentis pri elemento/konversacio kiun vi sekvas."
+msgid "[Friendica:Notify] Comment to conversation #%1$d by %2$s"
+msgstr "[Friendica:Atentigo] Komento pri konversacio #%1$d de %2$s"
 
-#: ../../include/enotify.php:86
+#: ../../include/enotify.php:99
 #, php-format
-msgid "%s commented on %s."
-msgstr "%s komentis pri %s."
+msgid "%s commented on an item/conversation you have been following."
+msgstr "%s komentis pri elemento/konversacio kiun vi sekvas."
 
-#: ../../include/enotify.php:88 ../../include/enotify.php:101
-#: ../../include/enotify.php:112 ../../include/enotify.php:123
+#: ../../include/enotify.php:102 ../../include/enotify.php:117
+#: ../../include/enotify.php:130 ../../include/enotify.php:143
 #, php-format
 msgid "Please visit %s to view and/or reply to the conversation."
 msgstr "Bonvolu viziti %s por vidi aŭ respondi la konversacion."
 
-#: ../../include/enotify.php:95
+#: ../../include/enotify.php:109
 #, php-format
 msgid "[Friendica:Notify] %s posted to your profile wall"
 msgstr "[Friendica:Atentigo] %s afiŝis al via profilmuro"
 
-#: ../../include/enotify.php:97
+#: ../../include/enotify.php:111
 #, php-format
-msgid "%s posted to your profile wall at %s"
-msgstr "%s skribis al via profila muro ĉe %s"
+msgid "%1$s posted to your profile wall at %2$s"
+msgstr "%1$s skribis al via profilmuro ĉe %2$s"
 
-#: ../../include/enotify.php:99
+#: ../../include/enotify.php:113
 #, php-format
-msgid "%s posted to %s"
-msgstr "%s afiŝis al %s"
-
-#: ../../include/enotify.php:99
-msgid "your profile wall."
-msgstr "via profilmuro."
+msgid "%1$s posted to [url=%2s]your wall[/url]"
+msgstr "%1$s afiŝis al [url=%2s]via muro[/url]"
 
-#: ../../include/enotify.php:108
+#: ../../include/enotify.php:124
 #, php-format
 msgid "[Friendica:Notify] %s tagged you"
 msgstr "[Friendica:Atentigo] %s markis vin"
 
-#: ../../include/enotify.php:109
+#: ../../include/enotify.php:125
 #, php-format
-msgid "%s tagged you at %s"
-msgstr "%s markis vin kiel %s"
+msgid "%1$s tagged you at %2$s"
+msgstr "%1$s markis vin ĉe %2$s"
 
-#: ../../include/enotify.php:110
+#: ../../include/enotify.php:126
 #, php-format
-msgid "%s %s."
-msgstr "%s %s."
-
-#: ../../include/enotify.php:110
-msgid "tagged you"
-msgstr "markis vin"
+msgid "%1$s [url=%2$s]tagged you[/url]."
+msgstr "%1$s [url=%2$s]markis vin[/url]."
 
-#: ../../include/enotify.php:119
+#: ../../include/enotify.php:137
 #, php-format
 msgid "[Friendica:Notify] %s tagged your post"
 msgstr "[Friendica:Atentigo] %s markis vian afiŝon"
 
-#: ../../include/enotify.php:120
+#: ../../include/enotify.php:138
 #, php-format
-msgid "%s tagged your post at %s"
-msgstr "%s markis vian afiŝon kiel %s"
+msgid "%1$s tagged your post at %2$s"
+msgstr "%1$s markis vian afiŝon ĉe %2$s"
 
-#: ../../include/enotify.php:121
+#: ../../include/enotify.php:139
 #, php-format
-msgid "%s tagged %s"
-msgstr "%s markis %s"
-
-#: ../../include/enotify.php:121
-msgid "your post"
-msgstr "vian afiŝon"
+msgid "%1$s tagged [url=%2$s]your post[/url]"
+msgstr "%1$s markis [url=%2$s]vian afiŝon[/url]"
 
-#: ../../include/enotify.php:130
+#: ../../include/enotify.php:150
 msgid "[Friendica:Notify] Introduction received"
 msgstr "[Friendica:Atentigo] Ricevis prezenton"
 
-#: ../../include/enotify.php:131
+#: ../../include/enotify.php:151
 #, php-format
-msgid "You've received an introduction from '%s' at %s"
-msgstr "Vi ricevis prezento de '%s' ĉe %s"
+msgid "You've received an introduction from '%1$s' at %2$s"
+msgstr "Vi ricevis prezenton de '%1$s' ĉe %2$s"
 
-#: ../../include/enotify.php:132
+#: ../../include/enotify.php:152
 #, php-format
-msgid "You've received %s from %s."
-msgstr "Vi ricevis %s de %s."
-
-#: ../../include/enotify.php:132
-msgid "an introduction"
-msgstr "prezenton"
+msgid "You've received [url=%1$s]an introduction[/url] from %2$s."
+msgstr "Vi ricevis [url=%1$s]prezenton[/url] de %2$s."
 
-#: ../../include/enotify.php:133 ../../include/enotify.php:150
+#: ../../include/enotify.php:155 ../../include/enotify.php:173
 #, php-format
 msgid "You may visit their profile at %s"
 msgstr "Vi povas vidi la profilon de li aŭ ŝi ĉe %s"
 
-#: ../../include/enotify.php:135
+#: ../../include/enotify.php:157
 #, php-format
 msgid "Please visit %s to approve or reject the introduction."
 msgstr "Bonvolu viziti %s por aprobi aŭ malaprobi la prezenton."
 
-#: ../../include/enotify.php:142
+#: ../../include/enotify.php:164
 msgid "[Friendica:Notify] Friend suggestion received"
 msgstr "[Friendica:Atentigo] Ricevis amikosugeston"
 
-#: ../../include/enotify.php:143
+#: ../../include/enotify.php:165
 #, php-format
-msgid "You've received a friend suggestion from '%s' at %s"
-msgstr "'%s' ĉe %s rekomendis amikon al vi"
+msgid "You've received a friend suggestion from '%1$s' at %2$s"
+msgstr "Vi ricevis amikosugeston de '%1$s' ĉe %2$s"
 
-#: ../../include/enotify.php:144
+#: ../../include/enotify.php:166
 #, php-format
-msgid "You've received %s for %s from %s."
-msgstr "Vi ricevis %s kun %s de %s."
-
-#: ../../include/enotify.php:145
-msgid "a friend suggestion"
-msgstr "sugeston por amikiĝi"
+msgid ""
+"You've received [url=%1$s]a friend suggestion[/url] for %2$s from %3$s."
+msgstr "Vi ricevis [url=%1$s]amikosugeston[/url] pri %2$s de %3$s."
 
-#: ../../include/enotify.php:148
+#: ../../include/enotify.php:171
 msgid "Name:"
 msgstr "Nomo:"
 
-#: ../../include/enotify.php:149
+#: ../../include/enotify.php:172
 msgid "Photo:"
 msgstr "Bildo:"
 
-#: ../../include/enotify.php:152
+#: ../../include/enotify.php:175
 #, php-format
 msgid "Please visit %s to approve or reject the suggestion."
 msgstr "Bonvolu viziti %s por aprobi aŭ malaprobi la sugeston."
 
-#: ../../include/items.php:2724
+#: ../../include/follow.php:32
+msgid "Connect URL missing."
+msgstr "Ne ekzistas URL adreso por konekti."
+
+#: ../../include/follow.php:59
+msgid ""
+"This site is not configured to allow communications with other networks."
+msgstr "Tiu retpaĝo ne permesas komunikadon kun aliaj retoj."
+
+#: ../../include/follow.php:60 ../../include/follow.php:80
+msgid "No compatible communication protocols or feeds were discovered."
+msgstr "Ne malkovris kongruajn protokolojn por komunikado aŭ fluojn."
+
+#: ../../include/follow.php:78
+msgid "The profile address specified does not provide adequate information."
+msgstr "La specifita profiladreso ne enhavas sufiĉe da informoj."
+
+#: ../../include/follow.php:82
+msgid "An author or name was not found."
+msgstr "Ne trovis aŭtoron aŭ nomon."
+
+#: ../../include/follow.php:84
+msgid "No browser URL could be matched to this address."
+msgstr "Neniu retuma URL adreso kongruas al la adreso."
+
+#: ../../include/follow.php:86
+msgid ""
+"Unable to match @-style Identity Address with a known protocol or email "
+"contact."
+msgstr "Ne eblas kongrui @-stilan identecon adreson al iu konata protokolo au retpoŝtadreso."
+
+#: ../../include/follow.php:87
+msgid "Use mailto: in front of address to force email check."
+msgstr "Uzu mailto: antaŭ la adreso por devigi la testadon per retpoŝto."
+
+#: ../../include/follow.php:93
+msgid ""
+"The profile address specified belongs to a network which has been disabled "
+"on this site."
+msgstr "Tiu profila adreso apartenas al retejo kiu estas maŝaltita je ĉi tiu retejo."
+
+#: ../../include/follow.php:103
+msgid ""
+"Limited profile. This person will be unable to receive direct/personal "
+"notifications from you."
+msgstr "Profilo limigata. Ĉi persono ne eblos ricevi rektajn/personajn atentigojn de vi. "
+
+#: ../../include/follow.php:205
+msgid "Unable to retrieve contact information."
+msgstr "Ne eblas ricevi kontaktinformojn."
+
+#: ../../include/follow.php:259
+msgid "following"
+msgstr "sekvanta"
+
+#: ../../include/items.php:2888
 msgid "A new person is sharing with you at "
 msgstr "Nova persono kunhavigas kun vi ĉe "
 
-#: ../../include/items.php:2724
+#: ../../include/items.php:2888
 msgid "You have a new follower at "
 msgstr "Vi havas novan sekvanton ĉe "
 
-#: ../../include/bb2diaspora.php:102 ../../include/bb2diaspora.php:112
-#: ../../include/bb2diaspora.php:113
-msgid "image/photo"
-msgstr "bildo"
+#: ../../include/items.php:3520
+msgid "Archives"
+msgstr "Arkivoj"
+
+#: ../../include/user.php:38
+msgid "An invitation is required."
+msgstr "Invio bezonata."
+
+#: ../../include/user.php:43
+msgid "Invitation could not be verified."
+msgstr "Ne povis kontroli la inviton."
+
+#: ../../include/user.php:51
+msgid "Invalid OpenID url"
+msgstr "Nevalida OpenID adreso"
+
+#: ../../include/user.php:66
+msgid "Please enter the required information."
+msgstr "Bonvolu entajpi la bezonatajn informojn."
+
+#: ../../include/user.php:80
+msgid "Please use a shorter name."
+msgstr "Bonvolu uzi pli mallongan nomon."
+
+#: ../../include/user.php:82
+msgid "Name too short."
+msgstr "Nomo estas tro mallonga."
+
+#: ../../include/user.php:97
+msgid "That doesn't appear to be your full (First Last) name."
+msgstr "Tio ŝajne ne estas via plena (persona, familia) nomo."
+
+#: ../../include/user.php:102
+msgid "Your email domain is not among those allowed on this site."
+msgstr "Via retpoŝtodomajno ne estas permesita ĉi tie."
+
+#: ../../include/user.php:105
+msgid "Not a valid email address."
+msgstr "Nevalida retpoŝtadreso."
+
+#: ../../include/user.php:115
+msgid "Cannot use that email."
+msgstr "Neuzebla retpoŝtadreso."
+
+#: ../../include/user.php:121
+msgid ""
+"Your \"nickname\" can only contain \"a-z\", \"0-9\", \"-\", and \"_\", and "
+"must also begin with a letter."
+msgstr "Via kaŝnomo nur povas enhavi \"a-z\", \"0-9\", \"-\", kaj \"_\". Ĝi ankaŭ devas komenci kun litero."
+
+#: ../../include/user.php:127 ../../include/user.php:225
+msgid "Nickname is already registered. Please choose another."
+msgstr "Tio kaŝnomo jam estas registrita. Bonvolu elekti alian."
+
+#: ../../include/user.php:137
+msgid ""
+"Nickname was once registered here and may not be re-used. Please choose "
+"another."
+msgstr "Tiu kaŝnomo iam estis registrita ĉi tie kaj ne ree uzeblas. Bonvolu elekti alian."
 
-#: ../../include/bb2diaspora.php:102
-msgid "link"
-msgstr "ligilo"
+#: ../../include/user.php:153
+msgid "SERIOUS ERROR: Generation of security keys failed."
+msgstr "GRAVA ERARO: La generacio de sekurecaj ĉifroŝlosiloj malsukcesis."
+
+#: ../../include/user.php:211
+msgid "An error occurred during registration. Please try again."
+msgstr "Eraro okazis dum registrado. Bonvolu provi denove."
+
+#: ../../include/user.php:246
+msgid "An error occurred creating your default profile. Please try again."
+msgstr "Eraro okazi dum kreado de via defaŭlta profilo. Bonvolu provi denove."
 
 #: ../../include/security.php:21
 msgid "Welcome "
@@ -6906,30 +7358,30 @@ msgstr "La sekuriga ĵetono de la formo estis malĝusta. Tio verŝajne okazis ĉ
 msgid "stopped following"
 msgstr "ne plu sekvas"
 
-#: ../../include/Contact.php:203 ../../include/conversation.php:817
+#: ../../include/Contact.php:218 ../../include/conversation.php:842
 msgid "View Status"
 msgstr "Vidi Staton"
 
-#: ../../include/Contact.php:204 ../../include/conversation.php:818
+#: ../../include/Contact.php:219 ../../include/conversation.php:843
 msgid "View Profile"
 msgstr "Vidi Profilon"
 
-#: ../../include/Contact.php:205 ../../include/conversation.php:819
+#: ../../include/Contact.php:220 ../../include/conversation.php:844
 msgid "View Photos"
 msgstr "Vidi Bildojn"
 
-#: ../../include/Contact.php:206 ../../include/Contact.php:219
-#: ../../include/conversation.php:820
+#: ../../include/Contact.php:221 ../../include/Contact.php:234
+#: ../../include/conversation.php:845
 msgid "Network Posts"
 msgstr "Enretaj Afiŝoj"
 
-#: ../../include/Contact.php:207 ../../include/Contact.php:219
-#: ../../include/conversation.php:821
+#: ../../include/Contact.php:222 ../../include/Contact.php:234
+#: ../../include/conversation.php:846
 msgid "Edit Contact"
 msgstr "Redakti Kontakton"
 
-#: ../../include/Contact.php:208 ../../include/Contact.php:219
-#: ../../include/conversation.php:822
+#: ../../include/Contact.php:223 ../../include/Contact.php:234
+#: ../../include/conversation.php:847
 msgid "Send PM"
 msgstr "Sendi PM"
 
@@ -6942,309 +7394,321 @@ msgstr "afiŝo/elemento"
 msgid "%1$s marked %2$s's %3$s as favorite"
 msgstr "%1$s markis la %3$s de %2$s kiel preferita."
 
-#: ../../include/conversation.php:317 ../../include/conversation.php:583
+#: ../../include/conversation.php:327 ../../include/conversation.php:608
 msgid "Select"
 msgstr "Elekti"
 
-#: ../../include/conversation.php:334 ../../include/conversation.php:676
-#: ../../include/conversation.php:677
+#: ../../include/conversation.php:344 ../../include/conversation.php:701
+#: ../../include/conversation.php:702
 #, php-format
 msgid "View %s's profile @ %s"
 msgstr "Vidi la profilon de %s ĉe %s"
 
-#: ../../include/conversation.php:344 ../../include/conversation.php:688
+#: ../../include/conversation.php:354 ../../include/conversation.php:713
 #, php-format
 msgid "%s from %s"
 msgstr "%s de %s"
 
-#: ../../include/conversation.php:359
+#: ../../include/conversation.php:369
 msgid "View in context"
 msgstr "Vidi kun kunteksto"
 
-#: ../../include/conversation.php:465
+#: ../../include/conversation.php:475
 #, php-format
 msgid "%d comment"
 msgid_plural "%d comments"
 msgstr[0] "%d komento"
 msgstr[1] "%d komentoj"
 
-#: ../../include/conversation.php:529
+#: ../../include/conversation.php:554
 msgid "like"
 msgstr "ŝati"
 
-#: ../../include/conversation.php:530
+#: ../../include/conversation.php:555
 msgid "dislike"
 msgstr "malŝati"
 
-#: ../../include/conversation.php:532
+#: ../../include/conversation.php:557
 msgid "Share this"
 msgstr "Kunhavigi ĉi tiun"
 
-#: ../../include/conversation.php:532
+#: ../../include/conversation.php:557
 msgid "share"
 msgstr "kunhavigi"
 
-#: ../../include/conversation.php:556
+#: ../../include/conversation.php:581
 msgid "Bold"
 msgstr "Grasa"
 
-#: ../../include/conversation.php:557
+#: ../../include/conversation.php:582
 msgid "Italic"
 msgstr "Kursiva"
 
-#: ../../include/conversation.php:558
+#: ../../include/conversation.php:583
 msgid "Underline"
 msgstr "Substreki"
 
-#: ../../include/conversation.php:559
+#: ../../include/conversation.php:584
 msgid "Quote"
 msgstr "Citaĵo"
 
-#: ../../include/conversation.php:560
+#: ../../include/conversation.php:585
 msgid "Code"
 msgstr "Kodo"
 
-#: ../../include/conversation.php:561
+#: ../../include/conversation.php:586
 msgid "Image"
 msgstr "Bildo"
 
-#: ../../include/conversation.php:562
+#: ../../include/conversation.php:587
 msgid "Link"
 msgstr "Ligilo"
 
-#: ../../include/conversation.php:563
+#: ../../include/conversation.php:588
 msgid "Video"
 msgstr "Video"
 
-#: ../../include/conversation.php:596
+#: ../../include/conversation.php:621
 msgid "add star"
 msgstr "aldoni stelon"
 
-#: ../../include/conversation.php:597
+#: ../../include/conversation.php:622
 msgid "remove star"
 msgstr "forpreni stelon"
 
-#: ../../include/conversation.php:598
+#: ../../include/conversation.php:623
 msgid "toggle star status"
 msgstr "ŝalti/malŝalti steloŝtato"
 
-#: ../../include/conversation.php:601
+#: ../../include/conversation.php:626
 msgid "starred"
 msgstr "steligita"
 
-#: ../../include/conversation.php:602
+#: ../../include/conversation.php:627
 msgid "add tag"
 msgstr "aldoni markon"
 
-#: ../../include/conversation.php:606
+#: ../../include/conversation.php:631
 msgid "save to folder"
 msgstr "konservi en dosierujo"
 
-#: ../../include/conversation.php:678
+#: ../../include/conversation.php:703
 msgid "to"
 msgstr "al"
 
-#: ../../include/conversation.php:679
+#: ../../include/conversation.php:704
 msgid "Wall-to-Wall"
 msgstr "Muro-al-Muro"
 
-#: ../../include/conversation.php:680
+#: ../../include/conversation.php:705
 msgid "via Wall-To-Wall:"
-msgstr "tra Muro-al-Muro:"
+msgstr "per Muro-al-Muro:"
 
-#: ../../include/conversation.php:725
+#: ../../include/conversation.php:750
 msgid "Delete Selected Items"
 msgstr "Forviŝi Elektitajn Elementojn"
 
-#: ../../include/conversation.php:876
+#: ../../include/conversation.php:905
 #, php-format
 msgid "%s likes this."
 msgstr "%s ŝatas tiun."
 
-#: ../../include/conversation.php:876
+#: ../../include/conversation.php:905
 #, php-format
 msgid "%s doesn't like this."
 msgstr "%s malŝatas tiun."
 
-#: ../../include/conversation.php:880
+#: ../../include/conversation.php:909
 #, php-format
 msgid "<span  %1$s>%2$d people</span> like this."
 msgstr "<span %1$s>%2$d homoj</span> ŝatas tiun."
 
-#: ../../include/conversation.php:882
+#: ../../include/conversation.php:911
 #, php-format
 msgid "<span  %1$s>%2$d people</span> don't like this."
 msgstr "<span %1$s>%2$d homoj</span>malŝatas tiun."
 
-#: ../../include/conversation.php:888
+#: ../../include/conversation.php:917
 msgid "and"
 msgstr "kaj"
 
-#: ../../include/conversation.php:891
+#: ../../include/conversation.php:920
 #, php-format
 msgid ", and %d other people"
 msgstr ", kaj %d aliaj homoj."
 
-#: ../../include/conversation.php:892
+#: ../../include/conversation.php:921
 #, php-format
 msgid "%s like this."
 msgstr "%s ŝatas tiun."
 
-#: ../../include/conversation.php:892
+#: ../../include/conversation.php:921
 #, php-format
 msgid "%s don't like this."
 msgstr "%s malŝatas tiun."
 
-#: ../../include/conversation.php:917
+#: ../../include/conversation.php:946
 msgid "Visible to <strong>everybody</strong>"
 msgstr "Videbla al <strong>ĉiuj</strong>"
 
-#: ../../include/conversation.php:919
+#: ../../include/conversation.php:948
 msgid "Please enter a video link/URL:"
 msgstr "Bonvolu entajpi ligilon/adreson de video:"
 
-#: ../../include/conversation.php:920
+#: ../../include/conversation.php:949
 msgid "Please enter an audio link/URL:"
 msgstr "Bonvolu entajpi ligilon/adreson de sono:"
 
-#: ../../include/conversation.php:921
+#: ../../include/conversation.php:950
 msgid "Tag term:"
 msgstr "Markfrazo:"
 
-#: ../../include/conversation.php:923
+#: ../../include/conversation.php:952
 msgid "Where are you right now?"
 msgstr "Kie vi estas nun?"
 
-#: ../../include/conversation.php:966
+#: ../../include/conversation.php:995
 msgid "upload photo"
 msgstr "alŝuti bildon"
 
-#: ../../include/conversation.php:968
+#: ../../include/conversation.php:997
 msgid "attach file"
 msgstr "kunsendi dosieron"
 
-#: ../../include/conversation.php:970
+#: ../../include/conversation.php:999
 msgid "web link"
 msgstr "TTT ligilo"
 
-#: ../../include/conversation.php:971
+#: ../../include/conversation.php:1000
 msgid "Insert video link"
 msgstr "Alglui ligilon de video"
 
-#: ../../include/conversation.php:972
+#: ../../include/conversation.php:1001
 msgid "video link"
 msgstr "video ligilo"
 
-#: ../../include/conversation.php:973
+#: ../../include/conversation.php:1002
 msgid "Insert audio link"
 msgstr "Alglui ligilon de sono"
 
-#: ../../include/conversation.php:974
+#: ../../include/conversation.php:1003
 msgid "audio link"
 msgstr "sono ligilo"
 
-#: ../../include/conversation.php:976
+#: ../../include/conversation.php:1005
 msgid "set location"
 msgstr "agordi lokon"
 
-#: ../../include/conversation.php:978
+#: ../../include/conversation.php:1007
 msgid "clear location"
 msgstr "forviŝi lokon"
 
-#: ../../include/conversation.php:985
+#: ../../include/conversation.php:1014
 msgid "permissions"
 msgstr "permesoj"
 
-#: ../../boot.php:511
+#: ../../include/plugin.php:388 ../../include/plugin.php:390
+msgid "Click here to upgrade."
+msgstr "Klaku ĉi tie por ĝisdatigi."
+
+#: ../../include/plugin.php:396
+msgid "This action exceeds the limits set by your subscription plan."
+msgstr "Tia ago preterpasas la limojn de via abono."
+
+#: ../../include/plugin.php:401
+msgid "This action is not available under your subscription plan."
+msgstr "Tia ago ne estas permesita laŭ via abono."
+
+#: ../../boot.php:527
 msgid "Delete this item?"
 msgstr "Forviŝi ĉi tiun elementon?"
 
-#: ../../boot.php:514
+#: ../../boot.php:530
 msgid "show fewer"
 msgstr "montri malpli"
 
-#: ../../boot.php:687
+#: ../../boot.php:725
 #, php-format
 msgid "Update %s failed. See error logs."
 msgstr "Malsukcesis ĝisdatigi %s. Vidu la protokolojn."
 
-#: ../../boot.php:689
+#: ../../boot.php:727
 #, php-format
 msgid "Update Error at %s"
 msgstr "Eraro dum ĝisdatigo ĉe %s"
 
-#: ../../boot.php:789
+#: ../../boot.php:827
 msgid "Create a New Account"
 msgstr "Krei Novan Konton"
 
-#: ../../boot.php:813
+#: ../../boot.php:851
 msgid "Nickname or Email address: "
 msgstr "Kaŝnomo aŭ retpoŝtadreso:"
 
-#: ../../boot.php:814
+#: ../../boot.php:852
 msgid "Password: "
 msgstr "Pasvorto:"
 
-#: ../../boot.php:817
+#: ../../boot.php:855
 msgid "Or login using OpenID: "
 msgstr "Aŭ ensaluti per OpenID:"
 
-#: ../../boot.php:823
+#: ../../boot.php:861
 msgid "Forgot your password?"
 msgstr "Ĉu vi vorgesis vian pasvorton?"
 
-#: ../../boot.php:990
+#: ../../boot.php:1028
 msgid "Edit profile"
 msgstr "Redakti profilon"
 
-#: ../../boot.php:1050
+#: ../../boot.php:1088
 msgid "Message"
 msgstr "Mesaĝo"
 
-#: ../../boot.php:1166 ../../boot.php:1242
+#: ../../boot.php:1204 ../../boot.php:1283
 msgid "g A l F d"
 msgstr "\\j\\e \\l\\a G\\a \\h\\o\\r\\o, l F d"
 
-#: ../../boot.php:1167 ../../boot.php:1243
+#: ../../boot.php:1205 ../../boot.php:1284
 msgid "F d"
 msgstr "F d"
 
-#: ../../boot.php:1212 ../../boot.php:1283
+#: ../../boot.php:1250 ../../boot.php:1324
 msgid "[today]"
 msgstr "[hodiaŭ]"
 
-#: ../../boot.php:1224
+#: ../../boot.php:1262
 msgid "Birthday Reminders"
 msgstr "Memorigilo pri naskiĝtagoj"
 
-#: ../../boot.php:1225
+#: ../../boot.php:1263
 msgid "Birthdays this week:"
 msgstr "Naskiĝtagoj ĉi-semajne:"
 
-#: ../../boot.php:1276
+#: ../../boot.php:1317
 msgid "[No description]"
 msgstr "[Neniu priskribo]"
 
-#: ../../boot.php:1294
+#: ../../boot.php:1335
 msgid "Event Reminders"
 msgstr "Memorigilo pri Okazoj"
 
-#: ../../boot.php:1295
+#: ../../boot.php:1336
 msgid "Events this week:"
 msgstr "Okazoj ĉi-semajne:"
 
-#: ../../boot.php:1481
+#: ../../boot.php:1541
 msgid "Status Messages and Posts"
 msgstr "Ŝtatmesaĝoj kaj Afiŝoj"
 
-#: ../../boot.php:1487
+#: ../../boot.php:1547
 msgid "Profile Details"
 msgstr "Profildetaloj"
 
-#: ../../boot.php:1502
+#: ../../boot.php:1562
 msgid "Events and Calendar"
 msgstr "Okazoj kaj Kalendaro"
 
-#: ../../boot.php:1508
+#: ../../boot.php:1568
 msgid "Only You Can See This"
 msgstr "Nur Vi Povas Vidi Tiun"
index ba2af413ae38c13d8c8840f3a9f54d91ca743fdb..23602299389272a7eeea11c7da01cf6d1746d231 100644 (file)
@@ -33,7 +33,7 @@ $a->strings["File upload failed."] = "Alŝutado malsukcesis.";
 $a->strings["Friend suggestion sent."] = "Amikosugesto sendita.";
 $a->strings["Suggest Friends"] = "Sugesti amikojn";
 $a->strings["Suggest a friend for %s"] = "Sugesti amikon por %s";
-$a->strings["Event description and start time are required."] = "Okazo bezonas priskribon kaj startotempon.";
+$a->strings["Event title and start time are required."] = "Titolo kaj starttempo estas bezonataj por la okazo.";
 $a->strings["l, F j"] = "l, F j";
 $a->strings["Edit event"] = "Redakti okazon";
 $a->strings["link to source"] = "ligilo al fonto";
@@ -43,13 +43,15 @@ $a->strings["Previous"] = "antaŭa";
 $a->strings["Next"] = "sekva";
 $a->strings["hour:minute"] = "horo:minuto";
 $a->strings["Event details"] = "Detaloj de okazo";
-$a->strings["Format is %s %s. Starting date and Description are required."] = "Formato estas %s %s. Startotempo kaj priskribo estas bezonataj";
+$a->strings["Format is %s %s. Starting date and Title are required."] = "Format is %s %s. Titolo kaj starttempo estas bezonataj.";
 $a->strings["Event Starts:"] = "Okazo startas:";
+$a->strings["Required"] = "Bezonata";
 $a->strings["Finish date/time is not known or not relevant"] = "Fina dato/tempo ne estas konata aŭ ne bezonata";
 $a->strings["Event Finishes:"] = "Okazo finas:";
 $a->strings["Adjust for viewer timezone"] = "Agordi al horzono de la leganto";
 $a->strings["Description:"] = "Priskribo";
 $a->strings["Location:"] = "Loko:";
+$a->strings["Title:"] = "Titolo:";
 $a->strings["Share this event"] = "Kunhavigi la okazon";
 $a->strings["Cancel"] = "Nuligi";
 $a->strings["Tag removed"] = "Marko forviŝita";
@@ -82,6 +84,8 @@ $a->strings["Image upload failed."] = "Alŝuto de bildo malsukcesis.";
 $a->strings["Public access denied."] = "Publika atingo ne permesita.";
 $a->strings["No photos selected"] = "Neniu bildoj elektita";
 $a->strings["Access to this item is restricted."] = "Atingo al tio elemento estas limigita.";
+$a->strings["You have used %1$.2f Mbytes of %2$.2f Mbytes photo storage."] = "Vi uzas %1$.2f MB de %2$.2f MB bildkonservejo.";
+$a->strings["You have used %1$.2f Mbytes of photo storage."] = "Vi uzas %1$.2f MB de bildkonservejo.";
 $a->strings["Upload Photos"] = "Alŝuti bildojn";
 $a->strings["New album name: "] = "Nomo por nova albumo:";
 $a->strings["or existing album name: "] = "aŭ nomo de estanta albumo:";
@@ -98,6 +102,8 @@ $a->strings["Private Message"] = "Privata mesaĝo";
 $a->strings["View Full Size"] = "Vidi plengrande ";
 $a->strings["Tags: "] = "Markoj:";
 $a->strings["[Remove any tag]"] = "[Forviŝi iun markon]";
+$a->strings["Rotate CW (right)"] = "Turni horloĝdirekte (dekstren)";
+$a->strings["Rotate CCW (left)"] = "Turni kontraŭhorloĝdirekte (maldekstren)";
 $a->strings["New album name"] = "Nova nomo de albumo";
 $a->strings["Caption"] = "Apudskribo";
 $a->strings["Add a Tag"] = "Aldoni markon";
@@ -124,7 +130,7 @@ $a->strings["Installed plugins/addons/apps:"] = "Instalitaj kromprogramoj/progra
 $a->strings["No installed plugins/addons/apps"] = "Neniom da instalitaj aldonaĵoj/programoj";
 $a->strings["Item not found"] = "Elemento ne trovita";
 $a->strings["Edit post"] = "Redakti afiŝon";
-$a->strings["Post to Email"] = "Sendi tra retpoŝto";
+$a->strings["Post to Email"] = "Sendi per retpoŝto";
 $a->strings["Edit"] = "Redakti";
 $a->strings["Upload photo"] = "Alŝuti bildon";
 $a->strings["Attach file"] = "Kunligi dosieron";
@@ -166,6 +172,7 @@ $a->strings["Failed to update contact record."] = "Ĝisdatigo de via kontaktriko
 $a->strings["Your introduction has been sent."] = "Via prezento estas sendita.";
 $a->strings["Please login to confirm introduction."] = "Bonvolu ensaluti por jesigi la prezenton.";
 $a->strings["Incorrect identity currently logged in. Please login to <strong>this</strong> profile."] = "Malĝusta identaĵo ensalutata. Bonvolu ensaluti en <strong>tiun</strong> profilon.";
+$a->strings["Hide this contact"] = "Kaŝi tiun kontakton";
 $a->strings["Welcome home %s."] = "Bonvenon hejme, %s.";
 $a->strings["Please confirm your introduction/connection request to %s."] = "Bonvolu konfirmi vian prezenton / kontaktpeton al %s.";
 $a->strings["Confirm"] = "Konfirmi.";
@@ -185,18 +192,14 @@ $a->strings[" - please do not use this form.  Instead, enter %s into your Diaspo
 $a->strings["Your Identity Address:"] = "Via identeca adreso:";
 $a->strings["Submit Request"] = "Sendi peton";
 $a->strings["Friendica Social Communications Server - Setup"] = "Friendica Interkona Komunikada Servilo - Instalo";
-$a->strings["Database connection"] = "Datumbaza konekto";
 $a->strings["Could not connect to database."] = "Ne eblas konekti la datumbazon.";
 $a->strings["Could not create table."] = "Ne eblas krei tabelon.";
 $a->strings["Your Friendica site database has been installed."] = "La datumbazo de vi Friendica retjo estas instalita.";
-$a->strings["IMPORTANT: You will need to [manually] setup a scheduled task for the poller."] = "GRAVA: Vi bezonas [mane] agordi planitan taskon por la Friendica poller.";
+$a->strings["You may need to import the file \"database.sql\" manually using phpmyadmin or mysql."] = "Vi bezonas mane importi la dosieron \"database.sql\" per phpmyadmin aŭ mysql.";
 $a->strings["Please see the file \"INSTALL.txt\"."] = "Bonvolu legi la dosieron \"INSTALL.txt\".";
-$a->strings["Proceed to registration"] = "Pluigi al la registrilo";
-$a->strings["Proceed with Installation"] = "Pluigi la instalado";
-$a->strings["You may need to import the file \"database.sql\" manually using phpmyadmin or mysql."] = "Vi bezonas mane importi la dosieron \"database.sql\" tra phpmyadmin aŭ mysql.";
-$a->strings["Database import failed."] = "Importo de la datumbazo malsukcesis.";
 $a->strings["System check"] = "Sistema kontrolo";
 $a->strings["Check again"] = "Ree kontroli";
+$a->strings["Database connection"] = "Datumbaza konekto";
 $a->strings["In order to install Friendica we need to know how to connect to your database."] = "Por instali Friendica, ni bezonas scii kiel konekti al via datumbazo.";
 $a->strings["Please contact your hosting provider or site administrator if you have questions about these settings."] = "Bonvolu kontakti vian servilprovizanton aŭ administranton se vi havas demandoj pri ĉi tiaj agordoj.";
 $a->strings["The database you specify below should already exist. If it does not, please create it before continuing."] = "La datumbazo nomata malsupren jam ekzistu. Se ĝi ne ekzistas, bonvolu unue krei ĝin antaŭ progresi.";
@@ -209,8 +212,9 @@ $a->strings["Your account email address must match this in order to use the web
 $a->strings["Please select a default timezone for your website"] = "Bonvolu elekti defaŭltan horzonon por via retejo.";
 $a->strings["Site settings"] = "Retejaj agordoj";
 $a->strings["Could not find a command line version of PHP in the web server PATH."] = "Komanda linia versio de PHP ne trovita en $PATH de la retservilo.";
+$a->strings["If you don't have a command line version of PHP installed on server, you will not be able to run background polling via cron. See <a href='http://friendica.com/node/27'>'Activating scheduled tasks'</a>"] = "Se vi ne havas komandlinian version de PHP sur la servilo, vi ne eblas plenumi fonan planitan enketon per cron. Bonvolu legi <a href='http://friendica.com/node/27'>'Activating scheduled tasks'</a>";
 $a->strings["PHP executable path"] = "Vojo de la komanda linia versio de PHP";
-$a->strings["Enter full path to php executable"] = "Entajpu plenan vojon al la komanda linia versio de PHP";
+$a->strings["Enter full path to php executable. You can leave this blank to continue the installation."] = "Entajpu la plenan vojon al la php komandodosiero. Vi eblas lasi tion malplena por pluigi la instalado.";
 $a->strings["Command line PHP"] = "komanda linia versio de PHP";
 $a->strings["The command line version of PHP on your system does not have \"register_argc_argv\" enabled."] = "En via komanda linia versio de PHP je via sistemo, \"register_argc_argv\" ne estas aktivita.";
 $a->strings["This is required for message delivery to work."] = "Tio estas bezonata por la livero de mesaĝoj.";
@@ -232,11 +236,15 @@ $a->strings["Error: mysqli PHP module required but not installed."] = "Eraro: La
 $a->strings["Error: mb_string PHP module required but not installed."] = "Eraro: La modulo mb_string en PHP estas bezonata sed ne instalita.";
 $a->strings["The web installer needs to be able to create a file called \".htconfig.php\ in the top folder of your web server and it is unable to do so."] = "La reta instalilo bezonas skribi dosieron nomata \".htconfig.php\" en la baza dosierujo de la retservilo, sed ne sukcesis.";
 $a->strings["This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can."] = "Tio ĉi plej ofte estas agordo rilate al permesoj, ĉar la servilo eble ne povas skribi en via dosierujo, eĉ se vi mem povas skribi.";
-$a->strings["Please check with your site documentation or support people to see if this situation can be corrected."] = "Bonvolu kontroli la dokumentojn de via servilo aŭ teĥnikiston por ekscii ĉu la situacio ĝustigeblas.";
-$a->strings["If not, you may be required to perform a manual installation. Please see the file \"INSTALL.txt\" for instructions."] = "Se ne, vi eble bezonas instali mane. Bonvolu legi la dosieron \"INSTALL.txt\" por pluaj instruaĵoj.";
+$a->strings["At the end of this procedure, we will give you a text to save in a file named .htconfig.php in your Friendica top folder."] = "Post la fino de tiu proceduro, ni donos al vi tekston por konservi en dosiero .htconfig.php en via baza Friendica dosierujo.";
+$a->strings["You can alternatively skip this procedure and perform a manual installation. Please see the file \"INSTALL.txt\" for instructions."] = "Vi ankaŭ povas preterpasi tiun proceduron kaj fari permanan instaladon. Bonvolu legi la dosieron \"INSTALL.txt\" por trovi instrukciojn.";
 $a->strings[".htconfig.php is writable"] = ".htconfig.php estas skribebla.";
+$a->strings["Url rewrite in .htaccess is not working. Check your server configuration."] = "Url rewrite en .htaccess ne funkcias. Kontrolu la agordojn de la servilo.";
+$a->strings["Url rewrite is working"] = "URL rewrite funkcias.";
 $a->strings["The database configuration file \".htconfig.php\" could not be written. Please use the enclosed text to create a configuration file in your web server root."] = "Ne povis skribi la datumbaza agordoj en la dosiero \".htconfig.php\". Bonvolu uzi la inkluzivan tekston por krei agordan dosieron en la baza dosierujo de la retservilo.";
 $a->strings["Errors encountered creating database tables."] = "Okazis eraroj dum la kreado de tabeloj en la datumbazo.";
+$a->strings["<h1>What next</h1>"] = "<h1>Kio sekvas nun?</h1>";
+$a->strings["IMPORTANT: You will need to [manually] setup a scheduled task for the poller."] = "GRAVA: Vi bezonas [mane] agordi planitan taskon por la Friendica poller.";
 $a->strings["l F d, Y \\@ g:i A"] = "l F d, Y \\@ g:i A";
 $a->strings["Time Conversion"] = "Konverto de tempo";
 $a->strings["Friendika provides this service for sharing events with other networks and friends in unknown timezones."] = "Friendica provizas tiun servon por kunhavigi okazojn kun aliaj retoj kaj amikoj en aliaj horzonoj.";
@@ -328,6 +336,7 @@ $a->strings["Archive"] = "Enarkivigi";
 $a->strings["Toggle Archive status"] = "Ŝalti/malŝalti Enarkivigitan staton";
 $a->strings["Repair"] = "Ripari";
 $a->strings["Advanced Contact Settings"] = "Specialaj Kontaktagordoj";
+$a->strings["Communications lost with this contact!"] = "Mi perdis la kommunikadon kun tiu kontakto!";
 $a->strings["Contact Editor"] = "Kontakta redaktilo.";
 $a->strings["Profile Visibility"] = "Videbleco de profilo";
 $a->strings["Please choose the profile you would like to display to %s when viewing your profile securely."] = "Bonvolu elekti la profilon kiu vi volas montri al %s aspektinde kiam sekure aspektante vian profilon.";
@@ -403,6 +412,8 @@ $a->strings[" Please use a shorter name."] = " Bonvolu uzi pli mallongan nomon."
 $a->strings[" Name too short."] = " Nomo estas tro mallonga.";
 $a->strings[" Not valid email."] = " Repoŝtadreso ne validas.";
 $a->strings[" Cannot change to that email."] = " Ne povas ŝanĝi al tio retpoŝtadreso.";
+$a->strings["Private forum has no privacy permissions. Using default privacy group."] = "Privata forumo ne havas privatecajn agordojn. Defaŭlta privateca grupo estas uzata.";
+$a->strings["Private forum has no privacy permissions and no default privacy group."] = "Privata forumo havas nek privatecajn agordojn nek defaŭltan privatecan grupon.";
 $a->strings["Settings updated."] = "Agordoj ĝisdatigita.";
 $a->strings["Add application"] = "Aldoni programon";
 $a->strings["Consumer Key"] = "Ŝlosilo de kliento";
@@ -420,11 +431,11 @@ $a->strings["Built-in support for %s connectivity is %s"] = "Integrita subteno p
 $a->strings["enabled"] = "ŝaltita";
 $a->strings["disabled"] = "malŝaltita";
 $a->strings["StatusNet"] = "StatusNet";
+$a->strings["Email access is disabled on this site."] = "Retpoŝta atingo ne disponeblas ĉi tie.";
 $a->strings["Connector Settings"] = "Konektiloagordoj";
 $a->strings["Email/Mailbox Setup"] = "Agordoj pri Retpoŝto";
-$a->strings["If you wish to communicate with email contacts using this service (optional), please specify how to connect to your mailbox."] = "Se vi volas uzi ĉi tiun servon por komuniki tra retpoŝto (nedeviga), bonvolu specifi kiel konekti al vian retpoŝtkonton.";
+$a->strings["If you wish to communicate with email contacts using this service (optional), please specify how to connect to your mailbox."] = "Se vi volas uzi ĉi tiun servon por komuniki per retpoŝto (nedeviga), bonvolu specifi kiel konekti al vian retpoŝtkonton.";
 $a->strings["Last successful email check:"] = "Plej ĵusa sukcesa kontrolo de poŝto:";
-$a->strings["Email access is disabled on this site."] = "Retpoŝta atingo ne disponeblas ĉi tie.";
 $a->strings["IMAP server name:"] = "Nomo de IMAP servilo:";
 $a->strings["IMAP port:"] = "Numero de IMAP pordo:";
 $a->strings["Security:"] = "Sekureco:";
@@ -444,14 +455,16 @@ $a->strings["Minimum of 10 seconds, no maximum"] = "Minimume 10 sekundoj, sen ma
 $a->strings["Number of items to display on the network page:"] = "Kvanto da elementoj kiuj estos montrata ĉe la reto paĝo.";
 $a->strings["Maximum of 100 items"] = "Maksimume 100 eroj";
 $a->strings["Don't show emoticons"] = "Ne montru ridetulojn";
-$a->strings["Normal Account"] = "Normala konto";
+$a->strings["Normal Account Page"] = "Normala Kontopaĝo";
 $a->strings["This account is a normal personal profile"] = "Tiu konto estas normala persona profilo";
-$a->strings["Soapbox Account"] = "Soapbox Konto";
+$a->strings["Soapbox Page"] = "Soapbox Paĝo";
 $a->strings["Automatically approve all connection/friend requests as read-only fans"] = "Aŭtomate konfirmi ĉiujn kontaktpetojn kiel nurlegaj admirantoj";
-$a->strings["Community/Celebrity Account"] = "Komunuma/eminentula Konto";
+$a->strings["Community Forum/Celebrity Account"] = "Komunuma Forumo/Eminentula Konto";
 $a->strings["Automatically approve all connection/friend requests as read-write fans"] = "Aŭtomate konfirmi ĉiujn kontaktpetojn kiel admirantoj kapable legi kaj skribi";
-$a->strings["Automatic Friend Account"] = "Aŭtomata Amika Konto";
+$a->strings["Automatic Friend Page"] = "Aŭtomata Amiko Paĝo";
 $a->strings["Automatically approve all connection/friend requests as friends"] = "Aŭtomate konfirmi ĉiujn kontaktpetojn kiel amikoj";
+$a->strings["Private Forum [Experimental]"] = "Privata Forumo [eksperimenta]";
+$a->strings["Private forum - approved members only"] = "Privata forumo - nur por aprobitaj membroj";
 $a->strings["OpenID:"] = "OpenID:";
 $a->strings["(Optional) Allow this OpenID to login to this account."] = "(Nedeviga) Permesi atingon al la konton al ĉi tio OpenID.";
 $a->strings["Publish your default profile in your local site directory?"] = "Publikigi vian defaŭltan profilon en la loka reteja katalogo?";
@@ -473,6 +486,7 @@ $a->strings["Expire posts:"] = "Senvalidigi afiŝojn:";
 $a->strings["Expire personal notes:"] = "Senvalidigi personajn notojn:";
 $a->strings["Expire starred posts:"] = "Senvalidigi steligitajn afiŝojn:";
 $a->strings["Expire photos:"] = "Senvalidigi bildojn:";
+$a->strings["Only expire posts by others:"] = "Nur senvalidigi afiŝojn de aliaj: ";
 $a->strings["Account Settings"] = "Kontoagordoj";
 $a->strings["Password Settings"] = "Agordoj pri Pasvorto";
 $a->strings["New Password:"] = "Nova pasvorto:";
@@ -503,7 +517,8 @@ $a->strings["Someone writes a followup comment"] = "Iu skribas sekvan komenton";
 $a->strings["You receive a private message"] = "Vi ricevas privatan mesaĝon.";
 $a->strings["You receive a friend suggestion"] = "Vi ricevas amikosugeston";
 $a->strings["You are tagged in a post"] = "Vi estas markita en afiŝon";
-$a->strings["Advanced Page Settings"] = "Specialaj agordoj pri paĝoj";
+$a->strings["Advanced Account/Page Type Settings"] = "Detalaj Agordoj pri Tipo de Konto/Paĝo.";
+$a->strings["Change the behaviour of this account for special situations"] = "Agordi la teniĝon de la konto en specialaj situacioj";
 $a->strings["Manage Identities and/or Pages"] = "Administri identecojn kaj/aŭ paĝojn.";
 $a->strings["Toggle between different identities or community/group pages which share your account details or which you have been granted \"manage\" permissions"] = "Ŝalti inter aliaj identecojn aj komunumaj/grupaj paĝoj kiuj kunhavas viajn kontajn detalojn au por kiuj vi havas \"administranto\" permesojn.";
 $a->strings["Select an identity to manage: "] = "Elektu identencon por administrado:";
@@ -557,7 +572,7 @@ $a->strings["Review the other settings, particularly the privacy settings. An un
 $a->strings["Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not."] = "Enŝuti profilbildon se vi ankoraŭ ne havas ĝin. Laŭ studoj, homoj kun realaj biloj de si mem trovas novajn amikon duope pli probable ol homoj sen reala bildo.";
 $a->strings["Authorise the Facebook Connector if you currently have a Facebook account and we will (optionally) import all your Facebook friends and conversations."] = "Rajtigu la Facebook Konektilon se vi nuntempe havas Facebook konton, kaj ni (nedeviga) enportu viajn Facebook amikojn kaj konversaciojn.";
 $a->strings["<em>If</em> this is your own personal server, installing the Facebook addon may ease your transition to the free social web."] = "<em>Se</tm> ĉi tiu estas via propra TTT servilo, instali la Facebook kromprogramon eble plifaciligos la transpason al la libera interkona reto.";
-$a->strings["Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX"] = "Entajpu la akreditaĵojn por via retpoŝtkonto en la konektilagordoj se vi volas importi aŭ interagi kun amikoj aŭ dissendlistoj tra via retkesto.";
+$a->strings["Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX"] = "Entajpu la akreditaĵojn por via retpoŝtkonto en la konektilagordoj se vi volas importi aŭ interagi kun amikoj aŭ dissendlistoj pere de via retkesto.";
 $a->strings["Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors."] = "Redakti viajn <strong>defaŭltan</strong> profilon kiel vi ŝatas ĝin. Kontrolu la agordojn por kaŝi vian kontaktliston aŭ kaŝi vian profilon al nekonataj vizitantoj.";
 $a->strings["Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships."] = "Aldonu publikajn ŝlosilvortojn al via defaŭlta profilo, kiuj priskribas viajn interesojn. Ni eble povas trovi aliajn uzantojn kun similaj interesoj kaj sugesti amikojn.";
 $a->strings["Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog."] = "Via kontaktpaĝo estas via portalo por administri amikojn kaj konekti kun amikoj en aliaj retoj. Vi kutime entajpas iliajn adreson aŭ URL adreso en la <em>Aldonu Novan Kontakton</em> dialogon.";
@@ -586,22 +601,6 @@ $a->strings["Visible To"] = "Videbla Al";
 $a->strings["All Contacts (with secure profile access)"] = "Ĉiuj Kontaktoj (kun sekura atingo al la profilo)";
 $a->strings["No contacts."] = "Neniu kontaktojn.";
 $a->strings["View Contacts"] = "Vidi Kontaktojn";
-$a->strings["An invitation is required."] = "Invio bezonata.";
-$a->strings["Invitation could not be verified."] = "Ne povis kontroli la inviton.";
-$a->strings["Invalid OpenID url"] = "Nevalida OpenID adreso";
-$a->strings["Please enter the required information."] = "Bonvolu entajpi la bezonatajn informojn.";
-$a->strings["Please use a shorter name."] = "Bonvolu uzi pli mallongan nomon.";
-$a->strings["Name too short."] = "Nomo estas tro mallonga.";
-$a->strings["That doesn't appear to be your full (First Last) name."] = "Tio ŝajne ne estas via plena (persona, familia) nomo.";
-$a->strings["Your email domain is not among those allowed on this site."] = "Via retpoŝtodomajno ne estas permesita ĉi tie.";
-$a->strings["Not a valid email address."] = "Nevalida retpoŝtadreso.";
-$a->strings["Cannot use that email."] = "Neuzebla retpoŝtadreso.";
-$a->strings["Your \"nickname\" can only contain \"a-z\", \"0-9\", \"-\", and \"_\", and must also begin with a letter."] = "Via kaŝnomo nur povas enhavi \"a-z\", \"0-9\", \"-\", kaj \"_\". Ĝi ankaŭ devas komenci kun litero.";
-$a->strings["Nickname is already registered. Please choose another."] = "Tio kaŝnomo jam estas registrita. Bonvolu elekti alian.";
-$a->strings["Nickname was once registered here and may not be re-used. Please choose another."] = "Tiu kaŝnomo iam estis registrita ĉi tie kaj ne ree uzeblas. Bonvolu elekti alian.";
-$a->strings["SERIOUS ERROR: Generation of security keys failed."] = "GRAVA ERARO: La generacio de sekurecaj ĉifroŝlosiloj malsukcesis.";
-$a->strings["An error occurred during registration. Please try again."] = "Eraro okazis dum registrado. Bonvolu provi denove.";
-$a->strings["An error occurred creating your default profile. Please try again."] = "Eraro okazi dum kreado de via defaŭlta profilo. Bonvolu provi denove.";
 $a->strings["Registration details for %s"] = "Detaloj de la registrado por %s";
 $a->strings["Registration successful. Please check your email for further instructions."] = "Registrado sukcesis. Bonvolu kontroli vian retpoŝton por pli da instruoj.";
 $a->strings["Failed to send email message. Here is the message that failed."] = "Malsukcesis sendi retpoŝton. Jen la malsukcesa mesaĝo.";
@@ -609,7 +608,7 @@ $a->strings["Your registration can not be processed."] = "Mi ne povas prilabori
 $a->strings["Registration request at %s"] = "Peto de registrado al %s";
 $a->strings["Your registration is pending approval by the site owner."] = "Via registrado bezonas apropbon de la administranto.";
 $a->strings["This site has exceeded the number of allowed daily account registrations. Please try again tomorrow."] = "La retejo transiras la maksimuman kvanton da ĉiutagaj kontaj registradoj. Bonvolu provi denove morgaŭ.";
-$a->strings["You may (optionally) fill in this form via OpenID by supplying your OpenID and clicking 'Register'."] = "Vi ankaŭ (nedeviga) povas plenigi la formularon tra OpenID se vi provizas vian OpenID adreson kaj klakas 'Registri'.";
+$a->strings["You may (optionally) fill in this form via OpenID by supplying your OpenID and clicking 'Register'."] = "Vi ankaŭ (nedeviga) povas plenigi la formularon per OpenID se vi provizas vian OpenID adreson kaj klakas 'Registri'.";
 $a->strings["If you are not familiar with OpenID, please leave that field blank and fill in the rest of the items."] = "Se vi ne konas OpenID, bonvolu lasi tiun kampon malplena kaj entajpu la aliajn elementojn.";
 $a->strings["Your OpenID (optional): "] = "Via OpenID (nedeviga):";
 $a->strings["Include your profile in member directory?"] = "Aldoni vian profilon al la membrokatalogo?";
@@ -684,9 +683,15 @@ $a->strings["Users"] = "Uzantoj";
 $a->strings["Plugins"] = "Kromprogramoj";
 $a->strings["Themes"] = "Etosoj";
 $a->strings["DB updates"] = "DB ĝisdatigoj";
-$a->strings["Software Update"] = "Friendica Ĝisdatigoj";
 $a->strings["Logs"] = "Protokoloj";
+$a->strings["Admin"] = "Administrado";
+$a->strings["Plugin Features"] = "Kromprogramaj Trajtoj";
 $a->strings["User registrations waiting for confirmation"] = "Uzantaj registradoj atendante konfirmon";
+$a->strings["Normal Account"] = "Normala konto";
+$a->strings["Soapbox Account"] = "Soapbox Konto";
+$a->strings["Community/Celebrity Account"] = "Komunuma/eminentula Konto";
+$a->strings["Automatic Friend Account"] = "Aŭtomata Amika Konto";
+$a->strings["Message queues"] = "Mesaĝvicoj";
 $a->strings["Administration"] = "Administrado";
 $a->strings["Summary"] = "Resumo";
 $a->strings["Registered users"] = "Registrataj uzantoj";
@@ -825,30 +830,21 @@ $a->strings["{0} tagged %s's post with #%s"] = "{0} markis la afiŝon de %s kun
 $a->strings["{0} mentioned you in a post"] = "{0} menciis vin en afiŝo";
 $a->strings["Contacts who are not members of a group"] = "Kontaktoj kiuj ne estas en iu grupo";
 $a->strings["OpenID protocol error. No ID returned."] = "Eraro en OpenID protokolo. Ne resendis identecon.";
-$a->strings["Account not found and OpenID registration is not permitted on this site."] = "Ne trovis kontoj, kaj registrado tra OpenID estas malpermesita ĉi tie.";
+$a->strings["Account not found and OpenID registration is not permitted on this site."] = "Ne trovis kontoj, kaj registrado per OpenID estas malpermesita ĉi tie.";
 $a->strings["Login failed."] = "Ensalutado malsukcesis.";
-$a->strings["Connect URL missing."] = "Ne ekzistas URL adreso por konekti.";
-$a->strings["This site is not configured to allow communications with other networks."] = "Tiu retpaĝo ne permesas komunikadon kun aliaj retoj.";
-$a->strings["No compatible communication protocols or feeds were discovered."] = "Ne malkovris kongruajn protokolojn por komunikado aŭ fluojn.";
-$a->strings["The profile address specified does not provide adequate information."] = "La specifita profiladreso ne enhavas sufiĉe da informoj.";
-$a->strings["An author or name was not found."] = "Ne trovis aŭtoron aŭ nomon.";
-$a->strings["No browser URL could be matched to this address."] = "Neniu retuma URL adreso kongruas al la adreso.";
-$a->strings["Unable to match @-style Identity Address with a known protocol or email contact."] = "Ne eblas kongrui @-stilan identecon adreson al iu konata protokolo au retpoŝtadreso.";
-$a->strings["Use mailto: in front of address to force email check."] = "Uzu mailto: antaŭ la adreso por devigi la testadon per retpoŝto.";
-$a->strings["The profile address specified belongs to a network which has been disabled on this site."] = "Tiu profila adreso apartenas al retejo kiu estas maŝaltita je ĉi tiu retejo.";
-$a->strings["Limited profile. This person will be unable to receive direct/personal notifications from you."] = "Profilo limigata. Ĉi persono ne eblos ricevi rektajn/personajn atentigojn de vi. ";
-$a->strings["Unable to retrieve contact information."] = "Ne eblas ricevi kontaktinformojn.";
-$a->strings["following"] = "sekvanta";
+$a->strings["Contact added"] = "Aldonis kontakton";
 $a->strings["Common Friends"] = "Komunaj Amikoj";
 $a->strings["No contacts in common."] = "Neniom da komunaj kontaktoj.";
 $a->strings["Item has been removed."] = "Elemento estas forviŝita.";
 $a->strings["Applications"] = "Programoj";
 $a->strings["No installed applications."] = "Neniom da instalitaj programoj.";
-$a->strings["Search This Site"] = "Serĉi ĉi-tiun retejon";
+$a->strings["Search"] = "Serĉi";
 $a->strings["Profile not found."] = "Profilo ne trovita.";
 $a->strings["Profile Name is required."] = "Nomo de profilo estas bezonata.";
 $a->strings["Marital Status"] = "Amrilata Stato";
 $a->strings["Romantic Partner"] = "Kora Partnero";
+$a->strings["Likes"] = "Ŝatoj";
+$a->strings["Dislikes"] = "Malŝatoj";
 $a->strings["Work/Employment"] = "Laboro";
 $a->strings["Religion"] = "Religio";
 $a->strings["Political Views"] = "Politikaj Opinioj";
@@ -856,11 +852,13 @@ $a->strings["Gender"] = "Sekso";
 $a->strings["Sexual Preference"] = "Seksa Prefero";
 $a->strings["Homepage"] = "Hejmpaĝo";
 $a->strings["Interests"] = "Interesoj";
+$a->strings["Address"] = "Adreso";
 $a->strings["Location"] = "Loko";
 $a->strings["Profile updated."] = "Profilo ĝisdatigita.";
 $a->strings[" and "] = " kaj ";
 $a->strings["public profile"] = "publika profilo";
 $a->strings["%1\$s changed %2\$s to &ldquo;%3\$s&rdquo;"] = "%1\$s ŝanĝis %2\$s al &ldquo;%3\$s&rdquo;";
+$a->strings[" - Visit %1\$s's %2\$s"] = " - Vizitu la %2\$s de %1\$s";
 $a->strings["%1\$s has an updated %2\$s, changing %3\$s."] = "%1\$s havas ĝisdatigigan %2\$s, ŝanĝas %3\$s.";
 $a->strings["Profile deleted."] = "Profilo forviŝita.";
 $a->strings["Profile-"] = "Profilo-";
@@ -885,12 +883,16 @@ $a->strings["Region/State:"] = "Ŝtato:";
 $a->strings["<span class=\"heart\">&hearts;</span> Marital Status:"] = "<span class=\"heart\">&hearts;</span> Civita Stato:";
 $a->strings["Who: (if applicable)"] = "Kiu (se aplikeble):";
 $a->strings["Examples: cathy123, Cathy Williams, cathy@example.com"] = "Ekzemploj: cathy123, Cathy Williams, cathy@example.com";
+$a->strings["Since [date]:"] = "Ekde [dato]:";
 $a->strings["Sexual Preference:"] = "Seksa Prefero:";
 $a->strings["Homepage URL:"] = "Adreso de Hejmpaĝo:";
+$a->strings["Hometown:"] = "Hejmurbo:";
 $a->strings["Political Views:"] = "Politikaj Opinioj:";
 $a->strings["Religious Views:"] = "Religiaj Opinioj:";
 $a->strings["Public Keywords:"] = "Publikaj ŝlosilvortoj:";
 $a->strings["Private Keywords:"] = "Privataj ŝlosilvortoj:";
+$a->strings["Likes:"] = "Ŝatoj:";
+$a->strings["Dislikes:"] = "Malŝatoj:";
 $a->strings["Example: fishing photography software"] = "Ekzemple: fiŝkapti fotografio programaro";
 $a->strings["(Used for suggesting potential friends, can be seen by others)"] = "(Por sugesti amikoj. Videbla al aliaj.)";
 $a->strings["(Used for searching profiles, never shown to others)"] = "(Por serĉi profilojn. Neniam videbla al aliaj.)";
@@ -926,7 +928,6 @@ $a->strings["No entries."] = "Neniom da afiŝoj.";
 $a->strings["Friend Suggestions"] = "Amikosugestoj";
 $a->strings["No suggestions available. If this is a new site, please try again in 24 hours."] = "Neniu sugestoj disponeblas. Se ĉi tiu estas nova retejo, bonvolu reprovi post 24 horoj.";
 $a->strings["Ignore/Hide"] = "Ignori/Kaŝi";
-$a->strings["%s [%s]"] = "%s [%s]";
 $a->strings["Global Directory"] = "Tutmonda Katalogo";
 $a->strings["Find on this site"] = "Trovi en ĉi retejo";
 $a->strings["Site Directory"] = "Reteja Katalogo";
@@ -948,7 +949,7 @@ $a->strings["Send invitations"] = "Sendi invitojn";
 $a->strings["Enter email addresses, one per line:"] = "Entajpu retpoŝtadresojn, po unu por ĉiu linio.";
 $a->strings["You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web."] = "Ni bonkore invitas vin aliĝi kun ni kaj aliaj bonaj amikoj ĉe Friendica. Helpu nin krei pli bonan interkonan reton.";
 $a->strings["You will need to supply this invitation code: \$invite_code"] = "Vi bezonas ĉi-tiun invitkodon: \$invite_code";
-$a->strings["Once you have registered, please connect with me via my profile page at:"] = "Kiam vi registris, bonvolu konekti al mi tra mi profilo ĉe: ";
+$a->strings["Once you have registered, please connect with me via my profile page at:"] = "Kiam vi registris, bonvolu konekti al mi pere de mi profilo ĉe: ";
 $a->strings["For more information about the Friendica project and why we feel it is important, please visit http://friendica.com"] = "Por pli da informoj pri Friendica, kaj kial ni pensas ke ĝi estas grava, bonvolu viziti http://friendica.com";
 $a->strings["This may occasionally happen if contact was requested by both persons and it has already been approved."] = "Tio ĉi okazis de tempo al tempo se ambaŭ personoj petas kontakton ka ĝi jam estas aprobita.";
 $a->strings["Response from remote site was not understood."] = "Ne komprenis la rispondon de la fora retejo.";
@@ -969,6 +970,10 @@ $a->strings["Unable to set your contact credentials on our system."] = "Ne sukce
 $a->strings["Unable to update your contact profile details on our system"] = "Neeblas ĝisdatigi viajn profildetalojn ĉe nia sistemo.";
 $a->strings["Connection accepted at %s"] = "Konekto akceptita je %s";
 $a->strings["%1\$s has joined %2\$s"] = "%1\$s aliĝis al %2\$s";
+$a->strings["Google+ Import Settings"] = "Google+ Importo";
+$a->strings["Enable Google+ Import"] = "Aktivigi Ĝoogle+ Importon";
+$a->strings["Google Account ID"] = "Google Konto ID";
+$a->strings["Google+ Import Settings saved."] = "Konservis Agordojn por Google+ Importo.";
 $a->strings["Facebook disabled"] = "Facebook malŝaltita";
 $a->strings["Updating contacts"] = "Mi ĝisdatigas la kontaktojn.";
 $a->strings["Facebook API key is missing."] = "La API ŝlosilo de Facebook ne estas konata ĉi tie.";
@@ -991,7 +996,7 @@ $a->strings["Problems with Facebook Real-Time Updates"] = "Problemoj kun Faceboo
 $a->strings["Facebook"] = "Facebook";
 $a->strings["Facebook Connector Settings"] = "Agordoj por la Facebook konektilo";
 $a->strings["Facebook API Key"] = "Facebook API ŝlosilo";
-$a->strings["Error: it appears that you have specified the App-ID and -Secret in your .htconfig.php file. As long as they are specified there, they cannot be set using this form.<br><br>"] = "Eraro: Ŝajnas kvazaŭ vi agordis la App-ID kaj la sekreton en via .htconfig.php dosiero. Kiam ili estas agordita tie, vi ne povas agordi ĝin tra tiu ĉi formo.<br><br>";
+$a->strings["Error: it appears that you have specified the App-ID and -Secret in your .htconfig.php file. As long as they are specified there, they cannot be set using this form.<br><br>"] = "Eraro: Ŝajnas kvazaŭ vi agordis la App-ID kaj la sekreton en via .htconfig.php dosiero. Kiam ili estas agordita tie, vi ne povas agordi ĝin en tiu ĉi formo.<br><br>";
 $a->strings["Error: the given API Key seems to be incorrect (the application access token could not be retrieved)."] = "Eraro: La API ŝlosilo aspektas malĝusta (ne eblas ricevi la programa atingoĵetono).";
 $a->strings["The given API Key seems to work correctly."] = "La API ŝlosilo ŝajne ĝuste funkcias.";
 $a->strings["The correctness of the API Key could not be detected. Somthing strange's going on."] = "Ne povis kontroli la ĝustecon de la API ŝlosilo. Ia stranga afero okazas. ";
@@ -1012,6 +1017,9 @@ $a->strings["Facebook post failed. Queued for retry."] = "Malsukcesis afiŝi ĉe
 $a->strings["Your Facebook connection became invalid. Please Re-authenticate."] = "Via Facbook konekto iĝis nevalida. Bonvolu reaŭtentiĝi.";
 $a->strings["Facebook connection became invalid"] = "Facebook konekto iĝis nevalida.";
 $a->strings["Hi %1\$s,\n\nThe connection between your accounts on %2\$s and Facebook became invalid. This usually happens after you change your Facebook-password. To enable the connection again, you have to %3\$sre-authenticate the Facebook-connector%4\$s."] = "Saluton %1\$s,\n\nla kontekto inter viaj kontoj ĉe %2\$s kaj Facebook malvalidiĝis. Tio kutime okazas post kiam via ŝangas vian pasvorton ĉe Facebook. Por reaktivigi la konekto, vi bezonas %3\$sreaŭtentiĝi la Facebook konektilon%4\$s.";
+$a->strings["StatusNet AutoFollow settings updated."] = "Ĝidatigis StatusNet AutoFollow agordojn.";
+$a->strings["StatusNet AutoFollow Settings"] = "StatusNet AutoFollow agordoj";
+$a->strings["Automatically follow any StatusNet followers/mentioners"] = "Aŭtomate sekvu ĉiujn StatusNet sekvantojn/menciantojn.";
 $a->strings["Lifetime of the cache (in hours)"] = "Vivodaŭro de kaŝmemoro (horoj)";
 $a->strings["Cache Statistics"] = "Statistikoj pri kaŝmemoro";
 $a->strings["Number of items"] = "Kvanto da eroj";
@@ -1051,6 +1059,12 @@ $a->strings["NSFW Settings saved."] = "NSFW agordoj konservitaj.";
 $a->strings["%s - Click to open/close"] = "%s - Klaku por malfermi/fermi";
 $a->strings["Forums"] = "Forumoj";
 $a->strings["show more"] = "montri pli";
+$a->strings["Forums:"] = "Forumoj:";
+$a->strings["Page settings updated."] = "Paĝajn agordojn ĝisdatigita.";
+$a->strings["Page Settings"] = "Paĝaj Agordoj";
+$a->strings["How many forums to display on sidebar without paging"] = "Montri tiom da forumoj en la flanka strio sen paĝigo";
+$a->strings["Randomise Page/Forum list"] = "Hazardigi la liston de Paĝoj/Forumoj";
+$a->strings["Show pages/forums on profile page"] = "Montri paĝojn/forumojn sur la profilpaĝo";
 $a->strings["Planets Settings"] = "Agordo pri Planets";
 $a->strings["Enable Planets Plugin"] = "Ŝalti la Planets kromprogamon";
 $a->strings["Login"] = "Ensaluti";
@@ -1060,6 +1074,54 @@ $a->strings["Most active users"] = "Plej aktivaj uzantoj";
 $a->strings["Latest photos"] = "Ĵusaj bildoj";
 $a->strings["Latest likes"] = "Ĵusaj ŝatitaĵoj";
 $a->strings["event"] = "okazo";
+$a->strings["U.S. Time Format (mm/dd/YYYY)"] = "Usona datformato (mm/dd/YYYY)";
+$a->strings["German Time Format (dd.mm.YYYY)"] = "Germana datformato (dd.mm.YYYY)";
+$a->strings["Error"] = "Eraro";
+$a->strings["No access"] = "No access";
+$a->strings["New event"] = "Nova okazo";
+$a->strings["Today"] = "Hodiaŭ";
+$a->strings["Day"] = "Tago";
+$a->strings["Week"] = "Semajno";
+$a->strings["Month"] = "Monato";
+$a->strings["Reload"] = "Reŝargi";
+$a->strings["Date"] = "Dato";
+$a->strings["Not found"] = "Ne trovita";
+$a->strings["Go back to the calendar"] = "Iri reen al la kalendaro";
+$a->strings["Starts"] = "Komencas";
+$a->strings["Ends"] = "Finas";
+$a->strings["Description"] = "Priskribo";
+$a->strings["Notification"] = "Atentigo";
+$a->strings["Minutes"] = "Minutoj";
+$a->strings["Hours"] = "Horoj";
+$a->strings["Days"] = "Tagoj";
+$a->strings["before"] = "antaŭ";
+$a->strings["Calendar Settings"] = "Kalendaraj Agordoj";
+$a->strings["Date format"] = "Datformato";
+$a->strings["Time zone"] = "Horzono";
+$a->strings["Limitations"] = "Limigoj";
+$a->strings["Warning"] = "Averto";
+$a->strings["Synchronization (iPhone, Thunderbird Lightning, Android, ...)"] = "Sinkronigo (iPhone, Thunderbird Lightning, Android, ...)";
+$a->strings["Synchronizing this calendar with the iPhone"] = "Sinkronigi tiun kalendaron kun la iPhone";
+$a->strings["Synchronizing your Friendica-Contacts with the iPhone"] = "Sinkronigi viajn Friendica kontaktojn kun la iPhone";
+$a->strings["Friendica-Contacts"] = "Friendica Kontaktoj";
+$a->strings["Your Friendica-Contacts"] = "Viaj Friendica Kontaktoj";
+$a->strings["Calendar"] = "Kalendaro";
+$a->strings["Extended calendar with CalDAV-support"] = "Etendita kalendaro kun CalDAV subteno";
+$a->strings["The database tables have been installed."] = "La tabeloj estas instalita en la datumbazo";
+$a->strings["An error occurred during the installation."] = "Eraro okazis dum instalado";
+$a->strings["No system-wide settings yet."] = "Ankoraŭ ne disponablas tutsistemaj agordoj";
+$a->strings["Database status"] = "Stato de datumbazo";
+$a->strings["Installed"] = "Instalita";
+$a->strings["Upgrade needed"] = "Ĝisdatigo bezonata";
+$a->strings["Upgrade"] = "Ĝisdatigo";
+$a->strings["Not installed"] = "Ne instalita";
+$a->strings["Install"] = "Instali";
+$a->strings["Troubleshooting"] = "Problemsolvado";
+$a->strings["Manual creation of the database tables:"] = "Mana kreado de tabeloj en la datumbazo:";
+$a->strings["Show SQL-statements"] = "Montru SQL ordonojn";
+$a->strings["Private Calendar"] = "Privata kalendaro";
+$a->strings["Friendica Events: Mine"] = "Friendica Okazoj: Miaj";
+$a->strings["Friendica Events: Contacts"] = "Friendica Okazoj: De Kontaktoj";
 $a->strings["Allow to use your friendica id (%s) to connecto to external unhosted-enabled storage (like ownCloud). See <a href=\"http://www.w3.org/community/unhosted/wiki/RemoteStorage#WebFinger\">RemoteStorage WebFinger</a>"] = "Permesi vian identecon ĉe Friendica (%s) por konekti al eksteraj konservejoj subtenata de unhosted (ekz. OwnCloud). Vidu <a href=\"http://www.w3.org/community/unhosted/wiki/RemoteStorage#WebFinger\">RemoteStorage WebFinger</a>";
 $a->strings["Template URL (with {category})"] = "URL adreso de ŝablono (kun {category})";
 $a->strings["OAuth end-point"] = "OAuth finpunkto";
@@ -1095,9 +1157,15 @@ $a->strings["Drupal site URL"] = "URL adreso de Drupal retejo";
 $a->strings["Drupal site uses clean URLS"] = "Drupal retejo uzas purajn URL adresojn";
 $a->strings["Post to Drupal by default"] = "Defaŭlte afiŝi ĉe Drupal";
 $a->strings["Post from Friendica"] = "Afiŝo de Friendica";
+$a->strings["Startpage Settings"] = "Startpaĝaj Agordoj";
+$a->strings["Home page to load after login  - leave blank for profile wall"] = "Hejmpaĝo ŝargonta post la ensaluto   - Lasu malplena por profilmuro.";
+$a->strings["Examples: &quot;network&quot; or &quot;notifications/system&quot;"] = "Ekzemple: &quot;network&quot; aŭ &quot;notifications/system&quot;";
 $a->strings["Geonames settings updated."] = "Ĝidatigis la Geonames agordojn.";
 $a->strings["Geonames Settings"] = "Geonames Agordoj";
 $a->strings["Enable Geonames Plugin"] = "Ŝalti la Geonames Kromprogramon";
+$a->strings["Your account on %s will expire in a few days."] = "Via konto ĉe %s senvalidiĝos post kelkaj tagoj.";
+$a->strings["Your Friendica account is about to expire."] = "Via konto ĉe Friendica baldaŭ senvalidiĝos.";
+$a->strings["Hi %1\$s,\n\nYour account on %2\$s will expire in less than five days. You may keep your account by logging in at least once every 30 days"] = "Saluton %1\$s,\n\nVia konto ĉe %2\$s senvalidiĝos post malpli ol kvin tagoj. Vi povas konservi vian konton se vi ensalutas almenaŭ ĉiujn 30 tagojn. ";
 $a->strings["Upload a file"] = "Alŝuti dosieron";
 $a->strings["Drop files here to upload"] = "Ŝovmeti dosierojn ĉi tie por alŝuti ilin.";
 $a->strings["Failed"] = "Malsukcesi";
@@ -1119,10 +1187,13 @@ $a->strings["Profile address of the operator."] = "La profilo de la funkciigisto
 $a->strings["How to contact the operator via snail mail. You can use BBCode here."] = "Kiel poŝte kontakti la funkciigisto de la retejo. Vi eblas uzi BBCode ĉi tie.";
 $a->strings["Notes"] = "Notoj";
 $a->strings["Additional notes that are displayed beneath the contact information. You can use BBCode here."] = "Pli da notoj kiuj aperas sub la kontaktinformoj. Vi eblas uzi BBCode ĉi tie.";
-$a->strings["How to contact the operator via email. (will be displayed obfuscated)"] = "Kiel kontakti la funkciigiston de la retejo tra retpoŝto. (montriĝos vuale) ";
+$a->strings["How to contact the operator via email. (will be displayed obfuscated)"] = "Kiel kontakti la funkciigiston de la retejo per retpoŝto. (montriĝos vuale) ";
 $a->strings["Footer note"] = "Paĝpiednoto";
 $a->strings["Text for the footer. You can use BBCode here."] = "Teksto por la paĝpiedo. Vie eblas uzi BBCode ĉi tie.";
 $a->strings["Report Bug"] = "Skribi cimraporton";
+$a->strings["No Timeline settings updated."] = "No Timeline agordojn ĝisdatigita.";
+$a->strings["No Timeline Settings"] = "No Timeline Agordoj";
+$a->strings["Disable Archive selector on profile wall"] = "Malaktivigi la Arkivo elektilo sur la profilmuro";
 $a->strings["\"Blockem\" Settings"] = "\"Blockem\" Agordoj";
 $a->strings["Comma separated profile URLS to block"] = "Blokotaj URL adresoj, disigita per komo";
 $a->strings["BLOCKEM Settings saved."] = "Konservis Agordojn de BLOCKEM.";
@@ -1141,6 +1212,12 @@ $a->strings["Tile Server URL"] = "Adreso de Kahelservilo";
 $a->strings["A list of <a href=\"http://wiki.openstreetmap.org/wiki/TMS\" target=\"_blank\">public tile servers</a>"] = "Listo de <a href=\"http://wiki.openstreetmap.org/wiki/TMS\" target=\"_blank\">publikaj kahelserviloj</a>";
 $a->strings["Default zoom"] = "Defaŭlta zoma faktoro";
 $a->strings["The default zoom level. (1:world, 18:highest)"] = "La defaŭlta zoma faktoro. (1:tutmonda, 18:plej proksima)";
+$a->strings["Post to libertree"] = "Afiŝi al libertree";
+$a->strings["libertree Post Settings"] = "Agordoj por Afiŝoj ĉe libertree";
+$a->strings["Enable Libertree Post Plugin"] = "Aktivigi Kromprogramon por Afiŝoj ĉe libertree";
+$a->strings["Libertree API token"] = "Libertree API ĵetono";
+$a->strings["Libertree site URL"] = "URL adreso de libertree retejo:";
+$a->strings["Post to Libertree by default"] = "Defaŭlte afiŝi ĉe Libertree";
 $a->strings["The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail."] = "La Mathjax kromprogramo bildigas matematikajn formulojn skribitajn en la LaTeX sintakso, cirkaŭigita de la komuna $$ aŭ eqnarray bloko en afiŝoj ĉe via muro, Reto folio kaj privataj mesaĝoj.";
 $a->strings["Use the MathJax renderer"] = "Ĉu uzi la Mathjax bildigilo";
 $a->strings["MathJax Base URL"] = "Mathjax Baza URL Adreso";
@@ -1158,7 +1235,6 @@ $a->strings["Select default avatar image if none was found at Gravatar. See READ
 $a->strings["Rating of images"] = "Pritakso de bildoj";
 $a->strings["Select the appropriate avatar rating for your site. See README"] = "Elektu la ĝustan pritakson de via avataro por via retejo. Vidu README.";
 $a->strings["Gravatar settings updated."] = "Gravatar agordoj ĝisdatigitaj.";
-$a->strings["Your account on %s will expire in a few days."] = "Via konto ĉe %s senvalidiĝos post kelkaj tagoj.";
 $a->strings["Your Friendica test account is about to expire."] = "Via Friendica provkonto baldaŭ malaktiviĝos.";
 $a->strings["Hi %1\$s,\n\nYour test account on %2\$s will expire in less than five days. We hope you enjoyed this test drive and use this opportunity to find a permanent Friendica website for your integrated social communications. A list of public sites is available at http://dir.friendica.com/siteinfo - and for more information on setting up your own Friendica server please see the Friendica project website at http://friendica.com."] = "Saluton %1\$s,\n\nVia testkonto ĉe %2\$s senvalidiĝos post malpli ol kvin tagoj. Vi esperas ke vi ĝuis la teston kaj baldaŭ trovosĝustan Friendica retejon por via integrita sociala komunikado. Listo de publikaj retejoj troviĝas ĉe http://dir.friendica.com/siteinfo - kaj por pli da informoj pri kiel instali vian propran Friendica servilon, bonvolu viziti la retejon de la Friendica projekton ĉe http://friendica.com.";
 $a->strings["\"pageheader\" Settings"] = "\"pageheader\" Agordoj";
@@ -1193,9 +1269,10 @@ $a->strings["If enabled all your <strong>public</strong> postings can be posted
 $a->strings["<strong>Note</strong>: Due your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to StatusNet will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted."] = "<strong>Averto</strong>: Laŭ viaj privatecaj agordoj (<em>Kaŝi viajn profilajn detalojn al nekonataj spektantoj?</em>), la ligilo en publikaj afiŝoj plusendata al StatusNet gvidas vizitontojn al malplena paĝo sciigante ilin ke atingo al via profilo estas lmitigita.";
 $a->strings["Allow posting to StatusNet"] = "Permesi afiŝojn al StatusNet";
 $a->strings["Send public postings to StatusNet by default"] = "Defaŭlte sendi publikajn afiŝojn al StatusNet";
-$a->strings["Send #tag links to StatusNet"] = "Sendu #marko ligilojn al StatusNet";
+$a->strings["Send linked #-tags and @-names to StatusNet"] = "Sendi ligitajn #-etikedojn kaj @-nomon al StatusNet";
 $a->strings["Clear OAuth configuration"] = "Forviŝi OAuth agordojn";
 $a->strings["API URL"] = "API URL adreso";
+$a->strings["Infinite Improbability Drive"] = "Senfina Probableca Pelilo";
 $a->strings["Post to Tumblr"] = "Afiŝi al Tumblr";
 $a->strings["Tumblr Post Settings"] = "Agordoj pri afiŝoj ĉe Tumblr";
 $a->strings["Enable Tumblr Post Plugin"] = "Ŝalti la kromprogramon por Tumblr afiŝoj";
@@ -1217,6 +1294,8 @@ $a->strings["WordPress username"] = "WordPress salutnomo";
 $a->strings["WordPress password"] = "WordPress pasvorto";
 $a->strings["WordPress API URL"] = "Wordpress API URL adreso";
 $a->strings["Post to WordPress by default"] = "Defaŭlte afiŝi al WordPress";
+$a->strings["Provide a backlink to the Friendica post"] = "Provizi re-ligilon al la Friendica afiŝo";
+$a->strings["Read the original post and comment stream on Friendica"] = "Legi la originalan afiŝon kaj komentfluo ĉe Friendica";
 $a->strings["\"Show more\" Settings"] = "\"Montri pli\" agordoj";
 $a->strings["Enable Show More"] = "Ŝalti \"montri pli\"";
 $a->strings["Cutting posts after how much characters"] = "Limitigi afiŝojn al kiom da literoj";
@@ -1239,7 +1318,7 @@ $a->strings["If enabled all your <strong>public</strong> postings can be posted
 $a->strings["<strong>Note</strong>: Due your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to Twitter will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted."] = "<strong>Averto</strong>: Laŭ viaj privatecaj agordoj (<em>Kaŝi viajn profilajn detalojn al nekonataj spektantoj?</em>), la ligilo en publikaj afiŝoj plusendata al Twitter gvidas vizitontojn al malplena paĝo sciigante ilin ke atingo al via profilo estas lmitigita.";
 $a->strings["Allow posting to Twitter"] = "Permesi afiŝojn al Twitter";
 $a->strings["Send public postings to Twitter by default"] = "Defaŭlte sendi publikajn afiŝojn al Twitter";
-$a->strings["Send #tag links to Twitter"] = "Sendu #marko ligilon al Twitter";
+$a->strings["Send linked #-tags and @-names to Twitter"] = "Sendi ligitajn #-etikedojn kaj @-nomon al Twitter";
 $a->strings["Consumer key"] = "Ŝlosilo de Kliento";
 $a->strings["Consumer secret"] = "Sekreto de Kliento";
 $a->strings["IRC Settings"] = "IRC Agordoj";
@@ -1285,19 +1364,21 @@ $a->strings["Local Directory"] = "Loka Katalogo";
 $a->strings["Similar Interests"] = "Similaj Interesoj";
 $a->strings["Invite Friends"] = "Inviti amikojn";
 $a->strings["Earth Layers"] = "Tertavoloj (Earth Layers)";
-$a->strings["Set zoomfactor for Earth Layer"] = "Agordi zoman faktoron de Tertavolo";
-$a->strings["Set longitude (X) for Earth Layer"] = "Agordi longitudon (X) de Tertavolo";
-$a->strings["Set latitude (Y) for Earth Layer"] = "Agordi latitudon (Y) de Tertavolo";
+$a->strings["Set zoomfactor for Earth Layers"] = "Agordi zoman faktoron por Tertavoloj";
+$a->strings["Set longitude (X) for Earth Layers"] = "Agordi longitudon (X) por Tertavoloj";
+$a->strings["Set latitude (Y) for Earth Layers"] = "Agordi latitudon (Y) por Tertavoloj";
 $a->strings["Help or @NewHere ?"] = "Helpu aŭ @NewHere ?";
 $a->strings["Connect Services"] = "Konekti Servojn";
 $a->strings["Last Tweets"] = "Ĵusaj Pepaĵoj";
 $a->strings["Set twitter search term"] = "Agordi Twitter serĉtekston";
 $a->strings["don't show"] = "kaŝi";
 $a->strings["show"] = "montri";
-$a->strings["Show/hide boxes at right-hand coloumn:"] = "Montri/kaŝi kestojn en la desktra kolumno:";
+$a->strings["Show/hide boxes at right-hand column:"] = "Kaŝi/montri kestojn ĉe dekstra kolumno:";
 $a->strings["Set line-height for posts and comments"] = "Agordi la linigrandon por afiŝoj kaj komentoj";
 $a->strings["Set resolution for middle column"] = "Agordi la distingivon por la meza kolumno";
 $a->strings["Set color scheme"] = "Agordi Kolorskemon";
+$a->strings["Set zoomfactor for Earth Layer"] = "Agordi zoman faktoron de Tertavolo";
+$a->strings["Last tweets"] = "Ĵusaj pepaĵoj";
 $a->strings["Alignment"] = "Ĝisrandigo";
 $a->strings["Left"] = "Maldekstren";
 $a->strings["Center"] = "Centren";
@@ -1308,6 +1389,7 @@ $a->strings["j F"] = "j F";
 $a->strings["Birthday:"] = "Naskiĝtago:";
 $a->strings["Age:"] = "Aĝo:";
 $a->strings["Status:"] = "Stato:";
+$a->strings["for %1\$d %2\$s"] = "por %1\$d %2\$s";
 $a->strings["Homepage:"] = "Hejmpaĝo:";
 $a->strings["Tags:"] = "Markoj:";
 $a->strings["Religion:"] = "Religio:";
@@ -1401,6 +1483,7 @@ $a->strings["Starts:"] = "Ekas:";
 $a->strings["Finishes:"] = "Finas:";
 $a->strings["(no subject)"] = "(neniu temo)";
 $a->strings["noreply"] = "nerespondi";
+$a->strings[" on Last.fm"] = " ĉe Last.fm";
 $a->strings["prev"] = "antaŭa";
 $a->strings["first"] = "unua";
 $a->strings["last"] = "lasta";
@@ -1410,7 +1493,6 @@ $a->strings["%d Contact"] = array(
        0 => "%d Kontakto",
        1 => "%d Kontaktoj",
 );
-$a->strings["Search"] = "Serĉi";
 $a->strings["Monday"] = "Lundo";
 $a->strings["Tuesday"] = "Mardo";
 $a->strings["Wednesday"] = "Merkredo";
@@ -1444,11 +1526,11 @@ $a->strings["post"] = "afiŝo";
 $a->strings["Item filed"] = "Enarkivigis elementon ";
 $a->strings["Sharing notification from Diaspora network"] = "Antentigo pri kunhavigado de la Diaspora reto";
 $a->strings["Attachments:"] = "Kunsendaĵoj:";
-$a->strings["[Relayed] Comment authored by %s from network %s"] = "[Plusendita] %s en la reto %s skribis komenton";
 $a->strings["view full size"] = "vidi plengrande";
 $a->strings["Embedded content"] = "Enigita enhavo";
 $a->strings["Embedding disabled"] = "Malŝaltita enigitado";
 $a->strings["A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name."] = "Revivigis malnovan grupon kun la sama nomo. Permesoj por estantaj elementoj <strong>eble</strong> estas validaj por la grupo kaj estontaj membroj. Se tiu ne estas kiun vi atendis, bonvolu krei alian grupon kun alia nomo.";
+$a->strings["Default privacy group for new contacts"] = "Defaŭlta privateca grupo por novaj kontaktoj";
 $a->strings["Everybody"] = "Ĉiuj";
 $a->strings["edit"] = "redakti";
 $a->strings["Groups"] = "Grupoj";
@@ -1480,7 +1562,6 @@ $a->strings["Manage other pages"] = "Administri aliajn paĝojn";
 $a->strings["Profiles"] = "Profiloj";
 $a->strings["Manage/edit profiles"] = "Administri/redakti profilojn";
 $a->strings["Manage/edit friends and contacts"] = "Administri/redakti amikojn kaj kontaktojn";
-$a->strings["Admin"] = "Administrado";
 $a->strings["Site setup and configuration"] = "Agordoj pri la retejo";
 $a->strings["Nothing new here"] = "Estas neniu nova ĉi tie";
 $a->strings["Add New Contact"] = "Aldonu Novan Kontakton";
@@ -1521,6 +1602,8 @@ $a->strings["minutes"] = "minutoj";
 $a->strings["second"] = "sekundo";
 $a->strings["seconds"] = "sekundoj";
 $a->strings["%1\$d %2\$s ago"] = "antaŭ %1\$d %2\$s";
+$a->strings["%s's birthday"] = "Naskiĝtago de %s";
+$a->strings["Happy Birthday %s"] = "Feliĉan Naskiĝtagon al %s";
 $a->strings["From: "] = "De: ";
 $a->strings["$1 wrote:"] = "$1 skribis:";
 $a->strings["Image/photo"] = "Bildo";
@@ -1532,45 +1615,67 @@ $a->strings["Thank You,"] = "Dankon,";
 $a->strings["%s Administrator"] = "%s Administranto";
 $a->strings["%s <!item_type!>"] = "%s <!item_type!>";
 $a->strings["[Friendica:Notify] New mail received at %s"] = "[Friendica:Atentigo] Ricevis novan retpoŝton ĉe %s";
-$a->strings["%s sent you a new private message at %s."] = "%s sendis novan mesaĝon al vi ĉe %s.";
-$a->strings["%s sent you %s."] = "%s sendis al vi %s.";
+$a->strings["%1\$s sent you a new private message at %2\$s."] = "%1\$s sendis al vi novan privatan mesaĝon ĉe %2\$s.";
+$a->strings["%1\$s sent you %2\$s."] = "%1\$s sendis al vi %2\$s.";
 $a->strings["a private message"] = "privatan mesaĝon";
 $a->strings["Please visit %s to view and/or reply to your private messages."] = "Bonvolu viziti %s por vidi aŭ respondi viajn privatajn mesaĝojn.";
-$a->strings["%s's"] = "de %s verkita";
-$a->strings["your"] = "via";
-$a->strings["[Friendica:Notify] Comment to conversation #%d by %s"] = "[Friendica:Atentigo] Komento pri konversacio #%d de %s";
+$a->strings["%1\$s commented on [url=%2\$s]a %3\$s[/url]"] = "%1\$s komentis pri [url=%2\$s]%3\$s[/url]";
+$a->strings["%1\$s commented on [url=%2\$s]%3\$s's %4\$s[/url]"] = "%1\$s komentis pri [url=%2\$s]%4\$s de %3\$s[/url]";
+$a->strings["%1\$s commented on [url=%2\$s]your %3\$s[/url]"] = "%1\$s komentis pri [url=%2\$s]via %3\$s[/url]";
+$a->strings["[Friendica:Notify] Comment to conversation #%1\$d by %2\$s"] = "[Friendica:Atentigo] Komento pri konversacio #%1\$d de %2\$s";
 $a->strings["%s commented on an item/conversation you have been following."] = "%s komentis pri elemento/konversacio kiun vi sekvas.";
-$a->strings["%s commented on %s."] = "%s komentis pri %s.";
 $a->strings["Please visit %s to view and/or reply to the conversation."] = "Bonvolu viziti %s por vidi aŭ respondi la konversacion.";
 $a->strings["[Friendica:Notify] %s posted to your profile wall"] = "[Friendica:Atentigo] %s afiŝis al via profilmuro";
-$a->strings["%s posted to your profile wall at %s"] = "%s skribis al via profila muro ĉe %s";
-$a->strings["%s posted to %s"] = "%s afiŝis al %s";
-$a->strings["your profile wall."] = "via profilmuro.";
+$a->strings["%1\$s posted to your profile wall at %2\$s"] = "%1\$s skribis al via profilmuro ĉe %2\$s";
+$a->strings["%1\$s posted to [url=%2s]your wall[/url]"] = "%1\$s afiŝis al [url=%2s]via muro[/url]";
 $a->strings["[Friendica:Notify] %s tagged you"] = "[Friendica:Atentigo] %s markis vin";
-$a->strings["%s tagged you at %s"] = "%s markis vin kiel %s";
-$a->strings["%s %s."] = "%s %s.";
-$a->strings["tagged you"] = "markis vin";
+$a->strings["%1\$s tagged you at %2\$s"] = "%1\$s markis vin ĉe %2\$s";
+$a->strings["%1\$s [url=%2\$s]tagged you[/url]."] = "%1\$s [url=%2\$s]markis vin[/url].";
 $a->strings["[Friendica:Notify] %s tagged your post"] = "[Friendica:Atentigo] %s markis vian afiŝon";
-$a->strings["%s tagged your post at %s"] = "%s markis vian afiŝon kiel %s";
-$a->strings["%s tagged %s"] = "%s markis %s";
-$a->strings["your post"] = "vian afiŝon";
+$a->strings["%1\$s tagged your post at %2\$s"] = "%1\$s markis vian afiŝon ĉe %2\$s";
+$a->strings["%1\$s tagged [url=%2\$s]your post[/url]"] = "%1\$s markis [url=%2\$s]vian afiŝon[/url]";
 $a->strings["[Friendica:Notify] Introduction received"] = "[Friendica:Atentigo] Ricevis prezenton";
-$a->strings["You've received an introduction from '%s' at %s"] = "Vi ricevis prezento de '%s' ĉe %s";
-$a->strings["You've received %s from %s."] = "Vi ricevis %s de %s.";
-$a->strings["an introduction"] = "prezenton";
+$a->strings["You've received an introduction from '%1\$s' at %2\$s"] = "Vi ricevis prezenton de '%1\$s' ĉe %2\$s";
+$a->strings["You've received [url=%1\$s]an introduction[/url] from %2\$s."] = "Vi ricevis [url=%1\$s]prezenton[/url] de %2\$s.";
 $a->strings["You may visit their profile at %s"] = "Vi povas vidi la profilon de li aŭ ŝi ĉe %s";
 $a->strings["Please visit %s to approve or reject the introduction."] = "Bonvolu viziti %s por aprobi aŭ malaprobi la prezenton.";
 $a->strings["[Friendica:Notify] Friend suggestion received"] = "[Friendica:Atentigo] Ricevis amikosugeston";
-$a->strings["You've received a friend suggestion from '%s' at %s"] = "'%s' ĉe %s rekomendis amikon al vi";
-$a->strings["You've received %s for %s from %s."] = "Vi ricevis %s kun %s de %s.";
-$a->strings["a friend suggestion"] = "sugeston por amikiĝi";
+$a->strings["You've received a friend suggestion from '%1\$s' at %2\$s"] = "Vi ricevis amikosugeston de '%1\$s' ĉe %2\$s";
+$a->strings["You've received [url=%1\$s]a friend suggestion[/url] for %2\$s from %3\$s."] = "Vi ricevis [url=%1\$s]amikosugeston[/url] pri %2\$s de %3\$s.";
 $a->strings["Name:"] = "Nomo:";
 $a->strings["Photo:"] = "Bildo:";
 $a->strings["Please visit %s to approve or reject the suggestion."] = "Bonvolu viziti %s por aprobi aŭ malaprobi la sugeston.";
+$a->strings["Connect URL missing."] = "Ne ekzistas URL adreso por konekti.";
+$a->strings["This site is not configured to allow communications with other networks."] = "Tiu retpaĝo ne permesas komunikadon kun aliaj retoj.";
+$a->strings["No compatible communication protocols or feeds were discovered."] = "Ne malkovris kongruajn protokolojn por komunikado aŭ fluojn.";
+$a->strings["The profile address specified does not provide adequate information."] = "La specifita profiladreso ne enhavas sufiĉe da informoj.";
+$a->strings["An author or name was not found."] = "Ne trovis aŭtoron aŭ nomon.";
+$a->strings["No browser URL could be matched to this address."] = "Neniu retuma URL adreso kongruas al la adreso.";
+$a->strings["Unable to match @-style Identity Address with a known protocol or email contact."] = "Ne eblas kongrui @-stilan identecon adreson al iu konata protokolo au retpoŝtadreso.";
+$a->strings["Use mailto: in front of address to force email check."] = "Uzu mailto: antaŭ la adreso por devigi la testadon per retpoŝto.";
+$a->strings["The profile address specified belongs to a network which has been disabled on this site."] = "Tiu profila adreso apartenas al retejo kiu estas maŝaltita je ĉi tiu retejo.";
+$a->strings["Limited profile. This person will be unable to receive direct/personal notifications from you."] = "Profilo limigata. Ĉi persono ne eblos ricevi rektajn/personajn atentigojn de vi. ";
+$a->strings["Unable to retrieve contact information."] = "Ne eblas ricevi kontaktinformojn.";
+$a->strings["following"] = "sekvanta";
 $a->strings["A new person is sharing with you at "] = "Nova persono kunhavigas kun vi ĉe ";
 $a->strings["You have a new follower at "] = "Vi havas novan sekvanton ĉe ";
-$a->strings["image/photo"] = "bildo";
-$a->strings["link"] = "ligilo";
+$a->strings["Archives"] = "Arkivoj";
+$a->strings["An invitation is required."] = "Invio bezonata.";
+$a->strings["Invitation could not be verified."] = "Ne povis kontroli la inviton.";
+$a->strings["Invalid OpenID url"] = "Nevalida OpenID adreso";
+$a->strings["Please enter the required information."] = "Bonvolu entajpi la bezonatajn informojn.";
+$a->strings["Please use a shorter name."] = "Bonvolu uzi pli mallongan nomon.";
+$a->strings["Name too short."] = "Nomo estas tro mallonga.";
+$a->strings["That doesn't appear to be your full (First Last) name."] = "Tio ŝajne ne estas via plena (persona, familia) nomo.";
+$a->strings["Your email domain is not among those allowed on this site."] = "Via retpoŝtodomajno ne estas permesita ĉi tie.";
+$a->strings["Not a valid email address."] = "Nevalida retpoŝtadreso.";
+$a->strings["Cannot use that email."] = "Neuzebla retpoŝtadreso.";
+$a->strings["Your \"nickname\" can only contain \"a-z\", \"0-9\", \"-\", and \"_\", and must also begin with a letter."] = "Via kaŝnomo nur povas enhavi \"a-z\", \"0-9\", \"-\", kaj \"_\". Ĝi ankaŭ devas komenci kun litero.";
+$a->strings["Nickname is already registered. Please choose another."] = "Tio kaŝnomo jam estas registrita. Bonvolu elekti alian.";
+$a->strings["Nickname was once registered here and may not be re-used. Please choose another."] = "Tiu kaŝnomo iam estis registrita ĉi tie kaj ne ree uzeblas. Bonvolu elekti alian.";
+$a->strings["SERIOUS ERROR: Generation of security keys failed."] = "GRAVA ERARO: La generacio de sekurecaj ĉifroŝlosiloj malsukcesis.";
+$a->strings["An error occurred during registration. Please try again."] = "Eraro okazis dum registrado. Bonvolu provi denove.";
+$a->strings["An error occurred creating your default profile. Please try again."] = "Eraro okazi dum kreado de via defaŭlta profilo. Bonvolu provi denove.";
 $a->strings["Welcome "] = "Bonvenon ";
 $a->strings["Please upload a profile photo."] = "Bonvolu alŝuti profilbildon.";
 $a->strings["Welcome back "] = "Bonvenon ";
@@ -1612,7 +1717,7 @@ $a->strings["add tag"] = "aldoni markon";
 $a->strings["save to folder"] = "konservi en dosierujo";
 $a->strings["to"] = "al";
 $a->strings["Wall-to-Wall"] = "Muro-al-Muro";
-$a->strings["via Wall-To-Wall:"] = "tra Muro-al-Muro:";
+$a->strings["via Wall-To-Wall:"] = "per Muro-al-Muro:";
 $a->strings["Delete Selected Items"] = "Forviŝi Elektitajn Elementojn";
 $a->strings["%s likes this."] = "%s ŝatas tiun.";
 $a->strings["%s doesn't like this."] = "%s malŝatas tiun.";
@@ -1637,6 +1742,9 @@ $a->strings["audio link"] = "sono ligilo";
 $a->strings["set location"] = "agordi lokon";
 $a->strings["clear location"] = "forviŝi lokon";
 $a->strings["permissions"] = "permesoj";
+$a->strings["Click here to upgrade."] = "Klaku ĉi tie por ĝisdatigi.";
+$a->strings["This action exceeds the limits set by your subscription plan."] = "Tia ago preterpasas la limojn de via abono.";
+$a->strings["This action is not available under your subscription plan."] = "Tia ago ne estas permesita laŭ via abono.";
 $a->strings["Delete this item?"] = "Forviŝi ĉi tiun elementon?";
 $a->strings["show fewer"] = "montri malpli";
 $a->strings["Update %s failed. See error logs."] = "Malsukcesis ĝisdatigi %s. Vidu la protokolojn.";
index 9c15329da32813ea15634cf39ddec015d556ca2e..5d1bb6310c6c0650da9238c6bd78648a8c32a63d 100644 (file)
@@ -113,7 +113,7 @@ input#acl-search {
 
 
 .notify-seen {
-  background:#666;
+  background:#111;
 }
 
 #nav-notifications-menu {
@@ -157,4 +157,27 @@ blockquote {
 
 #datebrowse-sidebar select {
 color:#99CCFF !important;
-}
\ No newline at end of file
+}
+
+.settings-widget .selected {
+background: #666;
+}
+
+#adminpage table tr:hover {
+    color: #eec;
+    background-color: #666;
+}
+
+input#prvmail-subject {
+background: #222 !important;
+}
+
+/* Events */
+
+.fc-state-highlight {
+background: #666 !important;
+}
+.fc-state-disabled, .fc-state-disabled .fc-button-inner {
+color: #000 !important;
+}
index 8a6099ee810c004baace1f538f3051cb70223c9c..55644e462d90e52ed64aba201f62e08c02217054 100644 (file)
@@ -111,9 +111,8 @@ input#acl-search {
 }
 
 
-
 .notify-seen {
-  background:#666;
+  background:#111;
 }
 
 #nav-notifications-menu {
@@ -138,7 +137,7 @@ blockquote {
   color:#eec !important;
 }
 
-.group-selected, .nets-selected, .fileas-selected, .categories-selected {
+.group-selected, .nets-selected, .fileas-selected, .categories-selected{
   background:#2e2f2e;
 }
 
@@ -146,11 +145,33 @@ blockquote {
   background:#444;
 }
 
-/* This seems okay to me...we might not need a new iconset, lets see how people react */
 .editicon {
        background-color: #333;
 }
 
 #datebrowse-sidebar select {
 color:#99CCFF !important;
-}
\ No newline at end of file
+}
+
+.settings-widget .selected {
+background: #666;
+}
+
+#adminpage table tr:hover {
+    color: #eec;
+    background-color: #666;
+}
+
+input#prvmail-subject {
+background: #222 !important;
+}
+
+/* Events */
+
+.fc-state-highlight {
+background: #666 !important;
+}
+
+.fc-state-disabled, .fc-state-disabled .fc-button-inner {
+color: #000 !important;
+}
index 50a15788de8a99f86a3e1c6d1f445260d47c9159..0ab7de78e769f45ca3187603b6f84b58f1357e15 100644 (file)
@@ -42,6 +42,7 @@ $(document).ready(function() {
             
        });
        
+       
        function tautogrow(id){
                $("textarea#comment-edit-text-" +id).autogrow();        
        };
@@ -128,6 +129,17 @@ $(document).ready(function() {
        function cmtBbClose(id) {
        $(".comment-edit-bb-" + id).hide();
        }
+       
+       $(document).ready(function(){
+       var doctitle = document.title;
+       function checkNotify() {
+       if(document.getElementById("notify-update").innerHTML != "")
+       document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
+       else
+       document.title = doctitle;
+       };
+       setInterval(function () {checkNotify();}, 10 * 1000);
+       })
 
        
 </script>
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 43c0974b14734fc80a7cc58c75539be9aea93af5..98c645024740c6c5870cf9c444e6b6cfdf47f0bc 100644 (file)
@@ -2822,6 +2822,35 @@ float: left;
 /* = Directory = */
 /* ============= */
 /* contacts menu */
+section .directory-item dl {
+height: auto;
+overflow: auto;
+}
+
+section .directory-item dt {
+float: left;
+margin-left: 0px;
+text-align: right;
+color: #999;
+}
+
+section .directory-item dd {
+float: left;
+margin-left: 5px;
+}
+
+.directory-profile-wrapper {
+float: left;
+max-height: 178px;
+overflow: hidden;
+width: 635px;
+}
+
+.directory-copy-wrapper {
+float:left;
+overflow: hidden;
+}
+
 .contact-photo-wrapper {
   position: relative;
 }
@@ -2862,13 +2891,20 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+float: left;
+height: 200px;
+width: 165px;
+}
+
 .directory-item .contact-photo img {
   width: 175px;
   height: 175px;
index b512c8bfe2af207b06cc6b83cc7d8f01400fcaf7..630b331e93e5433bd32904d7c5c8d992ceaa440e 100644 (file)
@@ -2808,6 +2808,30 @@ float: left;
 /* ============= */
 /* = Directory = */
 /* ============= */
+section .directory-item dl {
+  height: auto;
+  overflow: auto;      
+}
+section .directory-item dt {
+  float: left;
+  margin-left: 0px;
+  text-align: right;
+  color: #999;
+}
+section .directory-item dd {
+  float: left;
+  margin-left: 5px;
+}
+.directory-profile-wrapper {
+  float: left;
+  max-height: 178px;
+  overflow: hidden;
+  width: 635px;
+}
+.directory-copy-wrapper {
+  float: left;
+  overflow: hidden;    
+}
 /* contacts menu */
 .contact-photo-wrapper {
   position: relative;
@@ -2849,7 +2873,7 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
@@ -2860,17 +2884,42 @@ float: left;
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+  float: left;
+  height: 200px;
+  width: 165px;  
+}
 .contact-name {
-  text-align: left;
   font-weight: bold;
-  font-size: 12px;
+  font-size: 18px;
+  margin-bottom: -3px;
+  text-align: left;
 }
 .contact-details {
   color: #999999;
 }
+.page-type {
+  font-size: 10px;
+  font-style: italic;
+}
+.directory-detailscolumn-wrapper {
+  float: left; 
+  width: 305px;
+  margin-right: 10px;  
+}
+.directory-profile-wrapper dl {
+  margin-top: 3px;
+  margin-bottom: 3px;
+}
+.directory-profile-title {
+  font-weight: bold;
+  margin-bottom: 3px;
+  font-size: 14px;
+}
 #side-bar-photos-albums{
        margin-top: 15px;       
-       }
+}
 .photo-top-photo, .photo-album-photo {
   -webkit-border-radius: 5px 5px 0 0;
   -moz-border-radius: 5px 5px 0 0;
old mode 100755 (executable)
new mode 100644 (file)
index 103047f32a8b89eff6c1d76155a6795368acad55..fe1e8f66255fe75ddff36b3bbb352f82d7aff7b9 100644 (file)
@@ -2778,6 +2778,35 @@ float: left;
 /* = Directory = */
 /* ============= */
 /* contacts menu */
+section .directory-item dl {
+height: auto;
+overflow: auto;
+}
+
+section .directory-item dt {
+float: left;
+margin-left: 0px;
+text-align: right;
+color: #999;
+}
+
+section .directory-item dd {
+float: left;
+margin-left: 5px;
+}
+
+.directory-profile-wrapper {
+float: left;
+max-height: 178px;
+overflow: hidden;
+width: 635px;
+}
+
+.directory-copy-wrapper {
+float:left;
+overflow: hidden;
+}
+
 .contact-photo-wrapper {
   position: relative;
 }
@@ -2818,7 +2847,7 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
@@ -2829,14 +2858,47 @@ float: left;
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+float: left;
+height: 200px;
+width: 165px;
+}
+
 .contact-name {
   text-align: left;
   font-weight: bold;
-  font-size: 12px;
+  font-size: 18px;
+  margin-bottom: -3px;
 }
 .contact-details {
   color: #999999;
 }
+
+
+.page-type {
+font-size: 10px;
+font-style: italic;
+}
+
+.directory-detailscolumn-wrapper {
+float: left;
+width: 305px;
+margin-right: 10px;
+}
+
+.directory-profile-wrapper d1 {
+margin-top: 3px;
+margin-bottom: 3px;
+}
+
+.directory-profile-title {
+font-weight: bold;
+margin-bottom: 3px
+font-size: 14px;
+}
+
+
 #side-bar-photos-albums{
        margin-top: 15px;       
        }
index e7f3fd0bc8db205e3f7587094bf3bc5fe7a9c91b..952f907750f15503671c672f2477f3f4f86c6ac3 100644 (file)
@@ -2766,6 +2766,30 @@ float: left;
 /* ============= */
 /* = Directory = */
 /* ============= */
+section .directory-item dl {
+  height: auto;
+  overflow: auto;      
+}
+section .directory-item dt {
+  float: left;
+  margin-left: 0px;
+  text-align: right;
+  color: #999;
+}
+section .directory-item dd {
+  float: left;
+  margin-left: 5px;
+}
+.directory-profile-wrapper {
+  float: left;
+  max-height: 178px;
+  overflow: hidden;
+  width: 635px;
+}
+.directory-copy-wrapper {
+  float: left;
+  overflow: hidden;    
+}
 /* contacts menu */
 .contact-photo-wrapper {
   position: relative;
@@ -2807,7 +2831,7 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
@@ -2818,17 +2842,42 @@ float: left;
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+  float: left;
+  height: 200px;
+  width: 165px;  
+}
 .contact-name {
-  text-align: left;
   font-weight: bold;
-  font-size: 12px;
+  font-size: 18px;
+  margin-bottom: -3px;
+  text-align: left;
 }
 .contact-details {
   color: #999999;
 }
+.page-type {
+  font-size: 10px;
+  font-style: italic;
+}
+.directory-detailscolumn-wrapper {
+  float: left; 
+  width: 305px;
+  margin-right: 10px;  
+}
+.directory-profile-wrapper dl {
+  margin-top: 3px;
+  margin-bottom: 3px;
+}
+.directory-profile-title {
+  font-weight: bold;
+  margin-bottom: 3px;
+  font-size: 14px;
+}
 #side-bar-photos-albums{
        margin-top: 15px;       
-       }
+}
 .photo-top-photo, .photo-album-photo {
   -webkit-border-radius: 5px 5px 0 0;
   -moz-border-radius: 5px 5px 0 0;
old mode 100755 (executable)
new mode 100644 (file)
index 189bd30bf493aa428ba9eefeaf014c90217dcad7..5ef9398ec53b10425b0cd359bd56acf2b4543e64 100644 (file)
@@ -2780,6 +2780,30 @@ float: left;
 /* ============= */
 /* = Directory = */
 /* ============= */
+section .directory-item dl {
+  height: auto;
+  overflow: auto;      
+}
+section .directory-item dt {
+  float: left;
+  margin-left: 0px;
+  text-align: right;
+  color: #999;
+}
+section .directory-item dd {
+  float: left;
+  margin-left: 5px;
+}
+.directory-profile-wrapper {
+  float: left;
+  max-height: 178px;
+  overflow: hidden;
+  width: 635px;
+}
+.directory-copy-wrapper {
+  float: left;
+  overflow: hidden;    
+}
 /* contacts menu */
 .contact-photo-wrapper {
   position: relative;
@@ -2821,7 +2845,7 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
@@ -2832,17 +2856,42 @@ float: left;
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+  float: left;
+  height: 200px;
+  width: 165px;  
+}
 .contact-name {
-  text-align: left;
   font-weight: bold;
-  font-size: 12px;
+  font-size: 18px;
+  margin-bottom: -3px;
+  text-align: left;
 }
 .contact-details {
   color: #999999;
 }
+.page-type {
+  font-size: 10px;
+  font-style: italic;
+}
+.directory-detailscolumn-wrapper {
+  float: left; 
+  width: 305px;
+  margin-right: 10px;  
+}
+.directory-profile-wrapper dl {
+  margin-top: 3px;
+  margin-bottom: 3px;
+}
+.directory-profile-title {
+  font-weight: bold;
+  margin-bottom: 3px;
+  font-size: 14px;
+}
 #side-bar-photos-albums{
        margin-top: 15px;       
-       }
+}
 .photo-top-photo, .photo-album-photo {
   -webkit-border-radius: 5px 5px 0 0;
   -moz-border-radius: 5px 5px 0 0;
index 0a9c5e35cb5a48a2a729636a01f0a8b5cdd85132..107bec8bbda11fec9b8e8495b8766131c00b5647 100644 (file)
@@ -2799,6 +2799,35 @@ float: left;
 /* = Directory = */
 /* ============= */
 /* contacts menu */
+section .directory-item dl {
+height: auto;
+overflow: auto;
+}
+
+section .directory-item dt {
+float: left;
+margin-left: 0px;
+text-align: right;
+color: #999;
+}
+
+section .directory-item dd {
+float: left;
+margin-left: 5px;
+}
+
+.directory-profile-wrapper {
+float: left;
+max-height: 178px;
+overflow: hidden;
+width: 635px;
+}
+
+.directory-copy-wrapper {
+float:left;
+overflow: hidden;
+}
+
 .contact-photo-wrapper {
   position: relative;
 }
@@ -2839,13 +2868,20 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+float: left;
+height: 200px;
+width: 165px;
+}
+
 .directory-item .contact-photo img {
   width: 175px;
   height: 175px;
index 762310e4db696803b9e2f56db0b2b83b2f37ac76..e1993764e0c5ea0ec114f88a1110dcf1c1b7335f 100644 (file)
@@ -2795,6 +2795,30 @@ float: left;
 /* ============= */
 /* = Directory = */
 /* ============= */
+section .directory-item dl {
+  height: auto;
+  overflow: auto;      
+}
+section .directory-item dt {
+  float: left;
+  margin-left: 0px;
+  text-align: right;
+  color: #999;
+}
+section .directory-item dd {
+  float: left;
+  margin-left: 5px;
+}
+.directory-profile-wrapper {
+  float: left;
+  max-height: 178px;
+  overflow: hidden;
+  width: 635px;
+}
+.directory-copy-wrapper {
+  float: left;
+  overflow: hidden;    
+}
 /* contacts menu */
 .contact-photo-wrapper {
   position: relative;
@@ -2836,7 +2860,7 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
@@ -2847,17 +2871,42 @@ float: left;
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+  float: left;
+  height: 200px;
+  width: 165px;  
+}
 .contact-name {
-  text-align: left;
   font-weight: bold;
-  font-size: 12px;
+  font-size: 18px;
+  margin-bottom: -3px;
+  text-align: left;
 }
 .contact-details {
   color: #999999;
 }
+.page-type {
+  font-size: 10px;
+  font-style: italic;
+}
+.directory-detailscolumn-wrapper {
+  float: left; 
+  width: 305px;
+  margin-right: 10px;  
+}
+.directory-profile-wrapper dl {
+  margin-top: 3px;
+  margin-bottom: 3px;
+}
+.directory-profile-title {
+  font-weight: bold;
+  margin-bottom: 3px;
+  font-size: 14px;
+}
 #side-bar-photos-albums{
        margin-top: 15px;       
-       }
+}
 .photo-top-photo, .photo-album-photo {
   -webkit-border-radius: 5px 5px 0 0;
   -moz-border-radius: 5px 5px 0 0;
old mode 100755 (executable)
new mode 100644 (file)
index e85c58850a72994f3f347e14d8d7517473c50849..df25c4d17bdbf21fce9431e3f6a3bef72732c7ce 100644 (file)
@@ -2799,6 +2799,36 @@ float: left;
 /* = Directory = */
 /* ============= */
 /* contacts menu */
+
+section .directory-item dl {
+height: auto;
+overflow: auto;
+}
+
+section .directory-item dt {
+float: left;
+margin-left: 0px;
+text-align: right;
+color: #999;
+}
+
+section .directory-item dd {
+float: left;
+margin-left: 5px;
+}
+
+.directory-profile-wrapper {
+float: left;
+max-height: 178px;
+overflow: hidden;
+width: 635px;
+}
+
+.directory-copy-wrapper {
+float:left;
+overflow: hidden;
+}
+
 .contact-photo-wrapper {
   position: relative;
 }
@@ -2839,7 +2869,7 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
@@ -2850,14 +2880,46 @@ float: left;
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+float: left;
+height: 200px;
+width: 165px;
+}
+
 .contact-name {
   text-align: left;
   font-weight: bold;
-  font-size: 12px;
+  font-size: 18px;
+  margin-bottom: -3px;
 }
 .contact-details {
   color: #999999;
 }
+
+.page-type {
+font-size: 10px;
+font-style: italic;
+}
+
+.directory-detailscolumn-wrapper {
+float: left;
+width: 305px;
+margin-right: 10px;
+}
+
+.directory-profile-wrapper d1 {
+margin-top: 3px;
+margin-bottom: 3px;
+}
+
+.directory-profile-title {
+font-weight: bold;
+margin-bottom: 3px
+font-size: 14px;
+}
+
+
 #side-bar-photos-albums{
        margin-top: 15px;       
        }
index 248e3ead07ca140adf66b7cf1d743033a99c39f8..e9bcd53d042c414a11d907437239a22e8a54b5c1 100644 (file)
@@ -2795,6 +2795,30 @@ float: left;
 /* ============= */
 /* = Directory = */
 /* ============= */
+section .directory-item dl {
+  height: auto;
+  overflow: auto;      
+}
+section .directory-item dt {
+  float: left;
+  margin-left: 0px;
+  text-align: right;
+  color: #999;
+}
+section .directory-item dd {
+  float: left;
+  margin-left: 5px;
+}
+.directory-profile-wrapper {
+  float: left;
+  max-height: 178px;
+  overflow: hidden;
+  width: 635px;
+}
+.directory-copy-wrapper {
+  float: left;
+  overflow: hidden;    
+}
 /* contacts menu */
 .contact-photo-wrapper {
   position: relative;
@@ -2836,7 +2860,7 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
@@ -2847,17 +2871,42 @@ float: left;
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+  float: left;
+  height: 200px;
+  width: 165px;  
+}
 .contact-name {
-  text-align: left;
   font-weight: bold;
-  font-size: 12px;
+  font-size: 18px;
+  margin-bottom: -3px;
+  text-align: left;
 }
 .contact-details {
   color: #999999;
 }
+.page-type {
+  font-size: 10px;
+  font-style: italic;
+}
+.directory-detailscolumn-wrapper {
+  float: left; 
+  width: 305px;
+  margin-right: 10px;  
+}
+.directory-profile-wrapper dl {
+  margin-top: 3px;
+  margin-bottom: 3px;
+}
+.directory-profile-title {
+  font-weight: bold;
+  margin-bottom: 3px;
+  font-size: 14px;
+}
 #side-bar-photos-albums{
        margin-top: 15px;       
-       }
+}
 .photo-top-photo, .photo-album-photo {
   -webkit-border-radius: 5px 5px 0 0;
   -moz-border-radius: 5px 5px 0 0;
old mode 100755 (executable)
new mode 100644 (file)
index b068a2f5d23c3a9d5235a631bcc41e3015e192ac..b05156dc6491f7f604dad363b38b6bf56b423f13 100644 (file)
@@ -2805,6 +2805,35 @@ float: left;
 /* = Directory = */
 /* ============= */
 /* contacts menu */
+section .directory-item dl {
+height: auto;
+overflow: auto;
+}
+
+section .directory-item dt {
+float: left;
+margin-left: 0px;
+text-align: right;
+color: #999;
+}
+
+section .directory-item dd {
+float: left;
+margin-left: 5px;
+}
+
+.directory-profile-wrapper {
+float: left;
+max-height: 178px;
+overflow: hidden;
+width: 635px;
+}
+
+.directory-copy-wrapper {
+float:left;
+overflow: hidden;
+}
+
 .contact-photo-wrapper {
   position: relative;
 }
@@ -2845,13 +2874,20 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+float: left;
+height: 200px;
+width: 165px;
+}
+
 .directory-item .contact-photo img {
   width: 175px;
   height: 175px;
index 37e26b8b931fef8fac95f89dec6180851288b0da..72592168b50a3bd316e7ee9b874e7bcc8bddb5d3 100644 (file)
@@ -2793,6 +2793,30 @@ float: left;
 /* ============= */
 /* = Directory = */
 /* ============= */
+section .directory-item dl {
+  height: auto;
+  overflow: auto;      
+}
+section .directory-item dt {
+  float: left;
+  margin-left: 0px;
+  text-align: right;
+  color: #999;
+}
+section .directory-item dd {
+  float: left;
+  margin-left: 5px;
+}
+.directory-profile-wrapper {
+  float: left;
+  max-height: 178px;
+  overflow: hidden;
+  width: 635px;
+}
+.directory-copy-wrapper {
+  float: left;
+  overflow: hidden;    
+}
 /* contacts menu */
 .contact-photo-wrapper {
   position: relative;
@@ -2834,7 +2858,7 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
@@ -2845,17 +2869,42 @@ float: left;
   width: 175px;
   height: 175px;
 }
+
+section .directory-photo-wrapper {
+  float: left;
+  height: 200px;
+  width: 165px;  
+}
 .contact-name {
-  text-align: left;
   font-weight: bold;
-  font-size: 12px;
+  font-size: 18px;
+  margin-bottom: -3px;
+  text-align: left;
 }
 .contact-details {
   color: #999999;
 }
+.page-type {
+  font-size: 10px;
+  font-style: italic;
+}
+.directory-detailscolumn-wrapper {
+  float: left; 
+  width: 305px;
+  margin-right: 10px;  
+}
+.directory-profile-wrapper dl {
+  margin-top: 3px;
+  margin-bottom: 3px;
+}
+.directory-profile-title {
+  font-weight: bold;
+  margin-bottom: 3px;
+  font-size: 14px;
+}
 #side-bar-photos-albums{
        margin-top: 15px;       
-       }
+}
 .photo-top-photo, .photo-album-photo {
   -webkit-border-radius: 5px 5px 0 0;
   -moz-border-radius: 5px 5px 0 0;
old mode 100755 (executable)
new mode 100644 (file)
index bc2af16..70d1979
@@ -3,9 +3,40 @@
        <div class="directory-photo-wrapper" id="directory-photo-wrapper-$id" > 
                <div class="directory-photo" id="directory-photo-$id" >
                        <a href="$profile-link" class="directory-profile-link" id="directory-profile-link-$id" >
-                               <img class="directory-photo-img" src="$photo" alt="$alt-text" title="$alt-text" />
+                               <img class="directory-photo-img photo" src="$photo" alt="$alt-text" title="$alt-text" />
                        </a>
                </div>
        </div>
-       <div class="contact-name" id="directory-name-$id">$name</div>
+       <div class="directory-profile-wrapper" id="directory-profile-wrapper-$id" >
+               <div class="contact-name" id="directory-name-$id">$name</div>
+               <div class="page-type">$page-type</div>
+               {{ if $pdesc }}<div class="directory-profile-title">$profile.pdesc</div>{{ endif }}
+       <div class="directory-detailcolumns-wrapper" id="directory-detailcolumns-wrapper-$id">
+               <div class="directory-detailscolumn-wrapper" id="directory-detailscolumn1-wrapper-$id"> 
+                       {{ if $location }}
+                           <dl class="location"><dt class="location-label">$location</dt>
+                               <dd class="adr">
+                                       {{ if $profile.address }}<div class="street-address">$profile.address</div>{{ endif }}
+                                       <span class="city-state-zip">
+                                               <span class="locality">$profile.locality</span>{{ if $profile.locality }}, {{ endif }}
+                                               <span class="region">$profile.region</span>
+                                               <span class="postal-code">$profile.postal-code</span>
+                                       </span>
+                                       {{ if $profile.country-name }}<span class="country-name">$profile.country-name</span>{{ endif }}
+                               </dd>
+                               </dl>
+                       {{ endif }}
+
+                       {{ if $gender }}<dl class="mf"><dt class="gender-label">$gender</dt> <dd class="x-gender">$profile.gender</dd></dl>{{ endif }}
+                       </div>  
+                       <div class="directory-detailscolumn-wrapper" id="directory-detailscolumn2-wrapper-$id"> 
+                               {{ if $marital }}<dl class="marital"><dt class="marital-label"><span class="heart">&hearts;</span>$marital</dt><dd class="marital-text">$profile.marital</dd></dl>{{ endif }}
+
+                               {{ if $homepage }}<dl class="homepage"><dt class="homepage-label">$homepage</dt><dd class="homepage-url"><a href="$profile.homepage" target="external-link">$profile.homepage</a></dd></dl>{{ endif }}
+                       </div>
+               </div>
+               <div class="directory-copy-wrapper" id="directory-copy-wrapper-$id" >
+                       {{ if $about }}<dl class="directory-copy"><dt class="directory-copy-label">$about</dt><dd class="directory-copy-data">$profile.about</dd></dl>{{ endif }}
+               </div>
+       </div>
 </div>
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 4165656bd4d2963f9ef12aec45f824a8979a393e..1424c0e39a179f4bd42c98e3db5c666c952754e3 100644 (file)
 
 
 <div id="scrollup" style="position: fixed; bottom: 5px; right: 10px;z-index: 97;"><a id="down" onclick="scrolldown()" ><img id="scroll_top_bottom" src="view/theme/diabook/icons/scroll_bottom.png" style="display:cursor !important;" alt="back to top" title="Scroll to bottom"></a></div>
-<div style="position: fixed; bottom: 3px; left: 25px;">$langselector</div>
+<div style="position: fixed; bottom: 61px; left: 6px;">$langselector</div>
 <div style="position: fixed; bottom: 23px; left: 5px;"><a href="http://pad.toktan.org/p/diabook" target="blank" ><img src="view/theme/diabook/icons/bluebug.png" title="report bugs for the theme diabook"/></a></div>
 
 
old mode 100755 (executable)
new mode 100644 (file)
index 736817c7bfc340d2038d6b3d7de5d62481ddd289..68bfd5d3a9213a0750b8b37460c941898497ab06 100644 (file)
@@ -2732,6 +2732,30 @@ float: left;
 /* ============= */
 /* = Directory = */
 /* ============= */
+section .directory-item dl {
+  height: auto;
+  overflow: auto;      
+}
+section .directory-item dt {
+  float: left;
+  margin-left: 0px;
+  text-align: right;
+  color: #999;
+}
+section .directory-item dd {
+  float: left;
+  margin-left: 5px;
+}
+.directory-profile-wrapper {
+  float: left;
+  max-height: 178px;
+  overflow: hidden;
+  width: 635px;
+}
+.directory-copy-wrapper {
+  float: left;
+  overflow: hidden;    
+}
 /* contacts menu */
 .contact-photo-wrapper {
   position: relative;
@@ -2773,7 +2797,7 @@ float: left;
 }
 .directory-item {
   float: left;
-  width: 200px;
+  width: 800px;
   height: 200px;
 }
 .directory-item .contact-photo {
@@ -2784,14 +2808,38 @@ float: left;
   width: 175px;
   height: 175px;
 }
+section .directory-photo-wrapper {
+  float: left;
+  height: 200px;
+  width: 165px;        
+}
 .contact-name {
-  text-align: left;
+  font-size: 18px;
   font-weight: bold;
-  font-size: 12px;
+  margin-bottom: -3px;
+  text-align: left;
 }
 .contact-details {
   color: #999999;
 }
+.page-type {
+  font-size: 10px;
+  font-style: italic;
+}
+.directory-detailscolumn-wrapper {
+  float: left; 
+  width: 305px;
+  margin-right: 10px;  
+}
+.directory-profile-wrapper dl {
+  margin-top: 3px;
+  margin-bottom: 3px;
+}
+.directory-profile-title {
+  font-weight: bold;
+  margin-bottom: 3px;
+  font-size: 14px;
+}
 #side-bar-photos-albums li{
 list-style-type: disc;
 }
old mode 100755 (executable)
new mode 100644 (file)
index 12383406479ccaa51d5ffcbcbc5232406f8b9061..5b9de296894d84537fe536e30d55abba51986852 100644 (file)
@@ -22,7 +22,7 @@
                        <div class="wall-item-actions-author">
                                <a href="$item.profile_url" target="redir" title="$item.linktitle" class="wall-item-name-link"><span class="wall-item-name$item.sparkle">$item.name</span></a> 
                        <span class="wall-item-ago">-
-                       {{ if $item.plink }}<a class="link" title="$item.plink.title" href="$item.plink.href" style="color: #999">$item.ago</a>{{ else }} $item.ago {{ endif }}
+                       {{ if $item.plink }}<a class="link$item.sparkle" title="$item.plink.title" href="$item.plink.href" style="color: #999">$item.ago</a>{{ else }} $item.ago {{ endif }}
                        {{ if $item.lock }} - <span class="fakelink" style="color: #999" onclick="lockview(event,$item.id);">$item.lock</span> {{ endif }}
                        </span>
                        </div>
index bee75ad99a236b4063b2a902241c5bb93b9f913d..b2c980c78de460e10596881328dea3ad0d7d812e 100644 (file)
@@ -28,7 +28,7 @@
                                <a href="$item.profile_url" target="redir" title="$item.linktitle" class="wall-item-name-link"><span class="wall-item-name$item.sparkle">$item.name</span></a>
                                $item.to <a href="$item.owner_url" target="redir" title="$item.olinktitle" class="wall-item-name-link"><span class="wall-item-name$item.osparkle" id="wall-item-ownername-$item.id">$item.owner_name</span></a>
                                 $item.vwall <span class="wall-item-ago">- &nbsp;
-                       {{ if $item.plink }}<a class="link" title="$item.plink.title" href="$item.plink.href" style="color: #999">$item.ago</a>{{ else }} $item.ago {{ endif }}
+                       {{ if $item.plink }}<a class="link$item.sparkle" title="$item.plink.title" href="$item.plink.href" style="color: #999">$item.ago</a>{{ else }} $item.ago {{ endif }}
                        {{ if $item.lock }} - <span class="fakelink" style="color: #999" onclick="lockview(event,$item.id);">$item.lock</span> {{ endif }}
                        </span>
                        </div>
index 130bfb25ae4f3004d79a552ef80e1d3d386f4a2f..0bcc3aca4187b03931934e11a0ac071db4d73a24 100644 (file)
@@ -43,4 +43,17 @@ function insertFormatting(comment, BBcode, id) {
 function cmtBbOpen(id) {
        $(".comment-edit-bb-" + id).show();
 }
+function cmtBbClose(id) {
+    $(".comment-edit-bb-" + id).hide();
+}
+
+var doctitle = document.title;
+function checkNotify() {
+       if(document.getElementById("notify-update").innerHTML != "") {
+               document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle;
+       } else {
+               document.title = doctitle;
+    };
+    setInterval(function () {checkNotify();}, 10 * 1000);
+}
 </script>
index 8ab192368584bb691e0965f6515c52204a945b1c..95e2bb998399aa88205908bd8b991fe4f102e830 100644 (file)
@@ -97,6 +97,7 @@ nav .nav-link{display:inline-block;width:22px;height:22px;overflow:hidden;margin
 #nav-network-link{background-position:0px -177px;}#nav-network-link:hover{background-position:-22px -177px;}
 #nav-search-link{background-position:0 -44px;}#nav-search-link:hover{background-position:-22px -44px;}
 #jot-title,#profile-link,#profile-title,#profile-attach-wrapper,#profile-audio,#profile-link,#profile-location,#profile-nolocation,#profile-title,#profile-upload-wrapper,#profile-video,#profile-jot-submit,#wall-image-upload,#wall-file-upload,#wall-image-upload-div,#wall-file-upload-div,.icon,.hover,.focus,.pointer{cursor:pointer;}
+.sparkle{cursor:url("icons/sparkle.cur"),pointer;}
 div.jGrowl div.notice{background:#3320bc url("../../../images/icons/48/notice.png") no-repeat 5px center;color:white;padding-left:58px;margin-top:50px;}
 div.jGrowl div.info{background:#1353b1 url("../../../images/icons/48/info.png") no-repeat 5px center;color:white;padding-left:58px;margin-top:50px;}
 #nav-notifications-menu{margin:30px 0 0 -20px;width:275px;max-height:300px;overflow-y:auto;font-size:9pt;}#nav-notifications-menu img{float:left;margin-right:5px;}
index 60b49865e978c25df7f08cd92ca70aa01db82462..f701c12253b6f4812299cb0015a9b7433621cc61 100644 (file)
@@ -594,6 +594,9 @@ nav .nav-link {
 .pointer {
     cursor: pointer;
 }
+.sparkle {
+    cursor: url("icons/sparkle.cur"), pointer;
+}
 //* popup notifications */
 div.jGrowl div {
     &.notice {
diff --git a/view/theme/dispy/icons/sparkle.cur b/view/theme/dispy/icons/sparkle.cur
new file mode 100644 (file)
index 0000000..253259d
Binary files /dev/null and b/view/theme/dispy/icons/sparkle.cur differ
index de2717f0c4a823b8b37d3e493a812d4e1f5b7014..9a991b796e900033e6b16a7018228fe09241e5e0 100644 (file)
@@ -97,6 +97,7 @@ nav .nav-link{display:inline-block;width:22px;height:22px;overflow:hidden;margin
 #nav-network-link{background-position:0px -177px;}#nav-network-link:hover{background-position:-22px -177px;}
 #nav-search-link{background-position:0 -44px;}#nav-search-link:hover{background-position:-22px -44px;}
 #jot-title,#profile-link,#profile-title,#profile-attach-wrapper,#profile-audio,#profile-link,#profile-location,#profile-nolocation,#profile-title,#profile-upload-wrapper,#profile-video,#profile-jot-submit,#wall-image-upload,#wall-file-upload,#wall-image-upload-div,#wall-file-upload-div,.icon,.hover,.focus,.pointer{cursor:pointer;}
+.sparkle{cursor:url("icons/sparkle.cur"),pointer;}
 div.jGrowl div.notice{background:#511919 url("../../../images/icons/48/notice.png") no-repeat 5px center;color:white;padding-left:58px;margin-top:50px;}
 div.jGrowl div.info{background:#364e59 url("../../../images/icons/48/info.png") no-repeat 5px center;color:white;padding-left:58px;margin-top:50px;}
 #nav-notifications-menu{margin:30px 0 0 -20px;width:275px;max-height:300px;overflow-y:auto;font-size:9pt;}#nav-notifications-menu img{float:left;margin-right:5px;}
index e18f9a01b0360b89a0eea5ebde3b71381ed0afdf..87b405470cf06790d7a0ef367acadf3f72202c9e 100644 (file)
@@ -595,6 +595,9 @@ nav .nav-link {
 .pointer {
     cursor: pointer;
 }
+.sparkle {
+    cursor: url("icons/sparkle.cur"), pointer;
+}
 //* popup notifications */
 div.jGrowl div {
     &.notice {
index 8ffae040373859a82222b9b9b88bd9b374653bf6..7b17d9b8299e21d7bf23df02cccea304d71ffb81 100644 (file)
@@ -52,7 +52,7 @@
                                <li><a href="#" id="filer-$item.id" onclick="itemFiler($item.id); return false;" class="filer-item icon file-as" title="$item.filer"></a></li>
                                {{ endif }}
                                {{ if $item.plink }}
-                               <li class="wall-item-links-wrapper"><a href="$item.plink.href" title="$item.plink.title" target="external-link" class="icon remote-link"></a></li>
+                               <li class="wall-item-links-wrapper"><a href="$item.plink.href" title="$item.plink.title" target="external-link" class="icon remote-link$item.sparkle"></a></li>
                                {{ endif }}
                                {{ if $item.edpost }}
                                <li><a class="editpost icon pencil" href="$item.edpost.0" title="$item.edpost.1"></a></li>
index 84da598cd652eefad8afa2d76b40ece900b86458..a308bb07a5cc61eb3c53dd08a55e7730ddc0c41c 100644 (file)
@@ -59,7 +59,7 @@ class="icon recycle wall-item-share-buttons"  title="$item.vote.share.0" onclick
                                <li class="wall-item-filer-wrapper"><a href="#" id="filer-$item.id" onclick="itemFiler($item.id); return false;" class="filer-item icon file-as" title="$item.star.filer"></a></li>
                        {{ endif }}
                        {{ if $item.plink }}
-                               <li class="wall-item-links-wrapper"><a href="$item.plink.href" title="$item.plink.title" target="external-link" class="icon remote-link"></a></li>
+                               <li class="wall-item-links-wrapper"><a href="$item.plink.href" title="$item.plink.title" target="external-link" class="icon remote-link$item.sparkle"></a></li>
                        {{ endif }}
                        {{ if $item.edpost }}
                                <li><a class="editpost icon pencil" href="$item.edpost.0" title="$item.edpost.1"></a></li>
index 997c6d315af52b6534143710ad82d0eb9e6a4f9e..1be81d738e17200736a5cb8a144dd82bdb3d9ea1 100644 (file)
@@ -560,7 +560,12 @@ input#dfrn-url {
        clear: both;
        margin-bottom: 30px;
 }
-
+.aprofile dt {
+       font-weight: bold;
+}
+#page-profile .title {
+       font-weight: bold;
+}
 #profile-vcard-break {
        clear: both;
 }
diff --git a/view/theme/facepark/screenshot.jpg b/view/theme/facepark/screenshot.jpg
new file mode 100644 (file)
index 0000000..37adcc5
Binary files /dev/null and b/view/theme/facepark/screenshot.jpg differ
diff --git a/view/theme/quattro/Makefile b/view/theme/quattro/Makefile
new file mode 100644 (file)
index 0000000..5df58c8
--- /dev/null
@@ -0,0 +1,5 @@
+all:
+       cd dark; make; cd ..
+       cd green; make; cd ..
+
+
index 803a2c2f7bec03d34c86311c6bed0aa1d46fe8c8..72febbf525dbfd01c8795803ceff82d85053863d 100644 (file)
   overflow: hidden;
   text-indent: -9999px;
   padding: 1px;
+  min-width: 22px;
+  height: 22px;
 }
 .icon.text {
   text-indent: 0px;
 }
+.icon.notify {
+  background-image: url("../../../images/icons/22/notify_off.png");
+}
+.icon.gear {
+  background-image: url("../../../images/icons/22/gear.png");
+}
+.icon.like {
+  background-image: url("icons/like.png");
+}
+.icon.dislike {
+  background-image: url("icons/dislike.png");
+}
+.icon.add {
+  background-image: url("../../../images/icons/22/add.png");
+}
+.icon.delete {
+  background-image: url("../../../images/icons/22/delete.png");
+}
+.icon.edit {
+  background-image: url("../../../images/icons/22/edit.png");
+}
+.icon.star {
+  background-image: url("../../../images/icons/22/star.png");
+}
+.icon.menu {
+  background-image: url("../../../images/icons/22/menu.png");
+}
+.icon.link {
+  background-image: url("../../../images/icons/22/link.png");
+}
+.icon.lock {
+  background-image: url("../../../images/icons/22/lock.png");
+}
+.icon.unlock {
+  background-image: url("../../../images/icons/22/unlock.png");
+}
+.icon.plugin {
+  background-image: url("../../../images/icons/22/plugin.png");
+}
+.icon.type-unkn {
+  background-image: url("../../../images/icons/22/zip.png");
+}
+.icon.type-audio {
+  background-image: url("../../../images/icons/22/audio.png");
+}
+.icon.type-video {
+  background-image: url("../../../images/icons/22/video.png");
+}
+.icon.type-image {
+  background-image: url("../../../images/icons/22/image.png");
+}
+.icon.type-text {
+  background-image: url("../../../images/icons/22/text.png");
+}
+.icon.language {
+  background-image: url("icons/language.png");
+}
+.icon.text {
+  padding: 10px 0px 0px 25px;
+}
 .icon.s10 {
   min-width: 10px;
   height: 10px;
 .icon.s10.gear {
   background-image: url("../../../images/icons/10/gear.png");
 }
+.icon.s10.like {
+  background-image: url("icons/like.png");
+}
+.icon.s10.dislike {
+  background-image: url("icons/dislike.png");
+}
 .icon.s10.add {
   background-image: url("../../../images/icons/10/add.png");
 }
 .icon.s16.gear {
   background-image: url("../../../images/icons/16/gear.png");
 }
+.icon.s16.like {
+  background-image: url("icons/like.png");
+}
+.icon.s16.dislike {
+  background-image: url("icons/dislike.png");
+}
 .icon.s16.add {
   background-image: url("../../../images/icons/16/add.png");
 }
 .icon.s22.gear {
   background-image: url("../../../images/icons/22/gear.png");
 }
+.icon.s22.like {
+  background-image: url("icons/like.png");
+}
+.icon.s22.dislike {
+  background-image: url("icons/dislike.png");
+}
 .icon.s22.add {
   background-image: url("../../../images/icons/22/add.png");
 }
 .icon.s48.gear {
   background-image: url("../../../images/icons/48/gear.png");
 }
+.icon.s48.like {
+  background-image: url("icons/like.png");
+}
+.icon.s48.dislike {
+  background-image: url("icons/dislike.png");
+}
 .icon.s48.add {
   background-image: url("../../../images/icons/48/add.png");
 }
   height: 16px;
   background-position: 0px 0px;
 }
+
+.sparkle {
+       cursor: url('icons/lock.cur'), pointer;
+}
+
 /* global */
 body {
   font-family: Liberation Sans, helvetica, arial, clean, sans-serif;
@@ -267,7 +358,8 @@ body {
 h4 {
   font-size: 1.1em;
 }
-a, a:link {
+a,
+a:link {
   color: #005c94;
   text-decoration: none;
 }
@@ -336,6 +428,9 @@ code {
 .tool .action {
   float: right;
 }
+.tool > img {
+  float: left;
+}
 /* popup notifications */
 #jGrowl.top-right {
   top: 30px;
@@ -489,7 +584,8 @@ nav #nav-site-linkmenu .menu-popup {
   right: 0px;
   left: auto;
 }
-nav #nav-notifications-linkmenu.on .icon.s22.notify, nav #nav-notifications-linkmenu.selected .icon.s22.notify {
+nav #nav-notifications-linkmenu.on .icon.s22.notify,
+nav #nav-notifications-linkmenu.selected .icon.s22.notify {
   background-image: url("../../../images/icons/22/notify_on.png");
 }
 nav #nav-apps-link.selected {
@@ -599,6 +695,9 @@ aside {
   padding: 0px 10px 0px 20px;
   border-right: 1px solid #bdcdd4;
 }
+aside .profile-edit-side-div {
+  display: none;
+}
 aside .vcard .fn {
   font-size: 16px;
   font-weight: bold;
@@ -678,11 +777,15 @@ aside #profiles-menu {
   height: 48px;
 }
 /* group member */
-#contact-edit-drop-link, .mail-list-delete-wrapper, .group-delete-wrapper {
+#contact-edit-drop-link,
+.mail-list-delete-wrapper,
+.group-delete-wrapper {
   float: right;
   margin-right: 50px;
 }
-#contact-edit-drop-link .drophide, .mail-list-delete-wrapper .drophide, .group-delete-wrapper .drophide {
+#contact-edit-drop-link .drophide,
+.mail-list-delete-wrapper .drophide,
+.group-delete-wrapper .drophide {
   background-image: url('../../../images/icons/22/delete.png');
   display: block;
   width: 22px;
@@ -691,7 +794,9 @@ aside #profiles-menu {
   position: relative;
   top: -50px;
 }
-#contact-edit-drop-link .drop, .mail-list-delete-wrapper .drop, .group-delete-wrapper .drop {
+#contact-edit-drop-link .drop,
+.mail-list-delete-wrapper .drop,
+.group-delete-wrapper .drop {
   background-image: url('../../../images/icons/22/delete.png');
   display: block;
   width: 22px;
@@ -821,7 +926,8 @@ section {
   display: table;
   width: 750px;
 }
-.wall-item-container .wall-item-item, .wall-item-container .wall-item-bottom {
+.wall-item-container .wall-item-item,
+.wall-item-container .wall-item-bottom {
   display: table-row;
 }
 .wall-item-container .wall-item-bottom {
@@ -859,11 +965,13 @@ section {
 .wall-item-container .wall-item-content img {
   max-width: 710px;
 }
-.wall-item-container .wall-item-links, .wall-item-container .wall-item-actions {
+.wall-item-container .wall-item-links,
+.wall-item-container .wall-item-actions {
   display: table-cell;
   vertical-align: middle;
 }
-.wall-item-container .wall-item-links .icon, .wall-item-container .wall-item-actions .icon {
+.wall-item-container .wall-item-links .icon,
+.wall-item-container .wall-item-actions .icon {
   opacity: 0.5;
   -webkit-transition: all 0.2s ease-in-out;
   -moz-transition: all 0.2s ease-in-out;
@@ -871,7 +979,8 @@ section {
   -ms-transition: all 0.2s ease-in-out;
   transition: all 0.2s ease-in-out;
 }
-.wall-item-container .wall-item-links .icon:hover, .wall-item-container .wall-item-actions .icon:hover {
+.wall-item-container .wall-item-links .icon:hover,
+.wall-item-container .wall-item-actions .icon:hover {
   opacity: 1;
   -webkit-transition: all 0.2s ease-in-out;
   -moz-transition: all 0.2s ease-in-out;
@@ -1015,9 +1124,6 @@ section {
   opacity: 0.5;
 }
 .wwto {
-  position: absolute !important;
-  width: 25px;
-  height: 25px;
   background: #FFFFFF;
   border: 2px solid #364e59;
   height: 25px;
@@ -1248,7 +1354,9 @@ section {
     height: 18px;
 }*/
 /** acl **/
-#photo-edit-perms-select, #photos-upload-permissions-wrapper, #profile-jot-acl-wrapper {
+#photo-edit-perms-select,
+#photos-upload-permissions-wrapper,
+#profile-jot-acl-wrapper {
   display: block!important;
 }
 #acl-wrapper {
@@ -1407,10 +1515,12 @@ ul.tabs li .active {
   float: left;
   width: 200px;
 }
-.field input, .field textarea {
+.field input,
+.field textarea {
   width: 400px;
 }
-.field input[type="checkbox"], .field input[type="radio"] {
+.field input[type="checkbox"],
+.field input[type="radio"] {
   width: auto;
 }
 .field textarea {
@@ -1537,10 +1647,126 @@ ul.tabs li .active {
   width: 50px;
   float: left;
 }
-/* photo */
-.lframe {
+/* photo albums */
+#photo-edit-link-wrap {
+  margin-bottom: 10px;
+}
+#album-edit-link {
+  border-right: 1px solid #364e59;
+  float: left;
+  padding-right: 5px;
+  margin-right: 5px;
+}
+#photo-edit-link,
+#album-edit-link a {
+  background: url("../../../images/icons/16/edit.png") no-repeat left center;
+  padding-left: 18px;
+}
+#photo-toprofile-link {
+  background: url("../../../images/icons/16/user.png") no-repeat left center;
+  padding-left: 18px;
+}
+.photos-upload-link a,
+#photo-top-upload-link {
+  background: url("../../../images/icons/16/add.png") no-repeat left center;
+  padding-left: 18px;
+}
+.photo-top-image-wrapper,
+.photo-album-image-wrapper {
   float: left;
   margin: 0px 10px 10px 0px;
+  width: 150px;
+  height: 150px;
+  position: relative;
+  overflow: hidden;
+}
+.photo-top-image-wrapper img,
+.photo-album-image-wrapper img {
+  width: 150px;
+}
+.photo-top-image-wrapper .photo-top-album-name,
+.photo-album-image-wrapper .photo-top-album-name,
+.photo-top-image-wrapper .caption,
+.photo-album-image-wrapper .caption {
+  position: absolute;
+  color: #2d2d2d;
+  background-color: #ffffff;
+  width: 100%;
+  -webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
+  -moz-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
+  box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
+  -webkit-transition: all 0.5s ease-in-out;
+  -moz-transition: all 0.5s ease-in-out;
+  -o-transition: all 0.5s ease-in-out;
+  -ms-transition: all 0.5s ease-in-out;
+  transition: all 0.5s ease-in-out;
+  bottom: -150px;
+}
+.photo-top-image-wrapper:hover .photo-top-album-name,
+.photo-album-image-wrapper:hover .photo-top-album-name,
+.photo-top-image-wrapper:hover .caption,
+.photo-album-image-wrapper:hover .caption {
+  bottom: 0px;
+  -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
+  -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
+  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
+  -webkit-transition: all 0.5s ease-in-out;
+  -moz-transition: all 0.5s ease-in-out;
+  -o-transition: all 0.5s ease-in-out;
+  -ms-transition: all 0.5s ease-in-out;
+  transition: all 0.5s ease-in-out;
+}
+#photo-photo {
+  display: block;
+  width: 660px;
+  padding: 50px;
+  margin-bottom: 0px;
+  text-align: center;
+  background-color: #999999;
+}
+#photo-photo img {
+  max-width: 560px;
+}
+#photo-album-title {
+  background: url("../../../images/icons/22/image.png") no-repeat top left;
+  padding-left: 23px;
+  min-height: 22px;
+}
+#photo-album-title a {
+  display: block;
+  padding-top: 5px;
+}
+#photo-caption {
+  display: block;
+  width: 660px;
+  min-height: 55px;
+  background-color: #cccccc;
+  padding: 0 50px 0 50px;
+}
+#photo-next-link > a > div {
+  background: url("icons/next.png") no-repeat center center;
+  float: right;
+  width: 50px;
+  height: 50px;
+}
+#photo-prev-link > a > div {
+  background: url("icons/prev.png") no-repeat center center;
+  float: left;
+  width: 50px;
+  height: 50px;
+}
+#photo-like-div {
+  display: block;
+  width: 660px;
+  height: 30px;
+  background-color: #cccccc;
+  padding: 0 50px 0 50px;
+}
+#photo-like-div .icon {
+  float: left;
+}
+#photo-like-div .like-rotator {
+  float: right;
 }
 /* profile match wrapper */
 .profile-match-wrapper {
@@ -1641,13 +1867,15 @@ ul.tabs li .active {
   transition: all 0.2s ease-in-out;
 }
 /* theme screenshot */
-.screenshot, #theme-preview {
+.screenshot,
+#theme-preview {
   position: absolute;
   width: 202px;
   left: 70%;
   top: 50px;
 }
-.screenshot img, #theme-preview img {
+.screenshot img,
+#theme-preview img {
   width: 200px;
   height: 150px;
 }
index ecf4ff9860ea2130a08d38a601180553a470e13f..b1efb557fddf8c94235a8826ea390846ad694162 100644 (file)
   overflow: hidden;
   text-indent: -9999px;
   padding: 1px;
+  min-width: 22px;
+  height: 22px;
 }
 .icon.text {
   text-indent: 0px;
 }
+.icon.notify {
+  background-image: url("../../../images/icons/22/notify_off.png");
+}
+.icon.gear {
+  background-image: url("../../../images/icons/22/gear.png");
+}
+.icon.like {
+  background-image: url("icons/like.png");
+}
+.icon.dislike {
+  background-image: url("icons/dislike.png");
+}
+.icon.add {
+  background-image: url("../../../images/icons/22/add.png");
+}
+.icon.delete {
+  background-image: url("../../../images/icons/22/delete.png");
+}
+.icon.edit {
+  background-image: url("../../../images/icons/22/edit.png");
+}
+.icon.star {
+  background-image: url("../../../images/icons/22/star.png");
+}
+.icon.menu {
+  background-image: url("../../../images/icons/22/menu.png");
+}
+.icon.link {
+  background-image: url("../../../images/icons/22/link.png");
+}
+.icon.lock {
+  background-image: url("../../../images/icons/22/lock.png");
+}
+.icon.unlock {
+  background-image: url("../../../images/icons/22/unlock.png");
+}
+.icon.plugin {
+  background-image: url("../../../images/icons/22/plugin.png");
+}
+.icon.type-unkn {
+  background-image: url("../../../images/icons/22/zip.png");
+}
+.icon.type-audio {
+  background-image: url("../../../images/icons/22/audio.png");
+}
+.icon.type-video {
+  background-image: url("../../../images/icons/22/video.png");
+}
+.icon.type-image {
+  background-image: url("../../../images/icons/22/image.png");
+}
+.icon.type-text {
+  background-image: url("../../../images/icons/22/text.png");
+}
+.icon.language {
+  background-image: url("icons/language.png");
+}
+.icon.text {
+  padding: 10px 0px 0px 25px;
+}
 .icon.s10 {
   min-width: 10px;
   height: 10px;
 .icon.s10.gear {
   background-image: url("../../../images/icons/10/gear.png");
 }
+.icon.s10.like {
+  background-image: url("icons/like.png");
+}
+.icon.s10.dislike {
+  background-image: url("icons/dislike.png");
+}
 .icon.s10.add {
   background-image: url("../../../images/icons/10/add.png");
 }
 .icon.s16.gear {
   background-image: url("../../../images/icons/16/gear.png");
 }
+.icon.s16.like {
+  background-image: url("icons/like.png");
+}
+.icon.s16.dislike {
+  background-image: url("icons/dislike.png");
+}
 .icon.s16.add {
   background-image: url("../../../images/icons/16/add.png");
 }
 .icon.s22.gear {
   background-image: url("../../../images/icons/22/gear.png");
 }
+.icon.s22.like {
+  background-image: url("icons/like.png");
+}
+.icon.s22.dislike {
+  background-image: url("icons/dislike.png");
+}
 .icon.s22.add {
   background-image: url("../../../images/icons/22/add.png");
 }
 .icon.s48.gear {
   background-image: url("../../../images/icons/48/gear.png");
 }
+.icon.s48.like {
+  background-image: url("icons/like.png");
+}
+.icon.s48.dislike {
+  background-image: url("icons/dislike.png");
+}
 .icon.s48.add {
   background-image: url("../../../images/icons/48/add.png");
 }
   height: 16px;
   background-position: 0px 0px;
 }
+
+.sparkle {
+       cursor: url('icons/lock.cur'), pointer;
+}
+
 /* global */
 body {
   font-family: Liberation Sans, helvetica, arial, clean, sans-serif;
@@ -267,7 +358,8 @@ body {
 h4 {
   font-size: 1.1em;
 }
-a, a:link {
+a,
+a:link {
   color: #009100;
   text-decoration: none;
 }
@@ -336,6 +428,9 @@ code {
 .tool .action {
   float: right;
 }
+.tool > img {
+  float: left;
+}
 /* popup notifications */
 #jGrowl.top-right {
   top: 30px;
@@ -489,7 +584,8 @@ nav #nav-site-linkmenu .menu-popup {
   right: 0px;
   left: auto;
 }
-nav #nav-notifications-linkmenu.on .icon.s22.notify, nav #nav-notifications-linkmenu.selected .icon.s22.notify {
+nav #nav-notifications-linkmenu.on .icon.s22.notify,
+nav #nav-notifications-linkmenu.selected .icon.s22.notify {
   background-image: url("../../../images/icons/22/notify_on.png");
 }
 nav #nav-apps-link.selected {
@@ -599,6 +695,9 @@ aside {
   padding: 0px 10px 0px 20px;
   border-right: 1px solid #bdcdd4;
 }
+aside .profile-edit-side-div {
+  display: none;
+}
 aside .vcard .fn {
   font-size: 16px;
   font-weight: bold;
@@ -678,11 +777,15 @@ aside #profiles-menu {
   height: 48px;
 }
 /* group member */
-#contact-edit-drop-link, .mail-list-delete-wrapper, .group-delete-wrapper {
+#contact-edit-drop-link,
+.mail-list-delete-wrapper,
+.group-delete-wrapper {
   float: right;
   margin-right: 50px;
 }
-#contact-edit-drop-link .drophide, .mail-list-delete-wrapper .drophide, .group-delete-wrapper .drophide {
+#contact-edit-drop-link .drophide,
+.mail-list-delete-wrapper .drophide,
+.group-delete-wrapper .drophide {
   background-image: url('../../../images/icons/22/delete.png');
   display: block;
   width: 22px;
@@ -691,7 +794,9 @@ aside #profiles-menu {
   position: relative;
   top: -50px;
 }
-#contact-edit-drop-link .drop, .mail-list-delete-wrapper .drop, .group-delete-wrapper .drop {
+#contact-edit-drop-link .drop,
+.mail-list-delete-wrapper .drop,
+.group-delete-wrapper .drop {
   background-image: url('../../../images/icons/22/delete.png');
   display: block;
   width: 22px;
@@ -821,7 +926,8 @@ section {
   display: table;
   width: 750px;
 }
-.wall-item-container .wall-item-item, .wall-item-container .wall-item-bottom {
+.wall-item-container .wall-item-item,
+.wall-item-container .wall-item-bottom {
   display: table-row;
 }
 .wall-item-container .wall-item-bottom {
@@ -859,11 +965,13 @@ section {
 .wall-item-container .wall-item-content img {
   max-width: 710px;
 }
-.wall-item-container .wall-item-links, .wall-item-container .wall-item-actions {
+.wall-item-container .wall-item-links,
+.wall-item-container .wall-item-actions {
   display: table-cell;
   vertical-align: middle;
 }
-.wall-item-container .wall-item-links .icon, .wall-item-container .wall-item-actions .icon {
+.wall-item-container .wall-item-links .icon,
+.wall-item-container .wall-item-actions .icon {
   opacity: 0.5;
   -webkit-transition: all 0.2s ease-in-out;
   -moz-transition: all 0.2s ease-in-out;
@@ -871,7 +979,8 @@ section {
   -ms-transition: all 0.2s ease-in-out;
   transition: all 0.2s ease-in-out;
 }
-.wall-item-container .wall-item-links .icon:hover, .wall-item-container .wall-item-actions .icon:hover {
+.wall-item-container .wall-item-links .icon:hover,
+.wall-item-container .wall-item-actions .icon:hover {
   opacity: 1;
   -webkit-transition: all 0.2s ease-in-out;
   -moz-transition: all 0.2s ease-in-out;
@@ -1015,9 +1124,6 @@ section {
   opacity: 0.5;
 }
 .wwto {
-  position: absolute !important;
-  width: 25px;
-  height: 25px;
   background: #FFFFFF;
   border: 2px solid #364e59;
   height: 25px;
@@ -1248,7 +1354,9 @@ section {
     height: 18px;
 }*/
 /** acl **/
-#photo-edit-perms-select, #photos-upload-permissions-wrapper, #profile-jot-acl-wrapper {
+#photo-edit-perms-select,
+#photos-upload-permissions-wrapper,
+#profile-jot-acl-wrapper {
   display: block!important;
 }
 #acl-wrapper {
@@ -1407,10 +1515,12 @@ ul.tabs li .active {
   float: left;
   width: 200px;
 }
-.field input, .field textarea {
+.field input,
+.field textarea {
   width: 400px;
 }
-.field input[type="checkbox"], .field input[type="radio"] {
+.field input[type="checkbox"],
+.field input[type="radio"] {
   width: auto;
 }
 .field textarea {
@@ -1537,10 +1647,126 @@ ul.tabs li .active {
   width: 50px;
   float: left;
 }
-/* photo */
-.lframe {
+/* photo albums */
+#photo-edit-link-wrap {
+  margin-bottom: 10px;
+}
+#album-edit-link {
+  border-right: 1px solid #364e59;
+  float: left;
+  padding-right: 5px;
+  margin-right: 5px;
+}
+#photo-edit-link,
+#album-edit-link a {
+  background: url("../../../images/icons/16/edit.png") no-repeat left center;
+  padding-left: 18px;
+}
+#photo-toprofile-link {
+  background: url("../../../images/icons/16/user.png") no-repeat left center;
+  padding-left: 18px;
+}
+.photos-upload-link a,
+#photo-top-upload-link {
+  background: url("../../../images/icons/16/add.png") no-repeat left center;
+  padding-left: 18px;
+}
+.photo-top-image-wrapper,
+.photo-album-image-wrapper {
   float: left;
   margin: 0px 10px 10px 0px;
+  width: 150px;
+  height: 150px;
+  position: relative;
+  overflow: hidden;
+}
+.photo-top-image-wrapper img,
+.photo-album-image-wrapper img {
+  width: 150px;
+}
+.photo-top-image-wrapper .photo-top-album-name,
+.photo-album-image-wrapper .photo-top-album-name,
+.photo-top-image-wrapper .caption,
+.photo-album-image-wrapper .caption {
+  position: absolute;
+  color: #2d2d2d;
+  background-color: #ffffff;
+  width: 100%;
+  -webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
+  -moz-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
+  box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
+  -webkit-transition: all 0.5s ease-in-out;
+  -moz-transition: all 0.5s ease-in-out;
+  -o-transition: all 0.5s ease-in-out;
+  -ms-transition: all 0.5s ease-in-out;
+  transition: all 0.5s ease-in-out;
+  bottom: -150px;
+}
+.photo-top-image-wrapper:hover .photo-top-album-name,
+.photo-album-image-wrapper:hover .photo-top-album-name,
+.photo-top-image-wrapper:hover .caption,
+.photo-album-image-wrapper:hover .caption {
+  bottom: 0px;
+  -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
+  -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
+  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
+  -webkit-transition: all 0.5s ease-in-out;
+  -moz-transition: all 0.5s ease-in-out;
+  -o-transition: all 0.5s ease-in-out;
+  -ms-transition: all 0.5s ease-in-out;
+  transition: all 0.5s ease-in-out;
+}
+#photo-photo {
+  display: block;
+  width: 660px;
+  padding: 50px;
+  margin-bottom: 0px;
+  text-align: center;
+  background-color: #999999;
+}
+#photo-photo img {
+  max-width: 560px;
+}
+#photo-album-title {
+  background: url("../../../images/icons/22/image.png") no-repeat top left;
+  padding-left: 23px;
+  min-height: 22px;
+}
+#photo-album-title a {
+  display: block;
+  padding-top: 5px;
+}
+#photo-caption {
+  display: block;
+  width: 660px;
+  min-height: 55px;
+  background-color: #cccccc;
+  padding: 0 50px 0 50px;
+}
+#photo-next-link > a > div {
+  background: url("icons/next.png") no-repeat center center;
+  float: right;
+  width: 50px;
+  height: 50px;
+}
+#photo-prev-link > a > div {
+  background: url("icons/prev.png") no-repeat center center;
+  float: left;
+  width: 50px;
+  height: 50px;
+}
+#photo-like-div {
+  display: block;
+  width: 660px;
+  height: 30px;
+  background-color: #cccccc;
+  padding: 0 50px 0 50px;
+}
+#photo-like-div .icon {
+  float: left;
+}
+#photo-like-div .like-rotator {
+  float: right;
 }
 /* profile match wrapper */
 .profile-match-wrapper {
@@ -1641,13 +1867,15 @@ ul.tabs li .active {
   transition: all 0.2s ease-in-out;
 }
 /* theme screenshot */
-.screenshot, #theme-preview {
+.screenshot,
+#theme-preview {
   position: absolute;
   width: 202px;
   left: 70%;
   top: 50px;
 }
-.screenshot img, #theme-preview img {
+.screenshot img,
+#theme-preview img {
   width: 200px;
   height: 150px;
 }
index ae7459dfc68c5cb036b12211cce0ba8dba3ca1de..f9be4cc7237a722d4390733c56ae062c18b913ff 100644 (file)
@@ -5,6 +5,9 @@
        &.notify { background-image: url("../../../images/icons/@{size}/notify_off.png"); }
        &.gear   { background-image: url("../../../images/icons/@{size}/gear.png"); }
        
+    &.like      { background-image: url("icons/like.png"); }
+       &.dislike        { background-image: url("icons/dislike.png"); }
+       
        &.add           { background-image: url("../../../images/icons/@{size}/add.png"); }
        &.delete        { background-image: url("../../../images/icons/@{size}/delete.png"); }
        &.edit          { background-image: url("../../../images/icons/@{size}/edit.png"); }
                text-indent: 0px;
        }
 
+    min-width:22px; height: 22px;
+    .icons(22);
+    &.text { padding: 10px 0px 0px 25px;  }
+
        &.s10 {
                min-width:10px; height: 10px;
                .icons(10);
index 40b53259a20a616c8b35e779cb1c086023a17125..0fcce4d5abe02fd91f47054311ee2cc6c567eaa3 100644 (file)
Binary files a/view/theme/quattro/icons/addon_off.png and b/view/theme/quattro/icons/addon_off.png differ
index 3d9490f1528f1829a7fcfdf48cb0e59694bcc27b..79ce07f0e353d7803566bf833dd095a59f2ebc99 100644 (file)
Binary files a/view/theme/quattro/icons/addon_on.png and b/view/theme/quattro/icons/addon_on.png differ
diff --git a/view/theme/quattro/icons/dislike.png b/view/theme/quattro/icons/dislike.png
new file mode 100644 (file)
index 0000000..23de426
Binary files /dev/null and b/view/theme/quattro/icons/dislike.png differ
diff --git a/view/theme/quattro/icons/like.png b/view/theme/quattro/icons/like.png
new file mode 100644 (file)
index 0000000..b65edcc
Binary files /dev/null and b/view/theme/quattro/icons/like.png differ
diff --git a/view/theme/quattro/icons/lock.cur b/view/theme/quattro/icons/lock.cur
new file mode 100644 (file)
index 0000000..892c5e8
Binary files /dev/null and b/view/theme/quattro/icons/lock.cur differ
diff --git a/view/theme/quattro/icons/next.png b/view/theme/quattro/icons/next.png
new file mode 100644 (file)
index 0000000..7b5e25b
Binary files /dev/null and b/view/theme/quattro/icons/next.png differ
diff --git a/view/theme/quattro/icons/prev.png b/view/theme/quattro/icons/prev.png
new file mode 100644 (file)
index 0000000..55c1464
Binary files /dev/null and b/view/theme/quattro/icons/prev.png differ
diff --git a/view/theme/quattro/photo_view.tpl b/view/theme/quattro/photo_view.tpl
new file mode 100644 (file)
index 0000000..3b7a662
--- /dev/null
@@ -0,0 +1,37 @@
+<div id="live-display"></div>
+<h3 id="photo-album-title"><a href="$album.0">$album.1</a></h3>
+
+<div id="photo-edit-link-wrap">
+{{ if $tools }}
+<a id="photo-edit-link" href="$tools.edit.0">$tools.edit.1</a>
+|
+<a id="photo-toprofile-link" href="$tools.profile.0">$tools.profile.1</a>
+{{ endif }}
+{{ if $lock }} | <img src="images/lock_icon.gif" class="lockview" alt="$lock" onclick="lockview(event,'photo/$id');" /> {{ endif }}
+</div>
+
+<div id="photo-photo"><a href="$photo.href" title="$photo.title"><img src="$photo.src" /></a></div>
+{{ if $prevlink }}<div id="photo-prev-link"><a href="$prevlink.0">$prevlink.1</a></div>{{ endif }}
+{{ if $nextlink }}<div id="photo-next-link"><a href="$nextlink.0">$nextlink.1</a></div>{{ endif }}
+<div id="photo-caption">$desc</div>
+{{ if $tags }}
+<div id="in-this-photo-text">$tags.0</div>
+<div id="in-this-photo">$tags.1</div>
+{{ endif }}
+{{ if $tags.2 }}<div id="tag-remove"><a href="$tags.2">$tags.3</a></div>{{ endif }}
+
+{{ if $edit }}$edit{{ endif }}
+
+{{ if $likebuttons }}
+<div id="photo-like-div">
+       $likebuttons
+       $like
+       $dislike        
+</div>
+{{ endif }}
+<div class="wall-item-comment-wrapper">
+    $comments
+</div>
+
+$paginate
+
index 9099f0be163f4553179e80b36e73e7136bf406cc..0dac79bf9c2ceedce648491342fe22948f9b6fd4 100644 (file)
@@ -27,13 +27,17 @@ h4 { font-size: 1.1em }
 
 .opaque(@v: 0.5){
        opacity: @v;
-       -webkit-transition: all 0.2s ease-in-out;
-       -moz-transition: all 0.2s ease-in-out;
-       -o-transition: all 0.2s ease-in-out;
-       -ms-transition: all 0.2s ease-in-out;
-       transition: all 0.2s ease-in-out;
+       .transition();
 }
 
+.transition(@d: 0.2s){
+       -webkit-transition: all @d ease-in-out;
+       -moz-transition: all @d ease-in-out;
+       -o-transition: all @d ease-in-out;
+       -ms-transition: all @d ease-in-out;
+       transition: all @d ease-in-out;
+}      
+
 
 a, a:link { color: @Link; text-decoration: none; }
 a:visited { color: @LinkVisited; text-decoration: none; }
@@ -81,6 +85,7 @@ code {
        height: auto; overflow: auto;
        .label { float: left;}
        .action { float: right; }
+       > img { float: left; }
 }
 
 
@@ -282,6 +287,8 @@ aside {
        padding:0px 10px 0px 20px;
        border-right: 1px solid @AsideBorder;
 
+       .profile-edit-side-div { display: none; }
+
        .vcard {
                .fn { font-size: 16px; font-weight: bold; margin-bottom: 5px; }
                .title { margin-bottom: 5px; }
@@ -1068,12 +1075,102 @@ ul.tabs {
        width: 50px; float: left;
 }
 
-/* photo */
-.lframe {
+/* photo albums */
+@photosize: 150px;
+
+#photo-edit-link-wrap { margin-bottom: 10px; }
+       
+#album-edit-link {
+       border-right: 1px solid @MenuBorder;
+       float: left;
+       padding-right: 5px;
+       margin-right: 5px;
+}
+#photo-edit-link,
+#album-edit-link a {
+       background: url("../../../images/icons/16/edit.png") no-repeat left center;
+       padding-left: 18px;
+}
+#photo-toprofile-link {
+       background: url("../../../images/icons/16/user.png") no-repeat left center;
+       padding-left: 18px;
+}
+
+.photos-upload-link a,
+#photo-top-upload-link {
+       background: url("../../../images/icons/16/add.png") no-repeat left center;
+       padding-left: 18px;
+}
+
+
+.photo-top-image-wrapper,
+.photo-album-image-wrapper {
        float: left;
        margin: 0px 10px 10px 0px;
+       width:@photosize; height: @photosize;
+       position: relative;
+       overflow: hidden;
+       
+       img { width: @photosize; }
+               
+       .photo-top-album-name,
+       .caption{
+               position: absolute;
+               color: @Menu;
+               background-color: @MenuBg;
+               
+               width: 100%;
+               .shadow(0px, 5px);
+               .transition(0.5s);
+               bottom: -@photosize;
+       }
+       
+       &:hover .photo-top-album-name,
+       &:hover .caption {
+               bottom: 0px;
+               .shadow(0px, 0px);
+               .transition(0.5s);
+       }
+}
+
+#photo-photo {
+       display: block; width: 660px;
+       padding: 50px; margin-bottom: 0px;
+       text-align: center;
+       background-color: @Grey3;
+       img { max-width: 560px; }
+}
+#photo-album-title {
+       background: url("../../../images/icons/22/image.png") no-repeat top left;
+       padding-left: 23px;
+       min-height: 22px;
+       a { display: block; padding-top: 5px; }
 }
 
+#photo-caption {
+       display: block; width: 660px;
+       min-height: 55px;
+       background-color:  @Grey2;
+       padding:0 50px 0 50px;
+}
+#photo-next-link > a > div {
+       background: url("icons/next.png") no-repeat center center;
+       float: right;
+       width: 50px; height: 50px;
+}
+#photo-prev-link > a > div {
+       background: url("icons/prev.png") no-repeat center center;
+       float: left;
+       width: 50px; height: 50px;
+}
+#photo-like-div {
+       display: block; width: 660px;
+       height: 30px;
+       background-color:  @Grey2;
+       padding:0 50px 0 50px;
+       .icon {float: left;}
+       .like-rotator {float: right;}
+}
 /* profile match wrapper */
 .profile-match-wrapper {
        float: left;
index e771db0682f3e48f9db8a0c12606a51bd37d1580..2b12ce6324df79bc3ef7a3f750ec83aaa2b008cb 100644 (file)
@@ -23,7 +23,7 @@
                        <div class="wall-item-location">$item.location</div>    
                </div>
                <div class="wall-item-content">
-                       {{ if $item.title }}<h2><a href="$item.plink.href">$item.title</a></h2>{{ endif }}
+                       {{ if $item.title }}<h2><a href="$item.plink.href" class="$item.sparkle">$item.title</a></h2>{{ endif }}
                        $item.body
                </div>
        </div>
@@ -38,7 +38,7 @@
        </div>
        <div class="wall-item-bottom">
                <div class="">
-                       {{ if $item.plink }}<a class="icon s16 link" title="$item.plink.title" href="$item.plink.href">$item.plink.title</a>{{ endif }}
+                       {{ if $item.plink }}<a class="icon s16 link$item.sparkle" title="$item.plink.title" href="$item.plink.href">$item.plink.title</a>{{ endif }}
                </div>
                <div class="wall-item-actions">
                        <div class="wall-item-actions-author">
index 693ebaba6f3a81e082480e55770a8404224d49f2..a1d92773b61967f8f0bff83ff4b95fbaedf3c773 100644 (file)
@@ -27,7 +27,7 @@
                        <div class="wall-item-location">$item.location</div>    
                </div>
                <div class="wall-item-content">
-                       {{ if $item.title }}<h2><a href="$item.plink.href">$item.title</a></h2>{{ endif }}
+                       {{ if $item.title }}<h2><a href="$item.plink.href" class="$item.sparkle">$item.title</a></h2>{{ endif }}
                        $item.body
                </div>
        </div>
@@ -42,7 +42,7 @@
        </div>  
        <div class="wall-item-bottom">
                <div class="wall-item-links">
-                       {{ if $item.plink }}<a class="icon s16 link" title="$item.plink.title" href="$item.plink.href">$item.plink.title</a>{{ endif }}
+                       {{ if $item.plink }}<a class="icon s16 link$item.sparkle" title="$item.plink.title" href="$item.plink.href">$item.plink.title</a>{{ endif }}
                </div>
                <div class="wall-item-actions">
                        <div class="wall-item-actions-author">
index 4c0fdc22daf5d717b50c939f340bc1f8b938ee88..73b436fc61d0813d783ca0446e3dfc701ebaa6c1 100644 (file)
 .wall-item-tools {
        background: none;
 }
+.wall-item-body a:hover {
+       color: #ff6600;
+}
+
 
 .widget {
 /*     box-shadow: 4px 4px 3px 0 #444444; */
diff --git a/view/theme/testbubble/lock.cur b/view/theme/testbubble/lock.cur
new file mode 100644 (file)
index 0000000..892c5e8
Binary files /dev/null and b/view/theme/testbubble/lock.cur differ
index 1e63c7ef63056abe19bef689c5513abadf9f2432..1331a3f19073606a7fe3ec081f52609d16fbebe7 100644 (file)
@@ -2875,6 +2875,10 @@ tr {
 /* = Icons = */
 /* ========= */
 
+.sparkle {
+       cursor: url('lock.cur'), pointer;
+}
+
 .icon {
        display: block; width: 20px; height: 20px;
        background-image: url('icons.png');
@@ -3280,3 +3284,9 @@ ul.menu-popup {
 .notify-seen {
        background: #000;
 }
+
+
+/* Pages profile widget */
+#page-profile div#profile-page-list{
+margin-left: 45px;
+}
\ No newline at end of file
diff --git a/view/theme/vier/lock.cur b/view/theme/vier/lock.cur
new file mode 100644 (file)
index 0000000..892c5e8
Binary files /dev/null and b/view/theme/vier/lock.cur differ
index d8130e59fcfcf1d321f73cfeb92d249c76c519b0..64b3ba9740ef0d49431e95d86203dbafab68692e 100644 (file)
 .icon.s48.unlock {
   background-image: url("../../../images/icons/48/unlock.png");
 }
+.sparkle {
+       cursor: url('lock.cur'), pointer;
+}
+
 
 #contact-edit-links ul {
   list-style: none;
index dae33b3f75a209ad9deefa194927cf105109db3a..60dde76000d72012fea6933ea7bbea3776d4f54e 100644 (file)
@@ -48,7 +48,7 @@
                        </div>
                        {{ endif }}
                        {{ if $item.plink }}
-                               <div class="wall-item-links-wrapper"><a href="$item.plink.href" title="$item.plink.title" target="external-link" class="icon remote-link"></a></div>
+                               <div class="wall-item-links-wrapper"><a href="$item.plink.href" title="$item.plink.title" target="external-link" class="icon remote-link$item.sparkle"></a></div>
                        {{ endif }}
                        {{ if $item.edpost }}
                                <a class="editpost icon pencil" href="$item.edpost.0" title="$item.edpost.1"></a>
index a48acfec5bfad5ab2ff3fb2eccbff198857759dc..b7cca3fab9c9839ee71e6a6ac0aa16fefc6d6680 100644 (file)
@@ -52,7 +52,7 @@
                        </div>
                        {{ endif }}
                        {{ if $item.plink }}
-                               <div class="wall-item-links-wrapper"><a href="$item.plink.href" title="$item.plink.title" target="external-link" class="icon remote-link"></a></div>
+                               <div class="wall-item-links-wrapper"><a href="$item.plink.href" title="$item.plink.title" target="external-link" class="icon remote-link$item.sparkle"></a></div>
                        {{ endif }}
                        {{ if $item.edpost }}
                                <a class="editpost icon pencil" href="$item.edpost.0" title="$item.edpost.1"></a>
index dbb20256f93fd5f3828210bb7a0f63bfe72b39c5..94e3c2146e7da9302771c829fc690bfe8a1d9e24 100644 (file)
        <Link rel="http://oexchange.org/spec/0.8/rel/resident-target" type="application/xrd+xml" 
         href="$domain/oexchange/xrd" />
 
-    <Link rel="http://purl.org/zot/1.0/post" 
-        href="$zot_post" />
-
-    <Property xmlns:zot="http://purl.og/zot/1.0"
-        type="http://purl.org/zot/1.0/version"
-        zot:version="1" />
-
-    <Property xmlns:zot="http://purl.og/zot/1.0"
-        type="http://purl.org/zot/1.0/accept"
-        zot:accept="application/atom+xml" />
-
     <Property xmlns:mk="http://salmon-protocol.org/ns/magic-key"
         type="http://salmon-protocol.org/ns/magic-key"
         mk:key_id="1">$bigkey</Property>
index a4b921fe10b25b22f80ad8a1d16a7b4f7fa49bbd..d79203465bd7ca0812a92f558d4c3159befb0113 100644 (file)
@@ -5,17 +5,6 @@
        <Alias>$accturi</Alias>
     <Alias>$profile_url</Alias>
  
-    <Link rel="http://purl.org/zot/1.0/post/$nick" 
-          href="$zot_post" />
-
-    <Property xmlns:zot="http://purl.og/zot/1.0"
-          type="http://purl.org/zot/1.0/version"
-          zot:version="1" />
-
-    <Property xmlns:zot="http://purl.og/zot/1.0"
-        type="http://purl.org/zot/1.0/accept"
-        zot:accept="application/atom+xml" />
-
     <Link rel="http://purl.org/macgirvin/dfrn/1.0"
           href="$profile_url" />
     <Link rel="http://schemas.google.com/g/2010#updates-from"