forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchannels.php
164 lines (151 loc) · 6.75 KB
/
channels.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
<?php
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/Channel.php';
require_once $global['systemRootPath'] . 'objects/subscribe.php';
require_once $global['systemRootPath'] . 'objects/video.php';
if (isset($_SESSION['channelName'])) {
_session_start();
unset($_SESSION['channelName']);
}
$totalChannels = Channel::getTotalChannels();
if (!empty($_GET['page'])) {
$_POST['current'] = intval($_GET['page']);
} else {
$_POST['current'] = 1;
}
$current = $_POST['current'];
$_POST['rowCount'] = 10;
$channels = Channel::getChannels();
$totalPages = ceil($totalChannels / $_POST['rowCount']);
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: <?php echo __("Channels"); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
#custom-search-input{
padding: 3px;
border: solid 1px #E4E4E4;
border-radius: 6px;
background-color: #fff;
}
#custom-search-input input{
border: 0;
box-shadow: none;
}
#custom-search-input button{
margin: 2px 0 0 0;
background: none;
box-shadow: none;
border: 0;
color: #666666;
padding: 0 8px 0 10px;
border-left: solid 1px #ccc;
}
#custom-search-input button:hover{
border: 0;
box-shadow: none;
border-left: solid 1px #ccc;
}
#custom-search-input .glyphicon-search{
font-size: 23px;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container">
<div class="panel" >
<div class="panel-heading">
<form id="search-form" name="search-form" action="<?php echo $global['webSiteRootURL']; ?>channels" method="get">
<div id="custom-search-input">
<div class="input-group col-md-12">
<input type="search" name="searchPhrase" class="form-control input-lg" placeholder="<?php echo __("Search Channels"); ?>" value="<?php echo $_GET['searchPhrase']; unsetSearch(); ?>" />
<span class="input-group-btn">
<button class="btn btn-info btn-lg" type="submit">
<i class="glyphicon glyphicon-search"></i>
</button>
</span>
</div>
</div>
</form>
</div>
<div class="panel-body" >
<ul class="pages">
</ul>
<?php
foreach ($channels as $value) {
$get = array('channelName' => $value['channelName']);
?>
<div class=" bgWhite clear clearfix" style="margin: 10px 0;">
<div class="clear clearfix">
<img src="<?php echo User::getPhoto($value['id']); ?>"
class="img img-thumbnail img-responsive pull-left" style="max-height: 100px; margin: 0 10px;" />
<a href="<?php echo User::getChannelLink($value['id']); ?>" class="btn btn-default">
<i class="fas fa-play-circle"></i>
<?php
echo User::getNameIdentificationById($value['id']);
?>
</a>
<span class="pull-right">
<?php echo Subscribe::getButton($value['id']); ?>
</span>
<div>
<?php echo stripslashes(str_replace('\\\\\\\n', '<br/>', $value['about'])); ?>
</div>
</div>
<div class="clear clearfix">
<h2><?php echo __("Preview"); ?></h2>
<?php
$_POST['current'] = 1;
$_POST['rowCount'] = 6;
$_POST['sort']['created'] = "DESC";
$uploadedVideos = Video::getAllVideosAsync("viewable", $value['id']);
foreach ($uploadedVideos as $value2) {
$imgs = Video::getImageFromFilename($value2['filename'], "video", true);
$poster = $imgs->thumbsJpg;
?>
<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6 ">
<a href="<?php echo Video::getLink($value2['id'], $value2['clean_title'], false, $get); ?>" title="<?php echo $value2['title']; ?>" >
<img src="<?php echo $poster; ?>" alt="<?php echo $value2['title']; ?>" class="img img-responsive img-thumbnail" />
</a>
<div class="text-muted" style="font-size: 0.8em;"><?php echo $value2['title']; ?></div>
</div>
<?php
}
?>
</div>
</div>
<?php
}
?>
<ul class="pages">
</ul>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
$(function () {
$('.pages').bootpag({
total: <?php echo $totalPages; ?>,
page: <?php echo $current; ?>,
maxVisible: 10
}).on('page', function (event, num) {
document.location = "<?php echo $global['webSiteRootURL']; ?>channels?page=" + num;
});
});
</script>
</body>
</html>