Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.45 KB | None | 0 0
  1. if(!is_null($deco['creators']))
  2. {
  3. $director = array();
  4. $actor = array();
  5. $producer = array();
  6. $voice_director = array();
  7. $voice = array();
  8. $writer = array();
  9. $operator = array();
  10. $composer = array();
  11. $design = array();
  12. $editor = array();
  13.  
  14. foreach($deco['creators'] as $key => $value)
  15. {
  16. if(!is_null($value) && $key == 'director')
  17. {
  18. for($i = 0, $k = 0; $i < count($value); $i ++)
  19. {
  20. if($k > 9) break;
  21. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  22. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  23. $director[] = $title_;
  24. $k ++;
  25. }
  26. }
  27. if(!is_null($value) && $key == 'actor')
  28. {
  29. for($i = 0, $k = 0; $i < count($value); $i ++)
  30. {
  31. if($k > 9) break;
  32. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  33. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  34. $actor[] = $title_;
  35. $k ++;
  36. }
  37. }
  38. if(!is_null($value) && $key == 'producer')
  39. {
  40. for($i = 0, $k = 0; $i < count($value); $i ++)
  41. {
  42. if($k > 9) break;
  43. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  44. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  45. $producer[] = $title_;
  46. $k ++;
  47. }
  48. }
  49. if(!is_null($value) && $key == 'voice_director')
  50. {
  51. for($i = 0, $k = 0; $i < count($value); $i ++)
  52. {
  53. if($k > 9) break;
  54. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  55. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  56. $voice_director[] = $title_;
  57. $k ++;
  58. }
  59. }
  60. if(!is_null($value) && $key == 'voice')
  61. {
  62. for($i = 0, $k = 0; $i < count($value); $i ++)
  63. {
  64. if($k > 9) break;
  65. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  66. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  67. $voice[] = $title_;
  68. $k ++;
  69. }
  70. }
  71. if(!is_null($value) && $key == 'writer')
  72. {
  73. for($i = 0, $k = 0; $i < count($value); $i ++)
  74. {
  75. if($k > 9) break;
  76. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  77. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  78. $writer[] = $title_;
  79. $k ++;
  80. }
  81. }
  82. if(!is_null($value) && $key == 'operator')
  83. {
  84. for($i = 0, $k = 0; $i < count($value); $i ++)
  85. {
  86. if($k > 9) break;
  87. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  88. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  89. $operator[] = $title_;
  90. $k ++;
  91. }
  92. }
  93. if(!is_null($value) && $key == 'composer')
  94. {
  95. for($i = 0, $k = 0; $i < count($value); $i ++)
  96. {
  97. if($k > 9) break;
  98. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  99. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  100. $composer[] = $title_;
  101. $k ++;
  102. }
  103. }
  104. if(!is_null($value) && $key == 'design')
  105. {
  106. for($i = 0, $k = 0; $i < count($value); $i ++)
  107. {
  108. if($k > 9) break;
  109. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  110. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  111. $design[] = $title_;
  112. $k ++;
  113. }
  114. }
  115. if(!is_null($value) && $key == 'editor')
  116. {
  117. for($i = 0, $k = 0; $i < count($value); $i ++)
  118. {
  119. if($k > 9) break;
  120. if(is_null($value[$i]['name_person_ru']) && is_null($value[$i]['name_person_en'])) continue;
  121. if(is_null($value[$i]['name_person_ru'])) $title_ = $value[$i]['name_person_en']; else $title_ = $value[$i]['name_person_ru'];
  122. $editor[] = $title_;
  123. $k ++;
  124. }
  125. }
  126. }
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement