![]() |
need help with vB variables or queries regarding new posts/daily posts
i was wondering if there was a built in variable for vB that would tell you how many new posts there have been since you last visit, and how many posts there have been that day.
View New Posts (234) | Today's Posts (234) i want something like that. now if there is a variable like $bbuserinfo or $pmbox that could give me this information that would be great. if not, could someone give me the 2 queries i would use to gather this information. |
nope, there isn't such a variable, as it would produce extra queries which should be avoided
the sql would be: [sql]SELECT COUNT(postid) AS newposts FROM post WHERE dateline > $bbuserinfo[lastvisit][/sql] |
ok cool, what about how to select for daily threads.
i'm not worried about extra queries because it is going on a non-vb page that only has a few so it won't be adding anything extra to the message board. |
i got an error when i ran this:
PHP Code:
Code:
Invalid SQL: SELECT COUNT(postid) AS newposts FROM post WHERE dateline > $bbuserinfo[lastvisit] |
use doublequotes instead of single quotes and it will work :)
|
ok that worked thanks. now what do i change in the query to make it so it gives the count for the getdaily search?
the reason i ask is i think from looking at the database the times are stored in unix_timestamp format. but i don't think php has a unix_timestamp function, just mysql. PHP Code:
|
i think i might have it. lemme know if this is correct:
PHP Code:
|
you can use the mktime() function ;)
|
All times are GMT. The time now is 10:02 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|