<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Just Another Developer&#039;s Blog</title>
	<atom:link href="http://jadb.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jadb.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 28 Jan 2012 08:33:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jadb.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Just Another Developer&#039;s Blog</title>
		<link>http://jadb.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jadb.wordpress.com/osd.xml" title="Just Another Developer&#039;s Blog" />
	<atom:link rel='hub' href='http://jadb.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Migrate CodeIgniter app to ExpressionEngine</title>
		<link>http://jadb.wordpress.com/2011/11/15/migrate-codeigniter-app-to-expressionengine/</link>
		<comments>http://jadb.wordpress.com/2011/11/15/migrate-codeigniter-app-to-expressionengine/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 14:56:52 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[ExpressionEngine]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[EE]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=236</guid>
		<description><![CDATA[This guide will help you port your application to ExpressionEngine. If you don&#8217;t know, ExpressionEngine is a CMS built on CodeIgniter. Being built on CI makes it easy to write Web Apps using pure CodeIgniter framework, and then port it to EE with few changes. To start off, you need to create an EE module. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=236&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This guide will help you port your application to ExpressionEngine. If you don&#8217;t know, ExpressionEngine is a CMS built on CodeIgniter. Being built on CI makes it easy to write Web Apps using pure CodeIgniter framework, and then port it to EE with few changes.</p>
<p>To start off, you need to create an EE module. The module consists of the following structure:</p>
<ul>
<li>module_name
<ul>
<li>language
<ul>
<li>english
<ul>
<li>lang.module_name.php</li>
</ul>
</li>
</ul>
</li>
<li>models</li>
<li>mcp.module_name.php</li>
<li>mod.module_name.php</li>
<li>upd.module_name.php</li>
</ul>
</li>
</ul>
<div>Replace module_name with your module&#8217;s name with all letters in lowercase.</div>
<p>Inside lang.module_name.php:</p>
<blockquote>
<div>
<pre>&lt;?php
$lang = array(

"events_module_name" 		=&gt; 'Your module name here',
"events_module_description" 	=&gt; 'A description to your module',
);
?&gt;</pre>
</div>
</blockquote>
<div>
<p>Inside mcp.module_name.php</p>
<blockquote>
<pre>&lt;?php

class Events_mcp { 

	function __construct()
	{
		$this-&gt;EE =&amp; get_instance();
	}
}
?&gt;</pre>
</blockquote>
<p>Inside upd.module_name.php</p>
<blockquote>
<pre>&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class ModuleName_upd { 

    var $version = '1.0'; 

    function __construct()
    {
		// Make a local reference to the ExpressionEngine super object
		$this-&gt;EE =&amp; get_instance();
    }

    function install()
    {
	$this-&gt;EE-&gt;load-&gt;dbforge();

	$data = array(
		'module_name' =&gt; 'ModuleName' ,
		'module_version' =&gt; $this-&gt;version,
		'has_cp_backend' =&gt; 'n',
		'has_publish_fields' =&gt; 'y'
	);
	$this-&gt;EE-&gt;db-&gt;insert('modules', $data);
     }

    function uninstall()
    {
	return TRUE;
    }

    function update($current = '')
    {
	return FALSE;
    }

}</pre>
</blockquote>
<p>And finally inside mod.module_name.php:</p>
<blockquote>
<pre>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class ModuleName {
	function __construct()
	{
                // Make a local reference to the ExpressionEngine super object
		$this-&gt;EE =&amp; get_instance();
	}</pre>
</blockquote>
<p>Now place this folder inside &#8220;/expressionengine/third_party/&#8221;. If everything was done correctly your module should appear in EE&#8217;s module manager.</p>
<div id="attachment_244" class="wp-caption aligncenter" style="width: 932px"><a href="http://jadb.files.wordpress.com/2011/11/moduleman_ready.png"><img class="size-large wp-image-244 " title="moduleman_ready" src="http://jadb.files.wordpress.com/2011/11/moduleman_ready.png?w=922&#038;h=206" alt="module manager" width="922" height="206" /></a><p class="wp-caption-text">Module Manager</p></div>
<p>This is the first step in porting your existing CI application to EE. Next step is to put your actual code in the correct way. Briefly, the EE module corresponds to oridinary CI files as follows:</p>
<ul>
<li>models  folder in EE corresponds to models folder in CI</li>
<li>mod.module_name.php corresponds to a single CI controller</li>
<li>Views in CI correspond to templates in EE</li>
</ul>
<h2>Models:</h2>
<p>There are no required changes  to do if you want to use your CI models in EE. Just places them inside your module&#8217;s model folder under EE and they&#8217;re going to be available for you to load and use.</p>
<h2>Controllers:</h2>
<p>Your CI controller code should be placed inside <strong>mod.module_name.php</strong> under EE.  The controller code is not a simple copy and paste though to work. The first problem is the &#8220;<strong>load</strong>&#8221; function not being accessible from your new controller file (well since it&#8217;s not a normal CI controller). To have access to this function and others as usual, you&#8217;ll have to get instance of the CI object which would expose these functions for you to use. So the constructor should look like the following:</p>
<p>mod.module_name.php:</p>
<blockquote>
<pre>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class ModuleName {
	function __construct()
	{
		// Make a local reference to the ExpressionEngine super object
		$this-&gt;EE =&amp; get_instance();
	}
}
?&gt;</pre>
</blockquote>
<p>Now replace every call to <strong>$this-&gt;load() </strong>with <strong>$this-&gt;EE-&gt;load()</strong>. Same goes for loaded models and libraries. For example:</p>
<blockquote>
<pre>function addpost()
{
	$this-&gt;EE-&gt;load-&gt;helper('url');
	$this-&gt;EE-&gt;load-&gt;helper('form');
	$this-&gt;EE-&gt;load-&gt;library('form_validation');
	$this-&gt;EE-&gt;form_validation
		-&gt;set_rules('post_title', 'Post Title', 'required|max_length[100]|trim|xss_clean');
}</pre>
</blockquote>
<p>At the end of each function you will not load a view. This is because we will be dealing with EE&#8217;s templates which works pretty much differently than a normal View.</p>
<p>In CodeIgniter, usually at the end of the function you&#8217;d call a view and pass some data to be rendered by that view. In EE however, templates and controllers work differently. Instead of calling a controller function which loads a view, you call an EE template which calls zero or more functions from the EE controller file (mod.module_name.php). The template also expects the data to be returned in a specific format that you&#8217;ll be forced to change your functions returned values to match that format. I&#8217;ll use an example of  a Blog module for more clarification</p>
<p>Assume we want fetch all posts and comments from the database and display them in a template.  Normally in  CI controller functions we would it in a single function, and pass it to the view to handle. But given the way templates in EE work where you directly call as much controller functions as you want from it, we have the following options:</p>
<ul>
<li>Either break up the function into two, posts in one function and comments in other, each will be solely called from the template.</li>
<li>Have both posts and their comments placed in one array, which is returned to the template upon the controller function call.</li>
</ul>
<div>I&#8217;ll go with the first approach since it&#8217;s simpler.</div>
<div>mod.posts.php:</div>
<div>
<blockquote>
<pre>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class ModuleName {
	function __construct()
	{
		// Make a local reference to the ExpressionEngine super object
		$this-&gt;EE =&amp; get_instance();
	}

        function get_posts()
	{
		$this-&gt;EE-&gt;load-&gt;model('post');
		$this-&gt;EE-&gt;post-&gt;db-&gt;order_by('post_id', 'asc');
		$output_data = $this-&gt;EE-&gt;post-&gt;db-&gt;get('posts')-&gt;result();
		return $this-&gt;format_output($output_data);
	}
        function get_comments()
	{
                $post_id = $this-&gt;EE-&gt;TMPL-&gt;fetch_param('post_id');
		$this-&gt;EE-&gt;load-&gt;model('comment');
		$output_data = $this-&gt;EE-&gt;comment-&gt;db-&gt;get_where('post_id',$post_id)-&gt;result();
		return $this-&gt;format_output($output_data);
	}
}
?&gt;</pre>
</blockquote>
</div>
<p>Notice that the way we&#8217;re fetching posts and comments from the database is the normal CI way.  The main different things here is the first and last lines in <strong>get_comments</strong> function and their similarities in <strong>get_posts</strong>.  We&#8217;ll talk about the <strong>format_output </strong>function first.</p>
<p>As I previously mentioned, EE templates expects the function output to be formatted in a specific way. Normally you have only to call</p>
<blockquote><p>return $this-&gt;EE-&gt;TMPL-&gt;parse_variables($this-&gt;EE-&gt;TMPL-&gt;tagdata, $output_data);</p></blockquote>
<p>However, this only works given that <strong>$output_data </strong>is a multidimensional associative array.  If you are fetching data from database this way, then you&#8217;ll have to convert them to associative arrays since they are returned in form of an array of objects (should be an array of arrays) before passing it to <strong>parse_variables</strong> function. With quick dirty work I wrote a simple function that takes care of this, for 2 levels deep at most:</p>
<blockquote>
<pre>function format_output($objects)
{
	//prepares the data to be be used by templates
	//2 LEVEL PARSING ONLY!
	$values = array();

	foreach($objects as $o)
	{
		$vars = get_object_vars($o);
		$tmp = array();

		foreach($vars as $v=&gt;$val)
		{
			if(gettype($o-&gt;$v) == 'object')
			{
				$subvars = get_object_vars($o-&gt;$v);
				$subtmp = array();

				foreach($subvars as $subv=&gt;$subval)
				{
					$keyname = $subv=="id"?$v."_id":$subv;
					$subtmp[$keyname]=$o-&gt;$v-&gt;$subv;
				}
				$tmp[$v]=array(0=&gt;$subtmp);
			}
			else
				$tmp[$v]=$o-&gt;$v;
			}
			$values[]=$tmp;
		}
		$output = $this-&gt;EE-&gt;TMPL-&gt;parse_variables($this-&gt;EE-&gt;TMPL-&gt;tagdata, $values);
		return $output;
	}</pre>
</blockquote>
<h2>EE Template</h2>
<p>Now create a new template that would display blog posts and their comments:</p>
<blockquote>
<pre>{exp:posts:get_posts}
	&lt;h2&gt;{post_title}:&lt;/h2&gt;
	&lt;p&gt;{post_body}&lt;/p&gt;

	&lt;h3&gt;Comments:&lt;/h3&gt;

	{exp:posts:get_comments post_id={post_id}}
		&lt;p id="{comment_id}"&gt;{comment_content}&lt;/p&gt;
	{/exp:posts:get_comments}
{/exp:posts:get_posts}</pre>
</blockquote>
<p>For more information about EE modules check out this <a href="http://expressionengine.com/user_guide/development/module_tutorial.html" target="_blank">Module Tutorial</a> on EE&#8217;s userguide.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/236/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=236&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2011/11/15/migrate-codeigniter-app-to-expressionengine/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>

		<media:content url="http://jadb.files.wordpress.com/2011/11/moduleman_ready.png?w=1024" medium="image">
			<media:title type="html">moduleman_ready</media:title>
		</media:content>
	</item>
		<item>
		<title>Chromium open in folder issue</title>
		<link>http://jadb.wordpress.com/2011/11/12/chromium-open-in-folder-issue/</link>
		<comments>http://jadb.wordpress.com/2011/11/12/chromium-open-in-folder-issue/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 19:49:02 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Chromium]]></category>
		<category><![CDATA[fluxbox]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[lxde]]></category>
		<category><![CDATA[xfce]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=239</guid>
		<description><![CDATA[I noticed when I download a file on chromium then try to open it or open its folder by clicking &#8220;Open in folder&#8221;,  it just opens in firefox anyway. Tracing the problem I found chromium invokes xdg-open, which is an application launcher. It&#8217;s actually a generic application launcher that tries to detect your current desktop [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=239&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I noticed when I download a file on chromium then try to open it or open its folder by clicking &#8220;Open in folder&#8221;,  it just opens in firefox anyway. Tracing the problem I found chromium invokes <strong>xdg-open</strong>, which is an application launcher. It&#8217;s actually a generic application launcher that tries to detect your current desktop environment and passes the call to this DE&#8217;s application launcher. So if you&#8217;re using gnome, xdg-open would eventually direct your request to <strong>gnome-open</strong>. The problem comes when you&#8217;re using a DE not familiar to the script (Fluxbox in my case). The script recognizes only Gnome, KDE, LXDE, Xfce. If your DE is not in those, then <strong>xdg-open</strong> falls back to a default handler which seems to be the Internet browser.</p>
<p>Luckily in my case I have <strong>gnome-open</strong> and <strong>exo-open</strong> installed as they were pulled in when I installed some gnome and xfce apps.  To force <strong>xdg-open</strong> to use one of them (assume <strong>exo-open</strong>), you&#8217;ll have to trick<strong> xdg-open</strong> into thinking you have xfce as your DE. To do so, just edit the <strong>xdg-open </strong>script:</p>
<blockquote><p>sudo vim /usr/bin/xdg-open</p></blockquote>
<p>find the line containing the function called &#8220;detectDE&#8221;. At the very bottom of the function and before the closing braces just add:</p>
<blockquote><p>DE=xfce;</p></blockquote>
<p>Also possible values (gnome,lxde,kde) depending on the launcher you have. Now whenever xdg-open is run (by chromium or whatever) it will treat my DE as if it&#8217;s xfce and directs the call to <strong>exo-open. </strong>To further edit the preferred applications that exo-open runs, just run <strong>exo-preferred-applications</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/239/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=239&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2011/11/12/chromium-open-in-folder-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>
	</item>
		<item>
		<title>Social Engine 4: Modules</title>
		<link>http://jadb.wordpress.com/2011/04/22/social-engine-4-modules/</link>
		<comments>http://jadb.wordpress.com/2011/04/22/social-engine-4-modules/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 14:50:43 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SocialEngine]]></category>
		<category><![CDATA[socialengine]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[guide]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=208</guid>
		<description><![CDATA[Basically when you are developing for Social Engine, the best approach you&#8217;d take is to try as much as possible not to modify the pre-existing modules. That is because whenever a new SocialEngine update has been released, you&#8217;ll find hard time porting your changes to the new update. Not to mention the risk of messing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=208&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p>Basically when you are developing for Social Engine, the best approach you&#8217;d take is to try as much as possible not to modify the pre-existing modules. That is because whenever a new SocialEngine update has been released, you&#8217;ll find hard time porting your changes to the new update. Not to mention the risk of messing up a pre-existing SE code.</p>
<p>Luckily Social Engine follows a Modular design pattern. That is,  according to Wikipedia:</p>
<blockquote><p><strong>Modular programming</strong> is a software design technique that increases the extent to which software is composed of separate, interchangeable components, called <strong>modules</strong> by breaking down program functions into modules, each of which accomplishes one function and contains everything necessary to accomplish this</p></blockquote>
<p>Modules in SocialEngine are found in &#8220;<strong>/application/modules/&#8221;</strong>.  You&#8217;ll find a nice bunch of pre-existing modules that constitute SocialEngine functionality.</p>
<p>So how do you create a module? There is a nice process that takes takes care of creating the basic module structure and makes it already part of the application. The process consists of 3 parts:</p>
<ol>
<li>Creating the module</li>
<li>Installing the module</li>
<li>Building the module</li>
</ol>
<div style="text-align:center;">&#8212;&#8211;</div>
<p style="text-align:center;"><span style="color:#ff0000;"><strong>This is not an official guide on how to create a module for SE, these steps I just discovered them while playing around with SE and this is what I actually do to create a module. I hope they become helpful to you <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></span></p>
<p style="text-align:center;"> &#8212;&#8212;</p>
<h2><strong>Creating the module:</strong></h2>
<ol>
<li>First off, head to your website, and login with a user who has admin privileges.</li>
<li>We need the Package Manager, so go to this link after you login: <em><strong>http://&lt;SOCIAL_ENGINE_ADDR&gt;/install/manage</strong></em>, replacing of course &lt;SOCIAL_ENGINE_ADDR&gt; with the correct one. Inside the package manager you&#8217;ll find different installed modules, and you can enable/ disable them as you wish.</li>
<li>Switch to Developer SDK Tab and click on Create a Package</li>
<li>As you see Social Engine can setup for you any type of package you might need. In our case we&#8217;d select package of type <strong>Module</strong>. Complete the rest of required fields and hit &#8220;<strong>Create Package</strong>&#8221; button.</li>
</ol>
<div>
<div id="attachment_210" class="wp-caption aligncenter" style="width: 208px"><a href="http://jadb.files.wordpress.com/2011/04/createpackage.png"><img class="size-medium wp-image-210" title="Createpackage" src="http://jadb.files.wordpress.com/2011/04/createpackage.png?w=198&#038;h=300" alt="Createpackage" width="198" height="300" /></a><p class="wp-caption-text">Create Package form</p></div>
</div>
<p>By now you&#8217;ll have a compressed archive downloaded. If you look into it you&#8217;ll find the basic module file structure has been created for you. So next step is to actually make that module part of Social Engine so that you could start working on it and preview the changes immediately.</p>
<p style="text-align:center;"> &#8212;&#8212;</p>
<h2><strong>Installing the module:</strong></h2>
<p>Head again to <em><strong>http://&lt;SOCIAL_ENGINE_ADDR&gt;/install/manage</strong></em>, and click on <strong>Install New Packages</strong> link. The process of installing a new package consists of several automated steps. You just need to specify the package to install (which is the one downloaded from the previous steps), and the Step called &#8220;<strong>Enter FTP Info</strong>&#8220;. If Social Engine is running on your local server (the actual computer that you&#8217;re developing on), then you could just choose &#8220;<strong>None</strong>&#8221; for the <strong>FTP Connection Type</strong>, put in the Path to SE (it should be already there though) and mark &#8220;<strong>Search for SocialEngine Path</strong>&#8220;. Otherwise you&#8217;ll have to fill up the FTP connection fields.</p>
<div id="attachment_213" class="wp-caption aligncenter" style="width: 310px"><a href="http://jadb.files.wordpress.com/2011/04/ftp.png"><img class="size-medium wp-image-213" title="ftp" src="http://jadb.files.wordpress.com/2011/04/ftp.png?w=300&#038;h=168" alt="FTP Info" width="300" height="168" /></a><p class="wp-caption-text">FTP Fields</p></div>
<p>Then keep hitting continue until you&#8217;re done. You should get message like this in the end:</p>
<p><a href="http://jadb.files.wordpress.com/2011/04/done1.png"><img class="aligncenter size-full wp-image-215" title="done" src="http://jadb.files.wordpress.com/2011/04/done1.png?w=510&#038;h=42" alt="Successfully installed package" width="510" height="42" /></a></p>
<p>So now you&#8217;ve got you&#8217;re package created, installed and enabled in your SocialEngine application. You&#8217;ll find your module has appeared in SE&#8217;s modules folder and you can now modify it as you wish. If you&#8217;re still getting started with SocialEngine, these guides might be useful as well:</p>
<ul>
<li><a title="SocialEngine 4: Create a Widget (Updated)" href="http://jadb.wordpress.com/2011/01/17/socialengine-4-create-a-widget/">Creating a Widget</a></li>
<li><a title="Social Engine 4: Model" href="http://jadb.wordpress.com/2011/01/23/social-engine-4-model/">Creating a Model</a></li>
<li><a title="Social Engine 4: Controllers" href="http://jadb.wordpress.com/2011/01/20/social-engine-4-controllers/">Creating a Controller</a></li>
<li><a title="Social Engine 4: API files" href="http://jadb.wordpress.com/2011/02/18/social-engine-4-api-files/">Creating an API</a></li>
</ul>
<p style="text-align:center;"> &#8212;&#8212;</p>
<h2><strong>Building the module:</strong></h2>
<p>When you have finished developing your module and you&#8217;re ready to send it for example to a client, or sell it somewhere, you can have SocialEngine build an installable package for your module.</p>
<ol>
<li>&#8220;Go to the &#8220;Developer SDK Tab&#8221; in the Package Manager.</li>
<li>Click on Build Packages</li>
<li>Find your module an make a tick in the associated checkbox</li>
<li>Click on &#8220;<strong>Build Packages</strong>&#8221; button.</li>
<li>You can now click on your package to download it. This page is also accessible from &#8220;<strong>Manage Package Files</strong>&#8221; link in Developer SDK Tab under Package Manager</li>
</ol>
<div><a href="http://jadb.files.wordpress.com/2011/04/manage.png"><img class="aligncenter size-medium wp-image-216" title="manage" src="http://jadb.files.wordpress.com/2011/04/manage.png?w=300&#038;h=111" alt="Manage Packages" width="300" height="111" /></a></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=208&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2011/04/22/social-engine-4-modules/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>

		<media:content url="http://jadb.files.wordpress.com/2011/04/createpackage.png?w=198" medium="image">
			<media:title type="html">Createpackage</media:title>
		</media:content>

		<media:content url="http://jadb.files.wordpress.com/2011/04/ftp.png?w=300" medium="image">
			<media:title type="html">ftp</media:title>
		</media:content>

		<media:content url="http://jadb.files.wordpress.com/2011/04/done1.png" medium="image">
			<media:title type="html">done</media:title>
		</media:content>

		<media:content url="http://jadb.files.wordpress.com/2011/04/manage.png?w=300" medium="image">
			<media:title type="html">manage</media:title>
		</media:content>
	</item>
		<item>
		<title>Social Engine 4: Modal Windows</title>
		<link>http://jadb.wordpress.com/2011/02/27/social-engine-4-modal-windows/</link>
		<comments>http://jadb.wordpress.com/2011/02/27/social-engine-4-modal-windows/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 01:40:28 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SocialEngine]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[modal windows]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[smoothbox]]></category>
		<category><![CDATA[socialengine]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=144</guid>
		<description><![CDATA[&#160; Social Engine provides an easy way for showing modal windows for users. Some example for its uses are the following: Confirmation windows Notification windows with Timeout Taking a simple input on the fly, or even showing a whole form. Modal Windows in SocialEngine 4 are created using mootools&#8217;s plugin &#8220;smoothbox&#8221;. Simply  a modal window [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=144&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;">&nbsp;</p>
<div id="attachment_182" class="wp-caption aligncenter" style="width: 469px"><a href="http://jadb.files.wordpress.com/2011/01/modal.png"><img class="size-full wp-image-182 " title="Modal Window" src="http://jadb.files.wordpress.com/2011/01/modal.png?w=510" alt="Modal Window"   /></a><p class="wp-caption-text">SE Modal Window for confirmation</p></div>
<p>Social Engine provides an easy way for showing modal windows for users. Some example for its uses are the following:</p>
<ul>
<li>Confirmation windows</li>
<li>Notification windows with Timeout</li>
<li>Taking a simple input on the fly, or even showing a whole form.</li>
</ul>
<p>Modal Windows in SocialEngine 4 are created using mootools&#8217;s plugin &#8220;smoothbox&#8221;. Simply  a modal window here is just an iframe, displaying a view as a result of calling a specific action in a controller (<a title="Social Engine 4: Controllers" href="http://jadb.wordpress.com/2011/01/20/social-engine-4-controllers/">see Controllers</a>).  Let&#8217;s examine what happens when you try to delete an activity.</p>
<p>If you look at the html tag of the delete link you&#8217;ll find that it looks like the following:</p>
<blockquote><p>&lt;a href=&#8221;/activity/index/delete/action_id/126&#8243; class=&#8221;smoothbox&#8221;&gt;Delete&lt;/a&gt;</p></blockquote>
<p>Any anchor &lt;a&gt; tag that is given a class attribute with value &#8220;smoothbox&#8221;, opens the href link in a modal window (the i-frame), instead of transferring the whole page to it. This very much simulates an Ajax request with the least effort. Let&#8217;s inspect the href value to see where it leads:</p>
<p style="text-align:center;">&nbsp;</p>
<div class="wp-caption aligncenter" style="width: 469px"><a href="http://jadb.files.wordpress.com/2011/02/urldeform.png"><img class="size-full wp-image-183 " title="URL Inspect" src="http://jadb.files.wordpress.com/2011/02/urldeform.png?w=510" alt="Module: Activity, Controller: Index, Action:Delete, Parameters: action_id=126"   /></a></dt>
</dl>
</div>
<p style="text-align:left;">So head up to this action. The first few lines in the action are just to check  if the user is allowed to perform the delete operation. Also notice that the same method is invoked for both, deleting an activity (AKA action) or deleting a comment on an activity. Let&#8217;s focus this time on lines concerned with deleting the activity itself. Go for the line that say:</p>
<blockquote>
<p style="text-align:left;">if (!$this-&gt;getRequest()-&gt;isPost())      return;</p>
</blockquote>
<p style="text-align:left;">What happens here is that the action checks if it is invoked by a POST request (that request that takes place when you submit a form of type=post), if it is not a post request, the action just returns at this point, causing the default view for this action (delete.tpl) to render (<a title="Social Engine 4: Controllers" href="http://jadb.wordpress.com/2011/01/20/social-engine-4-controllers/">more info on Controllers</a>). Notice the variable passed to the view (before return) carrying the action/activity Id, which in our example is 126.</p>
<blockquote>
<p style="text-align:left;">$this-&gt;view-&gt;action_id  = $action_id  = $this-&gt;_getParam(&#8216;action_id&#8217;, null);</p>
</blockquote>
<p style="text-align:left;">If you open that view (delete.tpl), you&#8217;ll find a form of type=post just as expected. It contains the confirmation message to display:</p>
<blockquote>
<p style="text-align:left;">Are you sure that you want to delete this activity item and all of its comments? This action cannot be undone</p>
</blockquote>
<p style="text-align:left;">Form elements include:</p>
<ul>
<li>A hidden field carrying the action Id passed from the view</li>
<li>A submit button.</li>
<li>A &#8220;Cancel&#8221;  link.</li>
</ul>
<p style="text-align:left;">Cancel link just calls the instance of smoothbox in the parent window and closes it.</p>
<blockquote>
<p style="text-align:left;">&lt;a href=&#8221;javascript:void(0);&#8221; onclick=&#8221;parent.Smoothbox.close();&#8221;&gt;&lt;?php echo $this-&gt;translate(&#8220;cancel&#8221;) ?&gt;&lt;/a&gt;</p>
</blockquote>
<p style="text-align:left;">On submitting the form, the same action handles the request, but this time it bypasses the condition checking if it&#8217;s not a POST request (since the action is called by submitting the form). The lines after that condition just check again for further permissions, then the actual deletion takes place. We&#8217;re not to worry here about the actual deletion process, this guide is only concerned with the modal window itself and how it works. So After deleting:</p>
<blockquote>
<p style="text-align:left;">$this-&gt;view-&gt;status  = true;</p>
<p style="text-align:left;">$this-&gt;view-&gt;message = Zend_Registry::get(&#8216;Zend_Translate&#8217;)-&gt;_(&#8216;This activity item has been removed.&#8217;);</p>
<p style="text-align:left;">$this-&gt;view-&gt;smoothboxClose = true;</p>
<p style="text-align:left;">return $this-&gt;render(&#8216;deletedItem&#8217;);</p>
</blockquote>
<p style="text-align:left;">The status of the operation is set to true and passed to the view to indicate success, along with the success message to display. Also a flag (smoothboxClose) is set to true to tell the view to close the smoothbox. Finally the script renders &#8220;deletedItem.tpl&#8221;</p>
<p style="text-align:left;">I&#8217;ll break up deletedItem.tpl into 3 parts.</p>
<p style="text-align:left;"><strong>Part 1:</strong></p>
<blockquote>
<p style="text-align:left;">&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p style="text-align:left;">parent.$(&#8216;activity-item-&lt;?php echo $this-&gt;action_id ?&gt;&#8217;).destroy();</p>
</blockquote>
<p style="text-align:left;">&nbsp;</p>
<p>To further simulate the ajax request, after the activity item has been deleted it should be removed from the page. The above line simply does that by getting the HTML element containing that activity using its Id and removes it. The above translates to <strong>parent.$(&#8216;activity-item-126&#8242;).destroy();</strong></p>
<p><strong>Part 2:</strong></p>
<blockquote><p>setTimeout(function()</p>
<p>{</p>
<p>parent.Smoothbox.close();</p>
<p>}, &lt;?php echo ( $this-&gt;smoothboxClose === true ? 1000 : $this-&gt;smoothboxClose ); ?&gt;);</p>
<p>&lt;/script&gt;</p></blockquote>
<p>parent.Smoothbox.close() is invoked after 1000 ms only if <strong>smoothboxClose </strong>passed from <strong>deleteAction </strong>was set to true. That is to allow enough time for the user to read the success message before hiding it.</p>
<p><strong>And finally:</strong></p>
<blockquote><p>&lt;div class=&#8221;global_form_popup_message&#8221;&gt;</p>
<p>&lt;?php echo $this-&gt;message ?&gt;</p>
<p>&lt;/div&gt;</p></blockquote>
<p>This shows the success message passed from <strong>deleteAction()</strong>.</p>
<p>Here is another drawing for you</p>
<p style="text-align:center;"><a href="http://jadb.files.wordpress.com/2011/02/deleteaction.png"></a></p>
<div class="mceTemp mceIEcenter">
<dl class="wp-caption aligncenter">
<dt class="wp-caption-dt"><a href="http://jadb.files.wordpress.com/2011/02/deleteaction1.png"><img class="size-full wp-image-194" title="deleteAction" src="http://jadb.files.wordpress.com/2011/02/deleteaction1.png?w=510" alt="deleteAction"   /></a><br />
<p class="wp-caption-text"> </p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=144&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2011/02/27/social-engine-4-modal-windows/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>

		<media:content url="http://jadb.files.wordpress.com/2011/01/modal.png" medium="image">
			<media:title type="html">Modal Window</media:title>
		</media:content>

		<media:content url="http://jadb.files.wordpress.com/2011/02/urldeform.png" medium="image">
			<media:title type="html">URL Inspect</media:title>
		</media:content>

		<media:content url="http://jadb.files.wordpress.com/2011/02/deleteaction1.png" medium="image">
			<media:title type="html">deleteAction</media:title>
		</media:content>
	</item>
		<item>
		<title>Social Engine 4: API files</title>
		<link>http://jadb.wordpress.com/2011/02/18/social-engine-4-api-files/</link>
		<comments>http://jadb.wordpress.com/2011/02/18/social-engine-4-api-files/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 15:10:50 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SocialEngine]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[socialengine]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=178</guid>
		<description><![CDATA[An API file consists of functions that provide methods of communication between a module and other modules (including itself). For example to allow interaction with database tables associated with that module; instead of duplicating a basic select statement across multiple files, we could just create a function inside the API file that returns the result [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=178&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>An API file consists of functions that provide methods of communication between a module and other modules (including itself). For example to allow interaction with database tables associated with that module; instead of duplicating a basic select statement across multiple files, we could just create a function inside the API file that returns the result of that select statement.</p>
<p>This makes life much easier, specially when there are complex queries (like containing pagination and stuff) that need to be called from several controllers or actions. Even better, we won&#8217;t need to worry if for example a tablename has changed in an update or something, since all we will be updating is the API to match the new name.</p>
<p>In a module, APIs are created inside the &#8220;Api&#8221; folder. I think it&#8217;s a SE convention to name the basic/ default API for a module as &#8220;Core&#8221;. However assume we&#8217;re creating an API called &#8220;Myapi&#8221; just for the sake of learning.</p>
<p>Assume we&#8217;re in a module called &#8220;Mymodule&#8221;. Inside the &#8220;Api&#8221; folder create a file called &#8220;MyApi.php&#8221; that contains the following:</p>
<blockquote><p>&lt;?php</p>
<p>class Mymodule_Api_Myapi extends Core_Api_Abstract{</p>
<p>}</p>
<p>?&gt;</p></blockquote>
<p>Notice the naming convention of the class name: <strong>{ModuleName}</strong>_Api_<strong>{ApiName}</strong></p>
<p>Now just add any function to that class so it becomes something like this</p>
<blockquote><p>&lt;?php</p>
<p>class Mymodule_Api_Myapi extends Core_Api_Abstract{</p>
<p>public function addNumbers($a, $b){</p>
<p>return $a+$b;</p>
<p>}</p>
<p>}</p>
<p>?&gt;</p></blockquote>
<p>Of course an API would contain more sophisticated functions than addition, but that is just an example. Now in order to call this function from anywhere in the application:</p>
<blockquote><p>$myApi =  Engine_Api::_()-&gt;getApi(&#8216;myapi&#8217;, &#8216;mymodule&#8217;);</p>
<p>$sum = $myApi-&gt;addNumbers(10, 5);</p></blockquote>
<p><strong>&#8220;getApi&#8221;</strong> takes API name and Module name as parameters, and returns an instance of the API.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/178/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=178&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2011/02/18/social-engine-4-api-files/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>
	</item>
		<item>
		<title>The Big Picture</title>
		<link>http://jadb.wordpress.com/2011/02/07/the-big-picture/</link>
		<comments>http://jadb.wordpress.com/2011/02/07/the-big-picture/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 03:08:16 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Egypt]]></category>
		<category><![CDATA[jan25]]></category>
		<category><![CDATA[Revolt]]></category>
		<category><![CDATA[Tahrir]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=158</guid>
		<description><![CDATA[&#160; &#8220;The revolution in Egypt has stunned the entire world&#8221; (mymodernmet) &#8220;The uprising in Egypt has galvanized the world&#8221; (aolnews) &#8220;Egypt Revolution will change the Arab World&#8221; (twocircles.net) &#8220;Arab world gears up for domino effect&#8221; (presstv.ir) &#160; The Egyptian Revolution. The Big Picture. &#160;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=158&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_159" class="wp-caption aligncenter" style="width: 469px"><a href="http://www.boston.com/bigpicture/2011/02/a_harrowing_historic_week_in_e.html"><img class="size-full wp-image-159 " title="The Big Picture" src="http://jadb.files.wordpress.com/2011/02/tbp.jpg?w=510" alt="Tahrir Square"   /></a><p class="wp-caption-text">Tahrir Square</p></div>
<p>&nbsp;</p>
<p style="text-align:center;"><em>&#8220;The revolution in Egypt has stunned the entire world&#8221;</em> (<a href="http://www.mymodernmet.com/profiles/blogs/the-egyptian-revolution-the-1" target="_blank">mymodernmet</a>)</p>
<p style="text-align:center;"><em>&#8220;The uprising in Egypt has galvanized the world&#8221; </em>(<a href="http://www.aolnews.com/2011/02/01/opinion-egypts-revolution-huge-dangers-and-stark-alternativ/" target="_blank">aolnews</a>)</p>
<p style="text-align:center;"><em>&#8220;Egypt Revolution will change the Arab World&#8221;</em> (<a href="http://twocircles.net/node/237903" target="_blank">twocircles.net</a>)</p>
<p style="text-align:center;"><em>&#8220;Arab world gears up for domino effect&#8221;</em> (<a href="http://www.presstv.ir/detail/163380.html" target="_blank">presstv.ir</a>)</p>
<p>&nbsp;</p>
<h2 style="text-align:center;"><strong>The Egyptian Revolution. T</strong><strong>he <a title="Big Picture" href="http://www.boston.com/bigpicture/2011/02/a_harrowing_historic_week_in_e.html" target="_blank">Big Picture</a>.</strong></h2>
<p>&nbsp;</p>
<p><strong><br />
</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/158/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=158&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2011/02/07/the-big-picture/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>

		<media:content url="http://jadb.files.wordpress.com/2011/02/tbp.jpg" medium="image">
			<media:title type="html">The Big Picture</media:title>
		</media:content>
	</item>
		<item>
		<title>Social Engine 4: Model</title>
		<link>http://jadb.wordpress.com/2011/01/23/social-engine-4-model/</link>
		<comments>http://jadb.wordpress.com/2011/01/23/social-engine-4-model/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 14:44:49 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SocialEngine]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[socialengine]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=130</guid>
		<description><![CDATA[Following up with my last 2 posts about Widgets and Controllers, the past couple of days I got my hands dirty with Models. Models are created inside the Models directory in a module. A model represents an item, or an object, which is fetched from the database. To describe how things work, I think the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=130&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Following up with my last 2 posts about <a href="http://jadb.wordpress.com/2011/01/17/socialengine-4-create-a-widget/">Widgets</a> and <a href="http://jadb.wordpress.com/2011/01/20/social-engine-4-controllers/">Controllers</a>, the past couple of days I got my hands dirty with Models. Models are created inside the Models directory in a module. A model represents an item, or an object, which is fetched from the database. To describe how things work, I think the simplest way is to use an example.</p>
<p style="text-align:center;"><strong>If you find anything that is inconsistent or does not work, please let me know in a comment or so.</strong></p>
<p>Assume we want to allow the user to categorize his friends (like facebook friends lists). So we&#8217;re going to create a table in the database to store this.</p>
<p>From my understanding, the convention of SE (probably zend too) in table names goes like this:</p>
<blockquote><p><strong>prefix</strong>_<strong>modulename</strong>_<strong>tablename</strong></p></blockquote>
<p><strong>prefix</strong> is similar for all tables. It&#8217;s actually set somewhere in config files (can&#8217;t remember where).<strong> modulename </strong>is the name of module containing the model for our table. <strong>tablename </strong>(in plural form) is the actual name of table we&#8217;re creating. So, in our example, I&#8217;ll assume we&#8217;re working inside the &#8220;<strong>User</strong>&#8221; module, so we create the table &#8220;<strong>prefix_user_friendslists</strong>&#8220;.  We will just give the table a column for primary key  (<strong>friendslist_id</strong>), creator id (<strong>user_id</strong>), and category name (<strong>list_name</strong>).</p>
<p>Note that you must call the primary key column (friendslist_id) as zend automatically infers that from the table name.</p>
<p>Now let&#8217;s get started on how to deal with this table from within our application. Inside the Models directory, there is another folder called &#8220;<strong>DbTable</strong>&#8220;. DbTable files are most probably the lowest layer files you&#8217;ll need to deal with to create models from the database.  A DBTable class is what connects your table to it&#8217;s model. So start off by creating a DBTable file (inside DBTable folder) for our table.</p>
<p><em><strong>Friendslists.php</strong> (plural):</em></p>
<blockquote><p>class User_Model_DbTable_Friendslists extends Engine_Db_Table</p>
<p>{</p>
<p>protected $_rowClass = &#8216;User_Model_Friendslist&#8217;; Singular</p>
<p>}</p></blockquote>
<p><strong>$_rowClass </strong>chould have class name of our model (that we will create next). This way Social Engine (or zend) would know that results obtained from &#8220;<strong>User_Friendlists</strong>&#8221; table, should be assigned to our model. Don&#8217;t be confused about singular/plural conventions. Actually if you think about it, DBTable represents the table from database, that&#8217;s why it has  <strong>plural</strong> form like the table name. While a model represent a single object from that table, so it has a <strong>singular </strong>form in ists class name.</p>
<p>Now in the Models directory create:</p>
<p><em><strong>Friendslist.php </strong>(singular):</em></p>
<blockquote><p>class User_Model_Friendslist extends Core_Model_Item_Abstract</p>
<p>{</p>
<p>protected $_owner_type = &#8216;user&#8217;;</p>
<p>}</p></blockquote>
<p>With $_parent_type and $_owner_type we are getting rid of a manual JOIN operation to get the creator of a category. This way whenever we call $category-&gt;getOwner(), its creator&#8221;User&#8221; object is automatically fetched using the &#8220;<strong>user_id</strong>&#8221; column.</p>
<p><strong>Querying the table:</strong></p>
<p>To query our table we first tell the Engine API which table we are going to query against:</p>
<blockquote><p>$table = Engine_Api::_()-&gt;getDbtable(&#8216;friendslists&#8217;, &#8216;user&#8217;);</p></blockquote>
<p>Notice how function paramaters (tablename, modulename)</p>
<p>To select all friendslists a certain user created:</p>
<blockquote><p>$select = $table-&gt;select()  -&gt;where(&#8220;user_id = ?&#8221;, 1);</p>
<p>$result = $table-&gt;fetchAll($select);</p>
<p>foreach($result as $list)</p>
<p>{</p>
<p>echo &#8220;{$list-&gt;list_name} &lt;br/&gt;&#8221; ;</p>
<p>}</p></blockquote>
<p>A single $category (inside the foreach loop) is an instance of the model we&#8217;ve created above. You can use it to access any column by its name.</p>
<p>To create a new category:</p>
<blockquote><p>Engine_Api::_()-&gt;getDbtable(&#8216;friendslists&#8217;, &#8216;user&#8217;)</p>
<p>-&gt;insert(array(</p>
<p>&#8216;user_id&#8217; =&gt; 1,</p>
<p>&#8216;list_name&#8217; =&gt; &#8220;Shiny new category&#8221;</p>
<p>));</p></blockquote>
<p>Next to come is how to create your own module.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=130&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2011/01/23/social-engine-4-model/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>
	</item>
		<item>
		<title>Social Engine 4: Controllers</title>
		<link>http://jadb.wordpress.com/2011/01/20/social-engine-4-controllers/</link>
		<comments>http://jadb.wordpress.com/2011/01/20/social-engine-4-controllers/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 08:21:42 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SocialEngine]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[socialengine]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=123</guid>
		<description><![CDATA[Since Social Engine uses the Zend Framework, the files structure are most probably the same. Social Engine uses modules. So inside the application directory you find modules folder. Each module has a separate folder, containing its associated controllers, models, views, widgets ..etc. Controllers: Controllers are found inside controllers folder. Each controller class has defined actions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=123&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Since Social Engine uses the Zend Framework, the files structure are most probably the same. Social Engine uses modules. So inside the application directory you find modules folder. Each module has a separate folder, containing its associated controllers, models, views, widgets ..etc.</p>
<p><strong>Controllers:</strong></p>
<p>Controllers are found inside controllers folder. Each controller class has defined actions (methods) and each method must have an associated view.</p>
<p>Controllers&#8217; naming convention is <strong>NameController.php</strong>. The controller&#8217;s class name becomes {modulename}_{controllername}Controller</p>
<p>So if we&#8217;re inside <strong>User</strong> module and looking at the <strong>Profile Controller</strong>, you&#8217;ll find:</p>
<ul>
<li>Controller filename is ProfileController.php</li>
<li>Controller class name is User_ProfileController</li>
</ul>
<p>The standard method in controller is the init()  method. This is the method that get invoked when the class is instantiated. So inside it important variables that are used within other method in the controller should be set. For example, setting the subject. I understood that socialengine uses the term &#8220;Subject&#8221; to name a variable, or an item that the user is currently looking at. For example when you view someone&#8217;s profile, the subject becomes that person. If you&#8217;re viewing a group, subject becomes that group. Subject is set in the init function so as to be available easily to all other methods in the same controller.</p>
<p>To set subject:</p>
<blockquote><p>if( !Engine_Api::_()-&gt;core()-&gt;hasSubject() )    {  //Check is there is  no already set subject</p>
<p>$subject_temp = Engine_Api::_()-&gt;user()-&gt;getUser($id);      //set temp variable to some user, we got using his id</p>
<p>if( $subject_temp-&gt;getIdentity() )        {        //If temp is indeed a valid  user</p>
<p>Engine_Api::_()-&gt;core()-&gt;setSubject($subject_temp);      // set the subject to that user</p>
<p>}</p>
<p>}</p></blockquote>
<p>To get subject:</p>
<blockquote><p>$subject = Engine_Api::_()-&gt;core()-&gt;getSubject();</p></blockquote>
<p>Methods other than init() are called actions. The take the following convention:</p>
<blockquote><p>public function methodnameAction(){ }</p></blockquote>
<p>inside which the action&#8217;s logic is defined.</p>
<p>Each  controller has a folder containing it&#8217;s views, found in <strong>views/scripts</strong> folder. For Profile Controller explained above, there is a folder called &#8220;<strong>profile</strong>&#8220;, and for each method in this controller -other than init() &#8211; there must be an associated view. So if we have a method called helloAction, there must be a file called hello.tpl within that folder.</p>
<p>To invoke a certain action within a certain controller, you follow this scheme in URL:</p>
<blockquote><p>http://serveraddress/modulename/controllername/actionname/</p></blockquote>
<p>This action gets invoked, and automatically the associated view gets rendered for display.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=123&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2011/01/20/social-engine-4-controllers/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>
	</item>
		<item>
		<title>SocialEngine 4: Create a Widget (Updated)</title>
		<link>http://jadb.wordpress.com/2011/01/17/socialengine-4-create-a-widget/</link>
		<comments>http://jadb.wordpress.com/2011/01/17/socialengine-4-create-a-widget/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 04:38:50 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SocialEngine]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[socialengine]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=120</guid>
		<description><![CDATA[I&#8217;m currently working on a project that requires applying some modifications and creating plugins for SocialEngine 4. I&#8217;m new to socialengine so I&#8217;ll post here my findings during the work. Probably I&#8217;m not allowed to post the code in public, so I&#8217;m just going to post generic how tos that you could use to accomplish [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=120&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a project that requires applying some modifications and creating plugins for SocialEngine 4. I&#8217;m new to socialengine so I&#8217;ll post here my findings during the work. Probably I&#8217;m not allowed to post the code in public, so I&#8217;m just going to post generic how tos that you could use to accomplish similar tasks.</p>
<p>My first task to is to allow users to post comments to other users&#8217; profile. So the first challenge is to create a new tab where there would be a form, and other people comments displayed below it. More like the news feed, except that it shows and posts comments.</p>
<p>First thing to think about is where does this Widget belong? In my case, since it is displayed in a user&#8217;s profile then it should belong to the <strong>User</strong> module. So navigate to the Widgets folder inside the User module ({social_engine_root}/application/modules/User/widgets) and create a new directory with your widget&#8217;s name (mywidget for example). Create 2 files inside this directory:</p>
<ul>
<li>Controller.php</li>
<li>index.tpl</li>
</ul>
<p>As you&#8217;ve most probably figured out, SocialEngine uses the MVC architecture. So in this case the controller class lies in Controller.php and the view is in index.tpl. For the model I haven&#8217;t yet stepped into it so I&#8217;ll skip it now and come back to it when I find out more.</p>
<p>Controller.php:</p>
<blockquote><p>&lt;?php</p>
<p>class User_Widget_mywidgetController extends Engine_Content_Widget_Abstract {</p>
<p>public function indexAction()  {</p>
<p>$this-&gt;view-&gt;msg=&#8221;Hello Widget!&#8221;;</p>
<p>}<br />
}</p></blockquote>
<p>The indexAction() method is invoked whenever the widget is going to be displayed. So inside this method you should prepare data (if any) that should be passed to the view. To pass data to the view, use this convention <strong>$this-&gt;view-&gt;variablename=value </strong>like above, replacing variablename with any name of your choice, and value with the associated data.</p>
<p>Then in the view index.tpl:</p>
<blockquote><p>&lt;?php</p>
<p>echo $this-&gt;msg;</p>
<p>?&gt;</p></blockquote>
<p>Use this convention to get variables assigned in controller: $this-&gt;variablename</p>
<p>Now the next step is to tell the User module that it has got a shiny brand new widget. To do this edit the content file associated with User module: ({social_engine_root}/application/modules/User/settings/content.php)  and append the following at the very bottom of page (before the very last closing bracket &#8216;)&#8217; )</p>
<blockquote><p>array( &#8216;title&#8217; =&gt; &#8216;My Widget&#8217;,</p>
<p>&#8216;description&#8217; =&gt; &#8216;This is a brand new User Widget&#8217;,</p>
<p>&#8216;category&#8217; =&gt; &#8216;User&#8217;,</p>
<p>&#8216;type&#8217; =&gt; &#8216;widget&#8217;,</p>
<p>&#8216;name&#8217; =&gt; &#8216;user.mywidget&#8217;,</p>
<p>),</p></blockquote>
<p>always of course replacing &#8220;mywidget&#8221; with your widget&#8217;s name.</p>
<p>Now the Widget is registered with SocialEngine. I am going to add it under a new tab in User Profile. To do so, login as admin, click Admin from top menu and go to <strong>Layout Editor</strong>. Then Change Editing to <strong>Member profile</strong>, and in the <strong>Available Blocks</strong> scroll till you find the <strong>User</strong> section. If everything was done correctly you should find your widget under this section. Just drag it to the tabbed block and you&#8217;re done. Next up is how to create a model, and make the controller interact with it.</p>
<p>&nbsp;</p>
<p><strong>UPDATE:</strong></p>
<p>I quote this from John Boehr&#8217;s comment:</p>
<blockquote><p>If you want to create your own widgets, I’d recommend placing them in application/widgets instead. The widgets in the modules use a common content file, which would be replaced if you upgraded. The widgets in the application/widgets folder are designed to be atomic, so their files are not touched unless you specifically upgrade that widget (or never if it’s your own).</p>
<p>You can render a widget in a view script using:<br />
echo $this-&gt;content()-&gt;renderWidget(‘user.list-online’, array(‘key’ =&gt; ‘value’));</p>
<p>Check out application/modules/Core/views/scripts/admin-index/index.tpl for examples in the code.</p></blockquote>
<p>Great piece of info, thanks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=120&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2011/01/17/socialengine-4-create-a-widget/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>
	</item>
		<item>
		<title>Qt Spread</title>
		<link>http://jadb.wordpress.com/2010/12/04/qt-spread/</link>
		<comments>http://jadb.wordpress.com/2010/12/04/qt-spread/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 05:14:01 +0000</pubDate>
		<dc:creator>tgalal</dc:creator>
				<category><![CDATA[QML]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Nokia]]></category>

		<guid isPermaLink="false">http://jadb.wordpress.com/?p=113</guid>
		<description><![CDATA[Because of my recommendation, 4 teams (20 persons in total) are using Qt for a HCI project. 1 team is targeting Desktop platforms 1 team is targeting mobile platforms 1 team is using PyQt for Desktop targets And finally my team is using QML (desktop targets as well) I guess I do deserve my Qt [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=113&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Because of my recommendation, 4 teams (20 persons in total) are using Qt for a HCI project.</p>
<ul>
<li>1 team is targeting Desktop platforms</li>
<li>1 team is targeting mobile platforms</li>
<li>1 team is using PyQt for Desktop targets</li>
<li>And finally my team is using QML (desktop targets as well)</li>
</ul>
<p>I guess I do deserve my <a href="http://qt.nokia.com/qt-in-use/ambassadors/qtambassador/" target="_blank">Qt Ambassador</a> title! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jadb.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jadb.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jadb.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jadb.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jadb.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jadb.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jadb.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jadb.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jadb.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jadb.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jadb.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jadb.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jadb.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jadb.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jadb.wordpress.com&amp;blog=10001369&amp;post=113&amp;subd=jadb&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jadb.wordpress.com/2010/12/04/qt-spread/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/55be8cb2fa76f90ff002b5c2ff9213fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tgalal</media:title>
		</media:content>
	</item>
	</channel>
</rss>
