1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
18:
19: use Xoops\Core\Handler\Factory;
20:
21: 22: 23: 24: 25: 26:
27: function xoops_getHandler($name, $optional = false)
28: {
29: $xoops = Xoops::getInstance();
30: $xoops->deprecated('xoops_getHandler(\'' . $name . '\') is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
31: $handler = Factory::newSpec()->scheme('kernel')->name($name)->optional((bool) $optional)->build();
32: return $handler;
33: }
34:
35: 36: 37: 38: 39: 40: 41:
42: function xoops_getModuleHandler($name = null, $module_dir = null, $optional = false)
43: {
44: $xoops = Xoops::getInstance();
45: $xoops->deprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
46: return $xoops->getModuleHandler($name, $module_dir, $optional);
47: }
48:
49: 50: 51: 52: 53: 54: 55: 56: 57:
58: function xoops_load($name, $type = 'core')
59: {
60: $xoops = Xoops::getInstance();
61: $xoops->deprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
62: return XoopsLoad::load($name, $type);
63: }
64:
65: 66: 67: 68: 69: 70: 71: 72: 73:
74: function xoops_loadLanguage($name, $domain = '', $language = null)
75: {
76: $xoops = Xoops::getInstance();
77: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
78: return $xoops->loadLanguage($name, $domain, $language);
79: }
80:
81: 82: 83: 84:
85: function xoops_getActiveModules()
86: {
87: $xoops = Xoops::getInstance();
88: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
89: return $xoops->getActiveModules();
90: }
91:
92: 93: 94: 95:
96: function xoops_setActiveModules()
97: {
98: $xoops = Xoops::getInstance();
99: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
100: return $xoops->setActiveModules();
101: }
102:
103: 104: 105: 106: 107:
108: function xoops_isActiveModule($dirname)
109: {
110: $xoops = Xoops::getInstance();
111: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
112: return $xoops->isActiveModule($dirname);
113: }
114:
115: 116: 117: 118: 119:
120: function xoops_header($closehead = true)
121: {
122: $xoops = Xoops::getInstance();
123: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
124: $xoops->simpleHeader($closehead);
125: }
126:
127: 128: 129: 130:
131: function xoops_footer()
132: {
133: $xoops = Xoops::getInstance();
134: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
135: $xoops->simpleFooter();
136: }
137:
138: 139: 140: 141: 142: 143:
144: function xoops_error($msg, $title = '')
145: {
146: $xoops = Xoops::getInstance();
147: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
148: echo $xoops->alert('error', $msg, $title);
149: }
150:
151: 152: 153: 154: 155: 156:
157: function xoops_result($msg, $title = '')
158: {
159: $xoops = Xoops::getInstance();
160: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
161: echo $xoops->alert('info', $msg, $title);
162: }
163:
164: 165: 166: 167: 168: 169: 170: 171: 172:
173: function xoops_confirm($hiddens, $action, $msg, $submit = '', $addtoken = true)
174: {
175: $xoops = Xoops::getInstance();
176: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
177: echo $xoops->confirm($hiddens, $action, $msg, $submit, $addtoken);
178: }
179:
180: 181: 182: 183: 184: 185:
186: function xoops_getUserTimestamp($time, $timeoffset = '')
187: {
188: $xoops = Xoops::getInstance();
189: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
190: return $xoops->getUserTimestamp($time, $timeoffset);
191: }
192:
193: 194: 195: 196: 197: 198: 199:
200: function formatTimestamp($time, $format = 'l', $timeoffset = '')
201: {
202: $xoops = Xoops::getInstance();
203: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
204: return XoopsLocale::formatTimestamp($time, $format, $timeoffset);
205: }
206:
207: 208: 209: 210: 211: 212:
213: function userTimeToServerTime($timestamp, $userTZ = null)
214: {
215: $xoops = Xoops::getInstance();
216: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
217: return $xoops->userTimeToServerTime($timestamp, $userTZ);
218: }
219:
220: 221: 222: 223:
224: function xoops_makepass()
225: {
226: $xoops = Xoops::getInstance();
227: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
228: return $xoops->makePass();
229: }
230:
231: 232: 233: 234: 235: 236:
237: function checkEmail($email, $antispam = false)
238: {
239: $xoops = Xoops::getInstance();
240: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
241: return $xoops->checkEmail($email, $antispam);
242: }
243:
244: 245: 246: 247: 248:
249: function formatURL($url)
250: {
251: $xoops = Xoops::getInstance();
252: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
253: return $xoops->formatURL($url);
254: }
255:
256: 257: 258: 259:
260: function xoops_getbanner()
261: {
262: $xoops = Xoops::getInstance();
263: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
264: return $xoops->getBanner();
265: }
266:
267: 268: 269: 270: 271: 272: 273: 274: 275:
276: function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false)
277: {
278: $xoops = Xoops::getInstance();
279: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
280: $xoops->redirect($url, $time, $message, $addredirect, $allowExternalLink);
281: }
282:
283: 284: 285: 286: 287:
288: function xoops_getenv($key)
289: {
290: $xoops = Xoops::getInstance();
291: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
292: return $xoops->getEnv($key);
293: }
294:
295: 296: 297: 298: 299:
300: function xoops_getcss($theme = '')
301: {
302: $xoops = Xoops::getInstance();
303: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
304: return $xoops->getCss($theme);
305: }
306:
307: 308: 309: 310:
311: function xoops_getMailer()
312: {
313: $xoops = Xoops::getInstance();
314: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
315: return $xoops->getMailer();
316: }
317:
318: 319: 320: 321: 322: 323:
324: function xoops_getrank($rank_id = 0, $posts = 0)
325: {
326: $xoops = Xoops::getInstance();
327: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
328: return $xoops->service('userrank')->getUserRank(['rank' => $rank_id, 'posts' => $posts, 'uid' => 0])->getValue();
329: }
330:
331: 332: 333: 334: 335: 336: 337: 338:
339: function xoops_substr($str, $start, $length, $trimmarker = '...')
340: {
341: $xoops = Xoops::getInstance();
342: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
343: return XoopsLocale::substr($str, $start, $length, $trimmarker);
344: }
345:
346: 347: 348: 349: 350:
351: function xoops_notification_deletebymodule($module_id)
352: {
353: $xoops = Xoops::getInstance();
354: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use Notifications module instead.');
355: }
356:
357: 358: 359: 360: 361:
362: function xoops_notification_deletebyuser($user_id)
363: {
364: $xoops = Xoops::getInstance();
365: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use Notifications module instead.');
366: }
367:
368: 369: 370: 371: 372: 373: 374:
375: function xoops_notification_deletebyitem($module_id, $category, $item_id)
376: {
377: $xoops = Xoops::getInstance();
378: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use Notifications module instead.');
379: }
380:
381: 382: 383: 384: 385: 386:
387: function xoops_comment_count($module_id, $item_id = null)
388: {
389: $xoops = Xoops::getInstance();
390: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use comments module instead.');
391: }
392:
393: 394: 395: 396: 397: 398:
399: function xoops_comment_delete($module_id, $item_id)
400: {
401: $xoops = Xoops::getInstance();
402: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. Use comments module instead.');
403: }
404:
405: 406: 407: 408: 409: 410: 411:
412: function xoops_groupperm_deletebymoditem($module_id, $perm_name, $item_id = null)
413: {
414: $xoops = Xoops::getInstance();
415: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
416: return $xoops->getHandlerGroupPermission()->deleteByModule($module_id, $perm_name, $item_id);
417: }
418:
419: 420: 421: 422: 423:
424: function xoops_utf8_encode(&$text)
425: {
426: $xoops = Xoops::getInstance();
427: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
428: XoopsLocale::utf8_encode($text);
429: }
430:
431: 432: 433: 434: 435:
436: function xoops_convert_encoding(&$text)
437: {
438: $xoops = Xoops::getInstance();
439: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
440: XoopsLocale::utf8_encode($text);
441: }
442:
443: 444: 445: 446: 447:
448: function xoops_trim($text)
449: {
450: $xoops = Xoops::getInstance();
451: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
452: return XoopsLocale::trim($text);
453: }
454:
455: 456: 457: 458: 459:
460: function xoops_getOption($option)
461: {
462: $xoops = Xoops::getInstance();
463: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
464: return $xoops->getOption($option);
465: }
466:
467: 468: 469: 470: 471: 472:
473: function xoops_getConfigOption($option, $type = 'XOOPS_CONF')
474: {
475: $xoops = Xoops::getInstance();
476: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
477: return $xoops->getConfig($option);
478: }
479:
480: 481: 482: 483: 484: 485:
486: function xoops_setConfigOption($option, $new = null)
487: {
488: $xoops = Xoops::getInstance();
489: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
490: $xoops->setConfig($option, $new);
491: }
492:
493: 494: 495: 496: 497: 498:
499: function xoops_getModuleOption($option, $dirname = '')
500: {
501: $xoops = Xoops::getInstance();
502: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
503: return $xoops->getModuleConfig($option, $dirname);
504: }
505:
506: 507: 508: 509: 510: 511:
512: function xoops_getBaseDomain($url, $debug = 0)
513: {
514: $xoops = Xoops::getInstance();
515: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
516: return $xoops->getBaseDomain($url);
517: }
518:
519: 520: 521: 522: 523:
524: function xoops_getUrlDomain($url)
525: {
526: $xoops = Xoops::getInstance();
527: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
528: return $xoops->getBaseDomain($url, true);
529: }
530:
531: 532: 533: 534: 535: 536: 537:
538: function xoops_template_touch($tpl_id, $clear_old = true)
539: {
540: $xoops = Xoops::getInstance();
541: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
542: return $xoops->templateTouch($tpl_id);
543: }
544:
545: 546: 547: 548: 549: 550:
551: function xoops_template_clear_module_cache($mid)
552: {
553: $xoops = Xoops::getInstance();
554: $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
555: $xoops->templateClearModuleCache($mid);
556: }
557:
558:
559:
560:
561: if (!function_exists('http_response_code')) {
562: 563: 564: 565: 566: 567: 568: 569: 570: 571:
572: function http_response_code($newcode = null)
573: {
574: static $code = 200;
575: if ($newcode !== null) {
576: header('X-PHP-Response-Code: '.$newcode, true, $newcode);
577: if (!headers_sent()) {
578: $code = $newcode;
579: }
580: }
581: return $code;
582: }
583: }
584:
585:
586: if (!defined('ENT_SUBSTITUTE')) {
587: define('ENT_SUBSTITUTE', 0);
588: }
589:
590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605:
606: function xhtmlspecialchars($string, $dummy_flags = 0, $dummy_encoding = '', $dummy_double_encode = true)
607: {
608: return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
609: }
610: