Saturday, July 24, 2010

Documentation of Boxy tab

We will going to see a css only boxy tab. I use only css to create this tab. See the image of boxy tab:

Boxy tab

The blue color will available for the hover tab.

First let's see the html structure for this tab.


And we applied the following css for our tab:

ul#nav {
    position: relative;    
    float: left;
    width: 99%;
    height: 150px;
    border-bottom: 1px solid #d9d9d9;
    border-top: 1px solid #d9d9d9;
    border-left: 1px solid #d9d9d9;    
}

ul#nav li {
    float: left;
    list-style: none;
    border-bottom: 7px solid #a9a9a9;
    border-left: 1px solid #a9a9a9;
    border-right: 1px solid #a9a9a9;
    border-top: 2px solid #a9a9a9;
    width: 156px;
    height: 140px;
    background-color: #fcfcfc;
}

ul#nav li:hover {
    border-bottom: 7px solid #0066cc;
    background-color: #f9f9f9;
}


ul#nav li a {
    color: #a9a9a9;
    position: relative;
    z-index: 2;
    float: left;
    font-size: 15px;
    text-decoration: none;
    padding: 35px 15px;
    font-weight: normal;
    letter-spacing: 1px;
    word-spacing: 5px;
    width: 140px;
    height: 140px;
}

ul#nav li a:hover {
    color: #0066cc;
}

ul#nav #selected {
    border-bottom: 7px solid #0066cc;
}

ul#nav #selected a {
    color: #0066cc;
}

You can download the code from here


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Download Boxy tab

We have seen the documentation of Boxy tab. You can download boxy tab from here.

Thanks for interest. Stay with us for more tahSin's gaRAge products.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Thursday, July 22, 2010

Documentation of My Form validation of codeigniter

We have seen the weakness of Form validation class for codeigniter. Let's see how we can fix this short comings. I have an extended Form validation class of codeigniter. we will discuss it here:

First of all, we are going to combine our $_FILES and $_POST variables together. we use php's array_merge to merge them.

/**
     * Constructor
     *
     * @author Tahsin Hasan 
     * @return void
     * @access public
     */
    public function __construct() {
        $_POST = (count($_FILES) > 0) ? array_merge($_POST,$_FILES) : $_POST;
        parent::__construct();
    }

After merging them together, we call our parent constructor function.
/**
     * Allowed types rule
     *
     * @author Tahsin Hasan 
     * @return bool
     * @param  str String field name to validate
     * @param  types String allowed types
     * @access public
     */
    public function allowed_types($str, $types)
    {
        $type = explode(',', $types);
        $filetype = pathinfo($str['name'],PATHINFO_EXTENSION);
        return (in_array($filetype, $type)) ? TRUE : FALSE;
    }

We are using two new rules for upload functions: allowed_types and max_file_size. In the allowed_types function we can set a range of allowed file types for our uploaded file.

/**
     * Setting maximum file upload size
     *
     * @author Tahsin Hasan 
     * @return bool
     * @param  str String field name to validate
     * @param  size Integer maximum upload size in bytes
     * @access public
     */

    public function max_file_size($str, $size)
    {
        return ($str['size']<=$size) ? TRUE : FALSE;
    }
In the max_file_size rule we checking the uploaded file whether it is uploaded in the specified file upload size.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Weakness of codeigniter Form Validation

Codeigniter Form Validation is a very popular validation library. we use this library quite extensively. But it has some short comings. we will discuss the shortcomings here.

the Form Validation library only validates $_POST fields. so, if we have a upload image in our form, this validation library always shows that the uploaded field is empty.

we set the validation rule for our upload field as follows:

$val->set_rules('userfile', 'Profile Picture', 'required');

This is because our uploaded file resides in the $_FILES variable, not in the $_POST field. So, we need to make some way to validate our $_FILES variable.

See my extended Form Validation library for codeigniter. This weakness has been overcome.

Other Links:

Documentation of Codeigniter Extend MY Form Validation Library.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to use MY extended Codeigniter Form Validation Library

We have seen the documentation of Codeigniter Form Validation library. now we will see how we will use it in our coding.

First, we need to download our library. Then we need to place it under the Application-> library folder.

As it is an extended version of Form Validation, so, we can have it by loading our form validation library.

$this->load->library('Form_validation');

Now we will set rule for our upload field like this:

$this-form_validation->set_rules('userfile', 'Profile Picture', 'required|allowed_types[jpg,png,jpeg]|max_file_size[10]');

By allowed_types[jpg]
Here by allowed_types[jpg,png,jpeg] we mean our allowed types are jpg, png and jpeg. And with max_file_size we set the maximum bytes that is allowed to upload.

$this-form_validation->set_message('allowed_types','Please upload jpg, jpeg and png types');

With this we can set custom messages for our rules.

Other Links:

Documentation of Codeigniter Extend MY Form Validation Library.

Weakness of Codeigniter Form Validation Library
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Download MY Form Validation Library for Codeigniter

We have seen the codeigniter Form Validation library weaknesses and also shown how we can solve that problem with the extend My Form Validation library.

We can download the Extended Form Validation library from here.

