HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Looking for Calendar template

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#59786 (In Topic #13013)
Avatar

Community saint

I have a problem, when I use the side block

Code

[block="listing" days="30"]side_calendar[/block]
to get the up coming calendar events it gives the times. The problem with that is the times are never correct even after setting the site time and the member times correctly. So my question is what template do I need to alter to remove the time on the up coming events side block in question. Thanks for any help in this matter.

Rick Henson

OCP 4.3.2 & 5.0.1
PHP 5.2.5
MySQL 5.0.51a
FireFox 3.6.8
Back to the top
 
Posted
Rating:
#59790
Avatar

Hi,

I think this will fix it.

Attachment
sources/blocks/side_calendar.php
» Download: side_calendar.php (9 Kb, 136 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#59799
Avatar

Community saint

Thanks for the reply Chris but it's a no go. The problem I have is that it does not matter what I set the Server time to if I set my local time to my correct local time the calendar times are always 4 to 6 hours off in the side panel. That's why I just thought it would be easier to remove the time off of the side panel.

Rick Henson

OCP 4.3.2 & 5.0.1
PHP 5.2.5
MySQL 5.0.51a
FireFox 3.6.8
Back to the top
 
Posted
Rating:
#59805
Avatar

Ah yes actually my 'fix' makes things worse. I've just tested, and I think your problem is just that the times are translated to the users timezones and you don't want it. In BLOCK_SIDE_CALENDAR_LISTING.tpl change {TIME*} to {$DATE*,{TIMESTAMP}}.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#59812
Avatar

Community saint

As to it converting to the user time zone, that is what I want but it is never correct that is why I just thought that I would remove the time from the entries until the software worked right.

If that last change was meant to change all of the times to dates then it worked. Unfortunately all of the dates are the same. I would almost rather just remove that entry though since all of the events are already grouped with a date title/header. Now all of those are the same as well.

If on the other hand the last change was supposed to fix the incorrect time it did not. Here is a screen shot.

Rick Henson

OCP 4.3.2 & 5.0.1
PHP 5.2.5
MySQL 5.0.51a
FireFox 3.6.8
Back to the top
 
Posted
Rating:
#59824
Avatar

Hi,

I've just run some more tests and it seems to work. It saves as for the server timezone (not website timezone), but both when inputting the event and outputting it again it converts according to the viewing user (taking into account their timezone, and the websites).

For example, I ran a test where the website was -2.5 and my test user was +2. I added an event for 9:28am, and it saved as 9:58am in the database (because for the server, the user is -2.5+2=-0.5=30 minutes behind). It then showed to my test user as 9:28am.

So, to reiterate when adding the event it assumes the user adding it is adding it as for when the event will strike on the clock where their time is.

I think ocPortal isn't ideal here, we hope at some point to revisit how dates in the calendars work. Personally I think it needs to be completely explicit when you enter an event that you pick the time and timezone and it saves/outputs exactly like that (possibly providing a supplementary timezone conversion for the viewing user).
Particularly it's difficult for non-local US sites, because quoting timezones is part of your culture. For most countries we never deal with timezones on a daily basis, so it's quite alien to us and not an issue - to be completely honest this stuff confused me back when I implemented it, but I since understand the issues a lot better after working on a few US-wide sites involving times.

With regard just removing the time, just pull out that bit of coding I showed you entirely. If you want to clean up some more the cell itself can be removed from the template.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#59827
Avatar

Community saint

Hey Chris,

How hard would it be to have everything based around GMT. In other words set the server to GMT then everything else would be based on the Time Zone entered:

The Server would need to be set to GMT
The Calender Entries would need a Time Zone selector
And the members would need a Time Zone selector in their settings.

Since if I am not mistaken most of Europe is based on GMT this should not be a big change for you and since all Time Zones are +or- hours from GMT this should not be to hard to program. Of course since I am not a programmer this is all a guess on my part.

The problem I am having is that one of my main sites is a training site and we have lots of calls, meetings, etc. so the calendar and it's accurate times is kind of crucial. We have people around the world in the site. So my question is, are there any short term plans to make this work better for the rest of the world? and if not how much would it cost to fix this?

As always thanks for all of our help.

Rick Henson

OCP 4.3.2 & 5.0.1
PHP 5.2.5
MySQL 5.0.51a
FireFox 3.6.8
Back to the top
 
Posted
Rating:
#59831
Avatar

Hi,

We don't have any short-term plans for it, as it'd involve quite a substantial database change and overhaul to ocPortal's internals. We have internally estimated the full set of timezone changes we want to do as a 12 hour job, but just changing the calendar would be a 6 hour job:
  • Updating form interface to allow timezone selection
  • Updating database to store the timezones: structure, adding entries, editing entries
  • Changing the code and internal APIs so that timezone conversions do not happen for calendar events
  • Updating the screens/block to reflect the timezones


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#59833
Avatar

Community saint

Chris, thanks for taking the time to reply. Don't think I can afford to take that on at the moment, will keep it in mind if the cash flow gets a little better. Will keep playing with it, I had it working on another site in an earlier version, if not will try embedding an external calendar with an iFrame. Again thanks for all your help.

Rick Henson

OCP 4.3.2 & 5.0.1
PHP 5.2.5
MySQL 5.0.51a
FireFox 3.6.8
Back to the top
 
Posted
Rating:
#59835
Avatar

Community saint

Hey Chris,

Just got to thinking, I noticed that any of the full Calendar views, i.e. Day, Week, Month etc. all seem to show up correctly. In other words it shows the event and the time as it was originally entered. My question is how hard would it be to convert the side block to do the same? That way we can just tell our group that all times posted will be in Eastern time and then just make sure that all the times for all of the events are entered in Eastern time and we will have some consistency.

I like the idea of the side block showing the users local time but it is causing to many problems so the solution above would be awesome, just show all events as entered with no conversion.

Rick Henson

OCP 4.3.2 & 5.0.1
PHP 5.2.5
MySQL 5.0.51a
FireFox 3.6.8
Back to the top
 
Posted
Rating:
#59837
Avatar

Hi,

That's very odd, as in my tests they showed exactly the same time. Maybe this is a case where you can point me to an example event on your site.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#59838
Avatar

Community saint

Hey Chris, not sure exactly what the problem was but I had the Server time set for Eastern time, an event in the calendar set for 12 PM Eastern time and on my login which the local time is set to Mountain time 2 hours earlier than Eastern the side block showed 6 AM. I SU'ed into a user who's local time was set to Eastern time and on his side block that event showed 10 AM. This caused a lot of confusion.

I altered the template BLOCK_SIDE_CALENDAR_LISTING.tpl

Code

{+START,BOX,{TITLE*},,{$?,{$GET,in_panel},panel,classic},tray_open}
{+START,IF_EMPTY,{DAYS}}
<p class="nothing_here">{!NO_ENTRIES}</p>
{+END}
{+START,LOOP,DAYS}


<div class="event_listing_day">{TIME*}</div>

<div class="wide_table_wrap">
<table summary="{!MAP_TABLE}" class="solidborder wide_table events_listing_table">


<colgroup>
<col width="20%" />

<col width="80%" />


</colgroup>
{+START,LOOP,EVENTS}
<tr>
<td>


{+START,IF_PASSED,ICON}{+START,IF_PASSED,T_TITLE}
<img src="{$IMG*,{ICON}}" title="{T_TITLE*}" alt="{T_TITLE*}" />


{+END}{+END}
</td>





<td>
<a href="{VIEW_URL*}">{TITLE*}</a>
</td>
</tr>


{+END}
</table>
</div>

<br />
{+END}
{+END}

I basically removed the time and shifted the col widths a little and that has removed any confusion on the site. Again thanks for your time.

Rick Henson

OCP 4.3.2 & 5.0.1
PHP 5.2.5
MySQL 5.0.51a
FireFox 3.6.8
Back to the top
 
Posted
Rating:
#59841
Avatar

Community saint

Well I am not sure what happened but now all the times are starting to show up correctly. I had been clearing the caches after just about every change but who knows. Anyway I went back and put the times back into the side block and all is ok now. Again thanks to everyone for their help.

Rick Henson

OCP 4.3.2 & 5.0.1
PHP 5.2.5
MySQL 5.0.51a
FireFox 3.6.8
Back to the top
 
Posted
Rating:
#59848
Avatar

Aha. That sure is odd. We intentionally cache against timezones so if people adjust timezones it should automatically update itself. Not sure what happened there, but hopefully it's just a blip.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: