User talk:Simsong/Calendar

Feature Request
Fantastic extension, Hex2bit!

I wonder if it's possible to add support for events that span multiple dates?

Thanks!

Dhenderson 16:35, 13 February 2007 (UTC)

Hi Hex2bit

This looks like a very useful extension. Is there a test wiki where I can see it in action?

--HappyDog 01:33, 20 October 2006 (UTC)

Happy Happy Joy Joy
Thanks for the great extension. Its really easy to use! Thanks for sharing.--Magick 07:44, 7 December 2006 (UTC)

Installation
I would like more details regarding how to setup this Calendar in Mediawiki. I have added the files to the extensions folder as mentioned, but I am not sure how I need modify the   file to include the calendar in the wiki.

I have tried just using. Once I save this change, the wiki pages no longer load, they appear as blank white pages.

156.77.108.71 19:37, 20 October 2006 (UTC)

Make sure you add this line to the end of. 205.210.232.62 16:23, 13 February 2007 (UTC)

How do you make it not say event in the calandar view? --67.87.142.233 03:27, 23 October 2006 (UTC)

Looks like a good tool, i did have a couple questions:


 * I tried changing the code to reference extensions/Calendar/ instead of just extensions/, but while it displayed I got Extensions/Calendar/CalendarAdjust.php does not have anything on it. It says There is currently no text in this page, you can search for this page title in other pages or edit this page.
 * I tried also the default extensions directory, still no go. Any ideas?

Answer (working 1.6.8, Jan. 6 2007): add the following lines to your localsettings.php: include("extensions/Calendar.php"); include("extensions/CalendarAdjust.php"); When you change months/years, Mediawiki will momentarily display the "No text" message; wait and it will display the required month/year.

--- Hi Hex2bit, nice extension! I do have some tips though (and some answers for the above questions :

- @ the last question : To get this calendar working properly, you should adjust the way the URL is shown. Default it is set to , but it should be set to. Change it in Localsettings.php and it should work fine.

- @ 156.77.108.71 : to load extensions, you should add the following in LocalSettings.php:

- @ 67.87.142.233 : In Calendar.php there's this string:. Change it to  and it will say "Add ..."

Ah, now I know what you mean. You should start each entry with, that way it will show your title.

- @ Hex2bit : I think it is better to make the extension 'path' independant, so people can place a complete directory in /extentions instead of cluttering it up with a lot if files.

cheers,

Davidem 22:11, 5 November 2006 (UTC)

Special Pages
I love it, except for one thing: When the calendar event pages show up in my Special:Newpages I'm getting

Notice: Undefined offset: -2 in /home/danlyke/mediawiki-1.8.2/languages/Language.php on line 354

Which I believe comes from something about those event pages having a funky date. Just to make things even more complex, I'm running on PostgreSQL, so there may be an interaction with default dates.

If this bothers me enough I'll drop a patch on you at some point, but I'm a PHP n00b and haven't started to dig too deep yet.

DanLyke

Hello, the calendar loads fine for me and looks great but when I click to change month, year or add event it dosent work, just links to "The Page Cannot Be Found" ??

I see what there error is, it is in the CalenderAdjust.php path

"http://www.humbolpedia.com/edia.com/extensions/CalendarAdjust.php?day=6&month=11&year=2006&title=Current_events&name=&path=

Note the edia.com repeating.

I dont know how to fix this though.
 * Hi. I had the same prob. Was kinda in a hurry so just went to line 412 in Calendar.php and hardcoded it to:

$tag_addEvent = "month . "&year=" . $this->year . "&title=" . urlencode($this->title) . "&name=" . urlencode($this->name) . "&path=" . urlencode($wgScriptPath) . "\">Add Event";
 * Change http://www.mydomain.com/wiki/extensions/CalendarAdjust.php so it fits you domainename and path to wiki. Ugly but it worked for me.

Extension namespace
Hi Hex2bit - as there is now a dedicated Extension: namespace, would you consider moving your calendar extension there? I would recommend giving it a more distinctive name than just 'Extension:Calendar' to avoid confusion (as I know there are several calendar extensions out there), but that's your prerogative :-) --HappyDog 00:29, 29 November 2006 (UTC)

Wrong link
Great tool, however I am having the same issue as another user, a portion of the URL duplicated: http://www.ecuaserver.net/wiki/iki/extensions/CalendarAdjust.php?day=8&month=1&year=2007&title=Calendar&name=Test_calendar&path=%2Fwiki

The extra "/iki" should not be there, if I fix the link manually it works and I can add events or browse to other months/years

Compliments
This is one of many extensions I have installed on my wiki, but it's the first that runs without any problems just as it is supposed to. Just great! Thanks a lot!

URL Link to CalendarAdjust.php is incorrect
The calendar shows up just fine, however, when I try to add an event I get "Page not found". In addition the URL Link is incorrect, it reads http://www.themusicrevolution.com/wiki/mediawiki/21/user/1049983/htdocs/wiki/mediawiki/extensions/CalendarAdjust.php?day=29&month=1&year=2007&title=Creating_a_Calendar&name=YOUR_BAND_NAME_Calendar&path=%2Fwiki%2Fmediawiki and it seems to be adding extra "Htdocs/wiki/mediawiki" much like the person pointed out with the extra link above. How can I change the path so that it looks for the CalendarAdjust.php in the correct folder?

It cann't work nicely withAuth_phpbb.php
It cann't work nicely with Auth_phpbb.php. When I tried to add an new event. I would see the error code following:

Warning: require_once(./extensions/Auth_phpbb.php) [function.require-once]: failed to open stream: No such file or directory in  C:\AppServ\www\mediawiki\LocalSettings.php on line 192

Fatal error: require_once [function.require]: Failed opening required './extensions/Auth_phpbb.php' (include_path='C:\AppServ\www\mediawiki; C:\AppServ\www\mediawiki/includes;C:\AppServ\www\mediawiki/languages;. ;C:\php5\pear') in C:\AppServ\www\mediawiki\LocalSettings.php on line 192


 * WIN XP
 * AppServ 2.5.7
 * Apache Web Server Version 2.2.3
 * PHP Script Language Version 5.1.6
 * MySQL Database Version 5.0.24a


 * Could anybody give me a hand.

--Roc michael 16:09, 21 January 2007 (UTC)

Questions
Hi,

I've some questions.
 * Is it possible to remove the event once it is added? I tried and couldn't and I think this would be a good feature.
 * Is there a way to have all the content of an event displayed in an event window? (not only a title)
 * Is it possible to change event window width?

You can answer here and on my User_talk:Aretai
 * I'd like to write my own extension based on your code is it possible? Of course I'd mention you.

Regards, Aretai 11:00, 6 February 2007 (UTC)

Some Answers
@Aretai: Here are some of the answers you're looking for :

1 Yes, it is possible to remove an event, you'll have to be sysop or admin to do that. Log in as such, go to the event and you'll notice a 'delete' tab at the top...

2 Well, I thought I had an answer to this one, but what I came up with did not work...

3 This is also possible, but only on a 'daybasis'. In calendar_template.html you can change the width of each day. Search for witdth and change the values at .calendarSunday/Monday/etc...

cheers,

davidem

Hi Hex2bit,

first of all thanks for that easy-to-work-no-causing-problem extension which I installed on and adapted to my still young wiki ZonaCostera.Info. My questions are: why do I see not the titles but only Event 1 etc on the respective event page, even tough having properly used sections titles? Should the event title not show up also here and not only in the calendar? And: is there a way to have all events (of one calendar) summarized on one event page, or at least those for one day?

Thanks for your kind atention to this! --Horst Salzwedel 02:44, 8 March 2007 (UTC)

Only blank white pages
I just installed your Calendar extension but I only get blank white pages. The log files say nothing about crashes or something. Are these versions tested anywhere? Thanks!
 * MediaWiki: 1.9.3
 * PHP: 5.0.5 (cgi-fcgi)
 * MySQL: 4.0.15

Could I creat a page with title "test/Calendar "IT Calendar" (03-01-2007) - Event 1"

 * The date format included in article title name must be such as 03-03-2007 or 2007-03-03.
 * If It could be possible. Then we could use dpl to collect the pages generated by the calendar with a better order.

Add Event - bad URL
First, I need to tell you that this is the best calendar function for a wiki out there (here?). It Suits my needs perfectly, looks great, but I just cannot get it running. If anyone can help, please do... So: My setup is FC7T2 with all the required tools installed.
 * Mediawiki is installed as /var/mediawiki
 * Httpd is installed as /etc/www/html
 * I have a wiki.conf located in /etc/httpd/conf.d/ that contains 1 line: Alias /wiki /var/mediawiki.
 * The Calendar package is located in extensions/
 * LocalSettins has the require_once extensions/Calendar.php at the end, and $wgScriptPath = /wiki

What I get is a broken url that has an extra 'awiki' stuck in it. So trying to take apart Calendar.php where the URL is created, I mate a test script like this. It is placed in /var/mediawiki/extensions and called directly ( http://domain.name/wiki/extensions/test.php) with this result:

test.php: PHP Test  local path'; echo 'ScriptFileName=> '. $_SERVER["SCRIPT_FILENAME"]; echo 'ScrriptName=> '. $_SERVER["SCRIPT_NAME"]; $LenScriptFileName = strlen($_SERVER["SCRIPT_FILENAME"]); echo 'LenScriptFileName=> '.$LenScriptFileName; $wgLocalPath = str_replace("\\", "/", substr($_SERVER["SCRIPT_FILENAME"], 0, strlen($_SERVER["SCRIPT_FILENAME"]) -   strlen($_SERVER["SCRIPT_NAME"]))); echo 'LocalPath=> '.$wgLocalPath; echo 'StringLenScriptName=> '.strlen($_SERVER["SCRIPT_NAME"]); $calendarExtensionPath = str_replace("\\", "/", substr(dirname(__FILE__), strlen($wgLocalPath))); echo 'CalanderExtensionPath=> '.$calendarExtensionPath; echo 'Need CalendarExtensionPath=> /wiki/extensions'; ?>

Result: local path is => local path ScriptFileName=> /var/mediawiki/extensions/test.php ScrriptName=> /wiki/extensions/test.php LenScriptFileName=> 34 LocalPath=> /var/medi StringLenScriptName=> 25 CalanderExtensionPath=> awiki/extensions Need CalendarExtensionPath=> /wiki/extensions

Not sure of the reasons for what is going on here. So without solving it this way, I hard coded the correct paths. Not the URL is not wrong, but I go to edit page extensions/CalendarAdjust.php, and not the correct page.

So if anyone can advise me on what I have wrong, or ask some pointed questions, I would be grateful. Until then, I'm stuck.

Update So I kept at it, went back to it because its the best calendar. I decided to hardcode several locations in Calendar.php and CalendarAdjust.php. In Calendar.php: line 135 // path to the root of the web server line 136 $wgLocalPath = $wgScriptPath;    #'/wiki'; # Comment out original $wgLocalPath statement on line 137 line 258 // the path to this extension (install location line 259	$calendarExtensionPath = $wgLocalPath.'/extensions';    #comment out original $calendarExtensionPath.

In CalendarAdjust.php line 5 // determine the local base path to this wiki (rather than using server variable DOCUMENT_ROOT) line 6 $wgLocalPath = $wgScriptPath;          # Comment out original $wgLocalPath statement line 7 $local_wiki = '/var/mediawiki';     # new variable path = mediawiki location line 27 require_once( $local_wiki. '/includes/Defines.php' );	   # $local_wiki was $wgLocalPath. $_GET["path"] line 29 require_once( $local_wiki. '/LocalSettings.php' );     # $local_wiki was $wgLocalPath. $_GET["path"] line 31 if (file_exists($local_wiki. '/includes/ProfilerStub.php')) { line 32 	require_once( $local_wiki. '/includes/ProfilerStub.php'); line 33 } #    $local_wiki was $wgLocalPath. $_GET["path"] (2 locations) line 35 require_once( $local_wiki. '/includes/Setup.php' );    # $local_wiki was $wgLocalPath. $_GET["path"]

As I said in the previous update,
 * the wiki is located at /var/mediawiki;
 * wiki.conf ( http config file) contains Alias /wiki /var/mediawiki
 * my URL on main page shows: http://domain.name.co/wiki/index.php/Main_Page

Mjf55 04:36, 11 April 2007 (UTC)

Parse Wiki code in title
Hi Hex2bit,

Back again with a question this time.

How do I make it possible to parse Wiki/html code in the title? For example, the title is == Title== I would like to have it appear as Title in the calendar. Or with HTML to provide colors: == Title == which would show Title in the calendar.

If that would be possible, great :)

Cheers,

Davidem

Partly fixed...
Hi, back again... tinkered with the script myself and figured out how to use some color. We needed an easy way to see if something needs to be prepared for an event, so I adjusted the following to Calendar.php:* Somewhere near line 422 where links are written out, I changed $tag_eventList .= "". $this->getArticleSummaryLink($events[$k]). ""; to $tag_eventList .= "getArticleSummaryLink($events[$k]) . " ";

and further below at the getArticleSummaryLink function (around line 540), I added these if statements:

if ($linkText{0} == "!") { $linkBgClr = "tomato"; }  elseif ($linkText{0} == "*") { $linkBgClr = "lightgreen"; }  else    { $linkBgClr = "yellow";

and changed $text = ''. htmlspecialchars($linkText). '';

to $text = $linkBgClr. '">' . htmlspecialchars($linkText) . '';

This way I can easily generate a background color to emphasize the status of an event by adding a character befor the title (like ! or *). For example a title like == ! Title== will be seen in the calendar as Title. A different character gives a different color (if defined in the if statements off course). For the moment, this works alright for us...

cheers, Davidem

re. Partly fixed...
Parse error: parse error, unexpected T_VAR in D:\AppServ\www\testwiki\extensions\Calendar\Calendar.php on line 647 The code where the line 647 is var $month = 1;
 * I'v tried it ,but it didn't work.

The AppServ Open Project - 2.5.7 for Windows
 * 1)  Apache Web Server Version 2.2.3
 * 2) PHP Script Language Version 5.1.6
 * 3) MySQL Database Version 5.0.24a

--Roc michael 10:57, 16 April 2007 (UTC)

--davidem 15:08, 19 April 2007 (UTC)
 * Strange, because my tweak doesn't do anything with that part of the script. Are you sure all brackes, apostrophs and semicolons close correctly?