Ok on the new sites I am building, they are based on vB3 Beta5 ( Vbulletin 3).
One of the scripts I am writing and wrote originally for vB2 no longer work. Its a Calendar script to show the next 3 public events on a non vB page.
Heres the section of code that is causing me issues:
Code:
$events = $DB_site->query("SELECT FROM_UNIXTIME(dateline_from,'%Y-%m-%d') AS dateline_from, eventid, title
FROM event
WHERE calendarid = 1 AND dateline_from >= ".vbdate('Y-m-d',time())."
ORDER BY dateline_from LIMIT 3");
now wiht the rest of the code in the script the resulting code from the "dateline_from" variable and the ".vbdate('Y-m-d',time())." function are both YYYY-MM-DD.
But theres no cut off for the date. the issue is that it shows events that already happened. The kicker in all this is tha tin vb3 they changed the date format for the calendar dates to Unix Time stamps, instead of clear YYYYMMDD, so I need to runthe "from_unixtimestamp" in the query to get it to a format that vbdate can compare against.
The big thing that I THINK would make this work is if I can find what I need to do to replace that vbdate entry with the current Unix timestamp. If I got that then I could remove the whole unix timestamp from teh query and do the >= comparison with 2 flat simple unix times.
I am absolutely NOT a programmer, and thats why this is sorta getting me upset
edit: incase it isnt clear this is the line thats a problem:
Code:
WHERE calendarid = 1 AND dateline_from >= ".vbdate('Y-m-d',time())."
it should make it so no calendar item older than the date the script is run will be shown. (vbdate = todays date)
And it isnt working. if I change the expression to just = I get nothing, if I change it to <= I get nothing, but at >= I get everything...
If someone could give me the code to replace the whole vbdate function with another function for a current date in unix timestamp format, thats all I need