To add an individual, a family, or a source to your favorites, click on the Add a new favorite link to reveal some fields where you can enter or search for an ID number. Instead of an ID number, you can enter a URL and a title.'); } else { $content .= i18n::translate('At this moment there are no selected Favorites. The admin can add Favorites to display at startup.'); } } else { $content .= i18n::translate('You have not selected any favorites.

To add an individual, a family, or a source to your favorites, click on the Add a new favorite link to reveal some fields where you can enter or search for an ID number. Instead of an ID number, you can enter a URL and a title.'); } } else { if(!$isged) { $mygedcom = $GEDCOM; $current_gedcom = $GEDCOM; } $content .= ""; foreach($userfavs as $k=>$favorite) { if(isset($favorite['id'])){$k = $favorite['id'];} $removeFavourite = "".i18n::translate('Remove')."
\n"; if(!$isged) { $current_gedcom = $GEDCOM; $GEDCOM = $favorite['file']; } $content .= '\n" ; } $content .= "
'; if($favorite['type'] == 'URL') { $content .= "
\n"; if($ctype == 'user' || WT_USER_GEDCOM_ADMIN){$content .= $removeFavourite;} $content .= "".PrintReady($favorite['title']).''; $content .= "
\n".PrintReady($favorite['note'], false, true); $content .= "
\n"; } else { if(displayDetailsById($favorite['gid'], $favorite['type'])) { require $INDEX_DIRECTORY.$GEDCOM.'_conf.php'; switch($favorite['type']) { case 'INDI': { $indirec = find_person_record($favorite['gid'], get_id_from_gedcom($GEDCOM)); $content .= "
\n"; if($ctype == 'user' || WT_USER_GEDCOM_ADMIN){$content .= $removeFavourite;} ob_start(); print_pedigree_person($favorite['gid'], 2, 1, $k); $content .= ob_get_clean(); $content .= PrintReady($favorite['note'], false, true); $content .= "
\n"; break; } default: { $record=GedcomRecord::getInstance($favorite['gid']); $content .= "
\n"; if($ctype == 'user' || WT_USER_GEDCOM_ADMIN){$content .= $removeFavourite;} $content .= $record->format_list('span'); $content .= "
\n".PrintReady($favorite['note'], false, true); $content .= "
\n"; break; } } if(!$isged) { $GEDCOM = $mygedcom; require $INDEX_DIRECTORY.$GEDCOM.'_conf.php'; } } } $content .= "\n" ."
\n"; } if(($isged && WT_USER_GEDCOM_ADMIN) || !$isged) { $content .= '
'; $uniqueID = floor(microtime() * 1000000); if($isged) { $content .= "\"\" ".i18n::translate('Add a new favorite')."" .help_link('index_add_favorites') ."
\n
\n" ."
\n" ."\n" ; } else { $content .= "\"\" ".i18n::translate('Add a new favorite')."" .help_link('index_add_favorites') ."
\n
\n" ."\n" ."\n" ; } $content .= "\n" ."\n" ."\n" ."" ."
".i18n::translate('Enter a Person, Family, or Source ID')."
\n" ."" .print_findindi_link("gid{$uniqueID}", '', true) .print_findfamily_link("gid{$uniqueID}", '', true) .print_findsource_link("gid{$uniqueID}", '', true) .print_findrepository_link("gid{$uniqueID}",'',true) .print_findnote_link("gid{$uniqueID}",'',true) .print_findmedia_link("gid{$uniqueID}",'1','',true) ."
".i18n::translate('OR
Enter a URL and a title') ."" ."
".i18n::translate('URL')."
".i18n::translate('Title:')."
" ."
" .i18n::translate('Enter an optional note about this favorite') ."
\n" ."
\n" ."
\n" ."\n
\n" ; } // Restore GEDCOM configuration unset($show_full); if(isset($saveShowFull)){$show_full = $saveShowFull;} $PEDIGREE_FULL_DETAILS = $savePedigreeFullDetails; return $content; } static function gedcomFavorites(){return self::_getFavorites(true);} static function userFavorites(){return self::_getFavorites(false);} static function totalGedcomFavorites(){return count(getUserFavorites($GLOBALS['GEDCOM']));} static function totalUserFavorites(){return count(getUserFavorites(WT_USER_NAME));} /////////////////////////////////////////////////////////////////////////////// // Messages // /////////////////////////////////////////////////////////////////////////////// static function userMessages() { global $WT_IMAGE_DIR, $TEXT_DIRECTION, $WT_STORE_MESSAGES, $WT_IMAGES; $usermessages = getUserMessages(WT_USER_NAME); $content = "
"; if(count($usermessages) == 0) { $content .= i18n::translate('You have no pending messages.')."
"; } else { $content .= ' '; $content .= '' .'' ."\n" ."\n" ."\n" ."\n" ."\n"; foreach($usermessages as $k=>$message) { if(isset($message['id'])){$k = $message['id'];} $content .= "\n\n"; $showmsg = preg_replace('/(\w)\/(\w)/',"\$1/ \$2", PrintReady($message['subject'])); $showmsg = str_replace("@","@ ", $showmsg); $content .= "\n"; if(!empty($message['created'])){$t = strtotime($message['created']);}else{$t = time();} $content .= '\n".'\n" ."\n" ."\n\n\n"; } $content .= "
".i18n::translate('Delete')."
\n".i18n::translate('ALL')."
".i18n::translate('Subject:')."".i18n::translate('Date Sent:')."".i18n::translate('Email Address:')."
{$showmsg} \"\"'.format_timestamp($t)."'; $user_id = get_user_id($message['from']); if($user_id) { $content .= PrintReady(getUserFullName($user_id)); if($TEXT_DIRECTION == 'ltr') { $content .= ' '.getLRM().' - '.htmlspecialchars($user_id,ENT_COMPAT,'UTF-8').getLRM(); } else { $content .= ' '.getRLM().' - '.htmlspecialchars($user_id,ENT_COMPAT,'UTF-8').getRLM(); } } else { $content .= "".str_replace("@","@ ", $user_id).''; } $content .= "
" ; $message['body'] = expand_urls(nl2br(htmlspecialchars($message['body'],ENT_COMPAT,'UTF-8'))); $content .= PrintReady($message['body'])."
\n
\n"; if(strpos($message["subject"], "RE:")===false) { $message['subject'] = "RE:{$message['subject']}"; } if($user_id) { $content .= "".i18n::translate('Reply')." | "; } $content .= "".i18n::translate('Delete')."
\n" ."
\n
\n" ; } if(get_user_count() > 1) { $content .= i18n::translate('Send Message')." \n\n"; } $content .= "
\n"; return $content; } function totalUserMessages(){return count(getUserMessages(WT_USER_NAME));} /////////////////////////////////////////////////////////////////////////////// // Journal // /////////////////////////////////////////////////////////////////////////////// static function userJournal() { global $WT_IMAGE_DIR, $WT_IMAGES, $TEXT_DIRECTION, $ctype; $usernews = getUserNews(WT_USER_ID); $content = ''; if(count($usernews) == 0) { $content .= i18n::translate('You have not created any Journal items.')." "; } foreach($usernews as $k=>$news) { $day = date('j', $news['date']); $mon = date('M', $news['date']); $year = date('Y', $news['date']); $content .= "
"; $news['title']=embed_globals($news['title']); $news['text' ]=embed_globals($news['text' ]); $trans = array_flip(get_html_translation_table(HTML_SPECIALCHARS)); $news['text'] = strtr($news['text'], $trans); $content .= PrintReady($news['text'])."
\n
\n" ."".i18n::translate('Edit')." | " ."".i18n::translate('Delete')."
\n" ."

