News:

Wondering if this will always be free?  See why free is better.

Main Menu

ENotify

Started by SMFHacks.com Team, October 18, 2009, 04:40:06 PM

Previous topic - Next topic

ms_ukyankee

#380
Of course I have a few members who don't like it so I've added a Profile option to disable it.

Profile.template.php, find:

</tr><tr>
<td colspan="2">
<input type="hidden" name="default_options[view_newest_pm_first]" value="0" />
<label for="view_newest_pm_first"><input type="checkbox" name="default_options[view_newest_pm_first]" id="view_newest_pm_first" value="1"', !empty($context['member']['options']['view_newest_pm_first']) ? ' checked="checked"' : '', ' class="check" /> ', $txt['recent_pms_at_top'], '</label>
</td>


Add after:

</tr><tr>
<td colspan="2"><label for="profile_enotify_disable">Enotifications</label>
<select name="default_options[profile_enotify_disable]" id="profile_enotify_disable">
<option value="0"', empty($context['member']['options']['profile_enotify_disable']) ? ' selected="selected"' : '', '>Enabled</option>
<option value="1"', !empty($context['member']['options']['profile_enotify_disable']) ? ' selected="selected"' : '', '>Disabled</option>
</select>
</td>


And in Load.php, find:

// enotify
global $settings, $modSettings, $scripturl;

$context['html_headers'] .=  '
<link rel="stylesheet" type="text/css" href="' . $settings['default_theme_url'] . '/jquery.jgrowl.css" />
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/enotify.js"></script>
<script type="text/javascript">
jQuery.noConflict();
(function($){
$(document).ready(function(){
        $.getJSON("' . $scripturl . '?action=enotify",
                function(data){
                  $.each(data.items, function(i,item){
                    $.jGrowl(item.message, { header: item.title, life: ' . $modSettings['enotify_life'] . ' });
                  });
                });
setInterval( function() {
          $.getJSON("' . $scripturl . '?action=enotify",
                  function(data){
                    $.each(data.items, function(i,item){
                      $.jGrowl(item.message, { header: item.title, life: ' . $modSettings['enotify_life'] . ' });
                    });
                  });
} , ' . $modSettings['enotify_refresh'] . ' );
});
})(jQuery);
</script>';
//end enotify


Replace with:

// enotify
global $settings, $modSettings, $scripturl, $options;
$options['profile_enotify_disable'] = !isset($options['profile_enotify_disable']) ? 0 : $options['profile_enotify_disable'];
if ($options['profile_enotify_disable'] == 0):
$context['html_headers'] .=  '
<link rel="stylesheet" type="text/css" href="' . $settings['default_theme_url'] . '/jquery.jgrowl.css" />
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/enotify.js"></script>
<script type="text/javascript">
jQuery.noConflict();
(function($){
$(document).ready(function(){
        $.getJSON("' . $scripturl . '?action=enotify",
                function(data){
                  $.each(data.items, function(i,item){
                    $.jGrowl(item.message, { header: item.title, life: ' . $modSettings['enotify_life'] . ' });
                  });
                });
setInterval( function() {
          $.getJSON("' . $scripturl . '?action=enotify",
                  function(data){
                    $.each(data.items, function(i,item){
                      $.jGrowl(item.message, { header: item.title, life: ' . $modSettings['enotify_life'] . ' });
                    });
                  });
} , ' . $modSettings['enotify_refresh'] . ' );
});
})(jQuery);
</script>';
    endif;
//end enotify


There's probably a better way than using the $options as a global.
Edited to correct undefined index.
SMF since 2004 <3

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

sharks

Hopefully, this can be added in the next release of this mod.

Sir Kaos

Forum version: 1.1.12
Theme: Reference
Enotify: 2.0

Looks like Enotify doesnt work fine with me. Sometimes it appears and sometimes it doesnt. And sometimes it appears when no one even replied or posted to threads.

help?
Learn to Listen, Listen To Learn

agent47

Amazing mod mate.
Great stuff!
I hope I'll be able to make a donation sometime.

PortaMx is probably the best SMF portal!

Sir Kaos

Quote from: Sir Kaos on January 04, 2011, 09:10:14 AM
Forum version: 1.1.12
Theme: Reference
Enotify: 2.0

Looks like Enotify doesnt work fine with me. Sometimes it appears and sometimes it doesnt. And sometimes it appears when no one even replied or posted to threads.

help?

anyone experiencing this issue?
Learn to Listen, Listen To Learn

!RFAN

enotify is conflicting with SA Facebook connect mod..
anyone experienced the same problem??

ms_ukyankee

Quote from: Sir Kaos on January 04, 2011, 09:10:14 AM
Forum version: 1.1.12
Theme: Reference
Enotify: 2.0

Looks like Enotify doesnt work fine with me. Sometimes it appears and sometimes it doesnt. And sometimes it appears when no one even replied or posted to threads.

help?

I notice that the notifications appear for me until I've read the thread or marked everything as read, have you tried this?
SMF since 2004 <3

Sirius OCTeam

Quote from: purplepaisley68 on January 16, 2011, 05:45:20 PM
Quote from: Sir Kaos on January 04, 2011, 09:10:14 AM
Forum version: 1.1.12
Theme: Reference
Enotify: 2.0

Same for me, I had to uninstall it, because of users complaints.
Looks like Enotify doesnt work fine with me. Sometimes it appears and sometimes it doesnt. And sometimes it appears when no one even replied or posted to threads.

help?

I notice that the notifications appear for me until I've read the thread or marked everything as read, have you tried this?

!RFAN

Quote from: !RFAN on January 07, 2011, 09:40:53 AM
enotify is conflicting with SA Facebook connect mod..
anyone experienced the same problem??

this error:

({ "title": "Notification Feed", "generator": "ENotify Modification for Simple Machines Forum", "items": [ ] })

mibodega

I'm getting an error message  -    Execute Modification   ./Sources/ModSettings.php   Test failed

1.1.12 - SMF Default Theme -Core

!RFAN

^^ you must have rcvd error notification during installation?

now you can manually edit your modsettings.php file


Tunz Master

I wish it worked great for me.....sometimes it's right on the money & other times 20 of them come thru at once???

http://bootlegtunzworld.org/communityarea/  is where it's installed if you wanna take a look?  maybe I have conflicting mods installed?

really like the idea & hope the bugs get worked out

thanks for the mod & good luck with it

Abavagada

I just installed this on SMF 1.1.12, and I also have SA Facebook Connect installed. It seems to not work at all when that is enabled. When it is disabled, it works randomly. I'm just testing it with PMs from one account to another.

Anyone know what is going on and/or have a fix? I have nothing in the forum error logs or server error logs.

!RFAN

Quote from: Abavagada on February 02, 2011, 10:11:49 AM
I just installed this on SMF 1.1.12, and I also have SA Facebook Connect installed. It seems to not work at all when that is enabled. When it is disabled, it works randomly. I'm just testing it with PMs from one account to another.

Anyone know what is going on and/or have a fix? I have nothing in the forum error logs or server error logs.

http://www.simplemachines.org/community/index.php?topic=343151.msg2917443#msg2917443

Stigmartyr

Compatibility Issue Found with: http://custom.simplemachines.org/mods/index.php?mod=2714

When I asked the above mentioned mod owner about why I couldn't install his mod with yours his reply was he didn't know how eNotify worked so....

On the 3rd of (3) edits to ./Sources/LogInOut.php the 'Remember Position' mod is looking for:

if (empty($_SESSION['login_url']))
redirectexit();




....I'm asking you guys.  ./Sources/LogInOut.php is already modified by eNotify that causes it to break.

What it wants to do is replace the above code with:


if (empty($_SESSION['login_url']))
{
//Let's see if the REFERER is empty if it's no, take the next step
if (!empty($_SERVER['HTTP_REFERER']))
{
//verify if we are in the login page or some other place.
if ($_SERVER['HTTP_REFERER']==$boardurl.'/index.php?action=login' or $_SERVER['HTTP_REFERER']==$boardurl.'/login/')
{
redirectexit(); //Let's go to the main page!
}
else
{
redirectexit($_SERVER['HTTP_REFERER']); //Go back to the page where we login
}
}
else
{
redirectexit(); //There's no HTTP_REFERER, go to the main page.
}
}






ANY INSIGHT into making that work with eNotify??

Abavagada

I removed the SA Facebook mod, and now Enotify works fine.

I have my forum integrated with a site, however, and would like Enotify to appear on the rest of it. I copied the main index header that loads the proper .js and creates some script. This works fine, but it only appears on window/tab if I have multiple windows/tabs open on the site.

Why does it only appear on one, and how does it decide which one to appear on?

Great mod!

Kolya

I cannot recommend this mod.

First it installs an ad-link in the copyright line. No other mod I've ever installed did this an I don't think it's appropriate.
Then it hits the server like an iron gloved fist, sending requests every 10 seconds for every member who's online. As Arantor has observed, this isn't even a mistake but by design. Just to give you an impression: In 5 days this mod amassed as many page views as we'd had in the whole last year. And chances are your host will kick you out swiftly just for the dent this makes in server memory and computing power.

But the real fun starts, after you uninstall it, as you sooner or later will: Because it doesn't uninstall completely. I ran into the same problem described by others above. I have now around 30 guests with "unknown action" in the online list. Considering guests should at no point be able to use Enotify, this is a bit weird. But I looked them up in the database (Table: smf_log_online) and sure enough these guests do call Enotify, example: a:2:{s:6:"action";s:7:"enotify";s:10:"USER_AGENT";s:112:"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)";}

At this point I have replaced all files Enotify touches from backup and searched all files from the sources and themes folders for the word "enotify" and there's nothing there. I have also deleted 2 tables in the database that Enotify left behind (smf_log_enotify_pms & smf_log_enotify_topics).

I did all of this yesterday, so it's unlikely that 30 guests still have a tab open, not even mentioning they shouldn't have been able to call Enotify in the first place.

If this mod sounded too good to be true to you, you got it right the first time. Unless you like a big resource hog screwing up your forum permanently, keep your hands off it.

Arantor

QuoteAs Arantor has observed, this isn't even a mistake but by design.

I should note that I raised this with its original author during its original review prior to approval. There isn't a way to directly avoid it if you want current notifications, at least not on a stock Apache server (since the sanest way is to implement Comet notifications not AJAX, but that's not viable on Apache+PHP)

As for the uninstall issue, the problem is likely that there's fragments of code in your custom theme that aren't uninstalled (either due to SMF not being able to apply it to custom themes, or due to a bug in some versions of 2.0 that meant it didn't remove from custom themes anyway even when it was supposed to), but it *can* be caused by not having a page refresh so the code is still firing as you've indicated (or having some kind of cached content)

As for guests calling enotify, no idea why that happens. I can't remember if the original version I saw did or not, though.

Advertisement: