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 { } if ( ( $row['setup'] != "Complete" ) && ( $row['setup'] != "Skip" ) ) { header('Location: https://www.filterish.com/setup.htm'); } // Create 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) { if( strpos( $checkbox, ":" ) !== false) { $splitter = explode(':',$checkbox); $result = mysqli_query($con,"SELECT * FROM " . $tn7 . " WHERE `sub` ='" . $splitter[0] . "' AND `filter` = '" . $checkbox . "'"); if($result->num_rows == 0) { $sql = "INSERT INTO " . $tn7 . " (sub,filter,posts) VALUES ('" . $splitter[0] . "','" . $checkbox . "','1')"; if (mysqli_query($con, $sql)) { } else { } } else { $sql = "UPDATE " . $tn7 . " SET posts = posts+1 WHERE `sub` ='" . $splitter[0] . "' AND `filter` = '" . $checkbox . "'"; if (mysqli_query($con, $sql)) { $sql = "UPDATE " . $tn7 . " SET posts = posts+1 WHERE `sub` ='Main' AND `filter` = '" . $splitter[0] . "'"; if (mysqli_query($con, $sql)) { } else { } } else { } } if( strpos( $filterconstr, $splitter[0] ) !== false) { $filterconstr = $checkbox; } else { $filterconstr = $splitter[0] . "," . $checkbox; } } else { $filterconstr = $checkbox; } } else { if( strpos( $checkbox, ":" ) !== false) { $splitter = explode(':',$checkbox); $result = mysqli_query($con,"SELECT * FROM " . $tn7 . " WHERE `sub` ='" . $splitter[0] . "' AND `filter` = '" . $checkbox . "'"); if($result->num_rows == 0) { $sql = "INSERT INTO " . $tn7 . " (sub,filter,posts) VALUES ('" . $splitter[0] . "','" . $checkbox . "','1')"; if (mysqli_query($con, $sql)) { } else { } } else { $sql = "UPDATE " . $tn7 . " SET posts = posts+1 WHERE `sub` ='" . $splitter[0] . "' AND `filter` = '" . $checkbox . "'"; if (mysqli_query($con, $sql)) { $sql = "UPDATE " . $tn7 . " SET posts = posts+1 WHERE `sub` ='Main' AND `filter` = '" . $splitter[0] . "'"; if (mysqli_query($con, $sql)) { } else { } } else { } } if( strpos( $filterconstr, $splitter[0] ) !== false) { $filterconstr = $filterconstr . "," . $checkbox; } else { $filterconstr = $filterconstr . "," . $splitter[0] . "," . $checkbox; } } else { $filterconstr = $filterconstr . "," . $checkbox; } } $atleast++; } } $sanitized = filter_var($_POST['postcontent'], FILTER_SANITIZE_STRING); $pclined = nl2br($sanitized); if ($_SESSION['postuploads'] != "") { // Create Image Post $sql = "INSERT INTO " . $tn2 . " (poster,postcontent,filters,attachments) VALUES ('" . $_SESSION['userid'] . "','" . $pclined . "','" . $filterconstr . "','" . $_SESSION['postuploads'] . "')"; } else { // Create No-Attachment Post $sql = "INSERT INTO " . $tn2 . " (poster,postcontent,filters) VALUES ('" . $_SESSION['userid'] . "','" . $pclined . "','" . $filterconstr . "')"; } if (mysqli_query($con, $sql)) { $_SESSION['postuploads'] = ""; header('Location: index.htm'); } else { } } if (isset($_POST['removepic'])) { $_SESSION['postuploads'] = ""; header('Location: index.htm'); } if (isset($_POST['filterchoice'])) { // Update Filter Choice $sql = "UPDATE " . $tn1 . " SET `currentfilter` = '" . $_POST['filterchoice'] . "' WHERE `ID` ='" . $_SESSION['userid'] . "'"; if (mysqli_query($con, $sql)) { // Update Account Display $result = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $_SESSION['userid'] . "'"); $row = mysqli_fetch_array($result); } else { } header('Location: index.htm'); } // Set Filter Option List $filterpossible = array(); $filterq = mysqli_query($con,"SELECT * FROM " . $tn7 . " WHERE `sub` = 'Main'"); while($filrow = mysqli_fetch_array($filterq)) { $filterpossible[] = $filrow['filter']; } // Custom Filter Settings if (isset($_POST['customfilterchoice'])) { // Update Filter Choice $sql = "UPDATE " . $tn1 . " SET `filterchoice` = '" . $_POST['customfilterchoice'] . "' WHERE `ID` ='" . $_SESSION['userid'] . "'"; if (mysqli_query($con, $sql)) { // Update Account Display $result = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $_SESSION['userid'] . "'"); $row = mysqli_fetch_array($result); } else { } // Save Custom Filter Layout $customlayout = ""; $z = 0; $marker = 0; $custarr = $_POST['customfilter1']; while ( $z < count($filterpossible) ) { if($custarr[$marker] == $z ) { $customlayout = $customlayout . "checked"; $marker++; } else { $customlayout = $customlayout . "unchecked"; } $z++; if ( $z < count($filterpossible) ) { $customlayout = $customlayout . "."; } } // Update Filter Config $sql = "UPDATE " . $tn1 . " SET `filterconfig` = '" . $customlayout . "' WHERE `ID` ='" . $_SESSION['userid'] . "'"; if (mysqli_query($con, $sql)) { // Update Account Display $result = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $_SESSION['userid'] . "'"); $row = mysqli_fetch_array($result); } else { } header('Location: index.htm'); } if (isset($_POST['submitimg'])) { include 'imguploader.php'; $_SESSION['postuploads'] = $target_file; header('Location: index.htm'); } if (isset($_POST['galleryselection'])) { $_SESSION['postuploads'] = $_POST['galleryselection']; header('Location: index.htm'); } if (isset($_POST['closegallery'])) { header('Location: index.htm'); } } ?> FilterIsh
X
Select image to upload:



Apply Custom Filter ' . $x . '
Show/Hide Filters
'; $y = 0; while ( $y < count($filterpossible) ) { echo '
'; $y++; } echo '
'; } else { echo '
Show/Hide Filters
'; $y = 0; while ( $y < count($filterpossible) ) { echo '
'; $y++; } echo '
'; } $x++; } ?>
'; echo $quotfix; } else { echo '
Upload Picture To Post
Add A Picture From Your Gallery
'; } ?>
Post Type:
'; $x++; } ?>
num_rows != 0) { while( ( $row3 = mysqli_fetch_array($result3) ) && ( $adcount < 1 ) ) { $pdataresult = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $row3['poster'] . "'"); $pdatarow = mysqli_fetch_array($pdataresult); // Filter Transpose $filterver = explode(',', $row3['filters']); $filterish = 0; $filtered = 0; while ( $filterish < count($filterver) ) { $regex = '/\b' . $filterver[$filterish] . '\b/'; if (preg_match($regex, $_SESSION['constructfilter'])) { $filtered = 1; } $filterish++; } // Filter Override if ( $row['filterchoice'] == 0 ) { $filtered = 0; } if ( $filtered == 0 ) { $adcount++; $text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)?)@', '$1', $row3['postcontent']); $quotfix = '
'; $attafix = ""; if ( $row2['attachments'] != "" ) { $attafix = '
'; } echo '
' . $quotfix .' ' . $pdatarow['firstname'] . ' ' . $tagval . '

' . $text . '
' . $attafix . '
Post Filters: ' . $row3['filters'] . '
'; $sql = "UPDATE " . $tn9 . " SET viewed = viewed + 1 WHERE `ID` ='" . $row3['ID'] . "'"; if (mysqli_query($con, $sql)) { } else { } } } } if ( $row['currentfilter'] == "All" ) { // Display All Public and Friend Profile Posts $result2 = mysqli_query($con,"SELECT * FROM " . $tn2 . " ORDER BY `uploadtime` DESC LIMIT 0, 100"); $postcount = 0; if($result2->num_rows != 0) { while( ( $row2 = mysqli_fetch_array($result2) ) && ( $postcount < 10 ) ) { $_SESSION['postcount'] = $_SESSION['postcount'] + 1; $pdataresult = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $row2['poster'] . "'"); $pdatarow = mysqli_fetch_array($pdataresult); if ( $pdatarow['visibility'] == "Public" ) { // Filter Transpose $filterver = explode(',', $row2['filters']); $filterish = 0; $filtered = 0; while ( $filterish < count($filterver) ) { $regex = '/\b' . $filterver[$filterish] . '\b/'; if (preg_match($regex, $_SESSION['constructfilter'])) { $filtered = 1; } $filterish++; } // Filter Override if ( $row['filterchoice'] == 0 ) { $filtered = 0; } if ( $filtered == 0 ) { $postcount++; 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 if ( $pdatarow['visibility'] == "Private" ) { $friendsql = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` IN (" . $row['friends'] . "," . $_SESSION['userid'] .") AND `ID` = " . $pdatarow['ID'] . ""); if( mysqli_num_rows($friendsql) != 0) { // Filter Transpose $filterver = explode(',', $row2['filters']); $filterish = 0; $filtered = 0; while ( $filterish < count($filterver) ) { $regex = '/\b' . $filterver[$filterish] . '\b/'; if (preg_match($regex, $_SESSION['constructfilter'])) { $filtered = 1; } $filterish++; } // Filter Override if ( $row['filterchoice'] == 0 ) { $filtered = 0; } if ( $filtered == 0 ) { $postcount++; 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.
'; } } else if ( $row['currentfilter'] == "Friends" ) { // Display Only Friend's Posts $result2 = mysqli_query($con,"SELECT * FROM " . $tn2 . " WHERE `poster` IN (" . $row['friends'] . "," . $_SESSION['userid'] .") ORDER BY `uploadtime` DESC LIMIT 0, 100"); $postcount = 0; if($result2->num_rows != 0) { while( ( $row2 = mysqli_fetch_array($result2) ) && ( $postcount < 10 ) ) { $_SESSION['postcount'] = $_SESSION['postcount'] + 1; $pdataresult = mysqli_query($con,"SELECT * FROM " . $tn1 . " WHERE `ID` ='" . $row2['poster'] . "'"); $pdatarow = mysqli_fetch_array($pdataresult); // Filter Transpose $filterver = explode(',', $row2['filters']); $filterish = 0; $filtered = 0; while ( $filterish < count($filterver) ) { $regex = '/\b' . $filterver[$filterish] . '\b/'; if (preg_match($regex, $_SESSION['constructfilter'])) { $filtered = 1; } $filterish++; } // Filter Override if ( $row['filterchoice'] == 0 ) { $filtered = 0; } if ( $filtered == 0 ) { $postcount++; 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.
'; } } ?>