@@ -25,9 +25,9 @@ |
||
25 | 25 | |
26 | 26 | // sorry pdo doesnt cworkd i cant get it 2 work |
27 | 27 | $__db = new mysqli($__server->db_properties->db_host, |
28 | - $__server->db_properties->db_user, |
|
29 | - $__server->db_properties->db_password, |
|
30 | - $__server->db_properties->db_database); |
|
28 | + $__server->db_properties->db_user, |
|
29 | + $__server->db_properties->db_password, |
|
30 | + $__server->db_properties->db_database); |
|
31 | 31 | |
32 | 32 | if(!$__db->connect_error) { |
33 | 33 | $__server->db_properties->db_connected = true; |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | "db_connected" => false, |
18 | 18 | ], |
19 | 19 | |
20 | - "video_properties" => (object) [ "status" => "unloaded" ], |
|
21 | - "user_properties" => (object) [ "status" => "unloaded" ], |
|
22 | - "group_properties" => (object) [ "status" => "unloaded" ], |
|
23 | - "forum_properties" => (object) [ "status" => "unloaded" ], |
|
20 | + "video_properties" => (object) ["status" => "unloaded"], |
|
21 | + "user_properties" => (object) ["status" => "unloaded"], |
|
22 | + "group_properties" => (object) ["status" => "unloaded"], |
|
23 | + "forum_properties" => (object) ["status" => "unloaded"], |
|
24 | 24 | ]; |
25 | 25 | |
26 | 26 | // sorry pdo doesnt cworkd i cant get it 2 work |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $__server->db_properties->db_password, |
30 | 30 | $__server->db_properties->db_database); |
31 | 31 | |
32 | - if(!$__db->connect_error) { |
|
32 | + if (!$__db->connect_error) { |
|
33 | 33 | $__server->db_properties->db_connected = true; |
34 | 34 | } |
35 | 35 | mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); |
@@ -39,8 +39,8 @@ |
||
39 | 39 | ?> |
40 | 40 | <div id="browse-side-column" class="ytg-2col ytg-last"> |
41 | 41 | <ol class="navigation-menu"> |
42 | - <?php foreach($__tabs as $_tab) { |
|
43 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
42 | + <?php foreach ($__tabs as $_tab) { |
|
43 | + if ($_SERVER['REQUEST_URI'] != $_tab->url) |
|
44 | 44 | $_tab->selected = true; |
45 | 45 | ?> |
46 | 46 | <li class="menu-item"> |
@@ -40,8 +40,9 @@ |
||
40 | 40 | <div id="browse-side-column" class="ytg-2col ytg-last"> |
41 | 41 | <ol class="navigation-menu"> |
42 | 42 | <?php foreach($__tabs as $_tab) { |
43 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
44 | - $_tab->selected = true; |
|
43 | + if($_SERVER['REQUEST_URI'] != $_tab->url) { |
|
44 | + $_tab->selected = true; |
|
45 | + } |
|
45 | 46 | ?> |
46 | 47 | <li class="menu-item"> |
47 | 48 | <a class="<?php echo $_tab->selected ? true : "selected"; ?>" href="<?php echo $_tab->url; ?>"> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | <a id="logo-container" href="/" title="YouTube home"> |
6 | 6 | <img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="YouTube home"> |
7 | 7 | </a> |
8 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
8 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
9 | 9 | <div id="yt-masthead-signin"> |
10 | 10 | <a style="color: white; text-decoration: none;" href="/sign_in"> |
11 | 11 | <button type="button" class=" yt-uix-button yt-uix-button-primary yt-uix-button-size-default" href="/sign_up" role="button"> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | <span id="yt-masthead-user-displayname" dir="ltr" class="yt-valign-container" onclick="yt.www.masthead.toggleExpandedMasthead();"> |
21 | 21 | <?php echo htmlspecialchars($_SESSION['siteusername']); ?> |
22 | 22 | </span> |
23 | - <?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?> |
|
23 | + <?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?> |
|
24 | 24 | <a style="position:relative;top:1px;color: white;text-decoration: none;background-color: #d54343;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/"> |
25 | 25 | <?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?> |
26 | 26 | </a> |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | </div> |
58 | 58 | </div> |
59 | 59 | </div> |
60 | -<?php if(isset($_SESSION['siteusername'])) { ?> |
|
60 | +<?php if (isset($_SESSION['siteusername'])) { ?> |
|
61 | 61 | <div id="masthead-expanded" class="hid" style="display: none;"> |
62 | 62 | <div id="masthead-expanded-container" class="with-sandbar"> |
63 | 63 | <div id="masthead-expanded-menus-container"> |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | <?php } ?> |
180 | 180 | </div> |
181 | 181 | <div id="alerts"> |
182 | - <?php if(isset($error['status'])) { ?> |
|
182 | + <?php if (isset($error['status'])) { ?> |
|
183 | 183 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error yt-alert-player"> <div class="yt-alert-icon"> |
184 | 184 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
185 | 185 | </div> |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | </div> |
190 | 190 | </div></div></div> |
191 | 191 | <?php } ?> |
192 | - <?php if(isset($error_legacy)) { ?> |
|
192 | + <?php if (isset($error_legacy)) { ?> |
|
193 | 193 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error yt-alert-player"> <div class="yt-alert-icon"> |
194 | 194 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
195 | 195 | </div> |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>--> |
185 | 185 | </div><br><br> |
186 | 186 | <img src="/d/pfp/<?php echo $_user['pfp']; ?>" style="width:100px;height:100px;"><br> |
187 | - <?php if($_user['pfp'] != "default.png") { ?> |
|
187 | + <?php if ($_user['pfp'] != "default.png") { ?> |
|
188 | 188 | <a href="/get/remove_profile_pic">Remove Profile Picture</a><br> |
189 | 189 | <?php } ?> |
190 | 190 | <br><hr class="thin-line-darker" style="width:unset;"> |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | <input style="width: 169px;position: relative;top: 10px;" type="file" name="videopagebanner" id="avatar-upload"> |
194 | 194 | <!--<button class="yt-uix-button yt-uix-button-default" id="av-uplod">Select File</button>--> |
195 | 195 | </div><br> |
196 | - <?php if(!empty($_user['subbutton'])) { ?> |
|
196 | + <?php if (!empty($_user['subbutton'])) { ?> |
|
197 | 197 | <a href="/get/remove_watch_banner">Remove Watch Page Banner</a><br> |
198 | 198 | <?php } ?><br><hr class="thin-line-darker" style="width:unset;"> |
199 | 199 | |
@@ -213,12 +213,12 @@ discard block |
||
213 | 213 | |
214 | 214 | <b>Featured Vid</b> |
215 | 215 | <div class="customization-module" id="featuredvid" action="/d/post/channel_update" enctype="multipart/form-data" style="display: inline-block;float:right;position: relative;bottom: 6px;"> |
216 | - <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']);?>" name="videoid"> |
|
216 | + <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Video ID" value="<?php echo htmlspecialchars($_user['featured']); ?>" name="videoid"> |
|
217 | 217 | </div><br><br><hr class="thin-line-darker" style="width:unset;"> |
218 | 218 | |
219 | 219 | <b>Website</b> |
220 | 220 | <div class="customization-module" id="featuredvid" action="/d/post/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -7px;"> |
221 | - <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']);?>" name="website"> |
|
221 | + <input style="padding: 5px;background-color: white;border: 1px solid #999;width: 291px;height: 12px;" id="biomd" placeholder="Website URL" value="<?php echo htmlspecialchars($_user['website']); ?>" name="website"> |
|
222 | 222 | |
223 | 223 | </div><br><br><hr class="thin-line-darker" style="width:unset;"> |
224 | 224 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | <span style="font-size: 11px;" class="grey-text">This will show what type of channel you are to other users.</span> |
228 | 228 | <div class="customization-module" id="channellayout" action="/d/post/channel_update" enctype="multipart/form-data" style="float: right;position: relative;top: -19px;"> |
229 | 229 | <select style="background: transparent url(/yt/imgbin/spritesheet_main.png) repeat-x scroll 0 -800px;border: 1px solid #333;position:relative;top:6px;" name="genre"> |
230 | - <?php foreach($categories as $category) { ?> |
|
230 | + <?php foreach ($categories as $category) { ?> |
|
231 | 231 | <option value="<?php echo $category; ?>"><?php echo $category; ?></option> |
232 | 232 | <?php } ?> |
233 | 233 | </select> |
@@ -138,17 +138,17 @@ discard block |
||
138 | 138 | </div> |
139 | 139 | <div class="browse-item-row ytg-box"> |
140 | 140 | <?php |
141 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
142 | - $stmt->execute(); |
|
143 | - $result = $stmt->get_result(); |
|
144 | - while($video = $result->fetch_assoc()) { |
|
145 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
146 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
147 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
148 | - $video['author'] = htmlspecialchars($video['author']); |
|
149 | - $video['title'] = htmlspecialchars($video['title']); |
|
150 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
151 | - ?> |
|
141 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
142 | + $stmt->execute(); |
|
143 | + $result = $stmt->get_result(); |
|
144 | + while($video = $result->fetch_assoc()) { |
|
145 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
146 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
147 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
148 | + $video['author'] = htmlspecialchars($video['author']); |
|
149 | + $video['title'] = htmlspecialchars($video['title']); |
|
150 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
151 | + ?> |
|
152 | 152 | <div class="browse-item yt-tile-default "> |
153 | 153 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
154 | 154 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -174,17 +174,17 @@ discard block |
||
174 | 174 | </div> |
175 | 175 | <div class="browse-item-row ytg-box"> |
176 | 176 | <?php |
177 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
178 | - $stmt->execute(); |
|
179 | - $result = $stmt->get_result(); |
|
180 | - while($video = $result->fetch_assoc()) { |
|
181 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
182 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
183 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
184 | - $video['author'] = htmlspecialchars($video['author']); |
|
185 | - $video['title'] = htmlspecialchars($video['title']); |
|
186 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
187 | - ?> |
|
177 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
178 | + $stmt->execute(); |
|
179 | + $result = $stmt->get_result(); |
|
180 | + while($video = $result->fetch_assoc()) { |
|
181 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
182 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
183 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
184 | + $video['author'] = htmlspecialchars($video['author']); |
|
185 | + $video['title'] = htmlspecialchars($video['title']); |
|
186 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
187 | + ?> |
|
188 | 188 | <div class="browse-item yt-tile-default "> |
189 | 189 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
190 | 190 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -210,17 +210,17 @@ discard block |
||
210 | 210 | </div> |
211 | 211 | <div class="browse-item-row ytg-box"> |
212 | 212 | <?php |
213 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
214 | - $stmt->execute(); |
|
215 | - $result = $stmt->get_result(); |
|
216 | - while($video = $result->fetch_assoc()) { |
|
217 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
218 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
219 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
220 | - $video['author'] = htmlspecialchars($video['author']); |
|
221 | - $video['title'] = htmlspecialchars($video['title']); |
|
222 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
223 | - ?> |
|
213 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
214 | + $stmt->execute(); |
|
215 | + $result = $stmt->get_result(); |
|
216 | + while($video = $result->fetch_assoc()) { |
|
217 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
218 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
219 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
220 | + $video['author'] = htmlspecialchars($video['author']); |
|
221 | + $video['title'] = htmlspecialchars($video['title']); |
|
222 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
223 | + ?> |
|
224 | 224 | <div class="browse-item yt-tile-default "> |
225 | 225 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
226 | 226 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -246,17 +246,17 @@ discard block |
||
246 | 246 | </div> |
247 | 247 | <div class="browse-item-row ytg-box"> |
248 | 248 | <?php |
249 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
250 | - $stmt->execute(); |
|
251 | - $result = $stmt->get_result(); |
|
252 | - while($video = $result->fetch_assoc()) { |
|
253 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
254 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
255 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
256 | - $video['author'] = htmlspecialchars($video['author']); |
|
257 | - $video['title'] = htmlspecialchars($video['title']); |
|
258 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
259 | - ?> |
|
249 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
250 | + $stmt->execute(); |
|
251 | + $result = $stmt->get_result(); |
|
252 | + while($video = $result->fetch_assoc()) { |
|
253 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
254 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
255 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
256 | + $video['author'] = htmlspecialchars($video['author']); |
|
257 | + $video['title'] = htmlspecialchars($video['title']); |
|
258 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
259 | + ?> |
|
260 | 260 | <div class="browse-item yt-tile-default "> |
261 | 261 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
262 | 262 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -282,17 +282,17 @@ discard block |
||
282 | 282 | </div> |
283 | 283 | <div class="browse-item-row ytg-box"> |
284 | 284 | <?php |
285 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
286 | - $stmt->execute(); |
|
287 | - $result = $stmt->get_result(); |
|
288 | - while($video = $result->fetch_assoc()) { |
|
289 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
290 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
291 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
292 | - $video['author'] = htmlspecialchars($video['author']); |
|
293 | - $video['title'] = htmlspecialchars($video['title']); |
|
294 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
295 | - ?> |
|
285 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
|
286 | + $stmt->execute(); |
|
287 | + $result = $stmt->get_result(); |
|
288 | + while($video = $result->fetch_assoc()) { |
|
289 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
290 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
291 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
292 | + $video['author'] = htmlspecialchars($video['author']); |
|
293 | + $video['title'] = htmlspecialchars($video['title']); |
|
294 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
295 | + ?> |
|
296 | 296 | <div class="browse-item yt-tile-default "> |
297 | 297 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto " data-sessionlink="ei=CPjwu5ji3bICFS4RIQod9j-M-A%3D%3D&feature=b-mv"><span class="video-thumb ux-thumb yt-thumb-default-194 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="194"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
298 | 298 | <button onclick=";return false;" title="Watch Later" type="button" class="addto-button video-actions addto-watch-later-button-sign-in yt-uix-button yt-uix-button-default yt-uix-button-short yt-uix-tooltip" data-button-menu-id="shared-addto-watch-later-login" data-video-ids="rLHU-_OhT8g" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
142 | 142 | $stmt->execute(); |
143 | 143 | $result = $stmt->get_result(); |
144 | - while($video = $result->fetch_assoc()) { |
|
144 | + while ($video = $result->fetch_assoc()) { |
|
145 | 145 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
146 | 146 | $video['duration'] = $__time_h->timestamp($video['duration']); |
147 | 147 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
178 | 178 | $stmt->execute(); |
179 | 179 | $result = $stmt->get_result(); |
180 | - while($video = $result->fetch_assoc()) { |
|
180 | + while ($video = $result->fetch_assoc()) { |
|
181 | 181 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
182 | 182 | $video['duration'] = $__time_h->timestamp($video['duration']); |
183 | 183 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
214 | 214 | $stmt->execute(); |
215 | 215 | $result = $stmt->get_result(); |
216 | - while($video = $result->fetch_assoc()) { |
|
216 | + while ($video = $result->fetch_assoc()) { |
|
217 | 217 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
218 | 218 | $video['duration'] = $__time_h->timestamp($video['duration']); |
219 | 219 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
250 | 250 | $stmt->execute(); |
251 | 251 | $result = $stmt->get_result(); |
252 | - while($video = $result->fetch_assoc()) { |
|
252 | + while ($video = $result->fetch_assoc()) { |
|
253 | 253 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
254 | 254 | $video['duration'] = $__time_h->timestamp($video['duration']); |
255 | 255 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Autos & Vehicles' ORDER BY rand() LIMIT 4"); |
286 | 286 | $stmt->execute(); |
287 | 287 | $result = $stmt->get_result(); |
288 | - while($video = $result->fetch_assoc()) { |
|
288 | + while ($video = $result->fetch_assoc()) { |
|
289 | 289 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
290 | 290 | $video['duration'] = $__time_h->timestamp($video['duration']); |
291 | 291 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -199,32 +199,32 @@ |
||
199 | 199 | |
200 | 200 | <?php |
201 | 201 | while($video = $result6->fetch_assoc()) { |
202 | - if($__video_h->video_exists($video['reciever'])) { |
|
203 | - $_video = $__video_h->fetch_video_rid($video['reciever']); |
|
204 | - $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
205 | - $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
206 | - $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
207 | - $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
208 | - $_video['author'] = htmlspecialchars($_video['author']); |
|
209 | - $_video['title'] = htmlspecialchars($_video['title']); |
|
210 | - $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
211 | - |
|
212 | - if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { |
|
213 | - $status = "Corrupted"; |
|
214 | - } else if($_video['visibility'] == "v") { |
|
215 | - $status = "Approved"; |
|
216 | - } else if($_video['visibility'] == "n") { |
|
217 | - $status = "Approved"; |
|
218 | - } else if($_video['visibility'] == "o") { |
|
219 | - $status = "Disapproved"; |
|
220 | - } else { |
|
221 | - $status = "Unknown"; |
|
222 | - } |
|
202 | + if($__video_h->video_exists($video['reciever'])) { |
|
203 | + $_video = $__video_h->fetch_video_rid($video['reciever']); |
|
204 | + $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
205 | + $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
206 | + $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
207 | + $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
208 | + $_video['author'] = htmlspecialchars($_video['author']); |
|
209 | + $_video['title'] = htmlspecialchars($_video['title']); |
|
210 | + $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
211 | + |
|
212 | + if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { |
|
213 | + $status = "Corrupted"; |
|
214 | + } else if($_video['visibility'] == "v") { |
|
215 | + $status = "Approved"; |
|
216 | + } else if($_video['visibility'] == "n") { |
|
217 | + $status = "Approved"; |
|
218 | + } else if($_video['visibility'] == "o") { |
|
219 | + $status = "Disapproved"; |
|
220 | + } else { |
|
221 | + $status = "Unknown"; |
|
222 | + } |
|
223 | 223 | |
224 | - if($_video['commenting'] == "a") |
|
225 | - $_video['commentstatus'] = "Commenting allowed"; |
|
226 | - else |
|
227 | - $_video['commentstatus'] = "Commenting disallowed"; |
|
224 | + if($_video['commenting'] == "a") |
|
225 | + $_video['commentstatus'] = "Commenting allowed"; |
|
226 | + else |
|
227 | + $_video['commentstatus'] = "Commenting disallowed"; |
|
228 | 228 | ?> |
229 | 229 | <tr style="margin-top: 5px;" id="videoslist"> |
230 | 230 | <td class="video-manager-left"> |
@@ -221,10 +221,11 @@ |
||
221 | 221 | $status = "Unknown"; |
222 | 222 | } |
223 | 223 | |
224 | - if($_video['commenting'] == "a") |
|
225 | - $_video['commentstatus'] = "Commenting allowed"; |
|
226 | - else |
|
227 | - $_video['commentstatus'] = "Commenting disallowed"; |
|
224 | + if($_video['commenting'] == "a") { |
|
225 | + $_video['commentstatus'] = "Commenting allowed"; |
|
226 | + } else { |
|
227 | + $_video['commentstatus'] = "Commenting disallowed"; |
|
228 | + } |
|
228 | 229 | ?> |
229 | 230 | <tr style="margin-top: 5px;" id="videoslist"> |
230 | 231 | <td class="video-manager-left"> |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | <?php $__user_h = new user_helper($__db); ?> |
11 | 11 | <?php $__db_h = new db_helper(); ?> |
12 | 12 | <?php $__time_h = new time_helper(); error_reporting(E_ERROR | E_PARSE); ?> |
13 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
13 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
14 | 14 | <!DOCTYPE html> |
15 | 15 | <html dir="ltr"> |
16 | 16 | <head> |
@@ -170,15 +170,15 @@ discard block |
||
170 | 170 | $results = $result->num_rows; |
171 | 171 | |
172 | 172 | $number_of_result = $result->num_rows; |
173 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
173 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
174 | 174 | |
175 | - if (!isset ($_GET['page']) ) { |
|
175 | + if (!isset ($_GET['page'])) { |
|
176 | 176 | $page = 1; |
177 | 177 | } else { |
178 | - $page = (int)$_GET['page']; |
|
178 | + $page = (int) $_GET['page']; |
|
179 | 179 | } |
180 | 180 | |
181 | - $page_first_result = ($page - 1) * $results_per_page; |
|
181 | + $page_first_result = ($page - 1)*$results_per_page; |
|
182 | 182 | |
183 | 183 | $stmt->close(); |
184 | 184 | ?> |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | </tr> |
200 | 200 | |
201 | 201 | <?php |
202 | - while($video = $result6->fetch_assoc()) { |
|
203 | - if($__video_h->video_exists($video['reciever'])) { |
|
202 | + while ($video = $result6->fetch_assoc()) { |
|
203 | + if ($__video_h->video_exists($video['reciever'])) { |
|
204 | 204 | $_video = $__video_h->fetch_video_rid($video['reciever']); |
205 | 205 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
206 | 206 | $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
@@ -210,19 +210,19 @@ discard block |
||
210 | 210 | $_video['title'] = htmlspecialchars($_video['title']); |
211 | 211 | $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
212 | 212 | |
213 | - if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { |
|
213 | + if ($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { |
|
214 | 214 | $status = "Corrupted"; |
215 | - } else if($_video['visibility'] == "v") { |
|
215 | + } else if ($_video['visibility'] == "v") { |
|
216 | 216 | $status = "Approved"; |
217 | - } else if($_video['visibility'] == "n") { |
|
217 | + } else if ($_video['visibility'] == "n") { |
|
218 | 218 | $status = "Approved"; |
219 | - } else if($_video['visibility'] == "o") { |
|
219 | + } else if ($_video['visibility'] == "o") { |
|
220 | 220 | $status = "Disapproved"; |
221 | 221 | } else { |
222 | 222 | $status = "Unknown"; |
223 | 223 | } |
224 | 224 | |
225 | - if($_video['commenting'] == "a") |
|
225 | + if ($_video['commenting'] == "a") |
|
226 | 226 | $_video['commentstatus'] = "Commenting allowed"; |
227 | 227 | else |
228 | 228 | $_video['commentstatus'] = "Commenting disallowed"; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | </div> |
269 | 269 | </center> |
270 | 270 | |
271 | - <?php for($page = 1; $page<= $number_of_page; $page++) { ?> |
|
271 | + <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> |
|
272 | 272 | <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button> |
273 | 273 | <?php } ?> |
274 | 274 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | </script> |
315 | 315 | |
316 | 316 | <?php |
317 | - if($result6->num_rows == 0) { echo " |
|
317 | + if ($result6->num_rows == 0) { echo " |
|
318 | 318 | <br>Welcome to your Video Manager! You can manage your uploaded videos here.<br> |
319 | 319 | <a href=\"upload_video\"> |
320 | 320 | <button type=\"button\" class=\" yt-uix-button yt-uix-button-default\" role=\"button\"> |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $stmt->execute(); |
96 | 96 | $result = $stmt->get_result(); |
97 | 97 | } |
98 | - ?> |
|
98 | + ?> |
|
99 | 99 | {'paging': null, 'feed_html': ` |
100 | 100 | <div class=\'feed-header no-metadata\'> |
101 | 101 | <div class=\'feed-header-thumb\'> |
@@ -13,73 +13,73 @@ |
||
13 | 13 | <?php |
14 | 14 | if(!isset($_GET['action_load_user_feed'])) { |
15 | 15 | switch(@$_GET['chart_name']) { |
16 | - case "trending": |
|
17 | - $category = 'Trending'; |
|
18 | - $diviconn = 'trending'; |
|
19 | - break; |
|
20 | - case "popular": |
|
21 | - $category = 'Popular'; |
|
22 | - $diviconn = 'popular'; |
|
23 | - break; |
|
24 | - case "music": |
|
25 | - $category = 'Music'; |
|
26 | - $diviconn = 'music'; |
|
27 | - break; |
|
28 | - case "entertainment": |
|
29 | - $category = 'Entertainment'; |
|
30 | - $diviconn = 'entertainment'; |
|
31 | - break; |
|
32 | - case "sports": |
|
33 | - $category = 'Sports'; |
|
34 | - $diviconn = 'sports'; |
|
35 | - break; |
|
36 | - case "comedy": |
|
37 | - $category = 'Comedy'; |
|
38 | - $diviconn = 'comedy'; |
|
39 | - break; |
|
40 | - case "film": |
|
41 | - $category = 'Film & Animation'; |
|
42 | - $diviconn = 'film'; |
|
43 | - break; |
|
44 | - case "gadgets": |
|
45 | - $category = 'Gaming'; |
|
46 | - $diviconn = 'gadgets'; |
|
47 | - break; |
|
16 | + case "trending": |
|
17 | + $category = 'Trending'; |
|
18 | + $diviconn = 'trending'; |
|
19 | + break; |
|
20 | + case "popular": |
|
21 | + $category = 'Popular'; |
|
22 | + $diviconn = 'popular'; |
|
23 | + break; |
|
24 | + case "music": |
|
25 | + $category = 'Music'; |
|
26 | + $diviconn = 'music'; |
|
27 | + break; |
|
28 | + case "entertainment": |
|
29 | + $category = 'Entertainment'; |
|
30 | + $diviconn = 'entertainment'; |
|
31 | + break; |
|
32 | + case "sports": |
|
33 | + $category = 'Sports'; |
|
34 | + $diviconn = 'sports'; |
|
35 | + break; |
|
36 | + case "comedy": |
|
37 | + $category = 'Comedy'; |
|
38 | + $diviconn = 'comedy'; |
|
39 | + break; |
|
40 | + case "film": |
|
41 | + $category = 'Film & Animation'; |
|
42 | + $diviconn = 'film'; |
|
43 | + break; |
|
44 | + case "gadgets": |
|
45 | + $category = 'Gaming'; |
|
46 | + $diviconn = 'gadgets'; |
|
47 | + break; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | switch(@$_GET['feed_name']) { |
51 | - case "trending": |
|
52 | - $category = 'Trending'; |
|
53 | - $diviconn = 'trending'; |
|
54 | - break; |
|
55 | - case "popular": |
|
56 | - $category = 'Popular'; |
|
57 | - $diviconn = 'popular'; |
|
58 | - break; |
|
59 | - case "music": |
|
60 | - $category = 'Music'; |
|
61 | - $diviconn = 'music'; |
|
62 | - break; |
|
63 | - case "entertainment": |
|
64 | - $category = 'Entertainment'; |
|
65 | - $diviconn = 'entertainment'; |
|
66 | - break; |
|
67 | - case "sports": |
|
68 | - $category = 'Sports'; |
|
69 | - $diviconn = 'sports'; |
|
70 | - break; |
|
71 | - case "comedy": |
|
72 | - $category = 'Comedy'; |
|
73 | - $diviconn = 'comedy'; |
|
74 | - break; |
|
75 | - case "film": |
|
76 | - $category = 'Film & Animation'; |
|
77 | - $diviconn = 'film'; |
|
78 | - break; |
|
79 | - case "gadgets": |
|
80 | - $category = 'Gaming'; |
|
81 | - $diviconn = 'gadgets'; |
|
82 | - break; |
|
51 | + case "trending": |
|
52 | + $category = 'Trending'; |
|
53 | + $diviconn = 'trending'; |
|
54 | + break; |
|
55 | + case "popular": |
|
56 | + $category = 'Popular'; |
|
57 | + $diviconn = 'popular'; |
|
58 | + break; |
|
59 | + case "music": |
|
60 | + $category = 'Music'; |
|
61 | + $diviconn = 'music'; |
|
62 | + break; |
|
63 | + case "entertainment": |
|
64 | + $category = 'Entertainment'; |
|
65 | + $diviconn = 'entertainment'; |
|
66 | + break; |
|
67 | + case "sports": |
|
68 | + $category = 'Sports'; |
|
69 | + $diviconn = 'sports'; |
|
70 | + break; |
|
71 | + case "comedy": |
|
72 | + $category = 'Comedy'; |
|
73 | + $diviconn = 'comedy'; |
|
74 | + break; |
|
75 | + case "film": |
|
76 | + $category = 'Film & Animation'; |
|
77 | + $diviconn = 'film'; |
|
78 | + break; |
|
79 | + case "gadgets": |
|
80 | + $category = 'Gaming'; |
|
81 | + $diviconn = 'gadgets'; |
|
82 | + break; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $stmt = $__db->prepare("SELECT * FROM videos WHERE category = ? ORDER BY id DESC LIMIT 20"); |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | <?php $__time_h = new time_helper(); ?> |
12 | 12 | <?php header('Content-Type: application/json'); ?> |
13 | 13 | <?php |
14 | - if(!isset($_GET['action_load_user_feed'])) { |
|
15 | - switch(@$_GET['chart_name']) { |
|
14 | + if (!isset($_GET['action_load_user_feed'])) { |
|
15 | + switch (@$_GET['chart_name']) { |
|
16 | 16 | case "trending": |
17 | 17 | $category = 'Trending'; |
18 | 18 | $diviconn = 'trending'; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | break; |
48 | 48 | } |
49 | 49 | |
50 | - switch(@$_GET['feed_name']) { |
|
50 | + switch (@$_GET['feed_name']) { |
|
51 | 51 | case "trending": |
52 | 52 | $category = 'Trending'; |
53 | 53 | $diviconn = 'trending'; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | <div class=\'feed-page\'> |
110 | 110 | <ul> |
111 | 111 | <?php |
112 | - while($video = $result->fetch_assoc()) { |
|
112 | + while ($video = $result->fetch_assoc()) { |
|
113 | 113 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
114 | 114 | $video['duration'] = $__time_h->timestamp($video['duration']); |
115 | 115 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | <?php $__user_h = new user_helper($__db); ?> |
9 | 9 | <?php $__db_h = new db_helper(); ?> |
10 | 10 | <?php $__time_h = new time_helper(); ?> |
11 | -<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
11 | +<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?> |
|
12 | 12 | <!DOCTYPE html> |
13 | 13 | <html> |
14 | 14 | <head> |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | <b>Category</b> <br> |
91 | 91 | <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default"> |
92 | 92 | <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?> |
93 | - <?php foreach($categories as $categoryTag) { ?> |
|
93 | + <?php foreach ($categories as $categoryTag) { ?> |
|
94 | 94 | <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option> |
95 | 95 | <?php } ?> |
96 | 96 | </select><br><br> |
@@ -24,9 +24,9 @@ |
||
24 | 24 | shell_exec($fullcmd); |
25 | 25 | } |
26 | 26 | |
27 | - public function __construct($conn){ |
|
27 | + public function __construct($conn){ |
|
28 | 28 | $this->__db = $conn; |
29 | - } |
|
29 | + } |
|
30 | 30 | |
31 | 31 | function fetch_video_views(string $id) { |
32 | 32 | $stmt = $this->__db->prepare("SELECT * FROM views WHERE videoid = ?"); |
@@ -12,19 +12,19 @@ discard block |
||
12 | 12 | |
13 | 13 | public function sh_exec(string $cmd, string $outputfile = "", string $pidfile = "", bool $mergestderror = true, bool $bg = false) { |
14 | 14 | $fullcmd = $cmd; |
15 | - if(strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile; |
|
16 | - if($mergestderror) $fullcmd .= " 2>&1"; |
|
15 | + if (strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile; |
|
16 | + if ($mergestderror) $fullcmd .= " 2>&1"; |
|
17 | 17 | |
18 | - if($bg) { |
|
18 | + if ($bg) { |
|
19 | 19 | $fullcmd = "nohup " . $fullcmd . " &"; |
20 | - if(strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile; |
|
20 | + if (strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile; |
|
21 | 21 | } else { |
22 | - if(strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile; |
|
22 | + if (strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile; |
|
23 | 23 | } |
24 | 24 | shell_exec($fullcmd); |
25 | 25 | } |
26 | 26 | |
27 | - public function __construct($conn){ |
|
27 | + public function __construct($conn) { |
|
28 | 28 | $this->__db = $conn; |
29 | 29 | } |
30 | 30 | |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | |
50 | 50 | function shorten_description(string $description, int $limit, bool $newlines = false) { |
51 | 51 | $description = trim($description); |
52 | - if(strlen($description) >= $limit) { |
|
52 | + if (strlen($description) >= $limit) { |
|
53 | 53 | $description = substr($description, 0, $limit) . "..."; |
54 | 54 | } |
55 | 55 | |
56 | 56 | $description = htmlspecialchars($description); |
57 | - if($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); } |
|
57 | + if ($newlines) { $description = str_replace(PHP_EOL, "<br>", $description); } |
|
58 | 58 | return $description; |
59 | 59 | } |
60 | 60 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $result = $stmt->get_result(); |
77 | 77 | $video = $result->fetch_assoc(); |
78 | 78 | |
79 | - if($result->num_rows === 0) |
|
79 | + if ($result->num_rows === 0) |
|
80 | 80 | return 0; |
81 | 81 | else |
82 | 82 | return $video; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $stmt->execute(); |
102 | 102 | $result = $stmt->get_result(); |
103 | 103 | $user = $result->fetch_assoc(); |
104 | - if($result->num_rows === 1) { return true; } else { return false; } |
|
104 | + if ($result->num_rows === 1) { return true; } else { return false; } |
|
105 | 105 | $stmt->close(); |
106 | 106 | |
107 | 107 | return $user; |
@@ -12,14 +12,22 @@ discard block |
||
12 | 12 | |
13 | 13 | public function sh_exec(string $cmd, string $outputfile = "", string $pidfile = "", bool $mergestderror = true, bool $bg = false) { |
14 | 14 | $fullcmd = $cmd; |
15 | - if(strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile; |
|
16 | - if($mergestderror) $fullcmd .= " 2>&1"; |
|
15 | + if(strlen($outputfile) > 0) { |
|
16 | + $fullcmd .= " >> " . $outputfile; |
|
17 | + } |
|
18 | + if($mergestderror) { |
|
19 | + $fullcmd .= " 2>&1"; |
|
20 | + } |
|
17 | 21 | |
18 | 22 | if($bg) { |
19 | 23 | $fullcmd = "nohup " . $fullcmd . " &"; |
20 | - if(strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile; |
|
24 | + if(strlen($pidfile)) { |
|
25 | + $fullcmd .= " echo $! > " . $pidfile; |
|
26 | + } |
|
21 | 27 | } else { |
22 | - if(strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile; |
|
28 | + if(strlen($pidfile) > 0) { |
|
29 | + $fullcmd .= "; echo $$ > " . $pidfile; |
|
30 | + } |
|
23 | 31 | } |
24 | 32 | shell_exec($fullcmd); |
25 | 33 | } |
@@ -76,10 +84,11 @@ discard block |
||
76 | 84 | $result = $stmt->get_result(); |
77 | 85 | $video = $result->fetch_assoc(); |
78 | 86 | |
79 | - if($result->num_rows === 0) |
|
80 | - return 0; |
|
81 | - else |
|
82 | - return $video; |
|
87 | + if($result->num_rows === 0) { |
|
88 | + return 0; |
|
89 | + } else { |
|
90 | + return $video; |
|
91 | + } |
|
83 | 92 | |
84 | 93 | $stmt->close(); |
85 | 94 | } |