Jump to content

Extension talk:SimpleCalendar

Add topic
From mediawiki.org
(Redirected from Extension talk:Simple Calendar)
Latest comment: 2 months ago by ParagStudent2023 in topic Starting the week with Sunday?

Source code displaying on page

[edit]

This extension is not working for me. When enabled, all code from the script starting from "setFunctionHook" to the end is displayed at the top of my Main Page. Any ideas? Thanks. --Joshuaholland 20:57, 30 April 2007 (UTC)Reply

The script being displayed in the output page usually means that the php opening delimeter (<?) is missing. --Nad 22:23, 30 April 2007 (UTC)Reply
I have the opening delimiter (<?) there, and it is interesting that the code desplayed on the Main Page starts at setFunctionHook and not at the beginning of the script, which is what you think would happen if the <? was missing. Josh 00:45, 1 May 2007 (UTC)Reply
Hmmm that's pretty weird alright, what's the way you've included it into localsettings? is it pasted directly in, or included as a file? are other extensions working? --Nad 01:47, 1 May 2007 (UTC)Reply
That character before setFunctionHook is a ">", so my guess is that you've pasted the code directly into LocalSettings rather than including from file, and therefore there should be no delimeters since it's already in php context (it would make the opening delimeter a tag which would close when it got to the > before the setFunctionHook) - just a guess tho ;-) --Nad 01:50, 1 May 2007 (UTC)Reply
Okay, I just made it <?php and then it worked... Josh 02:43, 1 May 2007 (UTC)Reply
Cool, ok I guess I should really make the tags like that for everything. --Nad 02:55, 1 May 2007 (UTC)Reply

Could I create tasks whose title have some variables

[edit]
  • I want to create some tasks with titles like "Michael's log 2007_05_01" instead of ""Michael's log 2007_05_01_01_MAY_2007" by using ({{#calendar:{{CURRENTUSER}}'log_{{CURRENTYEAR}}_{{CURRENTMONTH}}_{{CURRENTDAY2}}|2007}} and "&preload=Template:Michael's log", any ideas? Thinks!--Roc michael 12:59, 1 May 2007 (UTC)Reply
