Author Archive

Japanese File Name

The Issue when I upload file which name is Japanese happened usually 日本語 日本語 – コピー

Posted in etc | Comments Off on Japanese File Name

Linux Sub Domain Setup

리눅스 서브도메인 셋팅방법 http://www.domain.com 이라는 도메인을 이용하여 http://shop.domain.com 이라는 서브도메인 셋팅방법을 설명드립니다. 1. 현재 설정된 네임서버 설정파일을 열어봅니다. [root@211 root]# vi /etc/named.conf 2. 도메인의 zone 파일을 확인합니다. (상략) include “/etc/rndc.key”; zone “internet.com” { type master; file “named.zone”; }; zone “domain.com” { type master; file “named.zone”; }; 3. 존파일 디렉토리로 이동합니다. [root@211 home]# cd /var/named 4. 2번에서 확인한 존파일을 vi로 편집합니다. [root@211 named]# vi named.zone * 비밀번호는 화면에 보이지 않습니다. 5. 제일 하단으로 한줄을 추가합니다. IN A 218.38.12.8 ftp IN A 218.38.12.8 www IN A 218.38.12.8 telnet IN A 218.38.12.8 mail IN A 218.38.12.8 pop3 IN A 218.38.12.8 shop IN A 218.38.12.8 ServerAdmin webmaster@domain.com ServerName domain.com ServerAlias www.domain.com DocumentRoot /home/domain/public_html scriptAlias […]

Posted in Linux | Comments Off on Linux Sub Domain Setup

Batch

update at3_field_data_field_user_intro set field_user_intro_format=replace(field_user_intro_format,’full_html’,’wysiwyg’); update at3_field_data_field_user_intro set field_user_intro_format=replace(field_user_intro_format,’filtered_html’,’wysiwyg’); update at3_field_data_field_user_intro set field_user_intro_format=replace(field_user_intro_format,’NULL’,’wysiwyg’) update at3_field_data_body set body_format=replace(body_format,’full_html’,’wysiwyg’); update at3_field_data_body set body_format=replace(body_format,’filtered_html’,’wysiwyg’); update at3_field_data_body set body_format=replace(body_format,’NULL’,’wysiwyg’)

Posted in MySQL | Comments Off on Batch

user_relationships in node.tpl.php

<?php $uid = $node->uid; $owner = $node->name; //if users are friends and relationship has been approved if ($relationships = user_relationships_load( array(’between’ => array($user->uid, $uid),’approved’ => 1))) { // set a value of friends to 1 to allow content to be displayed below. $friends = 1; } else { $friends = 0; } echo "friends value = " . $friends; ?> <div class="content clear-block"> <?php if ($friends == 0) { print render($content); }; ?> </div><?php $uid = $node->uid; $owner = $node->name; //if users are friends and relationship has been approved if ($relationships = user_relationships_load( array(‘between’ => array($user->uid, $uid),’approved’ => 1))) { // set a value of friends to 1 to allow […]

Posted in Drupal | Comments Off on user_relationships in node.tpl.php

PHP5.3.3のインストール

PHP5.3.3のインストール方法(ソース)~その1~ ●インストール環境 OS fedora13 PHP php-5.3.3.tar.gz インストール先フォルダ /usr/local/httpd-5.3.3 /usr/local/phpにシンボリックリンクを貼る Webサーバー Apache http Server 2.2.16 データベース MySQL 5.1.50 php.iniのパス /usr/local/php-5.3.3/lib/php.ini 拡張モジュール mbstring、GD、iconv、mysql、mysqli、 ●インストール 1.※事前に下記がインストールされているか調べる。無ければインストールする PHPのインストールと実行にはflex、libxml2が必要 ※5.2、5.3ではflexはインストールされてなくても大丈夫でした・・・ GD ライブラリを有効にするためにはzlib、libpng、libjpegが必要 # rpm -qa flex # rpm -qa libxml2-devel # rpm -qa libjpng-devel # rpm -qa libjpeg-devel # rpm -qa zlib-devel # yum install flex # yum install libxml2-devel # yum install libjpeg-devel # yum install libpng-devel # yum install zlib-devel 2.PHPが既にインストールされていないか調べる インストールされていたらアンインストールする (※依存するパッケージも削除されてしまうので注意してください) # rpm -qa php # yum remove php 3.root権限に移る $ su – 4./usr/local/srcにソースファイルをダウンロー ド # wget -P /usr/local/src http://jp.php.net/distributions/php-5.3.3.tar.gz 5./usr/localにインストールする為フォルダを作成 # mkdir /usr/local/php-5.3.3 6.ソースファイルが置いてある場所へ移動 # cd /usr/local/src 7.ソースファイルを展開 # tar xvfz php-5.3.3.tar.gz 8.展開されたフォルダへ移動 # cd php-5.3.3 9.設定 実際は事前に追加・削除するモジュール検証してからインストールした方が良いかと・・・ # ./configure […]

Posted in Linux | Comments Off on PHP5.3.3のインストール

Drupal node uid Reset

alter table node auto_increment=0;

Posted in Drupal | Comments Off on Drupal node uid Reset

For How to rebuild node_comment_statistics on Drupal 7

TRUNCATE TABLE at3_node_comment_statistics; INSERT INTO at3_node_comment_statistics ( nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count ) SELECT n.nid, IFNULL(last_comment.created,n.changed) AS last_comment_timestamp, IFNULL(last_comment.name,null) AS last_comment_name, IFNULL(last_comment.uid,n.uid) AS last_comment_uid, IFNULL(comment_count.comment_count,0) AS comment_count FROM at3_node AS n LEFT OUTER JOIN (SELECT nid, COUNT(*) AS comment_count FROM at3_comment WHERE status=1 GROUP BY nid) AS comment_count ON comment_count.nid=n.nid LEFT OUTER JOIN (SELECT nid, MAX(cid) AS max_cid FROM at3_comment WHERE status=1 GROUP by nid) AS max_node_comment ON max_node_comment.nid=n.nid LEFT OUTER JOIN (SELECT cid,uid,name,created FROM at3_comment ORDER BY cid DESC LIMIT 1) AS last_comment ON last_comment.cid=max_node_comment.max_cid WHERE n.status=1 ORDER BY n.nid;TRUNCATE TABLE at3_node_comment_statistics; INSERT INTO at3_node_comment_statistics ( nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count ) SELECT n.nid, IFNULL(last_comment.created,n.changed) AS last_comment_timestamp, IFNULL(last_comment.name,null) AS […]

Posted in Drupal | Comments Off on For How to rebuild node_comment_statistics on Drupal 7