04. november 2006 - 20:01
#2
<%Call Security()%>
<%
intSubPage = request("subpage")
If intSubPage = "" Then
intSubPage = "info"
End If
%>
<%
If intSubPage = "settings" Then
If intMode = "gem" Then
tempConn = "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("data/movies.mdb")
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM settings WHERE (ID = 1)"
rs.Open strSQL, tempConn, 1, 3
If NOT (rs.BOF Or rs.EOF) Then
rs("TxtTopLogo") = request("Logo")
rs("TxtBotLine1") = Left(request("Linie1"), 65)
rs("TxtBotLine2") = Left(request("Linie2"), 65)
rs("TxtBotLine3") = Left(request("Linie3"), 65)
rs("TxtBotLine4") = Left(request("Linie4"), 65)
rs("TxtBotLine5") = Left(request("Linie5"), 65)
rs.Update
response.redirect "index.asp?page=message&message=Indstillingerne er gemt&link=index.asp?page=txt"
END IF
rs.Close
End If
ElseIf intSubPage = "generate" Then
If intMode = "generate" Then
strCount = 0
Set rs2 = Server.CreateObject("ADODB.RecordSet")
strSQL = "select * from movies ORDER BY Type, Title ASC"
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("data/movies.mdb")
rs2.Open strSQL, strDSN, 1
tmpTxt = GetData("settings", "TxtTopLogo", 1)&vbCrLf&_
vbCrLf&_
" .::.::.::.::.::.::.::.::.::.::.::.::.::."&vbCrLf&_
" _____ _____ _____ _____ _____ _____ "&vbCrLf&_
" | | | | | | __|__ |"&vbCrLf&_
" | | | | | | | |- -| __| __|"&vbCrLf&_
" |_|_|_|_____|\___/|_____|_____|_____|"&vbCrLf&_
vbCrLf&_
" :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"&vbCrLf
do while not rs2.eof
If request("Check_"&rs2("ID")) = "TRUE" Then
strCount = strCount+1
Set objFS = Server.CreateObject("Scripting.FileSystemObject")
strDir = Request.ServerVariables("SCRIPT_NAME")
strTxtFile = Server.MapPath("txt/movies.txt")
strTitleLength = Len(Left(rs2("Title"), 38))
strTypeLength = Len(Left(rs2("Type"), 31))
tmpTxt = tmpTxt&_
": "&_
Left(rs2("Title"), 38)&_
String(38-strTitleLength, " ")&_
"("&_
Left(rs2("Type"), 31)&_
")"&_
String(31-strTypeLength, " ")&_
":"&vbCrLf
End If
rs2.movenext
Loop
strUpdated = now()
strStatusLength = Len(strCount&" MOVIES - LAST UPDATED: "&strUpdated)
strTmpCalc = 75-strStatusLength
strTmpCalc = strTmpCalc/2
strStatusSpace1 = Round(strTmpCalc, 0)
strStatusSpace2 = 75-(strStatusSpace1+strStatusLength)
strLine1Length = Len(GetData("settings", "TxtBotLine1", 1))
strTmpCalc = 65 - strLine1Length
strTmpCalc = strTmpCalc/2
strLine1Space1 = Round(strTmpCalc, 0)
strLine1Space2 = 65-(strLine1Space1+strLine1Length)
strLine2Length = Len(GetData("settings", "TxtBotLine2", 1))
strTmpCalc = 65 - strLine2Length
strTmpCalc = strTmpCalc/2
strLine2Space1 = Round(strTmpCalc, 0)
strLine2Space2 = 65-(strLine2Space1+strLine2Length)
strLine3Length = Len(GetData("settings", "TxtBotLine3", 1))
strTmpCalc = 65 - strLine3Length
strTmpCalc = strTmpCalc/2
strLine3Space1 = Round(strTmpCalc, 0)
strLine3Space2 = 65-(strLine3Space1+strLine3Length)
strLine4Length = Len(GetData("settings", "TxtBotLine4", 1))
strTmpCalc = 65 - strLine4Length
strTmpCalc = strTmpCalc/2
strLine4Space1 = Round(strTmpCalc, 0)
strLine4Space2 = 65-(strLine4Space1+strLine4Length)
strLine5Length = Len(GetData("settings", "TxtBotLine5", 1))
strTmpCalc = 65 - strLine5Length
strTmpCalc = strTmpCalc/2
strLine5Space1 = Round(strTmpCalc, 0)
strLine5Space2 = 65-(strLine5Space1+strLine5Length)
tmpTxt = tmpTxt&_
" :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"&vbCrLf&_
":"&_
String(strStatusSpace1, " ")&_
strCount&_
" MOVIES - LAST UPDATED: "&_
strUpdated&_
String(strStatusSpace2, " ")&_
":"&vbCrLf&_
" :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"&vbCrLf&_
" : :"&vbCrLf&_
" : ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :"&vbCrLf&_
" : :"&_
String(strLine1Space1, " ")&_
GetData("settings", "TxtBotLine1", 1)&_
String(strLine1Space2, " ")&_
": :"&vbCrLf&_
" : :"&_
String(strLine2Space1, " ")&_
GetData("settings", "TxtBotLine2", 1)&_
String(strLine2Space2, " ")&_
": :"&vbCrLf&_
" ::"&_
String(strLine3Space1, " ")&_
GetData("settings", "TxtBotLine3", 1)&_
String(strLine3Space2, " ")&_
"::"&vbCrLf&_
" :"&_
String(strLine4Space1, " ")&_
GetData("settings", "TxtBotLine4", 1)&_
String(strLine4Space2, " ")&_
":"&vbCrLf&_
" :"&_
String(strLine5Space1, " ")&_
GetData("settings", "TxtBotLine5", 1)&_
String(strLine5Space2, " ")&_
":"&vbCrLf&_
" :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"&vbCrLf&_
vbCrLf&_
"¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤"&vbCrLf
Set objFile = objFS.CreateTextFile(strTxtFile, True)
objFile.Write(tmpTxt)
Set objFS = Nothing
response.redirect "txt/movies.txt"
rs2.Close
Set rs2 = Nothing
End If
End If
%>
<%If intSubPage = "info" Then%>
<p align="center" style="margin-top: 0; margin-bottom: 0"> </p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: 1px solid #000000" bordercolor="#111111" width="350" id="AutoNumber1">
<tr>
<td bgcolor="#FF6600" style="border-bottom: 1px solid #000000">
<font size="1"><b> - Txt-List Generator</b></font></td>
</tr>
<tr>
<td>
<p style="margin: 0 5"><font size="1">Denne funktion genererer en
tekstbaseret liste over udvalgte film.</font></p>
<p style="margin: 0 5"><font size="1">Du bør rette indstillingerne før du
bruger denne funktion første gang.</font></p>
<p style="margin: 0 5"> </p>
<p style="margin: 0 5" align="center"><font size="2"><b>
<a href="index.asp?page=txt&subpage=settings">INDSTILLINGER</a></b></font></p>
<p style="margin: 0 5" align="center"><font size="2"><b>-</b></font></p>
<p style="margin: 0 5" align="center"><font size="2"><b>
<a href="index.asp?page=txt&subpage=generate">GENERÉR .TXT-FIL</a></b></font></p>
<p style="margin: 0 5"> </td>
</tr>
</table>
</center>
</div>
<%ElseIf intSubPage = "settings" Then%>
<p align="center" style="margin-top: 0; margin-bottom: 0"> </p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: 1px solid #000000" bordercolor="#111111" width="600" id="AutoNumber2">
<form method="POST" action="index.asp?page=txt&subpage=settings&mode=gem">
<tr>
<td style="border-bottom: 1px solid #000000" bgcolor="#FF6600">
<font size="1"><b> - Txt-List Generator: Indstillinger</b></font></td>
</tr>
<tr>
<td>
<p style="margin: 0 5"><font size="1"> </font></p>
<p style="margin: 0 5"><font size="2"><b>Brugerdefineret Top-Logo
(ASCII-ART) (MAX. 77 TEGN PR. LINIE):</b></font></p>
<p style="margin: 0 5"><font size="1"><b> </b></font></p>
<p style="margin: 0 5" align="center">
<textarea rows="6" name="Logo" cols="77" style="font-family: Lucida Console; font-size: 8pt; border: 1px solid #000000"><%=GetData("settings", "TxtTopLogo", 1)%></textarea></p>
<p style="margin: 0 5" align="center">
<font size="1"> </font></p>
<p style="margin: 0 5" align="left">
<font size="2"><b>Brugerdefineret Bund-Tekst (MAX. 65 TEGN PR. LINIE):</b></font></p>
<p style="margin: 0 5" align="left">
<font size="1"><b> </b></font></p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber3">
<tr>
<td width="11%"><font size="1"><b>Linie 1:</b></font></td>
<td width="89%">
<input type="text" name="Linie1" size="65" style="font-family: Lucida Console; font-size: 10pt; border: 1px solid #000000" value="<%=GetData("settings", "TxtBotLine1", 1)%>"></td>
</tr>
<tr>
<td width="11%"><font size="1"><b>Linie 2:</b></font></td>
<td width="89%">
<input type="text" name="Linie2" size="65" style="font-family: Lucida Console; font-size: 10pt; border: 1px solid #000000" value="<%=GetData("settings", "TxtBotLine2", 1)%>"></td>
</tr>
<tr>
<td width="11%"><font size="1"><b>Linie 3:</b></font></td>
<td width="89%">
<input type="text" name="Linie3" size="65" style="font-family: Lucida Console; font-size: 10pt; border: 1px solid #000000" value="<%=GetData("settings", "TxtBotLine3", 1)%>"></td>
</tr>
<tr>
<td width="11%"><font size="1"><b>Linie 4:</b></font></td>
<td width="89%">
<input type="text" name="Linie4" size="65" style="font-family: Lucida Console; font-size: 10pt; border: 1px solid #000000" value="<%=GetData("settings", "TxtBotLine4", 1)%>"></td>
</tr>
<tr>
<td width="11%"><font size="1"><b>Linie 5:</b></font></td>
<td width="89%">
<input type="text" name="Linie5" size="65" style="font-family: Lucida Console; font-size: 10pt; border: 1px solid #000000" value="<%=GetData("settings", "TxtBotLine5", 1)%>"></td>
</tr>
</table>
</center>
</div>
<p style="margin: 0 5" align="center"><font size="1"><b> </b></font></p>
<p style="margin: 0 5" align="center">
<input type="submit" value="Gem" name="Gem" style="font-family: Verdana; font-size: 10pt; font-weight: bold"></p>
<p style="margin: 0 5" align="center"><font size="1"><b> </b></font></td>
</tr>
</form>
</table>
</center>
</div>
<%ElseIf intSubPage = "generate" Then%>
<p align="center" style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin: 0 5"><font size="2"><b>Angiv hvilke film der skal indgå i .txt-filen:</b></font></p>
<p style="margin: 0 5"><font size="1"><b>OBS: ALT EFTER HVOR MANGE FILER DU VÆLGER AT OPRETTE, KAN DET TAGE LIDT TID!!!</b></font></p>
<!--#include file="txtbrowse.asp" -->
<%End If%>
<p align="center" style="margin-top: 0; margin-bottom: 0"> </p>