@@ -1,14 +1,14 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(isset($_SESSION['siteusername'])) { |
|
| 2 | + if(isset($_SESSION['siteusername'])) { |
|
| 3 | 3 | $stmt = $__db->prepare("UPDATE users SET ip = :ip WHERE username = :username"); |
| 4 | 4 | $stmt->bindParam(":username", $_SESSION['siteusername']); |
| 5 | - $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
|
| 5 | + $stmt->bindParam(":ip", $_SERVER["HTTP_CF_CONNECTING_IP"]); |
|
| 6 | 6 | $stmt->execute(); |
| 7 | - } |
|
| 7 | + } |
|
| 8 | 8 | |
| 9 | - if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) { |
|
| 10 | - die("<a href='/logout'>Your user has been deleted. Logout</a>"); |
|
| 11 | - } |
|
| 9 | + if(isset($_SESSION['siteusername']) && !$__user_h->user_exists(@$_SESSION['siteusername'])) { |
|
| 10 | + die("<a href='/logout'>Your user has been deleted. Logout</a>"); |
|
| 11 | + } |
|
| 12 | 12 | ?> |
| 13 | 13 | <!-- begin masthead --> |
| 14 | 14 | <div id="masthead" class="" dir="ltr"> |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | <div id="masthead-expanded" class="hid" style="display: none;height: 165px;"> |
| 106 | 106 | <div id="masthead-expanded-container" style="height: 142px;" class="with-sandbar"> |
| 107 | 107 | <?php |
| 108 | - $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 109 | - $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 110 | - $stmt->execute(); |
|
| 111 | - ?> |
|
| 108 | + $stmt = $__db->prepare("SELECT * FROM videos WHERE author = :username ORDER BY id DESC LIMIT 20"); |
|
| 109 | + $stmt->bindParam(":username", $_SESSION['siteusername']); |
|
| 110 | + $stmt->execute(); |
|
| 111 | + ?> |
|
| 112 | 112 | <div class="yt-uix-slider yt-rounded" id="watch-channel-discoverbox" data-slider-slide-selected="3" data-slider-slides="<?php echo $stmt->rowCount(); ?>" |
| 113 | 113 | style=" |
| 114 | 114 | width: 580px; |
@@ -123,14 +123,14 @@ discard block |
||
| 123 | 123 | <div class="yt-uix-slider-body" style="width: 525px;"> |
| 124 | 124 | <div class="yt-uix-slider-slides"> |
| 125 | 125 | <?php |
| 126 | - while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 127 | - $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 128 | - $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 129 | - $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 130 | - $video['author'] = htmlspecialchars($video['author']); |
|
| 131 | - $video['title'] = htmlspecialchars($video['title']); |
|
| 132 | - $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 133 | - ?> |
|
| 126 | + while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 127 | + $video['age'] = $__time_h->time_elapsed_string($video['publish']); |
|
| 128 | + $video['duration'] = $__time_h->timestamp($video['duration']); |
|
| 129 | + $video['views'] = $__video_h->fetch_video_views($video['rid']); |
|
| 130 | + $video['author'] = htmlspecialchars($video['author']); |
|
| 131 | + $video['title'] = htmlspecialchars($video['title']); |
|
| 132 | + $video['description'] = $__video_h->shorten_description($video['description'], 50); |
|
| 133 | + ?> |
|
| 134 | 134 | <ul class="yt-uix-slider-slide "> |
| 135 | 135 | <li class="yt-uix-slider-slide-item "> |
| 136 | 136 | <div class="video-list-item yt-tile-default "> |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
| 53 | 53 | $stmt->bindParam(":search", $_user['username']); |
| 54 | 54 | $stmt->execute(); |
| 55 | - ?> |
|
| 55 | + ?> |
|
| 56 | 56 | <div class="playlist-info"> |
| 57 | 57 | <h2><?php echo htmlspecialchars($_user['username']); ?>'s playlists</h2> |
| 58 | 58 | <?php if($stmt->rowCount() == 0) { echo "<span style='font-size:11px;color:grey;'>This user has no playlists available currently.</span><br><br>"; } ?> |
@@ -196,13 +196,13 @@ discard block |
||
| 196 | 196 | <div class="module-view other-channels-view"> |
| 197 | 197 | <h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> |
| 198 | 198 | <?php if(@$_SESSION['siteusername'] == $_user['username']) { |
| 199 | - echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; |
|
| 200 | - } ?> |
|
| 199 | + echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; |
|
| 200 | + } ?> |
|
| 201 | 201 | <ul class="channel-summary-list "> |
| 202 | 202 | <?php |
| 203 | - foreach($_user['featured_channels'] as $user) { |
|
| 204 | - if($__user_h->user_exists($user)) { |
|
| 205 | - ?> |
|
| 203 | + foreach($_user['featured_channels'] as $user) { |
|
| 204 | + if($__user_h->user_exists($user)) { |
|
| 205 | + ?> |
|
| 206 | 206 | <li class="yt-tile-visible yt-uix-tile"> |
| 207 | 207 | <div class="channel-summary clearfix channel-summary-compact"> |
| 208 | 208 | <div class="channel-summary-thumb"> |
@@ -226,19 +226,19 @@ discard block |
||
| 226 | 226 | </div> |
| 227 | 227 | |
| 228 | 228 | <?php |
| 229 | - $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 230 | - $stmt->bindParam(":search", $_user['username']); |
|
| 231 | - $stmt->execute(); |
|
| 229 | + $stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :search ORDER BY id DESC LIMIT 10"); |
|
| 230 | + $stmt->bindParam(":search", $_user['username']); |
|
| 231 | + $stmt->execute(); |
|
| 232 | 232 | |
| 233 | - if($stmt->rowCount() != 0) { |
|
| 234 | - ?> |
|
| 233 | + if($stmt->rowCount() != 0) { |
|
| 234 | + ?> |
|
| 235 | 235 | <div class="playlists-narrow channel-module yt-uix-c3-module-container"> |
| 236 | 236 | <div class="module-view gh-featured"> |
| 237 | 237 | <h2>Featured Playlists</h2> |
| 238 | 238 | <?php |
| 239 | - while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 240 | - $playlist['videos'] = json_decode($playlist['videos']); |
|
| 241 | - ?> |
|
| 239 | + while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { |
|
| 240 | + $playlist['videos'] = json_decode($playlist['videos']); |
|
| 241 | + ?> |
|
| 242 | 242 | <div class="playlist yt-tile-visible yt-uix-tile"> |
| 243 | 243 | <a href="/view_playlist?v=<?php echo $playlist['rid']; ?>"> |
| 244 | 244 | <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"> |