CSS

HTMLstyle使CSSclassCSS

HTMLclass使JavaScript


wh.js
jQueryjQuery 1.3.2

(function($) {
    $(function() {
        $('[class*=w_], [class*=h_]').each(function() {
            var classes = $(this).attr('class').split(' ');

            for (var i in classes) {
                if (match = classes[i].match(/^([wh])_(\d+)(px|p)$/)) {
                    var key = '';
                    var value = '';

                    switch (match[1]) {
                        case 'w':
                            key = 'width';
                            break;
                        case 'h':
                            key = 'height';
                            break;
                    }

                    switch (match[3]) {
                        case 'p':
                            value = match[2] + '%';
                            break;
                        case 'px':
                            value = match[2] + 'px';
                            break;
                    }

                    $(this).removeClass(match[0]).css(key, value);
                }
            }
        })
    });
})(jQuery);


jqueryjquery1.3.2


class

この場合、widthが100ピクセル、heightが200ピクセルの指定がされます。
また、パーセントでの記述も対応しています。

この場合、widthが100%、heightが33%の指定になります。
他のclassとの共存も問題ありませんので、比較的自由なデザインが可能になるかと思います。


CakePHPMedia便

便使



MediaMedia


Attachment

App::import('Lib', 'Media.Media');

class Attachment extends AppModel
{
    public $name = 'Attachment';
    public $useTable = 'attachments';
    public $useVersions = array();

    public $actsAs = array(
        'Media.Transfer' => array(
            'trustClient' => false,
            'transferDirectory' => MEDIA_TRANSFER,
            'createDirectory' => true,
            'alternativeFile' => 100
        ),
        'Media.Generator' => array(
            'baseDirectory' => MEDIA,
            'filterDirectory' => MEDIA_FILTER,
            'createDirectory' => true,
        ),
        'Media.Polymorphic',
        'Media.Coupler' => array(
            'baseDirectory' => MEDIA
        ),
        'Media.Meta' => array(
            'level' => 2
        )
    );

    public $validate = array(
        'file' => array(
            'resource'   => array('rule' => 'checkResource'),
            'access'     => array('rule' => 'checkAccess'),
            'location'   => array('rule' => array('checkLocation', array(
                MEDIA_TRANSFER, '/tmp/'
            ))),
            'permission' => array('rule' => array('checkPermission', '*')),
            'size'       => array('rule' => array('checkSize', '5M')),
            'pixels'     => array('rule' => array('checkPixels', '1600x1600')),
            'extension'  => array('rule' => array('checkExtension', false, array(
                'jpg', 'jpeg', 'png', 'tif', 'tiff', 'gif', 'pdf', 'tmp'
            ))),
            'mimeType'   => array('rule' => array('checkMimeType', false, array(
                'image/jpeg', 'image/png', 'image/tiff', 'image/gif', 'application/pdf'
        )))),
        'alternative' => array(
            'rule'       => 'checkRepresent',
            'on'         => 'create',
            'required'   => false,
            'allowEmpty' => true,
        )
    );

    public function makeVersion($file, $process)
    {
        if (!is_array($this->useVersions) && !empty($this->useVersions)) {
            $this->useVersions = array($this->useVersions);
        }

        if ($this->useVersions === false || !empty($this->useVersions) && !in_array($process['version'], $this->useVersions)) {
            return true;
        }

        return $this->Behaviors->Generator->makeVersion($this, $file, $process);
    }
}


 $useVersions 
App::import('Model', 'Attachment');

class UserImage extends Attachment
{
    public $name = 'UserImage';
    public $useVersions = array('main', 'sub');

    public $validate = array(
        'file' => array(
            'resource'   => array('rule' => 'checkResource'),
            'access'     => array('rule' => 'checkAccess'),
            'location'   => array('rule' => array('checkLocation', array(
                MEDIA_TRANSFER, '/tmp/', 'C:\xampp\tmp',
            ))),
            'permission' => array('rule' => array('checkPermission', '*')),
            'size'       => array('rule' => array('checkSize', '1M')),
            'extension'  => array('rule' => array('checkExtension', false, array(
                'jpg', 'jpeg', 'png', 'gif', 'tmp',
            ))),
            'mimeType'   => array('rule' => array('checkMimeType', false, array(
                'image/jpeg', 'image/png', 'image/gif',
            ))),
        ),
    );
}

$useVersions 

1つのMovableTypeをマルチドメインで運用する


MovableType11

1MovableType11

1MovableTypeSSH





test-blog.comtest-blog2.comtest-blog3.com3

MovableTypetest-blog.com/mt 





test-blog.com /home//www/test-blog.com

test-blog2.com /home//www/test-blog2.com

test-blog3.com /home//www/test-blog3.com

MovableType


1MovableType
test-blog.com  mt/ 


SSH
# 設定するドメインのルートディレクトリに移動
cd /home/アカウント名/www/test-blog2.com/
# MovableTypeディレクトリへのシンボリックリンクを作成
ln -s /home/アカウント名/www/test-blog.com/mt/ mt 

 test-blog2.com/mt MovableTypetest-blog3.com