| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | require($_SERVER['DOCUMENT_ROOT'] . "/s/classes/config.inc.php"); | 
| 3 | 3 | |
| 4 | -if(isset($_SESSION['siteusername'])) { | |
| 4 | +if (isset($_SESSION['siteusername'])) { | |
| 5 | 5 | $_SESSION = []; | 
| 6 | 6 | session_destroy(); | 
| 7 | 7 | } | 
| @@ -47,7 +47,7 @@ | ||
| 47 | 47 | 'target_upload_name' => md5_file($_FILES["fileToUpload"]["tmp_name"]) . "." . strtolower(pathinfo($_FILES["fileToUpload"]["name"], PATHINFO_EXTENSION)) // use video_file_type plzs | 
| 48 | 48 | ]; | 
| 49 | 49 | |
| 50 | - if(move_uploaded_file( | |
| 50 | + if (move_uploaded_file( | |
| 51 | 51 | $_FILES['fileToUpload']['tmp_name'], | 
| 52 | 52 | "dynamic/temp/" . $video_properties->video_rid . $video_validation->video_file_type | 
| 53 | 53 |      )) { | 
| @@ -14,10 +14,10 @@ discard block | ||
| 14 | 14 | $ago = new DateTime($datetime); | 
| 15 | 15 | $diff = $now->diff($ago); | 
| 16 | 16 | |
| 17 | - $diff->w = floor($diff->d / 7); | |
| 18 | - $diff->d -= $diff->w * 7; | |
| 17 | + $diff->w = floor($diff->d/7); | |
| 18 | + $diff->d -= $diff->w*7; | |
| 19 | 19 | |
| 20 | -        if(!isset($cLang)) { | |
| 20 | +        if (!isset($cLang)) { | |
| 21 | 21 | $string = array( | 
| 22 | 22 | 'y' => 'year', | 
| 23 | 23 | 'm' => 'month', | 
| @@ -39,7 +39,7 @@ discard block | ||
| 39 | 39 | ); | 
| 40 | 40 | } | 
| 41 | 41 | |
| 42 | -        if(!isset($cLang)) { | |
| 42 | +        if (!isset($cLang)) { | |
| 43 | 43 |              foreach ($string as $k => &$v) { | 
| 44 | 44 |                  if ($diff->$k) { | 
| 45 | 45 | $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : ''); | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | } | 
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | -        if(!isset($cLang)) { | |
| 60 | +        if (!isset($cLang)) { | |
| 61 | 61 | if (!$full) $string = array_slice($string, 0, 1); | 
| 62 | 62 |              return $string ? implode(', ', $string) . ' ago' : 'just now'; | 
| 63 | 63 |          } else { | 
| @@ -71,23 +71,23 @@ discard block | ||
| 71 | 71 |          if ($seconds > 60*60*24) { | 
| 72 | 72 | // over a day | 
| 73 | 73 |              return sprintf("%d:%s:%s:%s", | 
| 74 | - floor($seconds/60/60/24), // Days | |
| 75 | - str_pad( floor($seconds/60/60%24), 2, "0", STR_PAD_LEFT), // Hours | |
| 76 | - str_pad( floor($seconds/60%60), 2, "0", STR_PAD_LEFT), // Minutes | |
| 77 | - str_pad( $seconds%60, 2, "0", STR_PAD_LEFT) // Seconds | |
| 74 | + floor($seconds/60/60/24), // Days | |
| 75 | + str_pad(floor($seconds/60/60%24), 2, "0", STR_PAD_LEFT), // Hours | |
| 76 | + str_pad(floor($seconds/60%60), 2, "0", STR_PAD_LEFT), // Minutes | |
| 77 | + str_pad($seconds%60, 2, "0", STR_PAD_LEFT) // Seconds | |
| 78 | 78 | ); | 
| 79 | 79 |          } else if ($seconds > 60*60) { | 
| 80 | 80 | // over an hour | 
| 81 | 81 |              return sprintf("%d:%s:%s", | 
| 82 | - floor($seconds/60/60), // Hours | |
| 82 | + floor($seconds/60/60), // Hours | |
| 83 | 83 | str_pad(floor($seconds/60%60), 2, "0", STR_PAD_LEFT), // Minutes | 
| 84 | - str_pad( $seconds%60, 2, "0", STR_PAD_LEFT) // Seconds | |
| 84 | + str_pad($seconds%60, 2, "0", STR_PAD_LEFT) // Seconds | |
| 85 | 85 | ); | 
| 86 | 86 |          } else { | 
| 87 | 87 | // less than an hour | 
| 88 | 88 |              return sprintf("%d:%s", | 
| 89 | - floor($seconds/60), // Minutes | |
| 90 | - str_pad( $seconds%60, 2, "0", STR_PAD_LEFT) // Seconds | |
| 89 | + floor($seconds/60), // Minutes | |
| 90 | + str_pad($seconds%60, 2, "0", STR_PAD_LEFT) // Seconds | |
| 91 | 91 | ); | 
| 92 | 92 | } | 
| 93 | 93 | } | 
| @@ -10,7 +10,7 @@ | ||
| 10 | 10 | * | 
| 11 | 11 | **/ | 
| 12 | 12 |  class db_helper { | 
| 13 | -	public function __construct(){ | |
| 13 | +	public function __construct() { | |
| 14 | 14 | |
| 15 | 15 | } | 
| 16 | 16 | |
| @@ -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"> | 
| @@ -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> | 
| @@ -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> | 
| @@ -140,7 +140,7 @@ discard block | ||
| 140 | 140 | <?php | 
| 141 | 141 |  											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Pets & Animals' ORDER BY rand() LIMIT 4"); | 
| 142 | 142 | $stmt->execute(); | 
| 143 | -											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 143 | +											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 144 | 144 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); | 
| 145 | 145 | $video['duration'] = $__time_h->timestamp($video['duration']); | 
| 146 | 146 | $video['views'] = $__video_h->fetch_video_views($video['rid']); | 
| @@ -175,7 +175,7 @@ discard block | ||
| 175 | 175 | <?php | 
| 176 | 176 |  											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Pets & Animals' ORDER BY rand() LIMIT 4"); | 
| 177 | 177 | $stmt->execute(); | 
| 178 | -											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 178 | +											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 179 | 179 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); | 
| 180 | 180 | $video['duration'] = $__time_h->timestamp($video['duration']); | 
| 181 | 181 | $video['views'] = $__video_h->fetch_video_views($video['rid']); | 
| @@ -210,7 +210,7 @@ discard block | ||
| 210 | 210 | <?php | 
| 211 | 211 |  											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Pets & Animals' ORDER BY rand() LIMIT 4"); | 
| 212 | 212 | $stmt->execute(); | 
| 213 | -											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 213 | +											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 214 | 214 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); | 
| 215 | 215 | $video['duration'] = $__time_h->timestamp($video['duration']); | 
| 216 | 216 | $video['views'] = $__video_h->fetch_video_views($video['rid']); | 
| @@ -245,7 +245,7 @@ discard block | ||
| 245 | 245 | <?php | 
| 246 | 246 |  											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Pets & Animals' ORDER BY rand() LIMIT 4"); | 
| 247 | 247 | $stmt->execute(); | 
| 248 | -											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 248 | +											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 249 | 249 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); | 
| 250 | 250 | $video['duration'] = $__time_h->timestamp($video['duration']); | 
| 251 | 251 | $video['views'] = $__video_h->fetch_video_views($video['rid']); | 
| @@ -280,7 +280,7 @@ discard block | ||
| 280 | 280 | <?php | 
| 281 | 281 |  											$stmt = $__db->prepare("SELECT * FROM videos WHERE category = 'Pets & Animals' ORDER BY rand() LIMIT 4"); | 
| 282 | 282 | $stmt->execute(); | 
| 283 | -											while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 283 | +											while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	 | |
| 284 | 284 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); | 
| 285 | 285 | $video['duration'] = $__time_h->timestamp($video['duration']); | 
| 286 | 286 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |