vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - Events widget (https://vborg.vbsupport.ru/showthread.php?t=265941)

tomsch 06-28-2011 10:00 PM

Events widget
 
1 Attachment(s)
This upcoming events Widget comes in 3 flavors.

1) Plain lists the next 10 events

2) list the events and the first Image that is in the event details. If no image is listed it will not add a place holder for those events

3) same as 2 with the addtion of a line separator between events

follow the reademe in the file to install

stationar 06-28-2011 10:53 PM

Does it show upcoming birthdays?

tomsch 06-28-2011 11:04 PM

Quote:

Originally Posted by stationar (Post 2214301)
Does it show upcoming birthdays?

at this time No.

I intend on adding Holidays and birthdays in the future.

oldfan 06-29-2011 12:15 AM

Work with forum blocks also?

Eq4bits 06-29-2011 01:18 AM

It does on my 4.1.4 board ;)

karlm 06-29-2011 01:21 AM

Nice...

I've seen others that have date issues, i.e. they show events due tomorrow as being today or a day late, or they simply vanish on the due-date.

Does this have any known issues ?

tomsch 06-29-2011 01:36 AM

there is only 1 known possible bug that i know of. i have not been able to reproduce the problem as of yet. it has to do with range events adding 1 day to the end date.

the only other issue is a bug in VB the work around for this issue if you have it is not to set the time zone for the events. When VB has this bug resolved there will be an update to use the time zone offsets.

other than that i don't know of anything.

RC-Central 06-29-2011 04:16 AM

Where do you add the line divider in the code?? I am using the uenopics.php file but want the line divider between events.

PHP Code:

ob_start(); 
global 
$db,$vbulletin;


$mydate =  mktime(000date("m"), date("d")-1date("Y"));
$show_count =10

$query sprintf("    SELECT * FROM ".TABLE_PREFIX."event 
                    WHERE visible = 1 
                    AND (dateline_from >= '
$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to)) 
                    ORDER BY dateline_from ASC LIMIT 
$show_count"); 
                    
$event_get vB::$db->query_read($query); 

$output_bits ''
while(
$event vB::$db->fetch_array($event_get)) { 

     if(
$event['dateline_to'] == 
     { 
         
$format sprintf("On %s",vbdate('D M jS Y',$event['dateline_from'],false,true,false,true)); 
     } else { 
         
$format sprintf("From %s to %s",vbdate('D M jS Y',$event['dateline_from'],false,true,false,true),vbdate('jS M Y',$event['dateline_to'],false,true,false,true)); 
     } 
      
     
$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(); 


Kraxell 06-29-2011 07:07 AM

Screenshot or Demo?

toxin 06-29-2011 03:41 PM

It's working fine on 4.1.4, except it doesn't show recurring events very well.

I have created a recurring event. The range is starting Jan 01, ending Dec 31 and the event is 1st Sunday of every month.

The event is listed, but the widget just displays this:
My Event
From Sat Jan 1st 2011 to 31st Dec 2011
And because the range started Jan 1st, this event is always at the top of the list.

stationar 06-30-2011 01:35 PM

Tagged. Will wait for birthdays. They are the only events on my forum.

tomsch 06-30-2011 04:24 PM

Quote:

Originally Posted by stationar (Post 2215053)
Tagged. Will wait for birthdays. They are the only events on my forum.

birthday widget getting close

tomsch 06-30-2011 04:25 PM

Quote:

Originally Posted by toxin (Post 2214594)
It's working fine on 4.1.4, except it doesn't show recurring events very well.

I have created a recurring event. The range is starting Jan 01, ending Dec 31 and the event is 1st Sunday of every month.

The event is listed, but the widget just displays this:
My Event
From Sat Jan 1st 2011 to 31st Dec 2011
And because the range started Jan 1st, this event is always at the top of the list.

i am working on correcting this item.

Deriggs007 07-22-2011 02:06 AM

Can you please provide a demo?

I would like to add this for my website http://www.alteredgamers.com/ where it says "Featured Event"

I like the idea of having the ability show the picture with a set size, and use it as a "widget" if that makes sense...

Thanks!

Mooff 07-22-2011 10:05 AM

Quote:

Originally Posted by tomsch (Post 2215122)
i am working on correcting this item.

My version of the event widget (widget Turnierticker).
http://www.united-battlezone.de

(not based on your work, based on the idea here:
https://vborg.vbsupport.ru/showthrea...pcoming+events )
But heavily heavily modified. Maybe 5 lines of code are left. :D

Anyway - since our users rely on weekly recurring events i rewrote the code to account for that and set them in the right order. I thought it might help you with your work.

vB saves the recurring events in two seperate columns:
recurring and recuroption

I know for most of them what they mean (brute force testing :p). But the only one i have implemented so far is weekly.

Code:

elseif($event['recurring'] == 3) {
            $teile = explode("|", $event['recuroption']);
           
            //Datum neu setzen fuer die weeklies -- (offset damit der heutige noch erscheint!)
            while($event['dateline_from'] + $wez_offset < $time_offset)
            {
                $event['dateline_from'] += $teile[0] * 7 * 86400;
            }

What it does.
The recurroption for weekly events is saved like that:
1|5
-> event takes place every week on tuesdays and sundays.

3|32
-> event takes place every 3 weeks on fridays.

So we need that first part of the string, which i write into $teile[0] - then i'm using a loop to change the startdate to the actual week we are in (+ some offset to show events which are today).

I do that for all events which i take out of the database (usually 5ish more than i will show in the end - to account for database missorting based on the wrong dates).

Then i resort the array via
Code:

//getting database results
    foreach($DatabaseStatement as $event)
    {
//calculate new dates (see code above)

//add them into a big array
$events[] = $event;
}

//sort the $events array via array_multisort and startdate
    foreach($events as $c => $key)
    {
        $sort_date[] = $key['dateline_from'];
    }
   
    array_multisort($sort_date, SORT_ASC, $events);

//generate output


I hope that helps. :)

Kiint 05-16-2012 11:30 AM

Any chance of showing the complete code for the changes you made?

I'm having the problem of the recurring event showing at the top of the widget even though the recurring event is next scheduled until after the next 2 single events...

KGodel 05-29-2012 07:23 PM

Bumping. Any chance someone would know how to convert a time from the date of the calendar event to the date settings the user has specified?

oldfan 04-14-2023 02:47 PM

works on 4.2.5 php 7.2

oldfan 04-15-2023 03:55 PM

anyway to get this to show IE: april 15, 2023, april 15, 2022, april 15, 2021 on so on?


All times are GMT. The time now is 09:26 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
  • Page Generation 0.01227 seconds
  • Memory Usage 1,774KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete