コード例 #1
0
function print_welcome_block($block = true, $config = "", $side, $index)
{
    global $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES;
    $id = "user_welcome";
    $title = $pgv_lang["welcome"] . " " . getUserFullName(PGV_USER_ID);
    $content = "<table class=\"blockcontent\" cellspacing=\"0\" cellpadding=\"0\" style=\" width: 100%; direction:ltr;\"><tr>";
    $content .= "<td class=\"tab_active_bottom\" colspan=\"3\" ></td></tr><tr>";
    if (get_user_setting(PGV_USER_ID, 'editaccount') == 'Y') {
        $content .= "<td class=\"center details2\" style=\" width: 33%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"edituser.php\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["mygedview"]["small"] . "\" border=\"0\" alt=\"" . $pgv_lang["myuserdata"] . "\" title=\"" . $pgv_lang["myuserdata"] . "\" /><br />" . $pgv_lang["myuserdata"] . "</a></td>";
    }
    if (PGV_USER_GEDCOM_ID) {
        $content .= "<td class=\"center details2\" style=\" width: 34%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"" . encode_url("pedigree.php?rootid=" . PGV_USER_GEDCOM_ID) . "\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["pedigree"]["small"] . "\" border=\"0\" alt=\"" . $pgv_lang["my_pedigree"] . "\" title=\"" . $pgv_lang["my_pedigree"] . "\" /><br />" . $pgv_lang["my_pedigree"] . "</a></td>";
        $content .= "<td class=\"center details2\" style=\" width: 33%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"" . encode_url("individual.php?pid=" . PGV_USER_GEDCOM_ID) . "\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["indis"]["small"] . "\" border=\"0\" alt=\"" . $pgv_lang["my_indi"] . "\" title=\"" . $pgv_lang["my_indi"] . "\" /><br />" . $pgv_lang["my_indi"] . "</a></td>";
    }
    $content .= "</tr><tr><td class=\"center\" colspan=\"3\">";
    $content .= print_help_link("mygedview_customize_help", "qm", "", false, true);
    $content .= "<a href=\"javascript:;\" onclick=\"window.open('" . encode_url("index_edit.php?name=" . PGV_USER_NAME . "&ctype=user") . "', '_blank', 'top=50,left=10,width=600,height=350,scrollbars=1,resizable=1');\">" . $pgv_lang["customize_page"] . "</a>";
    $content .= "<br />" . format_timestamp(client_time());
    $content .= "</td>";
    $content .= "</tr></table>";
    global $THEME_DIR;
    if ($block) {
        require $THEME_DIR . 'templates/block_small_temp.php';
    } else {
        require $THEME_DIR . 'templates/block_main_temp.php';
    }
}
コード例 #2
0
function print_gedcom_block($block = true, $config = "", $side, $index)
{
    global $hitCount, $pgv_lang, $SHOW_COUNTER;
    $id = "gedcom_welcome";
    $title = PrintReady(get_gedcom_setting(PGV_GED_ID, 'title'));
    $content = "<div class=\"center\">";
    $content .= "<br />" . format_timestamp(client_time()) . "<br />\n";
    if ($SHOW_COUNTER) {
        $content .= $pgv_lang["hit_count"] . " " . $hitCount . "<br />\n";
    }
    $content .= "\n<br />";
    if (PGV_USER_GEDCOM_ADMIN) {
        $content .= "<a href=\"javascript:;\" onclick=\"window.open('" . encode_url("index_edit.php?name=" . PGV_GEDCOM . "&ctype=gedcom") . "', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1'); return false;\">" . $pgv_lang["customize_gedcom_page"] . "</a><br />\n";
    }
    $content .= "</div>";
    global $THEME_DIR;
    require $THEME_DIR . 'templates/block_main_temp.php';
}
コード例 #3
0
     }
 }
 //-- delete the cache files for the welcome page blocks
 require_once PGV_ROOT . 'includes/index_cache.php';
 clearCache();
 $logline = AddToLog("Gedcom configuration " . $INDEX_DIRECTORY . $FILE . "_conf.php" . " updated");
 $gedcomconfname = $FILE . "_conf.php";
 check_in($logline, $gedcomconfname, $INDEX_DIRECTORY);
 if (!$errors) {
     $gednews = getUserNews($FILE);
     if (count($gednews) == 0) {
         $news = array();
         $news["title"] = "#default_news_title#";
         $news["username"] = $FILE;
         $news["text"] = "#default_news_text#";
         $news["date"] = client_time();
         addNews($news);
     }
     if ($source == "upload_form") {
         $check = "upload";
     } elseif ($source == "add_form") {
         $check = "add";
     } elseif ($source == "add_new_form") {
         $check = "add_new";
     }
     if (!isset($bakfile)) {
         $bakfile = "";
     }
     if ($source !== "") {
         header("Location: " . encode_url("uploadgedcom.php?action={$source}&check={$check}&step=2&GEDFILENAME={$GEDFILENAME}&path={$path}&verify=verify_gedcom&bakfile={$bakfile}", false));
     } else {
コード例 #4
0
/**
 * Adds a news item to the database
 *
 * This function adds a news item represented by the $news array to the database.
 * If the $news array has an ["id"] field then the function assumes that it is
 * as update of an older news item.
 *
 * @author John Finlay
 * @param array $news a news item array
 */
function addNews($news)
{
    global $TBLPREFIX;
    if (!isset($news["date"])) {
        $news["date"] = client_time();
    }
    if (!empty($news["id"])) {
        // In case news items are added from usermigrate, it will also contain an ID.
        // So we check first if the ID exists in the database. If not, insert instead of update.
        $exists = PGV_DB::prepare("SELECT 1 FROM {$TBLPREFIX}news where n_id=?")->execute(array($news["id"]))->fetchOne();
        if (!$exists) {
            return (bool) PGV_DB::prepare("INSERT INTO {$TBLPREFIX}news (n_id, n_username, n_date, n_title, n_text) VALUES (?, ? ,? ,? ,?)")->execute(array($news["id"], $news["username"], $news["date"], $news["title"], $news["text"]));
        } else {
            return (bool) PGV_DB::prepare("UPDATE {$TBLPREFIX}news SET n_date=?, n_title=? , n_text=? WHERE n_id=?")->execute(array($news["date"], $news["title"], $news["text"], $news["id"]));
        }
    } else {
        return (bool) PGV_DB::prepare("INSERT INTO {$TBLPREFIX}news (n_id, n_username, n_date, n_title, n_text) VALUES (?, ? ,? ,? ,?)")->execute(array(get_next_id("news", "n_id"), $news["username"], $news["date"], $news["title"], $news["text"]));
    }
}
コード例 #5
0
ファイル: admin.php プロジェクト: rathervague/phpgedview
    }
}
echo PGV_JS_START, 'function showchanges() {window.location.reload();}', PGV_JS_END;
?>
	<table class="center <?php 
