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 pathmovie-tag.php
82 lines (67 loc) · 2.43 KB
/
movie-tag.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
<?php
if (isset($tag) && $tag){
if (isset($_REQUEST['p']) && $_REQUEST['p'] && is_numeric($_REQUEST['p'])){
$p = (int) $_REQUEST['p'];
} else {
$p = 1;
}
if (!$global_settings['maxmoviesperpage']){
$maxperpage = 40;
} else {
$maxperpage = $global_settings['maxmoviesperpage'];
}
$tag_perma = $tag;
$smarty->assign("tag_perma",$tag_perma);
$tag = $movie->getCategoryByPerma($tag_perma,$language);
if ($tag){
if (!isset($sortby)){
$sortby = "date";
}
$tag_id = $tag['id'];
$tag = $tag['tag'];
$category_count = $movie->getCategoryCount($tag_id);
if ($global_settings['seo_links']){
$pagination = $movie->getBasicPagination($category_count,$p,$maxperpage,$baseurl."/".$routes['movie_tag']."/".$tag_perma."/".$sortby."/");
} else {
$pagination = $movie->getBasicPagination($category_count,$p,$maxperpage,$baseurl."/index.php?menu=movie-tag&tag=$tag_perma&sortby=$sortby&p=");
}
$tagmovies = $movie->getMoviesByCategory($tag_id, $sortby, $language, $p, $maxperpage);
if (!count($tagmovies)){
$tagmovies = '';
} else {
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($tagmovies as $key => $val){
extract($val);
$description = nl2br(stripslashes($description));
$tagmovies[$key]['description']=$description;
$tagmovies[$key]['title']=stripslashes($title);
if (in_array($key,$seen)){
$tagmovies[$key]['seen'] = 1;
} else {
$tagmovies[$key]['seen'] = 0;
}
}
}
$smarty->assign("tagmovies",$tagmovies);
$smarty->assign("sortby",$sortby);
} else {
$tag = '';
$pagination = '';
}
} else {
$tag = '';
$pagination = '';
}
$seodata['category'] = $tag;
$smarty->assign("tag", $tag);
$smarty->assign("pagination", $pagination);
?>