| @@ -15,11 +15,13 @@ discard block | ||
| 15 | 15 | <?php $__db_h = new db_helper(); ?> | 
| 16 | 16 | <?php $__time_h = new time_helper(); ?> | 
| 17 | 17 | <?php | 
| 18 | - if(isset($_SESSION['siteusername'])) | |
| 19 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); | |
| 18 | +	if(isset($_SESSION['siteusername'])) { | |
| 19 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); | |
| 20 | + } | |
| 20 | 21 | |
| 21 | - if(!$__user_h->user_exists($_GET['n'])) | |
| 22 | -        header("Location: /?userdoesntexist"); | |
| 22 | +    if(!$__user_h->user_exists($_GET['n'])) { | |
| 23 | +            header("Location: /?userdoesntexist"); | |
| 24 | + } | |
| 23 | 25 | |
| 24 | 26 | $_user = $__user_h->fetch_user_username($_GET['n']); | 
| 25 | 27 | |
| @@ -42,10 +44,11 @@ discard block | ||
| 42 | 44 | |
| 43 | 45 | if ( | 
| 44 | 46 | ctype_xdigit($colorCode) && | 
| 45 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) | |
| 46 | - return true; | |
| 47 | - | |
| 48 | - else return false; | |
| 47 | +              (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { | |
| 48 | + return true; | |
| 49 | +        } else { | |
| 50 | + return false; | |
| 51 | + } | |
| 49 | 52 | } | 
| 50 | 53 | |
| 51 | 54 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); | 
| @@ -77,8 +80,9 @@ discard block | ||
| 77 | 80 |      if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } | 
| 78 | 81 |      if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } | 
| 79 | 82 | |
| 80 | - if(isset($_SESSION['siteusername'])) | |
| 81 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); | |
| 83 | +	if(isset($_SESSION['siteusername'])) { | |
| 84 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); | |
| 85 | + } | |
| 82 | 86 | |
| 83 | 87 |      if($_SERVER['REQUEST_METHOD'] == 'POST') { | 
| 84 | 88 | $error = array(); | 
| @@ -15,8 +15,8 @@ discard block | ||
| 15 | 15 | <?php $__db_h = new db_helper(); ?> | 
| 16 | 16 | <?php $__time_h = new time_helper(); ?> | 
| 17 | 17 | <?php | 
| 18 | - if(isset($_SESSION['siteusername'])) | |
| 19 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); | |
| 18 | + if(isset($_SESSION['siteusername'])) | |
| 19 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); | |
| 20 | 20 | |
| 21 | 21 | if(!$__user_h->user_exists($_GET['n'])) | 
| 22 | 22 |          header("Location: /?userdoesntexist"); | 
| @@ -29,21 +29,21 @@ discard block | ||
| 29 | 29 |          return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. | 
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | -	function addhttp($url) { | |
| 33 | -		if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { | |
| 34 | - $url = "http://" . $url; | |
| 35 | - } | |
| 36 | - return $url; | |
| 37 | - } | |
| 32 | +    function addhttp($url) { | |
| 33 | +        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { | |
| 34 | + $url = "http://" . $url; | |
| 35 | + } | |
| 36 | + return $url; | |
| 37 | + } | |
| 38 | 38 | |
| 39 | 39 |      function check_valid_colorhex($colorCode) { | 
| 40 | 40 | // If user accidentally passed along the # sign, strip it off | 
| 41 | 41 | $colorCode = ltrim($colorCode, '#'); | 
| 42 | 42 | |
| 43 | 43 | if ( | 
| 44 | - ctype_xdigit($colorCode) && | |
| 44 | + ctype_xdigit($colorCode) && | |
| 45 | 45 | (strlen($colorCode) == 6 || strlen($colorCode) == 3)) | 
| 46 | - return true; | |
| 46 | + return true; | |
| 47 | 47 | |
| 48 | 48 | else return false; | 
| 49 | 49 | } | 
| @@ -77,8 +77,8 @@ discard block | ||
| 77 | 77 |      if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } | 
| 78 | 78 |      if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } | 
| 79 | 79 | |
| 80 | - if(isset($_SESSION['siteusername'])) | |
| 81 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); | |
| 80 | + if(isset($_SESSION['siteusername'])) | |
| 81 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); | |
| 82 | 82 | |
| 83 | 83 |      if($_SERVER['REQUEST_METHOD'] == 'POST') { | 
| 84 | 84 | $error = array(); | 
| @@ -92,11 +92,11 @@ discard block | ||
| 92 | 92 |          //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; }  | 
| 93 | 93 | |
| 94 | 94 |          if(!isset($error['message'])) { | 
| 95 | - $text = $_POST['comment']; | |
| 95 | + $text = $_POST['comment']; | |
| 96 | 96 |              $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); | 
| 97 | -			$stmt->bindParam(":id", $_user['username']); | |
| 98 | -			$stmt->bindParam(":username", $_SESSION['siteusername']); | |
| 99 | -			$stmt->bindParam(":comment", $text); | |
| 97 | +            $stmt->bindParam(":id", $_user['username']); | |
| 98 | +            $stmt->bindParam(":username", $_SESSION['siteusername']); | |
| 99 | +            $stmt->bindParam(":comment", $text); | |
| 100 | 100 | $stmt->execute(); | 
| 101 | 101 | |
| 102 | 102 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); | 
| @@ -106,7 +106,7 @@ discard block | ||
| 106 | 106 | } | 
| 107 | 107 | } | 
| 108 | 108 | } | 
| 109 | - ?> | |
| 109 | + ?> | |
| 110 | 110 | <!DOCTYPE html> | 
| 111 | 111 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> | 
| 112 | 112 | <!-- machid: sNW5tN3Z2SWdXaDRqNGxuNEF5MFBxM1BxWXd0VGo0Rkg3UXNTTTNCUGRDWjR0WGpHR3R1YzFR --> | 
| @@ -15,10 +15,10 @@ discard block | ||
| 15 | 15 | <?php $__db_h = new db_helper(); ?> | 
| 16 | 16 | <?php $__time_h = new time_helper(); ?> | 
| 17 | 17 | <?php | 
| 18 | - if(isset($_SESSION['siteusername'])) | |
| 18 | + if (isset($_SESSION['siteusername'])) | |
| 19 | 19 | $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); | 
| 20 | 20 | |
| 21 | - if(!$__user_h->user_exists($_GET['n'])) | |
| 21 | + if (!$__user_h->user_exists($_GET['n'])) | |
| 22 | 22 |          header("Location: /?userdoesntexist"); | 
| 23 | 23 | |
| 24 | 24 | $_user = $__user_h->fetch_user_username($_GET['n']); | 
| @@ -70,28 +70,28 @@ discard block | ||
| 70 | 70 | |
| 71 | 71 | $_user['genre'] = strtolower($_user['genre']); | 
| 72 | 72 | |
| 73 | -    if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } | |
| 74 | -    if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } | |
| 75 | -    if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } | |
| 76 | -    if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } | |
| 77 | -    if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } | |
| 78 | -    if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } | |
| 73 | +    if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } | |
| 74 | +    if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } | |
| 75 | +    if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } | |
| 76 | +    if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } | |
| 77 | +    if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } | |
| 78 | +    if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } | |
| 79 | 79 | |
| 80 | - if(isset($_SESSION['siteusername'])) | |
| 80 | + if (isset($_SESSION['siteusername'])) | |
| 81 | 81 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); | 
| 82 | 82 | |
| 83 | -    if($_SERVER['REQUEST_METHOD'] == 'POST') { | |
| 83 | +    if ($_SERVER['REQUEST_METHOD'] == 'POST') { | |
| 84 | 84 | $error = array(); | 
| 85 | 85 | |
| 86 | -        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } | |
| 87 | -        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } | |
| 88 | -        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } | |
| 86 | +        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } | |
| 87 | +        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } | |
| 88 | +        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } | |
| 89 | 89 |          //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } | 
| 90 | 90 |          //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } | 
| 91 | -        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } | |
| 91 | +        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; } | |
| 92 | 92 |          //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; }  | 
| 93 | 93 | |
| 94 | -        if(!isset($error['message'])) { | |
| 94 | +        if (!isset($error['message'])) { | |
| 95 | 95 | $text = $_POST['comment']; | 
| 96 | 96 |              $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); | 
| 97 | 97 |  			$stmt->bindParam(":id", $_user['username']); | 
| @@ -101,7 +101,7 @@ discard block | ||
| 101 | 101 | |
| 102 | 102 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); | 
| 103 | 103 | |
| 104 | -            if(@$_SESSION['siteusername'] != $_user['username']) {  | |
| 104 | +            if (@$_SESSION['siteusername'] != $_user['username']) {  | |
| 105 | 105 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); | 
| 106 | 106 | } | 
| 107 | 107 | } | 
| @@ -127,7 +127,7 @@ discard block | ||
| 127 | 127 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> | 
| 128 | 128 | <style> | 
| 129 | 129 |  			#content-container { | 
| 130 | - background-color: <?php echo $_user['primary_color']; ?>; | |
| 130 | + background-color: <?php echo $_user['primary_color']; ?>; | |
| 131 | 131 | background-image: url(/d/banners/<?php echo $_user['2009_bg']; ?>); | 
| 132 | 132 | background-repeat: repeat; | 
| 133 | 133 | background-position: center top; | 
| @@ -144,7 +144,7 @@ discard block | ||
| 144 | 144 | <div id="content-container"> | 
| 145 | 145 | <!-- begin content --> | 
| 146 | 146 | <div id="content"> | 
| 147 | -					<?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> | |
| 147 | +					<?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> | |
| 148 | 148 | <div class="channel_customization"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> | 
| 149 | 149 | <?php } ?> | 
| 150 | 150 | |
| @@ -199,7 +199,7 @@ discard block | ||
| 199 | 199 | <h1><?php echo htmlspecialchars($_user['username']); ?></h1> | 
| 200 | 200 | </div> | 
| 201 | 201 | <div class="upper-left-section enable-fancy-subscribe-button"> | 
| 202 | -												<?php if($_user['username'] != @$_SESSION['siteusername']) { ?> | |
| 202 | +												<?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> | |
| 203 | 203 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> | 
| 204 | 204 |  														<button href="https://accounts.google.com/ServiceLogin?uilel=3&service=youtube&passive=true&continue=http%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dsubscribe%26nomobiletemp%3D1%26hl%3Den_US%26next%3D%252Fuser%252F<?php echo htmlspecialchars($_user['username']); ?>%253Ffeature%253Dg-logo-xit&hl=en_US&ltmpl=sso" onclick=";window.location.href=this.getAttribute('href');return false;" title="" type="button" class="yt-subscription-button subscription-button-with-recommended-channels   yt-uix-button yt-uix-button-subscription yt-uix-tooltip" data-enable-hovercard="true" data-subscription-value="UCIwFjwMjI0y7PDBVEO9-bkQ" data-force-position="" data-position="" data-subscription-feature="channels3" data-subscription-type="channel" role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content">  <span class="subscribe-label">Subscribe</span> | 
| 205 | 205 | <span class="subscribed-label">Subscribed</span> | 
| @@ -275,12 +275,12 @@ discard block | ||
| 275 | 275 | </div> | 
| 276 | 276 | </div> | 
| 277 | 277 | </div> | 
| 278 | -                            <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> | |
| 278 | +                            <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> | |
| 279 | 279 | <div id="branded-page-body"> | 
| 280 | 280 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"> | 
| 281 | 281 | <div class="tab-content-body"> | 
| 282 | 282 | <div class="primary-pane"> | 
| 283 | -                                            <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> | |
| 283 | +                                            <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> | |
| 284 | 284 | <div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge"> | 
| 285 | 285 | <div class="module-view featured-video-view-module"> | 
| 286 | 286 |  													<div class="channels-video-player " data-swf-config="{"assets": {"html": "\/html5_player_template", "css": "http:\/\/s.ytimg.com\/yt\/cssbin\/www-player-vfllhw7HB.css", "js": "http:\/\/s.ytimg.com\/yt\/jsbin\/html5player-vflzTrRqK.js"}, "url": "http:\/\/s.ytimg.com\/yt\/swfbin\/watch_as3-vflbPspVE.swf", "min_version": "8.0.0", "args": {"ttsurl": "http:\/\/www.youtube.com\/api\/timedtext?sparams=asr_langs%2Ccaps%2Cv%2Cexpire\u0026asr_langs=en%2Cko%2Cja%2Ces\u0026v=/watch?v=<?php echo $video['rid']; ?>\u0026caps=asr\u0026expire=1339746882\u0026key=yttt1\u0026signature=A1B858FF427B45672676C7403417ED1F4091A806.C347A6021C0F843E46F2056AEBA38FC93A0A47B8\u0026hl=en_US", "el": "profilepage", "fexp": "904001,907342,904824,910206,908620,907217,907335,921602,919306,922600,919316,920704,912804,913542,919324,912706", "url_encoded_fmt_stream_map": "url=http%3A%2F%2Fo-o.preferred.nuq04s10.v1.lscache4.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D44%26ip%3D207.0.0.0%26signature%3D9B9B5ECF02F2F66BDCCB0ACED26D3406F9F83241.1B2CC833461E3D2C4D081B7DFBC65B0948C61FB9%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=large\u0026fallback_host=tc.v1.cache4.c.youtube.com\u0026type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22\u0026itag=44,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v14.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D35%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3DB702D7CA72653169BDC2C945B5A35F4A23A3FEBF.ACC660CDAB11901FF8D3DA8D384D61F0AB0F0125%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=large\u0026fallback_host=tc.v14.cache1.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=35,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v24.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D43%26ip%3D207.0.0.0%26signature%3D9FABDD8C013AA137B87DF2D154D1B90E6827A2A3.880FECDEC066236D85FCF223CF472B62B8F9B3A4%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v24.cache3.c.youtube.com\u0026type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22\u0026itag=43,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v3.lscache7.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D34%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D1BA326B784DAA9F62FD789CBB5C2FABFCD5D351C.C4618E3AB2AB08C61C6A982A36F405DA886B5D5A%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v3.cache7.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=34,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v14.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26ms%3Dau%26itag%3D18%26ip%3D207.0.0.0%26signature%3D8806EA8FAE16557A2F9732068442133EA0A0760F.D91694A47E6B0BF627965CDA46010F36105A28FE%26sver%3D3%26mt%3D1339721111%26ratebypass%3Dyes%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=medium\u0026fallback_host=tc.v14.cache1.c.youtube.com\u0026type=video%2Fmp4%3B+codecs%3D%22avc1.42001E%2C+mp4a.40.2%22\u0026itag=18,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v4.lscache1.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D5%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D011CB6739AB60ED79D032DE2F62EB016D8A8E462.C2C0ABE42F26DBA18F2BC6E0D074EB99A95C0DF0%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=small\u0026fallback_host=tc.v4.cache1.c.youtube.com\u0026type=video%2Fx-flv\u0026itag=5,url=http%3A%2F%2Fo-o.preferred.nuq04s10.v12.lscache3.c.youtube.com%2Fvideoplayback%3Fupn%3D_7WL7XeDtjs%26sparams%3Dalgorithm%252Cburst%252Ccp%252Cfactor%252Cid%252Cip%252Cipbits%252Citag%252Csource%252Cupn%252Cexpire%26fexp%3D904001%252C907342%252C904824%252C910206%252C908620%252C907217%252C907335%252C921602%252C919306%252C922600%252C919316%252C920704%252C912804%252C913542%252C919324%252C912706%26mt%3D1339721111%26ms%3Dau%26algorithm%3Dthrottle-factor%26itag%3D36%26ip%3D207.0.0.0%26burst%3D40%26sver%3D3%26signature%3D988FDD37CBA8DB74C1148EE17921D8549434297C.A2C1796F2BA0427C9FE370BFB6B3B09BA1D81B07%26source%3Dyoutube%26expire%3D1339743583%26key%3Dyt1%26ipbits%3D8%26factor%3D1.25%26cp%3DU0hSTldPUV9NTUNOMl9PSVVGOmdTcVlPRFNNTEdM%26id%3D56ffd0bfee85d71f\u0026quality=small\u0026fallback_host=tc.v12.cache3.c.youtube.com\u0026type=video%2F3gpp\u0026itag=36", "allow_embed": 1, "vq": "auto", "account_playback_token": "", "allow_ratings": 1, "keywords": "Rehearsal,Dance,justin,bieber,believe,as,long,you,love,me,rodney,jerkins,pattie,mallette,jeremy,dad,mom,scooter,braun,island,def,jam,usher,rbmg,making,of,the,album,webisode,june,19th,19,new,amazing,song,big,sean,hit,record,<?php echo htmlspecialchars($_user['username']); ?>,always,still,studio,singing,kuk,harrell,producer,sing,boy,guy,man,smash,single,nick,demoura,dancers,sweat,beliebers,hard,work,tour,band", "cc3_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/subtitles3_module-vflu_Qeod.swf", "track_embed": 0, "is_purchased": false, "ps": "default", "fmt_list": "44\/854x480\/99\/0\/0,35\/854x480\/9\/0\/115,43\/640x360\/99\/0\/0,34\/640x360\/9\/0\/115,18\/640x360\/9\/0\/115,5\/320x240\/7\/0\/0,36\/320x240\/99\/0\/0", "author": "<?php echo htmlspecialchars($_user['username']); ?>", "muted": "0", "cc_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/subtitle_module-vflq8KnSi.swf", "length_seconds": 82, "feature": "g-logo-xit", "enablejsapi": 1, "rel": 0, "plid": "AATCeEL9eg3Ls9t-", "cc_font": "Arial Unicode MS, arial, verdana, _sans", "ftoken": "", "sdetail": "f:g-logo-xit,p:\/", "status": "ok", "cc_asr": 1, "watermark": ",http:\/\/s.ytimg.com\/yt\/img\/watermark\/youtube_watermark-vflHX6b6E.png,http:\/\/s.ytimg.com\/yt\/img\/watermark\/youtube_hd_watermark-vflAzLcD6.png", "sourceid": "y", "timestamp": 1339721682, "has_cc": true, "view_count": 2600, "quality_cap": "highres", "hl": "en_US", "tmi": "1", "no_get_video_log": "1", "eurl": "http:\/\/www.youtube.com\/user\/<?php echo htmlspecialchars($_user['username']); ?>", "iurl": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/hqdefault.jpg", "endscreen_module": "http:\/\/s.ytimg.com\/yt\/swfbin\/endscreen-vflJBKwqC.swf", "referrer": "http:\/\/www.youtube.com\/", "avg_rating": 4.97805486284, "video_id": "/watch?v=<?php echo $video['rid']; ?>", "sendtmp": "1", "sk": "bwv_lGOGF4u1g0p7puy7ERICN8NZ5cVFC", "is_video_preview": false, "token": "vjVQa1PpcFMSYb-unvOiIgSL8pW9tObJUMfrEc1mxfE=", "thumbnail_url": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/default.jpg", "iurlsd": "http:\/\/i3.ytimg.com\/vi\//watch?v=<?php echo $video['rid']; ?>\/sddefault.jpg", "autoplay": "1"}, "url_v9as2": "http:\/\/s.ytimg.com\/yt\/swfbin\/cps-vflhvG6F4.swf", "params": {"allowscriptaccess": "always", "allowfullscreen": "true", "bgcolor": "#000000"}, "attrs": {"width": "640", "id": "movie_player", "height": "390"}, "url_v8": "http:\/\/s.ytimg.com\/yt\/swfbin\/cps-vflhvG6F4.swf", "html5": false}" data-video-id="/watch?v=<?php echo $video['rid']; ?>"> | 
| @@ -326,7 +326,7 @@ discard block | ||
| 326 | 326 |                                                              $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); | 
| 327 | 327 |                                                              $stmt->bindParam(":username", $_user['username']); | 
| 328 | 328 | $stmt->execute(); | 
| 329 | -                                                            while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {  | |
| 329 | +                                                            while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {  | |
| 330 | 330 | ?> | 
| 331 | 331 | <li class="blogger-video"> | 
| 332 | 332 | <div class="video yt-tile-visible"> | 
| @@ -408,7 +408,7 @@ discard block | ||
| 408 | 408 | </div> | 
| 409 | 409 | <hr class="yt-horizontal-rule "> | 
| 410 | 410 | </div> | 
| 411 | -													<?php if(!empty($_user['website'])) { ?> | |
| 411 | +													<?php if (!empty($_user['website'])) { ?> | |
| 412 | 412 | <div class="user-profile-item"> | 
| 413 | 413 | <div class="yt-c3-profile-custom-url field-container "> | 
| 414 | 414 | <a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link"> | 
| @@ -457,7 +457,7 @@ discard block | ||
| 457 | 457 | <h5>Country</h5> | 
| 458 | 458 | <span class="value"><?php echo htmlspecialchars($_user['country']); ?></span> | 
| 459 | 459 | </div> | 
| 460 | -														<?php if($_user['genre'] != "none") { ?> | |
| 460 | +														<?php if ($_user['genre'] != "none") { ?> | |
| 461 | 461 | <div class="user-profile-item "> | 
| 462 | 462 | <h5>Channel Genre</h5> | 
| 463 | 463 | <span class="value"><?php echo htmlspecialchars($_user['genre']); ?></span> | 
| @@ -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 | } | 
| @@ -85,10 +85,11 @@ | ||
| 85 | 85 | $status = "Unknown"; | 
| 86 | 86 | } | 
| 87 | 87 | |
| 88 | - if($video['commenting'] == "a") | |
| 89 | - $video['commentstatus'] = "Commenting allowed"; | |
| 90 | - else | |
| 91 | - $video['commentstatus'] = "Commenting disallowed"; | |
| 88 | +            if($video['commenting'] == "a") { | |
| 89 | + $video['commentstatus'] = "Commenting allowed"; | |
| 90 | +            } else { | |
| 91 | + $video['commentstatus'] = "Commenting disallowed"; | |
| 92 | + } | |
| 92 | 93 | ?> | 
| 93 | 94 | <tr style="margin-top: 5px;" id="videoslist"> | 
| 94 | 95 | <td class="video-manager-left"> | 
| @@ -11,11 +11,11 @@ discard block | ||
| 11 | 11 | <?php | 
| 12 | 12 | $search = $_SESSION['siteusername']; | 
| 13 | 13 | |
| 14 | -    if($_GET['filter'] == "time") { | |
| 14 | +    if ($_GET['filter'] == "time") { | |
| 15 | 15 |          $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC"); | 
| 16 | 16 |          $stmt->bindParam(":username", $_SESSION['siteusername']); | 
| 17 | 17 | $stmt->execute(); | 
| 18 | -    } else if($_GET['filter'] == "title") { | |
| 18 | +    } else if ($_GET['filter'] == "title") { | |
| 19 | 19 |          $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY title DESC"); | 
| 20 | 20 |          $stmt->bindParam(":username", $_SESSION['siteusername']); | 
| 21 | 21 | $stmt->execute(); | 
| @@ -23,23 +23,23 @@ discard block | ||
| 23 | 23 | |
| 24 | 24 | $results_per_page = 12; | 
| 25 | 25 | $number_of_result = $stmt->rowCount(); | 
| 26 | - $number_of_page = ceil ($number_of_result / $results_per_page); | |
| 26 | + $number_of_page = ceil($number_of_result/$results_per_page); | |
| 27 | 27 | |
| 28 | -    if (!isset ($_GET['page']) ) {   | |
| 28 | +    if (!isset ($_GET['page'])) {   | |
| 29 | 29 | $page = 1; | 
| 30 | 30 |      } else {   | 
| 31 | - $page = (int)$_GET['page']; | |
| 31 | + $page = (int) $_GET['page']; | |
| 32 | 32 | } | 
| 33 | 33 | |
| 34 | - $page_first_result = ($page - 1) * $results_per_page; | |
| 34 | + $page_first_result = ($page - 1)*$results_per_page; | |
| 35 | 35 | |
| 36 | -    if($_GET['filter'] == "time") { | |
| 36 | +    if ($_GET['filter'] == "time") { | |
| 37 | 37 |          $stmt6 = $__db->prepare("SELECT * FROM videos WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper"); | 
| 38 | 38 |          $stmt6->bindParam(":search", $search); | 
| 39 | 39 |          $stmt6->bindParam(":pfirst", $page_first_result); | 
| 40 | 40 |          $stmt6->bindParam(":pper", $results_per_page); | 
| 41 | 41 | $stmt6->execute(); | 
| 42 | -    } else if($_GET['filter'] == "title") { | |
| 42 | +    } else if ($_GET['filter'] == "title") { | |
| 43 | 43 |          $stmt6 = $__db->prepare("SELECT * FROM videos WHERE author = :search ORDER BY title LIMIT :pfirst, :pper"); | 
| 44 | 44 |          $stmt6->bindParam(":search", $search); | 
| 45 | 45 |          $stmt6->bindParam(":pfirst", $page_first_result); | 
| @@ -52,15 +52,15 @@ discard block | ||
| 52 | 52 | <th style="width: 80%;"> | 
| 53 | 53 | <small class="video-filter-options"> | 
| 54 | 54 | Sort by: | 
| 55 | -                <a id="selector-title" onclick="changeFilter_Title();" <?php if($_GET['filter'] == "title") { ?>class="selected"<?php } ?>>Title</a> |  | |
| 56 | -                    <a id="selector-time" onclick="changeFilter_Time();" <?php if($_GET['filter'] == "time") { ?>class="selected"<?php } ?>>Time</a> | |
| 55 | +                <a id="selector-title" onclick="changeFilter_Title();" <?php if ($_GET['filter'] == "title") { ?>class="selected"<?php } ?>>Title</a> |  | |
| 56 | +                    <a id="selector-time" onclick="changeFilter_Time();" <?php if ($_GET['filter'] == "time") { ?>class="selected"<?php } ?>>Time</a> | |
| 57 | 57 | </small> | 
| 58 | 58 | </th> | 
| 59 | 59 | <th style="margin: 5px; width: 20%;"></th> | 
| 60 | 60 | </tr> | 
| 61 | 61 | |
| 62 | 62 | <?php | 
| 63 | -        while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) {  | |
| 63 | +        while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) {  | |
| 64 | 64 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); | 
| 65 | 65 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); | 
| 66 | 66 | $video['duration'] = $__time_h->timestamp($video['duration']); | 
| @@ -69,19 +69,19 @@ discard block | ||
| 69 | 69 | $video['title'] = htmlspecialchars($video['title']); | 
| 70 | 70 | $video['description'] = $__video_h->shorten_description($video['description'], 50); | 
| 71 | 71 | |
| 72 | -            if($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") { | |
| 72 | +            if ($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") { | |
| 73 | 73 | $status = "Corrupted"; | 
| 74 | -            } else if($video['visibility'] == "v") { | |
| 74 | +            } else if ($video['visibility'] == "v") { | |
| 75 | 75 | $status = "Approved"; | 
| 76 | -            } else if($video['visibility'] == "n") { | |
| 76 | +            } else if ($video['visibility'] == "n") { | |
| 77 | 77 | $status = "Approved"; | 
| 78 | -            } else if($video['visibility'] == "o") { | |
| 78 | +            } else if ($video['visibility'] == "o") { | |
| 79 | 79 | $status = "Disapproved"; | 
| 80 | 80 |              } else { | 
| 81 | 81 | $status = "Unknown"; | 
| 82 | 82 | } | 
| 83 | 83 | |
| 84 | - if($video['commenting'] == "a") | |
| 84 | + if ($video['commenting'] == "a") | |
| 85 | 85 | $video['commentstatus'] = "Commenting allowed"; | 
| 86 | 86 | else | 
| 87 | 87 | $video['commentstatus'] = "Commenting disallowed"; | 
| @@ -224,10 +224,11 @@ | ||
| 224 | 224 | $status = "Unknown"; | 
| 225 | 225 | } | 
| 226 | 226 | |
| 227 | - if($video['commenting'] == "a") | |
| 228 | - $video['commentstatus'] = "Commenting allowed"; | |
| 229 | - else | |
| 230 | - $video['commentstatus'] = "Commenting disallowed"; | |
| 227 | +                                            if($video['commenting'] == "a") { | |
| 228 | + $video['commentstatus'] = "Commenting allowed"; | |
| 229 | +                                            } else { | |
| 230 | + $video['commentstatus'] = "Commenting disallowed"; | |
| 231 | + } | |
| 231 | 232 | ?> | 
| 232 | 233 | <tr style="margin-top: 5px;" id="videoslist"> | 
| 233 | 234 | <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(); ?> | 
| 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> | 
| @@ -163,15 +163,15 @@ discard block | ||
| 163 | 163 | $stmt->execute(); | 
| 164 | 164 | |
| 165 | 165 | $number_of_result = $stmt->rowCount(); | 
| 166 | - $number_of_page = ceil ($number_of_result / $results_per_page); | |
| 166 | + $number_of_page = ceil($number_of_result/$results_per_page); | |
| 167 | 167 | |
| 168 | -                                    if (!isset ($_GET['page']) ) {   | |
| 168 | +                                    if (!isset ($_GET['page'])) {   | |
| 169 | 169 | $page = 1; | 
| 170 | 170 |                                      } else {   | 
| 171 | - $page = (int)$_GET['page']; | |
| 171 | + $page = (int) $_GET['page']; | |
| 172 | 172 | } | 
| 173 | 173 | |
| 174 | - $page_first_result = ($page - 1) * $results_per_page; | |
| 174 | + $page_first_result = ($page - 1)*$results_per_page; | |
| 175 | 175 | ?> | 
| 176 | 176 | <?php | 
| 177 | 177 |                                      $stmt6 = $__db->prepare("SELECT * FROM videos WHERE author = :search ORDER BY id DESC LIMIT :pfirst, :pper"); | 
| @@ -196,7 +196,7 @@ discard block | ||
| 196 | 196 | </tr> | 
| 197 | 197 | |
| 198 | 198 | <?php | 
| 199 | -                                        while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {  | |
| 199 | +                                        while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {  | |
| 200 | 200 | $video['video_responses'] = $__video_h->get_video_responses($video['rid']); | 
| 201 | 201 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); | 
| 202 | 202 | $video['duration'] = $__time_h->timestamp($video['duration']); | 
| @@ -205,19 +205,19 @@ discard block | ||
| 205 | 205 | $video['title'] = htmlspecialchars($video['title']); | 
| 206 | 206 | $video['description'] = $__video_h->shorten_description($video['description'], 50); | 
| 207 | 207 | |
| 208 | -                                            if($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") { | |
| 208 | +                                            if ($video['thumbnail'] == ".png" && $video['filename'] == ".mp4") { | |
| 209 | 209 | $status = "Corrupted"; | 
| 210 | -                                            } else if($video['visibility'] == "v") { | |
| 210 | +                                            } else if ($video['visibility'] == "v") { | |
| 211 | 211 | $status = "Approved"; | 
| 212 | -                                            } else if($video['visibility'] == "n") { | |
| 212 | +                                            } else if ($video['visibility'] == "n") { | |
| 213 | 213 | $status = "Approved"; | 
| 214 | -                                            } else if($video['visibility'] == "o") { | |
| 214 | +                                            } else if ($video['visibility'] == "o") { | |
| 215 | 215 | $status = "Disapproved"; | 
| 216 | 216 |                                              } else { | 
| 217 | 217 | $status = "Unknown"; | 
| 218 | 218 | } | 
| 219 | 219 | |
| 220 | - if($video['commenting'] == "a") | |
| 220 | + if ($video['commenting'] == "a") | |
| 221 | 221 | $video['commentstatus'] = "Commenting allowed"; | 
| 222 | 222 | else | 
| 223 | 223 | $video['commentstatus'] = "Commenting disallowed"; | 
| @@ -278,7 +278,7 @@ discard block | ||
| 278 | 278 | </div> | 
| 279 | 279 | </center> | 
| 280 | 280 | |
| 281 | -                                <?php for($page = 1; $page<= $number_of_page; $page++) { ?> | |
| 281 | +                                <?php for ($page = 1; $page <= $number_of_page; $page++) { ?> | |
| 282 | 282 | <button class="yt-uix-button yt-uix-button-default" onclick="ajax_fetch_videomanager(<?php echo $page; ?>)"><?php echo $page; ?></button> | 
| 283 | 283 | <?php } ?> | 
| 284 | 284 | |
| @@ -324,7 +324,7 @@ discard block | ||
| 324 | 324 | </script> | 
| 325 | 325 | |
| 326 | 326 | <?php | 
| 327 | -                                    if($stmt6->rowCount() == 0) { echo " | |
| 327 | +                                    if ($stmt6->rowCount() == 0) { echo " | |
| 328 | 328 | <br>Welcome to your Video Manager! You can manage your uploaded videos here.<br> | 
| 329 | 329 | <a href=\"upload_video\"> | 
| 330 | 330 | <button type=\"button\" class=\" yt-uix-button yt-uix-button-default\" role=\"button\"> | 
| @@ -83,10 +83,11 @@ | ||
| 83 | 83 | $status = "Unknown"; | 
| 84 | 84 | } | 
| 85 | 85 | |
| 86 | - if($_video['commenting'] == "a") | |
| 87 | - $_video['commentstatus'] = "Commenting allowed"; | |
| 88 | - else | |
| 89 | - $_video['commentstatus'] = "Commenting disallowed"; | |
| 86 | +                if($_video['commenting'] == "a") { | |
| 87 | + $_video['commentstatus'] = "Commenting allowed"; | |
| 88 | +                } else { | |
| 89 | + $_video['commentstatus'] = "Commenting disallowed"; | |
| 90 | + } | |
| 90 | 91 | ?> | 
| 91 | 92 | <tr style="margin-top: 5px;" id="videoslist"> | 
| 92 | 93 | <td class="video-manager-left"> | 
| @@ -11,11 +11,11 @@ discard block | ||
| 11 | 11 | <?php | 
| 12 | 12 | $search = $_SESSION['siteusername']; | 
| 13 | 13 | |
| 14 | -    if($_GET['filter'] == "time") { | |
| 14 | +    if ($_GET['filter'] == "time") { | |
| 15 | 15 |          $stmt = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :username ORDER BY id DESC"); | 
| 16 | 16 |          $stmt->bindParam(":username", $_SESSION['siteusername']); | 
| 17 | 17 | $stmt->execute(); | 
| 18 | -    } else if($_GET['filter'] == "title") { | |
| 18 | +    } else if ($_GET['filter'] == "title") { | |
| 19 | 19 |          $stmt = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :username ORDER BY title DESC"); | 
| 20 | 20 |          $stmt->bindParam(":username", $_SESSION['siteusername']); | 
| 21 | 21 | $stmt->execute(); | 
| @@ -23,23 +23,23 @@ discard block | ||
| 23 | 23 | |
| 24 | 24 | $results_per_page = 12; | 
| 25 | 25 | $number_of_result = $stmt->rowCount(); | 
| 26 | - $number_of_page = ceil ($number_of_result / $results_per_page); | |
| 26 | + $number_of_page = ceil($number_of_result/$results_per_page); | |
| 27 | 27 | |
| 28 | -    if (!isset ($_GET['page']) ) {   | |
| 28 | +    if (!isset ($_GET['page'])) {   | |
| 29 | 29 | $page = 1; | 
| 30 | 30 |      } else {   | 
| 31 | - $page = (int)$_GET['page']; | |
| 31 | + $page = (int) $_GET['page']; | |
| 32 | 32 | } | 
| 33 | 33 | |
| 34 | - $page_first_result = ($page - 1) * $results_per_page; | |
| 34 | + $page_first_result = ($page - 1)*$results_per_page; | |
| 35 | 35 | |
| 36 | -    if($_GET['filter'] == "time") { | |
| 36 | +    if ($_GET['filter'] == "time") { | |
| 37 | 37 |          $stmt6 = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :search ORDER BY id DESC LIMIT :pfirst, :pper"); | 
| 38 | 38 |          $stmt6->bindParam(":search", $search); | 
| 39 | 39 |          $stmt6->bindParam(":pfirst", $page_first_result); | 
| 40 | 40 |          $stmt6->bindParam(":pper", $results_per_page); | 
| 41 | 41 | $stmt6->execute(); | 
| 42 | -    } else if($_GET['filter'] == "title") { | |
| 42 | +    } else if ($_GET['filter'] == "title") { | |
| 43 | 43 |          $stmt6 = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :search ORDER BY title LIMIT :pfirst, :pper"); | 
| 44 | 44 |          $stmt6->bindParam(":search", $search); | 
| 45 | 45 |          $stmt6->bindParam(":pfirst", $page_first_result); | 
| @@ -56,8 +56,8 @@ discard block | ||
| 56 | 56 | </tr> | 
| 57 | 57 | |
| 58 | 58 | <?php | 
| 59 | -        while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) {  | |
| 60 | -            if($__video_h->video_exists($video['reciever'])) { | |
| 59 | +        while ($video = $stmt6->fetch(PDO::FETCH_ASSOC)) {  | |
| 60 | +            if ($__video_h->video_exists($video['reciever'])) { | |
| 61 | 61 | $_video = $__video_h->fetch_video_rid($video['reciever']); | 
| 62 | 62 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); | 
| 63 | 63 | $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); | 
| @@ -67,19 +67,19 @@ discard block | ||
| 67 | 67 | $_video['title'] = htmlspecialchars($_video['title']); | 
| 68 | 68 | $_video['description'] = $__video_h->shorten_description($_video['description'], 50); | 
| 69 | 69 | |
| 70 | -                if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { | |
| 70 | +                if ($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") { | |
| 71 | 71 | $status = "Corrupted"; | 
| 72 | -                } else if($_video['visibility'] == "v") { | |
| 72 | +                } else if ($_video['visibility'] == "v") { | |
| 73 | 73 | $status = "Approved"; | 
| 74 | -                } else if($_video['visibility'] == "n") { | |
| 74 | +                } else if ($_video['visibility'] == "n") { | |
| 75 | 75 | $status = "Approved"; | 
| 76 | -                } else if($_video['visibility'] == "o") { | |
| 76 | +                } else if ($_video['visibility'] == "o") { | |
| 77 | 77 | $status = "Disapproved"; | 
| 78 | 78 |                  } else { | 
| 79 | 79 | $status = "Unknown"; | 
| 80 | 80 | } | 
| 81 | 81 | |
| 82 | - if($_video['commenting'] == "a") | |
| 82 | + if ($_video['commenting'] == "a") | |
| 83 | 83 | $_video['commentstatus'] = "Commenting allowed"; | 
| 84 | 84 | else | 
| 85 | 85 | $_video['commentstatus'] = "Commenting disallowed"; | 
| @@ -19,7 +19,7 @@ | ||
| 19 | 19 | $_user_update_utils->initialize_db_var($conn); | 
| 20 | 20 | |
| 21 | 21 | |
| 22 | -  $_base_utils->initialize_page_compass("post/upload"); | |
| 22 | +    $_base_utils->initialize_page_compass("post/upload"); | |
| 23 | 23 | ?> | 
| 24 | 24 | <?php | 
| 25 | 25 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; | 
| @@ -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 |      )) { | 
| @@ -23,8 +23,9 @@ | ||
| 23 | 23 | ?> | 
| 24 | 24 | <?php | 
| 25 | 25 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; | 
| 26 | - for ($i = 0; $i < 11; $i++) | |
| 27 | - $rid .= $characters[mt_rand(0, 63)]; | |
| 26 | +    for ($i = 0; $i < 11; $i++) { | |
| 27 | + $rid .= $characters[mt_rand(0, 63)]; | |
| 28 | + } | |
| 28 | 29 | |
| 29 | 30 | $video_properties = (object) [ | 
| 30 | 31 | 'video_rid' => $rid, | 
| @@ -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 | } | 
| @@ -58,10 +58,14 @@ | ||
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | 60 |          if(!isset($cLang)) { | 
| 61 | - if (!$full) $string = array_slice($string, 0, 1); | |
| 61 | +            if (!$full) { | |
| 62 | + $string = array_slice($string, 0, 1); | |
| 63 | + } | |
| 62 | 64 |              return $string ? implode(', ', $string) . ' ago' : 'just now'; | 
| 63 | 65 |          } else { | 
| 64 | - if (!$full) $string = array_slice($string, 0, 1); | |
| 66 | +            if (!$full) { | |
| 67 | + $string = array_slice($string, 0, 1); | |
| 68 | + } | |
| 65 | 69 | return $string ? implode($cLang['agoLeft'], $string) . " " . " " . $cLang['agoRight'] : $cLang['justNow']; | 
| 66 | 70 | } | 
| 67 | 71 | } | 
| @@ -10,13 +10,13 @@ | ||
| 10 | 10 | * | 
| 11 | 11 | **/ | 
| 12 | 12 |  class db_helper { | 
| 13 | -	public function __construct(){ | |
| 13 | +    public function __construct(){ | |
| 14 | 14 | |
| 15 | - } | |
| 15 | + } | |
| 16 | 16 | |
| 17 | -  function fetch(string $table, array $where, string $extra) { | |
| 17 | +    function fetch(string $table, array $where, string $extra) { | |
| 18 | 18 | |
| 19 | - } | |
| 19 | + } | |
| 20 | 20 | } | 
| 21 | 21 | |
| 22 | 22 | ?> | 
| 23 | 23 | \ No newline at end of file | 
| @@ -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"> | 
| @@ -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; ?>"> |