The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Query Database to see if new Posts have been made (Forumhome)
Hello,
I am working on a new Theme for my forums and I am using static HTML for my index! That said, I can not use the regular lightbulb function of vBulletin. To see what my page looks like, please go here: http://www.kawaiination.com/uplo You can see what I would like to have if you browse to the BLUE category, the Offtopic forum. Something like "New Posts in Off Topic / Chit Chat (Post funny and ...)" Can someone help me how I can handle this? I found the function dealing with the regular lightbulbs in /includes/functions_forumlist.php But I don't know how I can do so I can use it in my HTML Page. Thanks for any help. Currently using vBulletin 3.0.X But planning to upgrade at a given time. |
#2
|
||||
|
||||
Perhaps take a look at how this mod does it and adapt as required.
https://vborg.vbsupport.ru/showthread.php?t=75320 |
#3
|
|||
|
|||
Hello,
thanks for the hint. I read through the TXT and think you mean this one, right? Code:
$postcount = $DB_site->query_first("SELECT COUNT(dateline) as pcount FROM ".TABLE_PREFIX."post WHERE dateline > ".$bbuserinfo['lastvisit']." "); Get the last post from the forum and check if it is newer or older than the last visit of the user? If this is the way it works, would this in any kind be inferior to the way an unhacked vBulletin handles the lightbulbs? I have tried to use your hack on a 3.5.4 forum. It does not work. It won't show anything in the templates. I would assume, the if() is not working at all. Is there something I am not aware of? Code:
unset($pcount, $rcount); if ($bbuserinfo['userid']) { $pcount = "No New Posts since your last visit."; $postcount = $DB_site->query_first("SELECT COUNT(dateline) as pcount FROM ".TABLE_PREFIX."post WHERE dateline > ".$bbuserinfo['lastvisit']." "); if ($postcount['pcount']) { if ($postcount['pcount'] == 1) { $pcount = "<a href='search.php?do=getnew'><b>1 New Post</b></a> since your last visit."; } else { $pcount = "<a href='search.php?do=getnew'><b>".$postcount['pcount']." New Posts</b></a> since your last visit."; } } |
#4
|
||||
|
||||
basically you're looking for
PHP Code:
|
#5
|
|||
|
|||
Thanks!
How can I check each forum? For example forum ids starting with 1 going till 20. My target would be something like an array where I can ask the forum: Code:
$newposts['$forumid'] |
#6
|
||||
|
||||
you'd change the query
PHP Code:
|
#7
|
|||
|
|||
Thanks a lot! I will try the last one tonight and give feedback as soon as possible.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|