Add Private Note Display - TNG
From Genwiki
If you are not comfortable with html and php editing, this page may not be for you
Contents
Overview
This TNG modification deals with notes. It is a modification to the person pages so that notes that are marked "Private" will display for admin users.
Revision History
- July 12, 2007 - validated for TNG V6.1.1
- Initial Release - Dec 13, 2006 - initial release (A request from the tngusers2 mail list).
Requirements
- A working TNG installation - see The Next Generation of Genealogy Sitebuilding
- A backup of your TNG personlib.php file
Side effects
- As with most source code modifications, these changes will likely be overwritten during your next TNG revision upgrade and will need to be re-implemented.
- The TNG "Private" flag for notes will be overwritten during a GEDCOM import. This mod is most useful for those who use TNG as their only genealogy database program and do not use a desktop application with a GEDCOM import to TNG.
TNG Modifications V6.0.3
- backup your existing TNG personlib.php file
- open a copy of your personlib.php file
- There are two sections to change, both within 30 lines of each other
- locate the following code
function getNotes( $persfamID, $flag ) { global $notelinks_table, $xnotes_table, $tree, $eventtypes_table, $events_table, $text, $eventswithnotes;
- change to this (red sections are the differences)
function getNotes( $persfamID, $flag ) { global $allow_admin, $notelinks_table, $xnotes_table, $tree, $eventtypes_table, $events_table, $text, $eventswithnotes;
- and locate the following code
$query = "SELECT display, $xnotes_table.note as note, $notelinks_table.eventID as eventID,$notelinks_table.xnoteID as xnoteID, $notelinks_table.ID as ID, noteID FROM $notelinks_table LEFT JOIN $xnotes_table on $notelinks_table.xnoteID = $xnotes_table.ID AND $notelinks_table.gedcom = $xnotes_table.gedcom LEFT JOIN $events_table ON $notelinks_table.eventID = $events_table.eventID LEFT JOIN $eventtypes_table on $eventtypes_table.eventtypeID = $events_table.eventtypeID WHERE $notelinks_table.persfamID=\"$persfamID\" AND $notelinks_table.gedcom=\"$tree\" AND secret!=\"1\" ORDER BY ordernum, tag, eventdatetr, $notelinks_table.ID";
- change to this (red sections are the differences)
if( $allow_admin == "1") { $hidenotes = " "; } else { $hidenotes = " AND secret !=\"1\" "; } $query = "SELECT display, $xnotes_table.note as note, $notelinks_table.eventID as eventID,$notelinks_table.xnoteID as xnoteID, $notelinks_table.ID as ID, noteID FROM $notelinks_table LEFT JOIN $xnotes_table on $notelinks_table.xnoteID = $xnotes_table.ID AND $notelinks_table.gedcom = $xnotes_table.gedcom LEFT JOIN $events_table ON $notelinks_table.eventID = $events_table.eventID LEFT JOIN $eventtypes_table on $eventtypes_table.eventtypeID = $events_table.eventtypeID WHERE $notelinks_table.persfamID=\"$persfamID\" AND $notelinks_table.gedcom=\"$tree\" $hidenotes ORDER BY ordernum, tag, eventdatetr, $notelinks_table.ID";
- you can copy the bits of red text from above to paste into your file
- close your personlib.php file and copy it to your base TNG directory
- check it out
In the event of a problem with your TNG site and this mod
- copy your backup personlib.php to your base TNG directory
- all should be well now
Support
- You're sort of on your own... If you have a specific question, or feel some additional info in the above would help others, feel free to contact me directly. Mail me here
- Please post suggestions, or your own flavour of this mod to the forum or list