Search Forums
Forums
Kiwitrees on Twitter
    Tags

    hover, partner, add missing death, 7.2, 3.2.2, .po, My Page, menus, CREM, simpl_pages, research tasks, fancy tree view, transifex, updates, edit, tree, php 7, CHR, resources, chart, ckeditor, prefix, error, HTML block, GEDCOM errors, simpl_grey, family fact, add_asso_facts, googlemaps, family, progress, notes, prison, name, performance, colors, danish, survey, tab, watermark, Administration, calendar.php issue, errors, footer, sanity checker, IE11, re-order, merge, Advanced search, menu, zend, clipboard, IE problem, Georgian, contact links, missing data, husband, 3.3.0, theme, margin

    #10216
    kiwi
    kiwi
    Keymaster

    1643 posts

    Do really just want to check for “empty”, or also for “invalid”, or for ‘null’? These are all different states.

    The normal check uses the function “isOK()”. Used throughout the system (for dates), a good place to look for examples would be in “includes\functions\functions_print.php”. Just do a search for that function in there to see many examples.
    You could also look in the same file for examples of the function “canShow()”. This checks that facts/events can be displayed in the context of this viewer without breaking all or any privacy rule settings. Privacy can be relevant to a fact/event level, record, (indi, fam, etc), family tree or even site levels.

    There is no built-in function like it for TIME. In fact, it’s use is not encouraged, as it was removed completely as a valid tag, from GEDCOM ver 5.5.1, which is the version kiwitrees tries to follow. So to be strictly correct you should not use it or expect it to exist. Of course, you still can, and many people do, but it has never been given any validation checking.

    With PLAC it is much more complex. PHP isset() or empty() or is_null()would be a start. But you mention “with LAT & LONG data-filled“. That a whole larger issue. You need to check the PLAC tag, and then separately check if a matching place, with coordinates, exists in the Google Map module table (##placelocations), AND that the GM module exists and is currently active for this user. Check the code in the Google Maps module for methods around this topic, perhaps especially in the sections module.php related to the “place-check” function.
    But you might also want to check LAT/Long tags in the GEDCOM data, as these can be entered without the use of the GM module.

    Nigel
    My personal kiwitrees site is www.our-families.info