From 78969b6d3adb9e3162754207a5a57a3a1e58fd4f Mon Sep 17 00:00:00 2001
From: uckelman 
Date: Sun, 11 Apr 2010 21:15:54 +0000
Subject: Adding forum -> list bridge.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6686 67b53d14-2c14-4ace-a08f-0dab2b34000c
---
 src/F2M.php  | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/Util.php |  4 ++++
 2 files changed, 64 insertions(+)
 create mode 100644 src/F2M.php
diff --git a/src/F2M.php b/src/F2M.php
new file mode 100644
index 0000000..980aca8
--- /dev/null
+++ b/src/F2M.php
@@ -0,0 +1,60 @@
+$e
\n";
+}
+
+function send_to_lists($user, $data, $post_data) {
+
+/*
+  require_once('Mail.php');
+
+  require_once(__DIR__ . '/Bridge.php');
+  require_once(__DIR__ . '/Util.php');
+*/
+
+  $postId = $data['post_id'];
+
+  $userName = $user->data['username'];
+  $userEmail = $user->data['user_email'];
+ 
+  $date = $data['post_time']; 
+  $subject = $post_data['post_subject'];
+
+  $body = $data['message'];
+
+  print '';
+  var_dump($data);
+  var_dump($post_data);
+  print '
';
+
+/*
+  $bridge = new Bridge();
+
+  $to = $bridge->getLists($forumId);
+  $messageId = build_message_id($postId);
+
+  $headers = array(
+    'To'           => implode(', ', $to),
+    'From'         => "$userName <$userEmail>",
+    'Subject'      => $subject,
+    'Date',        => $date,
+    'Message-Id',  => $messageId,
+    'X-BeenThere'  => $forumURL,
+  );
+
+
+
+
+
+
+  $mailer = Mail::factory('sendmail');
+  $mailer->send($to, $headers, $body);
+*/
+
+}
+
+?>
diff --git a/src/Util.php b/src/Util.php
index 817e8a1..62981b2 100644
--- a/src/Util.php
+++ b/src/Util.php
@@ -4,4 +4,8 @@ function throw_if_null($arg) {
   if ($arg === null) throw new Exception('argument is null');
 }
 
+function build_message_id($postId, $forumHost) {
+  return '<' . time() . ".bridge.$postId@$forumHost>";
+}
+
 ?>
-- 
cgit v1.2.3