News Database By Smo - Version 3

  All Applications are now available as shareware. There are no limitations or 'nag' screens. If you decide to use the application for more than 30 days you must purchase a license.

REMEMBER YOUR KARMA!!

  • News Database By Smo - $10
News Database By Smo
   File Size = 98 kb

  Refunds - No Refunds...try before you buy.

  Technical Support - For registered users only. I check my e-mail often. Its very important to me to offer my clients quality support in a timely manner. I answer all e-mail within 24 hours.

Table of Contents:

About The News Database By Smo

The News Database By Smo allows you to maintain a news database on your web site. Post/edit/delete articles with headline, author, date and time, lead in, full article, related link, and photos. Features include three display formats, a comment system, archive, search, print, e-mail articles to friends, password protected article poster page, password protected administration page, posting of articles to go active at a future date, and the ability to customize the date format, colors, font, font size, and icons. The application will run inside a 'template page' (any page on your web site) allowing the program to fit seamlessly into any design. The News Database By Smo is an Active Server Page Application written in the VBScript programming language. Photo upload to database is pure asp...no components needed on the server.

Requirements

1. Your isp (Internet Service Provider) must have the following running on their web server. Its ok if you are unfamiliar with the terms below. Your isp knows what they mean and can inform you if they are available on the server that hosts your web site. These are standard parts of Microsoft's© web site hosting technology.

  • Active Server Pages (ASP 2.0).
  • Ability to connect to a Microsoft Access 2000© database or an SQL Server 2000 database.
  • To allow users to send articles to friends via e-mail you will need one of the following e-mail components on your server - CDONTS (Microsoft), ASPEmail (Persits), AspMail (Server Objects), or JMail (Dimac). This script can be edited to support other e-mail components. Editing the script to support your e-mail component is free with purchase of the application. Note: If the 'Send To Friend' feature is disabled in the settings you do not need to have access to an e-mail component.

2. Your web site viewers need to be using Internet Explorer Version 4.0 or higher or Netscape Navigator Version 4.08 or higher. Version 3 browsers work well but have a few bugs. Is anyone still using a 3.0 browser?

Installation

1. Unzip the files - Unzip the files in the newsdatabasebysmo_v3.zip into a folder in your local web site directory (where you develop your web site before uploading). Be sure to unzip the file with the 'Use Directory Names' option selected. You will now have a folder named 'newsdatabase' containing the following files...
  • images (Folder)
  • hex_color_codes.htm
  • html_color_names.htm
  • news_admin.asp
  • news_admin_display.htm
  • news_admin_frameset.htm
  • news_admin_index.htm
  • newsdatabase.asp
  • newsdatabase_admin.asp
  • newsdatabase_config.asp
  • newsdatabase_photo.asp
  • newsdatabase_print.asp
  • newsdatabase_readme.htm (This file you are reading)
  • newsdatabase_setup_sql_tables.asp
  • newsdatabase_setup_sql_tables.txt
  • newsdatabase_template_page_example.asp
  • postnews.asp
  • rename_me.mdb
2. Setup the database - Below are directions for setting up the database.

Access - Rename the 'rename_me.mdb' file making sure you retain the .mdb extension. You can use any name you wish but you must keep the .mdb extension. Also, use only small case letters a-z with no spaces between the words. Here is an example...

rename_me.mdb ...renamed to... mydatabase.mdb

Be sure to rename the file 'rename_me.mdb' because doing so will provide extra security for your users.

