<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 17:59:24 +0000</lastBuildDate>
    <item>
      <title>(PHP) Drupal Format time ago - jonathanpglick</title>
      <link>https://snipplr.com/view/63570/drupal-format-time-ago</link>
      <description>&lt;p&gt;Foromat {timestamp} as a "x x ago" date/time.&lt;/p&gt;</description>
      <pubDate>Sat, 25 Feb 2012 05:18:52 UTC</pubDate>
      <guid>https://snipplr.com/view/63570/drupal-format-time-ago</guid>
    </item>
    <item>
      <title>(PHP) Trigger a Drupal Context programatically - jonathanpglick</title>
      <link>https://snipplr.com/view/58723/trigger-a-drupal-context-programatically</link>
      <description>&lt;p&gt;It's not immediately clear from the `context_set()` function how to trigger a context to be "active" using code.  Do it like this:&lt;/p&gt;</description>
      <pubDate>Fri, 16 Sep 2011 02:41:00 UTC</pubDate>
      <guid>https://snipplr.com/view/58723/trigger-a-drupal-context-programatically</guid>
    </item>
    <item>
      <title>(PHP) Render single node field - jonathanpglick</title>
      <link>https://snipplr.com/view/47887/render-single-node-field</link>
      <description>&lt;p&gt;Render the contents for a single node field.&lt;/p&gt;</description>
      <pubDate>Wed, 26 Jan 2011 10:51:22 UTC</pubDate>
      <guid>https://snipplr.com/view/47887/render-single-node-field</guid>
    </item>
    <item>
      <title>(PHP) OMBU Drupal string overrides - jonathanpglick</title>
      <link>https://snipplr.com/view/45206/ombu-drupal-string-overrides</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 03 Dec 2010 05:44:56 UTC</pubDate>
      <guid>https://snipplr.com/view/45206/ombu-drupal-string-overrides</guid>
    </item>
    <item>
      <title>(PHP) Split array into n arrays (columns) - jonathanpglick</title>
      <link>https://snipplr.com/view/44841/split-array-into-n-arrays-columns</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 25 Nov 2010 10:57:14 UTC</pubDate>
      <guid>https://snipplr.com/view/44841/split-array-into-n-arrays-columns</guid>
    </item>
    <item>
      <title>(PHP) Drupal 6 node_export inport don't make pathauto alias - jonathanpglick</title>
      <link>https://snipplr.com/view/43529/drupal-6-nodeexport-inport-dont-make-pathauto-alias</link>
      <description>&lt;p&gt;If you're importing nodes from a file and have pathauto setup, the existing paths for the nodes will be rewritten with pathauto.  To avoid this, simply add the following to the node export array for each node:&lt;/p&gt;</description>
      <pubDate>Thu, 04 Nov 2010 07:23:59 UTC</pubDate>
      <guid>https://snipplr.com/view/43529/drupal-6-nodeexport-inport-dont-make-pathauto-alias</guid>
    </item>
    <item>
      <title>(PHP) Drupal get total number of search results from pager - jonathanpglick</title>
      <link>https://snipplr.com/view/43453/drupal-get-total-number-of-search-results-from-pager</link>
      <description>&lt;p&gt;The total number of search results can be added in a hook_preprocess_search_results() function from the following variable:&lt;/p&gt;</description>
      <pubDate>Wed, 03 Nov 2010 04:52:52 UTC</pubDate>
      <guid>https://snipplr.com/view/43453/drupal-get-total-number-of-search-results-from-pager</guid>
    </item>
    <item>
      <title>(PHP) Drupal render Views pager from $view object - jonathanpglick</title>
      <link>https://snipplr.com/view/43273/drupal-render-views-pager-from-view-object</link>
      <description>&lt;p&gt;Drupal 6&#13;
&#13;
Do this after $view-&gt;execute() has already been called&lt;/p&gt;</description>
      <pubDate>Sat, 30 Oct 2010 06:07:46 UTC</pubDate>
      <guid>https://snipplr.com/view/43273/drupal-render-views-pager-from-view-object</guid>
    </item>
    <item>
      <title>(PHP) Drupal - Programatically trigger another theme - jonathanpglick</title>
      <link>https://snipplr.com/view/37256/drupal--programatically-trigger-another-theme</link>
      <description>&lt;p&gt;This example triggers the admin theme when on any of the user/* pages (login, edit, etc.).  Put the name of your admin theme in {admin-theme-name} so there's a safe fallback in case variable_get doesn't find the admin_theme.&lt;/p&gt;</description>
      <pubDate>Wed, 14 Jul 2010 06:46:44 UTC</pubDate>
      <guid>https://snipplr.com/view/37256/drupal--programatically-trigger-another-theme</guid>
    </item>
    <item>
      <title>(PHP) Drupal Date Popup from Form API - jonathanpglick</title>
      <link>https://snipplr.com/view/36038/drupal-date-popup-from-form-api</link>
      <description>&lt;p&gt;I can never remember how to trigger the Date Popup widget when writing a $form in Drupal so I've pulled out the instructions below.&#13;
&#13;
This requires that the date_api, date_timezone and date_popup modules are all enabled.&lt;/p&gt;</description>
      <pubDate>Wed, 23 Jun 2010 09:59:25 UTC</pubDate>
      <guid>https://snipplr.com/view/36038/drupal-date-popup-from-form-api</guid>
    </item>
    <item>
      <title>(PHP) Trigger WYSIWYG editor in Drupal Form API - jonathanpglick</title>
      <link>https://snipplr.com/view/35992/trigger-wysiwyg-editor-in-drupal-form-api</link>
      <description>&lt;p&gt;The trick is having a "format" key for the textarea and using filter_form().&#13;
&#13;
Use two elements with the same parent; the textarea element and an element with the "format" key. (important!).&#13;
&#13;
Example below.&lt;/p&gt;</description>
      <pubDate>Tue, 22 Jun 2010 07:08:20 UTC</pubDate>
      <guid>https://snipplr.com/view/35992/trigger-wysiwyg-editor-in-drupal-form-api</guid>
    </item>
    <item>
      <title>(PHP) Trigger Drupal Admin Theme - jonathanpglick</title>
      <link>https://snipplr.com/view/30708/trigger-drupal-admin-theme</link>
      <description>&lt;p&gt;Needs to execute before theme is initialized -- Ideally in hook_init() -- but also works in hook_nodeapi $op == 'view'&lt;/p&gt;</description>
      <pubDate>Thu, 01 Apr 2010 12:52:52 UTC</pubDate>
      <guid>https://snipplr.com/view/30708/trigger-drupal-admin-theme</guid>
    </item>
    <item>
      <title>(PHP) Drupal - get email addresses by role - jonathanpglick</title>
      <link>https://snipplr.com/view/29899/drupal--get-email-addresses-by-role</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 17 Mar 2010 12:54:43 UTC</pubDate>
      <guid>https://snipplr.com/view/29899/drupal--get-email-addresses-by-role</guid>
    </item>
    <item>
      <title>(PHP) Manually execute a view, the right way - jonathanpglick</title>
      <link>https://snipplr.com/view/19397/manually-execute-a-view-the-right-way</link>
      <description>&lt;p&gt;If `views_embed_view()` or just `$view-&gt;execute()` are called, the default view settings are used (only shows 10 entries, etc.) so we have to call `$view-&gt;set_display()` &amp; `$view-&gt;pre_execute()`.&lt;/p&gt;</description>
      <pubDate>Tue, 08 Sep 2009 12:37:42 UTC</pubDate>
      <guid>https://snipplr.com/view/19397/manually-execute-a-view-the-right-way</guid>
    </item>
    <item>
      <title>(PHP) Drupal Setup to use another database - jonathanpglick</title>
      <link>https://snipplr.com/view/18465/drupal-setup-to-use-another-database</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 18 Aug 2009 15:09:22 UTC</pubDate>
      <guid>https://snipplr.com/view/18465/drupal-setup-to-use-another-database</guid>
    </item>
    <item>
      <title>(PHP) Views default function - jonathanpglick</title>
      <link>https://snipplr.com/view/17520/views-default-function</link>
      <description>&lt;p&gt;This function goes in the {module\_name}.views\_default.inc file&lt;/p&gt;</description>
      <pubDate>Mon, 27 Jul 2009 14:30:18 UTC</pubDate>
      <guid>https://snipplr.com/view/17520/views-default-function</guid>
    </item>
    <item>
      <title>(PHP) Views API module declaration - jonathanpglick</title>
      <link>https://snipplr.com/view/17518/views-api-module-declaration</link>
      <description>&lt;p&gt;This will trigger views to load the views in the file {module\_name}.views\_default.inc&lt;/p&gt;</description>
      <pubDate>Mon, 27 Jul 2009 14:26:45 UTC</pubDate>
      <guid>https://snipplr.com/view/17518/views-api-module-declaration</guid>
    </item>
    <item>
      <title>(PHP) Form validate email address - jonathanpglick</title>
      <link>https://snipplr.com/view/14125/form-validate-email-address</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 17 Apr 2009 13:29:49 UTC</pubDate>
      <guid>https://snipplr.com/view/14125/form-validate-email-address</guid>
    </item>
    <item>
      <title>(PHP) Load node form from menu callback - jonathanpglick</title>
      <link>https://snipplr.com/view/14124/load-node-form-from-menu-callback</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 17 Apr 2009 13:17:20 UTC</pubDate>
      <guid>https://snipplr.com/view/14124/load-node-form-from-menu-callback</guid>
    </item>
  </channel>
</rss>
