-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
66 lines (56 loc) · 1.72 KB
/
index.php
File metadata and controls
66 lines (56 loc) · 1.72 KB
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
<?php
require_once("includes/common.php");
$data=json_decode(file_get_contents(PLEX_REPORT_URL.'/plex-data/data.json'), TRUE);
$new_movies = (array)$data['movies'];
$new_shows = (array)$data['shows'];
$html_template = file_get_contents("templates/template.php");
$shows_template = file_get_contents("templates/shows.php");
$movies_template = file_get_contents("templates/movies.php");
if(count($new_movies)>0){
foreach($new_movies as $key => $movie){
$movies_html.= $Core->replaceMappings($movies_template, $movie);
}
}else{
$movies_html = '
<tr>
<td style="padding-bottom: 30px;">
<table role="presentation" border="2" cellpadding="10" cellspacing="0" width="100%" class="bg_light">
<td valign="middle">
<div class="text-blog" style="text-align: center;">
<h2>No New Movies</h2>
</div>
</td>
</table>
</td>
</tr>
';
}
if(count($new_shows)>0){
foreach($new_shows as $key=>$show){
$shows_html.= $Core->replaceMappings($shows_template, $show);
}
}else{
$shows_html = '
<tr>
<td style="padding-bottom: 30px;">
<table role="presentation" border="2" cellpadding="10" cellspacing="0" width="100%" class="bg_light">
<td valign="middle">
<div class="text-blog" style="text-align: center;">
<h2>No New TV Shows</h2>
</div>
</td>
</table>
</td>
</tr>
';
}
$array_map = array(
'report_title'=>REPORT_TITLE,
'report_subtitle'=>REPORT_SUBTITLE,
'movies'=>$movies_html,
'shows'=>$shows_html,
'last_updated'=>$data['last_updated'],
'duration'=>$data['duration'],
);
$html = $Core->replaceMappings($html_template, $array_map);
echo $html;