From fa3f1e46618fc4cdd088b17fee16ef20f3956d49 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Jan 2025 08:37:14 +0100 Subject: [PATCH] updated fixed broken links --- www/header.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/www/header.php b/www/header.php index 0f2dd1d..720ceb4 100644 --- a/www/header.php +++ b/www/header.php @@ -24,6 +24,13 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { // if the row is the first one (name url status score) only display (Name Status Score): // display the contents of a csv row if ( $c == "1" ){ +//add http if its not already done in the URL +if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) { + $urllink = "http://" . $data[3]; + }else{ + $urllink = $data[3]; + } + if ($oldcatname != $data[1]){ echo ""; // skip a row if new category @@ -36,7 +43,8 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { echo "" ; // begin the table cell echo ' '; // display the link + //echo $data[3] . '"> '; // display the link + echo $urllink . '"> '; // display the link echo $data[2] . " "; // display the link title and close the a href and first cell, open the second cell echo $data[7] . " "; // display the status and close the second cell, open the third cell echo $data[6] . " \n"; // display the score and close the third cell