Attempting to setup a Picture Moblog for my site. I found a script that works with Sprint PCS picture mails, and that works good. However the way Sprint handles pictures vs. say Verizon is different and I'm having a hard time figuring out how to save the message portion from Verizon.
A friend more familiar with php than myself stated that what I might need is a regex command of which I don't know how to do.
Here's what I think I need:
you want a regex that says "grab the text between the > and the <BR>> that occurs right before the string <BR>;This message was sent using PixFlix
Here's the html code that I get from a Verizon Picturemail:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV> </DIV>
<DIV>----- Original Message -----
<DIV>From: <<A
href="mailto:test2@123.com">test2@123.com</A>></DIV>
<DIV>To: <<A href="mailto:test@123.com">test@123.com</A>></DIV>
<DIV>Sent: Saturday, March 12, 2005 2:03 PM</DIV></DIV>
<DIV><BR></DIV>> Cheese<BR>> <BR>> This message was sent using PIX-FLIX
Messaging service from Verizon Wireless!<BR>> <BR>> To learn how you can
snap pictures with your wireless phone visit <A
href="http://www.verizonwireless.com/getitnow/getpix">[url]www.verizonwireless.com/getitnow/getpix[/url]</A>.<BR>> <BR>>
To learn how you can record videos with your wireless phone visit <A
href="http://www.verizonwireless.com/getitnow/getflix">[url]www.verizonwireless.com/getitnow/getflix[/url]</A>.<BR>> <BR>>
To play video messages sent to email, QuickTime 6.5 or higher is required. Visit
<A
href="http://www.apple.com/quicktime/download">[url]www.apple.com/quicktime/download[/url]</A>
to download the free player or upgrade your existing QuickTime Player.
Note: During the download process when asked to choose an installation type
(Minimum, Recommended or Custom), select Minimum for faster
download.<BR>></BODY></HTML>
I figured out how to strip everything from that email, but I'm trying to save the message portion and in this particular picturemail, the message is simply "Cheese".
Any ideas? If not and you could forward me on, I'd appreciate it!
The Sprint coding I use is this:
<?php
require_once(dirname(__FILE__).'/include/mod_sprintpcs.inc.php');
if ($post['post_mail_subject'] == "") {
$post['post_mail_subject'] = mod_sprintpcs_subject($post['post_mail_body']);
}
?>
And the include file looks like this:
<?php
function mod_sprintpcs_subject ($subject) {
$subject = strstr($subject, '</b><br/>');
$subject = explode('</font>', $subject);
$subject = trim($subject[0]);
$subject = strip_tags($subject);
$subject = "TEST";
return ($subject);
}
function mod_sprintpcs_body ($body) {
$body = strstr($body, 'http://pictures.sprintpcs.com//shareImage/');
$body = explode("\"", $body);
$body = '<img src="' . trim($body[0]) . '"</img>';
return ($body);
}
?>
Any help would be greatly appreciated!