example_4.php

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PHP 代码 · 共 48 行

PHP
48
字号
<?php/** * Example of usage for HTML_Template_Sigma, callbacks *  * @package HTML_Template_Sigma * @author Alexey Borzov <avb@php.net> *  * $Id: example_4.php,v 1.2 2004/04/14 09:41:55 avb Exp $ */ 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' => '&nbsp;', 'reason' => 'Everything went OK', 'solution' => '&nbsp;'),    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鋑e von {username} anzeigen'    ),    'fr' => array(        'Send private message' => 'Envoyer un message priv

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?