Monday, July 1, 2013

Forcing some urls to HTTPS and some on HTTP using cakephp

Hi guys, today I was trying to do this task and did a lot of R&D. Tried some httaccess rules, tried cakephp routers and most specially which did my half work ( forcing some urls to https ) is security component of cakephp. But non of these components and techniques worked well like I wanted to do it. Then I wrote a simple function and it worked well.

Here is I am gonna show you how to redirect some urls like checkout, login, register on HTTPS and vice virsa. Here is that function,

/*
    redicting some urls to https
*/
   function securityrules()
   {
       $arrparams = $this->params;
       if( $_SERVER["HTTPS"] == "on" )
       {
          if( $arrparams['action'] != "login" && $arrparams['action'] != "register" && $arrparams['action'] != "reset" )
          {
             $this->redirect('http://' . env('SERVER_NAME') . $this->here);
          }
       }
       else
       {
          if( $arrparams['action'] == "login" || $arrparams['action'] == "register" || $arrparams['action'] == "reset" )
          {
             $this->redirect('https://' . env('SERVER_NAME') . $this->here);
          }
        }
    }

And for using it place this function in AppController.php and call it at the start of beforeFilter() function And enjoy. Don't waste your time on other stupid techniques like i wasted my whole day :( Thanks

Friday, November 30, 2012

Number of Users Online script in PHP

Sometime our clients demand for showing how many visitors are online currently on their website. This can be done by many ways. I am going to illustrate two methods of doing this. One is file based and other one is database based. Let us see how to achieve this by both methods one by one.

1) File Based Method:

In this method PHP script writes online visitors information in a text file. That text file is updated after a specific interval of time and script reads that file and show a counter of online visitors where required. Let us see the details of this method step by step,

Step 1) First of all you have to create a .txt file and place it on any folder in your server. In my case I am creating this file on root folder of my website and naming it ip.txt. After updating this file by code, it looks something like this,

127.0.0.1****1354262381++++
127.0.0.1****1354262381++++
127.0.0.1****1354262381++++

Step 2):Then copy and paste the code below where you want to show that counter,

<php
    $url = $_SERVER['SCRIPT_FILENAME'];
    $pp = strrpos($url,"/");
    $url = substr($url,0,$pp);
    $ura = $_SERVER['SCRIPT_NAME'];
    $host = $_SERVER['SERVER_NAME'];
    $ser = "http://$host";
    $ura= $ser.$ura; 
    $pp1 = strrpos($ura,"/");
    $ura = substr($ura,0,$pp1);
    $url1=explode('/', $url);
    $url=array_pop($url1);
    $url1=implode('/', $url1);
    $ura1=explode('/', $ura);
    $ura=array_pop($ura1);
    $ura1=implode('/', $ura1);

    $hm = "$url1"; 
    $hm2 = "$ura1"; 
    include "onlinevisitors.php";
?>


Step 3):  Next step is to create a file named onlinevisitors.php file and place in the folder where you included it in above code. In our case root folder,


<?php
$rip = $_SERVER['REMOTE_ADDR'];
$sd  = time();
$count = 1;

$file1 = "ip.txt";
$lines = file($file1);
$line2 = "";

foreach ($lines as $line_num => $line)
{
 //echo $line."";
 $fp = strpos($line,'****');
 $nam = substr($line,0,$fp);
 $sp = strpos($line,'++++');
 $val = substr($line,$fp+4,$sp-($fp+4));
 $diff = $sd-$val;
 if($diff < 300 && $nam != $rip)
 {
  $count = $count+1;
  $line2 = $line2.$line;
  //echo $line2;
 }
}

$my = $rip."****".$sd."++++\n";
$open1 = fopen($file1, "w");
fwrite($open1,"$line2");
fwrite($open1,"$my");
fclose($open1);

echo "<table width=180 height=30 bgcolor=#fdfdfd style=\"border: 1px green solid;\"><tr><td align=left valign=top>";
echo "</td><td align=center>";
echo "<span style=\"font-family: verdana,arial,helvetica; font-size: 11px; font-weight: bold; color: #aaccaa;\">";
echo "Total users online - <font color=red>$count</font></span><br>";
echo "</td></tr></table>";
?>

2) Database Driven Method:

comming soon...

Wednesday, November 14, 2012

Which Web Programming language to learn to keep you employed?

There are thousands of programming languages out there and have their own value over one and other. But there are a few programming languages which can keep you employed and you don't have to worry about earnings. Learning a right programming language on right time and right place is very necessary for your carrier. There are many examples out there who are not happy with their field and struggling in the market due to this fact. That's why I am going to share with my blog readers about the best programming languages and their scope in different areas of the world.
  • PHP
  • MySQL
  • Javascript
  • Perl
  • Ruby
  • Python
  • ASP.net

Tuesday, November 13, 2012

How to increase PTCL EVO signals

PTCL EVO is one of the best source of wireless internet connectivity and it offers coverage in more than 250 cities in pakistan nationwide. But sometimes eVo customers are returning their devices within 3 days because of dis-satisfaction or no signals at there homes or offices. So i thought there should be some method to strengthen the eVo signals so that customers can enjoy the great internet service out there.

Friday, November 9, 2012

What is radiotherapy treatment?

As x-Rays have been discovered almost 10 years ago and these are being used in medical science. These are used for the diagnosis purpose as well as for the treatment such as radiotherapy. There are two types of radiotherapy,

1. External radiotherapy

2. Internal radiotherapy

External radiotherapy is for external body and internal radiotherapy is used for internal body parts. Radiotherapy is actually used to distroye cancel cells but it may damage normal cells as well. But fortunately normal cells can repair themselves later on.

List of TOP 60 Insurance Companies in Pakistan

Tips on Accessing DSL Router, Modem or CPE

We are going to discuss that how can we access the DSL Modem, Router or CPE to put the internet settings and to configure it.

By following theses simple steps we can access the CPE and establish a connection to internet.

Keep reading this post for complete guide.

Connect the CPE to the Computer:

  1. Connect the Power Adapter to the AC power plug and attach the connector of adapter to the CPE and switch it on.
  2. Attach one end of LAN wire (RJ-45) to the LAN interface of CPE and the other end to the LAN wire to the LAN interface of computer’s LAN card.
  3. Link Indicator lights will lit up and show the connectivity.
DSL Configuration in CPE and Computer:
  1. Go to Start Menu > Control Panel > Network and Internet Connections > Network Connections. Check that the Local Area Connection is enabled. Right click local Area network and click properties.
  2. Double click “internet protocol (TCP/IP)”, Check “Use the following IP address” and make the following settings:
  3. IP Address: 192.168.1.5
  4. Subnet Mask: 255.255.255.0
  5. Gateway: 192.168.1.1
  6. Then, check “Obtain DNS server addresses automatically” and click "OK" to apply these settings.
Now open Internet Explorer and type “192.168.1.1” in address bar and press enter. There must not be any proxy setting in the internet Explorer.

A small pop up window will open as shown in the figure below and ask ”User Name” and “Password” for opening the CPE’s interface.

Enter User Name: “admin” and Password: “admin” and press OK.


You can read this http://our-knowledge-base.blogspot.com/2012/11/how-to-do-ptcl-dsl-modem-and-router.html to learn how to do router settings.

Thursday, November 8, 2012

Techniques of Adding New Widget Sections In Blogger On Different Places?

Adding new widget sections in blogger template is very easy task to do. There are many posts about this topic on the internet but those are very lengthy to read. Purpose of my post is to clear the concept.

If you want to add a widget which should be shown on home page of your blogspot blog then you have to follow these steps.

Step # 1. Go to templates section of your blog and click on html Editor.

Step # 2. Now decide where you want to add new widget section.

Step # 3. And past below code and save.

<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:section class='sidebar' id='magazine-left' showaddelement='yes' >
<b:widget id='Text51' locked='false' title='Test Title 1' type='Text'/> 
</b:section> </b:if>

If you want to add a widget which should be displayed on every page of your blog then you have to past below code in the corresponding area and save the template. All other steps will remain same.

<b:section class='sidebar' id='magazine-left' showaddelement='yes' >
<b:widget id='Text51' locked='false' title='Test Title 1' type='Text'/>
</b:section>

How to do PTCL DSL Modem and Router configuration

