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 pathmovies.php
68 lines (53 loc) · 1.57 KB
/
movies.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
<?php
if (!$global_settings['maxmoviesperpage']){
$maxperpage = 40;
} else {
$maxperpage = $global_settings['maxmoviesperpage'];
}
if (!isset($p)) $p = 1;
if (!isset($sortby)) $sortby = "date";
if ($maxperpage){
$count = $movie->getRealMovieCount();
$movielist = $movie->getRealMovies($language,$p,$maxperpage,$sortby);
if ($global_settings['seo_links']){
$pagination = $movie->getBasicPagination($count,$p,$maxperpage,$baseurl."/".$routes['movies']."/$sortby/");
} else {
$pagination = $movie->getBasicPagination($count,$p,$maxperpage,$baseurl."/index.php?menu=movies&sortby=$sortby&p=");
}
} else {
$movielist = $movie->getRealMovies($language);
if ($global_settings['seo_links']){
$pagination = '<a href="'.$baseurl.'/'.$routes['movies'].'">1</a>';
} else {
$pagination = '<a href="'.$baseurl.'/index.php?menu=movies">1</a>';
}
}
if (count($movielist)){
if ($logged){
$user = new User();
if (!isset($_SESSION['loggeduser_seen_movies'])){
$seen = $user->getSeenMovies(null,true);
} else {
$seen = $_SESSION['loggeduser_seen_movies'];
}
} else {
$seen = array();
}
foreach($movielist as $key => $val){
extract($val);
$description = nl2br(stripslashes($description));
$movielist[$key]['description']=$description;
$movielist[$key]['title']=stripslashes(stripslashes($title));
if (in_array($key,$seen)){
$movielist[$key]['seen'] = 1;
} else {
$movielist[$key]['seen'] = 0;
}
}
} else {
$movielist = '';
}
$smarty->assign("movielist",$movielist);
$smarty->assign("sortby",$sortby);
$smarty->assign("pagination",$pagination);
?>