Thanks for download the Extended Form Validation library.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, July 17, 2010

curl + cookie + redirect = nightmare

Sometime we use curl to store cookies in the remote server. and do our workings accordingly. Curl comes up with two options to deal with cookie settings remotely. They are the followings:

  • COOKIEJAR: it sets the cookie variables in the local machine and stores it in a file. we store it for later use. This file is written in netscap cookie file format. the values are delimited with a tab. A cookie is stored on a single line.
  • COOKIEFILE: This variable sends the cookie file to the remote server.

see the following code block. it explains the above discussion.

//create cURL connection
        $curl_connection = curl_init('remote_server_url');

        //set options
        curl_setopt($curl_connection, CURLOPT_POST, TRUE);
        curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, false);        
        curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);        
        //set data to be posted        
        curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
        curl_setopt($curl_connection, CURLOPT_COOKIEJAR, 'cookies.txt');
        curl_setopt($curl_connection, CURLOPT_COOKIEFILE, 'cookies.txt');

Here we send the cookie with the last two lines.

Now if we redirect our header in the remote server, then there will be a problem. your server then could not find the cookie file. and you will be signed out or related problem will be arose.

To solve this problem, you need to set your cookie after redirect call is made. So, you need to set cookie like this after a redirection is made.

setcookie('asite', $site, time()+60*60, '/', 'site.com'); 


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Size of a request header field exceeds server limit.

I have come up a strange error. It shows me a bad server request and shows Size of a request header field exceeds server limit. So, it is a unusual problem. And I found that my server is requesting with another server with a corrupted cookie file. I am sharing with you the cookie file so you can understand the situation.

see the cookie:

Cookie: bbthreadview=a%3A70%3A%7Bi%3A18969%3Bi%3A103728909 5%3Bi%3A19045%3Bi%3A1037288969%3Bi%3A19048%3Bi%3A1 037251417%3Bi%3A19007%3Bi%3A1037265534%3Bi%3A15623 %3Bi%3A1037265450%3Bi%3A19044%3Bi%3A1037289051%3Bi %3A19056%3Bi%3A1037265739%3Bi%3A18908%3Bi%3A103731 8594%3Bi%3A19051%3Bi%3A1037266071%3Bi%3A14527%3Bi% 3A1037266336%3Bi%3A19055%3Bi%3A1037289037%3Bi%3A19 059%3Bi%3A1037295501%3Bi%3A19063%3Bi%3A1037295544% 3Bi%3A18848%3Bi%3A1037468521%3Bi%3A18876%3Bi%3A103 7295631%3Bi%3A18825%3Bi%3A1037295645%3Bi%3A19050%3 Bi%3A1037318211%3Bi%3A19067%3Bi%3A1037318506%3Bi%3 A19089%3Bi%3A1037318521%3Bi%3A19083%3Bi%3A10373185 24%3Bi%3A19086%3Bi%3A1037318545%3Bi%3A19049%3Bi%3A 1037326825%3Bi%3A18763%3Bi%3A1037326941%3Bi%3A1911 7%3Bi%3A1037370172%3Bi%3A19097%3Bi%3A1037370207%3B i%3A19119%3Bi%3A1037372349%3Bi%3A19104%3Bi%3A10374 02713%3Bi%3A19120%3Bi%3A1037374210%3Bi%3A19112%3Bi %3A1037374223%3Bi%3A19082%3Bi%3A1037374259%3Bi%3A1 9126%3Bi%3A1037377619%3Bi%3A19122%3Bi%3A1037377727 %3Bi%3A19133%3Bi%3A1037396564%3Bi%3A19145%3Bi%3A10 37396573%3Bi%3A19137%3Bi%3A1037396582%3Bi%3A17962% 3Bi%3A1037403501%3Bi%3A19147%3Bi%3A1037421857%3Bi% 3A19167%3Bi%3A1037486584%3Bi%3A19158%3Bi%3A1037487 034%3Bi%3A19164%3Bi%3A1037463102%3Bi%3A19021%3Bi%3 A1037464672%3Bi%3A19171%3Bi%3A1037464675%3Bi%3A191 77%3Bi%3A1037464740%3Bi%3A19170%3Bi%3A1037465207%3 Bi%3A19173%3Bi%3A1037479613%3Bi%3A19046%3Bi%3A1037 465984%3Bi%3A19105%3Bi%3A1037467344%3Bi%3A18672%3B i%3A1037467351%3Bi%3A19084%3Bi%3A1037467425%3Bi%3A 18576%3Bi%3A1037467487%3Bi%3A19038%3Bi%3A103746750 0%3Bi%3A18151%3Bi%3A1037467626%3Bi%3A19068%3Bi%3A1 037467661%3Bi%3A18367%3Bi%3A1037467689%3Bi%3A13042 %3Bi%3A1037467713%3Bi%3A16935%3Bi%3A1037467720%3Bi %3A19134%3Bi%3A1037468536%3Bi%3A19168%3Bi%3A103747 9552%3Bi%3A19184%3Bi%3A1037479564%3Bi%3A19116%3Bi% 3A1037480034%3Bi%3A17520%3Bi%3A1037484175%3Bi%3A19 192%3Bi%3A1037485540%3Bi%3A19190%3Bi%3A1037485306% 3Bi%3A19180%3Bi%3A1037485554%3Bi%3A19100%3Bi%3A103 7485629%3Bi%3A19196%3Bi%3A1037485666%3Bi%3A18554%3 Bi%3A1037486195%3Bi%3A19197%3Bi%3A1037486564%3Bi%3 A19132%3Bi%3A1037486640%3Bi%3A19210%; bbthreadview=a%3A70%3A%7Bi%3A18969%3Bi%3A103728909 5%3Bi%3A19045%3Bi%3A1037288969%3Bi%3A19048%3Bi%3A1 037251417%3Bi%3A19007%3Bi%3A1037265534%3Bi%3A15623 %3Bi%3A1037265450%3Bi%3A19044%3Bi%3A1037289051%3Bi %3A19056%3Bi%3A1037265739%3Bi%3A18908%3Bi%3A103731 8594%3Bi%3A19051%3Bi%3A1037266071%3Bi%3A14527%3Bi% 3A1037266336%3Bi%3A19055%3Bi%3A1037289037%3Bi%3A19 059%3Bi%3A1037295501%3Bi%3A19063%3Bi%3A1037295544% 3Bi%3A18848%3Bi%3A1037468521%3Bi%3A18876%3Bi%3A103 7295631%3Bi%3A18825%3Bi%3A1037295645%3Bi%3A19050%3 Bi%3A1037318211%3Bi%3A19067%3Bi%3A1037318506%3Bi%3 A19089%3Bi%3A1037318521%3Bi%3A19083%3Bi%3A10373185 24%3Bi%3A19086%3Bi%3A1037318545%3Bi%3A19049%3Bi%3A 1037326825%3Bi%3A18763%3Bi%3A1037326941%3Bi%3A1911 7%3Bi%3A1037370172%3Bi%3A19097%3Bi%3A1037370207%3B i%3A19119%3Bi%3A1037372349%3Bi%3A19104%3Bi%3A10374 02713%3Bi%3A19120%3Bi%3A1037374210%3Bi%3A19112%3Bi %3A1037374223%3Bi%3A19082%3Bi%3A1037374259%3Bi%3A1 9126%3Bi%3A1037377619%3Bi%3A19122%3Bi%3A1037377727 %3Bi%3A19133%3Bi%3A1037396564%3Bi%3A19145%3Bi%3A10 37396573%3Bi%3A19137%3Bi%3A1037396582%3Bi%3A17962% 3Bi%3A1037403501%3Bi%3A19147%3Bi%3A1037421857%3Bi% 3A19167%3Bi%3A1037486584%3Bi%3A19158%3Bi%3A1037487 034%3Bi%3A19164%3Bi%3A1037463102%3Bi%3A19021%3Bi%3 A1037464672%3Bi%3A19171%3Bi%3A1037464675%3Bi%3A191 77%3Bi%3A1037464740%3Bi%3A19170%3Bi%3A1037465207%3 Bi%3A19173%3Bi%3A1037479613%3Bi%3A19046%3Bi%3A1037 465984%3Bi%3A19105%3Bi%3A1037467344%3Bi%3A18672%3B i%3A1037467351%3Bi%3A19084%3Bi%3A1037467425%3Bi%3A 18576%3Bi%3A1037467487%3Bi%3A19038%3Bi%3A103746750 0%3Bi%3A18151%3Bi%3A1037467626%3Bi%3A19068%3Bi%3A1 037467661%3Bi%3A18367%3Bi%3A1037467689%3Bi%3A13042 %3Bi%3A1037467713%3Bi%3A16935%3Bi%3A1037467720%3Bi %3A19134%3Bi%3A1037468536%3Bi%3A19168%3Bi%3A103747 9552%3Bi%3A19184%3Bi%3A1037479564%3Bi%3A19116%3Bi% 3A1037480034%3Bi%3A17520%3Bi%3A1037484175%3Bi%3A19 192%3Bi%3A1037485540%3Bi%3A19190%3Bi%3A1037485306% 3Bi%3A19180%3Bi%3A1037485554%3Bi%3A19100%3Bi%3A103 7485629%3Bi%3A19196%3Bi%3A1037485666%3Bi%3A18554%3 Bi%3A1037486195%3Bi%3A19197%3Bi%3A1037486564%3Bi%3 A19132%3Bi%3A1037486640%3Bi%3A19208%; sessionhash=926269e87ab7c226dbe40079adbafb1e; bbthreadview=a%3A68%3A%7Bi%3A18969%3Bi%3A103728909 5%3Bi%3A19045%3Bi%3A1037288969%3Bi%3A19048%3Bi%3A1 037251417%3Bi%3A19007%3Bi%3A1037265534%3Bi%3A15623 %3Bi%3A1037265450%3Bi%3A19044%3Bi%3A1037289051%3Bi %3A19056%3Bi%3A1037265739%3Bi%3A18908%3Bi%3A103731 8594%3Bi%3A19051%3Bi%3A1037266071%3Bi%3A14527%3Bi% 3A1037266336%3Bi%3A19055%3Bi%3A1037289037%3Bi%3A19 059%3Bi%3A1037295501%3Bi%3A19063%3Bi%3A1037295544% 3Bi%3A18848%3Bi%3A1037468521%3Bi%3A18876%3Bi%3A103 7295631%3Bi%3A18825%3Bi%3A1037295645%3Bi%3A19050%3 Bi%3A1037318211%3Bi%3A19067%3Bi%3A1037318506%3Bi%3 A19089%3Bi%3A1037318521%3Bi%3A19083%3Bi%3A10373185 24%3Bi%3A19086%3Bi%3A1037318545%3Bi%3A19049%3Bi%3A 1037326825%3Bi%3A18763%3Bi%3A1037326941%3Bi%3A1911 7%3Bi%3A1037370172%3Bi%3A19097%3Bi%3A1037370207%3B i%3A19119%3Bi%3A1037372349%3Bi%3A19104%3Bi%3A10374 02713%3Bi%3A19120%3Bi%3A1037374210%3Bi%3A19112%3Bi %3A1037374223%3Bi%3A19082%3Bi%3A1037374259%3Bi%3A1 9126%3Bi%3A1037377619%3Bi%3A19122%3Bi%3A1037377727 %3Bi%3A19133%3Bi%3A1037396564%3Bi%3A19145%3Bi%3A10 37396573%3Bi%3A19137%3Bi%3A1037396582%3Bi%3A17962% 3Bi%3A1037403501%3Bi%3A19147%3Bi%3A1037421857%3Bi% 3A19167%3Bi%3A1037486584%3Bi%3A19158%3Bi%3A1037463 043%3Bi%3A19164%3Bi%3A1037463102%3Bi%3A19021%3Bi%3 A1037464672%3Bi%3A19171%3Bi%3A1037464675%3Bi%3A191 77%3Bi%3A1037464740%3Bi%3A19170%3Bi%3A1037465207%3 Bi%3A19173%3Bi%3A1037479613%3Bi%3A19046%3Bi%3A1037 465984%3Bi%3A19105%3Bi%3A1037467344%3Bi%3A18672%3B i%3A1037467351%3Bi%3A19084%3Bi%3A1037467425%3Bi%3A 18576%3Bi%3A1037467487%3Bi%3A19038%3Bi%3A103746750 0%3Bi%3A18151%3Bi%3A1037467626%3Bi%3A19068%3Bi%3A1 037467661%3Bi%3A18367%3Bi%3A1037467689%3Bi%3A13042 %3Bi%3A1037467713%3Bi%3A16935%3Bi%3A1037467720%3Bi %3A19134%3Bi%3A1037468536%3Bi%3A19168%3Bi%3A103747 9552%3Bi%3A19184%3Bi%3A1037479564%3Bi%3A19116%3Bi% 3A1037480034%3Bi%3A17520%3Bi%3A1037484175%3Bi%3A19 192%3Bi%3A1037485540%3Bi%3A19190%3Bi%3A1037485306% 3Bi%3A19180%3Bi%3A1037485554%3Bi%3A19100%3Bi%3A103 7485629%3Bi%3A19196%3Bi%3A1037485666%3Bi%3A18554%3 Bi%3A1037486195%3Bi%3A19197%3Bi%3A1037486564%3B%7D ; bbadminon=1; bblastvisit=1035563932; vbcodemode=1; i=7:8:1:1036068408:1|4:5:1:1035751419:1|6:7:1:1035 751394:1|||||||||||||||||||||||||||||||||; bbuserid=1; bbpassword=feedd820a172677f3211aefc8f7a2885; PHPSESSID=00534cd1247c4336f21e1fce60acf422; ADCYCLE_LOGIN=admin|5790622|; i1=7:8:453:1035755985:152|5:6:621:1035670005:152|4 :5:621:1035669976:152|6:7:620:1035670121:152|||||| ||||||||||||||||||||||||||; c1=5:6:1:1036141033:152||||||||||||||||||||; phpAds_banner[af62734b]=a%3A2%3A%7Bs%3A8%3A%22bannerid%22%3Bs%3A1%3A%223% 22%3Bs%3A4%3A%22dest%22%3Bs%3A60%3A%22http%3A%2F%2 Fplurplanet.com%2Fforum%2Fshowthread.php%3Fs%3D%26 threadid%3D17706%22%3B%7D; bbthreadview=a%3A69%3A%7Bi%3A18969%3Bi%3A103728909 5%3Bi%3A19045%3Bi%3A1037288969%3Bi%3A19048%3Bi%3A1 037251417%3Bi%3A19007%3Bi%3A1037265534%3Bi%3A15623 %3Bi%3A1037265450%3Bi%3A19044%3Bi%3A1037289051%3Bi %3A19056%3Bi%3A1037265739%3Bi%3A18908%3Bi%3A103731 8594%3Bi%3A19051%3Bi%3A1037266071%3Bi%3A14527%3Bi% 3A1037266336%3Bi%3A19055%3Bi%3A1037289037%3Bi%3A19 059%3Bi%3A1037295501%3Bi%3A19063%3Bi%3A1037295544% 3Bi%3A18848%3Bi%3A1037468521%3Bi%3A18876%3Bi%3A103 7295631%3Bi%3A18825%3Bi%3A1037295645%3Bi%3A19050%3 Bi%3A1037318211%3Bi%3A19067%3Bi%3A1037318506%3Bi%3 A19089%3Bi%3A1037318521%3Bi%3A19083%3Bi%3A10373185 24%3Bi%3A19086%3Bi%3A1037318545%3Bi%3A19049%3Bi%3A 1037326825%3Bi%3A18763%3Bi%3A1037326941%3Bi%3A1911 7%3Bi%3A1037370172%3Bi%3A19097%3Bi%3A1037370207%3B i%3A19119%3Bi%3A1037372349%3Bi%3A19104%3Bi%3A10374 02713%3Bi%3A19120%3Bi%3A1037374210%3Bi%3A19112%3Bi %3A1037374223%3Bi%3A19082%3Bi%3A1037374259%3Bi%3A1 9126%3Bi%3A1037377619%3Bi%3A19122%3Bi%3A1037377727 %3Bi%3A19133%3Bi%3A1037396564%3Bi%3A19145%3Bi%3A10 37396573%3Bi%3A19137%3Bi%3A1037396582%3Bi%3A17962% 3Bi%3A1037403501%3Bi%3A19147%3Bi%3A1037421857%3Bi% 3A19167%3Bi%3A1037486584%3Bi%3A19158%3Bi%3A1037487 034%3Bi%3A19164%3Bi%3A1037463102%3Bi%3A19021%3Bi%3 A1037464672%3Bi%3A19171%3Bi%3A1037464675%3Bi%3A191 77%3Bi%3A1037464740%3Bi%3A19170%3Bi%3A1037465207%3 Bi%3A19173%3Bi%3A1037479613%3Bi%3A19046%3Bi%3A1037 465984%3Bi%3A19105%3Bi%3A1037467344%3Bi%3A18672%3B i%3A1037467


