Calendar

(Różnice między wersjami)
Skocz do: nawigacji, wyszukiwania
Linia 1: Linia 1:
<nowiki><code>Simple calendar extension for mediawiki.
+
<nowiki>Simple calendar extension for mediawiki.
 
+
Released under the GPL. Copyright 2005 by Christof Damian
+
Released under the GPL. Copyright 2005 by Christof Damian
(christof@damian.net)
+
(christof@damian.net)
 
+
I wrote this for http://krass.com/ where I have simple event
+
I wrote this for http://krass.com/ where I have simple event
calendar. Examples are at http://krass.com/wiki/Current_events and
+
calendar. Examples are at http://krass.com/wiki/Current_events and
http://krass.com/wiki/Calendar
+
http://krass.com/wiki/Calendar
 
+
The idea was to keep the calendar as simple as possibe and leave all
+
The idea was to keep the calendar as simple as possibe and leave all
the editing and page creation to mediawiki. It doesn't require any new
+
the editing and page creation to mediawiki. It doesn't require any new
database tables or files.
+
database tables or files.
 
+
To use this on your mediawiki site, copy the php files into your
+
To use this on your mediawiki site, copy the php files into your
extension directory and put this into your LocalSettings.php:
+
extension directory and put this into your LocalSettings.php:
 
+
  include("extensions/Calendar.php");
+
  include("extensions/Calendar.php");
 
+
Then you can use the calendar on any page like this:
+
Then you can use the calendar on any page like this:
 +
 
 +
<calendar>
 +
name=krass
 +
view=year
 +
</calendar>
 +
 +
The parameters work like this:
 +
 +
"view"
 +
        can be "days" days from today, "rdays" (reverse days),
 +
        "week","month","threemonths" and "year" (default).
 +
"name"
 +
        is a name for the calendar and changes the names of the day pages.
 +
"format"
 +
        defaults to '%name_%year_%month_%day' and describes the names
 +
        of the day pages.
 +
"formattitle"
 +
        formats the titles in today/days/week view
 +
"day","month","year"
 +
        you can specify the date of the calendar, it defaults to today.
 +
        currently this doesn't work with "view=week"
 +
