Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
opt /
lampp /
lib /
php /
doc /
HTML_Template_Sigma /
docs /
[ HOME SHELL ]
Name
Size
Permission
Action
templates
[ DIR ]
drwxr-xr-x
example_1.php
2.19
KB
-rw-r--r--
example_2.php
4.59
KB
-rw-r--r--
example_3.php
2.75
KB
-rw-r--r--
example_4.php
4.25
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : example_4.php
<?php /** * Example of usage for HTML_Template_Sigma, callbacks * * PHP versions 4 and 5 * * LICENSE: This source file is subject to version 3.01 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_01.txt If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category HTML * @package HTML_Template_Sigma * @author Alexey Borzov <avb@php.net> * @version CVS: $Id: example_4.php,v 1.3 2007/05/19 13:31:19 avb Exp $ * @ignore */ /** * Template class */ require_once 'HTML/Template/Sigma.php'; function toggle($item1, $item2) { static $i = 1; return $i++ % 2? $item1: $item2; } // remember, this is an example only. there are lots of more advanced i18n solutions to use! :] function translate($str) { global $lang, $aryI18n; return isset($aryI18n[$lang][$str])? $aryI18n[$lang][$str]: $str; } function letters($str) { return preg_replace('/[^\\w\\s]/', '', $str); } $ary = array( array('code' => 'SIGMA_OK', 'message' => ' ', 'reason' => 'Everything went OK', 'solution' => ' '), array('code' => 'SIGMA_BLOCK_NOT_FOUND', 'message' => 'Cannot find block <i>\'blockname\'</i>', 'reason' => 'Tried to access block that does not exist', 'solution' => 'Either add the block or fix the block name'), array('code' => 'SIGMA_BLOCK_DUPLICATE', 'message' => 'The name of a block must be unique within a template. Block <i>\'blockname\'</i> found twice.', 'reason' => 'Tried to load a template with several blocks sharing the same name', 'solution' => 'Get rid of one of the blocks or rename it'), array('code' => 'SIGMA_INVALID_CALLBACK', 'message' => 'Callback does not exist', 'reason' => 'A callback function you wanted to use does not exist', 'solution' => 'Pass a name of an existing function to setCallbackfunction()') ); // I speak neither German, nor French. The strings are from phpBB translations (http://www.phpbb.com/) $aryI18n = array( 'de' => array( 'Send private message' => 'Private Nachricht senden', 'Username' => 'Benutzername', 'Find all posts by {username}' => 'Alle Beitr�ge von {username} anzeigen' ), 'fr' => array( 'Send private message' => 'Envoyer un message priv�', 'Username' => 'Nom d\'utilisateur', 'Find all posts by {username}' => 'Trouver tous les messages de {username}' ) ); $langsAry = array('de' => 'German', 'fr' => 'French'); // instantiate the template object, templates will be loaded from the // 'templates' directory, no caching will take place $tpl =& new HTML_Template_Sigma('./templates'); // No errors are expected to happen here $tpl->setErrorHandling(PEAR_ERROR_DIE); // default behaviour is to remove unknown variables and empty blocks // from the template $tpl->loadTemplateFile('example_4.html'); // 1. Using callbacks for minor presentation changes $tpl->setCallbackFunction('bgcolor', 'toggle'); foreach ($ary as $item) { $tpl->setVariable($item); $tpl->parse('table_row'); } // 2. Using callbacks for i18n // We don't set a callback function, thus the function call will be replaced // by function's first argument (better than to throw an error, I think) $tpl->setVariable(array( 'language' => 'English (default)', 'username' => 'Luser' )); $tpl->parse('i18n_block'); // Now we set a callback function. Please note the third argument, we // want to process the strings with no variable substitutions done, they // should be done *after* the translation. $tpl->setCallbackFunction('translate', 'translate', true); foreach (array_keys($aryI18n) as $lang) { $tpl->setVariable(array( 'language' => $langsAry[$lang], 'username' => 'Luser' )); $tpl->parse('i18n_block'); } // 3. Shorthand for callbacks, built-in callbacks // We add a variable that cannot be safely displayed either in HTML, // in URLs or inside JavaScript string constants without appropriate encoding $tpl->setVariable('escaped', '"Foo & Bar"'); $tpl->setCallbackFunction('letters', 'letters'); // output the results $tpl->show(); ?>
Close