the-real-sumsome /
witter
| 1 | <?php require($_SERVER['DOCUMENT_ROOT'] . "/static/config.inc.php"); ?> |
||
| 2 | <?php require($_SERVER['DOCUMENT_ROOT'] . "/static/conn.php"); ?> |
||
| 3 | <?php require($_SERVER['DOCUMENT_ROOT'] . "/lib/profile.php"); |
||
| 4 | //ini_set('display_errors', 1); |
||
| 5 | //ini_set('display_startup_errors', 1); |
||
| 6 | //error_reporting(E_ALL); |
||
| 7 | ?> |
||
| 8 | <!DOCTYPE html> |
||
| 9 | <html> |
||
| 10 | <head> |
||
| 11 | <link href="/static/css/required.css" rel="stylesheet"> |
||
| 12 | <title>Witter: What are you doing?</title> |
||
| 13 | <script src='https://www.google.com/recaptcha/api.js' async defer></script> |
||
| 14 | <?php $user = getUserFromName(rhandleTag($_GET['n']), $conn); ?> |
||
| 15 | <meta property="og:title" content="@<?php echo $user['username']; ?>" /> |
||
| 16 | <meta property="og:description" |
||
| 17 | content="<?php echo $user['bio']; ?>" /> |
||
| 18 | <meta property="og:image" content="https://witter.spacemy.xyz/dynamic/pfp/<?php echo $user['pfp']; ?>" /> |
||
| 19 | <script>function onLogin(token){ document.getElementById('submitform').submit(); }</script> |
||
| 20 | </head> |
||
| 21 | <body id="front"> |
||
| 22 | <div id="container"> |
||
| 23 | <?php require($_SERVER['DOCUMENT_ROOT'] . "/static/header.php"); |
||
| 24 | ini_set('display_errors', 1); |
||
| 25 | ini_set('display_startup_errors', 1); |
||
| 26 | error_reporting(E_ALL); |
||
| 27 | ?> |
||
| 28 | <div id="content"> |
||
| 29 | <?php if(!isset($_SESSION['siteusername'])) { ?> |
||
| 30 | <div style="background-color: lightyellow;" class="wrapper"> |
||
| 31 | <big><big><big>Hey there! <b><?php echo $user['username']; ?></b> is using Witter.</big></big></big><br> |
||
| 32 | <img style="float: left; margin-right: 5px;" src="/static/girl.gif">Witter is a free service that lets you keep in touch with people through the exchange of quick, frequent answers to one simple question: What are you doing? Join today to start recieving <?php echo $user['username']; ?>'s updates. |
||
| 33 | </div><br><br><br><br><br><br> |
||
| 34 | <?php } ?> |
||
| 35 | <div class="wrapper"> |
||
| 36 | <?php if($user['banstatus'] == "suspended") { ?> |
||
| 37 | <br> |
||
| 38 | <div style='padding: 5px; border: 5px solid green;'> |
||
| 39 | <h4 id='noMargin'> |
||
| 40 | This user has been suspended. |
||
| 41 | </h4> |
||
| 42 | </div> |
||
| 43 | <?php die(); ?> |
||
| 44 | <?php } ?> |
||
| 45 | <?php if(!isset($user['banstatus'])) { ?> |
||
| 46 | <br> |
||
| 47 | <div style='padding: 5px; border: 5px solid green;'> |
||
| 48 | <h4 id='noMargin'> |
||
| 49 | This user does not exist or has been permanately deleted. |
||
| 50 | </h4> |
||
| 51 | </div> |
||
| 52 | <?php die(); ?> |
||
| 53 | <?php } ?> |
||
| 54 | <div class="customtopRight"> |
||
| 55 | Name: <b><big><?php echo $user['username']; ?></big></b><br> |
||
| 56 | <table id="cols"> |
||
| 57 | <tr> |
||
| 58 | <th style="width: 33%;"> </th> |
||
| 59 | <th style="width: 33%;"> </th> |
||
| 60 | <th style="width: 33%;"> </th> |
||
| 61 | </tr> |
||
| 62 | <tr> |
||
| 63 | <td><big><big><big><b><?php echo getFollowing($user['username'], $conn); ?></b></big></big></big><br><span id="blue">following</span></td> |
||
| 64 | <td><big><big><big><b><?php echo getFollowers($user['username'], $conn); ?></b></big></big></big><br><span id="blue">followers</span></td> |
||
| 65 | <td> </td> |
||
| 66 | </tr> |
||
| 67 | </table><br> |
||
| 68 | |||
| 69 | <div class="altbg"> |
||
| 70 | <b>Tweets</b><span id="floatRight"><?php echo getWeets(rhandleTag($_GET['n']), $conn); ?></span> |
||
| 71 | </div> |
||
| 72 | <span id="blue"><a style="text-decoration: none; padding-left: 5px;color: #6d94c8;" href="/favorites.php?n=<?php echo $user['username']; ?>">Favorites</a></span> |
||
| 73 | <br><br> |
||
| 74 | <div class="altbg"> |
||
| 75 | <span id="blue">Followers</span><br> |
||
| 76 | <?php |
||
| 77 | $stmt = $conn->prepare("SELECT * FROM follow WHERE reciever = ?"); |
||
| 78 | $stmt->bind_param("s", $user['username']); |
||
| 79 | $stmt->execute(); |
||
| 80 | $result = $stmt->get_result(); |
||
| 81 | while($row = $result->fetch_assoc()) { |
||
| 82 | ?> |
||
| 83 | <a href="/u.php?n=<?php echo handleTag($row['sender']); ?>"><img style="width: 30px; height: 30px;" src="/dynamic/pfp/<?php echo getPFPFromUser($row['sender'], $conn); ?>"></a> |
||
| 84 | <?php |
||
| 85 | } |
||
| 86 | $stmt->close(); |
||
| 87 | ?> |
||
| 88 | </div><br> |
||
| 89 | <div class="altbg"> |
||
| 90 | <span id="blue">Bio</span> |
||
| 91 | <?php echo $user['bio']; ?> |
||
| 92 | </div> |
||
| 93 | </div> |
||
| 94 | <div class="customtopLeft"> |
||
| 95 | <img id="pfp" style="height: 13%; width: 13%;" src="/dynamic/pfp/<?php echo $user['pfp']; ?>"><h1 style="margin-left: 80px;"><?php echo $user['username']; ?></h1><br> |
||
| 96 | <?php if(isset($_SESSION['errorMsg'])) { echo "<div style='padding: 5px; border: 5px solid green;'><h4 id='noMargin'>" . $_SESSION['errorMsg']; unset($_SESSION['errorMsg']); echo "</h4></div><br>"; }?> |
||
| 97 | <?php |
||
| 98 | if(ifFollowing(rhandleTag($_GET['n']), @$_SESSION['siteusername'], $conn) == false) {?> |
||
| 99 | <a href="/follow.php?n=<?php echo $user['username']; ?>"><button>Follow</button></a> |
||
| 100 | <?php } else { ?> |
||
| 101 | <a href="/unfollow.php?n=<?php echo $user['username']; ?>"><button>Unfollow</button></a> |
||
| 102 | <?php } |
||
| 103 | ?> |
||
| 104 | <table id="feed"> |
||
| 105 | <tr> |
||
| 106 | <th style="width: 48px;"> </th> |
||
| 107 | <th> </th> |
||
| 108 | </tr> |
||
| 109 | <?php |
||
| 110 | $stmt = $conn->prepare("SELECT * FROM likes WHERE fromu = ?"); |
||
| 111 | $stmt->bind_param("s", $tag); |
||
| 112 | $tag = rhandleTag($_GET['n']); |
||
| 113 | $stmt->execute(); |
||
| 114 | $result = $stmt->get_result(); |
||
| 115 | if($result->num_rows === 0) echo('This user has no favorites.'); |
||
| 116 | while($row = $result->fetch_assoc()) { |
||
| 117 | $weetBuffer = getWeetFromID($row['torid'], $conn); |
||
| 118 | while($row = $result->fetch_assoc()) { |
||
| 119 | ?> |
||
| 120 | <tr> |
||
| 121 | <big><big><big> |
||
| 122 | <td> |
||
| 123 | <img id="pfp" src="/dynamic/pfp/<?php echo getPFPFromUser($weetBuffer['author'], $conn); ?>"> |
||
| 124 | </td> |
||
| 125 | <td><a href="/u.php?n=<?php echo handleTag($weetBuffer['author']); ?>"><?php echo($weetBuffer['author']); ?></a> |
||
| 126 | <?php if(returnVerifiedFromUsername($weetBuffer['author'], $conn) != "") { ?> <span style="border-radius: 10px; background-color: deepskyblue; color: white; padding: 3px;"><?php echo(returnVerifiedFromUsername($weetBuffer['author'], $conn)); ?></span> <?php } ?> |
||
| 127 | <div id="floatRight" class="dropdown"> |
||
| 128 | <span><img style="vertical-align: middle;" src="/static/witter-dotdotdot.png"></span> |
||
| 129 | <div class="dropdown-content"> |
||
| 130 | <a href="#<?php $//echo report.php?r=$weetBuffer['realid']; ?>"><img style="vertical-align: middle;" src="/static/witter-report.png"></a><br> |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 131 | <?php if(isset($_SESSION['siteusername']) && $weetBuffer['author'] == $_SESSION['siteusername']) { ?> |
||
| 132 | <a href="/delete.php?rid=<?php echo $weetBuffer['realid']; ?>"><img style="vertical-align: middle;" src="/static/witter-trash.png"></a><br> |
||
| 133 | <a href="/edit.php?rid=<?php echo $weetBuffer['realid']; ?>"><img style="vertical-align: middle;" src="/static/witter-edit.png"></a><br> |
||
| 134 | <?php } ?> |
||
| 135 | </div> |
||
| 136 | </div> |
||
| 137 | <div id="feedtext"><?php echo parseText($weetBuffer['contents']); ?> </div> |
||
| 138 | <small><?php echo time_elapsed_string($weetBuffer['date']); ?> from web |
||
| 139 | <?php if(ifLiked($_SESSION['siteusername'], $weetBuffer['id'], $conn) == true) { ?> |
||
| 140 | <a href="/unlike.php?id=<?php echo $weetBuffer['id']; ?>"><img style="vertical-align: middle;" src="/static/witter-like.png">Unlike</a> |
||
| 141 | <?php } else { ?> |
||
| 142 | <a href="/like.php?id=<?php echo $weetBuffer['id']; ?>"><img style="vertical-align: middle;" src="/static/witter-liked.png">Like</a> |
||
| 143 | <?php } ?> |
||
| 144 | <a href="/v.php?rid=<?php echo $weetBuffer['realid']; ?>"><img style="vertical-align: middle;" src="/static/witter-reply.png">Reply</a> |
||
| 145 | <?php echo getComments($weetBuffer['realid'], $conn); ?><img style="vertical-align: middle;" src="/static/witter-replies.png"> |
||
| 146 | <a href="/home.php?text=https://witter.spacemy.xyz/embed/?i=<?php echo $weetBuffer['realid']; ?>"><img style="vertical-align: middle;" src="/static/witter-reweet.png">Reweet</a> |
||
| 147 | </small><br> |
||
| 148 | <?php |
||
| 149 | $likes = getLikesReal($weetBuffer['id'], $conn); |
||
| 150 | while($weetBuffer = $likes->fetch_assoc()) { |
||
| 151 | ?> |
||
| 152 | <a href="/u.php?n=<?php echo handleTag($weetBuffer['fromu']); ?>"><img style="width: 30px; height: 30px; margin-left: 2px;" id="pfp" src="/dynamic/pfp/<?php echo getPFPFromUser($weetBuffer['fromu'], $conn); ?>"></a> |
||
| 153 | <?php } ?> |
||
| 154 | </td> |
||
| 155 | </big></big></big> |
||
| 156 | </tr> |
||
| 157 | <?php |
||
| 158 | } |
||
| 159 | $stmt->close(); |
||
| 160 | ?> |
||
| 161 | </table> |
||
| 162 | </div> |
||
| 163 | <?php require($_SERVER['DOCUMENT_ROOT'] . "/static/footer.php"); ?> |
||
| 164 | </div> |
||
| 165 | </div> |
||
| 166 | </div> |
||
| 167 | </body> |
||
| 168 | </html> |