"date"
 +
        this takes a php strtotime ( http:://www.php.net/strtotime )
 +
        option and overrides the "day","month","year" option
 +
        above. examples are:
 
    
 
    
<calendar>
+
        date="+1 week"
name=krass
+
        date="next monday"
view=year
+
        date="+7 days"
</calendar>
+
"weekstart"
 
+
        week starts on 1=monday ... 7=sunday. default is 1
The parameters work like this:
+
"skipempty"  
 
+
        skip empty days in week view
"view"  
+
"showempty"
      can be "days" days from today, "rdays" (reverse days),
+
        show inivitation to add entries when a day is empty, default is 1
      "week","month","threemonths" and "year" (default).
+
"weekformat"
"name"  
+
        format of the week, days, rdays and today view.
      is a name for the calendar and changes the names of the day pages.
+
"format"  
+
        - "text" (default), simple wikitext format
      defaults to '%name_%year_%month_%day' and describes the names
+
        - "list" a layout that uses <dl>, <dt> and <dd> (definition
      of the day pages.
+
          list) tags with the 'calendar' class added to the <dl>
"formattitle"
+
          tag and the calendarToday class to the span tag that
      formats the titles in today/days/week view
+
          contains the weekday title. Merged calendar
"day","month","year"
+
          entries are added as sub lists with the name part of the
      you can specify the date of the calendar, it defaults to today.
+
          merged calendar as a link to the page of that
      currently this doesn't work with "view=week"
+
          calendar.
"date"
+
        - "table" a layout that uses table tags with also the name of
      this takes a php strtotime ( http:://www.php.net/strtotime )
+
          merged calendars as a link to the page of those
      option and overrides the "day","month","year" option
+
          calendars. The 'calendar' class is added to the table tag and
      above. examples are:
+
          the 'calendarToday' class to the span tag that contains the
 +
          weekday title.
 +
 +
format & formattitle accept these substitutions:
 +
        %name
 +
        %day,%month,%year
 +
        any php date() substitution prefixed with '%', like '%m','%d','%Y'
 +
 +
 +
 +
Thanks go to these contributors:
 
   
 
   
      date="+1 week"
+
- Amador amador@tiscali.nl (localization, weekformat, showempty)
      date="next monday"
+
- Austin Che (cache fix)
      date="+7 days"
+
- Dexter Samida <dextersamida@gmail.com> (today view)
"weekstart"
+
</nowiki>
      week starts on 1=monday ... 7=sunday. default is 1
+
"skipempty"
+
      skip empty days in week view
+
"showempty"
+
      show inivitation to add entries when a day is empty, default is 1
+
"weekformat"
+
      format of the week, days, rdays and today view.
+
 
+
      - "text" (default), simple wikitext format
+
      - "list" a layout that uses <dl>, <dt> and <dd> (definition
+
        list) tags with the 'calendar' class added to the <dl>
+
        tag and the calendarToday class to the span tag that
+
        contains the weekday title. Merged calendar
+
        entries are added as sub lists with the name part of the
+
        merged calendar as a link to the page of that
+
        calendar.
+
      - "table" a layout that uses table tags with also the name of
+
        merged calendars as a link to the page of those
+
        calendars. The 'calendar' class is added to the table tag and
+
        the 'calendarToday' class to the span tag that contains the
+
        weekday title.
+
 
+
format & formattitle accept these substitutions:
+
        %name
+
        %day,%month,%year
+
        any php date() substitution prefixed with '%', like '%m','%d','%Y'
+
 
+
 
+
 
+
Thanks go to these contributors:
+
 
+
- Amador amador@tiscali.nl (localization, weekformat, showempty)
+
- Austin Che (cache fix)
+
- Dexter Samida <dextersamida@gmail.com> (today view) </code></nowiki>
+

Wersja z 14:42, 30 maj 2006

Simple calendar extension for mediawiki. Released under the GPL. Copyright 2005 by Christof Damian (christof@damian.net) I wrote this for http://krass.com/ where I have simple event calendar. Examples are at http://krass.com/wiki/Current_events and http://krass.com/wiki/Calendar The idea was to keep the calendar as simple as possibe and leave all the editing and page creation to mediawiki. It doesn't require any new database tables or files. To use this on your mediawiki site, copy the php files into your extension directory and put this into your LocalSettings.php: include("extensions/Calendar.php"); Then you can use the calendar on any page like this: <calendar> name=krass view=year </calendar> The parameters work like this: "view" can be "days" days from today, "rdays" (reverse days), "week","month","threemonths" and "year" (default). "name" is a name for the calendar and changes the names of the day pages. "format" defaults to '%name_%year_%month_%day' and describes the names of the day pages. "formattitle" formats the titles in today/days/week view "day","month","year" you can specify the date of the calendar, it defaults to today. currently this doesn't work with "view=week" "date" this takes a php strtotime ( http:://www.php.net/strtotime ) option and overrides the "day","month","year" option above. examples are: date="+1 week" date="next monday" date="+7 days" "weekstart" week starts on 1=monday ... 7=sunday. default is 1 "skipempty" skip empty days in week view "showempty" show inivitation to add entries when a day is empty, default is 1 "weekformat" format of the week, days, rdays and today view. - "text" (default), simple wikitext format - "list" a layout that uses <dl>, <dt> and <dd> (definition list) tags with the 'calendar' class added to the <dl> tag and the calendarToday class to the span tag that contains the weekday title. Merged calendar entries are added as sub lists with the name part of the merged calendar as a link to the page of that calendar. - "table" a layout that uses table tags with also the name of merged calendars as a link to the page of those calendars. The 'calendar' class is added to the table tag and the 'calendarToday' class to the span tag that contains the weekday title. format & formattitle accept these substitutions: %name %day,%month,%year any php date() substitution prefixed with '%', like '%m','%d','%Y' Thanks go to these contributors: - Amador amador@tiscali.nl (localization, weekformat, showempty) - Austin Che (cache fix) - Dexter Samida <dextersamida@gmail.com> (today view)

Osobiste
Przestrzenie nazw
Warianty
Działania
HLDS.pl - Menu:
Inne
IRC
Inne sekcje:
Znajomi:
Narzędzia