Back to vBulletin 4.x Add-ons

[WIDGET] Upcoming Events
Mod Version: 1.00, by cory_booth

vB Version: 4.0.2 Rating: (6 votes - 4.17 average) Installs: 103
Released: 20 Feb 2010 Last Update: Never Downloads: 0
Not Supported Re-usable Code Is in Beta Stage  

Another upcoming events widget...
I am really waiting for someone to kickout an integrated calendar/events widget...
But until then, I am using this PHP widget for my events. I saw a few others on here, but they were not quite what I was looking for...

Feel free to use/hack/slash this code for your own use...

Navigate to AdminCP -> CMS -> Widgets.
Create a PHP Type Widget and paste the below code.

PHP Code:
ob_start();
global 
$db,$vbulletin;
$calendarid="1";
$per_page "10";
//################################################
$d=date("d");
$m=date("m");
$y=date("y");
$sdate mktime(000date("$m"), date("$d"),  date("$y"));
$edate mktime(000date("$m"), date("31"),  date("$y"));
$and=" and dateline_from > '".$sdate."'";

$getevents=$db->query_read("SELECT eventid, title, dateline_from from " TABLE_PREFIX "event WHERE calendarid='".$calendarid."' $and order by dateline_from ASC LIMIT $per_page");
$count=0;
if(!
$db->num_rows($getevents))
{
}
else
{
WHILE (
$events=$db->fetch_array($getevents))
{
$dtitle=$events['title'];
$did=$events['eventid'];
$date vbdate('m-d-y
'
,$events['dateline_from'], false,true,false,true);
if (
$count 2){$class="alt2";}else {$class="alt1";}
$year=date("Y");
$pagetitle $f;
$pagetitle .= " ";
$pagetitle.=$year;
$eventbits .="<tr><td nowrap class=''><strong>".$date.":</strong></td><td width='100%' class=''><a href='calendar.php?do=getinfo&e=$did&c=".$calendarid."'>".$dtitle."</a></td></tr>";
$count++;
}
}
echo 
"<table align='center' width='100%'>";
echo 
$eventbits;
echo 
"</table>";
$db->free_result($getevents);
unset(
$events);
$output=ob_get_contents();
ob_end_clean(); 

Download

No files for download.

Screenshots

Click image for larger version
Name:	events.jpg
Views:	2574
Size:	20.3 KB
ID:	112672  


vblts.ru supports vBulletin®, 2022-2024