The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
And I'm not sure what's wrong, I tried 3 different things:
I had Cyb's Advanced New Posts installed 3 different times before, but it suddenly stopped working the 4th time. It always shows "New Posts: 0," and on different styles, so that's not it. I also tried these codes: https://vborg.vbsupport.ru/showthread.php?t=75539 (inserted it to index.php, since I couldn't find the template, and later $newposts into the template) Code:
//New Posts $getnewposts = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= '$bbuserinfo[lastvisit]'"); $newposts = number_format($getnewposts['count']); //New Posts Code:
$newposts = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post AS post " . iif($vbulletin->options['threadmarking'], 'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . " WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] . iif($vbulletin->options['threadmarking'], ' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)')); EDIT: O.O I just notice vb.org also has something like that. How is it done? |
#2
|
||||
|
||||
![]()
Maybe I posted this in the wrong section? I dunno, I'm new here >.<
|
#3
|
|||
|
|||
![]()
I don't think the Wordpress code is going to work n vb. You could try that other code, but you need to change $DB_site to $db or $vbulletin->db.
|
#4
|
||||
|
||||
![]()
Nope, it didn't work.
I don't know, maybe it has something to do with not displaying Ajax properly? It doesn't make that much sense, seeing how it worked before on the same server and vB 3.8, but still, I'm quite desperate, and I saw Ajax doesn't always work like intended now. Any ideas how to check that? |
#5
|
|||
|
|||
![]()
You could try this:
Code:
//New Posts $getnewposts = $vbulletin->db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= '".$vbulletin->userinfo[lastvisit]."'"); $newposts = number_format($getnewposts['count']); //New Posts |
#6
|
||||
|
||||
![]()
Hmm, it still didn't work. It might not be the code itself, since I noticed the rainbows script doesn't want to work either. Could it be that a server setting or something is blocking certain scripts? Or doesn't give access to read data?
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|