Tuesday, December 05, 2006

google blog 升级了

下午登陆,系统提示升级,两步搞定!

无耻的中国移动

最近手机老收到一些不明的垃圾服务信息,开始还以为在网上泄露号码被一些不法奸商乘机发送垃圾信息.今天收到一条" 高挑美女性感近距离特写"的服务信息,出于好色和好奇,就在mozilla中输入地址:“http://211.147.224.145:8082/wap163.asp?m=a1b056ee”,结果显示:“请用手机访问”.(用mozilla的目的是害怕有病毒)。不得已那只有访问根目录,http://211.147.224.145:8082/,但在状态栏却显示正在连接的网址是wap.monternet.com。我就纳闷,google了一下,结果显示“中國移動夢网主頁wap.monternet.com”。靠!这不是婊子立牌坊嘛!垃圾,垃圾。奸商,奸商。

Monday, December 04, 2006

Smarty 學習筆訐(一)

php安装步骤就省略,就算写我也给忘了。-_-!
先下载Smarty-2.6.14,解压缩,拷贝libs到自己项目文件夹中,目录树如下:

-myTestProject
|
--WebApp
|
--libs
|
--Smarty.class.php
--Config_File.class.php
--Smarty_compile.class.php
--debug.tpl
+-plugins
+-internals
+-nc
+-templates
--templates_c
--cache
--configs
--index.php
--setup.php
+-therFiles
|
--Docs

smarty本身文档写的非常棒,并且它把所有出现的用法都表明了。我只抄其中我自己感觉最适用的。

使用smarty前都要引入smarty类和申明它的路径,所以我们自定义一个类用来继承smarty类,方便以后调用。
setup.php
//load Smarty library
require('smarty.class.php');

// The setup.php file is a good place to load
//required application library files, and you
// can do that right here. An example:

class smarty_hello extends Smarty(){

// Class Constructor.

function smarty_hello(){
$this -> Smarty();
$this -> template_dir = '/templates/';
$this -> compile_dir = '/templates_c/';
$this -> cache_dir = '/cache/';
$this -> config_dir = '/configs/';

$this -> cache = true;
$this -> assign('app_name','hello');
}
}
?>

使用的时候这样调用就可以了:
index.php
require('setup.php');

$smarty = new smarty_hello();
$smarty -> assign('name','world');
$smarty -> display('index.tpl');
?>

而index.tpl这个文件保存在templates文件夹中,内容如下:
{* Smarty *}
hello,{$name}!

还有很多种方法,我记不住,所以就忘了。哈哈