%@LANGUAGE=VBScript%>
<%
' Define variables
dim recordsonpage, requestrecords, offset, allrecords, hiddenrecords, showrecords, lastrecord, recordcounter, pagelist, pagelistcounter
' DB connection
dim Conn
Set Conn = createobject("ADODB.Connection")
Conn.open = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=mysql95.secureserver.net;PORT=3306;DATABASE=illweb;USER=illweb;PASSWORD='webill';OPTION=0;"
'DRIVER={MySQL ODBC 3.51 Driver};SERVER=mysql95.secureserver.net;PORT=3306;DATABASE=illweb;USER=illweb;PASSWORD='your password';OPTION=0;
' records per page
recordsonpage = 4
' count all records
allrecords = 0
set rs = conn.Execute("SELECT * FROM illnewsdb")
do until rs.EOF
allrecords = allrecords + 1
rs.movenext
loop
' if offset is zero then the first page will be loaded
offset = request.querystring("offset")
if offset = 0 OR offset = "" then
requestrecords = 0
else
requestrecords = requestrecords + offset
end if
' opens database
set rs = conn.Execute("SELECT * FROM illnewsdb ORDER BY Add_Time Desc")
' GET LATEST ALBUM INFORMATION
set rs2 =conn.Execute("SELECT *,DATE_FORMAT( release_date, '%M %e, %Y' ) as formatted_date FROM illalbumdb order by release_date desc Limit 1")
dim albumname,albumrd,label,albumfolder,price,artist,dl_ind,zip_name,sell_ind
album_id = rs2("album_id")
albumname = rs2("album_name")
albumrd = rs2("formatted_date")
label = rs2("album_label")
albumfolder = rs2("album_folder")
price = rs2("album_price")
artist = rs2("album_artist")
dl_ind = rs2("dl_ind")
sell_ind = rs2("sell_ind")
zip_name = rs2("zip_name")
albumpath = "/" & trim(albumfolder) & "/"
' END GET LATEST ALBUM INFORMATION
' reads first records (offset) without showing them (can't find another solution!)
hiddenrecords = requestrecords
do until hiddenrecords = 0 OR rs.EOF
hiddenrecords = hiddenrecords - 1
rs.movenext
if rs.EOF then
lastrecord = 1
end if
loop
%>
iLL Home
|
" style="border-color:#EDEDED" src="<% = albumpath & "cova.jpg" %> "/>
|
|
<%= "Artist: " & artist %>
<%= "Album: " & albumname %>
<% Response.Write("Price: ")
if dl_ind = 1 then
response.Write("Free Download !")
elseif sell_ind = 1 then
response.Write("$" & FormatNumber(price,2))
end if
%>
<%= "Release Date: " & FormatDateTime(albumrd,2)
%>
<%= "Label: " & label
%>
|
|
|
<%
' prints records in the table
showrecords = recordsonpage
recordcounter = requestrecords
do until showrecords = 0 OR rs.EOF
recordcounter = recordcounter + 1
%>
|
<% = FormatDateTime(rs("Add_Time"),2) %>
- <% = rs("News_Subj") %>
~<% = rs("Add_User") %>
|
<%
showrecords = showrecords - 1
rs.movenext
if rs.EOF then
lastrecord = 1
end if
loop
%>
|
|
|Join The iLL-iT Mailing List|
|
<%
' Closes connection
rs.close
Conn.close
%>
|