JDTMMSM.COM Welcome to jdtmmsm.com
Make a Donation | Downloads | Contact Us | Forums | Login | Help
 
HOME
PLEASE DONATE
PROJECTS
TUTORIALS
CODE LIBRARY
FORUM
DOWNLOADS
LINKS
RESUME
CONTACT ME
LOGIN
REGISTER
Projects
 
EZsneezyCal
ezRecipe-Zee
A Little Q&A
 
Tutorials
 
Simple Banner Rotator
Basic Authentication
 
Code Library
 
Create Select From Set Field
getDirNamesAsArray()
getFileSizeFormatted()
Simple Banner Rotator
Basic Authentication
 

Project
Support
General Descussion
Download
Demo
A Little Q&A An Interactive Question and Answer Solution
SUMMARY
SCREENSHOTS
DOCUMENTATION
TODO LIST
SUGGESTION BOX
CHANGE LOG

A Little Q&A / FAQ Documentation
Introduction
What is "A Little Q&A / FAQ"
A Little Q&A is a simple question and answer solution that allows users to ask a question for the web site to be answered by the webmaster or administrator. This will serve as a Knowledge Base of question that visitors can browse and find answers to there questions.

This script is designed to easily be incorporated into a current web site with its own headers and footer or a stand alone by simple linking to the main php file.

A Little Q&A offers an easy to use admin interface that is integrated into the guest user interface. Once the admin is logged in they will see links and options that aren't otherwise visible.

