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

 

Link to comment
Share on other sites

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)?

 

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.