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.

Notify

15681011

Comments

  • ONE quick way to add the Discussion title to the email subject line:

    Open Notify's default.php:
    Hit ctrl+F and search the page for the line (#Remove double inserted users) minus the parentheses:
    paste the code below just under the following default line "$e->HtmlOn = 0;":

    $result = mysql_query("SELECT Name FROM ".$DiscussionForm->Context->Configuration['DATABASE_TABLE_PREFIX']."Discussion WHERE DiscussionID = '$DiscussionID'"); $row = mysql_fetch_row($result); $mTitle = $row[0];



    just for reference: the end of the code above should end just above this deafult line "foreach($Notifieusers as $val)
    {"


    THEN REPLACE: $e->Subject = $DiscussionForm->Context->Configuration['APPLICATION_TITLE'].' '.$DiscussionForm->Context->GetDefinition('Notification');

    WITH: $e->Subject = $DiscussionForm->Context->Configuration[''APPLICATION_TITLE''].' "'.$mTitle.'" ';




    In the email_notify.txt in the Notify extension folder you can then ALSO include the title reference (something structured like):

    Hello {name}, A new comment/discussion was posted within the following topic to which you are subscribed. {title}: {topic_url}



    If it helps someone else
  • What about realisation of other tags that I see in php file (used in mail template) ? Like send comment to e-mail or person name...
  • Mhhh.. It's plugin too slow! What not use "PreSaveComment" controller here and do not use SQL queryes?
  • Hi,

    Thanks for a nice extension! However, there is one thing that seems to be wrong.

    Users seem to be notified about discussions in categories to which they do not have access to. This should definitely be checked when sending notifications. I do not want users who do not have access to some restricted categories to get notifications about messages posted into those categories.

    Please correct me if I'm wrong, but I think this is quite a critical fault in this extension.

    BR,
    Johan
  • Oh well, I already added the missing functionality myself.

    On row 224, in default.php of the Notify-extension, I added CategoryID to the query:
    $result = mysql_query("SELECT WhisperUserID,CategoryID FROM ...
    And then stored the result in a variable and build check lists for blocks:
    $WhisperUserID = $row[0]; $CategoryID = $row[1]; // Check for users who have blocked this category (do not notify them) $usersWithCategoryBlock = array(); $result = mysql_query("SELECT UserID FROM ".$DiscussionForm->Context->Configuration['DATABASE_TABLE_PREFIX']."CategoryBlock WHERE CategoryID = '$CategoryID'"); while(1) { $row = mysql_fetch_row($result); if(!$row) break; $usersWithCategoryBlock[] = $row[0]; } // Check for roles for which this category is blocked (do not notify them) $rolesWithCategoryBlock = array(); $result = mysql_query("SELECT RoleID FROM ".$DiscussionForm->Context->Configuration['DATABASE_TABLE_PREFIX']."CategoryRoleBlock WHERE CategoryID = '$CategoryID'"); while(1) { $row = mysql_fetch_row($result); if(!$row) break; $rolesWithCategoryBlock[] = $row[0]; }
    Then, starting from about row 276, the if statements in...
    while ($row = mysql_fetch_row($result)) if (($Whispered == 1 AND $WhisperUserID == $row[0]) OR ($Whispered == 0)) array_push($Notifieusers,array($row[0],$row[1],$row[2],$row[3]));
    ...should be surrounded with an additional if-statement:
    while ($row = mysql_fetch_row($result)) if(!in_array($row[0], $usersWithCategoryBlock) && !in_array($row[4], $rolesWithCategoryBlock)) { if (($Whispered == 1 AND $WhisperUserID == $row[0]) OR ($Whispered == 0)) array_push($Notifieusers,array($row[0],$row[1],$row[2],$row[3])); }
    Note, that there four of these if-statements to be completed and also note that some of the $row-variables are called $row2 instead of just $row.

    Ah, I almost forgot. Also add RoleID to the all the queries just before these if-statements:
    $result = mysql_query("SELECT UserID,Email,FirstName, LastName, RoleID FROM ...
    That should do it... Hope this helps to fix the issue.

    BR,
    Johan
  • can someone fix that?
  • Uploaded version 1.2.1 of Notify.
  • Added the fix which Dinoboff posted above to prevent this extension from causing faults with the rest of the forum. I have not added any of the potential new features as posted above as i am not aware of them having been fully tested. If someone wants to package them and test them then they are welcome to take over the extension with hutsteins agreement.
  • This extension is one that should work reliably.

    In my humble opinion, if it is not deemed worthy enough to be in the core, at least the developer (Hutstein) should be given full cooperation and assistance to make it work and work reliably.

    I only wish my skill set allowed me to help out.
  • small bug in default.php (around line 429)

    it causes trying to add script tags where it is not needed
    and it causes to break ajax if enabled extensions during ajax call (check last lines of appg/init_ajax.php) and therefore it is not possible to disable any extension then - it displays alert with error message about $Head not defined because it is not defined in init_ajax and it doesn't uninstall the extension

    this: if (in_array($Context->SelfUrl, array('comments.php','index.php','account.php','categories.php'))) $Head->AddScript('js/prototype.js'); $Head->AddScript('js/scriptaculous.js'); $Head->AddScript('extensions/Notify/functions.js');should beif (in_array($Context->SelfUrl, array('comments.php','index.php','account.php','categories.php'))) { $Head->AddScript('js/prototype.js'); $Head->AddScript('js/scriptaculous.js'); $Head->AddScript('extensions/Notify/functions.js'); }
  • That was the fix I added in the latest version :)
  • ah! sorry :) next time I should update to the latest version first :)
  • This extension gives problems to manage categories: it is not possible to change the order any more. The javascript error is: uncaught exception: script.aculo.us requires the Phototype JavaScript framework >= 1.5.0 Looking at the source of the page, I see that the order of the script tag in the head is: - scriptaculous.js - /extensions/Notify/functions.js - /js/prototype.js So scriptaculous.js is loaded before prototype.js and doesn't work. Is there a way to solve this problem ? Thanks.
  • Download the latest version.
  • I seem to be the only one getting this:

    A link to the server could not be established in /home/.batzi/cbabas/cbabaseball.com/board/extensions/Notify/default.php on line 435

    That line is:
    if ($Context->Session->UserID > 0)
    mysql_query("UPDATE ".$Context->Configuration['DATABASE_TABLE_PREFIX']."User SET Notified = 0 WHERE UserID = '".$Context->Session->UserID."'");
  • Minisweeper: I use Notify 1.2.1 (downloaded today) with Vanilla 1.1.4 and now the problem seems to be given only by Safari 1. Thanks
  • I've a feeling the drag and drop never did work in Safari 1. I might be wrong.
  • Is it just me, or do {user}, {title} and {comment} not equal anything in email_notify.txt?

    Also, {topic_url} refers to an "ugly" permalink, rather than the "pretty" mod_rewrite permalinks I have set up. Any ideas?

    If I can get all the code worked out, I may be able to continue some development on this.
  • I cannot move the categories up and down when i have 'notify' installed
  • I have this problem either. I guess it is something with order or loading prototype.js and scriptaculous.js
    Just have had no time to find the cause
This discussion has been closed.