AIRMail Beta 2.1

AIRMail Beta2.1

The release version (700) of phpVMS will not support AIRMail Beta 2.1 !

The beta version above 785 will support the AIRMail Beta 2.1 system.

New Features

1 - Mail sub folder creation

2 - Code updated to reflect new module structure for next release

3 - Protected functions for data posting

To Use the “You Have Mail” function place the following code where you would like the notice to appear, it will only appear if the pilot is logged in.

<?php MainController::Run('Mail', 'checkmail'); ?>

To Install

1 - Download the attached package

2 - Unzip the folder and place the files in their appropriate places in your phpVMS install

3 - Run the airmail_new_install.sql file in your phpVMS database using phpmyadmin or similar

(If you have been testing the first version (AIRMail Beta) you will have to drop the existing airmail table and replace it with the airmail_new_install.sql file, many changes have been made since the first beta and the new edition will not work within the old db table)

If you have been using AIRMail Beta2 you need to use the airmail_update.sql file to update the existing table and add a new folders table.

4 - Create a link on your site for your pilots to access their AIRMail

The main link has changed for previous versions!

<a href="<?php echo url('/Mail'); ?>">AIRMail</a>

5 - Existing installs of AIRMail can delete the mail_deleted.tpl and mail_sent.tpl files from the templates folder they are no longer used.

[AIRMail_beta2.1(lic).zip](< base_url >/applications/core/interface/file/attachment.php?id=188)

One small bug found -> When deleteing a sent item it does delete the item but takes you to a non existant template.

Open Mail.php and find lines 152-153

$this->set('mail', $result);
$this->show('mail_deleted.tpl');

Remove and replace with ->

header('Location: '.url('/Mail/sent'));

That will take you back to the sent box.

Loaded the new beta, I get this error and the rest of my page wont load.

Fatal error: Class ‘CodonData’ not found in /home/flyakaco/public_html/core/common/MailData.class.php on line 5

What version are you running? If it is below around 785 it will not support the new beta2.1 which I am guessing is the issue. You can remove the CodonData to bypass the error but there are other functions that will not work unless you are updated past 785.

1.2.743 , looks like I need to update

One small bug found -> When deleteing a sent item it does delete the item but takes you to a non existant template.

Open Mail.php and find lines 152-153

$this->set(‘mail’, $result);
$this->show(‘mail_deleted.tpl’);

Remove and replace with ->

header(‘Location: ‘.url(’/Mail/sent’));

That will take you back to the sent box.

I cant find the above code in Mail.php, all I can find is $Template not $this

Look for lines 152 and 153, I just checked the download and it is there.

Hey Simpilot,

Ive installed this addon into the latest beta and added the menu links as described. When i log in and click on the Airmail link it just loads a blank page nothing else… no errors… just nothing?

Any ideas?

Cheers,

Try just using

www.yoursite.com/index.php/mail

in the address bar and see what comes up. If mail comes up then it is the link in your menu, if nothing still comes up I am guessing a file in the wrong folder or a corrupted file when you uploaded. Try reloading all the files. Let me know how you make out.

Simpilot,

I managed to get it sorted… turns out id downloaded an older version of the application… re-installed the 2.1 beta and all works

On my site, I created a new folder called saved.  It doesn’t show. Also I am constantly getting the “you have mail” message even when I don’t… Not sure if its an issue with the latest build.

Did you upgrade from an old version or new install? There were some sql table changes for the folders and such going to 2.1 - Sounds like maybe that may be the issue. Check and make sure there are now two airmail related tables in the db. airmail and airmail_folders. Let me know what you find.

Yeah, I have the two tables.  The issue was , I got a message, move that message to a test folder I created and that folder doesn’t show in the links tree.  I am going to see If i did some thing to the code.

Got it sorted, mistake on my part.  Left some code out when I was editing the template.

Got it sorted, mistake on my part.  Left some code out when I was editing the template.

good deal  8)

Hi Simpilot. I have modified the mail image and added it to my nav. So it displays the you have no new mail correctly and when there is mail, it shows the mail box as should with a twist. I have added a sound file to it to audibly alert the user that they have mail much like AOHELL does.

Works great! However, is there a way I can make it so that it checks and if the notify sound has been played once, to not do it again? It notifies on login, then when clicking airmail, it plays it again.

I am going to take a wild stab at this and say that I should NOT include it in the nav, but simply in the pilot center so when they click the image to go to the airmail, it will not play it again.

Well I moved the image from nav to profile main. Seems more appropriate that way beings how they get redirected to that page on login.

I got the sound to work using the following code by modifying the check_mail.tpl file

<center>
<?php
    if ($items > 0)
	{
		echo '<img src="'.SITE_URL.'/mailimages/new_mail.gif" border="0" /><br /><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="1" height="1"><param name=movie value="../postsounds/newmail.swf"><param name=quality value=high><embed src="../postsounds/newmail.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="1" height="1"></embed></object>';
		echo '';
	}
	else
	{
		echo 'You have no new mail';
	}
?>
</center>

Now I wanted to make the image a link to the AirMail so I would not have to add another link in my nav. So ai modified the code even further to the following

<center>
<?php
    if ($items > 0)
	{
		echo '<a href="http://mweva.com/test/index.php/Mail"><img src="'.SITE_URL.'/mailimages/new_mail.gif" border="0" /></a><br />Click image to review mail<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="1" height="1"><param name=movie value="../postsounds/newmail.swf"><param name=quality value=high><embed src="../postsounds/newmail.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="1" height="1"></embed></object>';
		echo '';
	}
	else
	{
		echo 'You have no new mail';
	}
?>
</center>

I could not make it work using the link that works in core nav. I kept getting an error that I forgot to copy so I could let you know.

Now I am going to make a link from the one that says You have no new mail incase someone wants to send a mail out. or simply for email addicts who must check even though they have nothing. 

Ok here is the error I get while using the default link

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘,’ or ‘;’ in /home/XXXXXX/public_html/test/core/templates/mail_check.tpl on line 10

X’s are me doing for security

The code now looks like this

<center>
<?php
    if ($items > 0)
	{
		echo '<a href="http://mweva.com/test/index.php/Mail"><img src="'.SITE_URL.'/mailimages/new_mail.gif" border="0" /></a><br />Click image to review mail<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="1" height="1"><param name=movie value="../postsounds/newmail.swf"><param name=quality value=high><embed src="../postsounds/newmail.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="1" height="1"></embed></object>';
		echo '';
	}
	else
	{
		echo 'You have no new mail<br />Click <a href="<?php echo url('/Mail'); ?>">HERE</a> to create or check mail';
	}
?>
</center>

Now if I get rid of the link in the You have no new mail section and hard code the link in, error goes away and works just fine. Goes right to the mail center.

I know I am cunfusing as hell at times when I explain stuff. If you would like to see it in action how I have it working, let me know and I can give you some test user login info to my dev site.

P.S.

One key piece of info I forgot to include. To make the sound not come up twice, I had to modify the mail_inbox file to get rid of the mail check function. I thought it was kind of redundant to have that there anyhow. You can visually see if you have new messages or not without a image telling me so.  ;D   That is only my personal preference though. As is out of the box, it is a great script.

Hi simpilot, I am getting an error with the you have mail

Notice: The template file “/home/globalai/public_html//core/templates/mail_check.tpl” doesn’t exist in /home/globalai/public_html/core/classes/TemplateSet.class.php on line 227

that is the error, not sure how exactly to fix this, I am using 2.0.854 of phpvms not sure if it works with it but it should.

Cheers

Dan C

does this addon require PHP_Safe?

I would think not but i want to  make sure