[BETA] MyCalendar3

MODs and Styles for phpBB3.

To post your MOD or style, go to the STG MOD Manager
Forum rules
Go to http://startrekguide.com/mods to submit your MOD or style

Re: [BETA] MyCalendar3

Postby Dr00py » 07 Mar 2009, 16:37

cool MOD, but I have a small problem with the anniversaries.
If the year is not set in the profile, just day and month, on the calendar it displays 2009 to side of my nickname

birthday.jpg
birthday.jpg (3.21 KiB) Viewed 1114 times


Can you correct for that displays nothing if the Year of birth is not informed ???
Thanks
User avatar
Dr00py
Crewman
Crewman
 
Posts: 8
Joined: 07 Mar 2009, 16:19
Location: Switzerland
Gender: Male
phpBB Knowledge: 3




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: [BETA] MyCalendar3

Postby alf007 » 07 Mar 2009, 17:25

Dr00py wrote:cool MOD, but I have a small problem with the anniversaries.
If the year is not set in the profile, just day and month, on the calendar it displays 2009 to side of my nickname

birthday.jpg


Can you correct for that displays nothing if the Year of birth is not informed ???
Thanks


In mycalendar3.php

Find
Code: Select all
$birthdays .= '<a' . $user_colour . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $ucbirthdayrow[$i]['id']) . '">' . $ucbirthdayrow[$i]['username'] . '</a> (' . ((int)$monthView['year'] - (int)substr($ucbirthdayrow[$i]['birthday'], -4)) . ')';

Replace with
Code: Select all
         $birthdays .= '<a' . $user_colour . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $ucbirthdayrow[$i]['id']) . '">' . $ucbirthdayrow[$i]['username'] . '</a>';
         $birth_year = (int)substr($ucbirthdayrow[$i]['birthday'], -4);
         if ($birth_year > 0)
         {
            $birthdays .= ' (' . ((int)$monthView['year'] - $birth_year) . ')';
         }


In mini_calendar.php
Find
Code: Select all
$title .= $birthdays[$b]['username'] . ' (' . ($mini_cal_this_year - (int)substr($birthdays[$b]['birthday'], -4)) . ')';

Replace with
Code: Select all
         $title .= $birthdays[$b]['username'];
         $birth_year = (int)substr($birthdays[$b]['birthday'], -4);
         if ($birth_year > 0)
         {
            $title .= ' (' . ($mini_cal_this_year - $birth_year) . ')';
         }
User avatar
alf007
Cadet III
Cadet III
 
Posts: 33
Joined: 29 Oct 2007, 09:23
Gender: Male

Re: [BETA] MyCalendar3

Postby Dr00py » 08 Mar 2009, 04:23

Thanks alf007 :thumbsup:
User avatar
Dr00py
Crewman
Crewman
 
Posts: 8
Joined: 07 Mar 2009, 16:19
Location: Switzerland
Gender: Male
phpBB Knowledge: 3

Re: [BETA] MyCalendar3

Postby Dr00py » 08 Mar 2009, 16:07

alf007 wrote:
kb0000 wrote:Can this Calendar be used in Board3 Portal instead of MiniCalendar there. If it can be used, then how?


You mean to replace the Board3 mini_cal block with this MOD's?
It will need to insert/replace some parts of the mini_cal block (portal/block/mini_cal.php, styles/[style name]/template/portal/block/mini_calendar.html) with some code from (mini_calendar.php, styles/[style name]/template/mini_cal_body_html)
This is just a guess after a quick look at that portal MOD, that i didn't especially know of before :read:


I'm also interested, can you post the parts of codes we need to change/replace ??
I have a local board for testing with Board3 portal and MyCalendar3 installed

Thanks
Dr00py
User avatar
Dr00py
Crewman
Crewman
 
Posts: 8
Joined: 07 Mar 2009, 16:19
Location: Switzerland
Gender: Male
phpBB Knowledge: 3

Re: [BETA] MyCalendar3

Postby duw » 08 Mar 2009, 18:22

Got it to work at last - totally my fault - using a totally rubbish installment of BB! Great MOD. Thanks Alf. Also thanks for including the Welsh translation.
duw
Crewman
Crewman
 
Posts: 7
Joined: 09 Feb 2009, 03:53
Gender: Male
phpBB Knowledge: 5

Re: [BETA] MyCalendar3

Postby Dr00py » 12 Mar 2009, 11:21

Dr00py wrote:
alf007 wrote:
kb0000 wrote:Can this Calendar be used in Board3 Portal instead of MiniCalendar there. If it can be used, then how?


You mean to replace the Board3 mini_cal block with this MOD's?
It will need to insert/replace some parts of the mini_cal block (portal/block/mini_cal.php, styles/[style name]/template/portal/block/mini_calendar.html) with some code from (mini_calendar.php, styles/[style name]/template/mini_cal_body_html)
This is just a guess after a quick look at that portal MOD, that i didn't especially know of before :read:


I'm also interested, can you post the parts of codes we need to change/replace ??
I have a local board for testing with Board3 portal and MyCalendar3 installed

