diff --git a/database/migration_006_profile_links.sql b/database/migration_006_profile_links.sql new file mode 100644 index 0000000..219837d --- /dev/null +++ b/database/migration_006_profile_links.sql @@ -0,0 +1,9 @@ +CREATE TABLE IF NOT EXISTS profile_links ( + id SERIAL PRIMARY KEY, + user_email TEXT NOT NULL, + url TEXT NOT NULL, + title TEXT NOT NULL DEFAULT '', + description TEXT NOT NULL DEFAULT '', + position INT NOT NULL DEFAULT 0, + created_at TIMESTAMP DEFAULT now() +); diff --git a/public/.htaccess b/public/.htaccess index de04719..9575fa6 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -44,8 +44,12 @@ RewriteRule ^flux/?$ /index.php?action=flux [L,QSA] RewriteRule ^feed/add/?$ /index.php?action=add_feed [L,QSA] RewriteRule ^feed/delete/?$ /index.php?action=delete_feed [L,QSA] -# Profil public auteur +# Profil public auteur + page liens RewriteRule ^profil/([a-z0-9][a-z0-9-]*)/?$ /index.php?action=author&slug=$1 [L,QSA] +RewriteRule ^liens/([a-z0-9][a-z0-9-]*)/?$ /index.php?action=liens&slug=$1 [L,QSA] +RewriteRule ^link/add/?$ /index.php?action=add_link [L,QSA] +RewriteRule ^link/delete/?$ /index.php?action=delete_link [L,QSA] +RewriteRule ^link/reorder/?$ /index.php?action=reorder_links [L,QSA] # Pages statiques RewriteRule ^about/?$ /index.php?action=about [L,QSA] diff --git a/public/assets/css/style.css b/public/assets/css/style.css index fe5479d..e1eb707 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -1286,6 +1286,101 @@ footer.mt-5 { margin-top: 0 !important; } font-size: .9375rem; } +/* ─── Page "Mes liens" ───────────────────── */ + +.liens-page { + max-width: 480px; + margin: 0 auto; + padding: 2.5rem 1rem 4rem; + display: flex; + flex-direction: column; + align-items: center; + gap: 2rem; +} + +.liens-header { + display: flex; + flex-direction: column; + align-items: center; + gap: .75rem; + text-align: center; +} + +.liens-avatar { + width: 5rem; + height: 5rem; + border-radius: 50%; + background: var(--vl-accent); + color: #fff; + font-size: 2rem; + font-weight: 700; + display: flex; + align-items: center; + justify-content: center; +} + +.liens-name { + font-size: 1.25rem; + font-weight: 700; + margin: 0; +} + +.liens-bio { + font-size: .9rem; + color: var(--vl-muted); + line-height: 1.6; + margin: 0; +} + +.liens-list { + width: 100%; + display: flex; + flex-direction: column; + gap: .75rem; +} + +.liens-item { + display: flex; + flex-direction: column; + align-items: center; + gap: .2rem; + width: 100%; + padding: .875rem 1.25rem; + border-radius: var(--vl-radius); + border: 1.5px solid var(--vl-border); + background: var(--vl-surface); + text-align: center; + text-decoration: none; + color: var(--vl-text); + font-weight: 600; + transition: border-color .15s, background .15s, transform .1s; + box-shadow: var(--vl-shadow-sm); +} + +.liens-item:hover { + border-color: var(--vl-accent); + background: var(--vl-accent-soft); + color: var(--vl-accent); + transform: translateY(-1px); + box-shadow: var(--vl-shadow-md); +} + +.liens-item-title { font-size: 1rem; } + +.liens-item-desc { + font-size: .8rem; + font-weight: 400; + color: var(--vl-muted); +} +.liens-item:hover .liens-item-desc { color: var(--vl-accent); opacity: .8; } + +.liens-footer { + font-size: .8rem; + color: var(--vl-muted); +} +.liens-footer a { color: inherit; } +.liens-footer a:hover { color: var(--vl-accent); } + /* ─── Agrégateur de flux ─────────────────── */ .flux-list { diff --git a/public/index.php b/public/index.php index 439d92b..9120399 100644 --- a/public/index.php +++ b/public/index.php @@ -22,7 +22,7 @@ $action = $_GET['action'] ?? 'list'; $uuid = $_GET['uuid'] ?? ''; $slug = $_GET['slug'] ?? ''; -$_noindexActions = ['create', 'edit', 'admin', 'categories', 'diff', 'add_files', 'import_image', 'import_image_step2', 'sources', 'profile', 'delete_file', 'delete_external_link', 'rename_category', 'delete_category', 'toggle_private_category', 'admin_save_site', 'not_found', 'add_feed', 'delete_feed']; +$_noindexActions = ['create', 'edit', 'admin', 'categories', 'diff', 'add_files', 'import_image', 'import_image_step2', 'sources', 'profile', 'delete_file', 'delete_external_link', 'rename_category', 'delete_category', 'toggle_private_category', 'admin_save_site', 'not_found', 'add_feed', 'delete_feed', 'add_link', 'delete_link', 'reorder_links']; $metaRobots = in_array($action, $_noindexActions, true) ? 'noindex, nofollow' : null; unset($_noindexActions); @@ -881,6 +881,92 @@ switch ($action) { include BASE_PATH . '/templates/author_profile.php'; break; + case 'liens': + $liensSlug = trim($_GET['slug'] ?? ''); + $liensRow = profileBySlug($liensSlug); + if (!$liensRow) { + http_response_code(404); + $content = '
Page introuvable.
= nl2br(htmlspecialchars($_lBio)) ?>
+ +