<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="/pages/css/rss.css" type="text/css"?>
<rss xmlns:ps="http://trailfire.com" version="2.0"><channel><title>"website-drupal" by enjoylife</title><link>http://www.trailfire.com/enjoylife/trails/70980</link><category>enjoylife/trails</category><ttl>60</ttl><item><title>a more secure drupal [multisite] install | justin hileman dot info</title><link>http://www.trailfire.com/enjoylife/marks/265673</link><description><![CDATA[<P>I love the <A HREF="http://drupal.org">Drupal</A> <ACRONYM TITLE="Content Management System">CMS</ACRONYM>. One of my favorite features of Drupal is the ability to do a multisite install. This site and my other blog, <A HREF="http://iheartstella.com">i &lt;3 stella</A>, are hosted on the same box, using the same Drupal install. Several sites can share one codebase. Updates are easily rolled out to every site simultaneously. Overall, it&#39;s a wonderful idea. But I have some problems with the implementation...<A NAME="teaserbreak"></P><P><A NAME="teaserbreak">The standard way to set up a multisite install is to point each of the domain names at the Drupal install folder and let Drupal sort out which domain each request is coming from. It does a good job, too. But this method introduces some complications. For example, any content uploaded to site a is accessible from site b. A user that visits http://site1.com/myimage.jpg will find the same image as she finds at http://site2.com/myimage.jpg. Websites can&#39;t have domain specific .htaccess or robots.txt files either, which might hurt search engine optimization of individual sites.</A></P><P><A NAME="teaserbreak">An interesting side effect of this is if you want to install something in a subdirectory of your site, for example a WordPress blog at http://site1.com/blog, that exact same WordPress blog will exist in its full glory at http://site2.com/blog...</A></P><P><A NAME="teaserbreak">Another, and perhaps more grave, problem is that all that stands between the interweb and your very own personal settings is an .htaccess file. Install scripts, includes, site configurations and database passwords are in web accessible directories, and that is never a good thing.</A></P><P><A NAME="teaserbreak">We&#39;ll look at one solution to these problems.</A></P><P CLASS="note"><A NAME="teaserbreak">I assume here that you are using</A> <A HREF="http://justinhileman.info/hosting">Linux hosting</A>, that you have shell access, and that you have at least a passing acquaintance with <A HREF="http://en.wikipedia.org/wiki/Symbolic_link">symlinks</A>. If you&#39;re looking for a webhost that meets these requirements, <A HREF="http://www.1and1.com/?k_id=10858481">check out 1and1 shared hosting</A>. I&#39;ve been happy with them, and all of their packages above $9.99/mo will do what you need.</P><P CLASS="note">Microsoft/IIS guys, you can&#39;t do a symlink. You&#39;re looking for something called a <A HREF="http://en.wikipedia.org/wiki/NTFS_junction_point">junction</A>... good luck with that.</P>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 02 Feb 2009 15:02:10 -0800</pubDate><guid isPermalink="false">trailfire:markId:265673</guid></item><item><title>Possible to install Drupal?</title><link>http://www.trailfire.com/enjoylife/marks/265676</link><description><![CDATA[adding the php.ini but removing them from the .htaccess resolved that problem.&nbsp; Which led me to...<BR><BR>Since LP is php 4 and apache 1 I tried removing these 4 lines from the .htaccess<BR><BR>php_value magic_quotes_gpc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<BR>&nbsp; php_value register_globals&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<BR>&nbsp; php_value memory_limit &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12M<BR>&nbsp; php_value session.auto_start&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<BR><BR>and adding these 4 lines to my new php.ini<BR><BR>magic_quotes_gpc = 0<BR>register_globals = 0<BR>memory_limit = 12m<BR>session.auto_start = 0<BR><BR>still I can&#39;t upload files and I haven&#39;t even looked at the clean url thing yet.&nbsp; So hopefully this will get answered and spare you the same tireless hours of fiddling.<BR><BR>oh btw setting up the db and installing drupal was a breeze.&nbsp; had it all done inside an hour.]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 02 Feb 2009 16:10:48 -0800</pubDate><guid isPermalink="false">trailfire:markId:265676</guid></item><item><title>Code snippet: How to set the disabled attribute of a CCK field | drupal.org</title><link>http://www.trailfire.com/enjoylife/marks/265678</link><description><![CDATA[<H1 CLASS="title withtabs node-type-book">Code snippet: How to set the disabled attribute of a CCK field</H1><UL CLASS="tabs primary"><LI CLASS="active"><A CLASS="active" HREF="/node/357328"><SPAN CLASS="a"><SPAN CLASS="b">View</SPAN></SPAN></A></LI><LI><A HREF="/node/357328/edit"><SPAN CLASS="a"><SPAN CLASS="b">Edit</SPAN></SPAN></A></LI><LI><A HREF="/node/357328/revisions"><SPAN CLASS="a"><SPAN CLASS="b">Revisions</SPAN></SPAN></A></LI></UL><DIV CLASS="node"><DIV CLASS="clear-block"><DIV CLASS="terms"><A HREF="/taxonomy/term/102">Drupal 6.x</A> · <A HREF="/taxonomy/term/125">No known problems</A></DIV><DIV CLASS="info-page"><DIV CLASS="modified info-page">Last modified: January 11, 2009 - 10:41</DIV></DIV><DIV CLASS="content"><P>Here&#39;s a code snippet that you can use to set the disabled attribute of a CCK field.</P><P>First, you need to create a small module containing the following code:</P><DIV CLASS="codeblock"><SPAN STYLE="color: rgb(0, 0, 0);"><SPAN STYLE="color: rgb(255, 128, 0);">/**<BR>* @file<BR>* Custom module to set the disabled attribute of CCK fields.<BR>*/<BR><BR>/**<BR>* Implementation of hook_form_alter().<BR>*/<BR></SPAN><SPAN STYLE="color: rgb(0, 119, 0);">function</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">mysnippet_form_alter</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">(&amp;</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$form</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">,</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">$form_state</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">,</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">$form_id</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">) {<BR>&nbsp; if (isset(</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$form</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(221, 0, 0);">&#39;type&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">]) &amp;&amp; isset(</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$form</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(221, 0, 0);">&#39;#node&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">])) {<BR>&nbsp;&nbsp;&nbsp;</SPAN> <SPAN STYLE="color: rgb(255, 128, 0);">// Use this check to match node edit form for a particular content type.<BR>&nbsp;&nbsp;&nbsp;</SPAN> <SPAN STYLE="color: rgb(0, 119, 0);">if (</SPAN><SPAN STYLE="color: rgb(221, 0, 0);">&#39;mytype_node_form&#39;</SPAN> <SPAN STYLE="color: rgb(0, 119, 0);">==</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">$form_id</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">$form</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(221, 0, 0);">&#39;#after_build&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">][] =</SPAN> <SPAN STYLE="color: rgb(221, 0, 0);">&#39;_mysnippet_after_build&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;</SPAN> <SPAN STYLE="color: rgb(255, 128, 0);">// Use this check to match node edit form for any content type.<BR>//&nbsp;&nbsp;&nbsp; if ($form[&#39;type&#39;][&#39;#value&#39;] .&#39;_node_form&#39; == $form_id) {<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $form[&#39;#after_build&#39;][] = &#39;_mysnippet_after_build&#39;;<BR>//&nbsp;&nbsp;&nbsp; }<BR>&nbsp;</SPAN> <SPAN STYLE="color: rgb(0, 119, 0);">}<BR>}<BR><BR></SPAN><SPAN STYLE="color: rgb(255, 128, 0);">/**<BR>* Custom after_build callback handler.<BR>*/<BR></SPAN><SPAN STYLE="color: rgb(0, 119, 0);">function</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">_mysnippet_after_build</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">(</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$form</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">, &amp;</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$form_state</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">) {<BR>&nbsp;</SPAN> <SPAN STYLE="color: rgb(255, 128, 0);">// Use this one if the field is placed on top of the form.<BR>&nbsp;</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">_mysnippet_fix_disabled</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">(</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$form</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(221, 0, 0);">&#39;field_myfield&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">]);<BR>&nbsp;</SPAN> <SPAN STYLE="color: rgb(255, 128, 0);">// Use this one if the field is placed inside a fieldgroup.<BR>//&nbsp; _mysnippet_fix_disabled($form[&#39;group_mygroup&#39;][&#39;field_myfield&#39;]);<BR>&nbsp;</SPAN> <SPAN STYLE="color: rgb(0, 119, 0);">return</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">$form</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">;<BR>}<BR><BR></SPAN><SPAN STYLE="color: rgb(255, 128, 0);">/**<BR>* Recursively set the disabled attribute of a CCK field<BR>* and all its dependent FAPI elements.<BR>*/<BR></SPAN><SPAN STYLE="color: rgb(0, 119, 0);">function</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">_mysnippet_fix_disabled</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">(&amp;</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$elements</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">) {<BR>&nbsp; foreach (</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">element_children</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">(</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$elements</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">) as</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">$key</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">) {<BR>&nbsp;&nbsp;&nbsp; if (isset(</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$elements</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$key</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">]) &amp;&amp;</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">$elements</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$key</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">]) {<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN> <SPAN STYLE="color: rgb(255, 128, 0);">// Recurse through all children elements.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">_mysnippet_fix_disabled</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">(</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$elements</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$key</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">]);<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }<BR><BR>&nbsp; if (!isset(</SPAN><SPAN STYLE="color: rgb(0, 0, 187);">$elements</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(221, 0, 0);">&#39;#attributes&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">])) {<BR>&nbsp;&nbsp;&nbsp;</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">$elements</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(221, 0, 0);">&#39;#attributes&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">] = array();<BR>&nbsp; }<BR>&nbsp;</SPAN> <SPAN STYLE="color: rgb(0, 0, 187);">$elements</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">[</SPAN><SPAN STYLE="color: rgb(221, 0, 0);">&#39;#attributes&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">][</SPAN><SPAN STYLE="color: rgb(221, 0, 0);">&#39;disabled&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">] =</SPAN> <SPAN STYLE="color: rgb(221, 0, 0);">&#39;disabled&#39;</SPAN><SPAN STYLE="color: rgb(0, 119, 0);">;<BR>}<BR></SPAN><SPAN STYLE="color: rgb(0, 0, 187);">?&gt;</SPAN></SPAN></DIV><P><STRONG>Explanation:</STRONG></P><P>Setting the #disabled attribute of the element in form_alter doesn&#39;t work because the FAPI process handler of the CCK field won&#39;t transfer the #disabled attribute to its children elements. So we need to find a different method...</P><P>We can do this using our own <A HREF="http://api.drupal.org/api/file/developer/topics/forms_api_reference.html/6#after_build">#after_build</A> handler, but here we cannot simple set the $element[&#39;#disabled&#39;] attribute of the element. The reason is this attribute is transformed into $element[&#39;#attributes&#39;][&#39;disabled&#39;] by _form_builder_handle_input_element executes(), which is the format FAPI theme functions know about. However, _form_builder_handle_input_element executes() is executed before #after_build handlers are invoked, so our own handler needs to set the value as the theme functions expect. See <A HREF="http://api.drupal.org/api/function/form_builder/6">form_builder()</A>.</P><P>Finally, we need to use a recursive function so that we can set the disabled attribute of all the FAPI elements that depend on the CCK field we&#39;re interested in. Think for example about a checkboxes element, etc.</P></DIV></DIV></DIV>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 02 Feb 2009 17:01:45 -0800</pubDate><guid isPermalink="false">trailfire:markId:265678</guid></item><item><title>Part 8: Enhancing the form with Javascript, AJAX | Mooffie&amp;#039;s place</title><link>http://www.trailfire.com/enjoylife/marks/265679</link><description><![CDATA[<DIV ID="header"><DIV ID="logoWrapper"><DIV ID="siteName"><A TITLE="Home" HREF="/%7Emooffie/cms/">Mooffie&#39;s place</A></DIV></DIV><DIV ID="nav"><UL CLASS="links-menu"><LI><A HREF="/%7Emooffie/cms/">Home</A></LI><LI><A HREF="/%7Emooffie/cms/holidays">Holidays</A></LI><LI><A HREF="/%7Emooffie/cms/natsort_demo1">NaturalSort</A></LI><LI><A HREF="/%7Emooffie/cms/user/login">Login</A></LI></UL></DIV></DIV><DIV ID="content"><DIV CLASS="breadcrumb"><A HREF="/%7Emooffie/cms/">Home</A> » <A HREF="/%7Emooffie/cms/node/15">Dependent Dropdowns in CCK, a Tutorial</A></DIV><DIV CLASS="pageTitle">Part 8: Enhancing the form with Javascript, AJAX</DIV><DIV CLASS="tabs"><UL CLASS="tabs primary"><LI CLASS="active"><A CLASS="active" HREF="/%7Emooffie/cms/node/22">View</A></LI><LI><A HREF="/%7Emooffie/cms/node/22/who">Who&#39;s bookmarked this page?</A></LI></UL></DIV><DIV CLASS="node"><SPAN CLASS="submitted">Submitted by <A TITLE="View user profile." HREF="/%7Emooffie/cms/user/mooffie">mooffie</A> on Sun, 05/20/2007 - 15:38.</SPAN><DIV CLASS="content"><P>We can think of more ideas to enhance the form.</P><P>For example, we can save the user clicking the &quot;Update location field&quot; button by... clicking it for him. We do this by attaching an onchange event handler to the &#39;country&#39; and &#39;state&#39; fields. This onchange handler would automatically click the button for the user. Furthermore, the user don&#39;t even have to <EM>see</EM>&nbsp;this button, so we can hide it (hide it via Javascript so in case no Javascript support is there the user can still access the button).</P><P>That was one idea.</P><P>But we have another idea, a marvelous one with chocolate on top:</P><P>We don&#39;t like the way <EM>all</EM>&nbsp;the page gets refreshed when this button is clicked. Why don&#39;t we channel the response from the server into a hidden frame (IFRAME), load this textual response from here into a Javascript variable and finally replace only the &quot;Location&quot; fieldset the user sees on screen with this response? This would have a pleasant visual effect: the user would feel he never</P></DIV></DIV></DIV>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 02 Feb 2009 17:50:49 -0800</pubDate><guid isPermalink="false">trailfire:markId:265679</guid></item><item><title>Using hook_form_alter to fill in cck fields automatically and then hiding them from users | DrupalBin</title><link>http://www.trailfire.com/enjoylife/marks/265682</link><description><![CDATA[<DIV CLASS="clear-block" ID="tabs-wrapper"><H2 CLASS="with-tabs">Using hook_form_alter to fill in cck fields automatically and then hiding them from users</H2><UL CLASS="tabs primary"><LI CLASS="active"><A CLASS="active" HREF="/64">View</A></LI><LI><A HREF="/node/64/exportnode/text">Download</A></LI><LI><A TITLE="Post a fix for this code snippet" HREF="/node/64/clone">Fix</A></LI></UL></DIV>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 02 Feb 2009 18:27:32 -0800</pubDate><guid isPermalink="false">trailfire:markId:265682</guid></item><item><title>Modifying CCK fieldgroups with hook_form_alter() | Proof</title><link>http://www.trailfire.com/enjoylife/marks/265683</link><description></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 02 Feb 2009 18:33:04 -0800</pubDate><guid isPermalink="false">trailfire:markId:265683</guid></item><item><title>Mooffie&amp;#039;s place</title><link>http://www.trailfire.com/enjoylife/marks/265692</link><description></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 02 Feb 2009 18:41:23 -0800</pubDate><guid isPermalink="false">trailfire:markId:265692</guid></item><item><title>Mooffie&amp;#039;s place</title><link>http://www.trailfire.com/enjoylife/marks/265693</link><description></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 02 Feb 2009 18:42:21 -0800</pubDate><guid isPermalink="false">trailfire:markId:265693</guid></item><item><title>Drupal v5.12 CCK node reference modify a named field : Drupa, php, Firefox v3.0.3, http://drupal.org/node/331383</title><link>http://www.trailfire.com/enjoylife/marks/265695</link><description><![CDATA[Drupal v5.12 CCK node reference modify a named field<BR><BR><BR><DIV CLASS="answerBody quoted" ID="EchoTopic"><DIV CLASS="richText">Hi this is actually a very simple solution. &nbsp;You just need to forget about Drupal, CCK etc, and focus on the jQuery because all you need is some JavaScript to populate the relevant fields with the data which I assume you can already get.<BR><BR>There&#39;s a great page here, and the Simple tab has a demo: <A HREF="http://www.keyframesandcode.com/resources/javascript/jQuery/demos/populate-demo.html" TARGET="_blank">http://www.keyframesandcod<WBR>e.com/reso<WBR>urces/java<WBR>script/jQu<WBR>ery/<WBR>demos/<WBR>populate-d<WBR>emo.html</A></DIV></DIV>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 02 Feb 2009 18:53:44 -0800</pubDate><guid isPermalink="false">trailfire:markId:265695</guid></item><item><title>Drupal Multisite Configurations and Hosts</title><link>http://www.trailfire.com/enjoylife/marks/265907</link><description><![CDATA[<P>It is still possible to execute shell code without shell access. To execute shell code in Drupal, simply create a PHP page with the following and execute it from your root Drupal directory:</P><P><FONT COLOR="#000000"><FONT COLOR="#0000BB"><FONT COLOR="#007700">print `</FONT><FONT COLOR="#0000BB">ln -s /root_path/public_html/ /root_path/public_html/newsite</FONT><FONT COLOR="#007700">`;</FONT> <FONT COLOR="#0000BB">?&gt;</FONT></FONT>&nbsp;</FONT></P>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Tue, 03 Feb 2009 15:06:53 -0800</pubDate><guid isPermalink="false">trailfire:markId:265907</guid></item><item><title>Ethan&amp;#039;s blog | EchoDitto Labs</title><link>http://www.trailfire.com/enjoylife/marks/266097</link><description><![CDATA[<H2 CLASS="title"><A HREF="/drupal-i18n-L10n-part-1">Drupal Internationalization: Part I, and introduction</A></H2><DIV CLASS="picture"><A TITLE="View user profile." HREF="/user/9"><IMG TITLE="Ethan's picture" ALT="Ethan's picture" SRC="http://echodittolabs.org/files/pictures/picture-9.jpg"></A></DIV><DIV CLASS="submitted">Submitted by <A TITLE="View user profile." HREF="/user/9">Ethan</A><BR>on Thu, 07/24/2008 - 19:13.</DIV><SPAN CLASS="taxonomy">Tags:&nbsp;</SPAN><UL CLASS="links inline"><LI CLASS="first taxonomy_term_46"><SPAN CLASS="taxonomy"><A CLASS="taxonomy_term_46" HREF="/taxonomy/term/46">drupal</A></SPAN></LI><LI CLASS="taxonomy_term_199"><SPAN CLASS="taxonomy"><A CLASS="taxonomy_term_199" HREF="/taxonomy/term/199">i18n</A></SPAN></LI><LI CLASS="taxonomy_term_198"><SPAN CLASS="taxonomy"><A CLASS="taxonomy_term_198" HREF="/taxonomy/term/198">internationalization</A></SPAN></LI><LI CLASS="taxonomy_term_201"><SPAN CLASS="taxonomy"><A CLASS="taxonomy_term_201" HREF="/taxonomy/term/201">l10n</A></SPAN></LI><LI CLASS="last taxonomy_term_200"><SPAN CLASS="taxonomy"><A CLASS="taxonomy_term_200" HREF="/taxonomy/term/200">localization</A></SPAN></LI></UL><DIV STYLE="clear: left;"><DIV CLASS="content"><P>We&#39;ve recently begun putting together the infrastructure for a number of upcoming projects which will organize people around the world toward some pretty powerful, ambitious goals. While the details of those sites are still in the works, working with Drupal to create multi-language sites has been a great experience involving a great deal of learning. This is the first of a two part series covering how Drupal works with multiple languages and the best practices/tricks of the trade for making the most of the Drupal Local, i18n and L10n systems.</P></DIV></DIV>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Wed, 04 Feb 2009 12:31:14 -0800</pubDate><guid isPermalink="false">trailfire:markId:266097</guid></item><item><title>使用 views 建立tabs, use view to build tabs | JOE Tsui&amp;#039;s Drupal site</title><link>http://www.trailfire.com/enjoylife/marks/266634</link><description><![CDATA[<P>上圖顯示了一個經過修改的 user page 的 tabs</P><P>tabs 其實來自一個 hook(), menu_local_tasks()<BR>用 theme developer 指一下便可以看到<BR>但這次介紹的並不是要修改這個 hook 的 theme template<BR>而是使用 views, 新增一個tab 到這個地方</P><P>在上圖的例子,<BR>一個 url 為 [root]/user 的 頁面,<BR>要在 views 建立一個的 tab,</P><OL><LI>建立一個 page views</LI><LI>正常的輸入所需的資料 (sort, filter.....)</LI><LI>page 的 path 要設定為 user/%/[joe] ([joe]為任何值)</LI><LI>在 page 的參數選項之中, 有一個 men</LI></OL>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Fri, 06 Feb 2009 18:47:32 -0800</pubDate><guid isPermalink="false">trailfire:markId:266634</guid></item><item><title>log4drupal - a logging api for drupal | johnandcailin</title><link>http://www.trailfire.com/enjoylife/marks/266635</link><description><![CDATA[<H1 CLASS="title">log4drupal - a logging api for drupal</H1><DIV ID="node-127" CLASS="node ntype-blog"><DIV CLASS="submitted-taxonomy"><SPAN CLASS="submitted">posted november 12th, 2007 by <A TITLE="view user details." HREF="/usernode/cailin">cailin</A></SPAN><DIV CLASS="taxonomy">in<UL CLASS="links inline"><LI CLASS="first taxonomy_term_19"><A CLASS="taxonomy_term_19" HREF="/category/blog-tags/drupal">drupal</A></LI><LI CLASS="last taxonomy_term_17"><A CLASS="taxonomy_term_17" HREF="/category/blog-tags/tech">tech</A></LI></UL></DIV></DIV><DIV CLASS="content"><P>if your career as a developer has included a stay in the j2ee world, then when you arrived at drupal one of your initial questions was <EM>&quot;where&#39;s the log file?&quot;</EM>. eventually, someone told you about the watchdog table. you decided to try that for about five minutes, and then were reduced to using a combination of</P><PRE> and print_r to scrawl debug data across your web browser.<BR>

<BR>when you tired of that, you learned a little php, did a little web research and discovered the PEAR log package and debug_backtrace(). the former is comfortably reminiscent of good old log4j and the latter finally gave you the stacktrace you&#39;d been yearning for.  still, separately, neither gave you quite what you were looking for :  a log file in which every entry includes the filename and line number from which the log message originated.  put them together though, and you&#39;ve got <A HREF="http://www.johnandcailin.com/files/log.tar.gz">log4drupal</A> 

<BR>log4drupal is a simple api that writes messages to a log file.  each message is tagged with a particular log priority level (debug, info, warn, error or em</PRE></DIV></DIV>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Fri, 06 Feb 2009 18:47:44 -0800</pubDate><guid isPermalink="false">trailfire:markId:266635</guid></item><item><title>Writing a simple node_access module: resume access | 2bits.com, Inc. - Drupal Development, Customization and Consulting</title><link>http://www.trailfire.com/enjoylife/marks/267494</link><description><![CDATA[<P>One of the powerful features in Drupal is the node_access system. This is an API within Drupal which allows modules to do fine grained access access contol to individual nodes.</P><P>If you are using Drupal core, this system does nothing. You need to either enable one of the many node access modules, or write your own module to do that.</P><P>Writing a simple specialized node access module is what this article covers.</P><H2>Privacy for resumes</H2><P>The resume_access module is part of the <A TARGET="_blank" HREF="http://drupal.org/project/jobsearch">Drupal jobsearch</A> module, which 2bits wrote. In a nutshell, the jobsearch modules allows you to define one or more content types to be job postings (openings, contracts, ...etc), and one or more to be resumes (CVs for those across the pond). Then for the job postings, there is an &quot;apply&quot; link that prompts job candidates to apply to the job.</P><P>One request is to make resumes private so job applicants cannot see other job applicants&#39; resumes.</P><P>The module we are discussing today is called resume_access, and it does this by using the node_access system.</P><P>First we define a permission called &quot;view resumes&quot;. Under Roles, you select one or more roles that has the right to see resumes, for example employers, recruiters, ...etc.</P>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 09 Feb 2009 15:02:29 -0800</pubDate><guid isPermalink="false">trailfire:markId:267494</guid></item><item><title>Drupal Code Search</title><link>http://www.trailfire.com/enjoylife/marks/267495</link><description><![CDATA[<P>Drupal Code Search helps you find <A HREF="http://drupal.org">Drupal</A> code easier!</P><UL><LI>Search source code from thousands of Drupal modules and themes.</LI><LI>Use the power of <A HREF="http://en.wikipedia.org/wiki/Regular_expression#Syntax">regular expressions</A> to find exactly what you need.</LI><LI>Easily restrict results to specific Drupal versions and programming languages.</LI><LI>Results provided by the <A HREF="http://code.google.com/apis/codesearch/">Google Code Search API</A>.</LI></UL><P>Search Examples</P>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 09 Feb 2009 15:21:13 -0800</pubDate><guid isPermalink="false">trailfire:markId:267495</guid></item><item><title>learning drupal &amp;raquo; cck</title><link>http://www.trailfire.com/enjoylife/marks/267504</link><description><![CDATA[<DIV CLASS="post"><H3 ID="post-47"><A TITLE="Permanent Link to to custom-theme a node type" HREF="http://circuitous.org/stumble/?p=47">to custom-theme a node type</A></H3><SMALL>Monday, October 23rd, 2006</SMALL><DIV CLASS="entry"><P>make a template called “<EM>node-type</EM>.tpl.php”. for cck circa aug 2006, this is ‘node-content_<EM>cust_content_name</EM>.tpl.php’. then put this in to find out what info is available:</P><P>gleaned from <A HREF="http://drupal.org/node/62468">creating a template handbook</A>.</P></DIV><P CLASS="postmetadata">Posted in <A TITLE="View all posts in content type" HREF="http://circuitous.org/stumble/?cat=3">content type</A>, <A TITLE="View all posts in how to" HREF="http://circuitous.org/stumble/?cat=13">how to</A>, <A TITLE="View all posts in solution" HREF="http://circuitous.org/stumble/?cat=19">solution</A>, <A TITLE="View all posts in themes" HREF="http://circuitous.org/stumble/?cat=20">themes</A>, <A TITLE="View all posts in theming" HREF="http://circuitous.org/stumble/?cat=21">theming</A>, <A TITLE="View all posts in cck" HREF="http://circuitous.org/stumble/?cat=25">cck</A>, <A TITLE="View all posts in nodes" HREF="http://circuitous.org/stumble/?cat=27">nodes</A>, <A TITLE="View all posts in my drupal" HREF="http://circuitous.org/stumble/?cat=30">my drupal</A> | <A TITLE="Comment on to custom-theme a node type" HREF="http://circuitous.org/stumble/?p=47#respond">No Comments »</A></P></DIV><DIV CLASS="post"><H3 ID="post-46"><A TITLE="Permanent Link to views module patch" HREF="http://circuitous.org/stumble/?p=46">views module patch</A></H3><SMALL>Monday, October 23rd, 2006</SMALL></DIV>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 09 Feb 2009 16:24:49 -0800</pubDate><guid isPermalink="false">trailfire:markId:267504</guid></item><item><title>Resources and links on debugging, tracing and profiling Drupal | 2bits.com, Inc. - Drupal Development, Customization and Consulting</title><link>http://www.trailfire.com/enjoylife/marks/267514</link><description><![CDATA[<P>This is a collection of useful links on debugging, tracing, and profiling Drupal.</P><UL><LI>Drupal <A TARGET="_blank" HREF="http://drupal.org/project/devel">devel module</A> has some support for xdebug. It is valuable for other info as well such as page load times, list of queries run for the page, ...etc.</LI><LI>The <A TARGET="_blank" HREF="http://drupal.org/project/forminspect">Form Inspect module</A> is a devel add on that dumps the form ID and the array of form values.</LI><LI>Drupal&#39;s <A TARGET="_blank" HREF="http://drupal.org/project/trace">trace module</A> provides tracing for hooks, database queries and errors. Read the author&#39;s <A TARGET="_blank" HREF="http://bendiken.net/2006/12/03/easier-drupal-debugging-with-trace">article</A> on it.</LI><LI>Simple <A TARGET="_blank" HREF="http://realize.be/some-simple-debugging-tips-drupal">debugging tips</A> for Drupal that does not involve an IDE nor a real debugger but worth reading and using.</LI><LI>Article on <A TARGET="_blank" HREF="http://www.drupal.org.uk/node/64">Debugging Drupal with ActiveState Komodo</A>, on drupal.org.uk. This is a well written article covering local debugging. Remote debugging is a bit more tricky to get going, and setting it up with multiuser debugging is more challenging.</LI><LI>Article on setting <A TARGET="_blank" HREF="http://www.sysarchitects.com/node/22">Komodo for PHP on Mac OSX</A>. Although the article says this is remote debugging, everything is running on the same box, and no need to map local files to remote ones.</LI><LI>Debugging Drupal 6.x with <A TARGET="_blank" HREF="http://krimson.be/en/debugging-drupal-6-using-xdebug">Eclipse and Xdebug</A>.</LI><LI>Another <A TARGET="_blank" HREF="http://programmingbulls.com/debugging-drupal-php--xdebug-eclipse">Eclipse and Xdebug</A> article.</LI><LI><A TARGET="_blank" HREF="http://php.net/debugger">Debugging PHP</A> on php.net.</LI><LI>An somewhat old forum post on drupal.org on <A TARGET="_blank" HREF="http://drupal.org/node/1466">debugging PHP</A>.</LI><LI>An article by Steve M of OpenConcept on <A TARGET="_blank" HREF="http://openconcept.ca/debugging_php_on_ubuntu_feisty_fawn">Debugging PHP on Ubuntu Feisty Fawn</A>.</LI><LI>Adam Harvey is being mentored by Derick Rethans during the Google Summer of Code 2007 to develop a <A TARGET="_blank" HREF="http://code.google.com/soc/php/appinfo.html?csaid=44D9F90ADC3F0414">platform independent Xdebug client for PHP</A>.</LI></UL><P>Got a good article about debugging Drupal or hints and tips on that? Post it as a comment below</P>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 09 Feb 2009 16:41:02 -0800</pubDate><guid isPermalink="false">trailfire:markId:267514</guid></item><item><title>Displaying page generation time on Drupal pages | 2bits.com, Inc. - Drupal Development, Customization and Consulting</title><link>http://www.trailfire.com/enjoylife/marks/267517</link><description><![CDATA[<P>However, there are sometimes side effects to enabling the devel module on 4.6 and 4.7, that may manifest itself in certain situations. For example, showing errors on the screen directly.</P><P>If you want the timer functionality without the full devel, here is a tiny module that displays the timer at the bottom of every page.</P><P>To configure it, you have to add the following to the bottom of your settings.php file.</P>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 09 Feb 2009 16:46:07 -0800</pubDate><guid isPermalink="false">trailfire:markId:267517</guid></item><item><title>Themeing a specific CCK field | drewish.com</title><link>http://www.trailfire.com/enjoylife/marks/267522</link><description><![CDATA[But after copying CCK&#39;s content-field.tpl.php into my theme and renaming it I couldn&#39;t seem to get the theme to pick it up. <A HREF="http://drupal.org/user/67977">Roger López</A> gave me the frustratingly simple answer on irc: &quot;i think you need to have both templates in place&quot;... duh. Copied content-field.tpl.php into my theme and everything worked great.]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 09 Feb 2009 17:50:28 -0800</pubDate><guid isPermalink="false">trailfire:markId:267522</guid></item><item><title>Programatically creating a CCK field in Drupal 6 | drewish.com</title><link>http://www.trailfire.com/enjoylife/marks/267523</link><description></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 09 Feb 2009 17:52:00 -0800</pubDate><guid isPermalink="false">trailfire:markId:267523</guid></item><item><title>drupal theme：按照内容类型设计页面布局 | Drupal China</title><link>http://www.trailfire.com/enjoylife/marks/268250</link><description></description><category>website-drupal</category><author>enjoylife</author><pubDate>Fri, 13 Feb 2009 16:32:10 -0800</pubDate><guid isPermalink="false">trailfire:markId:268250</guid></item><item><title>drupal theme：按照内容类型设计页面布局 | Drupal China</title><link>http://www.trailfire.com/enjoylife/marks/268251</link><description><![CDATA[http://drupal.org/node/45944]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Fri, 13 Feb 2009 16:32:27 -0800</pubDate><guid isPermalink="false">trailfire:markId:268251</guid></item><item><title>http://www.comeongame.com/ 的设计流程 | Drupal China</title><link>http://www.trailfire.com/enjoylife/marks/268252</link><description><![CDATA[<P><A HREF="http://www.comeongame.com/">http://www.comeongame.com/</A> english game site, online games, flash games<BR>其实我不知道用drupal是否适合设计这样的站，但是用drupal已经习惯了，就设计个，不会php, 虽然难了点，但还是被他强大的灵活性所吸引，欲罢不能...<BR>这次我用了6.x设计我的game搜集站，主要是因为image field可以有link to node，并且图片和swf文件的上传都采用 用户ID/年月...这个方式，避免了大量文件都传到一个文件夹下的情况.... 以后站大了，这样做文件管理也好些... 这次是5.7版的comeongame(<A HREF="http://www.greenidea.net">www.greenidea.net</A>)的升级。。。<BR>第一：主题设计<BR>关于主题设计主要是采用了复写，在这里感谢drupaluser.cn提供给我的帮助，使我终于脱离了panels模块, 可以随意设计自己的排版!<BR>page-front.tpl.php 复写首页<BR>page-taxonomy.tpl.php 复写列表页<BR>page-flashnode.tpl.php 和 node-flashnode.tpl.php 复写flash内页<BR>复写page-flashnode.tpl.php注意....直接复写并不会成功，参照http://drupaluser.cn/html/mytheme/2009-01-01/332.html</P><P>这里主要是采用drupal的复写机制... 首先在.info文件里面建立自己的region, like this:<BR>regions[left] = Left sidebar<BR>regions[right] = Right sidebar<BR>regions[content] = Content<BR>regions[header] = Header<BR>regions[footer] = Footer<BR>然后你可以用css+div写自己的模板，将regins放在你想放的地方... regions不能放在node上... 如果想法似乎要搞template.php,我也尝试过，成功了！</P><P>关于flash游戏页面的设计，$content变量被我具体化成很多变量，主要是我想按照自己的div排版安排位置...这里我主要用content templete去找变量...然后同样道理用div+css结合变量去设计layout....这样可以方便随意设计出自己的排版.....为了有很好的seo, mate keywords和desciption部分我也加入了部分变量输出.....</P><P>第二：模块的使用<BR>因为我的站是flash小游戏搜集站，所以主要依靠flash node的功能.....输出用view2+cck, 然后还有投票的功能我用了vote up and down....你也需要cck的image field去输出游戏的截图, 用pathauto去定义了下node的url,形式是...../分类名/文章标题，分类用 Taxonomy</P><P>主要有6大类，分别在首页输出block,关于view2的主题制作也是复写....用css+div控制下就可以了</P><P>大概就是这么个流程.... 希望高手指点....</P>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Fri, 13 Feb 2009 16:33:51 -0800</pubDate><guid isPermalink="false">trailfire:markId:268252</guid></item><item><title>Drupal打造中国化主题系列教程(4)--创建tpl文件 | Drupal使用者中文社区[Drupaluser.cn]</title><link>http://www.trailfire.com/enjoylife/marks/268253</link><description><![CDATA[<P>有很多朋友拿到了我的主题，启用以后却发现和我的主题有很多差别，这是因为我的主题是定制的，<BR>不像drupal官方提供的那样拿过来就能直接用，区块的位置和我的后台设置的不一样的话，样式都会乱<BR>所以我在这里只是提供一个制作方法；</P><P>在第一部分当中，我已经介绍过了，Drupal使用者中文社区[ <A TITLE="http://drupaluser.cn" HREF="http://drupaluser.cn">http://drupaluser.cn</A> ]的tpl文件主要是以下几个</P><P>首页我们使用page-front.tpl.php文件覆写<BR>列表页面我们使用page-taxonomy.tpl.php文件覆写<BR>内容显示我们使用page-story.tpl.php和 node-story.tpl.php来覆写<BR>其他的静态页面我们使用page-page.tpl.php和node-page.tpl.php来覆写</P><P>其中page-story.tpl.php 和page-page.tpl.php不是默认就会起作用，比较常见的有两种方法可以让他起作用，</P><P>一种是drupal的风格，在template.php中覆写函数实现，这种方法老葛的zhupou上面有介绍，在此不再赘述了<BR>另一种是比较容易理解的风格，可以在page.tpl.php上面写一个判断，让他根据内容类型自己选择模板文件，<BR>如以下写法：</P>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Fri, 13 Feb 2009 16:34:23 -0800</pubDate><guid isPermalink="false">trailfire:markId:268253</guid></item><item><title>小技巧 - 使用firebug幫忙定制theme | JOE Tsui&amp;#039;s Drupal site</title><link>http://www.trailfire.com/enjoylife/marks/268254</link><description><![CDATA[<P>最近在盤算在兩個freelance 之間擠出些時間做一個全新的theme<BR>碰巧又沒有什麼特別的題目或教學<BR>所以發表些我定制這個theme 時的一些小技巧<BR>(這些小技巧不一定會出現在未完成的這個theme 內)</P><P>比如說我要在 &quot;Read more&quot; &quot;Add new comment&quot; 之前加個可愛的icon</P><P>但因為&quot;Read more&quot; 和 &quot;Add new comment&quot; 畏使用不同的icon (當然吧)<BR>所以要看看從css 上它們的class 或 id 值有否特定<BR>才可以用css 定制不同的icon<BR>如不, 可能要hack 核心或使用js 來忙了</P>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Fri, 13 Feb 2009 16:54:34 -0800</pubDate><guid isPermalink="false">trailfire:markId:268254</guid></item><item><title>Cavegoat.com - free classifieds site powered by Drupal | drupal.org</title><link>http://www.trailfire.com/enjoylife/marks/272764</link><description><![CDATA[<DIV CLASS="content"><P>Check out Zucker&#39;s post entitled &quot; Sorry I didn&#39;t respond sooner&quot; at <A TITLE="http://drupal.org/node/23991" HREF="http://drupal.org/node/23991">http://drupal.org/node/23991</A>. Let me know if this answers your question.</P></DIV><DIV CLASS="links"><SPAN><A HREF="/user/login?destination=comment/reply/371333%2523comment-form"></SPAN></DIV>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 16 Mar 2009 14:03:37 -0700</pubDate><guid isPermalink="false">trailfire:markId:272764</guid></item><item><title>Video Series: Building Drupal Modules - Getting Started | GotDrupal.com | Drupal Tutorials</title><link>http://www.trailfire.com/enjoylife/marks/272777</link><description></description><category>website-drupal</category><author>enjoylife</author><pubDate>Mon, 16 Mar 2009 15:43:39 -0700</pubDate><guid isPermalink="false">trailfire:markId:272777</guid></item><item><title>Drupal Tutorials | Webmaster Tips</title><link>http://www.trailfire.com/enjoylife/marks/272913</link><description><![CDATA[<H1>Drupal Tutorials</H1><DIV STYLE="padding: 25px 0pt 0pt;">&lt;!--
google_ad_client = &quot;pub-0289052664169907&quot;;
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = &quot;468x60_as&quot;;
google_ad_type = &quot;text_image&quot;;
//2007-10-15: TIPS-banner-top-rounded
google_ad_channel = &quot;8580387666&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;0000FF&quot;;
google_color_text = &quot;333333&quot;;
google_color_url = &quot;CCCCCC&quot;;
google_ui_features = &quot;rc:10&quot;;
//--&gt;
 </DIV><DIV CLASS="node" ID="node-207"><DIV CLASS="tags-top"><DIV CLASS="terms">Tags:<UL CLASS="links inline"><LI CLASS="first last taxonomy_term_38"><A CLASS="taxonomy_term_38" HREF="/general/drupal">Drupal</A></LI></UL></DIV></DIV><SPAN CLASS="submitted">2007, July 14 - 11:17am — Webmaster Tips</SPAN><DIV CLASS="content"><P>This section of the site contains Drupal tutorials. When browsing the Drupal-specific areas of this site, look for the Drupal tutorials menu that appears on the left sidebar. The list of tutorials is also listed below.</P></DIV></DIV>]]></description><category>website-drupal</category><author>enjoylife</author><pubDate>Tue, 17 Mar 2009 11:30:54 -0700</pubDate><guid isPermalink="false">trailfire:markId:272913</guid></item><item><title>Views | Sri Ezhumalaiyar Transport &amp;amp; Auto Consultant</title><link>http://www.trailfire.com/enjoylife/marks/274786</link><description></description><category>website-drupal</category><author>enjoylife</author><pubDate>Tue, 31 Mar 2009 16:42:29 -0700</pubDate><guid isPermalink="false">trailfire:markId:274786</guid></item></channel></rss>
