Jump to content


[Snippet] zcalendar3


  • You cannot reply to this topic
119 replies to this topic

#41 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 05 August 2007 - 03:23 PM

To anyone who is either following this thread, or may stumble upon it in the future, this is a great example of how community collaboration can bring about great contributions to the entire Etomite community... It's nice to see members working towards a common goal... Although I haven't tested this code to date, because I want to see what transpires with minimal influence, I look forward to giving it a try in the very near future... The examples I have viewed using the links above have looked very promising... Keep up the great work, guys...

#42 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 08 August 2007 - 08:59 AM

For those who are css challenged (like me) I have attached a .css file that will pull images, backgrounds from the manager/media/images folders (from the AlexisProRedux template) that will auto-style the 3 z calendar snippets: (zcalendar, zca_mini and zcalendar_display).

Obviously this can be changed drastically to suit the individual, but at least it might point users in the right direction in styling their own calendars. See in action :here.

Attached Files



#43 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 08 August 2007 - 12:54 PM

View PostCris D., on Aug 8 2007, 04:59 AM, said:

For those who are css challenged (like me) I have attached a .css file that will pull images, backgrounds from the manager/media/images folders (from the AlexisProRedux template) that will auto-style the 3 z calendar snippets: (zcalendar, zca_mini and zcalendar_display).

Obviously this can be changed drastically to suit the individual, but at least it might point users in the right direction in styling their own calendars. See in action :here.

This is a very nice suite of calendar snippets... the final results look and operate so well!

#44 vw53a

    Likes Etomite Forums!

  • Member
  • PipPip
  • 393 posts

Posted 08 August 2007 - 01:31 PM

I had started fiddling with this snippet to make it suit my needs, but stopped after version 3.1 to wait and see what may come out.

What I would like to have is an agenda-kind of calendar. So I'm thinking I need different snippets for the administration (entering of data), a calendar month sheet-view, a calendar week-view and a day-view. Furthermore now when clicking on an event, I am returned to a page with a month-sheet with all the events underneath. But I already clicked an event, so I assume I would go to a page about that event. In a month-view calendar I would display each separate event when clicked in a popup windows I guess. Also I would like to link to an existing document. And if a pageid was given have clicking the event in the overview open the given pageid.
Also I would need the starttime en endtime as well, not only the dates, so that I can also enter meetings from 20:00 untill 22:30 for example.

But first I'll wait how this snippet evolves. I already like the looks of it very much!

Edited by vw53a, 08 August 2007 - 01:34 PM.


#45 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 08 August 2007 - 10:50 PM

Thanks for your feedback. I'm taking a rest for a while before I do anything else with these. It's a good base to start with.

In theory, everything you suggest is possible if you can tweak them.

Quote

administration (entering of data),
Use zcalendar.

Quote

a calendar week-view and a day-view.
Possible but will require fairly heavy hacking (or start from scratch) of the existing calendar format and write new "where" statements.

Quote

Furthermore now when clicking on an event, I am returned to a page with a month-sheet with all the events underneath. But I already clicked an event, so I assume I would go to a page about that event.
Are you talking about clicking in zcalcal? mini? display? You will need to add the $i['page'] data to the temp array and include it as the <a href> however, seeing that there are potentially several events listed on any given day, making the link to another page dedicated to the event is much harder. Perhaps you could integrate the existing newslisting-based calendar if you want a dedicated page for every event (something I was trying to get away from).

Quote

Also I would like to link to an existing document.
In zcalendar in the admin form enter the id of the page (this also accepts aliases) number in the box: "URL Page Link" and a link will show to any internal page. Use the description field to link to external pages as it is not limited by htmlentities, you can type html a href's in there.

Quote

And if a pageid was given have clicking the event in the overview open the given pageid.
Again, you are looking at multiple entries on a page for zcal, but this could be done easily in the zcal_display as mentioned earlier by including the 'page' field instead of the zcal_link id.

Quote

Also I would need the starttime en endtime as well, not only the dates, so that I can also enter meetings from 20:00 untill 22:30 for example.

This is the easiest to do. Simply add the extra fields to your database, add the extra fields to the admin forms in zcal and add the extra fields in your template and your away.

Edited by Cris D., 10 August 2007 - 09:37 PM.


#46 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 09 August 2007 - 01:40 AM

I have updated the snippet library with zcalendar, rather than downloading the whole snippet, you can manually make the change on lines 448 to 450:

if($s>1){$output.="<a href=\"".$etomite->makeURL($page,'',[here]'?Ym='.$Ym.'[to here]')."#".$testday."\" title=\"Beginning: ".$active_titles."\" class='$event_class'>".$event."".$s."</a>\n";
			}elseif($s==1){ $output.="<a href=\"".$etomite->makeURL($page,'',[here]'?Ym='.$Ym.'[to here]')."#".$testday."\" title=\"Beginning: ".$title_link."\" class='$event_class'>".$event."".$s."</a>\n";							
  }

This is required for the event anchor to work if NOT on the current month.

Edited by Cris D., 09 August 2007 - 01:41 AM.


#47 katherholt

    Likes Etomite Forums!

  • Member
  • PipPip
  • 323 posts

Posted 11 August 2007 - 08:05 PM

Wow! That was difficult to setup for a novice designer!
Please let me know if I've skipped any steps, I've tried to make this as complete as possible.

Instructions:

Download the calendar3.js file (don't forget to rename it from "calendar.php" to "calendar.js" and ftp it up to the manager/media/tigra_calendar/ folder.

Add the javaScript line between the <head></head> tags in your template:
<script src="manager/media/tigra_calendar/calendar3.js" type="text/javascript"></script>

Save your template. I'm using Mollio_typeA template to start with this web site.

Create a new snippet called "authenticate_visitor" and download the snippet from the old snippet library. Save snippet.

Download latest zcalendar3 snippet "calendar3.php" - save to your desktop. Open this and copy and paste to a new snippet in your Manager and call it - zcalendar - save file. Within this file you must enter the parameters for you database login:

//Set the database connection details to link to the table: the same as the config.inc.php file.
$host = $host="localhost"; //hostname where the MySQL database is located
$user = $user="xxxxxxxxx"; //MySQL username for the external MySQL database
$pass = $pass="xxxxxxxxx"; //MySQL password for the external MySQL database
$dbase = $dbase="xxxxxxxxx"; //MySQL database name to which you wish to connect

There is some code before the database configuration to cut and paste into a new chunk within this snippet. Make a new chunk and call it: "zcalTemplate" and save the file.

Create a document to use for the calendar snippet. Make sure the "cache" is not checked.

In the body of this document, put this code:

[!zcalendar!] [[authenticate_visitor]] - save document.

In the Manager configuration - turn on "use access permissions" - YES

Under "Users" created a "Group" called "admin" - then in the "Manager Permissions", I checked the permission box called "admin" and saved the file. The manager will log you out and then you log back in.

Now open up a new browser page and go to the new page you created. You will get the login form.

You will see a visitor login and you can sign in and then start adding events via the chunk you created called "zcalTemplate". Once you are finished, there is a "Logout" button at the bottom and you will see the page that your visitors will see. I'm still working on design, but I think this may be a very workable solution for an event calendar.

Attached Files


Edited by katherholt, 04 December 2007 - 02:21 PM.


#48 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 11 August 2007 - 09:17 PM

I didn't realise there were that many steps. Thanks for documenting it. There are a few changes though.
1) the javascript file is the one required to call the pop-up calendar and has little to do with your java navigation. The script file you added was:

Quote

Add the javaScript line between the <head></head> tags in your template:
<script type="text/javascript" src="templates/mollio/js/common.js"></script>
It should be:

Quote

<script type="text/javascript" src="<path to tigra calendar scripts>/calendar3.js"></script>
Everything will still work with this wrong, except your pop-up calendar (you will have to type in the dates).

2)

Quote

