当前位置: 首页>>代码示例>>PHP>>正文


PHP mimetype函数代码示例

本文整理汇总了PHP中mimetype函数的典型用法代码示例。如果您正苦于以下问题:PHP mimetype函数的具体用法?PHP mimetype怎么用?PHP mimetype使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mimetype函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle

 /**
  * Handle the match
  */
 function handle($match, $state, $pos, &$handler)
 {
     global $ID;
     $match = substr($match, 9, -11);
     // strip markup
     list($flags, $match) = explode('>', $match, 2);
     $flags = explode('&', substr($flags, 1));
     $items = explode('*', $match);
     $pages = array();
     $c = count($items);
     for ($i = 0; $i < $c; $i++) {
         if (!preg_match('/\\[\\[(.+?)\\]\\]/', $items[$i], $match)) {
             continue;
         }
         list($id, $title, $description) = explode('|', $match[1], 3);
         list($id, $section) = explode('#', $id, 2);
         if (!$id) {
             $id = $ID;
         }
         resolve_pageid(getNS($ID), $id, $exists);
         // page has an image title
         if ($title && preg_match('/\\{\\{(.+?)\\}\\}/', $title, $match)) {
             list($image, $title) = explode('|', $match[1], 2);
             list($ext, $mime) = mimetype($image);
             if (!substr($mime, 0, 5) == 'image') {
                 $image = '';
             }
             $pages[] = array('id' => $id, 'section' => cleanID($section), 'title' => trim($title), 'image' => trim($image), 'description' => trim($description), 'exists' => $exists);
             // text title (if any)
         } else {
             $pages[] = array('id' => $id, 'section' => cleanID($section), 'title' => trim($title), 'description' => trim($description), 'exists' => $exists);
         }
     }
     return array($flags, $pages);
 }
开发者ID:kosenconf,项目名称:kcweb,代码行数:38,代码来源:syntax.php

示例2: add_file_callback

 private static function add_file_callback($id, $new_file, $filename)
 {
     $CI =& get_instance();
     $hash = md5_file($new_file);
     $storage_id = null;
     $query = $CI->db->select('id, hash')->from('file_storage')->where('hash', $hash)->get()->result_array();
     foreach ($query as $row) {
         $data_id = implode("-", array($row['hash'], $row['id']));
         $old_file = $CI->mfile->file($data_id);
         // TODO: set $new_file
         if (files_are_equal($old_file, $new_file)) {
             $storage_id = $row["id"];
             break;
         }
     }
     if ($storage_id === null) {
         $filesize = filesize($new_file);
         $mimetype = mimetype($new_file);
         $CI->db->insert("file_storage", array("filesize" => $filesize, "mimetype" => $mimetype, "hash" => $hash, "date" => time()));
         $storage_id = $CI->db->insert_id();
     }
     $data_id = $hash . "-" . $storage_id;
     // TODO: all this doesn't have to run if the file exists. updating the mtime would be enough
     //       that would also be better for COW filesystems
     $dir = $CI->mfile->folder($data_id);
     file_exists($dir) || mkdir($dir);
     $new_path = $CI->mfile->file($data_id);
     $dest = new \service\storage($new_path);
     $tmpfile = $dest->begin();
     rename($new_file, $tmpfile);
     $dest->commit();
     $CI->mfile->add_file($id, $filename, $storage_id);
 }
开发者ID:Anon215,项目名称:filebin,代码行数:33,代码来源:files.php

示例3: handle_output

 function handle_output(&$event, $param)
 {
     if ($event->data['do'] != 'imageshack') {
         return;
     }
     global $lang;
     echo '<h1 id="media__ns">' . $this->getLang('name') . '</h1>';
     echo '<p>' . $this->getLang('intro') . '</p>';
     echo '<form action="' . DOKU_BASE . 'lib/exe/mediamanager.php" method="post" enctype="multipart/form-data">';
     echo '<input type="hidden" name="do" value="imageshack" />';
     echo '<input type="file" name="imageshack_file" />';
     echo '<input type="submit" value="' . $lang['btn_upload'] . '" class="button" />';
     echo '</form>';
     // output the uploads stored in the current session
     if (is_array($_SESSION['imageshack'])) {
         $files = array_reverse($_SESSION['imageshack']);
         $twibble = 1;
         foreach ($files as $item) {
             $twibble *= -1;
             $zebra = $twibble == -1 ? 'odd' : 'even';
             list($ext, $mime, $dl) = mimetype($item['name']);
             $class = preg_replace('/[^_\\-a-z0-9]+/i', '_', $ext);
             $class = 'select mediafile mf_' . $class;
             echo '<div class="' . $zebra . '">' . NL;
             echo '<a name="h_' . $item['link'] . '" class="' . $class . '">' . hsc($item['name']) . '</a> ';
             echo '<span class="info">(' . $item['width'] . '&#215;' . $item['height'] . ' ' . filesize_h($item['size']) . ')</span>' . NL;
             echo ' <a href="' . $item['adlink'] . '" target="_blank"><img src="' . DOKU_BASE . 'lib/images/magnifier.png" ' . 'alt="' . $lang['mediaview'] . '" title="' . $lang['mediaview'] . '" class="btn" /></a>' . NL;
             echo '<div class="example" id="ex_' . str_replace(':', '_', $item['link']) . '">';
             echo $lang['mediausage'] . ' <code>{{' . hsc($item['link']) . '}}</code>';
             echo '</div>';
             if ($item['width'] > 120 || $item['height'] > 100) {
                 $w = 120;
                 $h = 100;
             } else {
                 $w = $item['width'];
                 $h = $item['height'];
             }
             $src = ml($item['link'], array('w' => $w, 'h' => $h));
             $p = array();
             $p['width'] = $w;
             $p['height'] = $h;
             $p['alt'] = $item['name'];
             $p['class'] = 'thumb';
             $att = buildAttributes($p);
             // output
             echo '<div class="detail">';
             echo '<div class="thumb">';
             echo '<a name="d_' . $item['link'] . '" class="select">';
             echo '<img src="' . $src . '" ' . $att . ' />';
             echo '</a>';
             echo '</div>';
             echo '</div>';
             echo '<div class="clearer"></div>' . NL;
             echo '</div>' . NL;
         }
     }
     $event->preventDefault();
 }
开发者ID:splitbrain,项目名称:dokuwiki-plugin-imageshack,代码行数:58,代码来源:action.php

示例4: addFileAsPicture

 /**
  * Adds the file $src as a picture file without adding it to the content.
  * Returns name of the file in the document for reference.
  *
  * @param string $src
  * @return string
  */
 function addFileAsPicture($src)
 {
     $name = '';
     if (file_exists($src)) {
         list($ext, $mime) = mimetype($src);
         $name = 'Pictures/' . md5($src) . '.' . $ext;
         $this->addFile($name, $mime, io_readfile($src, false));
     }
     return $name;
 }
开发者ID:a-gundy,项目名称:dokuwiki-plugin-odt,代码行数:17,代码来源:docHandler.php

