News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

ENotify

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

Previous topic - Next topic

Sheree

Hi there is there A way members can view a list of the notifications?

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

Sheree


Abavagada

Quote from: Sheree on May 03, 2011, 06:55:39 PM
Hi there is there A way members can view a list of the notifications?

I wanted the same, so made my own.

I have taken out some of the specializations and hopefully got it down to a more generic form.
Save it as a .php file in your forum root path. It's meant to be called using a pop up window.

Hope it helps someone.

<? require("SSI.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
<head>
<title>ENotifications</title>
<style type="text/css">
.enotify_list_holder { width: 400px; height: 400px; }
.enotify_top_cell { background-color: #990404; }
.enotify_list_div { height: 330px; overflow-x: hidden; overflow-y: scroll; border: 1px solid #999999; }
.enotify_list_table { width: 100%; border-collapse: collapse; }
.enotify_list_table td { vertical-align: top;  }
.enotify_list_table2 { width: 100%; border-collapse: collapse; }
.enotify_list_table2 td { font-size: 12px; vertical-align: top; line-height: 100%; apadding: 4px; }
.enotify_center_cell { text-align: center; font-size: 120%; padding: 4px; font-weight: bold; }
</style>
</head>
<body>
<?
require('Sources/ENotify1.php');
ENotifyLoad(1);

function get_userid_from_link($tlink) {
   $p1 = strpos($tlink, ';u=');
   if ($p1 !== false) {
      $uid = (substr($tlink, $p1 + 3));
   } else { $uid = -1; }
   return $uid;
}

function create_entry($enot) {
   global $txt;
   $estrarr = array ('Post Reply', 'Private Message');
   $etype = $enot['etype'];
   $uid = get_userid_from_link($enot['sender-href']);
   echo '<tr><td style="padding: 4px;">
   <table class="enotify_list_table2">
   <tr><td colspan="2"><b>'.$estrarr[$etype].'</b></td></tr>
   <tr><td><a href="'. $enot['sender-href']. '" target="_blank">'. $enot['sender']. '</a></td>
   <td style="text-align: right;">'. date('d-m-Y',$enot['time']) .'</td></tr>
   <tr><td colspan="2"><a href="'. $enot['href']. '" target="_blank">'. $enot['title']. '</a></td></tr>
   </table></td></tr>
   ';
}

$allnotes = array();
if (isset($context['enot']['replies'])) {
   foreach ($context['enot']['replies'] as $enot)  { $enot['etype'] = 0;  array_push($allnotes, $enot); }
}
if (isset($context['enot']['pms'])) {
   foreach ($context['enot']['pms'] as $enot)      { $enot['etype'] = 1;  array_push($allnotes, $enot); }
}

for ($i=0; $i < sizeof($allnotes); $i++) {
   $date1 = $allnotes[$i]['time'];
   for ($j=$i; $j < sizeof($allnotes); $j++) {
      $date2 = $allnotes[$j]['time'];
      if ($date2 > $date1) {
         $temp = $allnotes[$i];
         $allnotes[$i] = $allnotes[$j];
         $allnotes[$j] = $temp;
         $date1 = $date2;
      }
   }
}   

?>

<div class="enotify_list_holder">
<table class="enotify_list_table">
<tr><td class="enotify_top_cell enotify_center_cell"><? echo $txt['enotifications'] ?><a href="javascript:self.close();" style="float: right;">[close]</a></td></tr>
<tr><td><div class="enotify_list_div"><table class="enotify_list_table">
<?
foreach ($allnotes as $enot) {
   create_entry($enot);
}
?>
</table></div></td></tr>
<tr><td class="enotify_center_cell"><input type="button" value="Reload" onclick="window.location = '<? echo $PHP_SELF ?>'" /></td></tr>
</table></div>

</body>
</html>


Jorge D. Fuentes

I installed it and like it for what it does...

However, like the people above, my members complain that if there are many replies, they will not get to click on a 'show all notifications' page like in Facebook.  There is also no numerical notifier on the pages (again, like in Facebook).
Yeah, we're Facebook-spoiled. :P

I like the mod a lot though, but I've had some people asking me to uninstall it, which leads me to my question...

...I cannot seem to uninstall it!  When I tried to, SMF kicks up a "Test Failed" on Modsettings.   I'm now afraid of removing it lest a problem happens to the board.
"4.    Execute Modification    ./Sources/ModSettings.php    Test failed"
I'm using SMF 1.1.13

EDIT: I took a look at the response with the custom notifications page.  Where would I add that so that it adds this functionality?

Abavagada

Quote from: Jorge D. Fuentes on May 05, 2011, 02:30:20 PM
EDIT: I took a look at the response with the custom notifications page.  Where would I add that so that it adds this functionality?

Save that code as a file in the forum directory, like "enotifications.php", then put in a link wherever you want to be able to open it from:

<a href="javascript:openWindow('enotifications.php', 'enotifications', 400, 400);">ENotifications</a>

and put this javascript code into a linked in js file:


function openWindow(url, name, width, height, options) {
    width = width ? width : 800;
    height = height ? height : 600;
    options = options ? options : 'resizable=no,location=0';
    name = name ? name : 'openWindow';
    window.open(url, name, 'screenX=' + (screen.width - width) / 2 + ', screenY=' + (screen.height - height) / 2 + ', width=' + width + ', height=' + height + ', ' + options);
}

Biology Forums

Is there a way of putting the (X) [Closed notifications] as the first thing that pops up and then everything else follows? Currently it's the opposite way around  :-[

Gryzor

Just installed it, seems to work fine but I'm having some issues with my Admin panel and can't find it. Could someone give me the direct link to its options?

Thanks!

Biology Forums

It should be in features and it should have its own tab.

Gryzor

Quote from: shuban on May 10, 2011, 12:55:28 PM
It should be in features and it should have its own tab.

Thanks - but as I said, I can't find it, can you give me the link to it?

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

Gryzor

Quote from: vbgamer45 on May 10, 2011, 01:28:23 PM
Features Options -> Enotify

Maybe I'm not clear enough :) I'm not asking for the path I need to take; I'm asking for the relative URL to it!

ms_ukyankee

SMF since 2004 <3

Gryzor

Thanks! That's it. Unfortunately it goes back to the forum homepage, but that's probably something to do with my whole config... thanks again.

vbgamer45

Yeah probably a missing edit in the Admin.php or Subs.php depending on your SMF version
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

Biology Forums

Can someone show me how to do this?

Is there a way of putting the (X) [Closed notifications] as the first thing that pops up and then everything else follows? Currently it's the opposite way around 

Gryzor

Quote from: vbgamer45 on May 10, 2011, 02:09:39 PM
Yeah probably a missing edit in the Admin.php or Subs.php depending on your SMF version

Actually, I found the problem. Each edit was done twice in each file, probably due to a failed installation, and this caused ALL kinds of problems with the Admin panel... Thanks for the idea!

Jorge_CS_

Great mode!! Thanks.


I have a question, what is this for? "Expiration duration of log items: 48" 48 months?

Thanks!!

Gryzor

48 seconds?

Indeed it's a great mod but I really disagree with the footer it inserts to index.template.php. Imagine if every mod inserted its own footer, we'd have a page three feet long!

Jorge_CS_

It can be removed in sources/querystring.php

But this mod is not always working, dunno why...

Advertisement: