<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: drupal code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 22:40:02 GMT</pubDate>
    <description>DZone Snippets: drupal code</description>
    <item>
      <title>Getting Results for Paged Display</title>
      <link>http://snippets.dzone.com/posts/show/4807</link>
      <description>We can present these blog entries a better way: as a page of formatted results with links to more&lt;br /&gt;results. We can do that using Drupal&#8217;s pager. Let&#8217;s grab all of the blog entries again, only this&lt;br /&gt;time we&#8217;ll display them as a paged result, with links to additional pages of results and &#8220;first and&lt;br /&gt;last&#8221; links at the bottom of the page.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$sql = "SELECT * FROM {node} n WHERE type = 'blog' AND status = 1 ORDER BY&lt;br /&gt;n.created DESC"&lt;br /&gt;$result = pager_query(db_rewrite_sql($sql), 0, 10);&lt;br /&gt;while ($data = db_fetch_object($result)) {&lt;br /&gt;$node = node_load($data-&gt;nid);&lt;br /&gt;print node_view($node, TRUE);&lt;br /&gt;}&lt;br /&gt;// Add links to remaining pages of results.&lt;br /&gt;print theme('pager', NULL, 10);&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 21 Nov 2007 12:57:46 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4807</guid>
      <author>bifurcafe (Alex)</author>
    </item>
    <item>
      <title>[drupal] Show all nodes of current type</title>
      <link>http://snippets.dzone.com/posts/show/4796</link>
      <description>&lt;code&gt;&lt;br /&gt;$result = db_query('SELECT n.nid FROM {node} n WHERE n.type = '."'node_type'".' and n.status = 1');&lt;br /&gt;    $output = '';&lt;br /&gt;    while ($node = db_fetch_object($result))&lt;br /&gt;    {&lt;br /&gt;        $output .= node_view(node_load($node-&gt;nid), true);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    print $output;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 19 Nov 2007 10:15:57 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4796</guid>
      <author>bifurcafe (Alex)</author>
    </item>
    <item>
      <title>Drupal: edit Content inside Backend-Theme</title>
      <link>http://snippets.dzone.com/posts/show/4105</link>
      <description>/* If you've configured Drupal (www.drupal.org) the way that it &lt;br /&gt;   uses different themes for the frontend and the backend, it still kicks&lt;br /&gt;   you into the frontend when you edit content. &lt;br /&gt;   To change this you have to edit this file:&lt;br /&gt;   modules/system/system.module&lt;br /&gt;   &lt;br /&gt;   at the end of the function "function system_menu($may_cache)" look &lt;br /&gt;   for the "else" part   &lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;// in line ~308&lt;br /&gt;// find:&lt;br /&gt;    if (arg(0) == 'admin')&lt;br /&gt;&lt;br /&gt;// repalce with:&lt;br /&gt;    if (arg(0) == 'admin'|| &lt;br /&gt;    	(arg(0)=='node' &amp;&amp; arg(1)=='add') || &lt;br /&gt;    	(arg(0)=='user' &amp;&amp; arg(1)!='') || &lt;br /&gt;    	(arg(0)=='node' &amp;&amp; (arg(2)=='edit' || arg(2)=='localizernode'))&lt;br /&gt;    	)  </description>
      <pubDate>Tue, 05 Jun 2007 09:03:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4105</guid>
      <author>dvsg (XXX)</author>
    </item>
    <item>
      <title>Remove primary links</title>
      <link>http://snippets.dzone.com/posts/show/3684</link>
      <description>// remove primary links&lt;br /&gt;&lt;code&gt;&lt;br /&gt;// in the module - page.tpl.php &lt;br /&gt;// comment the three lines as shown...&lt;br /&gt;&lt;!-- Navigation Level 1 --&gt;&lt;br /&gt;&lt;?php #if (isset($primary_links)) : ?&gt;&lt;br /&gt;&lt;?php #print theme('links', $primary_links, array('class' =&gt; 'nav1')) ?&gt;&lt;br /&gt;&lt;?php #endif; ?&gt; 1&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 17 Mar 2007 14:47:37 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3684</guid>
      <author>shantanuo (shantanu oak)</author>
    </item>
    <item>
      <title>Change the word username in the form</title>
      <link>http://snippets.dzone.com/posts/show/3679</link>
      <description>&lt;code&gt;&lt;br /&gt;&lt;br /&gt;// user.module -  function user_login_block() change username and password words&lt;br /&gt;&lt;br /&gt;// form.inc - function theme_form_element($element, $value)  t('!title:132&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 16 Mar 2007 11:21:32 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3679</guid>
      <author>shantanuo (shantanu oak)</author>
    </item>
    <item>
      <title>login destination</title>
      <link>http://snippets.dzone.com/posts/show/3678</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;// login destination module enabled&lt;br /&gt;  global $user; $myid = $user-&gt;uid;&lt;br /&gt;return ($user-&gt;uid == 1) ? 'admin/'.$myid : 'user/'.$myid.'/edit/Address' ;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 16 Mar 2007 09:20:57 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3678</guid>
      <author>shantanuo (shantanu oak)</author>
    </item>
    <item>
      <title>Remove the | sign in the title</title>
      <link>http://snippets.dzone.com/posts/show/3676</link>
      <description>// Remove the | sign in the title&lt;br /&gt;&lt;code&gt;&lt;br /&gt;// phptemplate.engine line 189 change it to :&lt;br /&gt;&lt;br /&gt;$head_title = array(strip_tags(drupal_get_title())); &lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 15 Mar 2007 12:48:47 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3676</guid>
      <author>shantanuo (shantanu oak)</author>
    </item>
    <item>
      <title>Remove the "request new password" link</title>
      <link>http://snippets.dzone.com/posts/show/3675</link>
      <description>// Remove the "request new password" link&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;// user.module &lt;br /&gt;// Just comment (or remove) the following line in user_login_block function:&lt;br /&gt;// $items[] = l(t('Request new password'), 'user/password', array('title' =&gt; t('Request new password via e-mail.')));&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 15 Mar 2007 12:42:40 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3675</guid>
      <author>shantanuo (shantanu oak)</author>
    </item>
    <item>
      <title>Disable RSS logo in Drupal</title>
      <link>http://snippets.dzone.com/posts/show/3674</link>
      <description>// To disable RSS logos both in the address bar and on pages in Drupal 5.1 :&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;// Edit theme.inc to disable feed icons&lt;br /&gt;&lt;br /&gt;function theme_feed_icon($url) {&lt;br /&gt;//  if ($image = theme('image', 'misc/feed.png', t('Syndicate content'), t('Syndicate content'))) {&lt;br /&gt;//    return '&lt;a href="'. check_url($url) .'" class="feed-icon"&gt;'. $image. '&lt;/a&gt;';&lt;br /&gt;//  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// AND also edit common.inc&lt;br /&gt;&lt;br /&gt;function drupal_add_feed($url = NULL, $title = '') {&lt;br /&gt;  static $stored_feed_links = array();&lt;br /&gt;&lt;br /&gt;/*  if (!is_null($url)) {&lt;br /&gt;    $stored_feed_links[$url] = theme('feed_icon', $url);&lt;br /&gt;&lt;br /&gt;    drupal_add_link(array('rel' =&gt; 'alternate',&lt;br /&gt;                          'type' =&gt; 'application/rss+xml',&lt;br /&gt;                          'title' =&gt; $title,&lt;br /&gt;                          'href' =&gt; $url));&lt;br /&gt;  }*/&lt;br /&gt;  return $stored_feed_links;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 15 Mar 2007 12:39:31 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3674</guid>
      <author>shantanuo (shantanu oak)</author>
    </item>
    <item>
      <title>sql drupal count login</title>
      <link>http://snippets.dzone.com/posts/show/3602</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;SELECT u.name name, count(name) anzahl         &lt;br /&gt;    FROM accesslog al, users u&lt;br /&gt;    where al.uid = u.uid group by name order by anzahl &lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 28 Feb 2007 15:24:45 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3602</guid>
      <author>stereosonic ()</author>
    </item>
  </channel>
</rss>
