<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.juliakm.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>programming</title>
 <link>http://www.juliakm.com/topics/programming</link>
 <description>The taxonomy view with a depth of 0.</description>
 <language>en</language>
<item>
 <title>Adding author name to the Drupal search index</title>
 <link>http://www.juliakm.com/adding-author-name-drupal-search-index</link>
 <description>&lt;p&gt;Awhile back, I wanted to add author names to the Drupal search index. After poking around a bit, I found that this was actually pretty easy. I created a new module called custom_helper and in it put the following function:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;//Adding author name to the search index&lt;br /&gt;function custom_helper_nodeapi($node, $op, $arg = 0) {&lt;br /&gt;&amp;nbsp; switch ($op) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &amp;#039;update index&amp;#039;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($node-&amp;gt;uid) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $user = user_load(array(&amp;#039;uid&amp;#039; =&amp;gt; $node-&amp;gt;uid));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $user-&amp;gt;name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;One thing to keep in mind is that if you do this, then you will need to re-index all of your previously indexed nodes if you wanted them to be indexed by author name. &lt;/p&gt;
</description>
 <comments>http://www.juliakm.com/adding-author-name-drupal-search-index#comments</comments>
 <category domain="http://www.juliakm.com/topics/drupal">Drupal</category>
 <category domain="http://www.juliakm.com/topics/programming">programming</category>
 <pubDate>Tue, 01 Apr 2008 08:04:11 -0700</pubDate>
 <dc:creator>Julia</dc:creator>
 <guid isPermaLink="false">44 at http://www.juliakm.com</guid>
</item>
<item>
 <title>Adding to $items in a Drupal view</title>
 <link>http://www.juliakm.com/adding-items-drupal-view</link>
 <description>&lt;p&gt;I recently needed to add an extra link to the end of my $items list in a list view and found that this could be done quickly in template.php. &lt;/p&gt;
&lt;p&gt;I set out to do two things:&lt;br /&gt;
- add a link to the end of my list view that does not contain node data&lt;br /&gt;
- as part of this last list item, include a custom link that changes depending on the name of the view&lt;/p&gt;
&lt;p&gt;Accomplishing this was a lot easier than I expected. All I had to do was add a switch statement for the view name, and also add a line with the content I wanted to add to my $items array before the theming function.&lt;br /&gt;
&lt;!--break--&gt;&lt;br /&gt;
Here is my code:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000CC&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;function &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;phptemplate_views_view_list_myview&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$view&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$nodes&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$type&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) {&lt;br /&gt;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$fields &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;= &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;_views_get_fields&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;();&lt;br /&gt;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$taken &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;= array();&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#FF9900&quot;&gt;// Set up the fields in nicely named chunks.&lt;br /&gt;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;foreach (&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$view&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;-&amp;gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;field &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;as &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$id &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;=&amp;gt; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field_name &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;= &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;field&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isset(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$taken&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field_name&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field_name &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;= &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;queryname&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$taken&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field_name&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;true&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field_names&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$id&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field_name&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#FF9900&quot;&gt;// Set up some variables that won&#039;t change.&lt;br /&gt;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$base_vars &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;= array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;view&#039; &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;=&amp;gt; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$view&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;view_type&#039; &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;=&amp;gt; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$type&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;,&lt;br /&gt;&amp;nbsp; );&lt;br /&gt;&lt;br /&gt;&amp;nbsp; foreach (&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$nodes &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;as &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$i &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;=&amp;gt; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$node&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;= &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$base_vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;node&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$node&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;fullNode&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;node_load&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$node&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;-&amp;gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;nid&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;link&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;l&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;fullNode&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;]-&amp;gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;body&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;node/&#039; &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;. &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$node&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;-&amp;gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;nid&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;count&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$i&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;stripe&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$i &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;% &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;2 &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;? &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;even&#039; &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;: &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;odd&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#FF9900&quot;&gt;//adding extra variable for view name contextual links, in a template, this will be $linked_page. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;switch (&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;view&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;]-&amp;gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;name&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;view_one&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;linked_page&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;/news/special_one&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;view_two&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;linked_page&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;/news/special_two&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;view_three&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;linked_page&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;/news/special_three&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;view_four&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;linked_page&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;/news/special_four&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$view&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;-&amp;gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;field &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;as &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$id &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;=&amp;gt; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$name &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;= &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field_names&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$id&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$name&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;views_theme_field&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;views_handle_field&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;queryname&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;], &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$fields&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$node&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$view&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isset(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;label&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$name &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;. &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;_label&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$field&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;label&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$items&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[] = &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;_phptemplate_callback&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;views-happy_news&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#FF9900&quot;&gt;//the key, I&#039;m adding a link to the $items[] array. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$items&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[] =&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&quot;&amp;lt;a href=\&quot;{$vars[&#039;linked_page&#039;]}\&quot; class=\&quot;more-articles\&quot;&amp;gt;See more news&amp;lt;/a&amp;gt; »&quot;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;;&lt;br /&gt;&amp;nbsp; if (&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$items&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;theme&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;item_list&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$items&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;?&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
</description>
 <comments>http://www.juliakm.com/adding-items-drupal-view#comments</comments>
 <category domain="http://www.juliakm.com/topics/drupal">Drupal</category>
 <category domain="http://www.juliakm.com/topics/programming">programming</category>
 <pubDate>Mon, 17 Mar 2008 08:57:01 -0700</pubDate>
 <dc:creator>Julia</dc:creator>
 <guid isPermaLink="false">43 at http://www.juliakm.com</guid>
</item>
<item>
 <title>Displaying Nodeprofile Fields for a User within a Node</title>
 <link>http://www.juliakm.com/displaying-nodeprofile-fields-user-within-node</link>
 <description></description>
 <comments>http://www.juliakm.com/displaying-nodeprofile-fields-user-within-node#comments</comments>
 <category domain="http://www.juliakm.com/topics/drupal">Drupal</category>
 <category domain="http://www.juliakm.com/story/nodeprofile">nodeprofile</category>
 <category domain="http://www.juliakm.com/topics/programming">programming</category>
 <pubDate>Sun, 03 Feb 2008 08:49:33 -0800</pubDate>
 <dc:creator>Julia</dc:creator>
 <guid isPermaLink="false">40 at http://www.juliakm.com</guid>
</item>
<item>
 <title>Drupal Permissions Issues: A Debugging Checklist</title>
 <link>http://www.juliakm.com/drupal-permissions-issues-debugging-checklist</link>
 <description>&lt;p&gt;Every once in awhile, when working on a Drupal site, my content either disappears or I cannot log-in. At this point, I usually get rather angry and start thinking of worse case scenarios. What if I can never log into my site again? What if anonymous users can&#039;t read articles?&lt;/p&gt;
&lt;p&gt;In a rare moment of clarity, I put together the following Drupal permissions debugging checklist. I hope that you find it as useful as I have.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Check user access control and make sure that all users can &quot;access content&quot;&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;Path:&lt;/em&gt; mysite.com/admin/user/access&lt;br /&gt;
Often, when installing a module, I accidentally change key permissions. For example, a couple of times I have allowed anonymous users to &quot;access content&quot; but not logged-in ones. Although my access control permissions are usually not the problem, its always best to check them before moving onto the next approaches. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Check input filter roles&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;Path:&lt;/em&gt; mysite.com/admin/settings/filters&lt;br /&gt;
One problem with having a lot of input filters is that you can easily mess up the permissions of a particular filter. If a user does not have permission to use an input filter, then they cannot edit content that can only be edited with that input filter. To give a real-world example, say that I set up a new input filter called &quot;tinyMCE.&quot; Next, I set up my permissions for tinyMCE so that only my webmaster role can use the tinyMCE input filter. While doing this, I also set permissions so that only the webmaster can use my &quot;Filtered HTML&quot; and &quot;Full HTML&quot; input filters. Next, I set up a new role called &quot;intern&quot; and let the intern edit content. However, my intern reports that he cannot access any of the edit pages. Why? He needs to have access to the &quot;tinyMCE&quot; input filter. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Clear site cache and views cache&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;Path for Views Cache:&lt;/em&gt; mysite.com/admin/build/views/tools&lt;br /&gt;
Sometimes site cache and views cache can result in strange permissions problem. Site cache can be reset with the Developer module &quot;Empty cache&quot; menu option. To have this appear, you need to enable the Devel block. In addition to clearing the site cache, sometimes it helps to clear the ciews cache. This is especially true if your permissions problems started after you edited a view. The option to clear views cache can be found in the Tools section of the ciews administration page.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. If all else fails, rebuild node permissions&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;Path:&lt;/em&gt; mysite.com/admin/content/node-settings/rebuild&lt;br /&gt;
Sometimes Drupal node permissions get corrupted. When this happens, rebuilding the node permissions can solve the problem. Please be advised that if you have a lot of nodes, this can take a very long time. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. The Last Step: Looking for Module-Specific Issues&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;Path for Update Script:&lt;/em&gt; mysite.com/update.php&lt;br /&gt;
If none of the previous steps work, I usually try to figure out if the problem is caused by a module that I just installed. First, if I recently installed a new version of a module, I make sure that I have run the update.php script. Next, I generally disable the module, and then repeat step three. &lt;/p&gt;
&lt;p&gt;Please let me know if there are other ways of hunting down and fixing permissions issues that you know about.&lt;/p&gt;
</description>
 <comments>http://www.juliakm.com/drupal-permissions-issues-debugging-checklist#comments</comments>
 <category domain="http://www.juliakm.com/story/debugging">debugging</category>
 <category domain="http://www.juliakm.com/topics/drupal">Drupal</category>
 <category domain="http://www.juliakm.com/story/permissions">permissions</category>
 <category domain="http://www.juliakm.com/topics/programming">programming</category>
 <pubDate>Sat, 12 Jan 2008 12:15:24 -0800</pubDate>
 <dc:creator>Julia</dc:creator>
 <guid isPermaLink="false">39 at http://www.juliakm.com</guid>
</item>
<item>
 <title>Drupal Theming: Create a Subpage Template that Applies to Multiple Pages on a Newspaper Site</title>
 <link>http://www.juliakm.com/drupal-theming-create-subpage-template-applies-multiple-pages-newspaper-site</link>
 <description>&lt;p&gt;While working on a new Drupal site, I needed to set the same &quot;subsection&quot; template for multiple pages. The site is for an online newspaper and I wanted to use a new template for each of the section homepages. A good example of a similar approach is on CNN.com, where the &lt;a href=&quot;http://www.cnn.com/US/&quot;&gt;US section page&lt;/a&gt; looks different than both the &lt;a href=&quot;http://www.cnn.com/&quot;&gt;homepage&lt;/a&gt; and the &lt;a href=&quot;http://www.cnn.com/2008/US/weather/01/06/california.storm.ap/index.html&quot;&gt;article pages&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In past projects, I&#039;ve confused myself with template names. Six months later, I have trouble remembering what page-node-1432.tpl.php actually controls. So, this time, I set out to have better named template files and to have the same template file control multiple pages. So far, this has made it easier for both the project graphic designer and I.&lt;br /&gt;
Here&#039;s the code that I put in my template.php file to make page-subsection.tpl.php the template file for node/17658, node/17638, and node/17628. &lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000CC&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;function &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;_phptemplate_variables&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$hook&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;= array()) {&lt;br /&gt; switch (&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$hook&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;page&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;arg&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;)==&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;’node’&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) &amp;amp;&amp;amp; ((&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;arg&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) == &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;‘17658’&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) || (&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;arg&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) == &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;‘17638’&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) || (&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;arg&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;) == &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;‘17628’&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;))){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars‘template_files’ &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;= &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;‘page&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;-&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;subsection’&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$vars&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;?&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This code is effectively saying, if the page you are on has the node id 17658, 17638, or 17628, use the page template page-subsection.tpl.php.&lt;/p&gt;
</description>
 <comments>http://www.juliakm.com/drupal-theming-create-subpage-template-applies-multiple-pages-newspaper-site#comments</comments>
 <category domain="http://www.juliakm.com/topics/drupal">Drupal</category>
 <category domain="http://www.juliakm.com/topics/programming">programming</category>
 <category domain="http://www.juliakm.com/story/theming">theming</category>
 <pubDate>Sun, 06 Jan 2008 09:13:31 -0800</pubDate>
 <dc:creator>Julia</dc:creator>
 <guid isPermaLink="false">38 at http://www.juliakm.com</guid>
</item>
<item>
 <title>PickyRacer.com Up and Running</title>
 <link>http://www.juliakm.com/pickyracer-com-and-running</link>
 <description>&lt;p&gt;I finally launched &lt;a href=&quot;http://www.pickyracer.com/&quot;&gt;PickyRacer.com&lt;/a&gt;. PickyRacer is designed to help connect runners with great marathons, half-marathons, and other races. It is built with Drupal 5.3. In the next few months, I hope to add runner blogs, and groups. There are a bunch of other features that I would like to add as well, but I figure I should start small. &lt;/p&gt;
&lt;p&gt;Here are some of the more useful modules I used when developing the site:&lt;br /&gt;
CCK&lt;br /&gt;
Views&lt;br /&gt;
Views Bookmarks&lt;br /&gt;
Google Analytics&lt;br /&gt;
XML Sitemap&lt;br /&gt;
Node Teaser&lt;br /&gt;
Link&lt;br /&gt;
Fivestar&lt;br /&gt;
Forward&lt;br /&gt;
Location&lt;br /&gt;
Node Comment&lt;br /&gt;
Path Auto&lt;br /&gt;
Voting API&lt;/p&gt;
&lt;p&gt;I plan to implement Organic Groups over the next couple of months after I fix all of the existing bugs.&lt;/p&gt;
</description>
 <comments>http://www.juliakm.com/pickyracer-com-and-running#comments</comments>
 <category domain="http://www.juliakm.com/topics/drupal">Drupal</category>
 <category domain="http://www.juliakm.com/story/half-marathons">half-marathons</category>
 <category domain="http://www.juliakm.com/story/marathons">marathons</category>
 <category domain="http://www.juliakm.com/story/pickyracer-com">pickyracer.com</category>
 <category domain="http://www.juliakm.com/topics/programming">programming</category>
 <category domain="http://www.juliakm.com/story/running">running</category>
 <category domain="http://www.juliakm.com/topics/running">running</category>
 <pubDate>Mon, 31 Dec 2007 15:12:11 -0800</pubDate>
 <dc:creator>Julia</dc:creator>
 <guid isPermaLink="false">37 at http://www.juliakm.com</guid>
</item>
<item>
 <title>Using Imagecache and CCK Imagefield to Add an Image in Drupal</title>
 <link>http://www.juliakm.com/using-imagecache-and-cck-imagefield-add-image-drupal</link>
 <description>&lt;p&gt;Figuring out how to get Drupal&#039;s &lt;a href=&quot;http://drupal.org/project/imagecache&quot;&gt;imagecache module&lt;/a&gt; to work with &lt;a href=&quot;http://drupal.org/project/imagefield&quot;&gt;CCK&#039;s imagefield&lt;/a&gt; can about as fun as a trip to the dentist. Although I found a lot of articles analyzing the benefits of using Image vs. CCK imagefield, I could not find one source with clear instructions on how to implement imagefield with imagecache. So, here&#039;s my stab at an explanation of how to get imagecache to work with imagefield.&lt;/p&gt;
&lt;p&gt;1. Install and activate CCK, imagefield, and imagecache. Go to Admin &gt; Content types and select the content type that you want to add an image field to. Click on &quot;Add field&quot; to add an image field. Then, give your field a title, select Image and create your field. The name of my field is &quot;related_images.&quot;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/resources/u1/createfield.png&quot; alt=&quot;create cck image field&quot; height=&quot;205&quot; width=&quot;278&quot; /&gt;&lt;/p&gt;
&lt;p&gt;2. Set your imagecache presets at Site Building &gt; Image cache. My preset is has the namespace &quot;homepage&quot; and is set to resize with a width and height of 100. &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/resources/u1/namespace.png&quot; alt=&quot;drupal preset namespace&quot; height=&quot;321&quot; width=&quot;500&quot; /&gt;&lt;/p&gt;
&lt;p&gt;3. Go back to the content type that you added a CCK image to by selecting Content Management &gt; Content types. Click on the name of the content type you previously added an image to. In the content type&#039;s menu, select &quot;Display fields.&quot;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/resources/u1/displayfields.png&quot; alt=&quot;display cck image fields&quot; height=&quot;94&quot; width=&quot;415&quot; /&gt;&lt;/p&gt;
&lt;p&gt;4. Look to the right of the listing for the image field you created. Set the teaser and body to the namespace you set in step 2. My namespace is &quot;homepage.&quot; &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/resources/u1/chooselook.png&quot; alt=&quot;set display of cck image&quot; height=&quot;66&quot; width=&quot;500&quot; /&gt;&lt;/p&gt;
&lt;p&gt;5. Add a new article of content using the content type that has your new image field. Upload an image as part of the post and make sure that your image displays at the width and height you set in &quot;Display fields.&quot;&lt;/p&gt;
&lt;p&gt;
6. If you want to have your image display in a template such as node.tpl.php, the following code will print the image and image title for a CCK image field called field_related_images:
&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000CC&quot;&gt;&amp;lt;?php &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;print &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$node&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;-&amp;gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;field_related_images&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;][&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;view&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;]; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;?&amp;gt;&lt;/font&gt;&lt;/font&gt; &lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000CC&quot;&gt;&amp;lt;?php &lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;print &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;$node&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;-&amp;gt;&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;field_related_images&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;][&lt;/font&gt;&lt;font color=&quot;#CC0000&quot;&gt;&#039;title&#039;&lt;/font&gt;&lt;font color=&quot;#006600&quot;&gt;];&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#0000CC&quot;&gt;?&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
</description>
 <comments>http://www.juliakm.com/using-imagecache-and-cck-imagefield-add-image-drupal#comments</comments>
 <category domain="http://www.juliakm.com/topics/drupal">Drupal</category>
 <category domain="http://www.juliakm.com/topics/programming">programming</category>
 <pubDate>Mon, 20 Aug 2007 17:11:17 -0700</pubDate>
 <dc:creator>Julia</dc:creator>
 <guid isPermaLink="false">31 at http://www.juliakm.com</guid>
</item>
<item>
 <title>Javascript Blogroll Randomizer</title>
 <link>http://www.juliakm.com/javascript-blogroll-randomizer</link>
 <description>&lt;p&gt;&lt;a href=&quot;http://chessconfessions.blogspot.com/&quot;&gt;Eric&lt;/a&gt; uses Blogger and wanted to have a random list of 10 blogs from his blogroll display each time someone visited his blog. Since Blogger doesn&#039;t let its members upload PHP files, I used the following Javascript to create a random blog listing for him. The code is a slightly modified version of what I found &lt;a href=&quot;http://www.wdil.org/reuseables/randomizer-javascript-menu&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;8/28/2007 Update:&lt;/strong&gt; Be sure to include the backslashes before single quotes and apostrophes. &lt;a href=&quot;http://www.chickengirl.net/&quot;&gt;Chicken Girl&lt;/a&gt; wrote a great explanation of why this is important at &lt;a href=&quot;https://www.blogger.com/comment.g?blogID=1704170106558126102&amp;amp;postID=2163460307242887737&quot;&gt;Cranky Fitness&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;	&lt;br /&gt;	/* list all blogs, put a \ before single quotes */&lt;br /&gt;	var chess_blogs = [&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://www.beginchess.com/&amp;quot;&amp;gt;Begin Chess&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://caughtinthefire.blogspot.com/&amp;quot;&amp;gt;Caught in the fire&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://chessloser.wordpress.com/&amp;quot;&amp;gt;Chessloser&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://chess-training.blogspot.com/&amp;quot;&amp;gt;Chess Training&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://dk-transformation.blogspot.com/&amp;quot;&amp;gt;DK Transformation&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://dutchdefence.wordpress.com/&amp;quot;&amp;gt;Edwin \&amp;#039;dutchdefense\&amp;#039; Meyer&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://grandpatzerchess.blogspot.com/&amp;quot;&amp;gt;Grandpatzer Chess&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://www.kenilworthchessclub.org/kenilworthian/&amp;quot;&amp;gt;Kenilworthian&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://likesforests.blogspot.com/&amp;quot;&amp;gt;Likeforests&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://thebackrank.blogspot.com/&amp;quot;&amp;gt;Loomis&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://wangschesshouse.wordpress.com/&amp;quot;&amp;gt;Patzer\&amp;#039;s Corner&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://knightskewer.blogspot.com/&amp;quot;&amp;gt;Pawn Shaman&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://phorku.blogspot.com/&amp;quot;&amp;gt;Phorku&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://qxh7.blogspot.com/&amp;quot;&amp;gt;Qxh7#&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://rlpchessblog.blogspot.com/&amp;quot;&amp;gt;Robert Pearson\&amp;#039;s Chess Blog&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://sonofpearl.blogspot.com/&amp;quot;&amp;gt;Son of Pearl&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://squirrelchess.com/&amp;quot;&amp;gt;Squirrelchess&amp;lt;/a&amp;gt;&amp;#039;,&lt;br /&gt;	&amp;#039;&amp;lt;a href=&amp;quot;http://www.eddins.net/steve/chess/&amp;quot;&amp;gt;Steve Learns Chess&amp;lt;/a&amp;gt;&amp;#039;&lt;br /&gt;	];&lt;br /&gt;&lt;br /&gt;		function randomize (a_items, n_count) {&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp; var n_index, s_html = &amp;#039;&amp;lt;ul&amp;gt;&amp;#039;;&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp; while (a_items.length &amp;amp;&amp;amp; n_count) {&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n_index = Math.ceil(Math.random() * a_items.length) - 1;&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_html += &amp;#039;&amp;lt;li&amp;gt;&amp;#039; + a_items[n_index] + &amp;#039;&amp;lt;/li&amp;gt;&amp;#039;;&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a_items[n_index] = a_items[a_items.length - 1];&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a_items.length = a_items.length - 1;&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n_count--;&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp; return s_html + &amp;#039;&amp;lt;/ul&amp;gt;&amp;#039;;&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;		// call randomizer&lt;br /&gt;		// param 1 - list of items in the form of a variable&lt;br /&gt;		// param 2 - number of items to display&lt;br /&gt;		document.write(randomize (chess_blogs, 10));&lt;br /&gt;	&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
</description>
 <comments>http://www.juliakm.com/javascript-blogroll-randomizer#comments</comments>
 <category domain="http://www.juliakm.com/topics/programming">programming</category>
 <pubDate>Wed, 15 Aug 2007 16:50:32 -0700</pubDate>
 <dc:creator>Julia</dc:creator>
 <guid isPermaLink="false">30 at http://www.juliakm.com</guid>
</item>
</channel>
</rss>
