num_rows != 0) { date_default_timezone_set("America/New_York"); $d = date("Y-m-d H:i:s", strtotime("now")); $sql = "UPDATE " . $tn1 . " SET `activity` = '" . $d . "', `away` = 'active' WHERE `ID` ='" . $_SESSION['userid'] . "'"; if (mysqli_query($con, $sql)) { } else { } } else { } // Viewed Profile Details $viewresult = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $_GET['userid'] . "'"); $viewrow = mysqli_fetch_array($viewresult); if($result->num_rows != 0) { } else { } // Make Friend Request if (isset($_POST['requestfriend'])) { if ( $viewrow['requests'] != "" ) { $reqconstr = $viewrow['requests'] . ',' . $_SESSION['userid']; // Create Friend Request $sql = "UPDATE " . $tn1 . " SET `requests` = '" . $reqconstr . "' WHERE `ID` ='" . $_GET['userid'] . "'"; if (mysqli_query($con, $sql)) { // Update Viewed Profile Details $viewresult = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $_GET['userid'] . "'"); $viewrow = mysqli_fetch_array($viewresult); } else { } } else { // Create Friend Request $sql = "UPDATE " . $tn1 . " SET `requests` = '" . $_SESSION['userid'] . "' WHERE `ID` ='" . $_GET['userid'] . "'"; if (mysqli_query($con, $sql)) { // Update Viewed Profile Details $viewresult = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $_GET['userid'] . "'"); $viewrow = mysqli_fetch_array($viewresult); } else { } } } // Make New Post if (isset($_POST['postbutton'])) { // Construct Filter Syntax $filterconstr = "general"; $cba = $_POST['filterval']; $atleast = 0; // Check # of Applied Filters foreach($cba as $checkbox){ if(isset($checkbox)){ if ($atleast == 0) { $filterconstr = $checkbox; } else { $filterconstr = $filterconstr . "," . $checkbox; } $atleast++; } } // Create Post $sql = "INSERT INTO " . $tn2 . " (poster,postcontent,filters,tagged,taggedname) VALUES ('" . $_SESSION['userid'] . "','" . $_POST['postcontent'] . "','" . $filterconstr . "','" . $_GET['userid'] . "','" . $viewrow['firstname'] . "')"; if (mysqli_query($con, $sql)) { } else { } } } ?>
I go by:
Posts
'; ?>
Profile Details
'; ?>
Friends
'; ?>
Media
num_rows != 0) { echo '
You are friends.
'; } else { $reqsql = "select * from " . $tn1 . " WHERE `ID` IN (" . $viewrow['requests'] . ") AND `ID` = " . $row['ID'] . ""; $reqsql = mysqli_query($con,$reqsql); if($reqsql->num_rows != 0) { echo '
Friend request pending.
'; } else { echo '
'; } } ?>
num_rows == 0) ) { echo '
This profile is set to private, you cannot view this content unless you are friends.
'; } else { echo'
Post Type:
'; $result2 = mysqli_query($con,"SELECT * FROM " . $tn2 . " WHERE `poster` = '" . $_GET['userid'] . "' OR `tagged` = '" . $_GET['userid'] . "' ORDER BY `uploadtime` DESC LIMIT 0, 10"); if($result2->num_rows != 0) { while($row2 = mysqli_fetch_array($result2)) { $pdataresult = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $row2['poster'] . "'"); $pdatarow = mysqli_fetch_array($pdataresult); if ( $row2['tagged'] != "" ) { $tagval = 'tagged: ' . $row2['taggedname']; } else { $tagval = ''; } $text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)?)@', '$1', $row2['postcontent']); $quotfix = '
'; $attafix = ""; if ( $row2['attachments'] != "" ) { $attafix = '
'; } echo '
' . $quotfix .' ' . $pdatarow['firstname'] . ' ' . $tagval . '

' . $text . '
' . $attafix . '
Post Filters: ' . $row2['filters'] . '
Posted On: ' . $row2['uploadtime'] . '
'; // Create Comments And Comment Section echo '
'; $comresult = mysqli_query($con,"SELECT * FROM " . $tn6 . " WHERE `op` ='" . $row2['ID'] . "'"); while($comrow = mysqli_fetch_array($comresult)) { $comuser = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $comrow['author'] . "'"); $comuserdata = mysqli_fetch_array($comuser); if ( $comrow['thread'] == 0 ) { // OP Comments $quotfix = '
' . $comuserdata['firstname'] . ': ' . $comrow['comment'] . '
'; echo $quotfix; // Reply Form Generator $replyid = $comrow['ID']; echo '
Reply
'; // Toggle Reply Visibility $comuser = mysqli_query($con,"SELECT * FROM " . $tn6 . " WHERE `replyto` ='" . $replyid . "'"); if($comuser->num_rows != 0) { $comuserdata = mysqli_fetch_array($comuser); echo '
Show Replies
'; } else { echo '
'; } } else { } } echo '
'; } } else { echo '
No posts to show.
'; } } ?>