Post by Core on Apr 29, 2009 11:10:11 GMT -5
I have so many PDF files I needed a better way to access them. Also I needed to access them remotely.
Figured I would share it if anyone needed to build one.
As expected:
IE Has some display issues. Designing for IE takes the fun out of this...sorry.
FireFox, Seamonkey, Chrome: Looked pretty good.
Opera: forgot to check.
Ran into an issue with the 'Back' button. It would cause the ''option' to display twice.
But I think I found a solution:
Here is the Link on my server:
hvacore.net/seaside/go/runbasicpersonal?app=PDFserver1
The code is below:
Respectfully,
Core
Figured I would share it if anyone needed to build one.
As expected:
IE Has some display issues. Designing for IE takes the fun out of this...sorry.
FireFox, Seamonkey, Chrome: Looked pretty good.
Opera: forgot to check.
Ran into an issue with the 'Back' button. It would cause the ''option' to display twice.
But I think I found a solution:
Here is the Link on my server:
hvacore.net/seaside/go/runbasicpersonal?app=PDFserver1
The code is below:
Respectfully,
Core
' ||||||||||||||||||||||||||||||||||||
' ||| PDF server application |||
' ||||||||||||||||||||||||||||||||||||
[Start]
user = 0
user$ = UserAddress$ ' User IP is logged and a file is created and named with the IP address
user = 1
x = 0
open DefaultDir$ + "\public\User\";user$;".txt" for output as #f
print #f, user
close #f
cssclass "body", "{
background-image: url('/comp.jpg');
font: 14px sans-serif;
color: black;
}"
cssclass "input.RST", "{
width: 130px;
height: 25px;
Font-Weight: normal;
margin-top: -10px;
margin-right: 4px;
float: right;
}"
cssclass "input.RST:hover", "{
Font-Weight: bold;
}"
cssclass "#Header", "{
width: 799px;
height: 100px;
margin: 0px auto;
background-color: transparent;
background-image: url('http://i445.photobucket.com/albums/qq179/ct315185/PDFserver1.png');
border-top: 1px inset #6495ED;
background-repeat: no-repeat;
}"
cssclass "li","{
float: left;
list-style-type: none;
padding: 5px;
}"
cssid #Container, "{
position: absolute;
top: 0;
left: 260px;
width: 799px;
height: auto;
margin: auto;
border-left: 3px inset #6495ED;
border-right: 3px outset #6495ED;
border-bottom: 3px outset #6495ED;
}"
cssclass "#Header a", "{
user-focus: none; ' ** This code removes dashed lines from links
outline : none;
-moz-user-focus: none;
-moz-outline: none;
behavior: url(/includes/userfocus.htc) '** End of dash line removal line
}"
cssclass ".hideSelect1,.hideSelect2,.hideSelect3", "{
visibility: visible;
}"
cssclass "fieldset", "{
width: 730px;
margin: 20px auto;
height: auto;
opacity: 1;
}"
cssclass "legend", "{
color: black;
font-family: sans-serif;
}"
' ///////// End CSS //////////
global sel$, selected$
' |||||||||||||||||||||||||||||||||||||||||||||||||
' Finds Directories and displays them in a LIST box
' |||||||||||||||||||||||||||||||||||||||||||||||||
html "</div>
<div id = 'Container'>
<div id = 'Header'></div>"
button #Reset, " Reset Form ", [Reset]
#Reset cssclass("RST")
html "<fieldset>
<legend>File criteria</legend>"
print "Choose a category below."
files #fs, "public\PDF\*"
dim a$(#fs rowcount())
entry = 1
for count = 1 to #fs rowcount()
#fs nextfile$()
if #fs isdir() then a$(entry)= #fs name$()
entry = entry + 1
next
selected$=""
html "
<ul class = 'selection'>
<li>":print "Type: ";: listbox #lb,a$(),0 : html "</li>
<li class = 'hideSelect1'>":button #sel, " Select ", [SubSelect] : html "</li>
</ul>
</fieldset>"
wait
' ||||||||||||||||||||||||||||||||||||||||
' Check for Sub Directory and display them
' ||||||||||||||||||||||||||||||||||||||||
[SubSelect]
' |||||||||||||||||||||||||||||||||||||||||
' Trap the "back" button, It creates Havoc
' |||||||||||||||||||||||||||||||||||||||||
open DefaultDir$ + "\public\User\";user$;".txt" for input as #f
while not(eof(#f))
line input #f, user
wend
close #f
user = user + 1
if user <> 2 then [Reset2]
open DefaultDir$ + "\public\User\";user$;".txt" for output as #f
print #f, user
close #f
' |||||||||||||||||||||||||||||
' Above code opens user IP named file, adds 1 to 'user' variable
' then writes variable back into file.
' |||||||||||||||||||||||||||||
cssclass ".hideSelect1", "{
visibility: hidden;
}"
html "
<fieldset>
<legend>File SubDirectory</legend>"
selected$ = #lb selection$()
print "Choose a sub directory under '";selected$;"'."
files #Ds, "public\PDF\"; selected$ ;"\*"
dim x$(#Ds rowcount())
entry = 1
for count = 1 to #Ds rowcount()
#Ds nextfile$()
if #Ds isdir() then x$(entry)= #Ds name$()
entry = entry + 1
next
SubSelected$=""
html "
<ul>
<li>":print "Type: ";: listbox #lb2,x$(),0 : html "</li>
<li class = 'hideSelect2'>":button #sel, " Select ", [selectF] : html "</li>
</ul>
</fieldset>"
user = 0
wait
[selectF]
' || Trap "back" button again.
open DefaultDir$ + "\public\User\";user$;".txt" for input as #f
while not(eof(#f))
line input #f, user
wend
close #f
user = user + 1
if user <> 3 then [Reset2]
open DefaultDir$ + "\public\User\";user$;".txt" for output as #f
print #f, user
close #f
' ||||| If "back" button was clicked then reset form
cssclass ".hideSelect2", "{
visibility: hidden;
}"
html "
<fieldset>
<legend>Select file</legend>"
Subselected$ = #lb2 selection$() 'Sets the value of the listbox (selection$() method) to selected$
selected$ = #lb selection$()
print "Directory '";selected$;"' sub-directory '";Subselected$;"' contains below files."
files #Sdir, "public\PDF\"; selected$ ;"\";Subselected$ ;"\*.pdf"
dim y$(#Sdir rowcount())
isEmpty = #Sdir hasanswer()
if isEmpty then
maxCount = #Sdir rowcount()
for entry = 1 to maxCount
#Sdir nextfile$()
imgName$ = #Sdir name$()
y$(entry) = imgName$
entry = entry + 1
next
sel$ = ""
html "
<ul>
<li>":print "File: ";: listbox #lb3,y$(),0 : html "</li>
<li class = 'hideSelect3'>":button #sel, " Select ", [selectFile]: html "</li>
</ul>"
end if
html "</fieldset>"
wait
[selectFile]
open DefaultDir$ + "\public\User\";user$;".txt" for input as #f
while not(eof(#f))
line input #f, user
wend
close #f
user = user + 1
if user <> 4 then [Reset2]
open DefaultDir$ + "\public\User\";user$;".txt" for output as #f
print #f, user
close #f
cssclass ".hideSelect3", "{
visibility: hidden;
}"
sel$ = #lb3 selection$()
html " <fieldset>
<legend>PDF file link</legend>"
print "To upload your selected file from the server select link below:"
html "<span><h4>File link: <a href=""/PDF/"; selected$;"/";Subselected$;"/";sel$;""" target='_blank'>" ;sel$;"</a></h4></span>"
print ""
print ""
print "To start a new search 'click'":button #Reset, " Reset ", [Reset]
html "</fieldset>
</div>"
wait
[Reset]
user = 0
cls
goto [Start]
[Reset2]
cssid #warning, "{
position: absolute;
top: 140px;
left: 140px;
}"
cssclass ".hideSelect1,.hideSelect2,.hideSelect3", "{
visibility: hidden;
}"
cssclass "input.trap", "{
position: absolute;
top: 85px;
left: 123px;
width: 90px;
height: 25px;
z-index: 1;
}"
cssclass "input.trap:hover", "{
cursor: pointer;
}"
cssclass "fieldset", "{
opacity: .3;
}"
html "<div id = 'warning'>"
loadgraphic #dialog, "public\webImage\dialog.png"
render #dialog
button #ok, " Ok ", [Reset]
#ok cssclass("trap")
html "</div>"
wait