Author |
|
webdbase2 Valued Community Member
Joined: 25 March 2015 Location: Bulgaria
Online Status: Offline Posts: 81
|
Posted: 05 May 2015 at 12:29pm | IP Logged
|
|
|
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 |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 06 May 2015 at 3:36am | IP Logged
|
|
|
Thank you for this nice contribution! We'll add it to community plugins repository shortly.
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 06 May 2015 at 5:43am | IP Logged
|
|
|
Have just published it at:
Sound notifications (WebMail Plugins)
Thanks again!
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
Gyana.Dash Newbie
Joined: 19 May 2015 Location: India
Online Status: Offline Posts: 1
|
Posted: 19 May 2015 at 4:46am | IP Logged
|
|
|
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 |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 19 May 2015 at 4:57am | IP Logged
|
|
|
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 |
|
|
webdbase2 Valued Community Member
Joined: 25 March 2015 Location: Bulgaria
Online Status: Offline Posts: 81
|
Posted: 19 May 2015 at 11:17am | IP Logged
|
|
|
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 |
|
|
dansmith Newbie
Joined: 16 December 2017 Location: United Kingdom
Online Status: Offline Posts: 9
|
Posted: 18 December 2017 at 3:59pm | IP Logged
|
|
|
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 |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 19 December 2017 at 12:03am | IP Logged
|
|
|
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 |
|
|
dansmith Newbie
Joined: 16 December 2017 Location: United Kingdom
Online Status: Offline Posts: 9
|
Posted: 19 December 2017 at 12:37am | IP Logged
|
|
|
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 |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 19 December 2017 at 12:40am | IP Logged
|
|
|
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 |
|
|