Archive for 一月, 2011

TYPO3 multi language & multi domain site with RealURL and language menu

This is a step-by-step tutorial which describes in detail how to setup TYPO3 for a multilingual website with “domain language switching”. It will describe how to properly configure RealURL, extend it’s configuration with simple PHP statements in the RealURL configuration file and last but not least, probably the most important thing: the language switch menu with cross domain support.

I started with a clean TYPO3 installation and created two page trees in order to test the setup in a multiple page tree setup. Therefore I defined that on my local Linux box typo3-ml.local listens to the default language, while typo3-ml-en.local and typo3-ml-it.local – you guessed it – listens to the english and italian language versions of the page tree. (continue reading…)

1 Comment more...

SQL 高性能查询优化语句

保证在实现功能的基础上,尽量减少对数据库的访问次数;通过搜索参数,尽量减少对表的访问行数,最小化结果集,从而减轻网络负担;能够分开的操作尽量分开处理,提高每次的响应速度;在数据窗口使用SQL时,尽量把使用的索引放在选择的首列;算法的结构尽量简单;在查询时,不要过多地使用通配符如 SELECT * FROM T1语句,要用到几列就选择几列如:SELECT COL1,COL2 FROM T1;在可能的情况下尽量限制尽量结果集行数如:SELECT TOP 300 COL1,COL2,COL3 FROM T1,因为某些情况下用户是不需要那么多的数据的。 (continue reading…)


PHP5中static和const

Php代码 
  1. <?php
  2. class Counter
  3. {
  4. private static $count = 0;//定义一个静态属性 (continue reading…)

typo3插件互相调用方法

/*
* displayContact
*@param type: agency or customers
*@param data: data uid
*@param pageid: contact page id
*/
protected function displayContact($type, $data, $pageid) {
// Get default configuration
$conf = $GLOBALS[‘TSFE’]->tmpl->setup[‘plugin.’][‘tx_demodata_pi4.’];
// Modify this configuration
$conf += array(‘type’ => $type,’data’ => $data,’pageid’ => $pageid);
// Get page
$cObj = t3lib_div::makeInstance(‘tslib_cObj’);
/* @var $cObj tslib_cObj */
$cObj->start(array(), ”);
return $cObj->cObjGetSingle(‘USER’, $conf);
}

1 Comment more...

php格式化数字

number_format();

sprintf(“%04d”, 2) (continue reading…)


PHP 过滤器(Filter)

PHP 过滤器用于验证和过滤来自非安全来源的数据,比如用户的输入。

什么是 PHP 过滤器?

PHP 过滤器用于验证和过滤来自非安全来源的数据。

验证和过滤用户输入或自定义数据是任何 Web 应用程序的重要组成部分。

设计 PHP 的过滤器扩展的目的是使数据过滤更轻松快捷。 (continue reading…)


jQuery.Autocomplete 中文支持

jQuery.Autocomplete是jquery的流行插件,能够很好的实现输入框的自动完成(autocomplete)、建议提示(input suggest)功能,支持ajax数据加载。 (continue reading…)


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress