collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 248
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: New Calendar Block  (Read 15082 times)

0 Members and 2 Guests are viewing this topic.

Offline mrtrc266

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Male
    • Monsters Mansion
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
New Calendar Block
« on: April 02, 2009, 01:47:34 PM »
In my previous SP was using this custom Calendar Block which you could totally customize by adding color codes and setting how many days out to fetch upcoming events. Can the new built in Calendar be customized like this as well?

Code: [Select]
<?php
/*
Calender DIN1031 Version 11-11-2008-1
This is a costumizable calendar php block
It will show a calendar, and add the Today Events, Holidays and Birthdays.
Normal it's programmed and tested for SMF 1.1.X
I don't use any SSI.php, because all data that needed is loaded.
*/
global $scripturl$modSettings$sourcedir$txt;

//With that you can start the calander on a other day
//-1 = Start on Saturaday, 0 = Start on Sunday, 1 = Start on Monday, 2 = Start on Thusday...
$first_day 1;

//How many day in future should be shown in the events on today? (If you disable today nothing will work ;D)
$eventes_future 7;

//Show Weeksnumber? 1 = on 0 = off
$show_weeknumber 0;

//How long should the day, if the number higher 3 than the complete dayname will be shown
$day_name_length 0//0 is short day name 1 is full day name :)

//The background color of days with Events, birthdays or holidays, you can use css colors
$color_background_items_mixed 'red';
$color_background_items_event 'white';
$color_background_items_birthday 'yellow';
$color_background_items_holiday 'blue';

//The textcolor of days with Events, birthdays or holidays, you can use css colors
$color_text_items_mixed 'yellow';
$color_text_items_event 'blue';
$color_text_items_birthday 'red';
$color_text_items_holiday 'grey';

//The Color of the todays background / text
$color_background_today 'grey';
$color_text_today 'blue';

//The Textcolor for the standard days
$color_text 'steelblue';

//The Textcolor for the Sundays
$color_text_sunday '#C00000';

//The Textcolor for the Week Number
$color_text_week '#990000';

//If you have a diffrent calender you can change the link to it here
$month_href $scripturl '?action=calendar';

//What should the callendar show?
$show_events 1//0 No, 1 Yes
$show_birthdays 1//0 No, 1 Yes
$show_holidays 1//0 No, 1 Yes
//Show the single events and items of the day :)
$show_today 1//0 No, 1 Yes

//Dateformat of day you can use %y for year %d for day and %m for month (Only digital numbers!)
$currentDateFormat '%m/%d';

//This Variable is only for mulitple blocks of this type, please change it only if you know what you do ;)
//If show today disabled than this will not work and is disabled!
$enableJavaScript 1;
$javascript_idFix 'calendarDIN1031_';

//Okay please don't do anything here if you not now what you do
/**************************************************************/
// You can't do anything if the calendar is off!
if (empty($modSettings['cal_enabled']))
fatal_lang_error('calendar_off'false);

//First try to make it compatible between versions SMF 1.1 and 2.0 ;) (Not Working, text problems ;P)
if(file_exists($sourcedir '/Subs-Calendar.php')) {
require_once($sourcedir '/Subs-Calendar.php');
$smcFunc['getEvents'] = 'getEventRange';
$smcFunc['getBirthdays'] = 'getBirthdayRange';
$smcFunc['getHolidays'] = 'getHolidayRange';
}
else {
require_once($sourcedir '/Calendar.php');
$smcFunc['getEvents'] = 'calendarEventArray';
$smcFunc['getBirthdays'] = 'calendarBirthdayArray';
$smcFunc['getHolidays'] = 'calendarHolidayArray';
}

//Fix possible mistakes by user
$eventes_future = (int) $eventes_future;
$eventes_future = !empty($eventes_future) ? abs($eventes_future) : 0;

//Easier and faster to handel =).
$show_weeknumber = !empty($show_weeknumber);

//Enable the Javascript?
$enableJavaScript = !empty($enableJavaScript) && !empty($show_today);

//Built some standard dates
$now time() + $modSettings['time_offset'] * 3600;
$today date('j',$now);
$year date("Y",$now);
$month date("n",$now);
$days = array();
$pn = array();

$first_of_month gmmktime(0,0,0,$month,1,$year);

//retrieve this month events, holydays and birthdays
$days_in_month gmdate('t',$first_of_month);
//Built Month low and high date :)
$low_date $year.'-'.sprintf('%02d'$month).'-01'
$high_date $year.'-'.sprintf('%02d'$month).'-'.$days_in_month;

//Premission Checkup
$can_post_calendar allowedTo('calendar_post');
$calendarDataToday = array('events' => array(), 'birthdays' => array(), 'holidays' => array());
$collectionDays = array(); //This is for the java script build :)
$calendarEventsFuture = array();

$todayDate date("Y-m-d"time());

//add important days to the days array
if(!empty($show_events)) {
$insert_date true;
//Special Case the high date of events can be more in the future than normal
$event_future_time $now $eventes_future 86400;
if($eventes_future != 0) {
$month_event date("n",$event_future_time);
//Next Month?
if($month_event != $month) {
$day_event date("j",$event_future_time);
$year_event date("Y",$event_future_time); //This is need, could be possible that this jan next year.
$event_future_date $year_event.'-'.$month_event.'-'.$day_event;
}
else
$event_future_date $high_date;
}
else
$event_future_date $high_date;
$events $smcFunc['getEvents']($low_date$event_future_date);
foreach($events as $startdate => $event) {
list($cyear$cmonth$cday) = explode('-'$startdate);
$current_timestamp mktime(0,0,0$cmonth$cday$cyear);
//This insert the today events and future events if they exist
if($startdate == $todayDate || ($current_timestamp >= $now && $current_timestamp <= $event_future_time)) {
if($startdate == $todayDate)
$calendarDataToday['events'] = $event;
else
$calendarEventsFuture[$startdate] = $event;
}
//We must select between create or only show!
$href_calendar $enableJavaScript '#day'.$cday.'" onclick="return '.$javascript_idFix.'selectCalendarDate(\'day'.$cday.'\');' $month_href;
//Insert only the current informtions
if($cmonth == $month//Next month is not avaible ;)
$days[$cday] = '<a class="smalltext" style="color: '.$color_text_items_event.'; font-weight: bold; background-color: '.$color_background_items_event.'; padding: 0px 4px 0px 4px;" href="'.$href_calendar.'" target="_self">'.$cday.'</a>';
if($cmonth == $month && $startdate != $todayDate)
$collectionDays[$startdate] = $cday;
}
//Correct the order :)
if(!empty($calendarEventsFuture))
ksort($calendarEventsFutureSORT_NUMERIC);
}
//Add holidays into the day array?
if(!empty($show_birthdays)) {
$birthdays $smcFunc['getBirthdays']($low_date$high_date);
foreach($birthdays as $startdate => $birth) {
//This insert the today events if they exist
if($todayDate == $startdate)
$calendarDataToday['birthdays'] = $birth;
$cday = (int) substr($startdate,8,2);
//We must select between create or only show!
$href_calendar $enableJavaScript '#day'.$cday.'" onclick="return '.$javascript_idFix.'selectCalendarDate(\'day'.$cday.'\');' $month_href;
//Mixed color?
$text_color = !empty($days[$cday]) ? $color_text_items_mixed $color_text_items_birthday;
$background_color = !empty($days[$cday]) ? $color_background_items_mixed $color_background_items_birthday;
$days[$cday] = '<a class="smalltext" style="color: '.$text_color.'; font-weight: bold; background-color: '.$background_color.'; padding: 0px 4px 0px 4px;" href="'.$href_calendar.'" target="_self">'.$cday.'</a>';
if($startdate != $todayDate)
$collectionDays[$startdate] = $cday;
}
}
//Add holidays into the day array?
if(!empty($show_holidays)) {
$holidays $smcFunc['getHolidays']($low_date$high_date);
foreach($holidays as $startdate => $holiday) {
//This insert the today events if they exist
if($todayDate == $startdate)
$calendarDataToday['holidays'] = $holiday;
$cday = (int) substr($startdate,8,2);
//We must select between create or only show!
$text_color = !empty($days[$cday]) ? $color_text_items_mixed $color_text_items_holiday;
$background_color = !empty($days[$cday]) ? $color_background_items_mixed $color_background_items_holiday;
$href_calendar $enableJavaScript '#day'.$cday.'" onclick="return '.$javascript_idFix.'selectCalendarDate(\'day'.$cday.'\');' $month_href;
$days[$cday] = '<a class="smalltext" style="color: '.$text_color.'; font-weight: bold; background-color: '.$background_color.'; padding: 0px 4px 0px 4px;" href="'.$href_calendar.'" target="_self">'.$cday.'</a>';
if($startdate != $todayDate)
$collectionDays[$startdate] = $cday;
}
}

//So Todays it's an diffrent color :D
$href_calendar $enableJavaScript '#today" onclick="return '.$javascript_idFix.'selectCalendarDate(\'today\');' $month_href;
$days[$today] = '<a class="smalltext" style="color: '.$color_text_today.'; font-weight: bold; border: solid 1px black; background-color: '.$color_background_today.'; padding: 0px 4px 0px 4px;" href="'.$href_calendar.'" target="_self">'.$today.'</a>';

//Wellcome to the smf way of Day building with existing Language strings :D
$day_names $txt['days'];
$day_names_short $txt['days_short'];
//So lets see $firstday = 0 means sunday this is the first day :)
//if there is a higher number than i need to resort them
//negativ values can also be used :)
if(!empty($first_day)) {
if($first_day 0)
$first_day 7-(abs($first_day)%7); 
else
$first_day = ($first_day%7); 
}
if(!empty(
$first_day)) {
$old $day_names;
$old_s $day_names_short;
$day_names = array();
$day_names_short = array();
//Create the new day order :)
for($n=0$n<7$n++) {
$c = (($first_day+$n)%7);
$day_names[$n] = $old[$c];
$day_names_short[$n] = $old_s[$c];
}
}

list(
$month$year$weekday) = explode(',',gmstrftime('%m,%Y,%w',$first_of_month));
$weekday = ($weekday $first_day) % 7//adjust for $first_day
$title $txt['months_titles'][(int)$month].' '.$year;  //This is the SMF Text string, so it should be corrected for ut8 or iso

//Insert the Java Sciptfunction
if($enableJavaScript) {
echo 
'
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var '
.$javascript_idFix.'current_block = "'.$javascript_idFix.'today";

function '
.$javascript_idFix.'selectCalendarDate (day) {
var blockid = "'
.$javascript_idFix.'" + day;
if(blockid == '
.$javascript_idFix.'current_block) {
return false;
}
document.getElementById('
.$javascript_idFix.'current_block).style.display = "none";
'
.$javascript_idFix.'current_block = blockid + "";
document.getElementById(blockid).style.display = "block";
return false;
}
// ]]></script>'
;
}
/* Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03 */
$calendar '
<table align="center" style="display:block; width:100%;" width="100%">
<caption>'
.($month_href '<a href="'.htmlspecialchars($month_href).'">'.$title.'</a>' $title)."</caption>
<tr>"
;

//Show the weekday?
if($show_weeknumber)
$calendar .= '
<th class="smalltext" abbr="'
.$txt['calendar51'].'">'.$txt['calendar51'].'</th>';

//Put out the Daynames :)
foreach($day_names as $k => $d)
$calendar .= '
<th class="smalltext" abbr="'
.$d.'">'.(!empty($day_name_length) ? $d $day_names_short[$k]).'</th>';
$calendar .= "
</tr>
<tr style=\"text-align:right;\">"
;

if(
$show_weeknumber)
$calendar .= '
<td class="smalltext" abbr="'
.$txt['calendar51'].'" align="center"><span style="color:'.$color_text_week.'">'.gmdate('W'$first_of_month).'</span></td>';
if(
$weekday 0$calendar .= '
<td class="smalltext" colspan="'
.$weekday.'"> </td>'//initial 'empty' days
for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month$day++,$weekday++){
if($weekday == 7){
$weekday   0//start a new week
$calendar .= "
</tr>
<tr style=\"text-align:right;\">"
;
if($show_weeknumber)
$calendar .= '
<td class="smalltext" abbr="'
.$txt['calendar51'].'" align="center"><span style="color:'.$color_text_week.'">'.gmdate('W'gmmktime(0,0,0$month ,$day$year)).'</span></td>';
}
if(isset($days[$day])){
$calendar .= '
<td>'
.$days[$day].'</td>';
}
else 
{
$href_calendar $enableJavaScript '#none" onclick="return '.$javascript_idFix.'selectCalendarDate(\'none\');' $month_href;
$calendar .= "
<td class=\"smalltext\" style=\"padding-right:4px;\"><a"
;
if(((($weekday+$first_day) % 7)==0))
{
$calendar .= ' style="color:'.$color_text_sunday.';"';
}
$calendar .= " href=\"".$href_calendar."\" target=\"_self\">$day</a></td>";
}
}
if(
$weekday != 7$calendar .= '
<td class="smalltext" colspan="'
.(7-$weekday).'"> </td>'//remaining "empty" days

$calendar .= '
</tr>
</table>'
;
echo 
$calendar;

if(!empty(
$show_today)) {
echo 
'
<div style="display:block; width:100%;" align="center">'
;
if (!empty($calendarDataToday['events']) || !empty($calendarDataToday['birthdays']) || !empty($calendarDataToday['holidays']) || !empty($calendarEventsFuture)) {
//Standard Output :)
echo '
<table id="'
.$javascript_idFix.'today" align="center" style="display:block; width:100%;">';
if(!empty($calendarDataToday['holidays'])){
echo '
<tr>
<td width="15%">
<hr />
</td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_holiday ';">
<b>Holidays</b>
</td>
<td width="15%">
<hr />
</td>
</tr>
<tr>
<td colspan="3" class="smalltext" style="width:100%;">'
;
echo implode('<br />'$calendarDataToday['holidays']);
echo '
</td>
</tr>'
;
}

if(!empty($calendarDataToday['birthdays'])){
echo '
<tr>
<td width="15%">
<hr />
</td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_birthday ';">
<b>Birthdays</b>
</td>
<td width="15%">
<hr />
</td>
</tr>
<tr>
<td colspan="3" class="smalltext" style="width:100%;">'
;
foreach( $calendarDataToday['birthdays'] as $member )
echo '
<a href="'
$scripturl'?action=profile;u='$member['id'], '">'$member['name'], isset($member['age']) ? ' (' $member['age'] . ')' '''</a>''<br />';
echo '
</td>
</tr>'
;
}

if(!empty($calendarDataToday['events']))
{
$dayOutput str_replace(array('%y','%m','%d'), explode('-'$todayDate), $currentDateFormat);
echo '
<tr>
<td width="15%">
<hr />
</td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_event ';">
<b>Events ('
.$dayOutput.')</b>
</td>
<td width="15%">
<hr />
</td>
</tr>
<tr>
<td colspan="3" class="smalltext" align="left" style="width:100%;">'
;
foreach ($calendarDataToday['events'] as $event)
{
if ($event['can_edit'])
echo '
<a href="' 
$event['modify_href'] . '" style="color: #FF0000;">*</a> ';
echo '
$event['link'] . '<br />';
}
echo '
</td>
</tr>'
;
}
if(!empty($calendarEventsFuture))
{
echo '
<tr>
<td width="15%">
<hr />
</td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_event ';" style="width:100%;">
<b>Upcoming Events</b>
</td>
<td width="15%">
<hr />
</td>
</tr>
<tr>
<td colspan="3" class="smalltext" align="left">'
;
foreach ($calendarEventsFuture as $startdate => $future_events)
{
//Okay tell the user the date of this even...
$dayOutput str_replace(array('%y','%m','%d'), explode('-'$startdate), $currentDateFormat);
foreach($future_events as $event) {
if ($event['can_edit'])
echo '
<a href="' 
$event['modify_href'] . '" style="color: #FF0000;">*</a> ';
echo '
$dayOutput ' ' $event['link'] . '<br />';
}
}
echo '
</td>
</tr>'
;
}
echo '
</table>'
;
}
else
echo '
<table id="'
.$javascript_idFix.'today" align="center" width="100%" style="display:block; width:100%;">
<tr>
<td>
No Entries Found.
</td>
</tr>
</table>'
;

//Okay Start he Java Script insert :)
if($enableJavaScript) {
//First the Table for none ;)
echo '
<table id="'
.$javascript_idFix.'none" align="center" width="100%" style="display:none; width:100%;">
<tr>
<td class="smalltext">
No Entries Found.
</td>
</tr>
</table>'
;
foreach($collectionDays as $startdate => $day) {
echo '
<table id="'
.$javascript_idFix.'day'.$day.'" align="center" width="100%" style="display:none; width:100%;">';
if(!empty($holidays[$startdate])){
echo '
<tr>
<td width="15%">
<hr />
</td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_holiday ';">
<b>Holidays</b>
</td>
<td width="15%">
<hr />
</td>
</tr>
<tr>
<td colspan="3" class="smalltext" style="width:100%;">'
;
echo implode('<br />'$holidays[$startdate]);
echo '
</td>
</tr>'
;
}
if(!empty($birthdays[$startdate])){
echo '
<tr>
<td width="15%">
<hr />
</td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_birthday ';">
<b>Birthdays</b>
</td>
<td width="15%">
<hr />
</td>
</tr>
<tr>
<td colspan="3" class="smalltext" style="width:100%;">'
;
foreach( $birthdays[$startdate] as $member )
echo '
<a href="'
$scripturl'?action=profile;u='$member['id'], '">'$member['name'], isset($member['age']) ? ' (' $member['age'] . ')' '''</a>''<br />';
echo '
</td>
</tr>'
;
}
if(!empty($events[$startdate]))
{
$dayOutput str_replace(array('%y','%m','%d'), explode('-'$startdate), $currentDateFormat);
echo '
<tr>
<td width="15%">
<hr />
</td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_event ';">
<b>Events ('
.$dayOutput.')</b>
</td>
<td width="15%">
<hr />
</td>
</tr>
<tr>
<td colspan="3" class="smalltext" align="left" style="width:100%;">'
;
foreach ($events[$startdate] as $event)
{
if ($event['can_edit'])
echo '
<a href="' 
$event['modify_href'] . '" style="color: #FF0000;">*</a> ';
echo '
$event['link'] . '<br />';
}
echo '
</td>
</tr>'
;
}
echo '
</table>'
;
}
}
echo 
'
</div>'
;
}

?>

Offline mrtrc266

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Male
    • Monsters Mansion
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: New Calendar Block
« Reply #1 on: April 02, 2009, 02:45:51 PM »
I just noticed the Calendar Info Block that you can add below the Calendar and that's kinda what I'm after, but it would be great if it was all in the same block like in the code above.

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: New Calendar Block
« Reply #2 on: April 03, 2009, 03:51:26 AM »
It should be same. I mean if you have events or holidays or birthdays in that day or the day you click on, it should appear below the calendar. You cannot customize its style though, but I think you won't need it.
And slowly, you come to realize... It's all as it should be...

Offline mrtrc266

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Male
    • Monsters Mansion
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: New Calendar Block
« Reply #3 on: April 03, 2009, 10:36:13 AM »
In the new Calander it only shows the events below the calendar that are happening today. (yes they do pop up if you click on a day)

To get more future events to be shown in text below the calendar you need to add the Calendar Info block as well VS. this custom coded Calendar had everything in one block.

I need to have "Show Events" selected in both blocks so that Calendar can remain clickable and the result is that "Todays Events" are shown twice right on top of eachother

Just seems like it's kinda redudant to have 2 Calendar Blocks when there could be one block with all the setting via admin to select all the info you want to show. (No offense to anyone) This is all just IMO.

See the 1 vs 2 block pics.

You guys and gals kicked @&% on  making SP Rock! Thanks for all your hard work.

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: New Calendar Block
« Reply #4 on: April 03, 2009, 10:52:52 AM »
Well, the problem is that, the area below the calendar is supposed to show what's happening today. I can't see why it should be showing things that are in the future. They appear when you click on the day they are set on.
And slowly, you come to realize... It's all as it should be...

Offline mrtrc266

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Male
    • Monsters Mansion
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: New Calendar Block
« Reply #5 on: April 03, 2009, 12:29:20 PM »
Quote
I can't see why it should be showing things that are in the future. They appear when you click on the day they are set on.

I hear ya but then what is the purpose of the Calendar Info block? It's to show in text upcoming events vs. clicking on every single day of the month to see what's coming up. But then when you do have both the Calendar and Calendar info block enabled it shows "Todays Events" twice right on top of each other like in the pic I posted above.

It's no big deal, this custom code still works in SP2.2. Once again thanks for all your help and responses.

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: New Calendar Block
« Reply #6 on: April 09, 2009, 03:38:30 AM »
They are not supposed to be used together. People who want a full month calendar can use Calendar block and who just wants a list of what's happening in calendar would use Calendar Info block.
And slowly, you come to realize... It's all as it should be...

Offline tfs

  • Jr. Member
  • **
  • Posts: 64
Re: New Calendar Block
« Reply #7 on: April 15, 2009, 01:29:25 PM »
They are not supposed to be used together. People who want a full month calendar can use Calendar block and who just wants a list of what's happening in calendar would use Calendar Info block.

And if someone wants them both they're out of luck!    :(

Offline mrtrc266

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Male
    • Monsters Mansion
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: New Calendar Block
« Reply #8 on: April 16, 2009, 01:12:45 PM »
They are not supposed to be used together. People who want a full month calendar can use Calendar block and who just wants a list of what's happening in calendar would use Calendar Info block.

And if someone wants them both they're out of luck!    :(

No not out of luck, you just have to use 2 blocks instead of one but it shows the same event twice right next to eachother.

In the first post of this thread though you can use the code in a Custom PHP Block and it's fully customizable and shows everything in one block
« Last Edit: April 16, 2009, 01:15:22 PM by mrtrc266 »

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: New Calendar Block
« Reply #9 on: April 16, 2009, 01:20:44 PM »
The problem is that; I see no reason to display events/birthdays/holidays that does not belong to do selected day.
And slowly, you come to realize... It's all as it should be...

Offline mrtrc266

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Male
    • Monsters Mansion
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: New Calendar Block
« Reply #10 on: April 16, 2009, 01:47:06 PM »
The problem is that; I see no reason to display events/birthdays/holidays that does not belong to do selected day.

I guess it would depend on what you use the calendar for. I find it to be a nice feature because my members and I host a lot of private poker tournaments. And it's nice just to have all the info in one block vs. 2 blocks

Also if you have both blocks enabled it shows the same event twice right on top of each other.

You guys did a great job, I'm not knocking it in anyway, I just find it more convienient to use the custom code block.

It would be nice maybe to just create one calendar block and allow admins to choose just calendar or calendar and calendar info instead of having 2 seperate blocks.

Offline tfs

  • Jr. Member
  • **
  • Posts: 64
Re: New Calendar Block
« Reply #11 on: April 16, 2009, 02:41:38 PM »
The problem is that; I see no reason to display events/birthdays/holidays that does not belong to do selected day.

My forum is probably different from most, and in my circumstances there's reasons that wouldn't exist at other forums.  Mine is a private family site where everyone is blood or marriage related.  Up and coming birthdays are important to them.  A block that displayed the birthdays in the next 30 days would be great.  My members like to post childhood photographs of each other on a person's birthday, and knowing who is up and coming is important to them.  I'd love to see something like...


GUI Calendar Here
----------------
--Events [30] (60) (90)
04/19 Jane concert
04/22 Harry's camping trip
05/02 Half Dome Hike!!!!


--Birthdays [30] (60) (90)
04/16 John (22) TODAY!
05/12 Jane (44)

--Holidays [30] (60) (90)
04/22 Earth Day

--Past Items [30] (60) (90)
04/15 Event - Potluck at Alan's
04/02 Event - Paul's party
03/30 Birthday - Paul (28)



The [30] (60) (90) portion allows them to click on it to expand the date range for the items in question, with the current selection defined in some manner.

Maybe one day I'll take up PHP and look into this stuff myself, but until then I'm just a begger, not a chooser.  :)

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: New Calendar Block
« Reply #12 on: April 16, 2009, 02:41:49 PM »
Some people prefer full month calendar, and some others just a list of what's happening in calendar. It is more practical to have them separately.

Yours might be a different case. Logically, it should only be showing things that are on the selected day. You can just click on the days in the future to see what they have.

If you are happy with your custom calendar block, no problems here. It is just that we have to code built-in blocks for general purpose. If we try to implement every exceptional feature, then it would become a bloated mod.
And slowly, you come to realize... It's all as it should be...

Offline tfs

  • Jr. Member
  • **
  • Posts: 64
Re: New Calendar Block
« Reply #13 on: April 17, 2009, 09:16:25 PM »
No not out of luck, you just have to use 2 blocks instead of one but it shows the same event twice right next to eachother.

Which makes them mutually exclusive.  If you use one then the other one is a mismatch.  Use them together and it makes your board look cheesy.

I propose the following...

GUI Calendar Here
----------------
--Events [30] (60) (90)--
04/19 Jane concert
04/22 Harry's camping trip
05/02 Half Dome Hike!!!!


--Birthdays [30] (60) (90)--
04/16 John (22) TODAY!
05/12 Jane (44)

--Holidays [30] (60) (90)--
04/22 Earth Day

--Past Items [30] (60) (90)--
04/15 Event - Potluck at Alan's
04/02 Event - Paul's party
03/30 Birthday - Paul (28)




Unfortunately I'm not a PHP programmer or I'd make it.  :(

Offline mrtrc266

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Male
    • Monsters Mansion
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: New Calendar Block
« Reply #14 on: April 18, 2009, 12:32:54 AM »
No not out of luck, you just have to use 2 blocks instead of one but it shows the same event twice right next to eachother.

Which makes them mutually exclusive.  If you use one then the other one is a mismatch.  Use them together and it makes your board look cheesy.

I propose the following...

GUI Calendar Here
----------------
--Events [30] (60) (90)--
04/19 Jane concert
04/22 Harry's camping trip
05/02 Half Dome Hike!!!!


--Birthdays [30] (60) (90)--
04/16 John (22) TODAY!
05/12 Jane (44)

--Holidays [30] (60) (90)--
04/22 Earth Day

--Past Items [30] (60) (90)--
04/15 Event - Potluck at Alan's
04/02 Event - Paul's party
03/30 Birthday - Paul (28)




Unfortunately I'm not a PHP programmer or I'd make it.  :(

At this point you have 2 options, use the built in calendar that came with SP 2.2 or use the custom code block in the first post.

For the custom code, just create a PHP Block and insert the code and change your settings to your liking.

Offline noelleon69

  • Semi Newbie
  • *
  • Posts: 20
  • Gender: Male
  • SMF Version: 1.1.9
  • SP Version: 2.2.2
Re: New Calendar Block
« Reply #15 on: May 29, 2009, 03:33:16 AM »
See the 1 vs 2 block pics.

You guys and gals kicked @&% on  making SP Rock! Thanks for all your hard work.
Can you post the custom code to get the block seen in the picture "calendar_singleblock.PNG"?

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: New Calendar Block
« Reply #16 on: May 29, 2009, 05:40:33 AM »
@noelleon69,
For the custom code, just create a PHP Block and insert the code and change your settings to your liking.

Use the code from the first post. ;)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline noelleon69

  • Semi Newbie
  • *
  • Posts: 20
  • Gender: Male
  • SMF Version: 1.1.9
  • SP Version: 2.2.2
Re: New Calendar Block
« Reply #17 on: May 29, 2009, 05:55:48 AM »
I did... it turned out different. :) It didn't look like the one in the picture.

Some of the differences are...
1) No icons next to the event
2) No upcoming events summary
3) The current day doesn't have [] brackets
4) There is no horizontal line separating the calendar and the events below
« Last Edit: May 29, 2009, 09:43:39 AM by noelleon69 »

