Staff Home | WorkSource Home | ?printver=true&" class="white">Print Page
Inbox:


IntranetApp Documentation   v2.2a


:: Installation
:: Configuration
:: Database Schema
:: Customization
:: User and Administration Interfaces
:: Support



Installation

The installation process entails..
    1) "unzipping" the '.zip' file
    2) extracting or copying the files to a Web accessible folder
    3) connecting to the Access (.mdb) or SQL server database

    For Access
    • - unzip the .zip file to a Web shared (alias or virtual created via IIS) folder
    • - make sure the '/data' folder is write accesible to the IUSR_MACHINE account
    • - make sure the database connection paths (cn.Open, user_cn,Open) in 'i_utils' are valid paths to the database

      The most common reason for problems is that the Internet Guest account (IUSR_MACHINE) does not have 'Write' permissions on the database file (.mdb). To fix this problem, use the Security tab in Windows Explorer to adjust the properties for this file so that the Internet Guest account has the correct permissions. When using Microsoft Access databases with ADO, it is also necessary to give the Internet Guest account Write permissions on the directory containing the .mdb file. This is because Jet creates an .ldb file to handle database locking. You may also need to give read/write permission on the Temp folder because Jet may create temporary files in this directory.



    For SQL
    • - unzip the .zip file to a Web shared (alias or virtual created via IIS) folder
    • - create a database on your SQL server
    • - execute the included .sql script file (in the '/data' folder) on the new database (WARNING: executing the script on an existing SQL database will delete all tables and data!!)
    • - update the database connection strings (cn.Open, user_cn,Open) in 'i_utils.php' for your SQL server database (ie; "PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername_or_ip;UID=myuserid;PWD=mypwd;DATABASE=mydatabase")

Configuration

To set-up your site, there are some basic settings that need to be modified. Some of these settings can be updated from your Web browser, and others require that you can open the appropriate .php files in an editor. This editor can be any standard text or HTML editor (Visual InterDev, Homesite, Dreamweaver, Notepad, etc..). The application database comes pre-populated with data so that you can see how the .php pages interact with the database.
  1. Define categories:

    All of the links and content in the application are classified by categories. You probably have a hierarchical list of categories and sub-categories in mind, and now is the time to define these using the application admin pages. Categories can be anything that is best suited for your needs. Your categories might by topics, subjects, regions, groups or any other multi-level classification system that will fit to the links and content that will later be added to your site. To define new, or to change the existing categories go to the admin_cats.php from your Web browser (you must login as admin/admin to access this page). For more information, see Category Management

  2. Setting up the "who's online" feature:

    To active the list of current users on the home page (default.php), you need to make sure the site's global.asa file contains the following. You can use the included 'global.asa' file, or update the existing 'global.asa' file in site's application root.

    1. declaration of the online_users dictionary object

      <object runat="server" scope="application" id="online_users" progid="scripting.dictionary"></object>

    2. in the "Sub Session_OnEnd" event

      online_users.remove session.sessionid


  3. Setting up email notification features:

    The application has the ability to send emails automatically when triggered by the following events:

    -- new user registration (register.php)
    -- user password lookup (login.php)
    -- reporting bad link errors (links.php)
    -- forum topic and reply postings (forums.php)
    -- sending a newsletter (admin_send_newsletter.php)

    To activate email features you need to do the following:
    1. edit application variables in 'global.asa'
        - application("smtp_server") - specify the corrent SMTP mail server
        - application("email_component") - specify the component installed on the Web server
        - set site_root, from_name, and from_address application variables

    2. (optional) modify 'register.php' and 'forums.php'-- modify the variables as need in the send_confirmation sub


  4. Change the admin password:

    For security reasons, it is recommended to change the default admin account password (admin) via 'admin_users.php' To change the password, email address, or any other account fields, click the [edit] link in the row for username 'admin'.

