本文整理汇总了PHP中utf8_decodeFN函数的典型用法代码示例。如果您正苦于以下问题:PHP utf8_decodeFN函数的具体用法?PHP utf8_decodeFN怎么用?PHP utf8_decodeFN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了utf8_decodeFN函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pathID
/**
* translates a document path to an ID
*
* @author Andreas Gohr <[email protected]>
* @todo move to pageutils
*/
function pathID($path, $keeptxt = false)
{
$id = utf8_decodeFN($path);
$id = str_replace('/', ':', $id);
if (!$keeptxt) {
$id = preg_replace('#\\.txt$#', '', $id);
}
$id = preg_replace('#^:+#', '', $id);
$id = preg_replace('#:+$#', '', $id);
return $id;
}
开发者ID:Harvie,项目名称:dokuwiki,代码行数:17,代码来源:search.php
示例2: _mod_media_printfile_thumbs
/**
* Formats and prints one file in the list in the thumbnails view
*
* @see media_printfile_thumbs()
*/
function _mod_media_printfile_thumbs($item, $auth, $jump = false, $display_namespace = false)
{
global $lang;
global $conf;
// Prepare filename
$file = $this->_getOriginalFileName($item['id']);
if ($file === false) {
$file = utf8_decodeFN($item['file']);
}
// build fake media id
$ns = getNS($item['id']);
$fakeId = $ns === false ? $file : "{$ns}:{$file}";
$fakeId_escaped = hsc($fakeId);
// output
echo '<li><dl title="' . $fakeId_escaped . '">' . NL;
echo '<dt>';
if ($item['isimg']) {
media_printimgdetail($item, true);
} else {
echo '<a name="d_:' . $item['id'] . '" class="image" title="' . $fakeId_escaped . '" href="' . media_managerURL(array('image' => $fakeId, 'ns' => $ns, 'tab_details' => 'view')) . '">';
echo media_printicon($fakeId_escaped);
echo '</a>';
}
echo '</dt>' . NL;
if (!$display_namespace) {
$name = hsc($file);
} else {
$name = $fakeId_escaped;
}
echo '<dd class="name"><a href="' . media_managerURL(array('image' => $fakeId, 'ns' => $ns, 'tab_details' => 'view')) . '" name="h_:' . $item['id'] . '">' . $name . '</a></dd>' . NL;
if ($item['isimg']) {
$size = '';
$size .= (int) $item['meta']->getField('File.Width');
$size .= '×';
$size .= (int) $item['meta']->getField('File.Height');
echo '<dd class="size">' . $size . '</dd>' . NL;
} else {
echo '<dd class="size"> </dd>' . NL;
}
$date = dformat($item['mtime']);
echo '<dd class="date">' . $date . '</dd>' . NL;
$filesize = filesize_h($item['size']);
echo '<dd class="filesize">' . $filesize . '</dd>' . NL;
echo '</dl></li>' . NL;
}
开发者ID:kazmiya,项目名称:dokuwiki-plugin-preservefilenames,代码行数:50,代码来源:action_angua.php
示例3: _parseFileInfo
/**
* Gets basic info from the file - should work with non-JPEGs
*
* @author Sebastian Delmont <[email protected]>
* @author Andreas Gohr <[email protected]>
*/
function _parseFileInfo()
{
if (file_exists($this->_fileName) && is_file($this->_fileName)) {
$this->_info['file'] = array();
$this->_info['file']['Name'] = utf8_decodeFN(utf8_basename($this->_fileName));
$this->_info['file']['Path'] = fullpath($this->_fileName);
$this->_info['file']['Size'] = filesize($this->_fileName);
if ($this->_info['file']['Size'] < 1024) {
$this->_info['file']['NiceSize'] = $this->_info['file']['Size'] . 'B';
} elseif ($this->_info['file']['Size'] < 1024 * 1024) {
$this->_info['file']['NiceSize'] = round($this->_info['file']['Size'] / 1024) . 'KB';
} elseif ($this->_info['file']['Size'] < 1024 * 1024 * 1024) {
$this->_info['file']['NiceSize'] = round($this->_info['file']['Size'] / (1024 * 1024)) . 'MB';
} else {
$this->_info['file']['NiceSize'] = $this->_info['file']['Size'] . 'B';
}
$this->_info['file']['UnixTime'] = filemtime($this->_fileName);
// get image size directly from file
$size = getimagesize($this->_fileName);
$this->_info['file']['Width'] = $size[0];
$this->_info['file']['Height'] = $size[1];
// set mime types and formats
// http://www.php.net/manual/en/function.getimagesize.php
// http://www.php.net/manual/en/function.image-type-to-mime-type.php
switch ($size[2]) {
case 1:
$this->_info['file']['Mime'] = 'image/gif';
$this->_info['file']['Format'] = 'GIF';
break;
case 2:
$this->_info['file']['Mime'] = 'image/jpeg';
$this->_info['file']['Format'] = 'JPEG';
break;
case 3:
$this->_info['file']['Mime'] = 'image/png';
$this->_info['file']['Format'] = 'PNG';
break;
case 4:
$this->_info['file']['Mime'] = 'application/x-shockwave-flash';
$this->_info['file']['Format'] = 'SWF';
break;
case 5:
$this->_info['file']['Mime'] = 'image/psd';
$this->_info['file']['Format'] = 'PSD';
break;
case 6:
$this->_info['file']['Mime'] = 'image/bmp';
$this->_info['file']['Format'] = 'BMP';
break;
case 7:
$this->_info['file']['Mime'] = 'image/tiff';
$this->_info['file']['Format'] = 'TIFF (Intel)';
break;
case 8:
$this->_info['file']['Mime'] = 'image/tiff';
$this->_info['file']['Format'] = 'TIFF (Motorola)';
break;
case 9:
$this->_info['file']['Mime'] = 'application/octet-stream';
$this->_info['file']['Format'] = 'JPC';
break;
case 10:
$this->_info['file']['Mime'] = 'image/jp2';
$this->_info['file']['Format'] = 'JP2';
break;
case 11:
$this->_info['file']['Mime'] = 'application/octet-stream';
$this->_info['file']['Format'] = 'JPX';
break;
case 12:
$this->_info['file']['Mime'] = 'application/octet-stream';
$this->_info['file']['Format'] = 'JB2';
break;
case 13:
$this->_info['file']['Mime'] = 'application/x-shockwave-flash';
$this->_info['file']['Format'] = 'SWC';
break;
case 14:
$this->_info['file']['Mime'] = 'image/iff';
$this->_info['file']['Format'] = 'IFF';
break;
case 15:
$this->_info['file']['Mime'] = 'image/vnd.wap.wbmp';
$this->_info['file']['Format'] = 'WBMP';
break;
case 16:
$this->_info['file']['Mime'] = 'image/xbm';
$this->_info['file']['Format'] = 'XBM';
break;
default:
$this->_info['file']['Mime'] = 'image/unknown';
}
} else {
$this->_info['file'] = array();
//.........这里部分代码省略.........
开发者ID:rodrigoaustincascao,项目名称:Service-Desk-IMC,代码行数:101,代码来源:JpegMeta.php
示例4: tpl_pageinfo
/**
* Print some info about the current page
*
* @author Andreas Gohr <[email protected]>
* @param bool $ret return content instead of printing it
* @return bool|string
*/
function tpl_pageinfo($ret = false)
{
global $conf;
global $lang;
global $INFO;
global $ID;
// return if we are not allowed to view the page
if (!auth_quickaclcheck($ID)) {
return false;
}
// prepare date and path
$fn = $INFO['filepath'];
if (!$conf['fullpath']) {
if ($INFO['rev']) {
$fn = str_replace(fullpath($conf['olddir']) . '/', '', $fn);
} else {
$fn = str_replace(fullpath($conf['datadir']) . '/', '', $fn);
}
}
$fn = utf8_decodeFN($fn);
$date = dformat($INFO['lastmod']);
// print it
if ($INFO['exists']) {
$out = '';
$out .= $fn;
$out .= ' · ';
$out .= $lang['lastmod'];
$out .= ': ';
$out .= $date;
if ($INFO['editor']) {
$out .= ' ' . $lang['by'] . ' ';
$out .= editorinfo($INFO['editor']);
} else {
$out .= ' (' . $lang['external_edit'] . ')';
}
if ($INFO['locked']) {
$out .= ' · ';
$out .= $lang['lockedby'];
$out .= ': ';
$out .= editorinfo($INFO['locked']);
}
if ($ret) {
return $out;
} else {
echo $out;
return true;
}
}
return false;
}
开发者ID:neosunchess,项目名称:dokuwiki,代码行数:57,代码来源:template.php
示例5: media_printfile_thumbs
/**
* Formats and prints one file in the list in the thumbnails view
*
* @author Kate Arzamastseva <[email protected]>
*/
function media_printfile_thumbs($item, $auth, $jump = false, $display_namespace = false)
{
// Prepare filename
$file = utf8_decodeFN($item['file']);
// output
echo '<li><dl title="' . hsc($item['id']) . '">' . NL;
echo '<dt>';
if ($item['isimg']) {
media_printimgdetail($item, true);
} else {
echo '<a id="d_:' . $item['id'] . '" class="image" title="' . $item['id'] . '" href="' . media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']), 'tab_details' => 'view')) . '">';
echo media_printicon($item['id'], '32x32');
echo '</a>';
}
echo '</dt>' . NL;
if (!$display_namespace) {
$name = hsc($file);
} else {
$name = hsc($item['id']);
}
echo '<dd class="name"><a href="' . media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']), 'tab_details' => 'view')) . '" id="h_:' . $item['id'] . '">' . $name . '</a></dd>' . NL;
if ($item['isimg']) {
$size = '';
$size .= (int) $item['meta']->getField('File.Width');
$size .= '×';
$size .= (int) $item['meta']->getField('File.Height');
echo '<dd class="size">' . $size . '</dd>' . NL;
} else {
echo '<dd class="size"> </dd>' . NL;
}
$date = dformat($item['mtime']);
echo '<dd class="date">' . $date . '</dd>' . NL;
$filesize = filesize_h($item['size']);
echo '<dd class="filesize">' . $filesize . '</dd>' . NL;
echo '</dl></li>' . NL;
}
开发者ID:yjliugit,项目名称:dokuwiki,代码行数:41,代码来源:media.php
示例6: print_index
/**
* Print index nodes
*
* @author Samuele Tognini <[email protected]>
* @author Andreas Gohr <[email protected]>
* @author Rene Hadler <[email protected]>
*/
function print_index($ns)
{
require_once DOKU_PLUGIN . 'indexmenu/syntax/indexmenu.php';
global $conf;
$idxm = new syntax_plugin_indexmenu_indexmenu();
$ns = $idxm->_parse_ns(rawurldecode($ns));
$level = -1;
$max = 0;
$data = array();
$skipfile = array();
$skipns = array();
if ($_REQUEST['max'] > 0) {
$max = $_REQUEST['max'];
$level = $max;
}
$nss = $_REQUEST['nss'] ? cleanID($_REQUEST['nss']) : '';
$idxm->sort = $_REQUEST['sort'];
$idxm->msort = $_REQUEST['msort'];
$idxm->rsort = $_REQUEST['rsort'];
$idxm->nsort = $_REQUEST['nsort'];
$idxm->hsort = $_REQUEST['hsort'];
$fsdir = "/" . utf8_encodeFN(str_replace(':', '/', $ns));
$skipf = utf8_decodeFN($_REQUEST['skipfile']);
$skipfile[] = $this->getConf('skip_file');
if (isset($skipf)) {
$index = 0;
if ($skipf[1] == '+') {
$index = 1;
}
$skipfile[$index] = substr($skipf, 1);
}
$skipn = utf8_decodeFN($_REQUEST['skipns']);
$skipns[] = $this->getConf('skip_index');
if (isset($skipn)) {
$index = 0;
if ($skipn[1] == '+') {
$index = 1;
}
$skipns[$index] = substr($skipn, 1);
}
$opts = array('level' => $level, 'nons' => $_REQUEST['nons'], 'nss' => array(array($nss, 1)), 'max' => $max, 'js' => false, 'nopg' => $_REQUEST['nopg'], 'skip_index' => $skipns, 'skip_file' => $skipfile, 'headpage' => $idxm->getConf('headpage'), 'hide_headpage' => $idxm->getConf('hide_headpage'));
if ($idxm->sort || $idxm->msort || $idxm->rsort || $idxm->hsort) {
$idxm->_search($data, $conf['datadir'], array($idxm, '_search_index'), $opts, $fsdir);
} else {
search($data, $conf['datadir'], array($idxm, '_search_index'), $opts, $fsdir);
}
$out = '';
if ($_REQUEST['nojs']) {
require_once DOKU_INC . 'inc/html.php';
$out_tmp = html_buildlist($data, 'idx', array($idxm, "_html_list_index"), "html_li_index");
$out .= preg_replace('/<ul class="idx">(.*)<\\/ul>/s', "\$1", $out_tmp);
} else {
$nodes = $idxm->_jsnodes($data, '', 0);
$out = "ajxnodes = [";
$out .= rtrim($nodes[0], ",");
$out .= "];";
}
return $out;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:66,代码来源:action.php
示例7: bootstrap3_pageinfo
/**
* Print some info about the current page
*
* @author Andreas Gohr <[email protected]>
* @author Giuseppe Di Terlizzi <[email protected]>
*
* @param bool $ret return content instead of printing it
* @return bool|string
*/
function bootstrap3_pageinfo($ret = false)
{
global $conf;
global $lang;
global $INFO;
global $ID;
// return if we are not allowed to view the page
if (!auth_quickaclcheck($ID)) {
return false;
}
// prepare date and path
$fn = $INFO['filepath'];
if (!$conf['fullpath']) {
if ($INFO['rev']) {
$fn = str_replace(fullpath($conf['olddir']) . '/', '', $fn);
} else {
$fn = str_replace(fullpath($conf['datadir']) . '/', '', $fn);
}
}
$date_format = bootstrap3_conf('pageInfoDateFormat');
$page_info = bootstrap3_conf('pageInfo');
$fn = utf8_decodeFN($fn);
$date = $date_format == 'dformat' ? dformat($INFO['lastmod']) : datetime_h($INFO['lastmod']);
// print it
if ($INFO['exists']) {
$fn_full = $fn;
if (!in_array('extension', $page_info)) {
$fn = str_replace(array('.txt.gz', '.txt'), '', $fn);
}
$out = '<ul class="list-inline">';
if (in_array('filename', $page_info)) {
$out .= sprintf('<li><i class="fa fa-fw fa-file-text-o text-muted"></i> <span title="%s">%s</span></li>', $fn_full, $fn);
}
if (in_array('date', $page_info)) {
$out .= sprintf('<li><i class="fa fa-fw fa-calendar text-muted"></i> %s <span title="%s">%s</span></li>', $lang['lastmod'], dformat($INFO['lastmod']), $date);
}
if (in_array('editor', $page_info)) {
if (isset($INFO['editor'])) {
$user = editorinfo($INFO['editor']);
if (bootstrap3_conf('useGravatar')) {
global $auth;
$user_data = $auth->getUserData($INFO['editor']);
$HTTP = new DokuHTTPClient();
$gravatar_img = get_gravatar($user_data['mail'], 16);
$gravatar_check = $HTTP->get($gravatar_img . '&d=404');
if ($gravatar_check) {
$user_img = sprintf('<img src="%s" alt="" width="16" class="img-rounded" /> ', $gravatar_img);
$user = str_replace(array('iw_user', 'interwiki'), '', $user);
$user = $user_img . $user;
}
}
$out .= sprintf('<li class="text-muted">%s %s</li>', $lang['by'], $user);
} else {
$out .= sprintf('<li>(%s)</li>', $lang['external_edit']);
}
}
if ($INFO['locked'] && in_array('locked', $page_info)) {
$out .= sprintf('<li><i class="fa fa-fw fa-lock text-muted"></i> %s %s</li>', $lang['lockedby'], editorinfo($INFO['locked']));
}
$out .= '</ul>';
if ($ret) {
return $out;
} else {
echo $out;
return true;
}
}
return false;
}
开发者ID:huksley,项目名称:dokuwiki-template-bootstrap3,代码行数:78,代码来源:tpl_functions.php
示例8: media_printfile
/**
* Formats and prints one file in the list
*/
function media_printfile($item, $auth, $jump, $display_namespace = false)
{
global $lang;
global $conf;
// Prepare zebra coloring
// I always wanted to use this variable name :-D
static $twibble = 1;
$twibble *= -1;
$zebra = $twibble == -1 ? 'odd' : 'even';
// Automatically jump to recent action
if ($jump == $item['id']) {
$jump = ' id="scroll__here" ';
} else {
$jump = '';
}
// Prepare fileicons
list($ext, $mime, $dl) = mimetype($item['file'], false);
$class = preg_replace('/[^_\\-a-z0-9]+/i', '_', $ext);
$class = 'select mediafile mf_' . $class;
// Prepare filename
$file = utf8_decodeFN($item['file']);
// Prepare info
$info = '';
if ($item['isimg']) {
$info .= (int) $item['meta']->getField('File.Width');
$info .= '×';
$info .= (int) $item['meta']->getField('File.Height');
$info .= ' ';
}
$info .= '<i>' . dformat($item['mtime']) . '</i>';
$info .= ' ';
$info .= filesize_h($item['size']);
// output
echo '<div class="' . $zebra . '"' . $jump . '>' . NL;
if (!$display_namespace) {
echo '<a name="h_:' . $item['id'] . '" class="' . $class . '">' . hsc($file) . '</a> ';
} else {
echo '<a name="h_:' . $item['id'] . '" class="' . $class . '">' . hsc($item['id']) . '</a><br/>';
}
echo '<span class="info">(' . $info . ')</span>' . NL;
media_fileactions($item, $auth);
echo '<div class="example" id="ex_' . str_replace(':', '_', $item['id']) . '">';
echo $lang['mediausage'] . ' <code>{{:' . $item['id'] . '}}</code>';
echo '</div>';
if ($item['isimg']) {
media_printimgdetail($item);
}
echo '<div class="clearer"></div>' . NL;
echo '</div>' . NL;
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:53,代码来源:media.php
示例9: tpl_pageinfo
/**
* Print some info about the current page
*
* @author Andreas Gohr <[email protected]>
*/
function tpl_pageinfo()
{
global $conf;
global $lang;
global $INFO;
global $REV;
global $ID;
// return if we are not allowed to view the page
if (!auth_quickaclcheck($ID)) {
return;
}
// prepare date and path
$fn = $INFO['filepath'];
if (!$conf['fullpath']) {
if ($REV) {
$fn = str_replace(fullpath($conf['olddir']) . '/', '', $fn);
} else {
$fn = str_replace(fullpath($conf['datadir']) . '/', '', $fn);
}
}
$fn = utf8_decodeFN($fn);
$date = strftime($conf['dformat'], $INFO['lastmod']);
// print it
if ($INFO['exists']) {
print $fn;
print ' · ';
print $lang['lastmod'];
print ': ';
print $date;
if ($INFO['editor']) {
print ' ' . $lang['by'] . ' ';
print $INFO['editor'];
} else {
print ' (' . $lang['external_edit'] . ')';
}
if ($INFO['locked']) {
print ' · ';
print $lang['lockedby'];
print ': ';
print $INFO['locked'];
}
return true;
}
return false;
}
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:50,代码来源:template.php
示例10: _sendFile
/**
* Sends a media file with its original filename
*
* @see sendFile() in lib/exe/fetch.php
*/
function _sendFile(&$event)
{
global $conf;
global $MEDIA;
$d = $event->data;
$event->preventDefault();
list($file, $mime, $dl, $cache) = array($d['file'], $d['mime'], $d['download'], $d['cache']);
$fmtime = @filemtime($file);
// send headers
header("Content-Type: {$mime}");
// smart http caching headers
if ($cache == -1) {
// cache
// cachetime or one hour
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + max($conf['cachetime'], 3600)) . ' GMT');
header('Cache-Control: public, proxy-revalidate, no-transform, max-age=' . max($conf['cachetime'], 3600));
header('Pragma: public');
} elseif ($cache > 0) {
// recache
// remaining cachetime + 10 seconds so the newly recached media is used
header('Expires: ' . gmdate("D, d M Y H:i:s", $fmtime + $conf['cachetime'] + 10) . ' GMT');
header('Cache-Control: public, proxy-revalidate, no-transform, max-age=' . max($fmtime - time() + $conf['cachetime'] + 10, 0));
header('Pragma: public');
} elseif ($cache == 0) {
// nocache
header('Cache-Control: must-revalidate, no-transform, post-check=0, pre-check=0');
header('Pragma: public');
}
// send important headers first, script stops here if '304 Not Modified' response
http_conditionalRequest($fmtime);
// retrieve original filename and send Content-Disposition header
$filename = $this->_getOriginalFileName($MEDIA);
if ($filename === false) {
$filename = utf8_decodeFN($this->common->_correctBasename($d['file']));
}
header($this->common->_buildContentDispositionHeader($dl, $filename));
// use x-sendfile header to pass the delivery to compatible webservers
if (http_sendfile($file)) {
exit;
}
// send file contents
$fp = @fopen($file, 'rb');
if ($fp) {
http_rangeRequest($fp, filesize($file), $mime);
} else {
header('HTTP/1.0 500 Internal Server Error');
print "Could not read {$file} - bad permissions?";
}
}
开发者ID:kazmiya,项目名称:dokuwiki-plugin-preservefilenames,代码行数:54,代码来源:action_anteater.php
示例11: utf8_decodeFN
function utf8_decodeFN($file)
{
return utf8_decodeFN($file);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:4,代码来源:utf8_integration_test.class.php
注:本文中的utf8_decodeFN函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论