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: 236
  • 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]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Calendar and Calendar info Block  (Read 26913 times)

0 Members and 1 Guest are viewing this topic.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Calendar and Calendar info Block
« on: August 31, 2010, 04:31:31 AM »
i am using SMF 2 RC-3, SimplePortal 2.3.2

could someone give me a hand...

i am trying to put the Calendar Info Block into the Normal Calendar Block so that feuture events show up in the normal Calendar Block

basicly i only then have one Block not Two.

i have found the part in PortalBlocks.php that does the text under the horizontal rule, and commented it out;

Code: [Select]
/* <hr class="sp_acalendar_divider" />
foreach ($calendar_data['weeks'] as $week)
{
foreach ($week['days'] as $day)
{
if (empty($day['holidays']) && empty($day['birthdays']) && empty($day['events']) && !$day['is_today'])
continue;
elseif (empty($day['holidays']) && empty($day['birthdays']) && empty($day['events']))
{
echo '
<div class="sp_center smalltext" id="sp_calendar_', $day['day'], '">', $txt['error_sp_no_items_day'], '</div>';

continue;
}

echo '
<ul class="sp_list smalltext" id="sp_calendar_', $day['day'], '" ', !$day['is_today'] ? ' style="display: none;"' : '', '>';

if (!empty($day['holidays']))
{
echo '
<li class="sp_center"><strong>- ', $txt['sp_calendar_holidays'] ,' -</strong></li>';

foreach ($day['holidays'] as $key => $holiday)
echo '
<li class="sp_list_indent">', sp_embed_image('holiday'), ' ', $holiday ,'</li>';
}

if (!empty($day['birthdays']))
{
echo '
<li class="sp_center"><strong>- ', $txt['sp_calendar_birthdays'] ,' -</strong></li>';

foreach ($day['birthdays'] as $member)
echo '
<li class="sp_list_indent">', sp_embed_image('birthday'), ' <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a></li>';
}

if (!empty($day['events']))
{
echo '
<li class="sp_center"><strong>- ', $txt['sp_calendar_events'] ,' -</strong></li>';

foreach ($day['events'] as $event)
echo '
<li class="sp_list_indent">', sp_embed_image('event'), ' ', $event['link'], '</li>';
}

echo '
</ul>';
}
}
   
echo '
<div class="sp_center smalltext" id="sp_calendar_0" style="display: none;">', $txt['error_sp_no_items_day'], '</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_day = "sp_calendar_', $curPage['day'], '";
function sp_collapseCalendar(id)
{
new_day = "sp_calendar_" + id;
if (new_day == current_day)
return false;
document.getElementById(current_day).style.display = "none";
document.getElementById(new_day).style.display = "";
current_day = new_day;
}
// ]]></script>';
   */
   

basicaly what is now needed is the code form the Calendar Info Block to be inserted;

i have tryed to insert the function sp_calendarInformation part of the code into the calender part of the block, but i am obviously missing out on something, like the end of a Tabelle or a close tag of some form like a }

so the info does not acktualy show in the calender block.
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #1 on: September 02, 2010, 01:44:20 PM »
Or -- use blocks-in-blocks to put the two blocks in one block so you don't have to mess with portalblocks.php
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #2 on: September 23, 2010, 04:25:14 AM »
sorry for the late reply, but i guess, neither of those suggestions really do what i would like to do, so i have been digging in the Archives.

found a fair few threads about the calendar.

basically i was have the same problem as  mrtrc266

and i quite agree with most of his findings in this thread

i have taken the code that is there, and started to MOD it, so it uses the SP language file and the SP images, i am using SMF 2-RC3 and SP 2.3.2   

once i have finished, I'll post it here
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #3 on: September 23, 2010, 07:49:17 AM »
i think i have finished..:!!  :ill:

there is probably to a lot of Code that could be removed !!  ;P

i am not to sure if this will work with Older version, although the code would suggest it should, anybody want to try..??

attached an image how it looks.

and the php file that made it look like this.. not forgetting to make your own Custom PHP block and copy the contents of the php file excluding the first and last lines.

hope its useful to others.
« Last Edit: October 08, 2010, 04:19:16 AM by deansmar »
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #4 on: September 23, 2010, 02:10:07 PM »
it does not create and Faults in the SMF error log, so i think one could say its BUG free.

in IE-8 there is also no faults reported in the bottom of the window.

i am by no means a PHP Coder, so it would be better if a Coder was to look at it first and make the changes before it could be submitted to the blocks section.
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #5 on: September 24, 2010, 02:04:04 AM »
thanks for the vote of confidence  8)

the only problem that i have encountered is;

