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 | <!DOCTYPE html> |
||
| 5 | <html> |
||
| 6 | <head> |
||
| 7 | <link href="/static/css/required.css" rel="stylesheet"> |
||
| 8 | </head> |
||
| 9 | <body style="background-image: none; background-color: white;"> |
||
| 10 | <table id="feed"> |
||
| 11 | <tr> |
||
| 12 | <th style="width: 48px;"> </th> |
||
| 13 | <th> </th> |
||
| 14 | </tr> |
||
| 15 | <?php |
||
| 16 | $stmt = $conn->prepare("SELECT * FROM weets WHERE realid = ?"); |
||
| 17 | $stmt->bind_param('s', $_GET['i']); |
||
| 18 | $stmt->execute(); |
||
| 19 | $result = $stmt->get_result(); |
||
| 20 | |||
| 21 | while($row = $result->fetch_assoc()) { ?> |
||
| 22 | <tr> |
||
| 23 | <big><big><big> |
||
| 24 | <td> |
||
| 25 | <img id="pfp" src="/dynamic/pfp/<?php echo getPFPFromUser($row['author'], $conn); ?>"> |
||
| 26 | </td> |
||
| 27 | <td><a id="tag" href="/u.php?n=<?php echo handleTag($row['author']); ?>"><?php echo($row['author']); ?></a> |
||
| 28 | <?php if(returnVerifiedFromUsername($row['author'], $conn) != "") { ?> <span style="border-radius: 10px; background-color: deepskyblue; color: white; padding: 3px;"><?php echo(returnVerifiedFromUsername($row['author'], $conn)); ?></span> <?php } ?> |
||
| 29 | <div id="floatRight" class="dropdown"> |
||
| 30 | <span><img style="vertical-align: middle;" src="/static/witter-dotdotdot.png"></span> |
||
| 31 | <div class="dropdown-content"> |
||
| 32 | <a href="#<?php //echo report.php?r=$row['realid']; ?>"><img style="vertical-align: middle;" src="/static/witter-report.png"></a><br> |
||
| 33 | <?php if(isset($_SESSION['siteusername']) && $row['author'] == $_SESSION['siteusername']) { ?> |
||
| 34 | <a href="/delete.php?rid=<?php echo $row['realid']; ?>"><img style="vertical-align: middle;" src="/static/witter-trash.png"></a><br> |
||
| 35 | <a href="/edit.php?rid=<?php echo $row['realid']; ?>"><img style="vertical-align: middle;" src="/static/witter-edit.png"></a><br> |
||
| 36 | <?php } ?> |
||
| 37 | </div> |
||
| 38 | </div> |
||
| 39 | <span id="floatRight"> |
||
| 40 | <?php if(ifLiked($_SESSION['siteusername'], $row['id'], $conn) == true) { ?> |
||
|
0 ignored issues
–
show
|
|||
| 41 | <a href="/unlike.php?id=<?php echo $row['id']; ?>"><img style="vertical-align: middle;" src="/static/witter-like.png"></a> |
||
| 42 | <?php } else { ?> |
||
| 43 | <a href="/like.php?id=<?php echo $row['id']; ?>"><img style="vertical-align: middle;" src="/static/witter-liked.png"></a> |
||
| 44 | <?php } ?> |
||
| 45 | </span> |
||
| 46 | <div id="feedtext"><?php echo parseText($row['contents']); ?> </div> |
||
| 47 | <small id="grey">about <?php echo time_elapsed_string($row['date']); ?> from web |
||
| 48 | <span id="floatRight"> |
||
| 49 | <?php echo getComments($row['realid'], $conn); ?><img style="vertical-align: middle;" src="/static/witter-replies.png"> • <a href="/v.php?rid=<?php echo $row['realid']; ?>">Reply</a> • <a href="/home.php?text=https://witter.spacemy.xyz/embed/?i=<?php echo $row['realid']; ?>">Reweet</a> |
||
| 50 | </span> |
||
| 51 | </small><br> |
||
| 52 | <?php |
||
| 53 | $likes = getLikesReal($row['id'], $conn); |
||
| 54 | while($row = $likes->fetch_assoc()) { |
||
| 55 | ?> |
||
| 56 | <a href="/u.php?n=<?php echo handleTag($row['fromu']); ?>"><img style="width: 30px; height: 30px; margin-left: 2px;" id="pfp" src="/dynamic/pfp/<?php echo getPFPFromUser($row['fromu'], $conn); ?>"></a> |
||
| 57 | <?php } ?> |
||
| 58 | </td> |
||
| 59 | </big></big></big> |
||
| 60 | </tr> |
||
| 61 | <?php } ?> |
||
| 62 | </table> |
||
| 63 | </body> |
||
| 64 | </html> |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.