ADVERTISEMENT


Breaking News

Recent Posts

Sunday, September 27, 2015

How to add Youtube loading bar on your site

How Youtube stacking bar on top of their feature pages, it demonstrates page is stacking and which really looks really cool. Today I will demonstrat to you how you can rapidly include Youtube like advancement bar our site.

Go to Github and download nprogress Javascript plugin or simply indicate nprogress CDN here, it is especially made for Ajax web application yet you can different things with it as well.

Everything we need is nprogress.js and nprogress.css from the repo.

Step 1:
Add nprogress.js and nprogress.css 
 <script src='https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js'></script>  
 <link rel='stylesheet' href='ttps://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css'/>  

Step 2

Nprogress offers two methods NProgress.start() and NProgress.done(), we will incorporate them with DOM document.readyState property, it tells us the loading status of the current document. That’s it! Just put the following code at the bottom of your page but before tag and you should see it in action.

 //Page is loading start progress  
 document.onreadystatechange = function () {  
  if (document.readyState == "interactive") {  
   NProgress.start(); //start progress bar  
  }  
 }  
 //when page is loaded stop progress   
 var everythingLoaded = setInterval(function() {  
  if (/loaded|complete/.test(document.readyState)) {  
   clearInterval(everythingLoaded);  
   setTimeout(function(){NProgress.done()},2000);  
  }  
 }, 10);  

jQuery version

 $(document).ready(function() {  
   NProgress.start();  
 });  
 $(window).load(function() {  
   //setTimout() for 2 seconds progress stop delay  
   setTimeout(function(){NProgress.done()},2000);  
 });  


Usage 
Method for using is so simple when page load just use NProgress.start() and when page loading id complete just done it with NProgress.done()
Read more ...

Sunday, September 13, 2015

Return html entity of currency code in php

Some time you need to get html entity of currency code so 
I would like to share with you a smart method you just need to add below method in your project, 

It includes major famous country code or you can add it more hope 
so that will work fine for you J



 /* get html entity of currency symboles */  
 function GetCurrencySymbol($cc = 'USD')  
 {  
   $cc = strtoupper($cc);  
   $currency = array(  
   "USD" => "&#36;" , //U.S. Dollar  
   "AUD" => "&#36;" , //Australian Dollar  
   "BRL" => "R&#36;" , //Brazilian Real  
   "CAD" => "C&#36;" , //Canadian Dollar  
   "CZK" => "K&#269;" , //Czech Koruna  
   "DKK" => "kr" , //Danish Krone  
   "EUR" => "&euro;" , //Euro  
   "HKD" => "&#36" , //Hong Kong Dollar  
   "HUF" => "Ft" , //Hungarian Forint  
   "ILS" => "&#x20aa;" , //Israeli New Sheqel  
   "INR" => "&#8377;" //Indian Rupee  
   "JPY" => "&yen;" , //Japanese Yen   
   "MYR" => "RM" , //Malaysian Ringgit   
   "MXN" => "&#36" , //Mexican Peso  
   "NOK" => "kr" , //Norwegian Krone  
   "NZD" => "&#36" , //New Zealand Dollar  
   "PHP" => "&#x20b1;" , //Philippine Peso  
   "PLN" => "&#122;&#322;" ,//Polish Zloty  
   "GBP" => "&pound;" , //Pound Sterling  
   "SEK" => "kr" , //Swedish Krona  
   "CHF" => "Fr" , //Swiss Franc  
   "TWD" => "&#36;" , //Taiwan New Dollar   
   "THB" => "&#3647;" , //Thai Baht  
   "TRY" => "&#8378;" //Turkish Lira  
   );  
   if(array_key_exists($cc, $currency)){  
     return $currency[$cc];  
   }  
 }  

Usage

 GetCurrencySymbol(“CAD”);  
Read more ...

How to detect Ajax Request in PHP

In php you can detect that request send on your page is from ajax or not, 
Ajax requests usually set X-Requested-With request header which is set by different kind of js libraries i.e jQuery , Mootools



So its very good technique to use below script on top of your page if you want only ajax request acceptable. In other case you can show him Warning message.

 if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {  
   echo 'Only Ajax requests acceptable';  
 }  
Read more ...

Saturday, September 5, 2015

How to Convert Plain url into clickable links in Php

Here is the simple function that can convert string into clickable links, very easy to use just copy it and paste it where you want to use within you project or you cna modify it accordingly .

 function plain_url_to_link($string) {
  return preg_replace(
  '%(https?|ftp)://([-A-Z0-9./_*?&;=#]+)%i',  
  '<a target="blank" rel="nofollow" href="$0" target="_blank">$0</a>', $string);
 }




