show effective subscriptions for a sub forum

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

show effective subscriptions for a sub forum

nnako
Hello,

using [Options] > [Subscribe via email] users can subscribe to eMail notifications  for a particular sub forum. Which is great!

Now, I as a site admin want to know, who has been subscribed to a particular sub forum. So, I use [Options] > [Users] > [Manage subscribers] to see any subscribers on the [Current subscribers] tab on the new page. But what I see is not the exclusive list of subscribed users, but just a subset. There can still be some more subscriptions for this sub forum which have been made e.g. for the main forum page. But these are not visible here.

So, in order to get the effective list of all subscriptions, I have to repetetively go up the sub forum tree and check for further subscriptions.

Is there a way to view ALL subscriptions for a particular sub forum on ONE page? Maybe using NAML?

Thanks.
nnako
Reply | Threaded
Open this post in threaded view
|

Re: show effective subscriptions for a sub forum

Pedro
Usually, when you are subscribed to one forum, you are also subscribed to its descendants.
So, we can do something like get all ancestors subscribers of the current sub forum.
Take a look here:
http://pedro-3.1104361.n5.nabble.com/2-f4161.html
it's the sub forum 2, inside mbox, inside Pedro 3
Pedro 3 › mbox › 2
And here the list of subscriber to sub forum 2 and all the ancestors ( mbox and Pedro 3)
http://pedro-3.1104361.n5.nabble.com/template/NamlServlet.jtp?macro=manage_subscribers&node=4161
Did you understand? What do you think?
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: show effective subscriptions for a sub forum

nnako
Hi Pedro,

thanks for your answer.

Unfortunately, I have no access to the 2nd link you sent in your last post:
http://pedro-3.1104361.n5.nabble.com/template/NamlServlet.jtp?macro=manage_subscribers&node=4161

Even after creating myself a user on your test site. Seems to me that I have not the necessary rights to see what you see:

access restriction message

Could you try again?

Thanks.
nnako
Reply | Threaded
Open this post in threaded view
|

Re: show effective subscriptions for a sub forum

Pedro
Of course, Manage subscribers area is only accessible for admins. Take a look:
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: show effective subscriptions for a sub forum

nnako
Thanks for answering, Pedro. Yes, this looks quite suitable to solve the problem I mentioned: Knowing who would get a notification when I post something within this particular sub forum. But I still don't understand how to practically use or apply what you showed. Why don't you just go on explaining further?

I see, it already works on your installation? But how can I access it (I mean get the necessary code and pointers) to make it happen on my system? I would be happy if you could either provide an implementation of this feature for general usage within the Nabble platforms or at least post some NAML code here in the forum so that I (and others) could benefit from it by trying it out ourselves.

Please, explain a bit more, Pedro. Thanks.
nnako
Reply | Threaded
Open this post in threaded view
|

Re: show effective subscriptions for a sub forum

Pedro
Ok, I meant to show you how it could looks like.
Please, override your list_subscribers macro:
<override_macro name="list_subscribers" requires="node">
    <n.if.is_submitted_form>
        <then.process_unsubscription/>
    </n.if.is_submitted_form>
    
    <n.put_in_head.>
        <style type="text/css">
            table.subscriptions {
            border-collapse:collapse;
            margin-top:1em;
            clear:both;
            width:100%
            }
            table.subscriptions th {
            padding: .3em .6em;
            text-align:left;
            border-bottom-style:solid;
            border-bottom-width:2px;
            }
            table.subscriptions td {
            padding: .5em;
            }
        </style>
    </n.put_in_head.>
    
    <n.zebra_table_javascript table_selector="table.subscriptions"/>
    
    <n.subscribers_pagination/>
    
    <div>
        <n.ancestors_list. order="reverse">
            <n.loop.>
                <br/>
                Inside: <h3><n.current_node.node_link/></h3>
                <n.current_node.subscriptions. start="[n.subscriber_page_index_record/]" length="[n.subscriber_page_length/]">
                    <n.if.has_more_elements>
                        <then>
                            <table class="subscriptions">
                                <tr class="shaded-bg-color">
                                    <th class="medium-border-color"></th>
                                    <th class="medium-border-color"><t>Name</t></th>
                                    <th class="medium-border-color"><t>Email</t></th>
                                    <th class="medium-border-color"><t>Subscription Type</t></th>
                                    <th class="medium-border-color"></th>
                                </tr>
                                <n.loop.>
                                    <tr>
                                        <td style="width:30px;padding:0"><n.subscription.user.avatar/></td>
                                        <td class="nowrap"><n.subscription.user.user_link/></td>
                                        <td class="nowrap"><n.subscription.user.user_email/></td>
                                        <td class="nowrap"><n.subscription.type_label/></td>
                                        <td class="nowrap"><n.subscription.unsubscribe_button/></td>
                                    </tr>
                                </n.loop.>
                            </table>
                        </then>
                    </n.if.has_more_elements>
                </n.current_node.subscriptions.>
                <br/>
            </n.loop.>
        </n.ancestors_list.>
    </div>
    
    Inside: <h3><n.node_link/></h3>
    <div class="weak-color" style="float:left;margin:.5em 0">
        <n.one_or_many.page_node.subscription_count>
            <one_text><t>subscriber</t></one_text>
            <many_text><t>subscribers</t></many_text>
        </n.one_or_many.page_node.subscription_count>
    </div>
    
    
    
    <n.subscriptions. start="[n.subscriber_page_index_record/]" length="[n.subscriber_page_length/]">
        <n.if.has_more_elements>
            <then>
                <table class="subscriptions">
                    <tr class="shaded-bg-color">
                        <th class="medium-border-color"></th>
                        <th class="medium-border-color"><t>Name</t></th>
                        <th class="medium-border-color"><t>Email</t></th>
                        <th class="medium-border-color"><t>Subscription Type</t></th>
                        <th class="medium-border-color"></th>
                    </tr>
                    <n.loop.>
                        <tr>
                            <td style="width:30px;padding:0"><n.subscription.user.avatar/></td>
                            <td class="nowrap"><n.subscription.user.user_link/></td>
                            <td class="nowrap"><n.subscription.user.user_email/></td>
                            <td class="nowrap"><n.subscription.type_label/></td>
                            <td class="nowrap"><n.subscription.unsubscribe_button/></td>
                        </tr>
                    </n.loop.>
                </table>
            </then>
        </n.if.has_more_elements>
    </n.subscriptions.>
    
    <n.subscribers_pagination/>
</override_macro>
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: show effective subscriptions for a sub forum

nnako
Hi Pedro,

thanks for the code. It works fine :-)

Here a suggestion for a possible improvement:

With the new code for the "list_subscribers" macro, when there are persons subscribed for the main forum AND one or more subsequent sub forums, these persons appear more than once in the new subscriber list: one time for each sub forum level. This makes it, again, necessary to go through all separate lists, which are on one page, though. Would it be possible to generate just ONE list, where every subscriber who gets notified regarding the particular sub forum appears just ONCE? Even an alphabetical order might help speed up the manual subscription check.

What do you think?

Thanks.
nnako