============================================================================================================================
-ACCOUNT VERIFICATION 1.0
-BY DANE SMITH AND TRISTRAN
-Parts of code by Jonathon of JDMnet.org
-Install Guide

-ACCOUNT VERIFICATION 2.1
-BY WormHole and GuldantheWarlock @ XMB Garage

-ACCOUNT VERIFICATION 3.0
-BY: WormHole @ XMB Garage
============================================================================================================================
DESCRIPTION:
This modification will add a link to the Welcome area on the index page for users to verify their account.
This modification adds a link in the Admin Panel to view the verified accounts and has a reset button to reset the verifications.
============================================================================================================================
Changes Implemented: Now when the button to verify your account is clicked the verify link disappears
until the admin resets the verifications. The admin panel has been integrated with the board's admin
panel. And the reset verification feature has been added into the admin view thereby getting rid of
the extra link in the main admin panel.

Changes Implemented for v3.0: verify.php has been integrated into tools.php. verify_admin.php has been
integrated into cp.php. verified template has been removed. On/Off switch added to admin panel / Settings.
============================================================================================================================
COMPATIBILITY: XMB 1.9.8 Engage Final SP3
Code Updated by: WormHole @ XMB Garage

     2004-2009 XMB Garage
    http://www.xmbgarage.com

    Last Updated On: 07-28-09
    Last Updated By: WormHole (aka James Williams)

    All copyright information must remain visible and cannot be removed.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
============================================================================================================================
Notes: BACKUP ALL OF YOUR PHP FILES, TEMPLATES AND DATABASE BEFORE INSTALLING THIS MODIFICATION.
============================================================================================================================

============================================================================================================================
Step 1.
=======
==============================
Go To Admin Panel --> Insert Raw SQL
==============================
===============================
Add Code To Textarea and Click Submit
===============================

ALTER TABLE $table_members ADD verified char(3) NOT NULL default 'No';
ALTER TABLE `$table_settings` ADD `acctverstatus` set('on','off') NOT NULL default 'on';

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

// Account Verification Mod Begin
$lang['acctverusername'] = "Username:";
$lang['acctververified'] = "Verified?";
$lang['acctvernone'] = "No User Accounts have been verified!";
$lang['acctverify'] = "Verification Stats";
$lang['acctverreset'] = "Reset Verifications";
$lang['acctverreset2'] = "Verifications Reset";
$lang['acctveruser'] = "User Verification";
$lang['acctverified'] = "Account Verified: ";
$lang['acctver'] = "Verify Account";
$lang['acctverstatus'] = "Account Verification Status:";
$lang['acctversuccess'] = "Thank You! Your Account Has Been Verified.";
$lang['acctvertext'] = "Please verify your user account to let the Administrator know that this is an active account.<br />Just press the button below and your account will be verified.";
// Account Verification Mod End

============================================================================================================================
=======
Step 3:
=======
========================
Edit File: /include/admin.inc.php
========================
======
Find:
======

    &raquo;&nbsp;<a href="tools.php?action=logsdump"><?php echo $lang['textlogsdump']?></a><br />

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

    <!-- Account Verification Mod Begin -->
    &raquo;&nbsp;<a href="verify_admin.php"><?php echo $lang['acctverreset2']?></a><br />
    <!-- Account Verification Mod End -->

============================================================================================================================
=======
Step 4:
=======
=======================
Edit File: include/functions.php
=======================
======
Find:
======

$namesarray = array_unique(array_merge(func_get_args(), array(

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

$namesarray = array_unique(array_merge(func_get_args(), array('confirm_verification',

============================================================================================================================
=======
Step: 5:
=======
==============
Edit File: cp.php
==============
======
Find:
======

        $onlinetoday_statuson = $onlinetoday_statusoff = '';
        settingHTML('onlinetoday_status', $onlinetoday_statuson, $onlinetoday_statusoff);

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

        // Account Verification Mod Begin
        $acctverstatuson = $acctverstatusoff = '';
        settingHTML('acctverstatus', $acctverstatuson, $acctverstatusoff);
        // Account Verification Mod End

======
Find:
======

        printsetting2($lang['pruneusers'], 'pruneusersnew', ((int)$SETTINGS['pruneusers']), 3);

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

        // Account Verification Mod Begin
        printsetting1($lang['acctverstatus'], 'acctverstatusnew', $acctverstatuson, $acctverstatusoff);
        // Account Verification Mod End

==========================
======
Find:
======

        $onlinetoday_statusnew = formOnOff('onlinetoday_statusnew');

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

        // Account Verification Mod Begin
        $accverstatusnew = formOnOff('acctverstatusnew');
        // Account Verification Mod End

======
Find:
======

            onlinetoday_status='$onlinetoday_statusnew'

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

            onlinetoday_status='$onlinetoday_statusnew',
            acctverstatus='$acctverstatusnew'

======
Find:
======

if ($action == "search") {

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

// Account Verification Mod Begin
if ($action == 'verifyreset') {
    $query = $db->query("SELECT username, verified FROM ".X_PREFIX."members WHERE verified='Yes' ORDER BY uid ASC");
    ?>
    <form method="post" action="tools.php?action=verifyreset">
    <table cellspacing="0" cellpadding="0" border="0" width="550" align="center">
    <tr>
    <td bgcolor="<?php echo $THEME['bordercolor']?>">
    <table border="0" cellspacing="<?php echo $THEME['borderwidth']?>" cellpadding="<?php echo $THEME['tablespace']?>" width="100%">
    <tr class="category">
    <td colspan="2"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['acctverify']?></font></strong></td>
    </tr>
    <tr class="ctrtablerow">
    <td bgcolor="<?php echo $THEME['altbg1']?>"><strong><?php echo $lang['acctverusername']?></strong></td>
    <td bgcolor="<?php echo $THEME['altbg1']?>"><strong><?php echo $lang['acctververified']?></strong></td>
    </tr>
    <?
    if ($db->num_rows($query) != 0) {
        while ($ver = $db->fetch_array($query)) {
        ?>
        <tr class="ctrtablerow">
        <td bgcolor="<?php echo $THEME['altbg2']?>"><?php echo $ver['username']?></td>
        <td bgcolor="<?php echo $THEME['altbg2']?>"><?php echo $ver['verified']?></td>
        </tr>
        <?php
        }
    } else {
        ?>
        <tr class="ctrtablerow">
        <td colspan="2" align="center" bgcolor="<?php echo $THEME['altbg2']?>"><?php echo $lang['acctvernone']?></td>
        </tr>
        <?php
    }
    ?>
    <tr class="ctrtablerow">
    <td colspan="2" bgcolor="<?php echo $THEME['altbg1']?>"><input class="submit" type="submit" name="resetverify" value="<?php echo $lang['acctverreset']?>" /></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <?php
}
// Account Verification Mod End

============================================================================================================================
=======
Step 6:
=======
================
Edit File: index.php
================
======
Find:
======

        eval('$welcome = "'.template('index_welcome_member').'";');

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

        // Account Verification Mod Begin
        $verifiedlink = '';
        if ($SETTINGS['acctverstatus'] == 'on') {
            if ($self['verified'] == 'No') {
                $verifiedlink = '<td width="25%"><a href="verify.php"><strong>'.$lang['acctver'].'</strong></a></td>';
            } else {
                $verifiedlink = '';
            }
        }
        // // Account Verification Mod End

============================================================================================================================
=======
Step 7:
=======
==================
Edit File: member.php
==================
=============
Find (2 Times):
=============

) VALUES ('$username',

===================
Replace With (2 Times):
===================

, verified) VALUES ('$username',

=====================================
Add To End Of Both Above Statements Before )");
=====================================

, 'Yes'

============================================================================================================================
=======
Step 8:
===============
Edit File: tools.php
===============
======
Find:
======

    case 'updatemoods':

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

    case 'verify':
        if (noSubmit('confirmsubmit')) {
            if ($xmbuser) {
                $query = $db->query("SELECT * FROM ".X_PREFIX."members WHERE username='$xmbuser'");
                $grab = $db->fetch_array($query);
                $verified = $grab['verified'];
            }
            eval('$form = "'.template('confirm_verification').'";');
            $form = stripslashes($form);
            echo $form;
        } else {
            echo "<center><span class=\"12px \">$lang[acctversuccess]</span></center>";
            $db->query("UPDATE ".X_PREFIX."members SET verified='Yes' WHERE username='".$xmbuser."'");
            redirect("index.php", 1.5, X_REDIRECT_JS);
         }
         break;

    // Account Verification Mod Begin
    case 'verifyreset':
        $db->query("UPDATE ".X_PREFIX."members SET verified='No'");
        nav($lang['acctverreset']);
        echo '<tr bgcolor="'.$THEME['altbg2'].'" class="tablerow"><td align="center">'.$lang['tool_completed'].' '.$lang['acctverreset2'].'</td></tr></table></table>';
        end_time();
        break;
    // Account Verification Mod End

============================================================================================================================
=======
Step 9:
=======
==========================
Go To Admin Panel --> Templates
==========================
===============================
Create New Template: confirm_verification
===============================
======================
Add Code and Click Submit:
======================

<form method="post" action="tools.php?action=verify">
<table cellspacing="0" cellpadding="0" border="0" width="$THEME[tablewidth]" align="center">
<tr>
<td bgcolor="$THEME[bordercolor]">
<table border="0" cellspacing="$THEME[borderwidth]" cellpadding="$THEME[tablespace]" width="100%">
<tr class="header">
<td colspan="2">$lang[acctveruser]</td>
</tr>
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" valign="top">$lang[status]</td>
<td bgcolor="$THEME[altbg2]">$lang[acctverified]<strong><blink><font color="#FF0000">$verified</font></blink></strong></td>
</tr>
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[acctveruser]</td>
<td bgcolor="$THEME[altbg2]">$lang[acctvertext]</td></tr>
</table>
</td>
</tr>
</table>
<br />
<center><input type="submit" name="confirmsubmit" value="$lang[acctver]" /></center>
</form>

============================================================================================================================
========
Step 10:
========
==========================
Go To Admin Panel --> Templates
==========================
==============================
Edit Template: index_welcome_member
==============================
======
Find:
======

<td colspan="3">

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

<td colspan="4">

======
Find:
======

<tr class="ctrtablerow" bgcolor="$altbg2">
<td width="33%"><a href="memcp.php"><strong>$lang[textusercp]</strong></a></td>
<td width="33%"><a href="#" onclick="Popup('u2u.php','Window', 700, 450);"><strong>$lang[textu2umessenger]</strong></a></td>
<td width="33%"><a href="#" onclick="Popup('buddy.php', 'Window', 450, 400);"><strong>$lang[launchbuddylist]</strong></a></td>
</tr>

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

<tr class="ctrtablerow" bgcolor="$THEME[altbg2]">
<td width="25%"><a href="memcp.php"><strong>$lang[textusercp]</strong></a></td>
<td width="25%"><a href="#" onclick="Popup('u2u.php','Window', 700, 450);"><strong>$lang[textu2umessenger]</strong></a></td>
<td width="25%"><a href="#" onclick="Popup('buddy.php', 'Window', 450, 400);"><strong>$lang[launchbuddylist]</strong></a></td>
$verifiedlink
</tr>

==========================

UPLOAD ALL EDITED FILES (include/admin.inc.php, include/functions.php, lang/English.lang.php, cp.php, member.php, tools.php)
============================================================================================================================
Enjoy!