Author Archive

Joomla makesafe

$regex = array(‘#(\.){2,}#’, ‘#\[^ぁ-んァ-ンァ-ン゙゚A-Za-z0-9\.\_\- ]#’, ‘#^\.#’); // Japanese $regex = array(‘#(\.){2,}#’, ‘#[^A-Za-z0-9\.\_\- ]#’, ‘#^\.#’); // Korean

Posted in PHP | Comments Off on Joomla makesafe

preg_match for Korean, Japanese, Chinese

한글, 한자, 일어를 검색하는 정규식은 아래와 같습니다. 예전에 블로그에 포스팅했던 내용이었습니다만… 여기에서 영문이나 특수문자를 허용하려면 [ ] 안에 더 적어주면 되겠죠. 주의할점 1. PCRE 정규식 사용시 식의 맨 처음과 끝부분은 구분자를 넣어줘야 합니다. 예를들어 영문 A~Z 를 대소문자 구별없이 찾고자 할때 @[a-z]@i 2. 정규식 내에 [ ] 안에 마이너스(-) 를 검색하고자 할때는 Escape 시켜줘야 합니다. 안그러면 범위 지정이 되어서 엉뚱한 결과가 나올 수 있습니다. @[a-z,.\-~]@i 위의 정규식과 아래 정규식은 결과가 조금 다릅니다. @[a-z,.-~]@i . 문자 부터 ~ 문자 사이를 지정하게 되는 식이 되버리니까요. //  예제 문자열 $content = “test content☆漢字〓韓國外交部對外稱, 應美方要求,韓國貿易部長金宗塤和美國貿易代表施瓦布本週一下午還舉行了一個「非正式磋商」。end◆ 日語〓慰謝料としてフルハウス(Full House)をあげるというィヨンジェの言葉に,ジウンは寝ても寝る事ができないで悩む。end◆ 한글〓해쉬(Hash)값 필터링 시스템(Filtering system)은 디지털 파일에 고유의 키 값을 매겨서 등록, 관리하는 것으로 저작권 침해 신고가 접수됐을 […]

Posted in PHP | Comments Off on preg_match for Korean, Japanese, Chinese

Services Single Sign-On Drupal

A.Setting up the SSO Server site. 1.Install Services 3.x and enable the main Services module plus the REST server. 2.Install Services single sign-on server helper 3.Set up an endpoint in Structure > Services with the following settings: Server: REST, Authentication: Session authentication 4.Under the “server” tab of the endpoint, make sure response formatters: json and request parsing: application/json application/x-www-form-urlencoded are checked. 5.Under the “resources” tab of the endpoint, enable user.retrieve, user.index, user.login and user.logout   B.Setting up your SSO Client site. 1.SSO Client site. 2.Install the Services single sign-on client module 3.Under Configuration > Web services > Services single sign-on client settings, fill in the server address of the SSO […]

Posted in Drupal | Comments Off on Services Single Sign-On Drupal

The clean URL test failed.

-Check mod_rewrite in httpd.conf -In .htaccess-Check mod_rewrite in httpd.conf -In .htaccess <Directory /var/www/drupal> AllowOverride All </Directory> AccessFileName .htaccess restart

Posted in Drupal | Comments Off on The clean URL test failed.

How to use SortTable Post

SortTable Post [ sorttablepost ] HIDE STANDARD COLUMNS [ sorttablepost nothumb=”true” nodate=”true” nocats=”true” notags=”true” ] You can omit any undesired columns by using one or more of these shortcode options. SHOW CUSTOM POST TYPE [ sorttablepost type=”my-custom-post-type” ] You can specify the name of a custom post type (or `page`), instead of showing posts. USE CUSTOM TAXONOMIES [ sorttablepost cat=”my-custom-taxonomy” tag=”another-custom-taxonomy” ] You can replace the standard `Categories` or `Tags` columns (or both) with custom taxonomies. USE CUSTOM FIELDS [ sorttablepost meta=”Custom Field Key,Another Custom Field Key,Yet Another” ] As of version 4.0, you can add as many custom field columns as you like. Use a comma-seperated list of field […]

Posted in Wordpress | Comments Off on How to use SortTable Post

Limit word in the front widget

Front <?php echo limit_words(get_the_excerpt(), ‘5’); ?>   function limit_words($string, $word_limit) { $words = explode(‘ ‘, $string); // this next bit chops the $words array and sticks it back together // starting at the first word ‘0’ and ending at the $word_limit // the $word_limit which is passed in the function will be the number // of words we want to use // implode glues the chopped up array back together using a space character return implode(‘ ‘, array_slice($words, 0, $word_limit)); }  

Posted in Wordpress | Comments Off on Limit word in the front widget

utf-8 transferring

1. 리눅스에서 ICONV를 이용 하여 파일 내용을 utf8으로 변환하는 방법 그리고 파일이름을 UTF8로 변경하는 방법 url: http://www.welog.net/gbbs/bbs/board.php?bo_table=linux&wr_id=186&sca=%C6%C1&page=6 [팁] 리눅스에서 euc-kr 파일을 utf-8 파일로 변환 명령어 글쓴이 : 돗자리 리눅스에서 파일 내용에 있는 한글을 euc-kr에서 utf-8로 변환하는 방법은 다음과 같다. #iconv -c -f euc-kr -t utf-8 test.txt > test-utf8.txt 그리고 파일이름이 euc-kr인 경우에는 convmv를 이용해 파일명을 utf-8로 바꾼다. #convmv -f euc-kr -t utf-8 –notest 한글.txt 2. 리눅스에서 특정 파일들을 iconv로 변환하는 방법 — 음… 전 작동 않되더군요. url: http://www.ubuntu.or.kr/viewtopic.php?p=20579 Re: php 파일 변환에 대한 질문입니다. euc-kr 에서 utf-8 로 변환하고자 하는데.. 실험은 안 해 봤는데 이렇게 하시면 혹시 되지 않을까요? Code: find . -name ‘*.php’ -exec iconv -f euc-kr -t utf-8 […]

Posted in etc | Comments Off on utf-8 transferring