Jump to content

Fetch recent event in Vbulletin Calendar? Todays event


jalmz

Recommended Posts

Hi guys,

 

I would like to get the event for today's date. For Example the date today is April 12, 2011

 

then in my event calendar i have

 

PhpFreaks birthday - April 12, 2011

Digitalpoint birthday - April 15, 2011

 

$time_now = time();
$day_before = $time_now - 86400;
if ($result = mysql_query ("SELECT dateline, dateline_from, eventid, title FROM vb_event WHERE calendarid = 1 AND dateline_from >= '$day_before' ORDER BY dateline_from LIMIT 5")) {
  if (mysql_num_rows($result)) {
    $return = '';
    while ($row = mysql_fetch_array( $result )) {  
      $return .=  "<a href='/forum/calendar.php?do=getinfo&e=" . $row['eventid'] . "&c=1' title='". $row['title'] . "' style='font-size:11px;'>" . $row['title'] . "</a>, ";
    }
    echo rtrim($return, ', ');
  }
}

 

The result of this code is

 

PhpFreaks birthday - April 12, 2011, Digitalpoint birthday - April 15, 2011

 

I would like to display only the todays event.

 

PhpFreaks birthday - April 12, 2011

 

Thank you

 

ok.. in the Vbulletin table..

 

table vb_event

eventid

userid

event

title

allowsmilies

recurring

recuroption

calendarid

customfields

visible

dateline (1201165110)

utc (0.00)

dateline_from (1202169600)

dateline_to

dst

 

 

if our query is  dateline_from  = 1201165110 , then now how to get this variable (1201165110)?

 

ok it uses UNIX TIME STAMP

 

$day_before 1302533714 04 / 11 / 11 @ 9:55:14am EST

 

$time_now  1302620114 04 / 12 / 11 @ 9:55:14am EST

 

 

PhpFreaks birthday

 

dateline 1302605672 04 / 12 / 11 @ 5:54:32am EST

 

dateline_from 1302566400 04 / 11 / 11 @ 7:00:00pm EST

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.