I'm not sure completely what you mean, but the query-string bit is a good idea which I've just added. I've changed to named parameters now instead of an ordered list, and added a new query parameter which allows query-string items to be added to the newly created dates. --Nad 23:45, 1 May 2007 (UTC)Reply
Hi, Thank you very much! How wonderful it is that we can use peload parameter on the Calendar. I am Chinese in Taiwan and I want to use this extension and DPL in my wiki located in a intranet. So the people here would more like to use the date form of task title like "2007/05/02" than "02/May/2007" or "2007/May/02". I guess that Japanese people may think so. So if we can choose which date form we can use that will be a nice thing. Thank you!--Roc michael 15:00, 2 May 2007 (UTC)Reply
I added another parameter called format, you can change to the format you asked for of 2007/05/02 with the following,
{{#calendar:format=%Y/%m/%d}}
Thank you, Nad. I appreciate you for what you did.--Roc michael 13:35, 3 May 2007 (UTC)Reply

Adding a prefix to day links?

[edit]
  • Can the variable $prefix be used like this? I'd like the days to link to a page in the current namespace and subpage. I tried giving it a value to $prefix but that didn't work. I was able to code it into this line
$table .= "|$t|[[{{NAMESPACE}} {{SUBPAGENAME}} $prefix$dd $month $y|$day]]\n";" 

and mostly it works, but it seems there should be a more elegant way. Also, this makes the subpage have a colon instead of a slash before it, which is what I want. Thanks. Josh 14:15, 2 May 2007 (UTC)Reply

Actually, I got the formatting to work right, but still wondering if there is a better way for me to code it. Thanks. Josh 17:00, 2 May 2007 (UTC)Reply
I think putting mediawiki-variables in the code like that would just hardwire them into the code when its saved, they wouldn't be dynamic. You can add dynamic prefixes like this:
{{#calendar:title={{NAMESPACE}} {{SUBPAGENAME}} }}

Could it be possible that this great calendar could get a new face with a parameter?

[edit]

When I displayed this great calendar with dpl some people marvel at the wonderful result of the two extensions. But since I've used another calendar (User:Hex2bit/Calendar), some body used to using it. If Simple Calendar could get a new face with a parameter, I think it will be a nice thing. Nad, I believe that you can make it be possible to find a way to Integrate them, right? :-) --Roc michael 01:21, 8 May 2007 (UTC)Reply

Not sure about that, you'll need to explain in more detail what you're wanting to be done... do you mean a skin? It defines all its parts with CSS classes so you can change the look of it easily. --Nad 04:00, 8 May 2007 (UTC)Reply
Yes, Some people like the interface of calendar (User:Hex2bit/Calendar). It can be used to show which members in a department on duty at each day. But unfortunately, It cannot generate articles with custom-made titles. Especially,something like "2007/05/07". Nowadays, it can only use like "2007/5/7" to be a title of an article and it disadvantage working with DPL to list all the events. On the other hand, Simple Calendar is a Parser function extension. So it well be more useful than other calendar extensions.
The skin of Simple Calendar is good for some of my coworkers, but others prefer the one which User:Hex2bit/Calendar used ,particularly, to be used for a public calendar.
Nad, sorry, I am not a programer, :-( I can only use a few CAD softwares and edit some simple web pages with Dreamweaver. I very like Mediawiki, because it is powerful, useful and has countless advanced programers 'like you' to improve itself. So please do me a favor, Nad.--Roc michael 13:01, 8 May 2007 (UTC)Reply

Could I use the functions preload and format in the same time

[edit]

Nad, if I use the preload function, it seems that I cannot use the format function which like the followed all together.

{{#calendar:format=%Y/%m/%d query=preload=Template:Test}}
{{#calendar: query=preload=Template:Test format=%Y/%m/%d}}

Could you give me a hand?--Roc michael 16:04, 8 May 2007 (UTC)Reply

Use pipes to separate the parameters in a parser-function or template, eg:
{{#calendar: query=preload=Template:Test | format=%Y/%m/%d}}
Thank you! Nad.--Roc michael 11:27, 9 May 2007 (UTC)Reply

Remove # character in parser-function name on 1.6.x

[edit]

Hey Nad - first of all, I wanted to thank you very-very much; I really appreciate all this wiki-work you do, and I wish I could do the same, in order to publish these works freely...

Anyway, I liked your SimpleCalendar extension, but I just couldn't make it work, I don't know why... I'll detail here the phases I have done in order to make it work, and I'll be happy if you could tell me what have I missed/done wrong.

I do have experience with extensions; I have built some of my own (too specific to be included here... :-) ).

Here it is:

  • I have created the file SimpleCalendar.php
  • I have copied into it the text from here: [1]
  • Saved and uploaded to the extensions folder.
  • Inserted the following line into LocalSettings.php -
include('extensions/SimpleCalendar.php');
  • Uploaded that file (into the root directory)

First testings:

  • In my version page, I can see your credit (Simple Calendar (version 1.2.1, 2007-05-07), A simple calendar extension, by User:Nad )
  • I have created a "test" page, and put there only the following code:
{{#calendar:}}
  • Saving; refreshing; nothing. All I see is this: {{#calendar:}}

It just ignores the extension, somehow.

Other extensions, as I said, work; I also installed the "Extension:Variables", and if I enter the following input in the test page:

{{#calendar: year=2007 | month=feb | title={{CURRENTUSER}} }}

I save and get the following output: {{#calendar: year=2007 | month=feb | title=Demowiki }} (Demowiki is the username...)

That's it, I think...

Oh - and I have:

  1. MediaWiki: 1.6.10
  2. PHP: 4.4.1 (cgi)
  3. MySQL: 4.0.27-standard

If it matters.

Thanks ahead! Peleg 08:27, 13 May 2007 (UTC)Reply

No problem - on MediaWiki version 1.6.x the parser functions don't use the # character by default, just remove that, eg
{{Calendar:year=2007}}
I've updated the Extension:Simple Calendar page to have a note about this. --Nad 21:37, 13 May 2007 (UTC)Reply
hehe... AS simple as that... Thanks!! Peleg 07:27, 14 May 2007 (UTC)Reply
[edit]

I've just installed the new version of the calendar and I have a problem... All the links (dates) are external links: http://img260.imageshack.us/img260/2333/sanstitrets6.png And I still have the problem of the language... I don't have access to the configuration server. YeTi 20:39, 3 May 2007 (NZST)

I'm experiencing this same issue. Anybody find a resolution? Jaofos 05:06, 30 May 2007 (NZST)
Did you add the CSS rule #bodyContent table.month a { background:none; padding:0 }? that makes the links plain --Nad 08:47, 30 May 2007 (NZST)
Yes, I figured out afterwards to add the styles for the calendar and everything works great. I have, however, run into another issue where after you add entries for a calendar day, the link will not change to indicate an existing entry for that day until after you edit and save the page with the {{#calendar}} tag. Jaofos 02:59, 12 June 2007 (NZST)
I've tried adding a line into the code to disable the caching for calendar tables, but your problem doesn't happen on our wiki's, so I can't test it, give it a go now and see if it works any better --Nad 22:28, 11 June 2007 (UTC)Reply
Just change
$table .= "|$t|[$url <span class='$class'>$day</span>]\n";
to
$table .= "|$t|[[$title|<span class='$class'>$day</span>]]\n";
in SimpleCalendar.php --95.84.164.240 12:08, 3 September 2011 (UTC)Reply

Other languages

[edit]

Hi, a few questions:

  • How can I put the calendar in another language, for example french (january = janvier, etc...)?
I changed it slightly to work with locales, so download again from MW:Extension:Simple Calendar, and then set the PHP locale in LocalSettings.php with the following (the locale's must be configured on the server properly),
<php>setlocale(LC_ALL,'fr_FR','fr','FR','french','fra','france','French','fr_FR.ISO8859-1');</php>
if that doesn't work, use locale -a from your server's shell to see what local's are available.
  • In which file do I have to put the CSS code, knowing that I use the Monobook skin? --YeTi 19:58, 1 May 2007 (NZST)
You can add it to your MediaWiki:Monobook.css file, see our MediaWiki:Wikiskin.css for example. --Nad 21:08, 1 May 2007 (NZST)
[edit]

I've just installed the new version of the calendar and I have a problem... All the links (dates) are external links: http://img260.imageshack.us/img260/2333/sanstitrets6.png And I still have the problem of the language... I don't have access to the configuration server. YeTi 20:39, 3 May 2007 (NZST)

I'm experiencing this same issue. Anybody find a resolution? Jaofos 05:06, 30 May 2007 (NZST)
Did you add the CSS rule #bodyContent table.month a { background:none; padding:0 }? that makes the links plain --Nad 08:47, 30 May 2007 (NZST)
Yes, I figured out afterwards to add the styles for the calendar and everything works great.
Hello, first i had the same problem, until i added the css-style to Common.css. But after a while i found out that the links point to a new window. This means the links still behave like external links. This might be caused by the addition i made to open external links in a new window (see Mediawiki - FAQ). How can i prevent the calendarlinks from opening each day in a new window?
Thanks for a quick answer, TurboKanne 29.Jan.2008
The opening in new window hack should only work for links outside your wiki's domain, so you probably haven't set that up right (have you set regexp_isYourdomain to your domain?) --Nad 03:41, 9 February 2008 (UTC)Reply
Thanks for the response. Unfortunately this does not fit together with the way i changed wiki to open links in a new window. I used this method: here. So as far as i can see setting var regex_isYourdomain to my domain is no option for me. Or am i wrong?
kind regards
TurboKanne 11.Feb.2008
In that case I think you may have to adjust your file hack to not affect local domains or something similar --Nad 21:39, 11 February 2008 (UTC)Reply
Hello, now i managemd to change the way how external links are opened. it works the right way now. but since i have shortened my URL i have an additional problem. The style does not longer fit. that means the calender is rendered without any style, even though i have customized the MediaWiki:Common.css. Is there any variable to edit in LocalSetting.php when i shorten the URL to adjust the stylepath?
--TurboKanne 12:39, 19 February 2008 (UTC)Reply
Just change
$table .= "|$t|[$url <span class='$class'>$day</span>]\n";
to
$table .= "|$t|[[$title|<span class='$class'>$day</span>]]\n";
in SimpleCalendar.php --95.84.164.240 12:08, 3 September 2011 (UTC)Reply

Link colour not changing to indicate newly created entry

[edit]

I have, however, run into another issue where after you add entries for a calendar day, the link will not change to indicate an existing entry for that day until after you edit and save the page with the {{#calendar}} tag. Jaofos 02:59, 12 June 2007 (NZST)

I've tried adding a line into the code to disable the caching for calendar tables, but your problem doesn't happen on our wiki's, so I can't test it, give it a go now and see if it works any better --Nad 22:28, 11 June 2007 (UTC)Reply
Seems to be working now, thanks! --Jaofos 02:37, 13 June 2007 (NZST)

CSS style

[edit]

The CSS style to any calendar containing articles can be applied using Extension:CSS now --Zven 20:44, 1 July 2007 (UTC)Reply

[edit]
  • Running MediaWiki version 1.10 on latest version of XAMPP (running as localhost on my own Windows XP machine)
  • Using Simple Calendar version 1.2.2 from Organic Designs wiki site (having edited minor syntax error in the loop in the function that displays calendar from passed month and year).
  • calendar.php resides in my extensions directory.
  • LocalSettings.php includes the line include( "extensions/calendar.php" );
  • Calling the calendar display on the wiki page with the line {{#calendar: year=2007 | month=07 }}

The calendar display is visually perfect. However, every individual date links to the same page, July 2007, without including the actual day value in the link.

If I call the calendar using {{#calendar: year=2007 | month=07 | format=%d/%m/%Y }}, now I get date links but the table alignment for the first line of dates is offset to the right by the width of the calendar display, and negative dates are displayed (meaning for example that the display would include -13 as a date, which links to a date 13 days prior to July 1 2007 in this example).

The page July 2007 existed prior to the installation of Simple Calendar, if that is relevant.

Any thoughts, anyone? Clingonkelt 19:20, 15 July 2007 (UTC)Reply

There shouldn't have been a syntax error to fix because it's the same version which is running properly on the organicdesign site... what was the error? is it possible to see the faulty site or is it behind firewall? --Nad 06:43, 16 July 2007 (UTC)Reply

Vren here. I had the same problem. I put this in:

{{#calendar: title=engenic | year=2008 | month=02 | format=%Y/%m/%d }}

That works for me. Still... there is a small problem here.

Calendar Is There But As a Newby I have no Idea what to do with the CSS data

[edit]

I like your SimpleCalendar extension, but I just couldn't make it work, I don't know why... I'll detail here the phases I have done in order to make it work, and I'll be happy if you could tell me what have I missed/done wrong. (OK you've heard this all before I know but...)

Here it is:

   * I have created the file SimpleCalendar.php (from the Organic Design site)
   * Saved it to the extensions folder.
   * Inserted the following line into LocalSettings.php -
     include('extensions/SimpleCalendar.php');

Struggled with the CSS data, finally put it in Main.CSS (in the Skins/Monobook folder)

First test implementation:

   * Added Calendar|Calendar to the Sidebar
   * Created a page called Calendar added {{#calendar:}}
   * Clicking menu item I get a year calendar called "Calendar" but no formatting/styles 
     are applied the calendar days/months.
   * Hovering over a day doesn't give you a date, just a month.
   * Clicking a date creates a new page but the page is dated only by the month not the date.

That's it, I think...

Oh - and I have:

  1. MediaWiki: 1.10.1
  2. PHP: 5.2.3 (cgi)
  3. MySQL: 5.0.24
  4. IIS
  5. Windows 2K3

Any suggestions would be much appreciated

Prevaljo

First of all, you should remove the changes you made to the main.css file and put the css rules into the MediaWiki:Common.css article. You should never change any files which are part of the mediawiki installation, only LocalSettings.php and the extension files should ever be changed.
If you can't give me a URL to your wiki (due to firewall, intranet etc) then maybe give me the html source of the faulty calendar page and I'll see if I can figure out what's wrong with it. --Nad 22:01, 9 August 2007 (UTC)Reply
Thanks for this rapid feedback NAD, however for whatever reason let's assume caching I can now see your calendar. In the correct format with styles... (Newbys DUH)

Date Format

[edit]

One issue remaining was the fact that the day/month links all pointed only to a single month but by using the suggestion from "Clingonkelt" above to change the {{#calendar:}} to {{#calendar: year=2007 | format=%d/%m/%Y }} the date issue is now resolved I'm not sure if I like the articles being referenced numerically buy day eg as 14/6/2007 but I can work on that. I will revisit the changes I made to the Main.CSS stylesheet and see if puting them in Mediawiki:common.css article gives me the same result, many thanks again. Prevaljo

You can use that format parameter to make the date any format you like - how did you want it to be? Also when you make any changes to CSS you may have to do a ctrl+shift+refresh to force the browser to reload page dependencies since a normal refresh will only reload the page html. --Nad 05:33, 10 August 2007 (UTC)Reply
I would have agreed but it would appear you can't put text in using the date format, so I have been unable to have 01/March/2007 but I'm not loosing sleep over it. Prevaljo 06:07, 10 August 2007 (UTC)Reply
That format should be fine, you'd use format=%d/%B/%Y. if that doesn't work it may be a problem with your PHP locale settings. The default format is %e %B %Y which should give 1 March 2007. --Nad 07:55, 10 August 2007 (UTC)Reply


Little error

[edit]

When I install the extention I have this error on the top

Warning: Cannot modify header information - headers already sent by (output started at /mnt/123/free.fr/7/4/axxcat/wiki/extensions/simplecalendar.php:78) in /mnt/123/free.fr/7/4/axxcat/wiki/includes/WebResponse.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at /mnt/123/free.fr/7/4/axxcat/wiki/extensions/simplecalendar.php:78) in /mnt/123/free.fr/7/4/axxcat/wiki/includes/WebResponse.php on line 10

TheEnd, le 7 septembre 2007 à 21:45 (WET)

Not sure what that can be... Line 78 is the last line of the code, do you have the closing php-delimiter (>) on the end of the simplecalendar.php script? --Nad 21:21, 7 September 2007 (UTC)Reply

Check to make sure there is not an extra line break at the end of the PHP part after you pasted it, that is what messed it up for me.

Combination with Simple Form ?

[edit]

Hi Nad. Could it be possible the extension combine with Simple Forms like followed:

{{#calendar: query=preload=Template:calendar_preload |form =Template:calendar_input_form | format=%Y/%m/%d}}

and the content of Template:calendar_input_form is like followed:

{{#form:method=post|style=width:400px|
<br>
'''Description:'''<br>
{{#input:type=textarea|style=.....
}}
  • First, When we create a calendar page, we can use both functions "preload" and "form".
  • Second,When we edit a existing calendar page, we can use "form" function to do it.

Thanks! --Roc michael 03:41, 21 September 2007 (UTC)Reply

Could you give me a i18n file on this extension

[edit]

Hi Nad. Could you give me a i18n file on this extension for changing the titles of month and week in the calendar? Than everyone in different language can offers his own language in the file.--Roc michael 02:50, 13 October 2007 (UTC)Reply

I started creating one and then realised that MediaWiki already has the names of all the days and months in all languages, so I just need to adjust the code to use those existing messages. I'll do that as soon as I get some time. --Nad 03:44, 13 October 2007 (UTC)Reply
Test out the latest version and let me know if its working for your language properly. You need to add a parameter to your calendar statement though called dayformat which should be set to %a for abbreviated day names, or %A for full day name. --Nad 07:23, 13 October 2007 (UTC)Reply
Nad. Thank you. Your work is better than I thought and you can see it at here --Roc michael 09:42, 13 October 2007 (UTC)Reply
That looks cool! I can't speak or read Chinese, but I've always loved the look of the characters and have studied 八卦 philosophy from English translations for many years. --Nad 10:10, 13 October 2007 (UTC)Reply
It's interesting. I'd seen the Eight Trigrams at your web pages before. Though, I'v studied The History of Chinese Philosophy at National Open University in Taiwan. I'v never learn things on 易經(The Book of Changes). It's a fantastic ancient philosophy and I could not image that a expert of computer science as you are would be enthusiastic at such an ancient Chinese philosophy. The Characters at the picture SimpleCalendar.png are difference with those at my calendar because the interface you select is ancient Chinese and mine is Tradition Chinese(just contrary to Simple Chinese). I am very happy to know you like the old culture and thank for your help.--Roc michael 13:46, 15 October 2007 (UTC)Reply

I get his crazy error!

[edit]
[Wed Oct 17 12:54:08 2007] [error] [client 10.145.120.31] PHP Fatal error:  
Call to a member function exists() on a non-object in 
/PATH/extensions/SimpleCalendar/SimpleCalendar.php on line 69, referer:
http://DOMAIN/wdev_wiki_new/index.php?title=Simple_Calendar_Extension&action=submit

This error refers to the wfRenderMonth Function and the lines below.

 $class = $title->exists() ? 'day-active' : 'day-empty';
 $url = $title->getFullURL($title->exists() ? '' : $query);

Why am I getting this error?

Thanks, Pete.

What version of PHP/MW? It must mean that the prefix you're using is making an invalid title. I've made the code slightly more solid so that it won't die in this situation, instead it shows the title it was trying to make which may help solve the problem. --Nad 19:46, 17 October 2007 (UTC)Reply
From my Special:Version page: MediaWiki: 1.11.0 PHP: 5.1.6 (apache2handler) MySQL: 4.1.20 Have you uploaded this new more solid version? --Pete 20:57, 17 October 2007 (UTC)
I go tthe new version from the http://www.organicdesign.co.nz/Extension:SimpleCalendar.php Wiki and it works great. Thank You Very Much.! --Pete 21:04, 17 October 2007 (UTC)

Issue with Firefox v 2.0.0.8??

[edit]

I just inherited admin duties on our wiki at work. We have a local user that just upgraded to FF2.08, and now he sees one line of the calendar (not functioning) and code at top. Please help.

Thanks, patrick 10:15, 22 October 2007 (UTC)Reply

If you're seeing the calendar's php code, then that must mean you've missed out an opening php delimiter "<?php" in the extension file. --Nad 21:12, 22 October 2007 (UTC)Reply

Installation - 500 Error

[edit]

I am trying to install the Simple Calendar and am having some errors. I copied the php code and created a file called SimpleCalendar.php in my extensions directory. I then went to my LocalSettings.php and added the line: require_once( "$IP/extensions/SimpleCalendar.php" ); After I save the LocalSettings.php file and refresh my site, I am getting a 500 Error. As soon as I comment that line, and refresh it works again. I have opening and close php tags in the extension file, and I have tried to remove the closing php tag from the extension file (I have one extension that doesn't have the closing tag, since it is closed in Local Settings). Nothing seems to fix the problem, any help would be appreciated. Thanks, Shane

Not really sure why, but I moved it up an area in my LocalSettings.php file and it started to work without any issues. -Shane
500 just means there's a script error - you'll need to turn on error reporting or check the php error log to see exactly what the problem is, let me know that info and I should be able to be of more help. --Nad 21:23, 6 November 2007 (UTC)Reply

Time zone

[edit]

My server uses a different time zone than me, so I always enter the correct offset in my preferences to get around this issue. However, setting your offset in preferences does not affect the calendar. It still uses the server time zone. I think it would be a valuable improvement for this extension to dynamically determine the time zone for each user so the darkened cell used to indicate the current day is always accurate.

Does the author have any plans to implement such a feature?

I have come up with a workaround utilizing the $TZ environment variable in Unix-like systems. Place these lines after <?php in SimpleCalendar.php:

# set the timezone
putenv("TZ=insert time zone here");

Where insert time zone here should be a valid time zone for your system. --Dmnt 04:43, 12 November 2007 (UTC)Reply

Embed calendar in sidebar?

[edit]

Is there a way to embed a calendar (one month) in the sidebar (MediaWiki:Sidebar)? If so, how? If not, are there any plans to make this possible? Thanks! --Dmnt 05:19, 12 November 2007 (UTC)Reply

See Manual:Interface/Sidebar for a skin hack which allows you to put any wikitext in your sidebar article. --Nad 20:22, 12 November 2007 (UTC)Reply
That hack worked great. Sorry I missed that originally. Unfortunately, the calendar is a little too wide to fit into the sidebar with the provided CSS. I fixed it by changing the font-size for table.month td to 7pt. However, I don't want this to be applied to all the calendars I display on my wiki. Should there be a class option for the extension, or am I overlooking something simple? Thanks! --Dmnt 01:26, 13 November 2007 (UTC)Reply
Just wrap the sidebar calendar in a div with a class and add specific css rules for that div --Nad 19:10, 13 November 2007 (UTC)Reply
Works great. Thanks for your help. --Dmnt 20:21, 13 November 2007 (UTC)Reply
How did you do to manage it? --MWMP (talk) 06:41, 10 April 2013 (UTC)Reply

Starting the week with Sunday?

[edit]

Is there a way I can order the week to begin with Sunday? Thanks. --Dmnt 00:21, 15 November 2007 (UTC)Reply

I'd also like to make this change. This missing feature is the only thing standing between perfect and near-perfect for my personal uses. --Billdorr 11:09, 3 January 2008 (UTC)Reply

Near the beginning of wfRenderMonth(), change:

        if (!$d = date('w',$ts = mktime(0,0,0,$m,1,$y))) $d = 7;
        $month = wfMsg(strtolower(strftime('%B',$ts)));
        $days = array();
        foreach (array('M','T','W','T','F','S','S') as $i => $day)
                $days[] = $dayformat ? wfMsg(strftime($dayformat,mktime(0,0,0,2,$i,2000))) : $day;

to:

        $d =  date('w',$ts = mktime(0,0,0,$m,1,$y)) + 1;
        $month = wfMsg(strtolower(strftime('%B',$ts)));
        $days = array();
        foreach (array('S', 'M','T','W','T','F','S') as $i => $day)
                $days[] = $dayformat ? wfMsg(strftime($dayformat,mktime(0,0,0,5,$i,2000))) : $day;

That appears to move Sunday to the leftmost column. --Carlb 15:32, 19 March 2008 (UTC)Reply

This has brought a tear of joy to my eye. Thank you! --Billdorr 10:17, 25 March 2008 (UTC)Reply
I can confirm that this fix creates a week with eight days -- S M T W T F S S. How can we get rid of that extra Sunday? 71.80.132.193 07:51, 25 February 2009 (UTC)Reply
My error log was getting filled with "PHP Deprecated: Function strftime() is deprecated in" messages when using this extension for my mediawiki 1.40+ and PHP version 8.1+. I noticed the code was updated recently for the version MediaWiki Release 1.42 and now the function strftime() was removed and replaced with date() function.
I used the above mentioned code to readjust the week start day to be Sunday instead of Monday and the End Day is now Saturday. This fix continues to work for me. Here is the new format since the php function was changed.
Code section to update from:
$d = date( 'w', $ts = mktime( 0, 0, 0, $m, 1, $y ) );
.
.
foreach ( [ 'M', 'T', 'W', 'T', 'F', 'S', 'S' ] as $i => $day ) {
	$days[] = $dayformat ? wfMessage( date( $dayformat, mktime( 0, 0, 0, 2, $i, 2000 ) ) )->text() : $day;
}
to:
$d = date( 'w', $ts = mktime( 0, 0, 0, $m, 1, $y ) ) +1;
.
.
foreach ( [ 'S', 'M', 'T', 'W', 'T', 'F', 'S' ] as $i => $day ) {
	$days[] = $dayformat ? wfMessage( date( $dayformat, mktime( 0, 0, 0, 5, $i, 2000 ) ) )->text() : $day;
	}
This appears to still work. Thank you

-- ParagP. 13:20, 4 September 2024 (UTC)Reply

Could you give me a argument to switch the order of title and date

[edit]

Hi Nad.

  • I want to switch the order of title and date in a calendar.For example,
I can get a calendar like this "Mic/2007/03/09" by using followed description.
{{#calendar: year=2007|format=%Y/%m/%d |dayformat=%a| title=Mic |titlefirst }}
And I can get a calendar like this "2007/03/09/Mic" by using followed description.
{{#calendar: year=2007|format=%Y/%m/%d |dayformat=%a| title=Mic |datefirst }}
Could you give me a hand, please!--Roc michael 00:55, 2 December 2007 (UTC)Reply

Just include the title as part of the format string and it will be made to appear wherever you like. For instance:

{| align=right id=toc style="margin-left: 15px;"
|- 
|{{#calendar: month= 10 |format = %e de Outubro | dayformat = %a}}
|- 
|align="center" bgcolor="#e0e0e0"|
[[Setembro|Set]] - '''[[Outubro]] [[{{CURRENTYEAR}}]]'''  - [[Novembro|Nov]]<br>[[Lista de dias do ano|Todos os dias]]
|}

would display an October calendar with the days named "1 de Outubro" ... "31 de Outubro". The "month=10" indicates the calendar is for October of the current year, the "format = %e de Outubro" is the link to the individual day pages (such as "26 de Outubro", year not specified) and "dayformat = %a" is used to force the days-of-week to be displayed in the wiki's local language (for instance, "Seg Ter Qua Qui Sex Sáb Dom" on a Português-language wiki) instead of using the non-localisable defaults "M T W T F S S". --Carlb 06:08, 19 March 2008 (UTC)Reply

MistyLook Skin

[edit]

This great extension is just what I was looking for-thanks! Anyone have any suggestions on why the CSS doesn't work with the MistyLook skin? It work for several others for me. What change do I need to make? THW

Is the site public so I can see the problem? --Nad 02:50, 27 December 2007 (UTC)Reply

Private. It looks like it does before the css on the extension page is used. On monobook the tasteful, smaller calendar appears. In MistyLook the calendar is large, with the new page arrow on every date that doesn't have a page. THW

I'd have to know what the Misty skin is doing differently to know what css to change. You could try removing the #bodyContent bit in the calendar css rules and see if that fixes it, maybe Misty doesn't use that making those rules not activate. --Nad 08:01, 27 December 2007 (UTC)Reply

common.css problem

[edit]

I've got the extension installed and running, but I'm having a problem with common.css. I do not have a file of this name (or monobook.css) anywhere within the wiki, so I created it as ../skins/common/common.css. I added the recommended calendar code, but the calendar is rendered plain with days appearing as external links. I also tried installing Nad's Extension:CSS to no avail. Thanks for any help!

It's not a file, it's an article called MediaWiki:Common.css --Nad 22:23, 5 February 2008 (UTC)Reply
It is possible to add it to a file ./skins/common/shared.css; if the same skins and extensions are shared between multiple wikis on the same server this may allow them all to be configured as one. In most cases, though, it is better to use MediaWiki:Common.css as anything in any of the distribution files is prone to be overwritten during upgrades. --08:22, 19 March 2008 (UTC)

No year events

[edit]

Is it possible to create a calendar that does not have a year associated with it. This would be useful for noting things that happen every year on the same date, for example birthdays. Servel333 19:02, 6 May 2008 (UTC)Reply

Formatting title URLs

[edit]

Hullo. Firstly, great extension.

Secondly, is there any way to change how the title URLs are formatted? I have a namespace I use for events and days (Event:), but putting that as the argument for title results in dates that look like Event:/21_November_2024, but I don't want the slash after Event:... Any help please? Omega234 17:32, 24 June 2008 (UTC)Reply

Possible bug and correction

[edit]

I had a problem where wfRenderCalendar failed to identify the arguments supplied to the calendar. It seemed that a whitespace was included in front of the key-name. The following code fixed the problem for me:

if (preg_match('/^\\s*(.+?)\\s*=\\s*(.+)$/',$arg,$match)) $argv[$match[1]]=$match[2];

rather than:

if (preg_match('/^(.+?)\\s*=\\s*(.+)$/',$arg,$match)) $argv[$match[1]]=$match[2];

Regards, Sebastian

Help MediaWiki 1.13.0

[edit]

Did all the normal install procedures, and on my test page all I get a link that reads:

Template:Calendar: title="TaskDiary"

Clicking that link creates a new page "Editing Template:Calendar:"

Thank you,

Dennis Groves

Have you missed out the # character? - {{#calendar:bla bla}} --Nad 01:16, 30 October 2008 (UTC)Reply

Display only current month

[edit]

Hi there, I would like to show the calendar in the month view, but for the current month only. What do I need to do? So month = currentmonth instead of month = 11...

Cheers, Christian

I tried this too and found a way how to manage it:
{{#calendar: month={{CURRENTMONTH}} }}
It's important that you write in upper letters 'CURRENTMONTH' because in other cases it will not work. I'm using it on the version 1.13.5.
--LudiPurger 15:39, 19 May 2009 (UTC)Reply

Now, Is it possible to display the previous and following month along with the current month? dan 16 October 2012

Installed well, then fatal error when trying to access Special Pages list

[edit]

I get: Fatal error: Cannot redeclare wfcalendarlanguagegetmagic() (previously declared in /absolute_path_to_the_wiki/extensions/SimpleCalendar.php:24) in /absolute_path_to_the_wiki/extensions/SimpleCalendar.php on line 27

I get this error only when running update.php --Goadeff (talk) 18:12, 18 June 2012 (UTC)Reply
[edit]

I have followed all steps to install this extension, I can see the calendar but there are no links in date of the calendar. Any idea why is it so? i m using 1.20wmf3 version of mediawiki.

No calendar rendered after upgrading to MediaWiki 1.15.5

[edit]

After upgrading my Ubuntu Server to 12.04 LTS, and thereby upgrading MediaWiki to 1.15.5 and PHP to 5.3.10, the calendar is no longer rendered. I am using Simple Calendar (Version 1.2.4, 2007-10-18). If I write:

{{#calendar:}}

then that is exacly what is displayed on the page, no calendar is rendered. (As such, the symptoms are the same as mentioned above.) I have checked that MediaWiki runs SimpleCalendar.php by inserting syntax errors in the file. If syntax errors are inserted e.g. in the function wfRenderCalendar, MediaWiki can not display any pages. Any ideas to remedy this problem? -- User:Persteffen 2012-08-09

Solution

[edit]

Replacing

$wgExtensionFunctions[] = 'wfSetupSimpleCalendar';

with

$wgHooks['ParserFirstCallInit'][] = 'wfSetupSimpleCalendar';

apparently solves this problem in MediaWiki 1.15.5. -- User:Persteffen 2012-08-25

[edit]

I'm a VERY new (2 months) wiki admin and am just learning the ropes. I have SimpleCalendar installed and it renders without issue, but the dates appear as bracketed, un-clickable text instead of creatable pages. I've browsed numerous sites to see what this could be but nothing seems to address this specific problem. Any nuggets of wisdom for someone just starting out? MediaWiki 1.23.0. wraith_tjw

Change SimpleCalendar Page Width and Each Column Date Width

[edit]

Hi !

I am new in mediawiki. I have installed SimpleCalendar extension.

How do I change SimpleCalendar Page Width and Each date width? The page in Extension:SimpleCalendar said that "You can add new rules to adjust the tables to your own needs" but it doesn't give any detail instruction to change the page width and each column date width.

Anyone can help on this matter?

Thanks Fendy

01mina10cities (talk) 13:17, 14 August 2022 (UTC)Reply

How to get the months to display their own link?

[edit]

I want every month to link to a respective page as well. For example if I have a calendar for 1983, I want the "January" in the header to be a link to January 1983. How to do that?

I assume I could change the code in the extension's Setup.php, but I don't know what to actually add for it to render a link for each month. Rasputin 93 (talk) 22:09, 8 April 2023 (UTC)Reply