forked from kgnfth/tvstreamscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew-shows.php
48 lines (40 loc) · 1.17 KB
/
new-shows.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
<?php
if (!$global_settings['maxtvperpage']){
$maxperpage = 40;
} else {
$maxperpage = $global_settings['maxtvperpage'];
}
$episodes = $show->getRealLatestEpisodes($maxperpage,$language);
if (!count($episodes)){
$episodes = '';
} else {
if ($logged){
$user = new User();
if (!isset($_SESSION['loggeduser_seen_episodes'])){
$seen = $user->getSeenEpisodes(null,true);
} else {
$seen = $_SESSION['loggeduser_seen_episodes'];
}
} else {
$seen = array();
}
foreach($episodes as $key => $val){
extract($val);
$description = nl2br(stripslashes($description));
if (substr_count($description,"Airdate:")>0){
$tmp = explode("<br />",$description);
$description = $tmp[2];
}
$episodes[$key]['showtitle']=stripslashes($showtitle);
$episodes[$key]['title']=stripslashes(stripslashes($episodes[$key]['episodetitle']));
$episodes[$key]['showtitle']=stripslashes(stripslashes($episodes[$key]['showtitle']));
$episodes[$key]['description']=stripslashes(stripslashes($description));
if (in_array($episodes[$key]['epid'],$seen)){
$episodes[$key]['seen'] = 1;
} else {
$episodes[$key]['seen'] = 0;
}
}
}
$smarty->assign("episodes",$episodes);
?>