Jump to content

AIRMail Beta 2.1


simpilot

Recommended Posts

  • Administrators

airmail_logo.png

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

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 weeks later...
  • Administrators

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.

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.  ;)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

  • Administrators

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

That error would lead me to believe that the mail_check template does not exist in the core/templates folder or is corrupted. Try re-uploading that template and let us know if that clears up the error.

Link to comment
Share on other sites

  • 2 weeks later...

do we know if this works on Beta Version 2.0.869 ?

I updated my site then upgraded airmail and now I get

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'Mail::inbox' was given in /home/xxxxxxx/public_html/thunderva/core/classes/MainController.class.php on line 292

obviously I replaced one word in there for security note the X's

I first upgraded my site to phpvms beta version mentioned above. Then I went to phpmyadmin and dropped the airmail table, uploaded the 2.1 airmail files and then ran the airmail new sql file and this is what I get. I am going to go and try again by dropping airmail tables and removing all files and start from scratch.

Link to comment
Share on other sites

  • Administrators

It is working in the latest beta for me.

There is no /inbox function in the latest beta for AIRMail, I think that is where your error is coming from. In your link for AIRMail try using,

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

I think that will take care of it... Let us know how you make out.

Link to comment
Share on other sites

Ok I got it all working great except for the following.

When I go to delete a message that is in the sent messages folder, I get the following

Notice: The template file "/home/xxxxxx/public_html/thunderva//core/templates/mail_deleted.tpl" doesn't exist in /home/xxxxxxx/public_html/thunderva/core/classes/TemplateSet.class.php on line 227

Obviously the x's are there for security purpose. They are not part of the real url.

Now the first thing I did was make sure I did not skip a file on upload. Infact, I did not. That file it is calling for, is not even a part of the Airmail 2 download. I have dloaded the file 2 times to make sure I did not get a corrupt dload and both times that file was not there. Other then that, airmail is great.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...