the language file that is used \Themes\default\languages\SPortal.english.php

for example;
$txt['sp_calendar_events'] =  'Today\'s Events';

change it to;
$txt['sp_calendar_events'] =  'Whats on Today'; 

has no effect on the calendar...!! as if the calendar writes its headings to the database and recalls it from there, but i can not see any thing like that in the code.

and i can not find any other occurrences of "$txt['sp_calendar_events'] " in any of the other language files.

this is puzzling me..  :(
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #6 on: September 24, 2010, 04:01:43 AM »
stupid error....

the language file get copied into the forums cache\ folder and called
lang_SPortal_english_theme.php

so just by emptying the the forums cache;
Admin - Forum Maintenance - Empty the file cache

removes the language file there and makes space for the new one...

extremal stupid error, i think i will kick my self up the backside a few times and see if i wake up..
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #7 on: September 27, 2010, 01:16:21 AM »
it seems as if some users are happy about this... downloaded 7 times so far..

it would be nice to know who has down loaded the file, and if they found it of any use..  :nervous-happy:
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #8 on: October 01, 2010, 01:36:08 AM »
sorry folks i have just noticed a problem with this calendar !!

there are no errors in the SMF log, and everything seems to work just fine, but

see attached picture.

the first 9 days of a month do not show an event ? even though there is an Event in the SMF calendar.

Holidays and Birthdays show up no problems (which is this code);

Code: [Select]
//Add birthdays 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.'; background-color: '.$background_color.'; padding: 0px 0px 0px 0px;" href="'.$href_calendar.'" target="_self">'.$cday.'</a>';
if($startdate != $todayDate)
$collectionDays[$startdate] = $cday;
}
}

i would appricate someone to have a look at the attached code, i would say the problem lies between lines 95- 165.
the background-color gets added at line 155.

in antisipation of a little help

« Last Edit: October 08, 2010, 04:19:56 AM by deansmar »
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #9 on: October 01, 2010, 02:13:26 AM »
which part of the code are you refering to...

$event

does show up a fair few times in the code..  8)
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #10 on: October 01, 2010, 01:30:44 PM »
i think i have it sorted.... its showing the day highlighted and displaying the event..
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline JayH

  • Semi Newbie
  • *
  • Posts: 5
  • Gender: Male
    • NoVA HomeBrew
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #11 on: October 07, 2010, 08:55:07 PM »
Awesome job - when I first installed this portal, I thought that would be a great idea.  So happy I found the mod!

Anyway, I have it in use at http://www.novahomebrew.com - however it is not displaying the future birthdays/events/holidays.  I went thru the config and modified the settings and made sure they were set to "1".  I did not dig down in the code or made the two modifications that were listed.  I assumed that the .php file was updated :\  Maybe I was wrong there.  Oh well, I'll check that out.

Anyway - GREAT mod!  and thanks!
-Jay

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #12 on: October 08, 2010, 04:18:30 AM »
sorry i have forgotten to update the PHP file, which i have done now.

and also attached it to this post.

just as a comment;
the site you have mentioned is not accessable, so i could not take a look at the calendar.. !
« Last Edit: October 08, 2010, 04:21:51 AM by deansmar »
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #13 on: October 08, 2010, 06:55:34 AM »
just a little note:

non of the calendar mods show future birthdays or holidays, they only show future events.

this MOD shows, on the monthly calendar, if switched on, the birthdays, holidays and events with a different background color.
future events will be shown below the calendar.
on the day of the birthday and holiday this will also be shown below the calendar (if switched on)

i hope this has cleared up a few misunderstandings.
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline JayH

  • Semi Newbie
  • *
  • Posts: 5
  • Gender: Male
    • NoVA HomeBrew
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #14 on: October 09, 2010, 06:03:52 AM »
Thanks for the updated php file.  I will update mine in just a few.  However, I think is may be a browser specific bug.  Going to look at that as well.

As far as accessing the site, if you are outside the us, most likely the ip is blocked.  For some strange reason we became a target for spammers and hackers, based mostly in china.  Who knew they were into hombrewing :)

If you pm me you ip address, I'll permit that range to come through so you can see your handy work...

Jay
-Jay

Offline JayH

  • Semi Newbie
  • *
  • Posts: 5
  • Gender: Male
    • NoVA HomeBrew
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #15 on: October 09, 2010, 09:16:32 PM »
[thread_jack]
yea - I know.  I know it limits the overall access to the web site, but I have a .htaccess file in place that blocked all IP's outside of the US.  My number of "Guests" have dropped dramatically.  I may look at adding open proxys to the .htaccess list, but that is SUCH a moving target.  They can have people sit there and randomly go to sites and register accounts.  They may make $2.00 a day, if that.  The managers turn and sell the info - similar model to credit card/personal id sales.  Just for a bit less money.
[/thread_jack]

The calendar actually started to pull the data and place it properly, from the old php file.  Does the data get queried with every page load or refresh every 30 mins?

-Jay
-Jay

Offline JayH

  • Semi Newbie
  • *
  • Posts: 5
  • Gender: Male
    • NoVA HomeBrew
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #16 on: October 09, 2010, 09:24:01 PM »
deansmar

You should be good togo as far as access.  Sorry for the headache :\

I cannot send personal messages yet - I guess I do not have the secret handshake ;)
-Jay

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #17 on: October 10, 2010, 04:55:32 AM »
the calendar loads on every page load or screan refresh or click on the day..

i'll take a look.. ;)
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline Zirc

  • Jr. Member
  • **
  • Posts: 53
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #18 on: December 10, 2010, 09:18:24 PM »
Thanks for this code I have been trying to get this exact thing to work for quite a while now.  Still testing on my test site but so far working perfect.
 :applause:

Offline barbar

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Calendar and Calendar info Block
« Reply #19 on: December 30, 2010, 05:30:08 AM »
what do i do with the .php file here? upload it somewhere to replace?i just copy pasted your code and put it in a block and nothing appeared.

Offline Kyian

  • Semi Newbie
  • *
  • Posts: 11
    • Scalerace
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Calendar and Calendar info Block
« Reply #20 on: December 30, 2010, 11:19:51 AM »
I would love to know aswell :)

Offline Ares

  • Jr. Member
  • **
  • Posts: 50
  • Gender: Male
  • World Of Mass Distruction
    • [SoW] Spoils of War
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: Calendar and Calendar info Block
« Reply #21 on: January 07, 2011, 06:30:10 AM »
put the code in a php block with simple portal

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #22 on: February 11, 2011, 02:47:58 AM »
sorry been away for a few months...

@ Ares... thanks for answering

and being as the others did not come back.. i guess they have it working now..??
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline Yngwiedis

  • Jr. Member
  • **
  • Posts: 67
  • SMF Version: None
  • SP Version: 2.3.3
Re: Calendar and Calendar info Block
« Reply #23 on: April 14, 2011, 04:01:08 PM »
Hello...
I am trying to use this block, but i dont see any images displayed like the .jpg example in previous posts.
I need to upload images in any folder ?

Thank you very very much.

Offline Yngwiedis

  • Jr. Member
  • **
  • Posts: 67
  • SMF Version: None
  • SP Version: 2.3.3
Re: Calendar and Calendar info Block
« Reply #24 on: April 18, 2011, 10:44:38 AM »
Some help please ?

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #25 on: April 25, 2011, 06:28:45 AM »
if you have installed SP properly, then you should have a folder, in your theme that you are using called "images" in this folder there should be a folder called "sp"

yourforum\Themes\yourtheme\images\sp

in this folder there are all the images that simple portal use for example
holiday.png
event.png
birthday.png

these images are used by my Calendar and Calendar info Block

i hope this helps....
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline doughboy99

  • Semi Newbie
  • *
  • Posts: 12
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #26 on: September 26, 2011, 06:04:01 AM »
Hi

Great block.

Is it possible to show events that run over multiple days as one item in the list. So a 6 day event would appear as "Fri 14th-Wed 19th Ibiza" rather than filling the list with 6 items.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #27 on: October 09, 2011, 08:33:24 AM »
good question... i am not a programmer, i have just put this together from existing code... by trial and error
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline Andree2401

  • Newbie
  • Posts: 3
  • SMF Version: 2.0.1
  • SP Version: 2.3.4
Re: Calendar and Calendar info Block
« Reply #28 on: January 07, 2012, 12:49:49 PM »
Hi great Work so far.
Is it possible to show future Birthdays (Dates from User Profile).

I would like to see the Birthdays for the next 30 Days in Future.

Thanx

ANdree

Offline tomeh

  • Full Member
  • ***
  • Posts: 113
    • infomiasto.eu
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Calendar and Calendar info Block
« Reply #29 on: January 09, 2012, 11:53:25 AM »
Such a thing would be imparted by default, the portal also blocks
Serwis infomiasto.eu - poradniki i przewodniki tematyczne

Offline Andree2401

  • Newbie
  • Posts: 3
  • SMF Version: 2.0.1
  • SP Version: 2.3.4
Re: Calendar and Calendar info Block
« Reply #30 on: January 09, 2012, 12:41:47 PM »
Such a thing would be imparted by default, the portal also blocks
No, i dont see any Birthdays so far, only the Birthdays Today, but no Birthdays in Future
(tomorrow or next Week). I do only see Evetns created by Users.

Andree

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #31 on: January 10, 2012, 12:14:52 PM »
the birthdays are marked on the calendar.....

if you have not changed the colors... then they should be a green colour
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Calendar and Calendar info Block
« Reply #32 on: January 19, 2012, 11:04:20 PM »
The block uses the SSI function for showing birthdays. This is the expected behavior -- only show today's birthdays.

Changing this would require more customization.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline velorooms

  • Jr. Member
  • **
  • Posts: 83
    • Velorooms
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Calendar and Calendar info Block
« Reply #33 on: January 05, 2013, 07:45:42 PM »
Hi

Great block.

Is it possible to show events that run over multiple days as one item in the list. So a 6 day event would appear as "Fri 14th-Wed 19th Ibiza" rather than filling the list with 6 items.

A bit after the fact, but posting here as it may be of use to some. We had this problem as we frequently have calendar events spanning 7-20 days. The below code removes any of the duplicates so it only shows the next day (although it doesnt show them over a range of dates, just the next date)

Code: [Select]
<?php
/* New Calender Version 23.09.2010 works with SMF 2-RC3 and SP 2.3.2*/

