Tag: drupal

Indy로 form submit하기 삽질

  • TIdMultipartFormDataStream를 이용하면 될 것 같아서 열심히 했다.
  • 근데 UTF8 인코딩이 필요하다. AddFormField로 추가하면 될 것 같았다. AddObject도 안된다.
  • TIdMultipartFormDataStream는 유니코드를 전혀 지원하지 않는다.
  • 그냥 TStrings로 했다. 잘된다.. ㅡㅜ

Drupal에서 삽질

  • WebForms에서 만들 폼에다가 넣는 중이있다.
  • 잘 넣는데 가끔 폼에 적은 내용이 전달이 되지 않는다. 흠... 한참 삽질하다 다시 보니 WebForms의 필드 타입이 textfield인 곳에 여러줄 넣으면 안된다. 아마 여러줄에 이상한 문자가 있었나?.. 하여간 가끔안되다가 되다가.
  • 여러줄 필요한 곳의 타입을 textarea로 변경하니 잘 된다.

pager_query 없이 theme_pager 사용하기

drupal에서 쿼리 결과를 pager로 보려면 page_query로 하면되는데, 쿼리결과가 아닌 다른건.. 저의 경우는 별도의 검색 서버를 두고 거기서 가져오는 형태는 지원하지 않습니다. 그래서 theme_pager 함수를 살펴봤더니.. 아래처럼 하면 되는군요.

1. 먼저 theme_page에서 pager에 사용하는 전역변수를 선언합니다. 여기다가 적당히 데이터를 넣어주면 되는 것이지요.

global $pager_total, $pager_page_array;

2. 전체 페이지수 설정, $total_results는 전체 검색 결과 수이고 get_page_size()는 한 페이지당 표시할 데이터 수입니다.

$pager_total[0] = ceil($total_results / get_page_size());

3. 표시될 페이지 설정, $page는 현재 표시될 페이지 입니다.

$pager_page_array = array();
$page_count = ceil($total_results / get_page_size());
for($i=0; $i<$page_count; $i++) array_push($pager_page_array, $i + $page);

4. 이제 pager 사용..

theme('pager', get_page_size(), $total_results);

5. 당연히 검색하는 부분에서 파라미터로 넘어간 페이지수에 맞게 검색하면 됩니다.


모듈의 css 추가하기

function module_name_init(){
    $path = drupal_get_path('module', 'module_name');
    drupal_add_css($path .'/module_name.css', 'module', 'all', FALSE);
}

이렇게 함수 추가하고 모듈 디렉토리에 css 파일 놓는다.


drupal6-simply_modern은 ctype이 필요하다.

제목 드래도 drupal6-simply_modern은 php  ctype 모듈이 필요함


www/drupal6-zeropoint update to 6.x-2.3

diff -ruN drupal6-zeropoint.orig/Makefile drupal6-zeropoint/Makefile
--- drupal6-zeropoint.orig/Makefile	2010-03-10 07:25:31.000000000 +0900
+++ drupal6-zeropoint/Makefile	2010-03-10 02:31:11.000000000 +0900
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	zeropoint
-DISTVERSION=	6.x-1.10
+DISTVERSION=	6.x-2.3
 CATEGORIES=	www
 
 MAINTAINER=	whitekid@gmail.com
@@ -17,7 +17,6 @@
 MODULE_DIRS=	_custom/headerimg _custom css images/all images/ink \
 		images/icons/blocks images/icons images/ivy images/lime \
 		images/nature images/sangue images/sky images js
-
 MODULE_FILES=	_custom/custom-style.css _custom/headerimg/credits.txt \
 		_custom/headerimg/ephemeral_a.jpg \
 		_custom/headerimg/ephemeral_b.jpg \
@@ -25,19 +24,21 @@
 		_custom/headerimg/ephemeral_d.jpg \
 		_custom/headerimg/ephemeral_e.jpg _custom/headerimg/rotate.php \
 		block.tpl.php box.tpl.php comment-wrapper-forum.tpl.php \
-		comment-wrapper.tpl.php comment.tpl.php css/ie6.css css/ie7.css \
-		css/iepngfix.htc css/ink.css css/ivy.css css/lime.css \
-		css/nature.css css/print.css css/round.css css/sangue.css \
-		css/sky.css css/style-zero-rtl.css css/style-zero.css \
-		favicon.ico images/all/_brand.png images/all/_sidebarimg.png \
-		images/all/fill_left.png images/all/fill_right.png \
-		images/all/forum-container.jpg images/all/forum-link.png \
-		images/all/icon-comment.png images/all/ltr_forum-container.jpg \
+		comment-wrapper.tpl.php comment.tpl.php css/ie6.css \
+		css/ie7.css css/iepngfix.htc css/ink.css css/ivy.css \
+		css/lime.css css/nature.css css/print.css css/round.css \
+		css/sangue.css css/sky.css css/style-zero-rtl.css \
+		css/style-zero.css favicon.ico images/all/_brand.png \
+		images/all/_sidebarimg.png images/all/fill_left.png \
+		images/all/fill_right.png images/all/forum-container.jpg \
+		images/all/forum-link.png images/all/icon-comment.png \
+		images/all/ltr_forum-container.jpg \
 		images/all/ltr_forum-link.png images/all/ltr_icon-comment.png \
-		images/all/ltr_menu-collapsed.png images/all/menu-collapsed.png \
-		images/all/menu-expanded.png images/all/menu-leaf.png \
-		images/all/menu-up.png images/all/spacer.gif images/arr.png \
-		images/fill_block.png images/fill_block2.png images/fill_top.png \
+		images/all/ltr_menu-collapsed.png \
+		images/all/menu-collapsed.png images/all/menu-expanded.png \
+		images/all/menu-leaf.png images/all/menu-up.png \
+		images/all/spacer.gif images/arr.png images/fill_block.png \
+		images/fill_block2.png images/fill_top.png \
 		images/fill_top_left.png images/fill_top_right.png \
 		images/icons/attach.png images/icons/blocks/icon_01_32.png \
 		images/icons/blocks/icon_01_48.png \
@@ -137,12 +138,13 @@
 		images/sky/fill_top_right.png js/preloadCssImages.jQuery_v5.js \
 		js/suckerfish.js logo.png maintenance-page.tpl.php \
 		node-product.tpl.php node-webform.tpl.php node.tpl.php \
-		page.tpl.php screenshot-drupal.org.jpg screenshot-drupal.org.png \
-		screenshot.png search-result.tpl.php search-theme-form.tpl.php \
-		template.php theme-settings.php views-view.tpl.php \
-		zeropoint.info
+		page.tpl.php screenshot-drupal.org.jpg \
+		screenshot-drupal.org.png screenshot.png search-result.tpl.php \
+		search-theme-form.tpl.php template.php theme-settings.php \
+		views-view.tpl.php zeropoint.info
 DOC_FILES=	CHANGELOG.txt LICENSE.txt README.txt
 
 .include <bsd.port.pre.mk>
 .include "${.CURDIR}/../../www/drupal5/bsd.drupal.mk"
 .include <bsd.port.post.mk>
+
diff -ruN drupal6-zeropoint.orig/distinfo drupal6-zeropoint/distinfo
--- drupal6-zeropoint.orig/distinfo	2010-03-10 07:25:31.000000000 +0900
+++ drupal6-zeropoint/distinfo	2010-03-10 02:26:33.000000000 +0900
@@ -1,3 +1,3 @@
-MD5 (drupal/zeropoint-6.x-1.10.tar.gz) = dbaa5fc01b0bc79bb5459b3dc3fe1c79
-SHA256 (drupal/zeropoint-6.x-1.10.tar.gz) = c6c5f159f0d3519dc9fa254cc9ddbaea399731de7c06ada0aa8cbeb75cca539c
-SIZE (drupal/zeropoint-6.x-1.10.tar.gz) = 384303
+MD5 (drupal/zeropoint-6.x-2.3.tar.gz) = 510bca2664e7cb13735af87b64a4f2d0
+SHA256 (drupal/zeropoint-6.x-2.3.tar.gz) = dc6eec4c57067ec98ec2b5b09187bf65383250d4fcb3cbfb79a6fd8e7dfd5adc
+SIZE (drupal/zeropoint-6.x-2.3.tar.gz) = 384299

http://www.freebsd.org/cgi/query-pr.cgi?pr=144610


