=======================================================================================================================================
Title: Zodiac Sign Selection v1.0

Author: John Briggs

Copyright:  2009 John Briggs. All rights reserved.

Description:
This modification will provide an option to select what zodiac sign you are in your member control panel.
This modification will display your selected zodiac sign image in your profile, control panel and threads.

Compatability: XMB 1.9.11

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. A copy is provided with this software package.

=======================================================================================================================================
=======
Step 1:
=======
==============================
Go To Admin Panel -> Insert Raw SQL
==============================

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

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

loadtemplates(

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

'member_profile_zodiac',

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

                $langfileselect = createLangFileSelect($langfile);

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

                // Zodiac Sign Selection Mod Begin
                $zss = array();
                $zss[] = '<option value="">'.$lang['zodiacnone'].'</option>';
                $dp = opendir('./images/zodiac');
                while($file = readdir($dp)) {
                    if ($file != '.' And $file != '..' And $file != 'index.html') {
                        $zodiacname = $file;
                        $zodiacname = str_replace(array('.gif','.jpg','.png','.bmp','_'), array('','','','',' '), $zodiacname);
                        $zss[] = '<option value="'.$file.'">'.$zodiacname.'</option>';
                    }
                }
                closedir($dp);
                natcasesort($zss);
                $zodiacselect = '<select name="zodiac">'.implode("\n", $zss).'</select>';
               // Zodiac Sign Selection Mod End

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

                $sig = postedVar('sig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

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

                // Zodiac Sign Selection Mod Begin
                $zodiac = postedVar('zodiac', 'javascript', TRUE, TRUE, TRUE);
                // Zodiac Sign Selection Mod End

=================
Find Code (2 Times):
=================

) VALUES ('$username',

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

, zodiac) VALUES ('$username',

====================================
Find Code At End Of Query Statement (2 Times):
====================================

)");

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

, '$zodiac')");

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

        if ($memberinfo['customstatus'] != '') {
            $showtitle = $rank['title'];
            $customstatus = '<br />'.censor($memberinfo['customstatus']);
        } else {
            $showtitle = $rank['title'];
            $customstatus = '';
        }

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

        // Zodiac Sign Selection Mod Begin
        $zodiacblock = '';
        if ($memberinfo['zodiac'] != '') {
            $zodiacname = $memberinfo['zodiac'];
            $zodiacname = str_replace(array('.gif','.jpg','.png','.bmp','_'), array('','','','',' '), $zodiacname);
            if (@file_exists('./images/zodiac/'.$memberinfo['zodiac'])) {
                $zodiacimg = '<img src="./images/zodiac/'.$memberinfo['zodiac'].'" alt="'.$zodiacname.'" border="0" />';
                $memberinfo['zodiac'] = $zodiacimg;
                eval('$zodiacblock = "'.template('member_profile_zodiac').'";');
            }
        }
        // Zodiac Sign Selection Mod End

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

        $langfileselect = createLangFileSelect($member['langfile']);

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

        // Zodiac Sign Selection Mod Begin
        $zss = array();
        $zss[] = '<option value="">'.$lang['zodiacnone'].'</option>';
        $dp = opendir(ROOT.'images/zodiac');
        while($file = readdir($dp)) {
            if ($file != '.' And $file != '..' And $file != 'index.html') {
                $zodiacname = $file;
                $zodiacname = str_replace(array('.gif','.jpg','.png','.bmp','_'), array('','','','',' '), $zodiacname);
                if ($member['zodiac'] == $file) {
                    $zss[] = '<option value="'.$file.'" '.$selHTML.'>'.$zodiacname.'</option>';
                } else {
                    $zss[] = '<option value="'.$file.'">'.$zodiacname.'</option>';
                }
            }
        }
        closedir($dp);
        natcasesort($zss);
        $zodiacselect = '<select name="zodiac">'.implode("\n", $zss).'</select>';
        // Zodiac Sign Selection Mod End

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

        $sig = postedVar('newsig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

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

        // Zodiac Sign Selection Mod Begin
        $zodiac = postedVar('zodiac', 'javascript', TRUE, TRUE, TRUE);
        // Zodiac Sign Selection Mod End

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

        $db->query("UPDATE ".X_PREFIX."members SET $pwtxt

========================================
Find Code In-Line At End Of Above Query Statement:
========================================

 WHERE username='$xmbuser'");

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

, zodiac='$zodiac' WHERE username='$xmbuser'");

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

    if ($member['mood'] != '') {
        $member['mood'] = postify($member['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');
    } else {
        $member['mood'] = '';
    }

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

    // Zodiac Sign Selection Mod Begin
    if ($member['zodiac'] != '') {
        $zodiacname = $member['zodiac'];
        $zodiacname = str_replace(array('.gif','.jpg','.png','.bmp','_'), array('','','','',' '), $zodiacname);
        if (@file_exists('./images/zodiac/'.$member['zodiac'])) {
            $zodiacimg = '<img src="./images/zodiac/'.$member['zodiac'].'" alt="'.$zodiacname.'" border="0" />';
            $member['zodiac'] = $zodiacimg;
        }
    }
    // Zodiac Sign Selection Mod End

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

    $langfileselect = createLangFileSelect($member['langfile']);

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

    // Zodiac Sign Selection Mod Begin
    $zss = array();
    $zss[] = '<option value="">'.$lang['zodiacnone'].'</option>';
    $dp = opendir(ROOT.'images/zodiac');
    while($file = readdir($dp)) {
        if ($file != '.' And $file != '..' And $file != 'index.html') {
            $zodiacname = $file;
            $zodiacname = str_replace(array('.gif','.jpg','.png','.bmp','_'), array('','','','',' '), $zodiacname);
            if ($member['zodiac'] == $file) {
                $zss[] = '<option value="'.$file.'" '.$selHTML.'>'.$zodiacname.'</option>';
            } else {
                $zss[] = '<option value="'.$file.'">'.$zodiacname.'</option>';
            }
        }
    }
    closedir($dp);
    natcasesort($zss);
    $zodiacselect = '<select name="zodiac">'.implode("\n", $zss).'</select>';
    // Zodiac Sign Selection Mod End

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

    $sig = postedVar('newsig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

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

    // Zodiac Sign Selection Mod Begin
    $zodiac = postedVar('zodiac', 'javascript', TRUE, TRUE, TRUE);
    // Zodiac Sign Selection Mod End

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

$db->query("UPDATE ".X_PREFIX."members SET status='$status',

========================================
Find Code In-Line At End Of Above Query Statement:
========================================

 WHERE username='$user'");

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

, zodiac='$zodiac' WHERE username='$user'");

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

            if ($post['location'] != '') {
                $post['location'] = censor($post['location']);
                $location = '<br />'.$lang['textlocation'].' '.$post['location'];
            } else {
                $location = '';
            }

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

            // Zodiac Sign Selection Mod Begin
            if ($post['zodiac'] != '') {
                $zodiacname = $post['zodiac'];
                $zodiacname = str_replace(array('.gif','.jpg','.png','.bmp','_'), array('','','','',' '), $zodiacname);
                if (@file_exists('./images/zodiac/'.$post['zodiac'])) {
                    $zodiacimg = '<img src="./images/zodiac/'.$post['zodiac'].'" alt="'.$zodiacname.'" border="0" />';
                    $post['zodiac'] = '<br />'.$lang['zodiac'].' '.$zodiacimg;
                }
            }
            // Zodiac Sign Selection Mod End

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

            $profilelink = $post['author'];

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

            // Zodiac Sign Selection Mod Begin
            $post['zodiac'] = '';
            // Zodiac Sign Selection Mod End

=======================================================================================================================================
=======
Step 6:
=======
===============
Edit Language File:
===============
============================
Add Code To End Of File Above ?>
============================

// Zodiac Sign Selection Mod Begin
$lang['zodiac'] = 'Zodiac Sign:';
$lang['zodiacnone'] = '--- Select Zodiac Sign ---';
// Zodiac Sign Selection Mod End

============================================
Go To Admin Panel -> Translations & Upload Language File:
============================================
=======================================================================================================================================
=======
Step 7:
=======
=========================
Go To Admin Panel -> Templates
=========================
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textlocation]</td>
<td bgcolor="$altbg2"><input type="text" name="newlocation" size="25" value="$member[location]" /></td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[zodiac]</td>
<td bgcolor="$THEME[altbg2]">$zodiacselect</td>
</tr>

=======================================================================================================================================
=======
Step 8:
=======
=========================
Go To Admin Panel -> Templates
==========================
===========================
Edit Template: member_reg_optional
===========================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textlocation]</td>
<td bgcolor="$altbg2"><input type="text" name="location" size="25" value="" /></td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[zodiac]</td>
<td bgcolor="$THEME[altbg2]">$zodiacselect</td>
</tr>

=======================================================================================================================================
=======
Step 9:
=======
=========================
Go To Admin Panel -> Templates
=========================
=======================
Edit Template: memcp_profile
=======================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textlocation]</td>
<td bgcolor="$altbg2"><input type="text" name="newlocation" size="25" value="$member[location]" /></td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[zodiac]</td>
<td bgcolor="$THEME[altbg2]">$zodiacselect</td>
</tr>

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

$location

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

$post[zodiac]

=======================================================================================================================================
========
Step 11:
========
=========================
Go To Admin Panel -> Templates
=========================
=======================
Edit Template: member_profile
=======================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[textlocation]</td>
<td bgcolor="$altbg2">$memberinfo[location]</td>
</tr>

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

$zodiacblock

=======================================================================================================================================
========
Step 12:
========
=========================
Go To Admin Panel -> Templates
=========================
==================================
Create New Template: member_profile_zodiac
==================================
===========================
Add Code & Click Submit Changes
===========================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%" valign="top">$lang[zodiac]</td>
<td bgcolor="$THEME[altbg2]">$memberinfo[zodiac]</td>
</tr>

=======================================================================================================================================
========
Step 13:
========
=========================
Go To Admin Panel -> Templates
=========================
======================
Edit Template: memcp_home
======================

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

<td bgcolor="$altbg1" valign="top">&nbsp;</td>
<td bgcolor="$altbg2" valign="top">&nbsp;</td>

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

<td bgcolor="$THEME[altbg1]" valign="top">$lang[zodiac]</td>
<td bgcolor="$THEME[altbg2]" valign="top">$member[zodiac]</td>

=======================================================================================================================================
========
Step 14:
========

Now upload provided folder named "zodiac" to your forum "images" directory.

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