示例5: _media

 function _media($src, $title = NULL, $align = NULL, $width = NULL, $height = NULL, $cache = NULL)
 {
     $ret = '';
     list($ext, $mime) = mimetype($src);
     if (substr($mime, 0, 5) == 'image') {
         //add image tag
         $ret .= '<img src="media/' . str_replace(':', '/', $src) . '"';
         $ret .= ' class="media' . $align . '"';
         if (!is_null($title)) {
             $ret .= ' title="' . $this->_xmlEntities($title) . '"';
             $ret .= ' alt="' . $this->_xmlEntities($title) . '"';
         } else {
             $ret .= ' alt=""';
         }
         if (!is_null($width)) {
             $ret .= ' width="' . $this->_xmlEntities($width) . '"';
         }
         if (!is_null($height)) {
             $ret .= ' height="' . $this->_xmlEntities($height) . '"';
         }
         $ret .= ' />';
     } elseif ($mime == 'application/x-shockwave-flash') {
         $ret .= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' . ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"';
         if (!is_null($width)) {
             $ret .= ' width="' . $this->_xmlEntities($width) . '"';
         }
         if (!is_null($height)) {
             $ret .= ' height="' . $this->_xmlEntities($height) . '"';
         }
         $ret .= '>' . DOKU_LF;
         $ret .= '<param name="movie" value="media/' . str_replace(':', '/', $src) . '" />' . DOKU_LF;
         $ret .= '<param name="quality" value="high" />' . DOKU_LF;
         $ret .= '<embed src="media/' . str_replace(':', '/', $src) . '"' . ' quality="high"';
         if (!is_null($width)) {
             $ret .= ' width="' . $this->_xmlEntities($width) . '"';
         }
         if (!is_null($height)) {
             $ret .= ' height="' . $this->_xmlEntities($height) . '"';
         }
         $ret .= ' type="application/x-shockwave-flash"' . ' pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>' . DOKU_LF;
         $ret .= '</object>' . DOKU_LF;
     } elseif (!is_null($title)) {
         // well at least we have a title to display
         $ret .= $this->_xmlEntities($title);
     } else {
         // just show the source
         $ret .= $this->_xmlEntities($src);
     }
     return $ret;
 }
开发者ID:bomberstudios,项目名称:dokuwiki-offline-html,代码行数:50,代码来源:renderer.php

示例6: renderValue

 /**
  * Output the stored data
  *
  * If outputted in an aggregation we collect the images into a gallery.
  *
  * @param string|int $value the value stored in the database
  * @param \Doku_Renderer $R the renderer currently used to render the data
  * @param string $mode The mode the output is rendered in (eg. XHTML)
  * @return bool true if $mode could be satisfied
  */
 public function renderValue($value, \Doku_Renderer $R, $mode)
 {
     // get width and height from config
     $width = null;
     $height = null;
     if ($this->config['width']) {
         $width = $this->config['width'];
     }
     if ($this->config['height']) {
         $height = $this->config['height'];
     }
     if (!empty($R->info['struct_table_hash'])) {
         // this is an aggregation, check for special values
         if ($this->config['agg_width']) {
             $width = $this->config['agg_width'];
         }
         if ($this->config['agg_height']) {
             $height = $this->config['agg_height'];
         }
     }
     // depending on renderer type directly output or get value from it
     $returnLink = null;
     $html = '';
     if (!media_isexternal($value)) {
         if (is_a($R, '\\Doku_Renderer_xhtml')) {
             /** @var \Doku_Renderer_xhtml $R */
             $html = $R->internalmedia($value, null, null, $width, $height, null, 'direct', true);
         } else {
             $R->internalmedia($value, null, null, $width, $height, null, 'direct');
         }
     } else {
         if (is_a($R, '\\Doku_Renderer_xhtml')) {
             /** @var \Doku_Renderer_xhtml $R */
             $html = $R->externalmedia($value, null, null, $width, $height, null, 'direct', true);
         } else {
             $R->externalmedia($value, null, null, $width, $height, null, 'direct');
         }
     }
     // add gallery meta data in XHTML
     if ($mode == 'xhtml') {
         list(, $mime, ) = mimetype($value, false);
         if (substr($mime, 0, 6) == 'image/') {
             $hash = !empty($R->info['struct_table_hash']) ? "[gal-" . $R->info['struct_table_hash'] . "]" : '';
             $html = str_replace('href', "rel=\"lightbox{$hash}\" href", $html);
         }
         $R->doc .= $html;
     }
     return true;
 }
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:59,代码来源:Media.php