Thanks
Dr00py


alf007, can you help me to replace the portal calendar with your calendar ???
User avatar
Dr00py
Crewman
Crewman
 
Posts: 8
Joined: 07 Mar 2009, 16:19
Location: Switzerland
Gender: Male
phpBB Knowledge: 3

Re: [BETA] MyCalendar3

Postby alf007 » 12 Mar 2009, 12:41

Dr00py wrote:
alf007, can you help me to replace the portal calendar with your calendar ???


Maybe i'll have a look this week-end,
got also to check the validation response from the ModDB team, and do the needed corrections on the MOD :borg:
User avatar
alf007
Cadet III
Cadet III
 
Posts: 33
Joined: 29 Oct 2007, 09:23
Gender: Male

Re: [BETA] MyCalendar3

Postby Dr00py » 13 Mar 2009, 02:22

alf007 wrote:
Dr00py wrote:
alf007, can you help me to replace the portal calendar with your calendar ???


Maybe i'll have a look this week-end,
got also to check the validation response from the ModDB team, and do the needed corrections on the MOD :borg:

ok, thanks
User avatar
Dr00py
Crewman
Crewman
 
Posts: 8
Joined: 07 Mar 2009, 16:19
Location: Switzerland
Gender: Male
phpBB Knowledge: 3

Re: [BETA] MyCalendar3

Postby alf007 » 15 Mar 2009, 14:21

So to to add the mini_calendar to the portal, replacing the default one (the portal3 team should add some info to configure this one btw)

copy mini_calendar.php to portal/block/mini_calendar.php
copy styles/<your theme>/template/mini_cal_body.html to styles/<your theme>/template/portal/block/mini_cal_body.html

Open portal.php
Find
Code: Select all
include($phpbb_root_path . 'portal/block/mini_cal.'.$phpEx);

Replace with
Code: Select all
include($phpbb_root_path . 'portal/block/mini_calendar.'.$phpEx);


Open styles/<yourtheme>/template/portal/portal_body.html
Find
Code: Select all
<!-- INCLUDE portal/block/mini_calendar.html -->

Replace with
Code: Select all
<!-- INCLUDE portal/block/mini_cal_body.html -->


Open portal/block/mini_calendar.php
Find
Code: Select all
list($today['year'], $today['month'], $today['day'])

Replace with
Code: Select all
list($today_info['year'], $today_info['month'], $today_info['day'])

Find
Code: Select all
$view_isodate = $today['year'] . '-' . $today['month'] . '-01 00:00:00';

Replace with
Code: Select all
$view_isodate = $today_info['year'] . '-' . $today_info['month'] . '-01 00:00:00';

Find
Code: Select all
'mini_cal_body' => 'mini_cal_body.html')

Replace with
Code: Select all
'mini_cal_body' => 'portal/block/mini_cal_body.html')

Find
Code: Select all
$prev_month = append_sid("{$phpbb_root_path}index.$phpEx", 'month=' . ($month - 1));
$next_month = append_sid("{$phpbb_root_path}index.$phpEx", 'month=' . ($month + 1));

Replace with
Code: Select all
$prev_month = append_sid("{$phpbb_root_path}portal.$phpEx", 'month=' . ($month - 1));
$next_month = append_sid("{$phpbb_root_path}portal.$phpEx", 'month=' . ($month + 1));

Find
Code: Select all
'U_MINI_CAL_CALENDAR' => append_sid("{$phpbb_root_path}mycalendar3.$phpEx"),

Add before
Code: Select all
   'S_DISPLAY_MINICAL' => true,


Open styles/<yourtheme>/template/portal/block/mini_cal_body.html
Find
Code: Select all
<div class="forabg">

Replace with
Code: Select all
<div class="portal-panel">

Find
Code: Select all
<span class="corners-top"><span></span></span>

Replace with
Code: Select all
<span class="portal-corners-top"><span></span></span>

Find
Code: Select all
<span class="corners-bottom"><span></span></span>
   </div>
</div>

Replace with
Code: Select all
<span class="portal-corners-bottom"><span></span></span>
   </div>
</div>
<br style="clear:both" />


Then ACP/STYLES/Templates/<yourtheme> ... Refresh
And that should go.
Though may also need some adjustment on css style for color and such...
User avatar
alf007
Cadet III
Cadet III
 
Posts: 33
Joined: 29 Oct 2007, 09:23
Gender: Male

Re: [BETA] MyCalendar3

Postby Dr00py » 16 Mar 2009, 10:00

Big thanks alf007 for having taken the time to make me this block, it works very well.

mini_calendar.jpg
mini calendar block
(10.04 KiB) Downloaded 44 times
User avatar
Dr00py
Crewman
Crewman
 
Posts: 8
Joined: 07 Mar 2009, 16:19
Location: Switzerland
Gender: Male
phpBB Knowledge: 3

PreviousNext

Return to phpBB3 Customizations

Who is online

Users browsing this forum: Bingbot, EasouSpider and 14 guests