@@ -36,8 +36,9 @@ |
||
36 | 36 | </div> |
37 | 37 | <ol class="navigation-menu"> |
38 | 38 | <?php foreach($__tabs as $_tab) { |
39 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
40 | - $_tab->selected = true; |
|
39 | + if($_SERVER['REQUEST_URI'] != $_tab->url) { |
|
40 | + $_tab->selected = true; |
|
41 | + } |
|
41 | 42 | ?> |
42 | 43 | <li class="menu-item"> |
43 | 44 | <a class="<?php echo $_tab->selected ? true : "selected"; ?>" href="<?php echo $_tab->url; ?>"> |
@@ -15,11 +15,13 @@ discard block |
||
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($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) |
|
19 | - header("Location: /"); |
|
18 | + if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) { |
|
19 | + header("Location: /"); |
|
20 | + } |
|
20 | 21 | |
21 | - if(isset($_SESSION['siteusername'])) |
|
22 | - $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
22 | + if(isset($_SESSION['siteusername'])) { |
|
23 | + $__video_h->check_view($_GET['v'], @$_SESSION['siteusername']); |
|
24 | + } |
|
23 | 25 | |
24 | 26 | $_SESSION['current_video'] = $_video['rid']; |
25 | 27 | |
@@ -162,11 +164,12 @@ discard block |
||
162 | 164 | if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; } |
163 | 165 | |
164 | 166 | while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { |
165 | - if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") |
|
166 | - echo " |
|
167 | + if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") { |
|
168 | + echo " |
|
167 | 169 | <a style='font-size:10px;' href='/user/" . htmlspecialchars($username['username']) . "'>" . |
168 | 170 | htmlspecialchars($username['username']) |
169 | 171 | . "</a><br>"; |
172 | + } |
|
170 | 173 | } |
171 | 174 | ?> |
172 | 175 | <hr> |
@@ -777,10 +780,11 @@ discard block |
||
777 | 780 | $stmt->execute(); |
778 | 781 | |
779 | 782 | while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
780 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
781 | - $comment['liked'] = true; |
|
782 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
783 | - $comment['disliked'] = true; |
|
783 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) { |
|
784 | + $comment['liked'] = true; |
|
785 | + } else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) { |
|
786 | + $comment['disliked'] = true; |
|
787 | + } |
|
784 | 788 | |
785 | 789 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
786 | 790 | $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | - if(isset($_SESSION['siteusername'])) |
|
3 | - if(!$__user_h->user_exists($_SESSION['siteusername'])) |
|
2 | + if(isset($_SESSION['siteusername'])) { |
|
3 | + if(!$__user_h->user_exists($_SESSION['siteusername'])) |
|
4 | 4 | header("Location: /logout"); |
5 | + } |
|
5 | 6 | |
6 | 7 | if(isset($_SESSION['siteusername'])) { |
7 | 8 | $stmt = $__db->prepare("UPDATE users SET ip = :ip WHERE username = :username"); |