\n" ; } if(WT_USER_ID) { $content .= "
\n".i18n::translate('Add a new Journal entry').""; } return $content; } function totalUserJournal(){ return count(getUserNews(WT_USER_ID));} /////////////////////////////////////////////////////////////////////////////// // News // /////////////////////////////////////////////////////////////////////////////// static function gedcomNews($params=null) { global $WT_IMAGE_DIR, $WT_IMAGES, $TEXT_DIRECTION, $GEDCOM, $ctype; if($params === null){$params = array();} if(isset($params[0]) && $params[0] != ''){$limit = strtolower($params[0]);}else{$limit = 'count';} if(isset($params[1]) && $params[1] != ''){$flag = strtolower($params[0]);}else{$flag = 5;} // News postings if($flag == 0){$limit = 'nolimit';} if(isset($_REQUEST['gedcom_news_archive'])) { $limit = 'nolimit'; $flag = 0; } $usernews = getUserNews($GEDCOM); $content = ''; if(count($usernews) == 0) { $content .= i18n::translate('No News articles have been submitted.')."
\n"; } $c = 0; $td = time(); foreach($usernews as $k=>$news) { if($limit == 'count') { if($c >= $flag){break;} $c++; } if($limit == 'date') { if(floor(($td - $news['date']) / 86400) > $flag){break;} } $content .= "
\n"; // Look for $GLOBALS substitutions in the News title $newsTitle = embed_globals($news['title']); $content .= "".PrintReady($newsTitle)."
\n"; $content .= "".format_timestamp($news['date'])."

