DataObjects/Core_watch.php
[Pman.Core] / Mailer.php
index 459dbd6..8ae5336 100644 (file)
@@ -140,7 +140,9 @@ class Pman_Core_Mailer {
             
             // for the html body, we may want to convert the attachments to images.
 //            var_dump($htmlbody);exit;
-            $htmlbody = $this->htmlbodytoCID($htmlbody);
+            if ($this->replaceImages) {
+                $htmlbody = $this->htmlbodytoCID($htmlbody);    
+            }
             
               
         }
@@ -368,7 +370,6 @@ class Pman_Core_Mailer {
             
         }
         
-        $url = 'http://www.google.com.hk/images/srpr/logo11w.png';
         // CACHE???
         // 2 files --- the info file.. and the actual file...
         // add user
@@ -378,7 +379,7 @@ class Pman_Core_Mailer {
         
         $cache = ini_get('session.save_path')."/Pman_Core_Mailer-{$user}/" . md5($url);
         if (file_exists($cache) and filemtime($cache) > strtotime('NOW - 1 WEEK')) {
-            $ret =  json_decode($cache);
+            $ret =  json_decode(file_get_contents($cache), true);
             $ret['file'] = $cache . '.data';
             return $ret;
         }
@@ -406,7 +407,6 @@ class Pman_Core_Mailer {
         
         file_put_contents($cache, json_encode($ret));
         $ret['file'] = $cache . '.data';
-        print_r($ret);exit;
         return $ret;
     }