============================================================================================================================
Modification Name: FAQ & Rules Management System

Version: 1.4

Description: This modification will replace your current faq.php with a new one. The FAQ's will be placed in your database so you can handle them easily, instead of them being in templates and the language file.
Because the rules and the faq are in one file, I decided to spice up the rules as well.
Some features are:
- This gives you the opportunity to add/edit as many FAQ's as you please.
- You can decide per Question/Answer if HTML / BBCode / Smilies / IMG code should be enabled or disabled.
- The old links "faq.php?page=usermaint" / "faq.php?page=using" / "faq.php?page=messages" / "faq.php?page=misc" / "faq.php?page=forumrules" still work.
- The old links like "faq.php?page=usermaint#1" will not work. They will, but with different #numbers.
- You can have the smilie and rank listing show up at any Question/Answer you want want.
- You can now decide if you want HTML / BBCode / Smilies / IMG code enabled or disabled in the Board Rules.
- You can set it so that every member has to re-agree to the rules. This way, every member will be notified of any major rule changes, and they can't complain about it, as they can't surf the board if they don't agree first.

Compatibility: XMB 1.9.5 SP1

Code Designed By: FunForum

License Note: This modification is released under the GPL License v3. A copy is provided with this software package.

Notes:
- For your own safety, backup all effected files & templates before proceeding with this installation.
- Keep all names and copyrights in their place
- Do not use this hack if you have more then one language available to your members, as this Management System, only manages one language (which you can determine yourself).
- 2004 / 09 / 26; Adjusted the coding. Activated DEBUG mode and worked out all "issues".
- 2004 / 10 / 04; Fixed the selection of checkboxes/pulldownmenu. "Board Rules" must be turned on if the "All members must re-agree to the rules" wants to work.
- 2004 / 10 / 28; Minor adjustments to meet XMB 1.9.1 Final coding. Added cosmetic fixes by John.
- 2006 / 04 / 09; Minor adjustments to meet XMB 1.9.5 Final coding by GuldantheWarlock.
============================================================================================================================
=======
Step 1:
=======
===================================
Go To Administration Panel --> Insert Raw SQL
===================================

Use the 'Browse' button to locate the SQL.txt file that was in the zip file with this installation file.
Once you have found the file then select it and submit changes.

============================================================================================================================
=======
Step 2:
=======
=======================
Edit File: lang/English.lang.php
=======================
=============================
Add Code To End Of File ABOVE  ?>
=============================

// FAQ-Rules Management System Mod Begin
$lang['faq_A'] = "FAQ's updated successfully!";
$lang['faq_B'] = "Add New FAQ:";
$lang['faq_C'] = "Question:";
$lang['faq_D'] = "Answer:";
$lang['faq_E'] = "FAQ Options:";
$lang['faq_F'] = "Edit FAQ's";
$lang['faq_G'] = "New FAQ Category";
$lang['faq_H'] = "New FAQ Question";
$lang['faq_I'] = "Edit Current FAQ's";
$lang['faq_J'] = "New FAQ Solution";
$lang['faq_K'] = "Enter A New FAQ";
$lang['faq_L'] = "New FAQ Sub-Question";
$lang['faq_M'] = "The FAQ Sub-Question Solution";
$lang['faq_N'] = "Admin Area";
$lang['faq_O'] = "Here you can maintain your FAQ's.";
$lang['faq_P'] = "Category Name:";
$lang['faq_Q'] = "Category Code:";
$lang['faq_R'] = "The \"Category Code\"<br />The FAQ comes standard with 4 groups. And one can use links like faq.php?page=misc to go to a section.<br />To not lose that feature, you can tell here what group belongs to which one of the four \"codes\".<br />Be sure to use each \"code\" only once.";
$lang['faq_S'] = "Display:";
$lang['faq_T'] = "If you agree to <strong>all</strong> terms, hit the \"I Agree\" button below to continue...<br /><br />";
$lang['rules_A'] = "In this part of the \"FAQ Management System\" you can set your Board Rules, and decide if you want HTML, BBCode, Smilies and the IMG Code enabled/disabled.<br />Also, you can set if every member MUST re-agree to the rules after you changed/updated them.";
$lang['rules_B'] = "Rules settings updated successfully!";
$lang['rules_C'] = "All members must re-agree to the rules:";
$lang['rules_D'] = "Admin Message:<br /><br /><em>Will be shown above the rules, and only in that place when the checkbox above is checked.</em>";
$lang['rules_E'] = "You have accepted the rules. You will now be redirected to the page you were going to.";
// FAQ-Rules Management System Mod End

============================================================================================================================
=======
Step 3:
=======
=================
Edit File: member.php
=================
==========
Find Code:
==========

) VALUES ('', '$username'

================
Replace Code With:
================

, readrules) VALUES ('', '$username'

================================
Find Code (At The End Of The Same Line)
================================

)");

================
Replace Code With:
================

, 'no')");

============================================================================================================================
=======
Step 4:
=======
=================
Edit File: header.php
=================
==========
Find Code:
==========

,'favorites'

================
Replace Code With:
================

,'faq','favorites'

==========
Find Code:
==========

// if the user is registered, check for new u2u's

===============
Add Code Above:
===============

// FAQ-Rules Management System Mod Begin
// Check if the user has read the new rules...
if (X_MEMBER && $SETTINGS['bbrules'] == 'on' && $self['readrules'] == 'yes') {
    if (!strstr($url, "faq.php?page=agreerules")) {
        redirect('faq.php?page=agreerules', 0); 
        exit;
    }
}
// FAQ-Rules Management System Mod End

============================================================================================================================
=======
Step 5:
=======
==============
Edit File: cp.php
==============
==================
Find Code and Delete:
==================

        $ruleson = $rulesoff = '';
        if ($SETTINGS['bbrules'] == "on") {
            $ruleson = $selHTML;
        } else {
            $rulesoff = $selHTML;
        }

==================
Find Code and Delete:
==================

        $SETTINGS['bbrulestxt'] = stripslashes($SETTINGS['bbrulestxt']);

==================
Find Code and Delete:
==================

        printsetting1($lang['textbbrules'], 'bbrulesnew', $ruleson, $rulesoff);

==================
Find Code and Delete:
==================

        printsetting4($lang['textbbrulestxt'], 'bbrulestxtnew', $SETTINGS['bbrulestxt'], 5, 50);

==================
Find Code and Delete:
==================

        $bbrulestxtnew = addslashes($bbrulestxtnew);

==================
Find Code and Delete:
==================

, bbrules='$bbrulesnew', bbrulestxt='$bbrulestxtnew'

============================================================================================================================
=======
Step 6:
=======

Upload the file 'faq.php' that came in this zip file.
============================================================================================================================
Enjoy!