=======================================================================================================================================
Title: Subscriptions-Favorites Multi-Delete Option

Version: 1.0

Author: GuldantheWarlock

New Code By: John Briggs

Description: This modification will allow you to use the "Check All, Uncheck All, Invert Selection" options in your subscriptions and favorites.

Copyright:  2005 GuldantheWarlock. All Rights Reserved.
Copyright:  2006 John Briggs. All Rights Reserved.
Copyright:  2011 XMB Garage. 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.

Please backup your files before installing this modification.
Neither XMBGarage nor the author can be held responsible if your board stops functioning properly due to you installing this modification.

You downloaded this modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.
=======================================================================================================================================
=======
Step 1:
=======
=================
Edit File: memcp.php
=================
==========
Find Code:
==========

        $query = $db->query("SELECT tid FROM $table_favorites WHERE username='$xmbuser' AND type='favorite'");
        while($fav = $db->fetch_array($query)) {
            $delete = "delete" .$fav['tid']. "";
            $delete = "${$delete}";
            $db->query("DELETE FROM $table_favorites WHERE username='$xmbuser' AND tid='$delete' AND type='favorite'");
        }

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

        // Subscriptions-Favorites Multi-Delete Option Mod Begin
        foreach ($delete as $tid) {
            $db->query("DELETE FROM $table_favorites WHERE username='$xmbuser' AND tid='$tid' AND type='favorite'");
        }
        // Subscriptions-Favorites Multi-Delete Option Mod End

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

        $query = $db->query("SELECT tid FROM $table_favorites WHERE username='$xmbuser' AND type='subscription'");
        while ($sub = $db->fetch_array($query)) {
            $delete = "delete" .$sub['tid']. "";
            $delete = "${$delete}";
            $db->query("DELETE FROM $table_favorites WHERE username='$xmbuser' AND tid='$delete' AND type='subscription'");
        }

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

        // Subscriptions-Favorites Multi-Delete Option Mod Begin
        foreach ($delete as $tid) {
            $db->query("DELETE FROM $table_favorites WHERE username='$xmbuser' AND tid='$tid' AND type='subscription'");
        }
        // Subscriptions-Favorites Multi-Delete Option Mod End

=======================================================================================================================================
=======
Step 2:
=======
===============================
Go To Administration Panel --> Templates
===============================
=============================
Edit Template: memcp_favs_row
=============================
==========
Find Code:
==========

<input type="checkbox" name="delete$fav[tid]" value="$fav[tid]" />

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

<input type="checkbox" name="delete[]" value="$fav[tid]" />

=======================================================================================================================================
=======
Step 3:
=======
===============================
Go To Administration Panel --> Templates
===============================
=============================
Edit Template: memcp_subscriptions_row
=============================
==========
Find Code:
==========

<input type="checkbox" name="delete$fav[tid]" value="$fav[tid]" />

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

<input type="checkbox" name="delete[]" value="$fav[tid]" />

=======================================================================================================================================
=======
Step 4:
=======
===============================
Go To Administration Panel --> Templates
===============================
==========================
Edit Template: memcp_favs_button
==========================
================
Replace Code With:
================

<tr class="tablerow">
<td bgcolor="$altbg2" align="left" colspan="6"><font class="smalltxt">
<a href="#" onclick="setCheckboxes('fav_form', true); return false;">$lang[checkall]</a> -
<a href="#" onclick="setCheckboxes('fav_form', false); return false;">$lang[uncheckall]</a> -
<a href="#" onclick="invertSelection('fav_form', 'delete[]'); return false;">$lang[invertselection]</a></font></td>
</tr>
<tr class="ctrtablerow">
<td bgcolor="$altbg2" colspan="6"><input type="submit" class="submit" name="favsubmit" value="$lang[textdeleteselectedfavs]" /></td>
</tr>

=======================================================================================================================================
=======
Step 5:
=======
===============================
Go To Administration Panel --> Templates
===============================
================================
Edit Template: memcp_subscriptions_button
================================
================
Replace Code With:
================

<tr class="tablerow">
<td bgcolor="$altbg2" align="left" colspan="6"><font class="smalltxt">
<a href="#" onclick="setCheckboxes('sub_form', true); return false;">$lang[checkall]</a> -
<a href="#" onclick="setCheckboxes('sub_form', false); return false;">$lang[uncheckall]</a> -
<a href="#" onclick="invertSelection('sub_form', 'delete[]'); return false;">$lang[invertselection]</a></font></td>
</tr>
<tr class="ctrtablerow">
<td bgcolor="$altbg2" colspan="6"><input type="submit" class="submit" name="subsubmit" value="$lang[textdeleteselectedsubs]" /></td>
</tr>

=======================================================================================================================================
=======
Step 6:
=======
===============================
Go To Administration Panel --> Templates
===============================
=====================
Edit Template: memcp_favs
=====================
==========
Find Code:
==========

<form method="post" action="memcp.php?action=favorites">

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

<script language="JavaScript" src="./include/favorites.js"></script>
<form method="post" name="fav_form" action="memcp.php?action=favorites">

=======================================================================================================================================
=======
Step 7:
=======
===============================
Go To Administration Panel --> Templates
===============================
===========================
Edit Template: memcp_subscriptions
===========================
==========
Find Code:
==========

<form method="post" action="memcp.php?action=subscriptions">

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

<script language="JavaScript" src="./include/subscriptions.js"></script>
<form method="post" name="sub_form" action="memcp.php?action=subscriptions">

=======================================================================================================================================
=======
Step 8:
=======

Upload provided files 'subscriptions.js' and 'favorites.js' from the 'Contents' folder to your forum's './include/' folder

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