Announcement

Collapse
No announcement yet.

Determining Who is Subscribed to a Forum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Determining Who is Subscribed to a Forum

    I need to figure out who all is subscribed to a certain Forum (channel), getting mail like this "A new post in your Forum Channel subscription: [Forum Name]".

    I'm perfectly happy to look at the MySQL tables to figure it out, but my top guess of the "subscribeforum" table turns up two different columns that look relevant, "subscribeforumid" and "forumid". Worse, none of the numbers in either match the Node ID that I see for the Forum when I look at the Channel Manager.

    Any way to figure this out would be great.

  • #2
    The subscribeforum table isn't a vBulletin 5 table. It would have been held over from a previous version. Though, it should have been deleted during normal upgrade processes.

    All subscriptions are actually held in the subscribediscussion table. Behind the scenes, there is little difference between a topic node and a channel node. As such, the system doesn't need multiple tables to hold this information. To get a listing of who is subscribed to what channel, you would have to query this table, join in the User table and restrict nodes from the node table based on their content type equalling the Channel content type (contenttype table). On a new install, this query will look like this:
    Code:
    select s.userid, u.username, s.discussionid, n.title from `subscribediscussion` as s
        left join `user` as u on (s.userid=u.userid)
        left join `node` as n on (s.discussionid = n.nodeid)
        where n.nodeid in (select nodeid from `node` where contenttypeid=23)
    If you know the specific channel, you can restrict n.nodeid to that channel in the WHERE clause.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • #3
      Originally posted by Wayne Luke View Post
      The subscribeforum table isn't a vBulletin 5 table. It would have been held over from a previous version. Though, it should have been deleted during normal upgrade processes.

      All subscriptions are actually held in the subscribediscussion table. Behind the scenes, there is little difference between a topic node and a channel node. As such, the system doesn't need multiple tables to hold this information. To get a listing of who is subscribed to what channel, you would have to query this table, join in the User table and restrict nodes from the node table based on their content type equalling the Channel content type (contenttype table). On a new install, this query will look like this:
      Code:
      select s.userid, u.username, s.discussionid, n.title from `subscribediscussion` as s
      left join `user` as u on (s.userid=u.userid)
      left join `node` as n on (s.discussionid = n.nodeid)
      where n.nodeid in (select nodeid from `node` where contenttypeid=23)
      If you know the specific channel, you can restrict n.nodeid to that channel in the WHERE clause.
      We don't seem to have a contenttypeid=23 but that otherwise provides a rational search. Thanks!

      Comment


      • #4
        The value would vary on upgrades. That is for a new install. You would have to look at your contenttype table and determine which one is the channel.

        select * from contenttype where class='Channel'



        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment


        • #5
          Got it & I think we solved the problem. Thanks much.

          Comment

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