How to create a repeating Events like google gmail in php? - php

I want to create repeating Events like gmail. IF any idea, Please let me know? Thanks in advance.

You can setup/install the Date module on your site. Then, in the Event content type, configure your event date field with the repeat option enabled (see screenshot in Lullabot's blog post about the date module)
Also, here are a few considerations about dates during your Event content type and views setup process:
Once you configure the date field and add event content with those fields defined, you won't be able to modify the field settings to a more restrictive state. (For example, if you enable repeat and then decide to disable repeat). A work around for this is to create a new date field with desired settings, use views bulk operations to copy the data from obsolete date field to new date field, then delete obsolete date field.)
When working with repeating or ongoing events, you'll need to determine how you want them to appear in chronological event listing views. (For example, ongoing events may wind up showing at top of list if your sort is based only on start date. If your view is limited to very few listings/results, and all your events repeat- make sure there's enough variety of events to avoid showing the same repeating event back to back in the view. You may want to consider showing only distinct results in the view.)
When working with repeating dates, do the times also repeat? If not, you may want to also install the Node Clone module and configure so content managers can copy event nodes and edit/modify times.
If showing times, do you need to show timezones associated with them?

Related

Recursive item status performance

I have been pondering over this question for a few days now, and I can't seem to figure out what the best practice would be, so hopefully one of you guys / girls will be able to lead me down the right path.
Data
Lets say for the sake of argument we have a Meta data table, an Item data table and an Expiration date table.
Meta
Items
Expirations
A meta is what defines a collection of items and holds the general information for that collection, and there a certain criterias set on the meta which are used throughout the items layout.
An item is a derivation of a meta and holds unique data specific to that ONE item, and usually calls for the meta information. (Note: An item can ALSO be a collection of OTHER items)
A expiration is self explanatory, and is the expiration date of one individual item.
Current implementation
If you enter the meta page for any given meta, it will load the items in a paginated ajax call and for each loaded item it will load a status icon. This status icon is generated EACH time it is shown, and it is recursive (This means that if I were to put a status icon on the meta, then it would load all items for that meta and check all it's expiration dates and so fourth.)
With the extended implementation it currently does 600 calls (5.56 seconds) to the database (Which is quite a load, but is neccessary based on the database layout.)
My theory
I reckon it would show much better results for the end-user to simply store the status value in the database alongside each element, however I don't know if that is the right way to do things - considering that I would have to recursively adjust this status icon every time an element within the spectrum changes (including having a server job setup to go and update the status based on the expiration date)
The question
What would the best practice for a status icon be that is recursive and has many factors and relations to keep track of?
Best practice would be to cache a status icon and read it for end-user from cache only. All your load heavy stuff (recursive DB calls magic) will go into a job. Lastly you create observers for all your models that will queue this job to update cache value for changed items.
This way you will separate load heavy stuff to be handled by workers on your server side and on your client side everything will be fast and smooth. Once status icon update will be handled your end-user will see a change.

How to add a form field to modx 2.2.14 manager pages

I'm trying to add the editiedon field to the modx manager pages so my users can edit the value using this bit of documentation as a start point:
http://rtfm.modx.com/revolution/2.x/case-studies-and-tutorials/adding-custom-fields-to-manager-forms
Which does work, but:
how can I make that a date/time field?
how can I place it in the settings tab of the given resource?
Isn't input type="date" the answer to the first question? I'm not sure how you would do the second part, unless you managed to get the rendered content and splice it in there somehow (unless theres som hidden specified method).
Otherwise, you could always solve it with regular form customization. You'll want to create a TV of type Date, and give it a custom default data through a snippet, that just fetches the current resources editedon value. I guess you only need to update the resource/update form set. Under the template variables tab of the set, make sure your TV is connected and change the region value of it to "modx-resource-settings"
There are two different ways which have their own pros & cons.
At first you can use template variable with Date type. It gives you correct ExtJS component for dates and you'll see calendar in TV's tab.
If you'll choose this method you have to create a plugin which invokes on OnBeforeDocFormSave event. There you can redefine modResource editedon property from your TV and it will be saved in proper way. Also you may invoke another event(OnLoadWebDocument). There you can set modResource editedon property from you TV if you want to see correct data.
Pros:
fast calendar integration to the one of modResource's tab
you can use Form Customization for security reasons. It's rather easy and from the box.
Cons:
Additional TV which complicates modResource updating process a little bit
Another method is more complicated (you need skills in ExtJS).
Create plugin which invokes on OnDocFormPrerender event. You can add JS to the modResource page there. Your scripts should render new custom tab to the document where you can add your special field with calendar. So there is special ExtJS component in MODX for these purposes. And of course you need events from first method for loading and updating editedon value.
Also you can just render special field to the existing tab instead of creating new tab and rendering your custom field to it.
Pros:
you don't need TV anymore
it's flexible
Cons:
it's more complicated and takes time
P.S. You can view Xlexicon github repo. There you can find example of rendering new tab and manipulation with modResource properties.
Also you can check modAvatar extra for MODX. There is an example of manupulation with existing tab.

Pulling data from MySQL into an Elgg application

I'm trying to use Elgg as a starting point for a certain type of social media website. One of the main things I'd like to do is allow users to create events and then display all the events in a sortable table (sortable by different attributes given to the event during the creation like date and title). For the event creation aspect, I'm using the plugin Event Manager.
I'm assuming the best way to do this is to pull the event data from where ever it is stored and put it into an HTML table (I'm using the jQuery TableSorter code). Can anyone give me a good idea of where and how to start doing this?
The biggest problem I'm having is finding where the event data is stored in MySQL.
For the database organisation and model, read:
http://docs.elgg.org/wiki/Engine/DataModel
http://docs.elgg.org/wiki/DatabaseSchema
For fetching the data, consider using:
http://reference.elgg.org/1.8/engine_2lib_2metadata_8php.html#aec4b6f0b9565e3554acb9b39ef34a2ac
With options order_by and order_by_metadata for chosen information.