Hi guys, today i am going to share with you the most important and useful information regarding PTCL DSL modem configuration. This is a common problem that our internet stops working and we have no knowledge about what to do. There are two methods of configuring PTCL DSL router.


1. Call 1236 Helpline:

One method id to call 1236 PTCL line anf ask them, they should configure you DSL modem remotely and the other method is to configure you modem manually.


2. Manual Method:

2nd method is to do manual configuration. First of all open Internet Explorer and write “192.168.1.1” in address bar and press enter. There must not be any proxy setting in the internet Explorer. This will open a login window and will ask for username and password to access the router console. The default username and password for router is admin/admin. So write admin in username box and admin in password box and click on login button.

How to access router using browser can be found in this post http://our-knowledge-base.blogspot.com/2012/11/how-to-do-ptcl-dsl-modem-and-router.html

Wednesday, October 10, 2012

Images of Shangri-La Pakistan

Shangrila Lake or Lower Kachura Lake is a part of the Shangrila resort located at a drive of about 20 minutes from Skardu (nearly 2,500 m or 8,200 feet) town.

It is a popular tourist destination, and has a unique restaurant that is built on the fuselage of an aircraft that had crashed nearby.

Shangrila was established in 1983 with the opening of the first Resort Hotel in Skardu, Baltistan. It was named "heaven on earth" because of its spectacular beauty,and breathtaking view and peaceful atmosphere. Shangrila Resort Hotel was founded by the late Brig.(Retd) Muhammad Aslam Khan, the first commander of the Northern Scouts of the Pakistan Army.

Shangrila was named after a book titled "Lost Horizon" by James Hilton. In the novel, the author narrates a tale in which an aeroplane crash landed near a riverbed, in the early 1920s. The surviving passengers came across some Buddhist monks from a nearby temple and sought their help. They were taken to a beautiful lamasery filled with a variety of fruits and flowers. The monks looked quite young, although they claimed to be hundreds of years old. The idyllic place was called Shangri-la, a Tibetan word meaning "Heaven on earth".









Saturday, September 29, 2012

javascript - window.open not working in IE - (RESOLVED)

Browser compatibility is an issue which each and every web-developer has to face. New window popup using javascript is the same kind of issue and javascript fuction window.open() has different functionality in defferent browsers like in firefox and chrome it works and in IE-8 etc sometimes it does'nt work.

I also faced this problem today and did R&D on it, and found a very simple solution to this. here is the solution of this problem.

In IE, you can't have spaces in your second variable (the new window's name).

Try:
 
window.open (address,'Ver_articulo', config=center);
 
Please post your comment and share this with others if you really like this post. 

Thursday, June 14, 2012

Email validation using PHP and REGULAR EXPRESSION

Form validation is a very important part of web programming. This is to avoid any mistakenly adding data in database. Validating emails can be done in many ways. But the most faster and efficient way to validate emails is using regular expression.

Here is the code of this validation in PHP.

if(isset($todo) and $todo=="test")
{  
    if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){  
      echo "<center>Invalid email</center>";  
    }else{  
     echo "<center>Valid Email</center>";
    }  
}   

Monday, May 28, 2012

How to delete DUPLICATE records from MYSQL table

Some times we need to delete duplicate rows from a table. Because there is no need for keeping duplicate records in same table. Deleting these duplicate records is very easy. It can be don using some simple SQL queries.

Here’s two easy ways to clean out that table quickly.

1) Use ALTER IGNORE on MySQL 5.1+
MySQL will allow you to create a unique index on a table with duplicate records with its IGNORE SQL extension:

 ALTER IGNORE TABLE 'SHIPMENTS' ADD UNIQUE INDEX (CART_ID, TRACKING_NUMBER)  

Duplicates will be deleted.

2) Recreate the table with GROUP BY

 execute 'CREATE TABLE shipments_deduped like shipments;'  
 execute 'INSERT shipments_deduped SELECT * FROM shipments GROUP BY cart_id, tracking_number;'  
 execute 'RENAME TABLE shipments TO shipments_with_dupes;'  
 execute 'RENAME TABLE shipments_deduped TO shipments;'  
 add_index :shipments, [:cart_id, :tracking_number], :unique => true  
 execute 'DROP TABLE shipments_with_dupes;'  

Recreating the table is much, much faster than trying to delete the records in the existing table and doesn’t lock the existing table, making your application downtime minimal.

Insurance

Friday, May 25, 2012

How to download and unzip a .ZIP file using php

Today I was working on a website which will be an affiliate member of another big company with already running a very good website ( i don't want to mention the name of that affiliate program because with this my idea is some how disclosed to the public and i don't want to do so :) ). In that affiliate program I have to download the feeds in .zip form and then importing that in my database. So I needed a script to automatically download, unzip and then import that data in my database. By using my experience and skills and also with the help of Google, I have successfully written a script for this purpose. In this post I am going to share the same,

First part of my script checks that php zip extension is loaded or not.
 if (!extension_loaded('zip')) {  
                dl('zip.so');  
           }  
After that, mention the path of download file and destination folder and rest of the script is as follows,
 $target_url = "http://www.example.com/test.zip";  
 $userAgent = 'Googlebot/2.1 (http://www.googlebot.com/bot.html)';  
 $file_zip = "downloads/new.zip";  
 $file_txt = "downloads/".md5(time())."new.txt";  
 echo "<br>Starting<br>Target_url: $target_url";  
 echo "<br>Headers stripped out";  
 // make the cURL request to $target_url  
 $ch = curl_init();  
 $fp = fopen("$file_zip", "w");  
 curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);  
 curl_setopt($ch, CURLOPT_URL,$target_url);  
 curl_setopt($ch, CURLOPT_FAILONERROR, true);  
 curl_setopt($ch, CURLOPT_HEADER,0);  
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);  
 curl_setopt($ch, CURLOPT_AUTOREFERER, true);  
 curl_setopt($ch, CURLOPT_BINARYTRANSFER,true);  
 curl_setopt($ch, CURLOPT_TIMEOUT, 10);  
 curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);  
 curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);   
 curl_setopt($ch, CURLOPT_FILE, $fp);  
 $page = curl_exec($ch);  
 if (!$page) {  
   echo "<br />cURL error number:" .curl_errno($ch);  
   echo "<br />cURL error:" . curl_error($ch);  
   exit;  
 }  
 curl_close($ch);  
 echo "<br>Downloaded file: $target_url";  
 echo "<br>Saved as file: $file_zip";  
 echo "<br>About to unzip ...";  
 // Un zip the file  
 $zip = new ZipArchive;  
   if (! $zip) {  
     echo "<br>Could not make ZipArchive object.";  
     exit;  
   }  
   if($zip->open("$file_zip") != "true") {  
       echo "<br>Could not open $file_zip";  
         }  
   $zip->extractTo("$file_txt");  
   $zip->close();  
 echo "<br>Unzipped file to: $file_txt<br><br>";  
If you like this script, so please post your comments and feedback. Your good feedback is the main desire of me to continue writing useful posts for my blog reader. Thanks

Tuesday, May 22, 2012

Password protection using .htaccess

Some times, some portions of website need to be password protected in order to prevent it from UN-autorized access. There are many ways to do this. One way is achieved by server side programming and other way to achieve this is client side programming like java-script. In this post I will discuss password protection using .htaccess file. This method have following steps to follow,

1. First decide what portion or directory you want to make password protected. I am considering root directory in this post.

2. After this go to this URL http://www.tools.dynamicdrive.com/password/ and generate code for your .htaccess and .htpasswd files.

3. After this you need to save these codes in .htaccess and .htpasswd files respectively. I you are unable to create .htaccess file, you can read this http://our-knowledge-base.blogspot.com/2012/05/how-to-create-htaccess-file-simple.html article to learn how to create this. Creating .htpasswd file is exactly same like creating .htaccess file.

4. Now upload the both file in the corresponding directory. Your website is password protected now.

feel free to post your feedback

Thanks


How to create .htaccess file - Simple steps

I this simple step by step tutorial I will tell you how to create .htaccess file using a notepad editor.
Here are the steps to do this,
 
1. Open your Windows notepad editor.


2. Make sure that the word wrap function is off.


3. Select File, then select New
 

 4. You should have a screen that doesn’t contain any text.

5. Next, select Save As

6. Type the following for your file name, .htaccess

