-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
153 lines (146 loc) · 4.32 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!doctype html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/mypixeland.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/search.css">
<link rel="stylesheet" href="appmy.min.css">
<link rel="stylesheet" href="glide.core.min.css">
<?php
// YOU CAN CHANGE YOUR BUTTON STYLE
?>
<style>
:root {
--primary-color: #00bcd4;
--accent-color: #f50057;
--text-color: #263238;
--body-color: #fff;
--main-font: 'roboto';
--font-bold: 700;
--font-regular: 400;
}
* { box-sizing: border-box }
body {
color: var(--text-color);
background-color: var(--body-color);
font-family: var(--main-font), Arial;
font-weight: var(--font-regular);
}
main{
display: content;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100vw;
height: 50px;
padding-left: 5%;
padding-right: 5%;
}
h1 { font-weight: var(--font-bold) }
input,
button {
border: none;
background: none;
outline: 0;
}
button {cursor: pointer}
.SearchBox-input::placeholder {/* No es un seudoelemento estandar */
color:white;
opacity: .6;
}
/* Chrome, Opera ySafari */
.SearchBox-input::-webkit-input-placeholder {
color: white;
}
/* Firefox 19+ */
.SearchBox-input::-moz-placeholder {
color: white;
}
/* IE 10+ y Edge */
.SearchBox-input:-ms-input-placeholder {
color: white;
}
/* Firefox 18- */
#formGroupExampleInput:-moz-placeholder {
color: white;
}
.SearchBox {
--height: 4em;
display: flex;
border-radius: var(--height);
background-color: var(--primary-color);
height: var(--height);
}
.SearchBox:hover .SearchBox-input {
padding-left: 2em;
padding-right: 1em;
width: 240px;
}
.SearchBox-input {
width: 350px;
font-size: 1.2em;
padding-left: 20px;
color: #fff;
transition: .45s;
}
.SearchBox-button {
display: flex;
border-radius: 50%;
width: var(--height);
height: var(--height);
background-color: var(--accent-color);
transition: .3s;
}
.SearchBox-icon {
margin: auto;
color: #fff;
margin-right: 10px;
}
@media screen and (min-width: 320px){
.SearchBox:hover .SearchBox-input {
width: 100%;
}
}
</style>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<br>
<main>
<form>
<div class="SearchBox">
<input type="text" class="SearchBox-input" name="cinemapress" placeholder="SEARCH MOVIES, TV SHOWS OR PEOPLE">
<i class="SearchBox-icon material-icons">search</i>
</div>
</form>
</main>
<?php
include ('api.php');
$input_line = $_SERVER['QUERY_STRING'];
$buscar = array ('', 'cinemapress=', 'buscar=', ' ', 'Á', 'á', 'É', 'é', 'Í', 'í', 'Ó', 'ó', 'Ú', 'ú', 'ç', 'ã', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
$mudar = array ('', '', '', '-', 'a', 'a', 'e', 'e', 'i', 'i', 'o', 'o', 'u', 'u', 'c', 'a', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
preg_match("/([0-9]+)\/?/", $input_line, $output_array);
$infogeral = 'https://api.themoviedb.org/3/search/multi?api_key='. $api . '&query=' . str_replace($buscar, $mudar, $input_line) . '&include_adult=false';
$jsondatageral= file_get_contents ($infogeral);
$datageral = json_decode($jsondatageral, true);
?>
<br>
<div class="mx-auto " align="center" >
<div class="rz-explore-listings">
<?php
foreach ($datageral['results'] as $resultado) {
if ( ($resultado['media_type']) == 'person') {
echo '<a href="' . 'us' . '/person/?'. $resultado['id'] . '/' . str_replace($buscar, $mudar, $resultado['name']) . '"><strong>' .$resultado['name'] . '</strong></a>';
echo ' in People ' ;
}
if ( ($resultado['media_type']) == 'tv') {
echo '<a href="' . 'us' . '/tv/?'. $resultado['id'] . '/' . str_replace($buscar, $mudar, $resultado['name']) . '">' .$resultado['name'] . '</a>';
echo ' in TV Shows - ' . date('Y', strtotime($resultado['first_air_date'])) ;
}
if ( ($resultado['media_type']) == 'movie') {
echo '<a href="' . 'us' . '/movie/?'. $resultado['id'] . '/' . str_replace($buscar, $mudar, $resultado['title']) . '">' . $resultado['title'] . '</a>';
echo ' in Movies - ' . date('Y', strtotime($resultado['release_date'])) ;
}
echo '<br>';
}
?>
</div>
</div>