diff --git a/include/header.php b/include/header.php index b89f074..ce85cfd 100644 --- a/include/header.php +++ b/include/header.php @@ -29,6 +29,7 @@ if(!$db->querySingle("SELECT EXISTS(SELECT * FROM users where id = 0);")){ } if($_SESSION["login"] === true){ + echo(""); } else{ + echo(""); //header("Location: /login.php"); die(); } ?> diff --git a/include/main.php b/include/main.php new file mode 100644 index 0000000..66425dd --- /dev/null +++ b/include/main.php @@ -0,0 +1,5 @@ + diff --git a/include/settings.php b/include/settings.php index 65e9996..0f24764 100644 --- a/include/settings.php +++ b/include/settings.php @@ -5,5 +5,6 @@ // with this as false $fancy_urls = true; +$theme_name = "minimalpunk"; ?> diff --git a/login.php b/login.php index a294b51..2b1a479 100644 --- a/login.php +++ b/login.php @@ -1,5 +1,7 @@ + Login diff --git a/themes/minimalpunk/assets/favicon.png b/themes/minimalpunk/assets/favicon.png new file mode 100644 index 0000000..8a68958 Binary files /dev/null and b/themes/minimalpunk/assets/favicon.png differ diff --git a/themes/minimalpunk/assets/liberation-sans-Bold.ttf b/themes/minimalpunk/assets/liberation-sans-Bold.ttf new file mode 100644 index 0000000..2d7addc Binary files /dev/null and b/themes/minimalpunk/assets/liberation-sans-Bold.ttf differ diff --git a/themes/minimalpunk/assets/liberation-sans-BoldItalic.ttf b/themes/minimalpunk/assets/liberation-sans-BoldItalic.ttf new file mode 100644 index 0000000..d78e96d Binary files /dev/null and b/themes/minimalpunk/assets/liberation-sans-BoldItalic.ttf differ diff --git a/themes/minimalpunk/assets/liberation-sans-Italic.ttf b/themes/minimalpunk/assets/liberation-sans-Italic.ttf new file mode 100644 index 0000000..d139478 Binary files /dev/null and b/themes/minimalpunk/assets/liberation-sans-Italic.ttf differ diff --git a/themes/minimalpunk/assets/liberation-sans-Regular.ttf b/themes/minimalpunk/assets/liberation-sans-Regular.ttf new file mode 100644 index 0000000..59d2e25 Binary files /dev/null and b/themes/minimalpunk/assets/liberation-sans-Regular.ttf differ diff --git a/themes/minimalpunk/assets/logo_1000px.png b/themes/minimalpunk/assets/logo_1000px.png new file mode 100644 index 0000000..5985eb3 Binary files /dev/null and b/themes/minimalpunk/assets/logo_1000px.png differ diff --git a/themes/minimalpunk/colors.php b/themes/minimalpunk/colors.php new file mode 100644 index 0000000..8ffeaa9 --- /dev/null +++ b/themes/minimalpunk/colors.php @@ -0,0 +1,7 @@ + diff --git a/themes/minimalpunk/colors.php~ b/themes/minimalpunk/colors.php~ new file mode 100644 index 0000000..bb672ba --- /dev/null +++ b/themes/minimalpunk/colors.php~ @@ -0,0 +1,4 @@ + diff --git a/themes/minimalpunk/css/main.css.php b/themes/minimalpunk/css/main.css.php new file mode 100644 index 0000000..e0ee5cb --- /dev/null +++ b/themes/minimalpunk/css/main.css.php @@ -0,0 +1,33 @@ + +@font-face{ + font-family: liberation-sans; + src: url(/themes/minimalpunk/assets/liberation-sans-Regular.ttf) format("truetype"); +} +@font-face{ + font-family: liberation-sans; + font-weight: bold; + src: url(/themes/minimalpunk/assets/liberation-sans-Bold.ttf) format("truetype"); +} + +body{ + font-family: liberation-sans; + background-color: ; + color: white; +} + +a{ + color: white; +} + +input{ + background-color: ; + color: white; + border: none; + padding: 10px 20px; +} + +body{ + background-image: url("/themes/minimalpunk/assets/logo_1000px.png"): + background-size: 100px 100px; +} + diff --git a/themes/minimalpunk/css/reset.css b/themes/minimalpunk/css/reset.css new file mode 100644 index 0000000..ed11813 --- /dev/null +++ b/themes/minimalpunk/css/reset.css @@ -0,0 +1,48 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/themes/minimalpunk/css/user.css.php b/themes/minimalpunk/css/user.css.php new file mode 100644 index 0000000..a3487f3 --- /dev/null +++ b/themes/minimalpunk/css/user.css.php @@ -0,0 +1,104 @@ + +#parent-container{ + width: 80%; + margin: 50px auto 30px; + /*background-color: ;*/ +} +#header{ + text-align: right; + padding: 20px; + background-color: ; +} + +.columns-container{ + display: flex; +} +.column{ + flex: 25%; +} +.question-container{ + flex: 75%; +} + +/* user profile styling */ +#user-container{ + /*background-color: black;*/ + text-align: center; + background-color: ; + padding: 30px; + margin: 0px; +} +#user-name{ + font-size: 30px; + font-weight: bold; + margin-bottom: 20px; +} +#user-bio{ + +} + +/* Form column */ +.form-column{ + background-color: ; + padding: 10px; + overflow: hidden; +} +.form-column textarea{ + width: 100%; + height: 80px; + margin-bottom: 10px; +} +.form-column input[type="submit"]{ + margin: 10px; + float: right; +} +.form-column input[type="submit"]:hover{ + background-color: +} + +/* Questions */ +.question-container{ + padding: 10px; + background-color: ; +} +.question{ + margin: 20px; + margin-bottom: 10px; +} +.question-username{ + font-size: 20px; + font-weight: bold; + padding-bottom: 15px; + text-decoration: none; +} +.question-text{ + margin-bottom: 15px; +} +.question-date{ + float: right; + margin-bottom: 20px; +} + +.answer{ + clear: both; + padding: 10px; + margin-left: 40px; + background-color: ; +} +.answer-date{ + margin-top: 20px; +} + +/* Footer */ +#footer{ + padding: 10px; + /*background-color: ;*/ + text-align: center; + margin-bottom: 30px; +} + +@media screen and (max-width: 800px){ + .columns-container{ + display: block; + } +} diff --git a/themes/minimalpunk/css/user.css.php~ b/themes/minimalpunk/css/user.css.php~ new file mode 100644 index 0000000..87e8179 --- /dev/null +++ b/themes/minimalpunk/css/user.css.php~ @@ -0,0 +1,84 @@ + +65;6002;1cbody{ + background-color: ; +} +#parent-container{ + width: 80%; + margin: 50px auto; + /*background-color: ;*/ +} +#header{ + text-align: right; + padding: 20px; + background-color: ; +} + +.columns-container{ + display: flex; +} +.column{ + flex: 25%; +} +.question-container{ + flex: 75%; +} + +/* user profile styling */ +#user-container{ + /*background-color: black;*/ + text-align: center; + background-color: ; + padding: 30px; + margin: 0px; +} +#user-name{ + font-size: 30px; + font-weight: bold; + margin-bottom: 20px; +} +#user-bio{ + +} + +/* Form column */ +.form-column{ + background-color: ; + padding: 10px; +} +.form-column textarea{ + width: 100%; + height: 80px; +} + +/* Questions */ +.question-container{ + padding: 10px; + background-color: ; +} +.question{ + margin: 20px; + margin-bottom: 10px; +} +.question-username{ + font-size: 20px; + font-weight: bold; + padding-bottom: 15px; + text-decoration: none; +} +.question-text{ + margin-bottom: 15px; +} +.question-date{ + float: right; +} + +.answer{ + padding: 10px; + margin-top: 15px; + margin-left: 40px; +} + +/* Footer */ +#footer{ + background-color: ; +} \ No newline at end of file diff --git a/themes/minimalpunk/login.php b/themes/minimalpunk/login.php new file mode 100644 index 0000000..3ae133e --- /dev/null +++ b/themes/minimalpunk/login.php @@ -0,0 +1,3 @@ + diff --git a/themes/minimalpunk/main.php b/themes/minimalpunk/main.php new file mode 100644 index 0000000..a71fef8 --- /dev/null +++ b/themes/minimalpunk/main.php @@ -0,0 +1,6 @@ +'); +echo(''); +echo(''); +echo(''); +?> diff --git a/themes/minimalpunk/user.php b/themes/minimalpunk/user.php new file mode 100644 index 0000000..291b8ba --- /dev/null +++ b/themes/minimalpunk/user.php @@ -0,0 +1,4 @@ +'); +?> diff --git a/user.php b/user.php index bd2ee33..1368510 100644 --- a/user.php +++ b/user.php @@ -1,6 +1,8 @@ query("SELECT * FROM users WHERE username = '" . $_GET["q"] . "';")->fetchArray(SQLITE3_ASSOC); @@ -18,33 +20,46 @@ if(isset($_SESSION["uid"])){ + <?= $p_user["username"] ?> | LibreCat + -

-

+
+
+

+

"); if($fancy_urls) echo("config"); else echo("config"); } ?> +
+
+

"/>

name="anon"/> Post anonymously

$errorMsg

\n"; ?> - +
+
+
prepare("SELECT * FROM users WHERE id = :id"); - $qs = $db->query("SELECT * FROM questions WHERE user = '" . $p_user["id"] . "' LIMIT 0, 10;"); + $qs = $db->query("SELECT * FROM questions WHERE user = '" . $p_user["id"] . "' ORDER BY id DESC LIMIT 0, 10;"); $time = new DateTime("@0"); while($current = $qs->fetchArray(SQLITE3_ASSOC)){ @@ -52,10 +67,12 @@ if(isset($_SESSION["uid"])){ $u_prep->bindValue(":id", $current["by"], SQLITE3_INTEGER); $q_user = $u_prep->execute()->fetchArray(SQLITE3_ASSOC); - if($q_user["id"] == 0) echo("

" . $q_user["name"] ."

"); - else if($fancy_urls) echo("

" . $q_user["name"] ."

\n"); - else echo("

" . $q_user["name"] ."

\n"); - echo("\t

". $current["question"] ."

\n"); + echo("

"); + + if($q_user["id"] == 0) echo("

" . $q_user["name"] ."

"); + else if($fancy_urls) echo("

" . $q_user["name"] ."

\n"); + else echo("

" . $q_user["name"] ."

\n"); + echo("\t

". $current["question"] ."

\n"); if($is_current_user){ echo("\treply "); @@ -65,15 +82,28 @@ if(isset($_SESSION["uid"])){ // Time $time->settimestamp($current["q_date"]); - echo($time->format("y-m-d h:i:s")); + echo("

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

"); if($current["answer"]){ - echo("

" . $current["answer"] . "

"); + echo("
"); + echo("

" . $current["answer"] . "

"); $time->settimestamp($current["a_date"]); - echo($time->format("y-m-d h:i:s")); + echo("

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

"); + echo("
"); } echo("\n\n"); + + echo("
"); } ?> +
+
+
+