Database Schema
    Database Tables:

    Cats, CatTypes - These tables establish the hierarchy of categories througout the site. Categories can be anything you want such as regions, topics, subjects, people, etc.. CatTypes are used so that different categories sets can be used to organize different application areas. For example, you may want "Good sites", "Bad sites", and "OK sites" as link categories, but "News", "Articles", and "Tutorials" as content categories. You might also want the classifieds area to use it's own categories. Since the 'ParentId' field is used to establish parent, child relationships you can define several levels of categories (ie: Main category, sub category, sub-sub category, etc..).

    Content, ContentTypes - These table are used to manage the content area. ContentTypes can be used to define different types of content. Content can also be related to a category (CatID). The submitter of the content is identified by user_id.

    Links, LinkTypes, LinkRatings - These table are used to manage the links area. Links always have a related category (CatID). LinkTypes can be used as another means to classify links. For example, link types might be: "resource", "article", "news/press release", "personal site", "external link", "internal link", "download", etc.. The submitter of the link is identified by user_id.

    Disc_Forums, Disc_Replies, Disc_Topics - These tables are used to manage the forums / bulletin boards. The "topmost" table is 'Disc_Forums', that have one or more related records in 'Disc_Topics', that may have one or more related records in 'Disc_Replies'. The submitter of the forum, topic or reply is identified by user_id.

    MessageRecipients, Messages - These tables are used to manage the internal messaging features. The submitter of the message is identified by Messages.user_id and the intended recipients are defined by 1 or more user_id's in MessageRecipients.

    Newsletters - This table is used to manager the newsletter features. The submitter of the newsletter is identified by user_id.

    Events - This table is used to manager the calendar features. The submitter of any given event is identified by user_id.

    pm_Projects, pmTasks, pm* - These tables are used to enable the project and task management features.

    Surveys, SurveyQuestions, SurveysAnswers - These tables are used to manage the survey/polling features. The "topmost" table is 'Surveys'. A 'Survey' can have 1 or more 'SurveyQuestions', and 'SurveyQuestions' have 1 or more 'SurveyAnswers'

    SurveyResults - This is where the results of survey submission are stored. The survey responder is identified by user_id.

    Users - This table is used to manage all "registered" users and for login validation. The "user_id" field also relates the user to data stored in the 'Links', 'Content', 'Classifieds', 'Disc_Forums', 'Disc_Topics', 'Disc_Replies', 'MessageRecipients', 'Messages', 'Surveys', 'Events' and 'Auctions'. Using the "user_id" any data that is posted by or intended for any given user can be tracked.

    UserLinks - This table is used to track and manage a user's favorite links.

Customization

To make changes to you application, an understanding of Active Server Pages, VBScript and relational database design is needed.

Changing the style and look

    Your own custom design can also be applied by editing the 'i_header.php' and 'i_footer.php' HTML files that create a "wrapper" around the page content. Most fonts and colors used throughout the application are defined in the default.css file. You can change the style by modifying the values in the default.css, or reference a different .css file in 'i_header.php'. Several other example other style sheets are provided(default1.css, default2.css, etc..). The code that references the .css file is in the section of 'i_header.php'

Changing page content and functionality

    The application home page (default.php), is the most common page that clients and developers wish to modify. You may want to change the layout, or display different database-driven content. Familiarity with HTML, ASP, VBScript, and database design is useful when undertaking this task. To modify the home page (or any other page), simply open the page in any standard text or HTML editor. Modify 'i_menu.php' to change the navigation throughout the site.

    If you would like to modify other application pages, consider the following page architecture that is used consistently throughout all pages in the application.

    -- The 'i_utils.php' file (database and login functions library) is included at the top of every page.

    -- Variables are declared (dim)

    -- The "request_" and "validate_" subroutines

    -- The "db_" subroutines

    -- Key database fields are requested

    -- The action variable is requested and handled using the "select case action" statement

    -- The 'i_header.php' include file is displayed

    -- Forms and content are displayed

    -- The 'i_footer.php' include file is displayed

