add what's new to help page

This commit is contained in:
Michael Erdely 2024-12-31 14:43:47 -05:00
parent 599e0694e9
commit e137821b94
Signed by: mike
SSH key fingerprint: SHA256:ukbnfrRMaRYlBZXENtBTyO2jLnql5AA5m+SzZCfYQe0
2 changed files with 40 additions and 1 deletions

View file

@ -54,11 +54,12 @@ if (!empty($_POST["action"])) {
}
try {
$stmt = $smarty->dbh()->prepare("SELECT show_helptext FROM {$opt["table_prefix"]}users WHERE userid = ?");
$stmt = $smarty->dbh()->prepare("SELECT email, show_helptext FROM {$opt["table_prefix"]}users WHERE userid = ?");
$stmt->bindParam(1, $userid, PDO::PARAM_INT);
$stmt->execute();
if ($row = $stmt->fetch()) {
$smarty->assign('email', $row["email"]);
$smarty->assign('show_helptext', $row["show_helptext"]);
$_SESSION['show_helptext'] = $row["show_helptext"];
}

View file

@ -75,6 +75,24 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
</div> <!-- card body -->
</div> <!-- card -->
</div> <!-- col -->
<div class="col">
<div class="card h-100">
<div class="card-header">What's New</div>
<div class="card-body">
<ul>
<li>2024-12-31: Items can be marked "Public" and shared with others via
<div class="input-group">
<input type="text" id="readonlyText" class="form-control" value="{$myurl}/shop.php?list={$email}" readonly>
<button class="btn btn-primary" id="copyButton">Copy</button>
</div>
</li>
<li>2024-12-31: Marking items as received archives them instead of deletes them</li>
<li>2024-12-31: Items can be archived and the Item Archive can be viewed under the profile icon (top-right)</li>
<li>2024-12-17: You are automatically a shopper for your family members</li>
</ul>
</div> <!-- card body -->
</div> <!-- card -->
</div> <!-- col -->
<div class="col">
<div class="card h-100">
<div class="card-header">Gift Registry Help</div>
@ -141,5 +159,25 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
</div> <!-- container -->
</main>
{include file='footer.tpl'}
<script>
document.getElementById('copyButton').addEventListener('click', function() {
// Get the text from the input field
const textBox = document.getElementById('readonlyText');
textBox.select();
textBox.setSelectionRange(0, 99999); // For mobile devices
// Copy the text to the clipboard
navigator.clipboard.writeText(textBox.value)
.then(() => {
// Show success message
const alert = document.getElementById('copyAlert');
alert.classList.remove('d-none');
setTimeout(() => {
alert.classList.add('d-none');
}, 2000); // Hide the alert after 2 seconds
})
.catch(err => console.error('Failed to copy text:', err));
});
</script>
</body>
</html>