Skip to:
Content
Pages
Categories
Search
Top
Bottom

List subscribers of a forum

  • Hi,
    I’m using bbpress 2.5.8 on wordpress 4.2.4.
    My request seems so stupid, but I just don’t find it… How, as a wordpress admin, can I find a list of all the users that subscribed to new topics in a forum ? Any specific page ? Or even a SQL statement to the DB ?
    Thanks, Pascal.

Viewing 21 replies - 1 through 21 (of 21 total)

  • Shaktimaan
    Participant

    @umar007

    Subscribed. I asked same question a few days ago.

    And the answer was … ?


    Robkk
    Moderator

    @robkk

    @casiepa

    And the answer was … ?

    How to unsubscribe banned users to forums and new topics

    How, as a wordpress admin, can I find a list of all the users that subscribed to new topics in a forum ? Any specific page ? Or even a SQL statement to the DB ?

    Every user has a list of their subscriptions in their profile. You can show the user that if they want to unsubscribe, or you can switch to them and do it yourself.

    I had thoughts that listing users subscribed to a forum in a widget or an alternative, may be resource intensive.

    In phpMyAdmin, in the usermeta table normally called wp_usermeta with the meta-key wp__bbp_subscriptions.

    if a user has an ID of 3, and was subscribed to topics 10, 12 and 15, and forums 1, 3 and 6, you would see

    user_id 3
    meta_key wp__bbp_subscriptions
    meta_value 1,3,6,10,12,15

    OK, so we are at the same level for now as I found that out in the DB this afternoon 🙂
    I’m busy writing a function to display forums and users. Starting from the users I’m able to get the forums they subscribed to (I’m not interested in topics). But I would like to start the other way around, so from the forums and then loop my users, but how to I list all forums (or forum_ids) that exist ???


    Robkk
    Moderator

    @robkk

    There is a plugin I tested and works for displaying users subscribed to topics in a widget. I just changed anything saying topic to forum and it shows a list of subscribers of a forum. Hopefully that would help you for what you want.

    It may not work for BuddyPress group forums though.

    How to unsubscribe banned users to forums and new topics

    I don’t think it’s ethically correct to switch to another user 🙂 I have spent some hours on a new admin screen that shows my users, the roles I’m interested in and the forums I have. So it shows per user his/her role and if he/she did a ‘subscribe’ on forum level.
    Next step is to be able as admin to force (un)subscriptions at forum level (I’m not interested in topics). Will share when more advanced.
    Pascal.


    Robkk
    Moderator

    @robkk

    This is the plugin I meant before. In the other topic I didn’t make it work for Forums, but it seems to work fine when I edit the plugin myself and allow it to show forums instead.

    here is a plugin I tested and works for displaying users subscribed to topics in a widget. I just changed anything saying topic to forum and it shows a list of subscribers of a forum. Hopefully that would help you for what you want.

    https://github.com/easydigitaldownloads/bbPress-Topic-Subscribers

    If you are working on something, I would like to see the end result. Users have been asking for something to better manage user subscriptions, the best I could find is that widget. I would like to see what you can create.

    Hi Robkk,

    I have spent some evenings using for the first time WP_list_table and understanding the bbpress functions, but this is the plugin I have for the moment : http://casier.eu/dev/bbp-manage-subscriptions/

    I will also post it in the other thread.

    ALL REMARKS WELCOME!

    Pascal.


    Robkk
    Moderator

    @robkk

    @casiepa Thanks for creating a plugin to solve this problem for users. It is greatly appreciated. I have a few questions though.

    How do I use it??

    The setting are confusing me a little bit, and it doesn’t seem to show the subscriptions, but I do not really know where to manage them in the plugin. I just see a list of users with a button that says `[has role]’. I also do not think your plugin works for sub-forums/child forums of categories.

    How does it work exactly??

    I try to set it up, but I am still confused. Also there are a few errors while activating it with debug set to true in my wp-config.php file.

    define('WP_DEBUG', true);

    https://codex.wordpress.org/Debugging_in_WordPress

    Hi Robkk,
    If you have errors, you must have a weird configuration 🙂 Just joking.

    For the errors, you can send me what you got as errors. For the debug, I’ll have another look on a different wp installation I have and compare it.
    For me it works fine and does what it needs to do, but I only have 3 basic forums for now.

    On the settings page, you should be able to set the number of rows and if you want all users or just the ones from the visible roles (if you installed v1.1).
    Then you should get the list with all the roles on your system that you can flag as hidden.
    At the bottom you should get the list of all your forums (I did not add subforums, so will check that out !)

    On the main page, you should see a table with the name of the users, in blue the (non-hidden) roles and if users have that role (hasrole), then in yellow the last columns if users are subscribed or not. With a click on those buttons, you can change from subscribed to non-subscribed.

    Some screenshots : http://casier.eu/dev/bbp-manage-subscriptions/bbpms1.png and http://casier.eu/dev/bbp-manage-subscriptions/bbpms2.png

    Let me know how your system is different so I can replicate it here.

    Update: I just added first level of subforums, now need to make it recursive.

    Pascal.


    Robkk
    Moderator

    @robkk

    Oh I see how it works now. I had too many roles unchecked and it hid the forum subscription columns and I had to horizontal scroll the rest of the way.

    The error seems like something that doesn’t look too serious but here are some images of me running your plugin and bbPress by itself activated on my wamp server.

    Hi,
    Version 1.1.1 is publically available now on https://wordpress.org/plugins/bbp-manage-subscriptions/
    It handles the first level of subforums already now !
    Next first step is to check the warnings (like the ones you indicated).

    Any further input is welcome,
    Pascal.


    Robkk
    Moderator

    @robkk

    Thanks for putting your plugin on the repo 🙂

    If I had to say any more I guess I didn’t really like the colors and design of the table really. I think just using the regular WP List Table would be fine. That is just my opinion though.

    Hi Robkk,
    The colors have already changed in my current dev version (the colors were awful, I know) 🙂 But the reason is to easily see the difference between the roles, the forums and (in my dev version) the private groups of bbp-private-groups.
    New version coming soon…
    Pascal.


    PinkishHue
    Participant

    @pinkishhue

    Thanks for all the info above. I’ve added the ‘bbPress-Topic-Subscribers’ plugin and that works great.

    To try and do the same for forum subscriptions I’ve copied the files and changed all instances of ‘topic’ to ‘forum’, and it’s listing the users fine, but when you click the unsubscribe link nothing happens.

    Looking at the code, I think it must be something in this section that is not right:

    		$forum_id = bbp_get_forum_id();
    		
    		if ( $forum_id && current_user_can( 'moderate' ) ){
    			$subscribers = bbp_get_forum_subscribers( $forum_id );
    			if ( $subscribers ){
    				echo '<table style="width: 100%">';
    				foreach ( $subscribers as $subscriber ){
    					$subscriber = get_user_by( 'id', $subscriber );
    					echo '<tr>';
    						// avatar
    						echo get_avatar( $subscriber->ID, 45 );
    						echo ' ';
    						//username
    						echo $subscriber->user_login;
    						echo ' ';
    						// remove button
    						echo bbp_get_forum_subscription_link(
    							array(
    								'user_id'     => $subscriber->ID
    							)
    						);

    Specifically maybe the ‘bbp_get_forum_subscription_link’ area? Does anyone have any suggestions on why this wouldn’t work for forums in the same way as topics? Many thanks for any help you can give.

    @pinkishhue, I have subscription management in my ‘bbP Toolkit’ plugin that is on the w.org repository. Have a look if you find what you need in there.
    Pascal.


    PinkishHue
    Participant

    @pinkishhue

    Oh great, thanks @casiepa, now installed 🙂


    PinkishHue
    Participant

    @pinkishhue

    @casiepa Hi again, I don’t see an option to send you a private message but wanted to let you know I installed the plugin (thanks), but I’ve noticed it has altered the display of my subforums (removed the topic and voice counts, and made the font larger), even though I have not checked that option in the plugin settings.

    Here’s the info from the plugin if it’s any help.

    WP version 4.8
    Theme Make (child theme) 1.1.0
    PHP version 5.6.30
    bbPress version 2.5.12-6148
    site url (removed, on localhost XAMPP)
    Active Plugins Name and Version
    – p1 bbP Toolkit 1.0.10
    – p2 bbP shortcodes 2.8
    – p3 bbPress 2.5.12
    – p4 BuddyPress 2.8.2
    – p5 User Switching 1.0.9
    – p6 WordPress Social Login 2.3.3


    jgasba
    Participant

    @jgasba

    To anyone stumbling into this thread wondering how the subscriptions are stored in the database, it has been updated.

    To find out what users are subscribed to a topic or thread you need to look for the _bbp_subscription meta_key in the wp_postmeta table. There is one for each user subscribed where meta_value is the ID of the user subscribed.

    So for example, to know how many users are subscribed to a forum or topic, just count the number of _bpp_subscription metadata present with post_id of the specific forum or topic


    Ricsca2
    Participant

    @ricsca2

    It seems quite complicated to me…


    sayhi2lonnie
    Participant

    @sayhi2lonnie

    I’m sure once we get the hang of it, it won’t feel that way.

Viewing 21 replies - 1 through 21 (of 21 total)
  • You must be logged in to reply to this topic.
Skip to toolbar