Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

functions.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. if (!function_exists('debug')) {
  3. function debug($structure=null, $html=true) {
  4. global $config;
  5. if ($config['settings']['debug']) {
  6. $nl = !$html ? "\n" : "<br>";
  7. if (is_array($structure) || is_object($structure)) {
  8. if (!$html) {
  9. print "\n"; print_r($structure);
  10. } else {
  11. print '<pre>'; print_r($structure); print '</pre>';
  12. }
  13. return;
  14. }
  15. if (is_bool($structure)) {
  16. echo $structure === true ? "\n".'Bool: true'.$nl : "\n".'Bool: false'.$nl;
  17. return;
  18. }
  19. if (is_numeric($structure)) {
  20. echo "\n".'Numeric: ', $structure.$nl;
  21. return;
  22. }
  23. if (is_string($structure)) {
  24. echo "\n".'String: ', $structure.$nl;
  25. return;
  26. }
  27. if (is_null($structure)) {
  28. echo "null\n";
  29. return;
  30. }
  31. echo "\n".$structure;
  32. } else {
  33. return null;
  34. }
  35. } //function
  36. } //if
  37. function _t($textId) {
  38. //return utf8_encode(_($textId));
  39. }
  40. function leadingZeros($number) {
  41. return (int)$number<10 ? "0$number" : $number;
  42. }
  43. function optionSelected($value) {
  44. if ($value === true) return 'selected="selected"';
  45. return null;
  46. }