1. cambler
  2. Help (jevents 1.4 for 1.0.x)
  3. Monday, 03 March 2008
I have a very specific need for an events component, and I'd like to ask if JEvents will let me do what I need to do.

I run ShootNotes.com, a web site for photographers and models. I would very much like to allow my members to have their own calendar where they can note upcoming photo shoots. From what I can see, any user can put an event on to the calendar, but it looks like it's one big calendar for everyone.

What I'd like is for every user to have their own calendar such that they can see just their own events and anyone else can see anyone's calendar, too.

So photographer A could browse model B's calendar, which would tell him when she's available for shoots, as model B will place events into her calendar showing when she's shooting and/or when she's available.

Does that make sense? Will JEvents do this?
geraint
Support Team
Accepted Answer Pending Moderation
0
Votes
Undo
Not yet I'm afraid. This is similar to many other requests and we are considering implementing something similar in an upcoming version.

Geraint
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
  1. more than a month ago
  2. Help (jevents 1.4 for 1.0.x)
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
Rather than waiting, I think this is going to be a "do it myself" project, then.

Likely a module or component (or perhaps even a CB plugin) that will filter the display by user.
  1. more than a month ago
  2. Help (jevents 1.4 for 1.0.x)
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
Okay, this is likely to be much easier than I thought it would be.

The first part is done. I cloned the mod_events_cal module and called it mod_events_cal_user, added the "_user" to all of the names and renamed DisplayCalendarMod() to DisplayCalendarModUser(), and then added one extra line to the main SQL statement:

. "\n AND #__events.created_by = $my->id"


And that did it. Now I have a module that shows the calendar only for the logged-in user.

I've also cloned this and made it into a Community Builder plugin that, instead of using $my->id uses $user->id so that a CB user can have their calendar displayed on their profile. This lets anyone view anyone else's calendar summary.

The next step will be to add a parameter to the links into the component that tell it to only show the current user's entries, also constrained via the extra SQL line, and that will make it so that users can see the whole calendar, with everyone's entries as well as a constrained calendar with only their entries.

I can then use that parameter to allow ANYONE to invoke the calendar component constrained to a single user to see that user's calendar.

No database changes required, since the created_by field handles this for me. Since for what I have in mind all calendar entries are public, I'm then done. If I wanted to, though, I could add a new field to the jos_events table, "public_entry" as a boolean value and allow users to set or clear that if they want. In my case, however, I have a different application that will store all of the ancillary data I need and simply reference the id of a calendar entry.

So for cases where one does not necessarily need a separate table per user, this is a reasonably easy modification.

Unless I missed something? :-)
  1. more than a month ago
  2. Help (jevents 1.4 for 1.0.x)
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
Done. It works.

In the module that displays the mini-calendar (and in my CB plug-in that does the same), I now add "&member=###" to any query string passed in to the component, defaulting it to 0 (zero) if it's not set. I then load this variable in and pass it around everywhere.

I then put this code into all functions that load data (like listEventsByMonthNew):
	
if ($member != 0)
{
$memberConstrain = "\n AND #__events.created_by=$member";
}
else
{
$memberConstrain = '';
}


... and then include $memberConstrain within the building of the SQL SELECT statement that gets calendar entries. And that's it. Passing in a variable on the querystring with a numeric value in "member" constrains the display to only entries created by that member.

Of course, this is a meaty-enough hack that I've nuked my chances to upgrade along with you... but it does get me everything I need for my site, today.
  1. more than a month ago
  2. Help (jevents 1.4 for 1.0.x)
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!

Members Area

Show your support

Unlike many Joomla calendars we do not charge to download JEvents - please show your support for this project by becoming a member of the JEvents Club Club members get access to early releases, exclusive member support forums, and Silver and Gold members can use many exciting JEvents addons

Your membership will ensure that JEvents continues to be the best events calendar for Joomla.