$GLOBALS[‘TSFE’]->tmpl->setup
$GLOBALS[‘TSFE’]->tmpl->setup[‘config.’]
$GLOBALS[‘TSFE’]->tmpl->setup[‘config.’][‘baseURL’]
Archive for 四月, 2010
读取默认TS配置
js进度条
<div style=”border: 1px solid black; width: 100%; height: 20px;”>
<div style=”float: left; width: 100%; height: 20px; background-color: green;” id=”progress-bar”> </div>
<div style=”float: left; width: 0%; height: 20px; background-color: rgb(254, 254, 254);” id=”transparent-bar”> </div>
</div>
Warning: Call-time pass-by-reference has been deprecated in
解决方案有两个:
1.在原函数参数列表上加上&号
function func(&$a){
}
2.在PHP.INI中进行一下设置
allow_call_time_pass_reference = On
Configure TYPO3 for Localized Websites
A bit older of a multi-lingual setup guide, but the principals are the same.
The information below is over a year old, circa mid-2008. Some of the techniques and settings may have changed for TYPO3 4.2 and TYPO3 4.3. I’ll release an update to this in early 2010.
- Website Language Creation
- On the TYPO3 Global page via List mode, add a new Website Language. Take note of the uid of that language. To do so, hover over the Website Language icon after saving and closing to see the uid. You’ll need this for the sys_language_uid setting later on. (continue reading…)
typo3插件创建目录
ext_emconf.php
中加入 ‘createDirs‘ => ‘uploads/tx_templavoila/’
插件安装时会创建目录
史上最全的MYSQL备份方法
1.mysqldump备份
mysqldump 是采用SQL级别的备份机制,它将数据表导成 SQL 脚本文件,在不同的 MySQL 版本之间升级时相对比较合适,这也是最常用的备份方法。
示例:mysqldump -uroot -p database table > /home/jobs/back.sql
mysqldump也可做增量备份,mysqldump相关参数网上较多,就不在此一一赘述了 (continue reading…)
PHPMailer
public function lostsave(){
$Dao=D(‘User’);
$username=$_POST[‘username’];
$em=$_POST[’em’]; (continue reading…)
addLoadEvent()
在给网页加一些特效时经常要在<body>中加入“onload”事件,即在网页加载完后执行某事件,例如:<body onload=”alert(‘欢迎光临!’)”,但这样做有个大的缺陷,事件会在网页完全下载完后才会执行,包括网页中的图片或Flash等,如果网页 中的图片比较大或有很多图 (continue reading…)
页面的高度与宽度问题
网页可见区域宽: document.body.clientWidth;
网页可见区域高: document.body.clientHeight;
网页可见区域宽: document.body.offsetWidth; 包括边线的宽;
网页可见区域高: document.body.offsetHeight;包括边线的宽;
网页正文全文宽: document.body.scrollWidth;
网页正文全文高: document.body.scrollHeight;
网页被卷去的高: document.body.scrollTop;
网页被卷去的左: document.body.scrollLeft;
屏幕分辨率的高: window.screen.height;
屏幕可用工作区高度: window.screen.availHeight;
屏幕可用工作区宽度:window.screen.availWidth;
当前鼠标位置的X坐标:document.body.scrollLeft+event.clientX; 网页横向滚动条的左位置 + 事件源的X坐标
当前鼠标位置的Y坐标:document.body.scrollTop+event.clientY;
要注意的是scrollWidth和clientWidth的区别,顺带还有offsetWidth,手册上的说明:
scrollWidth:Retrieves the scrolling width of the object.
clientWidth:Retrieves the width of the object including padding, but not including margin, border, or scroll bar.
offsetWidth:Retrieves the width of the object relative to the layout or coordinate parent, as specified by the offsetParent property.
我的理解是(用Height容易测试):
scrollHeight是对象的内容的高度;clientHeight是对象的可视部分高度;offsetHeight是clientHeight加上border和滚动条本身高度。
可以看到clientHeight不受内容影响,都是83,即内容有没有超过对象高度都不受影响,但scrollHeight会受内容高度影响,而且从测试可以意识到:当有滚动条时,覆盖层的高度应该取scrollHeight(内容高度);当没有滚动条时,覆盖层的高度应该取clientHeight(视框高度)。而恰好两个情况都是取两者中比较大的值,所以就有了以下程序:
Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) "px";
设宽度时是不包括滚动条部分的而documentElement一般也没有border,所以不需要offsetWidth。
上面可以看到我用的是documentElement而不是body,手册上是这样说的:
Retrieves a reference to the root node of the document.意 思是整个文档的根节点,其实就是html节点(body的上一级),注意这是在XHTML的标准下。上面可以看到我们取值的对象是整个文档而不只是 body,所以这里用documentElement。还要注意的是在onresize的时候scrollWidth和clientWidth的值会产生 变化,所以需要在事件中重新设置宽度高度:
if(isIE6){ this._size(); window.attachEvent("onresize", this._size); }
IEFirefox下FLASH挡住DIV层
主要修改:
1、<param name="wmode" value="transparent">【IE】
2、<embed wmode="transparent">【Firefox】