how to pull the current date events

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Alpdog14

how to pull the current date events

Post by Alpdog14 »

So I have a calendar that I am trying to pull today's event. I can pull both yesterdays and tomorrows by changing the parameters of:

{cms_module module="Calendar" display="upcominglist" limit="1" category="Drink Specials" detail="1" first_day_of_week="0"}

but does anyone know for display a parameter to show the current day events both upcominglist and just list either shows the next day event. I am trying to pull the current event
Alpdog14

Re: how to pull the current date events

Post by Alpdog14 »

Come really no one has answered my post, I am really thinking about moving to Drupal
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: how to pull the current date events

Post by Wishbone »

I thought long and hard for a well-placed sarcastic remark to your threat of leaving us and inflicting Drupal with your demands, but came up with nothing.

'Calendar' hasn't been supported for a while. CGCalendar is the current best choice for calendaring in CMSMS. However, this doesn't have this feature as well. Luckily CMSMS makes use of Smarty and PHP, and it should be semi-easy to write an upcoming list template that loops through the upcoming list and filters out ones that don't match today's date.
uniqu3

Re: how to pull the current date events

Post by uniqu3 »

Well you can always create another upcominglist template and use $smarty.now.

Code: Select all


.... the template ...then comes foreach fro events
{foreach from=$events key=key item=event}
{if $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' == $event.event_date_start|date_format:'%Y-%m-%d %H:%M:%S'}

...the rest of template in the foreach ...

{/if}
{/foreach}
... and the rest of template...
Hope you get the idea.

Edit: oh we are talking about Calendar, but basically should be same thing, just check if events date equals todays date.
CMSMS uses Smarty so first stop to learn, read find a solution when you are stuck is Smarty documentation http://www.smarty.net/docsv2/en/
Alpdog14

Re: how to pull the current date events

Post by Alpdog14 »

Thanks for the reply, do you have another other code examples that have the full code in it, I can still use help
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: how to pull the current date events

Post by Wishbone »

You might want to leave off the ' %H:%M:%S' from his example... This will cause the template to only show you calendar items that match this exact second. :)
uniqu3

Re: how to pull the current date events

Post by uniqu3 »

@Wishbone he he lol true :-)
Alpdog14

Re: how to pull the current date events

Post by Alpdog14 »

Ok so I completely removed the old Calendar module and installed the CGCalendar module. I see its similar to the old but when I load my calendar I get this error above my calendar:

Warning: Parameter table_id is not known by module CGCalendar dropped in /home/content/j/e/t/jetshouse/html/lib/misc.functions.php on line 1590

Do you know how to fix this?
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: how to pull the current date events

Post by Wishbone »

They are not compatible. You could probably use the same or similar technique on the old calendar module.
Alpdog14

Re: how to pull the current date events

Post by Alpdog14 »

so what does that mean, the most recent version of CMSMS (1.10.1) does not support the most recent CGCalendar module?
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: how to pull the current date events

Post by Wishbone »

I meant that Calendar and CGCalendar aren't compatible.. Did you save an XML of the Calendar and try to load it in CGCalendar? Did it work? (aside from the error)
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: how to pull the current date events

Post by Wishbone »

Are you passing a table_id parameter? The error message usually means that your specifiying a parameter that doesn't exist.
Alpdog14

Re: how to pull the current date events

Post by Alpdog14 »

where do i put this table id, in the server side file or in the CMSMS editor with the {cms_module module="CGCalendar" table_id="big" display="calendar" category="Events" first_day_of_week="0"} code
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: how to pull the current date events

Post by Wishbone »

I see.. look at the help for the module.. I don't believe there's a table_id option for CGCalendar.
Alpdog14

Re: how to pull the current date events

Post by Alpdog14 »

So your saying I need to add this on the files on the server?
Post Reply

Return to “The Lounge”