Jump to content

AirMail 3.0


simpilot

Recommended Posts

I will have a look at it as soon as I am off work. Tnx.

regards,

Cor

You are welcome, and the code above this is the fix for the NOTAM bug. Long awaited, I'm sure. LOL, took Oxymoron five minutes. I can't take the credit, cuz while he was fixing it I was drowning myself in a mocaphrapacino. :)

The code you want is here --

ON the mail_sentitems.tpl ---

Replace this:

<?php echo $test->subject; ?>

With this:

<a href="<?php echo SITE_URL ?>/index.php/Mail/item/<?php echo $test->thread_id;?>"><?php echo $test->subject; ?>

That enables to view, but what we are working on is being able to add to a folder and have it not show up as you being the sender but rather showing the person it was sent to. It is going to require building a separate folder type for sent folders and being able to create those from the create folder page, as well as making a seperate mail_opensent.tpl for viewing sent items. Will probably have it done by this weekend, as I need to find time. But, for now, that code allows you to view them.

Thanks.

Link to comment
Share on other sites

The code you want is here --

ON the mail_sentitems.tpl ---

Replace this:

<?php echo $test->subject; ?>

With this:

<a href="<?php echo SITE_URL ?>/index.php/Mail/item/<?php echo $test->thread_id;?>"><?php echo $test->subject; ?>

That enables to view, but what we are working on is being able to add to a folder and have it not show up as you being the sender but rather showing the person it was sent to. It is going to require building a separate folder type for sent folders and being able to create those from the create folder page, as well as making a seperate mail_opensent.tpl for viewing sent items. Will probably have it done by this weekend, as I need to find time. But, for now, that code allows you to view them.

Thanks.

When I do this I can see the message that was sent to me and not the message I have sent :rolleyes:

Regards,

Cor

Link to comment
Share on other sites

Right. You are viewing the sent message, but it doesn't say who you sent it to, so it says it's from you to you.... Another problem is that once the message is deleted by the person you sent it to, you will get a message saying it is no longer available. Bottom line is that code pulls the ID of the actual message and when you view it you are using the mail_open.tpl. Airmail, only creates the message once. What needs to be coded, is the ability for the message to be created twice (once for the sender to be in sent and once for the receiver to be viewed in Inbox). Then we need to have a view page for the sent like mail_opensent.tpl and finally, another type of folder specifically for sent items for ability to be moved into them by the user. Oh, another thing... If the message has been replied to, then yes, you will see the reply to the message as it was sent to you because the code detects that it is you reading it and hides what you sent. View a message you sent that hasn't been replied to. You'll see what I mean. I say again, the code I gave pulls the ID of the AIRMail and allows you to view it as it stands now the way the code allows you to in the module. KNow that I am working on this, and that the code I gave you will change as I post this update when it is completed.

Link to comment
Share on other sites

When I do this I can see the message that was sent to me and not the message I have sent :rolleyes:

Regards,

Cor

Okay you are still going to see that until a viewing page for sent items is created, but I've noticed a few bugs already with the code I gave you. It comes up unavailable until the receiver reads it and then when they delete it. I will work on this and post it as soon as I have the solution.

Link to comment
Share on other sites

Okay you are still going to see that until a viewing page for sent items is created, but I've noticed a few bugs already with the code I gave you. It comes up unavailable until the receiver reads it and then when they delete it. I will work on this and post it as soon as I have the solution.

Ok I appreciate it. i have looked at it yesterday evening and if you fill in

<a href="<?php echo SITE_URL ?>/index.php/Mail/item/<?php echo $test->id;?>"><?php echo $test->subject; ?>

it refers to the right ID number in the database, but with $test->thread_id it takes the first messages with that number

:)

We will wait for a solution.

Regards,

Cor

Link to comment
Share on other sites

Ok I appreciate it. i have looked at it yesterday evening and if you fill in

<a href="<?php echo SITE_URL ?>/index.php/Mail/item/<?php echo $test->id;?>"><?php echo $test->subject; ?>

it refers to the right ID number in the database, but with $test->thread_id it takes the first messages with that number

:)

We will wait for a solution.

Regards,

Cor

Okay, Cor,

Wings on Air has the solution. Oxymoron coded it and this feature is finished and working. Frankly, I do not know everything that was done and can't begin to point out the code so as he said above, we are waiting on SimPilot and it will be at github. And, yes, you are going to love the features for this. It works! Just take a look at the images for sent items.

mail_sentitems.tpl

item1.jpg

mail_open.tpl

item2.jpg

Additional features to come! Features like; a contacts list or address book, sent item folders, ability to save drafts and view in a drafts section. Airmail is evolving. Github link will be posted soon by Oxymoron.

  • Like 1
Link to comment
Share on other sites

