4 * SquirrelMail NewMail plugin
8 * @copyright © 2001-2007 The SquirrelMail Project Team
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
13 * @todo add midi support
17 /** file type defines */
18 define('SM_NEWMAIL_FILETYPE_WAV',2);
19 define('SM_NEWMAIL_FILETYPE_MP3',3);
20 define('SM_NEWMAIL_FILETYPE_OGG',4);
21 define('SM_NEWMAIL_FILETYPE_SWF',5);
22 define('SM_NEWMAIL_FILETYPE_SVG',6);
24 /** load default config */
25 if (file_exists(SM_PATH
. 'plugins/newmail/config_default.php')) {
26 include_once(SM_PATH
. 'plugins/newmail/config_default.php');
30 if (file_exists(SM_PATH
. 'config/newmail_config.php')) {
31 include_once(SM_PATH
. 'config/newmail_config.php');
32 } elseif (file_exists(SM_PATH
. 'plugins/newmail/config.php')) {
33 include_once(SM_PATH
. 'plugins/newmail/config.php');
36 // ----- hooked functions -----
39 * Register newmail option block
41 function newmail_optpage_register_block_function() {
42 // Gets added to the user's OPTIONS page.
43 global $optpage_blocks;
45 /* Register Squirrelspell with the $optionpages array. */
46 $optpage_blocks[] = array(
47 'name' => _("NewMail Options"),
48 'url' => sqm_baseuri() . 'plugins/newmail/newmail_opt.php',
49 'desc' => _("This configures settings for playing sounds and/or showing popup windows when new mail arrives."),
55 * Save newmail plugin settings
57 function newmail_sav_function() {
58 global $data_dir, $username, $_FILES, $newmail_uploadsounds;
60 if ( sqgetGlobalVar('submit_newmail', $submit, SQ_POST
) ) {
64 $media_changetitle = '';
69 sqgetGlobalVar('media_enable', $media_enable, SQ_POST
);
70 sqgetGlobalVar('media_popup', $media_popup, SQ_POST
);
71 sqgetGlobalVar('media_recent', $media_recent, SQ_POST
);
72 sqgetGlobalVar('media_changetitle', $media_changetitle, SQ_POST
);
73 sqgetGlobalVar('popup_width', $popup_width, SQ_POST
);
74 sqgetGlobalVar('popup_height', $popup_height, SQ_POST
);
76 // sanitize height and width
77 $popup_width = (int) $popup_width;
78 if ($popup_width<=0) $popup_width=200;
79 $popup_height = (int) $popup_height;
80 if ($popup_height<=0) $popup_height=130;
82 setPref($data_dir,$username,'newmail_enable',$media_enable);
83 setPref($data_dir,$username,'newmail_popup', $media_popup);
84 setPref($data_dir,$username,'newmail_recent',$media_recent);
85 setPref($data_dir,$username,'newmail_changetitle',$media_changetitle);
86 setPref($data_dir,$username,'newmail_popup_width',$popup_width);
87 setPref($data_dir,$username,'newmail_popup_height',$popup_height);
89 if (sqgetGlobalVar('newmail_unseen_notify', $newmail_unseen_notify, SQ_POST
)) {
90 $newmail_unseen_notify = (int) $newmail_unseen_notify;
91 setPref($data_dir,$username,'newmail_unseen_notify',$newmail_unseen_notify);
94 if( sqgetGlobalVar('media_sel', $media_sel, SQ_POST
) &&
95 $media_sel == '(none)' ) {
96 removePref($data_dir,$username,'newmail_media');
98 setPref($data_dir,$username,'newmail_media',$media_sel);
101 // process uploaded file
102 if ($newmail_uploadsounds && isset($_FILES['media_file']['tmp_name']) && $_FILES['media_file']['tmp_name']!='') {
103 // set temp file and get media file name
104 $newmail_tempmedia=getHashedDir($username, $data_dir) . "/$username.tempsound";
105 $newmail_mediafile=getHashedFile($username, $data_dir, $username . '.sound');
106 if (move_uploaded_file($_FILES['media_file']['tmp_name'], $newmail_tempmedia)) {
107 // new media file is in $newmail_tempmedia
108 if (file_exists($newmail_mediafile)) unlink($newmail_mediafile);
109 if (! rename($newmail_tempmedia,$newmail_mediafile)) {
110 // remove (userfile), if file rename fails
111 removePref($data_dir,$username,'newmail_media');
114 if (isset($_FILES['media_file']['type']) && isset($_FILES['media_file']['name'])) {
115 setPref($data_dir,$username,'newmail_userfile_type',
116 newmail_get_mediatype($_FILES['media_file']['type'],$_FILES['media_file']['name']));
118 removePref($data_dir,$username,'newmail_userfile_type');
121 if (isset($_FILES['media_file']['name'])) {
122 setPref($data_dir,$username,'newmail_userfile_name',basename($_FILES['media_file']['name']));
124 setPref($data_dir,$username,'newmail_userfile_name','mediafile.unknown');
133 * Load newmail plugin settings
135 function newmail_pref_function() {
136 global $username,$data_dir;
137 global $newmail_media,$newmail_media_enable,$newmail_popup;
138 global $newmail_recent, $newmail_changetitle;
139 global $newmail_userfile_type, $newmail_userfile_name;
140 global $newmail_popup_width, $newmail_popup_height;
141 global $newmail_unseen_notify;
143 $newmail_recent = getPref($data_dir,$username,'newmail_recent');
144 $newmail_media_enable = getPref($data_dir,$username,'newmail_enable');
145 $newmail_media = getPref($data_dir, $username, 'newmail_media', '(none)');
146 // remove full location from setting (since SM 1.5.1 plugin uses only filename).
147 if ($newmail_media!='(none)')
148 $newmail_media = basename($newmail_media);
150 $newmail_popup = getPref($data_dir, $username, 'newmail_popup');
151 $newmail_popup_width = getPref($data_dir, $username, 'newmail_popup_width',200);
152 $newmail_popup_height = getPref($data_dir, $username, 'newmail_popup_height',130);
153 $newmail_changetitle = getPref($data_dir, $username, 'newmail_changetitle');
155 $newmail_userfile_type = getPref($data_dir, $username, 'newmail_userfile_type');
156 $newmail_userfile_name = getPref($data_dir,$username,'newmail_userfile_name','');
158 $newmail_unseen_notify = getPref($data_dir,$username,'newmail_unseen_notify',0);
164 * Used by option page when saving settings.
166 function newmail_set_loadinfo_function() {
167 global $optpage, $optpage_name;
168 if ($optpage=='newmail') {
169 $optpage_name=_("NewMail Options");
174 /* Receive the status of the folder and do something with it */
175 function newmail_folder_status($statusarr) {
176 global $newmail_media_enable,$newmail_popup,$newmail_changetitle,$trash_folder,
177 $sent_folder,$totalNewArr, $newmail_unseen_notify, $unseen_notify, $newmail_recent;
179 /* if $newmail_unseen_notify is set to zero, plugin follows $unseen_notify */
180 if ($newmail_unseen_notify == 0)
181 $newmail_unseen_notify = $unseen_notify;
183 $mailbox=$statusarr['MAILBOX'];
185 if (($newmail_media_enable == 'on' ||
186 $newmail_popup == 'on' ||
187 $newmail_changetitle == 'on') &&
189 * make sure that $newmail_unseen_notify is set to supported value,
190 * currently (1.5.2cvs) SMPREF_UNSEEN_NORMAL has highest integer value
191 * in SMPREF_UNSEEN constants
193 ($newmail_unseen_notify > SMPREF_UNSEEN_NONE
&& $newmail_unseen_notify <= SMPREF_UNSEEN_NORMAL
)) {
195 // Skip folders for Sent and Trash
196 // TODO: make this optional
197 if ($statusarr['MAILBOX'] == $sent_folder ||
$statusarr['MAILBOX'] == $trash_folder) {
201 if ((($mailbox == 'INBOX') && ($newmail_unseen_notify == SMPREF_UNSEEN_INBOX
)) ||
202 ($newmail_unseen_notify == SMPREF_UNSEEN_SPECIAL
&& isSpecialMailbox($mailbox)) ||
203 ($newmail_unseen_notify == SMPREF_UNSEEN_NORMAL
&& ! isSpecialMailbox($mailbox)) ||
204 ($newmail_unseen_notify == SMPREF_UNSEEN_ALL
)) {
205 if (($newmail_recent == 'on') && (!empty($statusarr['RECENT']))) {
206 $totalNewArr[$mailbox] = $statusarr['RECENT'];
207 } elseif ($newmail_recent != 'on' && !empty($statusarr['UNSEEN'])) {
208 $totalNewArr[$mailbox] = $statusarr['UNSEEN'];
215 * Insert needed data in left_main
217 function newmail_plugin_function() {
218 global $username, $newmail_media, $newmail_media_enable, $newmail_popup,
219 $newmail_recent, $newmail_changetitle, $imapConnection, $PHP_SELF;
220 global $newmail_mmedia, $newmail_allowsound;
221 global $newmail_userfile_type;
222 global $newmail_popup_width, $newmail_popup_height;
225 if ($newmail_media_enable == 'on' ||
226 $newmail_popup == 'on' ||
227 $newmail_changetitle) {
229 if (!empty($totalNewArr)) { $totalNew=array_sum($totalNewArr); }
230 else { $totalNew=0; }
232 // If we found unseen messages, then we
233 // will play the sound as follows:
235 if ($newmail_changetitle) {
236 echo "<script type=\"text/javascript\">\n" .
237 "function ChangeTitleLoad() {\n";
238 echo 'window.parent.document.title = "' .
239 sprintf(ngettext("%s New Message","%s New Messages",$totalNew), $totalNew) .
241 echo "if (BeforeChangeTitle != null)\n".
242 "BeforeChangeTitle();\n".
244 "BeforeChangeTitle = window.onload;\n".
245 "window.onload = ChangeTitleLoad;\n".
249 // create media output if there are new email messages
250 if ($newmail_allowsound && $totalNew > 0
251 && $newmail_media_enable == 'on'
252 && $newmail_media != '' ) {
253 echo newmail_create_media_tags($newmail_media);
256 if ($totalNew > 0 && $newmail_popup == 'on') {
257 // Idea by: Nic Wolfe (Nic@TimelapseProductions.com)
258 // Web URL: http://fineline.xs.mw
259 // More code from Tyler Akins
260 echo "<script type=\"text/javascript\">\n".
262 "function PopupScriptLoad() {\n".
263 'window.open("'.sqm_baseuri().'plugins/newmail/newmail.php?numnew='.$totalNew.
265 "\"width=$newmail_popup_width,height=$newmail_popup_height,scrollbars=no\");\n".
266 "if (BeforePopupScript != null)\n".
267 "BeforePopupScript();\n".
269 "BeforePopupScript = window.onload;\n".
270 "window.onload = PopupScriptLoad;\n".
277 // ----- end of hooked functions -----
282 * Function tries to detect if file contents match declared file type
284 * Function returns default extension for detected mime type or 'false'
286 * TODO: use $contents to check if file is in specified type
287 * @param string $contents file contents
288 * @param string $type file mime type
291 function newmail_detect_filetype($contents,$type) {
292 // convert $type to lower case
293 $type=strtolower($type);
304 case 'application/ogg':
307 case 'application/x-shockwave-flash':
310 case 'image/svg+xml':
320 * Function tries to detect uploaded file type
321 * @param string $type
322 * @param string $filename
323 * @return integer One of SM_NEWMAIL_FILETYPE_* defines or false.
325 function newmail_get_mediatype($type,$filename) {
327 // fix for browser's that upload file as application/octet-stream
328 case 'application/octet-stream':
329 $ret=newmail_get_mediatype_by_ext($filename);
332 $ret=SM_NEWMAIL_FILETYPE_WAV
;
335 $ret=SM_NEWMAIL_FILETYPE_MP3
;
337 case 'application/ogg':
338 $ret=SM_NEWMAIL_FILETYPE_OGG
;
340 case 'application/x-shockwave-flash':
341 $ret=SM_NEWMAIL_FILETYPE_SWF
;
343 case 'image/svg+xml':
344 $ret=SM_NEWMAIL_FILETYPE_SVG
;
353 * Function provides filetype detection for browsers, that
354 * upload files with application/octet-stream file type.
355 * Ex. some version of Opera.
356 * @param string $filename
357 * @return integer One of SM_NEWMAIL_FILETYPE_* defines or false.
359 function newmail_get_mediatype_by_ext($filename) {
360 if (preg_match("/\.wav$/i",$filename)) return SM_NEWMAIL_FILETYPE_WAV
;
361 if (preg_match("/\.mp3$/i",$filename)) return SM_NEWMAIL_FILETYPE_MP3
;
362 if (preg_match("/\.ogg$/i",$filename)) return SM_NEWMAIL_FILETYPE_OGG
;
363 if (preg_match("/\.swf$/i",$filename)) return SM_NEWMAIL_FILETYPE_SWF
;
364 if (preg_match("/\.svg$/i",$filename)) return SM_NEWMAIL_FILETYPE_SVG
;
369 * Creates html object tags of multimedia object
371 * Main function that creates multimedia object tags
372 * @param string $object object name
373 * @param integer $type media object type
374 * @param string $path URL to media object
375 * @param array $args media object attributes
376 * @param string $extra tags that have to buried deep inside object tags
377 * @param bool $addsuffix controls addition of suffix to media object url
378 * @return string object html tags and attributes required by selected media type.
380 function newmail_media_objects($object,$types,$path,$args=array(),$extra='',$addsuffix=true) {
381 global $newmail_mediacompat_mode;
383 // first prepare single object for IE
384 $ret = newmail_media_object_ie($object,$types[0],$path,$args,$addsuffix);
386 // W3.org nested objects
387 $ret.= "<!--[if !IE]> <-->\n"; // not for IE
389 foreach ($types as $type) {
390 $ret.= newmail_media_object($object,$type,$path,$args,$addsuffix);
393 if (isset($newmail_mediacompat_mode) && $newmail_mediacompat_mode)
394 $ret.= newmail_media_embed($object,$types[0],$path,$args,$addsuffix);
395 // add $extra code inside objects
400 if (isset($newmail_mediacompat_mode) && $newmail_mediacompat_mode)
401 $ret.= newmail_media_embed_close($types[0]);
403 // close w3.org nested objects
404 foreach (array_reverse($types) as $type) {
405 $ret.= newmail_media_object_close($type);
407 $ret.= "<!--> <![endif]-->\n"; // end non-IE mode
409 $ret.= newmail_media_object_ie_close($types[0]);
415 * Creates object tags of multimedia object for browsers that comply to w3.org
420 * <li>Returned string does not contain html closing tag.
421 * <li>This is internal function, use newmail_media_objects() instead
423 * @link http://www.w3.org/TR/html4/struct/objects.html#edef-OBJECT W3.org specs
424 * @param string $object object name
425 * @param integer $type media object type
426 * @param string $path URL to media object
427 * @param array $args media object attributes
428 * @param bool $addsuffix controls addition of suffix to media object url
429 * @return string object html tags and attributes required by selected media type.
431 function newmail_media_object($object,$type,$path,$args=array(),$addsuffix=true) {
434 $sArgs=newmail_media_prepare_args($args);
437 case SM_NEWMAIL_FILETYPE_SWF
:
438 if ($addsuffix) $suffix='.swf';
439 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
441 .'type="application/x-shockwave-flash">' . "\n";
443 case SM_NEWMAIL_FILETYPE_WAV
:
444 if ($addsuffix) $suffix='.wav';
445 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
447 .'type="audio/x-wav">' . "\n";
449 case SM_NEWMAIL_FILETYPE_OGG
:
450 if ($addsuffix) $suffix='.ogg';
451 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
453 .'type="application/ogg">' . "\n";
455 case SM_NEWMAIL_FILETYPE_MP3
:
456 if ($addsuffix) $suffix='.mp3';
457 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
459 .'type="audio/mpeg">' . "\n";
461 case SM_NEWMAIL_FILETYPE_SVG
:
462 if ($addsuffix) $suffix='.svg';
463 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
465 .'type="image/svg+xml">' . "\n";
474 * Creates multimedia object tags for Internet Explorer (Win32)
477 * * Returned string does not contain html closing tag, because
478 * this multimedia object can include other media objects.
479 * * This is internal function, use newmail_media_objects() instead
481 * @param string $object object name
482 * @param integer $type media object type
483 * @param string $path URL to media object
484 * @param array $args media object attributes
485 * @param bool $addsuffix controls addition of suffix to media object url
486 * @return string object html tags and attributes required by selected media type.
487 * @todo add ogg and svg support
489 function newmail_media_object_ie($object,$type,$path,$args=array(),$addsuffix) {
492 $sArgs=newmail_media_prepare_args($args);
495 case SM_NEWMAIL_FILETYPE_SWF
:
496 if ($addsuffix) $suffix='.swf';
497 $ret_ie ='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
498 .'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" '
499 . $sArgs . 'id="' . $object ."\">\n"
500 .'<param name="movie" value="' . $path . $object . $suffix . "\">\n"
501 .'<param name="hidden" value="true">' . "\n";
503 case SM_NEWMAIL_FILETYPE_WAV
:
504 if ($addsuffix) $suffix='.wav';
505 $ret_ie ='<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" '
506 .'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,0902" '
507 . $sArgs . 'id="' . $object ."\" \n"
508 .'type="audio/x-wav">' ."\n"
509 .'<param name="FileName" value="' . $path . $object . $suffix . "\">\n";
511 case SM_NEWMAIL_FILETYPE_MP3
:
512 if ($addsuffix) $suffix='.mp3';
513 $ret_ie ='<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" '
514 .'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,0902" '
515 . $sArgs . 'id="' . $object ."\" \n"
516 .'type="audio/mpeg">' ."\n"
517 .'<param name="FileName" value="' . $path . $object . $suffix . "\">\n";
519 case SM_NEWMAIL_FILETYPE_OGG
:
520 case SM_NEWMAIL_FILETYPE_SVG
:
528 * Creates embed tags of multimedia object
531 * Apple: http://www.apple.com/quicktime/authoring/embed.html
534 * * Returned string does not contain html closing tag.
535 * * embed tags will be created by newmail_media_objects() only
536 * when $newmail_mediacompat_mode option is enabled. Option is not
537 * enabled by default in order to comply to w3.org specs.
538 * * This is internal function, use newmail_media_objects() instead
539 * @link http://www.apple.com/quicktime/authoring/embed.html Info about embed tag
540 * @param string $object object name
541 * @param integer $type media object type
542 * @param string $path URL to media object
543 * @param array $args media object attributes
544 * @param bool $addsuffix controls addition of suffix to media object url
545 * @return string embed html tags and attributes required by selected media type.
547 function newmail_media_embed($object,$type,$path,$args=array(),$addsuffix=true) {
550 $sArgs=newmail_media_prepare_args($args);
553 case SM_NEWMAIL_FILETYPE_SWF
:
554 if ($addsuffix) $suffix='.swf';
555 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
556 .'hidden="true" autostart="true" '. "\n"
558 .'name="' . $object .'" ' . "\n"
559 .'type="application/x-shockwave-flash" ' . "\n"
560 .'pluginspage="http://www.macromedia.com/go/getflashplayer">' . "\n";
562 case SM_NEWMAIL_FILETYPE_WAV
:
563 if ($addsuffix) $suffix='.wav';
564 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
565 .' hidden="true" autostart="true" '. "\n"
567 .' name="' . $object .'" ' . "\n"
568 .' type="audio/x-wav">' . "\n";
570 case SM_NEWMAIL_FILETYPE_SVG
:
571 if ($addsuffix) $suffix='.svg';
572 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
573 .'hidden="true" autostart="true" '. "\n"
575 .'name="' . $object .'" ' . "\n"
576 .'type="image/svg-xml" ' . "\n"
577 .'pluginspage="http://www.adobe.com/svg/viewer/install/">' . "\n";
579 case SM_NEWMAIL_FILETYPE_OGG
:
580 if ($addsuffix) $suffix='.ogg';
581 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
582 .' hidden="true" autostart="true" '. "\n"
584 .' name="' . $object .'" ' . "\n"
585 .' type="application/ogg">' . "\n";
587 case SM_NEWMAIL_FILETYPE_MP3
:
588 if ($addsuffix) $suffix='.mp3';
589 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
590 .' hidden="true" autostart="true" '. "\n"
592 .' name="' . $object .'" ' . "\n"
593 .' type="audio/mpeg">' . "\n";
602 * Adds closing tags for ie object
604 * * This is internal function, use newmail_media_objects() instead
605 * @param integer $type media object type
606 * @return string closing tag of media object
608 function newmail_media_object_ie_close($type) {
611 case SM_NEWMAIL_FILETYPE_SWF
:
612 case SM_NEWMAIL_FILETYPE_WAV
:
613 case SM_NEWMAIL_FILETYPE_MP3
:
614 $ret_end="</object>\n";
616 case SM_NEWMAIL_FILETYPE_OGG
:
617 case SM_NEWMAIL_FILETYPE_SVG
:
625 * Adds closing tags for object
627 * * This is internal function, use newmail_media_objects() instead
628 * @param integer $type media object type
629 * @return string closing tag of media object
631 function newmail_media_object_close($type) {
634 case SM_NEWMAIL_FILETYPE_SWF
:
635 case SM_NEWMAIL_FILETYPE_WAV
:
636 case SM_NEWMAIL_FILETYPE_OGG
:
637 case SM_NEWMAIL_FILETYPE_MP3
:
638 case SM_NEWMAIL_FILETYPE_SVG
:
639 $ret_end="</object>\n";
648 * Adds closing tags for object
650 * * This is internal function, use newmail_media_objects() instead
651 * @param integer $type media object type
652 * @return string closing tag of media object
654 function newmail_media_embed_close($type) {
657 case SM_NEWMAIL_FILETYPE_SWF
:
658 case SM_NEWMAIL_FILETYPE_WAV
:
659 case SM_NEWMAIL_FILETYPE_OGG
:
660 case SM_NEWMAIL_FILETYPE_MP3
:
661 case SM_NEWMAIL_FILETYPE_SVG
:
662 $ret_end="</embed>\n";
671 * Converts media attributes to string
673 * * attribute values are automatically sanitized by htmlspecialchars()
674 * * This is internal function, use newmail_media_objects() instead
675 * @param array $args array with object attributes
676 * @return string string with object attributes
678 function newmail_media_prepare_args($args) {
680 foreach ($args as $arg => $value) {
681 $ret_args.= $arg . '="' . htmlspecialchars($value) . '" ';
687 * Detects used media type and creates all need tags
688 * @param string $newmail_media
689 * @return string html tags with media objects
691 function newmail_create_media_tags($newmail_media) {
692 global $newmail_mmedia, $newmail_userfile_type;
694 if (preg_match("/^mmedia_+/",$newmail_media)) {
695 $ret_media = "<!-- newmail mmedia option -->\n";
697 $newmail_mmedia_short=preg_replace("/^mmedia_/",'',$newmail_media);
698 // check if media option is not removed
699 if (isset($newmail_mmedia[$newmail_mmedia_short])) {
700 $ret_media.= newmail_media_objects($newmail_mmedia_short,
701 $newmail_mmedia[$newmail_mmedia_short]['types'],
702 sqm_baseuri() . 'plugins/newmail/media/',
703 $newmail_mmedia[$newmail_mmedia_short]['args']);
705 $ret_media.= "<!-- end of newmail mmedia option -->\n";
706 } elseif ($newmail_media=='(userfile)') {
707 $ret_media = "<!-- newmail usermedia option -->\n";
708 $ret_media.= newmail_media_objects('loadfile.php',
709 array($newmail_userfile_type),
710 sqm_baseuri() . 'plugins/newmail/',
711 array('width'=>0,'height'=>0),
713 $ret_media.= "<!-- end of newmail usermedia option -->\n";
715 $ret_media = "<!-- newmail sounds from sounds/*.wav -->\n";
716 $ret_media.= newmail_media_objects(basename($newmail_media),
717 array(SM_NEWMAIL_FILETYPE_WAV
),
718 sqm_baseuri() . 'plugins/newmail/sounds/',
719 array('width'=>0,'height'=>0),
721 $ret_media.= "<!-- end of newmail sounds from sounds/*.wav -->\n";