@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | <?php |
15 | 15 | $_playlist = $__video_h->fetch_playlist_rid($_GET['v']); |
16 | 16 | |
17 | - if(!$__user_h->user_exists($_playlist['author'])) |
|
17 | + if (!$__user_h->user_exists($_playlist['author'])) |
|
18 | 18 | header("Location: /?userdoesntexist"); |
19 | 19 | |
20 | 20 | $_user = $__user_h->fetch_user_username($_playlist['author']); |
@@ -66,28 +66,28 @@ discard block |
||
66 | 66 | $_user['genre'] = strtolower($_user['genre']); |
67 | 67 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
68 | 68 | |
69 | - if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
70 | - if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
71 | - if(!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
72 | - if(!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
73 | - if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
74 | - if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
69 | + if (!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
|
70 | + if (!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
|
71 | + if (!check_valid_colorhex($_user['third_color']) && strlen($_user['third_color']) != 6) { $_user['third_color'] = ""; } |
|
72 | + if (!check_valid_colorhex($_user['text_color']) && strlen($_user['text_color']) != 6) { $_user['text_color'] = ""; } |
|
73 | + if (!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
|
74 | + if (!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
|
75 | 75 | |
76 | - if(isset($_SESSION['siteusername'])) |
|
76 | + if (isset($_SESSION['siteusername'])) |
|
77 | 77 | $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
78 | 78 | |
79 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
79 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
80 | 80 | $error = array(); |
81 | 81 | |
82 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
83 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
84 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
82 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
83 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
84 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
85 | 85 | //if(!isset($_POST['g-recaptcha-response'])){ $error['message'] = "captcha validation failed"; $error['status'] = true; } |
86 | 86 | //if(!$_user_insert_utils->validateCaptcha($config['recaptcha_secret'], $_POST['g-recaptcha-response'])) { $error['message'] = "captcha validation failed"; $error['status'] = true; } |
87 | - 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; } |
|
87 | + 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; } |
|
88 | 88 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
89 | 89 | |
90 | - if(!isset($error['message'])) { |
|
90 | + if (!isset($error['message'])) { |
|
91 | 91 | $text = $_POST['comment']; |
92 | 92 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
93 | 93 | $stmt->bindParam(":id", $_user['username']); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
99 | 99 | |
100 | - if(@$_SESSION['siteusername'] != $_user['username']) { |
|
100 | + if (@$_SESSION['siteusername'] != $_user['username']) { |
|
101 | 101 | $_user_insert_utils->send_message($_user['username'], "New comment", 'I commented "' . $_POST['comment'] . '" on your profile!', $_SESSION['siteusername']); |
102 | 102 | } |
103 | 103 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | <link rel="stylesheet" href="/yt/cssbin/www-extra.css"> |
126 | 126 | <style> |
127 | 127 | #content-container { |
128 | - background-color: <?php echo $_user['primary_color']; ?>; |
|
128 | + background-color: <?php echo $_user['primary_color']; ?>; |
|
129 | 129 | background-image: url(/dynamic/banners/<?php echo $_user['2009_bg']; ?>); |
130 | 130 | background-repeat: repeat; |
131 | 131 | background-position: center top; |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?></div> |
142 | 142 | <div id="content-container"> |
143 | 143 | <!-- begin content --> |
144 | - <?php if(isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
144 | + <?php if (isset($_SESSION['siteusername']) && $_user['username'] == $_SESSION['siteusername']) { ?> |
|
145 | 145 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
146 | 146 | <?php } ?> |
147 | 147 | <?php |
148 | - if(empty(trim($_user['bio']))) |
|
148 | + if (empty(trim($_user['bio']))) |
|
149 | 149 | $_user['bio'] = "This user has no description."; |
150 | 150 | ?> |
151 | 151 | <div id="content"> |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | </div> |
206 | 206 | </div> |
207 | 207 | <div class="upper-left-section enable-fancy-subscribe-button"> |
208 | - <?php if($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
208 | + <?php if ($_user['username'] != @$_SESSION['siteusername']) { ?> |
|
209 | 209 | <div class="yt-subscription-button-hovercard yt-uix-hovercard"> |
210 | 210 | <button |
211 | 211 | href="#" |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | title="" |
214 | 214 | id="subscribe-button" |
215 | 215 | type="button" |
216 | - class="yt-subscription-button <?php if($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
216 | + class="yt-subscription-button <?php if ($_user['subscribed']) { echo "subscribed "; } ?> yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
217 | 217 | role="button"><span class="yt-uix-button-icon-wrapper"><img class="yt-uix-button-icon yt-uix-button-icon-subscribe" |
218 | 218 | src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></span><span class="yt-uix-button-content"> <span class="subscribe-label">Subscribe</span> |
219 | 219 | <span class="subscribed-label">Subscribed</span> |
@@ -247,12 +247,12 @@ discard block |
||
247 | 247 | </div> |
248 | 248 | </div> |
249 | 249 | </div> |
250 | - <?php if($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
250 | + <?php if ($_user['featured'] != "None") { $video = $__video_h->fetch_video_rid($_user['featured']); } else { $_user['featured'] = false; } ?> |
|
251 | 251 | <div id="branded-page-body"> |
252 | 252 | <div class="channel-tab-content channel-layout-two-column selected blogger-template"> |
253 | 253 | <div class="tab-content-body"> |
254 | 254 | <div class="primary-pane"> |
255 | - <?php if($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
255 | + <?php if ($_user['featured'] != false && $__video_h->video_exists($_user['featured'])) { ?> |
|
256 | 256 | <div class="channels-featured-video channel-module yt-uix-c3-module-container has-visible-edge"> |
257 | 257 | <div class="module-view featured-video-view-module"> |
258 | 258 | <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']; ?>"> |
@@ -308,8 +308,8 @@ discard block |
||
308 | 308 | <?php |
309 | 309 | $_playlist['videos'] = json_decode($_playlist['videos']); |
310 | 310 | $_playlist['count'] = 1; |
311 | - foreach($_playlist['videos'] as $video) { |
|
312 | - if($__video_h->video_exists($video)) { |
|
311 | + foreach ($_playlist['videos'] as $video) { |
|
312 | + if ($__video_h->video_exists($video)) { |
|
313 | 313 | $_video = $__video_h->fetch_video_rid($video); |
314 | 314 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
315 | 315 | $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
@@ -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> |
@@ -469,13 +469,13 @@ discard block |
||
469 | 469 | </div> |
470 | 470 | <div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact"> |
471 | 471 | <?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?> |
472 | - <?php if(count($_user['featured_channels']) != 0) { ?> |
|
472 | + <?php if (count($_user['featured_channels']) != 0) { ?> |
|
473 | 473 | <div class="module-view other-channels-view"> |
474 | 474 | <h2>Featured Channels</h2> |
475 | 475 | <ul class="channel-summary-list "> |
476 | 476 | <?php |
477 | - foreach($_user['featured_channels'] as $user) { |
|
478 | - if($__user_h->user_exists($user)) { |
|
477 | + foreach ($_user['featured_channels'] as $user) { |
|
478 | + if ($__user_h->user_exists($user)) { |
|
479 | 479 | ?> |
480 | 480 | <li class="yt-tile-visible yt-uix-tile"> |
481 | 481 | <div class="channel-summary clearfix channel-summary-compact"> |
@@ -504,13 +504,13 @@ discard block |
||
504 | 504 | $stmt->bindParam(":search", $_user['username']); |
505 | 505 | $stmt->execute(); |
506 | 506 | |
507 | - if($stmt->rowCount() != 0) { |
|
507 | + if ($stmt->rowCount() != 0) { |
|
508 | 508 | ?> |
509 | 509 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
510 | 510 | <div class="module-view gh-featured"> |
511 | 511 | <h2>Featured Playlists</h2> |
512 | 512 | <?php |
513 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
513 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
514 | 514 | $playlist['videos'] = json_decode($playlist['videos']); |
515 | 515 | ?> |
516 | 516 | <div class="playlist yt-tile-visible yt-uix-tile"> |
@@ -14,8 +14,9 @@ discard block |
||
14 | 14 | <?php |
15 | 15 | $_playlist = $__video_h->fetch_playlist_rid($_GET['v']); |
16 | 16 | |
17 | - if(!$__user_h->user_exists($_playlist['author'])) |
|
18 | - header("Location: /?userdoesntexist"); |
|
17 | + if(!$__user_h->user_exists($_playlist['author'])) { |
|
18 | + header("Location: /?userdoesntexist"); |
|
19 | + } |
|
19 | 20 | |
20 | 21 | $_user = $__user_h->fetch_user_username($_playlist['author']); |
21 | 22 | |
@@ -38,10 +39,11 @@ discard block |
||
38 | 39 | |
39 | 40 | if ( |
40 | 41 | ctype_xdigit($colorCode) && |
41 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
|
42 | - return true; |
|
43 | - |
|
44 | - else return false; |
|
42 | + (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { |
|
43 | + return true; |
|
44 | + } else { |
|
45 | + return false; |
|
46 | + } |
|
45 | 47 | } |
46 | 48 | |
47 | 49 | $_user['subscribers'] = $__user_h->fetch_subs_count($_user['username']); |
@@ -73,8 +75,9 @@ discard block |
||
73 | 75 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
74 | 76 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
75 | 77 | |
76 | - if(isset($_SESSION['siteusername'])) |
|
77 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
78 | + if(isset($_SESSION['siteusername'])) { |
|
79 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
80 | + } |
|
78 | 81 | |
79 | 82 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
80 | 83 | $error = array(); |
@@ -145,8 +148,9 @@ discard block |
||
145 | 148 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
146 | 149 | <?php } ?> |
147 | 150 | <?php |
148 | - if(empty(trim($_user['bio']))) |
|
149 | - $_user['bio'] = "This user has no description."; |
|
151 | + if(empty(trim($_user['bio']))) { |
|
152 | + $_user['bio'] = "This user has no description."; |
|
153 | + } |
|
150 | 154 | ?> |
151 | 155 | <div id="content"> |
152 | 156 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
@@ -25,21 +25,21 @@ discard block |
||
25 | 25 | return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. |
26 | 26 | } |
27 | 27 | |
28 | - function addhttp($url) { |
|
29 | - if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
30 | - $url = "http://" . $url; |
|
31 | - } |
|
32 | - return $url; |
|
33 | - } |
|
28 | + function addhttp($url) { |
|
29 | + if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
|
30 | + $url = "http://" . $url; |
|
31 | + } |
|
32 | + return $url; |
|
33 | + } |
|
34 | 34 | |
35 | 35 | function check_valid_colorhex($colorCode) { |
36 | 36 | // If user accidentally passed along the # sign, strip it off |
37 | 37 | $colorCode = ltrim($colorCode, '#'); |
38 | 38 | |
39 | 39 | if ( |
40 | - ctype_xdigit($colorCode) && |
|
40 | + ctype_xdigit($colorCode) && |
|
41 | 41 | (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
42 | - return true; |
|
42 | + return true; |
|
43 | 43 | |
44 | 44 | else return false; |
45 | 45 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $_user['2009_bgcolor'] = substr($_user['2009_bgcolor'], 0, 7); |
65 | 65 | |
66 | 66 | $_user['genre'] = strtolower($_user['genre']); |
67 | - $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
67 | + $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
|
68 | 68 | |
69 | 69 | if(!check_valid_colorhex($_user['primary_color']) && strlen($_user['primary_color']) != 6) { $_user['primary_color'] = ""; } |
70 | 70 | if(!check_valid_colorhex($_user['secondary_color']) && strlen($_user['secondary_color']) != 6) { $_user['secondary_color'] = ""; } |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
74 | 74 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
75 | 75 | |
76 | - if(isset($_SESSION['siteusername'])) |
|
77 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
76 | + if(isset($_SESSION['siteusername'])) |
|
77 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
78 | 78 | |
79 | 79 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
80 | 80 | $error = array(); |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | //if(ifBlocked(@$_SESSION['siteusername'], $user['username'], $__db)) { $error = "This user has blocked you!"; $error['status'] = true; } |
89 | 89 | |
90 | 90 | if(!isset($error['message'])) { |
91 | - $text = $_POST['comment']; |
|
91 | + $text = $_POST['comment']; |
|
92 | 92 | $stmt = $__db->prepare("INSERT INTO profile_comments (toid, author, comment) VALUES (:id, :username, :comment)"); |
93 | - $stmt->bindParam(":id", $_user['username']); |
|
94 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
95 | - $stmt->bindParam(":comment", $text); |
|
93 | + $stmt->bindParam(":id", $_user['username']); |
|
94 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
95 | + $stmt->bindParam(":comment", $text); |
|
96 | 96 | $stmt->execute(); |
97 | 97 | |
98 | 98 | $_user_update_utils->update_comment_cooldown_time($_SESSION['siteusername']); |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | } |
105 | 105 | ?> |
106 | 106 | <?php |
107 | - $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_playlist['title']); |
|
108 | - $__server->page_embeds->page_description = htmlspecialchars($_playlist['description']); |
|
109 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
110 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
107 | + $__server->page_embeds->page_title = "SubRocks - " . htmlspecialchars($_playlist['title']); |
|
108 | + $__server->page_embeds->page_description = htmlspecialchars($_playlist['description']); |
|
109 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
110 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
111 | 111 | ?> |
112 | 112 | <!DOCTYPE html> |
113 | 113 | <html dir="ltr" xmlns:og="http://opengraphprotocol.org/schema/" lang="en"> |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
152 | 152 | <?php } ?> |
153 | 153 | <?php |
154 | - if(empty(trim($_user['bio']))) |
|
155 | - $_user['bio'] = "This user has no description."; |
|
156 | - ?> |
|
154 | + if(empty(trim($_user['bio']))) |
|
155 | + $_user['bio'] = "This user has no description."; |
|
156 | + ?> |
|
157 | 157 | <div id="content"> |
158 | 158 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
159 | 159 | <div class="content" id="recommended-channels-list"></div> |
@@ -312,20 +312,20 @@ discard block |
||
312 | 312 | </div> |
313 | 313 | <ol> |
314 | 314 | <?php |
315 | - $_playlist['videos'] = json_decode($_playlist['videos']); |
|
316 | - $_playlist['count'] = 1; |
|
317 | - foreach($_playlist['videos'] as $video) { |
|
318 | - if($__video_h->video_exists($video)) { |
|
319 | - $_video = $__video_h->fetch_video_rid($video); |
|
320 | - $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
321 | - $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
322 | - $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
323 | - $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
324 | - $_video['author'] = htmlspecialchars($_video['author']); |
|
325 | - $_video['title'] = htmlspecialchars($_video['title']); |
|
326 | - $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
327 | - $_playlist['title'] = htmlspecialchars($_playlist['title']); |
|
328 | - ?> |
|
315 | + $_playlist['videos'] = json_decode($_playlist['videos']); |
|
316 | + $_playlist['count'] = 1; |
|
317 | + foreach($_playlist['videos'] as $video) { |
|
318 | + if($__video_h->video_exists($video)) { |
|
319 | + $_video = $__video_h->fetch_video_rid($video); |
|
320 | + $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
|
321 | + $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
322 | + $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
323 | + $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
324 | + $_video['author'] = htmlspecialchars($_video['author']); |
|
325 | + $_video['title'] = htmlspecialchars($_video['title']); |
|
326 | + $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
327 | + $_playlist['title'] = htmlspecialchars($_playlist['title']); |
|
328 | + ?> |
|
329 | 329 | <li class="playlist-video-item |
330 | 330 | odd |
331 | 331 | "> |
@@ -480,9 +480,9 @@ discard block |
||
480 | 480 | <h2>Featured Channels</h2> |
481 | 481 | <ul class="channel-summary-list "> |
482 | 482 | <?php |
483 | - foreach($_user['featured_channels'] as $user) { |
|
484 | - if($__user_h->user_exists($user)) { |
|
485 | - ?> |
|
483 | + foreach($_user['featured_channels'] as $user) { |
|
484 | + if($__user_h->user_exists($user)) { |
|
485 | + ?> |
|
486 | 486 | <li class="yt-tile-visible yt-uix-tile"> |
487 | 487 | <div class="channel-summary clearfix channel-summary-compact"> |
488 | 488 | <div class="channel-summary-thumb"> |
@@ -506,19 +506,19 @@ discard block |
||
506 | 506 | </div> |
507 | 507 | |
508 | 508 | <?php |
509 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
510 | - $stmt->bindParam(":search", $_user['username']); |
|
511 | - $stmt->execute(); |
|
509 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
510 | + $stmt->bindParam(":search", $_user['username']); |
|
511 | + $stmt->execute(); |
|
512 | 512 | |
513 | - if($stmt->rowCount() != 0) { |
|
514 | - ?> |
|
513 | + if($stmt->rowCount() != 0) { |
|
514 | + ?> |
|
515 | 515 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
516 | 516 | <div class="module-view gh-featured"> |
517 | 517 | <h2>Featured Playlists</h2> |
518 | 518 | <?php |
519 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
520 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
521 | - ?> |
|
519 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
520 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
521 | + ?> |
|
522 | 522 | <div class="playlist yt-tile-visible yt-uix-tile"> |
523 | 523 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
524 | 524 | <span class="playlist-thumb-strip playlist-thumb-strip-252"><span class="videos videos-4 horizontal-cutoff"><span class="clip"><span class="centering-offset"><span class="centering"> |
@@ -8,10 +8,10 @@ |
||
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | 10 | <?php |
11 | - $__server->page_embeds->page_title = "SubRocks - Replace me"; |
|
12 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
11 | + $__server->page_embeds->page_title = "SubRocks - Replace me"; |
|
12 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
15 | 15 | ?> |
16 | 16 | <!DOCTYPE html> |
17 | 17 | <html> |
@@ -11,7 +11,7 @@ |
||
11 | 11 | <?php |
12 | 12 | $playlist = $__video_h->fetch_playlist_rid($_GET['playlist']); |
13 | 13 | |
14 | -if($playlist['author'] == $_SESSION['siteusername']) { |
|
14 | +if ($playlist['author'] == $_SESSION['siteusername']) { |
|
15 | 15 | $b = json_decode($playlist['videos']); |
16 | 16 | array_push($b, $_GET['id']); |
17 | 17 | $b = json_encode($b); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | <div id="content"> |
38 | 38 | <div class="guide-layout-container enable-fancy-subscribe-button"> |
39 | 39 | <div class="guide-container"> |
40 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
40 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
41 | 41 | <div id="guide-builder-promo"> |
42 | 42 | <h2> |
43 | 43 | Sign in to add channels to your homepage |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | </div> |
57 | 57 | <div class="guide"> |
58 | 58 | <?php |
59 | - if(isset($_SESSION['siteusername'])) { |
|
59 | + if (isset($_SESSION['siteusername'])) { |
|
60 | 60 | ?> |
61 | 61 | <div style="/*! margin-top: 0px; *//*! margin-left: 10px; *//*! margin-bottom: 13px; */height: 99px;" class="guide-section feed-header channel first"><img alt="" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_SESSION['siteusername']); ?>" style="height: 88px;position: relative;top: 4px;left: 4px;" class="feed-header-thumb channel-thumb" width="88px"><div id="links" style="/*! margin-left: 5px; */position: relative;left: 13px;top: 7px;"><div style="font-size: 11px;margin-bottom: 6px;" class="metadata"> |
62 | 62 | <a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | </span> |
168 | 168 | </a> |
169 | 169 | </li> |
170 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
171 | - <?php foreach($__server->featured_channels as $channel) { ?> |
|
170 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
171 | + <?php foreach ($__server->featured_channels as $channel) { ?> |
|
172 | 172 | <li class="guide-item-container "> |
173 | 173 | <a class="guide-item" data-external-id="<?php echo htmlspecialchars($channel); ?>" data-feed-name="<?php echo htmlspecialchars($channel); ?>" data-feed-type="user"> |
174 | 174 | <span class="thumb"> <span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $stmt = $__db->prepare("SELECT * FROM subscribers WHERE sender = :username ORDER BY id DESC LIMIT 20"); |
184 | 184 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
185 | 185 | $stmt->execute(); |
186 | - while($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?> |
|
186 | + while ($channel = $stmt->fetch(PDO::FETCH_ASSOC)) { $channel = $channel['reciever']; ?> |
|
187 | 187 | <li class="guide-item-container "> |
188 | 188 | <a class="guide-item" data-external-id="<?php echo htmlspecialchars($channel); ?>" data-feed-name="<?php echo htmlspecialchars($channel); ?>" data-feed-type="user"> |
189 | 189 | <span class="thumb"> <span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Thumbnail" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($channel); ?>" width="28"><span class="vertical-align"></span></span></span></span> |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | <?php |
223 | 223 | $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 4"); |
224 | 224 | $stmt->execute(); |
225 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
225 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
226 | 226 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
227 | 227 | $video['duration'] = $__time_h->timestamp($video['duration']); |
228 | 228 | $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 featured = 'v' ORDER BY id DESC 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']); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | <?php |
279 | 279 | $stmt = $__db->prepare("SELECT * FROM videos ORDER BY id DESC LIMIT 20"); |
280 | 280 | $stmt->execute(); |
281 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
281 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
282 | 282 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
283 | 283 | $video['duration'] = $__time_h->timestamp($video['duration']); |
284 | 284 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -8,10 +8,10 @@ discard block |
||
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | 10 | <?php |
11 | - $__server->page_embeds->page_title = "SubRocks - Homepage"; |
|
12 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
11 | + $__server->page_embeds->page_title = "SubRocks - Homepage"; |
|
12 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
15 | 15 | ?> |
16 | 16 | <!DOCTYPE html> |
17 | 17 | <html> |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | </div> |
62 | 62 | <div class="guide"> |
63 | 63 | <?php |
64 | - if(isset($_SESSION['siteusername'])) { |
|
65 | - ?> |
|
64 | + if(isset($_SESSION['siteusername'])) { |
|
65 | + ?> |
|
66 | 66 | <div style="/*! margin-top: 0px; *//*! margin-left: 10px; *//*! margin-bottom: 13px; */height: 99px;" class="guide-section feed-header channel first"><img alt="" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_SESSION['siteusername']); ?>" style="height: 88px;position: relative;top: 4px;left: 4px;" class="feed-header-thumb channel-thumb" width="88px"><div id="links" style="/*! margin-left: 5px; */position: relative;left: 13px;top: 7px;"><div style="font-size: 11px;margin-bottom: 6px;" class="metadata"> |
67 | 67 | <a href="/user/<?php echo htmlspecialchars($_SESSION['siteusername']); ?>" style="color: inherit;">My channel |
68 | 68 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="see-more-arrow" alt=""></a> |
@@ -225,16 +225,16 @@ discard block |
||
225 | 225 | </p> |
226 | 226 | <ul> |
227 | 227 | <?php |
228 | - $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 4"); |
|
229 | - $stmt->execute(); |
|
230 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
231 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
232 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
233 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
234 | - $video['author'] = htmlspecialchars($video['author']); |
|
235 | - $video['title'] = htmlspecialchars($video['title']); |
|
236 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
237 | - ?> |
|
228 | + $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 4"); |
|
229 | + $stmt->execute(); |
|
230 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
231 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
232 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
233 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
234 | + $video['author'] = htmlspecialchars($video['author']); |
|
235 | + $video['title'] = htmlspecialchars($video['title']); |
|
236 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
237 | + ?> |
|
238 | 238 | <li class="video-list-item "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
239 | 239 | <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="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
240 | 240 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -248,16 +248,16 @@ discard block |
||
248 | 248 | </h3> |
249 | 249 | <ul> |
250 | 250 | <?php |
251 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' ORDER BY id DESC LIMIT 4"); |
|
252 | - $stmt->execute(); |
|
253 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
254 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
255 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
256 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
257 | - $video['author'] = htmlspecialchars($video['author']); |
|
258 | - $video['title'] = htmlspecialchars($video['title']); |
|
259 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
260 | - ?> |
|
251 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE featured = 'v' ORDER BY id DESC LIMIT 4"); |
|
252 | + $stmt->execute(); |
|
253 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
254 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
255 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
256 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
257 | + $video['author'] = htmlspecialchars($video['author']); |
|
258 | + $video['title'] = htmlspecialchars($video['title']); |
|
259 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
260 | + ?> |
|
261 | 261 | <li class="video-list-item "><a href="/watch?v=<?php echo $video['rid']; ?>" class="video-list-item-link yt-uix-sessionlink" data-sessionlink="ei=CNLr3rbS3rICFSwSIQodSW397Q%3D%3D&feature=g-sptl%26cid%3Dinp-hs-ytg"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><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="yuTBQ86r8o0" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
263 | 263 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -281,16 +281,16 @@ discard block |
||
281 | 281 | <div class="feed-page"> |
282 | 282 | <ul> |
283 | 283 | <?php |
284 | - $stmt = $__db->prepare("SELECT * FROM videos ORDER BY id DESC LIMIT 20"); |
|
285 | - $stmt->execute(); |
|
286 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
287 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
288 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
289 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
290 | - $video['author'] = htmlspecialchars($video['author']); |
|
291 | - $video['title'] = htmlspecialchars($video['title']); |
|
292 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
293 | - ?> |
|
284 | + $stmt = $__db->prepare("SELECT * FROM videos ORDER BY id DESC LIMIT 20"); |
|
285 | + $stmt->execute(); |
|
286 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
287 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
288 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
289 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
290 | + $video['author'] = htmlspecialchars($video['author']); |
|
291 | + $video['title'] = htmlspecialchars($video['title']); |
|
292 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
293 | + ?> |
|
294 | 294 | <li> |
295 | 295 | <div class="feed-item-container first " data-channel-key="UCR2A9ZNliJfgC66IvIpe-Zw"> |
296 | 296 | <div class="feed-author-bubble-container"> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | <a id="logo-container" href="/" title="SubRocks home"> |
6 | 6 | <img id="logo" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="SubRocks 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 | <div id="masthead-user-display"><span id="masthead-user-wrapper"><button href="/sign_in" type="button" id="masthead-user-button" onclick=";window.location.href=this.getAttribute('href');return false;" class=" yt-uix-button yt-uix-button-text" role="button"><span class="yt-uix-button-content"> <span id="masthead-user-image"> |
11 | 11 | <span class="clip"> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | <span id="yt-masthead-user-displayname" dir="ltr" class="yt-valign-container" onclick="yt.www.masthead.toggleExpandedMasthead();"> |
24 | 24 | <?php echo htmlspecialchars($_SESSION['siteusername']); ?> |
25 | 25 | </span> |
26 | - <?php if($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?> |
|
26 | + <?php if ($__user_h->fetch_unread_pms($_SESSION['siteusername']) != 0) { ?> |
|
27 | 27 | <a style="border-radius:2px;font-weight:bold;border:1px solid #CE4D34;position:relative;top:1px;color: white;text-decoration: none;background-color: #E26148;padding: 7px;padding-left: 10px;margin-right: 12px;display: inline;" href="/inbox/"> |
28 | 28 | <?php echo $__user_h->fetch_unread_pms($_SESSION['siteusername']); ?> |
29 | 29 | </a> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | </form> |
46 | 46 | </div> |
47 | 47 | </div></div> |
48 | -<?php if(isset($_SESSION['siteusername'])) { ?> |
|
48 | +<?php if (isset($_SESSION['siteusername'])) { ?> |
|
49 | 49 | <div id="masthead-expanded" class="hid" style="display: none;"> |
50 | 50 | <div id="masthead-expanded-container" class="with-sandbar"> |
51 | 51 | <div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="4" |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); |
67 | 67 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
68 | 68 | $stmt->execute(); |
69 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
69 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
70 | 70 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
71 | 71 | $video['duration'] = $__time_h->timestamp($video['duration']); |
72 | 72 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | <?php } ?> |
211 | 211 | </div> |
212 | 212 | <div id="alerts"> |
213 | - <?php if(isset($error['status'])) { ?> |
|
213 | + <?php if (isset($error['status'])) { ?> |
|
214 | 214 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error yt-alert-player"> <div class="yt-alert-icon"> |
215 | 215 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
216 | 216 | </div> |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | </div> |
221 | 221 | </div></div></div> |
222 | 222 | <?php } ?> |
223 | - <?php if(isset($_GET['error'])) { ?> |
|
223 | + <?php if (isset($_GET['error'])) { ?> |
|
224 | 224 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error "> <div class="yt-alert-icon"> |
225 | 225 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
226 | 226 | </div> |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | </div> |
231 | 231 | </div></div></div> |
232 | 232 | <?php } ?> |
233 | - <?php if(isset($_GET['success'])) { ?> |
|
233 | + <?php if (isset($_GET['success'])) { ?> |
|
234 | 234 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-success "> <div class="yt-alert-icon"> |
235 | 235 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
236 | 236 | </div> |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | </div> |
241 | 241 | </div></div></div> |
242 | 242 | <?php } ?> |
243 | - <?php if(isset($_SESSION['error'])) { ?> |
|
243 | + <?php if (isset($_SESSION['error'])) { ?> |
|
244 | 244 | <div id="masthead_child_div"><div class="yt-alert yt-alert-default yt-alert-error"> <div class="yt-alert-icon"> |
245 | 245 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
246 | 246 | </div> |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | "db_connected" => false, |
22 | 22 | ], |
23 | 23 | |
24 | - "video_properties" => (object) [ "status" => "unloaded" ], |
|
25 | - "user_properties" => (object) [ "status" => "unloaded" ], |
|
26 | - "group_properties" => (object) [ "status" => "unloaded" ], |
|
27 | - "forum_properties" => (object) [ "status" => "unloaded" ], |
|
24 | + "video_properties" => (object) ["status" => "unloaded"], |
|
25 | + "user_properties" => (object) ["status" => "unloaded"], |
|
26 | + "group_properties" => (object) ["status" => "unloaded"], |
|
27 | + "forum_properties" => (object) ["status" => "unloaded"], |
|
28 | 28 | ]; |
29 | 29 | |
30 | 30 | try |
31 | 31 | { |
32 | - $__db = new PDO("mysql:host=".$__server->db_properties->db_host.";dbname=".$__server->db_properties->db_database.";charset=utf8mb4", |
|
32 | + $__db = new PDO("mysql:host=" . $__server->db_properties->db_host . ";dbname=" . $__server->db_properties->db_database . ";charset=utf8mb4", |
|
33 | 33 | $__server->db_properties->db_user, |
34 | 34 | $__server->db_properties->db_password, |
35 | 35 | [ |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | ); |
40 | 40 | $__server->db_properties->db_connected = true; |
41 | 41 | } |
42 | - catch(PDOException $e) |
|
42 | + catch (PDOException $e) |
|
43 | 43 | { |
44 | - die("An error occured connecting to the database: ".$e->getMessage()); |
|
44 | + die("An error occured connecting to the database: " . $e->getMessage()); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | session_start(); |
@@ -38,8 +38,7 @@ |
||
38 | 38 | ] |
39 | 39 | ); |
40 | 40 | $__server->db_properties->db_connected = true; |
41 | - } |
|
42 | - catch(PDOException $e) |
|
41 | + } catch(PDOException $e) |
|
43 | 42 | { |
44 | 43 | die("An error occured connecting to the database: ".$e->getMessage()); |
45 | 44 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | <?php $__user_h = new user_helper($__db); ?> |
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | -<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
10 | +<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
11 | 11 | <?php |
12 | 12 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
13 | 13 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | </h4> |
81 | 81 | </div> |
82 | 82 | </div> |
83 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
83 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
84 | 84 | <div class="comments-post-container clearfix"> |
85 | 85 | <div class="comments-post-alert"> |
86 | 86 | <a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span> |
87 | 87 | </div> |
88 | 88 | </div> |
89 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
89 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
90 | 90 | <div class="comments-post-container clearfix"> |
91 | 91 | <div class="comments-post-alert"> |
92 | 92 | This video has comemnting disabled! |
93 | 93 | </div> |
94 | 94 | </div> |
95 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
95 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
96 | 96 | <div class="comments-post-container clearfix"> |
97 | 97 | <div class="comments-post-alert"> |
98 | 98 | This user has blocked you! |
@@ -139,15 +139,15 @@ discard block |
||
139 | 139 | $stmt->execute(); |
140 | 140 | |
141 | 141 | $number_of_result = $stmt->rowCount(); |
142 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
142 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
143 | 143 | |
144 | - if (!isset ($_GET['page']) ) { |
|
144 | + if (!isset ($_GET['page'])) { |
|
145 | 145 | $page = 1; |
146 | 146 | } else { |
147 | - $page = (int)$_GET['page']; |
|
147 | + $page = (int) $_GET['page']; |
|
148 | 148 | } |
149 | 149 | |
150 | - $page_first_result = ($page - 1) * $results_per_page; |
|
150 | + $page_first_result = ($page - 1)*$results_per_page; |
|
151 | 151 | |
152 | 152 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
153 | 153 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $stmt->bindParam(":pper", $results_per_page); |
156 | 156 | $stmt->execute(); |
157 | 157 | |
158 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
158 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
159 | 159 | ?> |
160 | 160 | |
161 | 161 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0"> |
@@ -11,23 +11,23 @@ |
||
11 | 11 | <?php |
12 | 12 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
13 | 13 | $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']); |
14 | - $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
15 | - $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
16 | - $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
17 | - $_video['author'] = htmlspecialchars($_video['author']); |
|
18 | - $_video['title'] = htmlspecialchars($_video['title']); |
|
19 | - $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
14 | + $_video['age'] = $__time_h->time_elapsed_string($_video['publish']); |
|
15 | + $_video['duration'] = $__time_h->timestamp($_video['duration']); |
|
16 | + $_video['views'] = $__video_h->fetch_video_views($_video['rid']); |
|
17 | + $_video['author'] = htmlspecialchars($_video['author']); |
|
18 | + $_video['title'] = htmlspecialchars($_video['title']); |
|
19 | + $_video['description'] = $__video_h->shorten_description($_video['description'], 50); |
|
20 | 20 | |
21 | - $__server->page_embeds->page_title = "SubRocks - All Comments"; |
|
22 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
23 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
24 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
21 | + $__server->page_embeds->page_title = "SubRocks - All Comments"; |
|
22 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
23 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
24 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
25 | 25 | ?> |
26 | 26 | <?php |
27 | - $__server->page_embeds->page_title = "SubRocks - All Comments"; |
|
28 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
29 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
30 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
27 | + $__server->page_embeds->page_title = "SubRocks - All Comments"; |
|
28 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
29 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
30 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
31 | 31 | ?> |
32 | 32 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
33 | 33 | <!DOCTYPE html> |
@@ -24,33 +24,33 @@ discard block |
||
24 | 24 | 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; } |
25 | 25 | |
26 | 26 | if(!isset($error['message'])) { |
27 | - $text = $_POST['comment']; |
|
27 | + $text = $_POST['comment']; |
|
28 | 28 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
29 | 29 | $stmt->bindParam(":v", $_GET['v']); |
30 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
31 | - $stmt->bindParam(":comment", $text); |
|
30 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
31 | + $stmt->bindParam(":comment", $text); |
|
32 | 32 | $stmt->execute(); |
33 | 33 | |
34 | - $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
35 | - $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
34 | + $__user_u->update_cooldown_time($_SESSION['siteusername'], "cooldown_comment"); |
|
35 | + $__user_i->send_message($_SESSION['siteusername'], "New comment", $_video['author'], "I commented \"" . $_POST['comment'] . "\" on your video!", $_video['rid'], "nt"); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | - /* |
|
39 | + /* |
|
40 | 40 | PREPARE EMBEDS CLASS -- function(string $page_title, string $page_description...) |
41 | 41 | Returns a list of arrays for compatibility purposes & but downside is ugly for loop codes |
42 | 42 | Work on this tomorrow or some shit idk lol |
43 | 43 | */ |
44 | 44 | |
45 | - /* |
|
45 | + /* |
|
46 | 46 | USE THE GOD DAMN __CONFIG MORE -- idiot |
47 | 47 | Work on this tomorrow or some shit |
48 | 48 | */ |
49 | 49 | |
50 | - $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
51 | - $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
52 | - $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
53 | - $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
50 | + $__server->page_embeds->page_title = htmlspecialchars($_video['title']); |
|
51 | + $__server->page_embeds->page_description = htmlspecialchars($_video['description']); |
|
52 | + $__server->page_embeds->page_image = "/dynamic/thumbs/" . $_video['thumbnail']; |
|
53 | + $__server->page_embeds->page_url = "https://subrock.rocks/watch?v=" . htmlspecialchars($_video['rid']); |
|
54 | 54 | ?> |
55 | 55 | <!DOCTYPE html> |
56 | 56 | <html> |
@@ -80,29 +80,29 @@ discard block |
||
80 | 80 | if (window.yt.timing) {yt.timing.tick("ct");} |
81 | 81 | </script> |
82 | 82 | <?php |
83 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
84 | - $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
83 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
84 | + $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
|
85 | 85 | |
86 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
87 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
86 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
87 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
88 | 88 | |
89 | - $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
90 | - $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
89 | + $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
|
90 | + $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
|
91 | 91 | |
92 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
93 | - $_video['likeswidth'] = 50; |
|
94 | - $_video['dislikeswidth'] = 50; |
|
95 | - } else { |
|
96 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
97 | - $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
98 | - } |
|
92 | + if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
93 | + $_video['likeswidth'] = 50; |
|
94 | + $_video['dislikeswidth'] = 50; |
|
95 | + } else { |
|
96 | + $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
97 | + $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
|
98 | + } |
|
99 | 99 | |
100 | - $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
101 | - $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
102 | - $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
103 | - $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
104 | - $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
105 | - ?> |
|
100 | + $_video['liked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], true); |
|
101 | + $_video['disliked'] = $__video_h->if_liked(@$_SESSION['siteusername'], $_video['rid'], false); |
|
102 | + $_video['author_videos'] = $__video_h->fetch_user_videos($_video['author']); |
|
103 | + $_video['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_video['author']); |
|
104 | + $_video['favorited'] = $__video_h->if_favorited(@$_SESSION['siteusername'], $_video['rid']); |
|
105 | + ?> |
|
106 | 106 | </head> |
107 | 107 | <body id="" class="date-20120927 en_US ltr ytg-old-clearfix guide-feed-v2 gecko gecko-15" dir="ltr"> |
108 | 108 | <form name="logoutForm" method="POST" action="/logout"> |
@@ -324,21 +324,21 @@ discard block |
||
324 | 324 | <hr><br> |
325 | 325 | <h3>Add to a Playlist</h3> |
326 | 326 | <?php |
327 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
328 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
329 | - $stmt->execute(); |
|
330 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
331 | - $buffer = json_decode($playlist['videos']); |
|
332 | - @$rid = $buffer[0]; |
|
333 | - if(!empty($rid)) { |
|
334 | - @$video = $__video_h->fetch_video_rid($rid); |
|
335 | - } else { |
|
336 | - $video['thumbnail'] = ""; |
|
337 | - $video['duration'] = 0; |
|
338 | - } |
|
327 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
328 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
329 | + $stmt->execute(); |
|
330 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
331 | + $buffer = json_decode($playlist['videos']); |
|
332 | + @$rid = $buffer[0]; |
|
333 | + if(!empty($rid)) { |
|
334 | + @$video = $__video_h->fetch_video_rid($rid); |
|
335 | + } else { |
|
336 | + $video['thumbnail'] = ""; |
|
337 | + $video['duration'] = 0; |
|
338 | + } |
|
339 | 339 | |
340 | - $videos = count($buffer); |
|
341 | - ?> |
|
340 | + $videos = count($buffer); |
|
341 | + ?> |
|
342 | 342 | <a href="/get/add_to_playlist?id=<?php echo $_video['rid']; ?>&playlist=<?php echo $playlist['rid']; ?>">Add to <?php echo htmlspecialchars($playlist['title']); ?></a> |
343 | 343 | <?php } ?> |
344 | 344 | <?php } ?> |
@@ -603,10 +603,10 @@ discard block |
||
603 | 603 | </div> |
604 | 604 | </div> |
605 | 605 | <?php |
606 | - $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
607 | - $stmt->bindParam(":v", $_GET['v']); |
|
608 | - $stmt->execute(); |
|
609 | - ?> |
|
606 | + $stmt = $__db->prepare("SELECT * FROM video_response WHERE toid = :v ORDER BY id DESC LIMIT 4"); |
|
607 | + $stmt->bindParam(":v", $_GET['v']); |
|
608 | + $stmt->execute(); |
|
609 | + ?> |
|
610 | 610 | |
611 | 611 | <?php if($stmt->rowCount() != 0) { ?> |
612 | 612 | <div class="comments-section"> |
@@ -616,16 +616,16 @@ discard block |
||
616 | 616 | <h4>Video Responses</h4> |
617 | 617 | <ul class="video-list"> |
618 | 618 | <?php |
619 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
620 | - if($__video_h->video_exists($video['video'])) { |
|
621 | - $video = $__video_h->fetch_video_rid($video['video']); |
|
622 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
623 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
624 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
625 | - $video['author'] = htmlspecialchars($video['author']); |
|
626 | - $video['title'] = htmlspecialchars($video['title']); |
|
627 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
628 | - ?> |
|
619 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
620 | + if($__video_h->video_exists($video['video'])) { |
|
621 | + $video = $__video_h->fetch_video_rid($video['video']); |
|
622 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
623 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
624 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
625 | + $video['author'] = htmlspecialchars($video['author']); |
|
626 | + $video['title'] = htmlspecialchars($video['title']); |
|
627 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
628 | + ?> |
|
629 | 629 | <li class="video-list-item yt-tile-default"> |
630 | 630 | <a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink yt-uix-sessionlink" data-sessionlink="<?php echo htmlspecialchars($_video['author']); ?>&feature=watch_response"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
631 | 631 | <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="cjls0QsHOBE" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
@@ -707,31 +707,31 @@ discard block |
||
707 | 707 | </div> |
708 | 708 | <ul class="comment-list" id="live_comments"> |
709 | 709 | <?php |
710 | - $results_per_page = 20; |
|
710 | + $results_per_page = 20; |
|
711 | 711 | |
712 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
713 | - $stmt->bindParam(":rid", $_video['rid']); |
|
714 | - $stmt->execute(); |
|
712 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC"); |
|
713 | + $stmt->bindParam(":rid", $_video['rid']); |
|
714 | + $stmt->execute(); |
|
715 | 715 | |
716 | - $number_of_result = $stmt->rowCount(); |
|
717 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
716 | + $number_of_result = $stmt->rowCount(); |
|
717 | + $number_of_page = ceil ($number_of_result / $results_per_page); |
|
718 | 718 | |
719 | - if (!isset ($_GET['page']) ) { |
|
720 | - $page = 1; |
|
721 | - } else { |
|
722 | - $page = (int)$_GET['page']; |
|
723 | - } |
|
719 | + if (!isset ($_GET['page']) ) { |
|
720 | + $page = 1; |
|
721 | + } else { |
|
722 | + $page = (int)$_GET['page']; |
|
723 | + } |
|
724 | 724 | |
725 | - $page_first_result = ($page - 1) * $results_per_page; |
|
725 | + $page_first_result = ($page - 1) * $results_per_page; |
|
726 | 726 | |
727 | - $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
728 | - $stmt->bindParam(":rid", $_video['rid']); |
|
729 | - $stmt->bindParam(":pfirst", $page_first_result); |
|
730 | - $stmt->bindParam(":pper", $results_per_page); |
|
731 | - $stmt->execute(); |
|
727 | + $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
|
728 | + $stmt->bindParam(":rid", $_video['rid']); |
|
729 | + $stmt->bindParam(":pfirst", $page_first_result); |
|
730 | + $stmt->bindParam(":pper", $results_per_page); |
|
731 | + $stmt->execute(); |
|
732 | 732 | |
733 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
734 | - ?> |
|
733 | + while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
734 | + ?> |
|
735 | 735 | |
736 | 736 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0"> |
737 | 737 | <div class="comment-body"> |
@@ -810,16 +810,16 @@ discard block |
||
810 | 810 | <ul id="watch-related" class="video-list"> |
811 | 811 | <div id="ppv-container" class="hid"></div> |
812 | 812 | <?php |
813 | - $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
814 | - $stmt->execute(); |
|
815 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
816 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
817 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
818 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
819 | - $video['author'] = htmlspecialchars($video['author']); |
|
820 | - $video['title'] = htmlspecialchars($video['title']); |
|
821 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
822 | - ?> |
|
813 | + $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
|
814 | + $stmt->execute(); |
|
815 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
816 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
817 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
818 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
819 | + $video['author'] = htmlspecialchars($video['author']); |
|
820 | + $video['title'] = htmlspecialchars($video['title']); |
|
821 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
822 | + ?> |
|
823 | 823 | <li class="video-list-item"><a href="/watch?v=<?php echo $video['rid']; ?>" class="related-video yt-uix-contextlink yt-uix-sessionlink" data-sessionlink="ved=CAIQzRooAA%3D%3D&<?php echo htmlspecialchars($_video['author']); ?>&feature=relmfu"><span class="ux-thumb-wrap contains-addto "><span class="video-thumb ux-thumb yt-thumb-default-120 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo $video['title']; ?>" onerror="this.onerror=null;this.src='/dynamic/thumbs/default.jpg';" data-thumb="/dynamic/thumbs/<?php echo $video['thumbnail']; ?>" width="120"><span class="vertical-align"></span></span></span></span><span class="video-time"><?php echo $video['duration']; ?></span> |
824 | 824 | <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="gyAaIKF6tSQ" role="button"><span class="yt-uix-button-content"> <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="Watch Later"> |
825 | 825 | </span><img class="yt-uix-button-arrow" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""></button> |
@@ -11,19 +11,19 @@ discard block |
||
11 | 11 | <?php $__user_u = new user_update($__db); ?> |
12 | 12 | <?php $__db_h = new db_helper(); ?> |
13 | 13 | <?php $__time_h = new time_helper(); ?> |
14 | -<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
14 | +<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?> |
|
15 | 15 | <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?> |
16 | 16 | <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?> |
17 | 17 | <?php |
18 | - if($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
18 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
19 | 19 | $error = array(); |
20 | 20 | |
21 | - if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
22 | - if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
23 | - if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
24 | - 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; } |
|
21 | + if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; } |
|
22 | + if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; } |
|
23 | + if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; } |
|
24 | + 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; } |
|
25 | 25 | |
26 | - if(!isset($error['message'])) { |
|
26 | + if (!isset($error['message'])) { |
|
27 | 27 | $text = $_POST['comment']; |
28 | 28 | $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)"); |
29 | 29 | $stmt->bindParam(":v", $_GET['v']); |
@@ -80,20 +80,20 @@ discard block |
||
80 | 80 | if (window.yt.timing) {yt.timing.tick("ct");} |
81 | 81 | </script> |
82 | 82 | <?php |
83 | - $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
83 | + $_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1); |
|
84 | 84 | $_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2); |
85 | 85 | |
86 | - $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
87 | - $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
86 | + $_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4); |
|
87 | + $_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5); |
|
88 | 88 | |
89 | 89 | $_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false); |
90 | 90 | $_video['likes'] += $__video_h->get_video_likes($_video['rid'], true); |
91 | 91 | |
92 | - if($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
92 | + if ($_video['likes'] == 0 && $_video['dislikes'] == 0) { |
|
93 | 93 | $_video['likeswidth'] = 50; |
94 | 94 | $_video['dislikeswidth'] = 50; |
95 | 95 | } else { |
96 | - $_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100; |
|
96 | + $_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100; |
|
97 | 97 | $_video['dislikeswidth'] = 100 - $_video['likeswidth']; |
98 | 98 | } |
99 | 99 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | </div> |
128 | 128 | <div id="instream_google_companion_ad_div"></div> |
129 | 129 | </div> |
130 | - <?php if(@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
130 | + <?php if (@$_SESSION['siteusername'] == $_video['author']) { ?> |
|
131 | 131 | <div id="watch-owner-container"> |
132 | 132 | <div id="masthead-subnav" class="yt-nav yt-nav-dark "> |
133 | 133 | <ul class="yt-nav-aside"> |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | title="" |
163 | 163 | id="subscribe-button" |
164 | 164 | type="button" |
165 | - class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
165 | + class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button yt-uix-button yt-uix-button-subscription yt-uix-tooltip" |
|
166 | 166 | role="button"> |
167 | 167 | <span class="yt-uix-button-icon-wrapper"> |
168 | 168 | <img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt=""> |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | <button onclick=";like_video();return false;" |
244 | 244 | title="I like this" |
245 | 245 | type="button" |
246 | - class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
246 | + class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip" |
|
247 | 247 | id="watch-like" |
248 | 248 | href="/get/like_video?v=<?php echo $_video['rid']; ?>" |
249 | 249 | role="button"><span class="yt-uix-button-icon-wrapper"> |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | type="button" |
258 | 258 | style="margin-left: -2px;" |
259 | 259 | href="/get/dislike_video?v=<?php echo $_video['rid']; ?>" |
260 | - class="end yt-uix-tooltip-reverse <?php if($_video['disliked']) { echo "unliked "; } ?> yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" |
|
260 | + class="end yt-uix-tooltip-reverse <?php if ($_video['disliked']) { echo "unliked "; } ?> yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" |
|
261 | 261 | id="watch-unlike" |
262 | 262 | role="button"> |
263 | 263 | <span class="yt-uix-button-icon-wrapper"> |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | not implemented ismnf |
276 | 276 | </div> |
277 | 277 | <div id="watch-actions-logged-out" class="watch-actions-panel hid"> |
278 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
278 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
279 | 279 | <div class="yt-alert yt-alert-naked yt-alert-warn "> |
280 | 280 | <div class="yt-alert-icon"> |
281 | 281 | <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon"> |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | <?php } else { ?> |
292 | 292 | <h3>Be friends with the creator</h3> |
293 | 293 | |
294 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
294 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
295 | 295 | <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>"> |
296 | 296 | <span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;"> |
297 | 297 | <b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br> |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | </span><br><br> |
306 | 306 | <?php } ?> |
307 | 307 | |
308 | - <?php if($_SESSION['siteusername'] != $_video['author']) { ?> |
|
309 | - <?php if($_video['friended'] == false) { ?> |
|
308 | + <?php if ($_SESSION['siteusername'] != $_video['author']) { ?> |
|
309 | + <?php if ($_video['friended'] == false) { ?> |
|
310 | 310 | <a href="/friends">Send a friend request</a> |
311 | 311 | <?php } else { ?> |
312 | 312 | Your friend request is pending. |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | <?php } ?> |
317 | 317 | <hr><br> |
318 | 318 | <h3>Add to Favorites</h3> |
319 | - <?php if($_video['favorited'] == false) { ?> |
|
319 | + <?php if ($_video['favorited'] == false) { ?> |
|
320 | 320 | <a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a> |
321 | 321 | <?php } else { ?> |
322 | 322 | <a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a> |
@@ -327,10 +327,10 @@ discard block |
||
327 | 327 | $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20"); |
328 | 328 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
329 | 329 | $stmt->execute(); |
330 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
330 | + while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
331 | 331 | $buffer = json_decode($playlist['videos']); |
332 | 332 | @$rid = $buffer[0]; |
333 | - if(!empty($rid)) { |
|
333 | + if (!empty($rid)) { |
|
334 | 334 | @$video = $__video_h->fetch_video_rid($rid); |
335 | 335 | } else { |
336 | 336 | $video['thumbnail'] = ""; |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | $stmt->execute(); |
609 | 609 | ?> |
610 | 610 | |
611 | - <?php if($stmt->rowCount() != 0) { ?> |
|
611 | + <?php if ($stmt->rowCount() != 0) { ?> |
|
612 | 612 | <div class="comments-section"> |
613 | 613 | <a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>"> |
614 | 614 | see all |
@@ -616,8 +616,8 @@ discard block |
||
616 | 616 | <h4>Video Responses</h4> |
617 | 617 | <ul class="video-list"> |
618 | 618 | <?php |
619 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
620 | - if($__video_h->video_exists($video['video'])) { |
|
619 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
620 | + if ($__video_h->video_exists($video['video'])) { |
|
621 | 621 | $video = $__video_h->fetch_video_rid($video['video']); |
622 | 622 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
623 | 623 | $video['duration'] = $__time_h->timestamp($video['duration']); |
@@ -648,19 +648,19 @@ discard block |
||
648 | 648 | </h4> |
649 | 649 | </div> |
650 | 650 | </div> |
651 | - <?php if(!isset($_SESSION['siteusername'])) { ?> |
|
651 | + <?php if (!isset($_SESSION['siteusername'])) { ?> |
|
652 | 652 | <div class="comments-post-container clearfix"> |
653 | 653 | <div class="comments-post-alert"> |
654 | 654 | <a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span> |
655 | 655 | </div> |
656 | 656 | </div> |
657 | - <?php } else if($_video['commenting'] == "d") { ?> |
|
657 | + <?php } else if ($_video['commenting'] == "d") { ?> |
|
658 | 658 | <div class="comments-post-container clearfix"> |
659 | 659 | <div class="comments-post-alert"> |
660 | 660 | This video has comemnting disabled! |
661 | 661 | </div> |
662 | 662 | </div> |
663 | - <?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
663 | + <?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?> |
|
664 | 664 | <div class="comments-post-container clearfix"> |
665 | 665 | <div class="comments-post-alert"> |
666 | 666 | This user has blocked you! |
@@ -714,15 +714,15 @@ discard block |
||
714 | 714 | $stmt->execute(); |
715 | 715 | |
716 | 716 | $number_of_result = $stmt->rowCount(); |
717 | - $number_of_page = ceil ($number_of_result / $results_per_page); |
|
717 | + $number_of_page = ceil($number_of_result/$results_per_page); |
|
718 | 718 | |
719 | - if (!isset ($_GET['page']) ) { |
|
719 | + if (!isset ($_GET['page'])) { |
|
720 | 720 | $page = 1; |
721 | 721 | } else { |
722 | - $page = (int)$_GET['page']; |
|
722 | + $page = (int) $_GET['page']; |
|
723 | 723 | } |
724 | 724 | |
725 | - $page_first_result = ($page - 1) * $results_per_page; |
|
725 | + $page_first_result = ($page - 1)*$results_per_page; |
|
726 | 726 | |
727 | 727 | $stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper"); |
728 | 728 | $stmt->bindParam(":rid", $_video['rid']); |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | $stmt->bindParam(":pper", $results_per_page); |
731 | 731 | $stmt->execute(); |
732 | 732 | |
733 | - while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
733 | + while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
734 | 734 | ?> |
735 | 735 | |
736 | 736 | <li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0"> |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | <?php |
813 | 813 | $stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20"); |
814 | 814 | $stmt->execute(); |
815 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
815 | + while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
816 | 816 | $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
817 | 817 | $video['duration'] = $__time_h->timestamp($video['duration']); |
818 | 818 | $video['views'] = $__video_h->fetch_video_views($video['rid']); |
@@ -8,10 +8,10 @@ |
||
8 | 8 | <?php $__db_h = new db_helper(); ?> |
9 | 9 | <?php $__time_h = new time_helper(); ?> |
10 | 10 | <?php |
11 | - $__server->page_embeds->page_title = "SubRocks - Sign Up"; |
|
12 | - $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | - $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | - $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
11 | + $__server->page_embeds->page_title = "SubRocks - Sign Up"; |
|
12 | + $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube."; |
|
13 | + $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png"; |
|
14 | + $__server->page_embeds->page_url = "https://subrock.rocks/"; |
|
15 | 15 | ?> |
16 | 16 | <!DOCTYPE html> |
17 | 17 | <html> |