how to add date field in html showing like a calender

i am new to html and php i have created one railway ticket booking page in html .in that form page there are option where the user going to fill like start station,reach station and date, so how can i show date ,that is when the user click the date means it shows like a calender and the user select the appropriate date where planned to travel and i want to show next three month date from the current date like a calender. because we give permission to book the ticket before three month..so any one help me doing this in html..
and when the user select the date how can I get that selected date..
This can't be done in HTML alone, you need to use javascript, or even better, jQuery, which is a javascript library designed to simplify the creation of client-side scripts.
When using jQuery, as you can probably suspect, a lot of things already exist, including a date picker.
You can find more info on this page : http://jqueryui.com/datepicker/‎
I also encourage you to check out the other contents the jQuery UI site, as they are really useful to easily design richer forms.

PHP: Match a specific date to a recurring iCal rule

I need to build a simple calendar to embed in my PHP application.
Basically I have a bunch of recurrent events whose iCal recurrent rule (rrule) is known (e.g.: "FREQ=MONTHLY;INTERVAL=2;BYDAY=SU" or "FREQ=WEEKLY;BYDAY=SU").
Basically I need a function that given
_ an event iCal rrule
_ a certain day (e.g. 04/10/2011)
returns a boolean telling me whether the event is on at that date.
Obviously I can build it myself but it would take ages: is there any reliable library already available for that?
Thanks,
Dan
Although I am at the end of my own calendar project and I am not using iCal, perhaps this will help.
My own experience is that I could not find any sort of library and I coded my own backend from scratch.
For the front-end, I would urge you to use FullCalendar, it is an amazing calendar with what you can do with it. All you need to then, is concentrate on the backend.
For the db, I would go the route of having only 1 database row per event and when that event is modified, if it is recurring then you amend the existing event and create a new event with the change.
For the back-end logic, in conjunction with fullcalendar it gives you a window to work with. Within this window, I would then work out when the event occurs and then show, if the event is recurring to then work out when it should be shown on the calendar. It can get a bit complex but you can do it.
I'm attaching pics of what I have done, sadly this project isn't open source.
Add New Recurring Event
Calendar with Recurring Events
Amend Recurring Event
Agenda List View
Cheers

Categories