Return-Path in Plurk’s Friend Request Email

July 3rd, 2008

I just noticed that the Return-Path header in the friend request mail is your acctual email address. Not Plurk’s.

If your mail server is down, the user who requested can get your email address.

Be careful.

Plurk Search Extension for Goosh

July 1st, 2008

I just created Plurk Search Extension for Goosh.org.

Here it is.

Update: 2008.07.01
Strange! No longer search by “test” and some specific words, including Japanese…

Muxtape Userscript v2.1

June 30th, 2008

I just updated the script.

New Features:

  1. New way to capture the player events
  2. Resume playing the last song on reload
  3. Rewind a muxtape on the end of the playlist

Memo: 369~

Muxtape Userscript 2.0

June 30th, 2008

Muxtape has been updated dramatically today.

I got several notifications from users of my script.

I just released new version here.

Enjoy~

Update: 2008.06.30
I got an email from Daniel Rodríguez who created a userscript for new Muxtape as well.
His one looks better than mine. :)

Memo: 354~

Patch up a Currency Format of Magento and Zend Framework for JPY

June 28th, 2008

DesignWalker の管理人さんから依頼がありまして、Magento というECサイト構築エンジンで「ロケールを日本にしても価格表示に小数点以下が表示される」という問題にパッチを当てました。

Magento って全く知りませんで、中身を見るとどうやら Zend フレームワークを使っているご様子。こっちも初めてでいろいろ複雑です。

結局 Magento の問題というよりは Zend 側の Currency クラスに問題がありました。

1.ロケール情報XMLファイルの currencyFormat に小数点が含まれていました。
2.ところが、実際の表示には currencyFormat が使われていません。

つーことで、1.を修正しつつ、2.に対応するためのパッチを当てるはめに。

とりあえずの応急処置ですが晒しときます。
本格的にやるにはちょっと時間がかかりそうなのでこの辺でw

/lib/Zend/Locale/Data/ja.xml

<currencyFormats>
  <currencyFormatLength>
       <currencyFormat>
      <pattern>¤#,##0.00</pattern>
    </currencyFormat>
  </currencyFormatLength>
</currencyFormats>

/lib/Zend/Currency.php

protected function _updateFormat()
{
    $locale = empty($this->_options['format']) ? $this->_locale : $this->_options['format'];

    //getting the format information of the currency
    $format = Zend_Locale_Data::getContent($locale, ‘currencynumber’);

    iconv_set_encoding(’internal_encoding’, ‘UTF-8′);
    if (iconv_strpos($format, ‘;’)) {
        $format = iconv_substr($format, 0, iconv_strpos($format, ‘;’));
    }

    // Patched a currency format for JPY by YungSang
    if (!strpos($format, ‘.’)) {
        $this->_options['precision'] = 0;
    }

    //knowing the sign positioning information
    if (iconv_strpos($format, ‘¤’) == 0) {
        $position = self::LEFT;
    } else if (iconv_strpos($format, ‘¤’) == iconv_strlen($format)-1) {
        $position = self::RIGHT;
    }

    return $position;
}