<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Adding a user to phpbb3 from an external script</title>
	<atom:link href="http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/</link>
	<description>Web Development, Accessibility and Search Marketing</description>
	<pubDate>Sat, 05 Jul 2008 20:45:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Martin Sarsini</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-764</link>
		<dc:creator>Martin Sarsini</dc:creator>
		<pubDate>Tue, 03 Jun 2008 11:15:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-764</guid>
		<description>Finally a simple solution. Thank you very much
the only thing I should suggest is to use exactly the phpBB3 specs

// get some functions from phpBB3
define('IN_PHPBB', true);
$phpbb_root_path = './forum/'; // change this to phpBB3 dir
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user-&#62;session_begin();
$auth-&#62;acl($user-&#62;data);
$user-&#62;setup();


all the global variables you have set are not required
/* set scope for variables required later */

thanks again, works great!</description>
		<content:encoded><![CDATA[<p>Finally a simple solution. Thank you very much<br />
the only thing I should suggest is to use exactly the phpBB3 specs</p>
<p>// get some functions from phpBB3<br />
define(&#8217;IN_PHPBB&#8217;, true);<br />
$phpbb_root_path = &#8216;./forum/&#8217;; // change this to phpBB3 dir<br />
$phpEx = substr(strrchr(__FILE__, &#8216;.&#8217;), 1);<br />
include($phpbb_root_path . &#8216;common.&#8217; . $phpEx);</p>
<p>// Start session management<br />
$user-&gt;session_begin();<br />
$auth-&gt;acl($user-&gt;data);<br />
$user-&gt;setup();</p>
<p>all the global variables you have set are not required<br />
/* set scope for variables required later */</p>
<p>thanks again, works great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-608</link>
		<dc:creator>Johan</dc:creator>
		<pubDate>Tue, 20 May 2008 09:08:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-608</guid>
		<description>Thanks a lot for this script!

I search this for a while!</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this script!</p>
<p>I search this for a while!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-563</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Fri, 02 May 2008 01:09:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-563</guid>
		<description>Thanks, works perfectly!</description>
		<content:encoded><![CDATA[<p>Thanks, works perfectly!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lilferry</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-562</link>
		<dc:creator>lilferry</dc:creator>
		<pubDate>Thu, 01 May 2008 04:09:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-562</guid>
		<description>oh hell. Disregard my above post, the post script on this site is filtering away the signs I wrote. Let me specify again:
Replace all ” and ‘ with &#34; or &apos;</description>
		<content:encoded><![CDATA[<p>oh hell. Disregard my above post, the post script on this site is filtering away the signs I wrote. Let me specify again:<br />
Replace all ” and ‘ with &quot; or &apos;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lilferry</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-561</link>
		<dc:creator>lilferry</dc:creator>
		<pubDate>Thu, 01 May 2008 04:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-561</guid>
		<description>Cheers! 
To make kirkland's code work: Replace all ” and ‘ with " or '.</description>
		<content:encoded><![CDATA[<p>Cheers!<br />
To make kirkland&#8217;s code work: Replace all ” and ‘ with &#8221; or &#8216;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-430</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Mon, 07 Apr 2008 19:39:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-430</guid>
		<description>Looks like I missed the first part of the code when copying. I've listed full program below. Sorry about that.

session_begin();
$auth-&#62;acl($user-&#62;data);

/* the file with the actual goodies */
include($phpbb_root_path .'includes/functions_user.php');

$result = mysql_pconnect('server', 'database', 'password');
$result = mysql_select_db('database');
$query = "select * from users";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result))
{
	$username = $row['username'];
	$password = $row['password'];
	$email = $row['email']
	$user_row = array(
		'username' =&#62; $username,
		'user_password' =&#62; md5($password), 
		'user_email' =&#62; $email,
		'group_id' =&#62; 2,     #Registered users group
		'user_timezone' =&#62; 0,
		'user_dst' =&#62; 1,
		'user_lang' =&#62; 'en',
		'user_type' =&#62; 0,
		'user_actkey' =&#62; '',
		'user_dateformat' =&#62; 'D M d, Y g:i a',
		'user_style' =&#62; 1,
		'user_regdate' =&#62; time(),
	);
	/* Now Register user */
	$phpbb_user_id = user_add($user_row);
}
echo 'finished';
?&#62;</description>
		<content:encoded><![CDATA[<p>Looks like I missed the first part of the code when copying. I&#8217;ve listed full program below. Sorry about that.</p>
<p>session_begin();<br />
$auth-&gt;acl($user-&gt;data);</p>
<p>/* the file with the actual goodies */<br />
include($phpbb_root_path .&#8217;includes/functions_user.php&#8217;);</p>
<p>$result = mysql_pconnect(&#8217;server&#8217;, &#8216;database&#8217;, &#8216;password&#8217;);<br />
$result = mysql_select_db(&#8217;database&#8217;);<br />
$query = &#8220;select * from users&#8221;;<br />
$result = mysql_query($query);<br />
while ($row = mysql_fetch_assoc($result))<br />
{<br />
	$username = $row['username'];<br />
	$password = $row['password'];<br />
	$email = $row['email']<br />
	$user_row = array(<br />
		&#8216;username&#8217; =&gt; $username,<br />
		&#8216;user_password&#8217; =&gt; md5($password),<br />
		&#8216;user_email&#8217; =&gt; $email,<br />
		&#8216;group_id&#8217; =&gt; 2,     #Registered users group<br />
		&#8216;user_timezone&#8217; =&gt; 0,<br />
		&#8216;user_dst&#8217; =&gt; 1,<br />
		&#8216;user_lang&#8217; =&gt; &#8216;en&#8217;,<br />
		&#8216;user_type&#8217; =&gt; 0,<br />
		&#8216;user_actkey&#8217; =&gt; &#8221;,<br />
		&#8216;user_dateformat&#8217; =&gt; &#8216;D M d, Y g:i a&#8217;,<br />
		&#8216;user_style&#8217; =&gt; 1,<br />
		&#8216;user_regdate&#8217; =&gt; time(),<br />
	);<br />
	/* Now Register user */<br />
	$phpbb_user_id = user_add($user_row);<br />
}<br />
echo &#8216;finished&#8217;;<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-429</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Mon, 07 Apr 2008 19:31:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-429</guid>
		<description>If the above code doesn't work then try replacing the single quotes in the code. I suspect these are changed when uploading to this message board. It was one of the main problems with the original code above.

Cheers
Russ</description>
		<content:encoded><![CDATA[<p>If the above code doesn&#8217;t work then try replacing the single quotes in the code. I suspect these are changed when uploading to this message board. It was one of the main problems with the original code above.</p>
<p>Cheers<br />
Russ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-428</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Mon, 07 Apr 2008 19:27:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-428</guid>
		<description>I tried the code above with no success, so I hacked it around for a while as below. It retrieves a list of users from a MySQL table called USERS which has 3 fields; USERNAME, PASSWORD, EMAIL.

This works fine for me on PHPBB 3. FTPed as addusers.php to my forum directory and activated with HTTP://www.domain.com/forum/addusers.php.

-------------------------------------------------------
#addusers.php
session_begin();
$auth-&#62;acl($user-&#62;data);

/* the file with the actual goodies */
include($phpbb_root_path .'includes/functions_user.php');

$result = mysql_pconnect('server', 'database', 'password');
$result = mysql_select_db('database');
$query = "select * from users";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result))
{
	$username = $row['username'];
	$password = $row['password'];
	$email = $row['email'];
	$user_row = array(
		'username' =&#62; $username,
		'user_password' =&#62; md5($password), 
		'user_email' =&#62; $email,
		'group_id' =&#62; 2,     #Registered users group
		'user_timezone' =&#62; 0,
		'user_dst' =&#62; 1,
		'user_lang' =&#62; 'en',
		'user_type' =&#62; 0,
		'user_actkey' =&#62; '',
		'user_dateformat' =&#62; 'D M d, Y g:i a',
		'user_style' =&#62; 1,
		'user_regdate' =&#62; time(),
	);
	/* Now Register user */
	$phpbb_user_id = user_add($user_row);
}
echo 'finished';
?&#62;</description>
		<content:encoded><![CDATA[<p>I tried the code above with no success, so I hacked it around for a while as below. It retrieves a list of users from a MySQL table called USERS which has 3 fields; USERNAME, PASSWORD, EMAIL.</p>
<p>This works fine for me on PHPBB 3. FTPed as addusers.php to my forum directory and activated with HTTP://www.domain.com/forum/addusers.php.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
#addusers.php<br />
session_begin();<br />
$auth-&gt;acl($user-&gt;data);</p>
<p>/* the file with the actual goodies */<br />
include($phpbb_root_path .&#8217;includes/functions_user.php&#8217;);</p>
<p>$result = mysql_pconnect(&#8217;server&#8217;, &#8216;database&#8217;, &#8216;password&#8217;);<br />
$result = mysql_select_db(&#8217;database&#8217;);<br />
$query = &#8220;select * from users&#8221;;<br />
$result = mysql_query($query);<br />
while ($row = mysql_fetch_assoc($result))<br />
{<br />
	$username = $row['username'];<br />
	$password = $row['password'];<br />
	$email = $row['email'];<br />
	$user_row = array(<br />
		&#8216;username&#8217; =&gt; $username,<br />
		&#8216;user_password&#8217; =&gt; md5($password),<br />
		&#8216;user_email&#8217; =&gt; $email,<br />
		&#8216;group_id&#8217; =&gt; 2,     #Registered users group<br />
		&#8216;user_timezone&#8217; =&gt; 0,<br />
		&#8216;user_dst&#8217; =&gt; 1,<br />
		&#8216;user_lang&#8217; =&gt; &#8216;en&#8217;,<br />
		&#8216;user_type&#8217; =&gt; 0,<br />
		&#8216;user_actkey&#8217; =&gt; &#8221;,<br />
		&#8216;user_dateformat&#8217; =&gt; &#8216;D M d, Y g:i a&#8217;,<br />
		&#8216;user_style&#8217; =&gt; 1,<br />
		&#8216;user_regdate&#8217; =&gt; time(),<br />
	);<br />
	/* Now Register user */<br />
	$phpbb_user_id = user_add($user_row);<br />
}<br />
echo &#8216;finished&#8217;;<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-264</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 11 Jan 2008 21:33:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-264</guid>
		<description>I've tried using your code (and others from the phpbb Mod forum) without any luck. My user_row array is correctly filled out, but the user_add() function does nothing - doesn't insert anything to the database, doesn't return a user ID, doesn't even spit out an error.

Any suggestions?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve tried using your code (and others from the phpbb Mod forum) without any luck. My user_row array is correctly filled out, but the user_add() function does nothing - doesn&#8217;t insert anything to the database, doesn&#8217;t return a user ID, doesn&#8217;t even spit out an error.</p>
<p>Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr Kirkland</title>
		<link>http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-257</link>
		<dc:creator>Mr Kirkland</dc:creator>
		<pubDate>Mon, 07 Jan 2008 07:20:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/#comment-257</guid>
		<description>Hi Richard,

Sorry I've not had that particular situation so I can't comment. 

I did notice that a side effect of including all the phpbb code is the error reporting, e.g. it will start reporting errors (as per phpbb settings) for any code from the point you include the phpbb3 code. I then uncommented @define('DEBUG', false); from config.php as it was interfering with my own error reporting i.e. it was diplaying errors to the end user rather than logging them silently as in my application.</description>
		<content:encoded><![CDATA[<p>Hi Richard,</p>
<p>Sorry I&#8217;ve not had that particular situation so I can&#8217;t comment. </p>
<p>I did notice that a side effect of including all the phpbb code is the error reporting, e.g. it will start reporting errors (as per phpbb settings) for any code from the point you include the phpbb3 code. I then uncommented @define(&#8217;DEBUG&#8217;, false); from config.php as it was interfering with my own error reporting i.e. it was diplaying errors to the end user rather than logging them silently as in my application.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
