Advanced Notifications 1.1 ********************************* Name : Advanced Notifications Author : Sonic Description : This mod replaces the original Shownotifcations part of Notify.pl. Instead of just name of thread and thread starter, it has icon, thread reply, thread starter, replies, views and last poster. ********************************* Version history :- 1.0 beta * First working copy. 1.1 * Sorted out screen usernames. Future Updates :- Have links to remove and reply. Email me your suggestions - sonic@scotsonphones.co.uk :) Note : If you are trying to install this mod and get errors just replace sub ShowNotification. Sonic www.scotsonphones.co.uk/YaBB Sources/Notify.pl sub ShowNotifications { if($username eq "Guest") { &error("$txt{'138'}"); } my(@dirdata,@datdata,$filename,$entry,@entries,$mnum,$dummy,$msub,$mname,$memail,$mdate,$musername,$micon,$mattach,$mip,$mmessage,@messages,@found_number,@found_subject,@found_date,@found_username); # Read all .mail-Files and search for username opendir (DIRECTORY,"$datadir"); @dirdata = readdir(DIRECTORY); closedir (DIRECTORY); @datdata = grep(/mail/,@dirdata); # Load Censor List &LoadCensorList; foreach $filename (@datdata) { fopen(FILE, "$datadir/$filename"); @entries = ; fclose(FILE); foreach $entry (@entries) { $entry =~ s/[\n\r]//g; if ($entry eq $settings[2]) { ($mnum, $dummy) = split(/\./,$filename); fopen(FILE, "$datadir/$mnum.txt"); @messages = ; fclose(FILE); ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $mmessage) = split(/\|/,$messages[0]); push(@found_number,$mnum); push(@found_subject,$msub); push(@found_date,$mdate); push(@found_username,$musername); push(@found_name,$mname); } } } # Display all Entries $yymain .= qq~
$txt{'418'}

~; if (@found_number==0) { $yymain .= "$txt{'414'}

 "; } else { foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $found_subject[$counter] =~ s~\Q$tmpa\E~$tmpb~gi; } $yymain .= qq~
~; $counter=0; foreach $entry (@found_number) { &FormatUserName($found_username[$counter]); $yymain .= "~; $yymain .= qq~\n~; $counter++; } $yymain .= "\n"; $yymain .= qq~~; $yymain .= "
$txt{'415'}:
 
"; $yymain .= qq~$found_subject[$counter] $txt{'525'} $found_name[$counter]

$txt{'416'}
 
    

 \n"; } $yymain .= qq~
~; $yytitle = "$txt{'417'}"; &template; exit; }
sub ShowNotifications { if($username eq "Guest") { &error("$txt{'138'}"); } my(@dirdata,@datdata,$filename,$entry,@entries,$mnum,$dummy,$msub,$mname,$memail,$mdate,$musername,$micon,$mattach,$mip,$mmessage,@messages,@found_number,@found_subject,@found_date,@found_username,@last_poster); # Read all .mail-Files and search for username opendir (DIRECTORY,"$datadir"); @dirdata = readdir(DIRECTORY); closedir (DIRECTORY); @datdata = grep(/mail/,@dirdata); # Load Censor List &LoadCensorList; foreach $filename (@datdata) { fopen(FILE, "$datadir/$filename"); @entries = ; fclose(FILE); foreach $entry (@entries) { $entry =~ s/[\n\r]//g; if ($entry eq $settings[2]) { ($mnum, $dummy) = split(/\./,$filename); fopen(FILE, "$datadir/$mnum.txt"); @messages = ; fclose(FILE); fopen(FILE, "$datadir/$mnum.txt"); @threadlist = ; $threadcount = $#threadlist; fclose(FILE); push(@thread_count,$threadcount); for ($i=1; $i<=$threadcount; $i++) { ($tmpa, $lastposterid, $tmpa, $mdate) = split(/\|/,$messages[$i]); } ($msub, $mname, $memail, $tmpa, $musername, $micon, $mattach, $mip, $mmessage) = split(/\|/,$messages[0]); push(@found_number,$mnum); push(@found_subject,$msub); $mydate = &timeformat($mdate); push(@found_date,$mydate); push(@found_username,$musername); push(@found_name,$mname); $mdate = &timeformat($mdate); fopen(FILE, "$datadir/$mnum.data") ; $_ = ; ($views, $lastposter) = split( /\|/, $_ ); fclose(FILE); push(@last_poster,$lastposter); push(@last_posterid,$lastposterid); $views=$views-1; push(@view_s,$views); } } } # Display all Entries if (@found_number==0) { # Message if no notifications found. $yymain .= qq~
No subscribed threads.  No subscribed threads!
~; } else { foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $found_subject[$counter] =~ s~\Q$tmpa\E~$tmpb~gi; } $yymain .= qq~
~; $counter=0; foreach $entry (@found_number) { &FormatUserName($found_username[$counter]); ($found_number[$counter]); &LoadUser($lastposter); (@last_posterid); &LoadUser($mname); ($last_poster[$counter]); ($found_date[$counter]); $yymain .= qq~ ~; $counter++; } $yymain .= qq~ ~; } $yymain .= qq~
  Subject Started by Replies Views Last post
$found_subject[$counter] @found_name[$counter] $thread_count[$counter] $view_s[$counter] $found_date[$counter]
by @last_posterid[$counter]
          By Sonic
~; $yytitle = "Subscribed Threads"; &template; exit; }