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

Author: Jamie

Last Updated: March 28, 2010

Description:
This modification will give posts 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.5 Nexus Final

Notes: This modification is released under the GPL. You should have received a copy of it 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
===================================

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: English.lang.php
====================

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

$lang['textaltbg1'] = "Alternating Colour #1:";
$lang['textaltbg2'] = "Alternating Colour #2:";

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

// 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 Colour #1 (Only applies to posts):";
$lang['textaltbg2_post_col'] = "Alternating Colour #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 == $altbg2) {
            $thisbg = $altbg1;
            // Begin Alternating background colors for posts hack
            if (empty($altbg1_post_col)) {
                $postbg = $thisbg;
            } else {
                $postbg = $altbg1_post_col;
            }
            if (!(empty($altbg1_post_img)) && file_exists("$imgdir/$altbg1_post_img")) {
                $postimg = " background=\"$imgdir/$altbg1_post_img\"";
            }
            // End Alternating background colors for posts hack
        } else {
            $thisbg = $altbg2;
            // Begin Alternating background colors for posts hack
            if (empty($altbg2_post_col)) {
                $postbg = $thisbg;
            } else {
                $postbg = $altbg2_post_col;
            }
            if (!(empty($altbg2_post_img)) && file_exists("$imgdir/$altbg2_post_img")) {
                $postimg = " background=\"$imgdir/$altbg2_post_img\"";
            }
        }
        // Alternating Backgrounds For Posts Mod End

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

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

        $db->query("UPDATE $table_themes SET name='$namenew'

===================================
Add In-Line Before  WHERE themeid='$orig'");
===================================

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

$db->query("INSERT INTO $table_themes (themeid,

===================
Add In-Line Before  )");
===================

, '$altbg1_post_colnew', '$altbg2_post_colnew', '$altbg1_post_imgnew', '$altbg2_post_imgnew'

===================
===================
Find Code In Same Line:
===================

) VALUES('', '$namenew'

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

, altbg1_post_col, altbg2_post_col, altbg1_post_img, altbg2_post_img) VALUES('', '$namenew'

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