<?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>IWebUX</title>
	
	<link>http://www.iwebux.com</link>
	<description>Interactive Web User Experience</description>
	<lastBuildDate>Sun, 14 Apr 2013 06:45:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Iwebux" /><feedburner:info uri="iwebux" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Iwebux</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Moving Magento from development to production</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/yceKanOTxK4/</link>
		<comments>http://www.iwebux.com/moving-magento-from-development-to-production/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 02:21:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[QBytes]]></category>
		<category><![CDATA[delete test orders]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[redirection development site]]></category>
		<category><![CDATA[refresh statistics]]></category>
		<category><![CDATA[set up]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=593</guid>
		<description><![CDATA[Once you are ready to move your development environment to the production environment, there are few things that you have to take care in Magento to avoid some issues. Before beginning it is always a best practice and safe to back up your database irrespective of any platform you are working on. This is the [...]]]></description>
				<content:encoded><![CDATA[<p>Once you are ready to move your development environment to the production environment, there are few things that you have to take care in Magento to avoid some issues.</p>
<p>Before beginning it is always a best practice and safe to back up your database irrespective of any platform you are working on. This is the golden rule that would save you when things go wrong.</p>
<p>So now lets dive into issues that is specific to the Magento platform that one may face during the migration of development environment to that of production.</p>
<h2>Copying all the files</h2>
<p>Copy all the folders and files in the Magento root directory and make sure you don&#8217;t copy the cache files under &#8220;Var&#8221; folder to the production environment.</p>
<h2>Environment configuration</h2>
<p>The production server must be configured with all php libraries that the development environment uses and your development code uses. </p>
<h2>Permission settings</h2>
<p>Make sure the permission settings used is same as the development environment, unless your development environment permission settings doesn&#8217;t comply to the security.</p>
<p>so as a rule of thumb it is always a good practice to set your development environment with necessary permission levels, keeping security in mind. Avoid setting permission mode to &#8220;777&#8243; when its not needed.</p>
<h2>Configuring the database</h2>
<p>Import the database that you backed up to the production environment. If you have used a different a database name or db credentials for production environment, you need to configure the connection settings in the /app/etc/local.xml file.</p>
<pre name="code" class="xml">
        <connection>
                    <host><!--[CDATA[localhost]]--></host>
                    <username><!--[CDATA[DB_USERNAME]]--></username>
                    <Password><!--[CDATA[DB_PASSWORD]]--></Password>
                    <dbname><!--[CDATA[DB_NAME]]--></dbname>
                    <active>1</active>
          </connection>
</pre>
<h2>Setting up the site domain</h2>
<p>You have to execute the following query in order to setup the database to point to the production environment.</p>
<pre name="code" class="sql">
   UPDATE core_config_data SET value = 'http://productionserver.com/' WHERE config_id IN (11,12);
</pre>
<p>This step is very important in setting up the production environment for Magento. Failing to do this, may result in redirection to your development server.</p>
<h2>Delete Test Data</h2>
<p>Delete all the test data from the system by deleting them from the admin panel. To delete the test orders that you placed in the development environment follow this <a href="http://www.iwebux.com/delete-test-orders-in-magento/"> tutorial </a>. </p>
<h2>Reindex the data</h2>
<p>Go to the admin panel. Click on the &#8220;Index Management&#8221; under &#8220;System&#8221;. Select all rows and reindex data.</p>
<h2>Refresh Statistics</h2>
<p> Click &#8220;Report/Refresh Statistics&#8221; and select all rows to refresh the statistics. Select &#8220;Refresh Lifetime Statistics&#8221; and click submit.</p>
<h2>Switch off test mode</h2>
<p>Make sure you disable the test mode for your payment gateway in the system.</p>
<p>The above said steps should help your Magento site published live.</p>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/yceKanOTxK4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/moving-magento-from-development-to-production/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/moving-magento-from-development-to-production/</feedburner:origLink></item>
		<item>
		<title>Delete test orders in Magento</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/BtqXSwGPzbw/</link>
		<comments>http://www.iwebux.com/delete-test-orders-in-magento/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 02:54:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[QBytes]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[orders]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[version 1.4.1]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=583</guid>
		<description><![CDATA[In Magento there is no option for deleting orders in the admin panel. This is a problem when you want to delete those test orders that you made in development before going live. Here I will show you which tables you have to look for to delete those test orders.
]]></description>
				<content:encoded><![CDATA[<p>In Magento there is no option for deleting orders in the admin panel. This is a problem when you want to delete those test orders that you made in development before going live. Here I will show you which tables you have to look for to delete those test orders.</p>
<p>Remember it is always a good idea to backup your db as it will delete all the details regarding the test sales you made.</p>
<div id="requirements">
<h5>Compatibility:</h5>
<p>Applicable to Magento version 1.4.X
</p>
</div>
<pre name="code" class="sql">
DELETE FROM `sales_flat_order`;

TRUNCATE TABLE `sales_flat_invoice`;
TRUNCATE TABLE `sales_flat_invoice_comment`;
TRUNCATE TABLE `sales_flat_invoice_grid`;
TRUNCATE TABLE `sales_flat_invoice_item`;
TRUNCATE TABLE `sales_flat_order`;
TRUNCATE TABLE `sales_flat_order_address`;
TRUNCATE TABLE `sales_flat_order_grid`;
TRUNCATE TABLE `sales_flat_order_item`;
TRUNCATE TABLE `sales_flat_order_payment`;
TRUNCATE TABLE `sales_flat_order_status_history`;
TRUNCATE TABLE `sales_flat_shipment`;
TRUNCATE TABLE `sales_flat_shipment_comment`;
TRUNCATE TABLE `sales_flat_shipment_grid`;
TRUNCATE TABLE `sales_flat_shipment_item`;
TRUNCATE TABLE `sales_flat_shipment_track`;
TRUNCATE TABLE `sales_payment_transaction`; 
</pre>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/BtqXSwGPzbw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/delete-test-orders-in-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/delete-test-orders-in-magento/</feedburner:origLink></item>
		<item>
		<title>Dynamic Controls in Cross Page Postback</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/JNg5uQ1Wp-0/</link>
		<comments>http://www.iwebux.com/dynamic-controls-in-cross-page-postback/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 20:31:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[charp]]></category>
		<category><![CDATA[Checkbox]]></category>
		<category><![CDATA[crosspage postback]]></category>
		<category><![CDATA[radiobutton]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=548</guid>
		<description><![CDATA[In Asp.Net world a Cross Page Postback refers to passing form data from one web page to another. In Asp.Net this is handled differently when compared to classic Asp or any other server side languages. In this tutorial let us see how a static Asp.Net control and dynamic Asp.Net controls are handled in a Cross Page Postback.

Asp.Net controls are nothing but the form elements and dynamic Asp.Net controls here, I mean the controls that are created on the fly during runtime.]]></description>
				<content:encoded><![CDATA[<div id="download">
<span class="downloadtext"><a href="http://www.iwebux.com/demos/WebApplication1.zip">Download Source Code</a></span>
</div>
<div id="requirements">
<h5>Requirements:</h5>
<p>This tutorial requires basic knowledge in Asp.Net, Csharp and Visual studio.
</p></div>
<h2>What is Cross Page Postback?</h2>
<p>In Asp.Net world a Cross Page Postback refers to passing form data from one web page to another. In Asp.Net this is handled differently when compared to classic Asp or any other server side languages. In this tutorial let us see how a static Asp.Net control and dynamic Asp.Net controls are handled in a Cross Page Postback.</p>
<p>Asp.Net controls are nothing but the form elements and dynamic Asp.Net controls here, I mean the controls that are created on the fly during runtime.</p>
<h2>Step 1:</h2>
<p>First we create a source page front end with static form control. We will add a text box control and button to the form. By default the PostBackUrl property of the button is assigned to the same page. Since we are dealing with cross page postback, we assign it to Target.aspx page.</p>
<pre name="code" class="html">
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Source.aspx.cs" Inherits="WebApplication1.Source" %>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
 <asp:Button ID="Button1" runat="server" Text="Submit" PostBackUrl="~/Target.aspx"/>
</asp:Content>

</pre>
<h2>Step 2:</h2>
<p>Now we need to get the form data in the Target.aspx page. Let us first design the front end for the Target.aspx page.</p>
<pre name="code" class="html">
<%@ Page Title="About Us" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Target.aspx.cs" Inherits="WebApplication1.Target"  %>
<%@ PreviousPageType VirtualPath="~/Source.aspx" %>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Target Page
    </h2>

    <asp:PlaceHolder ID="LabelHolder" runat="server">

        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />
    
    </asp:PlaceHolder>
   

</asp:Content>

</pre>
<p>In the above snippet you can see a PreviousPageType directive with virtual path set to Source.aspx . This is how the target page knows, from where the cross page postback comes from.</p>
<h2>Step 3:</h2>
<p>In this step we write some c# code inside the page load event for the target page to retrieve the value from the source page. Let us see how to do it.</p>
<pre name="code" class="csharp">
  protected void Page_Load(object sender, EventArgs e)
  {
     if (this.PreviousPage.IsCrossPagePostBack)
     {
      HtmlGenericControl br = new HtmlGenericControl("br");
      ContentPlaceHolder con = (ContentPlaceHolder)this.PreviousPage.Master.FindControl("MainContent");
      TextBox txt1 = (TextBox)con.FindControl("TextBox1");
      Label1.Text = txt1.Text;
      /*Dynamic controls code to follow*/
      }
   }
</pre>
<p>In the above snippet we first check the if PreviousPage has sent a Cross Page Postback, if yes then we get the placeholder control called &#8220;MainContent&#8221; in the master page. We find the textbox control in the previous page using its ID, &#8220;TextBox1&#8243;. The value of the TextBox1 can be retrieved using the Text property.</p>
<h2>Step 4:</h2>
<p>Now let us see how to retrieve the values for the dynamic controls in the target page. So lets add some c# code to the page load event of the Source page to create the dynamic controls on the fly. </p>
<pre name="code" class="csharp">

 protected void Page_Load(object sender, EventArgs e)
 {

     ListItem lst1 = new ListItem("Item1", "CheckBox1 is Checked");

     ListItem lst2 = new ListItem("Item2", "CheckBox2 is Checked");

     CheckBoxList1.Items.Add(lst1);
     CheckBoxList1.Items.Add(lst2);

     ListItem lst3 = new ListItem("Item1", "RadioButton1 is Checked");

     ListItem lst4 = new ListItem("Item2", "RadioButton2 is Checked");

     RadioButtonList1.Items.Add(lst3);
     RadioButtonList1.Items.Add(lst4);

 }
</pre>
<p>In the snippet above a checkbox list and radio button list is created during the runtime, when the source page is loaded.</p>
<h2>Step 5:</h2>
<p>The target page can retrieve the values from the dynamic control as follows,</p>
<pre name="code" class="csharp">
protected void Page_Load(object sender, EventArgs e)
{

   if (this.PreviousPage.IsCrossPagePostBack)
   {
      HtmlGenericControl br = new HtmlGenericControl("br");
      ContentPlaceHolder con = (ContentPlaceHolder)this.PreviousPage.Master.FindControl("MainContent");
      TextBox txt1 = (TextBox)con.FindControl("TextBox1");
      Label1.Text = txt1.Text;
      CheckBoxList ck1 = (CheckBoxList)con.FindControl("CheckBoxList1");
      foreach(ListItem item in ck1.Items)
      {
          if (item.Selected)
          {
           Label lbl = new Label();
           lbl.Text = item.Value;
           LabelHolder.Controls.Add(br);
           LabelHolder.Controls.Add(lbl);
          }
     }
     RadioButtonList rbtn1 = (RadioButtonList)con.FindControl("RadioButtonList1");
     foreach (ListItem item in rbtn1.Items)
     {
       if (item.Selected)
       {
         Label lbl = new Label();
         lbl.Text = item.Value;
         LabelHolder.Controls.Add(br);
         LabelHolder.Controls.Add(lbl);
         break;
       }        
    }
 }
</pre>
<p>In the above snippet we check for the selected items from the ckecboxbox list control and radiobutton list control. The value is retrieved from the list item and assigned to the labels that are created during the runtime.</p>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/JNg5uQ1Wp-0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/dynamic-controls-in-cross-page-postback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/dynamic-controls-in-cross-page-postback/</feedburner:origLink></item>
		<item>
		<title>CSS 3 Basics</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/KL9OOxc2V-4/</link>
		<comments>http://www.iwebux.com/css-3-basics/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 21:47:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[browser compatibility]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=518</guid>
		<description><![CDATA[In this tutorial, let us see about some of the CSS3 features and the browsers supporting them. ]]></description>
				<content:encoded><![CDATA[<p>In this tutorial, let us see about some of the CSS3 features and the browsers supporting them.</p>
<h2>Border Radius</h2>
<pre name="code" class="css">
-moz-border-radius-topleft: 12px;
-moz-border-radius-topright: 12px;
-moz-border-radius-bottomright: 12px;
-moz-border-radius-bottomleft: 12px;
border-top-left-radius: 12px;
border-top-right-radius: 12px;
border-bottom-right-radius: 12px;
border-bottom-left-radius: 12px;  
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.1 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/ie_thumb.jpg" alt="" title="ie_thumb" width="20" height="20" class="alignleft size-full wp-image-530" /> : 9 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/opera_thumb.jpg" alt="" title="opera_thumb" width="20" height="20" class="alignleft size-full wp-image-531" /> : 10.5 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Box Resize</h2>
<pre name="code" class="css">
resize: both;/*other options : horizontal, vertical */
overflow: auto;
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.1 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Box Shadow</h2>
<pre name="code" class="css">
-webkit-box-shadow: 2px 3px 4px #0d0c0d;
-moz-box-shadow: 2px 3px 4px #0d0c0d;
box-shadow: 2px 3px 4px #0d0c0d; 
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.5 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.1 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/opera_thumb.jpg" alt="" title="opera_thumb" width="20" height="20" class="alignleft size-full wp-image-531" /> : 10.5 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Box Sizing</h2>
<pre name="code" class="css">
/*content-box by default */
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box; 
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 1.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 0.2 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.0 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/ie_thumb.jpg" alt="" title="ie_thumb" width="20" height="20" class="alignleft size-full wp-image-530" /> : 8 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/opera_thumb.jpg" alt="" title="opera_thumb" width="20" height="20" class="alignleft size-full wp-image-531" /> : 7 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Font Face</h2>
<p>To know more about bullet-proof concept by Paul Irish for font-face and its usage <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/#smiley" target="_blank"><b> click here</b>.</a></p>
<pre name="code" class="css">
@font-face {
font-family: 'Garamond';
src: url('Garamond.eot');
src: local('☺'),
url('Garamond.woff') format('woff'),
url('Garamond.ttf') format('truetype');
}
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.5 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.2 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/ie_thumb.jpg" alt="" title="ie_thumb" width="20" height="20" class="alignleft size-full wp-image-530" /> : 9 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/opera_thumb.jpg" alt="" title="opera_thumb" width="20" height="20" class="alignleft size-full wp-image-531" /> : 10.1 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Gradients</h2>
<pre name="code" class="css">
background: -moz-linear-gradient(top, #7d7e7d 0%, #0e0e0e 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7d7e7d), color-stop(100%,#0e0e0e));
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.6 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 4.0 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Multiple Columns</h2>
<pre name="code" class="css">
-moz-column-count: 2;
-moz-column-gap: 20px;
-webkit-column-count: 2;
-webkit-column-gap: 20px;
column-count: 2;
column-gap: 20px;
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.1 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Outline</h2>
<pre name="code" class="css">
outline: 10px solid #302b30;
outline-offset: 20px; 
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.1 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/ie_thumb.jpg" alt="" title="ie_thumb" width="20" height="20" class="alignleft size-full wp-image-530" /> : 9 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/opera_thumb.jpg" alt="" title="opera_thumb" width="20" height="20" class="alignleft size-full wp-image-531" /> : 10.5 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>RGBA</h2>
<pre name="code" class="css">
background-color: rgba(200, 250, 130, 0.7);
color: rgba(200, 250, 130, 0.7);
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.1 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/opera_thumb.jpg" alt="" title="opera_thumb" width="20" height="20" class="alignleft size-full wp-image-531" /> : 10.0 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Text Shadow</h2>
<pre name="code" class="css">
text-shadow: 2px 2px 4px #1f021f;
filter: dropshadow(color=#1f021f, offx=2, offy=2);
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.5 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 4.0 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/opera_thumb.jpg" alt="" title="opera_thumb" width="20" height="20" class="alignleft size-full wp-image-531" /> : 9.6 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Transform</h2>
<pre name="code" class="css">
-moz-transform: scale(1) rotate(5deg) translate(20px, 20px) skew(5deg, 5deg);
-webkit-transform: scale(1) rotate(5deg) translate(20px, 20px) skew(5deg, 5deg);
-o-transform: scale(1) rotate(5deg) translate(20px, 20px) skew(5deg, 5deg);
-ms-transform: scale(1) rotate(5deg) translate(20px, 20px) skew(5deg, 5deg);
transform: scale(1) rotate(5deg) translate(20px, 20px) skew(5deg, 5deg);
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.5 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.2 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/opera_thumb.jpg" alt="" title="opera_thumb" width="20" height="20" class="alignleft size-full wp-image-531" /> : 10.5 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<h2>Transition</h2>
<pre name="code" class="css">
-webkit-transition: all 10s ease-in;
-moz-transition: all 10s ease-in;
-o-transition: all 10s ease-in;
transition: all 10s ease-in;
</pre>
<p><strong>Compatibility</strong></p>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/firefox_thumb.jpg" alt="" title="firefox_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 4.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/chrome_thumb.jpg" alt="" title="chrome_thumb" width="20" height="20" class="alignleft size-full wp-image-522" /> : 3.0 + </div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/safari_thumb.jpg" alt="" title="safari_thumb" width="20" height="20" class="alignleft size-full wp-image-529" /> : 3.2 +</div>
<div id="browsers"><img src="http://www.iwebux.com/wp-content/uploads/2010/11/opera_thumb.jpg" alt="" title="opera_thumb" width="20" height="20" class="alignleft size-full wp-image-531" /> : 10.5 +</div>
<div class="clear">
<p>&nbsp;</p>
</div>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/KL9OOxc2V-4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/css-3-basics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/css-3-basics/</feedburner:origLink></item>
		<item>
		<title>Disable/Enable WordPress Users</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/NFwK2nsjEKs/</link>
		<comments>http://www.iwebux.com/disableenable-wordpress-users/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 22:40:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[enable]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress users]]></category>
		<category><![CDATA[wp-admin]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=495</guid>
		<description><![CDATA[ A simple and easy to use plugin for disabling or enabling wordpress users. Surprisingly I didn't find any plugins that disable or enable wordpress users.

This situation could arise due to various reasons. So I came up with a plugin that does the work for me.

I made this plugin available to everyone. Feel free to use it.]]></description>
				<content:encoded><![CDATA[<div id="download"><span class="downloadtext"><a href="http://www.iwebux.com/demos/usercontrol.zip">Download Plugin</a></span></div>
<p>I needed a simple and easy to use plugin for disabling or enabling wordpress users. Surprisingly I didn&#8217;t find any plugins that disable or enable wordpress users.</p>
<p>This situation could arise due to various reasons. So I came up with a plugin that does the work for me.</p>
<p>I made this plugin available to everyone. Feel free to use it.</p>
<p><strong>NOTE:</strong> This plugin does not disable the admin user.</p>
<h2>Screen Shots:</h2>
<p><img class="aligncenter size-full wp-image-502" title="screenshot1" src="http://www.iwebux.com/wp-content/uploads/2010/10/screenshot1.jpg" alt="" width="600" height="325" /></p>
<p><img class="aligncenter size-full wp-image-503" title="screenshot2" src="http://www.iwebux.com/wp-content/uploads/2010/10/screenshot2.jpg" alt="" width="600" height="393" /></p>
<div style="width:420px;margin:0 auto;"><img src="http://www.iwebux.com/wp-content/uploads/2010/12/Screenshot.png" alt="" title="Screenshot" width="420" height="418" class="aligncenter size-full wp-image-579" /></div>
<h2>Change Log:</h2>
<p><strong>1.0.0</strong></p>
<p>    * Initial Release</p>
<p><strong>1.0.1</strong></p>
<p>    * Bug Fix for updates</p>
<p><strong>1.1.0</strong></p>
<p>    * Added new feature for disabling/enabling new users by default</p>
<p><strong>1.1.1</strong></p>
<p>    * Added new feature for disabling/enabling anonymous users by default</p>
<p><strong>2.0.0</strong></p>
<p>    * Added search function and pagination (by Digg style) .</p>
<p><strong>2.1.0</strong></p>
<p>    * Bug fix and compatible with WP 3.5.1.</p>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/NFwK2nsjEKs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/disableenable-wordpress-users/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/disableenable-wordpress-users/</feedburner:origLink></item>
		<item>
		<title>Inline edit using Ajax in Jquery</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/O6xq-NSYx5U/</link>
		<comments>http://www.iwebux.com/inline-edit-using-ajax-in-jquery/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 20:32:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[inline edits]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=439</guid>
		<description><![CDATA[AJAX is a technology that kept evolving from java applet days. It was notably used in web development when Google started deploying it in Gmail and Google maps extensively.

AJAX stands for Asynchronous Javascript and XML. As the name suggests the request from the end user is made asynchronously to the server. The requests and responses for the ajax is in XML format. ]]></description>
				<content:encoded><![CDATA[<div id="download-demo">
<span class="downloadtext"><a href="http://www.iwebux.com/demos/Ajax_tut.zip">Download</a></span><span class="divider">&nbsp;</span><span class="demotext"><a href="http://www.iwebux.com/demos/ajax" target="_blank">Demo</a></span>
</div>
<div id="requirements">
<h5>Requirements:</h5>
<p>This tutorial requires core javascript knowledge and basic knowledge about jquery.
</p></div>
<h2>What is Ajax ?</h2>
<p>AJAX is a technology that kept evolving from java applet days. It was notably used in web development when Google started deploying it in Gmail and Google maps extensively.</p>
<p>AJAX stands for Asynchronous Javascript and XML. As the name suggests the request from the end user is made asynchronously to the server. The requests and responses for the ajax is in XML format. </p>
<p>A request that is sent asynchronously from a browser to the server and receives the response in an async mode, doesn&#8217;t require you to refresh the page to display the results on the page. In other words, the user doesn&#8217;t realize when the request is been sent and the response is received back.</p>
<p>Now let us see an example of ajax using Jquery.</p>
<h2>Ajax in Jquery</h2>
<p>Jquery provides a very powerful library for ajax operations. As part of this tutorial, we will see how to edit the contents of the table and store that in the database using php and jquery. Remember we will be performing the inline edits asynchronously.</p>
<h2>Step 1:</h2>
<p>Let us start with building a database. Create a test database and load some test data.</p>
<p>Next we need to connect to database from our php code. Let me call this php file config.php and make sure you don&#8217;t give public access to it, as you will be storing all your DB credentials in this file.</p>
<pre name="code" class="php">
define('DBHOST','YOUR HOST');
define('DBUSER','USERNAME');
define('DBPASS','PASSWORD');
define('DBNAME','DBNAME');
/*code to follow*/
</pre>
<h2>Step 2:</h2>
<p>Now you can test your database connection and write a function to retrieve the contents from the test db you created in step1.</p>
<pre name="code" class="php">
$conn = mysql_connect(DBHOST,DBUSER,DBPASS);
mysql_select_db(DBNAME,$conn);

function get_data()
{
	
	$sql = "select * from TABLENAME";
	
	$rs = mysql_query($sql);
	
	return $rs;
}
</pre>
<h2>Step 3:</h2>
<p>Let us build the HTML to display the contents in a table we just retrieved from db in step 2. I marked the class of the td element that I want to edit to say &#8216;edit&#8217; followed by its tag and row number in the db for updating the respective record in db. </p>
<pre name="code" class="html">
<table>
<tbody>
<tr>
    <th>No</th>
    <th>Name</th>
    <th>Description</th>
    <th>Price</th>
</tr>
<!--populate table using php code -->
<tr>
<td>'.$rows['id'].'</td>
        <td class="edit name '.$rows['id'].'">'.$rows['name'].'</td>
        <td class="edit description '.$rows['id'].'">'.$rows['description'].'</td>
        <td class="edit price '.$rows['id'].'">'.$rows['price'].'</td>
</tr>
</tbody>
</table>
</pre>
<h2>Step 4:</h2>
<p>Now the table can be styled.</p>
<pre name="code" class="css">
body
{
	margin:0;
	padding:0;
	background:#f4f4f4;
}

h1{margin:80px auto 0;width:288px}

table
{
	margin:100px auto;
	width:500px;
	border:1px solid #646464;
	position:relative;
}

tr,td
{
	text-align:center;
	border: 1px solid #ccc;
}

tr
{
	background:#99F;
}

.heading{background:#ccc;}

.alt
{
	background:#C4C4FF;
}
</pre>
<h2>Step 5:</h2>
<p>So now we have come to the javascript portion of the tutorial that adds ajax to your table you built. I want to make the td element editable when a &#8216;click&#8217; event is triggered on it. The javascript that is used for making it an editable item is below,</p>
<pre name="code" class="javascript">
$('td.edit').click(function(){
$(this).addClass('ajax');
$(this).html('<input id="editbox" size="'+
$(this).text().length+'" type="text" value="' + $(this).text()+'">');										
$('#editbox').focus();
});
</pre>
<h2>Step 6:</h2>
<p>We also want the editable items to be switched around as we move clicking on other td elements. So I added a script that switches the ajax class among the editable elements. We can add this script to the click event function. Now the above code looks like this,</p>
<pre name="code" class="javascript">
$('td.edit').click(function(){
							 
 $('.ajax').html($('.ajax input').val());
 $('.ajax').removeClass('ajax');

 $(this).addClass('ajax');
 $(this).html('<input id="editbox" size="'+
$(this).text().length+'" type="text" value="' +
 $(this).text() + '">');
										
$('#editbox').focus();								        
  
} );
</pre>
<h2>Step 7:</h2>
<p>Next we want the edits made to be passed on to the server to store it in DB. I want that to happen when user presses Enter key. How can that be achieved? First we have to check if a user has pressed Enter key and next if it is Enter key pressed on that particular editable element, we have to pass the value entered by the user to our server side code to handle the data storage.</p>
<pre name="code" class="javascript">
$('td.edit').keydown(function(event){
    if(event.which == 13)
   { 
      $.ajax({    type: "POST",
      url:"config.php",
      data: //To be discussed in next step,
      success: function(data){
	   $('.ajax').html($('.ajax input').val());
	    $('.ajax').removeClass('ajax');
       }});
    }
								  
});
</pre>
<p>The above javascript tells the browser to look for the keydown event and if it is triggered it will check if the keypressed is &#8216;Enter key&#8217; ( Enter key value &#8217;13&#8242;). Once it passes the check it calls the &#8216;config.php&#8217; (server-side code). Note it uses the POST method for the call.</p>
<p> On a successful callback the success function gets executed. I want to make the editable area back to the regular td element. So we will be again removing the &#8216;ajax&#8217; class for that td element and pass the value of the editable box to the td element.</p>
<h2>Step 8:</h2>
<p>In the above step you would have noticed &#8216;data&#8217; key value pair. We will discuss how we are going to construct the data that will be sent as request to the config.php .</p>
<p>In Step 3, I have mentioned that editable td elements will be marked with their corresponding tag (table column name) and row number of the table. We are going to use that to pass as data to server-side along with the edited value.</p>
<p>so now the above code looks like this with complete data construction.</p>
<pre name="code" class="javascript">
$('td.edit').keydown(function(event){
	 arr = $(this).attr('class').split( " " );
	 if(event.which == 13)
	 { 
		$.ajax({    type: "POST",
			        url:"config.php",
				data: "value="+$('.ajax input').val()+
                                        "&#038;rownum="+arr[2]+"&#038;field="+arr[1],
				success: function(data){
					 $('.ajax').html($('.ajax input').val());
				         $('.ajax').removeClass('ajax');
			}});
		}
								  
	});
</pre>
<h2>Step 9:</h2>
<p>We have to write the function to handle the data that have been sent in the above step. Also this function will be called only if the data have been received from the browser. </p>
<pre name="code" class="php">
//check if the data is received from the browser
//and calls the update function
if(isset($_POST['rownum']))
{
	update_data($_POST['field'],$_POST['value'],$_POST['rownum']);
}
/*php code*/
function update_data($field, $data, $rownum)
{

	
	$sql = "update TABLENAME set ".$field." = '".$data."' where id = ".$rownum;
	
	mysql_query($sql) or die("Couldn't connect to db");
	
	
}
</pre>
<p>So now your config.php should looks like this</p>
<pre name="code" class="php">
define('DBHOST','YOUR HOST');
define('DBUSER','USERNAME');
define('DBPASS','PASSWORD');
define('DBNAME','DBNAME');

$conn = mysql_connect(DBHOST,DBUSER,DBPASS);
	
mysql_select_db(DBNAME,$conn);

if(isset($_POST['rownum']))
{
	update_data($_POST['field'],$_POST['value'],$_POST['rownum']);
}


function get_data()
{
	
	$sql = "select * from TABLENAME";
	
	$rs = mysql_query($sql);
	
	return $rs;
}

function update_data($field, $data, $rownum)
{

	
	$sql = "update TABLENAME set ".$field." = '".$data."' where id = ".$rownum;
	
	mysql_query($sql) or die("Couldn't connect to db");
	
	
}
</pre>
<h2>Step 10:</h2>
<p>Finally, I want to add the &#8216;blur&#8217; event to the editable box, so that the editable box disappears when the focus is blurred out from it.</p>
<pre name="code" class="javascript">
$('#editbox').live('blur',function(){
		$('.ajax').html($('.ajax input').val());
		$('.ajax').removeClass('ajax');
});
</pre>
<p><b>Note:</b><br />
The above script uses &#8216;live&#8217; keyword to bind the &#8216;blur&#8217; event to the editable box, because the &#8216;editbox&#8217; element is a dynamic one. It is been added dynamically when you click on any editable td element.</p>
<p>This completes the tutorial. Hope you enjoyed this tutorial and if you liked this tutorial consider sharing it.    </p>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/O6xq-NSYx5U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/inline-edit-using-ajax-in-jquery/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/inline-edit-using-ajax-in-jquery/</feedburner:origLink></item>
		<item>
		<title>Javascript Test Framework</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/Wq6bvMLzI3g/</link>
		<comments>http://www.iwebux.com/javascript-test-framework/#comments</comments>
		<pubDate>Sat, 25 Sep 2010 04:14:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[QBytes]]></category>
		<category><![CDATA[javascript libraries]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[mootols]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[test framework]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=417</guid>
		<description><![CDATA[JsFiddle is a javascript test framework where users can test their javascript code before placing it on their site. JsFiddle includes almost all javascript libraries available right now. JsFiddle is an evolution of MooShell, created and maintained by Pitor. Here are some of the examples from JsFiddle.]]></description>
				<content:encoded><![CDATA[<p>JsFiddle is a javascript test framework where users can test their javascript code before placing it on their site. JsFiddle includes almost all javascript libraries available right now. JsFiddle is an evolution of MooShell, created and maintained by Pitor.</p>
<p>Here are some of the examples from JsFiddle.</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/zalun/FZqZN/embedded/"></iframe></p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/r7MgY/embedded/"></iframe></p>
<p><iframe style="width: 100%; height: 500px" src="http://jsfiddle.net/timwienk/LgJsN/embedded/"></iframe></p>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/Wq6bvMLzI3g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/javascript-test-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/javascript-test-framework/</feedburner:origLink></item>
		<item>
		<title>Floating toolbar using jquery</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/67jksduqv8I/</link>
		<comments>http://www.iwebux.com/floating-toolbar-using-jquery/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 04:01:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[floating toolbar]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[social media]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=399</guid>
		<description><![CDATA[Demo I will walk you through how to create a floating toolbar for your website in this post using jquery. The floating toolbar sticks to page, even when user scrolls the page. All utilities or links that you need to show to the user can be placed in the toolbar. The user can access the [...]]]></description>
				<content:encoded><![CDATA[<div id="download-demo">
<span class="demotext"><a href="http://www.iwebux.com/demos/toolbar.html" target="_blank">Demo</a></span>
</div>
<p>I will walk you through how to create a floating toolbar for your website in this post using jquery. The floating toolbar sticks to page, even when user scrolls the page.</p>
<p>All utilities or links that you need to show to the user can be placed in the toolbar. The user can access the utilities without having them to leave the current section where user is in.</p>
<p>Well, enough about me describing the floating toolbar, let us see it in action.</p>
<h2>Step 1:</h1>
<p>First I am going to start with the HTML,</p>
<pre name="code" class="html">
<div id="toolbar">
        <div id="move">Move Up</div>
   	<div id="socialmedia">
             <div id="twitter"><a href="#">Twitter</a></div>
            <div id="facebook"><a href="#">Facebook</a></div>
            <div id="buzz"><a href="#">buzz</a></div>
	    <div id="reddit"><a href="#">reddit</a></div>
            <div id="sharethis"><a href="#">Sharethis</a></div>
        </div>
   </div>
</pre>
<h2>Step 2:</h2>
<p>Next, lets add some styles to the HTML,</p>
<pre class="css" name="code">
  body
  {
      background:#ccc;
      min-height: 1000px;
      margin: 0;
      padding: 0;
  }

  
  a{color:#fff;}
  
  #toolbar{
      background:url(toolbar.png) no-repeat center center; 
     margin: 0 auto; 
     height:35px;
     position:fixed;
     bottom:0;
     width:100%
  }
  
  .moveup{position:fixed;top:0;}
  
  .movedown{position:fixed;bottom:0;}
  
  
  #move{
    color:#333;
    float:right;
    font-size:11px;
    position:static;
    width:70px;
    font-weight:bold;
  }
  
  #move:hover{
      cursor:pointer;
  }
  
  #socialmedia{margin: 0 auto; width:450px;}
  
  #twitter,#facebook,#buzz,#reddit,#sharethis
  {
      float:left;
      padding:5px 20px;
  }
</pre>
<h2>Step 3:</h2>
<p>Now we have added the styles to the HTML, to bring the floating toolbar to life lets add javascript to it.</p>
<p>Once the page loads, after a while we want the toolbar to go transparent, with some nice animation effect.</p>
<pre class="javascript" name="code">
      $('#toolbar').animate({opacity:0.1},{duration: 'slow', queue: false});
</pre>
<h2>Step 4:</h2>
<p>When you move the mouse over the page, the toolbar should be highlighted, lets set the opacity to 1 if mousemove event is triggered on the page.</p>
<pre class="javascript" name="code">
      $(this).mousemove(function(event){
            $('#toolbar').animate({opacity: 1},{duration: 'slow', queue: false});
    });
</pre>
<h2> Step 5:</h2>
<p>I want to bring back the opacity to 0.1, if there is a idle period or inactivity. To find the inactivity over the page, let us write a small javascript function. I have used two global variables here, one for calculating the time elapsed by user inactivity and the other variable is to set the time interval.</p>
<pre name="code" class="javascript">
      var elapsedtime = 0;
      var time;
   
      //Function to calculate idle time

    $.fn.Idle = function(){
    return this.each(function(){
        
        var interval  = 2 //set 2 seconds max timeout
        
        time = setInterval(function(){
                  elapsedtime++;
                  if(elapsedtime == interval)
                    $('#toolbar').animate({opacity:0.1},{duration: 'slow', queue: false},'easeout');
        },2000);
                            

     });
    
   };
   
</pre>
<p>You can also use a jquery plugin to find idle time on your page. The following are the famous idle timer plugins,</p>
<ul>
<li>Paul Irish&#8217;s <a href="http://paulirish.com/2009/jquery-idletimer-plugin/" target="_blank"><strong>Idle Timer Plugin</strong></a></li>
<li>Werk&#8217;s <a href="http://www.frebsite.nl/werk/scripts/jquery_nap_plugin/" target="_blank"><strong>Nap Plugin</strong></a></li>
</ul>
<p>So now if you have inactivity for 2 seconds, the toolbar starts fading out.  </p>
<h2>Step 6:</h2>
<p>I want the toolbar not to fade out when I have mouse over the toolbar. But right now it fades out after 2 seconds. For that I have written one more function,</p>
<pre class="javascript" name="code">
     $.fn.toolbar = function(){
    
      return this.each(function(){
                             
        $('#toolbar').mousemove(function(event){
            window.clearInterval(time);
            $('#toolbar').animate({opacity: 1},{duration: 'slow', queue: false});
        });
        
        $('#toolbar').mouseout(function(event){
            elapsedtime = 0;
            $(this).Idle();
            $('#toolbar').animate({opacity:0.1},{duration: 'slow', queue: false});
        });
    });
    
  };
</pre>
<h2>Step 7:</h2>
<p>It would be nice to have the toolbar highlighted when we scroll the page. That&#8217;s right, this gives us the complete floating toolbar. The javascript that does the trick is below,</p>
<pre name="code" class="javascript">
     $(window).scroll(function(){
     
     elapsedtime = 0;
     
     $('#toolbar').animate({opacity: 1},{duration: 'slow', queue: false});
      
     });
</pre>
<h2>Step 8:</h2>
<p>Now what is next?  Lets allow the user to move the toolbar either top or bottom according to their convenience. Here is the script that toggles the toolbar.</p>
<pre name="code" class="javascript">
      $('#move').toggle(function(){
			$('#toolbar').removeClass('movedown');
			$('#toolbar').addClass('moveup');
			$(this).html('Move Down');
			$(this).css('top',35);
	},function(){
			$('#toolbar').removeClass('moveup');	
			$('#toolbar').addClass('movedown');
			$(this).html('Move Up');
			$(this).css('top',-12);
	});
</pre>
<h2>Step 9:</h2>
<p>We can integrate all the code pieces now and this is how it looks,</p>
<pre class="css" name="code">
  /*CSS Starts*/
  body
  {
      background:#ccc;
      min-height: 1000px;
      margin: 0;
      padding: 0;
  }

  
  a{color:#fff;}
  
  #toolbar{
      background:url(toolbar.png) no-repeat center center; 
      margin: 0 auto; 
      height:35px;
      position:fixed;
      bottom:0;
      width:100%
  }
  
  .moveup{position:fixed;top:0;}
  
  .movedown{position:fixed;bottom:0;}
  
  
  #move{
    color:#333;
    float:right;
    font-size:11px;
    position:relative;
    top:-12px;
    right: 218px;
    width:70px;
    font-weight:bold;
  }
  
  #move:hover{
      cursor:pointer;
  }
  
  #socialmedia{margin: 0 auto; width:450px;}
  
  #twitter,#facebook,#buzz,#reddit,#sharethis
  {
      float:left;
      padding:5px 20px;
  }
/*CSS Ends*/
 </pre>
<pre name="code" class="javascript">
/*Javascript Starts */


var elapsedtime = 0;
var time;

$.fn.Idle = function(){
    return this.each(function(){
        
        var interval  = 2 //set 2 seconds max timeout
        
        time = setInterval(function(){
                  elapsedtime++;
                  if(elapsedtime == interval)
                    $('#toolbar').animate({opacity:0.1},
                   {duration: 'slow', queue: false},'easeout');
        },2000);
                            

    });
    
};


$.fn.toolbar = function(){
    
    return this.each(function(){
                             
        $('#toolbar').mousemove(function(event){
            window.clearInterval(time);
            $('#toolbar').animate({opacity: 1},
               {duration: 'slow', queue: false});
        });
        
        $('#toolbar').mouseout(function(event){
            elapsedtime = 0;
            $(this).Idle();
            $('#toolbar').animate({opacity:0.1},
                {duration: 'slow', queue: false});
        });
    });
    
};

                        
            

$(window).scroll(function(){
     
     elapsedtime = 0;
     
     $('#toolbar').animate({opacity: 1},
           {duration: 'slow', queue: false});
      
});



$(function(){    
    
    $(this).Idle();
    
    $('#toolbar').animate({opacity:0.1},
           {duration: 'slow', queue: false});
    
    $(this).mousemove(function(event){
            elapsedtime = 0;
            $('#toolbar').animate({opacity: 1},
               {duration: 'slow', queue: false});
    });
    
    $('#toolbar').toolbar();
    
    $('#move').toggle(function(){
            $('#toolbar').removeClass('movedown');
            $('#toolbar').addClass('moveup');
            $(this).html('Move Down');
            $(this).css('top',35);
    },function(){
            $('#toolbar').removeClass('moveup');    
            $('#toolbar').addClass('movedown');
            $(this).html('Move Up');
            $(this).css('top',-12);
    });
    
});
/*Javascript Ends*/
</pre>
<pre name="code" class="html">
<!--HTML Starts -->
   <div id="toolbar">
        <div id="move">Move Up</div>
           <div id="socialmedia">
            <div id="twitter"><a href="#">Twitter</a></div>
            <div id="facebook"><a href="#">Facebook</a></div>
            <div id="buzz"><a href="#">buzz</a></div>
            <div id="reddit"><a href="#">reddit</a></div>
            <div id="sharethis"><a href="#">Sharethis</a></div>
        </div>
   </div>
<!--HTML Ends -->

</pre>
<p>Hope you enjoyed this tutorial. If you have any comments or feedback, please use the form below for your voice to be heard. </p>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/67jksduqv8I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/floating-toolbar-using-jquery/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/floating-toolbar-using-jquery/</feedburner:origLink></item>
		<item>
		<title>HTML 5 Basics</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/SwX094GRB68/</link>
		<comments>http://www.iwebux.com/html-5-basics/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 00:00:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[difference between html 5 and html 4]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html 5 tutorial]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=352</guid>
		<description><![CDATA[HTML 5 is the most powerful version ever released. HTML 4 is a robust version that was released before. Since HTML 5 is built on top of that, it is backward compatible.  All older websites built on HTML 4 will still work in HTML 5 era. There is no need for any special arrangements for your websites to handle this transition. But not all browsers are ready yet to support all HTML 5 features introduced. Let us see how to face this transition and embrace the HTML 5.]]></description>
				<content:encoded><![CDATA[<p>HTML 5 is the most powerful version ever released. HTML 4 is a robust version that was released before. Since HTML 5 is built on top of that, it is backward compatible.  All older websites built on HTML 4 will still work in HTML 5 era. There is no need for any special arrangements for your websites to handle this transition. But not all browsers are ready yet to support all HTML 5 features introduced. Let us see how to face this transition and embrace the HTML 5.</p>
<p>So what is special about HTML 5 along with CSS3 and where does it stand out from their previous versions? The following features added to HTML 5 will definitely give you the answer.</p>
<h2>1. Doctype declaration:</h2>
<p>With older HTML versions the doctype declaration was a verbose one. I have been working on html almost every day, but still I don&#8217;t know the full doctype declaration that is used above &lt;html&gt; tag, atleast with me. But with HTML 5 it just requires <code>&lt;!DOCTYPE    html&gt;</code> and it is case insensitive.</p>
<h2>2. New Element tags</h2>
<p>There are a number new element tags added to HTML 5.</p>
<p><img class="aligncenter size-full wp-image-354" title="htmltags" src="http://www.iwebux.com/wp-content/uploads/2010/08/htmltags-small.jpg" alt="" width="600" height="390" /></p>
<p>An example comprising of some of the above tags</p>
<pre class="html" name="code">&lt;header&gt;Welcome to HTML5 Era&lt;/header&gt;
&lt;article&gt;
 &lt;hgroup&gt;
  &lt;h1&gt;Music&lt;/h1&gt;
  &lt;h2&gt;Trance - a genre of music&lt;/h2&gt;
 &lt;/hgroup&gt;
&lt;details&gt;
 &lt;summary&gt;Details about Trance&lt;/summary&gt;
 &lt;p&gt;Nation of origin: abc&lt;/p&gt;
 &lt;p&gt; History: Lposem seu edum ...&lt;/p&gt;
 &lt;p&gt;I like trance music&lt;/p&gt;
&lt;/details&gt;
&lt;figure&gt;
 &lt;img src="demo.jpg" alt="demo"&gt;
 &lt;figcaption&gt;Demo Image&lt;/figcaption&gt;
&lt;/figure&gt;
 &lt;section&gt;
  &lt;h1&gt;Techno Fusion&lt;/h1&gt;
  &lt;p&gt;Music fusion with techno beats&lt;/p&gt;
   &lt;meter min="0" max="100" value="75"&gt;Percentage&lt;/meter&gt;
   &lt;mark&gt;Like&lt;/mark&gt;
 &lt;/section&gt;
 &lt;section&gt;
  &lt;h1&gt;Electronica&lt;/h1&gt;
  &lt;p&gt;Not a trance, but a variation of techno&lt;/p&gt;
  &lt;meter min="0" max="100" value="75"&gt;Percentage&lt;/meter&gt;
  &lt;mark&gt;Like&lt;/mark&gt;
 &lt;/section&gt;
&lt;/article&gt;
&lt;/footer&gt;&lt;time&gt;Jul 04, 2010&lt;/time&gt;&lt;/footer&gt;
</pre>
<h2>3. New Input types</h2>
<p>The following is a list of new input types,</p>
<p><img class="aligncenter size-full wp-image-360" title="inputtypes" src="http://www.iwebux.com/wp-content/uploads/2010/08/inputtypes-small.jpg" alt="" width="600" height="244" /></p>
<h2>4. New Attributes</h2>
<p><img class="aligncenter size-full wp-image-368" title="attributes" src="http://www.iwebux.com/wp-content/uploads/2010/08/attributes-small.jpg" alt="" width="600" height="143" /></p>
<h2>5. How to check the support of HTML5 features in your browsers?</h2>
<p>&#8220;Modernizr&#8221; is a script that is released under MIT license. The latest stable version is 1.5 . It supports the ability to check most of the features of HTML 5.</p>
<ul>
<li>Download the script from <a href="http://www.modernizr.com/" target="_blank"><strong>here</strong></a></li>
<li>Include the script in your head tag</li>
<li>Check for the support in your browser as given below.</li>
</ul>
<pre class="javascript" name="code"> 
if (Modernizr.XYZ) {

// XYZ feature of HTML 5 is supported

} else {

//XYZ feature of HTML 5 is not supported by your browser.
//Implement Fallback approach
}
</pre>
<p>For more information on how to check for the support for different HTML 5 features, click <a href="http://www.modernizr.com/docs/" target="_blank"><strong>here</strong></a> .</p>
<h2>6. How to accommodate cross browsers?</h2>
<p>Google chrome frame is an ideal solution to support more HTML 5 features in cross browsers, especially  IE browsers. It also accelerates the execution time for javascript used in your web pages. Chrome frame is still in beta version lacking support for some of the features of HTML 5. To get started with chrome frame follow the link <a href="http://code.google.com/chrome/chromeframe/" target="_blank"><strong>here</strong></a>.</p>
<h2>7. What is next?</h2>
<p>HTML 5 has created lot of expectations and of course raised more questions among web application developers. But importantly re-thinking the way the traditional web development practices were followed. Retrospecting the practices that were followed with web development approach, HTML 5 has taken web development into a new different level. Now the CSS role among  html elements is getting refined.</p>
<p>HTML 5 also created a new sensation in rich media web applications and the way content is delivered. This is a whole new perspective of HTML 5 delivering  rich media content with fallback approach to support different browsers and target all users. Kaltura is one, that embraced HTML 5 and came up with rich media content delivery network with fall back approach for HTML 5. For more information on Kaltura click <a href="http://corp.kaltura.com/" target="_blank"><strong>here</strong></a>.</p>
<p>This is an overview of HTML 5 features for those who are ready to move from HTML 4 to HTML 5. I have not covered advanced topics of HTML 5 here.</p>
<p>Do you have anything to share about HTML 5 ? Post your comments below.</p>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/SwX094GRB68" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/html-5-basics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/html-5-basics/</feedburner:origLink></item>
		<item>
		<title>MVC in Code Igniter</title>
		<link>http://feedproxy.google.com/~r/Iwebux/~3/yTt79ukKZ7E/</link>
		<comments>http://www.iwebux.com/mvc-in-code-igniter/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 04:03:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[MVC pattern]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.iwebux.com/?p=289</guid>
		<description><![CDATA[MVC stands for Model View Controller. Those of you not familiar with MVC, it is a software design pattern. Basically it aims with separation of concern. Each component in your website architecture model has to do what it exactly needs to do.

For instance, your database connection class has to connect to the database and handle the connection state. It should not do any other work apart from the connection establishment to your DB. The bottom line is your components should not be over loaded.
]]></description>
				<content:encoded><![CDATA[<div id="download">
<span class="downloadtext"><a href="http://www.iwebux.com/demos/subscriber_demo.zip">Download Source Code</a></span>
</div>
<h2>Introduction:</h2>
<p>MVC stands for Model View Controller. Those of you not familiar with MVC, it is a software design pattern. Basically it aims with separation of concern. Each component in your website architecture model has to do what it exactly needs to do.</p>
<p>For instance, your database connection class has to connect to the database and handle the connection state. It should not do any other work apart from the connection establishment to your DB. The bottom line is your components should not be over loaded.</p>
<p><strong>M</strong> &#8211; Model (Represents the Database)</p>
<p><strong>V &#8211; </strong>View (Represents the HTML/CSS &#8211; Front End)</p>
<p><strong>C </strong>- Controller (Represents the middle component that bridges Model and View). Controllers are used for rendering the views.</p>
<p>More information on the MVC pattern can be found <a href="http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller" target="_blank"><strong>here</strong></a></p>
<h2>Code Igniter Framework:</h2>
<p>Code Igniter framework follows MVC pattern. The objective of this tutorial is to understand MVC in Code Igniter Framework. The prerequisite for this tutorial is Object Oriented Programming in PHP.  I walk you through an example of how to create an subscribers list and manage them, in Code Igniter.</p>
<h2>Step 1:</h2>
<p>Download the latest stable version of Code Igniter from <a href="http://codeigniter.com/downloads/" target="_blank"><strong>here</strong></a></p>
<h2>Step 2:</h2>
<p>Extract the downloaded package to your root directory of your site. Now the directory structure should like the following,</p>
<p>&lt;root directory&gt;<br />
&#8212;&#8212;-&gt;system<br />
&#8212;&#8212;-&gt;user_guide<br />
&#8212;&#8212;-&gt;index.php<br />
&#8212;&#8212;-&gt;license.txt</p>
<h2>Step 3:</h2>
<p>Now its time to set up your website environment. Look for &#8220;application&#8221; folder inside &#8220;system&#8221; folder. Copy that folder and place it under root directory,</p>
<p>&lt;root directory&gt;<br />
&#8212;&#8212;-&gt;application<br />
&#8212;&#8212;-&gt;system<br />
&#8212;&#8212;-&gt;user_guide<br />
&#8212;&#8212;-&gt;index.php<br />
&#8212;&#8212;-&gt;license.txt</p>
<p>Change the following in /application/config/config.php and remove the index.php, so that it is not displayed in the url.</p>
<pre class="php" name="code">$config['base_url']	= "YOUR SERVER URL";
$config['index_page'] = "";//Remove Index.php
</pre>
<h2>Step 4:</h2>
<p>If you have removed the index.php in the above step follow step 4 otherwise proceed to step 5. Add an .htaccess file with the following contents to your root directory.  These rewrite rules tell the server how to handle the removed index.php</p>
<pre class="php" name="code">RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</pre>
<h2>Step 5:</h2>
<p>To set up your home page of the site look for the /application/config/routes.php and change the following line,</p>
<pre class="php" name="code">$route['default_controller'] = "YOUR DEFAULT CONTROLLER";//Controller handling home page
</pre>
<h2>Step 6:</h2>
<p>Final step in setting up your website environment is assign database to your application. Change the following db variables in /application/config/database.php</p>
<pre class="php" name="code">$db['default']['hostname'] = "YOUR DB HOST NAME";
$db['default']['username'] = "YOUR DB USER NAME";
$db['default']['password'] = "YOUR DB PASSWORD";
$db['default']['database'] = "YOUR DATABASE NAME";
</pre>
<p>Remember, you should not set public access to this file in your server, as your db information will be available to others.  So make sure database.php is not accessible from outside the server.</p>
<h2>Step 7:</h2>
<p>Now we will be seeing an example application created using the code igniter framework. The features of the example are </p>
<ul>
<li>allows user to subscribe</li>
<li>store subscriber information in the db</li>
<li>admin access subscribers information and send email to the subscribers.</li>
</ul>
<p>Let us first start with creating a database for our application. We need a table for storing a subscribers information and a table for storing admin user information.</p>
<p><img src="http://www.iwebux.com/wp-content/uploads/2010/08/subscriber_table.jpg" alt="" title="subscriber_table" width="520" height="86" class="aligncenter size-full wp-image-312" /></p>
<p><img src="http://www.iwebux.com/wp-content/uploads/2010/08/panel.jpg" alt="" title="panel" width="520" height="123" class="aligncenter size-full wp-image-311" /></p>
<p>Fill in your admin user information in the &#8220;panelowner&#8221; table. We will be using MD5 hash for the password field, so make sure you apply md5 to your password field in phpMyadmin.</p>
<h2>Step 8:</h2>
<p>To begin with one should know that controllers file should be placed under controllers folder of your application directory and so as with view files in &#8220;view&#8221; folder and model files in &#8220;model&#8221; folder. Create a controller called &#8220;subscribe&#8221; for the subscriber front end. Call the model that will be used for the subscribe in the constructor and load the form helper class of Code Igniter(CI). This is where CI becomes very handy and more powerful. The form validation becomes very easy by using form_validation library. The function &#8220;feed&#8221; uses the form validation class provided by CI. </p>
<pre class="php" name="code">
class Subscribe extends Controller {
	
	function Subscribe()
	{
		parent::Controller();
		$this->load->helper('form');
		$this->load->model('subscribe_model');
	}
/*..... code to follow .......*/

function feed()
{
     ........Code..........
     //Load Form Validation Library
     $this->load->library('form_validation');
     /*..... code to follow.......*/
}
</pre>
<p>To set and check the validation rules, the code is below. The rule can be specifed as <strong>&#8216;email&#8217;, &#8216;Email&#8217;, &#8216;trim|required|valid_email|xss_clean&#8217;</strong> where email is the post field name, Email is the string used when error is displayed, required denotes a required field,valid_email checks for if the email is of the correct format, xss_clean and trim is used for the pruning the data. </p>
<pre class="php" name="code">	
    //Set Validation Rules
    $this->form_validation->set_rules(......rules......);
		
    //Run the Form Validation
    if ($this->form_validation->run() == TRUE)
    {
           /*..... do something if validation passes.......*/
    }
 </pre>
<h2>Step 9:</h2>
<p>Create a view for the controller subscriber. Let us name the file as subscriber.php and place it in view folder of the application directory. Using form helper method &#8220;form_open&#8221; we can create a form as below and &#8220;subscribe/feed&#8221; is the action url for the form where &#8220;subscribe&#8221; denotes the controller name and &#8220;feed&#8221; denotes method name available in that controller. By default &#8220;form_open&#8221; uses POST method. The validation errors can be displayed using &#8220;validation_errors&#8221;  method.</p>
<pre class="php" name="code">
if (function_exists('validation_errors') &#038;&#038; validation_errors())
{
	/*HTML Code*/
	echo validation_errors();
	/*HTML Code*/
}

       /*HTML Code*/
	 echo form_open('subscribe/feed'); 
        /*HTMl to follow*/
</pre>
<h2>Step 10:</h2>
<p>Create a model file named &#8220;subscriber_model.php&#8221; and place it under model folder of the application. Note that model filename should end as xxxx_model.php. First call the base class and load the database library provided by CI in the constructor. &#8220;subscribe_model.php&#8221; stores the subscriber&#8217;s email in the db. </p>
<pre class="php" name="code">
class Subscribe_model extends Model{
	function Subscribe_model()
	{
		//Load base classess
		parent::Model();
		$this->load->database();
	}
      /*.....Code to follow......*/
      $data = array('email' => $email); 
     $result = $this->db->insert('subscribers',$data);
     /*......Code to follow.......*/
}
</pre>
<h2>Step 11:</h2>
<p> Similarly the admin panel is also built. The admin panel has two views. One for the login screen and other for managing the subscribers. So as I said before each view has their corresponding controllers and models.<br />
The login session is created in the controller once the credentials match against the information in the database. The session is cleared when the admin logs out.</p>
<p>Load the session library provided by CI.</p>
<pre class="php" name="code">
function Admin()
{
      parent::Controller();
      $this->load->library('session');
      $this->load->helper('form');
      $this->load->model('admin_model');
}
</pre>
<pre class="php" name="code">
/*Session created if admin user credential match */
if($result)
{
	 //Set Admin User Seesion
	 $this->session->set_userdata(array('userid'=>$result[0]->id));
	 //Get Subscribers List
	 $result = $this->admin_model->get_subscribers();
	 //Call Manage
	 $this->manage_list($result,'Logged in successfully');
}
</pre>
<pre class="php" name="code">
/*Session data cleared once admin user logs out*/
function logout()
{
	 //Clear Admin User Seesion
	 $this->session->set_userdata(array('userid'=>''));
	 $data['message'] = "Logged out successfully";
	 //Load Views
	 $this->load->view('adminheader');
	 $this->load->view('admin',$data);
	 $this->load->view('footer');
}
</pre>
<p><strong>Note:</strong><br />
I have used email class library provided by CI for sending emails to the subscribers. </p>
<pre class="php" name="code">
function send_mail()
{
        //Load email library
	$this->load->library('email');
       /*Code to follow*/
       
	//Prepare Email 
	$this->email->from('admin@demo.com', 'Admin');
	$this->email->subject('Subscriber Demo');
	$this->email->message($emailMessage);
	foreach($result as $iterator)
	{
		$this->email->to($iterator->email);
		$this->email->send();
	}
     /*Code to follow*/

}
</pre>
<p>There is bug in the email class that comes with CI package. To fix the bug go to /system/library/Email.php . On line number :938 look for the following code,</p>
<pre class="php" name="code">
if ($this->protocol == 'mail')
{
	$this->_subject = $this->_headers['Subject'];
	unset($this->_headers['Subject']);
}
</pre>
<p>change it to</p>
<pre class="php" name="code">
if ($this->protocol == 'mail')
{
	if (array_key_exists('Subject', $this->_headers))
	{
		$this->_subject = $this->_headers['Subject'];
		unset($this->_headers['Subject']);
	}
}

</pre>
<p>Hope this tutorial will be a good starting point to learn more about Code Igniter framework.   </p>
<img src="http://feeds.feedburner.com/~r/Iwebux/~4/yTt79ukKZ7E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.iwebux.com/mvc-in-code-igniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.iwebux.com/mvc-in-code-igniter/</feedburner:origLink></item>
	</channel>
</rss>
