function i18n_gallery_preview() { global $content; if (isset($_GET['preview-gallery'])) { if (function_exists('i18n_init')) { i18n_init(); } $content = htmlspecialchars("<p>(% gallery %)</p>"); } }
public static function redirectIfLink() { if (function_exists('return_custom_field')) { if (function_exists('i18n_init')) { i18n_init(); } if (function_exists('i18n_get_custom_fields')) { i18n_get_custom_fields(); } $link = return_custom_field('link'); if ($link) { header('Location: ' . $link); exit(0); } } }
function nm_frontend_init() { global $NMPAGEURL, $nmpagetype, $nmsingletag; if (function_exists('i18n_init')) { i18n_init(); } // I18N plugin $nmpagetype = array(); nm_i18n_merge(); if (strval(get_page_slug(false)) == $NMPAGEURL) { global $content, $metad; $metad_orig = $metad == '' ? ' ' : $metad; $metad = ' '; $nmpagetype[] = 'site'; ob_start(); echo PHP_EOL; if (isset($_POST['search'])) { nm_reset_options('search'); nm_show_search_results(); $nmpagetype[] = 'search'; } elseif (isset($_GET[NMPARAMARCHIVE])) { nm_reset_options('archive'); if (nm_show_archive($_GET[NMPARAMARCHIVE], false)) { $nmpagetype[] = 'archive'; } } elseif (isset($_GET[NMPARAMTAG])) { $tag = rawurldecode($_GET[NMPARAMTAG]); $result = false; nm_reset_options('tag'); if (nm_get_option('tagpagination')) { $index = isset($_GET[NMPARAMPAGE]) ? intval($_GET[NMPARAMPAGE]) : NMFIRSTPAGE; $result = nm_show_tag_page($tag, $index, false); } else { $result = nm_show_tag($tag, false); } if ($result) { $nmpagetype[] = 'tag'; $nmsingletag = $tag; } } elseif (isset($_GET[NMPARAMPOST])) { nm_reset_options('single'); if (nm_show_post($_GET[NMPARAMPOST], false, false, true)) { $nmpagetype[] = 'single'; if (nm_get_option('metakeywordstags')) { nm_update_meta_keywords(); } if (nm_get_option('autometad')) { $metad = nm_post_excerpt(150, null, false); } } } elseif (isset($_GET[NMPARAMPAGE]) && intval($_GET[NMPARAMPAGE]) > NMFIRSTPAGE) { nm_reset_options('main'); nm_show_page($_GET[NMPARAMPAGE], false); $nmpagetype[] = 'main'; } else { $metad = $metad_orig; nm_reset_options('main'); nm_show_page(NMFIRSTPAGE, false); array_push($nmpagetype, 'main', 'home'); } $content = nm_ob_get_content(false); $content = addslashes(htmlspecialchars($content, ENT_QUOTES, 'UTF-8')); if (nm_get_option('templatefile')) { nm_switch_template_file(nm_get_option('templatefile')); } } nm_update_page_title(); nm_reset_options(); }
$install_terminee = false; /* Prend le choix de langue de l'utilisateur, soit : * - lorsqu'il vient de changer la langue du sélecteur ($lang) * - lorsqu'il vient de lancer l'installeur ($install_changeLngLeed) */ $lang = ''; if (isset($_GET['lang'])) { $lang = $_GET['lang']; } elseif (isset($_POST['install_changeLngLeed'])) { $lang = $_POST['install_changeLngLeed']; } $installDirectory = dirname(__FILE__) . '/install'; if (empty($lang)) { $currentLanguage = i18n_init(Functions::getBrowserLanguages(), $installDirectory); } else { $currentLanguage = i18n_init($lang, $installDirectory); } $languageList = $i18n->languages; if (file_exists('constant.php')) { die(_t('ALREADY_INSTALLED')); } // Cookie de la session $cookiedir = ''; if (dirname($_SERVER['SCRIPT_NAME']) != '/') { $cookiedir = dirname($_SERVER["SCRIPT_NAME"]) . '/'; } session_set_cookie_params(0, $cookiedir); session_start(); // Protection des variables $_ = array_merge($_GET, $_POST); $whiteList = array('mysqlHost', 'mysqlLogin', 'mysqlMdp', 'mysqlBase', 'mysqlPrefix');
global $minimalRequiredPhpVersion; if (version_compare(phpversion(), $minimalRequiredPhpVersion) < 0) { add_action('admin_notices', 'PhpVersionCheck'); return false; } return true; } /** * Initialize internationalization (i18n) for this plugin. * References: * http://codex.wordpress.org/I18n_for_WordPress_Developers * http://www.wdmac.com/how-to-create-a-po-language-translation#more-631 * @return void */ function i18n_init() { $pluginDir = dirname(plugin_basename(__FILE__)); load_plugin_textdomain('wordwrap-elegant-slider', false, $pluginDir . '/languages/'); } ////////////////////////////////// // Run initialization ///////////////////////////////// // First initialize i18n i18n_init(); // Next, run the version check. // If it is successful, continue with initialization for this plugin if (PhpVersionCheck()) { // Only load and run the init function if we know PHP version can parse it include_once __DIR__ . '/../word-wrap/word-wrap.php'; WordWrap_init(basename(__DIR__)); }
function run($module) { $config = $this->config; if ($module != 'admin') { global $rewriteHandler; include_once './include/rewrite.php'; } require_once DRIVER_PATH . 'i18n.php'; i18n_init($config['language']); require_once LIB_PATH . 'config.han.php'; include_once CONFIG_PATH . 'robot.php'; require_once FUNCTION_PATH . 'common.func.php'; define('MY_QUERY_ERROR', 10); require_once CONFIG_PATH . 'constants.php'; require_once CONFIG_PATH . 'credits.php'; require_once FUNCTION_PATH . 'cache.func.php'; require_once FUNCTION_PATH . 'global.func.php'; require_once INCLUDE_PATH . 'load.php'; require_once LIB_PATH . 'http.han.php'; require_once LIB_PATH . 'template.han.php'; require_once LIB_PATH . 'form.han.php'; require_once DB_DRIVER_PATH . 'database.db.php'; require_once DB_DRIVER_PATH . "mysql.db.php"; require_once INCLUDE_PATH . 'constant.php'; require_once INCLUDE_PATH . 'engine.php'; require_once INCLUDE_PATH . 'extend.php'; require_once MOD_PATH . 'master.mod.php'; require_once MOD_PATH . $this->accessMod($config['default_module']) . '.mod.php'; $_GET = HttpHandler::checkVars($_GET); $_POST = HttpHandler::checkVars($_POST); $moduleobject = new ModuleObject($config); $module != 'inizd' && handler('member')->SaveActionToLog($moduleobject->Title); unset($moduleobject); }
<?php /* @nom: install @auteur: Idleman (idleman@idleman.fr) @description: Page d'installation du script (a supprimer après installation) */ require_once 'Functions.class.php'; require_once 'i18n.php'; global $i18n; $install_terminee = false; if (isset($_GET['lang'])) { $currentLanguage = i18n_init($_GET['lang']); } else { $currentLanguage = i18n_init(Functions::getBrowserLanguages()); } $languageList = $i18n->languages; if (file_exists('constant.php')) { die(_t('ALREADY_INSTALLED')); } // Cookie de la session $cookiedir = ''; if (dirname($_SERVER['SCRIPT_NAME']) != '/') { $cookiedir = dirname($_SERVER["SCRIPT_NAME"]) . '/'; } session_set_cookie_params(0, $cookiedir); session_start(); // Protection des variables $_ = array_merge($_GET, $_POST); $whiteList = array('mysqlHost', 'mysqlLogin', 'mysqlMdp', 'mysqlBase', 'mysqlPrefix'); foreach ($_ as $key => &$val) {
} elseif (defined('LANGAGE')) { $language = LANGAGE; } else { $language = Translation::DEFAULT_LANGUAGE; } $configurationManager->put('language', $language); } // Faut-il supprimer la variable /langu?age/ de 'constant.php'? $theme = $configurationManager->get('theme'); //Instanciation du template $tpl = new RainTPL(); //Definition des dossiers de template raintpl::configure("base_url", null); raintpl::configure("tpl_dir", './templates/' . $theme . '/'); raintpl::configure("cache_dir", "./cache/tmp/"); i18n_init($language, dirname(__FILE__) . '/templates/' . $theme . '/'); if ($resultUpdate) { die(_t('LEED_UPDATE_MESSAGE')); } $view = ''; $tpl->assign('myUser', $myUser); $tpl->assign('feedManager', $feedManager); $tpl->assign('eventManager', $eventManager); $tpl->assign('userManager', $userManager); $tpl->assign('folderManager', $folderManager); $tpl->assign('configurationManager', $configurationManager); $tpl->assign('synchronisationCode', $configurationManager->get('synchronisationCode')); //Récuperation et sécurisation de toutes les variables POST et GET $_ = array(); foreach ($_POST as $key => $val) { $_[$key] = Functions::secure($val, 2);
* On tente de récupérer une nouvelle session avec un jeton. */ $myUser = User::existAuthToken(); $_SESSION['currentUser'] = serialize($myUser); } $feedManager = new Feed(); $eventManager = new Event(); $folderManager = new Folder(); $configurationManager = new Configuration(); $conf = $configurationManager->getAll(); //Instanciation du template $tpl = new RainTPL(); //Definition des dossiers de template raintpl::configure("base_url", null); raintpl::configure("tpl_dir", './templates/' . DEFAULT_THEME . '/'); raintpl::configure("cache_dir", "./cache/tmp/"); i18n_init(LANGUAGE); if ($resultUpdate) { die(_t('LEED_UPDATE_MESSAGE')); } $view = ''; $tpl->assign('myUser', $myUser); $tpl->assign('feedManager', $feedManager); $tpl->assign('eventManager', $eventManager); $tpl->assign('userManager', $userManager); $tpl->assign('folderManager', $folderManager); $tpl->assign('configurationManager', $configurationManager); $tpl->assign('synchronisationCode', $configurationManager->get('synchronisationCode')); //Récuperation et sécurisation de toutes les variables POST et GET $_ = array(); foreach ($_POST as $key => $val) { $_[$key] = Functions::secure($val, 2);
function i18n_get_custom_fields() { global $customfields, $data_index, $data_index_orig; if ($customfields) { return; } if (function_exists('i18n_init')) { i18n_init(); // make sure that I18N is initialized if (isset($data_index_orig)) { i18n_get_custom_fields_from($data_index_orig); } } i18n_get_custom_fields_from($data_index); }