DEALGOODER

Have Fun. Do Good. Help Others.

This is the core philosophy that drives DealGooder. We believe that everyone has the ability to make the world a bit better each day. And if you can have fun while doing it, well, we think that’s a win-win and a message worth spreading.

We created DealGooder to make it easy for people to support local charities by doing something they are already going to do – shop.

Every time you purchase a deal on DealGooder, 50% of the profits go back to local charities to support things we all care about like animal shelters, education, and a clean environment. In a nutshell, you get a great deal on something fun to do in your city and as a bonus you get to feel like Mother Teresa knowing that HALF the profits from your purchase go directly to support local charities.

We like to think we give folks the opportunity to donate their cake and eat it too. Others might say we’re trying to make the world a better place one deep tissue massage at a time. Either way, DealGooder creates a win-win-win for everyone – our community gets unbeatable deals, businesses get new customers and local charities get donations!

But we can’t do this without good people. Meet our team of friendly do gooders that make the DealGooder engine run.

‘;
echo ‘

Date Calculator › Here are the shortcode definition

‘;
echo ‘

The Date Calculator plugin has NOW three basic functions.

‘;
echo ‘

1. It returns the current date.

‘;
echo ‘The shortcode 20.08.2017 returns the current date in posts, pages and also in Contact Form 7-forms.
‘;
echo ‘Since version 1.1.0, it is also possible to determine the date format or print only parts of the current date.

‘;
echo ‘

For returning the current date, the following shortcode is available:
‘;
echo ‘
‘;
echo ‘

Examples:

‘;
echo ‘

1.1 Displaying of certain date parts:
‘;
echo ‘It is possible to impersonate only a part of the date, for example the day or month only. This is specified with the show-parameter.
‘;
echo ‘Suppose today is the 01.10.2016

‘;
echo ‘

20.08.2017 returns: 01.10.2016
‘;
echo ‘20 returns: 01
‘;
echo ‘08 returns: 10
‘;
echo ‘2017 returns: 2016

‘;
echo ‘

1.2 Returning a date in your own format:
‘;
echo ‘It is also possible to impersonate a date, in your desired format. This is specified with the format-parameter.
‘;
echo ‘Suppose today is the 01.10.2016

‘;
echo ‘

20.08.2017 returns: 01.10.2016
‘;
echo ‘08/20/2017 returns: 10/01/2016
‘;
echo ‘20. August 2017 returns: 10. October 2016

‘;
echo ‘

Note: The parameter “format” has no effect if parameter “show” is set (except “all”).
‘;
echo ‘For the documentation of the parameter “format” please have a look at PHP: date – Manual.

‘;
echo ‘

2. It can calculate a date.

‘;
echo ‘The shortcodes 20.08.2017 or 20.08.2017 and returns a calculated date in posts, pages and also in Contact Form 7-forms.

‘;
echo ‘

For calculating, the following shortcodes are available:
‘;
echo ‘
‘;
echo ‘

‘;
echo ‘

Examples:

‘;
echo ‘

2.1 Calculating the date down:
‘;
echo ‘Suppose today is the 01.10.2014

‘;
echo ‘

19.08.2017 returns: 30.09.2014
‘;
echo ‘20.05.2017 returns: 01.07.2014
‘;
echo ‘20.08.2013 returns: 01.10.2010
‘;
echo ‘19.05.2013 returns: 30.06.2010

‘;
echo ‘

2.2 Calculating the date up:
‘;
echo ‘Suppose today is the 01.10.2014

‘;
echo ‘

21.08.2017 returns: 02.10.2014
‘;
echo ‘20.11.2017 returns: 01.01.2015
‘;
echo ‘20.08.2021 returns: 01.10.2018
‘;
echo ‘21.11.2021 returns: 02.01.2018

‘;
echo ‘

2.3 Displaying of certain date parts:
‘;
echo ‘It is also possible to impersonate only a part of the date, for example the day or month only. This is specified with the show-parameter.
‘;
echo ‘Suppose today is the 01.10.2014

‘;
echo ‘

21 returns: 02
‘;
echo ‘11 returns: 01
‘;
echo ‘2021 returns: 2018
‘;
echo ‘19.05 returns: 30.07
‘;
echo ‘2017-09-21 returns: 2014-11-02

‘;
echo ‘

2.4 Returning a date in your own format:
‘;
echo ‘It is also possible to impersonate a date, in your desired format. This is specified with the format-parameter.
‘;
echo ‘Suppose today is the 01.10.2016

‘;
echo ‘21.08.2017 returns: 10/02/2016
‘;
echo ‘20.08.2013 returns: 10. October 2012

‘;
echo ‘

Note: The parameter “format” has no effect if parameter “show” is set (except “all”).
‘;
echo ‘For the documentation of the parameter “format” please have a look at PHP: date – Manual.

‘;
echo ‘

3. The Thing “says” a date.

‘;
echo ‘The shortcode 20.08.2017 returns a date in posts, pages and also in Contact Form 7-forms in many different ways like next Monday or last month.
‘;
echo ‘Since version 1.1.0, it is also possible to determine the date format or print only parts of the date.

‘;
echo ‘

For returning the current date, the following shortcode is available:
‘;
echo ‘
‘;
echo ‘

Examples:

‘;
echo ‘

3.1 Displaying a date:
‘;
echo ‘It is possible to impersonate a special date, something like the “second friday of next month” or “third monday of last month”. This is specified with the say-parameter.
‘;

echo ‘Suppose today is the 01.10.2016

‘;
echo ‘

08.09.2017 returns: 11.11.2016
‘;
echo ‘17.07.2017 returns: 19.09.2016
‘;
echo ‘For the documentation of the parameter “say” please have a look at PHP: strtotime – Manual.

‘;

echo ‘

3.2 Displaying of certain date parts:
‘;
echo ‘It is possible to impersonate only a part of the date, for example the day or month only. This is specified with the show-parameter.
‘;
echo ‘Suppose today is the 01.10.2016

‘;
echo ‘

08 returns: 11
‘;
echo ‘07 returns: 09

‘;

echo ‘

3.3 Returning a date in your own format:
‘;
echo ‘It is also possible to impersonate a date, in your desired format. This is specified with the format-parameter.
‘;
echo ‘Suppose today is the 01.10.2016

‘;
echo ‘08/21/2017 returns: 10/03/2016
‘;
echo ‘21. August 2017 returns: 3. October 2016

‘;
echo ‘

Note: The parameter “format” has no effect if parameter “show” is set (except “all”).
‘;
echo ‘For the documentation of the parameter “format” please have a look at PHP: date – Manual.

‘;

echo ‘

This plugin enables the shortcode-support within Contact Form 7-forms so that the Date Calculator-shortcodes can also be used there.

‘;

echo ‘

Have a lot of fun with my first WordPress-Plugin.

‘;
echo ‘

You like this Plugin? Help to keep it alive and donate a cup of coffee 🙂

‘;
echo ‘

‘;
echo ‘‘;
echo ‘‘;
echo ‘‘;
echo ‘‘;
echo ‘

‘;
echo ‘

‘;
}

// Integrate Shortcodes to Contact Form 7
add_filter( ‘wpcf7_form_elements’, ‘do_shortcode’ );

// Date now – Callexample:
function date_now_func( $atts ) {
extract( shortcode_atts( array(
‘show’ => ‘all’,
‘format’ => ‘d.m.Y’,
), $atts ) );

$show = “{$show}”;
$format = “{$format}”;

if ($show == “all”) {
$date_now = date($format, mktime(0, 0, 0, date(“m”), date(“d”), date(“Y”)));
return $date_now;
}

if ($show == “monthonly”) {
$date_now = date(“m”, mktime(0, 0, 0, date(“m”), date(“d”), date(“Y”)));
return $date_now;
}

if ($show == “dayonly”) {
$date_now = date(“d”, mktime(0, 0, 0, date(“m”), date(“d”), date(“Y”)));
return $date_now;
}

if ($show == “yearonly”) {
$date_now = date(“Y”, mktime(0, 0, 0, date(“m”), date(“d”), date(“Y”)));
return $date_now;
}

}

