<%@ Language=VBScript %> <% Response.Buffer = True set session("connection") = Server.CreateObject("ADODB.Connection") session("connection").Open "Driver={mySQL}; Server=localhost; Port=3306; Option=0; Socket=; Stmt=; Database=themclub_org; Uid=umdmclub; Pwd=BCpSBqcx;" ''get date of two months ago from today (to show news articles no more than 2 months old) Function CToDate(OrgDate) Date1=CDate(OrgDate) Date2=Year(Date1) & "-" & month(Date1)-2 & "-" & Day(Date1) CToDate=Date2 End Function 'Function CToDate(OrgDate) 'Date1=CDate(OrgDate) 'Date2=month(Date1)-1 & "/" & Day(Date1) & "/" & Year(Date1) 'CToDate=Date2 'End Function 'SQL = "Select * from news where news_date > #"& CToDate(date) & "#" SQL = "Select DISTINCT sport from news order by sport asc" Set RsSport = Server.CreateObject("ADODB.Recordset") ''response.write SQL RsSport.open SQL, session("connection") Function CropSentence(strText, intLength, strCrop) Dim intPosition 'As Integer Dim intMaxLength 'As Integer Dim strOutput 'As String 'Set the max length to be the desired length minus 'the length of the trailing characters. intMaxLength = intLength 'Check if the max length is less than or equal to zero. If intMaxLength <= 0 Then 'Return an empty string. CropSentence = "" 'Check if the inputted text it is less that the desired length. ElseIf Len(strText) <= intLength Then 'Return the inputted text CropSentence = strText 'Crop the sentance Else 'Remove the end of the text. strOutput = Left(strText, intLength) 'Get the position of the last space in the text. intPosition = InStrRev(strOutput, " ") 'Return the cropped sentance CropSentence = Left(strOutput, intPosition - 1) & strCrop End If End Function %> MCLUB
     
 

Team News

   

Search by Sport

     
     
     
     

 

 

 

 


<%If RsSport.EOF then%> <%else%> <%Do while not RsSport.EOF SQL="Select MAX(news_id) as last_article from news where sport = '"&RsSport("sport")&"'" Set RsLast = Server.CreateObject("ADODB.Recordset") ''response.write SQL RsLast.open SQL, session("connection") SQL="Select * from news where news_id = '"&RsLast("last_article")&"' "'and date_entered > '"& CToDate(date) & "'" Set RsNews = Server.CreateObject("ADODB.Recordset") ''response.write SQL RsNews.open SQL, session("connection") ''response.write rsnews("sport") SQL="Select sport from sports where sport_id = '"&RsNews("sport")&"'" Set RsHeader = Server.CreateObject("ADODB.Recordset") ''response.write SQL RsHeader.open SQL, session("connection") %> <%If RsNews.EOF then%> <% else %> <%do while not RsNews.EOF%> <% news_text = RsNews("content") news_id = RsNews("news_id") SQL="Select * from news_administrators where administrator_id = '"&RsNews("administrator_id")&"'" Set RsAdmin = Server.CreateObject("ADODB.Recordset") 'response.write SQL RsAdmin.open SQL, session("connection") %> <%'RsFamily.close RsNews.Movenext loop end if%> <%RsSport.Movenext loop end if%>
<%If session("administrator_id") = "" then%> News Admin Login <%else%> Add News <%If session("access_type") = "1" then%>| Admin Info<%end if%> | Logout <%end if%>
<%=RsHeader("sport")%>
There is no news listed at this time.
     
<%=RsNews("date_entered")%> "><%=RsNews("headline")%>
  <%=CropSentence(""&news_text&"",150,"...")%>
  Submitted by: <%=RsAdmin("first_name")%> <%=RsAdmin("last_name")%>  ">Read Article
     

 


Copyright © 2003, M Club and the University of Maryland.
The team names, logos, and uniform designs are registered trademarks of the teams indicated. No logos, photographs or graphics on this site may be reproduced without written permission.