按月存档: 六月 2009

uchome模板-对应的文件说明

快捷管理菜单  cp_advance.htm
相册管理      cp_album.htm
当前我的头像  cp_avatar.htm
编辑日志      cp_blog.htm
删除指定的分类 cp_class.htm
确定删除指定的回复吗  cp_comment.htm
积分                  cp_credit.htm
删除该迷你博客        cp_doing.htm
屏蔽指定动态          cp_feed.htm
帮您找好友            cp_friend.htm
页首 设置             cp_header.htm
日志 设置             cp_import.htm
邀请邮件              cp_invite.htm
管理群组成员          cp_mtag.htm
短消息                cp_pm.htm
打招呼                cp_poke.htm
个人隐私设置          cp_privacy.htm
我的真实姓名          cp_profile.htm
激活您的邮箱          cp_sendmail.htm
删除指定的分享        cp_share.htm
隐藏该应用            cp_space.htm
有奖活动              cp_task.htm
个人主页风格-CSS      cp_theme.htm
编辑话题              cp_thread.htm
图片上传              cp_upload.htm
我的应用?页面加载中..cp_userapp.htm
会员等级              do_ajax.htm
密码验证              do_inputpwd.htm
登录                 do_login.htm
取回密码          do_lostpasswd.htm
注册本站帐号      do_register.htm
头像抓拍页?       do_swfupload.htm
页脚             footer.htm
页首             header.htm
页首 其他        headerindex.htm
帮助             help.htm
未知页框架页     iframe.htm
首页             index.htm
邀请你为好友        invite.htm
相片搜索         network_album.htm
日志搜索         network_blog.htm
没有相应的迷你博客。  network_doing.htm
随便看看 页首           network_header.htm
随便看看                 network_index.htm
群组                network_mtag.htm
分享提示页?         network_share.htm
找人搜索            network_space.htm
话题搜索            network_thread.htm
邮件内容页          sendmail.htm
信息提示            showmessage.htm
相册                space_album_list.htm
相册 [...]

uchome的模板处理方法

uchome的模板处理主要调用/source目录下的function_template.php文件中的parse_template函数实现(比起smarty可真是超轻量级了).
解析过程并不复杂,主要是读取模板文件(.htm),用规则表达式替换标记为PHP标准语法,最终生成一个标准的PHP文件,保存到缓存目录
1:读入模板文件,模板文件一般在template/default下面
Php代码
//read
if(!file_exists($tplfile)) {
$tplfile = str_replace(‘/’.$_SCONFIG['template'].’/’, ‘/default/’, $tplfile);
}
$template = sreadfile($tplfile);
if(emptyempty($template)) {
exit(“Template file : $tplfile Not found or have no access!”);
}
//read
if(!file_exists($tplfile)) {
$tplfile = str_replace(‘/’.$_SCONFIG['template'].’/’, ‘/default/’, $tplfile);
}
$template [...]

丁丁9个半月了

时间过得真快,再过一个多星期丁丁就满10个月了