\n"; // Look for $GLOBALS substitutions in the News text $newsText = embed_globals($news['text']); $trans = get_html_translation_table(HTML_SPECIALCHARS); $trans = array_flip($trans); $newsText = strtr($newsText, $trans); //$newsText = nl2br($newsText); $content .= PrintReady($newsText)."
\n"; // Print Admin options for this News item if(WT_USER_GEDCOM_ADMIN) { $content .= "
" ."".i18n::translate('Edit')." | " ."".i18n::translate('Delete')."
" ; } $content .= "
\n"; } $printedAddLink = false; if(WT_USER_GEDCOM_ADMIN) { $content .= "".i18n::translate('Add a News article').""; $printedAddLink = true; } if($limit == 'date' || $limit == 'count') { if($printedAddLink){$content .= '  |  ';} $content .= "".i18n::translate('View archive').""; $content .= help_link('gedcom_news_archive'); $content .= '
'; } return $content; } function totalGedcomNews(){return count(getUserNews($GLOBALS['GEDCOM']));} /////////////////////////////////////////////////////////////////////////////// // Block // /////////////////////////////////////////////////////////////////////////////// static function callBlock($params=null) { if($params === null){return '';} if(isset($params[0]) && $params[0] != ''){$block = strtolower($params[0]);}else{return '';} $func = "print_{$block}"; if(!function_exists("print_{$block}")){return '';} // Build the config array array_shift($params); $cfg = array(); foreach($params as $config) { $bits = explode('=', $config); if(count($bits) < 2){continue;} $v = array_shift($bits); $cfg[$v] = join('=', $bits); } // Run the block and retrive its contents ob_start(); $func(false, $cfg, 'main', 9999); $out = ob_get_clean(); // Rip out the content of the block return trim(substr(trim(stristr($out, 'blockcontent')), 14, -12)); } /////////////////////////////////////////////////////////////////////////////// // System // // Only allowed in GEDCOM Home Page, not user portals for security. // /////////////////////////////////////////////////////////////////////////////// static function includeFile($params=null) { if(!isset($_GET['ctype']) || $_GET['ctype'] != 'gedcom'){return '';} if($params === null){$params = array();} if(isset($params[0]) && $params[0] != ''){$fn = $params[0];}else{return '';} if(!file_exists($fn) || stristr($fn, 'config.php')){return '';} ob_start(); include filename_decode(real_path($fn)); return trim(ob_get_clean()); } }