- Reviews and forum posts/replies now use a modern comment layout: avatar + username/meta on the left, content/actions on the right.

Added sanitized Markdown rendering for reviews, forum topics, and 
replies.
Added a local Markdown editor with toolbar and live visual preview 
for:Review body on 
[business.php](/Users/tyemeclifford/Documents/GH/MyKeyser/business.php)
Forum topic body and reply body on 
[forum.php](/Users/tyemeclifford/Documents/GH/MyKeyser/forum.php)

Added editor/comment styling in 
[assets/css/style.css](/Users/tyemeclifford/Documents/GH/MyKeyser/assets/css/style.css).
Added the editor script at 
[assets/js/markdown-editor.js](/Users/tyemeclifford/Documents/GH/MyKeyser/assets/js/markdown-editor.js), 
included globally through 
[includes/footer.php](/Users/tyemeclifford/Documents/GH/MyKeyser/includes/footer.php).
This commit is contained in:
Ty Clifford
2026-06-19 11:07:43 -04:00
parent 25327e3302
commit ed932a6cd6
6 changed files with 305 additions and 37 deletions
+13 -15
View File
@@ -450,7 +450,7 @@ include __DIR__.'/includes/header.php';
</div>
<div class="fg">
<label class="flabel">YOUR REVIEW</label>
<textarea name="rbody" class="ftextarea" placeholder="Share your experience…"><?=e($myrev['body'] ?? '')?></textarea>
<textarea name="rbody" class="ftextarea markdown-editor" placeholder="Share your experience…"><?=e($myrev['body'] ?? '')?></textarea>
</div>
<button type="submit" class="btn btn-primary btn-sm">Submit Review</button>
</form>
@@ -462,17 +462,16 @@ include __DIR__.'/includes/header.php';
<?php endif; ?>
<?php foreach ($reviews as $r): ?>
<div class="rev-card">
<div class="rev-hdr">
<div class="rev-user">
<?=userAvatarHtml($r, 'avatar-sm')?>
<div>
<div class="rev-author"><?=e($r['username'] ?? 'Anonymous')?></div>
<?=starDisplay((float)($r['rating'] ?? 0))?>
</div>
</div>
<div class="flex-row" style="gap:.5rem">
<span class="rev-date"><?=ago($r['created_at'] ?? '')?></span>
<article class="rev-card comment-card">
<aside class="comment-author">
<?=userAvatarHtml($r, 'avatar-lg')?>
<div class="comment-name"><?=e($r['username'] ?? 'Anonymous')?></div>
<div class="comment-meta"><?=ago($r['created_at'] ?? '')?></div>
<?=starDisplay((float)($r['rating'] ?? 0))?>
</aside>
<div class="comment-content">
<div class="comment-topline">
<?php if (!empty($r['title'])): ?><div class="rev-title"><?=e($r['title'])?></div><?php else: ?><div></div><?php endif; ?>
<?php if (isAdmin()): ?>
<form method="POST">
<?=csrfField()?>
@@ -482,10 +481,9 @@ include __DIR__.'/includes/header.php';
</form>
<?php endif; ?>
</div>
<?php if (!empty($r['body'])): ?><div class="rev-body markdown-body"><?=renderMarkdown((string)$r['body'])?></div><?php endif; ?>
</div>
<?php if (!empty($r['title'])): ?><div class="rev-title"><?=e($r['title'])?></div><?php endif; ?>
<?php if (!empty($r['body'])): ?><div class="rev-body"><?=e($r['body'])?></div><?php endif; ?>
</div>
</article>
<?php endforeach; ?>
<?php if (!$reviews): ?>
<p style="color:var(--text-d);font-size:.88rem">No reviews yet — be the first!</p>