Who is in? Plugin



  • This is a light weight RSVP plugin . For example you can use this to ask people to join an event or express their interest in a topic, right from inside a post. The source code is on github.

    npm install nodebb-plugin-whoisin

    Once you activate the plugin, you just have to ask the magic phrase: who is in? in a post
    The plugin will automatically replace that question with a widget like this:

    Selection_044.png

    Now every user can easily add themselves to that list, or remove themselves if they change their mind. Currently only one unique whoisin widget can be added to each topic.

    This is my first plugin for NodeBB. Any feedback, feature requests or bug reports will be much appreciated! πŸ™‚

    I hope some people will find this useful.



  • Very interesting mate, love the idea - and published with plenty of time left πŸ™‚
    I believe there's a calendar plugin under development. Perhaps the two could potentially mesh together down the road.



  • Really nice idea, though might I suggest something like

    /(?:who is|who's) in\?/gi
    

    to capture the text.


  • Plugin & Theme Dev

    Nice! Is there source available yet?

    How do you parse the "who is in" string? What happens if someone puts it in the middle of a sentence? Does it also work on every post in a topic of just first post?



  • @Schamper said:

    Nice! Is there source available yet?

    How do you parse the "who is in" string? What happens if someone puts it in the middle of a sentence? Does it also work on every post in a topic of just first post?

    Looks like it's just a direct replace on each post, not just the first.

    postContent = postContent.replace(/Who is in\?/gi, mainTemplate);
    

  • Plugin & Theme Dev

    @xbenjii kind of dangerous, any post with the magic string in it somewhere would get a match. Might not always be the expected behaviour.

    Personally, I'd do something like /^Who is in\?$/gim, but that's me πŸ˜›



  • @Schamper said:

    @xbenjii kind of dangerous, any post with the magic string in it somewhere would get a match. Might not always be the expected behaviour.

    Personally, I'd do something like /^Who is in\?$/gim, but that's me πŸ˜›

    If you wanted to add some sort of description though, that wouldn't work. πŸ˜› Maybe create a template, something like:

    Some text.
    {who-is-in}
    Some more text.
    

    Then you could do

    /\{who-is-in\}/gi
    

  • Plugin & Theme Dev

    @xbenjii why wouldn't it work? That regex should work as long as there's a line with "Who is in?". You can have as much text around it in different paragraphs as you want. Maybe you didn't notice the m modifier?



  • @Schamper said:

    @xbenjii why wouldn't it work? That regex should work as long as there's a line with "Who is in?". You can have as much text around it in different paragraphs as you want. Maybe you didn't notice the m modifier?

    Whups, missed that xD. Just saw the start/end anchors.



  • Thanks for the feedback so far. Looks like most of you don’t really like the idea of looking for an ordinary sentence to insert the plugin. My thinking was that by doing so, some forum users will discover the plugin accidentally. Specially since you immediately see the plugin in the preview. But as was pointed out, this method of inserting the plugin is not very customizable.

    Perhaps, instead of playing the guessing game as to which sentence to capture, I should switch to a good old wordpress style plugin shortcode. Maybe something flexible like [whoisin] that would also support a couple of custom attributes, for example [whoisin add-btn-text="I am in!" remove-btn-text="Remove me" height="5rem"]. I think this way it will be easily customizable for each different use case.

    @Schamper I think I saw you had used wordpress style shortcode for some of you plugins. Is this a recommened format for inserting plugins into posts or does NodeBB has it's own shortcode style? Any other suggestions about the shorcode format, or what attributes should be customizable?

    Is there source available yet?

    Of course, here is the source code

    Thanks again for trying it out. This plugin is still very tiny and can be improved easily. So please keep the suggestions coming! πŸ™‚


  • Admin

    Nice, well if you don't win the whole thing, you're definitely well on track for winning the "new developer" prize πŸ˜›


  • Plugin & Theme Dev

    @arasbm Never really thought about it as Wordpress shortcode style, but I suppose it does look like that. I just tried to think of something that kind of looked like markdown, but I also looked at what syntax other forum software that use markdown are using for some features.



  • This is awesome,

    2 bugs for me,
    -cant click on anyone that "is in" ... redirects me to 404 error.
    -if i reply inside the same thread to create another "who is in" it works



  • @chas thanks for the report!

    cant click on anyone that "is in" ... redirects me to 404 error.

    Good find, I will fix it this weekend

    if i reply inside the same thread to create another "who is in" it works

    I am not sure what the right behaviour would be here. Should I limit the whoisin plugin to only the OP? My thinking was that it would be nice if anyone could start one in a discussion, and if someone else attempts to add another one, it will be just a copy of the first one.


  • GNU/Linux

    Nice work @arasbm



  • @meetdilip thanks mate! Don't forget to vote for "who is in" if you like the plugin πŸ˜‰


  • GNU/Linux

    @arasbm said:

    @meetdilip thanks mate! Don't forget to vote for "who is in" if you like the plugin πŸ˜‰

    I have already upvoted the first post, if that is what you mean πŸ™‚



  • @meetdilip No, I meant in the polls for the October plugin contest. Here are the links to the polls:

    You can vote in both πŸ˜‰ Thanks!



  • @arasbm said:

    I am not sure what the right behaviour would be here. Should I limit the whoisin plugin to only the OP? My thinking was that it would be nice if anyone could start one in a discussion, and if someone else attempts to add another one, it will be just a copy of the first one.

    I'd say first post only, but you could preserve the option through a configuration setting and let each forum admin decide for themselves.



  • +1 for first post only

    specifying a limit per event could be nice

    Still love the simplicity!


 

| |

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.