Saturday, November 5, 2011

Time Difference function between two time in php

 /*
     *#Auth: Amit Sharma
     *#Desc: Fucnction for Time difference
     *#Note: use 24 hours Format only
 */

//Start from here;

<?php

//Call a function:
returnTimeDifference("10:00","14:00");

//echo returnTimeDifference("10:00","14:00");

function returnTimeDifference($dtime,$atime)
{

    echo $dtime."-".$atime."
";
    $nextDay=$dtime>$atime?1:0;
     //use 1 to add for next day if time increases
   
    $dep=explode(':',$dtime);
    $arr=explode(':',$atime);
    // echo $dep[0];

    //use mktime function for two dates difference
    $diff=abs(MKTIME($dep[0],$dep[1],0,DATE('n'),DATE('j'),DATE('y'))-MKTIME($arr[0],$arr[1],0,DATE('n'),DATE('j')+$nextDay,DATE('y')));

    // echo DATE('y');//return code
     echo $diff."
";
     $hours=floor($diff/(60*60));
     $mins=floor(($diff-($hours*60*60))/(60));
     $secs=floor(($diff-(($hours*60*60)+($mins*60))));
   
     if(strlen($hours)<2){$hours="0".$hours;}
     if(strlen($mins)<2){$mins="0".$mins;}
     if(strlen($secs)<2){$secs="0".$secs;}

     return $hours.':'.$mins.':'.$secs;
   
}

?>

Thursday, October 6, 2011

HOW to Divide the time

Hi friends today i want to display the logic behind the , time division in your programming as well as daily routine work or to crack the math questions also..


Lets take an example :

Suppose I have 5 hours and 30 minutes (5h30m)

Then the step I follow are:

  • First divide the hours by 2 .  like 5/2 we got 2 as dividend and 1 as reminder.
  • Now convert this reminder  to minutes by multiplies it to 60.
  • After that add this 60 to the 30(already given minutes).
  • total is 90 (minutes you have).
  • then divide the Ninety   by 2 we got 45.
  • So at last, half of the given time is  2 hour 45 (2h 45m)
  • Basically we have to make the conversion like 
  • hours:minutes:seconds format.
 
The same logic work for Minutes and second (mm::ss) format


Hope you got the point.....

Friday, September 23, 2011

Best Chat module for Jomsocial

Keep in mind that you use joomla1.7 and jomsocial  2.2.3 version

Today i will Explain you the Step by step Guide in Easy and very Clean way how to add a chat module for Joomla1.7 and jomsocial 2.2.3 even this is done by me.

so here i show some links and paths so work as i told to you, hope you find it easy, me  take it 10 days to Do this.

  • Name of Chat module that i found is Cometchat here is its website.(http://www.cometchat.com)
  •  Purchase the Cometchat  for jomsocial from here(or download it from other source if you can)
  • After downloading : Unzip it.
  • Go to the folder where you put your put your Jomsocial folder and Save here the cometchat folder.
    • This one path example: /www/joomla1_7/cometchat
    • or just same where your , Component folder exists.
  • After that on your url :
    • type the complete url :
      • like: www/joomla/cometchat/install.php
      • Install.php is the key file to install this.
      • as you do this some instruction you have to follow like:
        • Full 777 permission to the folders.
        • Copy some code and paste into the HEAD section of your Template page(main template like bee20, default etc)
        • also  Define('') code be updated in config.php  file
      • After completing that , delete the install.php file.
  • Then go to the jomsocial -> login it and enjoy the chat, with your friends.

Also you find this link may be helpful : Guide me!
to downloads the cometchat :use this link but i am not sure that this links works or not

Hope you understand this: if not the Post your Comment sure i will helps you....




Thursday, September 15, 2011

facebook connect in with jomsocial

how to add Facebook sign in Button on my site
or
how to add Facebook sign in Button on your site

here are some step that can easily helps you how to use:
Facebook Connect In on your website.

  • Step 1: go to www.facebook.com and login to it
  • step 2: type www.developer.facebook.com/apps
  • step 3: see the link create application. new apps
  • step4: the type the name of your site, as well as convas url i.e your default index or home page of the site.
  • step5: the you got the  API key as well as secret key.
  • Step6 : then go to your jomsocial->congifration->input the API and secret key ->save it.
  • step 8: congrats you able to do this. At last refresh your site page, you see a facebook sign in button there

Wednesday, September 7, 2011

how to add new software application in openWith option : ubantu

To add new software application in openWith option : ubantu(10.10)

You are using Ubuntu 10.10   - the Maverick Meerkat - released in October 2010 and supported until April 2012.
   
It is very simple:

Steps are:--
  • Right click on any item you want to choose from your system
  • select the option '' custom command to open ''
  • click on browse option-> then choose->file system.
  • file_system->usr i.e. then select usr folder.
  • usr->bin i.e. select the bin folder.
  • then search the software you want to choose.
  • select it and press ok.
  • your application open in that application you want
  • congrts.
Hope you find it easy ....

Tuesday, August 30, 2011

how to change default home page in joomla1.7

In joomla 1.7 if you want to change the Home page

follow these steps in easy ways:


    • LOGIN to site
    • Go to Menu Option
    • Then select the page  you want to New HOME page
    • choose default option. or click on star ( * ).
     
  • Hope you Got it...

Friday, August 26, 2011

Easy way to create Facebook site in Joomla1.7


This is the short and easy method that i share with you how to make a site like Facebook in Joomla1.7.


  • For this:
  • Please check the joomla version and jomsocial version for compatibility before do anything 
    • you have to download free version of JomSocial Component from Internet.
    • then install the Com_community zip folder from the downloaded files in joomla
    • then follow some instruction and click on next.



Wait this i am testing on this tutorial and provide you everyhting about that.


"Under Process....."