issue: append and ignore page titles in links
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 20 Oct 2019 03:49:22 +0000 (05:49 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 9 Nov 2019 06:08:13 +0000 (07:08 +0100)
Preserve names of replaced files, and improve recognition of sent targets
as well as seo score.

issue/index.php
widget/comments.sql

index 3d62ced075f98f34c04285e6d2c1bb83b828e8ad..d8f9c261e65b877764dafca34e28488dc2e9cfa4 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 global $User, $Db;
 require_once 'database.inc.php';
-$id = trim($Args, '/');
+@list ($id, $title) = explode('/', ltrim($Args, '/'));
 
 if ($id) {
        $Article->title = "Issue #$id";
@@ -19,6 +19,7 @@ if ($id) {
                        'Opgelost', showdate(preg_split('/\D/', $row->closed))
                );
        }
+       $Args = "/$id";  # minimal reference
        print placeholder_include('reply');
        return;
 }
@@ -44,7 +45,7 @@ ob_start();
 print '<ul>';
 while ($row = $query->fetch()) {
        printf('<li><a href="%s">%s <small class="date">%s</small></a>',
-               "/$Page/{$row->id}",
+               "/$Page/{$row->id}/{$row->link}",
                sprintf($row->closed ? '<strike>%s</strike>' : '%s',
                        htmlspecialchars($row->subject)),
                showdate(array_slice(preg_split('/\D/', $row->created), 0, 3))
index 54088778108f5bbe4053b61b977bb838137e1e78..5e33716da32f7843e95e441c797e0ee36fb9543c 100644 (file)
@@ -1,5 +1,6 @@
 CREATE TABLE issues (
        page       text        NOT NULL DEFAULT 'issue',
+       link       text,
        subject    text,
        body       text,
        created    timestamptz          DEFAULT now(),