See attached. It’s the first MODX snippet I’ve ever written! I’m pretty solid with PHP but have found trying to use XPDO and the MODX API quite confusing so hopefully it works ok for you. I think it should auto-create the database tables it needs from the schema but from memory that might cause the first event you save to fail, if that happens then just try again, and maybe take a look at your MODX event log.
Because I don’t have webusers (or any way of logging into the front end), it assumes that anyone who can log into the manager is allowed to create events but it would be pretty easy to modify it to only allow certain web users/groups.
Let me know how you get on! I haven’t tested it that much but once I’d finally got the XPDO schema to work the actual calendar stuff is pretty short. It’s a bit specific to my needs, but should be fairly easy to modify.
You can try Google Calendar, all you have to do to put it into your site is to use the iframe/embed code that it gives you.
However, it may not be that flexible. Try it out first, it’s the calendar I’m using (doesn’t work well when it’s very thin).
Hi there, I have followed the instruction given in the readme file. but I cannot add the event on the date. Looking at the error log, following message is logged.
’modxrevo.modx_amc_cal_events’ doesn’t exist
I have got WAMP server 2 and windows 7 ultimate operating system. Any help would be appreciated.
Thanking in advance.
Buddhi
Modx should auto create the tables, but I don’t really understand how the whole xpdo/schema thing works so it might not do it on your system. Use phpmyadmin to look at your database and see if you have the two tables amc_cal_events and amc_cal_dates, if they aren’t there then try adding a couple of events and if they still don’t get created you’ll have to examine the XML schema file and create them manually I guess...They did auto create on my main webserver when I moved the code from my laptop (which is the same platform as yours) onto the main server though. Hope this helps...
Hi there, on the myphpadmin I have got amc_call_dates but I don’t have amc_call_events. In this case how do i add the event manually. Where do i use this calendar.js file while modifying strings.inc.php file as I do not see the path for it. Any reply for this would be much appreciated.
Regards
Buddhi
Thanks for sharing this code Mark.
The code is very easy to follow to see what’s happening.