forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistCategories.php
174 lines (161 loc) · 7 KB
/
listCategories.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
?>
<!DOCTYPE html>
<html lang="<?php echo $config->getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle(['Categories']);
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
.categoryItem .categoryName {
position: absolute;
clear: both;
overflow: hidden;
bottom: 0;
left: 0;
padding: 10px 10px 10px calc( 20% + 20px);
width: 100%;
color: #fff;
background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1));
}
.categoryItem .panel-default{
position: relative;
}
.categoryItem img{
max-width: 20%;
position: absolute;
bottom: 10px;
left: 10px;
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.categoryItem:hover img {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
.categoryItem>div{
background-size: cover;
box-shadow: 0 1px 2px rgba(0,0,0,0.15);
transition: box-shadow 0.3s ease-in-out;
}
.categoryItem:hover>div{
-webkit-animation: zoomin 0.3s linear;
animation: zoomin 0.3s linear;
animation-fill-mode: forwards;
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
@-webkit-keyframes zoomin {
0% {
-webkit-transform: scale(1);
transform: scale(1);
}
100% {
-webkit-transform: scale(1.05);
transform: scale(1.05);
}
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<br>
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="row">
<?php
$_GET['parentsOnly'] = 1;
$categories = Category::getAllCategories(false, true);
//var_dump(count($categories));
foreach ($categories as $value) {
if (!empty($value['parentId'])) {
//var_dump("<br> 1 {$value['name']}");
continue;
}
if ($advancedCustom->ShowAllVideosOnCategory) {
$total = $value['fullTotal'];
} else {
$total = $value['total'];
}
if (empty($total)) {
//var_dump("<br> 2 {$value['name']}");
continue;
}
if (!empty($value['fullTotal_videos'])) {
$video = Category::getLatestVideoFromCategory($value['id'], true, true);
$images = Video::getImageFromID($video['id']);
$image = $images->poster;
} elseif (!empty($value['fullTotal_lives'])) {
$live = Category::getLatestLiveFromCategory($value['id'], true, true);
$image = Live::getImage($live['users_id'], $live['live_servers_id']);
} elseif (!empty($value['fullTotal_livelinks'])) {
$liveLinks = Category::getLatestLiveLinksFromCategory($value['id'], true, true);
$image = LiveLinks::getImage($liveLinks['id']);
}
$totalVideosOnChilds = Category::getTotalFromChildCategory($value['id']);
$childs = Category::getChildCategories($value['id']);
$photo = Category::getCategoryPhotoPath($value['id']);
$photoBg = Category::getCategoryBackgroundPath($value['id']);
$link = $global['webSiteRootURL'] . 'cat/' . $value['clean_name'];
$imageNotFound = preg_match('/notfound/i', $image);
$photoNotFound = empty($photo) || preg_match('/notfound/i', $photo['url']);
$icon = '<i class="' . (empty($value['iconClass']) ? "fa fa-folder" : $value['iconClass']) . '"></i> ' ;
if (!$imageNotFound) {
?>
<style>
.categoryItem<?php echo $value['id']; ?>>div{
background-image: url(<?php echo $image; ?>);
}
</style>
<?php
}
if ($photoNotFound || !Category::isAssetsValids($value['id'])) {
?>
<style>
.categoryItem<?php echo $value['id']; ?> img{
display: none;
}
.categoryItem<?php echo $value['id']; ?> .categoryName {
padding-left: 10px ;
}
</style>
<?php
} ?>
<a href="<?php echo $link; ?>">
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 categoryItem categoryItem<?php echo $value['id']; ?>" >
<div class="panel panel-default embed-responsive embed-responsive-16by9 ">
<div class="panel-body ">
<?php
//var_dump($images, $totalVideosOnChilds['total'], $value['name'], $value['fullTotal']);
?>
<div class="categoryName">
<?php echo $icon, ' ', $value['name']; ?>
</div>
<img src="<?php echo $photo['url+timestamp']; ?>" class=" img img-responsive" />
</div>
</div>
</div>
</a>
<?php
}
?>
</div>
</div><!--/.container-->
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
$(document).ready(function () {
});
</script>
</body>
</html>
<?php
include $global['systemRootPath'].'objects/include_end.php';