Difference between revisions of "Add Private Note Display - TNG"
From Genwiki
m (intermediate save, not done yet) |
(Revision 0 - initial post) |
||
Line 27: | Line 27: | ||
==TNG Modifications V6.0.3== | ==TNG Modifications V6.0.3== | ||
− | # backup your existing TNG | + | # 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 | |
− | # | + | <nowiki> |
− | #* | + | function getNotes( $persfamID, $flag ) { |
− | <nowiki> </ | + | global $notelinks_table, $xnotes_table, $tree, $eventtypes_table, $events_table, $text, $eventswithnotes; |
− | + | </nowiki> | |
− | < | + | ::* change to this <font color=red><b>(red sections are the differences)</b></font> |
− | + | <nowiki> | |
− | + | function getNotes( $persfamID, $flag ) { | |
− | ::* to this | + | global </nowiki><font color=red><b>$allow_admin, </b></font><nowiki>$notelinks_table, $xnotes_table, $tree, $eventtypes_table, $events_table, $text, $eventswithnotes; |
− | + | </nowiki> | |
− | < | + | |
− | < | + | :* and locate the following code |
− | + | <nowiki> | |
− | + | ||
− | + | $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 | |
− | ::* you can copy the | + | LEFT JOIN $xnotes_table on $notelinks_table.xnoteID = $xnotes_table.ID AND $notelinks_table.gedcom = $xnotes_table.gedcom |
− | <ol start= | + | LEFT JOIN $events_table ON $notelinks_table.eventID = $events_table.eventID |
− | <li> close your | + | 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"; | |
+ | </nowiki> | ||
+ | ::* change to this <font color=red><b>(red sections are the differences)</b></font> | ||
+ | <font color=red><b><nowiki> | ||
+ | if( $allow_admin == "1") { | ||
+ | $hidenotes = " "; | ||
+ | } | ||
+ | else { | ||
+ | $hidenotes = " AND secret !=\"1\" "; | ||
+ | } | ||
+ | </nowiki></b></font><nowiki> | ||
+ | $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\" </nowiki><font color=red><b>$hidenotes</b></font><nowiki> | ||
+ | ORDER BY ordernum, tag, eventdatetr, $notelinks_table.ID"; | ||
+ | </nowiki> | ||
+ | |||
+ | ::* you can copy the bits of red text from above to paste into your file | ||
+ | <ol start=4> | ||
+ | <li> close your personlib.php file and copy it to your base TNG directory </li> | ||
<li> check it out </li> | <li> check it out </li> | ||
</ol> | </ol> | ||
− | ==In the event of a problem with your TNG site== | + | ==In the event of a problem with your TNG site and this mod== |
# copy your backup personlib.php to your base TNG directory | # copy your backup personlib.php to your base TNG directory |
Revision as of 01:04, 14 December 2006
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
- 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 files
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