<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Breathing Spring &#187; Drupal</title>
	<atom:link href="http://breathing-spring.com/category/drupal/feed/" rel="self" type="application/rss+xml" />
	<link>http://breathing-spring.com</link>
	<description></description>
	<lastBuildDate>Wed, 04 Aug 2010 11:22:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>load user object in drupal</title>
		<link>http://breathing-spring.com/load-user-object-in-drupal/</link>
		<comments>http://breathing-spring.com/load-user-object-in-drupal/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 11:22:30 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=165</guid>
		<description><![CDATA[/*
Load user by  username and password or id
*/
function login_module_user_load($array = array())
{
// Dynamically compose a SQL query:
$query = array();
$params = array();
if (is_numeric($array)) {
$array = array(&#8216;uid&#8217; =&#62; $array);
} elseif (!is_array($array)) {
return false;
}
foreach ($array as $key =&#62; $value) {
if ($key == &#8216;uid&#8217; &#124;&#124; $key == &#8217;status&#8217;) {
$query[] = &#8220;$key = %d&#8221;;
$params[] = $value;
} else
if ($key == &#8216;pass&#8217;) {
$query[] ]]></description>
			<content:encoded><![CDATA[<blockquote><p>/*<br />
Load user by  username and password or id<br />
*/<br />
function login_module_user_load($array = array())<br />
{<br />
// Dynamically compose a SQL query:<br />
$query = array();<br />
$params = array();<br />
if (is_numeric($array)) {<br />
$array = array(&#8216;uid&#8217; =&gt; $array);<br />
} elseif (!is_array($array)) {<br />
return false;<br />
}</p>
<p>foreach ($array as $key =&gt; $value) {<br />
if ($key == &#8216;uid&#8217; || $key == &#8217;status&#8217;) {<br />
$query[] = &#8220;$key = %d&#8221;;<br />
$params[] = $value;<br />
} else<br />
if ($key == &#8216;pass&#8217;) {<br />
$query[] = &#8220;pass = &#8216;%s&#8217;&#8221;;<br />
$params[] = md5($value);<br />
} else {<br />
$query[] = &#8220;LOWER($key) = LOWER(&#8216;%s&#8217;)&#8221;;<br />
$params[] = $value;<br />
}<br />
}<br />
$result = db_query(&#8216;SELECT * FROM {users} u WHERE &#8216; . implode(&#8216; AND &#8216;, $query),<br />
$params);</p>
<p>if ($user = db_fetch_object($result)) {<br />
$user = drupal_unpack($user);<br />
$user-&gt;roles = array();<br />
if ($user-&gt;uid) {<br />
$user-&gt;roles[DRUPAL_AUTHENTICATED_RID] = &#8216;authenticated user&#8217;;<br />
} else {<br />
$user-&gt;roles[DRUPAL_ANONYMOUS_RID] = &#8216;anonymous user&#8217;;<br />
}<br />
$result = db_query(&#8216;SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid<br />
WHERE ur.uid = %d&#8217;, $user-&gt;uid);<br />
while ($role = db_fetch_object($result)) {<br />
$user-&gt;roles[$role-&gt;rid] = $role-&gt;name;<br />
}<br />
user_module_invoke(&#8216;load&#8217;, $array, $user);<br />
} else {<br />
$user = false;<br />
}</p>
<p>return $user;<br />
}</p></blockquote>
<p>and to call the function we eiter call it by id or username that way</p>
<p>$usert =modulename_user_load(array(&#8216;name&#8217; =&gt; $username));</p>
<p>$user = login_module_user_load(array(&#8216;uid&#8217; =&gt; $array['uid']));</p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/load-user-object-in-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal Menu Hook to call page</title>
		<link>http://breathing-spring.com/drupal-menu-hook-to-call-page/</link>
		<comments>http://breathing-spring.com/drupal-menu-hook-to-call-page/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 10:01:15 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=163</guid>
		<description><![CDATA[ok here make it short to use menu hook in module to here how to write it down
function module_name_menu()
{
items['mypagename']=&#62;array(
&#8216;title&#8217;=&#62;&#8217;my page title&#8217;,
&#8216;page_callback&#8217;=&#62;&#8217;the_function_name&#8217;,
&#8216;access arguments&#8217;=&#62;array(&#8216;access content&#8217;),
&#8216;type&#8217;=&#62;MENU_CALLBACK,
);
return $items;
}
Then we can call the form that way
function the_name_given_above_better_to_end_with_form_word()
{
$form['form_start'] = array(&#8216;#type&#8217; =&#62; &#8216;markup&#8217;, &#8216;#value&#8217; =&#62;
&#8216;&#60;div style=&#8221;position:relative&#8221;&#62;&#8217;, );
$form['username'] = array(&#8216;#type&#8217; =&#62; &#8216;textfield&#8217;, &#8216;#title&#8217; =&#62; t(&#8216;User name&#8217;),
&#8216;#size&#8217; =&#62; &#8216;25&#8242;, &#8220;#attributes&#8221; =&#62; array(&#8220;onkeypress&#8221; =&#62;
&#8216;return checkEnglish(event)&#8217;), ]]></description>
			<content:encoded><![CDATA[<p>ok here make it short to use menu hook in module to here how to write it down</p>
<blockquote><p>function module_name_menu()</p>
<p>{</p>
<p>items['mypagename']=&gt;array(</p>
<p>&#8216;title&#8217;=&gt;&#8217;my page title&#8217;,</p>
<p>&#8216;page_callback&#8217;=&gt;&#8217;the_function_name&#8217;,</p>
<p>&#8216;access arguments&#8217;=&gt;array(&#8216;access content&#8217;),</p>
<p>&#8216;type&#8217;=&gt;MENU_CALLBACK,</p>
<p>);</p>
<p>return $items;</p>
<p>}</p></blockquote>
<p>Then we can call the form that way</p>
<blockquote><p>function the_name_given_above_better_to_end_with_form_word()<br />
{<br />
$form['form_start'] = array(&#8216;#type&#8217; =&gt; &#8216;markup&#8217;, &#8216;#value&#8217; =&gt;<br />
&#8216;&lt;div style=&#8221;position:relative&#8221;&gt;&#8217;, );<br />
$form['username'] = array(&#8216;#type&#8217; =&gt; &#8216;textfield&#8217;, &#8216;#title&#8217; =&gt; t(&#8216;User name&#8217;),<br />
&#8216;#size&#8217; =&gt; &#8216;25&#8242;, &#8220;#attributes&#8221; =&gt; array(&#8220;onkeypress&#8221; =&gt;<br />
&#8216;return checkEnglish(event)&#8217;), );<br />
$form['email'] = array(&#8216;#type&#8217; =&gt; &#8216;textfield&#8217;, &#8216;#title&#8217; =&gt; t(&#8216;User email&#8217;),<br />
&#8216;#size&#8217; =&gt; &#8216;25&#8242;, &#8220;#attributes&#8221; =&gt; array(&#8220;onkeypress&#8221; =&gt;<br />
&#8216;return checkEnglish(event)&#8217;), );<br />
$form['password'] = array(&#8216;#type&#8217; =&gt; &#8216;password&#8217;, &#8216;#title&#8217; =&gt; t(&#8216;password&#8217;),<br />
&#8216;#size&#8217; =&gt; &#8216;25&#8242;, &#8220;#attributes&#8221; =&gt; array(&#8220;onkeypress&#8221; =&gt;<br />
&#8216;return checkEnglish(event)&#8217;), );<br />
$form['confirmpass'] = array(&#8216;#type&#8217; =&gt; &#8216;password&#8217;, &#8216;#title&#8217; =&gt; t(&#8216;Confirm password&#8217;),<br />
&#8216;#size&#8217; =&gt; &#8216;25&#8242;, &#8220;#attributes&#8221; =&gt; array(&#8220;onkeypress&#8221; =&gt;<br />
&#8216;return checkEnglish(event)&#8217;), );<br />
$form['submit'] = array(&#8216;#type&#8217; =&gt; &#8216;image_button&#8217;, &#8216;#value&#8217; =&gt; t(&#8216;Register&#8217;),<br />
&#8216;#src&#8217; =&gt; drupal_get_path(&#8216;module&#8217;, &#8216;login_module&#8217;) . &#8216;/css/images/reg_btn.png&#8217;,<br />
&#8216;#attributes&#8217; =&gt; array(&#8216;class&#8217; =&gt; &#8216;form-submit ajax-trigger&#8217;));<br />
$form['form_end'] = array(&#8216;#type&#8217; =&gt; &#8216;markup&#8217;, &#8216;#value&#8217; =&gt; &#8216;&lt;/div&gt;&#8217;, );<br />
$form['#validate'][] = &#8216;login_module_register_form_validate&#8217;;<br />
return $form;<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/drupal-menu-hook-to-call-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Alias Path In Drupal</title>
		<link>http://breathing-spring.com/get-alias-path-in-drupal/</link>
		<comments>http://breathing-spring.com/get-alias-path-in-drupal/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 11:35:17 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=139</guid>
		<description><![CDATA[I&#8217;ve added this to the module (also to template.php)  and its working well

function get_url_alias( $src ){
if ( $query = db_query( "SELECT * FROM {url_alias}
WHERE src='%s'", $src ) ){
if ( $rs = db_fetch_object( $query ) ){
return $rs-&#62;dst;
}
else {
return $src;
}
}
else {
return $src;
}
}

]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added this to the module (also to template.php)  and its working well<br />
<code><br />
function get_url_alias( $src ){<br />
if ( $query = db_query( "SELECT * FROM {url_alias}<br />
WHERE src='%s'", $src ) ){<br />
if ( $rs = db_fetch_object( $query ) ){<br />
return $rs-&gt;dst;<br />
}<br />
else {<br />
return $src;<br />
}<br />
}<br />
else {<br />
return $src;<br />
}<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/get-alias-path-in-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>important variables to be added to page.tpl.php</title>
		<link>http://breathing-spring.com/important-variables-to-be-added-to-page-tpl-php/</link>
		<comments>http://breathing-spring.com/important-variables-to-be-added-to-page-tpl-php/#comments</comments>
		<pubDate>Sun, 30 May 2010 07:30:35 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=129</guid>
		<description><![CDATA[importent variables to be added to page.tpl.php
$base_path: The base path of the Drupal installation. At the very least, this will always
default to / if Drupal is installed in a root directory.
$breadcrumb: Returns the HTML for displaying the navigational breadcrumbs on the
page.
$closure: Returns the output of hook_footer() and thus is usually displayed at the bottom
of the ]]></description>
			<content:encoded><![CDATA[<p>importent variables to be added to page.tpl.php</p>
<p><strong>$base_path:</strong> The base path of the Drupal installation. At the very least, this will always<br />
default to / if Drupal is installed in a root directory.</p>
<p><strong>$breadcrumb</strong>: Returns the HTML for displaying the navigational breadcrumbs on the<br />
page.</p>
<p><strong>$closure:</strong> Returns the output of hook_footer() and thus is usually displayed at the bottom<br />
of the page, just before the close of the body tag. hook_footer() is used to allow<br />
modules to insert HTML or JavaScript at the end of a page. Note that drupal_add_js()<br />
will not work in hook_footer().</p>
<p><strong>$content:</strong> Returns the HTML content to be displayed. Examples include a node, an<br />
aggregation of nodes, the content of the administrative interface, and so on.</p>
<p><strong>$css:</strong> Returns an array structure of all the CSS files to be added to the page. Use $styles<br />
if you are looking for the HTML version of the $css array.</p>
<p><strong>$directory: </strong>The relative path to the directory the theme is located in; for example,<br />
themes/bluemarine or sites/all/themes/custom/greyscale. You’ll commonly use this<br />
variable in conjunction with the $base_path variable to build the absolute path to your<br />
site’s theme:<br />
&lt;?php print $base_path . $directory ?&gt;<br />
will resolve to<br />
&lt;?php print &#8216;/&#8217; . &#8217;sites/all/themes/custom/greyscale&#8217; ?&gt;</p>
<p><strong>$feed_icons: </strong>Returns RSS feed links for the page. RSS feed links are added via<br />
drupal_add_feed().</p>
<p><strong>$footer:</strong> Returns the HTML for the footer region, including the HTML for blocks<br />
belonging to this region. Do not confuse this with hook_footer(), which is a Drupal<br />
hook that lets modules add HTML or JavaScript that will appear in the $closure variable<br />
just before the closing body tag</p>
<p><strong>$footer_message:</strong> Returns the text of the footer message that was entered at Administer<br />
ä Site configuration ä Site information.</p>
<p><strong>$front_page:</strong> The output of url() with no parameters; for example, /drupal/.<br />
Use $front_page instead of $base_path when linking to the front page of a site, because<br />
$front_page will include the language domain and prefix when applicable</p>
<p><strong>$head:</strong> Returns the HTML to be placed within the &lt;head&gt;&lt;/head&gt; section. Modules<br />
append to $head by calling drupal_set_html_head() to add additional markup.</p>
<p><strong>$head_title:</strong> The text to be displayed in the page title, between the HTML<br />
&lt;title&gt;&lt;/title&gt; tags. It is retrieved using drupal_get_title().</p>
<p><strong>$header:</strong> Returns the HTML for the header region, including the HTML for blocks<br />
belonging to this region.</p>
<p><strong>$is_front: </strong>TRUE if the front page is currently being displayed</p>
<p><strong>$left:</strong> Returns the HTML for the left sidebar, including the HTML for blocks belonging<br />
to this region.</p>
<p><strong>$logged_in:</strong> TRUE if the current user is logged in; FALSE otherwise.</p>
<p><strong>$logo: </strong>The path to the logo image, as defined in the theme configuration page of<br />
enabled themes. It’s used as follows in Drupal’s default page template:<br />
&lt;img src=&#8221;&lt;?php print $logo; ?&gt;&#8221; alt=&#8221;&lt;?php print t(&#8216;Home&#8217;); ?&gt;&#8221; /&gt;</p>
<p><strong>$messages:</strong> This variable returns the HTML for validation errors, success notices for<br />
forms, and other messages as well. It’s usually displayed at the top of the page.</p>
<p><strong>$mission:</strong> Returns the text of the site mission that was entered at Administer ä Site configuration<br />
ä Site information. This variable is only populated when $is_front is TRUE.</p>
<p><strong>$primary_links:</strong> An array containing the primary links as they have been defined at<br />
Administer ä Site building äMenus. Usually $primary_links is styled through the<br />
theme(&#8216;links&#8217;) function as follows:<br />
&lt;?php<br />
print theme(&#8216;links&#8217;, $primary_links, array(&#8216;class&#8217; =&gt; å<br />
&#8216;links primary-links&#8217;))<br />
?&gt;</p>
<p><strong>$secondary_links: </strong>An array containing the secondary links as they have been defined at<br />
Administer ä Site building äMenus. Usually $secondary_links is styled through the<br />
theme(&#8216;links&#8217;) function as follows: and are placed beneath primary links as they are the sub links for them<br />
&lt;?php<br />
print theme(&#8216;links&#8217;, $secondary_links, array(&#8216;class&#8217; =&gt; å<br />
&#8216;links primary-links&#8217;))<br />
?&gt;</p>
<p><strong>$site_name:</strong> The name of the site, which is set at Administer ä Site configuration ä Site<br />
information. $site_name is empty when the administrator has disabled the display on<br />
the theme configuration page of enabled themes.</p>
<p><strong>$site_slogan: </strong>The slogan of the site, which is set at Administer ä Site configuration ä<br />
Site information. $site_slogan is empty when the administrator has disabled the display<br />
of the slogan on the theme configuration page of enabled themes.</p>
<p><strong>$styles:</strong> Returns the HTML for linking to the necessary CSS files to the page. CSS files<br />
are added to the $styles variable through drupal_add_css().</p>
<p><strong>$tabs: </strong>Returns the HTML for displaying tabs such as the View/Edit tabs for nodes. Tabs<br />
are usually at the top of the page in Drupal’s core themes</p>
<p><strong>$title:</strong> The main content title, different from $head_title. When on a single node view<br />
page $title is the title of the node. When viewing Drupal’s administration pages,<br />
$title is usually set by the menu item that corresponds to the page being viewed</p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/important-variables-to-be-added-to-page-tpl-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>base path and module path</title>
		<link>http://breathing-spring.com/base-path-and-module-path/</link>
		<comments>http://breathing-spring.com/base-path-and-module-path/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 09:47:54 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=125</guid>
		<description><![CDATA[to get theme path use

drupal_get_path('theme', 'theme_name')

for module path use

drupal_get_path('mobule', 'module_name')

to get base url

$GLOBALS['base_path']

]]></description>
			<content:encoded><![CDATA[<p>to get theme path use</p>
<pre>
drupal_get_path('theme', 'theme_name')
</pre>
<p>for module path use</p>
<pre>
drupal_get_path('mobule', 'module_name')
</pre>
<p>to get base url</p>
<pre>
$GLOBALS['base_path']
</pre>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/base-path-and-module-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Drupal Module &#8211; Part 2</title>
		<link>http://breathing-spring.com/creating-drupal-module-part-2/</link>
		<comments>http://breathing-spring.com/creating-drupal-module-part-2/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 15:01:15 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=122</guid>
		<description><![CDATA[now I will cover the mymodule.module part
there is three hooks we use alot in backend those are
insert_hook, update_hook, delete_hook
each hook add node, delete node, and update node
insert_hook
starting clear we can implement hook insert by name modulename_insert
function modulename_insert($node) {
  db_query("INSERT INTO {mytable} (nid, extra)
    VALUES (%d, '%s')", $node-&#62;nid, $node-&#62;extra);
}


function modulename_update($node) {
//if the ]]></description>
			<content:encoded><![CDATA[<p>now I will cover the mymodule.module part</p>
<p>there is three hooks we use alot in backend those are</p>
<p>insert_hook, update_hook, delete_hook</p>
<p>each hook add node, delete node, and update node</p>
<p><strong>insert_hook</strong></p>
<p>starting clear we can implement hook insert by name modulename_insert</p>
<pre><code>function <a title="Respond to node insertion." href="http://api.drupal.org/api/function/hook_insert/4.7"></a>modulename_insert($node) {
  db_query("INSERT INTO {mytable} (nid, extra)
    VALUES (%d, '%s')", $node-&gt;nid, $node-&gt;extra);
}

</code>
<pre><code>function modulename_update($node) {
//if the node is set for revision insert instead of delete
</code>if ($node-&gt;revision) {
 modulename_insert($node);
 }
 else
<code>{
 db_query("UPDATE {mytable} SET extra = '%s' WHERE nid = %d",
    $node-&gt;extra, $node-&gt;nid);
}
}
</code></pre>
<pre><code>function modulename_delete(&amp;$node) {
  db_query('DELETE FROM {mytable} WHERE nid = %d', $node-&gt;nid);
}
</code></pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/creating-drupal-module-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Drupal Module Part 1 &#8211; Install Package</title>
		<link>http://breathing-spring.com/creating-drupal-module-part-1-install-package/</link>
		<comments>http://breathing-spring.com/creating-drupal-module-part-1-install-package/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 13:05:04 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=119</guid>
		<description><![CDATA[first of all we should know that the name of installing any function should be modulename.install and we wont need
&#60;?php
function mymodule_schema() {
$schema['mytable1'] = array(
// specification for mytable1
);
$schema['mytable2'] = array(
// specification for mytable2
);
return $schema;
}
function mymodule_install() {
// Create my tables.
drupal_install_schema('mymodule');
drupal_set_message(t('The tables created successfully'));
}
function mymodule_uninstall() {
// Drop my tables.
drupal_uninstall_schema('mymodule');
drupal_set_message(t('The tables were removed'));
}
?&#62;

sample of table schema array
$schema['distribution_center'] = array(
&#8216;fields&#8217; ]]></description>
			<content:encoded><![CDATA[<p>first of all we should know that the name of installing any function should be <strong>modulename</strong>.install and we wont need</p>
<div><code>&lt;?php<br />
function mymodule_schema() {<br />
$schema['mytable1'] = array(<br />
// specification for mytable1<br />
);<br />
$schema['mytable2'] = array(<br />
// specification for mytable2<br />
);<br />
return $schema;<br />
}</p>
<p>function mymodule_install() {<br />
// Create my tables.<br />
drupal_install_schema('mymodule');<br />
drupal_set_message(t('The tables created successfully'));<br />
}</p>
<p>function mymodule_uninstall() {<br />
// Drop my tables.</p>
<p>drupal_uninstall_schema('mymodule');<br />
drupal_set_message(t('The tables were removed'));</p>
<p>}<br />
?&gt;<br />
</code><br />
sample of table schema array</p>
<p>$schema['distribution_center'] = array(<br />
&#8216;fields&#8217; =&gt; array(<br />
&#8216;vid&#8217; =&gt; array(<br />
&#8216;type&#8217; =&gt; &#8216;int&#8217;,<br />
&#8216;not null&#8217; =&gt; TRUE,<br />
&#8216;description&#8217;=&gt; &#8220;Log ID&#8221;<br />
),<br />
&#8216;nid&#8217;=&gt;array(<br />
&#8216;type&#8217;=&gt;&#8217;int&#8217;,<br />
&#8216;not null&#8217;=&gt;FALSE,<br />
),<br />
&#8216;fname&#8217;=&gt;array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;TRUE,<br />
),<br />
&#8216;lname&#8217;=&gt;array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;TRUE,<br />
),<br />
&#8216;address&#8217;=&gt;    array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;TRUE,<br />
),<br />
&#8216;country&#8217;=&gt;array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;TRUE,<br />
),<br />
&#8216;city&#8217;=&gt;array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;TRUE,<br />
),<br />
&#8216;phone&#8217;=&gt;array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;FALSE,<br />
),<br />
&#8216;mobile&#8217;=&gt;array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;FALSE,<br />
),<br />
&#8216;email&#8217;=&gt;array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;TRUE,<br />
),<br />
&#8217;site&#8217;=&gt;array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;TRUE,<br />
),<br />
&#8216;center_attr&#8217;=&gt;    array(<br />
&#8216;type&#8217;=&gt;&#8217;text&#8217;,<br />
&#8216;not null&#8217;=&gt;FALSE,<br />
),<br />
),<br />
&#8216;primary key&#8217; =&gt; array(&#8216;vid&#8217;)<br />
);</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/creating-drupal-module-part-1-install-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logging in Drupal</title>
		<link>http://breathing-spring.com/logging-in-drupal/</link>
		<comments>http://breathing-spring.com/logging-in-drupal/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 09:56:25 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=117</guid>
		<description><![CDATA[$msg = &#8216;No content from %url.&#8217;;
$vars = array( &#8216;%url&#8217; => $url );
watchdog(&#8216;module_name&#8217;, $msg, $vars, WATCHDOG_WARNING);
There are eight different constants that can be passed to this function:
WATCHDOG_EMERG: The system is now in an unusable state.
WATCHDOG_ALERT: Something must be done immediately.
WATCHDOG_CRITICAL: The application is in a critical state.
WATCHDOG_ERROR: An error occurred.
WATCHDOG_WARNING: Something unexpected (and negative) happened, but
didn&#8217;t ]]></description>
			<content:encoded><![CDATA[<p>$msg = &#8216;No content from %url.&#8217;;<br />
$vars = array( &#8216;%url&#8217; => $url );<br />
watchdog(&#8216;module_name&#8217;, $msg, $vars, WATCHDOG_WARNING);</p>
<p>There are eight different constants that can be passed to this function:<br />
WATCHDOG_EMERG: The system is now in an unusable state.<br />
WATCHDOG_ALERT: Something must be done immediately.<br />
WATCHDOG_CRITICAL: The application is in a critical state.<br />
WATCHDOG_ERROR: An error occurred.<br />
WATCHDOG_WARNING: Something unexpected (and negative) happened, but<br />
didn&#8217;t cause any serious problems.<br />
WATCHDOG_NOTICE: Something significant (but not bad) happened.<br />
WATCHDOG_INFO: Information can be logged.<br />
WATCHDOG_DEBUG: Debugging information can be logged.</p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/logging-in-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add paging in Drupal</title>
		<link>http://breathing-spring.com/how-to-add-paging-in-drupal/</link>
		<comments>http://breathing-spring.com/how-to-add-paging-in-drupal/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 10:07:30 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=106</guid>
		<description><![CDATA[this article is taken from http://www.sononix.com/node/270 just placed here for reminder purposes
//This is numbers per page
$num_per_page = 5;
//actual query
$query = &#8220;SELECT n.nid, n.created FROM {node} n WHERE n.type = &#8216;halloffame&#8217; AND n.status = 1 ORDER BY n.created DESC&#8221;;
//the count query should be similar to the query above
$count_query = &#8220;SELECT COUNT(*) AS row_count FROM {node} n ]]></description>
			<content:encoded><![CDATA[<p>this article is taken from http://www.sononix.com/node/270 just placed here for reminder purposes</p>
<p>//This is numbers per page<br />
$num_per_page = 5;</p>
<p>//actual query</p>
<p>$query = &#8220;SELECT n.nid, n.created FROM {node} n WHERE n.type = &#8216;halloffame&#8217; AND n.status = 1 ORDER BY n.created DESC&#8221;;</p>
<p>//the count query should be similar to the query above<br />
$count_query = &#8220;SELECT COUNT(*) AS row_count FROM {node} n WHERE n.type = &#8216;halloffame&#8217; AND n.status = 1 ORDER BY n.created DESC&#8221;;</p>
<p>//pager_query function<br />
$result = pager_query($query, $num_per_page, 0, $count_query, $user_load-&gt;uid);</p>
<p>//dont forget</p>
<p>while ($node = db_fetch_object($result)) {<br />
$output .= node_view(node_load(array(&#8216;nid&#8217; =&gt; $node-&gt;nid)), 1);<br />
}</p>
<p>$output .= theme(&#8216;pager&#8217;, NULL, 5, 0);</p>
<p>print $output;</p>
<p>?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/how-to-add-paging-in-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
