Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Thread Tools Display Modes
Old 12-27-2020, 12:21 PM
Micolai's Avatar
Micolai Micolai is offline
Loving Mysidia
Join Date: May 2020
Location: Tennessee
Posts: 95
Gender: Female
Credits: 7,090
Micolai is on a distinguished road
Arrow Time season and calendar changes

So I wanted to have a little season icon and text that would change based on the calendar, so I managed to get this working.

$today = new DateTime();
if(new DateTime() < new DateTime($today->format('Y').'-3-20 00:00:00')) $season = "Winter <img src=''>";
else if (new DateTime() < new DateTime($today->format('Y').'-6-21 00:00:00')) $season = "Spring ";
else if (new DateTime() < new DateTime($today->format('Y').'-9-22 00:00:00')) $season = "Summer <img src=''>";
else if (new DateTime() < new DateTime($today->format('Y').'-12-20 00:00:00')) $season = "Fall <img src=''>";
else $season = "Winter <img src=''>";
$this->moneyBar->add(new Comment("<b id='season'>{$season}</b><br>"));
You can see where I have the little image icons beside my season's text.
I pasted this into the moneybar area of class_sidebar.php
but you don't have to paste it here. You could probably just paste it into the PHP area of a module for the sidebar.

I also wanted to create a code for changing my explore page image map based on day and night. So for this I made a page for my image map area called Map.

So first you need to create the regular php page in your root folder. public_html. You can call it whatever, but I called mine map.php and inside paste this:

class MapController extends AppController{

public function __construct(){



and save. Then in your view folder create a new file called (whatever you pick)view.php. Mine was mapview.php.
Paste this into the view file:

class MapView extends View{

public function index(){

$mysidia = Registry::get("mysidia");

$document = $this->document;

$document->setTitle("<br>The Wild<br><br>");

$h = date('G'); //set variable $h to the hour of the day
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
if ($h < 12) $img = "<img src='' width='750' usemap='#image-map'>";
else $img = "<img src='' width='750' usemap='#image-map'>";
$document->add(new Comment("{$img}<br>"));

Hope this helps anyone! I'll be working at figuring out how to get the time and calendar to work together but right now you'll have to switch the day and night image out for each new season. Once I get it figured out I'll add it.
"You try you fail, you try you fail, but the only true failure is if you stop trying. So try again." - Haunted Mansion
Reply With Quote

calendar, hour, season, time

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 01:07 AM.

Currently Active Users: 301 (2 members and 299 guests)
Threads: 4,048, Posts: 31,827, Members: 15,720
Welcome to our newest members, Moth-chan.

What's New?

What's Hot?

What's Popular?

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636