Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

July 04, 2022, 05:38:16 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 193413
  • Total Topics: 21081
  • Online today: 50
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 51
Total: 51

Author Topic: Holiday Blocks  (Read 12521 times)

0 Members and 1 Guest are viewing this topic.

Offline Skhilled

  • Beta Tester
  • *
  • Posts: 1179
  • Once you stop learning, you stop living!
    • Doc Skillz
Re: Holiday Blocks
« Reply #10 on: November 29, 2015, 02:16:16 PM »
I got tired of waking up and realizing that I had forgotten or need to add something for a holiday on my site which is how I came up with the idea...a "set it and forget" type of thing. I've created blocks for every holiday with an image and now I don't have to deal with it except for the ones that don't have a specific date like Thanksgiving which is the last Thursday of that month.

Reading can seriously damage your ignorance!

Offline Sayaka Maizono

  • Beta Tester
  • *
  • Posts: 31
  • $("div.content:dd").hide();
Re: Holiday Blocks
« Reply #11 on: November 29, 2015, 03:36:32 PM »
I can make you a block that will display things based on various dates if you want.

Offline william777

  • Full Member
  • ***
  • Posts: 122
Re: Holiday Blocks
« Reply #12 on: November 30, 2015, 01:09:24 PM »
 O0

Offline Sayaka Maizono

  • Beta Tester
  • *
  • Posts: 31
  • $("div.content:dd").hide();
Re: Holiday Blocks
« Reply #13 on: November 30, 2015, 06:45:52 PM »
Code: [Select]
<?php

/**
 * @block Custom Dates
 * @author Rhode Fey (Sayaka Maizono)
 * @version 1.0.0
 * @for TinyPortal
*/

global $user_info;

$time time() + ($user_info['time_offset'] * 3600);
$current_date date('m'$time) . '-' date('d'$time);

if (
$current_date == '12-25')
{
echo '
Merry Christmas!'
;
}
elseif (
$current_date == '1-1' || $current_date '12-31')
{
echo '
Happy New Year!'
;
}
elseif (
$current_date == '7-4')
{
echo '
Happy Independence Day!'
;
}
// Default if current date is not specified.
else
{
echo '
Hello!'
;
}

?>

Offline Skhilled

  • Beta Tester
  • *
  • Posts: 1179
  • Once you stop learning, you stop living!
    • Doc Skillz
Re: Holiday Blocks
« Reply #14 on: December 01, 2015, 07:59:01 AM »
Very simple but works! :)

Reading can seriously damage your ignorance!