Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Notification extension 0.2

edited October 2006 in Vanilla 1.0 Help
Because nobody else is making an extension for notification. I will try if i can do it, I don't know if I'm able to create one, but I need it for my forum.

My idea is, that the user can mark the complete forum, single categories and single discussions to be notified. But where should i place the notify links?

I've two ideas:

1. for the discussions: at the index.php on each discussion label behind the New x, for the categories: at the categories.php behind Options: Block Categories

2. for the discussions: at the comments.php on the Panel, for the categories: if a category is selected on the Panel

What would you think, is the best way?
«134

Comments

  • Options
    I've decided to make the second variant, and it works fine. I've added a point "Notification" to the Panel and below there are "Notify All", "Notify Category" or "Notify Discussion". Everything works with Ajax and the Notify / Unnotify function works fine.

    Now I've to make it work, that mails are sent, when new posts are created.

    Another thing is, that for example Notify Discussion won't appear when the Category or the complete Forum is already activated...
  • Options
    I've got a little problem:
    How can i detect the Category of the actually selected Discussion?
    I only have the DiscussionID, but I don't know how i get the CategoryID?
  • Options
    ithcyithcy New
    edited May 2006
    join the discussions table to the comments table on the discussion id. the category id is in the discussions table. the sql would be something like:
    SELECT d.CategoryID FROM `LUM_Comment` c LEFT JOIN `LUM_Discussion` d ON d.DiscussionID = c.DiscussionID WHERE c.CommentID = whatever_your_comment_id;
    there is a Join method in SqlBuilder but i've never had to use it.


    //actually you could do it without an explicit join like this:
    SELECT d.CategoryID FROM LUM_Comment c, LUM_Discussion d WHERE c.DiscussionID = d.DiscussionID AND c.CommentID = whatever_your_comment_id
  • Options
    Thanks for your work on this. Forgive me if I miss this but are you also building in the option to have the user notified on replies to discussions they participate in (or start)? I'd think that would be a good option and have the user be able to decide whether or not they want this turned on.
  • Options
    @ithcy:
    Thanks, I thougt there is an easier method to do this, but OK

    @talkshoe
    Yes that's a very good idea, but I will integrate this, when the rest is finished, because it only needs to add the notification setting when the user posts something
  • Options
    see my edits :)
  • Options
    I've done it like this:
    SELECT CategoryID FROM `lum_discussion` WHERE DiscussionID = '$DiscussionID'
  • Options
    or that!

    *needs more sleep
  • Options
    I definitely understand, just wanted to see if it was on your radar (or someone else's). Looking forward to this and the official release of 1.0. Our project is in beta and we'd like to use Vanilla during the beta testing and then after release. Not to go way off-topic but our it has gotten raves.
  • Options
    edited May 2006
    I try to make an page on the account tab, but it doesn't work...
    class NotifyDisplay extends PostBackControl { var $Name; // The name of this form function NotifyDisplay(&$Context) { $this->Constructor($Context); if ($this->PostBackAction == 'Notification') { echo '<div id="Form" class="">'; echo 'test'; echo '</div>'; } } } $NotifyDisplay = $Context->ObjectFactory->NewContextObject($Context, 'NotifyDisplay'); $Page->AddRenderControl($NotifyDisplay, $Configuration['CONTROL_POSITION_BODY_ITEM'] + 80); if (in_array($Context->SelfUrl, array('account.php')) ) $Panel->AddListItem($Context->GetDefinition('AccountOptions'), 'Notification', GetUrl($Context->Configuration, $Context->SelfUrl, '', '', '', '', 'PostBackAction=Notification'), '', '', 92);

    but the code is added at the top of the complete page, how can I make, that it's display at the right place?
  • Options
    The extensions works:
    The user can subscribe to the complete forum, an category or a specific discussion. If a user has already subscribed to the complete forum, he's not able to subscribe to a category or a discussion and if a user has already subscribed to a category he can't subscribe to a discussion.

    If the user has predefined to be notified about answers to his own discussions, the Discussion Notification for all discussions created by him, are set automatically and he can also disable the notification for his own discussions.

    Every user is only once notified until he visits the forum again.

    the next things, i've to do now:
    - notification for comments, actually it works only for creating new discussions
    - creating a new page on the account tab, where all notifications are displayed and can be deleted, there will also be the setting for notification on own discussions

    If anyone has some ideas, please post it here
  • Options
    I dont have an install to try it out and i cant think of much else to add but if it all works like you say it seems like you've done a pretty good job on this! I'm sure a lot of people will be very thankful. Make sure you get it on the addons dir though :)
  • Options
    yes when it's completed i will post it in here to be tested and when all bugs are removed i will get it on the addons directory.

    The Notification for comments is done, but my problem is the page in the account tab won't work...
  • Options
    I haven't installed vanilla yet, (waiting for the official 1.0 release) but the first thing that jumps to my mind is a way for admins to turn that off on a users account. That way, if they get complaints about the board "spamming" a long forgotten user, they can easily manage it. I also wasn't clear on this, but will they be able to unsubscribe from their own notifications via a link in the notification email?
  • Options
    The first beta is ready, you can download it here

    please test it and if you find bugs post it in this thread. Also if you have some ideas to make the extension better, you can post it here.

    I hope you enjoy the extension
  • Options
    to hutstein:

    an extension to send an e-mail to all forum users (like newsletter) would be nice, too :))
  • Options
    That should be a seperate extension though imo.
  • Options
    @uzi: Download. You can download it here, and test it. I haven't tested it much. But it should work...
  • Options
    WOW Hutstein! I will test it ;)
  • Options
    uziuzi
    edited May 2006
    For Notification Extension I get this error aften enabling it in the extensions menue:

    "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/s16u38/html/hessen/lussumo/extensions/Notify/default.php on line 45"

    For NewsMailer this error comes after "sending" a message:

    "Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /var/www/s16u38/html/hessen/lussumo/extensions/NewsMailer/default.php on line 33
    Newsmailer

    The message was sent."


    the emails don't come....
This discussion has been closed.