示例7: moveMediaAttic

 /**
  * Move the old revisions of the media file that is specified in the options
  *
  * @param string $src_ns   The original namespace
  * @param string $src_name The original basename of the moved doc (empty for namespace moves)
  * @param string $dst_ns   The namespace after the move
  * @param string $dst_name The basename after the move (empty for namespace moves)
  * @return bool If the attic files were moved successfully
  */
 public function moveMediaAttic($src_ns, $src_name, $dst_ns, $dst_name)
 {
     global $conf;
     $ext = mimetype($src_name);
     if ($ext[0] !== false) {
         $name = substr($src_name, 0, -1 * strlen($ext[0]) - 1);
     } else {
         $name = $src_name;
     }
     $newext = mimetype($dst_name);
     if ($newext[0] !== false) {
         $newname = substr($dst_name, 0, -1 * strlen($newext[0]) - 1);
     } else {
         $newname = $dst_name;
     }
     $regex = '\\.\\d+\\.' . preg_quote((string) $ext[0], '/');
     return $this->execute($conf['mediaolddir'], $src_ns, $name, $dst_ns, $newname, $regex);
 }
开发者ID:kochichi,项目名称:dokuwiki-plugin-move,代码行数:27,代码来源:file.php

示例8: __construct

 public function __construct()
 {
     // Prepare
     parent::__construct();
     $manager = new Manager(new ArrayDriver());
     $this->__lock = $manager->caller(new Path());
     $this->__lock->deny('all');
     // REST
     $this->middleware(function ($middlewares) {
         if (isset($_POST['_METHOD'])) {
             $_SERVER['REQUEST_METHOD'] = strtoupper($_POST['_METHOD']);
             unset($_POST['_METHOD']);
         }
         $middlewares->next();
     });
     // Return allowed files
     $this->middleware(function ($middlewares) {
         $path = $this->_formatPath($this['request']->getResourceUri());
         if (file_exists($path) && is_file($path) && $this->__lock->can($this->_formatPath($path))) {
             // Get mime type
             $mime = mimetype($path);
             // Try some more extensions
             if ($mime == 'text/plain') {
                 if (strpos($path, '.css')) {
                     $mime = 'text/css';
                 }
                 if (strpos($path, '.js')) {
                     $mime = 'application/javascript';
                 }
                 if (strpos($path, '.json')) {
                     $mime = 'application/json';
                 }
             }
             // Set content type
             if ($mime != 'text/plain') {
                 header('Content-Type: ' . $mime);
             }
             // Print file
             echo file_get_contents($path);
             exit;
         }
         $middlewares->next();
     });
 }
开发者ID:pyrsmk,项目名称:lumy,代码行数:44,代码来源:Http.php

示例9: sl_upload

