Events Diary Creation

8 posts by 3 authors in: Forums > CMS Builder
Last Post: June 4, 2009   (RSS)

Re: [willydoit] Events Diary Creation

By ross - May 29, 2009

Hi there.

Thanks for posting!

For the first one there, I think we'll need to look at some customized options which we can do through consulting@interactivetools.com

For the second one, if you were to setup a special field for end dates in your event section, the system itself would just stop displaying that listing after a certain point in time. So the listing would appear in your search until it has "expired".

Check out this page in our docs for a bit more information:


http://www.interactivetools.com/docs/cmsbuilder/special_fieldnames.html


You'll be looking at the "removeDate" field. I also recommend adding in a "neverRemove" field just so you don't actually have to set a date for every single listing.

LEt me know what you think :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Events Diary Creation

By willydoit - May 29, 2009

Hi Ross,

Sorry, I must not have made myself clear, I have already set up an end date by using the removeDate field as stated in b), my issue was that if the event started in April and ran until say August I need the item to also show in May , June , July and August searches, the coding I have would only show the item in May as it searches on the start date field if startdate = 5 then it shows on a may search, on a june search it would not show up as startdate doesnt=6 I assume I need something such as if start date is equal to or greater than search date and search date is less than removeDate then display plus any other elements to stop false displays, does this help?

Thanks

Re: [willydoit] Events Diary Creation

By ross - June 1, 2009

Hi.

Thanks for clearing that up! I think I get it now :). The auto hide thing will definitely help but you'll need to take it one step further.

Basically, you are passing the month numbers to your server so you'll need to setup a custom WHERE to search something like this:

where the event month number is less that the end date selected in the form.

Does that sound more like it?

Let me know what you think :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Events Diary Creation

By willydoit - June 1, 2009

Hi Ross,

Yes we are getting there, If the searched month variable is "searchdate" and the event start date is "startdate" and the remove/end date is "enddate" then I think it needs something like if "searchdate" is equal to or greater than "startdate" and "searchdate" is less than end then display the information. otherwise move to next record and apply same criteria until it reaches the end of the records.

Unfortunately my php knowledge is such that I havent a clue where to start but could probably work it out if I had access to php code which followed a similar routine so that I could analyse, cut and paste and replace variables as required.

Any help by pointing in the right direction of any such code would be helpful.



Thanks in advance

Re: [willydoit] Events Diary Creation

By Dave - June 1, 2009

Hi willydoit,

Try this:
- Rename your search field 'targetDate'
- Zero pad the month numbers so they are all 2 digits (and Mar is 03)
- Change the values to be like this: 2009-03, use <?php echo date('Y'); ?> to display the current year.

That will give us a valid mysql date we can use for comparison. Then above your code block have this line:
$escapedTargetDate = mysql_real_escape_string( $_REQUEST['targetDate'] );

Then in your list viewer options have this:
'where' => "startdate <= '$escapedTargetDate' AND '$escapedTargetDate' <= removeDate",

That will let you search for a month that is within the range. In general, though, date and calendar systems are _very_ complicated. I've done a few through custom programming and just figuring out how to display things in a way that makes sense is enough of a challenge before you even get to the programming. The issue is all the different combination of dates (some are on certain days only, some are re-occurring, etc).

For simple event lists CMS Builder is great but if you find you want to do something more advanced you're be better off with a pre-made web-calendar system or something custom built.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Events Diary Creation

By willydoit - June 2, 2009

Thanks Dave,

If you think it could be complex then without doubt it is going to be beyond my current knowledge, I think we may have to stick with the current calendar program which looks naff or look for an alternative which uses php & css so way may be able to adapt it to fall in line with current design layouts.

Thanks for your help

Re: [willydoit] Events Diary Creation

By ross - June 4, 2009

Hi there.

Keep us up to date with however you end up getting things done. If you like, we could take a look at this for you through consulting but like Dave said, it would still end up being a fairly simple events list.

Either way, keep us up to date :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/