============================================================================================================================
Modification Name: Ignore Forums In Activity

Version: 2.0

Last modified: 06/07/2010

Description:
This modification will provide an option to enter the forum id's (fid's) of forums you do not want to see in today's posts or topic activity.
This option can be entered on your member registration form.
The option is editable in your member control panel and admin edit profile tool.
Admins can set pre-determined fid's to be ignored to be set for new registrations, of which the user can edit later on.

Compatibility: XMB v1.9.5 SP1

Code Developed By: Adam Clarke (http://www.scriptdesign.co.uk & http://www.adam-clarke.co.uk)

MOD History: V1.0 (05/08/2005 @ 15:00) - Initial Release.
             V1.1 (05/08/2005 @ 17:20) - Fixed code for English.lang.php and made a few minor adjustments.
             V1.2 (05/08/2005 @ 17:55) - Fixed code for today.php and activity.php.
             V1.2 (05/07/2006 @ 08:10) - Updated for 1.9.5
             V2.0 (06/07/2010 @ 13:50) - Added admin ability to set pre-determined fids to be set for new users upon registration.

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

Note: Backup all affected files, templates & database.

Affected Files (6): member.php, memcp.php, editprofile.php, today.php, activity.php, lang/English.lang.php

Affected Templates (3): member_reg, memcp_profile, admintool_editprofile

Author Notes:
Before installing this modification you should back up all files modified by this modification.
Neither XMB Garage nor the author can be held responsible if your board stops functioning properly due to you installing this modification.

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 SQL.txt and click Submit Changes.

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

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

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

        // Ignore Forums In Activity Mod Begin
        printsetting4($lang['ignoreforums2'], 'ignoreforumsnew', $ignoreforums, 5, 50);
        // Ignore Forums In Activity Mod End

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

        $bboffreasonnew = addslashes($bboffreasonnew);

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

        // Ignore Forums In Activity Mod Begin
        $ignoreforumsnew = addslashes($ignoreforumsnew);
        // Ignore Forums In Activity Mod End

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

        $db->query("UPDATE $table_settings SET
        
========================
Add To End Of Line Before  '");
========================

, ignoreforums='$ignoreforumsnew'

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

        $sig           = isset($sig) ? checkInput($sig, '', $SETTINGS['sightml'], '', false) : '';

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

        // Ignore Forums In Activity Mod Begin
        $ignoreforums = isset($ignoreforums) ? checkInput($ignoreforums, '', '', "javascript", false) : '';
        // Ignore Forums In Activity Mod End

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

        $sig           = addslashes($sig);

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

        // Ignore Forums In Activity Mod Begin
        $ignoreforums = addslashes($ignoreforums);
        // Ignore Forums In Activity Mod End

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

) VALUES ('', '$username'

================
Replace Code With:
================
, ignoreforums) VALUES ('', '$username'

======================
Find Code (At End Of Line):
======================

)");

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

, '$SETTINGS[ignoreforums]')");

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

        $sig            = isset($newsig) ? checkInput($newsig, '', $SETTINGS['sightml'], '', false) : '';

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

        // Ignore Forums In Activity Mod Begin
        $ignoreforums = isset($newignoreforums) ? checkInput($newignoreforums, '', '', 'javascript', false) : '';
        // Ignore Forums In Activity Mod End

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

        $sig            = addslashes($sig);

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

        // Ignore Forums In Activity Mod Begin
        $ignoreforums = addslashes($ignoreforums);
        // Ignore Forums In Activity Mod End

==========
Find Code:
==========
$db->query("UPDATE $table_members SET $pwtxt

======================
Find Code (At End Of Line):
======================

 WHERE username='$xmbuser'");

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

, ignoreforums='$newignoreforums' WHERE username='$xmbuser'");

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

    $sig            = isset($newsig) ? checkInput($newsig, '', $SETTINGS['sightml'], '', false) : '';

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

    // Ignore Forums In Activity Mod Begin
    $ignoreforums = isset($newignoreforums) ? checkInput($newignoreforums, 'no', 'no', 'javascript', false) : '';
    // Ignore Forums In Activity Mod End

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

    $sig            = addslashes($sig);

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

    // Ignore Forums In Activity Mod Begin
    $ignoreforums = addslashes($ignoreforums);
    // Ignore Forums In Activity Mod End

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

$db->query("UPDATE $table_members SET email='$email',

======================
Find Code (At End Of Line):
======================

 WHERE username='$user'");

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

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

============================================================================================================================
=======
Step 6:
=======
You can skip this step if you have the Topic Activity modification installed
================
Edit File: today.php
================
==========
Find Code:
==========

$fids = array();

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

// Ignore Forums In Activity Mod Begin
$ignoreforums = '';
if (isset($self['ignoreforums']) && $self['ignoreforums'] != '') {
    $ignoreforums = ' AND fid NOT IN (' . $self['ignoreforums'] . ')';
}
// Ignore Forums In Activity Mod End

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

$q = $db->query("SELECT fid FROM $table_forums WHERE status = 'on'");

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

$q = $db->query("SELECT fid FROM $table_forums WHERE status = 'on' $ignoreforums");

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

$q = $db->query("SELECT fid FROM $table_forums WHERE status = 'on' AND $restrict");

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

$q = $db->query("SELECT fid FROM $table_forums WHERE status = 'on' AND $restrict $ignoreforums");

============================================================================================================================
=======
Step 7:
=======
Do this step if you have the Topic Activity modification installed
================
Edit File: activity.php
================
==========
Find Code:
==========

$threadcount = 0;

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

// Ignore Forums In Activity Mod Begin
$ignoreforums = '';
if (isset($self['ignoreforums']) && $self['ignoreforums'] != '') {
    $ignoreforums = ' AND f.fid NOT IN (' . $self['ignoreforums'] . ')';
}
// Ignore Forums In Activity Mod End

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

$query = $db->query("SELECT $dotadd1 t.*, f.name FROM ($table_threads t, $table_forums f) $dotadd2 WHERE $srchtype t.lastpost >= '$srchfrom' AND t.fid=f.fid AND f.fid IN ($fidlist) ORDER BY $srchsort $srchorder LIMIT $start_limit, $tpp");

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

$query = $db->query("SELECT $dotadd1 t.*, f.password, f.private, f.userlist, f.name FROM ($table_threads t, $table_forums f) $dotadd2 WHERE $srchtype t.lastpost >= '$srchfrom'$ignoreforums AND t.fid=f.fid AND f.fid IN ($fidlist) ORDER BY $srchsort $srchorder LIMIT $start_limit, $tpp");

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

$totalquery = $db->query("SELECT $dotadd1 t.*, f.password, f.private, f.userlist, f.name FROM $table_threads t $dotadd2, $table_forums f WHERE $srchtype t.lastpost >= '$srchfrom' AND t.fid = f.fid AND f.fid IN ($fidlist)");

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

$totalquery = $db->query("SELECT $dotadd1 t.*, f.password, f.private, f.userlist, f.name FROM $table_threads t $dotadd2, $table_forums f WHERE $srchtype t.lastpost >= '$srchfrom'$ignoreforums AND t.fid = f.fid AND f.fid IN ($fidlist)");

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

// Ignore Forums In Activity Mod Begin
$lang['ignoreforums'] = "Ignore New Posts In Forum(s):<br /><small>Enter the forum id's (fid) of the forums you wish to ignore in Today\'s posts or Topic Activity?</small>";
$lang['ignoreforums2'] = "Ignore Forum(s):<br /><small>Enter the forum id's (fid) of the forums you wished ignored in Today's posts or Topic Activity for New Registrations?<br /><i>(Separate entries with a comma. Ex: 1,2,3)</i></small>";
// Ignore Forums In Activity Mod End

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

<tr>
<td align="center" class="tablerow" bgcolor="$altbg2" colspan="2"><input type="submit" class="submit" name="editsubmit" value="$lang[texteditpro]" /></td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[ignoreforums]</td>
<td bgcolor="$altbg2"><textarea rows="5" cols="45" name="newignoreforums">$member[ignoreforums]</textarea></td>
</tr>

============================================================================================================================
========
Step 10:
========
===============================
Go To Administration Panel --> Templates
===============================
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

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

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[ignoreforums]</td>
<td bgcolor="$altbg2"><textarea rows="5" cols="45" name="newignoreforums">$member[ignoreforums]</textarea></td>
</tr>

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