add_shortcode( ‘date_now’, ‘date_now_func’);

// Date add – Callexample:
function date_add_func( $atts ) {
extract( shortcode_atts( array(
‘month’ => ‘0’,
‘day’ => ‘0’,
‘year’ => ‘0’,
‘show’ => ‘all’,
‘format’ => ‘d.m.Y’,
), $atts ) );

$month = “{$month}”;
$day = “{$day}”;
$year = “{$year}”;
$show = “{$show}”;
$format = “{$format}”;

if ($show == “all”) {
$datecalc = date(“d.m.Y”,mktime(0, 0, 0, date(“m”)+$month, date(“d”)+$day, date(“Y”)+$year));
return $datecalc;
}

if ($show == “monthonly”) {
$datecalc = date(“m”,mktime(0, 0, 0, date(“m”)+$month, date(“d”)+$day, date(“Y”)+$year));
return $datecalc;
}

if ($show == “dayonly”) {
$datecalc = date(“d”,mktime(0, 0, 0, date(“m”)+$month, date(“d”)+$day, date(“Y”)+$year));
return $datecalc;
}

if ($show == “yearonly”) {
$datecalc = date(“Y”,mktime(0, 0, 0, date(“m”)+$month, date(“d”)+$day, date(“Y”)+$year));
return $datecalc;
}
}

add_shortcode( ‘date_add’, ‘date_add_func’ );

// Date sub – Callexample:
function date_sub_func( $atts ) {
extract( shortcode_atts( array(
‘month’ => ‘0’,
‘day’ => ‘0’,
‘year’ => ‘0’,
‘show’ => ‘all’,
‘format’ => ‘d.m.Y’,
), $atts ) );

$month = “{$month}”;
$day = “{$day}”;
$year = “{$year}”;
$show = “{$show}”;
$format = “{$format}”;

if ($show == “all”) {
$datecalc = date(“d.m.Y”,mktime(0, 0, 0, date(“m”)-$month, date(“d”)-$day, date(“Y”)-$year));
return $datecalc;
}

if ($show == “monthonly”) {
$datecalc = date(“m”,mktime(0, 0, 0, date(“m”)-$month, date(“d”)-$day, date(“Y”)-$year));
return $datecalc;
}

if ($show == “dayonly”) {
$datecalc = date(“d”,mktime(0, 0, 0, date(“m”)-$month, date(“d”)-$day, date(“Y”)-$year));
return $datecalc;
}

if ($show == “yearonly”) {
$datecalc = date(“Y”,mktime(0, 0, 0, date(“m”)-$month, date(“d”)-$day, date(“Y”)-$year));
return $datecalc;
}
}

add_shortcode( ‘date_sub’, ‘date_sub_func’ );

// Say the Date – Callexample:
function date_say_func( $atts ) {
extract( shortcode_atts( array(
‘what’ => ‘today’,
‘show’ => ‘all’,
‘format’ => ‘d.m.Y’,
), $atts ) );

$what = “{$what}”;
$show = “{$show}”;
$format = “{$format}”;

if ($show == “all”) {
$search_date = strtotime($what);
$datecalc = date($format, $search_date);
return $datecalc;
}

if ($show == “monthonly”) {
$search_date = strtotime($what);
$datecalc = date(“m”, $search_date);
return $datecalc;
}

if ($show == “dayonly”) {
$search_date = strtotime($what);
$datecalc = date(“d”, $search_date);
return $datecalc;
}

if ($show == “yearonly”) {
$search_date = strtotime($what);
$datecalc = date(“Y”, $search_date);
return $datecalc;
}
}

add_shortcode( ‘date_say’, ‘date_say_func’ );

?>

Leave a Comment