1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Moved old functions out of class2.php.

This commit is contained in:
Cameron
2020-12-25 14:57:53 -08:00
parent d890163836
commit 84a3e45e48
5 changed files with 117 additions and 150 deletions

View File

@@ -287,6 +287,108 @@ function echo_gzipped_page()
}
/**
* @deprecated but necessary. BC Fix.
* @return string
*/
function getip()
{
trigger_error('<b>getip() is deprecated.</b> Use e107::getIPHandler()->ipDecode(USERIP) instead.', E_USER_DEPRECATED); // NO LAN
return e107::getIPHandler()->ipDecode(USERIP);
}
/**
* @deprecated - use e107::loadLanFiles();
* @param $unitName
* @param string $type
* @return bool|string
* Routine looks in standard paths for language files associated with a plugin or theme - primarily for core routines, which won't know
* for sure where the author has put them.
* $unitName is the name (directory path) of the plugin or theme
* $type determines what is to be loaded:
* 'runtime' - the standard runtime language file for a plugin
* 'admin' - the standard admin language file for a plugin
* 'theme' - the standard language file for a plugin (these are usually pretty small, so one is enough)
* Otherwise, $type is treated as part of a filename within the plugin's language directory, prefixed with the current language
* Returns false on failure (not found).
* Returns the include_once error return if there is one
* Otherwise returns an empty string.
*
* Note - if the code knows precisely where the language file is located, use include_lan()
*
* $pref['noLanguageSubs'] can be set true to prevent searching for the English files if the files for the current site language don't exist.
*/
function loadLanFiles($unitName, $type='runtime')
{
trigger_error('<b>loadLanFiles() is deprecated.</b> Use e107::loadLanFiles() instead.', E_USER_DEPRECATED); // NO LAN
$info = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2);
e107::getMessage()->addDebug("Using deprecated function loanLanFiles(). Replace with e107::loadLanFiles().".print_a($info,true));
return e107::loadLanFiles($unitName, $type);
}
/**
* @deprecated Use ini_set() directly.
* @param $var
* @param $value
* @return false|string
*/
function e107_ini_set($var, $value)
{
trigger_error('<b>e107_ini_set() is deprecated.</b> Use ini_set() instead.', E_USER_DEPRECATED); // NO LAN
if (function_exists('ini_set'))
{
return ini_set($var, $value);
}
return false;
}
/**
* @deprecated - use e107::isInstalled();
* @param $plugname
* @return bool
*/
function plugInstalled($plugname)
{
trigger_error('<b>plugInstalled() is deprecated.</b> Use <e107::isInstalled() instead.', E_USER_DEPRECATED); // NO LAN
return e107::isInstalled($plugname);
/*global $pref;
// Could add more checks here later if appropriate
return isset($pref['plug_installed'][$plugname]);*/
}
/*
// -----------------------------------------------------------------------------
function table_exists($check)
{
if (!$GLOBALS['mySQLtablelist'])
{
$tablist=mysql_list_tables($GLOBALS['mySQLdefaultdb']);
while (list($temp) = mysql_fetch_array($tablist))
{
$GLOBALS['mySQLtablelist'][] = $temp;
}
}
$mltable=MPREFIX.strtolower($check);
foreach ($GLOBALS['mySQLtablelist'] as $lang)
{
if (strpos($lang, $mltable) !== false)
{
return true;
}
}
}
*/
// Better Array-sort by key function by acecream (22-Apr-2003 11:02) http://php.net/manual/en/function.asort.php
if (!function_exists('asortbyindex'))