1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Number of Unread Posts

Discussion in 'XenForo Development Discussions' started by nrep, Sep 12, 2011.

  1. nrep

    nrep Well-Known Member

    Would it be easy enough to make a mod that shows the number of unread posts since the last visit? I'm trying to add this number in to the header template, but I can't find an existing mod or variable.

    If anyone can point me in the right direction that would be a big help!
     
  2. James

    James Well-Known Member

    PHP:
    /**
         * Gets the IDs of threads that the specified user has not read. Doesn't not work for guests.
         * Doesn't include deleted.
         *
         * @param integer $userId
         * @param array $fetchOptions Fetching options; limit only
         *
         * @return array List of thread IDs
         */
        
    public function getUnreadThreadIds($userId, array $fetchOptions = array())
    XenForo_Model_Thread, line 450. You should be able to run that and return the results using the $viewParams inside your extended ControllerPublic.
     
  3. Lu Kas

    Lu Kas Active Member

  4. racersimage

    racersimage Active Member

    Anyone ever figure out how to display the number of unread posts since the last visit?
     
  5. MOZ

    MOZ Well-Known Member

Share This Page