echo $TEXT_DIRECTION;
?>
 width90">
		<tr>
			<td colspan="2" class="topbottombar">
			<?php 
echo '<h2>', PGV_PHPGEDVIEW, ' ', PGV_VERSION_TEXT, '<br />', $pgv_lang['administration'], '</h2>';
echo $pgv_lang["system_time"];
echo " ", format_timestamp(time());
echo "<br />", $pgv_lang["user_time"];
echo " ", format_timestamp(client_time());
if (PGV_USER_IS_ADMIN) {
    if ($err_write) {
        echo "<br /><span class=\"error\">";
        echo $pgv_lang["config_still_writable"];
        echo "</span><br /><br />";
    }
    if ($verify_msg) {
        echo "<br />";
        echo "<a href=\"", encode_url("useradmin.php?action=listusers&filter=admunver"), "\" class=\"error\">", $pgv_lang["admin_verification_waiting"], "</a>";
        echo "<br /><br />";
    }
    if ($warn_msg) {
        echo "<br />";
        echo "<a href=\"", encode_url("useradmin.php?action=listusers&filter=warnings"), "\" class=\"error\" >", $pgv_lang["admin_user_warnings"], "</a>";
        echo "<br /><br />";
コード例 #6
0
ファイル: class_stats.php プロジェクト: bitweaver/phpgedview
 static function browserTimezone()
 {
     return date('T', client_time());
 }
コード例 #7
0
/**
* XML <PGVRNow /> elemnt handler
*
* @see PGVRElement::addText()
* @final
*/
function PGVRNowSHandler()
{
    global $currentElement;
    $g = timestamp_to_gedcom_date(client_time());
    $currentElement->addText($g->Display());
}
コード例 #8
0
function client_jd()
{
    return timestamp_to_jd(client_time());
}