diff --git a/TODO.md b/TODO.md
index d2ec6a4..5e333f5 100644
--- a/TODO.md
+++ b/TODO.md
@@ -10,7 +10,8 @@
- Twitter post publication
- Toggle Twitter posting
- Mastodon login
- - Add various language support.
+ - Add various language support
+ - Make unanswered questions not show on the profile
- Config panel to change:
- Bio
diff --git a/action/delete-question.php b/action/delete-question.php
index 99693b1..86157de 100644
--- a/action/delete-question.php
+++ b/action/delete-question.php
@@ -20,7 +20,7 @@ else{
}
else{
$db->exec("DELETE FROM questions WHERE id = " . $question["id"] . ";");
- if($pretty_urls){
+ if($fancy_urls){
header("Location: /user/" . $db->querySingle("SELECT username FROM users WHERE id = " . $question["user"] . ";"));
die();
}
diff --git a/action/reply.php b/action/reply.php
index 21dc913..39e0deb 100644
--- a/action/reply.php
+++ b/action/reply.php
@@ -58,7 +58,7 @@ else{
$tweet = $question["question"] . $separator . $question["answer"];
}
}
- $tweet = $tweet . " https://ask.fai.su/user/" . $user["username"];
+ $tweet = $tweet . " https://" . $_SERVER['HTTP_HOST'] . "/user/" . $user["username"] . "?p=" . $question["id"];
// echo strlen($tweet) . " - " . strlen($question["answer"]) . "
\n";
// echo $tweet;
@@ -68,7 +68,7 @@ else{
post_tweet(htmlspecialchars_decode($tweet, ENT_QUOTES));
}
- if($pretty_urls){
+ if($fancy_urls){
header("Location: /user/" . $db->querySingle("SELECT username FROM users WHERE id = " . $question["user"] . ";"));
die();
}
diff --git a/themes/minimalpunk/colors.php b/themes/minimalpunk/colors.php
index 8ffeaa9..715fdb2 100644
--- a/themes/minimalpunk/colors.php
+++ b/themes/minimalpunk/colors.php
@@ -3,5 +3,6 @@ $color_main = "#353942";
$color_bg = "#282b32";
$color_2 = "#464c58";
$color_3 = "#5a6271";
+$color_4 = "#aab9cb";
?>
diff --git a/themes/minimalpunk/css/user.css.php b/themes/minimalpunk/css/user.css.php
index a3487f3..2d6111c 100644
--- a/themes/minimalpunk/css/user.css.php
+++ b/themes/minimalpunk/css/user.css.php
@@ -22,7 +22,6 @@
/* user profile styling */
#user-container{
- /*background-color: black;*/
text-align: center;
background-color: = $color_3 ?>;
padding: 30px;
@@ -56,6 +55,39 @@
background-color: = $color_main ?>
}
+/* Highlighted post (?p=id) */
+
+.highlighted-post{
+ background-color: = $color_2 ?>;
+ padding: 10px;
+ margin-bottom: 50px;
+}
+ .highlighted-post .question-body{
+ margin: 30px;
+ }
+ .highlighted-post .question-date{
+ margin-top: 40px;
+ float: none;
+ }
+ .highlighted-post .question-text{
+ margin: 15px;
+ }
+ .highlighted-post .answer{
+ background-color: = $color_main ?>;
+ margin: 0px;
+ padding: 30px;
+ }
+ .highlighted-post .answer .title{
+ font-weight: bold;
+ margin-bottom: 15px;
+ }
+ .highlighted-post .answer-text{
+ padding: 15px;
+ }
+ .highlighted-post .answer-date{
+ color: = $color_4 ?>;
+ }
+
/* Questions */
.question-container{
padding: 10px;
@@ -63,7 +95,7 @@
}
.question{
margin: 20px;
- margin-bottom: 10px;
+ margin-bottom: 40px;
}
.question-username{
font-size: 20px;
@@ -78,6 +110,12 @@
float: right;
margin-bottom: 20px;
}
+.question-footer, .question-footer a{
+ color: = $color_4 ?>
+}
+.question-footer a:hover{
+ color: white;
+}
.answer{
clear: both;
diff --git a/user.php b/user.php
index 61d448c..4f1cf06 100644
--- a/user.php
+++ b/user.php
@@ -47,6 +47,62 @@ if(isset($_SESSION["uid"])){
}
?>
+ 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"]){
+
+ echo('
"); + if($h_user["id"] == 0){ + echo($h_user["name"]); + } + else if($fancy_urls){ + echo("" . $h_user["name"] .""); + } + else{ + echo("" . $h_user["name"] .""); + } + echo(" asked:
"); + + echo("\t". $h_question["question"] ."
\n"); + + 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('' . $p_user["name"] . ' answered:'); + echo("
" . $h_question["answer"] . "
"); + $time->settimestamp($h_question["a_date"]); + echo("" . $time->format("Y-m-d h:i:s") . "
"); + echo("". $current["question"] ."
\n"); + echo(' '); if($current["answer"]){ echo("