Exemplo n.º 1
0
 /**
  * @access private
  */
 private function get_message_cache($key, $from, $to, $sort_field, $sort_order)
 {
     $cache_key = "{$key}:{$from}:{$to}:{$sort_field}:{$sort_order}";
     $db_header_fields = array('idx', 'uid', 'subject', 'from', 'to', 'cc', 'date', 'size');
     $config = rcmail::get_instance()->config;
     // use idx sort for sorting by Date with index_sort=true or for unknown field
     if ($sort_field == 'date' && $this->index_sort || !in_array($sort_field, $db_header_fields)) {
         $sort_field = 'idx';
     }
     if ($this->caching_enabled && !isset($this->cache[$cache_key])) {
         $this->cache[$cache_key] = array();
         $sql_result = $this->db->limitquery("SELECT idx, uid, headers\n         FROM " . get_table_name('messages') . "\n         WHERE  user_id=?\n         AND    cache_key=?\n         ORDER BY " . $this->db->quoteIdentifier($sort_field) . " " . strtoupper($sort_order), $from, $to - $from, $_SESSION['user_id'], $key);
         while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
             $uid = $sql_arr['uid'];
             $this->cache[$cache_key][$uid] = $this->db->decode(unserialize($sql_arr['headers']));
             // featch headers if unserialize failed
             if (empty($this->cache[$cache_key][$uid])) {
                 $this->cache[$cache_key][$uid] = iil_C_FetchHeader($this->conn, preg_replace('/.msg$/', '', $key), $uid, true, $this->fetch_add_headers);
             }
         }
     }
     return $this->cache[$cache_key];
 }
Exemplo n.º 2
0
$arrayContent = explode("<br>", $content);
$t = time();
$filename = "/tmp/" . $t . ".txt";
$fp = fopen($filename, "w");
foreach ($arrayContent as $val) {
    fwrite($fp, $val . "\n");
}
fwrite($fp, ".\n");
fclose($fp);
echo "<HTML><HEAD><meta http-equiv=\"Content-Type\" content=\"text/html; charset=BIG5\"><link rel=\"stylesheet\" href=\"my.css\" type=\"text/css\"><TITLE></TITLE></HEAD><BODY>";
$my_prefs["html_in_frame"] = true;
$my_charset = "BIG5";
$my_colors["main_darkbg"] = "#FAFFE5";
$my_colors["main_hilite"] = "#E6EDB6";
$fp = fopen($filename, "r");
$header = iil_C_FetchHeader($fp);
fseek($fp, 0);
$structure_str = iil_C_FetchStructureString($fp);
fseek($fp, 0);
echo "\n<!-- " . $structure_str . "-->\n";
flush();
$structure = iml_GetRawStructureArray($structure_str);
$num_parts = iml_GetNumParts($structure, $part);
$parent_type = iml_GetPartTypeCode($structure, $part);
$uid = $header->uid;
if ($parent_type == 1 && $num_parts == 1) {
    $part = 1;
    $num_parts = iml_GetNumParts($structure, $part);
    $parent_type = iml_GetPartTypeCode($structure, $part);
}
//show subject