From eb1c77d2a9fcddd7f42c7412fb8a0be7caddde0b Mon Sep 17 00:00:00 2001 From: Spuds Date: Tue, 23 Apr 2024 17:03:58 -0500 Subject: [PATCH 01/19] ! rename to wysiwyg --- themes/default/GenericControls.template.php | 2 +- ...itor.elk_wiz_light.css => jquery.sceditor.wysiwyg_light.css} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename themes/default/css/_light/{jquery.sceditor.elk_wiz_light.css => jquery.sceditor.wysiwyg_light.css} (99%) diff --git a/themes/default/GenericControls.template.php b/themes/default/GenericControls.template.php index 6cdfc073ac..24f7efc29e 100644 --- a/themes/default/GenericControls.template.php +++ b/themes/default/GenericControls.template.php @@ -39,7 +39,7 @@ function template_control_richedit($editor_id) function elk_editor() { sceditor.createEx(eTextarea, { - style: "', $settings['theme_url'], '/css/', $context['theme_variant_url'], 'jquery.sceditor.elk_wiz', $context['theme_variant'], '.css', CACHE_STALE, '", + style: "', $settings['theme_url'], '/css/', $context['theme_variant_url'], 'jquery.sceditor.wysiwyg', $context['theme_variant'], '.css', CACHE_STALE, '", width: "100%", autofocus: ', (!empty($context['site_action']) && $context['site_action'] !== 'display') ? 'true' : 'false', ', autofocusEnd: false, diff --git a/themes/default/css/_light/jquery.sceditor.elk_wiz_light.css b/themes/default/css/_light/jquery.sceditor.wysiwyg_light.css similarity index 99% rename from themes/default/css/_light/jquery.sceditor.elk_wiz_light.css rename to themes/default/css/_light/jquery.sceditor.wysiwyg_light.css index 4efddc5d1f..65af324a37 100644 --- a/themes/default/css/_light/jquery.sceditor.elk_wiz_light.css +++ b/themes/default/css/_light/jquery.sceditor.wysiwyg_light.css @@ -14,8 +14,8 @@ --me: #5BA048; /* me and footnotes */ } +/* This really should match your site stylesheet */ html, body { - font-size: 15px; font-weight: 400; line-height: 1.5; overflow: auto; From 2bffb43d2a7b7ef6e95a27c90098e8a0bcff65c6 Mon Sep 17 00:00:00 2001 From: Spuds Date: Tue, 23 Apr 2024 17:09:33 -0500 Subject: [PATCH 02/19] ! simple var to let --- sources/ElkArte/AdminController/ManageRegistration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/ElkArte/AdminController/ManageRegistration.php b/sources/ElkArte/AdminController/ManageRegistration.php index 3b47759179..6e73f7057a 100644 --- a/sources/ElkArte/AdminController/ManageRegistration.php +++ b/sources/ElkArte/AdminController/ManageRegistration.php @@ -504,10 +504,10 @@ public function action_registerSettings_display() theme()->addInlineJavascript(' function checkCoppa() { - var coppaDisabled = document.getElementById(\'coppaAge\').value == 0; + let coppaDisabled = document.getElementById(\'coppaAge\').value == 0; document.getElementById(\'coppaType\').disabled = coppaDisabled; - var disableContacts = coppaDisabled || document.getElementById(\'coppaType\').options[document.getElementById(\'coppaType\').selectedIndex].value != 1; + let disableContacts = coppaDisabled || document.getElementById(\'coppaType\').options[document.getElementById(\'coppaType\').selectedIndex].value != 1; document.getElementById(\'coppaPost\').disabled = disableContacts; document.getElementById(\'coppaFax\').disabled = disableContacts; document.getElementById(\'coppaPhone\').disabled = disableContacts; From 08f3a64ab07fdd01eed00f2307d43f2ae208a7d5 Mon Sep 17 00:00:00 2001 From: Spuds Date: Tue, 23 Apr 2024 17:14:19 -0500 Subject: [PATCH 03/19] ! coppa form error from refactor --- sources/ElkArte/Controller/About.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/ElkArte/Controller/About.php b/sources/ElkArte/Controller/About.php index 053536fa77..81cf447838 100644 --- a/sources/ElkArte/Controller/About.php +++ b/sources/ElkArte/Controller/About.php @@ -181,7 +181,7 @@ public function action_coppa() if (isset($this->_req->query->form)) { - $this->handleContactForm(); + $this->handleContactForm($member); } else { @@ -190,14 +190,14 @@ public function action_coppa() } /** - * Handle the contact form for the forum. + * Handle the contact form for member registration. * - * This method allows for the viewing or downloading of the COPPA form. - * Accessed by action=about;sa=coppa;form;dl;member= and action=about;sa=coppa;form;member= + * This method sets the necessary variables in the global $context for displaying the contact form. + * If the query parameter `dl` is set, the method outputs a file for download, otherwise it shows the contact form template. * - * @return void + * @param array $member The member data from getBasicMemberData()) */ - private function handleContactForm() + private function handleContactForm($member) { global $context, $modSettings, $txt; From 1a2b880592a021acef361afc33b8e27de81e5e3f Mon Sep 17 00:00:00 2001 From: Spuds Date: Tue, 23 Apr 2024 17:15:14 -0500 Subject: [PATCH 04/19] ! prevent metadata error when there are no likes or the feature is off --- sources/ElkArte/MetadataIntegrate.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/ElkArte/MetadataIntegrate.php b/sources/ElkArte/MetadataIntegrate.php index 896e312a2c..211dbda1bb 100644 --- a/sources/ElkArte/MetadataIntegrate.php +++ b/sources/ElkArte/MetadataIntegrate.php @@ -482,6 +482,11 @@ public function getLikeCount() global $context; $total = 0; + if (empty($context['likes'])) + { + return $total; + } + foreach($context['likes'] as $item) { $total += $item['count']; } From 1648c9eb834d92de4d624d927b2b5e35a4813f13 Mon Sep 17 00:00:00 2001 From: Spuds Date: Tue, 23 Apr 2024 17:19:05 -0500 Subject: [PATCH 05/19] ! poll options remove vote caused an error due to query --- sources/ElkArte/Controller/Poll.php | 2 ++ sources/subs/Poll.subs.php | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sources/ElkArte/Controller/Poll.php b/sources/ElkArte/Controller/Poll.php index 9dcb1e6493..c24c7e8395 100644 --- a/sources/ElkArte/Controller/Poll.php +++ b/sources/ElkArte/Controller/Poll.php @@ -130,8 +130,10 @@ public function action_vote() if (!empty($row['change_vote']) && $this->user->is_guest === false && empty($this->_req->post->options)) { checkSession('request'); + // Find out what they voted for before. $pollOptions = determineVote($this->user->id, $row['id_poll']); + // Just skip it if they had voted for nothing before. if (!empty($pollOptions)) { diff --git a/sources/subs/Poll.subs.php b/sources/subs/Poll.subs.php index dc0e890587..277aeda88f 100644 --- a/sources/subs/Poll.subs.php +++ b/sources/subs/Poll.subs.php @@ -714,7 +714,7 @@ function increaseGuestVote($id_poll) function determineVote($id_member, $id_poll) { $db = database(); - $pollOptions = array(); + $pollOptions = []; $db->fetchQuery(' SELECT @@ -728,7 +728,10 @@ function determineVote($id_member, $id_poll) ) )->fetch_callback( function ($row) use (&$pollOptions) { - $pollOptions[] = $row[0]; + if (isset($row['id_choice'])) + { + $pollOptions[] = $row['id_choice']; + } } ); From 7f7f1983dbbe0ec1acf6bcadd7d981daa3af3961 Mon Sep 17 00:00:00 2001 From: Spuds Date: Tue, 23 Apr 2024 17:23:59 -0500 Subject: [PATCH 06/19] ! add option to move keyinfo to post header --- themes/default/Display.template.php | 104 ++++++++++++++++----------- themes/default/Settings.template.php | 4 ++ 2 files changed, 66 insertions(+), 42 deletions(-) diff --git a/themes/default/Display.template.php b/themes/default/Display.template.php index 82ddc52a71..97b97716e4 100644 --- a/themes/default/Display.template.php +++ b/themes/default/Display.template.php @@ -133,7 +133,7 @@ function template_messages() $ignoring = false; } - // Show the message anchor and a "new" anchor if this message is new. + // Show the message anchor and a "new" separator if this message is the first new. if (($message['id'] != $context['first_message']) && $message['first_new']) { echo ' @@ -141,57 +141,34 @@ function template_messages()
'; } - echo ' -
', $message['id'] != $context['first_message'] ? ' + echo $message['id'] != $context['first_message'] ? ' ' : ''; + echo ' +
'; + + if (!empty($settings['show_keyinfo_above'])) + { + template_keyinfo($message, $ignoring, true); + } + // Showing the sidebar poster area? if (empty($options['hide_poster_area'])) { echo ' -