Author Archive

Faster DNS

设备DNS服务器地址为:74.117.62.158
新增国内DNS:42.121.236.241

IPv6: 2001:470:C:108::2
2001:470:66:3b0::2


DAM Replace 时间字段值变更

DAM replace的时候自动加减了UTC时间. 配置禁止即可.
dam/lib/class.tx_dam_db.php


memcached限制ip进行tcp连接

先说下-l绑定本机网卡的问题,当使用-l 127.0.0.1运行md的时候,只有本机能connect上这个memcache;让使用-l 10.0.0.2运行的时候(这里假定10.0.0.2是md机器对外的ip),任何机器都可以连上这个memcache。同事有人指出,-l实际上就是在指定绑定机器的那个网卡的问题,比如当使用ifconfig的时候,显示信息类似如下: (continue reading…)


link 忽略access

config.typolinkLinkAccessRestrictedPages = NONE

mail with image CID

Global:

$mail = t3lib_div::makeInstance('t3lib_mail_Message');
            $mail->setFrom(array($sender => $sender_name));
            $mail->setReplyTo($reply_to);
            $mail->setTo($row['email']);
            $mail->setSubject($subject);

            $body = 'Any html code!';

            preg_match_all("/\embed(Swift_Image::fromPath($src));
                    if($cid){
                        $body = str_replace($src, $cid, $body);
                    }
                }
            }
            $mail->setBody($body, 'text/html', 'utf-8');
            $mail->send();

typo3<4.7 [4.7+己废弃]

require_once(PATH_t3lib.’class.t3lib_htmlmail.php’);

// Prepare mailer and send the mail
$mailer = t3lib_div::makeInstance(‘t3lib_htmlmail’);
$mailer->start();
$mailer->useBase64();
$mailer->from_email = ”;
$mailer->from_name = ”;
$mailer->charset = ‘iso-8859-1′;
//$mailer->replyto_email = $this->reply_email;
//$mailer->replyto_name = ‘TEST-TASK’;
$mailer->subject = ”;
//$mailer->addPlain($mailBody);
$mailer->addHTML($url); //支持图片CID
$mailer->setRecipient(recipient@email.com);
$mailer->setHeaders();
$mailer->setContent();
$mailer->sendtheMail();

remove image width tag

tt_content.image.20.stdWrap.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib{
    width.unset = 1
    height.unset = 1
}
tt_content.textpic.20.stdWrap.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib{
    width.unset = 1
    height.unset = 1
}
lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib{
    width.unset = 1
    height.unset = 1
}



Realurl前辍

'preVars' => array(
        array(
            'GETvar' => 'no_cache',
            'valueMap' => array(
                    'nc' => 1
                ),
            'noMatch' => 'bypass'
        ),
        array(
            'GETvar' => 'abc',
            'valueMap' => array(
                'a' => 1,
                'b' => 2,
                'c' => 3,
                'd' => 4,
            ),
            'noMatch' => 'bypass'
        ),
        array(
			'GETvar' => 'L',
			'valueMap' => array(
				'de' => '0',
				'at' => '1',
				'ch' => '2'
			),
			'noMatch' => 'bypass',
		)
	)

(continue reading…)


ts odd even in template

temp.elemente = COA
temp.elemente {
    10 = CONTENT
    10 {
        table = tt_content
        select {
            where = colPos = 2
            orderBy = sorting
        }
        renderObj < tt_content
        renderObj.wrap = |###SPLITTER###
    }
    stdWrap.split {
        token = ###SPLITTER###
        cObjNum = 1 |*| 2 || 3 |*| 4 || 5
        1.current = 1
        1.wrap = 
| 2.current = 1 2.wrap =
|
3.current = 1 3.wrap =
|
4.current = 1 4.wrap =
|
5.current = 1 } }

(continue reading…)

1 Comment more...

Sending files better: Apache mod_xsendfile and PHP

I have previously written a quick post on making files downloadable through PHP scripts. The example in the post reads the file itself into a variable, and as pointed out in the comments, it’s not necessarily a very good idea especially if you deal with large files.

Recently at work, we needed a reliable way to send files to users’ browser, and I decided to take a look at mod_xsendfile, as suggested by Tom Graham.

It’s also supported by other web servers such as Lighttpd and nginx. (continue reading…)


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