28 $xoops->deprecated(
'xoops_getHandler(\'' .
$name .
'\') is deprecated. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
29 $method = 'getHandler
' . ucfirst(strtolower(trim($name)));
30 return $xoops->$method($optional);
40 function xoops_getModuleHandler($name = null, $module_dir = null, $optional = false)
42 $xoops = Xoops::getInstance();
43 $xoops->deprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
44 return $xoops->getModuleHandler($name, $module_dir, $optional);
53 function xoops_load($name, $type = 'core')
55 $xoops = Xoops::getInstance();
56 $xoops->deprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
57 return XoopsLoad::load($name, $type);
69 function xoops_loadLanguage($name, $domain = '', $language = null)
71 $xoops = Xoops::getInstance();
72 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
73 return $xoops->loadLanguage($name, $domain, $language);
80 function xoops_getActiveModules()
82 $xoops = Xoops::getInstance();
83 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
84 return $xoops->getActiveModules();
91 function xoops_setActiveModules()
93 $xoops = Xoops::getInstance();
94 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
95 return $xoops->setActiveModules();
103 function xoops_isActiveModule($dirname)
105 $xoops = Xoops::getInstance();
106 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
107 return $xoops->isActiveModule($dirname);
115 function xoops_header($closehead = true)
117 $xoops = Xoops::getInstance();
118 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
119 $xoops->simpleHeader($closehead);
126 function xoops_footer()
128 $xoops = Xoops::getInstance();
129 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
130 $xoops->simpleFooter();
139 function xoops_error($msg, $title = '')
141 $xoops = Xoops::getInstance();
142 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
143 echo $xoops->alert('error
', $msg, $title);
152 function xoops_result($msg, $title = '')
154 $xoops = Xoops::getInstance();
155 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
156 echo $xoops->alert('info
', $msg, $title);
168 function xoops_confirm($hiddens, $action, $msg, $submit = '', $addtoken = true)
170 $xoops = Xoops::getInstance();
171 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
172 echo $xoops->confirm($hiddens, $action, $msg, $submit, $addtoken);
181 function xoops_getUserTimestamp($time, $timeoffset = '')
183 $xoops = Xoops::getInstance();
184 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
185 return $xoops->getUserTimestamp($time, $timeoffset);
195 function formatTimestamp($time, $format = 'l
', $timeoffset = '')
197 $xoops = Xoops::getInstance();
198 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
199 return XoopsLocale::formatTimestamp($time, $format, $timeoffset);
208 function userTimeToServerTime($timestamp, $userTZ = null)
210 $xoops = Xoops::getInstance();
211 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
212 return $xoops->userTimeToServerTime($timestamp, $userTZ);
219 function xoops_makepass()
221 $xoops = Xoops::getInstance();
222 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
223 return $xoops->makePass();
232 function checkEmail($email, $antispam = false)
234 $xoops = Xoops::getInstance();
235 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
236 return $xoops->checkEmail($email, $antispam);
244 function formatURL($url)
246 $xoops = Xoops::getInstance();
247 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
248 return $xoops->formatURL($url);
255 function xoops_getbanner()
257 $xoops = Xoops::getInstance();
258 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
259 return $xoops->getBanner();
271 function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false)
273 $xoops = Xoops::getInstance();
274 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
275 $xoops->redirect($url, $time, $message, $addredirect, $allowExternalLink);
283 function xoops_getenv($key)
285 $xoops = Xoops::getInstance();
286 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
287 return $xoops->getEnv($key);
295 function xoops_getcss($theme = '')
297 $xoops = Xoops::getInstance();
298 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
299 return $xoops->getCss($theme);
306 function xoops_getMailer()
308 $xoops = Xoops::getInstance();
309 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
310 return $xoops->getMailer();
319 function xoops_getrank($rank_id = 0, $posts = 0)
321 $xoops = Xoops::getInstance();
322 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
323 return $xoops->getRank($rank_id, $posts);
334 function xoops_substr($str, $start, $length, $trimmarker = '...
')
336 $xoops = Xoops::getInstance();
337 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
338 return XoopsLocale::substr($str, $start, $length, $trimmarker);
346 function xoops_notification_deletebymodule($module_id)
348 $xoops = Xoops::getInstance();
349 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use
Notifications module instead.
');
357 function xoops_notification_deletebyuser($user_id)
359 $xoops = Xoops::getInstance();
360 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use
Notifications module instead.
');
370 function xoops_notification_deletebyitem($module_id, $category, $item_id)
372 $xoops = Xoops::getInstance();
373 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use
Notifications module instead.
');
382 function xoops_comment_count($module_id, $item_id = null)
384 $xoops = Xoops::getInstance();
385 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use
comments module instead.
');
394 function xoops_comment_delete($module_id, $item_id)
396 $xoops = Xoops::getInstance();
397 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use
comments module instead.
');
407 function xoops_groupperm_deletebymoditem($module_id, $perm_name, $item_id = null)
409 $xoops = Xoops::getInstance();
410 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
411 return $xoops->getHandlerGroupperm()->deleteByModule($module_id, $perm_name, $item_id);
419 function xoops_utf8_encode(&$text)
421 $xoops = Xoops::getInstance();
422 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
423 XoopsLocale::utf8_encode($text);
431 function xoops_convert_encoding(&$text)
433 $xoops = Xoops::getInstance();
434 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
435 XoopsLocale::utf8_encode($text);
443 function xoops_trim($text)
445 $xoops = Xoops::getInstance();
446 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
447 return XoopsLocale::trim($text);
455 function xoops_getOption($option)
457 $xoops = Xoops::getInstance();
458 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
459 return $xoops->getOption($option);
468 function xoops_getConfigOption($option, $type = 'XOOPS_CONF')
470 $xoops = Xoops::getInstance();
471 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
472 return $xoops->getConfig($option);
481 function xoops_setConfigOption($option, $new = null)
483 $xoops = Xoops::getInstance();
484 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
485 $xoops->setConfig($option, $new);
494 function xoops_getModuleOption($option, $dirname = '')
496 $xoops = Xoops::getInstance();
497 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
498 return $xoops->getModuleConfig($option, $dirname);
507 function xoops_getBaseDomain($url, $debug = 0)
509 $xoops = Xoops::getInstance();
510 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
511 return $xoops->getBaseDomain($url);
519 function xoops_getUrlDomain($url)
521 $xoops = Xoops::getInstance();
522 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
523 return $xoops->getBaseDomain($url, true);
533 function xoops_template_touch($tpl_id, $clear_old = true)
535 $xoops = Xoops::getInstance();
536 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
537 return $xoops->templateTouch($tpl_id);
546 function xoops_template_clear_module_cache($mid)
548 $xoops = Xoops::getInstance();
549 $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file
' . __FILE__ . ' line
' . __LINE__);
550 $xoops->templateClearModuleCache($mid);
554 // general php version compatibility functions
556 if (!function_exists('http_response_code
')) {
567 function http_response_code($newcode = null)
570 if ($newcode !== null) {
571 header('X-PHP-Response-Code:
'.$newcode, true, $newcode);
572 if (!headers_sent()) {
580 // ENT_SUBSTITUTE flag for htmlspecialchars() added in PHP 5.4
581 if (!defined('ENT_SUBSTITUTE
')) {
582 define('ENT_SUBSTITUTE
', 0);
601 function xhtmlspecialchars($string, $dummy_flags = 0, $dummy_encoding = '', $dummy_double_encode = true)
603 return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8
');
xoops_getHandler($name, $optional=false)