Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite 7

 AfterLogic Forum : AfterLogic WebMail Lite 7
Subject Topic: Sound notification plugin Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
webdbase2
Valued Community Member
Valued Community Member


Joined: 25 March 2015
Location: Bulgaria
Online Status: Offline
Posts: 81
Posted: 05 May 2015 at 12:29pm | IP Logged Quote webdbase2

Here it is. It plays sound when there are new messages.





Enable it in data/settings/config.php by
Code:
'plugins.sound-notification' => true,

Upload any audio file. The size in the database is mediumblob.
Back to Top View webdbase2's Profile Search for other posts by webdbase2
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 06 May 2015 at 3:36am | IP Logged Quote Igor

Thank you for this nice contribution! We'll add it to community plugins repository shortly.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 06 May 2015 at 5:43am | IP Logged Quote Igor

Have just published it at:

Sound notifications (WebMail Plugins)

Thanks again!

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Gyana.Dash
Newbie
Newbie
Avatar

Joined: 19 May 2015
Location: India
Online Status: Offline
Posts: 1
Posted: 19 May 2015 at 4:46am | IP Logged Quote Gyana.Dash

Hi To All at AfterLogic Support team, and Thanks for nice Open Source Webmail Software. Currently I have installed AfterLogic Webmail Lite 7.5 Edition and noted that the Sound Notification plugin is not working, the code is in deprecated version for the new release of Afterlogic Webmail 7.5? Can Some help me out of this. Thanking all of U ...
Back to Top View Gyana.Dash's Profile Search for other posts by Gyana.Dash
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 19 May 2015 at 4:57am | IP Logged Quote Igor

I'm pretty sure the plugin was developed exactly for current version 7.5 of the product. Maybe, plugin's author might be able to assist - and most likely, they're going to need more troubleshooting information - what exactly isn't working, what troubleshooting steps have you tried, are there any errors in the log, etc. etc.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
webdbase2
Valued Community Member
Valued Community Member


Joined: 25 March 2015
Location: Bulgaria
Online Status: Offline
Posts: 81
Posted: 19 May 2015 at 11:17am | IP Logged Quote webdbase2

Yes, absolutely, Igor!
Gyana, I'm at your disposition. What exactly isn't working? You can't set (upload) the sound file? Nothnig happens (no sound is played) when new mail arrives?
Are there any javascript errors?
Please describe the procedure you are following.
Back to Top View webdbase2's Profile Search for other posts by webdbase2
 
dansmith
Newbie
Newbie


Joined: 16 December 2017
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 18 December 2017 at 3:59pm | IP Logged Quote dansmith

hi, this seems a great plugin though notice it hasn't been updated in quite a while. I'm running PHP 7 so updated index.php as below to use mysqli rather than mysql. I've uploaded a sound file in wav format and can see the table update has happened properly though no sound plays when a new email comes in - any idea why this would be the case or am I missing some setup etc?

also, wondering how I can set this as a global option for all users rather than per user?

Code:

<?php

class_exists('CApi') or die();

class CSound_Notification extends AApiPlugin
{
     /**
      * @param CApiPluginManager $oPluginManager
      */
     public function __construct(CApiPluginManager $oPluginManager)
     {
          parent::__construct('1.0', $oPluginManager);
     }

     public function Init()
     {
          parent::Init();

      $this->SetI18N(true);
       $this->AddJsFile('js/include.js');
      $this->AddTemplate('Sound_Notification', 'templates/Sound_Notification.html');
      $this->AddJsonHook('AjaxSound_Notification', 'AjaxSound_Notification');
     }
     public function AjaxSound_Notification()
     {
      $oApiIntegratorManager = \CApi::Manager('integrator');
      $oApiUsers = \CApi::Manager('users');
      $acct_id=$oApiIntegratorManager->GetLogginedUserId();
      $oSettings =& CApi::GetSettings();
      $sPrefix = $oSettings->GetConf('Common/DBPrefix');
          
      $host = $oSettings->GetConf('Common/DBHost');
      $user = $oSettings->GetConf('Common/DBLogin');
      $pass = $oSettings->GetConf('Common/DBPassword');
      $db = $oSettings->GetConf('Common/DBName');
      $table=$sPrefix.'awm_sound_notifications';
       $link = mysqli_connect($host, $user, $pass,$db) or trigger_error(mysqli_error(),E_USER_ERROR);
     
      if (!$link)
         return array(-1);
      if (isset($_POST['clear_sound']))
      {
         if (mysqli_query($link,'delete from '.$table.' where acct_id='.$acct_id))
            return array(1);
         else
            return array(-3);
      }
      elseif (isset($_POST['get_file']))
      {
            $res=mysqli_query($link,'select `file`,mime_type from '.$table.' where acct_id='.$acct_id);
         $row=mysqli_fetch_assoc($res);
         return array($row['file'],$row['mime_type']);
      }
      elseif (isset($_POST['get_file_name']))
      {
         $res=mysqli_query($link,'select `file_name` from '.$table.' where acct_id='.$acct_id);
         $row=mysqli_fetch_assoc($res);
         return array($row['file_name']);
      }
      else
         if (!@$_FILES['sound']['error'])
            {
               if (!mysqli_query($link,'select acct_id from '.$table.' limit 1'))
                  mysqli_query($link,'CREATE TABLE `'.$table.'` (
                                `acct_id ` bigint(20) NOT NULL AUTO_INCREMENT,
                                `file_na me` varchar(255) NOT NULL,
                                `mime_ty pe` varchar(50) NOT NULL,
                                `file` mediumblob NOT NULL,
                                PRIMARY KEY (`acct_id`)
                              ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
               $file=base64_encode(file_get_contents($_FILES['sound']['tmp_name']));
               $finfo = finfo_open(FILEINFO_MIME_TYPE);
               $mime_type=finfo_file($finfo, $_FILES['sound']['tmp_name']);
               if (mysqli_query($link,"replace $table set acct_id=$acct_id,mime_type='$mime_type',file_name='".$_FILES['sound']['name']."',file='$file'"))
                  return array($_FILES['sound']['name']);
               else
                  return array(-3);
            }
         else
            return array(-2); // no file
   }
}

return new CSound_Notification($this);

?>


Back to Top View dansmith's Profile Search for other posts by dansmith
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 19 December 2017 at 12:03am | IP Logged Quote Igor

Hello dansmith,

As the plugin isn't created by us, we can't really assist with it - but hope its author is still watching the thread and will be able to offer some help.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
dansmith
Newbie
Newbie


Joined: 16 December 2017
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 19 December 2017 at 12:37am | IP Logged Quote dansmith

Igor wrote:
Hello dansmith,

As the plugin isn't created by us, we can't really assist with it - but hope its author is still watching the thread and will be able to offer some help.

--
Regards,
Igor, Afterlogic Support


Thanks Igor, appreciate that, was reaching out to either the plugin owner or anyone else who is using it currently. Is there any plan to move this idea to the core product?
Back to Top View dansmith's Profile Search for other posts by dansmith
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 19 December 2017 at 12:40am | IP Logged Quote Igor

There are no plans to add that in the product. However, we're now working on version 8 of WebMail Pro, currently available as beta. One of its main benefits is modular structure which makes it much easier for third-party developers to add features into the product.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide