From 58900e3d606dc5490a6c4ba06effe0eba77dee4a Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Thu, 2 Jan 2020 22:38:41 +0100 Subject: [PATCH] Link sources directly instad of through the list at the bottom --- shared.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shared.php b/shared.php index 53c88f8..056843d 100644 --- a/shared.php +++ b/shared.php @@ -156,9 +156,11 @@ */ $meta['sources'] = array(); $counters['sources'] = 1; - function addSource($url) { + function addSource($url, $text="") { global $counters; global $meta; + if ("$text" != "") + $text .= " "; if (is_numeric($url)) { echo "[" . $url . "]"; return $url; @@ -168,14 +170,14 @@ $i = 1; foreach ($meta['sources'] as $v) { if ($v == $url) { - echo "[" . $i . "]"; + echo "" . $text . "[" . $i . "]"; return $i; } $i++; } // If not found, then add $meta['sources'][$counters['sources']] = $url; - echo "[" . $counters['sources'] . "]"; + echo "" . $text . "[" . $counters['sources'] . "]"; return $counters['sources']++; } }