Browse your folders and select which folder you want to save the .htaccess file in, then click Save
The next step is to verify that the file was named .htaccess by the editor. You simply open the Windows file manager, locate the file, right-click the file icon and selecting Properties.) If the file was named with the .txt suffix, you can rename the file to .htaccess and your done.

Thanks

Friday, May 18, 2012

Balanced Diet Plane

Hey guys, if you want a perfect diet plane chart, then this post is just for you.

Cereals (per 100 grams) Calories
Breads (per slice) Calories
Vegetables (per 100 grams) Calories
Fruits (per 100 grams) Calories
Desserts (per 100 grams) Calories
Milk Products (per cup) Calories
Others Calories
Bajra 360

Maize flour 355

Rice 325

Wheat flour 341
Chapati (wheat bread) (medium) 119

White bread 60

Paratha (not stuffed) 280
Cabbage 45

Carrot 48

Cauliflower 30

Corn (baked) 84

Cucumber 12

Eggplant (Fresh) 24

Eggplant (Cooked) 69

Fenugreek (methi) 49

French Beans 26

Lettuce 21

Peas 93

Potato 97

Potato (fried- 1 cup) 450

Potato (baked- 1 cup) 100

Potato (mashed- 1 cup) 245

Potato (boiled- 1 cup) 83

Pumpkin (cooked) 33

Spinach 26

Tomato (fresh) 21

Tomato (stuffed and baked) 58

Tomato (baked) 39
Apple 56

Banana 153

Black Grapes 45

Chickoo (Sapota) 94

Cherries 70

Dates 281

Guava 66

Litchies 61

Mango 70

Muskmelon 74

Orange 53

Papaya 32

Peach 50

Pears 51

Pineapple 46

Plums 56

Pomegranate 77

Watermelon 16
Biscuits 399

Boondi ladoo 150

Cake (with icing) 302

Cake (without icing) 218

Cookies (butter cookies) 482

Custard 205

Fruit pie 236

Fruit salad 80

Gujia 501

Gulab Jamun 387

Halwa (atta) 263

Halwa (rawa) 181

Halwa (sohan halwa) 399

Jalebi 494

Jelly 65

Kheer (rice) 141

Kheer (rice-carrot) 226

Malpua 325

Sandesh 57
Buffalo milk 115

Butter (100gms.) 750

Buttermilk 19

Cheese 315

Cow milk 100

Cream (100gms) 210

Ghee (100gms) 910

Skimmed milk 45
Coconut water (100 ml) 25

Coffee 40

Honey (1 tbsp) 90

Orange juice (100 ml) 47

Sugar (1 tbsp) 48

Tea 30

Tomato juice (100ml) 22

How to change "font-family" in dompdf script

In latest web development industry document conversion from one format to other format is very important. Sometimes we need to generate spread sheet files, some times we need to generate word files and some times PDF files. In this topic I will be talking about PDF file conversion.

For generating PDF files from the given data, there are a number of scripts and modules written in php and different languages. DomPDF is one of them written in php. DomPDF is fabulous in its features. It allows direct conversion of HTML files to PDF files. But there are some limitations like some times it never generates the exact copy of that HTML. Some times font-family doesn't apply correctly as we apply in HTML file. I had the same problem last days when I was using DomPDF for my PDF generation. I goggled the web and found some solutions. And on the basis of those many solutions and posts, I wrote a summarized article focusing on this problem.

It need some simple steps to follow,

  1. Download archive from approved answer. Extract files /dompdf/lib/fonts/times*.*.
  2. Copy them in your dompdf fonts folder.
  3. Edit dompdf_font_family_cache.dist.php with snippet 1.
  4. In CSS use font-family: times;.

Snippet 1:

 /* ... */  
 'times' => array (  
   'normal' => DOMPDF_FONT_DIR . 'times',  
   'bold' => DOMPDF_FONT_DIR . 'timesbd',  
   'italic' => DOMPDF_FONT_DIR . 'timesi',  
   'bold_italic' => DOMPDF_FONT_DIR . 'timesbi'  
 ),  
 'times-roman' => array (  
   'normal' => DOMPDF_FONT_DIR . 'times',  
   'bold' => DOMPDF_FONT_DIR . 'timesbd',  
   'italic' => DOMPDF_FONT_DIR . 'timesi',  
   'bold_italic' => DOMPDF_FONT_DIR . 'timesbi'  
 ),  
 /* ... */  

