diff --git a/include/_topics.php b/include/_topics.php index a6bdccd..8795fd3 100644 --- a/include/_topics.php +++ b/include/_topics.php @@ -1,11 +1,20 @@ prepare('SELECT *, UNIX_TIMESTAMP(`topic_created`) AS `topic_created`, UNIX_TIMESTAMP(`topic_bumped`) AS `topic_bumped`, UNIX_TIMESTAMP(`topic_locked`) AS `topic_locked`, UNIX_TIMESTAMP(`topic_resolved`) AS `topic_resolved`, UNIX_TIMESTAMP(`topic_confirmed`) AS `topic_confirmed` FROM `fmf_topics` WHERE `cat_id` = :category AND `topic_bumped` IS NOT NULL ORDER BY `topic_bumped` DESC'); + $query = 'SELECT *, UNIX_TIMESTAMP(`topic_created`) AS `topic_created`, UNIX_TIMESTAMP(`topic_bumped`) AS `topic_bumped`, UNIX_TIMESTAMP(`topic_locked`) AS `topic_locked`, UNIX_TIMESTAMP(`topic_resolved`) AS `topic_resolved`, UNIX_TIMESTAMP(`topic_confirmed`) AS `topic_confirmed`' + . ' FROM `fmf_topics` WHERE `cat_id` = :category AND `topic_bumped` IS NOT NULL' + . ' ORDER BY '; + + if($variation === 1) + $query .= 'IF(`topic_confirmed` IS NULL, 0, IF(`topic_resolved` IS NULL, -1, 1)), '; + + $query .= '`topic_bumped` DESC'; + + $getTopics = $pdo->prepare($query); $getTopics->bindValue('category', $category); $topics = $getTopics->execute() ? $getTopics->fetchAll(PDO::FETCH_ASSOC) : false; diff --git a/include/_user.php b/include/_user.php index a77868d..618b280 100644 --- a/include/_user.php +++ b/include/_user.php @@ -2,6 +2,7 @@ include_once '_utils.php'; define('FMF_UF_SCROLLBEYOND', 1); +define('FMF_UF_NEWSTYLE', 2); function get_user_id(string $username, string $email): int { global $pdo; @@ -181,6 +182,18 @@ function destroy_session(string $token): void { $delete->execute(); } +function destroy_user_sessions(int $userId): void { + global $pdo; + + $delete = $pdo->prepare('DELETE FROM `fmf_sessions` WHERE `user_id` = :user'); + $delete->bindValue('user', $userId); + $delete->execute(); +} + +function destroy_current_user_sessions(): void { + destroy_user_sessions(current_user_id()); +} + function current_user_id(): int { return session_active() ? $GLOBALS['fmf_user_id'] : 0; } diff --git a/layout/footer.php b/layout/footer.php index 66a54c5..3413c2a 100644 --- a/layout/footer.php +++ b/layout/footer.php @@ -1,4 +1,11 @@ + + + + diff --git a/layout/header.php b/layout/header.php index 3df2323..b03d2ca 100644 --- a/layout/header.php +++ b/layout/header.php @@ -1,5 +1,8 @@ @@ -7,25 +10,41 @@ include_once '_user.php'; <?=$title ?? 'flash.moe message board';?> + + + + + + - + +
+
+ +
+ //flash.moe/assets/headers/mkt-044.jpg +
+ +

flash.moe message board

@@ -45,4 +64,19 @@ include_once '_user.php';
+
+ +
+
+ + + + +
+ This message board will be taken offline in May 2021. Registration and posting have already been disabled.
+ Musewave support has moved to a forum topic on Flashii.net. +
\ No newline at end of file diff --git a/public/category.php b/public/category.php index 2749d1a..0821b56 100644 --- a/public/category.php +++ b/public/category.php @@ -75,7 +75,7 @@ if(count($categories) > 0) { } if($categoryInfo['cat_type'] == 0) { -$topics = topics_in_category($categoryInfo['cat_id']); +$topics = topics_in_category($categoryInfo['cat_id'], $categoryInfo['cat_variation']); ?> Create Topic
diff --git a/public/posting.php b/public/posting.php index abfca16..d529eb2 100644 --- a/public/posting.php +++ b/public/posting.php @@ -1,6 +1,8 @@ 'Scroll beyond end of the page.', + FMF_UF_NEWSTYLE => 'Preview new style.', ]; $timeZones = DateTimeZone::listIdentifiers(); @@ -154,7 +155,7 @@ include FMF_LAYOUT . '/header.php';

Date/time format

diff --git a/public/style.css b/public/style.css index 988eb51..39bbdaf 100644 --- a/public/style.css +++ b/public/style.css @@ -474,3 +474,11 @@ option { margin: 2px 0; padding: 4px; } + +.forum-shutdown { + background-color: #37221a; + padding: 5px 7px; + font-weight: bold; + color: #D9AA9D; + border: 1px solid #000; +} diff --git a/public/style2.css b/public/style2.css new file mode 100644 index 0000000..070feb9 --- /dev/null +++ b/public/style2.css @@ -0,0 +1,434 @@ +h1 { + color: #9DAAD9; + font-weight: bold; + font-size: 22px; + text-decoration: none; +} + +h2 { + font-weight: bold; + font-size: 22px; + text-decoration: none; + line-height: 120%; +} + +h3 { + font-size: 1.3em; + font-weight: bold; + line-height: 120%; +} + +h4 { + margin: 0; + font-size: 1.1em; + font-weight: bold; +} + +p { + font-size: 1.1em; +} + +h3 > a { + display: inline-block; + padding: 2px 5px; +} + +input[type="text"], +input[type="password"], +input[type="email"], +input[type="search"], +input[type="submit"], +input[type="reset"], +input[type="button"] { + color: #9daad9; + font-family: Tahoma, Geneva, 'Dejavu Sans', Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: 400; + padding: 2px; + border: 1px solid #9daad9; + background-color: #191E33; +} + +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + padding: 2px 4px; +} + +input[type="submit"] { + font-weight: 700; +} + +textarea { + background-color: #191E33; + color: #9DAAD9; + font-family: Tahoma, Geneva, 'Dejavu Sans', Arial, Helvetica, sans-serif; + font-weight: normal; + border: 1px solid #A9B8C2; + padding: 2px; + font-size: 12px; +} + +select { + color: #9DAAD9; + background-color: #191E33; + font-family: Tahoma, Geneva, 'Dejavu Sans', Arial, Helvetica, sans-serif; + font-size: 11px; + font-weight: normal; + border: 1px solid #A9B8C2; + padding: 1px; +} + +option { + padding: 0 1em 0 0; +} + +.wrapper { + margin: 0 auto; + width: 100%; + max-width: 1000px; +} +.wrapper.scrollbeyond { + padding-bottom: 100vh; +} + +.wrapper a { + color: #567194; + text-decoration: none; + transition: color .1s; +} + +.wrapper a:active { + color: #4C5A8E; + text-decoration: none; +} + +.wrapper a:hover { + color: #FFFFFF; + text-decoration: underline; +} + +.forum-category, +.topics { + border: 1px solid #000; + background-color: #191e33; + color: #cecece; + margin: 4px 0; +} +.forum-category-title, +.topics-header { + font-weight: 700; + display: flex; + align-items: center; +} +.forum-category-title-info, +.topics-header-info { + flex: 1 1 auto; + padding: 4px 5px; +} +.forum-category-board, +.topics-item { + border-top: 1px solid #000; + background-color: #1a2237; + display: flex; + align-items: center; + min-height: 40px; +} +.forum-category-board-indicator, +.topics-item-indicator, +.topics-item-indicator-closed, +.topics-item-indicator-locked { + width: 20px; + height: 20px; + line-height: 20px; + border: 1px solid #000; + flex: 0 0 auto; + margin: 5px; + background-color: #1a2237; +} +.topics-item-indicator-closed { + background-color: #0c0; + margin-left: 0; +} +.topics-item-indicator-locked { + background-color: #c00; + margin-left: 0; +} +.forum-category-board-indicator.unread, +.topics-item-indicator.unread { + background-color: #4D556A; +} +.topics-item-indicator, +.topics-item-indicator-closed, +.topics-item-indicator-locked { + width: 16px; + height: 16px; + line-height: 16px; +} +.forum-category-board-info, +.topics-item-info { + flex: 1 1 auto; +} +.forum-category-count, +.topics-item-count { + width: 60px; + text-align: center; + padding: 4px 5px; +} +.forum-category-latest, +.topics-item-author, +.topics-item-created, +.topics-item-latest { + width: 120px; + text-align: center; +} +.topics-item-created time, +.forum-category-latest time, +.topics-item-latest time { + font-size: .9em; + line-height: 1.2em; + display: inline-block; +} +.forum-category-latest-header, +.topics-item-latest-header { + padding: 4px 5px; +} +.forum-category-board-desc { + font-size: .9em; + line-height: 1.2em; +} +.topics-item-status { + display: inline-block; + margin-right: 4px; +} + +.auth-form { + max-width: 300px; + margin: 5px auto; +} +.auth-header { + padding: 5px 0; +} +.auth-field { + margin: 5px 0; + display: block; +} +.auth-field-value input { + width: 100%; +} +.auth-buttons { + text-align: center; + padding: 5px; +} +.auth-message { + text-align: center; +} +.auth-message-error { + color: #f00; +} +.forum-title { + padding: 2px 5px; +} + +.posting-header { + display: flex; + padding: 4px 0; +} +.posting-title { + flex: 1 1 auto; +} +.posting-submit { + margin-left: 4px; +} +.posting-text { + display: block; + width: 100%; + min-width: 100%; + max-width: 100%; + min-height: 500px; +} +.posting-message { + padding: 0 3px; +} +.posting-message-error { + color: #f00; +} + +.createtopicbtn, +.topic-btns a { + display: inline-block; + color: #fff !important; + text-decoration: none !important; + font-size: 12px; + font-weight: 400; + padding: 5px 10px; + background-color: #393939; + background-image: linear-gradient(0deg, #1118 0%, #2228 50%, #3338 50%, #5558 100%); + border-radius: 5px; + overflow: hidden; + cursor: pointer; + filter: drop-shadow(0 1px 5px #000); + margin: 5px 0; + margin-right: 10px; +} + +.search-form { + display: flex; +} +.search-input { + flex: 1 1 auto; +} +.search-submit { + margin-left: 4px; +} + +.post { + display: flex; + border: 1px solid #000; + background-color: #191e33; + color: #cecece; + margin: 2px 0; +} +.post-details { + flex: 0 0 auto; + width: 120px; + display: flex; + flex-direction: column; + align-items: center; + border: 0 solid #000; + border-right-width: 1px; +} +.post-permalink-wrap { + text-align: center; + font-size: .9em; + line-height: 1.4em; +} +.post-username { + font-size: 1.2em; + line-height: 1.5em; +} +.post-details * { + margin: 1px 0; +} +/*@media(max-width: 600px) {*/ + .post { + flex-direction: column; + } + .post-details { + border-right-width: 0; + border-bottom-width: 1px; + width: 100%; + flex-direction: row; + } + .post-avatar { + width: 40px; + height: 40px; + order: 1; + margin: 5px; + } + .post-username { + order: 2; + padding: 10px; + } + .post-permalink-wrap { + order: 3; + flex: 1 1 auto; + text-align: right !important; + } + .post-permalink { + padding: 10px; + } +/*}*/ +.post-text { + flex: 1 1 auto; + background-color: #1a2237; + min-height: 160px; + padding: 2px 5px; + display: flex; + flex-direction: column; +} +.post-text-inner { + flex: 1 1 auto; + padding: 3px 0; + word-wrap: normal; + word-break: break-word; +} +.post-footer { + display: flex; + flex: 0 0 auto; + font-size: .9em; +} +.post-edited { + flex: 1 1 auto; + font-style: italic; +} +.post-options { + flex: 0 0 auto; +} +.post-options a { + margin: 0 5px; +} +.post-deleted .post-text { + min-height: 0; +} + +.setting { + margin: 10px 0; +} +.setting-head h3 { + line-height: 1.5em; +} +.setting-value input[type="text"], +.setting-value input[type="password"], +.setting-value input[type="email"], +.setting-value select { + min-width: 400px; + margin: 1px 0; +} +.settings-message { + padding: 0 3px; +} +.settings-message-error { + color: #f00; +} +.settings-option { + margin: 2px 0; + padding: 0 4px; + display: block; +} + +.event { + display: block; + border: 1px solid #000; + background-color: #191e33; + color: #cecece; + margin: 2px 0; +} +.event-msg { + margin: 4px; + display: flex; +} +.event-msg img { + vertical-align: bottom; +} +.event-msg time { + font-size: .9em; + margin: 0 4px; +} +.event-msg-text { + flex: 1 1 auto; + margin: 0 4px; +} + +.notice { + display: block; + border: 1px solid #000; + background-color: #1a2237; + color: #cecece; + margin: 2px 0; + padding: 4px; +} + +.header-search { +}