%
pagetitle="At Lakeland, Our Graduates Are the Story"
filename="/story/home.asp"
function resizeimg(id, num, ext, width, height)
resizeimg_srcimg="/story/uploads/"&id&"/file-"&num&"."&ext
'response.write resizeimg_srcimg
resizeimg_destimg="/story/images/"&id&"_"&num&"_"&clng(width)&"_"&clng(height)&".jpg"
resizeimg_srcpath=server.mappath(resizeimg_srcimg)
resizeimg_destpath=server.mappath(resizeimg_destimg)
resizeimg_url="http://lakeland150.org/story/ImageResizer.aspx?image="&resizeimg_srcpath&"&thumb="&resizeimg_destpath&"&width="&clng(width)&"&height="&clng(height)&"&compression=80"
' response.write resizeimg_url
''TODO: check if destination file already exists
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
if NOT fs.FileExists(resizeimg_destpath) then
Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", resizeimg_url, false
objXML.Send
Set objXML=Nothing
response.flush
end if
set fs=nothing
resizeimg=resizeimg_destimg
end function
response.write "
"
set rs=server.createobject("ADODB.Recordset")
rs.open "SELECT id, firstname, gradyear, lastname, revisedstory, altTitle FROM [150-share-story] WHERE approved='1' AND releasepermission='1' ORDER BY lastname ASC, firstname ASC, datetime ASC", strCon
response.write "
"&vbcrlf
rs.close
set rs=nothing
response.write "
"
if request("view")="random" then
strSQL="SELECT id FROM [150-share-story] WHERE approved='1' AND releasepermission='1'"
set rs=server.CreateObject("ADODB.Recordset")
rs.open strSQL,strCon
id="0"
if NOT rs.eof then
dim ids()
x=0
while not rs.eof
redim preserve ids(x)
ids(x)=rs("id")
x=x+1
rs.movenext
wend
randomize timer
glarb=int(RND*x)
id=ids(glarb)
end if
rs.close
set rs=nothing
if id="0" then
response.redirect filename
response.write "There don't appear to be any approved stories, continue."
else
response.redirect filename&"?view="&id
response.write "Continue"
end if
elseif request("view")<>"" then
id=clng(request("view"))
set rs=server.createobject("ADODB.Recordset")
rs.open "SELECT firstname, lastname, gradyear, altTitle, revisedstory, comments, OFname1, OFname2, OFname3, OFname4, OFname5, featuredphoto FROM [150-share-story] WHERE id='"&id&"' AND approved='1' AND releasepermission='1'", strCon
if NOT rs.eof then
firstname=rs("firstname")
lastname=rs("lastname")
gradyear=rs("gradyear")
altTitle=rs("altTitle")&""
revisedstory=rs("revisedstory")
comments=rs("comments")
'Convert line breaks into tags for the HTML editor. Submitted stories are originally in plaintext.
comments=replace(comments,vbcrlf,vbcr)
comments=replace(comments,vblf,vbcr)
comments=replace(comments,vbcr,vbcrlf)
comments="
"&replace(comments,vbcrlf,"
"&vbcrlf&"")&"
"
if NOT isnull(revisedstory) then
if len(revisedstory)>5 then
comments=revisedstory
end if
end if
dim OFnames(5)
for x=1 to 5
OFnames(x)=rs("OFname"&x)
next
featuredphoto=rs("featuredphoto")
' response.write "
"&vbcrlf
response.write ""&vbcrlf
if featuredphoto>0 then
FPFname=OFnames(featuredphoto)&""
featuredphotoext=mid(FPFname,instrrev(FPFname,".")+1)
url=resizeimg(id, featuredphoto, featuredphotoext, 350, -1)
response.write "
![]()
"&vbcrlf
' response.write "
![]()
"&vbcrlf
end if
title=firstname&" "&lastname
if gradyear&""<>"" then
title=title&" '"&right(gradyear,2)
end if
if altTitle<>"" then
title=altTitle
end if
response.write "
"&title&"
"&vbcrlf
response.write "
"&comments&"
"&vbcrlf
response.write "
"&vbcrlf
response.write "Submitted Photos:
(click to enlarge)
"&vbcrlf
set fso = createobject("scripting.filesystemobject")
dafolder=server.mappath("/story/uploads/"&id&"/")
numfiles=0
if fso.folderexists(dafolder) then
set folder=fso.getfolder(dafolder)
serverroot=server.mappath("/")
serverrootlen=len(serverroot)
for each files in folder.files
url=replace(mid(files.path,serverrootlen+1), "\","/")
fsize=files.size
suffix="B"
if fsize>1024 then
fsize=fsize/1024
suffix="KB"
end if
if fsize>1024 then
fsize=fsize/1024
suffix="MB"
end if
if fsize>1024 then
fsize=fsize/1024
suffix="GB"
'' wow, hopefully this never happens!
end if
fsize=round(fsize*10)/10
filenumstart=instr(url,"file-")+5
filenumend=instr(filenumstart,url,".")
filenum=mid(url,filenumstart,filenumend-filenumstart)&""
fileext=mid(url,filenumend+1)&""
if isnumeric(filenum) then
filenum=cint(filenum)
bordercol="ECECEC"
if featuredphoto=filenum then
bordercol="000"
end if
imgurl=resizeimg(id, filenum, fileext, -1, 100)
lgimgurl=resizeimg(id, filenum, fileext, 600, -1)
response.write ""&vbcrlf
' response.write ""&vbcrlf
numfiles=numfiles+1
end if
next
set folder=nothing
if numfiles=0 then response.write "no attached files"&vbcrlf
else
response.write "no attached files"&vbcrlf
end if
socialBookmark_URL=server.URLEncode(filename&"?view="&id)
socialBookmark_title=server.URLEncode(title)
%>
<%
' Share your story
%>
<%
else
response.write "That story couldn't be found, or is not approved for public view."&vbcrlf
end if
rs.close
set rs=nothing
elseif request("decade")<>"" then
decade=cint(left(request("decade"),3)+"0")
gradyearpart="AND gradyear BETWEEN '"&decade&"' AND '"&(decade+9)&"'"
'special case because we don't want to add an option for the 2010s decade :/
if decade=2000 then
gradyearpart="AND gradyear>=2000"
end if
strSQL="SELECT id, firstname, gradyear, lastname, revisedstory, altTitle FROM [150-share-story] WHERE approved='1' AND releasepermission='1' "&gradyearpart&" ORDER BY lastname ASC, firstname ASC, gradyear ASC, datetime ASC"
'derp, BETWEEN is inclusive, so we need to go 1990-1999, not 1990-2000, otherwise the year 2000 shows up in the results for the '90s
set rs=server.createobject("ADODB.Recordset")
rs.open strSQL, strCon
' response.write "
In 2012 we will be celebrating the Sesquicentennial of Lakeland College. To us, there is no better time than now to put the spotlight on 150 years of the achievements and memories of our graduates. The way we see it, your story is the celebration. Please add your story today! If you would like to read the stories of others, click on the names below.
"&vbcrlf
response.write "
In 2012 we will be celebrating the Sesquicentennial of Lakeland College. To us, there is no better time than now to put the spotlight on 150 years of the achievements and memories of our graduates. The way we see it, your story is the celebration. If you would like to read the stories of others, click on the names below.
"&vbcrlf
response.write "
Shared Stories, "&decade&"s:
"&vbcrlf
response.write "
"&vbcrlf
while not rs.eof
id=rs("id")
firstname=rs("firstname")
lastname=rs("lastname")
gradyear=rs("gradyear")
revisedstory=rs("revisedstory")
altTitle=rs("altTitle")&""
if altTitle="" then
response.write "- "
response.write "
"&textpreview(striphtml(revisedstory),300)&"
Read more "&vbcrlf
else
response.write "- "
response.write "
"&textpreview(striphtml(revisedstory),300)&"
Read more "&vbcrlf
end if
rs.movenext
wend
response.write "
"&vbcrlf
rs.close
set rs=nothing
else
' response.write "
In 2012 we will be celebrating the Sesquicentennial of Lakeland College. To us, there is no better time than now to put the spotlight on 150 years of the achievements and memories of our graduates. The way we see it, your story is the celebration. Please add your story today! If you would like to read the stories of others, click on the pictures below.
"&vbcrlf
response.write "
In 2012 we will be celebrating the Sesquicentennial of Lakeland College. To us, there is no better time than now to put the spotlight on 150 years of the achievements and memories of our graduates. The way we see it, your story is the celebration. If you would like to read the stories of others, click on the pictures below.
"&vbcrlf
response.write "
![]()
" &vbcrlf&_
"
"&vbcrlf
' set rs=server.createobject("ADODB.Recordset")
' rs.open "SELECT DISTINCT substring(gradyear,1,3)+'0' AS decade FROM [150-share-story] WHERE approved='1' AND releasepermission='1' ORDER BY decade DESC", strCon
' response.write "
Select a decade:
(Only decades with submitted and approved stories are listed below)
"&vbcrlf
' response.write "
"&vbcrlf
' col=3: numcols=3
' while not rs.eof
' col=col+1
' if col>numcols then
' response.write ""&vbcrlf
' col=1
' end if
' decade=rs("decade")
' response.write "![]() "&decade&"s | "&vbcrlf
' if col=numcols then
' response.write "
"&vbcrlf
' end if
'
' rs.movenext
' wend
' for col=col to numcols-1
' response.write " | "&vbcrlf
' next
' response.write "
"&vbcrlf
'
' rs.close
' set rs=nothing
end if
%>