![]() | ||
|
|
Random Nonsense / Geek Stuff All those random tech ramblings you can't fit anywhere else! |
![]() |
Thread Tools |
![]() |
#1 |
The Pro/Life Support System
Join Date: Dec 1999
Location: Denver, CO
Posts: 4,041
|
![]()
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"); 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())." 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 ![]()
__________________
Joe - I only take this hat off for one thing... ProCooling archive curator and dusty skeleton. |
![]() |
![]() |
![]() |
#2 |
The Pro/Life Support System
Join Date: Dec 1999
Location: Denver, CO
Posts: 4,041
|
![]()
NM ! I fixed it.
The revised code is as such: Code:
$events = $DB_site->query ("SELECT UNIX_TIMESTAMP() AS dateline, dateline_from, eventid, title FROM event WHERE dateline_from > dateline ORDER BY dateline_from LIMIT 4");
__________________
Joe - I only take this hat off for one thing... ProCooling archive curator and dusty skeleton. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|