Nice waking up at sundaymorning :-) Tnx

Cor

Thank You for waiting, Cor. I hope you and your VA Group love the changes Oxymoron worked hard on. I must take this time to say that with time permitting, Wings On Air Virtual Aviation and Oxymoron PHP Development is committed to support the continued development of PHPVMS. There will be more to come in the future.

Simpilots AIRMail Is Evolving

Code At Github

Pending Pull Request

Link to comment
Share on other sites

On my site some pilots complain that they receive email saying : You received a new message with the subject (Mail problem) in your pilot's message inbox on 04/16/2013, but when they go to the site the mailbox is empty. What i find out thats only happen when i send NOTAM to all pilots and they dont made any flight , so system ignore them. Now question how i can setup to stop sending to inactive pilots message or send .

Link to comment
Share on other sites

On my site some pilots complain that they receive email saying : You received a new message with the subject (Mail problem) in your pilot's message inbox on 04/16/2013, but when they go to the site the mailbox is empty. What i find out thats only happen when i send NOTAM to all pilots and they dont made any flight , so system ignore them. Now question how i can setup to stop sending to inactive pilots message or send .

If the AIRMail module is updated properly, there shouldn't be a problem. If it is then you are having a problem caused by some other reason.

('.$subject.')

on line 143 of the mail.php file in the modules/mail directory refers to a public static function written in the MailDataClass.php

on line 83. Let me know if you have both of those files written and if you are still having the same problem.

In Reference to the NOTAM Problem, on line 142 and 155 of the Mail.php file in the modules/mail directory "

$sub = 'You have reveived a new message at '.SITE_NAME;

is written to say its from your site. This only works if you have phpvms set up correctly and if you do then something else is causing your site name

not to show up. That code if you have it correctly should pull it. The site name is set by going to your PHPVMS Admin Panel, then to Site and Settings, then General Settings... You should see it there.

`OR`

You can simply delete

'.SITE_NAME

and write in your site name and it will still work the same. Or, you can try replacing it with

'.SITE_URL

, or even typing out your url, being sure to use

http//

. The site url is set in the same place.

On line 142,143, 155, and 156 you can edit them to say whatever you want. They are your email template area.

Earlier I posted This

Yes. Ironic to get on here and see your post. Just worked on that tonight and, yes, that feature is partially working at my site wingsonair.net along with several other new features. Too much to get the codes in order for posting, but I soon will. One of the features created was a folders page where you can view folders as icons and edit, create or delete them from that page. So to add to the ability of reading the mails from the sent folder found that when choosing to move them to a folder, which you can do, they appear as received from yourself. With time permitting, I should have that working before the end of the week. Several innovations, an email template for the mail.php file both for regular AIRMails and NOTAMS; addon for messaging pilot from their profile which ads a 3rd type of message and separate action.php file so when the notice is receive to the pilot that they have an email a different template for that email can be use to notify the pilot the message came specifically from their profile; ability to save drafts; ability to cc another pilot, and ccc; when mail is open ability to view next and previous "unread" mails -- and much more. As for the mail templates, I can post those now: Just look for the familiar lines in Mail.php located inside your core/mail folder and paste the code. Be sure you are placing it correctly. Our mail.php file has been modified so much that I'm not sure if I'm giving code we wrote or not.

 $pilots=(PilotData::findPilots(array('p.retired' => '0')));
foreach ($pilots as $pilot) {
$notam = $notam+1;
MailData::send_new_mail($pilot->pilotid, $who_from, $subject, $message, $notam, $thread_id);
if(MailData::send_email($pilot->pilotid) === TRUE){
$pilot = PilotData::getPilotData($who_to);
$sender = PilotData::getPilotData($who_from);
$email = $pilot->email;
$sub = 'AIRMail NOTAM Received From '.SITE_NAME;
$message = '[url="http://wingsonair.net"][img=http://wingsonair.net/woa/lib/skins/wingsonair/images/airmail/mail/airmail_mail_notam.png][/url]



Hello, '.$pilot->firstname.'.



You received a new AIRMail NOTAM message with the subject ([b][b][color="#FA0707"]'.$subject.'[/color][/b][/b]) in your pilot\'s message inbox on



'.date('m/d/Y', time()).'.



This Message was sent via Wings On AIRMail from [b][b][color="#FA0707"]'.$sender->firstname.' '.$sender->lastname.'[/color][/b][/b].



Click [b][b][color="#FA0707"][url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]HERE[/url][/color][/b][/b] or below, or copy the link below and paste it into your browser to view this message!:



[url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]http://wingsonair.net/index.php#Mail/item/'.$thread_id.'[/url]



Thank You,



WOAVA Support';
Util::SendEmail($email, $sub, $message);
}
}
}
else
{
MailData::send_new_mail($who_to, $who_from, $subject, $message, '0', $thread_id);
if(MailData::send_email($who_to) === TRUE){
$pilot = PilotData::getPilotData($who_to);
$pilot = PilotData::getPilotData($who_to);
$sender = PilotData::getPilotData($who_from);
$email = $pilot->email;
$sub = 'AIRMail Message Received From '.SITE_NAME;
$message = '[url="http://wingsonair.net"][img=http://wingsonair.net/woa/lib/skins/wingsonair/images/airmail/mail/airmail_mail_received.png][/url]



Hello, '.$pilot->firstname.'.



You received a new AIRMail message with the subject ([b][b][color="#FA0707"]'.$subject.'[/color][/b][/b]) in your pilot\'s message inbox on



'.date('m/d/Y', time()).'.



This Message was sent via Wings On AIRMail from [b][b][color="#FA0707"]'.$sender->firstname.' '.$sender->lastname.'[/color][/b][/b].



Click [b][b][color="#FA0707"][url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]HERE[/url][/color][/b][/b] or below, or copy the link below and paste it into your browser to view this message!:



[url="http://wingsonair.net/index.php#Mail/item/'.$thread_id.'"]http://wingsonair.net/index.php#Mail/item/'.$thread_id.'[/url]



Thank You,



WOAVA Support';
Util::SendEmail($email, $sub, $message);
}
}

