![]() |
ya ... appears to only show the FIRST of a recurring events series. Is there any way to resolve this ...? Thanks! Otherwise, great mod!!!
|
and ... grrr ... it's off by a day!!! was there something here I missed to fix this ...?
|
Hi really need help on recurring events!!! PLEASE HELP SOME ONE!
|
Quote:
|
Quote:
|
Quote:
|
Thank you very much! Love it :)
|
Quote:
|
What changes need to be made to make this work as a BLOCK in the sidebar?
|
Quote:
In fact is there an area which is dedicated on creating certain forum blocks? |
Nice widget, but it won't show 'All Day'-events.
To fix this find: Code:
$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); Code:
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%1\$d' || ( dateline_from > '%1\$d' AND dateline_to < '%1\$d' ) || (dateline_to = 0 AND DATE(FROM_UNIXTIME(dateline_from)) = DATE(FROM_UNIXTIME(%1\$d)))) ORDER BY dateline_from ASC LIMIT %2\$d",TIMENOW,$show_count); Christian Stadler |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Try again. I fixed a typo in my post above. It should work now.
|
1 Attachment(s)
ahha i just noticed something
the problem only occurs if you don't use ranged events and set an end date ... to make it work correctly you have to have a starting and ending day. so the weird thing happens only on single all day events haven't tried reoccurring yet ! works i figured it out now installed |
Quote:
Thanks for helping though Stadler. :) |
The two issues that seem to persist are:
(1) Getting re-curring events to display after the initial day (even though I have specific date ranges); and (2) Getting the current day's events to display Otherwise, it's a great mod and in spite of these issues, I use it on my main page. Think it's funny that vBulletin does not provide this as a built-in feature (similar to their built-in feature that displays recent posts) |
Quote:
[Edit:]Here's the full code in my widget: PHP Code:
|
Are there any other mods out there that may do this and display the events accurately ...?
|
Copied the code into a Forum Block and it worked perfectly. Thanks!
|
My forum has more than one calendar. Is there any way to only pull events from a specific calendar instead of all of them lumped together?
|
1 Attachment(s)
This widget doesnt handle reocurring events very well. It lists the beginning and ending date of the range of the event, rather than each instance as one would expect. Anyone have any luck in modifying this?
|
Quote:
|
Quote:
is the block set as Choose which content type do you want to use: Pure Text - Display Pure Text content HTML - Parse HTML code and display PHP - Parse PHP code and display |
Nice, simple, and effective. Thanks :)
|
Quote:
|
Quote:
Anyway, currently with the original code and edit (to make the days the correct one), I have an event for the 1st August 2010 but it is labelling it as on the 32th July? :confused: |
I am petitioning on vbulletin.com to implement this as part of the vbulletin code and release us an upcoming events widget.. everyone please voice your opinion about this here -> http://www.vbulletin.com/forum/showt...17#post2014317
|
Maybe we could kill two birds with one stone (so to speak). Looking at the code line by line, people knowledgeable in php and vB could explain what's going on with that code line. Maybe we could learn a few things and end up with a needed widget. :-)
I'll start, using Stadler's code (I hope you don't mind, Stader). Please jump in with any/all info and/or insight you can offer and don't hesitate correct any errors with my comments/logic. Thanks! In php, we use // to make a single-line comment or /* and */ to make a large comment block. I'll use /*...*/ for my comments as there is a line in the code that uses // and I'm not sure why it's there. Comments will be placed before (above) the line(s) of code they reference. -+-+-+-+-+-+-+-+ UPDATE July 31, 2010 I've edited a few areas in my comments as I've gained a bit more insight into php and the code. Hope this helps someone. And I really hope others will join in! -+-+-+-+-+-+-+-+ OK, here we go: /* Since there is a parentheses after ob_start, this is obviously a function call. */ /* I guess vB needs this to indicate the start of a php widget */ ob_start(); /* What is this used for? // is used to denote a single line comment */ /* (i.e. not processed as part of the program by php interpreter). */ /* It's not indicating anything I can see in the code. */ /* Why is it included? */ // %d /* Obviously $show_count is a variable, set to a value of 5 as seen */ /* in the set up of the database query line that follows this one. */ $show_count = 5; /* This sets up a MySQL database query with the results placed in the $query variable. */ /* sprintf is used to write a formatted string to a variable (in this case, $query). */ /* Variables, values, strings, etc. are integrated into the string using */ /* conversion specifications which are passed in as arguments to the */ /* sprintf function. E.g. you can pass in a value and require that value to be an integer. */ /* Apparently, sprintf is commonly used in SQL calls to 'sanitize' the string. */ /* The argument parameters will be inserted at the percent (%) signs in the main string. */ /* In the following line, 2 percent formatters and 2 arguments are used. */ /* The arguments are the variables/strings/etc. that are placed at the end of the line, */ /* separated by commas. */ /* TIMENOW and $show_count are the 2 arguments in the following line. */ / * %1\$d */ /* This is replaced by the TIMENOW variable and formatted as a signed decimal number. */ /* %1 says to use the first argument and $d says to make it a signed decimal number. */ /* A backslash (\) is used to separate the argument identifier from the format identifier. */ /* %2\$d */ /* This is replaced by the $show_count variable and formatted as a signed decimal number. */ /* %2 says to use the second argument. */ /* || means 'or' in php speak */ /* AND means 'and' in php speak */ /* I still don't (as yet) fully understand the date formatting. */ $query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%1\$d' || ( dateline_from > '%1\$d' AND dateline_to < '%1\$d' ) || (dateline_to = 0 AND DATE(FROM_UNIXTIME(dateline_from)) = DATE(FROM_UNIXTIME(%1\$d)))) ORDER BY dateline_from ASC LIMIT %2\$d",TIMENOW,$show_count); /* This fetches the info from the database using the string built */ /* and stored in the $query variable. */ /* The results are stored in the $event_get array variable. */ /* Not sure why it's formatted the way it is. */ $event_get = vB::$db->query_read($query); /*This sets the variable $output_bits to double quote character. Why is this needed? */ $output_bits = ''; /* While loop. */ /* $event (which is an array, right?) is the variable used */ /* to store the info retrieved in $event_get. */ /* While will loop until the function returns no more data */ /* (function returns 0 or false). */ while($event = vB::$db->fetch_array($event_get)) { /*if/else conditional. */ /* Again, date formatting. Expanation here is again needed. :-) */ if($event['dateline_to'] == 0 ) { $format = sprintf("On %s",date('jS M Y',$event['dateline_from'])); } else { $format = sprintf("From %s to %s",date('jS M Y',$event['dateline_from']),date('jS M Y',$event['dateline_to'])); } /* sprintf is used again, this time to build a formatted output string. */ /* However, since this is within the loop, doesn't the $output_bits variable */ /* get rewritten each time through the loop? */ /* Wait a sec... the first part of this line is: */ /* $output_bits .= sprintf(' */ /* I notice a dot (.) just before the equals (=) sign. Does this concatenate (add to) */ /* the string with each iteration (instead of rewriting the contents of the variable each time)? */ $output_bits .= sprintf(' <div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php5?do=getinfo&e=%d">%s</a></h4> <p class="cms_widget_post_content"> %s</p> </div> ',$event['eventid'],$event['title'],$format); } /* Why is $output equated to $output_bits? */ /* I guess vB internal code uses $output to print out (display) data in the widget, */ /* so a string must be built and then copied to this variable... right? */ $output = $output_bits; /*This is obviously needed by vB to close the widget and clean up. */ /* ( Companion to ob_start() ). */ ob_end_clean(); |
@ngcoders
OMG I love you, this is exactly what I needed. |
working in 4.0.6
|
Can someone convert this code to a forum block? If I try using the existing code in a forum block I get the following error.
Fatal error: Class 'vB' not found in /home/public_html/includes/block/html.php(95) : eval()'d code on line 9 |
Be good to have it in the Forum blocks as well :)
|
same code just add at the end
return $output; |
Quote:
|
what's your code?
|
Quote:
PHP Code:
|
Also single day events do not show if the event is that day, it would be good if it showed the entire day the event was on.
|
All times are GMT. The time now is 07:11 PM. |
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:
|