<?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/"
	>

<channel>
	<title>Shahriat's Blog</title>
	<atom:link href="http://shahriat.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shahriat.com</link>
	<description>My Experience Lists</description>
	<pubDate>Sun, 05 Jul 2009 14:08:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Some common osCommerce errors and their fixing</title>
		<link>http://shahriat.com/some-common-oscommerce-errors-and-their-fixing/</link>
		<comments>http://shahriat.com/some-common-oscommerce-errors-and-their-fixing/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 14:40:42 +0000</pubDate>
		<dc:creator>Shahriat</dc:creator>
		
		<category><![CDATA[osCommerce]]></category>

		<category><![CDATA[osCommerce error fixing]]></category>

		<category><![CDATA[osCommerce errors]]></category>

		<category><![CDATA[osCommerce solutions]]></category>

		<guid isPermaLink="false">http://shahriat.com/?p=71</guid>
		<description><![CDATA[When I worked with osCommerce projects I had experienced with some common errors those I have mentioned  here and also their solutions :

Error Type : Warning: session_save_path() [function.session-save-path]: SAFE MODE Restriction in effect. The script whose uid is X is not allowed to access owned by uid Y in /path/to/your/oscommerce/catalog/includes/functions/sessions.php on line 167


How to [...]]]></description>
			<content:encoded><![CDATA[<p>When I worked with osCommerce projects I had experienced with some common errors those I have mentioned  here and also their solutions :</p>
<pre class="brush: html;">
Error Type : Warning: session_save_path() [function.session-save-path]: SAFE MODE Restriction in effect. The script whose uid is X is not allowed to access owned by uid Y in /path/to/your/oscommerce/catalog/includes/functions/sessions.php on line 167
</pre>
<pre class="brush: html;">
How to fix:
Step 1:  Open catalog/includes/functions/sessions.php
</pre>
<p>Find the following code </p>
<pre class="brush: php;">
function tep_session_save_path($path = '') {
    if (!empty($path)) {
      return session_save_path($path);
    } else {
      return session_save_path();
    }
  }
</pre>
<p>and replace with the following code </p>
<pre class="brush: php;">
  function tep_session_save_path($path = '') {
  if (STORE_SESSIONS != 'mysql') {
    if (!empty($path)) {
      return session_save_path($path);
    } else {
      return session_save_path();
    }
  }
  } </pre>
<pre class="brush: html;">
Step 2: Open catalog/admin/includes/functions/sessions.php
</pre>
<p>Find the following code </p>
<pre class="brush: php;">
  function tep_session_save_path($path = '') {
    if ($path != '') {
      return session_save_path($path);
    } else {
      return session_save_path();
    }
  }
  </pre>
<p>and replace with the following code </p>
<pre class="brush: php;">
  function tep_session_save_path($path = '') {
  if (STORE_SESSIONS != 'mysql') {
    if (!empty($path)) {
      return session_save_path($path);
    } else {
      return session_save_path();
    }
  }
  }
</pre>
<pre class="brush: html;">
Error Type: Warning: I am able to write to the configuration file:  catalog/includes/configure.php. This is a potential security risk - please set the right user permissions on this file.
</pre>
<pre class="brush: html;">
How to fix:
Make  chmod catalog/includes/configure.php  file to 644
If you are using windows server right  click on catalog/includes/configure.php file
Select  'Properties' (a small window will be opened )
Select/Tick  on Attributes:   'Read-only' and click OK
</pre>
<pre class="brush: html;">
Error Type:  Warning: session_start() [function.session-start]: open(/tmp\sess_d6bde9ac679d6e3434615010f05b922c, O_RDWR) failed: No such file or directory (2) in catalog\admin\includes\functions\sessions.php on line 102

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\osc_skin\admin\includes\functions\sessions.php:102) in catalog\admin\includes\functions\sessions.php on line 102

Warning: Cannot modify header information - headers already sent by (output started at catalog\admin\includes\functions\sessions.php:102) in catalog\admin\includes\functions\general.php on line 22

Warning: Unknown: open(/tmp\sess_d6bde9ac679d6e3434615010f05b922c, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
</pre>
<p>How to fix:</p>
<pre class="brush: html;">
Step 1:  Open catalog/includes/configure.php
and define session_store to 'mysql'

Step 1-a:  Open catalog/admin/includes/configure.php

and define SESSION_STORES to 'mysql'
</pre>
<p>I recommend not to use php close tag ?> in the full php script which will help to remove output buffering, white space from the script  as a result headers never send before the script is executing.</p>
]]></content:encoded>
			<wfw:commentRss>http://shahriat.com/some-common-oscommerce-errors-and-their-fixing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Magento Installation on XAMPP and WAMP</title>
		<link>http://shahriat.com/magento-installation-on-xampp-and-wamp/</link>
		<comments>http://shahriat.com/magento-installation-on-xampp-and-wamp/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 12:55:28 +0000</pubDate>
		<dc:creator>Shahriat</dc:creator>
		
		<category><![CDATA[Magento]]></category>

		<category><![CDATA[install magento on wamp]]></category>

		<category><![CDATA[install magento on xampp]]></category>

		<category><![CDATA[magento ecommerce]]></category>

		<category><![CDATA[Magento installation]]></category>

		<category><![CDATA[magentocommerce]]></category>

		<category><![CDATA[wamp]]></category>

		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://shahriat.com/?p=61</guid>
		<description><![CDATA[Magento is a feature-rich eCommerce solution built on open-source technology using PHP. When I first learned  Magento of course I had to follow some instructions to install Magento in my local server and here is some short instructions by which someone can get help. It can be easily installed on windows with XAMPP and [...]]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.magentocommerce.com" target="_blank">Magento</a> is a feature-rich eCommerce solution built on open-source technology using PHP. When I first learned  <a href="http://www.magentocommerce.com" target="_blank">Magento</a> of course I had to follow some instructions to install Magento in my local server and here is some short instructions by which someone can get help. It can be easily installed on windows with XAMPP and WAMP and before it, I recommend to install the latest version of XAMPP or WAMP. It is also a best practise using the latest version of any software because the latest version has the previous bug fixed and the new release is published.</p>
<p>Download the latest version of Magento from here <a href="http://www.magentocommerce.com/download" target="_blank">http://www.magentocommerce.com/download</a> and after unzipping keep the magento folder or renaming it to your server root doc. For XAMPP htdocs is the server root folder and www for WAMP. Now follow the instructions here</p>
<p>1)<br />
1.</p>
<pre class="brush: js;">#LoadModule rewrite_module modules/mod_rewrite.so</pre>
<p>to</p>
<p>1.</p>
<pre class="brush: js;">
LoadModule rewrite_module modules/mod_rewrite.so</pre>
<p>(just remove the # ) in your httpd.conf file</p>
<p>2) Edit apache/bin/php.ini and php/php.ini (same changes on both files) change lines (the first change is not necessary on xampp):</p>
<p>1.</p>
<pre class="brush: js;">
;extension=php_mcrypt.dll</pre>
<p>to</p>
<p>1.</p>
<pre class="brush: js;">
extension=php_mcrypt.dll</pre>
<p>and changes lines:</p>
<p>1.</p>
<pre class="brush: js;">
;extension=php_curl.dll</pre>
<p>to</p>
<p>1.</p>
<pre class="brush: js;">
extension=php_curl.dll</pre>
<p>(just remove the ; )</p>
<p>2-a) On WAMP you must also change the following line in apache2/bin/php.ini and php/php.ini changes lines:</p>
<p>1.</p>
<pre class="brush: js;">      ;extension=php_pdo_mysql.dll</pre>
<p>to</p>
<p>1.</p>
<pre class="brush: js;">extension=php_pdo_mysql.dll</pre>
<p>(just remove the ; )</p>
<p>In addition to php_pdo_mysql.dll, you may also need to make sure you are loading:</p>
<p>1.</p>
<pre class="brush: js;">      extension=php_pdo.dll</pre>
<p>3) Restart all servers</p>
<p>4) Goto: http://localhost/magento/install (replace the above “magento” with where your installation was extracted to)</p>
<p>5) On page 2 “Configuration” change database as needed and change Secure Connection to: (XAMPP actually supports SSL over port 443 - so this step is not needed if you want to test SSL)</p>
<pre class="brush: js;">
Secure Host: localhost (could be different)
Secure Base Path: /magento/ (also could be different)
Secure Protocol: http
Secure Port: 80
</pre>
<p>6) Continue with install, all should be good!</p>
<p>NOTE If you can’t login to the administration panel after installation, that’s because there’s a cookie problem. Add these lines:</p>
<pre class="brush: js;">
127.0.0.1        magento.localhost.com www.localhost.com
</pre>
<p>to:</p>
<p>C:WindowsSystem32driversetchosts (edit this file in notepad)</p>
<p>Then go to www.localhost.com/</p>
]]></content:encoded>
			<wfw:commentRss>http://shahriat.com/magento-installation-on-xampp-and-wamp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Refresh particular div by jQuery</title>
		<link>http://shahriat.com/refresh-particular-div-by-jquery/</link>
		<comments>http://shahriat.com/refresh-particular-div-by-jquery/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 19:23:10 +0000</pubDate>
		<dc:creator>Shahriat</dc:creator>
		
		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[jQuery & PHP]]></category>

		<category><![CDATA[auto refresh by jquery]]></category>

		<category><![CDATA[auto refresh div]]></category>

		<category><![CDATA[freelancer]]></category>

		<category><![CDATA[Jquery]]></category>

		<category><![CDATA[jquery ajax]]></category>

		<category><![CDATA[jquery expert]]></category>

		<category><![CDATA[jquery freelancer]]></category>

		<category><![CDATA[jquery programmer]]></category>

		<category><![CDATA[php freelancer]]></category>

		<category><![CDATA[php programmer]]></category>

		<category><![CDATA[programmer]]></category>

		<category><![CDATA[refresh div]]></category>

		<category><![CDATA[web application developer]]></category>

		<category><![CDATA[web developer]]></category>

		<guid isPermaLink="false">http://shahriat.com/?p=39</guid>
		<description><![CDATA[First we will make a customize function called getRefresh() -

function getRefresh(){
$(”#auto”).load(”data.php”, ”, callback);
}

Here we have used load( url, [data], [callback] ) ajax api. This api load HTML output  from a remote file (data.php) and inject it into the div (auto). Below we have created a callback function named callback() -

function callback(){
setTimeout(”getRefresh()”, 1000);
}

setTimeout() function is [...]]]></description>
			<content:encoded><![CDATA[<p>First we will make a customize function called getRefresh() -</p>
<pre class="brush: js;">
function getRefresh(){
$(”#auto”).load(”data.php”, ”, callback);
}
</pre>
<p>Here we have used load( url, [data], [callback] ) ajax api. This api load HTML output  from a remote file (data.php) and inject it into the div (auto). Below we have created a callback function named callback() -</p>
<pre class="brush: js;">
function callback(){
setTimeout(”getRefresh()”, 1000);
}
</pre>
<p>setTimeout() function is used  to call getRefresh() after a specified number of milliseconds (1000). Now we can add some jQuery effect to realize that the div is refreshing automatically</p>
<pre class="brush: js;">
function getRefresh(){
$(”#auto”).fadeIn(”slow”);
$(”#auto”).load(”data.php”, ”, callback);
}
function callback(){
$(”#auto”).fadeOut(”slow”);
setTimeout(”getRefresh();”, 1000);
}
</pre>
<p>And finally here is the complete code  -</p>
<pre class="brush: php;">
// for jQuery html
&lt;html&gt;
  &lt;head&gt;
  &lt;script src=”http://code.jquery.com/jquery-latest.js”&gt;&lt;/script&gt;
  &lt;script type=”text/javascript”&gt;
  function getRefresh() {
  $(”#auto”).fadeIn(”slow”);
  $(”#auto”).load(”data.php”, ”, callback);
  }
function callback() {
  $(”#auto”).fadeOut(”slow”);
  setTimeout(”getRefresh();”, 1000);
  }
  $(document).ready(getRefresh);
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Auto refresh div by jQuery &lt;/h1&gt;
  &lt;div id=”auto”&gt;
  Random text goes here
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </pre>
<p>// for php server scripting language<br />
// data.php</p>
<pre class="brush: php;">
  mysql_connect(”localhost”, “root”, “”);
  mysql_select_db(”dbname”);
  $result = mysql_query(”select * from tblname”);
  while ($row = mysql_fetch_object($result)) {
  echo $row-&gt;username.’’;
  }
  mysql_free_result($result);
  </pre>
]]></content:encoded>
			<wfw:commentRss>http://shahriat.com/refresh-particular-div-by-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>URI Routing</title>
		<link>http://shahriat.com/uri-routing/</link>
		<comments>http://shahriat.com/uri-routing/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 19:16:41 +0000</pubDate>
		<dc:creator>Shahriat</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

		<category><![CDATA[codeigniter uri routing rules]]></category>

		<category><![CDATA[how to control query strings by uri rerouting]]></category>

		<category><![CDATA[pass query strings by uri routing]]></category>

		<category><![CDATA[rearrange url]]></category>

		<category><![CDATA[routing rules]]></category>

		<category><![CDATA[uri]]></category>

		<category><![CDATA[uri rerouting]]></category>

		<category><![CDATA[url]]></category>

		<category><![CDATA[url rewrite]]></category>

		<category><![CDATA[url segments reducing]]></category>

		<guid isPermaLink="false">http://shahriat.com/?p=37</guid>
		<description><![CDATA[Uniform Resource Identifier or URI  consists of a string of character used to name a resource on the Internet. The name of a resource on the Internet should be naming conventional so that Search Engine like google , yahoo, ask etc. can easily find out. And it can be possible if we arrange the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Uniform Resource Identifier or</strong> <strong>URI </strong> consists of a string of character used to name a resource on the Internet. The name of a resource on the Internet should be naming conventional so that Search Engine like google , yahoo, ask etc. can easily find out. And it can be possible if we arrange the URI perfectly following some rules of URI Routing. In CodeIgniter the segments in a URI normally follow a pattern like this -</p>
<pre class="brush: php;">

www.mysite.com/myclass/myfunction/myparam
</pre>
<p>Suppose that we have a URL like below -</p>
<pre class="brush: php;">

http://localhost/TestingServer/home/chidc/mid/4/sid/11/chid/12
</pre>
<p>where “http://localhost/TestingServer/”  is our BASE URL  and others are segments. If we describe the above URI following the CodeIgniter pattern -</p>
<pre class="brush: php;">

http://localhost/TestingServer/home(myclass)/chidc(myfunction)/mid(paramname1)
/4(paramvalue1)/sid(paramname2)/11(paramvalue2)/chid(paramname3)/12(paramvalue3)
</pre>
<p>Now we will apply our own routing rules to the above URL.</p>
<p>In CodeIgniter routing rules are defined <var></var>in application/config/routes.php file.</p>
<pre class="brush: php;">

// routes.php

&lt;?php  if ( ! defined(’BASEPATH’)) exit(’No direct script access allowed’);
/*
| ————————————————————————-
| URI ROUTING
| ————————————————————————-
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
|     example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
|    http://codeigniter.com/user_guide/general/routing.html
|
| ————————————————————————-
| RESERVED ROUTES
| ————————————————————————-
|
| There are two reserved routes:
|
|    $route['default_controller'] = ‘welcome’;
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the “welcome” class
| would be loaded.
|
|    $route['scaffolding_trigger'] = ’scaffolding’;
|
| This route lets you set a “secret” word that will trigger the
| scaffolding feature for added security. Note: Scaffolding must be
| enabled in the controller in which you intend to use it.   The reserved
| routes must come before any wildcard or regular expression routes.
|
*/

$route['default_controller'] = “home”;
$route['scaffolding_trigger'] = “”;

/* End of file routes.php */
/* Location: ./system/application/config/routes.php */

?&gt;
</pre>
<p>Here $route is an array by which we can specify our own routing rules. Now we are going to specify our own routing rules below -</p>
<pre class="brush: php;">

$route['childmenu/([0-9]+)/([0-9]+)/([0-9]+)’] = “home/chidc/mid/$1/sid/$2/chid/$3″;
</pre>
<p>Here segments childmenu and regular expressions will be remapped to the  ‘home’ class ,  ‘chidc’ function and three params value ‘mid’, ’sid’, ‘chid’.</p>
<p>By adding above code to routes.php file -</p>
<pre class="brush: php;">

// modified routes.php

&lt;?php  if ( ! defined(’BASEPATH’)) exit(’No direct script access allowed’);
/*
| ————————————————————————-
| URI ROUTING
| ————————————————————————-
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
|     example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
|    http://codeigniter.com/user_guide/general/routing.html
|
| ————————————————————————-
| RESERVED ROUTES
| ————————————————————————-
|
| There are two reserved routes:
|
|    $route['default_controller'] = ‘welcome’;
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the “welcome” class
| would be loaded.
|
|    $route['scaffolding_trigger'] = ’scaffolding’;
|
| This route lets you set a “secret” word that will trigger the
| scaffolding feature for added security. Note: Scaffolding must be
| enabled in the controller in which you intend to use it.   The reserved
| routes must come before any wildcard or regular expression routes.
|
*/

$route['default_controller'] = “home”;
$route['scaffolding_trigger'] = “”;

// Customized routing rules
$route['childmenu/([0-9]+)/([0-9]+)/([0-9]+)’] = “home/chidc/mid/$1/sid/$2/chid/$3″;
/* End of file routes.php */
/* Location: ./system/application/config/routes.php */

?&gt;
</pre>
<p>Below we will go to the  finished step for view -</p>
<pre class="brush: php;">

// view.php

&lt;a href=”&lt;?=base_url()?&gt;childmenu/&lt;?=$id1?&gt;/&lt;?=$id2?&gt;/&lt;?=$id3?&gt;”&gt;Menu name&lt;/a&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shahriat.com/uri-routing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A simple trick to apply alternate css class part 1</title>
		<link>http://shahriat.com/a-simple-trick-to-apply-alternate-css-class-part-1/</link>
		<comments>http://shahriat.com/a-simple-trick-to-apply-alternate-css-class-part-1/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 19:12:13 +0000</pubDate>
		<dc:creator>Shahriat</dc:creator>
		
		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[jQuery & PHP]]></category>

		<category><![CDATA[add class by jquery]]></category>

		<category><![CDATA[alternate css]]></category>

		<category><![CDATA[apply css on dymanic data]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[Jquery]]></category>

		<category><![CDATA[jquery addClass method]]></category>

		<category><![CDATA[jquery basic filter]]></category>

		<category><![CDATA[jquery last row select]]></category>

		<category><![CDATA[simple trick to css]]></category>

		<category><![CDATA[simple trick to dynamic data]]></category>

		<guid isPermaLink="false">http://shahriat.com/?p=34</guid>
		<description><![CDATA[In our professional work sometimes we  need to apply some simple trick to overcome complexity when retrieving data from database and showing those on user interface using loop.
Suppose that we have some data from database and showing them using loop on our interface like below -
First one we have designed static so that we [...]]]></description>
			<content:encoded><![CDATA[<p>In our professional work sometimes we  need to apply some simple trick to overcome complexity when retrieving data from database and showing those on user interface using loop.</p>
<p>Suppose that we have some data from database and showing them using loop on our interface like below -</p>
<p>First one we have designed static so that we can understand the format</p>
<pre class="brush: php;">
&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;td&gt;Username&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Shahriat&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Hossain&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Somel&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</pre>
<p>Now we will apply some style here -</p>
<pre class="brush: php;">

table tbody tr
{
background: url(../img/tbody_tr_bg.png) repeat-x left bottom;
}
</pre>
<p>After applying style we can get the output -</p>
<pre class="brush: php;">

Shahriat
……………………….  // dotted is the png image in our style
Hossain
………………………..
Somel
………………………..
</pre>
<p>Isn’t it very odd to look at our design has broken ? Certainly under Somel dotted (…..) should not be there. It will be then design broken issue. It can be solved if we keep the design static as it is adding extra class at the last row. But what about when we make it dynamic using loop retrieving data from database like below -</p>
<pre class="brush: php;">

foreach($a as $k=&gt;$v){
echo’
&lt;tr&gt;’;
  echo’
  &lt;td&gt;’.$v.’&lt;/td&gt;
  ’;
  echo’&lt;/tr&gt;
’;
}
</pre>
<p>jQuery is our best friend here to solve this type of problem and now we will go with a simple example here -</p>
<pre class="brush: php;">

$(”tr:last”).addClass(”no_bg”);
</pre>
<p>We have added a class no_bg using jQuery addClass method at the last row of table. Here (:last) is one of the jQuery basic filter which finds the last row of table. Its a single code isn’t it and after all getting out here is our complete code -</p>
<pre class="brush: php;">
&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
&lt;html xmlns=”http://www.w3.org/1999/xhtml”&gt;
&lt;head&gt;
&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;pre&gt;&lt;script src=&quot;&lt;a class=&quot;external free&quot; title=&quot;http://code.jquery.com/jquery-latest.js&quot; href=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;http://code.jquery.com/jquery-latest.js&lt;/a&gt;&quot;&gt;&lt;/script&gt;
&lt;/pre&gt;
&lt;script&gt;
$(document).ready(function(){
$(”tr:last”).addClass(”no_bg”);
});
&lt;/script&gt;
&lt;style&gt;
table tbody tr {
	background: url(../img/tbody_tr_bg.png) repeat-x left bottom;
}
.no_bg {
	background: none !important;
}
&lt;/style&gt;
&lt;/head&gt;&lt;body&gt;
&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;td&gt; Username &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;?php
foreach($a as $k=&gt;$v){
echo’&lt;tr&gt;’;
echo’&lt;td&gt;’.$v.’&lt;/td&gt;’;
echo’&lt;/tr&gt;’;
}
?&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>and the output is -</p>
<pre class="brush: php;">

Shahriat
……………..
Hossain
…………….
Somel
// no background image (………..) here
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shahriat.com/a-simple-trick-to-apply-alternate-css-class-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A simple trick to add static content block in magento template</title>
		<link>http://shahriat.com/a-simple-trick-to-add-static-content-block-in-magento-template/</link>
		<comments>http://shahriat.com/a-simple-trick-to-add-static-content-block-in-magento-template/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 19:08:49 +0000</pubDate>
		<dc:creator>Shahriat</dc:creator>
		
		<category><![CDATA[Magento]]></category>

		<category><![CDATA[how to create magento static page]]></category>

		<category><![CDATA[magento block customization]]></category>

		<category><![CDATA[magento static block]]></category>

		<category><![CDATA[magento template]]></category>

		<category><![CDATA[magento theme]]></category>

		<category><![CDATA[magento theme customization]]></category>

		<category><![CDATA[magento tutorial]]></category>

		<category><![CDATA[template]]></category>

		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://shahriat.com/?p=31</guid>
		<description><![CDATA[Just go to your magento admin panel and then CMS -&#62; Static Blocks
Now click on Add New Block button below and there will be a New Block form with some required fields. Now fill up all the required fields and save. Congrats! you have created your new static block . You have an identifier for [...]]]></description>
			<content:encoded><![CDATA[<p>Just go to your magento admin panel and then CMS -&gt; Static Blocks</p>
<p>Now click on Add New Block button below and there will be a New Block form with some required fields. Now fill up all the required fields and save. Congrats! you have created your new static block . You have an identifier for your static block that you should remember for the next step. Now you can call your static block using the code below</p>
<pre class="brush: php;">
&lt;?php
echo $this-&gt;getLayout()-&gt;createBlock(’cms/block’)-&gt;
setBlockId(’yourIdentifierNameHere’)-&gt;toHtml()
?&gt;
</pre>
<p>at anywhere in your template. You must replace setBlockId(’<span style="color: #99cc00;">yourIdentifierNameHere</span>‘) “YourIdentifierNameHere” with your created  Static Block’s  identifier name.</p>
]]></content:encoded>
			<wfw:commentRss>http://shahriat.com/a-simple-trick-to-add-static-content-block-in-magento-template/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to check dynamic group checkbox?</title>
		<link>http://shahriat.com/how-to-check-dynamic-group-checkbox/</link>
		<comments>http://shahriat.com/how-to-check-dynamic-group-checkbox/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 19:04:39 +0000</pubDate>
		<dc:creator>Shahriat</dc:creator>
		
		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[jQuery & PHP]]></category>

		<category><![CDATA[Jquery]]></category>

		<category><![CDATA[jQuery checkbox]]></category>

		<category><![CDATA[jQuery group checkbox]]></category>

		<guid isPermaLink="false">http://shahriat.com/?p=24</guid>
		<description><![CDATA[Suppose that I have an admin panel and there have a content management system. And contents are belong to  categories. Each category may have lots of contents and I want to delete the contents of each category separately. To make it possible first we will make an interface so that anybody can understand what [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose that I have an admin panel and there have a content management system. And contents are belong to  categories. Each category may have lots of contents and I want to delete the contents of each category separately. To make it possible first we will make an interface so that anybody can understand what is going to be happened through this post.</p>
<pre class="brush: php;">
&lt;ul&gt;
&lt;li&gt;
  &lt;input type=”checkbox” id=”category_id1″ /&gt;
  &lt;ul&gt;
    &lt;li&gt;
      &lt;input id=”content_id1″ name=”catgroup_id1″ type=”checkbox” /&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;input id=”content_id2″ name=”catgroup_id1″ type=”checkbox” /&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;input id=”content_id3″ name=”catgroup_id1″ type=”checkbox” /&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
&lt;li&gt;
  &lt;input id=”category_id2″ type=”checkbox” /&gt;
  &lt;ul&gt;
    &lt;li&gt;
      &lt;input id=”content_id4″ name=”catgroup_id2″ type=”checkbox” /&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;input id=”content_id5″ name=”catgroup_id2″ type=”checkbox” /&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;input id=”content_id6″ name=”catgroup_id2″ type=”checkbox” /&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
</pre>
<p>If we extend the above code then the format becomes like below -</p>
<pre class="brush: php;">
&lt;ul&gt;
  &lt;?php
  // php script
  Content_model-&gt;getContentsByParent($category-&gt;cate_id);
  ?&gt;
  &lt;li&gt;
    &lt;input id=”category_&lt;?=$category-&gt;cate_id?&gt;” onclick=”checkGroupBox(’&lt;?=$category-&gt;cate_id?&gt;’)” type=”checkbox” /&gt;
    &lt;ul&gt;
      &lt;li&gt;
        &lt;input id=”content_&lt;?=$content-&gt;content_id?&gt;” name=”catgroup_&lt;?=$category-&gt;cate_id?&gt;” type=”checkbox” /&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>and after above done here is our jQuery code to check the group checkbox below -</p>
<pre class="brush: php;">
&lt;script type=”text/javascript”&gt;
function checkGroupBox(id){
var groupname = ‘catgroup_’+id;
var checkedvalue = $(’#category_’+id).attr(’checked’) ? ‘checked’ : ”;
$(’input[name='+groupname+']‘).attr(’checked’, checkedvalue);
}
&lt;/script&gt;
</pre>
<p>You must link  jQuery core file to use this jQuery code that I have done on my some of last post. I have also used CodeIgniter’s code here and iterative looping system but you can use recursive function instead of iterative looping system which is advanced technique and more flexible. I will post some tutorials using recursive function in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://shahriat.com/how-to-check-dynamic-group-checkbox/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
