Guest User

Untitled

a guest
Nov 16th, 2015
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class Utils {
  15.  
  16. public function translateContentArray($content_array) {
  17. if (0 < strlen($content_array)) {
  18. $content_array = json_decode($content_array, true);
  19. foreach ($content_array as $key => $content) {
  20. $content_array[$content["id"]] = $content;
  21. unset($content_array[$key]);
  22. }
  23. }
  24. return $content_array;
  25. }
  26.  
  27.  
  28. public function getClassesByCityAndType($city, $type) {
  29. global $pdo;
  30. global $sb;
  31. $params = array(":city" => $city, ":class_type" => $type);
  32. $stmt = $pdo->prepare($sb->select("classes")->where("city", "=", ":city")->where("class_type", "=", ":class_type")->generate());
  33. $stmt->setFetchMode(PDO::FETCH_ASSOC);
  34. $stmt->execute($params);
  35. $classes = $stmt->fetchAll();
  36. return $classes;
  37. }
  38.  
  39.  
  40. public function getUrlById() {
  41. global $pdo;
  42. global $sb;
  43. $stmt = $pdo->prepare($sb->select("pages", "id,slug")->generate());
  44. $stmt->setFetchMode(PDO::FETCH_ASSOC);
  45. $stmt->execute();
  46. $pages = $stmt->fetchAll();
  47. return $this->idsToKey($pages);
  48. }
  49.  
  50.  
  51. public function getVideoPlayerBySource($source, $video_id, $width = "277", $height = "170") {
  52. switch ($source) {
  53. case "youtube":
  54. echo("<iframe src=\"http://www.youtube.com/embed/" . $video_id . "?theme=light&color=red&rel=0&modestbranding=1&showinfo=0\" frameborder=\"0\" width=\"" . $width . "\" height=\"" . $height . "\" allowfullscreen></iframe>");
  55. break;
  56.  
  57. case "vimeo":
  58. echo("<iframe src=\"//player.vimeo.com/video/" . $video_id . "\" width=\"" . $width . "\" height=\"" . $height . "\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>");
  59. break;
  60.  
  61. default:
  62. break;
  63.  
  64. }
  65. }
  66.  
  67.  
  68. public function normalizeChars($string, $underscore_spaces = true) {
  69. $normalizeChars = array("\xc5\xa0" => "S", "\xc5\xa1" => "s", "\xc3\x90" => "Dj", "\xc5\xbd" => "Z", "\xc5\xbe" => "z", "\xc3\x80" => "A", "\xc3\x81" => "A", "\xc3\x82" => "A", "\xc3\x83" => "A", "\xc3\x84" => "A", "\xc3\x85" => "A", "\xc3\x86" => "A", "\xc3\x87" => "C", "\xc3\x88" => "E", "\xc3\x89" => "E", "\xc3\x8a" => "E", "\xc3\x8b" => "E", "\xc3\x8c" => "I", "\xc3\x8d" => "I", "\xc3\x8e" => "I", "\xc3\x8f" => "I", "\xc3\x91" => "N", "\xc3\x92" => "O", "\xc3\x93" => "O", "\xc3\x94" => "O", "\xc3\x95" => "O", "\xc3\x96" => "O", "\xc3\x98" => "O", "\xc3\x99" => "U", "\xc3\x9a" => "U", "\xc3\x9b" => "U", "\xc3\x9c" => "U", "\xc3\x9d" => "Y", "\xc3\x9e" => "B", "\xc3\x9f" => "Ss", "\xc3\xa0" => "a", "\xc3\xa1" => "a", "\xc3\xa2" => "a", "\xc3\xa3" => "a", "\xc3\xa4" => "a", "\xc3\xa5" => "a", "\xc3\xa6" => "a", "\xc3\xa7" => "c", "\xc3\xa8" => "e", "\xc3\xa9" => "e", "\xc3\xaa" => "e", "\xc3\xab" => "e", "\xc3\xac" => "i", "\xc3\xad" => "i", "\xc3\xae" => "i", "\xc3\xaf" => "i", "\xc3\xb0" => "o", "\xc3\xb1" => "n", "\xc3\xb2" => "o", "\xc3\xb3" => "o", "\xc3\xb4" => "o", "\xc3\xb5" => "o", "\xc3\xb6" => "o", "\xc3\xb8" => "o", "\xc3\xb9" => "u", "\xc3\xba" => "u", "\xc3\xbb" => "u", "\xc3\xbd" => "y", "\xc3\xbd" => "y", "\xc3\xbe" => "b", "\xc3\xbf" => "y", "\xc6\x92" => "f");
  70. if ($underscore_spaces) {
  71. $normalizeChars[" "] = "_";
  72. }
  73. return strtr($string, $normalizeChars);
  74. }
  75.  
  76.  
  77. public function encodeSensitiveQuery($string) {
  78. return base64_encode($string);
  79. }
  80.  
  81.  
  82. public function decodeSensitiveQuery($string) {
  83. return base64_decode($string);
  84. }
  85. .............................................................................
  86. ...............................
  87. .........
Add Comment
Please, Sign In to add comment