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


PHP get_pwg_charset函数代码示例

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


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

示例1: on_index_thumbnails_ajax

 static function on_index_thumbnails_ajax($thumbs)
 {
     global $template;
     $template->assign('thumbnails', $thumbs);
     header('Content-Type: text/html; charset=' . get_pwg_charset());
     $template->pparse('index_thumbnails');
     exit;
 }
开发者ID:kappuccino,项目名称:piwigo-tscroller,代码行数:8,代码来源:main.inc.php

示例2: osm_render_category

function osm_render_category()
{
    global $template, $page, $conf, $filter;
    include_once dirname(__FILE__) . '/include/functions.php';
    include_once dirname(__FILE__) . '/include/functions_map.php';
    osm_load_language();
    load_language('plugin.lang', OSM_PATH);
    // TF, 20160102: pass config as parameter
    $js_data = osm_get_items($conf, $page);
    if ($js_data != array()) {
        $local_conf = array();
        $local_conf['contextmenu'] = 'false';
        $local_conf['control'] = true;
        $local_conf['img_popup'] = false;
        $local_conf['popup'] = 1;
        $local_conf['center_lat'] = 0;
        $local_conf['center_lng'] = 0;
        $local_conf['zoom'] = 2;
        $local_conf['auto_center'] = 1;
        // TF, 20160102: pass config as parameter
        $local_conf['paths'] = osm_get_gps($conf, $page);
        $height = isset($conf['osm_conf']['category_description']['height']) ? $conf['osm_conf']['category_description']['height'] : '200';
        $width = isset($conf['osm_conf']['category_description']['width']) ? $conf['osm_conf']['category_description']['width'] : 'auto';
        $js = osm_get_js($conf, $local_conf, $js_data);
        $template->set_filename('map', dirname(__FILE__) . '/template/osm-category.tpl');
        $template->assign(array('CONTENT_ENCODING' => get_pwg_charset(), 'OSM_PATH' => embellish_url(get_gallery_home_url() . OSM_PATH), 'HOME' => make_index_url(), 'HOME_PREV' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : get_absolute_root_url(), 'HOME_NAME' => l10n("Home"), 'HOME_PREV_NAME' => l10n("Previous"), 'OSMJS' => $js, 'HEIGHT' => $height, 'WIDTH' => $width));
        $osm_content = $template->parse('map', true);
        //$osm_content = '<div id="osmmap"><div class="map_title">'.l10n('EDIT_MAP').'</div>' . $osm_content . '</div>';
        $index = isset($conf['osm_conf']['category_description']['index']) ? $conf['osm_conf']['category_description']['index'] : 0;
        // 0 - PLUGIN_INDEX_CONTENT_BEGIN
        // 1 - PLUGIN_INDEX_CONTENT_COMMENT
        // 2 - PLUGIN_INDEX_CONTENT_END
        if ($index <= 1) {
            // From index category comment at L300
            if ($page['start'] == 0 and !isset($page['chronology_field'])) {
                if (empty($page['comment'])) {
                    $page['comment'] = $osm_content;
                } else {
                    if ($index == 0) {
                        $page['comment'] = '<div>' . $osm_content . $page['comment'] . '</div>';
                    } else {
                        $page['comment'] = '<div>' . $page['comment'] . $osm_content . '</div>';
                    }
                }
            }
        } else {
            $osm_content = '<div id="osmmap">' . $osm_content . '</div>';
            $template->concat('PLUGIN_INDEX_CONTENT_END', "\n" . $osm_content);
        }
    }
}
开发者ID:ThomasDaheim,项目名称:piwigo-openstreetmap,代码行数:51,代码来源:category.inc.php

示例3: ws_session_getStatus

/**
 * API method
 * Returns info about the current user
 * @param mixed[] $params
 */
function ws_session_getStatus($params, &$service)
{
    global $user, $conf;
    $res['username'] = is_a_guest() ? 'guest' : stripslashes($user['username']);
    foreach (array('status', 'theme', 'language') as $k) {
        $res[$k] = $user[$k];
    }
    $res['pwg_token'] = get_pwg_token();
    $res['charset'] = get_pwg_charset();
    list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
    $res['current_datetime'] = $dbnow;
    $res['version'] = PHPWG_VERSION;
    if (is_admin()) {
        $res['upload_file_types'] = implode(',', array_unique(array_map('strtolower', $conf['upload_form_all_types'] ? $conf['file_ext'] : $conf['picture_ext'])));
        $res['upload_form_chunk_size'] = $conf['upload_form_chunk_size'];
    }
    return $res;
}
开发者ID:donseba,项目名称:Piwigo,代码行数:23,代码来源:pwg.php

示例4: Template

        $theme = $conf['mobile_theme'];
    }
    $template = new Template(PHPWG_ROOT_PATH . 'themes', $theme);
}
if (!isset($conf['no_photo_yet'])) {
    include PHPWG_ROOT_PATH . 'include/no_photo_yet.inc.php';
}
if (isset($user['internal_status']['guest_must_be_guest']) and $user['internal_status']['guest_must_be_guest'] === true) {
    $header_msgs[] = l10n('Bad status for user "guest", using default status. Please notify the webmaster.');
}
if ($conf['gallery_locked']) {
    $header_msgs[] = l10n('The gallery is locked for maintenance. Please, come back later.');
    if (script_basename() != 'identification' and !is_admin()) {
        set_status_header(503, 'Service Unavailable');
        @header('Retry-After: 900');
        header('Content-Type: text/html; charset=' . get_pwg_charset());
        echo '<a href="' . get_absolute_root_url(false) . 'identification.php">' . l10n('The gallery is locked for maintenance. Please, come back later.') . '</a>';
        echo str_repeat(' ', 512);
        //IE6 doesn't error output if below a size
        exit;
    }
}
if ($conf['check_upgrade_feed']) {
    include_once PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php';
    if (check_upgrade_feed()) {
        $header_msgs[] = 'Some database upgrades are missing, ' . '<a href="' . get_absolute_root_url(false) . 'upgrade_feed.php">upgrade now</a>';
    }
}
if (count($header_msgs) > 0) {
    $template->assign('header_msgs', $header_msgs);
    $header_msgs = array();
开发者ID:squidjam,项目名称:Piwigo,代码行数:31,代码来源:common.inc.php

示例5: clean_iptc_value

/**
 * return a cleaned IPTC value.
 *
 * @param string $value
 * @return string
 */
function clean_iptc_value($value)
{
    // strip leading zeros (weird Kodak Scanner software)
    while (isset($value[0]) and $value[0] == chr(0)) {
        $value = substr($value, 1);
    }
    // remove binary nulls
    $value = str_replace(chr(0x0), ' ', $value);
    if (preg_match('/[\\x80-\\xff]/', $value)) {
        // apparently mac uses some MacRoman crap encoding. I don't know
        // how to detect it so a plugin should do the trick.
        $value = trigger_change('clean_iptc_value', $value);
        if (($qual = qualify_utf8($value)) != 0) {
            // has non ascii chars
            if ($qual > 0) {
                $input_encoding = 'utf-8';
            } else {
                $input_encoding = 'iso-8859-1';
                if (function_exists('iconv') or function_exists('mb_convert_encoding')) {
                    // using windows-1252 because it supports additional characters
                    // such as "oe" in a single character (ligature). About the
                    // difference between Windows-1252 and ISO-8859-1: the characters
                    // 0x80-0x9F will not convert correctly. But these are control
                    // characters which are almost never used.
                    $input_encoding = 'windows-1252';
                }
            }
            $value = convert_charset($value, $input_encoding, get_pwg_charset());
        }
    }
    return $value;
}
开发者ID:squidjam,项目名称:Piwigo,代码行数:38,代码来源:functions_metadata.inc.php

示例6: sendResponse

 /**
  * Encodes a response and sends it back to the browser.
  */
 function sendResponse($response)
 {
     $encodedResponse = $this->_responseEncoder->encodeResponse($response);
     $contentType = $this->_responseEncoder->getContentType();
     @header('Content-Type: ' . $contentType . '; charset=' . get_pwg_charset());
     print_r($encodedResponse);
     trigger_notify('sendResponse', $encodedResponse);
 }
开发者ID:squidjam,项目名称:Piwigo,代码行数:11,代码来源:ws_core.inc.php

示例7: pwg_mail


//.........这里部分代码省略.........
        if (preg_match('#^\\[(.*)\\](.*)$#', $args['subject'], $matches)) {
            $args['mail_title'] = $matches[1];
            $args['mail_subtitle'] = $matches[2];
        }
    }
    if (!isset($args['mail_title'])) {
        $args['mail_title'] = $conf['gallery_title'];
    }
    if (!isset($args['mail_subtitle'])) {
        $args['mail_subtitle'] = $args['subject'];
    }
    // content type
    if (empty($args['content_format'])) {
        $args['content_format'] = 'text/plain';
    }
    $content_type_list = array();
    if ($conf_mail['mail_allow_html'] and @$args['email_format'] != 'text/plain') {
        $content_type_list[] = 'text/html';
    }
    $content_type_list[] = 'text/plain';
    $contents = array();
    foreach ($content_type_list as $content_type) {
        // key compose of indexes witch allow to cache mail data
        $cache_key = $content_type . '-' . $lang_info['code'];
        if (!isset($conf_mail[$cache_key])) {
            // instanciate a new Template
            if (!isset($conf_mail[$cache_key]['theme'])) {
                $conf_mail[$cache_key]['theme'] = get_mail_template($content_type);
                trigger_notify('before_parse_mail_template', $cache_key, $content_type);
            }
            $template =& $conf_mail[$cache_key]['theme'];
            $template->set_filename('mail_header', 'header.tpl');
            $template->set_filename('mail_footer', 'footer.tpl');
            $template->assign(array('GALLERY_URL' => get_gallery_home_url(), 'GALLERY_TITLE' => isset($page['gallery_title']) ? $page['gallery_title'] : $conf['gallery_title'], 'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '', 'PHPWG_URL' => defined('PHPWG_URL') ? PHPWG_URL : '', 'CONTENT_ENCODING' => get_pwg_charset(), 'CONTACT_MAIL' => $conf_mail['email_webmaster']));
            if ($content_type == 'text/html') {
                if ($template->smarty->templateExists('global-mail-css.tpl')) {
                    $template->set_filename('global-css', 'global-mail-css.tpl');
                    $template->assign_var_from_handle('GLOBAL_MAIL_CSS', 'global-css');
                }
                if ($template->smarty->templateExists('mail-css-' . $args['theme'] . '.tpl')) {
                    $template->set_filename('css', 'mail-css-' . $args['theme'] . '.tpl');
                    $template->assign_var_from_handle('MAIL_CSS', 'css');
                }
            }
        }
        $template =& $conf_mail[$cache_key]['theme'];
        $template->assign(array('MAIL_TITLE' => $args['mail_title'], 'MAIL_SUBTITLE' => $args['mail_subtitle']));
        // Header
        $contents[$content_type] = $template->parse('mail_header', true);
        // Content
        // Stored in a temp variable, if a content template is used it will be assigned
        // to the $CONTENT template variable, otherwise it will be appened to the mail
        if ($args['content_format'] == 'text/plain' and $content_type == 'text/html') {
            // convert plain text to html
            $mail_content = '<p>' . nl2br(preg_replace('/(https?:\\/\\/([-\\w\\.]+[-\\w])+(:\\d+)?(\\/([\\w\\/_\\.\\#-]*(\\?\\S+)?[^\\.\\s])?)?)/i', '<a href="$1">$1</a>', htmlspecialchars($args['content']))) . '</p>';
        } else {
            if ($args['content_format'] == 'text/html' and $content_type == 'text/plain') {
                // convert html text to plain text
                $mail_content = strip_tags($args['content']);
            } else {
                $mail_content = $args['content'];
            }
        }
        // Runtime template
        if (isset($tpl['filename'])) {
            if (isset($tpl['dirname'])) {
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:67,代码来源:functions_mail.inc.php

示例8: get_fs_languages

 /**
  *  Get languages defined in the language directory
  */
 function get_fs_languages($target_charset = null)
 {
     if (empty($target_charset)) {
         $target_charset = get_pwg_charset();
     }
     $target_charset = strtolower($target_charset);
     $dir = opendir(PHPWG_ROOT_PATH . 'language');
     while ($file = readdir($dir)) {
         if ($file != '.' and $file != '..') {
             $path = PHPWG_ROOT_PATH . 'language/' . $file;
             if (is_dir($path) and !is_link($path) and preg_match('/^[a-zA-Z0-9-_]+$/', $file) and file_exists($path . '/common.lang.php')) {
                 $language = array('name' => $file, 'code' => $file, 'version' => '0', 'uri' => '', 'author' => '');
                 $plg_data = implode('', file($path . '/common.lang.php'));
                 if (preg_match("|Language Name:\\s*(.+)|", $plg_data, $val)) {
                     $language['name'] = trim($val[1]);
                     $language['name'] = convert_charset($language['name'], 'utf-8', $target_charset);
                 }
                 if (preg_match("|Version:\\s*([\\w.-]+)|", $plg_data, $val)) {
                     $language['version'] = trim($val[1]);
                 }
                 if (preg_match("|Language URI:\\s*(https?:\\/\\/.+)|", $plg_data, $val)) {
                     $language['uri'] = trim($val[1]);
                 }
                 if (preg_match("|Author:\\s*(.+)|", $plg_data, $val)) {
                     $language['author'] = trim($val[1]);
                 }
                 if (preg_match("|Author URI:\\s*(https?:\\/\\/.+)|", $plg_data, $val)) {
                     $language['author uri'] = trim($val[1]);
                 }
                 if (!empty($language['uri']) and strpos($language['uri'], 'extension_view.php?eid=')) {
                     list(, $extension) = explode('extension_view.php?eid=', $language['uri']);
                     if (is_numeric($extension)) {
                         $language['extension'] = $extension;
                     }
                 }
                 // IMPORTANT SECURITY !
                 $language = array_map('htmlspecialchars', $language);
                 $this->fs_languages[$file] = $language;
             }
         }
     }
     closedir($dir);
     @uasort($this->fs_languages, 'name_compare');
 }
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:47,代码来源:languages.class.php

示例9: encodeResponse

    function encodeResponse($response)
    {
        $respClass = strtolower(@get_class($response));
        if ($respClass == 'pwgerror') {
            $ret = '<?xml version="1.0"?>
<rsp stat="fail">
	<err code="' . $response->code() . '" msg="' . htmlspecialchars($response->message()) . '" />
</rsp>';
            return $ret;
        }
        $this->_writer = new PwgXmlWriter();
        $this->encode($response);
        $ret = $this->_writer->getOutput();
        $ret = '<?xml version="1.0" encoding="' . get_pwg_charset() . '" ?>
<rsp stat="ok">
' . $ret . '
</rsp>';
        return $ret;
    }
开发者ID:squidjam,项目名称:Piwigo,代码行数:19,代码来源:rest_encoder.php

示例10: osm_gen_template

function osm_gen_template($conf, $js, $js_data, $tmpl, $template)
{
    $linkname = isset($conf['osm_conf']['left_menu']['link']) ? $conf['osm_conf']['left_menu']['link'] : l10n('OSWorldMap');
    $template->set_filename('map', dirname(__FILE__) . '/../template/' . $tmpl);
    $template->assign(array('CONTENT_ENCODING' => get_pwg_charset(), 'OSM_PATH' => embellish_url(get_gallery_home_url() . OSM_PATH), 'GALLERY_TITLE' => $linkname . ' - ' . $conf['gallery_title'], 'HOME' => make_index_url(), 'HOME_PREV' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : get_absolute_root_url(), 'HOME_NAME' => l10n("Home"), 'HOME_PREV_NAME' => l10n("Previous"), 'TOTAL' => sprintf(l10n('ITEMS'), count($js_data)), 'OSMJS' => $js, 'MYROOT_URL' => get_absolute_root_url(), 'default_baselayer' => $conf['osm_conf']['map']['baselayer']));
    if ($conf['osm_conf']['map']['baselayer'] == 'custom') {
        $iconbaselayer = $conf['osm_conf']['map']['custombaselayerurl'];
        $iconbaselayer = str_replace('{s}', 'a', $iconbaselayer);
        $iconbaselayer = str_replace('{z}', '5', $iconbaselayer);
        $iconbaselayer = str_replace('{x}', '15', $iconbaselayer);
        $iconbaselayer = str_replace('{y}', '11', $iconbaselayer);
        $template->assign(array('custombaselayer' => $conf['osm_conf']['map']['custombaselayer'], 'custombaselayerurl' => $conf['osm_conf']['map']['custombaselayerurl'], 'iconbaselayer' => $iconbaselayer));
    }
    $template->pparse('map');
    $template->p();
}
开发者ID:joubu,项目名称:piwigo-openstreetmap,代码行数:16,代码来源:functions_map.php

示例11: build_user

        $user = build_user($feed_row['user_id'], true);
    }
} else {
    $image_only = true;
    if (!is_a_guest()) {
        // auto session was created - so switch to guest
        $user = build_user($conf['guest_id'], true);
    }
}
// Check the status now after the user has been loaded
check_status(ACCESS_GUEST);
list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
include_once PHPWG_ROOT_PATH . 'include/feedcreator.class.php';
set_make_full_url();
$rss = new UniversalFeedCreator();
$rss->encoding = get_pwg_charset();
$rss->title = $conf['gallery_title'];
$rss->title .= ' (as ' . stripslashes($user['username']) . ')';
$rss->link = get_gallery_home_url();
// +-----------------------------------------------------------------------+
// |                            Feed creation                              |
// +-----------------------------------------------------------------------+
$news = array();
if (!$image_only) {
    $news = news($feed_row['last_check'], $dbnow, true, true);
    if (count($news) > 0) {
        $item = new FeedItem();
        $item->title = l10n('New on %s', format_date($dbnow));
        $item->link = get_gallery_home_url();
        // content creation
        $item->description = '<ul>';
开发者ID:squidjam,项目名称:Piwigo,代码行数:31,代码来源:feed.php

示例12: array

        }
    } else {
        if (isset($_GET['init_auth'])) {
            $params = array();
            if ($provider == 'OpenID') {
                $params['openid_identifier'] = $_GET['openid_identifier'];
            }
            // try to authenticate
            $adapter = $hybridauth->authenticate($provider, $params);
        } else {
            if (!verify_ephemeral_key(@$_GET['key'])) {
                throw new Exception('Forbidden', 403);
            }
            $template->assign('LOADING', '&openid_identifier=' . @$_GET['openid_identifier'] . '&init_auth=1');
        }
    }
} catch (Exception $e) {
    switch ($e->getCode()) {
        case 5:
            $template->assign('ERROR', l10n('Authentication canceled'));
            break;
        case 404:
            $template->assign('ERROR', l10n('User not found'));
            break;
        default:
            $template->assign('ERROR', l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>', '<span title="' . $e->getMessage() . '">' . $e->getCode() . '</span>'));
    }
}
$template->assign(array('GALLERY_TITLE' => $conf['gallery_title'], 'CONTENT_ENCODING' => get_pwg_charset(), 'U_HOME' => get_gallery_home_url(), 'OAUTH_PATH' => OAUTH_PATH, 'PROVIDER' => $hybridauth_conf['providers'][$provider]['name'], 'SELF_URL' => OAUTH_PATH . 'auth.php?provider=' . $provider));
$template->set_filename('index', realpath(OAUTH_PATH . 'template/auth.tpl'));
$template->pparse('index');
开发者ID:lcorbasson,项目名称:Piwigo-Social-Connect,代码行数:31,代码来源:auth.php


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