[or-cvs] r14994: (ticket:100) Removing fingerprint and adding for when router (torstatus/trunk/web)

kasimir at seul.org kasimir at seul.org
Fri Jun 6 17:42:26 UTC 2008


Author: kasimir
Date: 2008-06-06 13:42:26 -0400 (Fri, 06 Jun 2008)
New Revision: 14994

Modified:
   torstatus/trunk/web/router_detail.php
Log:
(ticket:100) Removing fingerprint and adding for when router is not found

Modified: torstatus/trunk/web/router_detail.php
===================================================================
--- torstatus/trunk/web/router_detail.php	2008-06-06 16:20:26 UTC (rev 14993)
+++ torstatus/trunk/web/router_detail.php	2008-06-06 17:42:26 UTC (rev 14994)
@@ -325,10 +325,20 @@
 				$fplink = strtolower(substr($FamilyMember,1));
 				$query = "SELECT `CountryCode`, `Name` from `$ActiveNetworkStatusTable` WHERE `Fingerprint` LIKE '$fplink'";
 				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
-				$record = mysql_fetch_assoc($result);
-				// Display in the form
-				//  [linked][countrycode]Fingerprint (Name)
-				echo "<img src=\"img/flags/".strtolower($record['CountryCode']).".gif\" class=\"flag\" /> <a href=\"router_detail.php?FP=$fplink\">$FamilyMember (".$record['Name'].")</a><br/>";
+				if (mysql_num_rows($result) == 1)
+				{
+					$record = mysql_fetch_assoc($result);
+					// Display in the form
+					//  [linked][countrycode] Name
+					echo "<img src=\"img/flags/".strtolower($record['CountryCode']).".gif\" class=\"flag\" /> <a href=\"router_detail.php?FP=$fplink\">".$record['Name']."</a><br/>";
+				}
+				else
+				{
+					// The router was not found
+					// Display in the form
+					//  Fingerprint
+					echo "$FamilyMember<br/>";
+				}
 			}
 			else
 			{



More information about the tor-commits mailing list