www/drupal6-r4032login

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#       www/drupal6-r4032login
#       www/drupal6-r4032login/Makefile
#       www/drupal6-r4032login/distinfo
#       www/drupal6-r4032login/pkg-descr
#
echo c - www/drupal6-r4032login
mkdir -p www/drupal6-r4032login > /dev/null 2>&1
echo x - www/drupal6-r4032login/Makefile
sed 's/^X//' >www/drupal6-r4032login/Makefile << '5cde0bc78d03feafc52b54f67bed9395'
X# New ports collection makefile for:   drupal6-r4032login
X# Date created:                                9 Mar 2010
X# Whom:                                        whitekid@gmail.com
X#
X# $FreeBSD$
X#
X
XPORTNAME=      r4032login
XDISTVERSION=   6.x-1.2
XCATEGORIES=    www
X
XMAINTAINER=    whitekid2gmail.com
XCOMMENT=       r4032login drupal module
X
XDRUPAL6_MODULE=        yes
XMODULE_FILES=  r4032login.module r4032login.info r4032login.install 
XMODULE_DIRS=   translations
XDOC_FILES=     README.TXT LICENSE.txt
X
X.include <bsd.port.pre.mk>
X.include "${.CURDIR}/../../www/drupal5/bsd.drupal.mk"
X.include <bsd.port.post.mk>
5cde0bc78d03feafc52b54f67bed9395
echo x - www/drupal6-r4032login/distinfo
sed 's/^X//' >www/drupal6-r4032login/distinfo << 'a6f822bd1235d42329ab9498b569e634'
XMD5 (drupal/r4032login-6.x-1.2.tar.gz) = 106cbd4e6e87d344c10f510856e70836
XSHA256 (drupal/r4032login-6.x-1.2.tar.gz) = 62c20d6d7a3126ef22e5feed5872a920f44ecfcab15d6f0883d04a6fad9e6276
XSIZE (drupal/r4032login-6.x-1.2.tar.gz) = 8868
a6f822bd1235d42329ab9498b569e634
echo x - www/drupal6-r4032login/pkg-descr
sed 's/^X//' >www/drupal6-r4032login/pkg-descr << 'f8bb830a87e7c75f347ab592e8dd9528'
XRedirect the HTTP 403 error page to the Drupal /user/login page with an
Xoptional message.
X
XWWW: http://drupal.org/project/r4032login
f8bb830a87e7c75f347ab592e8dd9528
exit

drupal6-admin_menu

see http://www.woosum.net/ports/www/drupal6-admin_menu

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#       www/drupal6-admin_menu
#       www/drupal6-admin_menu/Makefile
#       www/drupal6-admin_menu/distinfo
#       www/drupal6-admin_menu/pkg-descr
#
echo c - www/drupal6-admin_menu
mkdir -p www/drupal6-admin_menu > /dev/null 2>&1
echo x - www/drupal6-admin_menu/Makefile
sed 's/^X//' >www/drupal6-admin_menu/Makefile << '6f47df969b7ef7c1e3f076d6bb57f21d'
X# New ports collection makefile for:   drupal6-admin_menu
X# Date created:                                23 Feb 2010
X# Whom:                                        whitekid@gmail.com
X#
X# $FreeBSD$
X#
X
XPORTNAME=      admin_menu
XDISTVERSION=   6.x-1.5
XCATEGORIES=    www
X
XMAINTAINER=    ports@FreeBSD.org
XCOMMENT=       Theme-independent administration interface for drupal.
X
XDRUPAL6_MODULE=        yes
XMODULE_DIRS=   images tests translations
XMODULE_FILES=  admin_menu-rtl.css admin_menu.css admin_menu.inc \
X               admin_menu.info admin_menu.install admin_menu.js \
X               admin_menu.module images/arrow-rtl.png images/arrow.png \
X               images/bkg.png images/bkg_tab.png images/icon_users.png \
X               tests/admin_menu.test translations/admin_menu.pot \
X               translations/da.po translations/de.po translations/es.po \
X               translations/fr.po translations/hu.po translations/ja.po \
X               translations/nl.po translations/pt-br.po translations/ru.po \
X               translations/sv.po
XDOC_FILES=     CHANGELOG.txt README.txt LICENSE.txt
X
X.include <bsd.port.pre.mk>
X.include "${.CURDIR}/../../www/drupal5/bsd.drupal.mk"
X.include <bsd.port.post.mk>
6f47df969b7ef7c1e3f076d6bb57f21d
echo x - www/drupal6-admin_menu/distinfo
sed 's/^X//' >www/drupal6-admin_menu/distinfo << '5a46b96780d00134834a4fb436cad805'
XMD5 (drupal/admin_menu-6.x-1.5.tar.gz) = efa340632c9fd0b9a964671bed27a722
XSHA256 (drupal/admin_menu-6.x-1.5.tar.gz) = 41bef68b0599f781dfe4887055979a677e09b5be3c2a020c3534b95292da3b26
XSIZE (drupal/admin_menu-6.x-1.5.tar.gz) = 45284
5a46b96780d00134834a4fb436cad805
echo x - www/drupal6-admin_menu/pkg-descr
sed 's/^X//' >www/drupal6-admin_menu/pkg-descr << '4d3b06cf926ae9928613690e8cb7eb92'
XAdministration menu module provides a theme-independent administration interface
X(aka. "navigation", "back-end") for Drupal. It's a helper for novice Drupal
Xusers coming from other CMS, a real time-saver for Drupal site administrators,
Xand definitely a must for Drupal developers and site builders.
X
XWWW: http://drupal.org/project/admin_menu
4d3b06cf926ae9928613690e8cb7eb92
exit

