Week 2 for me: Week 2 all all is well :D... - No Smoking Day

No Smoking Day

5,216 members32,485 posts

Week 2 for me

nsd_user663_2151 profile image
11 Replies

Week 2 all all is well :D

Does anyone want to join my stats wall? All in real time.

Look at my stats link below and if you do, let me know. You can be added to my link or I can start one just for you and give you the URL so you can link yours.

Written by
nsd_user663_2151 profile image
nsd_user663_2151
To view profiles and participate in discussions please or .
11 Replies
nsd_user663_2133 profile image
nsd_user663_2133

Dear WHF

WELL DONE MATEY

img.photobucket.com/albums/...

Brill - now how are you going to celebrate????

Poppyfairyxx

nsd_user663_2151 profile image
nsd_user663_2151

Beer later.

nsd_user663_2133 profile image
nsd_user663_2133

WHF

Could you please do my smoking stats - what do you need?

poppyfairyxx

nsd_user663_2151 profile image
nsd_user663_2151

Hi Poppyfairy,

Start date and time and if you want a page of your own?

nsd_user663_1704 profile image
nsd_user663_1704

Ok but is the prgramme written with constants?

I mean the months won't equate will they? because we have different length months!!!! and the 29 days soon run out of sync :(

I want someone to work on a formula that will give the variants of the months!! :D

Though It must be impossible because no ones done it :(

nsd_user663_1704 profile image
nsd_user663_1704

hehehe like your quotes of the visit

'Last night I lay in bed looking up at the stars in the sky and I thought to myself, "Where the heck is the ceiling?'

Other than that the site seems pretty west ham related! :p

You seem to suffer with gary numan as i do buffy the vampire slayer lol

nsd_user663_2142 profile image
nsd_user663_2142

WAY TO GO WEST HAM!!!!!!

nsd_user663_2151 profile image
nsd_user663_2151

Nosmoke4me.

Ta :D

Buffy,

I cleaned the site out and haven't had a chance to put anything back. The code is PHP driven and basically splits out the start and current time and then divides this up. It isn't 100% accurate, yet but I will work on it. I have got a hidden days longer I will live based on saving 11 minutes a ciggie but I am still messing with it.

The code has years and months that only show when these are greater than zero and if the number is one is has singular text and plural for more than one. If there are no days or weeks for example it does not show them. For example days are not showing at the moment but will re-appear tomorrow.

Buffy the smoke slayer more like :D

nsd_user663_1704 profile image
nsd_user663_1704

The singular and plural is cool most don't bother as with not showing text with a negative value!! very good x x

0 years 0 months is nonsensical and not too encouraging lollol

The exact lengths of months are impossible I guess :rolleyes:

Hehehe smoke slayer :D

nsd_user663_2151 profile image
nsd_user663_2151

The code so far is

<link rel="stylesheet" type="text/css" href="style.css">

$start = "2007-08-17 06:00:00";

$text = "have passed since I stopped smoking.";

//--------------------------

$now = strtotime ("now");

$then = strtotime ("$start");

$difference = $now - $then ;

$num = $difference/86400;

$num1 = $num/365;

$years = intval($num1);

$temp = $difference/86400 - $years*365;

$num2 = $temp/30;

$months = intval($num2);

$temp = $difference/86400 - ($years*365) - ($months*30);

$num3 = $temp/7;

$weeks = intval($num3);

$num3a = $difference/86400 - ($years*365) - ($months*30) - ($weeks*7);

$days = intval($num3a);

$num4 = ($difference/86400 - intval($difference/86400))*24;

$hours = intval($num4);

$num5 = ($num4 - $hours)*60;

$mins = intval($num5);

$num6 = ($num5 - $mins)*60;

$secs = intval($num6);

$saving = $days*5;

$saving = $difference/86400*5;

$saved = $difference/4320;

$differencea = $saved*11;

if ( $years > 1 ) {

echo $years ;

echo " Years, ";

} elseif ( $years == 1 ) {

echo $years ;

echo " Year, ";

} else {

echo " ";

}

if ( $months > 1 ) {

echo $months ;

echo " Months, ";

} elseif ( $months == 1 ) {

echo $months ;

echo " Month, ";

} else {

echo " ";

}

if ( $weeks > 1 ) {

echo $weeks ;

echo " Weeks, ";

} elseif ( $weeks == 1 ) {

echo $weeks ;

echo " Week, ";

} else {

echo " ";

}

if ( $days > 1 ) {

echo $days ;

echo " Days, ";

} elseif ( $days == 1 ) {

echo $days ;

echo " Day, ";

} else {

echo " ";

}

if ( $hours > 1 ) {

echo $hours ;

echo " Hours, ";

} elseif ( $hours == 1 ) {

echo $hours ;

echo " Hour, ";

} else {

echo " ";

}

if ( $mins > 1 ) {

echo $mins ;

echo " Minutes, ";

} elseif ( $mins == 1 ) {

echo $mins ;

echo " Minute, ";

} else {

echo " ";

}

if ( $secs > 1 ) {

echo $secs ;

echo " Seconds, ";

} elseif ( $secs == 1 ) {

echo $secs ;

echo " Second, ";

} else {

echo " ";

}

echo " ";

echo $text ;

?>

<br>

<?

echo "Based on £5 per packet I have saved £";

echo(floor($saving));

?>

<br>

<?

echo "Based on smoking 20 cigarettes per day I have saved myself from smoking ";

echo(floor($saved));

echo " cigarettes! ";

?>

Help yourself if you have a host with PHP

nsd_user663_1704 profile image
nsd_user663_1704

Very impressive :D

I have not but thanks x x

The post is here forever if people search it out in the future :D

I haven't used programming except basic html and dreamweaver type stuff

Since Basic!! :eek:

Last program i wrote was some funny quiz game thing for the zx spectrum :D

hehehehe

You may also like...

week 2 day 10 new me (again)

around us- do i want to have more energy? do i want to do more things? do i want to reread fav...

week 2? me?!

course, they didn't. The people that love you don't want you to smoke! instead I was irritatingly...

Week 2 for me.. day 15

doing well. and on my 15th day. people can smoke around me and im fine with it, hate the look of ash

Happy week 2 to me-cakes are on me

instead (Bad) And my ******* boss keeps giving me a hard time over NOTHING....I could potentially...

Privileged to write in week 2

Hello all!!! I feel great to be able to write in the week 2 forum!! :D I am on my 8th day today and