[or-cvs] r14993: (ticket:100) Adding in ideas, thanks\! (in torstatus/trunk/web: . css)

kasimir at seul.org kasimir at seul.org
Fri Jun 6 16:20:26 UTC 2008


Author: kasimir
Date: 2008-06-06 12:20:26 -0400 (Fri, 06 Jun 2008)
New Revision: 14993

Modified:
   torstatus/trunk/web/css/style.css
   torstatus/trunk/web/router_detail.php
Log:
(ticket:100) Adding in ideas, thanks\!

Modified: torstatus/trunk/web/css/style.css
===================================================================
--- torstatus/trunk/web/css/style.css	2008-06-06 15:34:33 UTC (rev 14992)
+++ torstatus/trunk/web/css/style.css	2008-06-06 16:20:26 UTC (rev 14993)
@@ -169,3 +169,8 @@
 {
 	background-image: url(/img/searchhover.png);
 }
+
+td.TRSB a:hover
+{
+	text-decoration: underline;
+}

Modified: torstatus/trunk/web/router_detail.php
===================================================================
--- torstatus/trunk/web/router_detail.php	2008-06-06 15:34:33 UTC (rev 14992)
+++ torstatus/trunk/web/router_detail.php	2008-06-06 16:20:26 UTC (rev 14993)
@@ -314,9 +314,48 @@
 	if ($Family_DATA_ARRAY == null) {echo "No Info Given";}
 	else
 	{
-		for ($i=0 ; $i < count($Family_DATA_ARRAY) ; $i++)
+		foreach ($Family_DATA_ARRAY as $FamilyMember)
 		{
-			echo "$Family_DATA_ARRAY[$i]<br/>";
+			// Link to the routers in the family, as well as
+			// provide names for fingerprints
+			if (substr($FamilyMember,0,1) == "$" && strlen($FamilyMember) == 41)
+			{
+				// It can be assumed to be a fingerprint
+				// The name and countrycode should be found
+				$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/>";
+			}
+			else
+			{
+				// It can be assumed to be a name
+				// The countrycode and fingerprint are needed
+				// - Test to make sure that there is only one
+				//   router with the same name
+				$query = "SELECT `CountryCode`, `Fingerprint` from `$ActiveNetworkStatusTable` WHERE `Name` LIKE '$FamilyMember'";
+				$result = mysql_query($query) or die('Query failed: ' . mysql_error());
+				if (mysql_num_rows($result) == 1)
+				{
+					$record = mysql_fetch_assoc($result);
+					$fplink = strtolower(substr($record['Fingerprint'],1));
+					// 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\">$FamilyMember</a><br/>";
+				}
+				else
+				{
+					// Unfortunately, the name is 
+					// meaningless
+					// Display in the form
+					//  Name
+					echo "$FamilyMember<br/>";
+				}
+
+			}
 		}
 	}
 	echo "</td>\n";



More information about the tor-commits mailing list