Many isps require a special folder be created to hold database files. Ask them to create this folder and to set the proper permissions. You can now upload the 'rename_me.mdb' file (which you have renamed...) into the newly created folder. If your isp does not require a special folder to hold database files create a new folder yourself and upload the 'rename_me.mdb' file (which you have renamed...) into it. Your new folder can be named anything you want. Inform your isp of the location of the folder so they can set the proper permissions. It is always best to have your database folder above your webroot directory to prevent anyone from downloading your databases. Renaming the 'rename_me.mdb' file will also help prevent anyone from downloading your database (you did rename the 'rename_me.mdb' file didn't you?).

SQL Server 2000 - Create a database on the server (or use an existing database). Skip ahead and complete sections 4 and 5. Load the newsdatabase_setup_sql_tables.asp page and use it to create the required tables in your database. Be sure to delete the newsdatabase_setup_sql_tables.asp page from your web site after you successfully create the tables to prevent anyone from using the page again and possibly damaging your database. You can also use Query Analyzer to create the required tables. To do so, open the newsdatabase_setup_sql_tables.txt and follow the directions.

3. Create the news database template page - Next you need to create your news database template page. It can be a simple blank page but you will most likely want it to have your web site's design. It can contain your web site's templates, library items, asp code, etc. It must be an .asp file. You can take one of your existing htm, html, etc. pages and change the extension to asp. In this news database template page you need to put the following code...

<!--#include file="newsdatabase.asp"-->

...in the place where you want the news database to run. Make sure the line of code only appears once in your news database template page and that it is not in the title. The news database template page MUST be in the 'newsdatabase' folder with the other news database files. An example news database template page is provided...'newsdatabase_template_page_example.asp.' You can view this page with Notepad or your HTML editor to see the code.

4. Open the 'newsdatabase_config.asp' file for editing - Edit the 'newsdatabase_config.asp' file with your favorite editor (Notepad works nicely). Read through this file and follow the directions it contains. You may need to obtain some of the required information, such as the physical address of your rename_me.mdb (which you have renamed...), from your isp.

5. Upload Files - Upload all the files to your web site.

6. Link to your news database template page - You can now link to the news database template page which will run and include the news database application.

If you want the news database application to run on the opening or 'default' page of your web site then move all the files into your webroot directory were your 'default' or starting page resides. Keep the images in the images folder and move it to the webroot directory. Your 'default' or starting page will be your news database template page which you will configure in step 3.

7. Photos - The photos are stored in the database. The photos MUST be of type JPEG (.jpg extension) or GIF (.gif extension). Photos that do not meet the criteria are rejected. The actual photos are only taken out of the database when being displayed. You can set the height and width limitations of photos from the 'Set Options' page of the administration page. Keeping the height and width of the photos small will keep the file size of the photos small as well. It is best to use the JPEG format for pictures that contain many colors such as real life photos and complicated artwork. This is because the JPEG format can store all the complicated photo information in a much smaller file than the GIF format can. Use the GIF format for larger images that contain fewer colors. Keeping the file size of the photos small will help keep the size of your database file small and reduce the strain on your server when it takes the photos out of the database for display.

8. Customize Icons - You can create your own icons and overwrite the applications default icons. Your icons can be of any size but it is best to keep them the size of the originals or at least close. You can experiment with different sizes to find what works best for your web site. Below are the default icon names and sizes. You will need to name your custom icon the same as the icon you wish to replace and overwrite that original icon in the images folder.

    newsdatabase_home.gif - Can be any size

     newsdatabase_archive.gif - Can be any size

     newsdatabase_search.gif - Can be any size

    newsdatabase_articledetail.gif - Best 35 x 35 pixels

      newsdatabase_articledetail_small.gif - Best 15 x 15 pixels

     newsdatabase_print.gif - Best 35 x 35 pixels

      newsdatabase_print_small.gif - Best 18 width x 11 height in pixels

     newsdatabase_email.gif - Best 35 x 35 pixels

      newsdatabase_email_small.gif - Best 18 width x 11 height in pixels

      newsdatabase_comment_small.gif - Best 18 width x 11 height in pixels

      newsdatabase_commentdetail_small.gif - Best 15 x 15 pixels

      newsdatabase_link_small.gif - Best 18 width x 11 height in pixels

     newsdatabase_arrowleft.gif - Best 23 width x 17 height in pixels

      newsdatabase_arrowright.gif - Best 23 width x 17 height in pixels

      newsdatabase_error.gif - Best 98 width x 17 height in pixels

Using The News Database Posting Page

The administrator can add articles using the News Database Administration Page. If you want to give non-administrators the ability to add articles simply direct them to the News Posting Page (postnews.asp) and provide them with the News Posting Password you set in the newsdatabase_config.asp. Users must have cookies enabled to use the News Posting Page. The News Posting Page does not place any cookies that last beyond the session. Following are the functions of the News Posting Page.

  • Welcome - Welcomes the user.
  • Add Article - Add an article.
  • Exit To News Page - Exits to the main news page.

Using The News Database Administration Page

To use the administration page you simply load the 'news_admin.asp' page located on your web site into your browser and enter the administrator password. It is a stand alone file and does not need a template file or special configuration. You must have cookies enabled to use the administration page. The administration page does not place any cookies that last beyond the session. The administration page does not use a custom error page.

1. Statistics - Displays the News Database statistics.

2. Add Article - Add an article.

3. List Current Articles - Lists the current articles.

4. List Pending Articles - Lists the articles that will go active at a future date.

5. News Archive - Use the archive page to find older articles.

6. Search News - Use the search page to search for articles.

7. Set News Options - Use this page to set the options. All options can be changed at any time.

  • Table Length In Pixels - The application creates and runs inside a table. Use this option to set the length of this table.
  • # Of Current Articles To Display - The number of articles displayed with full detail on the opening page before listing just the headline and date/time in the sub-archive.
  • # Of Sub-Archive Articles To Display - The sub-archive is on the opening page and lists articles with just headline and date/time underneath articles that are displayed with full details. Use this option to set the number of articles to list in the sub-archive.
  • Headline Cut Factor - When listing articles the number of characters displayed in the headline can be set with this option. The space for displaying the headline will vary depending on the size of your table, font, and date/time format. Displaying too many characters in the headline will cause it to take up more than one line and push the date/time into two lines. This is fine if you are happy with this look, but to keep the information on one line, set the Headline Cut Factor to an appropriate number. You may need to experiment to get it just right. This number also applies to the comment heading when listing comments.
  • Allow Photo Upload/Display - Enable/disable photo upload and display.
  • Photo Maximum Pixel Height - Set the maximum pixel height of photos.
  • Photo Maximum Pixel Width- Set the maximum pixel width of photos.
  • Article Display Format - Select the display format. If you wish to create your own format select custom and then create your custom format. You will need to code a custom format in three subroutines (Sub displayarticle(ArticleId), Sub commentdetail, Sub addcomment) in the newsdatabase.asp using Case Z.
  • Display Color One - Table border and underline colors.
  • Display Color Two - Table background colors.
  • Display Text Color One - Article headline/leadin/full article and comment heading/comment color.
  • Display Text Color Two - Support text color (date/time, author, related link, etc...).
  • List Color One - As article headlines and comment headings are listed, this is the background color of the first table cell. It alternates with List Color Two.
  • List Color Two - As article headlines and comment headings are listed, this is the background color of the second table cell. It alternates with List Color One.
  • Enable Send To Friend Feature - Enable/disable the ability for users to send articles to friends. Set the e-mail component.
  • E-mail Server Address - The address of your e-mail server. Provided by your isp.
  • Valid Web Site E-mail Address - A valid web site e-mail address.
  • Enable Comment System - Enable/disable the ability for users to post and read comments.
  • Font Size - Set the font size.
  • Font Face Type - Set the font type.
  • Date And Time Format - Set the date and time format.

8. Launch ReadMe Page - Displays this readme file.

9. Logout - Logout and load the main news page.

Trouble Shooting

The application will trap most errors and display them on a custom error page rather than show the server default error page that leaves the user confused about what has gone wrong. The two most common errors for users will be 'cookies disabled' and 'session time-out' (session time-out is set to 20 minutes by the application overriding the server setting). If a user encounters one of these errors the custom error page will help them correct the problem. As an administrator the custom error page will assist you in correcting any problems you may encounter. Below are some common errors and their solutions.

I get the following error:

Data source name not found and no default driver specified

...or...

'(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

...or...

Could not find file '(unknown)'

...or similar...

Make sure the database connection is set properly in the 'newsdatabase_config.asp'.

I get the following error:

Operation must use an updateable query. (or a 'permission denied' error)

...or similar...

Make sure your isp has set the proper permissions on the folder in which your database resides.

I get the following error:

006~ASP 0159~Buffering Off~Buffering must be on.

Buffering is off. Either your isp has buffering turned off at the server level or the code in your news database template page turns buffering off. If your isp has turned buffering off simply add the following line of code to the top of your news database template page...

<% Response.Buffer = True %>

If the code in your news database template page turns buffering off you will need to change it to allow buffering. The code that turns buffering off will usually be at the top of your news database template page and look like the line below...

<% Response.Buffer = False %>

...change to...

<% Response.Buffer = True %>

I get the following error: (The following error will not show in the custom error page but will be displayed by the server using its error handling method.)

The page cannot be displayed

There is a problem with the page you are trying to reach and it cannot be displayed.

HTTP 500 - Internal server error
Internet Explorer

The most likely cause of this error is the inability of the news database template page to load the include file 'newsdatabase.asp'. Make sure the news database template page is in the 'newsdatabase' folder with the 'newsdatabase.asp' file and that it is properly set in the 'newsdatabase_config.asp'.

Technical Support

If you find you are still having trouble getting the News Database By Smo running correctly after reading the 'Trouble Shooting' section of this document please send an e-mail to iamsmo@comcast.net explaining the difficulty you are having. I have worked very hard to build a high quality application. I will do everything I can to help you get things working properly. I will reply to your e-mail within 24 hours.

THE NEWS DATABASE BY SMO IS SOLD "AS IS" AND WITHOUT ANY WARRANTY AS TO MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER WARRANTIES EITHER EXPRESSED OR IMPLIED. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.