• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP load_language函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: on_index_thumbnails

 static function on_index_thumbnails($thumbs)
 {
     global $page, $template;
     $total = count($page['items']);
     if (count($thumbs) >= $total) {
         add_event_handler('loc_end_index', array('RVTS', 'on_end_index'));
         return $thumbs;
     }
     $url_model = str_replace('123456789', '%start%', duplicate_index_url(array('start' => 123456789)));
     $ajax_url_model = add_url_params($url_model, array('rvts' => '%per%'));
     $url_model = str_replace('&', '&', $url_model);
     $ajax_url_model = str_replace('&', '&', $ajax_url_model);
     $my_base_name = basename(dirname(__FILE__));
     $ajax_loader_image = get_root_url() . "plugins/{$my_base_name}/ajax-loader.gif";
     $template->func_combine_script(array('id' => 'jquery', 'load' => 'footer', 'path' => 'themes/default/js/jquery.min.js'));
     $template->func_combine_script(array('id' => $my_base_name, 'load' => 'async', 'path' => 'plugins/' . $my_base_name . '/rv_tscroller.min.js', 'require' => 'jquery', 'version' => RVTS_VERSION));
     $start = (int) $page['start'];
     $per_page = $page['nb_image_page'];
     $moreMsg = 'See the remaining %d photos';
     if ('en' != $GLOBALS['lang_info']['code']) {
         load_language('lang', dirname(__FILE__) . '/');
         $moreMsg = l10n($moreMsg);
     }
     // the String.fromCharCode comes from google bot which somehow manage to get these urls
     $template->block_footer_script(null, "var RVTS = {\najaxUrlModel: String.fromCharCode(" . ord($ajax_url_model[0]) . ")+'" . substr($ajax_url_model, 1) . "',\nstart: {$start},\nperPage: {$per_page},\nnext: " . ($start + $per_page) . ",\ntotal: {$total},\nurlModel: String.fromCharCode(" . ord($url_model[0]) . ")+'" . substr($url_model, 1) . "',\nmoreMsg: '{$moreMsg}',\nprevMsg: '" . l10n("Previous") . "',\najaxLoaderImage: '{$ajax_loader_image}'\n};\njQuery('.navigationBar').hide();");
     return $thumbs;
 }
开发者ID:kappuccino,项目名称:piwigo-tscroller,代码行数:27,代码来源:main.inc.php


示例2: NBMSInfos

function NBMSInfos($dir)
{
    $path = $dir;
    $plg_data = implode('', file($path . 'main.inc.php'));
    if (preg_match("|Plugin Name: (.*)|", $plg_data, $val)) {
        $plugin['name'] = trim($val[1]);
    }
    if (preg_match("|Version: (.*)|", $plg_data, $val)) {
        $plugin['version'] = trim($val[1]);
    }
    if (preg_match("|Plugin URI: (.*)|", $plg_data, $val)) {
        $plugin['uri'] = trim($val[1]);
    }
    if ($desc = load_language('description.txt', $path . '/', array('return' => true))) {
        $plugin['description'] = trim($desc);
    } elseif (preg_match("|Description: (.*)|", $plg_data, $val)) {
        $plugin['description'] = trim($val[1]);
    }
    if (preg_match("|Author: (.*)|", $plg_data, $val)) {
        $plugin['author'] = trim($val[1]);
    }
    if (preg_match("|Author URI: (.*)|", $plg_data, $val)) {
        $plugin['author uri'] = trim($val[1]);
    }
    if (!empty($plugin['uri']) and strpos($plugin['uri'], 'extension_view.php?eid=')) {
        list(, $extension) = explode('extension_view.php?eid=', $plugin['uri']);
        if (is_numeric($extension)) {
            $plugin['extension'] = $extension;
        }
    }
    // IMPORTANT SECURITY !
    $plugin = array_map('htmlspecialchars', $plugin);
    return $plugin;
}
开发者ID:Eric-Piwigo,项目名称:NBM_Subscriber,代码行数:34,代码来源:functions.inc.php


示例3: osm_apply_menu

function osm_apply_menu($menu_ref_arr)
{
    global $template, $page, $conf;
    $menu =& $menu_ref_arr[0];
    if (($block = $menu->get_block('mbLinks')) != null) {
        include_once dirname(__FILE__) . '/include/functions.php';
        include_once dirname(__FILE__) . '/include/functions_map.php';
        osm_load_language();
        load_language('plugin.lang', OSM_PATH);
        // Comment are used only with this condition index.php l294
        if ($page['start'] == 0 and !isset($page['chronology_field'])) {
            $js_data = osm_get_items($page);
            if ($js_data != array()) {
                $local_conf = array();
                $local_conf['contextmenu'] = 'false';
                $local_conf['control'] = true;
                $local_conf['img_popup'] = false;
                $local_conf['popup'] = 2;
                $local_conf['center_lat'] = 0;
                $local_conf['center_lng'] = 0;
                $local_conf['zoom'] = 2;
                $local_conf['autocenter'] = 1;
                $local_conf['divname'] = 'mapmenu';
                $local_conf['paths'] = osm_get_gps($page);
                $height = isset($conf['osm_conf']['main_menu']['height']) ? $conf['osm_conf']['main_menu']['height'] : '200';
                $js = osm_get_js($conf, $local_conf, $js_data);
                $template->set_template_dir(dirname(__FILE__) . '/template/');
                $template->assign(array('OSM_PATH' => embellish_url(get_gallery_home_url() . OSM_PATH), 'OSMJS' => $js, 'HEIGHT' => $height));
                $block->template = 'osm-menu.tpl';
            }
        }
    }
}
开发者ID:lcorbasson,项目名称:piwigo-openstreetmap,代码行数:33,代码来源:menu.inc.php


示例4: oauth_init

/**
 * plugin initialization
 */
function oauth_init()
{
    global $conf, $page, $hybridauth_conf, $template;
    load_language('plugin.lang', OAUTH_PATH);
    $conf['oauth'] = safe_unserialize($conf['oauth']);
    // check config
    if (defined('IN_ADMIN')) {
        if (empty($hybridauth_conf) and strpos(@$_GET['page'], 'plugin-oAuth') === false) {
            $page['warnings'][] = '<a href="' . OAUTH_ADMIN . '">' . l10n('Social Connect: You need to configure the credentials') . '</a>';
        }
        if (!function_exists('curl_init')) {
            $page['warnings'][] = l10n('Social Connect: PHP Curl extension is needed');
        }
    }
    // in case of registration aborded
    if (script_basename() == 'index' and ($oauth_id = pwg_get_session_var('oauth_new_user')) !== null) {
        pwg_unset_session_var('oauth_new_user');
        if ($oauth_id[0] == 'Persona') {
            oauth_assign_template_vars(get_gallery_home_url());
            $template->block_footer_script(null, 'navigator.id.logout();');
        } else {
            require_once OAUTH_PATH . 'include/hybridauth/Hybrid/Auth.php';
            try {
                $hybridauth = new Hybrid_Auth($hybridauth_conf);
                $adapter = $hybridauth->getAdapter($oauth_id[0]);
                $adapter->logout();
            } catch (Exception $e) {
            }
        }
    }
}
开发者ID:lcorbasson,项目名称:Piwigo-Social-Connect,代码行数:34,代码来源:main.inc.php


示例5: TAT_no_photo_yet

function TAT_no_photo_yet()
{
    global $template;
    load_language('plugin.lang', PHPWG_PLUGINS_PATH . 'TakeATour/');
    $template->set_prefilter('no_photo_yet', 'TAT_no_photo_yet_prefilter');
    $template->assign(array('F_ACTION' => get_root_url() . 'admin.php', 'pwg_token' => get_pwg_token()));
}
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:7,代码来源:main.inc.php


示例6: osm_load_language

function osm_load_language()
{
    global $lang, $lang_info, $conf;
    if (isset($lang['Map']) or $lang_info['code'] == 'en' and !$conf['debug_l10n']) {
        return;
    }
    load_language('lang', dirname(__FILE__) . '/../');
}
开发者ID:lcorbasson,项目名称:piwigo-openstreetmap,代码行数:8,代码来源:functions.php


示例7: Controller_ZobBase

 /**
  * 构造函数
  *
  * 负责根据用户的 session 设置载入语言文件
  *
  * @return Controller_OfficeBase
  */
 function Controller_ZobBase()
 {
     if (isset($_SESSION['LANG'])) {
         $lang = $_SESSION['LANG'];
         $languages = FLEA::getAppInf('languages');
         if (in_array($lang, $languages, true)) {
             FLEA::setAppInf('defaultLanguage', $lang);
         }
     }
     load_language('ui, exception');
 }
开发者ID:TheProjecter,项目名称:teamweb,代码行数:18,代码来源:ZobBase.php


示例8: tg_groups_display

function tg_groups_display()
{
    global $conf, $template, $user, $tags, $page;
    load_language('plugin.lang', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    load_language('lang', PHPWG_ROOT_PATH . PWG_LOCAL_DIR, array('no_fallback' => true, 'local' => true));
    $template->set_prefilter('tags', 'tg_add_display_link_prefilter');
    $template->assign('U_TAG_GROUPS', get_root_url() . 'tags.php?display_mode=groups');
    if ($page['tg_display']) {
        // echo __FILE__.'::'.__LINE__.' display_mode=groups<br>';
        $template->set_prefilter('tags', 'tg_groups_display_prefilter');
        $template->assign('display_mode', 'groups');
        // we want tags diplayed in alphabetic order
        usort($tags, 'tag_alpha_compare');
        $current_tag_group = null;
        $nb_tags = count($tags);
        $current_column = 1;
        $current_tag_idx = 0;
        $tag_group = array('tags' => array());
        foreach ($tags as $tag) {
            // if the tag belongs to no group, we don't show it on the "tag by
            // group" display mode
            if (strpos($tag['name'], ':') === false) {
                continue;
            } else {
                list($tag['group'], $tag['name']) = explode(':', $tag['name'], 2);
                $tag['group'] = preg_replace('/^[^=]*=/', '', $tag['group']);
            }
            if ($current_tag_idx == 0) {
                $current_tag_group = $tag['group'];
                $tag_group['TITLE'] = $tag['group'];
            }
            // new group?
            if ($tag['group'] !== $current_tag_group) {
                if ($current_column < $conf['tag_letters_column_number'] and $current_tag_idx > $current_column * $nb_tags / $conf['tag_letters_column_number']) {
                    $tag_group['CHANGE_COLUMN'] = true;
                    $current_column++;
                }
                $tag_group['TITLE'] = $current_tag_group;
                $template->append('tag_groups', $tag_group);
                $current_tag_group = $tag['group'];
                $tag_group = array('tags' => array());
            }
            array_push($tag_group['tags'], array_merge($tag, array('URL' => make_index_url(array('tags' => array($tag))))));
            $current_tag_idx++;
        }
        // flush last group
        if (count($tag_group['tags']) > 0) {
            unset($tag_group['CHANGE_COLUMN']);
            $tag_group['TITLE'] = $current_tag_group;
            $template->append('tag_groups', $tag_group);
        }
    }
}
开发者ID:lcorbasson,项目名称:piwigo-tag_groups,代码行数:53,代码来源:main.inc.php


示例9: 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


示例10: upgrade_100_110

function upgrade_100_110()
{
    global $conf;
    load_language('plugin.lang', PH_PATH);
    // Upgrading options - Changing config variables to assoc array
    // ------------------------------------------------------------
    // Upgrade $conf_PH options
    $conf_PH = unserialize($conf['PruneHistory']);
    $Newconf_PH = array('PHVersion' => $conf_PH[0], 'AUTOPRUNE' => $conf_PH[1], 'RANGEVALUE' => $conf_PH[2], 'RANGE' => $conf_PH[3]);
    // unset obsolete conf
    // -------------------
    for ($i = 0; $i <= 3; $i++) {
        unset($conf_PH[$i]);
    }
    $update_conf = serialize($Newconf_PH);
    conf_update_param('PruneHistory', pwg_db_real_escape_string($update_conf));
}
开发者ID:Eric-Piwigo,项目名称:Prune_History,代码行数:17,代码来源:upgradedb.inc.php


示例11: osm_render_element_content

function osm_render_element_content()
{
    global $template, $picture, $page, $conf;
    load_language('plugin.lang', OSM_PATH);
    if (empty($page['image_id'])) {
        return;
    }
    // Load coordinates from picture
    $query = 'SELECT latitude,longitude FROM ' . IMAGES_TABLE . ' WHERE id = \'' . $page['image_id'] . '\' ;';
    //FIXME LIMIT 1 ?
    $result = pwg_query($query);
    $row = pwg_db_fetch_assoc($result);
    if (!$row or !$row['latitude'] or empty($row['latitude'])) {
        return;
    }
    $lat = $row['latitude'];
    $lon = $row['longitude'];
    // Load parameter, fallback to default if unset
    $height = isset($conf['osm_conf']['right_panel']['height']) ? $conf['osm_conf']['right_panel']['height'] : '200';
    $zoom = isset($conf['osm_conf']['right_panel']['zoom']) ? $conf['osm_conf']['right_panel']['zoom'] : '12';
    $osmname = isset($conf['osm_conf']['right_panel']['link']) ? $conf['osm_conf']['right_panel']['link'] : 'Location';
    $osmnamecss = isset($conf['osm_conf']['right_panel']['linkcss']) ? $conf['osm_conf']['right_panel']['linkcss'] : '';
    $showosm = isset($conf['osm_conf']['right_panel']['showosm']) ? $conf['osm_conf']['right_panel']['showosm'] : 'true';
    if (strlen($osmnamecss) != 0) {
        $osmnamecss = "style='" . $osmnamecss . "'";
    }
    $osmlink = "https://openstreetmap.org/?mlat=" . $lat . "&amp;mlon=" . $lon . "&zoom=12&layers=M";
    $local_conf = array();
    $local_conf['contextmenu'] = 'false';
    $local_conf['control'] = false;
    $local_conf['img_popup'] = false;
    $local_conf['popup'] = 2;
    $local_conf['center_lat'] = $lat;
    $local_conf['center_lng'] = $lon;
    $local_conf['zoom'] = $zoom;
    // TF, 20160102: pass config as parameter
    $js_data = osm_get_items($conf, $page);
    $js = osm_get_js($conf, $local_conf, $js_data);
    // Select the template
    $template->set_filenames(array('osm_content' => dirname(__FILE__) . "/template/osm-picture.tpl"));
    // Assign the template variables
    $template->assign(array('HEIGHT' => $height, 'OSMJS' => $js, 'OSM_PATH' => embellish_url(get_gallery_home_url() . OSM_PATH), 'OSMNAME' => $osmname, 'OSMNAMECSS' => $osmnamecss, 'SHOWOSM' => $showosm, 'OSMLINK' => $osmlink));
    // Return the rendered html
    $osm_content = $template->parse('osm_content', true);
    return $osm_content;
}
开发者ID:ThomasDaheim,项目名称:piwigo-openstreetmap,代码行数:46,代码来源:picture.inc.php


示例12: NBMS_prefilter

function NBMS_prefilter($content, &$smarty)
{
    global $template, $lang;
    load_language('plugin.lang', NBMS_PATH);
    $search = '<p class="bottomButtons">';
    $addon = '
  <fieldset>
    <legend>{\'NBMS_Section\'|@translate}</legend>
      <ul>
        <li>
          <span class="property">{\'NBMS_Text\'|@translate}</span>
          {html_radios name=\'NBM_Subscription\' options=$radio_options selected=$NBMS}
        </li>
      </ul>
  </fieldset>
';
    $replacement = $addon . $search;
    return str_replace($search, $replacement, $content);
}
开发者ID:Eric-Piwigo,项目名称:NBM_Subscriber,代码行数:19,代码来源:main.inc.php


示例13: PH_version_update

/**
 * Function to update plugin version number in config table
 * Used everytime a new version is updated even if no database
 * upgrade is needed
 */
function PH_version_update()
{
    global $conf;
    load_language('plugin.lang', PH_PATH);
    // Get current plugin version
    // --------------------------
    $plugin = PHInfos(PH_PATH);
    $version = $plugin['version'];
    // Upgrading options
    // -----------------
    $query = '
SELECT value
FROM ' . CONFIG_TABLE . '
WHERE param = "PruneHistory"
;';
    $result = pwg_query($query);
    $conf_PH = pwg_db_fetch_assoc($result);
    $Newconf_PH = unserialize($conf_PH['value']);
    $Newconf_PH['PHVersion'] = $version;
    $update_conf = serialize($Newconf_PH);
    conf_update_param('PruneHistory', pwg_db_real_escape_string($update_conf));
    // Check #_plugin table consistency
    // Only useful if a previous version upgrade has not worked correctly (rare case)
    // ------------------------------------------------------------------------------
    $query = '
SELECT version
  FROM ' . PLUGINS_TABLE . '
WHERE id = "PruneHistory"
;';
    $data = pwg_db_fetch_assoc(pwg_query($query));
    if (empty($data['version']) or $data['version'] != $version) {
        $query = '
UPDATE ' . PLUGINS_TABLE . '
SET version="' . $version . '"
WHERE id = "PruneHistory"
LIMIT 1
;';
        pwg_query($query);
    }
}
开发者ID:Eric-Piwigo,项目名称:Prune_History,代码行数:45,代码来源:functions.inc.php


示例14: upgrade_240_250

function upgrade_240_250()
{
    global $conf;
    load_language('plugin.lang', REGFLUXBB_PATH);
    $plugin = RegFluxBB_Infos(REGFLUXBB_PATH);
    $version = $plugin['version'];
    // Upgrading options - Changing config variables to assoc array
    // ------------------------------------------------------------
    $conf_RegFluxBB = isset($conf['Register_FluxBB']) ? explode(";", $conf['Register_FluxBB']) : array();
    $Newconf_RegFluxBB = array('REGFLUXBB_VERSION' => $version, 'FLUXBB_PREFIX' => $conf_RegFluxBB[0], 'FLUXBB_ADMIN' => $conf_RegFluxBB[1], 'FLUXBB_GUEST' => $conf_RegFluxBB[2], 'FLUXBB_DEL_PT' => $conf_RegFluxBB[3], 'FLUXBB_CONFIRM' => $conf_RegFluxBB[4], 'FLUXBB_DETAIL' => $conf_RegFluxBB[5], 'FLUXBB_UAM_LINK' => $conf_RegFluxBB[6], 'FLUXBB_GROUP' => $conf_RegFluxBB[7]);
    $update_conf = serialize($Newconf_RegFluxBB);
    $q = '
DELETE FROM ' . CONFIG_TABLE . '
WHERE param="Register_FluxBB" LIMIT 1
;';
    pwg_query($q);
    $q = '
INSERT INTO ' . CONFIG_TABLE . ' (param, value, comment)
VALUES ("Register_FluxBB","' . pwg_db_real_escape_string($update_conf) . '","Register_FluxBB parameters")
  ;';
    pwg_query($q);
}
开发者ID:Eric-Piwigo,项目名称:Register_FluxBB,代码行数:22,代码来源:upgradedb.inc.php


示例15: modus_smarty_prefilter

function modus_smarty_prefilter($source)
{
    global $lang, $conf;
    $source = str_replace('<div id="imageHeaderBar">', '<div class=titrePage id=imageHeaderBar>', $source);
    $source = str_replace('<div id=imageHeaderBar>', '<div class=titrePage id=imageHeaderBar>', $source);
    if (!isset($lang['modus_theme'])) {
        load_language('theme.lang', dirname(__FILE__) . '/');
    }
    // picture page actionButtons wrap for mobile
    if (strpos($source, '<div id="imageToolBar">') !== false || strpos($source, '<div id=imageToolBar>') !== false) {
        if (!($pos = strpos($source, '<div class="actionButtons">'))) {
            $pos = strpos($source, '<div class=actionButtons>');
        }
        if ($pos !== false) {
            $source = substr_replace($source, '<div class=actionButtonsWrapper><a id=imageActionsSwitch class=pwg-button><span class="pwg-icon pwg-icon-ellipsis"></span></a>{combine_script version=1 id=\'modus.async\' path="themes/`$themeconf.id`/js/modus.async.js" load=\'async\'}', $pos, 0);
            $pos = strpos($source, 'caddie', $pos + 1);
            $pos = strpos($source, '</div>', $pos + 1);
            $source = substr_replace($source, '</div>', $pos, 0);
        }
    }
    /* move imageNumber from imageToolBar to imageHeaderBar*/
    if (preg_match('#<div[ a-zA-Z"=]+id="?imageHeaderBar"?>#', $source, $matches, PREG_OFFSET_CAPTURE) && preg_match('#<div class="?imageNumber"?>{\\$PHOTO}</div>#', $source, $matches2, PREG_OFFSET_CAPTURE, $matches[0][1] + 20)) {
        $source = substr_replace($source, '', $matches2[0][1], strlen($matches2[0][0]));
        $source = substr_replace($source, $matches2[0][0], $matches[0][1] + strlen($matches[0][0]), 0);
    }
    if (($pos = strpos($source, '<ul class="categoryActions">')) !== false || ($pos = strpos($source, '<ul class=categoryActions>')) !== false) {
        if (($pos2 = strpos($source, '</ul>', $pos)) !== false && substr_count($source, '<li>', $pos, $pos2 - $pos) > 2) {
            $source = substr_replace($source, '<a id=albumActionsSwitcher class=pwg-button><span class="pwg-icon pwg-icon-ellipsis"></span></a>{combine_script version=1 id=\'modus.async\' path="themes/`$themeconf.id`/js/modus.async.js" load=\'async\'}', $pos, 0);
        }
    }
    $re = preg_quote('<img title="{$cat.icon_ts.TITLE}" src="', '/') . '[^>]+' . preg_quote('/recent{if $cat.icon_ts.IS_CHILD_DATE}_by_child{/if}.png"', '/') . '[^>]+' . preg_quote('alt="(!)">', '/');
    $source = preg_replace('/' . $re . '/', '<span class=albSymbol title="{$cat.icon_ts.TITLE}">{if $cat.icon_ts.IS_CHILD_DATE}' . MODUS_STR_RECENT_CHILD . '{else}' . MODUS_STR_RECENT . '{/if}</span>', $source);
    $re = preg_quote('<img title="{$thumbnail.icon_ts.TITLE}" src="', '/') . '[^>]+' . preg_quote('/recent.png" alt="(!)">', '/');
    $source = preg_replace('/' . $re . '/', '<span class=albSymbol title="{$thumbnail.icon_ts.TITLE}">' . MODUS_STR_RECENT . '</span>', $source);
    return $source;
}
开发者ID:joubu,项目名称:piwigo-modus,代码行数:36,代码来源:functions.inc.php


示例16: language_controler_switch

function language_controler_switch()
{
    global $user;
    $same = $user['language'];
    if (isset($_GET['lang'])) {
        include_once PHPWG_ROOT_PATH . 'admin/include/languages.class.php';
        $languages = new languages();
        if (!in_array($_GET['lang'], array_keys($languages->fs_languages))) {
            $_GET['lang'] = PHPWG_DEFAULT_LANGUAGE;
        }
        if (!empty($_GET['lang']) and file_exists(PHPWG_ROOT_PATH . 'language/' . $_GET['lang'] . '/common.lang.php')) {
            if (is_a_guest() or is_generic()) {
                pwg_set_session_var('lang_switch', $_GET['lang']);
            } else {
                $query = '
UPDATE ' . USER_INFOS_TABLE . '
  SET language = \'' . $_GET['lang'] . '\'
  WHERE user_id = ' . $user['id'] . '
;';
                pwg_query($query);
            }
            $user['language'] = $_GET['lang'];
        }
    } elseif (is_a_guest() or is_generic()) {
        $user['language'] = pwg_get_session_var('lang_switch', $user['language']);
    }
    // Reload language only if it isn't the same one
    if ($same !== $user['language']) {
        load_language('common.lang', '', array('language' => $user['language']));
        load_language('lang', PHPWG_ROOT_PATH . PWG_LOCAL_DIR, array('language' => $user['language'], 'no_fallback' => true, 'local' => true));
        if (defined('IN_ADMIN') and IN_ADMIN) {
            // Never currently
            load_language('admin.lang', '', array('language' => $user['language']));
        }
    }
}
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:36,代码来源:language_switch.inc.php


示例17: die

<?php

if (!defined("IN_BTIT")) {
    die("non direct access!");
}
require load_language("lang_staff.php");
$stafftpl = new bTemplate();
$stafftpl->set("language", $language);
if ($CURUSER["view_users"] == "no") {
    err_msg($language["ERROR"], $language["NOT_AUTHORIZED"] . " " . strtolower($language["STAFF"]) . "!");
    stdfoot();
    exit;
} else {
    $query = "SELECT u.id, u.username, u.avatar, UNIX_TIMESTAMP(u.joined) joined, ";
    $query .= "UNIX_TIMESTAMP(u.lastconnect) lastconnect, ul.level, ul.prefixcolor, ";
    $query .= "ul.suffixcolor, c.name country, c.flagpic, o.lastaction ";
    $query .= "FROM {$TABLE_PREFIX}users u ";
    $query .= "LEFT JOIN {$TABLE_PREFIX}users_level ul ON u.id_level = ul.id ";
    $query .= "LEFT JOIN {$TABLE_PREFIX}countries c ON u.flag = c.id ";
    $query .= "LEFT JOIN {$TABLE_PREFIX}online o ON u.id = o.user_id ";
    $query .= "WHERE u.id_level >=6 ";
    $query .= "AND u.id_level <=8 ";
    $query .= "ORDER BY u.id_level DESC, u.id ASC";
    $res = do_sqlquery($query);
    $i = 0;
    while ($row = mysql_fetch_assoc($res)) {
        is_null($row["avatar"]) || $row["avatar"] == "" ? $avatar = "<img src='{$STYLEURL}/images/default_avatar.gif' height=80 width=80>" : ($avatar = "<img src='" . $row["avatar"] . "' height=80 width=80>");
        is_null($row["lastaction"]) ? $lastseen = $row["lastconnect"] : ($lastseen = $row["lastaction"]);
        time() - $lastseen > 900 ? $status = "<img src='images/offline.gif' border='0' alt='" . $language["OFFLINE"] . "'>" : ($status = "<img src='images/online.gif' border='0' alt='" . $language["ONLINE"] . "'>");
        if (is_null($row["flagpic"])) {
            $row["flagpic"] = "unknown.gif";
开发者ID:wilian32,项目名称:xbtit,代码行数:31,代码来源:staff.php


示例18: get_result

}
$res = get_result("SELECT size FROM {$TABLE_PREFIX}files WHERE info_hash='{$id}'", true);
if ($res) {
    $row = $res[0];
    if ($row) {
        $tsize = 0 + $row["size"];
    }
} else {
    die("Error ID");
}
if ($XBTT_USE) {
    $res = get_result("SELECT x.uid,x.completed, x.downloaded, x.uploaded, x.left as bytes, IF(x.left=0,'seeder','leecher') as status, x.mtime as lastupdate, u.username, u.flag, c.flagpic, c.name FROM xbt_files_users x LEFT JOIN xbt_files ON x.fid=xbt_files.fid LEFT JOIN {$TABLE_PREFIX}files f ON f.bin_hash=xbt_files.info_hash LEFT JOIN {$TABLE_PREFIX}users u ON u.id=x.uid LEFT JOIN {$TABLE_PREFIX}countries c ON u.flag=c.id WHERE f.info_hash='{$id}' AND active=1 ORDER BY status DESC, lastupdate DESC", true, $btit_settings['cache_duration']);
} else {
    $res = get_result("SELECT * FROM {$TABLE_PREFIX}peers p LEFT JOIN {$TABLE_PREFIX}countries c ON p.dns=c.domain WHERE infohash='{$id}' ORDER BY bytes ASC, status DESC, lastupdate DESC", true, $btit_settings['cache_duration']);
}
require load_language("lang_peers.php");
$peerstpl = new bTemplate();
$peerstpl->set("language", $language);
$peerstpl->set("peers_script", "index.php");
if (count($res) == 0) {
    $peerstpl->set("NOPEERS", TRUE, TRUE);
} else {
    $peerstpl->set("NOPEERS", FALSE, TRUE);
    foreach ($res as $id => $row) {
        // for user name instead of peer
        if ($XBTT_USE) {
            $resu = TRUE;
        } elseif ($PRIVATE_ANNOUNCE) {
            $resu = get_result("SELECT u.username,u.id,c.flagpic,c.name FROM {$TABLE_PREFIX}users u LEFT JOIN {$TABLE_PREFIX}countries c ON c.id=u.flag WHERE u.pid='" . $row["pid"] . "' LIMIT 1", true, $btit_settings['cache_duration']);
        } else {
            $resu = get_result("SELECT u.username,u.id,c.flagpic,c.name FROM {$TABLE_PREFIX}users u LEFT JOIN {$TABLE_PREFIX}countries c ON c.id=u.flag WHERE u.cip='" . $row["ip"] . "' LIMIT 1", true, $btit_settings['cache_duration']);
开发者ID:fchypzero,项目名称:cybyd,代码行数:31,代码来源:peers.php


示例19: load_language

<?php

// Need upgrade?
global $conf;
include PHPWG_THEMES_PATH . 'smartpocket/admin/upgrade.inc.php';
load_language('theme.lang', PHPWG_THEMES_PATH . 'smartpocket/');
$config_send = array();
if (isset($_POST['submit_smartpocket'])) {
    $config_send['loop'] = isset($_POST['loop']);
    $config_send['autohide'] = isset($_POST['autohide']) ? 5000 : 0;
    $conf['smartpocket'] = serialize($config_send);
    conf_update_param('smartpocket', pwg_db_real_escape_string($conf['smartpocket']));
    array_push($page['infos'], l10n('Information data registered in database'));
}
$template->set_filenames(array('theme_admin_content' => dirname(__FILE__) . '/admin.tpl'));
$template->assign('options', unserialize($conf['smartpocket']));
$template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content');
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:17,代码来源:admin.inc.php


示例20: get_access

/ \ / \ / \ / \ / \   / \ / \ / \ / \ / \ / \   / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/   \_/ \_/ \_/ \_/ \_/ \_/   \_/ \_/ \_/ \_/
*/
if (!defined('IN_INSTALLER09_ADMIN')) {
    $HTMLOUT = '';
    $HTMLOUT .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\t\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t<html xmlns='http://www.w3.org/1999/xhtml'>\n\t\t<head>\n\t\t<title>Error!</title>\n\t\t</head>\n\t\t<body>\n\t<div style='font-size:33px;color:white;background-color:red;text-align:center;'>Incorrect access<br />You cannot access this file directly.</div>\n\t</body></html>";
    echo $HTMLOUT;
    exit;
}
require_once INCL_DIR . 'user_functions.php';
require_once INCL_DIR . 'html_functions.php';
require_once CLASS_DIR . 'class_check.php';
$class = get_access(basename($_SERVER['REQUEST_URI']));
class_check($class);
$lang = array_merge($lang, load_language('ad_stats_extra'));
$inbound = array_merge($_GET, $_POST);
if (!isset($inbound['mode'])) {
    $inbound['mode'] = '';
}
$form_code = '';
$month_names = array(1 => $lang['stats_ex_jan'], $lang['stats_ex_jan'], $lang['stats_ex_feb'], $lang['stats_ex_mar'], $lang['stats_ex_apr'], $lang['stats_ex_may'], $lang['stats_ex_jun'], $lang['stats_ex_jul'], $lang['stats_ex_sep'], $lang['stats_ex_oct'], $lang['stats_ex_nov'], $lang['stats_ex_dec']);
switch ($inbound['mode']) {
    case 'show_reg':
        result_screen('reg');
        break;
    case 'show_topic':
        result_screen('topic');
        break;
    case 'topic':
        main_screen('topic');
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:31,代码来源:stats_extra.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP load_language_module函数代码示例发布时间:2022-05-15
下一篇:
PHP load_lang函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap