Modification Name: Member Profile Tagboard v1.0

Description: This modification will add a Tagboard to the members profile. 
                   With an option in the profile to turn it On and Off. 
                   And an extra option to receive U2U's when a tag has been received.

Compatibility: XMB 1.9.8 SP3

Version: 1.0 

Code Designed By: Unknown

Re-written & revised by: FunForum

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

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

================================================================================

In order for this hack to work, you're going to need the "sanitize.inc.php". 
This can be achieved in two ways. 

 - Go to http://cvs.xmbforum.com/ and download the latest /include/sanitize.inc.php 

Upload that file to your forum: /include/sanitize.inc.php 

================================================================================

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


Edit PHP file:   header.php

Find:
--------------------------------------------------------------------------------

require ROOT.'include/validate.inc.php';

--------------------------------------------------------------------------------

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

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

--------------------------------------------------------------------------------

Edit PHP File: /lang/English.lang.php

Add to the end of the 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

--------------------------------------------------

Edit PHP File: member.php

Find:
--------------------------------------------------

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

--------------------------------------------------

Replace With:
--------------------------------------------------

        $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 ".X_PREFIX."members WHERE username='$member'"));

--------------------------------------------------

Edit PHP File: memcp.php

Find:
--------------------------------------------------

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

--------------------------------------------------

Add 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><td class="tablerow" bgcolor="'.$THEME['altbg1'].'" width="22%">'.$lang['tabg_001'].'</td><td class="tablerow" 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:
--------------------------------------------------

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

--------------------------------------------------

Add 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:
--------------------------------------------------

        $db->query("UPDATE ".X_PREFIX."members SET

Find code In-line in above statement:
--------------------------------------------------

 WHERE username='$xmbuser'");

--------------------------------------------------

Replace With:
--------------------------------------------------

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

--------------------------------------------------

Edit Template: memcp_profile

Find:
--------------------------------------------------

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

--------------------------------------------------
Add Below:
--------------------------------------------------

$tagboard

--------------------------------------------------

Edit Template: member_profile

Find:
--------------------------------------------------

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

--------------------------------------------------
Add 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 />

--------------------------------------------------

Create Template: member_profile_tag

Add:
--------------------------------------------------

<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>

--------------------------------------------------

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

   /member.tagboard.php?action=install

Congratulations,
You have now finished installing this hack.