Become a Patron!

Banners needed .

James

Bronze Contributor
Member For 4 Years
Member For 3 Years
ECF Refugee
Has anyone seen a banner that will do something like this
Vaping =6 days Analogs avoided = 600 money saved = $200 Money spent on Mods, batterys, attys = $2000 ?
 

tick22

Silver Contributor
Member For 4 Years
Member For 3 Years
Member For 2 Years
Member For 1 Year
Member For 5 Years
I think what he is looking for is a little tongue in cheek thing.
He asks for :

How long he has been vaping. 12/12/12
How many smokes avoided 1234
Money saved on smokes $1000
Money he spent on vaping $5000.

I have never seen the how much money spent on Vaping before, I guess cause it would scare the hell out of anyone not really knowing what all is out there.

Remember, they are pushing vaping as a way to stop smoking, improve your life and save money. (ok, pushing is the wrong term, but)

as you can see 2 out of three things are true.
The last, well, we all know how much money we have spent. Even with DIYing, you spent tons before you did that.

So yes, it's a little tongue in cheek, but true. In time, we do save money, but not during that first year, or hell, first 3 months....
 

jae

Silver Contributor
Member For 4 Years
You got a PHP server i'll slap that together for you. You'd just need to know the average amount you spend in, say, a month. My sig actually takes this cost into account when calculating the money saved, but i don't show the amount spent. [EDIT - ok now i do!]

In my case i figure on about $1 a day, though i've never actually sat down and did a proper accounting of what i actually really do spend. But i don't imagine it's more than $400 a year (although i could be wrong).
 
Last edited:

jae

Silver Contributor
Member For 4 Years
Code:
<?php
/*
********************************************************************************************
* x jeremy jarratt coded this terribly didn't he - http://jeremyjarratt.com/ - @transmothra
*                    PRAISE DOBBS! HAIL ERIS! ALL HAIL DISCORDIA!
*                         This work is licensed under the 
*     Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. 
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
********************************************************************************************
*/

// EDIT THESE NEXT FEW LINES
// set your timezone or suffer the consequences
date_default_timezone_set('America/New_York');

// set your quit date
$quitdate = "2010-08-16"; // change this to your quit date

// how much is a pack of smokes worth where you live?
$cigprice = 5.00; // omit the dollar sign

// how many packs per day did you smoke?
$packsperday = 2.5; // decimals ok

// how much do you spend on vaping per month?
$vapecostmonthly = 30; // omit the dollar sign

// set your font by filename - UPLOAD YOUR FONT FILE TO THE SAME DIRECTORY
$font = './trebuc.ttf';
$fontb = './trebucbd.ttf';

// number of pixels for the left margin
$left_margin = 5;

// HEY LET'S CALCULATE A BUNCH OF CRAP (in general, leave this alone)
	$now = time(); // this is really NOW, for comparison to your quit date
    $your_date = strtotime($quitdate);
    $datediff = $now - $your_date;	// compare your quit date to right now (output in seconds)
	$datetime1 = new DateTime($quitdate);
	$datetime2 = new DateTime();
	$interval = date_diff($datetime1, $datetime2); // just another time comparison
	$howlong = $interval->format('%y years, %m months, %d days');
	$vapedays = floor($datediff/(60*60*24)); // convert time since quitting to days (rounded down to eliminate any remainder)
	$vapecostdaily = $vapecostmonthly/30; // divide monthly cost by 30 for a daily cost
	$vapecost_ttl = $vapecostdaily*$vapedays; // multiply daily vape cost by total days since quitting
	$vapesaved = $vapedays*$cigprice*$packsperday-$vapecost_ttl; // days x cost x ppd, minus vaping costs
	$cigsavoided = $packsperday*20*$vapedays;	// ppd x 20 smokes per pack x total days since quitting
	$packs = $cigsavoided/20;	// total number of packs avoided since quitting
// format numbers: decimal places, decimal separator, thousands separator
		$vapesaved = number_format($vapesaved, 2, '.', ',');
		$vapecost_ttl = number_format($vapecost_ttl, 2, '.', ',');
		$cigsavoided = number_format($cigsavoided, 0, '.', ',');
		$packs = number_format($packs, 0, '.', ',');
		$vapedays = number_format($vapedays, 0, '.', ',');