Creating other user access levels / Modifying security

    You may also want to create different levels of security in your application, where only certain users can access certain pages. Out of the box, the application has 3 levels of access:

    accesslevel = null or 0 -- anonymous users that are not logged in

    accesslevel = 1 -- (member) these users can access all application (user) pages and modify some data

    accesslevel = 2 -- (editor) these users can access most of the 'admin_' pages

    accesslevel = 3 -- (admin) these users can access all of the 'admin_' pages including user, category and file management

    When a user logs in, the session 'user_id' and 'accesslevel' variables are set. For example, the following code could be used to display a section only to users with an accesslevel of 2 or greater...

    <% if session("accesslevel") >= 2 then %> response.write "you are seeing this because you're logged in with an access level of at least 2" <% end if %>

    To set an access level for an entire page, just modify the check_security statement at the top of the page...

    <% check_security(n) %>
    ''' (where n is the value(1,2,3,4..) of the accesslevel field in the Users database table)


The User and Administration Interface

For consistency in page naming, the pages used for adminstration begin with 'admin_'. All of these pages can be used to add, edit, and delete data in the application database and require a user to be logged in with an accesslevel of 2 or greater. A users's access level is determined by the value of the accesslevel field in the Users database table. The administrative pages used for User, Category, and File management require a minimum access level of 3. For more information on security, see "Creating other user access levels / Modifying security"

All administrative features can be accessed via 'admin.php'.
  • Category Management

    Category management is a one of the most important aspects of your application. All of the links and content in the application will fit into the hierarchy of categories (Root categories, sub categories, sub-sub categories, etc..)

    To add or edit categories, the 'admin_cats.php' page is used. There is a form at the top of this page that is used to add or edit category information, and there is a table of the existing categories organized by root (parent or top categories) and sub-categories. You will see that each category has a corresponding category type. The category type enables you to have separate groups of categories. For example, there can be a set of categories used to organize the links and articles, another set for classified ads, and another distinct set for the image gallery.

    Category data is stored in the 'Cats' table. Each category has a label that is stored in the 'Cat' field and a related 'CatId' that is an automatically generated (Access: autonumber or SQL: identity field) number. This 'CatId' is created when you add a new category. There is also an optional 'ParentId' field. This field is used to create the hierarchy of categories and sub-categories. Examine the table below to see how the 'My Main1 Sub Category' and 'My 2nd Main1 Sub Category' sub-categories are created under the 'My Main1 Category' category. Cat Table
    CatId Cat ParentId
    104 My Main1 Category
    105 My Main1 Sub Category 104
    106 My 2nd Main1 Sub Category 104
    107 My Main2 Category


    Categories without ParentId's are considered to be root (or main) categories. More advanced developers may also wish to also use the 'RelatedId' field to created related categories that will display at the bottom of the 'links.php' page. Category relationships can be updated using 'admin_related_cats.php'

    The CategoryTypes table (admin_cattypes.php) is used to create different groups of categories. You may want to have one set of categories for links, and a different set of categories for articles, and yet another group of categories for classified ads and images...

      - 'Link' category examples: Web designers, Web developers, Other software companies, etc..
      - 'Content' category examples: Web development, Web design, Programming, etc..
      - 'Classified' category examples: Real Estate, Jobs, Automotive, etc..

    If you choose to modify the existing, or create new CategoryTypes, you may need to also modify the pages that are used for submission of links and content. The Category selection list in these pages reference the corresponding CategoryType, so if you change the name of the CategoryType in the database, you'll need to change the SQL query that is used to create the category select list on the 'submit_' page. The SQL query is defined within the actual .php code, so you'll need to edit the appropriate pages in a text or HTML editor.
    • submit.php (for link submission)
    • submit_gallery.php -- the query for the Category select list references CategoryType='gallery'
    • submit_classified.php -- the query for the Category select list references CategoryType='classified'
    • submit_auction.php -- the query for the Category select list references CategoryType='auction'


    These queries can be changed by modifying the SQL statement used to created the Category select lists in the 'submit_' page..

    ie; =get_options ("SELECT Cat... ...WHERE Cats.CatTypeId = Cattypes.CatTypeId AND Cattype = 'gallery'", CatId)


  • User Management

    - Adding users: Login to the admin area using the default admin account (usr: admin, pwd: admin). Goto user administration ('admin_users.php'), comlete the add user form, and click the 'Add User' button. Specify access level of 1 for basic users. Specify access level of 2 (or greater) for application administrators and forum moderators. Users can also be added via the 'register.php' page. This page is set to create basic users that will be added with an accesslevel of 1. User data is stored in the 'Users' table of the application database.

    There are situations where a user record is created in the 'Users' table with only the email and user_id fields populated. No username and password are needed when a user subscribes to a newsletter (subscribe.php). Therefore, some user records may exist with only a 'user_id' and 'email'.

    - Logging in: 'login.php' is used to prompt users for their username and password. When a user requests a security enabled page (check_security function) an permission level is obtained by referencing the current session 'user_id' and 'accesslevel' variables. If these session variables have not been set, the user is redirected to login.php and prompted to login using their username and password credentials. The 'login.php' also enables users to lookup a lost password. The user specifies their email address, and it is referenced in the 'Users' table. If a matching email address is found, the related password is emailed to the specified email address. As described above, there may be situations where no user_name or password exist, but an email address does. If a user attempts to lookup a password for an account with a non-existent user_name, they will be redirected to the registration form (register.php). To find out more about the user email notification features click here.

    Once logged in, users can view and manage their own profile via 'user_profile.php' and 'upd_user.php'. The 'user_profile.php' page also lets users view and compose internal messages, and view their favorite links, active discussions, and any links or content they have submitted.

    Using Windows authentication (NT, Windows 2000 and XP networks) -- optional:

    3 files are included that let you authenticate users on your Web server's local network. The 'Users' table in the application database is still used to manage and track the site users, but use of the 'nt_' files will first authenticiate the user on your local network and add them to the 'Users' table in the application database.
    1. nt_login.php - authenicates Windows users and manages login.
    2. nt_ins_user.php - creates an account in the app database (Users table) for a specified Windows user.
    3. nt_upd_user.php - updates an account in the app database (Users table) for a specified Windows user.

    To enable Windows authentication for your site:

    Rename the 'nt_login.php' file to 'login.php' so that it becomes the login page.

    How it works:

    Once you have renamed the nt_login.php page, site users will be authenticated on your local network. When a user requests a security enabled page (check_security function) a permission level is obtained by referencing the current session 'user_id' and 'accesslevel' variables. If these session variables have not been set, the user is redirected to login.php and prompted to login to the Windows network. The "WWW-Authenticate" HTTP Header (NTLM) response is sent to the browser and the user logs in using their Windows credentials.

    Once the user is validated as a user on the Windows network, the login page (nt_login.php) will query the 'Users' table in the application database to assure that the user_name and password used match a record in the 'Users' table.

    If a matching username and password is found:
    The user has previously visited the site and thus has a record in the 'Users' table. The values of the user_id and accesslevel are stored in session variables, and the user is "logged-in".

    If a matching username but mismatched password is found:
    The user has previously visited the site and a record in the 'Users' table exists, but the password in the 'Users' table doesn't match the password from the Windows network. In this scenario it's possible that it's the wrong user account or the user's password has changed in the Windows network so that the record in the 'Users' table must also be updated. In this case, the user is redirected to 'nt_upd_user.php' to verify the old password, record is updated, the values of the user_id and accesslevel are stored in session variables, and then the user is "logged-in".

    If no matching username is found:
    The user has an account on the Windows network, but doesn't have one in the application database 'Users' table. This is most likely a new visitor to the site. In this scenario, the user is redirected to 'nt_ins_user.php', prompted for an email address, and then their Windows username, password, and email address are added to the 'Users' table. The user_id and accesslevel of the newly inserted record are obatined and then the user is "logged-in".


  • Link Management

    - Link administration: 'admin_links.php' can be used to add, edit, and delete links in the Links table. When organizing external links to other sites you can classify links by "type" (as well as categories described above). The 'admin_linktypes.php' page can be used to define various types of links.

    - User link submission: 'submit.php' can be used to allow user to submit links. These links will be added to the Links table, and marked with Display=0. An administrator can later log-in to 'admin_links.php' and approve the links for display.

    - Links display: All links are organized by category and displayed via 'links.php'. Each link that displays on this page will have a 'rate this resource' link that opens the 'pu_rate.php' pop-up page. This page enables users to rate the linked web site on a scale from 1-10.


  • Content Management

    The 'admin_content.php' page is used to add, edit, and delete links in the Content table. You may intend to use the application to manage many different types of "content". You may want to display articles, news stories, press releases, images or other content bodies that contain text and images. Since there are different types of content (ContentTypes), not all of the fields are used for all types of content. For example, the 'Image' content type, that displays on 'gallery.php', does not use the LongDesc (Content) field. To define content types use admin_contenttypes.php. You'll see that several content types have already been defined. You can edit the existing types, or add new content types for your application.

    If you choose to add new content types, you may need to update the 'user_profile.php' page where the value of the ContentTypeId has been hardcoded. For example, 'user_profile.php' is used to display content that has been submitted by any given user. The last section of this page displays content of type 'Article'. ContentType 'Article' has a ContentTypeId value of 8 in the database. The link for submitting new articles is 'submit_content.php?ContentTypeId=8'.

    Understanding Cats, CatTypes and ContentTypes

    Consider for example, you have defined the following categories via 'admin_cats.php'..
    • General Business (CatType=general)
    • Information Technology (CatType=general)
    • Sales and Marketing (CatType=general)
    • HR Forms (CatType=library)
    • HR Policies (CatType=library)


    You have also defined the following content types via 'admin_contenttypes.php'...
    • News
    • Articles
    • Library


    Next, consider these scenarios...
      scenario 1) A user submits an article or news story... When the user adds this new content, a "category" and "content type" will be selected. The actual content might be a "News" story that is about "Information Technology", or if might be an "Article" that is about "Information Technology". This way there is a distinction between "News" and "Articles" eventhough they share the same topical category -- "Information Technology".

      scenario 2) A user submits a document for the library... When a user adds (and uploads) the new document, the "content type" will be set to "Library" (submit_library.php). They will also select a "category", but we only want the categories that would be applicable for a document in the library (ie; "HR Forms", "HR Policies"). This is what the 'CatTypes' table is used for, and why there is a CatType of "library" and ContentType of "Library".


    The 'admin_content.php' page is also used to update the currently "featured" content. The "featured" content is requested and displayed on the application home page (default.php).

    Uploading and managing content related images and files

    To upload and manage files related to your content, the 'pu_upload.php' and 'pu_fileman.php' pages are linked to from the insert/edit mode (Filename field) on 'admin_content.php'. The files will enable accesslevel 2 users to upload files, and accesslevel 3 users can create and delete files or folders using 'pu_fileman.php'. The link from 'admin_content.php' to 'pu_fileman.php' will only appear for accesslevel 3 users. To enable file uploads, write permission on the appropriate folder(s) must be granted via the security settings on the Web server.

    User content submission

    The 'submit_content.php page can be used to allow user to submit content (articles). This content will be added to the Content table, and marked with Display=0. An administrator can later log-in to 'admin_content.php' and approve the articles for display by checking the "Display" checkbox. Since some types of content, for example the ContentType of 'Image' requires the user to upload a file, other specific pages ('submit_gallery.php', 'submit_download.php') for content submission have been created.


  • Discussion Forums

    - Creating forums: Login in as an administrator (user accesslevel=2) to the admin area. Goto forum administration (admin_forums.php) and click the 'create a new forum' link. Only other users that have accesslevel of 2 or greater can be selected as Forum moderators.

    - User forums interface: 'forums.php' is used for all user forum interaction. Users can view the forums, read and post topics, and reply to topics. Users can also later edit there own topics and replies. To enable some of the message editing features the 'i_formatting.php' include page contains several Javascript functions used in the forums.


  • Downloads / File Library

    The file/document/download management features are enabled via 'downloads.php', 'submit_download.php' and 'admin_content.php'. You can use these pages to make any types of files available for download. In the application database, a 'Downloads' category type ('admin_cattypes.php') has been created so that you can define categories of downloads. These categories can be entirely different that the categories used in other sections of the application (resources/links, articles, etc..).

    Users can submit files using 'submit_download.php'. This is a 2 step process where the user submits information about the file (Title, Author, Description), a record is then created in the Content table. Next, the user selects that actual file for upload. This browser upload feature ('i_fileupload.php') doesn't work in some older Netscape and IE for the Mac browsers. The data related to each image is stored in the 'Content' database table, therefore 'admin_content.php' can be used to administer images in the downloads area. By default, when a user submits a file, the display field in the database does not get set. In order for the download to be made available, an administrator must use 'admin_content.php' to update the display field and "approve" the download. The actual files are stored in the '/library' folder when the file is uploaded via 'submit_download.php'. When 'admin_content.php' is used to delete a content record, the associated file (specified in the filename field) will be deleted from the Web server.


  • Image / Photo Gallery

    The image gallery / photo features are enabled via 'gallery.php', 'submit_gallery.php' and 'admin_content.php'. You may use these pages to display any types of Web viewable images. In the application database, a 'Gallery' category type ('admin_cattypes.php') has been created so that you can define categories of images. These "image" categories can be entirely different that the categories used in other sections of the application (resources/links, articles, etc..).

    Users can submit images using 'submit_gallery.php'. This is a 2 step process where the user submits information about the image (Title, Photo Credit, Description), a record is then created in the 'Content' database table. Next, the user selects that actual image file for upload. This browser upload feature ('i_fileupload.php') doesn't work in some older Netscape and IE for the Mac browsers. The data related to each image is stored in the Content table, therefore 'admin_content.php' can be used to administer images in the gallery. By default, when a user submits a file, the display field in the database does not get set. In order for the new image to be made visible in the gallery, an administrator must use 'admin_content.php' to update the display field and "approve" the image. The actual files are stored in the '/images/gallery' folder when the file is uploaded via 'submit_gallery.php'.


  • Calendar / Schedule

    The calendar features are enabled by the 'calendar.php' and 'upd_events.php' pages. These pages interact with the 'Events' database table. When a user submit an event for the calendar (appointment, meeting, deadline, seminar, holiday, multi-day event, etc..), the event can be made public, so that the all users can see the event, or private, so that the event will only appear on the calendar of it's creator. To make an event private, the user checks the "hide from others" checkbox when adding the event.


  • Surveys / Polling

    Using the survey manager ('adm_surveys.php'), you can create user polls and surveys with various question and answer formats. Surveys can have 1 or more questions. Each question can be multiple choice, multiple answer, short text, or long (essay) text. The 'surveys.php' page is used so that users can select a survey, and complete the questions. 'list_surveyresults.php' is used to display the results of any given survey. The results for the survey are selected by passing a 'survey_id' value to the survey results page. The survey pages interact with the SurveyResults, Surveys, SurveyQuestions and SurveyAnswers database tables.


  • Personalization (My Inbox)

    The personlized user features are enabled via the 'user_profile.php' page. With the page, users can view and modify their related fields in the user table. They can also track information they have submitted, such as articles,and forum postings.


  • Project and Task Management

    The project and task managment features are enabled by the 'pmprojects.php' and 'pmtasks.php' pages. Each project that is created can have 1 or more associated tasks. Each project task has a related name, type, description, assignee and status. If there is no assignee (assignee_user_id) for the given task, it's status will be set to 'new' (the status field in the 'pmTasks' table will be set to 0). Inversely, if the task status is set to new, the 'assignee_user_id' field in the 'pmTasks' table will be set to null. This provides a means of tracking and managing new tasks that need to be assigned to a specific user. As progress is made on a project or it's tasks, updates can be made via the 'pmProjects.php' page. A separate form on 'pmTasks.php' is used to "close" tasks when completed. This form will update the task in the pmTasks table by setting the status to "closed" (Status=2), recording the completion date (dtComplete), and the actual hours (ActualHours) required to complete the task can be entered at this time.


  • Internal Messaging

    The internal messaging features let users send messages to other users. 'user_profile.php' and 'message.php' are used to read messages, and 'compose_messages.php' is used to compose messages.


  • Newsletter Management

    The newsletter features let administrators compose, edit, and send newsletters to a subscribed user list. The 'admin_newsletters.php' page is used to administer the 'Newsletters' database table. A user accesslevel of 2 is required to access this page. The 'admin_send_newsletters.php' page is used to send a newsletter to specified or "subscribed" users. This page uses the 'i_smtp.php' include for email component (w3jmail, aspmail, aspsmartmail) functions. Use the 'i_subscribe.php' include page to subscribe/unscribe users from the mailing list. The mailing list (subscribed users) is created by 'mailing_list' field the in 'Users' table.


Support and Customer Assistance

ASPapp.com support is staffed from Monday-Friday 8:30 AM to 6:00 PM United States EST. Any requests during this time should be directed to support@aspapp.com, otherwise information and assistance can be found in the support forums at ASPapp.com. Telephone support is not provided.



TOPBack to top



Logout | My Profile | News | Training
Documents | Links | Staff List | Site Map

© 2003 by Seattle - King County WorkSource.
Staff Assistance | Terms of Use | Privacy Policy