/*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 'white';
$color_background_items_event 'white';
$color_background_items_birthday '#89C8A9';
$color_background_items_holiday 'yellow';

//The textcolor of days with Events, birthdays or holidays, you can use css colors
$color_text_items_mixed '#C00000';
$color_text_items_event 'black';
$color_text_items_birthday 'darkblue';
$color_text_items_holiday '#C00000';

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

//The Textcolor for the standard days
$color_text 'dark blue';

//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 0//0 No, 1 Yes
$show_holidays 0//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 '%d/%m';

//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 Events into 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($todayDate == $startdate  || ($current_timestamp >= $now && $current_timestamp <= $event_future_time)) {
if(
$todayDate == $startdate 
$calendarDataToday['events'] = $event;
else
$calendarEventsFuture[$startdate] = $event;
}

if(
$todayDate == $startdate)
$calendarDataToday['events'] = $event;
$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_event;
$background_color = !empty($days[$cday]) ? $color_background_items_mixed $color_background_items_event;

//Insert only the current informtions
if($cmonth == $month//Next month is not avaible ;)
$days[$cday] = '<a class="smalltext" style="color: '.$color_text_items_event.'; background-color: '.$color_background_items_event.'; padding: 1px 3px 1px 3px;" href="'.$href_calendar.'" target="_self">'.$cday.'</a>';
if(
$cmonth == $month && $startdate != $todayDate)
$collectionDays[$startdate] = $cday;
}
//Correct the order :)
if(!empty($calendarEventsFuture))
//ksort($calendarEventsFuture, SORT_NUMERIC);
ksort($calendarEventsFuture);
$calendar_array['futureEvents'] = $event;
}

//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: 1px 3px 1px 3px;" 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 .= '
<td class="smalltext" abbr="'
.$d.'">'.(!empty($day_name_length) ? $d $day_names_short[$k]).'</td>';
$calendar .= "
</tr>
<tr style=\"text-align:center;\">"
;

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:center;\">"
;
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:0px;\"><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%;" class="block-calendar">';
if(!empty(
$calendarDataToday['holidays'])){
echo 
' <tr>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_holiday ';">
<b>'
$txt['sp_calendar_holidays'] ,'</b> </td>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
</tr>
<tr>
<td colspan="3" class="smalltext" align="left" style="width:100%;"><ul>'

echo  
'<li>'sp_embed_image('holiday'), '  'implode('<br />'$calendarDataToday['holidays']) , '</li>' ;
echo 
'</ul></td> </tr>'
}
if(!empty(
$calendarDataToday['birthdays'])){
echo 
' <tr>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_birthday ';">
<b>'
$txt['sp_calendar_birthdays'] ,'</b> </td>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
</tr>
<tr>
<td colspan="3" class="smalltext" align="left" style="width:100%;"><ul>'
;
foreach( 
$calendarDataToday['birthdays'] as $member )
echo 
'<li>'sp_embed_image('birthday'), ' <a href="'$scripturl'?action=profile;u='$member['id'], '">'$member['name'], isset($member['age']) ? ' (' $member['age'] . ')' '''</a></li>' ;
echo 
'</ul></td> </tr>'
}
if(!empty(
$calendarDataToday['events']))
{
$dayOutput str_replace(array('%y','%m','%d'), explode('-'$todayDate), $currentDateFormat);
echo 
'<tr>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_event ';">
<b>'
$txt['sp_calendar_events'] ,'</b> </td>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
</tr>
<tr>
<td colspan="3" class="smalltext" align="left" style="width:100%;"><ul>'
;
foreach (
$calendarDataToday['events'] as $event)
echo 
'<li>'sp_embed_image('event'), ' '$event['link'], '</li>';
echo 
'</ul></td> </tr>'
}
if(!empty(
$calendarEventsFuture))
{
echo 
'<tr>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_event ';" style="width:100%;">
<b>'
$txt['sp_calendar_upcomingEvents'] ,'</b> </td>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
</tr>
<tr>
<td colspan="3" class="smalltext" align="left"><ul>'
;
foreach (
$calendarEventsFuture as $startdate => $future_events)
{
list(
$year$month$day) = explode('-'$startdate);
$currentDay $day ' ' $txt['months_short'][(int) $month];
//Okay tell the user the date of this event...
$dayOutput str_replace(array('%y','%m','%d'), explode('-'$startdate), $currentDateFormat);

foreach(
$future_events as $event)
if(isset($log)) {

if(!in_array($event['id'],$log,true) ) { 
$log[]=$event['id'];
echo '<li>'sp_embed_image('event'), ' '$currentDay ' - '$event['link'];
}
}
else {
echo '<li>'sp_embed_image('event'), ' '$currentDay ' - '$event['link'];
$log = array();
$log[]=$event['id'];
}
}
//print_r($log,true);
echo '</ul></td> </tr>'
}
echo 
' </table>';
}
else
echo 
'
<table id="'
.$javascript_idFix.'today" align="center" width="100%" style="display:block; width:100%;" class="block-calendar">
<tr>
<td class="smalltext">  <hr class="sp_acalendar_divider" /> '
,$txt['sp_calendar_noEventsFound'],' </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%;" class="block-calendar">
<tr>
<td class="smalltext"> <hr class="sp_acalendar_divider" /> '
,$txt['sp_calendar_noEventsFound'],' </td>
</tr>
</table>'
;
foreach(
$collectionDays as $startdate => $day) {
echo 
' <table id="'.$javascript_idFix.'day'.$day.'" align="center" width="100%" style="display:none; width:100%;" class="block-calendar">';
if(!empty(
$holidays[$startdate])){
echo 
' <tr>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_holiday ';">
<b>'
$txt['sp_calendar_holidays'] ,'</b> </td>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
</tr>
<tr>
<td colspan="3" class="smalltext" align="left" style="width:100%;">'
;
echo 
sp_embed_image('holiday'), ' 'implode('<br />'$holidays[$startdate]);
echo 
' </td> </tr>'
}
if(!empty(
$birthdays[$startdate])){
echo 
' <tr>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_birthday ';">
<b>'
$txt['sp_calendar_birthdays'] ,'</b> </td>
<td width="15%"> <hr class="sp_acalendar_divider" /> </td>
</tr>
<tr>
<td colspan="3" class="smalltext" align="left" style="width:100%;">'
;
foreach( 
$birthdays[$startdate] as $member )
echo 
'<li>'sp_embed_image('birthday'), ' <a href="'$scripturl'?action=profile;u='$member['id'], '">'$member['name'], isset($member['age']) ? ' (' $member['age'] . ')' '''</a></li>' ;
echo 
' </td>  </tr>'
}
if(!empty(
$events[$startdate]))
{
$dayOutput str_replace(array('%y','%m','%d'), explode('-'$startdate), $currentDateFormat);
echo 
' <tr>
<td width="15%"> <hr class="sp_acalendar_divider" />  </td>
<td class="smalltext" align="center" style="color: ' 
$color_text_items_event ';">
<b>'
$txt['sp_calendar_events'] ,'</b>  </td> 
<td width="15%">  <hr class="sp_acalendar_divider" /> </td>

</tr>
<tr>
<td colspan="3" class="smalltext" align="left" style="width:100%;"><ul>'
;
foreach (
$events[$startdate] as $event)
echo 
'<li>'sp_embed_image('event'), ' '$event['link'] , '</li>';
echo 
'</ul></td></tr>'
}
echo 
'</table>';
}
}
echo 
'</div>';
}
?>

then a couple of lines added to the themes index.css

Code: [Select]
.block-calendar td ul {margin: 0; padding: 0;}
.block-calendar td ul li {list-style: none;}

Which turns off the bulleting

Admin and Owner of Velorooms.com - Using SMF 2.0.3 and Simpleportal 2.3.5