当前位置: 首页>>代码示例>>PHP>>正文


PHP print_text函数代码示例

本文整理汇总了PHP中print_text函数的典型用法代码示例。如果您正苦于以下问题:PHP print_text函数的具体用法?PHP print_text怎么用?PHP print_text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了print_text函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: print_recent_changes

function print_recent_changes($block = true, $config = "", $side, $index)
{
    global $pgv_lang, $ctype;
    global $PGV_IMAGE_DIR, $PGV_IMAGES, $PGV_BLOCKS;
    $block = true;
    // Always restrict this block's height
    if (empty($config)) {
        $config = $PGV_BLOCKS["print_recent_changes"]["config"];
    }
    if ($config["days"] < 1) {
        $config["days"] = 30;
    }
    if (isset($config["hide_empty"])) {
        $HideEmpty = $config["hide_empty"];
    } else {
        $HideEmpty = "no";
    }
    $found_facts = get_recent_changes(client_jd() - $config['days']);
    // Start output
    if (count($found_facts) == 0 and $HideEmpty == "yes") {
        return false;
    }
    // Print block header
    $id = "recent_changes";
    $title = print_help_link("recent_changes_help", "qm", "", false, true);
    if ($PGV_BLOCKS["print_recent_changes"]["canconfig"]) {
        if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) {
            if ($ctype == "gedcom") {
                $name = PGV_GEDCOM;
            } else {
                $name = PGV_USER_NAME;
            }
            $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">";
            $title .= "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["admin"]["small"] . "\" width=\"15\" height=\"15\" border=\"0\" alt=\"" . $pgv_lang["config_block"] . "\" /></a>";
        }
    }
    $title .= $pgv_lang["recent_changes"];
    $content = "";
    // Print block content
    $pgv_lang["global_num1"] = $config["days"];
    // Make this visible
    if (count($found_facts) == 0) {
        $content .= print_text("recent_changes_none", 0, 1);
    } else {
        $content .= print_text("recent_changes_some", 0, 1);
        // sortable table
        require_once PGV_ROOT . 'includes/functions/functions_print_lists.php';
        ob_start();
        print_changes_table($found_facts);
        $content .= ob_get_clean();
    }
    global $THEME_DIR;
    if ($block) {
        require $THEME_DIR . 'templates/block_small_temp.php';
    } else {
        require $THEME_DIR . 'templates/block_main_temp.php';
    }
}
开发者ID:rathervague,项目名称:phpgedview,代码行数:58,代码来源:recent_changes.php

示例2: loadLangFile

// leave manual config until we can move it to bitweaver table
require "config.php";
loadLangFile("pgv_help, pgv_admin, pgv_editor, ra_lang, gm_lang, gm_help, sm_lang, sm_help");
// Load language keys
require 'includes/help_text_vars.php';
print_simple_header($pgv_lang['help_header']);
echo '<a name="top"></a><span class="helpheader">', $pgv_lang['help_header'], '</span><br /><br /><div class="helptext">';
$help = safe_GET('help');
$action = safe_GET('action');
if ($help == 'help_useradmin.php' && $action == 'edituser') {
    $help = 'edit_useradmin_help';
}
if ($help == 'help_login_register.php' && $action == 'pwlost') {
    $help = 'help_login_lost_pw.php';
}
if ($help == 'help_contents_help') {
    if (PGV_USER_IS_ADMIN) {
        $help = 'admin_help_contents_help';
        echo $pgv_lang['admin_help_contents_head_help'];
    } else {
        echo $pgv_lang['help_contents_head_help'];
    }
    print_help_index($help);
} else {
    print_text($help);
}
echo '</div><br /><br /><br />';
echo '<a href="#top" title="', $pgv_lang['move_up'], '">', $UpArrow, '</a><br />';
echo '<a href="help_text.php?help=help_contents_help"><b>', $pgv_lang['help_contents'], '</b></a><br />';
echo '<a href="javascript:;" onclick="window.close();"><b>', $pgv_lang['close_window'], '</b></a>';
print_simple_footer();
开发者ID:bitweaver,项目名称:phpgedview,代码行数:31,代码来源:help_text.php

示例3: print_text

                 if ($okMain) {
                     print_text("main_media_ok" . $mediaAction);
                 } else {
                     $finalResult = false;
                     echo '<span class="error">', print_text("main_media_fail" . $mediaAction), '</span>';
                 }
             }
             print "<br />";
             if (!$isThum) {
                 print_text("thumb_media_fail0");
             } else {
                 if ($okThum) {
                     print_text("thumb_media_ok" . $mediaAction);
                 } else {
                     $finalResult = false;
                     echo '<span class="error">', print_text("thumb_media_fail" . $mediaAction), '</span>';
                 }
             }
             print "<br />";
             unset($GLOBALS["oldMediaName"]);
             unset($GLOBALS["newMediaName"]);
             unset($GLOBALS["oldMediaFolder"]);
             unset($GLOBALS["newMediaFolder"]);
             unset($GLOBALS["oldThumbFolder"]);
             unset($GLOBALS["newThumbFolder"]);
         }
     }
 }
 if ($finalResult) {
     $_SESSION["upload_folder"] = $folder;
     // store standard media folder in session
开发者ID:bitweaver,项目名称:phpgedview,代码行数:31,代码来源:addmedia.php

示例4: srand

     echo '</table>';
     echo '<br />';
 }
 echo '<table class="facts_table">';
 echo '<tr><td class="facts_value" style="text-align:center; " >';
 srand((double) microtime() * 1000000);
 // These 3 hidden variables has to be set or there will be a PHP ERROR message
 echo '<input type="hidden" name="language2" value="', $language2, '"/>';
 echo '<input type="hidden" name="file_type" value="', $file_type, '"/>';
 echo '<input type="hidden" name="ls01" value="', $ls01, '"/>';
 echo '<input type="submit" value="', $pgv_lang["close_window"], "\" onclick=\"window.opener.showchanges('&dv=", rand(), "#", $anchor, "'); self.close();\" />";
 echo '</td></tr>';
 if ($Write_Ok) {
     echo '<tr><td class="facts_value" style="text-align:center; " ><br /><br />';
     echo '<input type="submit" value="', print_text("close_window_without_refresh"), '" onclick="self.close();" /><br /><br />';
     echo '<div class="error">', print_text("edit_lang_utility_warning"), '</div>';
     echo '</td></tr>';
 }
 echo '</table>';
 echo '</form>';
 echo '</center></div>';
 // if ls02 (the line of the translated sentence) variable has not been set, try to find the row in the translated file
 if ($ls02 == "") {
     $ls02 = 0;
     $englishTarget1 = $english_language_array[$ls01][0];
     $englishTarget2 = str_replace('"', "'", $englishTarget1);
     // Var name could be inside apostrophes
     $englishTarget3 = str_replace("'", '"', $englishTarget1);
     // Var name could be inside apostrophes
     for ($y = 0, $ymax = sizeof($new_language_array); $y < $ymax; $y++) {
         if (isset($new_language_array[$y][1])) {
开发者ID:rathervague,项目名称:phpgedview,代码行数:31,代码来源:editlang_edit.php

示例5: print_footer

echo '<option value="0"', $showall == 0 ? ' selected="selected"' : '', '>', $pgv_lang['err_rec'], '</option>';
echo '<option value="1"', $showall == 1 ? ' selected="selected"' : '', '>', $pgv_lang['all_rec'], '</option>';
echo '</select></td></tr>';
echo '<tr><td colspan="2" class="list_label"><input type="submit" value="', $pgv_lang['show'], '"><input type="hidden" name="action" value="go"></td></tr>';
echo '</table></form><hr />';
// Do not run until user clicks "show", as default page may take a while to load.
// Instead, show some useful help info.
if (!isset($_POST['action'])) {
    echo '<p>', $pgv_lang['gedcheck_text'], '</p><hr />';
    print_footer();
    exit;
}
// If we're checking a gedcom that is imported into the database, check that the file is synchronised
if ($ged == PGV_GEDCOM && !$SYNC_GEDCOM_FILE) {
    $ged_link = 'href="javascript:" onclick="window.open(\'' . encode_url("export_gedcom.php?export={$ged}") . '\', \'_blank\',\'left=50,top=50,width=500,height=500,resizable=1,scrollbars=1\');"';
    echo '<div class="error">', print_text('gedcheck_sync', 0, 1), '</div><hr/>';
}
// Special cases.  Other facts link to themselves; SUBN, SUBN, OBJE, NOTE, REPO, SOUR
$XREF_LINK = array('FAMC' => 'FAM', 'FAMS' => 'FAM', 'HUSB' => 'INDI', 'WIFE' => 'INDI', 'CHIL' => 'INDI', 'ASSO' => 'INDI', 'ALIA' => 'INDI', 'ANCI' => 'SUBM', 'DESI' => 'SUBM', '_PGV_OBJS' => 'OBJE', 'AUTH' => 'INDI');
// Use the global settings for these (if they exist)
if (isset($FAM_FACTS_UNIQUE)) {
    $fam_facts_unique = preg_split('/[, ;:]+/', $FAM_FACTS_UNIQUE, -1, PREG_SPLIT_NO_EMPTY);
} else {
    $fam_facts_unique = array();
}
if (isset($INDI_FACTS_UNIQUE)) {
    $indi_facts_unique = preg_split('/[, ;:]+/', $INDI_FACTS_UNIQUE, -1, PREG_SPLIT_NO_EMPTY);
} else {
    $indi_facts_unique = array();
}
// Match end of line in DOS/UNIX/MAC format
开发者ID:rathervague,项目名称:phpgedview,代码行数:31,代码来源:gedcheck.php

示例6: print_user_favorites

function print_user_favorites($block = true, $config = "", $side, $index)
{
    global $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $TEXT_DIRECTION, $INDEX_DIRECTORY, $MEDIA_DIRECTORY, $MULTI_MEDIA, $MEDIA_DIRECTORY_LEVELS, $ctype;
    global $show_full, $PEDIGREE_FULL_DETAILS, $BROWSERTYPE, $ENABLE_AUTOCOMPLETE;
    // Override GEDCOM configuration temporarily
    if (isset($show_full)) {
        $saveShowFull = $show_full;
    }
    $savePedigreeFullDetails = $PEDIGREE_FULL_DETAILS;
    $show_full = 1;
    $PEDIGREE_FULL_DETAILS = 1;
    $userfavs = getUserFavorites(PGV_USER_NAME);
    if (!is_array($userfavs)) {
        $userfavs = array();
    }
    $id = "user_favorites";
    $title = print_help_link("mygedview_favorites_help", "qm", "", false, true);
    $title .= $pgv_lang["my_favorites"] . "&nbsp;&nbsp;";
    if ($TEXT_DIRECTION == "rtl") {
        $title .= getRLM();
    }
    $title .= "(" . count($userfavs) . ")";
    if ($TEXT_DIRECTION == "rtl") {
        $title .= getRLM();
    }
    if ($ENABLE_AUTOCOMPLETE) {
        $content = '<script type="text/javascript" src="js/jquery/jquery.min.js"></script>
		<script type="text/javascript" src="js/jquery/jquery.autocomplete.js"></script>
		<script type="text/javascript" src="js/jquery/jquery.ajaxQueue.js"></script>
		<script type="text/javascript">
		jQuery.noConflict(); // @see http://docs.jquery.com/Using_jQuery_with_Other_Libraries/
		jQuery(document).ready(function($){
			$("input[name^=gid]").autocomplete("autocomplete.php", {
				extraParams: {field:"IFSRO"},
				formatItem: function(row, i) {
					return row[0] + " (" + row[1] + ")";
				},
				formatResult: function(row) {
					return row[1];
				},
				width: 400,
				minChars: 2
			});
		});
		</script>';
    } else {
        $content = '';
    }
    if ($block) {
        $style = 2;
        // 1 means "regular box", 2 means "wide box"
        $tableWidth = $BROWSERTYPE == "msie" ? "95%" : "99%";
        // IE needs to have room for vertical scroll bar inside the box
        $cellSpacing = "1px";
    } else {
        $style = 2;
        $tableWidth = "99%";
        $cellSpacing = "3px";
    }
    if (count($userfavs) == 0) {
        $content .= print_text("no_favorites", 0, 1);
    } else {
        $mygedcom = $GEDCOM;
        $current_gedcom = $GEDCOM;
        $content .= "<table width=\"{$tableWidth}\" style=\"border:none\" cellspacing=\"{$cellSpacing}\" class=\"center {$TEXT_DIRECTION}\">";
        foreach ($userfavs as $key => $favorite) {
            if (isset($favorite["id"])) {
                $key = $favorite["id"];
            }
            $removeFavourite = "<a class=\"font9\" href=\"" . encode_url("index.php?ctype={$ctype}&action=deletefav&fv_id={$key}") . "\" onclick=\"return confirm('" . $pgv_lang["confirm_fav_remove"] . "');\">" . $pgv_lang["remove"] . "</a><br />";
            $current_gedcom = $GEDCOM;
            $GEDCOM = $favorite["file"];
            $content .= "<tr><td>";
            if ($favorite["type"] == "URL") {
                $content .= "<div id=\"boxurl" . $key . ".0\" class=\"person_box\">";
                if ($ctype == "user" || PGV_USER_IS_ADMIN) {
                    $content .= $removeFavourite;
                }
                $content .= "<a href=\"" . $favorite["url"] . "\">" . PrintReady($favorite["title"]) . "</a>";
                $content .= "<br />" . PrintReady($favorite["note"]);
            } else {
                require $INDEX_DIRECTORY . $GEDCOM . '_conf.php';
                $indirec = find_gedcom_record($favorite["gid"], PGV_GED_ID);
                if ($favorite["type"] == "INDI") {
                    $content .= "<div id=\"box" . $favorite["gid"] . ".0\" class=\"person_box";
                    if (strpos($indirec, "\n1 SEX F") !== false) {
                        $content .= "F";
                    } elseif (strpos($indirec, "\n1 SEX M") !== false) {
                        $content .= "";
                    } else {
                        $content .= "NN";
                    }
                    $content .= "\">";
                    if ($ctype == "user" || PGV_USER_IS_ADMIN) {
                        $content .= $removeFavourite;
                    }
                    ob_start();
                    print_pedigree_person($favorite["gid"], $style, 1, $key);
                    $content .= ob_get_clean();
                    $content .= PrintReady($favorite["note"]);
//.........这里部分代码省略.........
开发者ID:rathervague,项目名称:phpgedview,代码行数:101,代码来源:user_favorites.php

示例7: print_yahrzeit


//.........这里部分代码省略.........
                    $content .= "</div>";
                }
            }
            break;
        case "style2":
            // Table style
            require_once PGV_ROOT . 'js/sorttable.js.htm';
            require_once PGV_ROOT . 'includes/classes/class_gedcomrecord.php';
            $table_id = "ID" . floor(microtime() * 1000000);
            // sorttable requires a unique ID
            $content .= "<table id=\"{$table_id}\" class=\"sortable list_table center\">";
            $content .= "<tr>";
            $content .= "<th class=\"list_label\">{$factarray['NAME']}</th>";
            $content .= "<th style=\"display:none\">GIVN</th>";
            $content .= "<th class=\"list_label\">{$factarray['DATE']}</th>";
            $content .= "<th class=\"list_label\"><img src=\"./images/reminder.gif\" alt=\"{$pgv_lang['anniversary']}\" title=\"{$pgv_lang['anniversary']}\" border=\"0\" /></th>";
            $content .= "<th class=\"list_label\">{$factarray['_YART']}</th>";
            $content .= "</tr>";
            $count = 0;
            foreach ($yahrzeits as $yahrzeit) {
                if ($yahrzeit['jd'] >= $startjd && $yahrzeit['jd'] < $startjd + $config['days']) {
                    ++$count;
                    $ind = person::GetInstance($yahrzeit['id']);
                    $content .= "<tr class=\"vevent\">";
                    // hCalendar:vevent
                    // Record name(s)
                    $name = $ind->getFullName();
                    $url = $ind->getLinkUrl();
                    $content .= "<td class=\"list_value_wrap\" align=\"" . get_align($name) . "\">";
                    $content .= "<a href=\"" . encode_url($ind->getLinkUrl()) . "\" class=\"list_item name2\" dir=\"" . $TEXT_DIRECTION . "\">" . PrintReady($name) . "</a>";
                    $content .= $ind->getSexImage();
                    $addname = $ind->getAddName();
                    if ($addname) {
                        $content .= "<br /><a href=\"" . encode_url($url) . "\" class=\"list_item\">" . PrintReady($addname) . "</a>";
                    }
                    $content .= "</td>";
                    // GIVN for sorting
                    $content .= "<td style=\"display:none\">";
                    $exp = explode(",", str_replace('<', ',', $name) . ",");
                    $content .= $exp[1];
                    $content .= "</td>";
                    $today = new JewishDate($yahrzeit['jd']);
                    $td = new GedcomDate($today->Format('@ A O E'));
                    // death/yahrzeit event date
                    $content .= "<td class=\"list_value_wrap\">";
                    $content .= "<a name='{$yahrzeit['jd']}'>" . $yahrzeit['date']->Display(true, NULL, array()) . "</a>";
                    $content .= "</td>";
                    // Anniversary
                    $content .= "<td class=\"list_value_wrap rela\">";
                    $anniv = $yahrzeit['anniv'];
                    if ($anniv == 0) {
                        $content .= '<a name="0">&nbsp;</a>';
                    } else {
                        $content .= "<a name=\"{$anniv}\">{$anniv}</a>";
                    }
                    if ($config['allowDownload'] == 'yes') {
                        // hCalendar:dtstart and hCalendar:summary
                        //TODO does this work??
                        $content .= "<abbr class=\"dtstart\" title=\"" . strip_tags($yahrzeit['date']->Display(false, 'Ymd', array())) . "\"></abbr>";
                        $content .= "<abbr class=\"summary\" title=\"" . $pgv_lang["anniversary"] . " #{$anniv} " . $factarray[$yahrzeit['fact']] . " : " . PrintReady(strip_tags($ind->getFullName())) . "\"></abbr>";
                    }
                    // upcomming yahrzeit dates
                    $content .= "<td class=\"list_value_wrap\">";
                    $content .= "<a href=\"" . $url . "\" class=\"list_item url\">" . $td->Display(true, NULL, array('gregorian')) . "</a>";
                    // hCalendar:url
                    $content .= "&nbsp;</td>";
                    $content .= "</tr>";
                }
            }
            // table footer
            $content .= "<tr class=\"sortbottom\">";
            $content .= "<td class=\"list_label\">";
            $content .= '<a href="javascript:;" onclick="sortByOtherCol(this,1)"><img src="images/topdown.gif" alt="" border="0" /> ' . $factarray["GIVN"] . '</a><br />';
            $content .= $pgv_lang["total_names"] . ": " . $count;
            if ($hidden) {
                $content .= "<br /><span class=\"warning\">{$pgv_lang['hidden']} : {$hidden}</span>";
            }
            $content .= "</td>";
            $content .= "<td style=\"display:none\">GIVN</td>";
            $content .= "<td>";
            if ($config['allowDownload'] == 'yes') {
                $uri = $SERVER_URL . basename($_SERVER['REQUEST_URI']);
                global $whichFile;
                $whichFile = 'hCal-events.ics';
                $alt = print_text('download_file', 0, 1);
                if (count($yahrzeits)) {
                    $content .= "<a href=\"http://feeds.technorati.com/events/{$uri}\"><img src=\"images/hcal.png\" border=\"0\" alt=\"{$alt}\" title=\"{$alt}\" /></a>";
                }
            }
            $content .= '</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
            $content .= '</table>';
            break;
    }
    global $THEME_DIR;
    if ($block) {
        require $THEME_DIR . 'templates/block_small_temp.php';
    } else {
        require $THEME_DIR . 'templates/block_main_temp.php';
    }
}
开发者ID:rathervague,项目名称:phpgedview,代码行数:101,代码来源:yahrzeit.php

示例8: replace_gedrec

                            if (isset($facts2[$i])) {
                                if (in_array($i, $keep2)) {
                                    $newgedrec .= $facts2[$i]["subrec"] . "\n";
                                    print $pgv_lang["adding"] . " " . $facts2[$i]["fact"] . " " . $pgv_lang["from"] . " {$gid2}<br />\n";
                                }
                            }
                        }
                        replace_gedrec($gid1, $newgedrec);
                        if ($SYNC_GEDCOM_FILE) {
                            write_file();
                        }
                        write_changes();
                        $rec = GedcomRecord::getInstance($gid1);
                        $pid = $rec->getXrefLink();
                        // $pid is embedded in $pgv_lang['record_updated']
                        echo '<br />', print_text('record_updated', 0, 1), '<br />';
                        print "<br /><a href=\"edit_merge.php?action=choose\">" . $pgv_lang["merge_more"] . "</a><br />\n";
                        print "<br /><br /><br />\n";
                    }
                }
            }
        }
    }
}
if ($action == "choose") {
    ?>
	<script language="JavaScript" type="text/javascript">
	<!--
	var pasteto;
	function iopen_find(textbox, gedselect) {
		pasteto = textbox;
开发者ID:bitweaver,项目名称:phpgedview,代码行数:31,代码来源:edit_merge.php

示例9: print_htmlplus_block

function print_htmlplus_block($block = true, $config = '', $side, $index)
{
    global $ctype, $factarray, $GEDCOM, $HTML_BLOCK_COUNT, $PGV_BLOCKS, $PGV_IMAGE_DIR, $PGV_IMAGES, $pgv_lang, $TEXT_DIRECTION, $MULTI_MEDIA, $SHOW_ID_NUMBERS;
    // config sanity check
    if (empty($config)) {
        $config = $PGV_BLOCKS['print_htmlplus_block']['config'];
    } else {
        foreach ($PGV_BLOCKS['print_htmlplus_block']['config'] as $k => $v) {
            if (!isset($config[$k])) {
                $config[$k] = $v;
            }
        }
    }
    if (!isset($HTML_BLOCK_COUNT)) {
        $HTML_BLOCK_COUNT = 0;
    }
    $HTML_BLOCK_COUNT++;
    /*
     * Select GEDCOM
     */
    switch ($config['gedcom']) {
        case '__current__':
            break;
        case '':
            break;
        case '__default__':
            $GEDCOM = get_site_setting('DEFAULT_GEDCOM');
            if (!$GEDCOM) {
                foreach (get_all_gedcoms() as $gedcom) {
                    $GEDCOM = $gedcom;
                    break;
                }
            }
            break;
        default:
            if (get_gedcom_setting(get_gedcom_from_id($config['gedcom']), 'imported')) {
                $GEDCOM = $config['gedcom'];
            }
            break;
    }
    /*
     * Initiate the stats object.
     */
    if ($config['compat'] == 1) {
        require_once PGV_ROOT . 'includes/classes/class_stats_compat.php';
        $stats = new stats_compat($GEDCOM);
    } elseif ($config['ui'] == 1) {
        require_once PGV_ROOT . 'includes/classes/class_stats_ui.php';
        $stats = new stats_ui($GEDCOM);
    } else {
        $stats = new stats($GEDCOM);
    }
    // Make some values from the GEDCOM's 0 HEAD record visible to the world
    global $CREATED_SOFTWARE, $CREATED_VERSION, $CREATED_DATE;
    $CREATED_SOFTWARE = $stats->gedcomCreatedSoftware();
    $CREATED_VERSION = $stats->gedcomCreatedVersion();
    $CREATED_DATE = $stats->gedcomDate();
    /*
     * First Pass.
     * Handle embedded language, fact, global, etc. references
     *   This needs to be done first because the language variables could themselves
     *   contain embedded keywords.
     */
    // Title
    $config['title'] = print_text($config['title'], 0, 2);
    // Content
    $config['html'] = print_text($config['html'], 0, 2);
    /*
     * Second Pass.
     */
    list($new_tags, $new_values) = $stats->getTags("{$config['title']} {$config['html']}");
    // Title
    if (strstr($config['title'], '#')) {
        $config['title'] = str_replace($new_tags, $new_values, $config['title']);
    }
    // Content
    $config['html'] = str_replace($new_tags, $new_values, $config['html']);
    /*
     * Restore Current GEDCOM
     */
    $GEDCOM = PGV_GEDCOM;
    /*
     * Start Of Output
     */
    $id = "html_block{$HTML_BLOCK_COUNT}";
    $title = "";
    if ($config['title'] != '') {
        if (PGV_USER_GEDCOM_ADMIN) {
            $title .= print_help_link('index_htmlplus_ahelp', 'qm_ah', '', false, true);
        } else {
            $title .= print_help_link('index_htmlplus_help', 'qm', '', false, true);
        }
        if ($PGV_BLOCKS['print_htmlplus_block']['canconfig']) {
            if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) {
                if ($ctype == "gedcom") {
                    $name = PGV_GEDCOM;
                } else {
                    $name = PGV_USER_NAME;
                }
                $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">" . "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/{$PGV_IMAGES['admin']['small']}\" width=\"15\" height=\"15\" border=\"0\" alt=\"{$pgv_lang['config_block']}\" /></a>";
//.........这里部分代码省略.........
开发者ID:rathervague,项目名称:phpgedview,代码行数:101,代码来源:block_htmlplus.php

示例10: add_table_row

function add_table_row($name, $contents, $font = 'Default')
{
    global $TABLE_STYLES;
    $TABLE_STYLES[$name][rows_text] .= TAB . '<table:table-row>' . NL;
    for ($i = 0; $i < count($contents); $i++) {
        $span = count($contents) == 1 ? $TABLE_STYLES[$name][cols] : 1;
        $style = get_pos_style($TABLE_STYLES[$name][inserted_rows] + 1, $i + 1, count($contents));
        $TABLE_STYLES[$name][rows_text] .= TAB2 . '<table:table-cell table:number-columns-spanned="' . $span . '" table:style-name="' . $name . '.' . $style . '" table:value-type="string">' . NL . TAB3 . print_text($contents[$i], $font) . TAB2 . '</table:table-cell>' . NL;
    }
    $TABLE_STYLES[$name][rows_text] .= TAB . '</table:table-row>' . NL;
    $TABLE_STYLES[$name][inserted_rows]++;
}
开发者ID:HadoDokis,项目名称:knomos-plus,代码行数:12,代码来源:index.php

示例11: print_text

<?php

function print_text($msg, $tag, $col)
{
    for ($i = 0; $i < 10; $i++) {
        echo "<{$tag} style='color: {$col}'> {$msg} </{$tag}>";
    }
}
print_text('Hello', 'p', 'blue');
?>


<?php 
print_text('How are you', 'h4', 'green');
开发者ID:ekadiyski2,项目名称:try-proj3,代码行数:14,代码来源:func-param.php

示例12: print_logged_in_users

/**
 * logged in users
 *
 * prints a list of other users who are logged in
 */
function print_logged_in_users($block = true, $config = "", $side, $index)
{
    global $pgv_lang, $PGV_SESSION_TIME, $TEXT_DIRECTION;
    $block = true;
    // Always restrict this block's height
    // Log out inactive users
    foreach (get_idle_users(time() - $PGV_SESSION_TIME) as $user_id => $user_name) {
        if ($user_id != PGV_USER_ID) {
            userLogout($user_id);
        }
    }
    // List active users
    $NumAnonymous = 0;
    $loggedusers = array();
    foreach (get_logged_in_users() as $user_id => $user_name) {
        if (PGV_USER_IS_ADMIN || get_user_setting($user_id, 'visibleonline') == 'Y') {
            $loggedusers[$user_id] = $user_name;
        } else {
            $NumAnonymous++;
        }
    }
    $id = "logged_in_users";
    $title = print_help_link("index_loggedin_help", "qm", "", false, true);
    $title .= $pgv_lang["users_logged_in"];
    $content = "<table width=\"90%\">";
    $LoginUsers = count($loggedusers);
    if ($LoginUsers == 0 and $NumAnonymous == 0) {
        $content .= "<tr><td><b>" . $pgv_lang["no_login_users"] . "</b></td></tr>";
    }
    $Advisory = "anon_user";
    if ($NumAnonymous > 1) {
        $Advisory .= "s";
    }
    if ($NumAnonymous > 0) {
        $pgv_lang["global_num1"] = $NumAnonymous;
        // Make it visible
        $content .= "<tr><td><b>" . print_text($Advisory, 0, 1) . "</b></td></tr>";
    }
    $Advisory = "login_user";
    if ($LoginUsers > 1) {
        $Advisory .= "s";
    }
    if ($LoginUsers > 0) {
        $pgv_lang["global_num1"] = $LoginUsers;
        // Make it visible
        $content .= "<tr><td><b>" . print_text($Advisory, 0, 1) . "</b></td></tr>";
    }
    if (PGV_USER_ID) {
        foreach ($loggedusers as $user_id => $user_name) {
            $content .= "<tr><td><br />" . PrintReady(getUserFullName($user_id)) . " - " . $user_name;
            if (PGV_USER_ID != $user_id && get_user_setting($user_id, 'contactmethod') != "none") {
                $content .= "<br /><a href=\"javascript:;\" onclick=\"return message('" . $user_id . "');\">" . $pgv_lang["message"] . "</a>";
            }
            $content .= "</td></tr>";
        }
    }
    $content .= "</table>";
    global $THEME_DIR;
    if ($block) {
        require $THEME_DIR . 'templates/block_small_temp.php';
    } else {
        require $THEME_DIR . 'templates/block_main_temp.php';
    }
}
开发者ID:rathervague,项目名称:phpgedview,代码行数:69,代码来源:logged_in.php

示例13: img_uploader

function img_uploader($file, $CID, $target_path, $mode, $UpdateMode = false, $tozihat = "it`s a group upload file", $code = NULL, $NW = -1, $NH = -1)
{
    $image = $file;
    $uploadedfile = $target_path . PATCH_DIS . $file;
    if ($code == NULL) {
        $codeKala = basename($target_path);
    } else {
        $codeKala = $code;
    }
    debug(" codeKala parsing in Img_Uploader function " . $codeKala);
    debug($image . " <= image " . $uploadedfile . " <= uploadedfile " . $CID . " <= CID<br>");
    $UID = $_SESSION['UID'];
    $filename = stripslashes($file);
    $extension = getExtension($filename);
    $extension = strtolower($extension);
    $ftype = get_ftype($extension);
    debug("file extention is : " . $extension);
    if ($extension != "jpg" && $extension != "jpeg" && $extension != "png" && $extension != "gif") {
        debug("this is not a valid file and should be deleted");
        unlink($uploadedfile);
        print_text("دسوند این فایل جزو پسوند های مجاز نمی باشد", "err");
        return;
    } else {
        debug("start prossesing image file");
        $size = filesize($uploadedfile);
        debug($uploadedfile . " size is : " . $size);
        if ($size > MAX_SIZE * 1024) {
            unlink($uploadedfile);
            print_text("سایز این عکس از حد مجاز بیشتر است", "err");
            return;
        }
        if ($extension == "jpg" || $extension == "jpeg") {
            $uploadedfile = $uploadedfile;
            $src = imagecreatefromjpeg($uploadedfile);
        } else {
            if ($extension == "png") {
                $uploadedfile = $uploadedfile;
                $src = imagecreatefrompng($uploadedfile);
            } else {
                $src = imagecreatefromgif($uploadedfile);
                echo $src;
                echo " test <br><br><br><br><br><br><br>";
            }
        }
        debug("image size and format is valid and started for prosesiing " . $src);
        list($width, $height) = getimagesize($uploadedfile);
        debug("w : " . $width . " and h : " . $height);
        if ($mode == SII) {
            $newwidth = 200;
            $newheight = 160;
            //($height/$width)*$newwidth;
        } else {
            if ($mode == LII) {
                debug("nw that send is : " . $NW);
                $newwidth = $NW == -1 ? 450 : $NW;
                $newheight = $NH == -1 ? $height / $width * $newwidth : $NH;
            } else {
                if ($mode == BII) {
                    $newwidth = $NW == -1 ? $width : $NW;
                    $newheight = $NH == -1 ? $height : $NH;
                }
            }
        }
        $tmp = imagecreatetruecolor($newwidth, $newheight);
        imagecopyresampled($tmp, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
        debug(" New w : " . $newwidth . " and New h : " . $newheight);
        // imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height);
        $base_address = MASTER_DIR . PATCH_DIS . cryp($UID) . PATCH_DIS . cryp($CID) . PATCH_DIS;
        debug("this file will moved to " . $base_address);
        $filename = $base_address . $image;
        debug("and final file address will be : " . $filename);
        //echo $filename."<br>";
        //$filename1 = "images/small". $_FILES['file']['name'];
        require_once 'farsi_date.php';
        $date = ShamsiDate('a');
        if ($extension == 'gif') {
            echo "gift extention is detected";
            if ($mode == BII) {
                move_uploaded_file($uploadedfile, $filename);
            } else {
                $RRes = imagegif($tmp, $filename);
            }
        } else {
            if ($extension == 'jpg' || $extension == 'jpeg') {
                $RRes = imagejpeg($tmp, $filename, 100);
            } else {
                if ($extension == 'png') {
                    $RRes = imagepng($tmp, $filename, 100);
                }
            }
        }
        if ($RRes) {
            ?>

            <h2 dir="rtl" ><p class="text">  فایل با موفقیت به سرور انتقال پیدا کرد و از ادرس زیر قابل دسترس می باشد.<br></p></h2>



            <center><br>
            <?php 
//.........这里部分代码省略.........
开发者ID:somewhereocean,项目名称:InAppVerify,代码行数:101,代码来源:lib.php

示例14: print_gedcom_news

/**
 * Prints a gedcom news/journal
 *
 * @todo Add an allowed HTML translation
 */
function print_gedcom_news($block = true, $config = '', $side, $index)
{
    global $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES, $TEXT_DIRECTION, $ctype, $PGV_BLOCKS;
    if (empty($config)) {
        $config = $PGV_BLOCKS['print_gedcom_news']['config'];
    }
    if ($config['flag'] == 0) {
        $config['limit'] = 'nolimit';
    }
    if (isset($_REQUEST['gedcom_news_archive'])) {
        $config['limit'] = 'nolimit';
        $config['flag'] = 0;
    }
    $usernews = getUserNews(PGV_GEDCOM);
    $id = "gedcom_news";
    $title = "";
    if (PGV_USER_GEDCOM_ADMIN) {
        $title .= print_help_link('index_gedcom_news_ahelp', 'qm_ah', "", false, true);
    } else {
        $title .= print_help_link('index_gedcom_news_help', 'qm', "", false, true);
    }
    if ($PGV_BLOCKS['print_gedcom_news']['canconfig']) {
        if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) {
            if ($ctype == "gedcom") {
                $name = PGV_GEDCOM;
            } else {
                $name = PGV_USER_NAME;
            }
            $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('index_edit.php?name={$name}&amp;ctype={$ctype}&amp;action=configure&amp;side={$side}&amp;index={$index}', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">" . "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/{$PGV_IMAGES['admin']['small']}\" width=\"15\" height=\"15\" border=\"0\" alt=\"{$pgv_lang['config_block']}\" /></a>\n";
        }
    }
    $title .= $pgv_lang['gedcom_news'];
    $content = "";
    if (count($usernews) == 0) {
        $content .= $pgv_lang['no_news'] . '<br />';
    }
    $c = 0;
    $td = time();
    foreach ($usernews as $news) {
        if ($config['limit'] == 'count') {
            if ($c >= $config['flag']) {
                break;
            }
            $c++;
        }
        if ($config['limit'] == 'date') {
            if (floor(($td - $news['date']) / 86400) > $config['flag']) {
                break;
            }
        }
        //		print "<div class=\"person_box\" id=\"{$news['anchor']}\">\n";
        $content .= "<div class=\"news_box\" id=\"{$news['anchor']}\">\n";
        // Look for $pgv_lang, $factarray, and $GLOBALS substitutions in the News title
        $newsTitle = print_text($news['title'], 0, 2);
        $ct = preg_match("/#(.+)#/", $newsTitle, $match);
        if ($ct > 0) {
            if (isset($pgv_lang[$match[1]])) {
                $newsTitle = str_replace("{$match['0']}", $pgv_lang[$match[1]], $newsTitle);
            }
        }
        $content .= "<span class=\"news_title\">" . PrintReady($newsTitle) . "</span><br />\n";
        $content .= "<span class=\"news_date\">" . format_timestamp($news['date']) . "</span><br /><br />\n";
        // Look for $pgv_lang, $factarray, and $GLOBALS substitutions in the News text
        $newsText = print_text($news['text'], 0, 2);
        $ct = preg_match("/#(.+)#/", $newsText, $match);
        if ($ct > 0) {
            if (isset($pgv_lang[$match[1]])) {
                $newsText = str_replace("{$match['0']}", $pgv_lang[$match[1]], $newsText);
            }
        }
        $ct = preg_match("/#(.+)#/", $newsText, $match);
        if ($ct > 0) {
            $varname = $match[1];
            if (isset($pgv_lang[$varname])) {
                $newsText = str_replace("{$match['0']}", $pgv_lang[$varname], $newsText);
            } else {
                if (defined('PGV_' . $varname)) {
                    // e.g. global $VERSION is now constant PGV_VERSION
                    $varname = 'PGV_' . $varname;
                }
                if (defined($varname)) {
                    $newsText = str_replace("{$match['0']}", constant($varname), $newsText);
                } else {
                    if (isset(${$varname})) {
                        $newsText = str_replace("{$match['0']}", ${$varname}, $newsText);
                    }
                }
            }
        }
        $trans = get_html_translation_table(HTML_SPECIALCHARS);
        $trans = array_flip($trans);
        $newsText = strtr($newsText, $trans);
        $newsText = nl2br($newsText);
        $content .= PrintReady($newsText) . "<br />\n";
        // Print Admin options for this News item
//.........这里部分代码省略.........
开发者ID:rathervague,项目名称:phpgedview,代码行数:101,代码来源:gedcom_news.php

示例15: gedcomNews

 static function gedcomNews($params = null)
 {
     global $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES, $TEXT_DIRECTION, $GEDCOM, $ctype, $PGV_BLOCKS;
     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 .= "{$pgv_lang['no_news']}<br />\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 .= "<div class=\"news_box\" id=\"{$news['anchor']}\">\n";
         // Look for $pgv_lang, $factarray, and $GLOBALS substitutions in the News title
         $newsTitle = print_text($news['title'], 0, 2);
         $ct = preg_match("/#(.+)#/", $newsTitle, $match);
         if ($ct > 0) {
             if (isset($pgv_lang[$match[1]])) {
                 $newsTitle = preg_replace("/{$match['0']}/", $pgv_lang[$match[1]], $newsTitle);
             }
         }
         $content .= "<span class=\"news_title\">" . PrintReady($newsTitle) . "</span><br />\n";
         $content .= "<span class=\"news_date\">" . format_timestamp($news['date']) . "</span><br /><br />\n";
         // Look for $pgv_lang, $factarray, and $GLOBALS substitutions in the News text
         $newsText = print_text($news['text'], 0, 2);
         $ct = preg_match("/#(.+)#/", $newsText, $match);
         if ($ct > 0) {
             if (isset($pgv_lang[$match[1]])) {
                 $newsText = preg_replace("/{$match[0]}/", $pgv_lang[$match[1]], $newsText);
             }
         }
         $ct = preg_match("/#(.+)#/", $newsText, $match);
         if ($ct > 0) {
             $varname = $match[1];
             if (isset($pgv_lang[$varname])) {
                 $newsText = preg_replace("/{$match[0]}/", $pgv_lang[$varname], $newsText);
             } else {
                 if (defined('PGV_' . $varname)) {
                     // e.g. global $VERSION is now constant PGV_VERSION
                     $varname = 'PGV_' . $varname;
                 }
                 if (defined($varname)) {
                     $newsText = preg_replace("/{$match[0]}/", constant($varname), $newsText);
                 } else {
                     if (isset(${$varname})) {
                         $newsText = preg_replace("/{$match[0]}/", ${$varname}, $newsText);
                     }
                 }
             }
         }
         $trans = get_html_translation_table(HTML_SPECIALCHARS);
         $trans = array_flip($trans);
         $newsText = strtr($newsText, $trans);
         //$newsText = nl2br($newsText);
         $content .= PrintReady($newsText) . "<br />\n";
         // Print Admin options for this News item
         if (PGV_USER_GEDCOM_ADMIN) {
             $content .= "<hr size=\"1\" />" . "<a href=\"javascript:;\" onclick=\"editnews('{$k}'); return false;\">{$pgv_lang['edit']}</a> | " . "<a href=\"" . encode_url("index.php?action=deletenews&news_id={$k}&ctype={$ctype}") . "\" onclick=\"return confirm('{$pgv_lang['confirm_news_delete']}');\">{$pgv_lang['delete']}</a><br />";
         }
         $content .= "</div>\n";
     }
     $printedAddLink = false;
     if (PGV_USER_GEDCOM_ADMIN) {
         $content .= "<a href=\"javascript:;\" onclick=\"addnews('" . preg_replace("/'/", "\\'", $GEDCOM) . "'); return false;\">{$pgv_lang['add_news']}</a>";
         $printedAddLink = true;
     }
     if ($limit == 'date' || $limit == 'count') {
         if ($printedAddLink) {
             $content .= '&nbsp;&nbsp;|&nbsp;&nbsp;';
//.........这里部分代码省略.........
开发者ID:bitweaver,项目名称:phpgedview,代码行数:101,代码来源:class_stats_ui.php


注:本文中的print_text函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。