This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathshow.php
91 lines (72 loc) · 2.5 KB
/
show.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
<?php
if (!isset($perma)){
header("Location: $baseurl");
exit();
}
$perma = str_replace("/","",$perma);
$show_data = $show->getShowByPerma($perma, $language);
if (count($show_data)){
foreach($show_data as $show_id => $val){
extract($val);
$show_data[$show_id]['description'] = nl2br($val['description']);
$show_data[$show_id]['categories'] = $show->getShowCategories($show_id, true, $language);
$seodata['showtitle'] = $val['title'];
$seodata['title'] = $val['title'];
$seodata['description'] = $val['description'];
$smarty->assign("fb_image",$baseurl."/thumbs/".$show_data[$show_id]['thumbnail']);
$show_seasons = $show->getSeasons($show_id);
if (!count($show_seasons)) {
$show_seasons = '';
}
$smarty->assign("show_seasons",$show_seasons);
$show_title = $title;
}
if (!isset($season)){
$season = null;
}
if (isset($season) && $season){
$seodata['season'] = $season;
$smarty->assign("season",$season);
} else {
$smarty->assign("season","");
}
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();
}
$episodes = $show->getEpisodes($show_id,$season,$language);
if (count($episodes)){
foreach($episodes as $episode_id => $val){
extract($val);
$description = nl2br($description);
if (substr_count($description,"Airdate:")){
$tmp = explode("<br />",$description);
$description = $tmp[2];
}
$episodes[$episode_id]['description'] = $description;
$episodes[$episode_id]['perma'] = $perma;
if (in_array($episode_id,$seen)){
$episodes[$episode_id]['seen'] = 1;
} else {
$episodes[$episode_id]['seen'] = 0;
}
}
}
} else {
$show_data = '';
$episodes = '';
}
if ($global_settings['seo_links']){
$smarty->assign("fullurl",$baseurl."/".$routes['show']."/".$perma);
} else {
$smarty->assign("fullurl",$baseurl."/index.php?menu=show&perma=".$perma);
}
$smarty->assign("show_data",$show_data);
$smarty->assign("episodes",$episodes);
?>