Holiday dates on board index

Started by lemur21, January 09, 2021, 11:55:36 PM

Previous topic - Next topic

lemur21

I remember - some time ago (maybe in the 1.0 era) I had my board index *calendar* section separated into two areas: Holidays and Birthdays.

Each had its own line and each had the respective date attached.

Since upgrading to 2.0, I'm noticing that's not the case any longer. The birthdays are still separated (and preceded by dates) 1-per-line; but the holidays are merely on one line, separated by commas, no dates attached.

Is that a setting (or <gulp> do I need to head back into coding) :/

I'm on 2.0.17 -- the Blue Star theme.

Thanks :)

shadav

that would be a tweak to the template

in your theme's boardindex.template.php

find
// Show information about events, birthdays, and holidays on the calendar.

and then look for
// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
I'm not sure about the theme you are using, and it would probably be best to ask in that theme's support forum but

it should look something like this
// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['calendar_holidays']))
echo '
<span class="holiday">', $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';


I'm guessing yours is different as you can see the above has a line break in it so I'm guessing yours doesn't....as for the date  :-\ sorry it's a bit too late for me to be thinking clearly  :laugh: if no one else comes along I'll look in to it tomorrow

lemur21

I'll take a peek and see if that's what's in mine. I guess when it moved from 1.0 to 2.0 that functionality/formatting changed.

Thanks :)

shadav

more than likely it did, I didn't really use smf1.x so can't say for sure or not

also different templates/themes could/can change things a bit :)

if you still need some help, feel free to ask....sorry i kind of forgot to look into this some more

*note to self to add some "holidays" to my calendar so I can actually see how it is  :laugh: I hardly pay attention to it so don't remember what it actually looks like on a default theme*

lemur21

Yeah - I did add holidays to my list ... it's good because it provides a little at-a-glance issue for scheduling.

I'm going to look if anyone set up a mod to do it :/

shadav

after adding test holidays I noticed they are not on separate lines
I managed to get them on separate lines...next is for the date part (not sure on that one yet)

in your boardindex.template.php
find
// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['calendar_holidays']))
echo '
<span class="holiday">', $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';


replace with
// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['calendar_holidays']))
echo '
<span class="holiday">', $txt['calendar_prompt'], ' ', implode('<br /> ', $context['calendar_holidays']), '</span><br />';


shadav

well I tried...searched all through the forum but gave up

found a few things for smf 1.x but nothing for 2.x

however I did find how to do it for the events but not the holidays
https://www.simplemachines.org/community/index.php?topic=469210.0

I haven't tried it yet, if I remember tomorrow I'll try to install this and then see if I can't figure out with help from this mod on how to do it for the holidays.

hopefully someone else will chime in though  :laugh:

Advertisement: