==============================================================================================
Modification Name: Alternating Backgrounds For Posts v2.0

Author: Jamie

Last Updated: 07/31/2009
Updated for 1.9.8 by: WormHole @ XMB Garage

Description:
This modification will give posts alternating backgrounds.
This modification will give BB Code quote and code functions alternating backgrounds.
You can use either colors or images.
This modification is administered through the Themes Manager in the Administration Panel.

Supported Version: XMB 1.9.8 SP3

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

Please backup your files before installing this modification. Neither XMB Garage nor the author can be held 
responsible if your board stops functioning properly due to you installing this modification.
You can obtain support for this modification from XMB Garage.

==============================================================================================
=======
Step 1:
=======
===================================
Go To Administration Panel -> Insert Raw SQL
===================================
=======================
Add Code & Submit Changes
=======================

ALTER TABLE `$table_themes` 
  ADD `altbg1_post_img` VARCHAR(100) NOT NULL AFTER `altbg2`,
  ADD `altbg2_post_img` VARCHAR(100) NOT NULL AFTER `altbg1_post_img`,
  ADD `altbg1_post_col` VARCHAR(100) NOT NULL AFTER `altbg2_post_img`,
  ADD `altbg2_post_col` VARCHAR(100) NOT NULL AFTER `altbg1_post_col`;

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

// Alternating Backgrounds For Posts Mod Begin
$lang['textaltbg1_post_img'] = "Alternating Background Image #1 (Only applies to posts):";
$lang['textaltbg2_post_img'] = "Alternating Background Image #2 (Only applies to posts):";
$lang['textaltbg1_post_col'] = "Alternating Color #1 (Only applies to posts):";
$lang['textaltbg2_post_col'] = "Alternating Color #2 (Only applies to posts):";
// Alternating Backgrounds For Posts Mod End

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

        if (!$notexist) {

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

        // Alternating Backgrounds For Posts Mod Begin
        $postimg = '';
        if ($thisbg == $THEME['altbg2']) {
            $thisbg = $THEME['altbg1'];
            if (empty($THEME['altbg1_post_col'])) {
                $THEME['postbg'] = $thisbg;
            } else {
                $THEME['postbg'] = $THEME['altbg1_post_col'];
            }
            if (!(empty($THEME['altbg1_post_img'])) && file_exists("$THEME[imgdir]/$THEME[altbg1_post_img]")) {
                $THEME['postimg'] = " background=\"$THEME[imgdir]/$THEME[altbg1_post_img]\"";
            }
        } else {
            $thisbg = $THEME['altbg2'];
            if (empty($THEME['altbg2_post_col'])) {
                $THEME['postbg'] = $thisbg;
            } else {
                $THEME['postbg'] = $THEME['altbg2_post_col'];
            }
            if (!(empty($THEME['altbg2_post_img'])) && file_exists("$THEME[imgdir]/$THEME[altbg2_post_img]")) {
                $THEME['postimg'] = " background=\"$THEME[imgdir]/$THEME[altbg2_post_img]\"";
            }
        }
        // Alternating Backgrounds For Posts Mod End

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

        if ($thisbg == $altbg2) {
            $thisbg = $altbg1;
        } else {
            $thisbg = $altbg2;
        }

==============================================================================================
=======
Step 4:
=======
===============================
Go To Administration Panel -> Templates
===============================
========================
Edit Template: viewthread_post
========================
==========
Find Code:
==========

<tr bgcolor="$thisbg">
<td class="tablerow" valign="top" style="height: 80px; width: 82%" >

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

<tr bgcolor="$THEME[postbg]" class="tablerow">
<td $THEME[postimg] valign="top" style="height: 80px; width: 82%">

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

        <tr bgcolor="<?php echo $altbg2?>" class="tablerow">
        <td><?php echo $lang['textaltbg2']?></td>
        <td><input type="text" name="altbg2new" value="<?php echo $themestuff['altbg2']?>" /></td>
        <td bgcolor="<?php echo $themestuff['altbg2']?>">&nbsp;</td>
        </tr>

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

        <!-- Alternating Backgrounds For Posts Mod Begin -->
        <tr bgcolor="<?php echo $THEME['altbg2']?>" class="tablerow">
        <td><?php echo $lang['textaltbg1_post_col']?></td>
        <td><input type="text" name="altbg1_post_colnew" value="<?php echo $THEME['altbg1_post_col']?>" /></td>
        <td bgcolor="<?php echo $THEME['altbg1_post_col']?>">&nbsp;</td>
        </tr>
        <tr bgcolor="<?php echo $THEME['altbg2']?>" class="tablerow">
        <td><?php echo $lang['textaltbg2_post_col']?></td>
        <td><input type="text" name="altbg2_post_colnew" value="<?php echo $THEME['altbg2_post_col']?>" /></td>
        <td bgcolor="<?php echo $THEME['altbg2_post_col']?>">&nbsp;</td>
        </tr>
        <tr bgcolor="<?php echo $THEME['altbg2']?>" class="tablerow">
        <td><?php echo $lang['textaltbg1_post_img']?></td>
        <td colspan="2"><input type="text" name="altbg1_post_imgnew" value="<?php echo $THEME['altbg1_post_img']?>" /></td>
        <td bgcolor="<?php echo $THEME['altbg1_post_img']?>">&nbsp;</td>
        </tr>
        <tr bgcolor="<?php echo $THEME['altbg2']?>" class="tablerow">
        <td><?php echo $lang['textaltbg2_post_img']?></td>
        <td colspan="2"><input type="text" name="altbg2_post_imgnew" value="<?php echo $THEME['altbg2_post_img']?>" /></td>
        <td bgcolor="<?php echo $THEME['altbg2_post_img']?>">&nbsp;</td>
        </tr>
        <!-- Alternating Backgrounds For Posts Mod End -->

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

        <tr bgcolor="<?php echo $altbg2?>" class="tablerow">
        <td><?php echo $lang['textaltbg2']?></td>
        <td><input type="text" name="altbg2new" /></td>
        </tr>

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

        <!-- Alternating Backgrounds For Posts Mod Begin -->
        <tr bgcolor="<?php echo $THEME['altbg2']?>" class="tablerow">
        <td><?php echo $lang['textaltbg1_post_col']?></td>
        <td><input type="text" name="altbg1_post_colnew" /></td>
        <td bgcolor="<?php echo $THEME['altbg1_post_col']?>">&nbsp;</td>
        </tr>
        <tr bgcolor="<?php echo $THEME['altbg2']?>" class="tablerow">
        <td><?php echo $lang['textaltbg2_post_col']?></td>
        <td><input type="text" name="altbg2_post_colnew" /></td>
        <td bgcolor="<?php echo $THEME['altbg2_post_col']?>">&nbsp;</td>
        </tr>
        <tr bgcolor="<?php echo $THEME['altbg2']?>" class="tablerow">
        <td><?php echo $lang['textaltbg1_post_img']?></td>
        <td colspan="2"><input type="text" name="altbg1_post_imgnew" />&nbsp;</td>
        </tr>
        <tr bgcolor="<?php echo $THEME['altbg2']?>" class="tablerow">
        <td><?php echo $lang['textaltbg2_post_img']?></td>
        <td colspan="2"><input type="text" name="altbg2_post_imgnew" />&nbsp;</td>
        </tr>
        <!-- Alternating Backgrounds For Posts Mod End -->

====================
Find Code: (2 Occasions):
====================

        $altbg2new = postedVar('altbg2new');

=========================
Add Code Below (2 Occasions):
=========================

        //  Alternating Backgrounds For Posts Mod Begin
        $THEME['altbg1_post_colnew'] = postedVar('altbg1_post_colnew');
        $THEME['altbg2_post_colnew'] = postedVar('altbg2_post_colnew');
        $THEME['altbg1_post_imgnew'] = postedVar('altbg1_post_imgnew');
        $THEME['altbg2_post_imgnew'] = postedVar('altbg2_post_imgnew');
        //  Alternating Backgrounds For Posts Mod End

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

, altbg2='$altbg2new'

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

, altbg2='$altbg2new', altbg1_post_col='$altbg1_post_colnew', altbg2_post_col='$altbg2_post_colnew', altbg1_post_img='$altbg1_post_imgnew', altbg2_post_img='$altbg2_post_imgnew'

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

, altbg2, link

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

, altbg2, '$altbg1_post_colnew', '$altbg2_post_colnew', '$altbg1_post_imgnew', '$altbg2_post_imgnew', link

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

, '$altbg2new', '$linknew'

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

, '$altbg2new', altbg1_post_col, altbg2_post_col, altbg1_post_img, altbg2_post_img, '$linknew'

==============================================================================================
=======================
Edit File: include/functions.php
=======================
==========
Find Code:
==========

    global $imgdir, $bordercolor, $db, $smdir, $smiliecache, $censorcache, $smiliesnum, $wordsnum, $versionbuild, $fontsize;
    
===============
Add Code Below:
===============

    global $postbg, $postimg;
    
==========
Find Code:
==========

            12 => '</font><table align="center" class="quote" cellspacing="0" cellpadding="0"><tr><td class="quote">'.$lang['textquote'].'</td></tr><tr><td class="quotemessage">',

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

            12 => '</font><table align="center" class="quote" cellspacing="0" cellpadding="0"><tr><td class="quote">'.$lang['textquote'].'</td></tr><tr bgcolor="$postbg"><td class="quotemessage"$postimg>',
        
==========
Find Code:
==========

            14 => '</font><table align="center" class="code" cellspacing="0" cellpadding="0"><tr><td class="code">'.$lang['textcode'].'</td></tr><tr><td class="codemessage">',
                
================
Replace Code With:
================

            14 => '</font><table align="center" class="code" cellspacing="0" cellpadding="0"><tr><td class="code">'.$lang['textcode'].'</td></tr><tr bgcolor="$postbg"><td class="codemessage"$postimg>',

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