Features:

  • Easy to setup and use
  • Intuitive Admin user Interface
  • Easy Search
  • Trash Can type delete and permanent delete

    Tested With:

  • PHP 4 & 5
  • MySQL 4 & 5
  • Apache, IIS Web Servers
  • How to Use
    This Q&A script was designed to make it easy for visitors to get information by either asking questions to be answered by the webmaster or admin, or search current questions for other with the same question that may have already been answered.

    Here's how it will work.

    1. The visitors of your site will have a questions about something.
    2. The visitor goes to the Q&A script.
    3. Clicks the "Ask a Question" button and fill in their question, and submits by click "Ask."
    4. At this point the question is not viewable by the public, only the admin.
    5. The webmaster or admin will login to the Q&A script (click the login link at the bottom right) and view all new question. (uncompleted questions will appear in a different color)
    6. Expand the question needing answered, and click the edit button.
    7. Here they will answer the question, select completed yes, no, or move to trash, then click the "Save" button.
    8. If the admin selected complete, the question and answer will be available for everyone to view.

    Presto! The question is now available to the public to help answer their questions.

    Installation / Configuration
    Prerequisites
    • qanda.config.PHP -- The configuratin file
    • qandaLib.inc.php -- Functions used with the script
    • qanda.php -- The include file for the script
    • index.php -- View this file to run the script
    • mysql.sql -- This file holds the query to create the database file
    • README -- Information about the script
    • DOC.HTM -- The "A Little Q&A / FAQ" Documentation
    • COPYING -- Information on copywrite information
    • INSTALL.HTM -- Information on installing the script
    • expand.gif -- the expand icon
    • collapse.gif -- the collapse icon
    Prerequisites
    To install and use "A Little Q&A / FAQ" you will need the following.
    1. A place to host it (ie. your web site)
    2. PHP 4.0 or greater
    3. MySQL 4.0 or greater
    4. Access to you MySQL database using either a command prompt or a utility like phpMyAdmin
    5. Little but some database and scripting knowledge
    Creating the Database Table
    Most hosting account nowadays have a control panel where you can manage your database tables. phpMyAdmin seems to be very popular. Follow these step to configure your database for this script.
    1. You need to use an existing database or create a new one. For help creating database refer to your host manual.
    2. Once the database is created you'll have a username and password. We will need this info later in the install.
    3. To create the QandA table you can either use the SQL Query text below or import the file mysql.sql found in the root of the script.
    CREATE TABLE IF NOT EXISTS qanda (
    ID int(10) NOT NULL auto_increment,
    DateAsked int(12) NOT NULL,
    DateAnswered int(12) default NULL,
    ipAddress varchar(15) default NULL,
    question varchar(255) NOT NULL,
    answer text,
    completed set('yes','no','deleted') NOT NULL default 'no',
    PRIMARY KEY  (ID)
    ) ENGINE=MyISAM ;
    	
    Entering the Host, Username, and Password Settings
    Now add your database settings to the script.
    1. Open the 'qanda.config.php'
    2. Part way down the page you should see the following variables:
      // DATABASE SETTINGS /////////////////////////////////////
      $QandA['host']    = "localhost"; // your database host setting. usually it will be localhost
      $QandA['user']    = "db_user";   // your database username
      $QandA['pass']    = "db_pass";   // your database password
      $QandA['dbName']  = "db_name";   // the name of the database
      
    3. Change the localhost to what every your host is (usually it will be local host)
    4. Change db_user to match your database username
    5. Change db_pass to match your database password
    6. Change db_name to match the name of your database
    Setting the Admin Password
    Now lets set your admin password. Find the following line in the qanda.config.php file and change admin to what ever you want your admin password to be.
    // ADMIN LOGIN SETTINGS ///////////////////////////////////
    $QandA['adminPassword'] = "admin";                  // this is the admin password used to manage the Q&A database
    
    Operation Modes
    This script can be ran in 2 different modes.
    • Stand alone mode
    In stand alone mode you will configure and copy the files to a folder on your web server and run them without any of your own headers or footer. No other special setup needs to occur.
    • Include mode
    In include mode you can create a page that matches your site and simply include the qanda.php file.
    Example:
    <? include("./littleQandA/qanda.php"); ?>
    
    or
    Example: 
    <? require_once("./littleQandA/qanda.php"); ?>
    
    Make sure the path between the quotes (") is pointing to the proper location.

    This script uses sessions to track if admin is logged in so sessions has to be started. So, add the line below to the very top of the page that is including the qanda.php file.

    <? session_start(); ?>
    
    This must be done before any html is output occurs.
    Other Configuration Settings
    The file qanda.config.php has other settings to change the appearance of the script. Read the comments and experiment to find the look you want. Only edit between the double quotes ("). Below are the other settings that can be changed.
    // SET TO 1 TO USE IN ADMIN MODE //////////////////////////
    $QandA['showIP']            = 1;                    // 1 = show ip address of those who ask questions | 0 = don't show ip address
    
    
    // DISPLAY SETTINGS ///////////////////////////////////////
    $QandA['basicFont']         = "font: normal 9pt Arial;";    // main font setting (example: font: normal 9pt Arial;)
    $QandA['basicBoldFont']     = "font: bold 9pt Arial;";      // bold font settings (example: font: bold 9pt Arial;)
    $QandA['titleFont']         = "font: bold 11pt Arial;";     // the title font setting (example: font: bold 11pt Arial;)
    
    
    // COLOR SETTINGS /////////////////////////////////////////
    $QandA['tableBGcolor']              = "#CCCCCC";    // the background color of the table. Only shows in the middle of wide borders (example: #CCCCCC)
    $QandA['borderColor']               = "#FFFFFF";    // the color of all borders (example: #FFFFFF)
    $QandA['expandCellColor']           = "#CCCCCC";    // the background color of the cell with the expand/collapse or + and - images (example: #CCCCCC)
    $QandA['titleBGcolor']              = "#CCCCCC";    // the background color of the title cell. (ex Q&A) (example: #CCCCCC)
    $QandA['hilightBGcolor']            = "#FFFFCC";    // the background color of the hilight cells (ex the ask question cell) (example: #FFFFCC)
    $QandA['expandNormalBGcolor']       = "#FFFFFF";    // the background color of the normal expanded question cell (example: #FFFFFF)
    $QandA['nonExpandNormalBGcolor']    = "#FFFFFF";    // the background color of the non expanded question cell (example: #FFFFFF)
    $QandA['deletedBGcolor']            = "#999999";    // the background color of the deleted question both expanded and collapsed (example: #999999)
    $QandA['notAnsweredBGcolor']        = "#EBECFA";    // the background color of the non answered question both expanded and collapsed (example: #EBECFA)
    $QandA['titleFontColor']            = "#333333";    // the color of the title text (example: #333333)
    $QandA['questionFontColor']         = "#333333";    // the color fo the question and answer text (example: #333333)
    
    
    // WIDTH SETTINGS /////////////////////////////////////////
    $QandA['widthOne']                  = 15;           // width of the left column (with the expand and collapse icons)
    $QandA['widthTwo']                  = 600;          // width of the question and answer column
    
    
    // SITE INFORMATION ///////////////////////////////////////
    $QandA['siteName'] = "A Little Q and A";    // the name of the Q and A Site
    
    Guest Features
    Asking a Question
    • Click the "Ask a Question" button.
    • Enter your question. Must 255 characters or less
    • Click the "Ask" button
    • Once the admin answers (completes) the question it will become viewable.
    Searching for Questions
    • Use the search field at the top of the script.
    • Type in your search word or words.
    • Click the "Find" button.
    • The script will search the question and answers for word you searched for and display them below hiding all other questions.
    • After viewing these question click the "Clear" button to display all questions again.
    Admin Features
    Complete Questions
    1. Non answered questions will display in a different color (default is light grey)
    2. Expand the question.
    3. Click the edit button to answer the question
    4. Enter the answer text and click the select "Yes." This will make the question visible to all. Selecting no will hide from all and "move to trash" will to just that.
    5. Click the "Save" button.
    6. You can also click the "mark completed" button to make it visible to all.
    Editing Questions
    1. Login as Admin
    2. Expand the question to be edited.
    3. Click the "Edit" button.
    4. Make the changes and click "Save."
    Show Deleted Questions
    Questions can be deleted or (moved to the trash) but not permanently deleted. When logged in as Admin you'll see the link "show deleted" or "hide deleted." When show deleted is clicked the deleted questions will show in a different color (the default is dark grey). Click "hide deleted" to hide them again.
    Empty Trash
    When logged in as Admin you'll see the link "Empty Trash" at the top right of the script. Clicking this will permanently delete any questions that have been moved to the trash. They can not be retrieved later. Questions can also be permanently deleted by expanding the question and clicking the "preeminently delete" button.

    Support / Contacts / Links
     
    Home   +    Please Donate   +    Projects   +    Tutorials   +    Code Library   +    Forum   +    Downloads   +    Contact Us
    © Copyright 2007-2008 Dave Torres. All rights reserved.