######################################################################################
##
## Program :
## Description :
## Programmer : äªÂÃѵ¹ì Êع·ÃÇÔÀÒµ
## Email : webmaster@sixhead.net,sixheadz@hotmail.com
## Website : http://www.sixhead.net
## Date :
## Modify log :
##
######################################################################################
#####################################################################
#### start setup ####
$template_download = "_template_download_v4.html";
#### end of setup ####
#####################################################################
#####################################################################
#### start program ####
require "_config.php";
require "_module.php";
ob_start();
global $tp;
@$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db($config_db_name);
if (!$db) { echo "Error connect to Database: " . mysql_error(); ob_end_flush(); exit; }
$sql = "SELECT DOWNLOAD_WEEK,DOWNLOAD_THIS_WEEK,DOWNLOAD_ALL FROM $config_table_program WHERE (ID = $id)";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
$DOWNLOAD_WEEK = $row[DOWNLOAD_WEEK];
$DOWNLOAD_THIS_WEEK = $row[DOWNLOAD_THIS_WEEK];
$DOWNLOAD_ALL = $row[DOWNLOAD_ALL];
}
$DOWNLOAD_THIS_WEEK += 1;
$DOWNLOAD_ALL += 1;
$week_of_year = strftime("%W");
if ($DOWNLOAD_WEEK == $week_of_year) { # à»ç¹ÊÑ»´ÒËì»Ñ¨¨ØºÑ¹
mysql_query ("UPDATE $config_table_program SET DOWNLOAD_THIS_WEEK = '$DOWNLOAD_THIS_WEEK',DOWNLOAD_ALL = '$DOWNLOAD_ALL' WHERE (ID = $id)");
}
else { # ¢Öé¹ÊÑ»´ÒËìãËÁè
mysql_query ("UPDATE $config_table_program SET DOWNLOAD_WEEK = '$week_of_year',DOWNLOAD_THIS_WEEK = '1',DOWNLOAD_ALL = '$DOWNLOAD_ALL' WHERE (ID = $id)");
}
$sql = "SELECT NAME,URL,URL_MIRROR FROM $config_table_program WHERE (ID = $id)";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
$tp[NAME] = ucfirst($row[NAME]);
$tp[URL_ALL] = "Main: $row[URL]
";
if ($row[URL_MIRROR]) {
$MIRROR = preg_split('/\|/', $row[URL_MIRROR], -1, PREG_SPLIT_NO_EMPTY);
foreach ($MIRROR as $mirror) {
$tp[URL_ALL] .= "Mirror: $mirror
";
}
}
}
mysql_free_result($result);
mysql_close($db);
$tp[url] = $url;
Template($template_download);
#### end of program ####
#####################################################################
#### Start sub program. Don't touch anything below ####
?>