// put in a bunch of quotes or whatever you want; space is limited!; rotated on a random basis
$randomquote = array(
	'How can I be free in the shadow of a chapel? (anon)',
	'We are a way for the cosmos to know itself. (C.Sagan)',
	'I\'d take the awe of understanding over the awe of ignorance any day. (D.Adams)',
	'I love deadlines. I love the whooshing noise they make as they go by. (D.Adams)',
	'DON\'T PANIC (D.Adams)',
	'Nothing is true. Everything is permissible. (Hassan i Sabbah)',
	'Curb Your Dogma. (Hill/Thornley)',
	'The Enlightened take things Lightly. (Hill/Thornley)',
	'Ideologies separate us. Dreams and anguish bring us together. (Ionesco)',
	'Anyone who isn\'t confused doesn\'t really understand the situation. (E.Murrow)',
	'As for me, all I know is that I know nothing. (Socrates)',
	'Only the madman is absolutely sure. (RA Wilson)',
	'A frog in a well cannot conceive of the ocean. (Zhuangzi)',
	'With our thoughts we make the world. (Gotama)',
	'Oppressive laws don\'t destroy minorities; they simply make bootleggers. (HL Mencken)',
	'Nature abhors a moron. (HL Mencken)',
	'Puritanism: The haunting fear that someone, somewhere, may be happy. (HL Mencken)',
	'The highest understanding we can achieve: laughter & human compassion. (Feynman)',
);
$quotation = $randomquote[rand(0, sizeof($randomquote) - 1)];

// DON'T EDIT UNLESS YOU KNOW WHAT YOU'RE DOING
$image = 'signature_bar.png'; // create a banner image with this name; 468 pixels wide by 60 pixels tall
$im = imagecreatefrompng($image);

// set colors (RGB)
$main_color = imagecolorallocate($im, 51, 102, 153);
$black = imagecolorallocate($im, 0, 0, 0);
$orange = imagecolorallocate($im, 255, 140, 0);
$blue = imagecolorallocate($im, 216, 196, 255);
$red = imagecolorallocate($im, 255, 0, 0);
$green = imagecolorallocate($im, 0, 160, 0);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 216, 216, 216);
$yellow = imagecolorallocate($im, 255, 216, 64);

/* OUTPUT FOR TESTING/DEBUGGING - TO TEST, COMMENT OUT EVERYTHING BELOW THIS BLOCK TO THE END
echo "now = ".$now."<br>".
	"quitdate = ".$quitdate."<br>".
	"your_date = ".$your_date."<br>".
	"datediff = ".$datediff."<br>".
	"howlong = ".$howlong."<br>".
	"vapedays = ".$vapedays."<br>".
	"vapesaved = ".$vapesaved."<br>".
	"cigsavoided = ".$cigsavoided."<br>".
	"packs = ".$packs."<br>"
;
*/

// THE MAGIC: set font size, font angle, horizontal position, vertical position, color, fontface, text
// Add the text - drop shadow
imagettftext($im, 12, 0, $left_margin-2, 18, $black, $fontb, 'Vaping since 16 August 2010; '.$howlong);
imagettftext($im, 10, 0, $left_margin-2, 34, $black, $font, 'Cigarettes avoided: '.$cigsavoided.' in '.$packs.' packs');
imagettftext($im, 10, 0, $left_margin-2, 50, $black, $font, 'Money spent on better things: $'.$vapesaved);
imagettftext($im, 8, 0, $left_margin-1, 65, $black, $fontb, $quotation);

// Add the text
imagettftext($im, 12, 0, $left_margin, 16, $orange, $fontb, 'Vaping since 16 August 2010; '.$howlong);
imagettftext($im, 10, 0, $left_margin, 32, $blue, $font, 'Cigarettes avoided: '.$cigsavoided.' in '.$packs.' packs');
imagettftext($im, 10, 0, $left_margin, 48, $white, $font, 'Money spent on better things: $'.$vapesaved.' ($'.$vapecost_ttl.' of that vaped)');
imagettftext($im, 8, 0, $left_margin, 64, $yellow, $fontb, $quotation);

// LEAVE THESE ALONE DAMN YOU
header('Content-Disposition: filename=signature_bar.png');
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?>
 

CJ

VU Webmaster
Staff member
VU Senior Leadership
VU Senior Administrator
VU Administrator
Senior Moderator
VU Donator
Platinum Contributor
ECF Refugee
Member For 5 Years
Reddit Exile
VU Patreon
#DatPHPdoe
 

jae

Silver Contributor
Member For 4 Years
Just realized there's a mistake on the third line of the drop-shadow text section, which doesn't have the added text. That should be:
Code:
// Add the text - drop shadow
imagettftext($im, 12, 0, $left_margin-2, 18, $black, $fontb, 'Vaping since 16 August 2010; '.$howlong);
imagettftext($im, 10, 0, $left_margin-2, 34, $black, $font, 'Cigarettes avoided: '.$cigsavoided.' in '.$packs.' packs');
imagettftext($im, 10, 0, $left_margin-2, 50, $black, $font, 'Money spent on better things: $'.$vapesaved.' (incl. $'.$vapecost_ttl.' vaped)');
imagettftext($im, 8, 0, $left_margin-1, 65, $black, $fontb, $quotation);
 

James

Bronze Contributor
Member For 4 Years
Member For 3 Years
ECF Refugee
Ummmm I guess I better be more carefull of the things that I try to make fun off .
 

lordmage

The Sky has Fallen. the End is Here.
Staff member
Senior Moderator
VU Donator
Gold Contributor
ECF Refugee
Member For 5 Years

tick22

Silver Contributor
Member For 4 Years
Member For 3 Years
Member For 2 Years
Member For 1 Year
Member For 5 Years
Thanks Jeremy, you came through when everyone else was, well, who knows.

See James, you got what you ask for, even if you didn't really want it..
 

James

Bronze Contributor
Member For 4 Years
Member For 3 Years
ECF Refugee
Well I did want it ...its just that I dont have a php server to host it .I almost hate to sugest it but could it also have something linking to this forum in in ?
 
testing LOL
imagettftext($im, 12, 0, $left_margin-2, 18, $black, $fontb, 'Vaping since 16 August 2010; '.$howlong);
imagettftext($im, 10, 0, $left_margin-2, 34, $black, $font, 'Cigarettes avoided: '.$cigsavoided.' in '.$packs.' packs');
imagettftext($im, 10, 0, $left_margin-2, 50, $black, $font, 'Money spent on better things: $'.$vapesaved.' (incl. $'.$vapecost_ttl.' vaped)');
imagettftext($im, 8, 0, $left_margin-1, 65, $black, $fontb, $quotation);
 

Emilie

Silver Contributor
Member For 4 Years
Member For 3 Years
Member For 2 Years
Member For 1 Year
Member For 5 Years
The signature I offer links back to my site where others can fill out the same thing, but you could always change the link to whatever you want.

The given link is in BBCode format. You can find the form in my bottom signature image. :)
 

Emilie

Silver Contributor
Member For 4 Years
Member For 3 Years
Member For 2 Years
Member For 1 Year
Member For 5 Years
I should also mention that this is a slightly tweaked and hosted version of the code that @jeremy wrote and posted above. :)
 
You got a PHP server i'll slap that together for you. You'd just need to know the average amount you spend in, say, a month. My sig actually takes this cost into account when calculating the money saved, but i don't show the amount spent. [EDIT - ok now i do!]

In my case i figure on about $1 a day, though i've never actually sat down and did a proper accounting of what i actually really do spend. But i don't imagine it's more than $400 a year (although i could be wrong).

Hey guys, I'm wondering if I can get some help here. I have created a php file copying Jeremy's code and dropped in in my root folder. I am getting an error when I call up the php file:
Fatal error
: Call to undefined function date_diff() in /home/content/t/h/e/theredlines/html/signature_bar.php on line 41


Any ideas as to what I'm doing wrong? I did a simple cut and paste of the code so I figured I'd be good to go.
 

JuicyLucy

My name is Lucy and I am a squonkaholic
VU Donator
Diamond Contributor
ECF Refugee
VU Challenge Team
Member For 5 Years
I have never seen the how much money spent on Vaping before, I guess cause it would scare the hell out of anyone not really knowing what all is out there.

ROFLMAO
 

JuicyLucy

My name is Lucy and I am a squonkaholic
VU Donator
Diamond Contributor
ECF Refugee
VU Challenge Team
Member For 5 Years
Yep;)
Just added the banner and thought this would be a good thread to test it in. Just rewarding myself for being off the sticks for two weeks:confetti:

Congratulations!!!

It took me over two and a half years to stop dual using :eek:
 

Rickajho

Gold Contributor
Member For 3 Years
ECF Refugee
Yep;)
Just added the banner and thought this would be a good thread to test it in. Just rewarding myself for being off the sticks for two weeks:confetti:

Congrats! :banana:

When I was first quit I found the banner to be a good motivator. Did I really want to break my first successful 2 week streak? Or 1 month? Or 4 months? It did help.

Haven't had a single cigarette since 07/31/2011 and I plan on keeping it that way.
 

Paratech

I forgot
VU Donator
Gold Contributor
Member For 4 Years
Just realized there's a mistake on the third line of the drop-shadow text section, which doesn't have the added text. That should be:
Code:
// Add the text - drop shadow
imagettftext($im, 12, 0, $left_margin-2, 18, $black, $fontb, 'Vaping since 16 August 2010; '.$howlong);
imagettftext($im, 10, 0, $left_margin-2, 34, $black, $font, 'Cigarettes avoided: '.$cigsavoided.' in '.$packs.' packs');
imagettftext($im, 10, 0, $left_margin-2, 50, $black, $font, 'Money spent on better things: $'.$vapesaved.' (incl. $'.$vapecost_ttl.' vaped)');
imagettftext($im, 8, 0, $left_margin-1, 65, $black, $fontb, $quotation);
Great work jeremy
 
Hey guys,

I copy/pasted the php into a file in my server's ~/public_html personal directory. I can only assume the server is setup for php CGI. I put the two font files (ttf) into the same directory. When I try to access the URL or 'wget' it, it's just a 0-length file. Any help to get this code working would be appreciated. And thanks @jeremy for the original code!

Merc
 

VU Sponsors

Top