$this->set('message', '
AIRMail Message Sent!
');
$this->message();

Link to comment
Share on other sites

I get "Fatal error: Class 'MailData' not found in /home/lobaras/public_html/en/core/modules/Mail/Mail.php on line 52" when i try to load AIRmail from my pilot center.

Be sure you have all the parts and they are installed in the right directory. The Templates/Mail folder can be moved or copied to your skins directory for editing or skinning. The file the code there refers to is the mail/mail_message.tpl. If you do not have it or it is in the wrong place, then you will get that error. If you modified the mail_message.tpl incorrectly, that will cause the same result. Hope this helps.

Link to comment
Share on other sites

I'm using AirMail 2.0 and just discovered my messages aren't displaying anymore. I checked the database via phpMyAdmin and the entries are there. The code to show the message is:

echo $data->message

Is this correct?

I'm not sure where you are referring to seeing that code. and are you talking about the messages in your inbox? If you've removed your sql tables before updating to the new sql tables the messages would be deleted as well because they are stored in my sql. I'm not sure what you did since you are telling me you are still using 2.0.

If you are using Airmail 2.0, I recommend updating to 3.0 completely and re skinning the modules templates to fit your needs. A clean update. The updates talked about here are for 3.0 and not 2.0. Alot of the files have basically been rewritten since 2.0, so if you update just parts, you will miss something and essentially break functionality in the module.

|Code On Github|

Link to comment
Share on other sites

Not a problem, sorry for the delay, I am back in treatment and unfortunatly spend a lot of time sleeping.

Oh, wasn't even worried. But you get better, soon. Lots of rest, Sir. So far, not too many complaints. Oxy's pretty busy with his work, so it will be a bit before the next updates.

Link to comment
Share on other sites

A little Update: The Address Book is available, thanks to Oxymoron. This is a really neat add-on module to work with Simpilots' AirMail 3.0. It's a separate module, because it can work with AirMail or without, provided the links to message a pilot are removed. This module is essentially a Buddy List. A link to add a pilot can be put in the Pilot's Roster, or on the public profile. Or even be called to show on the pilot center. If you are real familiar with PHPVMS you will see all the possibility's. This module is in current development for more features, however the working source code is available now;

Look Here

:rolleyes:

Link to comment
Share on other sites

Will it be released?

Yes, it will be packaged and be maid available as an addon as soon as Oxy has the time. For now, however the source code can be found Here @ Github in the Files Changed Tab.

If you are willing to assemble it and begin using it. You will need to copy the code from those pages referring to contacts. The file structure is as follows:

core/common/ContactsData.class.php

core/modules/Contacts/Contacts.php

core/templates/contacts/contacts_home.tpl

core/templates/contacts/view_contact.tpl

Before you can use this AirMail addition you must update AirMail 3.0 with the newest changes by Oxymoron. (information for that is here.)

Keep in mind that we are constantly updating this new addon for AirMail. There will be more updates to it to include features like a mini buddy list you can put on the pilot pub profile and pull counts of how many contacts you have and blocked contacts you have. They are complete, but have not been posted yet. When Oxy has time they will be added to the source code.

Link to comment
Share on other sites

Hi!

I need to know if there's some way to change the order mails are shown, I want them to appear from the newest one to the oldest one. Thank you!

In your MailData.class.php, edit the 'getallmail' function so that ORDER BY date DESC becomes ORDER BY date ASC.

Link to comment
Share on other sites

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