============================================================================================================================
ModificationName: Member Profile Tagboard

Version: 1.0

Code Designed By: Unknown

Re-written & revised by: FunForum

Description:
This modification will add a Tagboard to the member profile with an option in the profile to turn it On and Off and an extra option to receive U2U messages when a tag has been received.

Compatibility: XMB 1.9.5 SP1

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

Notes: Backup all affected files and templates before attempting to install this modification.

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

Upload the following PHP file to your forum's include directory: 
 - sanitize.inc.php 

Upload the following PHP file to your forum's root directory: 
 - member.tagboard.php

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

require_once(ROOT.'functions.php');

================================================
Add Code Below (if this statement isn't already in your header.php):
================================================

require_once(ROOT.'include/sanitize.inc.php');

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

// Member Profile Tagboard Mod Begin
$lang['tabg_001'] = 'Tagboard in Profile';
$lang['tabg_002'] = 'Disable';
$lang['tabg_003'] = 'Enable';
$lang['tabg_004'] = 'Enable - get U2U on new tag';
$lang['tabg_005'] = 'Tagboard';
$lang['tabg_006'] = 'Please login to view this restricted page.';
$lang['tabg_007'] = 'No such user.';
$lang['tabg_008'] = 'This member has their Tagboard disabled.';
$lang['tabg_009'] = 'You got tagged, have a look in your profile to view your Tagboard:<br /> *boardurl*member.php?action=viewpro&uid=*uid*';
$lang['tabg_010'] = 'Delete this tag';
$lang['tabg_011'] = '(x)';
$lang['tabg_012'] = ' (PrivMsg)';
$lang['tabg_013'] = 'Private: ';
$lang['tabg_014'] = 'Tag!';
// Member Profile Tagboard Mod End

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

loadtemplates(

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

'member_profile_tag',

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

    if (!$member) {
        error($lang['nomember']);
    } else {
        $memberinfo = $db->fetch_array($db->query("SELECT * FROM $table_members WHERE username='$member'"));

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

    // Member Profile Tag Board Mod Begin
    $uid = safeInt(fetchFromRequest('uid', X_GET));
    if (!$member && $uid == 0) {
        error($lang['nomember']);
    } else {
        $whereclause = ( $uid > 0 ? "uid='$uid'" : "username='$member'" );
        $memberinfo = $db->fetch_array($db->query("SELECT * FROM $table_members WHERE $whereclause"));
        // Member Profile Tag Board Mod End

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

        $invchecked = '';
        if ($member['invisible'] == 1) {
            $invchecked = $cheHTML;
        }

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

        // Member Profile Tagboard Mod Begin
        $tagb_checkA = $tagb_checkB = $tagb_checkC = '';
        switch($member['tagb']) {
            case 'on':
                $tagb_checkB = $selHTML;
                break;
             case 'u2u':
                 $tagb_checkC = $selHTML;
                 break;
            default:
                $tagb_checkA = $selHTML;
                break;
        }
        $tagboard = '<tr class="tablerow"><td bgcolor="'.$THEME['altbg1'].'" width="22%">'.$lang['tabg_001'].'</td><td bgcolor="'.$THEME['altbg2'].'"><select name="tagopt_new"><option value="off"'.$tagb_checkA.'>'.$lang['tabg_002'].'</option><option value="on"'.$tagb_checkB.'>'.$lang['tabg_003'].'</option><option value="u2u"'.$tagb_checkC.'>'.$lang['tabg_004'].'</option></select></td></tr>';
        // Member Profile Tagboard Mod End

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

        $bday           = iso8601_date($year, $month, $day);

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

        // Member Profile Tagboard Mod Begin
        $tagopt_new = fetchFromRequest('tagopt_new', X_POST);
        $tagopt_new = (($tagopt_new != 'on' && $tagopt_new != 'u2u' ) ? 'off' : $tagopt_new);
        // Member Profile Tagboard Mod End

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

        $db->query("UPDATE $table_members SET $pwtxt

=============================
Find Code In-Line In Above Statement:
=============================

 WHERE username='$xmbuser'");

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

, tagb='$tagopt_new' WHERE username='$xmbuser'");

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

<option value="13" $timezone33>$lang[timezone33]</option>
</select></td>
</tr>

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

$tagboard

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

<tr>
<td bgcolor="$altbg1" valign="top"
class="tablerow">$lang[textproflastpost]</td>
<td bgcolor="$altbg2" class="tablerow">$lastpost</td>
</tr>
</table></td>
</tr>
</table>

<br />

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

<form action="member.tagboard.php?memid=$memberinfo[uid]" method="POST">
<table cellspacing="0" cellpadding="0" border="0" width="$THEME[tablewidth]" align="center">
<tr>
<td bgcolor="$THEME[bordercolor]">
<table border="0" cellspacing="$THEME[borderwidth]" cellpadding="$THEME[tablespace]" width="100%">
<tr>
<td class="category"><font color="$THEME[cattext]"><strong>$lang[tabg_005]</strong></font></td></tr>
<tr class="tablerow">
<td align="center" bgcolor="$THEME[altbg2]"> <iframe name="tagboard" src="member.tagboard.php?memid=$memberinfo[uid]" style="width: 100%; height: 200px; border: 0px;" border="0" frameborder="0"></iframe></td></tr>
</table>
</td>
</tr>
</table>
</form>

<br />

============================================================================================================================
=======
Step 8:
=======
===============================
Go To Administration Panel --> Templates
===============================
===============================
Create NewTemplate: member_profile_tag
===============================
========================
Add Code and Submit Changes:
========================

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
<style type="text/css">
body {
    background-color: {$THEME['altbg1']};
}
html , body , table , tr , td {
    margin:0px;
    padding:0px;
}
td {
    font-family: {$THEME['font']};
    font-size: {$THEME['fontsize']};
}
a {
    color: {$THEME['link']};
    text-decoration: none;
}
a:hover, .category a:hover {
    text-decoration: underline;
}
form {
    margin: 0px;
}

hr {
    color:  {$THEME['bordercolor']};
    background-color: {$THEME['bordercolor']};
    border: 0px;
    height: 1px;
}
.tablerow {
    color: {$THEME['tabletext']};
    font-family: {$THEME['font']};
    font-size: {$THEME['fontsize']};
    table-layout: fixed;
}
</style>
</head>
<body>
$html
</body>
</html>

============================================================================================================================
=======
Step 9:
=======

Visit your board at the following location to perform the SQL upgrade:

   /member.tagboard.php?action=install

Congratulations! You have now finished installing this modification.

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