vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Counting methods for new posts don't work (https://vborg.vbsupport.ru/showthread.php?t=272713)

Emeralda 10-24-2011 07:14 PM

Counting methods for new posts don't work
 
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 used on Wordpress
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)'));
None of the three options worked (plugin and codes), so maybe it's some setting on the forum that prevents counting up new posts? It did work on the same vB version on the same server before a reinstall.

EDIT: O.O I just notice vb.org also has something like that. How is it done?

Emeralda 10-29-2011 11:46 AM

Maybe I posted this in the wrong section? I dunno, I'm new here >.<

kh99 10-29-2011 02:43 PM

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.

Emeralda 11-05-2011 06:20 PM

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?

kh99 11-08-2011 11:57 PM

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


Emeralda 11-11-2011 02:58 PM

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?


All times are GMT. The time now is 06:33 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01079 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete