public function init() { $language = preg_replace('#\\\\|/#', '', getLanguageName()); if (file_exists($this->getDirectory() . $language . '.php')) { include_once $this->getDirectory() . $language . '.php'; } else { include_once $this->getDirectory() . 'english.php'; } return; }
function init() { // include language file for this plugin $language = str_replace(array('\\', '/'), '', getLanguageName()); if (file_exists($this->getDirectory() . $language . '.php')) { include_once $this->getDirectory() . $language . '.php'; } else { include_once $this->getDirectory() . 'english.php'; } }
public function init() { // include language file for this plugin $language = str_replace(array('\\', '/'), '', getLanguageName()); $includeDir = $this->getDirectory() . 'language/'; $includeFile = is_file($includeDir . $language . '.inc') ? $language : 'english'; include_once $includeDir . $includeFile . '.inc'; $this->language = $includeFile; // Mobile Detect require_once $this->getDirectory() . "Mobile-Detect-{$this->mobileDetectVersion}/Mobile_Detect.php"; $this->detect = new Mobile_Detect(); }
function init() { // include language file for this plugin global $CONF; $adminurl = parse_url($CONF['AdminURL']); $currenturl = getenv('SCRIPT_NAME'); if (strpos($currenturl, $adminurl['path']) !== 0) { return; } $language = str_replace(array('\\', '/'), '', getLanguageName()); $langDir = $this->getDirectory() . 'language/'; if (!@(include_once "{$langDir}{$language}.php")) { include_once "{$langDir}english.php"; } }
public function init() { $language = preg_replace('#\\\\|/#', '', getLanguageName()); if (file_exists($this->getDirectory() . $language . '.php')) { include_once $this->getDirectory() . $language . '.php'; } else { include_once $this->getDirectory() . 'english.php'; } $this->enable_security = $this->getOption('enable_security'); $this->pwd_min_length = intval($this->getOption('pwd_min_length')); $this->pwd_complexity = intval($this->getOption('pwd_complexity')); $this->max_failed_login = intval($this->getOption('max_failed_login')); $this->login_lockout = intval($this->getOption('login_lockout')); return; }
private function getInlinejs() { static $called = FALSE; if ($called) { return; } // Use only once $called = TRUE; global $DIR_MEDIA, $CONF; $adminurl = $this->getAdminURL(); $tpl = file_get_contents($this->getDirectory() . 'inlinejs.tpl'); if ($tpl !== FALSE) { $ph['adminurl'] = $adminurl; $ph['lang'] = getLanguageName() === 'japanese-utf8' ? 'ja' : 'en'; $ph['MediaURL'] = $CONF['MediaURL']; return $this->parseText($tpl, $ph); } return ''; }
function articleMetaInfo($author, $author_username, $date, $time = "", $languageId = "") { debug("LanguageId er " . $languageId); $languageName = getLanguageName($languageId); echo '<div class="metatext">'; echo '<span class="author">'; if ($author_username == -1) { echo stripslashes($author); } else { echo '<a href="index.php?m_c=mvp&username='******'">' . stripslashes($author) . '</a>'; } echo '</span>'; if (strlen($time) > 1) { echo ', postet <span class="date">' . $date . '</span>'; echo '<span class="time"> ' . $time . '</span>'; } else { echo ', <span class="date">' . $date . '</span>'; } if (strlen($languageName) > 0) { echo ' <span class="date">(' . $languageName . ')</span>'; } echo '</div>'; }
function install() { // include language file for this plugin $language = str_replace(array('\\', '/'), '', getLanguageName()); if (file_exists($this->getDirectory() . $language . '.php')) { include_once $this->getDirectory() . $language . '.php'; } else { include_once $this->getDirectory() . 'english.php'; } $this->createOption('timelocale', _NP_LRWITEBACKS_TZLOC, 'text', 'ja_JP.' . _CHARSET); $this->createOption('cmdateformat', _NP_LRWITEBACKS_CDFMT, 'text', '%Y-%m-%d %H:%M:%S'); $this->createOption('tbdateformat', _NP_LRWITEBACKS_TEFMT, 'text', '%m-%d'); $this->createOption('cmlisthead', _NP_LRWITEBACKS_CHEAD, 'textarea', '<ul class="nobullets">'); $this->createOption('cmttemplate', _NP_LRWITEBACKS_CBODY, 'textarea', '<li>♣<a href="<%itemlink%>#c<%commentid%>"><%commentdate%>|<%commentator%>><%commentbody%></a></li>'); $this->createOption('cmlistfoot', _NP_LRWITEBACKS_CFOOT, 'textarea', '</ul>'); $this->createOption('tblisthead', _NP_LRWITEBACKS_THEAD, 'textarea', '<ul class="nobullets">'); $this->createOption('tbktemplate', _NP_LRWITEBACKS_TBODY, 'textarea', '<li>…<a href="<%itemlink%>#trackback"><%tbdate%>|<%blogname%> ping: "<%entrytitle%>"</a></li>'); $this->createOption('tblistfoot', _NP_LRWITEBACKS_TFOOT, 'textarea', '</ul>'); /* Comment list template sample Header <ol class="recent-comment"> Body <li><a href="<%itemlink%>#c<%commentid%>" title="<%commentbody%>"><%commentator%>(<%commentday%>)</a></li> Footer </ol> TrackBack list template sample Header <ol class="recent-trackback"> Body <li><a href="<%itemlink%>#tb<%tbid%>" title="<%expect%>"><%blogname%> : <%entrytitle%>(<%tbday%>)</a></li> Footer </ol> */ }
function init() { global $admin; $language = str_replace(array('\\', '/'), '', getLanguageName()); $plugin_path = $this->getDirectory(); if (!is_file("{$plugin_path}language/{$language}.php")) { $language = 'english'; } include_once "{$plugin_path}language/{$language}.php"; }
public function init() { global $manager; $locale = ''; if (!class_exists('Medium', FALSE)) { $manager->getPlugin('NP_Thumbnail'); } /* new API */ if (class_exists('i18n', FALSE)) { $locale = i18n::get_current_locale() . '.' . i18n::get_current_charset() . '.php'; } else { $language = preg_replace('#[/|\\\\]#', '', getLanguageName()); if ($language == 'japanese-euc') { $locale = 'ja_Jpan_JP.EUC-JP.php'; } else { if ($language = 'japanese-utf8') { $locale = 'ja_Jpan_JP.UTF-8.php'; } } } if (!$locale || !file_exists($this->getDirectory() . $locale)) { include $this->getDirectory() . 'en_Latn_US.ISO-8859-1.php'; } else { include $this->getDirectory() . $locale; } return; }
function init() { // include language file for this plugin $language = str_replace(array('\\', '/'), '', getLanguageName()); if (file_exists($this->getDirectory() . $language . '.php')) { include_once $this->getDirectory() . $language . '.php'; } else { include_once $this->getDirectory() . 'english.php'; } //sortkey array (called from admin area) $this->arr_skey = array(); foreach (range('a', 'z') as $key) { $this->arr_skey[$key] = strtoupper($key); } }
* This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit * http://www.gnu.org/licenses/gpl.html * ========================================================================================== */ $DIR_LIBS = ''; $strRel = '../../../'; require $strRel . 'config.php'; include_libs('PLUGINADMIN.php'); $language = preg_replace('#\\\\|/#', '', getLanguageName()); $langfile = $language . '.php'; if (file_exists($langfile)) { include_once $langfile; } else { include_once 'english.php'; } /** * Create admin area */ $oPluginAdmin = new PluginAdmin('SkinFiles'); if (!($member->isLoggedIn() && $member->isAdmin())) { /* begin modification by yama.kyms */ $oPluginAdmin->start(); /* end modification */ echo '<p>' . _ERROR_DISALLOWED . '</p>';
yu (http://nucleus.datoka.jp/) index.php (admin page) ---------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. (see nucleus/documentation/index.html#license for more info) */ $strRel = '../../../'; include $strRel . 'config.php'; include $DIR_LIBS . 'PLUGINADMIN.php'; include 'functions.php'; $language = ereg_replace('[\\|/]', '', getLanguageName()); $langfile = $language . '.php'; if (file_exists($langfile)) { include_once $langfile; } else { include_once 'english.php'; } /** * Create admin area */ $oPluginAdmin = new PluginAdmin('LinkList'); $pluginUrl = $oPluginAdmin->plugin->getAdminURL(); switch ($oPluginAdmin->plugin->getOption('sel_edit')) { case 'siteadmin': $flg_edit = $member->isAdmin(); break;
function availableLocales($active_locale = null, $bypass_settings = false) { // Initialize $scan = scandir(JAPPIX_BASE . '/i18n/'); $list = array(); // Loop the available languages foreach ($scan as $current_id) { // Pass? if (!$bypass_settings && LANGUAGE && LANGUAGE != 'all' && $current_id != LANGUAGE) { continue; } // Get the current language name $current_name = getLanguageName($current_id); // Not valid? if (strtolower($current_id) == $active_locale || $current_name == null) { continue; } // Add this to the list $list[$current_id] = $current_name; } return $list; }
function availableLocales($active_locale) { // Initialize $scan = scandir(JAPPIX_BASE . '/lang/'); $list = array(); // Loop the available languages foreach ($scan as $current_id) { // Get the current language name $current_name = getLanguageName($current_id); // Not valid? if (strtolower($current_id) == $active_locale || $current_name == null) { continue; } // Add this to the list $list[$current_id] = $current_name; } return $list; }
<li><?php _e("Main configuration"); ?> </li> <li><?php _e("Hosts configuration"); ?> </li> <li><?php _e("Services installation"); ?> </li> </ol> <p><?php printf(T_("If the current language does not match yours (%1s), you can make Jappix speak %2s it will be saved."), getLanguageName($locale), languageSwitcher($locale)); ?> </p> <p><?php _e("If you want to get some help about the Jappix installation and configuration, you can use our whole documentation, available at:"); ?> <a href="https://github.com/jappix/jappix/wiki" target="_blank">https://github.com/jappix/jappix/wiki</a></p> <p><?php _e("It's time to build your own social cloud: just go to the next step!"); ?> </p> <?php } else { if ($step == 2) {
public function doTemplateVar(&$item, $constant) { global $member, $CONF; $language = getLanguageName(); $getLanguage = isset($_GET['lang']) ? getVar('lang') : false; $cookieLanguage = isset($_COOKIE['NP_Text']) ? cookieVar('NP_Text') : false; if ($getLanguage) { $this->use_lang($getLanguage, $constant); } elseif ($cookieLanguage) { $this->use_lang($cookieLanguage, $constant); } else { $this->use_lang($language, $constant); } }
<div class="row"><label for="app"><?php echo installer_t('Application Name'); ?> </label><input type="text" name="app" id="app" value="<?php getField('app', 'X2Engine'); ?> " style="width:190px" /></div> <div class="row"><label for="language"><?php echo installer_t('Default Language'); ?> </label> <select name="language" id="language" onChange="changeLang(this.options[this.selectedIndex].value);" style="width:200px"><option value="">English</option> <?php foreach ($languageDirs as $code) { // generate language dropdown $languageName = getLanguageName($code); // lookup language name if ($languageName !== false) { $selected = $code == $lang ? ' selected' : ''; // mark option selected if user has chosen this language echo "\t\t<option value=\"{$code}\"{$selected}>{$languageName}</option>\n"; // list all available languages } } echo '</select>'; ?> </div> <div class="row"><label for="currency"><?php echo installer_t('Currency'); ?>
<span class="desc"><?php _e("Find a public Jappix node."); ?> </span> </a> </div> </div> </div> <div class="locale" data-keepget="<?php echo keepGet('l', false); ?> "> <div class="current"> <div class="current_align"><?php echo getLanguageName($locale); ?> </div> </div> </div> <?php // Add the notice $conf_notice = readNotice(); $type_notice = $conf_notice['type']; $text_notice = $conf_notice['notice']; // Simple notice if ($type_notice == 'simple' || $type_notice == 'advanced') { // We must encode special HTML characters if ($type_notice == 'simple') { $text_notice = '<span class="title home-images">' . T_("Notice") . '</span><span class="text">' . htmlentities($text_notice) . '</span>';
/** * Multi language support */ function defineMultilanguage() { $multilang = array('_NPTAGEX_ERASE_FLG' => array('Erase data when uninstall ?', 'アンインストール時にデータを消去しますか?'), '_NPTAGEX_EDT_TAGORDER' => array('editform tag order', 'アイテム追加/編集時のタグの並び順'), '_NPTAGEX_ORDER_VALUE' => array("amount(desc)|1|amount(asc)|2|tag's order|3|random|4", 'アイテムの多い順|1|アイテムの少ない順|2|タグ順(キャラクターコード順)|3|ランダム|4'), '_NPTAGEX_TPL_AND' => array("template for 'and'", "'and' リンクのテンプレート"), '_NPTAGEX_TPL_OR' => array("template for 'or'", "'or' リンクのテンプレート"), '_NPTAGEX_TPL_TAGIDX' => array("template for 'tagIndex'", 'タグのリンクのテンプレート'), '_NPTAGEX_TPL_ITEMHEAD' => array("template for 'tagItemHeader'", 'タグを含むアイテムごとのヘッダ'), '_NPTAGEX_TPL_TAGITEMS' => array("template for 'tagItem'", 'タグを含むアイテム'), '_NPTAGEX_TPL_ITEMSEPL' => array("template for 'tagItemSeparator'", 'タグを含むアイテムのセパレータ'), '_NPTAGEX_TPL_ITEMFOOT' => array("template for 'tagItemFooter'", 'タグを含むアイテムごとのフッタ'), '_NPTAGEX_TPL_IDXSEP' => array("template for 'tagIndexSeparator'", 'タグのリンクのセパレータ'), '_NPTAGEX_ONLY_CURRENT' => array('show tags only current blog have', '表示中のブログのアイテムに登録してあるタグのみ表示'), '_NPTAGEX_HILIGHT_MODE' => array('colorful highlight mode ?', 'カラフルハイライトモードにしますか?'), '_NPTAGEX_HILIGHT_NORM' => array('template for normal highlightmode', 'ノーマルハイライトモードの時のテンプレート'), '_NPTAGEX_MAX_TAGLEBEL' => array('MAX tag lebel', 'タグレベルの最大値'), '_NPTAGEX_MIN_TAGLEBEL' => array('MAX tag lebel', 'タグレベルの最小値')); switch (str_replace(array('\\', '/'), '', getLanguageName())) { case 'japanese-utf8': foreach ($multilang as $key => $value) { define($key, $value[1]); } break; case 'japanese-euc': foreach ($multilang as $key => $value) { define($key, mb_convert_encoding($value[1], 'EUC-JP', 'UTF-8')); } break; default: foreach ($multilang as $key => $value) { define($key, $value[0]); } } }
/** * Check ticket when not checked in plugin's admin page * to avoid CSRF. * Also avoid the access to plugin/index.php by guest user. */ function ticketForPlugin() { global $CONF, $DIR_PLUGINS, $member, $ticketforplugin; /* initialize */ $ticketforplugin = array(); $ticketforplugin['ticket'] = FALSE; /* Check if using plugin's php file. */ if ($p_translated = serverVar('PATH_TRANSLATED')) { if (!file_exists($p_translated)) { $p_translated = ''; } } if (!$p_translated) { $p_translated = serverVar('SCRIPT_FILENAME'); if (!file_exists($p_translated)) { header("HTTP/1.0 404 Not Found"); exit(''); } } $p_translated = str_replace('\\', '/', $p_translated); $d_plugins = str_replace('\\', '/', $DIR_PLUGINS); if (strpos($p_translated, $d_plugins) !== 0) { return; // This isn't plugin php file. } /* Solve the plugin php file or admin directory */ $phppath = substr($p_translated, strlen($d_plugins)); $phppath = preg_replace('#^/#', '', $phppath); // Remove the first "/" if exists. $path = preg_replace('#^NP_(.*)\\.php$#', '$1', $phppath); // Remove the first "NP_" and the last ".php" if exists. $path = preg_replace('#^([^/]*)/(.*)$#', '$1', $path); // Remove the "/" and beyond. /* Solve the plugin name. */ $plugins = array(); $query = 'SELECT `pfile` FROM ' . sql_table('plugin'); $res = sql_query($query); while ($row = sql_fetch_row($res)) { $name = substr($row[0], 3); $plugins[strtolower($name)] = $name; } sql_free_result($res); if ($plugins[$path]) { $plugin_name = $plugins[$path]; } else { if (in_array($path, $plugins)) { $plugin_name = $path; } else { header("HTTP/1.0 404 Not Found"); exit(''); } } /* Return if not index.php */ if ($phppath != strtolower($plugin_name) . '/' && $phppath != strtolower($plugin_name) . '/index.php') { return; } /* Exit if not logged in. */ if (!$member->isLoggedIn()) { exit(_GFUNCTIONS_YOU_AERNT_LOGGEDIN); } global $manager, $DIR_LIBS, $DIR_LANG, $HTTP_GET_VARS, $HTTP_POST_VARS; /* Check if this feature is needed (ie, if "$manager->checkTicket()" is not included in the script). */ if (!($p_translated = serverVar('PATH_TRANSLATED'))) { $p_translated = serverVar('SCRIPT_FILENAME'); } if ($file = @file($p_translated)) { $prevline = ''; foreach ($file as $line) { if (preg_match('/[\\$]manager([\\s]*)[\\-]>([\\s]*)checkTicket([\\s]*)[\\(]/i', $prevline . $line)) { return; } $prevline = $line; } } /* Show a form if not valid ticket */ if ((strstr(serverVar('REQUEST_URI'), '?') || serverVar('QUERY_STRING') || strtoupper(serverVar('REQUEST_METHOD')) == 'POST') && !$manager->checkTicket()) { if (!class_exists('PluginAdmin')) { $language = getLanguageName(); # replaced ereg_replace() below with preg_replace(). ereg* functions are deprecated in PHP 5.3.0 # original ereg_replace: ereg_replace( '[\\|/]', '', $language) . '.php') # important note that '\' must be matched with '\\\\' in preg* expressions include $DIR_LANG . preg_replace('#[\\\\|/]#', '', $language) . '.php'; include $DIR_LIBS . 'PLUGINADMIN.php'; } $oPluginAdmin = new PluginAdmin($plugin_name); $oPluginAdmin->start(); echo '<p>' . _ERROR_BADTICKET . "</p>\n"; /* Show the form to confirm action */ // PHP 4.0.x support $get = isset($_GET) ? $_GET : $HTTP_GET_VARS; $post = isset($_POST) ? $_POST : $HTTP_POST_VARS; // Resolve URI and QUERY_STRING if ($uri = serverVar('REQUEST_URI')) { list($uri, $qstring) = explode('?', $uri); } else { if (!($uri = serverVar('PHP_SELF'))) { $uri = serverVar('SCRIPT_NAME'); } $qstring = serverVar('QUERY_STRING'); } if ($qstring) { $qstring = '?' . $qstring; } echo '<p>' . _SETTINGS_UPDATE . ' : ' . _QMENU_PLUGINS . ' <span style="color:red;">' . htmlspecialchars($plugin_name) . "</span> ?</p>\n"; switch (strtoupper(serverVar('REQUEST_METHOD'))) { case 'POST': echo '<form method="POST" action="' . htmlspecialchars($uri . $qstring) . '">'; $manager->addTicketHidden(); _addInputTags($post); break; case 'GET': echo '<form method="GET" action="' . htmlspecialchars($uri) . '">'; $manager->addTicketHidden(); _addInputTags($get); default: break; } echo '<input type="submit" value="' . _YES . '" /> '; echo '<input type="button" value="' . _NO . '" onclick="history.back(); return false;" />'; echo "</form>\n"; $oPluginAdmin->end(); exit; } /* Create new ticket */ $ticket = $manager->addTicketToUrl(''); $ticketforplugin['ticket'] = substr($ticket, strpos($ticket, 'ticket=') + 7); }
<?php $language = str_replace(array('\\', '/'), '', getLanguageName()); $plugin_path = str_replace('\\', '/', dirname(__FILE__)) . '/'; $help_path = "{$plugin_path}{$language}_help.html"; if (is_file($help_path)) { echo file_get_contents($help_path); } else { echo file_get_contents('default_help.html'); }
} else { if (isset($_POST['adm-lang-compile']) && !empty($_POST['langs'])) { foreach ($_POST['langs'] as $iLangId) { if (!compileLanguage((int) $iLangId)) { $aResults['langs'] = '_adm_txt_langs_cannot_compile'; break; } } if (empty($aResults['langs'])) { $aResults['langs'] = '_adm_txt_langs_success_compile'; } } else { if (isset($_POST['adm-lang-delete']) && !empty($_POST['langs'])) { $sNameDefault = getParam('lang_default'); foreach ($_POST['langs'] as $iLangId) { $sName = getLanguageName($iLangId); if ($sName == $sNameDefault) { $aResults['langs'] = '_adm_txt_langs_cannot_delete_default'; break; } if (!deleteLanguage((int) $iLangId)) { $aResults['langs'] = '_adm_txt_langs_cannot_delete'; break; } } if (empty($aResults['langs'])) { $aResults['langs'] = '_adm_txt_langs_success_delete'; } } else { if (isset($_GET['action']) && $_GET['action'] == 'export' && isset($_GET['id'])) { $aLanguage = $GLOBALS['MySQL']->getRow("SELECT `Name`, `Flag`, `Title`, `Direction`, `LanguageCountry` FROM `sys_localization_languages` WHERE `ID`= ? LIMIT 1", [$_GET['id']]);
</head> <body> <div id="installer-box"> <h2><?php echo installer_t('Installation Page'); ?></h2> <?php echo installer_t('Welcome to the X2Engine application installer! We need to collect a little information before we can get your application up and running. Please fill out the fields listed below.'); ?> <div class="wide form" id="install-form"> <form name="install" action="initialize.php" method="POST" onSubmit="return validate(this);"> <h2><?php echo installer_t('X2Engine Application Info'); ?></h2><hr> <div class="row"><label for="app"><?php echo installer_t('Application Name'); ?></label><input type="text" name="app" id="app" value="X2Engine" /></div> <div class="row"><label for="lang"><?php echo installer_t('Default Language'); ?></label> <select name="lang" id="lang" onChange="changeLang(this.options[this.selectedIndex].value);"><option value="">English</option> <?php foreach ($languageDirs as $code) { // generate language dropdown $languageName = getLanguageName($code); // lookup language name if($languageName!==false) { $selected = ($code == $_GET['lang'])? ' selected' : ''; // mark option selected if user has chosen this language echo " <option value=\"$code\"$selected>$languageName</option>\n"; // list all available languages } } // flag images are public domain from http://www.famfamfam.com/lab/icons/flags $flagUrl = file_exists("images/flags/$lang.png")? "images/flags/$lang.png" : "images/flags/us.png"; echo '</select> <img src="'.$flagUrl.'">'; ?></div> <div class="row"><label for="currency"><?php echo installer_t('Currency'); ?></label> <select name="currency" id="currency"> <option value="USD" selected="selected">USD</option> <option value="EUR">EUR</option>
function getAllSupportedLanguages() { $i18n_folder = dirname(__FILE__) . '/../i18n'; $directories = glob($i18n_folder . '/*', GLOB_ONLYDIR); $directories = scandir($i18n_folder); $lang = array(array("code" => "en", "name" => T_("English"))); foreach ($directories as $dir) { if ($dir != ".." && $dir != ".") { if (is_dir($i18n_folder . '/' . $dir)) { $lang[] = array("code" => $dir, "name" => getLanguageName($dir)); } } } return $lang; }