[aur-dev] [PATCH] removed obsolete inline CSS in index.php

Michael Klier chi at chimeric.de
Sat Jun 7 13:06:08 EDT 2008


Angel Velásquez wrote:
>    Oh hi Michael, good, but, i have to be annoying again (and sorry) but
>    what about with the double and simple quotes subject? i know that the
>    file was originally written bad, but try at least to don't copy and
>    paste things like:
>    print "</th>";
>    print "</tr>";
>    Remember, double quotes and simple quotes are important even if you
>    think that 'both works'. I tried to said you this in the other mail,
>    and i thought that you understood (i hope this time you will), thanks
>    anyway, but please try to clean the code (or maybe i say optimize it?)
>    before submit a patch, isn't the idea to patch and re-patch with
>    bad-written-code.
>    Thanks!

Here's another attempt (patch attached to the mail this time), I hope I got it
right this time :). Now I've change the quoting style like you said for the
changed line as well as the surrounding html block. In one case I've also
fixed the indentation (to use tabs) as it seemed the right step to me (that
still leaves enough bad quoting to fix, but I was asked to also keep the diffs
short).

Kind Regards,
	Michael

-- 
Michael Klier
-------------- next part --------------
From 08ed4e1820dee70a045563fc6bd5ff57a5275da3 Mon Sep 17 00:00:00 2001
From: Michael Klier <chi at chimeric.de>
Date: Sat, 7 Jun 2008 18:55:12 +0200
Subject: [PATCH] removed obsolete inline CSS in index.php

---
 web/html/index.php |   76 ++++++++++++++++++++++++++--------------------------
 1 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/web/html/index.php b/web/html/index.php
index 895fc8a..43f4571 100644
--- a/web/html/index.php
+++ b/web/html/index.php
@@ -38,35 +38,35 @@ $result = db_query($q,$dbh);
 # Table 2
 print '<table class="boxSoft">';
 print '<tr>';
-print '<th colspan="2" class="boxSoftTitle" style="text-align: right">';
-print ' <a href="/rss2.php"><img src="/images/rss.gif"></a> <span class="f3">'.__("Recent Updates").' <span class="f5"></span></span>';
+print '<th colspan="2" class="boxSoftTitle">';
+print '  <a href="/rss2.php"><img src="/images/rss.gif"></a><span class="f3">'.__("Recent Updates").' <span class="f5"></span></span>';
 print '</th>';
 print '</tr>';
 
 while ($row = mysql_fetch_assoc($result)) {
 	print '<tr>';
-        print '<td class="boxSoft">';
+	print '<td class="boxSoft">';
 
-        print '<span class="f4"><span class="blue"><a href="/packages.php?ID='.intval($row["ID"]).'">';
+	print '<span class="f4"><span class="blue"><a href="/packages.php?ID='.intval($row["ID"]).'">';
 	print $row["Name"]." ".$row["Version"]."</a></span></span>";
 
-        print '</td>';
-	print '<td class="boxSoft" style="text-align: right">';
-
-        # figure out the mod string
-        $mod_int = intval($row["ModifiedTS"]);
-        $sub_int = intval($row["SubmittedTS"]);
-        if ($mod_int != 0) {
-	  $modstring = gmdate("r", $mod_int);
-        }
-        elseif ($sub_int != 0) {
-          $modstring = '<img src="/images/new.gif"/> '.gmdate("r", $sub_int);
-        }
-        else {
-          $mod_string = "(unknown)";
-        }
-        print '<span class="f4">'.$modstring.'</span>';
-        print '</td>';
+	print '</td>';
+	print '<td class="boxSoft">';
+
+	# figure out the mod string
+	$mod_int = intval($row["ModifiedTS"]);
+	$sub_int = intval($row["SubmittedTS"]);
+	if ($mod_int != 0) {
+		$modstring = gmdate("r", $mod_int);
+	}
+	elseif ($sub_int != 0) {
+		$modstring = '<img src="/images/new.gif"/> '.gmdate("r", $sub_int);
+	}
+	else {
+		$mod_string = "(unknown)";
+	}
+	print '<span class="f4">'.$modstring.'</span>';
+	print '</td>';
 	print '</tr>'."\n";
 }
 print "</td>";
@@ -121,21 +121,21 @@ if (!empty($user)) {
     $row = mysql_fetch_row($result);
     $flagged_outdated = $row[0];
     
-    print "<table class='boxSoft'>";
+    print '<table class="boxSoft">';
     
-    print "<tr>";
-    print "<th colspan='2' class='boxSoftTitle' style='text-align: right'>";
-    print "<span class='f3'>".__("My Statistics")."</span>";
-    print "</th>";
-    print "</tr>";
+    print '<tr>';
+    print '<th colspan="2" class="boxSoftTitle">';
+    print '<span class="f3">'.__('My Statistics').'</span>';
+    print '</th>';
+    print '</tr>';
     
     # Number of packages in unsupported
-    print "<tr>";
-    print "<td class='boxSoft'>";
-    print "<span class='f4'>".__("Packages in unsupported")."</span>";
-    print "</td>";
-    print "<td class='boxSoft'><span class='f4'>$maintainer_unsupported_count</span></td>";
-    print "</tr>";
+    print '<tr>';
+    print '<td class="boxSoft">';
+    print '<span class="f4">'.__('Packages in unsupported').'</span>';
+    print '</td>';
+    print '<td class="boxSoft"><span class="f4">'.$maintainer_unsupported_count.'</span></td>';
+    print '</tr>';
     
     # If the user is a TU calculate the number of the packages
     $atype = account_from_sid($_COOKIE["AURSID"]);
@@ -167,11 +167,11 @@ if (!empty($user)) {
 
 print "<table class='boxSoft'>";
 
-print "<tr>";
-print "<th colspan='2' class='boxSoftTitle' style='text-align: right'>";
-print "<span class='f3'>".__("Statistics")."</span>";
-print "</th>";
-print "</tr>";
+print '<tr>';
+print '<th colspan="2" class="boxSoftTitle">';
+print '<span class="f3">'.__('Statistics').'</span>';
+print '</th>';
+print '</tr>';
 
 print "<tr>";
 print "<td class='boxSoft'>";
-- 
1.4.4.4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://archlinux.org/pipermail/aur-dev/attachments/20080607/d2377c23/attachment.pgp>


More information about the aur-dev mailing list