If you want to use your own TTF font (say, Arial.ttf):
  1. Run: ttf2afm -o Arial.afm Arial.ttf. (I did it in Ubuntu.)
  2. Run: ttf2ufm -a -F Arial.ttf. (you can use /dompdf/lib/ttf2ufm/bin/ttf2ufm.exe.)
  3. Copy Arial.* files in /dompdf/lib/fonts/.
  4. Add to dompdf_font_family_cache.dist.php snippet 2.
  5. In CSS use font-family: arial;.

Snippet 2:

 /* ... */  
 'arial' => array (  
   'normal' => DOMPDF_FONT_DIR . 'Arial',  
   'bold' => DOMPDF_FONT_DIR . 'Arial',  
   'italic' => DOMPDF_FONT_DIR . 'Arial',  
   'bold_italic' => DOMPDF_FONT_DIR . 'Arial'  
 )  
 /* ... */  

 Please feel free to post you comments and suggestions.

Thanks
 

Thursday, May 3, 2012

Working with arrays in pyrocms plugins

Hi guys, I am writing this post for one of my cool blog reader. He posted a comment that how we can return arrays from plugins to plugin view files and then how we can loop through and display the values of that array.

Pyrocms is very cool in handling this type of thing because it has a very strong template engine already built-in its codeignitor package. In order to explain how to use array in pyrocms plugin, i will take the same "example" plugin which I explained in this post http://our-knowledge-base.blogspot.com/2012/04/how-to-develop-custom-plugin-in-pyrocms.html.

Adding another function:

Open "example" plugin code and put the following function some where in that class.
 <?php  
 public function myposts()  
 {  
           $plugin_data = array();  
           $plugin_data[] = array(  
                                    'value'          => "Post # 1 value",  
                                    'title'          => 'Post # 1 title'  
                               );  
           $plugin_data[] = array(  
                                    'value'          => "Post # 2 value",  
                                    'title'          => 'Post # 2 title'  
                               );  
           $plugin_data[] = array(  
                                    'value'          => "Post # 3 value",  
                                    'title'          => 'Post # 3 title'  
                               );  
           return $plugin_data;  
      }  
 ?>  

so after adding this function whole plugin code will look like this,
1:  <?php defined('BASEPATH') OR exit('No direct script access allowed');  
2:  /**  
3:   * Example Plugin  
4:   *  
5:   * Quick plugin to demonstrate how things work  
6:   *  
7:   * @package          PyroCMS  
8:   * @author          PyroCMS Dev Team  
9:   * @copyright     Copyright (c) 2009 - 2010, PyroCMS  
10:   *  
11:   */  
12:  class Plugin_Example extends Plugin  
13:  {  
14:       /**  
15:        * Hello  
16:        *  
17:        * Usage:  
18:        * {{ example:hello }}  
19:        *  
20:        * @param     array  
21:        * @return     array  
22:        */  
23:       function hello()  
24:       {  
25:            $name = $this->attribute('name', 'World');  
26:            return 'Hello '.$name.'!';  
27:       }  
28:   
29:  
30:
31:   public function myposts()  
32:   {  
33:         $plugin_data = array();  
34:         $plugin_data[] = array(  
35:                                    'value'          => "Post # 1 value",  
36:                                    'title'          => 'Post # 1 title'  
37:                               );  
38:         $plugin_data[] = array(  
39:                                    'value'          => "Post # 2 value",  
40:                                    'title'          => 'Post # 2 title'  
41:                               );  
42:         $plugin_data[] = array(  
43:                                    'value'          => "Post # 3 value",  
44:                                    'title'          => 'Post # 3 title'  
45:                               );  
46:          return $plugin_data;  
47:      }  
48:  }  
49:  /* End of file example.php */

How to use this?
Using this is very simple. You just have to paste following code in view file. It will show post titles in the form of a list.
 {{ example:myposts }}  
     <strong>{{ name }}:</strong> {{ value }}<br />  
 {{ /example:myposts }}  

Although this is a very simple explanation of how to handle arrays in pyrocms, but after ready and understanding this example, you can easily modify this or even can develop your own complex plugin.

Please feel to post comments on this.

Thanks