Page 1 of 2

[resolved] Calendar personnalised with 2 pages ...

Posted: Tue Sep 05, 2006 2:24 pm
by tynmar
Hi,

I'm happy (and proud) tu use CMS Made simple. I'm french, I want to do something very simple. I can do that with a simple database & php but with templates, I'm lost.

Here is what I want : 2 pages with events sorted by date :
- the first page will show the events in the futur
- the second page will show the events passed

For example :

Futur events :
10 september 2006 > Faire la fête toute la nuit

... 1 week later >>

Passed events :

10 september 2006 > Faire la fête toute la nuit


Is there a module which could do this or will I do this by myself ?

PS : excuse my frenglish ..


Thanks a lot

Re: Calendar personnalised with 2 pages ...

Posted: Tue Sep 05, 2006 3:13 pm
by calguy1000
Check out the calendar module, I'm fairly confident that with the calendar module you can do most of what you want.  and it wouldn't take much to add this functionality if it's not there already.

Re: Calendar personnalised with 2 pages ...

Posted: Wed Sep 06, 2006 11:32 am
by tynmar
Ok, I worked all night.  :'( I dont know PHP object & method ... I can't learn it because I have to do this before wednesday, time missing.
I began to create a module with module maker, & skeleton. I am really stupid and I don't understand at all how to do something really simple.

I want this :

Page1
Image

Page2
Image

This is not moon ? I can't do this with calendar because you can't show events of 2 - 3 or more months in the same time.

(ps : I hope you can understand my approximative english :D )

thanks to give me the way to realize this

Re: Calendar personnalised with 2 pages ...

Posted: Wed Sep 06, 2006 5:16 pm
by Dr.CSS
You can use the calendar mod. to do this, these are the parameters it takes...
note the display options, the upcominglist one can be used for the future and all the rest can be called with other parameters...

What Parameters Exist?
display Acceptable values:
"calendar" - displays events for the current month in a traditional grid. Inclues links to prev. and next months.
"list" - displays events for the current month as a list. Includes links to prev. and next months.
"yearlist" - displays events for the current year in a list. Includes links to prev. and next years.
"upcominglist" - displays all upcoming events. No prev/next links.
Defaults to "calendar" (optional)
category Only display items for that category. Leaving unset, will show all categories. Note that you can limit to muliple categories by separating each one with a comma.(optional)
month Display entries for a particular month. If year is not set, then the current year is assumed. This option only works if display is set to "list" or "calendar". (optional)
year Display entries for a particular year. This option only works if display is set to "list" or "calendar". (optional)
limit Set to the maximum number of events to display. This option only works if display is set to "list" or "upcominglist". (optional)
first_day_of_week Set to the first day of the week as a number between 0 and 6 (0 = Sunday). Default is 1 (Monday). This option only works if display is set to "calendar". (optional)
summaries Set to 1 to display the summary information or 0 to not display it in calendar mode. Default is 1. (optional)
detail Set to 1 to display the detail information or 0 to not display it in list mode. Default is 0. (optional)
table_id Id to set for this calendar or list. This is useful for applying CSS styling. Default is "calendar-". (optional)
date_format Format to display the event's date (as used in strftime()). Default is "%d/%b/%Y". (optional)
use_session Use a session variable to store the current month of the calendar. Default is ture. (optional)
compact_view Set to 1 to hide the navigation links. Helpful to show current month's events on the home page. Default is 0. (optional)
reverse Set to true to display events in reverse chronological order. Applicable to list and upcominglist displays. Default is false. (optional)

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 1:26 am
by Greg
Put this in the 'List Template'

{if $compact_view neq 1}
{$lang.prev}
{if $day > 0}{$day} {/if}{$month_names[$month]} {$year}
{$lang.next}{/if}
Event{$lang.date}Summary
{foreach from=$events key=key item=event}

    {$event.event_title}
   

{assign var=month_number value=$event.event_date_start|date_format:"%m"}
{assign var=end_month_number value=$event.event_date_end|date_format:"%m"}
{if $event.event_date_start == $event.event_date_end || $event.event_date_end == ""}
{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y"}
{else}
{if $event.event_date_start|date_format:"%d%m%Y" == $event.event_date_end|date_format:"%d%m%Y"}
{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%H:%M"}
{else}
{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%d"} {$month_names[$end_month_number]} {$event.event_date_end|date_format:"%Y %H:%M"}
{/if}
{/if}
   
   
{if $event.event_summary !="" && ($detail != 1 || ($event.event_details =="" ||  $event.event_details == "
"))}
{$event.event_summary}
{/if}
   
   
{/foreach}

{if $return_url != ""}
{$return_url}
{/if}

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 9:30 am
by tynmar
Ok,

thank you so much. That works very well. But now I want to show the passed event. Is there a param like display="downcominglist"   ;D (that doesn't work).

Will I need to modify or create a template ?
I suppose I have to change this :
{foreach from=$events key=key item=event}
- - - -
{/for}


I'm not a template master  :D . Thank you for your help.

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 12:55 pm
by Greg
How about a list of events by year
Create a page with this tag:

Code: Select all

{cms_module module='Calendar' table_id='cmscaly' display='yearlist' first_day_of_week='0'}

And a list by month
Create a page with this tag:

Code: Select all

{cms_module module='Calendar' table_id='cmscalm' display='list' first_day_of_week='0'}

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 1:07 pm
by calguy1000
In SVN I Modified Calendar to have a display=pastlist parameter.

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 1:24 pm
by tynmar
calguy1000 wrote: In SVN I Modified Calendar to have a display=pastlist parameter.
Can you explain more please. This is really intersting !  :)  How can I do this, what is SVN ?

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 2:20 pm
by Pierre M.
SVN is the development version of cmsms. (alpha software).
See http://wiki.cmsmadesimple.org/index.php ... vn_version
Our devs are responsive, aren't they ?-)

PM

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 2:46 pm
by tynmar
I downloaded the SVN with this command (I'm with linux ubuntu)
svn checkout http://svn.cmsmadesimple.org/svn/calendar
Then I have 3 folders "branches", "tags" & "trunk".

What should I do now ?
I took the version "0.7alpha2" and uploaded it. But the  display=pastlist  does not work. Then I took all the files in the Trunk folder and uploaded it. Then, I got this :
Fatal error: Call to undefined function: createevent() in /home/tynmar/www/centreduson/modules/Calendar/method.upgrade.php on line 46

I don't know where I'm wrong. Thanks a lot for your help.

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 2:57 pm
by calguy1000
svn checkout http://svn.cmsmadesimple.org/svn/calendartrunk Calendar

That'll do what you want.

BTW, are you using CMS Made simple 1.0B6 ?

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 3:05 pm
by tynmar
svn: Échec de la requête PROPFIND sur '/svn/calendartrunk'
svn: Could not open the requested SVN filesystem

??? ??? ???
I only use linux svn command. 'dont understand...

I'm on cmsms 0.13. Once downloading file with svn, what should i do ? I have tu Paste the Calendar folder into my Module folder of cmsms ?


Edit : I think you wanted to write /svn/calendar/trunk. I can not install this. When I click Install in module, I've got that :
Fatal error: Call to undefined function: createevent() in /home/martyn/www/centreduson/modules/Calendar/method.install.php on line  77

Re: Calendar personnalised with 2 pages ...

Posted: Thu Sep 07, 2006 4:50 pm
by alby
tynmar wrote: svn: Échec de la requête PROPFIND sur '/svn/calendartrunk'
svn: Could not open the requested SVN filesystem

??? ??? ???
I only use linux svn command. 'dont understand...
try:

Code: Select all

svn checkout http://svn.cmsmadesimple.org/svn/calendar/trunk  Calendar
Alby

Re: Calendar personnalised with 2 pages ...

Posted: Sat Sep 09, 2006 6:49 am
by tynmar
I'm sorry, I'm really really really really stupid.  :-\
Please, read all this
- The SVN work perfectly. OK
- I don't work on my server, so I must upload the folder Calender on my server (in the modules folder) OK
- I go in my cmsms admin, in the module section. OK
- I see Calendar (all right), but Calendar is not installed. I cannot use Calendar if this is not installed !
- I click "Install" > error !!!

Here is the error I see :

Code: Select all

Fatal error: Call to undefined function: createevent() in /home/martyn/www/centreduson/modules/Calendar/method.install.php on line  77
In this file, we can see the from line 77 :

Code: Select all

$this->CreateEvent('EventAdded');
$this->CreateEvent('EventEdited');
$this->CreateEvent('EventDeleted');
$this->CreateEvent('CategoryAdded');
$this->CreateEvent('CategoryEdited');
$this->CreateEvent('CategoryDeleted');
It seems that this function is not defined for me (and maybe for everybody). Or maybe cmsms wants to waiste my time  :D

I use CMS Made Simple 0.13 "Canary"

Thanks for keeping this module working.  ;)