\n"; ?>
@@ -136,11 +137,17 @@ if(isset($_GET["p"])){
if(!$p_offset || $p_offset <= 0) $p_offset = 0;
// TODO: Build a mechanism to make off-limits pages show as the last one
+
+
+
+ $private_filter = "";
+ if(!$is_current_user) $private_filter = "AND private IS NOT 1 AND answer IS NOT NULL";
+
$q_count = $db->query('SELECT COUNT(*) FROM questions WHERE user = "' . $p_user["id"] . '";')->fetchArray(SQLITE3_ASSOC)['COUNT(*)'];
$u_prep = $db->prepare("SELECT * FROM users WHERE id = :id");
- $qs = $db->query("SELECT * FROM questions WHERE user = '". $p_user["id"] ."' ORDER BY id DESC LIMIT ". $p_limit ." OFFSET ". $p_offset .";");
+ $qs = $db->query("SELECT * FROM questions WHERE user = '". $p_user["id"] . "' " . $private_filter . " ORDER BY id DESC LIMIT ". $p_limit ." OFFSET ". $p_offset .";");
/** QUESTIONS MAIN LOOP **/
@@ -167,8 +174,13 @@ if(isset($_GET["p"])){
$new_get["q"] = $q_user["name"];
echo("" . $q_user["name"] ."");
}
+ if($current["private"] == 1){
+ echo(" ");
+ echo("(private)");
+ }
echo("\n");
+
// Actual text body
echo("\t\t\t\t");
echo("