<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Georgi.Budinov.com » CodeIgniter</title>
	
	<link>http://georgi.budinov.com</link>
	<description>The sacred mission of a Web Developer - Get the job done!</description>
	<lastBuildDate>Wed, 02 Nov 2011 13:55:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/GeorgibudinovcomCodeigniter" /><feedburner:info uri="georgibudinovcomcodeigniter" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>GeorgibudinovcomCodeigniter</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Integrating PHPList and CodeIgniter</title>
		<link>http://feedproxy.google.com/~r/GeorgibudinovcomCodeigniter/~3/yO2vK1nTV3o/</link>
		<comments>http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 10:10:37 +0000</pubDate>
		<dc:creator>Georgi Budinov</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[phplist]]></category>

		<guid isPermaLink="false">http://georgi.budinov.com/?p=835</guid>
		<description><![CDATA[Hello to all. It was a busy month ,so I haven&#8217;t updated this blog for soo loong. Now I give you a small bonus . I was busy with a lot of stuff including writing a library for CodeIgniter dealing with PHPList integration. Before implementing it, I googled a lot for a ready to use [...]]]></description>
			<content:encoded><![CDATA[<p>Hello to all. It was a busy month ,so I haven&#8217;t updated this blog for soo loong. Now I give you a small bonus <img src='http://georgi.budinov.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I was busy with a lot of stuff including writing a library for CodeIgniter dealing with PHPList integration. Before implementing it, I googled a lot for a ready to use library on this particular subject. No luck. So I found myself writing it for an hour and think it is pretty good in doing its job, at least for me <img src='http://georgi.budinov.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Here is the library <span id="more-835"></span>and enjoy.</p>
<p>NOTE: Have in mind that the CI and PHPLIST have a common function named &#8220;redirect&#8221;. You either need to rename that in CI or in PHPLIST.</p>
<pre class="brush: php;">
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
* CodeIgniter phplist Library
*
* CodeIgniter phplist bridge allowing adding users to lists and blacklisting them
*
* @author Georgi Budinov
* @version	1.0
* @link http://georgi.budinov.com
*/
class Phplist_library
{
    public $CI;

    /**
     * Constructor.
     */
    public function __construct()
    {
    	global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;
        if (!isset($this-&gt;CI))
		{
			$this-&gt;CI =&amp; get_instance();
		}

		$rootPath = $this-&gt;CI-&gt;config-&gt;item('root_path');

		define('BULLETIN_ROOT_PATH', $rootPath.'bulletin/');

		$phplist_root_path = (defined('PHPLIST_ROOT_PATH')) ? PHPLIST_ROOT_PATH : BULLETIN_ROOT_PATH;

		// Include needed files
		include($phplist_root_path . 'admin/defaultconfig.inc');
		include($phplist_root_path . 'config/config.php');
		include($phplist_root_path . 'admin/mysql.inc');
		include($phplist_root_path . 'admin/connect.php');
    }

    /**
     *
     * @param $email
     * @param $lists
     * @return mixed
     */
    public function user_add($email, $lists = array())
    {
    	if(!$email) return false;

    	if(is_array($lists) &amp;&amp; count($lists))
    	{
    		$userID = addNewUser($email);

    		if($userID &gt; 0)
    		{
    			foreach($lists as $list)
    			{
    				$this-&gt;userAddToList($userID, $list);
    			}
    		}
    	}
    	else
    	{
        	return addNewUser($email);
    	}
    }

	public function get_lists()
    {
    	$results = $this-&gt;getLists();

    	return $results;
    }

	public function user_add_list($email, $list)
    {
    	if(!$email || !$list) return;

    	$userid = $this-&gt;getUserIDByEmail($email);

    	if($userid &gt; 0)
    	{
    		$this-&gt;userAddToList($userid, $list);
    	}
    	else
    	{
    		return;
    	}
    }

	public function user_remove_list($email, $list)
    {
    	if(!$email || !$list) return;

    	$userid = $this-&gt;getUserIDByEmail($email);

    	if($userid &gt; 0)
    	{
    		$this-&gt;userRemoveToList($userid, $list);
    	}
    	else
    	{
    		return;
    	}
    }

    /**
     *
     * @param $email
     * @return mixed
     */
    public function user_blacklist($email)
    {
    	if(!$email) return;

    	return addUserToBlackList($email);
    }

	/**
     *
     * @param $email
     * @return mixed
     */
    public function user_unblacklist($email)
    {
    	if(!$email) return;

    	$userid = $this-&gt;getUserIDByEmail($email);

    	if($userid &gt; 0)
    	{
    		return unBlackList($userid);
    	}
    	else
    	{
    		return false;
    	}
    }

	private function getUserIDByEmail($email = '') {
	  global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;
	  if (!$email) return;

	  # workaround for integration webbler/phplist
	  if (!isset($table_prefix))
	    $table_prefix = &quot;phplist_&quot;;

	  if (isset($tables[&quot;attribute&quot;])) {
	    $att_table = $tables[&quot;attribute&quot;];
	    $user_att_table = $tables[&quot;user_attribute&quot;];
	    $usertable = $tables[&quot;user&quot;];
	  } else {
	    $att_table = &quot;attribute&quot;;
	    $user_att_table = &quot;user_attribute&quot;;
	    $usertable = &quot;user&quot;;
	  }
	  $email = mysql_real_escape_string($email, $database_connection);
	  $userid = Sql_Fetch_Row_Query(&quot;select id from {$usertable} where email = \&quot;$email\&quot;&quot;);
	  $id = $userid[0];

	  return $id;
	}

	private function userAddToList($id = 0, $listID = 0)
	{
		global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;

		$id = intval($id);
		$listID = intval($listID);
		if(!$id || !$listID) return false;

		$query = &quot;replace into &quot;.$tables[&quot;listuser&quot;].&quot; (userid,listid,entered) values($id,$listID,now())&quot;;
	    $result = Sql_query($query);
	}

	private function userRemoveToList($id = 0, $listID = 0)
	{
		global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;

		$id = intval($id);
		$listID = intval($listID);
		if(!$id || !$listID) return false;

		$query = &quot;delete from &quot;.$tables[&quot;listuser&quot;].&quot; where userid = $id and listid = $listID&quot;;
	    $result = Sql_query($query);
	}

	private function getLists()
	{
		global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;

		$results = array();
		$result = Sql_query(&quot;SELECT * FROM {$tables['list']} order by listorder&quot;);
		while ($row = Sql_fetch_array($result))
		{
			$results[$row['id']] = $row;
		}

		return $results;
	}
}

/* End of file phplist_library.php */
/* Location: ./application/libraries/phplist_library.php */
</pre>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">
<p>&lt;?php if (!defined(&#8216;BASEPATH&#8217;)) exit(&#8216;No direct script access allowed&#8217;);</p>
<p>/**<br />
* CodeIgniter phplist Library<br />
*<br />
* CodeIgniter phplist bridge allowing adding users to lists and blacklisting them<br />
*<br />
* @author Georgi Budinov<br />
* @version    1.0<br />
* @link http://georgi.budinov.com<br />
*/<br />
class Phplist_library<br />
{<br />
public $CI;</p>
<p>/**<br />
* Constructor.<br />
*/<br />
public function __construct()<br />
{<br />
global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;<br />
if (!isset($this-&gt;CI))<br />
{<br />
$this-&gt;CI =&amp; get_instance();<br />
}</p>
<p>$rootPath = $this-&gt;CI-&gt;config-&gt;item(&#8216;root_path&#8217;);</p>
<p>define(&#8216;BULLETIN_ROOT_PATH&#8217;, $rootPath.&#8217;bulletin/&#8217;);</p>
<p>$phplist_root_path = (defined(&#8216;PHPLIST_ROOT_PATH&#8217;)) ? PHPLIST_ROOT_PATH : BULLETIN_ROOT_PATH;</p>
<p>// Include needed files<br />
include($phplist_root_path . &#8216;admin/defaultconfig.inc&#8217;);<br />
include($phplist_root_path . &#8216;config/config.php&#8217;);<br />
include($phplist_root_path . &#8216;admin/mysql.inc&#8217;);<br />
include($phplist_root_path . &#8216;admin/connect.php&#8217;);<br />
}</p>
<p>/**<br />
*<br />
* @param $email<br />
* @param $lists<br />
* @return mixed<br />
*/<br />
public function user_add($email, $lists = array())<br />
{<br />
if(!$email) return false;</p>
<p>if(is_array($lists) &amp;&amp; count($lists))<br />
{<br />
$userID = addNewUser($email);</p>
<p>if($userID &gt; 0)<br />
{<br />
foreach($lists as $list)<br />
{<br />
$this-&gt;userAddToList($userID, $list);<br />
}<br />
}<br />
}<br />
else<br />
{<br />
return addNewUser($email);<br />
}<br />
}</p>
<p>public function get_lists()<br />
{<br />
$results = $this-&gt;getLists();</p>
<p>return $results;<br />
}</p>
<p>public function user_add_list($email, $list)<br />
{<br />
if(!$email || !$list) return;</p>
<p>$userid = $this-&gt;getUserIDByEmail($email);</p>
<p>if($userid &gt; 0)<br />
{<br />
$this-&gt;userAddToList($userid, $list);<br />
}<br />
else<br />
{<br />
return;<br />
}<br />
}</p>
<p>public function user_remove_list($email, $list)<br />
{<br />
if(!$email || !$list) return;</p>
<p>$userid = $this-&gt;getUserIDByEmail($email);</p>
<p>if($userid &gt; 0)<br />
{<br />
$this-&gt;userRemoveToList($userid, $list);<br />
}<br />
else<br />
{<br />
return;<br />
}<br />
}</p>
<p>/**<br />
*<br />
* @param $email<br />
* @return mixed<br />
*/<br />
public function user_blacklist($email)<br />
{<br />
if(!$email) return;</p>
<p>return addUserToBlackList($email);<br />
}</p>
<p>/**<br />
*<br />
* @param $email<br />
* @return mixed<br />
*/<br />
public function user_unblacklist($email)<br />
{<br />
if(!$email) return;</p>
<p>$userid = $this-&gt;getUserIDByEmail($email);</p>
<p>if($userid &gt; 0)<br />
{<br />
return unBlackList($userid);<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}</p>
<p>private function getUserIDByEmail($email = &#8221;) {<br />
global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;<br />
if (!$email) return;</p>
<p># workaround for integration webbler/phplist<br />
if (!isset($table_prefix))<br />
$table_prefix = &#8220;phplist_&#8221;;</p>
<p>if (isset($tables["attribute"])) {<br />
$att_table = $tables["attribute"];<br />
$user_att_table = $tables["user_attribute"];<br />
$usertable = $tables["user"];<br />
} else {<br />
$att_table = &#8220;attribute&#8221;;<br />
$user_att_table = &#8220;user_attribute&#8221;;<br />
$usertable = &#8220;user&#8221;;<br />
}<br />
$email = mysql_real_escape_string($email, $database_connection);<br />
$userid = Sql_Fetch_Row_Query(&#8220;select id from {$usertable} where email = \&#8221;$email\&#8221;");<br />
$id = $userid[0];</p>
<p>return $id;<br />
}</p>
<p>private function userAddToList($id = 0, $listID = 0)<br />
{<br />
global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;</p>
<p>$id = intval($id);<br />
$listID = intval($listID);<br />
if(!$id || !$listID) return false;</p>
<p>$query = &#8220;replace into &#8220;.$tables["listuser"].&#8221; (userid,listid,entered) values($id,$listID,now())&#8221;;<br />
$result = Sql_query($query);<br />
}</p>
<p>private function userRemoveToList($id = 0, $listID = 0)<br />
{<br />
global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;</p>
<p>$id = intval($id);<br />
$listID = intval($listID);<br />
if(!$id || !$listID) return false;</p>
<p>$query = &#8220;delete from &#8220;.$tables["listuser"].&#8221; where userid = $id and listid = $listID&#8221;;<br />
$result = Sql_query($query);<br />
}</p>
<p>private function getLists()<br />
{<br />
global $tables, $table_prefix, $config, $usertable_prefix, $database_connection;</p>
<p>$results = array();<br />
$result = Sql_query(&#8220;SELECT * FROM {$tables['list']} order by listorder&#8221;);<br />
while ($row = Sql_fetch_array($result))<br />
{<br />
$results[$row['id']] = $row;<br />
}</p>
<p>return $results;<br />
}<br />
}</p>
<p>/* End of file phplist_library.php */<br />
/* Location: ./application/libraries/phplist_library.php */</p>
</div>
<div class="social_bookmark"><script type="text/javascript"><!--
google_ad_client = "pub-1171831089941131";
google_ad_slot = "5499515740";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div><!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Bookmark It</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/&amp;title=Integrating+PHPList+and+CodeIgniter" title="Bookmark 'Integrating PHPList and CodeIgniter' in Del.icio.us"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/delicious.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in Del.icio.us" alt="Bookmark 'Integrating PHPList and CodeIgniter' in Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/&amp;title=Integrating+PHPList+and+CodeIgniter" title="Bookmark 'Integrating PHPList and CodeIgniter' in digg"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in digg" alt="Bookmark 'Integrating PHPList and CodeIgniter' in digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/" title="Bookmark 'Integrating PHPList and CodeIgniter' in Technorati"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in Technorati" alt="Bookmark 'Integrating PHPList and CodeIgniter' in Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/&amp;t=Integrating+PHPList+and+CodeIgniter" title="Bookmark 'Integrating PHPList and CodeIgniter' in Yahoo My Web"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/yahoo_myweb.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in Yahoo My Web" alt="Bookmark 'Integrating PHPList and CodeIgniter' in Yahoo My Web" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/&amp;title=Integrating+PHPList+and+CodeIgniter" title="Bookmark 'Integrating PHPList and CodeIgniter' in Google Bookmarks"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/google.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in Google Bookmarks" alt="Bookmark 'Integrating PHPList and CodeIgniter' in Google Bookmarks" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="https://favorites.live.com/quickadd.aspx?url=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/&amp;title=Integrating+PHPList+and+CodeIgniter" title="Bookmark 'Integrating PHPList and CodeIgniter' in Live-MSN"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/live.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in Live-MSN" alt="Bookmark 'Integrating PHPList and CodeIgniter' in Live-MSN" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/&amp;t=Integrating+PHPList+and+CodeIgniter" title="Bookmark 'Integrating PHPList and CodeIgniter' in FaceBook"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in FaceBook" alt="Bookmark 'Integrating PHPList and CodeIgniter' in FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Integrating+PHPList+and+CodeIgniter&amp;c=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/" title="Bookmark 'Integrating PHPList and CodeIgniter' in MySpace"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in MySpace" alt="Bookmark 'Integrating PHPList and CodeIgniter' in MySpace" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home?status=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/" title="Bookmark 'Integrating PHPList and CodeIgniter' in Twitter"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/twitter.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in Twitter" alt="Bookmark 'Integrating PHPList and CodeIgniter' in Twitter" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://friendfeed.com/share/bookmarklet/frame#title=Integrating+PHPList+and+CodeIgniter&amp;url=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/" title="Bookmark 'Integrating PHPList and CodeIgniter' in FriendFeed"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/friendfeed.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in FriendFeed" alt="Bookmark 'Integrating PHPList and CodeIgniter' in FriendFeed" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/reader/link?url=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/&amp;title=Integrating+PHPList+and+CodeIgniter&amp;srcURL=http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/" title="Bookmark 'Integrating PHPList and CodeIgniter' in Google Buzz"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/googlebuzz.png" title="Bookmark 'Integrating PHPList and CodeIgniter' in Google Buzz" alt="Bookmark 'Integrating PHPList and CodeIgniter' in Google Buzz" /></a></div>
<!-- Social Bookmarking Reloaded END --><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=yO2vK1nTV3o:gNMxd8zfaNA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=yO2vK1nTV3o:gNMxd8zfaNA:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=yO2vK1nTV3o:gNMxd8zfaNA:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=yO2vK1nTV3o:gNMxd8zfaNA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=yO2vK1nTV3o:gNMxd8zfaNA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=yO2vK1nTV3o:gNMxd8zfaNA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=yO2vK1nTV3o:gNMxd8zfaNA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=yO2vK1nTV3o:gNMxd8zfaNA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=yO2vK1nTV3o:gNMxd8zfaNA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=yO2vK1nTV3o:gNMxd8zfaNA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/GeorgibudinovcomCodeigniter/~4/yO2vK1nTV3o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		<feedburner:origLink>http://georgi.budinov.com/2010/10/integrating-phplist-and-codeigniter/</feedburner:origLink></item>
		<item>
		<title>CodeIgniter and IntelliSense in Eclipse PDT</title>
		<link>http://feedproxy.google.com/~r/GeorgibudinovcomCodeigniter/~3/pTB_-iJhD0k/</link>
		<comments>http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 15:18:33 +0000</pubDate>
		<dc:creator>Georgi Budinov</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Eclipse PDT]]></category>
		<category><![CDATA[IntelliSense]]></category>

		<guid isPermaLink="false">http://georgi.budinov.com/?p=631</guid>
		<description><![CDATA[For those that are not aware, IntelliSense is a feature of the Eclipse IDE, which allows us to quickly inspect the properties of an instantiated object of some type, function parameters, auto-completion, short description, if available and so on. This is incredibly handy when developing applications, no matter the programming language. When developing with CodeIgniter, [...]]]></description>
			<content:encoded><![CDATA[<p>For those that are not aware, IntelliSense is a feature of the Eclipse IDE, which allows us to quickly inspect the properties of an instantiated object of some type, function parameters, auto-completion, short description, if available and so on. This is incredibly handy when developing applications, no matter the programming language. When developing with CodeIgniter, due to the style the framework is written, the IntelliSense is not working.<br />
<span id="more-631"></span> I found a post that describes how you could enable it but I couldn&#8217;t do it &#8211; perhaps it is just me personally that is unable to achieve the goal &#8211; <a title="see here" rel="nofollow" href="http://www.gostomski.co.uk/codeigniter/getting-full-auto-complete-with-codeigniter-in-eclipse">see here</a>.</p>
<p>After some thinking what to do &#8211; I realized that in most of the projects I am extending the Controller class and I am using my own. So in the extended class I just added the variables to the definition + phpdoc style comment. This way I succeeded in enabling the IntelliSense with Eclipse PDT and CodeIgniter&#8217;s main libraries. Here is the code:</p>
<pre class="brush: php;">
&lt;?php
class MY_Controller extends Controller
{
	/**
	 * @var CI_User_agent
	 */
 	var $agent;
	/**
	 * @var CI_Benchmark
	 */
 	var $benchmark;
	/**
	 * @var CI_Calendar
	 */
 	var $calendar;
	/**
	 * @var CI_Cart
	 */
 	var $cart;
	/**
	 * @var CI_Config
	 */
 	var $config;
	/**
	 * @var CI_DB_driver
	 */
 	var $db;
	/**
	 * @var CI_Email
	 */
 	var $email;
	/**
	 * @var CI_Encrypt
	 */
 	var $encrypt;
	/**
	 * @var CI_Form_validation
	 */
 	var $form_validation;
	/**
	 * @var CI_FTP
	 */
 	var $ftp;
	/**
	 * @var CI_Image_lib
	 */
 	var $image_lib;
	/**
	 * @var CI_Input
	 */
 	var $input;
	/**
	 * @var CI_Language
	 */
 	var $lang;
	/**
	 * @var CI_Output
	 */
 	var $output;
	/**
	 * @var CI_Pagination
	 */
 	var $pagination;
	/**
	 * @var CI_Parser
	 */
 	var $parser;
	/**
	 * @var CI_Session
	 */
 	var $session;
	/**
	 * @var CI_Table
	 */
 	var $table;
	/**
	 * @var CI_Trackback
	 */
 	var $trackback;
	/**
	 * @var CI_Typography
	 */
 	var $typography;
	/**
	 * @var CI_Unit_test
	 */
 	var $unit;
	/**
	 * @var CI_Upload
	 */
 	var $upload;
	/**
	 * @var CI_URI
	 */
 	var $uri;
	/**
	 * @var CI_Xmlrpc
	 */
 	var $xmlrpc;
	/**
	 * @var CI_Xmlrpcs
	 */
 	var $xmlrpcs;
	/**
	 * @var CI_Zip
	 */
 	var $zip;
}
?&gt;
</pre>
<p>Note that there is no need to initialize anything, update core classes in the system folder or anything else. Simple as extending the Controller and using it.</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Bookmark It</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/&amp;title=CodeIgniter+and+IntelliSense+in+Eclipse+PDT" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Del.icio.us"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/delicious.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Del.icio.us" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/&amp;title=CodeIgniter+and+IntelliSense+in+Eclipse+PDT" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in digg"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in digg" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Technorati"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Technorati" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/&amp;t=CodeIgniter+and+IntelliSense+in+Eclipse+PDT" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Yahoo My Web"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/yahoo_myweb.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Yahoo My Web" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Yahoo My Web" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/&amp;title=CodeIgniter+and+IntelliSense+in+Eclipse+PDT" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Google Bookmarks"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/google.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Google Bookmarks" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Google Bookmarks" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="https://favorites.live.com/quickadd.aspx?url=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/&amp;title=CodeIgniter+and+IntelliSense+in+Eclipse+PDT" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Live-MSN"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/live.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Live-MSN" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Live-MSN" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/&amp;t=CodeIgniter+and+IntelliSense+in+Eclipse+PDT" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in FaceBook"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in FaceBook" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=CodeIgniter+and+IntelliSense+in+Eclipse+PDT&amp;c=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in MySpace"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in MySpace" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in MySpace" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home?status=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Twitter"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/twitter.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Twitter" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Twitter" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://friendfeed.com/share/bookmarklet/frame#title=CodeIgniter+and+IntelliSense+in+Eclipse+PDT&amp;url=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in FriendFeed"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/friendfeed.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in FriendFeed" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in FriendFeed" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/reader/link?url=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/&amp;title=CodeIgniter+and+IntelliSense+in+Eclipse+PDT&amp;srcURL=http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Google Buzz"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/googlebuzz.png" title="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Google Buzz" alt="Bookmark 'CodeIgniter and IntelliSense in Eclipse PDT' in Google Buzz" /></a></div>
<!-- Social Bookmarking Reloaded END --><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=pTB_-iJhD0k:WXtKy8aMFZo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=pTB_-iJhD0k:WXtKy8aMFZo:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=pTB_-iJhD0k:WXtKy8aMFZo:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=pTB_-iJhD0k:WXtKy8aMFZo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=pTB_-iJhD0k:WXtKy8aMFZo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=pTB_-iJhD0k:WXtKy8aMFZo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=pTB_-iJhD0k:WXtKy8aMFZo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=pTB_-iJhD0k:WXtKy8aMFZo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=pTB_-iJhD0k:WXtKy8aMFZo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=pTB_-iJhD0k:WXtKy8aMFZo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/GeorgibudinovcomCodeigniter/~4/pTB_-iJhD0k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://georgi.budinov.com/2010/08/codeigniter-and-intellisense-in-eclipse-pdt/</feedburner:origLink></item>
		<item>
		<title>CodeIgniter’s language management – improvement</title>
		<link>http://feedproxy.google.com/~r/GeorgibudinovcomCodeigniter/~3/HS6szhkMI24/</link>
		<comments>http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 13:56:00 +0000</pubDate>
		<dc:creator>Georgi Budinov</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[imrovement]]></category>
		<category><![CDATA[language]]></category>

		<guid isPermaLink="false">http://georgi.budinov.com/?p=612</guid>
		<description><![CDATA[Have you ever been annoyed by using the CodeIgniter&#8217;s language/localization functionality? I have been pissed by constantly repeating: echo $this-&#62;lang-&#62;line('sample_label'); So today I found a forum thread in CodeIgniter forums asking about using the language functionality and a shortcut to that language variables. That made me think of some kind of simplification of the code [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever been annoyed by using the CodeIgniter&#8217;s language/localization functionality? I have been pissed by constantly repeating:</p>
<pre class="brush: php;">
echo $this-&gt;lang-&gt;line('sample_label');
</pre>
<p><span id="more-612"></span><br />
So today I found a forum thread in CodeIgniter forums asking about using the language functionality and a shortcut to that language variables. That made me think of some kind of simplification of the code that we all use. So what I did was just small improvement in the Loader class &#8211; specifically the view function. I created  MY_Loader file in libraries folder and put simply these contents:</p>
<pre class="brush: php;">
&lt;?php
class MY_Loader extends CI_Loader
{
 /**
 * Load View
 *
 * This function is used to load a &quot;view&quot; file.  It has three parameters:
 *
 * 1. The name of the &quot;view&quot; file to be included.
 * 2. An associative array of data to be extracted for use in the view.
 * 3. TRUE/FALSE - whether to return the data or load it.  In
 * some cases it's advantageous to be able to return data so that
 * a developer can process it in some way.
 *
 * @access    public
 * @param    string
 * @param    array
 * @param    bool
 * @return    void
 */
 function view($view, $vars = array(), $return = FALSE)
 {
     $vars = $this-&gt;_ci_object_to_array($vars);
     $CI =&amp; get_instance();
     $vars['lang'] = &amp;$CI-&gt;lang-&gt;language;
     return $this-&gt;_ci_load(array('_ci_view' =&gt; $view, '_ci_vars' =&gt; $this-&gt;_ci_object_to_array($vars),
     '_ci_return' =&gt; $return));
  }
}
?&gt;
</pre>
<p>This way I could just use the $lang array in the view like this:</p>
<pre class="brush: php;">
$lang['sample_label']
</pre>
<p>UPDATE:<br />
Sorry for messing this &#8230; I found out that in the lang helper<br />
of CodeIgniter there is a magic function I have never been aware of -&gt; lang(&#8216;language key&#8217;)</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Bookmark It</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/&amp;title=CodeIgniter%26%238217%3Bs+language+management+%26%238211%3B+improvement" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Del.icio.us"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/delicious.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Del.icio.us" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/&amp;title=CodeIgniter%26%238217%3Bs+language+management+%26%238211%3B+improvement" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in digg"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in digg" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Technorati"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Technorati" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/&amp;t=CodeIgniter%26%238217%3Bs+language+management+%26%238211%3B+improvement" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Yahoo My Web"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/yahoo_myweb.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Yahoo My Web" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Yahoo My Web" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/&amp;title=CodeIgniter%26%238217%3Bs+language+management+%26%238211%3B+improvement" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Google Bookmarks"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/google.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Google Bookmarks" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Google Bookmarks" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="https://favorites.live.com/quickadd.aspx?url=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/&amp;title=CodeIgniter%26%238217%3Bs+language+management+%26%238211%3B+improvement" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Live-MSN"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/live.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Live-MSN" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Live-MSN" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/&amp;t=CodeIgniter%26%238217%3Bs+language+management+%26%238211%3B+improvement" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in FaceBook"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in FaceBook" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=CodeIgniter%26%238217%3Bs+language+management+%26%238211%3B+improvement&amp;c=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in MySpace"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in MySpace" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in MySpace" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home?status=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Twitter"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/twitter.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Twitter" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Twitter" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://friendfeed.com/share/bookmarklet/frame#title=CodeIgniter%26%238217%3Bs+language+management+%26%238211%3B+improvement&amp;url=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in FriendFeed"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/friendfeed.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in FriendFeed" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in FriendFeed" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/reader/link?url=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/&amp;title=CodeIgniter%26%238217%3Bs+language+management+%26%238211%3B+improvement&amp;srcURL=http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Google Buzz"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/googlebuzz.png" title="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Google Buzz" alt="Bookmark 'CodeIgniter&#8217;s language management &#8211; improvement' in Google Buzz" /></a></div>
<!-- Social Bookmarking Reloaded END --><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=HS6szhkMI24:ulvqULnoiC4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=HS6szhkMI24:ulvqULnoiC4:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=HS6szhkMI24:ulvqULnoiC4:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=HS6szhkMI24:ulvqULnoiC4:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=HS6szhkMI24:ulvqULnoiC4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=HS6szhkMI24:ulvqULnoiC4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=HS6szhkMI24:ulvqULnoiC4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=HS6szhkMI24:ulvqULnoiC4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=HS6szhkMI24:ulvqULnoiC4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=HS6szhkMI24:ulvqULnoiC4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/GeorgibudinovcomCodeigniter/~4/HS6szhkMI24" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://georgi.budinov.com/2010/08/codeigniters-language-management-improvement/</feedburner:origLink></item>
		<item>
		<title>Managing multiple application folders with one index.php</title>
		<link>http://feedproxy.google.com/~r/GeorgibudinovcomCodeigniter/~3/i2da7Yp93Tk/</link>
		<comments>http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 22:54:09 +0000</pubDate>
		<dc:creator>Georgi Budinov</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://georgi.budinov.com/?p=401</guid>
		<description><![CDATA[There was a question in the CodeIgniter forums about management of multiple application folders using just one index.php. I was interested in that so got deeper in the problem and tried to resolve that. I found a solution and this was mode_rewrite. Actually I applied a technique that I have never used before &#8211; setting [...]]]></description>
			<content:encoded><![CDATA[<p>There was a question in the CodeIgniter forums about management of multiple<br />
application folders using just one index.php. I was interested in that so<br />
got deeper in the problem and tried to resolve that. I found a solution and<br />
this was mode_rewrite. Actually I applied a technique that I have never used<br />
before &#8211; setting environment variables using htaccess and mod_rewrite. Here<br />
is what exactly I did:<br />
<span id="more-401"></span><br />
.htaccess file:</p>
<pre class="brush: plain;">
RewriteEngine on

RewriteCond $1 !^(index\.php)
RewriteRule ^([^/]+)/(.*)?$ - [E=PATH_APPLICATION:$1,NE]

RewriteCond $1 !^(index\.php)
RewriteRule ^([^/]+)/(.*)?$ /index.php?/$2 [L]
</pre>
<p>Using this .htaccess file I manage the hiding of the index.php file and the most<br />
interesting part is setting the environment variable REDIRECT_PATH_APPLICATION<br />
with the first segment of the accessed uri. So in the index.php I can access<br />
$_SERVER['REDIRECT_PATH_APPLICATION'] which holds the first segment. This segment<br />
shows me where is the application folder I need to use with this request. So<br />
in the index.php I have the following:</p>
<pre class="brush: php;">

$application_folder = &quot;/var/www/&quot;.$_SERVER['REDIRECT_PATH_APPLICATION'];
</pre>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Bookmark It</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/&amp;title=Managing+multiple+application+folders+with+one+index.php" title="Bookmark 'Managing multiple application folders with one index.php' in Del.icio.us"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/delicious.png" title="Bookmark 'Managing multiple application folders with one index.php' in Del.icio.us" alt="Bookmark 'Managing multiple application folders with one index.php' in Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/&amp;title=Managing+multiple+application+folders+with+one+index.php" title="Bookmark 'Managing multiple application folders with one index.php' in digg"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Bookmark 'Managing multiple application folders with one index.php' in digg" alt="Bookmark 'Managing multiple application folders with one index.php' in digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/" title="Bookmark 'Managing multiple application folders with one index.php' in Technorati"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Bookmark 'Managing multiple application folders with one index.php' in Technorati" alt="Bookmark 'Managing multiple application folders with one index.php' in Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/&amp;t=Managing+multiple+application+folders+with+one+index.php" title="Bookmark 'Managing multiple application folders with one index.php' in Yahoo My Web"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/yahoo_myweb.png" title="Bookmark 'Managing multiple application folders with one index.php' in Yahoo My Web" alt="Bookmark 'Managing multiple application folders with one index.php' in Yahoo My Web" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/&amp;title=Managing+multiple+application+folders+with+one+index.php" title="Bookmark 'Managing multiple application folders with one index.php' in Google Bookmarks"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/google.png" title="Bookmark 'Managing multiple application folders with one index.php' in Google Bookmarks" alt="Bookmark 'Managing multiple application folders with one index.php' in Google Bookmarks" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="https://favorites.live.com/quickadd.aspx?url=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/&amp;title=Managing+multiple+application+folders+with+one+index.php" title="Bookmark 'Managing multiple application folders with one index.php' in Live-MSN"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/live.png" title="Bookmark 'Managing multiple application folders with one index.php' in Live-MSN" alt="Bookmark 'Managing multiple application folders with one index.php' in Live-MSN" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/&amp;t=Managing+multiple+application+folders+with+one+index.php" title="Bookmark 'Managing multiple application folders with one index.php' in FaceBook"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Bookmark 'Managing multiple application folders with one index.php' in FaceBook" alt="Bookmark 'Managing multiple application folders with one index.php' in FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Managing+multiple+application+folders+with+one+index.php&amp;c=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/" title="Bookmark 'Managing multiple application folders with one index.php' in MySpace"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Bookmark 'Managing multiple application folders with one index.php' in MySpace" alt="Bookmark 'Managing multiple application folders with one index.php' in MySpace" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home?status=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/" title="Bookmark 'Managing multiple application folders with one index.php' in Twitter"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/twitter.png" title="Bookmark 'Managing multiple application folders with one index.php' in Twitter" alt="Bookmark 'Managing multiple application folders with one index.php' in Twitter" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://friendfeed.com/share/bookmarklet/frame#title=Managing+multiple+application+folders+with+one+index.php&amp;url=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/" title="Bookmark 'Managing multiple application folders with one index.php' in FriendFeed"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/friendfeed.png" title="Bookmark 'Managing multiple application folders with one index.php' in FriendFeed" alt="Bookmark 'Managing multiple application folders with one index.php' in FriendFeed" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/reader/link?url=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/&amp;title=Managing+multiple+application+folders+with+one+index.php&amp;srcURL=http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/" title="Bookmark 'Managing multiple application folders with one index.php' in Google Buzz"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/googlebuzz.png" title="Bookmark 'Managing multiple application folders with one index.php' in Google Buzz" alt="Bookmark 'Managing multiple application folders with one index.php' in Google Buzz" /></a></div>
<!-- Social Bookmarking Reloaded END --><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=i2da7Yp93Tk:_T_GcxizxPo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=i2da7Yp93Tk:_T_GcxizxPo:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=i2da7Yp93Tk:_T_GcxizxPo:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=i2da7Yp93Tk:_T_GcxizxPo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=i2da7Yp93Tk:_T_GcxizxPo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=i2da7Yp93Tk:_T_GcxizxPo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=i2da7Yp93Tk:_T_GcxizxPo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=i2da7Yp93Tk:_T_GcxizxPo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=i2da7Yp93Tk:_T_GcxizxPo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=i2da7Yp93Tk:_T_GcxizxPo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/GeorgibudinovcomCodeigniter/~4/i2da7Yp93Tk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://georgi.budinov.com/2010/06/managing-multiple-application-folders-with-one-index-php/</feedburner:origLink></item>
		<item>
		<title>Integrating phpbb in a website based on CodeIgniter</title>
		<link>http://feedproxy.google.com/~r/GeorgibudinovcomCodeigniter/~3/dJBEhyAgTyE/</link>
		<comments>http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 20:19:58 +0000</pubDate>
		<dc:creator>Georgi Budinov</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[integration]]></category>

		<guid isPermaLink="false">http://georgi.budinov.com/?p=283</guid>
		<description><![CDATA[I have noticed that at the community forums of CodeIgniter there are a lot of questions on integrating phpbb in a code ignited web site. However there is one library posted in the forums &#8211; here,  but it didn&#8217;t fulfill my needs. Actually the only thing that was usefull for me is the login part, [...]]]></description>
			<content:encoded><![CDATA[<p>I have noticed that at the community forums of CodeIgniter there are a lot of questions on integrating phpbb in a code ignited web site. However there is one library posted in the forums &#8211; <a rel="nofollow" href="http://codeigniter.com/forums/viewthread/125350/" target="_blank">here</a>,  but it didn&#8217;t fulfill my needs. Actually the only thing that was usefull for me is the login part, e.g. the constructor. It is pretty much the same so here I should thank Tomaž Muraus for that lead. My additions to it are the rest usefull functions. So I gave it a try and created a very simple library for CodeIgniter that manages remote login, remote user add, remote user edit (password change) and remote user delete. I will post it here and will cut it a little because the current state has some additional programming related to the project I did it for.<br />
<span id="more-283"></span></p>
<pre class="brush: php;">
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
* CodeIgniter phpBB3 Bridge
* @author Georgi Budinov, credits to Tomaž Muraus at http://www.tomaz-muraus.info
* @link georgi.budinov.com
*/
class Phpbb_bridge
{
 public $CI;
 protected $_user;

 /**
 * Constructor.
 */
 public function __construct()
 {
   if (!isset($this-&gt;CI))
   {
     $this-&gt;CI =&amp; get_instance();
   }

   // Set the variables scope
   global $phpbb_root_path, $phpEx, $user, $auth, $cache, $db, $config, $template, $table_prefix;

   $rootPath = $this-&gt;CI-&gt;config-&gt;item('root_path');

   define('IN_PHPBB', TRUE);
   define('FORUM_ROOT_PATH', $rootPath.'forum/');

   $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : FORUM_ROOT_PATH;
   $phpEx = substr(strrchr(__FILE__, '.'), 1);

   // Include needed files
   include($phpbb_root_path . 'common.' . $phpEx);
   include($phpbb_root_path . 'config.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);

   // Initialize phpBB user session
   $user-&gt;session_begin();

   $auth-&gt;acl($user-&gt;data);
   $user-&gt;setup();

   // Save user data into $_user variable
   $this-&gt;_user = $user;
 }

 /**
 * @param $email
 * @param $username
 * @param $password
 * @return unknown_type&lt;/pre&gt;
 */
 public function user_add($email, $username, $password)
 {
   $user_row = array(
     'username'              =&gt; $username,
     'user_password'         =&gt; phpbb_hash($password),
     'user_email'            =&gt; $email,
     'group_id'              =&gt; 2, // by default, the REGISTERED user group is id 2
     'user_timezone'         =&gt; (float) date('T'),
     'user_lang'             =&gt; 'bg',
     'user_type'             =&gt; USER_NORMAL,
     'user_ip'               =&gt; $_SERVER['REMOTE_ADDR'],
     'user_regdate'          =&gt; time(),
   );

   return user_add($user_row, false);
 }

 /**
 * @param $username
 * @param $password
 * @return bool
 */
 public function user_edit($username, $password)
 {
   return user_edit($username, $password);
 }

 /*
 * Logins the user in forum
 */
 public function user_login($username, $password)
 {
   $auth = new auth();

   return $auth-&gt;login($username, $password);
 }

 public function user_logout()
 {
   $this-&gt;_user-&gt;session_kill();
   $this-&gt;_user-&gt;session_begin();
 }

 /**
 * @param $user_id
 * @return unknown_type
 */
 public function user_delete($user_id)
 {
   return user_delete('remove', $user_id, false);
 }
}
</pre>
<p>One more thing to add here: the user_edit function is not available in phpbb3 so I defined one in includes/functions_user.php:</p>
<pre class="brush: php;">
/**
* Change password
*
* @param string $username
* @param string $newPassword
* @return boolean
*/
function user_edit($username, $newPassword)
{
 global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;

 if (empty($username) || empty($newPassword))
 {
   return false;
 }

 $sql = 'UPDATE ' . USERS_TABLE . ' SET user_password=\'' . $db-&gt;sql_escape(md5($newPassword)) . '\' WHERE username = \''.$db-&gt;sql_escape($username).'\'';
 $db-&gt;sql_query($sql);

 return true;
}
</pre>
<p>And last but not least you will have to decide wich way to go &#8230; there is duplication of the function redirect. I replaced it in the CodeIgniter framework as it was easier for me.<br />
Enjoy!</p>
<p>UPDATE 1:</p>
<p>For versions of PHPBB greater or equal than 3.0.8. you must change the cache class name from cache to cache_phpbb. The files that need changes are:</p>
<p>./common.php , ./style.php , ./download/file.php and ./includes/cache.php</p>
<p>UPDATE 2:</p>
<p>In order to run the library correctly you must choose a different connection driver for the database from the one chosen for CI. For example mysql for CI and mysqli for PHPBB (set up in  ./config.php)</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Bookmark It</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/&amp;title=Integrating+phpbb+in+a+website+based+on+CodeIgniter" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Del.icio.us"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/delicious.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Del.icio.us" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Del.icio.us" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/&amp;title=Integrating+phpbb+in+a+website+based+on+CodeIgniter" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in digg"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in digg" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Technorati"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Technorati" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/&amp;t=Integrating+phpbb+in+a+website+based+on+CodeIgniter" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Yahoo My Web"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/yahoo_myweb.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Yahoo My Web" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Yahoo My Web" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/&amp;title=Integrating+phpbb+in+a+website+based+on+CodeIgniter" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Google Bookmarks"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/google.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Google Bookmarks" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Google Bookmarks" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="https://favorites.live.com/quickadd.aspx?url=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/&amp;title=Integrating+phpbb+in+a+website+based+on+CodeIgniter" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Live-MSN"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/live.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Live-MSN" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Live-MSN" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/&amp;t=Integrating+phpbb+in+a+website+based+on+CodeIgniter" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in FaceBook"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in FaceBook" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Integrating+phpbb+in+a+website+based+on+CodeIgniter&amp;c=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in MySpace"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in MySpace" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in MySpace" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home?status=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Twitter"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/twitter.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Twitter" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Twitter" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://friendfeed.com/share/bookmarklet/frame#title=Integrating+phpbb+in+a+website+based+on+CodeIgniter&amp;url=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in FriendFeed"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/friendfeed.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in FriendFeed" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in FriendFeed" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/reader/link?url=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/&amp;title=Integrating+phpbb+in+a+website+based+on+CodeIgniter&amp;srcURL=http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Google Buzz"><img src="http://georgi.budinov.com/wp-content/plugins/social-bookmarking-reloaded/googlebuzz.png" title="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Google Buzz" alt="Bookmark 'Integrating phpbb in a website based on CodeIgniter' in Google Buzz" /></a></div>
<!-- Social Bookmarking Reloaded END --><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=dJBEhyAgTyE:81VTXtCb5Jo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=dJBEhyAgTyE:81VTXtCb5Jo:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=dJBEhyAgTyE:81VTXtCb5Jo:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=dJBEhyAgTyE:81VTXtCb5Jo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=dJBEhyAgTyE:81VTXtCb5Jo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=dJBEhyAgTyE:81VTXtCb5Jo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=dJBEhyAgTyE:81VTXtCb5Jo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=dJBEhyAgTyE:81VTXtCb5Jo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?i=dJBEhyAgTyE:81VTXtCb5Jo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?a=dJBEhyAgTyE:81VTXtCb5Jo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/GeorgibudinovcomCodeigniter?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/GeorgibudinovcomCodeigniter/~4/dJBEhyAgTyE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://georgi.budinov.com/2010/06/integrating-phpbb-in-a-website-based-on-codeigniter/</feedburner:origLink></item>
	</channel>
</rss>

