-
Notifications
You must be signed in to change notification settings - Fork 9
/
watch.php
162 lines (138 loc) · 5.87 KB
/
watch.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
<?php
require('inc/lang.inc.php');
require('inc/functions.inc.php');
// File to watch/DL and it extention
$file = htmlspecialchars($_GET['file']);
$ext = get_file_icon(basename($file),TRUE);
// Get the next and the previous video file if current file is a video too
if($ext == "avi"):
$listof_dir = array(); // Global used by get_nextnprev
$nextnprev = get_nextnprev($file);
$prev = $nextnprev['prev'];
$next = $nextnprev['next'];
else:
$prev = NULL;
$next = NULL;
endif;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="robots" content="noindex" />
<title>CakeBox - <?php echo $lang[LOCAL_LANG]['watch_title']; ?></title>
<meta charset="utf-8">
<!-- Style & ergo -->
<link href='http://fonts.googleapis.com/css?family=Changa+One|Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="ressources/style.css" type="text/css" media="screen">
<link rel="stylesheet" href="ressources/reset.css" type="text/css" media="screen">
<link rel="stylesheet" href="ressources/tooltips.css" type="text/css" media="screen" />
<!-- / Style & ergo -->
<!-- VLC Controls -->
<script language="javascript" src="ressources/jquery.min.js"></script>
<script language="javascript" src="ressources/jquery-vlc.js"></script>
<link rel="stylesheet" type="text/css" href="ressources/vlc-styles.css" />
<script language="javascript">
function play(instance, uri) {
VLCobject.getInstance(instance).play(uri);
}
var player = null;
$(document).ready(function() {
player = VLCobject.embedPlayer('vlc1', 600, 400, true);
});
</script>
<!-- / VLC Controls -->
<script lang="javascript">
var lang_ok_unmark = '<?php echo $lang[LOCAL_LANG]['ok_unmark']; ?>';
var lang_ok_mark = '<?php echo $lang[LOCAL_LANG]['ok_mark']; ?>';
</script>
<script src="ressources/oXHR.js"></script>
</head>
<body onload="play('vlc1', '<?php echo $file; ?>')">
<!-- HEADER -->
<header>
<div id="logo">
<a href="index.php">
<span class="first">Cake</span>
<span class="second">Box</span>
</a>
</div>
<div id="flattr">
<a href="http://flattr.com/thing/811178/Cakebox-votre-nouvelle-tele" target="_blank">
<?php echo $lang[LOCAL_LANG]['support_us']; ?> <span class="cakebox">Cakebox</span> <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /> <span class="coeur">♥</span>
</a>
</div>
</header>
<!-- / HEADER -->
<!-- CONTENT -->
<section id="content">
<h2><?php echo ustr_replace(LOCAL_DL_PATH."/","",$file ); ?></h2>
<?php
// If it's a video file
if($ext == "avi"):
?>
<div id="popcorn" class="littleh2">
<?php
// If file is not marked as "already seen"
if(!file_exists("data/".basename($file))):
?>
<?php echo $lang[LOCAL_LANG]['have_you_finished']; ?>
<span class="mark" onclick="markfile('<?php echo basename($file); ?>');"><?php echo $lang[LOCAL_LANG]['click_remind']; ?></span>
<a href="#" class="update_info" style="text-decoration: underline;"><?php echo $lang[LOCAL_LANG]['what_zat']; ?>
<span class="tooltip">
<span></span>
<?php echo $lang[LOCAL_LANG]['popcorn_details']; ?>
</span>
</a>
<?php
else:
?>
Hey, <span class="unmark"><?php echo $lang[LOCAL_LANG]['do_you_remember']; ?></span>
<span class="update_info" style="text-decoration: underline;cursor:pointer;" onclick="unmarkfile('<?php echo basename($file); ?>')"><?php echo $lang[LOCAL_LANG]['cancel_please']; ?></span>
<?php
endif;
?>
</div>
<hr class="clear" />
<p style="text-align:center;margin-bottom:10px;">
<a href="https://github.com/MardamBeyK/Cakebox/wiki/Impossible-de-lire-une-vid%C3%A9o-en-streaming" target="_blank" class="help"><?php echo $lang[LOCAL_LANG]['help_watching']; ?></a>
</p>
<center>
<!-- Embed VLC -->
<div id="vlc1" style="margin-bottom:50px;">player 1</div>
<!-- / VLC -->
<?php
// Show the "previous" and "next" link under the player
if($prev != NULL):
echo '<div style="margin:40px 0px 10px 0px;">';
echo '<a href="watch.php?file='.$prev.'" class="next_episode">';
echo "← ".$lang[LOCAL_LANG]['watch_previous'];
echo '</a></div>';
endif;
if($next != NULL):
echo '<div style="margin:10px 0px 40px 0px;padding-left:30px;">';
echo '<a href="watch.php?file='.$next.'" class="next_episode">';
echo $lang[LOCAL_LANG]['watch_next']." →";
echo '</a></div>';
endif;
?>
</center>
<?php endif; ?>
<div class="download_button">
<a href="<?php echo $file; ?>">
<img src="ressources/downloadfile.png" />
</a><br/>
<?php echo $lang[LOCAL_LANG]['right_click']; ?><br/>
<strong><?php echo $lang[LOCAL_LANG]['size']; ?></strong> <?php echo convert_size(filesize($file)); ?>
</div>
<br />
<br />
</section>
<!-- / CONTENT -->
<!-- FOOTER -->
<footer>
<div class="padding">
</div>
</footer>
<!-- / FOOTER -->
</body>
</html>