Drupal 몇가지 링크들..

흠.. Drupal 사이트 문서는 나중에 찾기는 힘들다..


drupal themesettingsapi module

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	www/drupal6-themesettingsapi
#	www/drupal6-themesettingsapi/Makefile
#	www/drupal6-themesettingsapi/distinfo
#	www/drupal6-themesettingsapi/pkg-descr
#
echo c - www/drupal6-themesettingsapi
mkdir -p www/drupal6-themesettingsapi > /dev/null 2>&1
echo x - www/drupal6-themesettingsapi/Makefile
sed 's/^X//' >www/drupal6-themesettingsapi/Makefile << 'bcb04d505305fd2621e9906bb6352875'
X# New ports collection makefile for:	drupal6-themesettingsapi
X# Date created:				3 Mar 2010
X# Whom:					whitekid@gmail.com
X#
X# $FreeBSD$
X#
X
XPORTNAME=	themesettingsapi
XDISTVERSION=	6.x-1.4
XCATEGORIES=	www
X
XMAINTAINER=	ports@FreeBSD.org
XCOMMENT=	Add custom settings to you theme for drupal.
X
XDRUPAL6_MODULE=	yes
XMODULE_DIRS=	translations
XMODULE_FILES=	themesettingsapi.admin.inc themesettingsapi.info \
X		themesettingsapi.module translations/de.po translations/ja.po \
X		translations/themesettingsapi.pot
XDOC_FILES=	CHANGELOG.txt README.txt LICENSE.txt
X
X.include <bsd.port.pre.mk>
X.include "${.CURDIR}/../../www/drupal5/bsd.drupal.mk"
X.include <bsd.port.post.mk>
bcb04d505305fd2621e9906bb6352875
echo x - www/drupal6-themesettingsapi/distinfo
sed 's/^X//' >www/drupal6-themesettingsapi/distinfo << '935c639b4a6c51408e999d94bc5cd788'
XMD5 (drupal/themesettingsapi-6.x-1.4.tar.gz) = a2b5b5f156ea5b571be9f87638b9f471
XSHA256 (drupal/themesettingsapi-6.x-1.4.tar.gz) = 62be4dcc9ddae6930c3e985b0b0ffbb62584c9b6652a03202ae62053218315fa
XSIZE (drupal/themesettingsapi-6.x-1.4.tar.gz) = 9855
935c639b4a6c51408e999d94bc5cd788
echo x - www/drupal6-themesettingsapi/pkg-descr
sed 's/^X//' >www/drupal6-themesettingsapi/pkg-descr << 'afe1ea8baa59a0619c70f98199a10a5f'
XPathauto is a Drupal module which automatically generates path aliases for
Xvarious kinds of content (nodes, categories, users) without requiring the
Xuser to manually specify the path alias.
X
XWWW: http://drupal.org/project/pathauto
afe1ea8baa59a0619c70f98199a10a5f
exit

drupal simply_moderm theme

themesettingsapi-module 필요함

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#       www/drupal6-simply_modern
#       www/drupal6-simply_modern/Makefile
#       www/drupal6-simply_modern/distinfo
#       www/drupal6-simply_modern/pkg-descr
#
echo c - www/drupal6-simply_modern
mkdir -p www/drupal6-simply_modern > /dev/null 2>&1
echo x - www/drupal6-simply_modern/Makefile
sed 's/^X//' >www/drupal6-simply_modern/Makefile << 'b8cdc2bb06814f1bbeab576f974258a1'
X# New ports collection makefile for:   drupal6-simply_modern
X# Date created:                                3 Mar 2010
X# Whom:                                        whitekid@gmail.com
X#
X# $FreeBSD$
X#
X
XPORTNAME=      simply_modern
XDISTVERSION=   6.x-3.1
XCATEGORIES=    www
X
XMAINTAINER=    ports@FreeBSD.org
XCOMMENT=       The simply modern drupal theme
X
XRUN_DEPENDS=   drupal6-themesettingsapi>=0:${PORTSDIR}/www/drupal6-themesettingsapi
X
XDRUPAL6_THEME= yes
XMODULE_DIRS=   css/images/tabs css/images css js images/black images/blue \
X               images/copper images/green images/red images translations
X
XMODULE_FILES=  block.tpl.php css/default.css css/ie6.css css/ie7.css \
X               css/images/bg_pattern_brown.jpg css/images/header.gif \
X               css/images/screenshot.png css/images/tabs/tab-bar.png \
X               css/images/tabs/tab-left-ie6.png css/images/tabs/tab-left.png \
X               css/images/tabs/tab-right-ie6.png \
X               css/images/tabs/tab-right.png \
X               css/images/tabs/tab-secondary-bg.png \
X               css/images/tabs/tab-secondary.png \
X               css/images/top_gradient_dark.jpg \
X               css/images/top_gradient_light.jpg css/layout.css css/print.css \
X               css/style.css css/tabs.css favicon.ico \
X               images/bg_pattern_brown.jpg images/black/BottomBG.png \
X               images/black/MastBG.png images/black/MenuDiv.png \
X               images/black/RoopleThemeLogo.png images/black/header.gif \
X               images/black/logo.png images/blue/BottomBG.png \
X               images/blue/MastBG.png images/blue/MenuDiv.png \
X               images/blue/RoopleThemeLogo.png images/blue/header.gif \
X               images/blue/logo.png images/copper/BottomBG.png \
X               images/copper/MastBG.png images/copper/MenuDiv.png \
X               images/copper/RoopleThemeLogo.png images/copper/header.gif \
X               images/copper/logo.png images/favicon.ico \
X               images/green/BottomBG.png images/green/MastBG.png \
X               images/green/MenuDiv.png images/green/RoopleThemeLogo.png \
X               images/green/header.gif images/green/logo.png \
X               images/menu_arrow.png images/page_bg_left.png \
X               images/page_bg_right.png images/red/BottomBG.png \
X               images/red/MastBG.png images/red/MenuDiv.png \
X               images/red/RoopleThemeLogo.png images/red/header.gif \
X               images/red/logo.png images/top_gradient_dark.jpg \
X               images/top_gradient_light.jpg js/jquery.pngFix.js \
X               js/pickstyle.js js/suckerfish.js logo.png node.tpl.php \
X               page.tpl.php simply_modern.info template.php \
X               theme-settings.php translations/hu.po
XDOC_FILES=     LICENSE.txt
X
X.include <bsd.port.pre.mk>
X.include "${.CURDIR}/../../www/drupal5/bsd.drupal.mk"
X.include <bsd.port.post.mk>
b8cdc2bb06814f1bbeab576f974258a1
echo x - www/drupal6-simply_modern/distinfo
sed 's/^X//' >www/drupal6-simply_modern/distinfo << 'c3558f3948d3ec2f8921c637916fff39'
XMD5 (drupal/simply_modern-6.x-3.1.tar.gz) = 63ec13e369262adbfe20460838c639f6
XSHA256 (drupal/simply_modern-6.x-3.1.tar.gz) = 193eff35afe3cee7c2270bd7900c04bf4e4a05e2d8e3b579de3ff1dca525ea1a
XSIZE (drupal/simply_modern-6.x-3.1.tar.gz) = 66612
c3558f3948d3ec2f8921c637916fff39
echo x - www/drupal6-simply_modern/pkg-descr
sed 's/^X//' >www/drupal6-simply_modern/pkg-descr << '12a37c37db8f35cffa85aa6be8a15627'
XSimply Modern is a table-less, CSS driven design sporting an advanced feature
Xset.
X
XWWW: http://drupal.org/project/simply_modern
12a37c37db8f35cffa85aa6be8a15627
exit

  • Copyright © 1996-2010 Your wish is my command. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress