<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>chirale &#187; profile</title>
	<atom:link href="http://chirale.wordpress.com/tag/profile/feed/" rel="self" type="application/rss+xml" />
	<link>http://chirale.wordpress.com</link>
	<description>watashi no yume...</description>
	<lastBuildDate>Mon, 07 Dec 2009 08:58:07 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='chirale.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/913d290334c442dca8a7360d648ac1bd?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>chirale &#187; profile</title>
		<link>http://chirale.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://chirale.wordpress.com/osd.xml" title="chirale" />
		<item>
		<title>Save user profile on Drupal</title>
		<link>http://chirale.wordpress.com/2008/12/03/save-user-profile-on-drupal/</link>
		<comments>http://chirale.wordpress.com/2008/12/03/save-user-profile-on-drupal/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 08:51:09 +0000</pubDate>
		<dc:creator>chirale</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[drupal 5]]></category>
		<category><![CDATA[fields]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[load profile]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[profile_load_profile]]></category>
		<category><![CDATA[profile_save_profile]]></category>
		<category><![CDATA[save profile]]></category>

		<guid isPermaLink="false">http://chirale.wordpress.com/?p=241</guid>
		<description><![CDATA[Tested on:

Drupal 5.x

After you have created some user fields through Profile module provided by core, you can have the need to save value into the user object. Here a quick howto to do this.
On user creation:
/** create user profile ($new_user will be an user object) */
$new_user_array = array (
  'name' =&#62; "funnyusername",
  'pass' [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=241&subd=chirale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Tested on:</p>
<ul>
<li>Drupal 5.x</li>
</ul>
<p>After you have created some user fields through Profile module provided by core, you can have the need to save value into the user object. Here a quick howto to do this.</p>
<p>On user creation:</p>
<pre>/** create user profile ($new_user will be an user object) */
$new_user_array = array (
  'name' =&gt; "funnyusername",
  'pass' =&gt; "MyVerySecurePassword",
  'mail' =&gt; "info@example.gom",
  'status' =&gt; 1, # status: active
);
$new_user = user_save(NULL, $new_user_array, $category = 'account');
/** assign values to profile fields */
$new_user_edit =  array(
'profile_surname' =&gt; "Yumemiya",
'profile_name' =&gt; "Arika",
);
/** create and save profile fields */
profile_save_profile($new_user_edit, $new_user, "Character ID");</pre>
<p>Where &#8220;Character ID&#8221; is the category name for <code>profile_surname</code> e <code>profile_name</code>.</p>
<p>To load current user instead creating new one, you have to use</p>
<pre>global $user;</pre>
<p>instead a previously declared user object $new_user.</p>
<p>See also:</p>
<ul>
<li><a class="active" href="http://api.drupal.org/api/function/profile_save_profile/5"><span class="a"><span class="b">profile_save_profile() on Drupal API</span></span></a></li>
<li class="active"><a class="active" href="http://api.drupal.org/api/function/profile_load_profile/5"><span class="a"><span class="b">profile_load_profile() on Drupal API</span></span></a></li>
</ul>
<p><strong>Update: </strong></p>
<ul>
<li>Using this method during a cronjob (using <a href="http://api.drupal.org/api/function/hook_cron/5">hook_cron</a>) I experienced an error: profile values are passed, but not written, but only if cronjob is launched automatically, and not forced by Report screen (as admin). After some days, I discovered that it&#8217;s a permission issue.<br />
<strong>Problem:</strong><br />
Add a &#8220;cronbot&#8221; user with some privileges over user (&#8220;administer user&#8221;) to allow writing even on hidden Profile field.<br />
<strong>Solution:</strong><br />
On a dedicated server, with a dedicated IP, you can automatically login by IP (by <a href="http://drupalmodules.com/module/ip-login">IP Login module</a> for 5.x and 6.x) the cronjob using the server IP or loopback address (127.0.0.1) depending on server configuration (I use the first in production, the latter on local testing).</p>
<ol>
<li>Add an ip_login Profile field (single line text field, hidden field)</li>
<li>Enable IP Login module</li>
<li>Assign ip_login field to IP login by IP Login configuration screen</li>
<li>Create a new role named &#8220;cronbots&#8221;, with &#8220;administer users&#8221; permission.</li>
<li>Create a new user named &#8220;cronbot&#8221;, with &#8220;cronbots&#8221; role assigned</li>
<li>Change the &#8220;IP login&#8221; field for &#8220;cronbot&#8221; to your server IP (127.0.0.1 or your static IP address as listed on ifconfig on *nix servers)</li>
</ol>
<p>On the next automatic cron run (not force it), you&#8217;ll see the &#8220;cronbot&#8221; user logging in. On Drupal logs, the cronjob execution pass from &#8220;Anonymous&#8221; to &#8220;cronbot&#8221;, and profile fields are rightly written.<br />
<strong>The other way:</strong><br />
Just write profile field via db_query. (You don&#8217;t want to do a weird thing like that, right? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chirale.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chirale.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chirale.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chirale.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chirale.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chirale.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chirale.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chirale.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chirale.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chirale.wordpress.com/241/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=241&subd=chirale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chirale.wordpress.com/2008/12/03/save-user-profile-on-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12a67456dc1db7deec545e23d51e0c8c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chirale</media:title>
		</media:content>
	</item>
		<item>
		<title>Enable user profile field token on Drupal</title>
		<link>http://chirale.wordpress.com/2008/02/22/enable-user-profile-field-token-on-drupal/</link>
		<comments>http://chirale.wordpress.com/2008/02/22/enable-user-profile-field-token-on-drupal/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 13:27:34 +0000</pubDate>
		<dc:creator>chirale</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[token]]></category>

		<guid isPermaLink="false">http://chirale.wordpress.com/?p=43</guid>
		<description><![CDATA[Tested on:

Drupal 5.x (Profile module included)
Token
Personalized E-mails 5.x-1.0


In token module directory, rename  token_user.inc to token_user.inc.orig
Copy pmail/patches/token_user.inc in  Token module directory
Go to Personalized E-mails setting and watch your profile fields as tokens.

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=43&subd=chirale&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Tested on:</p>
<ul>
<li>Drupal 5.x (Profile module included)</li>
<li><a href="http://drupal.org/project/token" target="_blank">Token</a></li>
<li><a href="http://drupal.org/project/pmail" target="_blank">Personalized E-mails</a> 5.x-1.0</li>
</ul>
<ol>
<li>In token module directory, rename  token_user.inc to token_user.inc.orig</li>
<li>Copy pmail/patches/token_user.inc in  Token module directory</li>
<li>Go to Personalized E-mails setting and watch your profile fields as tokens.</li>
</ol>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/chirale.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/chirale.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chirale.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chirale.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chirale.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chirale.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chirale.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chirale.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chirale.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chirale.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chirale.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chirale.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chirale.wordpress.com&blog=1488255&post=43&subd=chirale&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chirale.wordpress.com/2008/02/22/enable-user-profile-field-token-on-drupal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12a67456dc1db7deec545e23d51e0c8c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chirale</media:title>
		</media:content>
	</item>
	</channel>
</rss>