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']++; } }