Usage 

 Jus use it as below mention...

 $str = "http://www.google.com is a search website, you can also visit http://yahoo.com and http://twitter.com";
 echo plain_url_to_link($str);

Read more ...

Friday, September 4, 2015

5 Best Ecommerce web solution

E-commerce has turned into a critical component for most organizations nowadays as it spares time and makes things attainable. Be that as it may, these advantages must be appreciated in the event that you have a productively living up to expectations content administration framework. Choosing which content administration framework to decide for your business is an extreme occupation, so how would you choose which CMS is best for you? We have assembled a rundown of the 5 best CMS that have practical experience in e-trade to help you decide on which sort of framework will be best for you:

1. Magento

Magento, with its not insignificant rundown of elements, is a standout amongst the most intense substance administration frameworks accessible. It may have a precarious expectation to learn and adapt yet once you get the hold of it, the potential outcomes are inestimable. You can undoubtedly alter and outline your framework precisely the way you need. Be it complex rebates or voucher frameworks, Magento is great at taking care of everything. It can coordinate Google site streamlining agent and has numerous valuable modules to offer. With the assistance of its solid group, you can without much of a stretch discover speedy fixes in the event that you experience an issue.

2. Prestashop

Prestashop is an open source CMS and is a great option if you are running a small or medium business. Being able to handle a wide range and types of products, it allows you to add many lists of products and their related items, each with separate details and pictures. You can create many different types of coupons and promotional offers and also manage how each one of them would work. It also has an ability to design loyalty programs for regular customers.

3. OpenCart

OpenCart is a splendid CMS for both little and extensive organizations and has an extremely easy to understand interface. It can deal with a vast mixed bag of items and can order them as per maker or traits. It can likewise give item audits and evaluations to the simplicity of the clients. Offering an extensive variety of additional items and expansions, it gives the client the capacity of complete customization of the stage.

4. Zen Cart

Zen cart has turned out to be a standout amongst the most dependable open source content administration frameworks around. The alluring nature of this framework is its accessibility of a wide mixed bag of additional items and expansions permitting you to alter the framework precisely the route you like. It can arrange your items into a mixed bag of characteristics, for example, shading, size, and so forth furthermore gives you the alternative of including their surveys. It has an in number group and gathering framework which helps you alter your issues at the earliest opportunity.

5. OsCommerce

OsCommerce is another great stage for overseeing e-business and is a host to more than 10,000 unique sites. It meets expectations truly well with little or medium organizations. Like whatever other great CMS, it can proficiently order your items and make sub-classes. It underpins downloadable items as well as work with a mixed bag of dialects and installment strategies. It offers numerous adjustable elements and has a library of more than 7000 additional items.

Conclusion

Every substance administration framework is composed with some particular components keeping in mind one CMS may be awesome for one business, it may be awful for another. In this manner, picking a CMS that takes into account your each need is the particular case that you ought to go for. An effective CMS functions admirably as well as gives most straightforwardness to the directors or administrators and in addition the customers.
Read more ...

Tuesday, December 30, 2014

How to start Angular JS

Angular JS is very well know updated js lib by google, mostly people thinks how to take first step to start it,
let me give you introduce it in very ease way;

just creating an html page and paste below code:

 <!DOCTYPE html>  
 <html>  
 <head>  
   // including angular.js lib file from google, you can download it and add locally  
   <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>  
 </head>  
 <body>  
 <div ng-app="">  
   <div>My Name: <input type="text" ng-model="myName"></div>  
   <p ng-bind="myName"></p>  
 </div>  
 </body>  
 </html>  

- In head section included angular.js file is online from google you can dowload it locally .
- ng-app it is the identifier which will define the scope of angular , if you want for whole page you can add with body tag
- ng-model directive stores/updates the value of the input field into/from a variable.
- ng-bind it will bind the value of model to this (p,input).
Read more ...

Monday, December 29, 2014

How to convert date timezone with php

. Its very easy way to convert time to required time zone, below is the example to convert time GMT time to los angeles time zone.

- First we are creating php time zone object with our required time zone in this example it "los angeles" which is GMT -8.

- then we creates datetime object with oldtime zone which is GMT by default other wise we can pass it object if any other time zone required.

-setTimeZone is the function which will get the new time zone object and convert date into it, you can echo it and check it out.

1:   $newTimeZone = new DateTimeZone('America/Los_Angeles');  
2:   $date = new DateTime('01-02-2014 09:00:00');  
3:   $date->setTimeZone($newTimeZone);  
4:   echo $date->format('Y-m-d H:i:s')."\n";  
Read more ...
Designed By Published.. Blogger Templates