Download the calendar3.js file (don't forget to rename it from "calendar.php" to "calendar.js" and ftp it up to the manager/media/tigra_calendar/ folder.
This needs to be changed to...

Quote

Download the calendar3.js file (don't forget to rename it from "calendar3.php" to "calendar3.js" and ftp it up to the manager/media/tigra_calendar/ folder.
(without that little number, the script in the snippet won't use the correct calendar resource and you might end up with dates that don't save).

Next, I had a play with visitor permissions and the authenticate_visitor snippet. This snippes seems to work regardless of any permissions being set in your configuration, therefore admin users do not need to change any of this. It is only if users with limited access require access to the event admin form that you will need to turn on permissions.

Finally, I noticed that your calendar event in september, when clicked on goes back to august. This means that you do not have the latest version with the '?Ym='.$Ym.'' in the $etomite->makeURL('','','') as per the post above.

Once you have this set up, the other two are a breeze! Enjoy.

Edited by Cris D., 11 August 2007 - 09:34 PM.


#49 katherholt

    Likes Etomite Forums!

  • Member
  • PipPip
  • 323 posts

Posted 11 August 2007 - 11:24 PM

Thanks Chris, I did copy the wrong javascript in my directions to include in the template - I was in too much of a hurry in typing the instructions. I think this will work well for me on my other tourism web sites. Anyway - it is a much needed script and I thank you for all of the work that has been done by you, Ian and Ralph.

This was my script in the template:
<script src="manager/media/tigra_calendar/calendar3.js" type="text/javascript"></script>

Next, I'd like to try the mini-calendar on the home page that links to the calendar page or event detail, but I need to master this calendar first. I really appreciate this script because I've been looking at a lot of 3rd party scripts and plugins that are just way too many choices to view a simple event calendar.

Karen

#50 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 17 August 2007 - 10:45 PM

Chris, how hard would it be to add "recurring" events?

#51 katherholt

    Likes Etomite Forums!

  • Member
  • PipPip
  • 323 posts

Posted 17 August 2007 - 11:11 PM

I've been working with this snippet and find it doesn't have some things I require. I like the "Events" snippet for it's display use of a list and when a event date passes, the event goes away from the display. I've spent 3 days looking for a simple good web event calendar that doesn't cost a fortune, allows me to use html, and images, multiple dates and recurrences - but they are way too bloated or not easy enough to edit and display. I wouldn't mind using this script if it would allow those things.

Chris, if you are interested in helping make this script adapt to the above needs, I can chip in some money to help and/or let you use the site I'm working on below for development of the calendar.

Here is what I started:
http://www.roswellrotary.com/calendar.html - with one event in September. I like the list below and will continue to add to it for better display.

Karen

#52 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 17 August 2007 - 11:12 PM

@cathode: The code for it exists in zcal_display already.
The main problem will be how much room the code takes up and how it is displayed in the event box. I have been thinking of ways to do it but I can't visuaize a clean solution that it intuitive.

I was thinking display events:2, if spanned event also exists on this date, then events3?? or will people think that this means 3 events start today? Then a spanned event and no event, output EVENT? or ONGOING? What about if there is a spanned event and an END, list SPANNED only? or END and SPANNED? (How much room will this take in the cell, will it wreak havoc on div height width designs? Or leave off the spanned events for ending dates, therefore not consistent.

If you have any thoughts, let me know, I'd be happy to do it if I know what to do!

Edited by Cris D., 20 August 2007 - 11:49 AM.


#53 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 17 August 2007 - 11:18 PM

Quote

doesn't cost a fortune, allows me to use html, and images, multiple dates and recurrences

The zcalendar does allow all html in the description box, allows images links via the pic (internal or a full img src address for external links) box, It does allow multiple dates and spanned ocurrences are OK now, for multiple recurrences, is something I could look at if you can give me a more specific example...

#54 katherholt

    Likes Etomite Forums!

  • Member
  • PipPip
  • 323 posts

Posted 17 August 2007 - 11:22 PM

For my purposes, I can even do without the visual of the small calendar - a list for upcoming events with the ability to put an end date or span dates and spit out in text would be great. Then we can format the record with images and extra info. For my web sites, tourists only want to see what's coming, not what has happened in the past. Maybe just color blocks for assigned categories would work on the calendar itself. I would also like to display the new upcoming 10 events in a small box on the home page.

Here are some examples:
http://www.villaricatourism.com/events.html
http://www.serviceteamtraining.com/upcomin...s-schedule.html
http://www.flowerybranchga.org/special-events.html

#55 katherholt

    Likes Etomite Forums!

  • Member
  • PipPip
  • 323 posts

Posted 17 August 2007 - 11:26 PM

I'll work with the zcalendar more so I can determine more specifics for you Chris. Thank you for willing to help.

#56 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 17 August 2007 - 11:33 PM

You can get rid of the small calendar and have JUST the list by adding ?hcalendar=1
to the snippet call eg
[!zcalendar?hcalendar=1!]

After looking at your examples, this can be achieved quite easily with zcalendar.
The two main things you will require is 1) custom templates to display the info as required.
2) Change the dates dislayed from this month only to..yo the start of the current month (or today) to the end of the year.

Change the line
$where="`sdate`>='".$SQLStartMonth."' AND `sdate`<='".$SQLEndMonth."' OR `fdate`>='".$SQLStartMonth."' AND `fdate`<= '".$SQLEndMonth."'";
to
$where="`sdate`>='".$SQLStartMonth."' AND `sdate`<='".$SQLEndYear."' OR `fdate`>='".$SQLStartMonth."' AND `fdate`<= '".$SQLEndYear."'";

Then add near the top of the snippet with the other date definitionst
$SQLEndYear=$year."-12-31";//set to the end of the year

Now all events from the beginning of the month to the end of the year will be displayed. Let me know if you need help to get month name headers in there. :)

