Disable install.php redirects and DownloadCounts. For performance and bustage reasons. Bug 267822

git-svn-id: svn://10.0.0.236/branches/update_0_9_branch@164966 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
psychoticwolf%carolina.rr.com
2004-11-05 01:24:45 +00:00
parent e932f1f6a6
commit 61ba5ab47e
5 changed files with 18 additions and 6 deletions

View File

@@ -44,6 +44,11 @@ $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mys
$row = mysql_fetch_array($sql_result);
$uri=$row["URI"];
header("Location: $uri")
exit;
//XXX This codepath sucks performance wise and has been disabled. See Bug 267822.
// New DownloadCount management Code..
//Check for user, to see if they recently accessed this file (filters duplicate/triplicate+ requests in a short period).
$maxlife = date("YmdHis", mktime(date("H"), date("i")-10, date("s"), date("m"), date("d"), date("Y")));

View File

@@ -255,7 +255,8 @@ echo"
if ($appname=="Thunderbird") {
echo"<A HREF=\"install.php?id=$id&vid=$vid\" TITLE=\"Download $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\">&nbsp;( Download Now )</A><BR>";
} else {
echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\">&nbsp;( Install Now )</A><BR>";
echo"<A HREF=\"javascript:void(InstallTrigger.install({'$name $version':'$uri'}))\" TITLE=\"Install $name $version\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\">&nbsp;( Install Now )</A><BR>";
//echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\">&nbsp;( Install Now )</A><BR>";
}
echo"
<SPAN class=\"filesize\">&nbsp;&nbsp;$filesize KB, ($time @ $speed"."k)</SPAN></DIV>
@@ -371,7 +372,8 @@ echo"</SPAN>\n";
//Icon Bar Modules
echo"<DIV style=\"height: 34px\">";
echo"<DIV class=\"iconbar\" style=\"width: 100px;\"><A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name (Right-Click to Download)\" ALT=\"\">Install</A><BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
echo"<DIV class=\"iconbar\" style=\"width: 100px;\"><A HREF=\"javascript:void(InstallTrigger.install({'$name $version':'$uri'}))\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name (Right-Click to Download)\" ALT=\"\">Install</A><BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
//echo"<DIV class=\"iconbar\" style=\"width: 100px;\"><A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name (Right-Click to Download)\" ALT=\"\">Install</A><BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"$appname\">&nbsp;Works with:<BR>&nbsp;&nbsp;$minappver - $maxappver</DIV>";
echo"<DIV class=\"iconbar\" style=\"width: 90px;\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"\">OS:<BR>"; if($osname=="ALL") {echo"All OSes";} else {echo"$osname";} echo"</DIV>";
echo"</DIV>";

View File

@@ -395,8 +395,8 @@ echo"<DIV class=\"iconbar\" style=\"width: 104px;\">";
if ($appname=="Thunderbird") {
echo"<A HREF=\"moreinfo.php?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
} else {
echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name\" ALT=\"\">Install</A>";
//echo"<A HREF=\"javascript:void(InstallTrigger.install({'$name $version':'$uri'}))\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name\" ALT=\"\">Install</A>";
//echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name\" ALT=\"\">Install</A>";
echo"<A HREF=\"javascript:void(InstallTrigger.install({'$name $version':'$uri'}))\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name\" ALT=\"\">Install</A>";
}
echo"<BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
if ($homepage) {echo"<DIV class=\"iconbar\" style=\"width: 98px;\"><A HREF=\"$homepage\"><IMG SRC=\"/images/home.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"$name Homepage\" ALT=\"\">Homepage</A></DIV>";}

View File

@@ -44,6 +44,11 @@ $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mys
$row = mysql_fetch_array($sql_result);
$uri=$row["URI"];
header("Location: $uri")
exit;
//XXX This codepath sucks performance wise and has been disabled. See Bug 267822.
// New DownloadCount management Code..
//Check for user, to see if they recently accessed this file (filters duplicate/triplicate+ requests in a short period).
$maxlife = date("YmdHis", mktime(date("H"), date("i")-10, date("s"), date("m"), date("d"), date("Y")));

View File

@@ -254,7 +254,7 @@ echo"<A HREF=\"install.php?id=$id&vid=$vid\" TITLE=\"Download $name $version\"><
} else {
//Make Theme Install work again, Bug 246754
//echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'install.php/$filename?id=$id&vid=$vid','$name'))\"";
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name'))\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\">&nbsp;( Install Now )</A><BR>";
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name $version'))\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\">&nbsp;( Install Now )</A><BR>";
}
echo"
<SPAN class=\"filesize\">&nbsp;&nbsp;$filesize KB, ($time @ $speed"."k)</SPAN></DIV>
@@ -374,7 +374,7 @@ echo"<DIV class=\"iconbar\" style=\"width: 100px;\">";
if ($type=="T") {
//Make Theme Install work again, Bug 246754
//echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'install.php?id=$id&vid=$vid','$name'))\">";
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name'))\">";
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name $version'))\">";
} else {
echo"<A HREF=\"install.php?id=$id&vid=$vid\">";
}