Offline ncvettes

  • Semi Newbie
  • *
  • Posts: 6
  • Gender: Male
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: New Calendar Block
« Reply #18 on: June 22, 2009, 04:10:07 PM »
In the new Calander it only shows the events below the calendar that are happening today. (yes they do pop up if you click on a day)

To get more future events to be shown in text below the calendar you need to add the Calendar Info block as well VS. this custom coded Calendar had everything in one block.

I need to have "Show Events" selected in both blocks so that Calendar can remain clickable and the result is that "Todays Events" are shown twice right on top of eachother

Just seems like it's kinda redudant to have 2 Calendar Blocks when there could be one block with all the setting via admin to select all the info you want to show. (No offense to anyone) This is all just IMO.

See the 1 vs 2 block pics.

You guys and gals kicked @&% on  making SP Rock! Thanks for all your hard work.

I'm having to use 2 blocks as well. No big deal, but it would be nice to have it all in one. http://ncvettes.com

Where did you get the script for the pic you attached?

Is it just me or when it comes to calendars most developers think they're not that worthwhile? SMF's ability to create a new forum topic from an event entry is the only one I've seen that can do that. It's terrific if you're running a site where events are the focus.

SP is great!  :applause:

Offline Swat

  • Just Registered
  • Posts: 1
  • SMF Version: None
  • SP Version: None
Re: New Calendar Block
« Reply #19 on: March 16, 2010, 07:33:15 AM »
I can't get my Birthdays and events to show on the front page can someone help