=======================================================================================================================================
Mod Title: Notepad

Mod Version: 1.0

Mod Author: John Briggs

Mod Description:
This mod will provide a personal notepad for each member which can be used for storing notes etc..
This mod will provide a on or off control via the admin settings panel.

Mod Copyright:  2008 XMBMods.com. All rights reserved.

Mod Compatibility: XMB 1.9.8 Engage Final SP2

Mod Install Note: Before adding this mod to your forum, you should back up all files related to this mod.

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

Mod Author Note:
This modification is developed and released for use with XMB 1.9.8 Engage Final SP2 which is provided by XMBMods.com.

=======================================================================================================================================
=======
Step 1:
=======

===================================
Go to admin panel -> Insert Raw SQL
===================================

Upload provided file named "SQL.txt" & click "Submit Changes" button.

=======================================================================================================================================
=======
Step 2:
=======

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

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

?>

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

// Notepad Mod Begin
$lang['notepadstatus'] = "Notepad Status:";
$lang['notepad'] = "Notepad";
$lang['notepadsave'] = "Save";
$lang['notepadclear'] = "Clear";
// Notepad Mod End

=======================================================================================================================================
=======
Step 2:
=======

=================
Edit File: cp.php
=================

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

        $onlinetoday_statuson = $onlinetoday_statusoff = '';
        settingHTML('onlinetoday_status', $onlinetoday_statuson, $onlinetoday_statusoff);

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

        // Notepad Mod Begin
        $notepadstatuson = $notepadstatusoff = '';
        settingHTML('notepadstatus', $notepadstatuson, $notepadstatusoff);
        // Notepad Mod End

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

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

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

        // Notepad Mod Begin
        printsetting1($lang['notepadstatus'], 'notepadstatusnew', $notepadstatuson, $notepadstatusoff);
        // Notepad Mod End

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

        $onlinetoday_statusnew = formOnOff('onlinetoday_statusnew');

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

        // Notepad Mod Begin
        $notepadstatusnew = formOnOff('notepadstatusnew');
        // Notepad Mod End

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

            onlinetoday_status='$onlinetoday_statusnew'

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

            onlinetoday_status='$onlinetoday_statusnew',
            notepadstatus='$notepadstatusnew',

=======================================================================================================================================
========
Step: 3:
========

====================
Edit File: memcp.php
====================

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

'memcp_home_u2u_row',

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

'memcp_notepad',

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

    global $bordercolor, $tablewidth, $borderwidth, $tablespacing, $altbg1, $altbg2, $lang;

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

    global $SETTINGS;

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

    echo "<td bgcolor=\"$altbg2\" width=\"20%\" class=\"ctrtablerow\"><a href=\"#\" onclick=\"Popup('u2u.php', 'Window', 700, 450);\">" .$lang['textu2umessenger']. "</a></td>";

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

    // Notepad Mod Begin
    if ($SETTINGS['notepadstatus'] == 'on') {
        echo "<td bgcolor=\"$altbg2\" width=\"10%\" class=\"ctrtablerow\"><a href=\"#\" onclick=\"Popup('memcp.php?action=notepad', 'Window', 350, 250);\">".$lang['notepad']."</a></td>";
    }
    // Notepad Mod End

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

if (X_GUEST) {
    redirect('misc.php?action=login', 0);
    exit();
}

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

// Notepad Mod Begin
$note_pad = '';
if ($SETTINGS['notepadstatus'] == 'on' && $action == 'notepad') {
    if (!isset($_POST['savesubmit']) && $_POST['savesubmit'] == '' && !isset($_POST['clearsubmit']) && $_POST['clearsubmit'] == '') {
        $notes = stripslashes($self['notepad']);
        eval('$note_pad = "'.template('memcp_notepad').'";');
        echo $note_pad;
    }

    if (isset($_POST['savesubmit']) && $_POST['savesubmit'] != '') {
        $_POST['notes'] = addslashes(trim($_POST['notes']));
        $db->query("UPDATE ".X_PREFIX."members SET notepad='$_POST[notes]' WHERE username='$xmbuser'");
        redirect('memcp.php?action=notepad', 0);
    }

    if (isset($_POST['clearsubmit']) && $_POST['clearsubmit'] != '') {
        $db->query("UPDATE ".X_PREFIX."members SET notepad='' WHERE username='$xmbuser'");
        redirect('memcp.php?action=notepad', 0);
    }
    exit;
}
// Notepad Mod End

=======================================================================================================================================
=======
Step 4:
=======

=====================
Edit File: member.php
=====================

==================
Find Code 2 Times:
==================

                $db->query("INSERT INTO ".X_PREFIX."members (username,

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

) VALUES ('$username',

==========================
Replace Code With 2 Times:
==========================

, notepad) VALUES ('$username',

==================================================
Find Code At End Of Above Query Statement 2 Times:
==================================================

)");

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

, '')");

=======================================================================================================================================
=======
Step 5:
=======

====================
Edit File: index.php
====================

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

'index_welcome_member',

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

'index_welcome_member_notepad',

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

    if (X_MEMBER) {
        eval('$welcome = "'.template('index_welcome_member').'";');
    } else {
        eval('$welcome = "'.template('index_welcome_guest').'";');
    }

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

    if (X_MEMBER) {
        // Notepad Mod Begin
        $notepadlink = '';
        if ($SETTINGS['notepadstatus'] == 'on') {
            eval('$notepadlink = "'.template('index_welcome_member_notepad').'";');
        }
        // Notepad Mod End
        eval('$welcome = "'.template('index_welcome_member').'";');
    } else {
        eval('$welcome = "'.template('index_welcome_guest').'";');
    }

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

    $ticker = $welcome = $whosonline = $statsbar = $whosonlinetoday = '';

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

    $ticker = $welcome = $whosonline = $statsbar = $whosonlinetoday = $notepadlink = '';

=======================================================================================================================================
=======
Step 6:
=======

=====================================================
Go to admin panel -> templates-> index_welcome_member
=====================================================

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

<td width="33%"><a href="memcp.php"><strong>$lang[textusercp]</strong></a></td>

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

$notepadlink

====================
Find All Occassions:
====================

33%

============================
Replace All Occassions With:
============================

25%

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

<td colspan="3">

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

<td colspan="4">

=======================================================================================================================================
=======
Step 7:
=======

=====================================================================================
Go to admin panel -> templates-> create template name -> index_welcome_member_notepad
=====================================================================================

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

<td width="25%"><a href="#" onclick="Popup('memcp.php?action=notepad', 'Window', 350, 250)"><strong>$lang[notepad]</strong></a></td>

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

======================================================================
Go to admin panel -> templates-> create template name -> memcp_notepad
======================================================================

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
<title>$lang[notepad]</title>
$css
</head>
<body $THEME[bgcode] text="$text">
<form method="post" action="memcp.php?action=notepad">
<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center">
<tr>
<td bgcolor="$THEME[bordercolor]">
<table border="0" cellspacing="$THEME[borderwidth]" cellpadding="$THEME[tablespace]" width="100%" align="center">
<tr class="header">
<td align="center">$lang[notepad]</td>
</tr>
<tr class="ctrtablerow">
<td bgcolor="$THEME[altbg1]"><textarea name="notes" style="width: 100%" rows="10">$notes</textarea></td>
</tr>
<tr class="ctrtablerow">
<td bgcolor="$THEME[altbg2]"><input class="submit" type="submit" name="savesubmit" value="$lang[notepadsave]" />&nbsp;<input class="submit" type="submit" name="clearsubmit" value="$lang[notepadclear]" /></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>

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