read())) { if (strstr($entry, ".")==".php") { include_once("blocks/".$entry); } } $d->close(); if (isset($_SESSION["timediff"])) $time = time()-$_SESSION["timediff"]; else $time = time(); $day = date("j", $time); $month = date("M", $time); $year = date("Y", $time); if ($USE_RTL_FUNCTIONS) { //-------> Today's Hebrew Day with Gedcom Month $datearray = array(); $datearray[0]["day"] = $day; $datearray[0]["mon"] = $monthtonum[str2lower(trim($month))]; $datearray[0]["year"] = $year; $datearray[0]["month"] = $month; $date = gregorianToJewishGedcomDate($datearray); $hDay = $date[0]["day"]; $hMonth = $date[0]["month"]; $hYear = $date[0]["year"]; // $currhDay = $hDay; // $currhMon = trim($date[0]["month"]); // $currhMonth = $monthtonum[str2lower($currhMon)]; $currhYear = $hYear; } if (!isset($action)) $action=""; //-- make sure that they have user status before they can use this page //-- otherwise have them login again $uname = getUserName(); if (empty($uname)) { if (!empty($command)) { if ($command=="user") { header("Location: login.php?help_message=mygedview_login_help&url=".urlencode("index.php?command=user")); exit; } } $command="gedcom"; } else $user = getUser($uname); if (empty($command)) $command="user"; if (!empty($uname)) { //-- add favorites action if (($action=="addfav")&&(!empty($gid))) { $gid = strtoupper($gid); if (!isset($favnote)) $favnote = ""; $indirec = find_gedcom_record($gid); $ct = preg_match("/0 @(.*)@ (.*)/", $indirec, $match); if ($indirec && $ct>0) { $favorite = array(); if (!isset($favtype)) { if ($command=="user") $favtype = "user"; else $favtype = "gedcom"; } if ($favtype=="gedcom") $favtype = $GEDCOM; else $favtype=$uname; $favorite["username"] = $favtype; $favorite["gid"] = $gid; $favorite["type"] = trim($match[2]); $favorite["file"] = $GEDCOM; $favorite["url"] = ""; $favorite["note"] = $favnote; $favorite["title"] = ""; addFavorite($favorite); } } if (($action=="addfav")&&(!empty($url))) { if (!isset($favnote)) $favnote = ""; if (empty($favtitle)) $favtitle = $url; $favorite = array(); if (!isset($favtype)) { if ($command=="user") $favtype = "user"; else $favtype = "gedcom"; } if ($favtype=="gedcom") $favtype = $GEDCOM; else $favtype=$uname; $favorite["username"] = $favtype; $favorite["gid"] = ""; $favorite["type"] = "URL"; $favorite["file"] = $GEDCOM; $favorite["url"] = $url; $favorite["note"] = $favnote; $favorite["title"] = $favtitle; addFavorite($favorite); } if (($action=="deletefav")&&(isset($fv_id))) { deleteFavorite($fv_id); } else if ($action=="deletemessage") { if (isset($message_id)) { if (!is_array($message_id)) deleteMessage($message_id); else { foreach($message_id as $indexval => $mid) { if (isset($mid)) deleteMessage($mid); } } } } else if (($action=="deletenews")&&(isset($news_id))) { deleteNews($news_id); } } //-- get the blocks list if ($command=="user") { $ublocks = getBlocks($uname); if ((count($ublocks["main"])==0) and (count($ublocks["right"])==0)) { $ublocks["main"][] = array("print_todays_events", ""); $ublocks["main"][] = array("print_user_messages", ""); $ublocks["main"][] = array("print_user_favorites", ""); $ublocks["right"][] = array("print_welcome_block", ""); $ublocks["right"][] = array("print_random_media", ""); $ublocks["right"][] = array("print_upcoming_events", ""); $ublocks["right"][] = array("print_logged_in_users", ""); } } else { $ublocks = getBlocks($GEDCOM); if ((count($ublocks["main"])==0) and (count($ublocks["right"])==0)) { $ublocks["main"][] = array("print_gedcom_stats", ""); $ublocks["main"][] = array("print_gedcom_news", ""); $ublocks["main"][] = array("print_gedcom_favorites", ""); $ublocks["main"][] = array("review_changes_block", ""); $ublocks["right"][] = array("print_gedcom_block", ""); $ublocks["right"][] = array("print_random_media", ""); $ublocks["right"][] = array("print_todays_events", ""); $ublocks["right"][] = array("print_logged_in_users", ""); } } //-- Set some behaviour controls that depend on which blocks are selected $welcome_block_present = false; $gedcom_block_present = false; $top10_block_present = false; $login_block_present = false; foreach($ublocks["right"] as $block) { if ($block[0]=="print_welcome_block") $welcome_block_present = true; if ($block[0]=="print_gedcom_block") $gedcom_block_present = true; if ($block[0]=="print_block_name_top10") $top10_block_present = true; if ($block[0]=="print_login_block") $login_block_present = true; } foreach($ublocks["main"] as $block) { if ($block[0]=="print_welcome_block") $welcome_block_present = true; if ($block[0]=="print_gedcom_block") $gedcom_block_present = true; if ($block[0]=="print_block_name_top10") $top10_block_present = true; if ($block[0]=="print_login_block") $login_block_present = true; } if ($command=="user") { $helpindex = "index_myged_help"; print_header($pgv_lang["mygedview"]); } else { print_header($GEDCOMS[$GEDCOM]["title"]); } ?>