Difference between revisions of "Add Private Note Display - TNG"

From Genwiki

Jump to: navigation, search
Line 86: Line 86:
 
#* Please post suggestions, or your own flavour of this mod to the forum or list
 
#* Please post suggestions, or your own flavour of this mod to the forum or list
  
[[Categories:TNG_mods]]
+
[[Categories:TNG mods]]

Revision as of 01:05, 14 December 2006

If you are not comfortable with html and php editing, this page may not be for you


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

  • Initial Release - Dec 13, 2006 - initial release (A request from the tngusers2 mail list.

Requirements

  1. A working TNG installation - see The Next Generation of Genealogy Sitebuilding
  2. A backup of your TNG personlib.php files


Side effects

  1. 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.
  2. 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

  1. backup your existing TNG personlib.php file
  2. open a copy of your personlib.php file
  3. 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
  1. close your personlib.php file and copy it to your base TNG directory
  2. check it out


In the event of a problem with your TNG site and this mod

  1. copy your backup personlib.php to your base TNG directory
    • all should be well now


Support

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

Categories:TNG mods

Personal tools