============================================================================================================================
Modification Name: Avatar Gallery

Version: 1.0

Author: John Briggs

Contributors: FunForum

Description:
This modification will provide a avatar gallery to your board which is configurable via the admin panel.
This modification will provide the ability for members to select a avatar from a folder of provided avatar images.

Copyright:  2010 John Briggs. All Rights Reserved.

Compatability: XMB 1.9.5 SP1

Install 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:
==========

        $avataron = $avataroff = $avatarlist = '';
        if ($SETTINGS['avastatus'] == "on") {
            $avataron = $selHTML;
        } elseif ($avastatus == "list") {
            $avatarlist = $selHTML;
        } else {
            $avataroff = $selHTML;
        }

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

        // Avatar Gallery Mod Begin
        $avatargalon = $avatargaloff = '';
        switch ($SETTINGS['avatargal']) {
            case 'on':
                $avatargalon = $selHTML;
                break;
            default:
                $avatargaloff = $selHTML;
                break;
        }
        // Avatar Gallery Mod End

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

        printsetting2($lang['textmpp'], "memberperpagenew", $SETTINGS['memberperpage'], 3);

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

        // Avatar Gallery Mod Begin
        printsetting2($lang['avatarsperpage'], 'avatargalppnew', $SETTINGS['avatargalpp'], 2);
        printsetting2($lang['avatarsperrow'], 'avatargalprnew', $SETTINGS['avatargalpr'], 2);
        // Avatar Gallery Mod End

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

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

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

        // Avatar Gallery Mod Begin
        printsetting1($lang['avatargalstatus'], 'avatargalnew', $avatargalon, $avatargaloff);
        // Avatar Gallery Mod End

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

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

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

        // Avatar Gallery Mod Begin
        $avatargalppnew = (int) $avatargalppnew;
        $avatargalprnew = (int) $avatargalprnew;
        $avatargalnew = ($avatargalnew == 'on') ? 'on' : 'off';
        // Avatar Gallery Mod End

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

$db->query("UPDATE $table_settings SET

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

");

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

, avatargal='$avatargalnew', avatargalpp='$avatargalppnew', avatargalpr='$avatargalprnew'");

============================================================================================================================
=======
Step 3:
=======
================
Edit File: header.php
================
==========
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:
===============

// Avatar Gallery-Link
if (X_MEMBER && $SETTINGS['avatargal'] == 'on') {
    $links[] = '<img src="'.$imgdir.'/avatars.gif" alt="'.$lang['avatars'].'"  border="0" /> <a href="avatars.php"><font class="navtd">'.$lang['avatars'].'</font></a>';
}

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

    global $bordercolor, $tablewidth, $borderwidth, $tablespacing, $altbg1, $altbg2, $lang;

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

    // Avatar Gallery Mod Begin
    global $SETTINGS;
    // Avatar Gallery Mod End

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

    if ($current == "favorites") {
        echo "<td bgcolor=\"$altbg1\" width=\"15%\" class=\"ctrtablerow\">" .$lang['textfavorites']. "</td>";
    } else {
        echo "<td bgcolor=\"$altbg2\" width=\"15%\" class=\"ctrtablerow\"><a href=\"memcp.php?action=favorites\">" .$lang['textfavorites']. "</a></td>";
    }

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

    // Avatar Gallery Mod Begin
    if ($SETTINGS['avatargal'] == 'on') {
        echo '<td bgcolor="'.$altbg2.'" width="10%" class="ctrtablerow"><a href="avatars.php">'.$lang['avatars'].'</a></td>';
    }
    // Avatar Gallery Mod End

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

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

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

    // Avatar Gallery Mod Begin
    } elseif (false !== strpos($url, '/avatars.php')) {
        $location = $lang['onlineavatars'];
    // Avatar Gallery Mod End

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

// Avatar Gallery Mod Begin
$lang['avatars'] = "Avatars";
$lang['avatargallery'] = "Avatar Gallery";
$lang['avatargalstatus'] = "Avatar Gallery Status:";
$lang['avatarsperpage'] = "Avatars Per Page:";
$lang['avatarsperrow'] = "Avatars Per Row:";
$lang['onlineavatars'] = "Viewing Avatar Gallery";
$lang['updateavatar'] = "Update Avatar";
$lang['avatarnologin'] = "You must be logged in or registered.";
$lang['folderdoesnotexist'] = "The specified folder does not exist.";
$lang['avatarfeaturedisabled'] = "The Avatar Gallery has been disabled.";
$lang['avatarupdated'] = "Your avatar has been updated successfully.";
$lang['noavatarselected'] = "You must first choose an avatar.";
$lang['noavatarsinfolder'] = "There are no avatars to display in this folder.";
$lang['currentavatarmsg'] = "The image below is your current avatar.";
$lang['welcomeavatarmsg']= "Welcome to $SETTINGS[bbname] - Avatar Gallery!";
$lang['navigateavatarmsg'] = "By navigating through the folders on the left, you can choose a new avatar by browsing our gallery and making your selection.";
$lang['avatarnologin'] = "Sorry! But you must be registered or logged in to use the Avatar Gallery.";
// Avatar Gallery Mod End

============================================================================================================================
=======
Step 7:
=======
===============================
Go To Administration Panel --> Templates
===============================
========================
Create New Template: avatargal
========================
========================
Add Code and Submit Changes:
========================

<form method="post" action="avatars.php">
<table cellspacing="0" cellpadding="0"  border="0" width="$tablewidth" align="center">
<tr>
<td bgcolor="$bordercolor">
<table border="0" cellspacing="$borderwidth" cellpadding="$tablespace" width="100%">
<tr class="category">
<td colspan="2"><font color="$cattext"><strong>$lang[avatargallery]</strong></font></td>
</tr>
$multipage
<tr class="tablerow">
<td bgcolor="$altbg1" valign="top" width="25%"><img src="$THEME[imgdir]/topav.gif" alt="$lang[altfolder]" border="0" /> <a href="avatars.php"><strong>$lang[avatars]</strong></a>$subfolders</td>
<td bgcolor="$altbg2" valign="top" width="75%">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
$avatars
</table>
</td>
</tr>
$multipage
$submitbutton
</table>
</td>
</tr>
</table>
</form>

============================================================================================================================
=======
Step 8:
=======
===============================
Go To Administration Panel --> Templates
===============================
===========================
Create New Template: avatargal_mp
===========================
========================
Add Code and Submit Changes:
========================

<tr class="tablerow" bgcolor="$altbg2">
<td colspan="2">&nbsp;$multipage</td>
</tr>

============================================================================================================================
=======
Step 9:
=======

Upload the 4 images provided named "openav.gif", "closeav.gif", avatars.gif, and "topav.gif" to all theme folders.

Upload the provided file named "avatars.php" to your forum root path.

Note: All avatars should be saved/uploaded to the "images/avatars" folder of your board in sub-folders within.

It is best to create sub-folders within the "images/avatars" folder for multi avatars.

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