@@ -40,8 +40,9 @@ |
||
| 40 | 40 | <div id="browse-side-column" class="ytg-2col ytg-last"> |
| 41 | 41 | <ol class="navigation-menu"> |
| 42 | 42 | <?php foreach($__tabs as $_tab) { |
| 43 | - if($_SERVER['REQUEST_URI'] != $_tab->url) |
|
| 44 | - $_tab->selected = true; |
|
| 43 | + if($_SERVER['REQUEST_URI'] != $_tab->url) { |
|
| 44 | + $_tab->selected = true; |
|
| 45 | + } |
|
| 45 | 46 | ?> |
| 46 | 47 | <li class="menu-item"> |
| 47 | 48 | <a class="<?php echo $_tab->selected ? true : "selected"; ?>" href="<?php echo $_tab->url; ?>"> |
@@ -40,8 +40,7 @@ discard block |
||
| 40 | 40 | ] |
| 41 | 41 | ); |
| 42 | 42 | $__server->db_properties->db_connected = true; |
| 43 | - } |
|
| 44 | - catch(PDOException $e) |
|
| 43 | + } catch(PDOException $e) |
|
| 45 | 44 | { |
| 46 | 45 | die("An error occured connecting to the database: ".$e->getMessage()); |
| 47 | 46 | } |
@@ -55,8 +54,9 @@ discard block |
||
| 55 | 54 | |
| 56 | 55 | while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
| 57 | 56 | $ban_info = $ban; |
| 58 | - if($_SERVER['REQUEST_URI'] != "/ban") |
|
| 59 | - header("Location: /ban"); |
|
| 57 | + if($_SERVER['REQUEST_URI'] != "/ban") { |
|
| 58 | + header("Location: /ban"); |
|
| 59 | + } |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /* IP BANS */ |
@@ -66,8 +66,9 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | while($ban = $stmt->fetch(PDO::FETCH_ASSOC)) { |
| 68 | 68 | $ban_info = $ban; |
| 69 | - if($_SERVER['REQUEST_URI'] != "/ip_ban") |
|
| 70 | - header("Location: /ip_ban"); |
|
| 69 | + if($_SERVER['REQUEST_URI'] != "/ip_ban") { |
|
| 70 | + header("Location: /ip_ban"); |
|
| 71 | + } |
|
| 71 | 72 | } |
| 72 | 73 | |
| 73 | 74 | /* NOT RUNNING UNDER CF CHECK */ |
@@ -13,11 +13,13 @@ discard block |
||
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | 15 | <?php |
| 16 | - if(isset($_SESSION['siteusername'])) |
|
| 17 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 16 | + if(isset($_SESSION['siteusername'])) { |
|
| 17 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 18 | + } |
|
| 18 | 19 | |
| 19 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 20 | - header("Location: /?userdoesntexist"); |
|
| 20 | + if(!$__user_h->user_exists($_GET['n'])) { |
|
| 21 | + header("Location: /?userdoesntexist"); |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | 24 | $_user = $__user_h->fetch_user_username($_GET['n']); |
| 23 | 25 | |
@@ -40,10 +42,11 @@ discard block |
||
| 40 | 42 | |
| 41 | 43 | if ( |
| 42 | 44 | ctype_xdigit($colorCode) && |
| 43 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
|
| 44 | - return true; |
|
| 45 | - |
|
| 46 | - else return false; |
|
| 45 | + (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { |
|
| 46 | + return true; |
|
| 47 | + } else { |
|
| 48 | + return false; |
|
| 49 | + } |
|
| 47 | 50 | } |
| 48 | 51 | |
| 49 | 52 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
@@ -76,8 +79,9 @@ discard block |
||
| 76 | 79 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 77 | 80 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 78 | 81 | |
| 79 | - if(isset($_SESSION['siteusername'])) |
|
| 80 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 82 | + if(isset($_SESSION['siteusername'])) { |
|
| 83 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 84 | + } |
|
| 81 | 85 | |
| 82 | 86 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 83 | 87 | $error = array(); |
@@ -146,8 +150,9 @@ discard block |
||
| 146 | 150 | <div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 147 | 151 | <?php } ?> |
| 148 | 152 | <?php |
| 149 | - if(empty(trim($_user['bio']))) |
|
| 150 | - $_user['bio'] = "This user has no description."; |
|
| 153 | + if(empty(trim($_user['bio']))) { |
|
| 154 | + $_user['bio'] = "This user has no description."; |
|
| 155 | + } |
|
| 151 | 156 | ?> |
| 152 | 157 | <div id="content"> |
| 153 | 158 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
@@ -39,8 +39,9 @@ |
||
| 39 | 39 | $stmt->execute(); |
| 40 | 40 | |
| 41 | 41 | $__user_u->update_cooldown_time($request->username, "cooldown_comment"); |
| 42 | - if(@$request->username != $_user['author']) |
|
| 43 | - $__user_i->send_message($request->username, "New profile comment", $_user['username'], "I commented \"" . $request->touser . "\" on your profile!", "", "nt"); |
|
| 42 | + if(@$request->username != $_user['author']) { |
|
| 43 | + $__user_i->send_message($request->username, "New profile comment", $_user['username'], "I commented \"" . $request->touser . "\" on your profile!", "", "nt"); |
|
| 44 | + } |
|
| 44 | 45 | |
| 45 | 46 | header("Location: /user/" . $request->touser . "/discussion"); |
| 46 | 47 | } else { |
@@ -15,8 +15,9 @@ 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 | 22 | $__video_h->check_view($_GET['v'], @$_SERVER["HTTP_CF_CONNECTING_IP"]); |
| 22 | 23 | |
@@ -164,11 +165,12 @@ discard block |
||
| 164 | 165 | if($alts != 0) { echo "<span style='font-size:11px;color:grey;'>Alts will pop up below here...</span><br>"; } |
| 165 | 166 | |
| 166 | 167 | while($username = $stmt->fetch(PDO::FETCH_ASSOC)) { |
| 167 | - if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") |
|
| 168 | - echo " |
|
| 168 | + if($username['username'] != $_video['author'] && $username['ip'] != "0.0.0.0") { |
|
| 169 | + echo " |
|
| 169 | 170 | <a style='font-size:10px;' href='/user/" . htmlspecialchars($username['username']) . "'>" . |
| 170 | 171 | htmlspecialchars($username['username']) |
| 171 | 172 | . "</a><br>"; |
| 173 | + } |
|
| 172 | 174 | } |
| 173 | 175 | ?> |
| 174 | 176 | <hr> |
@@ -790,10 +792,11 @@ discard block |
||
| 790 | 792 | $stmt->execute(); |
| 791 | 793 | |
| 792 | 794 | while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { |
| 793 | - if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) |
|
| 794 | - $comment['liked'] = true; |
|
| 795 | - else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) |
|
| 796 | - $comment['disliked'] = true; |
|
| 795 | + if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) { |
|
| 796 | + $comment['liked'] = true; |
|
| 797 | + } else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) { |
|
| 798 | + $comment['disliked'] = true; |
|
| 799 | + } |
|
| 797 | 800 | |
| 798 | 801 | $comment['likes'] = $__video_h->get_comment_likes($comment['id'], true); |
| 799 | 802 | $comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false); |