
I do like this mod quite a bit but really felt it didn't belong in the overall header and decided it needed to be in the User control panel with all of the other personal user stuff, since it is personal notes.
Now the link says what it is too, personal notes. Just a few file edits, a language addition, template changes and such and we are ready to boogie.
If you already have this mod installed, you will be deleting the files "notes.html", notes.php (from the root folder)(full details in delete and file copy instructions further down) and also removing the edit for the link display from the overall header plus the edits for the /includes/functions.php. I made these changes for prosilver, and subsilver2 based styles.
Let's begin shall we, now you too will create this module on your board per my instructions.
Open: /includes/ucp/info/ucp_main.php
Find:
Code: Select all
'drafts' => array('title' => 'UCP_MAIN_DRAFTS', 'auth' => '', 'cat' => array('UCP_MAIN')),
Code: Select all
'notes' => array('title' => 'UCP_MAIN_NOTES', 'auth' => '', 'cat' => array('UCP_MAIN')),
Open: /includes/ucp/ucp_main.php
Find:
Code: Select all
if (!$edit)
{
$template->assign_var('S_DRAFT_ROWS', $row_count);
}
break;
Code: Select all
case 'notes':
$user->add_lang('mods/notes');
add_form_key('users_notes');
if ( isset($_POST['snote']) )
{
$note = utf8_normalize_nfc( request_var('note', '', true) );
$note_ready = $db->sql_escape($note);
// and finaly adding new notes into database
$db->sql_query("UPDATE " . USERS_TABLE . " SET user_note = '" . $note_ready . "' WHERE user_id = " . $user->data['user_id']);
trigger_error( sprintf($user->lang['NOTES_SAVED'], append_sid("{$phpbb_root_path}ucp.$phpEx" , 'i=main&mode=notes')) );
}
// create a template variables
$template->assign_vars(array(
'NOTE' => $user->data['user_note'],
));
page_header($user->lang['NOTES']);
$template->set_filenames(array(
'body' => 'ucp_main_notes.html',
));
;
break;
Open: /language/en/ucp.php
Find:
Code: Select all
'UCP_MAIN_SUBSCRIBED' => 'Manage subscriptions',
Code: Select all
'UCP_MAIN_NOTES' => 'Personal Notes',
Remove or delete the file "notes.php" from your phpbb root directory.
Path: root/notes.php
Note: (We remove this because all of the needed code is in the new includes/ucp_main.php file edits. We no longer need to check for bots in the notes because bots are not going to be inside ucp of personal users, and also no log in check is required because users already have to be logged in to see their ucp panel.)
Remove or delete the file "notes.html" from your styles templates directory if you already have this mod installed.
Path: /styles/prosilver/templates/notes.html
or /styles/subsilver2/templates/notes.html
Remove the "overall_header.html" edits from this mod if you have previously added them.
Path: /styles/prosilver/templates/overall_header.html
or /styles/subsilver2/templates/overall_header.html
Remove the "includes/functions.php" edits from this mod if you have previously added them.
Path: /includes/functions.php
Here are my newly created template files for this along with css file for both prosilver, subsilver2, and in the contrib folder I've provided the files for X-Treme Purple. I've included the newly edited language file as well for those who don't have it already.
File Copy *I said prosilver or subsilver2 in the file paths as to not have to explain the same thing twice.
1. Copy: /styles/prosilver or subsilver2/template/ucp_main_notes.html
To: /styles/prosilver or subsilver2/template/ucp_main_notes.html
2. Copy: /styles/prosilver or subsilver2/theme/notes.css
To: /styles/prosilver or subsilver2/theme/notes.css
// If you don't already have this new version of the language file, or don't have this mod at all.
3. Copy: /language/en/mods/notes.php
To: /language/en/mods/notes.php
The same file copies for X-Treme purple if you are doing that, and those again are in the contrib folder.
No other files are included with this version of the mod.
Clear your cache.
These next steps are the most important ones for the completion, as it's how you obtain the view and activation of the module.
1. Go to your admin control panel.
2. Click on the "System" tab.
3. Scroll down to the left hand side where it says "Module management" and then click on "User Control Panel".
4. After the ucp module settings page loads, look (ONLY LOOK) towards the right hand bottom for the drop down menu NEXT TO the button that says "add module" and open the drop down menu after which scroll until you see the entries for "Overview [ucp_main]", then within that list populated under it you select "Personal Notes".
5. then click the "Add Module" button directly next to the drop down from which you just made your selection.
6. Once your module has been added, you will see it within the main modules list, and from there you will click the word "enable" to enable your module.
Note: You can enable or disable it from showing on the ucp from any time from within these settings.
7. You may move the new module up or down to the position in which you wish for it to show in your ucp.
Clear your cache for fun.
Here is an illustration with the areas squared out in red so you can see the spots you need to be working with for the above steps numbered 1-7.
Note: Click the image or open in a new tab/window to view full size.
Now for some screenies!
Prosilver
Subsilver2
X-Treme Purple
__________________________________________________________________________________
Note: If you don't have this mod installed previously, you can still install this by following all of the above steps and ignoring the part about removing edits and deleting mod files for this mod, lol duh. You would then need to execute the sql query for this mod (Only if you don't have this mod already, making this clear as to not confuse anyone.)
Here is the query (Remember, don't execute this query unless you have NOT installed the mod ever, if you have the previous version of the mod, then you don't need this query)
Code: Select all
ALTER TABLE phpbb_users ADD user_note TEXT NOT NULL;
Find:
Code: Select all
'NOTIFY_ADMIN_EMAIL' => 'Please notify the board administrator or webmaster: <a href="mailto:%1$s">%1$s</a>',
Code: Select all
'NOTES' => 'Notes',
__________________________________________________________________________________
That's it!!!
If you don't like my custom css that I recently created for subsilver based styles, then you can follow the instructions here and apply the changes to the file "ucp_main_notes.html", instead of the "notes.html".
https://www.phpbb.com/customise/db/mod/ ... 86#p551286
then in "ucp_main_notes.html" you'd need to change the table width in the main table for the template to "100%" instead of what it is now which is "98%". Again, that's only if you don't like the custom css I added, so if you like it, just follow the instructions to install.
Enjoy!

