Thank you for choosing Asp.Net Forum from Jitbit Software. This README will guide through the basics of installation and operation of Asp.Net Forum. Please read it carefully. Thank you.
IMPORTANT: before installing and using Jitbit AspNetForum read the License Agreement located in "!!!license.txt" file.
Contents:
The ASP.NET forum software is distributed in a ZIP-archive, which contains:
1.2. Installing the Forum as a standalone ASP.NET application:
1.3. Installing this Forum as a sub-part of an existing ASP.NET application (a website or a folder) without configuring as a standalone web-application:
<httpModules> <add type="aspnetforum.ForumSEOHttpModule, aspnetforum" name="ForumSEOHttpModule" /> </httpModules>
2.1. Database Setup
This ASP.NET forum contains the "/App_Data" folder, which contains:This forum's web.config file has several sample connection strings in it (see the "connectionStrings" section of the file). One for MS Access, one for for MS SQL, one for MySQL etc. By default, the MS-Access connection string is uncommented, others are commented out.
When you edit the connection strings in the "web.config" file please note that apart from editing the connection string itself (in the connectionString attribute), you have to specify a value of the providerName attribute. This will tell ASP.NET (and AspNetForum) what database driver to use.
For example:
As you can see, this allows Jitbit AspNetForum using not only MS Access or MS SQL database, but, theoretically, any database engine, which has a .NET provider.
Note for MySQL users: To use the Forum with MySQL you have to download and install the free "MySQL Connector .NET" on your server. The download is available here - http://dev.mysql.com/downloads/connector/net/. Please ask your hosting provider if they have this driver installed. If they do not - simply place the "MySql.Data.dll" from the downloaded package into the "/bin" folder. Contact your hosting provider for more info. More information on "MySQL Connector .NET" is available at http://www.mysql.com/products/connector/net/
Both MS Access and MSSQL/MySQL default databases come with a pre-created user "admin". The user's password is "admin". Log in under these credentials to start using the forum. But remember to change the default password afterwards!
VERY IMPORTANT, read carefully
Sometimes a new version uses an updated database format. These database changes are usually light and simple, so there should be no problem to upgrade your existing copy.
3.1. MS SQL and MySQL users:
The installation package can contain one or more files named "upgrade_from_XXX.sql" in the App_Data folder, where "XXX" is a forum version. Depending on your existing version, execute the appropriate file. The file contains text comments, describing the changes made. Read these comments carefully.
The upgrade scripts are not cumulative. This means that, for example, if you are upgrading from the oldest version, you have to apply all the scripts one by one.
3.2. MS Access users:
The installation package contains the "forum.mdb" database file. This file is the new updated database format. Open two copies of MS Access: one with your existing "forum.mdb", and one with the new downloaded "forum.mdb".
You can always look at the "upgrade_from_XXX.sql" files, which contain text comments, describing the changes, made to the database format (see the above paragraph for SQL users), to know WHAT columns and tables have been added or removed.
4.1. ADMIN PASSWORD
!!!IMPORTANT NOTE!!! Please note, that default database comes with a pre-created user "admin". The default password is "admin". CHANGE THAT!!!
4.2. FORUM TITLE BAR.
By default AspNetForum comes with an "Acme Web Site" title. This title is used in forum notification emails, and in forum pages title. You can change this to whatever you like by editing the "web.config" file. Find and edit this lines:
<add key="ForumTitle" value="Acme Web Site" /> <add key="TitleLink" value="http://www.jitbit.com/" />
AspNetForum can be configured to send email notifications to subscribers when topic and forums are updated. Emails are sent asynchronously, without affecting the forum performance. To enable email notifications you should edit the web.config and specify your smtp-server's address, specify the smtp-server login/password (if your server does not require authentication simply leave the username field blank) etc.
INPORTANT NOTE: the Forum also has the "Email Verification" feature which also requires you to specify smtp-credentials in web.config.
AspNetForum is a multi-language forum application. It is "globalized" using resource strings, which is a standard ASP.NET technique.
The application comes with a number of predefined languages. You can switch between these languages editing the web.config.
<globalization uiCulture="en-US"/>
will set the language to English.<globalization uiCulture="nl-NL"/>
will set the language to Dutch.If you are a little familiar with ASP.NET you can easily add more languages by adding the required .resx-files to the "App_LocalResources" folder, using the existing files as templates. Please contact us to get a discount for you translation.
To modify the html-code of any forum page edit the appropriate ".aspx" file. Be careful when editing .NET-controls code (tags like "<asp:textbox>"). Backup the files before editing.
You can also edit the "aspnetforum.css" file and modify images.
4.6. INTEGRATING INTO YOUR WEBSITE'S DESIGN
The Forum utilizes ASP.NET 2.0 "MasterPages" functionality. All AspNetForum pages use one masterpage called "AspNetForumMaster.Master". All you have to do to visully integrate the Forum software into your website - is edit this one file only ("AspNetForumMaster.Master"), and configure it to use your parent website's masterpage. This trick is called "nested masterpages". To make it work properly you should also edit "AspNetForumMaster.Master" and remove the "<form>", "<html>", "<body>" and the "<head>" tags, and replace them with the "<asp:Content>" instead.
If you plan to use the "nested masterpage" trick, please make sure that your parent masterpage DOES NOT disable the ViewState, since the forum software requires it for some features (polls, for instance)
You can allow unregistered guest-users to post messages. To do this edit the forum's Web.config and set the "AllowGuestPosts" flag to "true".
You can also mark some "forums" inside the application as "members only", so Guests will not be able to read messages there.
This forum application can generate topic/forum urls in a search-engine-friendly manner. Instead of "messages.asp?TopicID=1000" it provides "topic100-this is-the-topic-title.aspx"
Here is the .web.config section responsible for this:
<httpModules>
<add type="aspnetforum.ForumSEOHttpModule, aspnetforum" name="ForumSEOHttpModule"/>
</httpModules>
PLEASE NOTE: if you are installing the forum under an existing application, then move this whole "httpModules" section to your parent application's web.config!!! (inside the "system.web" section)
You can also comment-out this entire section to disable this funtionality
<add key="PageSize" value="10" />
- page size for the messages
list<add key="MsgSortDescending" value="true" />
- sort the messages
in the forum to have the most recent postings listed first<add key="BadWords" value="f*ck;sh*t;"/>
- semicolon separated list
of bad words. These words will be replaced with "*" signs when posting a message<add key="AllowSmilies" value="true"/>
- enabled/disable smilies<add key="IntegratedAuthentication" value="false"/>
- look here<add key="ServerTimeOffset" value="0"/>
- Offset in hours.
EXAMPLE: if your hosting provider is in New York-USA,
but your forum is French, you might want to add a 6 hours offset
(cause when it's 1:00 in NY it is 7:00 in Paris)<add key="EnableAvatars" value="true"/>
- Enable/disable avatars.
PLEASE NOTE: to use avatars you should grant write permissions on the "/upload" folder
to the user-account, which your ASP.NET website runs under.
(typically "NETWORK SERVICE" account, or "ASPNET" account)<add key="EnableFileUploads" value="true"/>
- Enable/disable file attachments.
PLEASE NOTE: to use file attachments you should grant write permissions on the "/upload" folder
to the user-account, which your ASP.NET website runs under.
(typically "NETWORK SERVICE" account, or "ASPNET" account)<add key="EnableEmailActivation" value="true"/>
- enable/disable sending an email confirmation when registering new forum users<add key="NewUsersDisabledByDefault" value="true"/>
- newly created users are disabled by default<add key="NewUsersNotifyAdmin" value="false"/>
- notify ALL administrators of new forum user registrations4.10 Windows authentication and SINGLE SIGN ON
Now this is a tricky part, so read carefully:
If you want to install the forum as a standalone ASP.NET application (with no parent application) and you want the forum to authenticate your users with their windows-accounts, you have to:
<authentication mode="Windows"></authentication>
If you run a website where users already have an account and you don't want them to create another account for the forum, AspNetForum offers an option of "single sign-on" for your users. First of all, install the Forum so that the Forum and your website share the same ASP.NET Session. To share the same Session, DO NOT configure the "/forum" folder as a virtual directory/application. Instead, make it a part of your website-application, as described above (section 1.2). Now you have two options:
If your website uses
ASP.NET Forms Authentication (for example, in conjunction with ASP.NET
membership provider) or ASP.NET Windows authentication, then AspNetForum can be
configured to recognize your authenticated users, and automatically
register them as forum users (and login automatically). To enable this feature simply edit this line in the web.config:
<add key="IntegratedAuthentication" value="false"/>
and change "false" to "true".
Next steps are simple. The Forum uses ASP.NET "Session" object to store the current logged on user. There are two variables: Session["aspnetforumUserID"] (the user's ID in forum database) and Session["aspnetforumUserName"] (the user's name in forum). You can assign these variables in your website code and aspnetforum will authenticate the current user.
This will work only when your website and AspNetForum are configured to share the Session. Which means that the Forum should be installed under the existing website (web-application) and is NOT configured to be a separate web-application.
Code example 1 - adding a new user (this sample code if for AspNetForum using MS Access):
//Code sample - ADDING A NEW USER TO THE FORUM'S DATABASE. //This sample assumes you use MS Access DB. It wont work with SQL Server or MySQL!!! System.Data.OleDb.OleDbConnection cn; System.Data.OleDb.OleDbCommand cmd; //Creating a connection to the forum database (remember to //edit the connection string) cn = new System.Data.OleDb.OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\db\forum.mdb;Jet OLEDB:Database Password=DB_PASSWORD;"); cmd = new System.Data.OleDb.OleDbCommand(); cmd.Connection = cn; //Inserting a new user cmd.CommandText = "INSERT INTO ForumUsers (UserName, Email, Password, Homepage, Interests, RegistrationDate, Disabled, ActivationCode) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; cmd.Parameters.AddWithValue("@UserName", username); cmd.Parameters.AddWithValue("@Email", email); cmd.Parameters.AddWithValue("@Password", password); cmd.Parameters.AddWithValue("@Homepage", homepage); cmd.Parameters.AddWithValue("@Interests", interests); cmd.Parameters.AddWithValue("@RegDate", DateTime.Now); cmd.Parameters.AddWithValue("@Disabled", false); cmd.Parameters.AddWithValue("@ActivationCode", ""); cn.Open(); cmd.ExecuteNonQuery(); cn.Close();
Code example 2 - authenticating a user:
//code sample - Pre-authenticate a user for the forum //This sample assumes you use MS Access DB. It wont work with SQL Server or MySQL!!! System.Data.OleDb.OleDbConnection cn; System.Data.OleDb.OleDbCommand cmd; //Creating a connection to the forum database (remember to // edit the connection string) cn = new System.Data.OleDb.OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\db\forum.mdb;Jet OLEDB:Database Password=DB_PASSWORD;"); cmd = new System.Data.OleDb.OleDbCommand(); cmd.Connection = cn; //Get the user's ID from the forum database cmd.CommandText = "SELECT UserID, UserName FROM ForumUsers WHERE UserName=? AND Disabled=?"; cmd.Parameters.AddWithValue("@UserName", username); cmd.Parameters.AddWithValue("@Disabled", false); cn.Open(); System.Data.OleDb.OleDbDataReader dr = cmd.ExecuteReader(); if(dr.Read()) { //Assign two session variables - and the user will be treated // as authenticated by the forum Session["aspnetforumUserID"] = (int)dr[0]; Session["aspnetforumUserName"] = dr[1].ToString(); } dr.Close(); cn.Close();