When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sections:
Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
XML Info
Information:
Feedback
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
Print this page.
Published: Friday, March 19, 1999

An ASP Based EZine
By Bart Silverstein


Please note: This article will not go into details about the construction of ASP or HTML pages. For details on the actual code used, please look at the source f iles provided.

- continued -

Have you wanted to produce an EZine? With dynamic content? I would guess that most of you would have avoided such a project because of the amount of manual work involved in maintaining it on a recurring basis. Well, folks, here is an example of how you could implement one in short order. It also allows for easy maintenance due to several factors. Let's check out the key features of this project:

    1) The EZine should be database driven. This reduces maintenance because all locations are automatically updated with minimal manual intervention.
    2) Articles should be stored in the database or read from individual HTML files. Allowing article authors to create and edit the article pages reduces your work.
    3) Columns, articles and authors should only be visible when we deem fit. Hiding columns and articles until you decide they should be shown lets you build them when you can, and roll them out when the time is right.
    4) All displayed data should be able to be customized with HTML tags. By allowing HTML tags in our stored text, individual items can be adjusted for appearance on demand.

I have included both a blank data structure for building your own EZines and a fictitious sample EZine called 'Supermodel Test Drive.'

Setting up the Sample:
In order to run the sample database, or the blank one for that matter, there are a few steps we need to accomplish. First we need to unzip the archive onto the server. The example is set to run in the /ezine path of the server so you should unzip it there. Remember to extract the files using their directories as this is critical for proper operation. Next you should create a System DSN pointing to the file /ezine/_private/ezine.mdb using the DSN name of EZine.

Now that that's been done, let's have a look at the EZine and talk about the data behind it...

The EZine Home Page:
The home page is generated from the content of the VColumnList query which contains all of the necessary data to display it. This query only returns the currently linked article for each column being listed. If there is no linked article for a particular column, or it's been marked as hidden, the column won't be displayed.

There is actually data from 3 records being displayed. Information about the column and it's graphic, information about the author and their graphic and information about the article and it's graphic. The grayed out picture of the supermodels with inset car clip is made up of these 3 graphics. Because of the way that the graphics for the column and author mesh, the sample EZine can't have mixed authors for any given column. There is nothing in the way the ASP scripts or database has been constructed that would preclude mixing authors for any column. It is possible to include HTML tags in the column name stored in the database, making it possible to have a graphical column name instead of a text one, or to adjust the appearance of the text, without having to modify the EZine template.

The EZine Authors Page:
The authors page lists all authors in the database who have articles marked to be shown. By removing the shown flag from the articles you can remove them from the list (such as when they get stale). Generated from the VAuthorList query, the page is displayed by the sort name associated with each author. This ensures that the authors are in the proper order without having to enter the author names in as 'Last, First MI' or worrying about any HTML tags that may have been included in the author's name. Like the column name, the authors name field can contain HTML tags. You will find that most places can contain HTML in order to adjust it's appearance on the client browser. The maintenance pages clearly show where HTML can and can't be used.

The EZine Article Page:
The article page displays all of the articles in the EZine. The page shown to the left was retrieved from an HTM file and the one on the right was generated in it's entirety. The article data is retrieved from the VArticle query, and could be entirely generated from the data found there or could be read from the HTM file specified. In either case there are several fields that are automatically replaced with data from the record. The special strings are listed below:

!--titletext-- This string is replaced with the title text listed in the article information.
!--headergraphic-- This string is replaced with the URL of the header graphic listed in the article information.

You could add more special strings by adding more replace functions in the ARTICLE.ASP script.

Whether you use generate the page directly from the database or retrieve an HTM file, the short biography, link to the authors page, and link to your previous page are automatically included. If the article has been completely generated from the database, then the header graphic and article title are automatically inserted as well.

Adding Other Pages:
Because you are in control of the content of each and every article data page either by having separate HTM files or inserting HTML tags in the database, you can sprout extra pages on demand. They could be either static HTM or dynamic ASP pages, depending on your needs.

Maintaining the EZine:
This is the EZine maintenance page, and can be accessed through the path /ezine/maintenance. The objects are shown in the order which they should be added. First add your columns, then authors, and finally articles. When you add items they will be hidden by default and need to be shown for them to be displayed. Also note that columns that aren't shown will not be scanned for new articles, and articles that aren't shown will not be eligible for linking to columns. When you link articles to columns only articles that have been added since the current article (by article ID number) will be searched for hits.

One other thing of note is that once an article has been shown, if it's not hidden it will continue to be displayed on the authors page showing the author as well if necessary, even if the column has been hidden. All of the individual addition/edit pages have field descriptions associated with each one to help you properly determine what data should be entered for each of them.

Well folks, that's about all there is to it. Remember that any changes from the format provided in the sample EZine will need to have any necessary script and database structure changes to make it work correctly. Go ahead and have a good time with it! Happy Programming!

The ZIP:
This ZIP contains the database, sample pages, graphics and maintenance pages that are necessary for the example to run, and also a blank database for you to use to start creating your own EZine. It should be unziped in the /ezine path on your server, and directories should be preserved. Also, the System DSN EZine should be used to point to the EZINE.MDB sample database or the BLANK.MDB blank database for you to start constructing your own EZine.


Bart Silverstein has written several great articles for 4GuysFromRolla.com. When he is not writing articles, Bart is often found on the many ASP messageboards, answering questions.


ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article