CyberGL
search in CyberGL only
1 Visitor, 0 Member logged in
Signup Activation Login
Newer version of phpFAQ is available,
released on 15 August 2002, has been downloaded for 1270 times.
Please visit phpFAQ ver 0.0.2 to get more information.
CyberGL phpFAQ ver 0.0.1

phpFAQ ver 0.0.1 Documentation

General Information

Please read the INSTALL file for installation instructions.

After completing the installation you'll be greeted with welcome page. There is menu on left side bar with 4 links, they are "Home", "Guide" (you reading it now), "View" and "Tools". "Home" is the welcome greeting page, "View" is a page to view the FAQ list.

Inserting new FAQ's item:

Go to "Tools" page, there is a list of FAQ item (if any) and a form consist of 4 form-field which describe below.

  1. Order => Determines order of the item.
  2. Visible => Visibility mode of the item, check it to make the item shown.
  3. Question => The FAQ question.
  4. Answer => The FAQ answer.

After full filling the form click "Add" button and you can see there new item listed with links to edit and del.

Editing and Deleting FAQ's item:

Click the link "edit" to edit and "del" to remove the item from the list. For deletion you will be confirm before the deletion proceed.

Configuration

Database configuration

$db_user is the username of your database.
$db_pass is the password of your database.
$db_name is the name of the database where application can find its tables.
$db_host is the hostname of the MySQL database.

Tables configuration

$tbl_faq_data is the name of the FAQ data database table

Path configuration

$faq_dirpath is the directory path where you installed the application
$faq_reqpath is the directory path where application can find its required modules
$faq_incpath is the directory path where application can find its include files

URL configuration

$faq_baseurl is base URL where you can browse the application
$faq_imageurl is the URL where images can be browse

Answer configuration

$faq_max_char is determines how many character are allowed for the FAQ answer field, the default is 512 char.

Integrating the phpFAQ into your code

To integrate FAQ into your code, you have to include faq_config.php3 and faq.php3 into your script. These files are in your phpFAQ-require-installation-directory. phpFAQ provide two functions to get FAQ's TOC and FAQ's detail.

array faq_toc( );

To display FAQ's Table Of Content ( TOC ) you can call this function.
This function will return an associative-array with 3 key-elements which describe below.

  1. faq_id => ID of the FAQ's item.
  2. question => Question of FAQ's item.
  3. toc => a ready to use FAQ's TOC, it's contain a link to proper FAQ's item.

This function returns sequential FAQ's TOC in every call of this function.
You can simply call this function for quick view like below:

<ol>
<?
  while ($faq=faq_toc()) {
?>
    <li> <?echo $faq[toc];?></li>
<?}?>
</ol>

Or if you want different layout you can design your own TOC by using the 1st and 2nd array element. For example take a look at code snippet below:

<ol>
<?
  while ($faq=faq_toc()) {
?>
    <li> <a href="#<?echo $faq[faq_id];?>">
          <font face="Verdana"><?
echo $faq[question];?></font>
          </a>
    </li>
<?}?>
</ol>

array read_faq( );

To display FAQ's item you can call this function.
This function return an associative-array with 4 key-elements which describe below.

  1. faq_id => ID of the FAQ's item.
  2. question => Question of FAQ's item.
  3. answer => Answer of FAQ's item.
  4. faq => a ready to use FAQ's item, it's contain a complete question and answer of FAQ's item.

This function returns sequential FAQ's item in every call of this function.
You can simply call this function for quick view like below: 

<?
  while ($faq=read_faq()) {
?> <hr>
    <?echo $faq[faq];?>
<?}?>

Or if you want different layout you can design your own FAQ by using the 1st, 2nd and the 3rd array element. For example take a look at code snippet below:

<table cellpadding=1 cellspacing=1 border=0>
<?
  while ($faq=
read_faq()
) {
?>
    <tr>
      <td ><hr>&nbsp;</td>
    </tr>
    <tr>
      <td><a name="
<?echo $faq[faq_id]?>">
            <font face=Verdana><?echo $faq[question];?></font>
             </a><br>&nbsp;
     </td>
    </tr>
    <tr>
      <td><font=Verdana>

            <?echo $faq[answer];?>
            </font><br>&nbsp;
      </td>
    </tr>
<?}?>
</table>

Remember before you calling those two function you must include these two files at the top of your script page.

<?
  include("require/faq_config.php3");
  include("require/faq.php3");
?>
Login Form
Login:
Password:
Lost Password?