function sl_upload($srcFile, $dstFile)
{
    $uploadType = Get::cfg('uploadType');
    // check if the mime type is allowed by the whitelist
    // if the whitelist is empty all types are accepted
    require_once _lib_ . '/lib.mimetype.php';
    $upload_whitelist = Get::sett('file_upload_whitelist', 'zip,jpg,gif,png,txt,csv,rtf,xml,doc,docx,xls,xlsx,ppt,pptx,odt,ods,odp,pdf,xps,mp4,mp3,flv,swf,mov,wav,ogg,flac,wma,wmv');
    $upload_whitelist_arr = explode(',', trim($upload_whitelist, ','));
    if (!empty($upload_whitelist_arr)) {
        $valid_ext = false;
        $file_ext = strtolower(substr(strrchr($dstFile, "."), 1));
        foreach ($upload_whitelist_arr as $k => $v) {
            // remove extra spaces and set lower case
            $ext = trim(strtolower($v));
            $mt = mimetype($ext);
            if ($mt) {
                $mimetype_arr[] = $mt;
            }
            getOtherMime($ext, $mimetype_arr);
            if ($ext == $file_ext) {
                $valid_ext = true;
            }
        }
        $mimetype_arr = array_unique($mimetype_arr);
        if (class_exists('file') && method_exists('finfo', 'file')) {
            $finfo = new finfo(FILEINFO_MIME_TYPE);
            $file_mime_type = $finfo->file($srcFile);
        } else {
            $file_mime_type = mime_content_type($srcFile);
        }
        if (!$valid_ext || !in_array($file_mime_type, $mimetype_arr)) {
            return false;
        }
    }
    $dstFile = stripslashes($dstFile);
    if ($uploadType == "ftp") {
        return sl_upload_ftp($srcFile, $dstFile);
    } elseif ($uploadType == "cgi") {
        return sl_upload_cgi($srcFile, $dstFile);
    } else {
        return sl_upload_fs($srcFile, $dstFile);
    }
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:43,代码来源:lib.upload.php

示例10: download

function download($path, $home, $force = true)
{
    if (is_file($home . $path) && $force) {
        header('Content-type: application/octet-stream');
        header('Content-Disposition: attachment; filename="' . basename($path) . '";');
        header('Content-Transfer-Encoding: binary');
        readfile($home . $path);
    } elseif (is_file($home . $path)) {
        header('Content-type: ' . mimetype($home . $path));
        readfile($home . $path);
    } else {
        header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
        header('Status: 404 Not Found');
        $_SERVER['REDIRECT_STATUS'] = 404;
        if (!$force) {
            echo 'The requested file is not available.';
        }
    }
}
开发者ID:andresce1979,项目名称:MCHostPanel,代码行数:19,代码来源:lib.php

示例11: internalmedia

 public function internalmedia($src, $title = NULL, $align = NULL, $width = NULL, $height = NULL, $cache = NULL, $linking = NULL, $return = false)
 {
     global $ID;
     list($src, $hash) = explode('#', $src, 2);
     resolve_mediaid(getNS($ID), $src, $exists);
     $noLink = false;
     $render = $linking == 'linkonly' ? false : true;
     $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
     list($ext, $mime, $dl) = mimetype($src, false);
     if (substr($mime, 0, 5) == 'image' && $render) {
         if ($linking == NULL || $linking == '' || $linking == 'details') {
             $linking = 'direct';
         }
         $link['url'] = ml($src, array('id' => $ID, 'cache' => $cache), $linking == 'direct');
     } elseif ($mime == 'application/x-shockwave-flash' && $render) {
         // don't link flash movies
         $noLink = true;
     } else {
         // add file icons
         $class = preg_replace('/[^_\\-a-z0-9]+/i', '_', $ext);
         $link['class'] .= ' mediafile mf_' . $class;
         $link['url'] = ml($src, array('id' => $ID, 'cache' => $cache), true);
         if ($exists) {
             $link['title'] .= ' (' . filesize_h(filesize(mediaFN($src))) . ')';
         }
     }
     if ($hash) {
         $link['url'] .= '#' . $hash;
     }
     //markup non existing files
     if (!$exists) {
         $link['class'] .= ' wikilink2';
     }
     //output formatted
     if ($linking == 'nolink' || $noLink) {
         $this->doc .= $link['name'];
     } else {
         $this->doc .= $this->_formatLink($link);
     }
 }
开发者ID:ssahara,项目名称:dw-plugin-prettyPhoto,代码行数:40,代码来源:renderer.php

示例12: _media

 /**
  * Renders internal and external media
  *
  * @author Andreas Gohr <andi@splitbrain.org>
  */
 function _media($src, $title = NULL, $align = NULL, $width = NULL, $height = NULL, $cache = NULL, $render = true)
 {
     $ret = '';
     list($ext, $mime, $dl) = mimetype($src);
     if (substr($mime, 0, 5) == 'image') {
         // first get the $title
         if (!is_null($title)) {
             $title = $this->_xmlEntities($title);
         } elseif ($ext == 'jpg' || $ext == 'jpeg') {
             //try to use the caption from IPTC/EXIF
             require_once DOKU_INC . 'inc/JpegMeta.php';
             $jpeg = new JpegMeta(mediaFN($src));
             if ($jpeg !== false) {
                 $cap = $jpeg->getTitle();
             }
             if ($cap) {
                 $title = $this->_xmlEntities($cap);
             }
         }
         if (!$render) {
             // if the picture is not supposed to be rendered
             // return the title of the picture
             if (!$title) {
                 // just show the sourcename
                 $title = $this->_xmlEntities(utf8_basename(noNS($src)));
             }
             return $title;
         }
         //add image tag
         $ret .= '<img src="' . ml($src, array('w' => $width, 'h' => $height, 'cache' => $cache)) . '"';
         $ret .= ' class="media' . $align . '"';
         if ($title) {
             $ret .= ' title="' . $title . '"';
             $ret .= ' alt="' . $title . '"';
         } else {
             $ret .= ' alt=""';
         }
         if (!is_null($width)) {
             $ret .= ' width="' . $this->_xmlEntities($width) . '"';
         }
         if (!is_null($height)) {
             $ret .= ' height="' . $this->_xmlEntities($height) . '"';
         }
         $ret .= ' />';
     } elseif ($mime == 'application/x-shockwave-flash') {
         if (!$render) {
             // if the flash is not supposed to be rendered
             // return the title of the flash
             if (!$title) {
                 // just show the sourcename
                 $title = utf8_basename(noNS($src));
             }
             return $this->_xmlEntities($title);
         }
         $att = array();
         $att['class'] = "media{$align}";
         if ($align == 'right') {
             $att['align'] = 'right';
         }
         if ($align == 'left') {
             $att['align'] = 'left';
         }
         $ret .= html_flashobject(ml($src, array('cache' => $cache), true, '&'), $width, $height, array('quality' => 'high'), null, $att, $this->_xmlEntities($title));
     } elseif ($title) {
         // well at least we have a title to display
         $ret .= $this->_xmlEntities($title);
     } else {
         // just show the sourcename
         $ret .= $this->_xmlEntities(utf8_basename(noNS($src)));
     }
     return $ret;
 }
开发者ID:ngharaibeh,项目名称:Methodikos,代码行数:77,代码来源:xhtml.php

示例13: define

 */
if (!defined('DOKU_INC')) {
    define('DOKU_INC', dirname(__FILE__) . '/../../');
}
define('DOKU_DISABLE_GZIP_OUTPUT', 1);
require_once DOKU_INC . 'inc/init.php';
//close session
session_write_close();
$mimetypes = getMimeTypes();
//get input
$MEDIA = stripctl(getID('media', false));
// no cleaning except control chars - maybe external
$CACHE = calc_cache($_REQUEST['cache']);
$WIDTH = (int) $_REQUEST['w'];
$HEIGHT = (int) $_REQUEST['h'];
list($EXT, $MIME, $DL) = mimetype($MEDIA, false);
if ($EXT === false) {
    $EXT = 'unknown';
    $MIME = 'application/octet-stream';
    $DL = true;
}
// check for permissions, preconditions and cache external files
list($STATUS, $STATUSMESSAGE) = checkFileStatus($MEDIA, $FILE);
// prepare data for plugin events
$data = array('media' => $MEDIA, 'file' => $FILE, 'orig' => $FILE, 'mime' => $MIME, 'download' => $DL, 'cache' => $CACHE, 'ext' => $EXT, 'width' => $WIDTH, 'height' => $HEIGHT, 'status' => $STATUS, 'statusmessage' => $STATUSMESSAGE);
// handle the file status
$evt = new Doku_Event('FETCH_MEDIA_STATUS', $data);
if ($evt->advise_before()) {
    // redirects
    if ($data['status'] > 300 && $data['status'] <= 304) {
        send_redirect($data['statusmessage']);
开发者ID:rezlemic,项目名称:dokuwiki-jQuery,代码行数:31,代码来源:fetch.php

示例14: mediaFN

/**
 * returns the full path to the mediafile specified by ID
 *
 * The filename is URL encoded to protect Unicode chars
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 * @author Kate Arzamastseva <pshns@ukr.net>
 *
 * @param string     $id  media id
 * @param string|int $rev empty string or revision timestamp
 * @return string full path
 */
function mediaFN($id, $rev = '')
{
    global $conf;
    $id = cleanID($id);
    $id = str_replace(':', '/', $id);
    if (empty($rev)) {
        $fn = $conf['mediadir'] . '/' . utf8_encodeFN($id);
    } else {
        $ext = mimetype($id);
        $name = substr($id, 0, -1 * strlen($ext[0]) - 1);
        $fn = $conf['mediaolddir'] . '/' . utf8_encodeFN($name . '.' . (int) $rev . '.' . $ext[0]);
    }
    return $fn;
}
开发者ID:s7mx1,项目名称:dokuwiki,代码行数:26,代码来源:pageutils.php

示例15: emailer


//.........这里部分代码省略.........
             #
         #
         default:
             $x_prio = '3 (Normal)';
             #	12/08/2009
     }
     if ($x_prio) {
         $headers .= 'X-Priority: ' . $x_prio . _CR_;
     }
     #
     #	Message Priority for Exchange Servers
     #
     #	$headers .=	'X-MSmail-Priority: '.$x_prio_des._CR_;
     #
     #	!!! WARNING !!!---# Hotmail and others do NOT like PHP mailer...
     #	$headers .=	'X-Mailer: PHP/'.phpversion()._CR_;---#
     #
     #	$headers .= 'X-Mailer: Microsoft Office Outlook, Build 11.0.6353'._CR_;
     #	$headers .= 'X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527'._CR_;
     #
     //		$headers .= 'X-Sender: '.$_SESSION['misc']['E_ROBOT']._CR_;
     $headers .= 'X-Sender: ' . $user_id . ' <' . $from_id . '>' . _CR_;
     #	12/08/2009
     $headers .= 'X-AntiAbuse: This is a solicited email for - ' . $to . ' - ' . _CR_;
     $headers .= 'X-AntiAbuse: Servername - {' . $domain . '}' . _CR_;
     //		$headers .= 'X-AntiAbuse: User - '.$_SESSION['misc']['E_ROBOT']._CR_;
     $headers .= 'X-AntiAbuse: User - ' . $from_id . _CR_;
     #	12/08/2009
     #
     #	Set the right start of header
     #
     //		if($attach_file)						#	25/11/2009
     if ($attach_path && $attach_file) {
         include SITE_ROOT . 'common/fun2inc/mimetype.inc';
         #
         # INS 25/11/2009 : BEG
         #---------------------
         if (!is_array($attach_path) || !is_array($attach_file)) {
             $_attach_path = array();
             $_attach_file = array();
             $_attach_path[] = $attach_path;
             $_attach_file[] = $attach_file;
         } else {
             $_attach_path = $attach_path;
             $_attach_file = $attach_file;
         }
         #
         $a = 0;
         foreach ($_attach_file as $key => $attach_file) {
             $attach_path = $_attach_path[$key];
             #---------------------
             # INS 25/11/2009 : END
             #
             $file_name_type = mimetype($attach_path, $attach_file);
             $file_name_name = $attach_file;
             #
             #	Read the file to be attached
             #
             $data = '';
             //				$file = @fopen($attach_path.$attach_file,'rb') or die('(emailer.inc) Cannot open: '.$attach_path.$attach_file);
             $file = @fopen($attach_path . $attach_file, 'rb');
             #	12/08/2009
             if ($file) {
                 while (!feof($file)) {
                     $data .= @fread($file, 4096);
                 }
开发者ID:hewu,项目名称:blogwp,代码行数:67,代码来源:emailer.inc.php


注:本文中的mimetype函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。