Code tranlated:
<%
Dim gv_figures, gv_figures()
/*(c)Graham Eames 2002Code in this file may be re-used or modified
providing this copyright notice is retained */Function fn_read_stats (
lv_username )
Dim lv_username, lv_usercode, lv_url, lv_line,
lv_fcontents, lv_output, lv_section, lv_return(), lv_time, lv_points,
lv_results, lv_return
' multiline comment removed
lv_usercode = ereg_replace(" ", "+", lv_username)
' multiline comment removed
' multiline comment removed
lv_url = "http://www.grid.org/stats/members/compare.htm?un1=" & $userco de."&ord=CPU_TIME_PER_DAY"
' multiline comment removed
$fcontents = file ($url)
$output = false
$section = ""
' multiline comment removed
For lv_line = 0 to sizeof(lv_fcontents)
' multiline comment removed
If ereg("ord=CPU_TIME""", $fcontents[$line]) then
$output = true
$section = "CPU_TIME"
End If
' multiline comment removed
If (lv_output==true) && (lv_section == "CPU_TIME") then
' multiline comment removed
If ereg("\<td", $fcontents[$line]) then
' multiline comment removed
$q = split("<b>", $fcontents[$line])
$q = split("</b>", $q[1])
$time = $q[0]
' multiline comment removed
$output = false
$section = ""
End If
End If
' multiline comment removed
If ereg("ord=POINTS""", $fcontents[$line]) then
$output = true
$section = "POINTS"
End If
' multiline comment removed
If (lv_output==true) && (lv_section == "POINTS") then
' multiline comment removed
If ereg("\<td", $fcontents[$line]) then
' multiline comment removed
$q = split("<b>", $fcontents[$line])
$q = split("</b>", $q[1])
$points = $q[0]
' multiline comment removed
$output = false
$section = ""
End If
End If
' multiline comment removed
If ereg("ord=RESULTS""", $fcontents[$line]) then
$output = true
$section = "RESULTS"
End If
' multiline comment removed
If (lv_output==true) && (lv_section == "RESULTS") then
' multiline comment removed
If ereg("\<td", $fcontents[$line]) then
' multiline comment removed
$q = split("<b>", $fcontents[$line])
$q = split("</b>", $q[1])
$results = $q[0]
$output = false
$section = ""
lv_line = sizeof(lv_fcontents)
lv_return(0) = lv_time
lv_return(1) = lv_points
lv_return(2) = lv_results
fn_read_stats = lv_return
' multiline comment removed
breakEnd If
End If
Next
End Function
gv_figures = read_stats("huwnet")
printf("CPU Time =%s<br>\n",gv_figures(0));
printf("Points =%s<br>\n",gv_figures(1));
printf("Results =%s<br>\n",
%>
Errors:
Function names do not have the fn_ prefix added when they are called
(see
notes)
MySQL / SQL commands are not yet translated properly.
I think there are some other errors as well.