posts since last visit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kisby
    Member
    • Apr 2002
    • 67

    posts since last visit

    On vB 2, whenever you came onto the board there was text that told you how many posts there were since your last visit. It was with the welcome message at the top. I don't see that now. How do I get that back?
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    There was a "View New Posts" link, but I don't remember there being the actual number. However, this can be added with a little custom code in your phpinclude_start template.

    Go to your:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> PHP Include Code Templates -> phpinclude_start

    Add this code:

    PHP Code:
    // GET NUMBER OF NEW POSTS
    $newposts $DB_site->query_first("SELECT count(*) AS count FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");

    // DETERMINE IF "POSTS" IS SINGULAR OR PLURAL
    if ($newposts[count] == 1)
    {
        
    $newposts[plural] = "";
    }
    else
    {
        
    $newposts[plural] = "s";

    Then go to your:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> FORUMHOME

    Add this code where ever you want the message to show up:

    Code:
    <a href="search.php?$session[sessionurl]do=getnew">$newposts[count] new post$newposts[plural]</a>

    Comment

    • Problemsolver
      New Member
      • Nov 2008
      • 28

      #3
      Originally posted by Jake Bunce
      There was a "View New Posts" link, but I don't remember there being the actual number. However, this can be added with a little custom code in your phpinclude_start template.

      Go to your:

      Admin CP -> Styles & Templates -> Style Manager -> « » -> PHP Include Code Templates -> phpinclude_start

      Add this code:

      PHP Code:
      // GET NUMBER OF NEW POSTS
      $newposts $DB_site->query_first("SELECT count(*) AS count FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");

      // DETERMINE IF "POSTS" IS SINGULAR OR PLURAL
      if ($newposts[count] == 1)
      {
          
      $newposts[plural] = "";
      }
      else
      {
          
      $newposts[plural] = "s";

      Then go to your:

      Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> FORUMHOME

      Add this code where ever you want the message to show up:

      Code:
      <a href="search.php?$session[sessionurl]do=getnew">$newposts[count] new post$newposts[plural]</a>
      I have vBulletin 3.7.4 and I do this but cannot find any php_include or anything with php really.

      Comment

      • peterska2
        Senior Member
        • Oct 2003
        • 8869
        • 3.7.x

        #4
        Please do not bump old threads. Please start your own thread in the relevant forum for the version of vBulletin that you are running. Thank you.

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...