<%@LANGUAGE="VBSCRIPT" %> <%Response.Buffer=True%> Cursuri online pentru incepatori si profesionisti - CursuriOnline.ro :: Stiri
sigla cursuri online
Nume utilizator
Parolă
Stiri <% Dim adoCon 'Database Connection Variable Dim rsConfiguration 'Holds the configuartion recordset Dim strCon 'Holds the Database driver and the path and name of the database Dim strSQL 'Holds the SQL query for the database Dim intRecordsPerPage 'Holds the number of files shown on each page Dim strBgColour 'Holds the background colour of the News Administrator Dim strTextColour 'Holds the text colour of the News Administrator Dim strTextType 'Holds the font type of the News Administrator Dim intHeadingTextSize 'Holds the heading font size Dim intTextSize 'Holds the font size of the News Administrator Dim intSmallTextSize 'Holds the small font size Dim strLinkColour 'Holds the link colour of the News Administrator Dim strTableColour 'Holds the table colour Dim strTableBorderColour 'Holds the table border colour Dim strTableTitleColour 'Holds the table title colour Dim strVisitedLinkColour 'Holds the visited link colour of the News Administrator Dim strActiveLinkColour 'Holds the active link colour of the News Administrator Dim blnLCode 'set to true Dim blnEmail 'Boolean set to true if e-mail is on Dim strCode 'Holds the page code Dim strCodeField 'Holds the code type Dim strWebSiteEmailAddress 'Holds the e-mail address for the web site the Site News is on Dim strMailComponent 'Email coponent the site news app useses Dim strSMTPServer 'SMTP server for sending the e-mails through Dim strLoggedInUserCode 'Holds the user code of the user Dim strTitleImage 'Holds the path and name for the title image for the site news Dim intMsgCharNo 'Holds the number of characters allowed for the messages Dim blnCookieSet 'Set to true if cookies are to be set to stop multiple posts Dim blnIPBlocking 'Set to true if IP blooking is to be used to stop multiple posts Set adoCon = Server.CreateObject("ADODB.Connection") 'Database connection info and driver strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db/news.mdb") 'Set an active connection to the Connection object adoCon.Open strCon 'Set up the page encoding strCodeField = "Code" strCode = "nolinks2002" 'Intialise the ADO recordset object Set rsConfiguration = Server.CreateObject("ADODB.Recordset") 'Initialise the SQL variable with an SQL statement to get the configuration details from the database strSQL = "SELECT tblConfiguration.* From tblConfiguration;" 'Query the database rsConfiguration.Open strSQL, strCon 'If there is config deatils in the recordset then read them in If NOT rsConfiguration.EOF Then 'Read in the configuration details from the recordset intRecordsPerPage = CInt(rsConfiguration("No_records_per_page")) strBgColour = rsConfiguration("bg_colour") strTextColour = rsConfiguration("text_colour") strTextType = rsConfiguration("text_type") intHeadingTextSize = CInt(rsConfiguration("heading_text_size")) intTextSize = CInt(rsConfiguration("text_size")) intSmallTextSize = CInt(rsConfiguration("small_text_size")) strTableColour = rsConfiguration("table_colour") strTableBorderColour = rsConfiguration("table_border_colour") strTableTitleColour = rsConfiguration("table_title_colour") strLinkColour = rsConfiguration("links_colour") strVisitedLinkColour = rsConfiguration("visited_links_colour") strActiveLinkColour = rsConfiguration("active_links_colour") strWebSiteEmailAddress = rsConfiguration("email_address") blnLCode = CBool(rsConfiguration("Code")) blnEmail = CBool(rsConfiguration("email_notify")) strTitleImage = rsConfiguration("Title_image") intMsgCharNo = rsConfiguration("Message_char_no") blnCookieSet = CBool(rsConfiguration("Cookie")) blnIPBlocking = CBool(rsConfiguration("IP_blocking")) strMailComponent = rsConfiguration("mail_component") strSMTPServer = rsConfiguration("mail_server") End If 'Reset server object rsConfiguration.Close Set rsConfiguration = Nothing %> <% Dim rsNews 'Database recordset holding the news items Dim rsComments 'Database recordset holding the comments for this news item Dim lngNewsID 'Holds the News item ID number Dim blnComments 'Set to true if comments are allowed for this item 'Read in the ID number of the news item we are looking at the comments of If isNull(Request.QueryString("NewsID")) = True Or isNumeric(Request.QueryString("NewsID")) = False Then Response.Write "default.asp" Else lngNewsID = CLng(Request.QueryString("NewsID")) End If %>
Toate știrile
<% 'Create recorset object Set rsNews = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database by selecting all tables ordered by the decending date strSQL = "SELECT tblNews.* FROM tblNews WHERE tblNews.News_ID = " & lngNewsID & " ORDER BY News_Date DESC;" 'Query the database rsNews.Open strSQL, adoCon 'If there are no records then exit for loop If NOT rsNews.EOF Then 'Read in if comments are allowed for this news item blnComments = CBool(rsNews("Comments")) %>
<% = rsNews("News_title") %>
- <% = FormatDateTime(rsNews("News_Date"), vbShortDate) %> at <% = FormatDateTime(rsNews("News_Date"), vbShortTime) %>
<% = rsNews("News_item") %>

<% End If 'Clean up rsNews.Close Set rsNews = Nothing 'If comments are allowed then show any comments and a text form If blnComments = True Then %>


Comments
<% 'Create recorset object Set rsComments = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database by selecting all tables ordered by the decending date strSQL = "SELECT tblComments.* FROM tblComments WHERE tblComments.News_ID = " & lngNewsID & " ORDER BY Comments_Date DESC;" 'Query the database rsComments.Open strSQL, adoCon 'Loop round to display all the comments for the news item Do While NOT rsComments.EOF %>
Comments by <% 'If there is an email address entered make it a mailto link If rsComments("EMail") <> "" Then Response.Write("" & rsComments("Name") & "") Else Response.Write(rsComments("Name")) %> from <% = rsComments("Country") %> on <% = FormatDateTime(rsComments("Comments_Date"), VbLongDate) %> at <% = FormatDateTime(rsComments("Comments_Date"), VbShortTime) %> - IP Logged
<% = rsComments("Comments") %>

<% 'Move to the next record in the recordset rsComments.MoveNext Loop 'Reset server objects rsComments.Close Set rsComments = Nothing Set strCon = Nothing Set adoCon = Nothing %>
*Indicates required fields
Name*:
Country*:
E-mail:
  Bold Italic Underline Emoticon Smilies
Comments*:
(max. <% = intMsgCharNo %> characters)
Character Count:
 

<% End If %>