============================================================================================================================
Modification Title: Quiz System

Version: 1.0

Author: Combined by thepowerfromport.com using the scripts below.
            Original script by [widgetmonkey.com] ( http://www.widgetmonkey.com/detail.php?id=6 )
            [XMBmods] Custom Page Mod By: John Briggs ( http://xmbmods.com )

On and Off status added by Nick Pledge of XMBXtreme

Updated for 1.9.5 by: WormHole @ XMB Garage
Added php echoes where needed.
Converted text to language variables.
Renamed files to keep them together in the directory.
Converted on/off switch to be more php compliant.
Made it so when questions are deleted there are no breaks in the numbering of the questions.

Last Updated: 04/28/10

Description: This modification will add a quiz system to your XMB Board.

Supported Version: XMB 1.9.5 SP1

Installation Note: Before adding this modification to your forum, you should back up all files related to this modification.

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

Author Note:
You downloaded this modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.
============================================================================================================================
=======
Step 1:
=======
====================================
Go To Administration Panel --> Insert Raw SQL
====================================

Upload provided file named "SQL.txt" & click "Submit Changes" button.

============================================================================================================================
=======
Step 2:
=======
==============
Edit File: cp.php
=============
==========
Find Code:
==========

        $avchecked[0] = $avchecked[1] = $avchecked[2] = false;
        if (!empty($avatarlist)) {
            $avchecked[1] = true;
        } elseif (!empty($avataroff)) {
            $avchecked[2] = true;
        } else {
            $avchecked[0] = true;
        }

===============
Add Code Below:
===============

        // Quiz System Mod Begin
        $quizstatus_on = $quizstatus_off = '';
        switch ($SETTINGS['quizstatus']) {
            case 'on':
                $quizstatus_on = $selHTML;
                break;
            default:
                $quizstatus_off = $selHTML;
                break;
        }
        // Quiz System Mod End

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

        printsetting1($lang['reportpoststatus'], 'reportpostnew', $reportposton, $reportpostoff);

===============
Add Code Below:
===============

        // Quiz System Mod Begin
        printsetting1($lang['quizstatus'], 'quizstatusnew', $quizstatus_on, $quizstatus_off);
        // Quiz System Mod End

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

        $resetSigNew = ($resetSigNew == 'on') ? 'on' : 'off';

===============
Add Code Below:
===============

        // Quiz System Mod Begin
        $quizstatusnew = ($quizstatusnew == 'on') ? 'on' : 'off';
        // Quiz System Mod End

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

$db->query("UPDATE $table_settings SET langfile='$langfilenew'

==============================
Find Code At End Of Above Statement:
==============================

");

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

, quizstatus='$quizstatusnew'");

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

,'posts','ranks'

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

,'posts','quiz','ranks'

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

    // 'Forum Rules'-link
    if ( $SETTINGS['bbrules'] == "on") {
        $links[] = "<img src=\"$imgdir/bbrules.gif\" alt=\"$lang[altrules]\" border=\"0\" /> <a href=\"faq.php?page=forumrules\"><font class=\"navtd\">$lang[textbbrules]</font></a>";
    }

===============
Add Code Below:
===============

    // Quiz-link
    if ($SETTINGS['quizstatus'] == 'on') {
        $links[] = "<img src=\"./$imgdir/quiz.gif\" alt=\"$lang[quiz]\" title=\"$lang[quiz]\" border=\"0\" /> <a href=\"./quiz.php\"><font class=\"navtd\">$lang[quiz]</font></a>";
    }

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

    } elseif (false !== strpos($url, "/topicadmin.php")) {
        $location = $lang['onlinetopicadmin'];

===============
Add Code Below:
===============

    // Quiz System Mod Begin
    } elseif (false !== strpos($url, "/quizedit.php")) {
        $location = $lang['quizadministration'];
    } elseif (false !== strpos($url, "/quizeditlist.php")) {
        $location = $lang['quizadministration'];
    } elseif (false !== strpos($url, "/quizinsert.php")) {
        $location = $lang['quizadministration'];
    // Quiz System Mod End

============================================================================================================================
=======
Step 5:
=======
===========================
Edit File: /include/admin.user.inc.php
===========================
======================
Find Code ( At End Of File):
======================

    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>

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

    <!-- Quiz System Mod Begin -->
    &raquo;&nbsp;<a href="quizlistedit.php"><?php echo $lang['quizedit']?></a><br />
    <!-- Quiz System Mod End -->

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

// Quiz System Mod Begin
$lang['quiz'] = "$bbname Quiz";
$lang['quizaddeditdelete'] = 'Add, Edit or Delete Questions';
$lang['quizaddnewquestion'] = 'Add a new question to the quiz';
$lang['quizaddquestion'] = 'Quiz Editor';
$lang['quizadministration'] = 'Using The Quiz Editor';
$lang['quizadminpanel'] = 'Quiz Admin Panel';
$lang['quizanswer'] = 'Answer:';
$lang['quizanswered'] = ' you answered ';
$lang['quizansweridentical'] = '<strong>Answer</strong> (must be identical to correct option):';
$lang['quizansweris'] = ' The answer is ';
$lang['quizanswers'] = 'Here are the answers:';
$lang['quizcongratulations'] = 'Congratulations! You got every question right!';
$lang['quizquestiondelete'] = 'Delete Questions';
$lang['quizedit'] = 'Quiz Editor';
$lang['quizeditdelete'] = 'Edit or Delete Questions';
$lang['quizfulltable'] = 'See the full Quiz table';
$lang['quizlist'] = 'Quiz - List';
$lang['quiznew'] = 'Quiz - Add Question';
$lang['quizno'] = 'No.';
$lang['quiznoanswer'] = ' you didn\'t select an answer, The answer is ';
$lang['quiznotbad'] = 'Not bad - but there were a few that stumped you!';
$lang['quiznotbest'] = 'Oh dear. Not the best score, but don\'t worry, it\'s only a quiz.';
$lang['quizopt1'] = 'Option 1:';
$lang['quizopt2'] = 'Option 2:';
$lang['quizopt3'] = 'Option 3:';
$lang['quizoutof'] = ' out of ';
$lang['quizquestion'] = 'Question:';
$lang['quizquestionadded'] = 'Question added to quiz.';
$lang['quizquestionsanswers'] = 'Questions & Answers';
$lang['quizquestiondeleted'] = 'Question deleted';
$lang['quizquestionedit'] = 'Edit Question';
$lang['quizresults'] = 'See how you did';
$lang['quizreturnlist'] = 'Back to list of quiz questions';
$lang['quizscored'] = 'You scored ';
$lang['quizstatus'] = 'Quiz Status:';
$lang['quiztitle'] = '$bbname - Quiz';
$lang['quizupdateinfo'] = 'Update Information';
$lang['quizupdatedsuccess'] = 'The quiz has been succesfully updated.';
$lang['quizviewingquiz'] = 'View the Quiz';
$lang['quizwelldone'] = 'Well done! You certainly know your stuff.';
$lang['quizwhichcorrect'] = ', which is correct.';
// Quiz System Mod End

============================================================================================================================
=======
Step 7:
=======
=======================================
Upload files listed below to your forum's root directory
=======================================

quiz.php
quizdelete.php
quizedit.php
quizeditlist.php
quizinfo.php
quizinsert.php

============================================================================================================================
=======
Step 8:
=======

Upload the image quiz.gif to all theme folders.

============================================================================================================================
Enjoy!