@@ -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 | |
@@ -739,10 +741,11 @@ discard block |
||
| 739 | 741 | $stmt->execute(); |
| 740 | 742 | |
| 741 | 743 | while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
| 742 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 743 | - $comment['liked'] = true; |
|
| 744 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 745 | - $comment['disliked'] = true; |
|
| 744 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) { |
|
| 745 | + $comment['liked'] = true; |
|
| 746 | + } else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) { |
|
| 747 | + $comment['disliked'] = true; |
|
| 748 | + } |
|
| 746 | 749 | |
| 747 | 750 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
| 748 | 751 | $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |
@@ -8,8 +8,9 @@ |
||
| 8 | 8 | <?php $__db_h = new db_helper(); ?> |
| 9 | 9 | <?php $__time_h = new time_helper(); ?> |
| 10 | 10 | <?php |
| 11 | -if(!isset($_SESSION['siteusername'])) |
|
| 11 | +if(!isset($_SESSION['siteusername'])) { |
|
| 12 | 12 | header('Location: ' . $_SERVER['HTTP_REFERER'] . '&error=You have to be logged in to report videos.'); |
| 13 | +} |
|
| 13 | 14 | |
| 14 | 15 | $_video = $__video_h->fetch_video_rid($_GET['v']); |
| 15 | 16 | $webhookurl = $__server->discord_webhook; |