Quote

I would also like to display the new upcoming 10 events in a small box on the home page.

This can be done with a hybrid of zcal by limiting the results from above (from today to the end of the year) and returning only the next 10. What that looks like will be determined again by your custom template. It is definitely possible.
Change this line:
$cal_data=$etomite->getIntTableRows($fields="*",$from=$zcalendar,$where,$sort="sdate",
$dir="ASC",$limit=999,$push=true,$addPrefix=true);
to
$cal_data=$etomite->getIntTableRows($fields="*",$from=$zcalendar,$where,$sort="sdate",
$dir="ASC",$limit,$push=true,$addPrefix=true);

And add in the snippet call ?limit=10 where 10 is the maximum number of results you want to show.
Katherholt, if you want some personalized service to get this snippet up and running for your requirements, PM me and I'd be happy to work with you.

Edited by Cris D., 18 August 2007 - 05:35 AM.


#57 katherholt

    Likes Etomite Forums!

  • Member
  • PipPip
  • 323 posts

Posted 18 August 2007 - 03:01 PM

So far, so good. I may try to figure out how to add the monthly headers. I'll let you know. Thank you so much for the help. Maybe together we can get an event calendar that will help many. I'll be working here:
http://www.roswellrotary.com/calendar.html today.

Karen

#58 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 19 August 2007 - 04:41 AM

The idea behind recursion on the events is to be able to say "every Wednesday" or "every 14th of the month"... then be able to set a date range... like "Repeat for x days/months/years" or "forever". I think it would add a lot to this snippet.

#59 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 19 August 2007 - 05:51 AM

OK, I thought that was the case: I was hoping it was not the case :)

Of course, everything is possible, however, adding a feature like this will require a LOT more code, changing forms integrating new logic to the display additional table fields etc. I realise that this would be a good feature but it is more than I am willing to do at the moment as it would require a complete overhaul to integrate it.

I was wondering how far I would go with support for this snippet, I guess that was the line :)

I'm still happy to assist in making small changes to suit personal circumstances, installation assistance, fixing bugs...

#60 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 19 August 2007 - 10:57 AM

View PostCris D., on Aug 19 2007, 01:51 AM, said:

OK, I thought that was the case: I was hoping it was not the case :)

Of course, everything is possible, however, adding a feature like this will require a LOT more code, changing forms integrating new logic to the display additional table fields etc. I realise that this would be a good feature but it is more than I am willing to do at the moment as it would require a complete overhaul to integrate it.

I was wondering how far I would go with support for this snippet, I guess that was the line :)

I'm still happy to assist in making small changes to suit personal circumstances, installation assistance, fixing bugs...
/yeah, I thought it seemed complex... Let me ask you this. If you had to add a duplicate event every Friday for a year, how would you go about it?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users