![]() |
Still one day off, i.e. it's on the calendar for the 27th, but the "Upcoming Events" widget shows "26th Feb 2011"...
|
same here , had to disable
|
Quote:
|
after i added this all i got was a white screen to my site
|
first i want to say that is a great mod. i have a few questions though.
- Is there a way to change the information that is displayed in the widget box. instead of having it show the date ranges of the event i would like to see it display the Date of the next event upcoming along with the day of the week and the start time Example Currently it shows "Name of Event" "From 4th March 2011 to 4th July 2011" What i would like it to show would be "Name of Event" "Friday, March 4th @ 3:00pm" |
I have this on the cms homepage (www.WonderfulWaterloo.com), but I'd like to know how I can have it show up on the forumdisplay template. For example, I want it to show up on this page: www.wonderfulwaterloo.com/election
|
Quote:
|
ok I know why we are having troubles with some of the dates being a day behind.
In my opinion there is a bug in the calendar. when you post a range event is puts in a time zone entry and if DST is active. a single event does not. i will be posting a bug report for this. as a work around just add the missing data to the fields and all works well does any know how to use the utz and dst fields to adjust our times?? |
Code:
ob_start(); see if this work around solves the problem |
Quote:
can anyone tell me where the placeholder is being set to the date?? |
answered my own question sorta
Please test this version out i beleive it account for DST and time zones Code:
ob_start(); |
Just tried tomsch's last version and the dates are showing correctly.
|
Guys, is there a way I can show a link at the end of the widget that says "More..." and it has a link to my calendars?
|
1 Attachment(s)
I have tried all the ones everyone has posted and can't get ant to show at all. just nothing. I can switch it to text and it will show it then, as text of couse, but when set to php I get nothing..
Attachment 129072 |
All installed and working correctly
Installed as per the code in tomsch's post |
Quote:
PHP Direct Execution widget and paste the code in my earlier post |
I'm after showing dates & times in English.....this is the current code in use:
ob_start(); // %d $show_count = 5; $query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%d' || ( dateline_from > '%d' AND dateline_to < '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count); $event_get = vB::$db->query_read($query); $output_bits = ''; while($event = vB::$db->fetch_array($event_get)) { if($event['dateline_to'] == 0 ) { $format = sprintf("<b>Am:</b> %s", vbdate(VB::$vbulletin->options['dateformat'],$event['dateline_from'])); } else { $format = sprintf("<b>Vom:</b> %s<br /><b>Bis:</b> %s", vbdate(VB::$vbulletin->options['dateformat'] . ' ' . VB::$vbulletin->options['timeformat'],$event['dateline_from']), vbdate(VB::$vbulletin->options['dateformat'] . ' ' . VB::$vbulletin->options['timeformat'],$event['dateline_to'])); } $output_bits .= sprintf(' <div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a></h4> <p class="cms_widget_post_content">%s</p> </div> ',$event['eventid'],$event['title'],$format); } $output = $output_bits; ob_end_clean(); thanks |
Quote:
https://vborg.vbsupport.ru/showpost....&postcount=211 |
Alas, this code shows up all the old data which i dont want displayed
|
Quote:
|
What I'm after is the upcoming events to be displayed.
And (if ranged) the start and end times In english No historical events to be displayed Sorry to be a pain in the ass |
ok the code in my earlier post does that. how ever it only displays the date are you say you want the time displayed also??
|
If you could that'd be great :)
|
This is the code i'm currently using.......
Quote:
This does everything but the time..............and it seems to remove a planned event for the day as soon as the clock turns midnight (i.e. if there is a meet planned for the 17th May then as the clocks turn from 23:59 (tues) - 00:00 (weds) the event is removed |
Code:
ob_start(); this will display the times for the Range events. But there is a small catch when you enter the range event leave the time zone setting to GMT. i left off the time for the all day event as its always the same time because of the way its stored. i also fixed a bug in my code the mydate3 variable was commented out for my fixed date. |
Thanks for this..............fantastic stuff
Works perfect and is exactly what i was after Have a huge bag of kudos :) |
Quote:
|
Quote:
2) The code is working fine but it shows all events in the widget not the 10 as the cutoff is set for. Can that be fixed? |
Okay this works for me and should fix anyone's problem whether it is ranged events or single day events or the 1 day early problem.
ob_start(); // %d $show_count = 5; $query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%d' || ( dateline_from > '%d' AND dateline_to < '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count); $event_get = vB::$db->query_read($query); $output_bits = ''; while($event = vB::$db->fetch_array($event_get)) { $tz_offset = 86400; if($event['dateline_to'] == 0 ) { $format = sprintf("On %s",date('M jS Y',($event['dateline_from']+$tz_offset))); } else { $format = sprintf("From %s to %s",date('h:i A M jS Y',($event['dateline_from'])),date('h:i A M jS Y',($event['dateline_to']))); } $output_bits .= sprintf(' <div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a></h4> <p class="cms_widget_post_content">%s</p> </div> ',$event['eventid'],$event['title'],$format); } $output = $output_bits; ob_end_clean(); It is set to cut off at 5 events, you can adjust that via $show_count = 5. It has a timezone offset of 1 day via seconds for the 1 day early issue here $tz_offset = 86400 Its format for date is set to Time, Date, Month, and Year via here $format = sprintf("From %s to %s",date('h:i A M jS Y',($event['dateline_from']+$tz_offset)),date('h:i A M jS Y',($event['dateline_to'])));. And here for the all day events that do not include time of day ; $format = sprintf("On %s",date('M jS Y',($event['dateline_from']+$tz_offset))); } else { I am still debating on dropping the Year form the widget since 99% of the time the next 5 events are in the same year anyway. To do that simply drop the Y from the M jS Y or h:i A M jS Y See it live, 3rd block from the top on the right column. http://xboxhounds.com I'm simply an amateur but I'm learning with as I go. |
You can customize the date however you want, see the php documentation:
http://www.php.net/manual/en/function.date.php The time offset should be in the database-query, not in your output date. As for showing Users their local time. I thought about changeing the widget that way, but then i think i can't use the cms-widget-cache anymore on this particular widget. I just can't imagine the widget beeing created for multiple timezones in the cache. ;) Second issue with local time is the utc-column in the event-db-table. You need to correct for that value as well, depending on which timezone the user chose upon adding the event. --------------------------------- Thanks to the creator of the widget. Great work, great idea. :) |
Code:
ob_start(); |
@tomsch
Thank you, this works for my page with +8 timezone. |
Quote:
|
Quote:
|
Thanks muchly. Don't know how I missed that post, I *thought* I'd read all 16 pages ;)
Would you happen to know of a way to either put the 'from/to' *above* the 'event'? Or maybe a horizontal bar/separator between each event in the list? I've been playing with it but no luck. |
Ugh. Hate to bug ya but.... everything is working/showing properly *except* the 'to' date... it's showing 1 day extra.
i.e. date range is 12:01 AM July 1 2011 to 11:59 PM July 7 2011 yet in widget it's showing as Quote:
|
Quote:
i also added to my version the ability to have and image that is in the event to be displayed with each item. i also added the capability to add a divideing line between events i just need a horizontal line image of the right size. |
Another question....
If an event say lasts a week and the 'current' date/time is during that week (but after the 'start' date/time) the event isn't showing even though the event isn't 'completed'. |
https://vborg.vbsupport.ru/external/2011/06/12.png
Here is a horizontal line that is 2px x 150px If it needs to be a different dimension let me know ;) |
Quote:
thanks |
All times are GMT. The time now is 04:02 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|