Archive for October, 2008

Photoshop Competition Voting…

I have voted in the second round of the election 2008! For who, is not much of a big secret… Next is the worst part, I hate waiting… But we have to wait until one wins, to check the result live visit here… So while waiting why not participate and/or cast your vote on Crestock Photoshop Competition too, a competition to show off your creativity and Photoshop skills, among the many out in the net! Thou I have missed a couple of entries more or less I do participate in this competition every year! What for? It is fun and exciting!

The first round was about US Election 2008, a propagenda poster, it is over and here is the one that I came up with! Click to enlarge!

If you are a photoshop dude or dudy and have some time to kill, head your way to 2008 competition. The first round is over, but you can register and enter the 2nd, 3rd & 4th round. While you are there remember to cast your votes!

Note: This post is time sensitive…

Advertisements

4 Comments

Leaflet design for WTM 2008

A small leaflet designed for WTM 2008! enjoy!

2 Comments

Find the duration in hours and minutes of two times using PHP

Another function that you can use to find the duration of any given two times. If you know PHP you can modify this further to include years, days & months (if you need help let me know!). But right now it will only say the time differences of two inputted times, which is actually what I need for now!

function duration($start,$end){
$tmp_e = explode(“:”,$end);
$tmp_s = explode(“:”,$start);
$start_time = mktime($tmp_s[0],$tmp_s[1],$tmp_s[2],8,8,8);
$end_time = mktime($tmp_e[0],$tmp_e[1],$tmp_e[2],8,8,8);
$durationt = $end_time-$start_time;
$hrs = intval(floor($durationt/3600));
$min = intval(floor($durationt/60))-($hrs*60);
if($hrs<>0){
$rval = $hrs.’ hr’;
}
if($min<>0){
if($hrs<>0){
$rval .= ‘ & ‘.$min.’ min’;
} else {
$rval = $min.’ min’;
}
}
return $rval;
}

How to use it:

$timeOne =’12:31′;

$timeTwo = ’15:43′;

echo duration($timeOne,$timeTwo); //output: 3 hours & 12 min

,

Leave a comment

Find the Saturday of any week using PHP!

When dealing with weeks, one problem that I face is the difference in week start day! For us the week start with Saturday but for the most parts in the rest of the world the week start with Sunday or Monday! So in PHP calculations and queries related with weeks, it is important to find the previous Saturday of a given day in a week! The following function will tell you the Saturday of any week, provided you give it any day within the week.

<?php
function wksaturday($day) //input format: d/m/yyyy
{
$tmp = explode(“/”,$day);
$dateob = mktime(0,0,0,$tmp[1],$tmp[0],$tmp[2]);
$toadd = -1-(date(‘w’,$dateob));
if($toadd<=-7){
$toadd += 7;
}
$dadate = mktime(0,0,0,$tmp[1],$tmp[0]+($toadd),$tmp[2]);
return date(‘d/m/Y’,$dadate);
}

?>

How to use it:

<?php

$mydate =’24/12/2008′;
echo “saturday: “.wksaturday($mydate); //output saturday: 20/12/2008

?>

,

Leave a comment

TVM New Logo!

I guess it is about time TVM changes their logo! Here is one candidate!


Are you really serious TVM is changing their logo! I have no idea, I was just fooling around with Photoshop! Just blink your eyes while looking at this wallpaper!

6 Comments

Add days to a given date in PHP

When dealing with dates it is necessary to add or subtract a given number of days to a date! I use the following little function to do it in PHP.

function dateadd($day,$toadd) //input format: d/m/yyyy
{
$tmp = explode(“/”,$day);
$dadate = mktime(0,0,0,$tmp[1],$tmp[0]+($toadd),$tmp[2]);
return date(‘d/m/Y’,$dadate);
}

It is a simple function that split the inputed date into an array and create a date object with the number of additional days included in the creation. And then format the out put!

How to use:

<?php
$mydate =’24/12/2008′;
echo dateadd($mydate,30); //output 23/01/2009
?>

,

4 Comments