|
NEWS
<% ' Load the PSnews global settings ' %>
<% ' Load and declare our variables ' %>
<%
' Declare all the variables we will need to use '
Dim strAccessDatabasePathAndName, strAccessDatabasePassword
Dim strDatabaseType, Conn, SQL, RSuser, RSnews, RScount
Dim strTotalMembers, strDisplayNick, strDeletedName
Dim strAllNewsFormChecksPassed, strChangePasswordsCheckPassed
Dim strAllNewMemberChecksPassed, strNewsIsActive, strInput, strShowHowManyNewsPosts, strPSnewsVersion, strNewsBody
Dim strMemberCanPostNews, strMemberCanEditOwnNews, strMemberCanEditOthersNews, strMemberCanDeleteOwnNews
Dim strMemberCanDeleteOthersNews, strMemberCanEditOtherMembers, strMemberCanDeleteOtherMembers
Dim strMemberEmailAddress, strMemberNickName
Dim i, postData(4), strNewsID
Dim strEmailWebMasterOnNewsSubmission, strEmailWebMasterOnNewsDeletion
Dim strEmailWebMasterOnUserAdded, strEmailWebMasterOnUserDeleted
Dim strEmailWebMasterOnLogin
Dim strWebMasterEmailAddress, strWebMasterName
Dim JMail, strJMailServerAddress
Dim objMail
Dim Mail, strAspEmailServerAddress
Dim strEmailFrom, strEmailTo, strEmailSubject, strEmailBody, strEmailType, strEmailFeatures
Dim ShowNewsHeadline, ShowNewsBody, ShowMemberEmailAddress, ShowNewsDateStamp
Dim ShowNewsTimeStamp, ShowMemberNickName, ShowNewsID
Dim strSiteTracker, strSmilies, strLinksOpenNewWindow
Dim strSQLServerName, strSQLUserName, strSQLPassword, strSQLDatabaseName
Dim strHeadline, strBody, strTimeStamp, strDateStamp, strMemberIP
Dim strMemberID, strMemberFirstName, strMemberSurname
Dim strMemberLastSeenIP, strMemberLastSeenDate, strMemberLastSeenTime
%>
<%
' This file is where you can alter your settings to suit your own website and server '
' This version of PSnews. Please dont change this, it's not big, it's not clever and you will get no support :) '
strPSnewsVersion = "v1.3"
' You may alter the settings below this line to suit your own website '
' How many news posts to display from the database '
strShowHowManyNewsPosts = 10
' Set what poster name will be displayed on your news page if a user is deleted but news posts are kept '
strDeletedName = "<< DELETED >>"
' Microsoft Access 2000 Database Settings '
strAccessDatabasePathAndName = "PSnews_th3_d4t4b453.mdb"
strAccessDatabasePassword = "psnews"
' Microsoft SQL Server 2000 Database Settings '
strSQLServerName = "FILESERVER1"
strSQLUserName = "sa"
strSQLPassword = "password"
strSQLDatabaseName = "psnews"
' Choose which database type you are using. 1=Microsoft Access 2000, 2=Microsoft SQL Server '
strDatabaseType = "1"
' Set the Response Buffer, values can be True or False '
' The Buffer property specifies whether to buffer the output to the browser or not '
' When Response.Buffer = True, the server will hold back the response to the browser '
' until all of the server scripts have been processed '
' When Response.Buffer = False, the page will be sent to the browser as soon as possible '
' while the scripts may still be running '
Response.Buffer = True
' Do you want to use SiteTracker to log the details of your visitors ? (Yes or No) '
strSiteTracker = "No"
' Do you want links in your articles to open into a new window ? (Yes or No) '
strLinksOpenNewWindow = "Yes"
' Do you want to use Smilie Images in your posts ? (Yes or No) '
' You can change these images to whatever images you want, just keep the filename the same: '
' PSnews_Img_Smilie_Sad.gif, PSnews_Img_Smilie_Happy.gif, PSnews_Img_Smilie_Wink.gif, PSnews_Img_Smilie_Grin.gif '
strSmilies = "Yes"
' PLEASE NOTE: To use the features below, you MUST have a compatible mail component installed on the server '
' Do you want to use email features ? (Yes or No) '
strEmailFeatures = "No"
' What email type do you want to use ?, 1=JMail, 2=CDONTS 3=AspEmail '
' (CDONTS is built into IIS, download Jmail from www.dimac.net, download AspEmail from www.aspemail.com) '
strEmailType = "2"
' JMail Server Setting (localhost or maybe your isp mail server ? (eg: smtp.yourserverisp.com) '
strJMailServerAddress = "mail.whatever.com"
' AspEmail Server Setting (localhost or maybe your isp mail server ? (eg: smtp.yourserverisp.com) '
strAspEmailServerAddress = "mail.whatever.com"
' What is the WebMasters email address ? '
strWebMasterEmailAddress = "your@emailaddress.com"
' What is the WebMasters name ? '
strWebMasterName = "YourNameHere!"
' Email the WebMaster every time someone logs in ? (Yes or No) '
strEmailWebMasterOnLogin = "No"
' Email the WebMaster every time a news article is posted ? (Yes or No) '
strEmailWebMasterOnNewsSubmission = "No"
' Email the WebMaster every time a news article is deleted ? (Yes or No) '
strEmailWebMasterOnNewsDeletion = "No"
' Email the WebMaster every time a user is added ? (Yes or No) '
strEmailWebMasterOnUserAdded = "No"
' Email the WebMaster every time a user is deleted ? (Yes or No) '
strEmailWebMasterOnUserDeleted = "No"
%>
<%
' Display PSnews version in the users html source '
' Please do not remove or alter these few lines, it is the only credit I get ! '
Response.Write ""
%>
<% ' Check to see if SiteTracker is on and if so, log the visitors details '
If strSiteTracker = "Yes" Then
' Get the database path and open the connection to it '
%>
<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_DSNPSNews_STRING
MM_DSNPSNews_STRING = "dsn=DSNPSNews;pwd="& strAccessDatabasePassword &";"
%>
<%
' Add the visitors details to the database '
SQL = "INSERT INTO tblSiteTracker (fldSiteTrackerIP, fldSiteTrackerDate, fldSiteTrackerTime, fldSiteTrackerReferer, fldSiteTrackerUserAgent) VALUES('" & Request.ServerVariables("REMOTE_ADDR") & "','" & FormatDateTime(Now, 1) & "','" & FormatDateTime(Now, 4) & "','" & Request.ServerVariables("HTTP_REFERER") & "','" & Request.ServerVariables("HTTP_USER_AGENT") & "')"
Conn.Execute (SQL)
Conn.Close
End If
%>
<% ' Get the database path and open the connection to it ' %>
<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_DSNPSNews_STRING
MM_DSNPSNews_STRING = "dsn=DSNPSNews;pwd="& strAccessDatabasePassword &";"
%>
<%
' Check to see if a particular news article has been requested '
If Request.QueryString("NewsID") <> "" And IsNumeric(Request.QueryString("NewsID")) = "True" Then
' No specific NewsID was requested so set the SQL Query to be sent to the database '
SQL = "SELECT * FROM tblNews,tblMembers WHERE tblNews.fldMemberID = tblMembers.fldMemberID AND tblNews.fldNewsID = " & Request.QueryString("NewsID") & " AND fldNewsIsActive = 1 ORDER BY fldNewsID DESC"
Else
' A specific NewsID was requested, so set the SQL Query to be sent to the database '
SQL = "SELECT TOP " & strShowHowManyNewsPosts & " * FROM tblNews,tblMembers WHERE (tblNews.fldMemberID = tblMembers.fldMemberID AND fldNewsIsActive = 1) OR (tblNews.fldMemberID = tblMembers.fldMemberID AND tblMembers.fldMemberNickName = '" & strDeletedName & "') AND fldNewsIsActive = 1 ORDER BY fldNewsID DESC"
End If
' Send the SQL Query to the database and store the results of the sql query in the variable RSnews '
Set RSnews = Conn.Execute (SQL)
' Start the loop which will display the news articles '
While Not RSnews.EOF
' Set the Show* variables to be displayed in your webpage '
ShowNewsID = RSnews("fldNewsID")
ShowNewsHeadline = RSnews("fldNewsHeadline")
ShowNewsBody = RSnews("fldNewsBody")
ShowNewsTimeStamp = RSnews("fldNewsTimeStamp")
ShowNewsDateStamp = RSnews("fldNewsDateStamp")
ShowMemberNickName = RSnews("fldMemberNickName")
ShowMemberEmailAddress = RSnews("fldMemberEmailAddress")
%>
::: <%=ShowNewsHeadline")%>
<%=ShowNewsDateStamp%>
<%=ShowNewsBody%>
<%
' Keep looping the news until strShowHowManyNewsPosts (which you set in PSnews_config.asp) is reached '
RSnews.MoveNext
' End the loop '
Wend
' Close the connection to the database '
Conn.Close
' Display PSnews version in the users html source '
' Please do not remove or alter these few lines, it is the only credit I get ! '
Response.Write ""
%>
|