text: StP Forum - CodeProject
  Posted 17 Mar 2002
  Philip Patrick, 17 Mar 2002
  3.69/5 - 13 votes
  ASP-based forum for your website.
  Download source files - 74.1 Kb
  I was looking for an ASP forum to add to my site and found some. One I didn't like the look, another was hard to insert into my site (changes almost on every page needed), so I decided to make my own forum. I surfed the web to see different forums, on different scripting languages, then made a list of basic features I wanted to see in my forums. Remember this is not a message board, like the one you see on CodeProject, it is a forum. Though I am still unsure about differences :) On the picture above you can see a screenshot of the forum. If you want to see a live demo, go look on my site.
  Ok, let me introduce you the features in the forum (I called it StP Forum, StP is a short form of my nickname, full is StPatrick *s*)
  Below are the list of main features of StP Forum
  Members system (also tracking total posts by every member)
  Anonymous posts (can be turned on/off in configuration file)
  Moderators (currently only one moderator per forum). They can lock/unlock topics in their forums, delete posts.
  Smilies replaced with images
  Support for pseudo-code ([b], [i], etc...)
  More features will be added in future. If you have some ideas, let me know :)
  All files in forums may be used as includes to your main files. It is like a text inside your <BODY> tag.
  config.asp - Configuration file
  admin_inc.asp - Administration file
  forum_inc.asp - Main file for displaying forums and topics
  login_inc.asp - login form and code
  mail_inc.asp - form for e-mailing to members
  members_inc.asp - members list and particular member info page
  post_inc.asp - form for making a new topic, post or edit existing.
  ppreview.asp - standalone file for previewing your post before submitting it
  profile_inc.asp - form used for changing profile and registering
  search_inc.asp - search form and search results page
  The typical use of all the files with "_inc" is to include them in your own files, using SSI (server-side includes) in the place you want them to be displayed. This gives you an option to make your pages like you want, with your background, formatting, additional text or whatever. If you want them as is, just make it with empty ASP pages and include the proper file inside your BODY tag. Remember to configure your forum. At least a database connection string need to be changed in order for the forum to work.
  To configure your forums, use config.asp file. Inside it you will find several variables that you can change. Although I think they are describing themselves very well, I will run through them here.
  First and main is a ConnString. You need to set it to your database connection string, like "DSN= MyDB" or DSN-less connection.
  HeadCellColor -background color for forum header
  HeadFontColor -text color for forum header
  CategoryCellColor - background color for category (TD tag)
  CategoryFontColor - category text color
  ForumCellColor - background color for the rest of forum. Used as background for replies also
  ForumCellAltColor - alternative background color for forum. Used as background for topic text and rows highlighting (if enabled)
  ForumFontColor - text color
  HighlightRows - True or False. Determines if highlight rows on mouse over or not.
  ImagesDir - folder where all images stored. Leave blank if the images are in same directory as files. The directory can be relative to main forum file or absolute. The final path to image is calculated as follows: ImagesDir + ImageName.
  ForumFile - main forum file name, where the forum_inc.asp is included
  MembersFile, AdminFile, EmailFile, PostFile, LoginFile, ProfileFile, SearchFile - file names for members, administration, e-mail form, new topic/post, login form, profile/registration, search, where corresponding files included. These are not include files names, but yours.
  NewTopicImage, ReplyImage, LoginImage, RegisterImage, ProfileImage, SearchImage - images for corresponding links, as seen from their names. Can be set to empty string (""). In this case text links will be used
  MessageImages - string with so-called message images ("|" as delimiter). When someone makes a post, he can choose an image to be shown near its topic (or without any image).
  UseSmiles - Boolean (True/False), determines if change smilies to images on display or not. If you set to False, other smilies parameters are irrelevant
  SmiliesImages - images (files names) for smilies. This is a string with "|" as delimiter between different files. For example: smile.gif|biggrin.gif|confused.gif
  SmiliesTypes - text to replace with images. String with "|" delimiter between several types. Example: :)|:-D|:confused:
  SmiliesDescriptions - short description for every smiley, will be shown as tooltip in the post form
  BadWordsFilter - Boolean, determines if use bad words filter or not. To use it set to True
  BadWords - string with bad words and "|" as delimiter between them. No example here and you know why :)
  HTML and Pseudo-code
  AllowHTMLLevel - level of HTML. 0 means all HTML is stripped from the post (change all open and closing brackets (<>) to their HTML form). 1 means only several tags are restricted, see RestrictedTags. 2 - All HTML is available and displayed as is.
  RestrictedTags - if AllowHTMLLevel is set to 1, the tags from this string ("|" as delimiter) are stripped from post. Example: "SCRIPT|IFRAME|EMBED|FRAME"
  AllowPseudoCode - Boolean, tells if pseudo-code is allowed in the forums. If False, all pseudo-code will be displayed as is.
  Pseudo-code supported by current version of forums:
  [b] - bold text
  [i] - italic text
  [u] - underline text
  [s] - strike out text
  [center], [right] - text is centered/right aligned
  [quote] - changed to BLOCKQUOTE tag
  [color=*] - changed to <FONT color="*"> tag
  [size=*] - font size, replaced with <FONT size="*">
  [url=*]**[/url] - defines URL, replaces with <A href="*" target=_blank>**</A>
  [mail=*]**[/mail] - same as URL, but adds mailto: to *
  USER_LEVEL - set to name of session variable where the member's level will be stored.
  USER_NAME - name of session variable with member's name
  ForumName - name of your forums. Don't set to empty string, as it is used for backward navigation (from topic to forums list)
  AllowAnonymous - Boolean. Tells if anonymous posts are allowed or user has to have an account
  AnonymousUserName - If anonymous post was made, when displaying it, this will show below the person's name.
  You will notice a small STYLE tag at the top of the configuration file. The BLOCKQUOTE tag is defined and also a class SmartLink, which represents the topic/forum's names. When new post was made in some forum, the link changes and user will see that the forum/topic has new posts. By default it is set to bold for new topics and regular for forums/topics without new posts. You can change it to different colors for example.
  Also there are many other things you can see in the configuration file. Like fields ordinal numbers for example. Do not change it unless you know what you are doing. Most of the database operations are made with ordinal numbers of fields instead of their names to increase database access speed. But in several places not, so it is not a guide to start changing fields names in your tables :)
  And another thing you may want to change is how e-mail is sent. Look at the end of configuration file, you will see a small class named MailClient. By default CDO.Message is used to send e-mails. You may want to use something else, like ASPMail or whatever. Just change the progID and be sure that your component has same methods and parameters.
  Quick guide to changing pseudo-code
  If you want to add a new pseudo-code and are familiar with regular expressions, you can do it easily. Look in the configuration file for a function named FormatText. You will see several lines that looks the same, for example:
  retval = ReplacePCode(retval, "", "", "<B>$1</B>")
  So what it means? This is a simple replacement. [b] and [/b] will be replaced with <B> and </B> and the text between them will be placed instead of $1. Nothing new here, it is just a simplified form of regular expression.
  Now about more complex things, like [color] code. Look at the line where it is defined:
  retval = ReplacePCode(retval, "[color=(.+)]", "[/color]", _
  "<FONT color=$1>$2</FONT>")
  The "(.+)" means at least one ANY character should be present in this place and the text (color here) will be placed instead of $1 in second parameter. All other text, between the tags will replace $2 in second parameter.
  It can look complicated for someone who hasn't used regular expressions before, but you have to start somewhere, not? :)
  If you are gonna use this forum on your own web-site, please leave the link to mine at the bottom of the forum table, it won't bother you too much :)
  Any bugs, suggestions, ideas and feature requests you can post here, or on my site or send them directly to my e-mail.
  media data transfer between filters
  bhanu_850911-Jan-08 1:25
  bhanu_8509 11-Jan-08 1:25
  Iam a beginner in VC++. I have done a code for initializing and adding the filters.But on execution it is throughing an
  "ACCESS VIOLATION ERROR"
  rianelis29-Jul-05 7:47
  rianelis 29-Jul-05 7:47
  i was wondering how can i build a chat forum on asp .net for pda?can i set the size?please help me.thank you
  Automatic mail posting to all subsribers
  Bill Leibold25-Mar-02 21:51
  Bill Leibold 25-Mar-02 21:51
  Does this forum support automatic mailing for all new posts to subscribers, if they choose to receive notification of all new posts?
  Re: Automatic mail posting to all subsribers
  Philip Patrick25-Mar-02 21:54
  Philip Patrick 25-Mar-02 21:54
  Not right now, this feature is in progress. The current version of forums is very simple, just an example, but I'm working on it, since I need some features for myself
  juan29412-Sep-07 10:38
  juan294 12-Sep-07 10:38
  Hi, are you still working on your forum? I'm trying to make it work but it's been imposible for me although it seems to be so simple.
  Can you help me? I've downloaded the code, put it into my site, create a new asp page, introduced the "<!--#include file=foro/forum_inc.asp-->" into the BODY tags, imported the tables from access to SQL Server and changed the string for the BD connection to: Const ConnString = "DSN=Provider=SQLOLEDB.1;Persist Security Info=True;User ID=spc;Initial Catalog=SPC;Data Source=localhost;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=localhost;User Id=spc2;Password=spc2;"
  But it doesn't work, when i try to load the page it keeps showing a login windows which i don't know how to pass. I can't find any login or password that works with it.
  Anonymous1-Apr-03 16:19
  Anonymous 1-Apr-03 16:19
  Simply use the free bulletin board (and pretty much the best available) phpBB... which can be found at