Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.


This discussion is related to the Notifi addon.
SubJunkSubJunk ✭✭
edited November 2009 in Vanilla 1.0 Help


  • Uploaded version 1.3.1 of Notifi.
  • Hello, Klaus.
    First of all thanx for your efforts.
    I added this extension to my forum but when I try to subscribe for a discussion or a category, it simply cannot. I created a user for you in my forum.

    Could you please have a look at the situation. Thanx.
  • We have identified the problem and it is an incompatibility with another extension called Low-Cal Vanilla. I will attempt to find a fix but in the meantime I have made an "Incompatibilities" section in this extension's description to let people know.
  • I have "Notify" extension on my internal forum. If I upgrade to your extension, will it keep all my existing notification subscribed by users? Is it still using same tables? I want to upgrade to this one rather than having an inactive extension (if I can), but I don't want to loose my existing subscriptions for notifications. That will just be a hassle for users.

  • I've made no changes to the tables except for the name of the main one, because I didn't want any conflicts with Notify.
    It used to be called prefix_Notify, now it's called prefix_Notifi, where "prefix_" is of course your Vanilla table prefix, which I think is "LUM_" by default.
    But what you can do is easily get an export of your current database, grab the part with the Notify table, then just replace "Notify" with "Notifi" and run the code to insert it, effectively copying the Notify table to the Notifi one.
    If you want more specific instructions my email address is in the extension, it would be easier to help if I can ask questions about your setup. It should be very simple, though.
  • Hm. Is it possible to extend this to both sending out the new post and having an option as to weather or not it should send out for every new post in the subscribed forum - and not only once?

    I would love to have a plugin for subscribing via e-mail.
  • I've just tried installing this extension, and am not having too much luck.

    Basically, I click on a discussion to be subscribed, and the little swirly loading thing just spins for ever (or at least, as long as I waited) :)

    It hasn't made any difference to the settings and when I reload, or view my notification settings under my account settings, everything is unticked.

    any help appreciated.. thanks
  • To Daniel_SJ:
    That is a good idea, I will try to implement that in the next release.

    To tekhammer:
    What other extensions do you have? That is the same thing that happens if you have the extension Low-Cal Vanilla 0.4.3 enabled. This plugin has been tested on fresh installations of Vanilla and it works perfectly, so the only thing that can be interfering is other extensions.
    Try disabling your extensions one by one, each time checking if Notifi works. When it works you will know which extension is causing the problem, then if you can tell me which one it is that will be very helpful for me.
  • disabled all others, and still not working. just twirls forever..

    the other extensions are Buy A Drink 1.1, Discussion Filters 2.0, and Preset Avatars 1.0.
  • I just added this discussion and did the following to use this extension rather than "Notify":

    - Renamed PREFIX_Notify table to PREFIX_Notifi (backed up old table)
    - Renamed NotifyId to NotifiId in new table

    I found following statement in line 152 of default.php

    mysql_query("UPDATE `LUM_User` SET SubscribeOwn = $Switch WHERE UserID = $UserID",$Context->Database->Connection);

    I changed it to following to have my prefix as it is different from "LUM_"
    mysql_query("UPDATE ".$Context->Configuration['DATABASE_TABLE_PREFIX']."User SET SubscribeOwn = $Switch WHERE UserID = $UserID",$Context->Database->Connection);

    In any case, this wont work for me as I dont have SubscribeOwn column in User table. can you please explain what it is?

    Also, I want to be able to add Comment added (because of which notification is generated) in the email body. I noticed that you have $mComment in the array. I tried adding {comment} in the email body but it's adding nothing and when I tried to find where $mComment is defined, I couldn't find anything.

    How can I put comments in the body? Please help.

    EDIT: I have some categories which are only available to certain roles. Some of the users on my forum have subscribed to ALL discussions. Will they get notification even if they can't see this category where a new comment is posted? I can ask some of the users to make sure but I want to ask you, as author of this extension, to confirm.

  • To iamspammer:
    The SubscribeOwn column is just a switch that when enabled (by entering "1") means that user will be automatically subscribed to discussions they start. It isn't a fully implemented feature, but I plan to make a better control panel for the next release, which will allow users to use that feature, among others.
    Users will only be notified if they have permission to view that category.
    I might add the ability to put more information in the email body at a later date, once I have finished with some other new features.

    To tekhammer:
    I don't know what the problem could be, it has worked for many others so maybe an old extension left something over that is breaking it, or you/someone have edited the code manually. Maybe you should try a fresh install.
  • Uploaded version 1.4 of Notifi.
  • To iamspammer:
    The SubscribeOwn functionality now works (when the user has the SubscribeOwn column, of course :))
  • Sub Junk: That is a good idea, I will try to implement that in the next release.
    Cool! Please tell me if you want any help or ideas, would love to see this but ain't too good at php myself.
  • I didn't put it in this release as you can see, but definitely in the next one which won't be too far away, probably next weekend as that seems to be the only time I can work on this at the moment.
    Also, at the risk of opening Pandora's Box by posting this publicly, sure I am always happy for help and ideas. Vanilla is used so differently by everyone I'm sure there are great features I have never even considered.
    • I don't know what the problem could be, it has worked for many others so maybe an old extension left something over that is breaking it, or you/someone have edited the code manually.
    it's only been running 4 days.. no old extensions..
      Maybe you should try a fresh install.
    you're a windows user aren't you? :)

    hitting it in the face with a sledgehammer isn't a solution.

    No big deal though, I don't need Notifi. It's not a show stopper for me.
  • I run 4 OS's; 2 Linux distros, XP and Vista.
    Sorry to lose you and your helpful opinions.
  • I have updated to new version. I have also checked that, those new columns (SubscribeOwn and SubscribedEntireForum) are added to table.

    But, how do we turn these on? I looked inot "Forum preferences" but couldn't find anything which says to subscribe to your own discussion.

    Also, any ETA when you will add that "comment in email" feature? I was hoping soon but I understand it will be on your own schedule.

    BTW, thanks for all the updates and fixing bugs.

    You asked for new features. One of the users requested that it'd be good if they continue to get emails even if they don't visit forum after getting one notification. It can be configurable and by default users will only get one email and until they visit forum, they won't get any other emails. But, they can go to "Forum Preferences" and then turn on notification even if they don't visit forum.

    Users claim that they sometimes forget that they received email and then they keep on waiting for another email but they won't get any because they forgot that they have to visit forum once after a notification.

  • I added following code at line 143. This is work around to add comment in the email until you come up with the solution. Just wanted to post it here in case anybody needed it now.

    $result = mysql_query("SELECT Body FROM ".$DiscussionForm->Context->Configuration['DATABASE_TABLE_PREFIX']."Comment WHERE CommentID = '$CommentID'");
    $row = mysql_fetch_row($result);
    $mComment = str_replace('

    Problem is that Vanilla Email only supports plain text now. I can change it to HTML but then I'll have to your email_notify.txt to include
    for new line and other HTML code for link.

    I din't want to do this because if you submit any updates, and if I forgot to change it then all users will complain.

    So, work around for now is

    $mComment = str_replace('

    This will change
    to new line and strip all html tags like

    and so on. This will loose all formatting in the email but this is the workaround for now. Hopefully you have something else planned.


    To send an HTML email, you can ask users to change library/Framework/Framework.Class.Email.php line.

    They can ADD following at line 33

    var $ContentType = 'text/plain';

    ADD Following at 103
    $this->ContentType = 'text/plain';

    and UPDATE following with 144

    .'Content-type: '.$this->ContentType.'; charset='

    All it does is, change Static content type to variable based.

    Then you can change it from your class like $e->ContentType = 'text/html';

    Like I said, I din't do this on my forum in the hopes that you'll have another sophiticated work around this problem.


  • To iamspammer:
    I will hopefully release the new version, 1.5, in a few hours. I have made a lot of changes for this version (I think a .5 version should always mean pretty big changes, I'm just a romantic like that :p) and I wouldn't be surprised if the feature of having the comment in the email is in this version.
    Oh and the setting SubscribeOwn setting is controlled by each user by going to the Notification section in the Account tab. There, the option is "Automatically subscribe me to discussions I have started "
  • Uploaded version 1.5 of Notifi.
  • Upon activating this addon, I am getting a page of errors:

    Notice: Undefined index: NOTIFI_VERSION in mysiteurl/forum/extensions/Notifi/default.php on line 31

    Notice: Undefined index: NOTIFI_VERSION in mysiteurl/forum/extensions/Notifi/_includes/upgrade.php on line 2

    Notice: Undefined index: NOTIFI_VERSION in mysiteurl/forum/extensions/Notifi/_includes/upgrade.php on line 3

    Fatal error: Class 'ConfigurationManager' not found in mysiteurl/forum/extensions/Notifi/_includes/upgrade.php on line 5

    What the heck is happening??
  • I installed new version and it worked fine for me except a bug which a user just reported to me.Thanks for all the options. I just tested the one where users get repeated email even if they haven't visited the forum and it works flawlessly.

    When a new discussion is added, email doesn't include comment. It's empty. I tried to see how to correct it but I am not sure. Can you please tell me how "NotifiDiscusison()" function is called? I can't seem to find any reference which call this function. I am not sure how you call it but if you let me know then I can help you debug it for new problems as my forum uses it extensively.

    Also, I think it'd be good idea to include DiscussionTitle in every email. The reason is, when users get email with comment, they are not able to tell which discussion that comment belonged to in the email.
  • Uploaded version 1.5.1 of Notifi.
  • Ok, deleting my old comment as that problem was fixed in the release released while I was writing it. ;)

    Now it installs without a hitch, but still doesn't seem to work. I'll try to clean up the mess caused by Notify and earlier versions of Notifi and see if that helps, but I don't really understand why it doesn't work.

    This is what happens:
    After I've installed (installing works! Yay for 1.5.1) the link to subscribing appears as it should (and just like it did with the old Notify), however pressing it does nothing at all, just takes me to the front page. It looks like the JS isn't loaded or something.
  • Here are some more details:

    The following notfi.js is included in the header:
    <script type="text/javascript" src="/foobar/extensions/Notifi/functions.js"></script>

    The following links are included:
    <a href="./" id="SetNotifiAll" onclick="PNotifiAll('Abonner p&aring; Foobar', 'Avsultt abonnement p&aring; Foobar'); return false;">Abonner p&aring; Foobar</a> <a href="./" id="SetNotifiCategory_3" onclick="PNotifiCategory(3,'Abonner p&aring; denne kategorien', 'Avslutt abonnement p&aring; denne kategorien'); return false;">Abonner p&aring; denne kategorien</a> <a href="./" id="SetNotifiDiscussion_115" onclick="PNotifiDiscussion(115,'Abonner p&aring; denne diskusjonen', 'Avslutt abonnement p&aring; denne diskusjonen'); return false;">Abonner p&aring; denne diskusjonen</a>
    (The &aring;s come from this being on a norwegian installation. )

    Clicking these links does seemingly nothing.
  • There will be another bugfix release within a few hours, thanks for the feedback guys, and sorry for the bugs. I'm aware that 1.5.1 doesn't fix everything but I just wanted to release something ASAP to show I am working on it and to fix some of the problems. Expect 1.5.2 very soon.
  • Sounds good. ;)

    Another thing:
    The ajax doesn't work on the config-page either (

    Which reminds me of another idea: Could you create fallbacks for people who don't use javascript? If you want help with it I can try to help out on that.

    You're doing great work!
  • Daniel, I can't reproduce the problem. I've tried with an old version of Vanilla that has had Notify and Notifi installed on it, as well as a fresh installation. Did you upload all the files, not just default.php? I changed a couple of files from 1.5.0 to 1.5.1. Also have you tried refreshing a page, or shift+refreshing? I use Firefox and sometimes it forgets to check for a new version of a JavaScript file until I very forcefully tell it to do so :p
  • To iamspammer:
    Yes you're right about the new discussion bug, I will look into that.
    NotifiDiscussion is called from the Notification page in the Account tab and only appears as an option if you have subscribed to a specific discussion. It is just the function that lets you unsubscribe from discussions via the Notification page.
    And yes I agree about the discussion title. I just threw in the comment in email feature quickly because I plan to see if I can send formatted emails instead of plaintext, then we can really customize the output, as you mentioned before in this discussion :)
Sign In or Register to comment.