This is a corrupted cookie file. Apache has a header size limit of

# allow up to 100 headers in a request
  LimitRequestFields 100
  # each header may be up to 8190 bytes long
  LimitRequestFieldsize 8190

Again, IIS 7 has a size of 16K and IIS 6 has 8K length of header size.

So, we need to manually delete this cookie file. As cookies are browser specific, you need to check our browser how to delete those. I was using firefox and the solution is to go to tools->clear private data.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Friday, July 16, 2010

Download My Input Library for Codeigniter

We seen the drawbacks of Input library of codeigniter and my extended input library comes to solve this problem. I have already mentioned how my library overcome the problem. so, let's get the extended codeigniter Input library.

Use this link to download it.

After downloading,


  • Just put the class file under the libraries folder under application folder.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

syntax error near unexpected token `('

We, the linux users sometime face this problem. when we want to open a file with terminal or doing some work like svn commits or deletion we need to do deal with files. if a file contains invalid character's, then we will come up with this erros.

syntax error near unexpected token `('

if we have a file named 'name (copy).html', then doing the following command will produce the above error:

vim name (copy).html

Here we need to escape the unwanted characters with '\'. So, we need to modify our code the following.

vim name\ \(copy\).html

Now our command will work like a charm!
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Documentation of Codeigniter My Input Library

Codeigniter Input Library comes up with many great security features. But it still lacks some of the security concerns. We have discussed those in our blog earlier. So, I have created an extended input library to minimize those security holes.

I have extend the xss_clean method of input class. and added some advanced level of security fixes. We have replaced the following code for naughty words in the xss_clean method.


/*
  * Sanitize naughty HTML elements
  *
  * If a tag containing any of the words in the list
  * below is found, the tag gets converted to entities.
  *
  * Becomes: <blink>
  *
        */
        $naughty = '\w*';
        $str = preg_replace_callback('#<(\w*/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str);
instead of
/*
  * Sanitize naughty HTML elements
  *
  * If a tag containing any of the words in the list
  * below is found, the tag gets converted to entities.
  *
  * Becomes: <blink>
  *
  */
  $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss';
  $str = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str);

Here In the input library we have defined many HTML keywords which will be treated as naughty keywords. But there are many more keywords which will do massive damage to our site. Like, the header tags 'h1', as we mentioned about the probable attack of it in our blog post earlier. So, I have treated every html words as naughty and convert them. In this regard, we use regular expression to check for any word character and it can occur any number of time.
\w*
See also: Download Codeigniter My input library from here.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Weakness of Codeigniter Input Library

Codeigniter Input Library has minimized many security holes. But still there are some leaks in it. The input library has defined some html keywords as naughty entries. But these naughty keywords are not all to be aware of.

There are still many keywords which have significant threat for a website. So, we must need to take care of those malwords. Let's discuss some of them.

the header tags 'h1', h2, h3, h4, h5, h6 can have a significant impact, if we use it with the input library. if we use only the starting tag and never end those tags, then our page layout will be broken. Use the following with h1 tag at the beginning and you will see the result in the browser.

it is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the ye

Again if we use b, strong keywords the same will be the case.

See how to solve it here.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, July 14, 2010

Codeigniter Advanced Layout Library

We have several layout library in the wiki of codeigniter. But those has only one replacement block. Advanced codeigniter library solves this problem. You can find the features of advanced layout library here here. Let's discuss about Advanced Layout library for codeigniter.

we will see every code block of the library and discuss them seperately. At first we have defined our necessary variables.

#ci instance
    public $ci;
    #layout variable
    public $layout;

In the constructor function we have created an instance of codeigniter. the argument of the function gets the filename of our main codeigniter library.

/**
     * Constructor
     *
     * @author Tahsin Hasan 
     * @return void
     * @param  layout String layout file name
     * @access public
     */
    public function __construct($layout = "layout_main") {
        $this->ci =& get_instance();
        $this->layout = $layout;        
    }
Let's see the code block of the function that handles the block replacement of our layout. we are passing here three arguments: blocks array contains key-value relationship of block and their corresponding replacement code chunk. view is the filename of the main body content area.
/**
     * shows our blocks in the layout section
     *
     * @author Tahsin Hasan 
     * @return void
     * @param  blocks Array blocks to replace
     * @param  view String code to replace with
     * @param  data Array the data we need to pass
     * @access public
     */
    public function view($blocks, $view, $data)
    {   
        $layout       = $this->layout;
        $data['content_for_layout'] = $this->ci->load->view($view, $data, true);
        
        $view = $this->ci->load->view($layout, $data, true);
        foreach($blocks as $key=>$val)
        {
           if(empty($val))
           {
               $replaces[$key] = '';
           }
           else
           {
               $replaces[$key] = $this->ci->load->view ( $val, NULL, TRUE );
           }            
        }
        $view = str_replace(array_keys($replaces), array_values($replaces), $view);
        
        $this->ci->load->view ( 'view', array ('view' => $view) );
    }

The content_for_layout variable contains the main body section of a page. We replace this string value with our page specific content. with this page specific content, we then replace the layout with our values and store it in the view file.

Download Advanced Layout library from here.
The block variable contains the other replacements except the main content. we replace each varible with the foreach loop.

the str_replace function done the tricks here. it replaces the keys with the values of the view variable. And finally, we load the view file.

Download Advanced Layout library from here.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Features of Advanced Layout library of Codeigniter

We have seen the documentation of Advanced Layout Library of Codeigniter. But before using it, we must know what features it brings to us. Let's see them:

  • Other layout library give us the opportunity to make one single block replacement for our layout. But in Advanced Layout library, we can have as many blocks as we wish to have. We just have to define the block and a variable to represent it. Advanced Layout library will take care of the rest. it's simple.
  • We can even have multiple blocks in our main content block. we have shown how to use multiple blocks in layout and also in the main content block. So, we will have more control of your layout using Advanced Layout library for codeigniter.

Download Advanced Layout library from here.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to use Advanced layout library

We have seen the documentation. Now let's see how we can use the library. At first we need to load Advanced Layout Library for codeigniter.

$this->load->library('advancedLayout');

Now we will set our main layout file in it:

$this->advancedlayout->setLayout('path_to_layoutfile');

We have put our main layout file in the view file. The file is like this:


html xmlns="http://www.w3.org/1999/xhtml"
    head
//        stylesheets link will be here.
        
    /head
    body
        {HEADER_LAYOUT}
        
        
{FLASH_MSG_CONT}
{FOOTER_LAYOUT} /body /html

Here, you can see we have set some variable which will be replaced with our layout values. We can have here as many replacement block as we like. we have set header, top navigation, flash message, body and footer. Not necessary that we also need to implement all those blocks. just use as you like the blocks to be.

In the controller, from which the page is called, we need to replace our layout variables there. the following code does the trick:

$this->advancedlayout->view(array ('{HEADER_LAYOUT}' => 'common/header','{TOP_LAYOUT}'=>'', '{FLASH_MSG_CONT}' => 'common/flash_msg_cont', '{FOOTER_LAYOUT}' => 'common/footer' ),$viewName, $this->_data);

Here, you can see that each variables is set as key and there is a corresponding files in he view file. so, we just write the location of the specific view file. then the variable is replaced with our code.

we set multiple blocks even the main content block. just check the following code block.

echo $admin_right_column;

we are echoing a variable, this can be any variable that we set in the controller. now we need to write the following the controller:

$this->_data['admin_right_column'] = $this->load->view('common/admin_right',$this->_data, TRUE);

Here, the variable contains the content of the admin right column.

And finally, you need to have a view file named 'view' in our main view folder. the file will be like this:

echo $view;

Download Advanced Layout library from here.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Download Advanced Layout Library for Codeigniter

We have discussed the features, documentation and user guide for Advanced Layout Library for Codeigniter. now Just download it from here. After downloading it:

  • Take the library and drop it under the library folder of Application folder.



See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, July 10, 2010

Technorati posting started

Every one tahSin's gaRAge is starting posting blog in technorati, code is SZ4QFYS9VB42.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, July 7, 2010

tweetsigniter Documentation

Let's see step by step explanation of our tweetsigniter class, a twitter codeigniter library. Initially, we have declared all our necessary global variables, like username, password, path, template, timezone etc.

# username field
    public $username;
    # password field
    public $password;
    # maximum no. of values
    public $maxItems;
    # path value
    public $path;
    # timezone value
    public $timezone;
    public $configs = array();
    # template file name
    public $template;

Next comes the constructor method. it defines our template variable. we will replace the template values.

public function  __construct()
    {
        $this->template = "
  • {text}
  • "; }

    we set the necessary values with this method like username, password, maxItem shows the maximum no. of items to be displayed, and timezone will be your timezone.

    public function setInfo($username, $password, $maxItems = '5', $timezone = '+6')
        {
            $this->username = $username;
            $this->password = $password;
            $this->timezone = $timezone;
            $this->maxItems = $maxItems;
            $this->config();
        }
    
    

    We set necessary configuraion Information with these function.
    public function config()
        {
            $this->configs['template'] = $this->template;
            $this->configs['maxitems'] = $this->maxItems;
        }
    
    
    The following function shows all your tweets. you can apply css style within the html elements. the cut and resume functions process tweeter responses.

    public function easyfeeder()
        {
            $content=$this->twitterXml('http://twitter.com/statuses/user_timeline.xml');
            $items=explode("",$content);
            array_shift($items);
    
            $retstr="

    Latest News

      "; foreach($items as $cnt=>$item) { if($this->configs['maxitems']>0 and $cnt+1>$this->configs['maxitems']) break; $created_at=$this->cut("","",$item); $text=$this->cut("","",$item); $itemid=$this->cut("","",$item); $screenname=$this->cut("","",$item); $created_day = substr($created_at, 0, 3); $created_monthday = substr($created_at, 4, 6); $created_timehour = substr($created_at, 11, 2); $created_timehour = $created_timehour + $this->timezone; $created_timeminutes = substr($created_at, 14, 2); $created_year = substr($created_at, 26, 4); if ($created_timehour == 12) { $ampm = "pm"; } else if (($created_timehour > 12) AND ($created_timehour < 24)) { $ampm = "pm"; $created_timehour = $created_timehour - 12; } else if ($created_timehour == 24) { $ampm = "am"; $created_timehour = 12; } else { $ampm = "am"; } $created_at = $created_day . ", " . $created_monthday . ", " . $created_year . " - " . $created_timehour . ":" . $created_timeminutes . $ampm; $itemlink = "http://twitter.com/" . $screenname . "/statuses/" . $itemid; $tpl=$this->configs['template']; $tpl=str_replace("{created_at}",$created_at,$tpl); $tpl=str_replace("{text}",$text,$tpl); $tpl=str_replace("{itemlink}",$itemlink,$tpl); $retstr.=$tpl; } $retstr.="
    "; return $retstr; }

    Following is the cut and resume methods that we used in the above method.

    public function cut($start,$end,$word)
        {
            $word=substr($word,strpos($word,$start)+strlen($start));
            $word=substr($word,0,strpos($word,$end));
            return $word;
        }
    
        public function resume($text,$limit=7)
        {
            $words=@explode(" ",$text);
            $words=@array_splice($words,0,$limit);
            $retstr=@implode(" ",$words);
            return $retstr."... ";
        }
    

    The following method will show all you tweeter followers.

    public function twitterFollowers()
        {
            $this->template = "
    
  • "; $content=$this->twitterXml('http://twitter.com/statuses/followers.xml'); $items=explode("",$content); array_shift($items); $retstr="

    Latest News

      "; foreach($items as $cnt=>$item) { if($this->configs['maxitems']>0 and $cnt+1>$this->configs['maxitems']) break; $created_at=$this->cut("","",$item); $text=$this->cut("","",$item); $itemid=$this->cut("","",$item); $screenname=$this->cut("","",$item); $itemlink = "http://twitter.com/" . $screenname; $tpl=$this->template; $tpl=str_replace("{text}",$text,$tpl); $tpl=str_replace("{itemlink}",$itemlink,$tpl); $retstr.=$tpl; } $retstr.="
    "; return $retstr; }

    This method will show all your tweeter friends.

    public function twitterFriends()
        {
            $this->template = "
    
  • "; $content=$this->twitterXml('http://twitter.com/statuses/friends.xml'); $items=explode("",$content); array_shift($items); $retstr="

    Latest News

      "; foreach($items as $cnt=>$item) { if($this->configs['maxitems']>0 and $cnt+1>$this->configs['maxitems']) break; $created_at=$this->cut("","",$item); $text=$this->cut("","",$item); $itemid=$this->cut("","",$item); $screenname=$this->cut("","",$item); $itemlink = "http://twitter.com/" . $screenname; $tpl=$this->template; $tpl=str_replace("{text}",$text,$tpl); $tpl=str_replace("{itemlink}",$itemlink,$tpl); $retstr.=$tpl; } $retstr.="
    "; return $retstr; }

    let's see how we have connected with tweeter. we used curl to connect with tweeter. the following method done the trick for us.

    function twitterXml($url)
        {
            $curl_handle = curl_init();
            curl_setopt($curl_handle, CURLOPT_URL, "$url");
            curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
            curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($curl_handle, CURLOPT_USERPWD, "$this->username:$this->password");
            $buffer = curl_exec($curl_handle);
            curl_close($curl_handle);
    
            return $buffer;
        }
    

    Links:



    See the book OpenCart 1.4 Template Design Cookbook.
    See the book Joomla Mobile Development Beginners Guide




    List of my works:

    Technical Support:

    If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


    Wordpress Plugins:
    1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
    2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Download Tweetsigniter

    Download Tweetsigniter, a twitter codeigniter library, from this link Download. Thanks for downloading Tweetsigniter.

    Links:


    See the book OpenCart 1.4 Template Design Cookbook.
    See the book Joomla Mobile Development Beginners Guide




    List of my works:

    Technical Support:

    If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


    Wordpress Plugins:
    1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
    2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    How to use Tweetsigniter

    To use tweetsigniter, a twitter codeigniter library, grab your copy from here:

    Place the library file under the application->library folder. And in the controller, type the following code:

    $this->load->library('tweetsigniter');
    

    This will load our library. now we will set the requied info:
    $this->tweetsigniter->setInfo('username','password','3');
    

    Here 3 means max number of items. To show tweeter status, we use this function:

    $this->tweetsigniter->easyfeeder();        
    

    To show all followers use the following function.

    $this->tweetsigniter->twitterFollowers();        
    

    And to show all friends use the following function.

    $this->tweetsigniter->twitterFriends();        
    

    Links:


    See the book OpenCart 1.4 Template Design Cookbook.
    See the book Joomla Mobile Development Beginners Guide




    List of my works:

    Technical Support:

    If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


    Wordpress Plugins:
    1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
    2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Tweetsigniter features

    Tweetsigniter, a twitter codeigniter library, comes up with following feature with version 1.0.

    • You can show all your tweeter status messages.
    • This library also shows list of all your friends.
    • It also shows list of all your followers.

    And the following are coming with the next release.

    • Updating status.

    Links:



    See the book OpenCart 1.4 Template Design Cookbook.
    See the book Joomla Mobile Development Beginners Guide




    List of my works:

    Technical Support:

    If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


    Wordpress Plugins:
    1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
    2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Thursday, July 1, 2010

    Sample robots.txt to improve page rank

    Here we will see a helpful robots.txt file structure. first let us know what is a robots.txt file. it contains information for web search engine bots to not scroll the seleted pages. let's see a sample helpful robots.txt file that will be helpful for improving page rank.
    user-agent: *
    disallow: /images/
    disallow: /css/
    disallow: /js/
    disallow: /assets/
    disallow: /classes/
    disallow: /captcha/
    disallow: /admin/
    disallow: /system/ /* this is for codeigniter */
    disallow: /application/confiq/ /* this is for codeigniter */
    disallow: /application/controllers/ /* this is for codeigniter */
    disallow: /application/errors/ /* this is for codeigniter */
    disallow: /application/helpers/ /* this is for codeigniter */
    disallow: /application/hooks/ /* this is for codeigniter */
    disallow: /application/models/ /* this is for codeigniter */
    disallow: /application/libraries/ /* this is for codeigniter */
    disallow: /application/language/ /* this is for codeigniter */
    
    User-agent: Googlebot-Image
    Disallow:
    Allow: /*
    
    Sitemap: http://www.example.com/sitemap.xml
    

    Please feel free to suggest me on this topic through your helpful comments.

    see how to resolve svn conflict on http://newdailyblog.blogspot.com/2010/07/resolving-svn-conflict.html
    See the book OpenCart 1.4 Template Design Cookbook.
    See the book Joomla Mobile Development Beginners Guide.




    List of my works:

    Technical Support:

    If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


    Wordpress Plugins:
    1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
    2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Resolving SVN conflict

    At times there may arise a conflict when working with svn. Let's see how we can minimize it. when a conflict occurs four new files are created. they are the followings:
    myfile – the original with markers
    myfile.mine – your version
    myfile.r5 – the original your worked with
    myfile.r6 – the most update version from your colleague
    
    There are several options for resolving conflicts.

    1. I can keep all my works and discard the changes my colleague made with the following command:
    $ cp myfile.mine myfile
    $ svn resolved myfile
    Resolved conflicted state of 'myfile'
    
    2. I will discard all my changes and keep my colleagues work with these commands:
    $ svn revert myfile
    Reverted 'myfile'
    $ svn update myfile
    At revision 6.
    
    The ‘resolved’ command will clean up all the special files that were generated. Now commit your changes.

    3. we can merge both version. we need to do this manually removing the markers and placing the codes of my mine and my colleagues as necessary. then do the following command:
    $ svn resolved myfile
    Resolved conflicted state of 'myfile'
    
    Now commit your changes.


    See the book OpenCart 1.4 Template Design Cookbook.
    See the book Joomla Mobile Development Beginners Guide




    List of my works:

    Technical Support:

    If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


    Wordpress Plugins:
    1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
    2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide