query("SELECT * FROM users WHERE username = '" . $_GET["q"] . "';")->fetchArray(SQLITE3_ASSOC); if(!$p_user || !$p_user["id"]){ include("404.php"); die(); } if(isset($_SESSION["uid"])){ if($_SESSION["uid"] == $p_user["id"]){ $is_current_user = true; } } ?> <?= $p_user["username"] ?> | LibreCat

"); if($fancy_urls){ echo("config"); echo(" - "); echo('share on twitter'); } else{ echo("config"); } } ?>
query("SELECT * FROM questions WHERE id = " . $_GET["p"] . ";")->fetchArray(SQLITE3_ASSOC); $h_user = $db->query("SELECT * FROM users WHERE id = " . $h_question["by"] . ";")->fetchArray(SQLITE3_ASSOC); if($p_user["id"] == $h_question["user"]){ // Only show question that are for this user echo('
'); echo('
'); $time = new DateTime("@0"); // Title echo("

"); if($h_user["id"] == 0){ // no link if anonymous echo($h_user["name"]); } else{ echo("" . $h_user["name"] ."\n"); } echo(" asked:

"); // Actual question text echo("\t

". $h_question["question"] ."

\n"); // Footer if($is_h_question_user){ echo("\treply "); echo("\tdelete "); echo("fav ignore "); } // Time $time->settimestamp($h_question["q_date"]); echo('

'); echo('' . $time->format('Y-m-d h:i:s') . ''); echo('

'); echo('
'); // question-body /* Answer */ if($h_question["answer"]){ echo("
"); echo('

' . $p_user["name"] . ' answered:'); echo("

" . $h_question["answer"] . "

"); $time->settimestamp($h_question["a_date"]); echo("

" . $time->format("Y-m-d h:i:s") . "

"); echo("
"); } echo('
'); // highlighted-post } } ?>

"/>

name="anon"/> Post anonymously

$errorMsg

\n"; ?>
query('SELECT COUNT(*) FROM questions WHERE user = "' . $p_user["id"] . '";')->fetchArray(SQLITE3_ASSOC)['COUNT(*)']; // echo $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 .";"); /** QUESTIONS MAIN LOOP **/ $time = new DateTime("@0"); while($current = $qs->fetchArray(SQLITE3_ASSOC)){ // Execute prepared statement $u_prep->bindValue(":id", $current["by"], SQLITE3_INTEGER); $q_user = $u_prep->execute()->fetchArray(SQLITE3_ASSOC); echo("
"); // Question username echo("

" ); if($q_user["id"] == 0){ // no link if anonymous echo($q_user["name"]); } else{ echo("" . $q_user["name"] ."\n"); } echo("

"); // Actual text body echo("\t

". $current["question"] ."

\n"); /* Question footer */ echo(''); // Footer /* Answer */ if($current["answer"]){ echo("
"); echo("

" . $current["answer"] . "

"); $time->settimestamp($current["a_date"]); echo("

" . $time->format("Y-m-d h:i:s") . "

"); echo("
"); } echo("\n\n"); echo("
"); // Question } ?>