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


PHP safe_text函数代码示例

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


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

示例1: popup

function popup($text, $show_data = true)
{
    global $dbh, $tree_id, $lang, $number, $c, $tree_prefix_quoted;
    $person = $text;
    $text = '';
    include_once "../include/person_cls.php";
    include_once "../include/marriage_cls.php";
    //$person_man=$dbh->query("SELECT * FROM ".safe_text($_SESSION['tree_prefix'])."person WHERE pers_gedcomnumber='".safe_text($person)."'");
    $person_man = $dbh->query("SELECT * FROM humo_persons\n\t\tWHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='" . safe_text($person) . "'");
    @($person_manDb = $person_man->fetch(PDO::FETCH_OBJ));
    //*** Use class to show person ***
    $man_cls = new person_cls();
    $man_cls->construct($person_manDb);
    $man_privacy = $man_cls->privacy;
    $name = $man_cls->person_name($person_manDb);
    if ($person_manDb->pers_sexe == "M") {
        $text .= '<li><img src="../images/man.gif" class="ui-li-icon">';
    } elseif ($person_manDb->pers_sexe == "F") {
        $text .= '<li><img src="../images/woman.gif" class="ui-li-icon">';
    } else {
        $text .= '<li><img src="../images/unknown.gif" class="ui-li-icon">';
    }
    $number_text = '';
    if ($number == 1) {
        $number_text = $c + 1 . ' ';
    }
    $text .= '<p>' . $number_text . '<a href="family.php?id=' . $person_manDb->pers_gedcomnumber . '">' . $name["index_name"] . '</a><br>';
    if ($show_data == true) {
        if ($man_privacy) {
            $text .= __(' PRIVACY FILTER');
        } else {
            // no privacy set
            if ($person_manDb->pers_birth_date or $person_manDb->pers_birth_place) {
                $text .= ucfirst(__('*')) . ' ' . date_place($person_manDb->pers_birth_date, $person_manDb->pers_birth_place) . '<br>';
            } elseif ($person_manDb->pers_bapt_date or $person_manDb->pers_bapt_place) {
                $text .= ucfirst(__('~')) . ' ' . date_place($person_manDb->pers_bapt_date, $person_manDb->pers_bapt_place) . '<br>';
            }
            if ($person_manDb->pers_death_date or $person_manDb->pers_death_place) {
                $text .= ucfirst(__('&#134;')) . ' ' . date_place($person_manDb->pers_death_date, $person_manDb->pers_death_place) . '<br>';
            } elseif ($person_manDb->pers_buried_date or $person_manDb->pers_buried_place) {
                if ($person_manDb->pers_cremation) {
                    $var .= ucfirst(__('crem.')) . ' ';
                } else {
                    $var .= ucfirst(__('buried')) . ' ';
                }
                $var .= date_place($person_manDb->pers_buried_date, $person_manDb->pers_buried_place) . '<br>';
            } else {
                $text .= '</p></li>';
            }
        }
    }
    return $text;
}
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:53,代码来源:function.php

示例2: show_tree_text

function show_tree_text($tree_prefix, $selected_language)
{
    global $dbh, $dataDb;
    // *** Standard tree text values ***
    $treetext_array['name'] = __('NO NAME');
    $treetext_array['mainmenu_text'] = '';
    $treetext_array['mainmenu_source'] = '';
    //$treetext_array['family_top']='Family page';
    $treetext_array['family_top'] = '';
    $treetext_array['family_footer'] = '';
    $found_text = false;
    // *** NEW: Default tree texts ***
    $sql = "SELECT * FROM humo_trees LEFT JOIN humo_tree_texts\r\n\t\tON humo_trees.tree_id=humo_tree_texts.treetext_tree_id\r\n\t\tAND treetext_language='default' WHERE tree_prefix='" . safe_text($tree_prefix) . "'";
    $datasql = $dbh->query($sql);
    @($dataDb = $datasql->fetch(PDO::FETCH_OBJ));
    if (isset($dataDb->treetext_name)) {
        $treetext_array['id'] = $dataDb->treetext_id;
        $treetext_array['name'] = $dataDb->treetext_name;
        $treetext_array['mainmenu_text'] = $dataDb->treetext_mainmenu_text;
        $treetext_array['mainmenu_source'] = $dataDb->treetext_mainmenu_source;
        $treetext_array['family_top'] = $dataDb->treetext_family_top;
        $treetext_array['family_footer'] = $dataDb->treetext_family_footer;
        $found_text = true;
    }
    // *** Check for tree texts in selected language ***
    $sql = "SELECT * FROM humo_trees LEFT JOIN humo_tree_texts\r\n\t\tON humo_trees.tree_id=humo_tree_texts.treetext_tree_id\r\n\t\tAND treetext_language='" . $selected_language . "' WHERE tree_prefix='" . safe_text($tree_prefix) . "'";
    $datasql = $dbh->query($sql);
    @($dataDb = $datasql->fetch(PDO::FETCH_OBJ));
    if (isset($dataDb->treetext_name)) {
        $treetext_array['id'] = $dataDb->treetext_id;
        $treetext_array['name'] = $dataDb->treetext_name;
        $treetext_array['mainmenu_text'] = $dataDb->treetext_mainmenu_text;
        $treetext_array['mainmenu_source'] = $dataDb->treetext_mainmenu_source;
        $treetext_array['family_top'] = $dataDb->treetext_family_top;
        $treetext_array['family_footer'] = $dataDb->treetext_family_footer;
        $found_text = true;
    }
    if ($found_text === false) {
        // *** Final try to show some texts ***
        $sql = "SELECT * FROM humo_trees LEFT JOIN humo_tree_texts\r\n\t\t\tON humo_trees.tree_id=humo_tree_texts.treetext_tree_id\r\n\t\t\tAND treetext_name LIKE '_%'\r\n\t\t\tWHERE tree_prefix='" . safe_text($tree_prefix) . "'";
        @($datasql = $dbh->query($sql));
        @($dataDb = $datasql->fetch(PDO::FETCH_OBJ));
        if (isset($dataDb->treetext_name)) {
            $treetext_array['id'] = $dataDb->treetext_id;
            $treetext_array['name'] = $dataDb->treetext_name;
            $treetext_array['mainmenu_text'] = $dataDb->treetext_mainmenu_text;
            $treetext_array['mainmenu_source'] = $dataDb->treetext_mainmenu_source;
            $treetext_array['family_top'] = $dataDb->treetext_family_top;
            $treetext_array['family_footer'] = $dataDb->treetext_family_footer;
        }
    }
    return $treetext_array;
}
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:53,代码来源:show_tree_text.php

示例3: __

}
// *** Remove user ***
if (isset($_GET['remove_user'])) {
    echo '<div class="confirm">';
    echo __('Are you sure you want to delete this user?');
    echo ' <form method="post" action="' . $_SERVER['PHP_SELF'] . '" style="display : inline;">';
    echo '<input type="hidden" name="page" value="' . $_GET['page'] . '">';
    echo '<input type="hidden" name="remove_user" value="' . $_GET['remove_user'] . '">';
    echo ' <input type="Submit" name="remove_user2" value="' . __('Yes') . '" style="color : red; font-weight: bold;">';
    echo ' <input type="Submit" name="submit" value="' . __('No') . '" style="color : blue; font-weight: bold;">';
    echo '</form>';
    echo '</div>';
}
if (isset($_POST['remove_user2'])) {
    // *** Delete source connection ***
    $sql = "DELETE FROM humo_users WHERE user_id='" . safe_text($_POST['remove_user']) . "'";
    $result = $dbh->query($sql);
}
// *************
// *** Users ***
// *************
if (CMS_SPECIFIC == "Joomla") {
    echo "<form method=\"POST\" action=\"index.php?option=com_humo-gen&amp;task=admin&amp;page=users\">\n";
} else {
    echo "<form method=\"POST\" action=\"" . $_SERVER['PHP_SELF'] . "\">\n";
}
echo '<input type="hidden" name="page" value="' . $page . '">';
echo '<br><table class="humo standard" border="1" style="width:95%;">';
echo '<tr class="table_header_large"><th>' . __('User') . '</th>';
echo '<th>' . __('E-mail address') . '</th>';
echo '<th>' . __('Change password') . '</th>';
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:31,代码来源:users.php

示例4: edit_category

 function edit_category($ID, $cat)
 {
     global $scdb;
     if (intval($ID) != $ID || $ID < 1 || !isset($cat['category'][2])) {
         $this->category->message = 'Error: You must call $scadmin->edit_category() with an associative array, with at least the "category" value being set.';
         return false;
     }
     $ID = (int) $ID;
     $category = safe_text($cat['category'], 50);
     $nicename = nicename($cat['nicename']);
     $info = isset($cat['info']) ? safe_text($cat['info'], 200) : '';
     $oldcat = $scdb->get_row("SELECT * FROM `{$scdb->categories}` WHERE `ID` = '{$ID}' LIMIT 1");
     if ($scdb->num_rows != 1) {
         $this->category->message = "Can't find category with `ID` = '{$ID}'";
         $scdb->debug();
         return false;
     }
     if (!$scdb->query("UPDATE `{$scdb->categories}` SET `category`='{$category}', `nicename`='{$nicename}', `info`='{$info}' WHERE `ID` = '{$ID}' LIMIT 1")) {
         $this->category->message = 'Error Updating Category!';
         $scdb->debug();
         return false;
     }
     $folder = IMG_FOLDER . $oldcat->nicename;
     if (is_dir($folder)) {
         rename($folder, IMG_FOLDER . $nicename);
     } else {
         $this->category->message = 'Error: Category Folder ' . IMG_FOLDER . $oldcat->nicename . ' can&#39;t be found!';
         return false;
     }
     $this->category->message = 'Succesfully Edited Category!';
     return true;
 }
开发者ID:jclay06,项目名称:scms,代码行数:32,代码来源:admin.class.php

示例5: json_decode

<?php

include 'db.php';
include 'init.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_POST)) {
    $_POST = json_decode(file_get_contents('php://input'), true);
}
$name = $email = $phone = $address = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = safe_text($_POST['name']);
    $email = safe_text($_POST['email']);
    $phone = safe_text($_POST['phone']);
    $address = safe_text($_POST['address']);
    $stmt = $conn->prepare('INSERT INTO members(name, email, phone, address) VALUES(:name, :email, :phone, :address)');
    $stmt->execute(array(':name' => $name, ':email' => $email, ':phone' => $phone, ':address' => $address));
    $results = $conn->query('SELECT * FROM members');
    $results = json_encode($results->fetchAll());
    print_r($results);
}
开发者ID:selim-mahmud,项目名称:angularjs-demo-code,代码行数:19,代码来源:save.php

示例6: name_qry

function name_qry($search_name, $search_part)
{
    $text = "LIKE '%" . safe_text($search_name) . "%'";
    // *** Default value: "contains" ***
    if ($search_part == 'equals') {
        $text = "='" . safe_text($search_name) . "'";
    }
    if ($search_part == 'starts_with') {
        $text = "LIKE '" . safe_text($search_name) . "%'";
    }
    return $text;
}
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:12,代码来源:list.php

示例7: process_text

function process_text($text_process, $text_sort = 'standard')
{
    global $dbh, $tree_id, $user, $tree_prefix_quoted;
    global $screen_mode, $text_presentation;
    if ($text_presentation != 'hide') {
        //1 NOTE Text by person#werktekst#
        //2 CONT 2e line text persoon#2e werktekst#
        //2 CONT 3e line #3e werktekst# tekst persoon
        // *** If multiple texts are read, a | seperator character is added ***
        // *** Split the text, and check for @Nxx@ texts ***
        $text_pieces = explode("|", $text_process);
        $text_result = '';
        for ($i = 0; $i <= count($text_pieces) - 1; $i++) {
            // *** Search for Aldfaer texts ***
            if (substr($text_pieces[$i], 0, 1) == '@') {
                $text_check = substr($text_pieces[$i], 1, -1);
                //$search_text=$dbh->query("SELECT * FROM ".$tree_prefix_quoted."texts
                //	WHERE text_gedcomnr='".safe_text($text_check)."'");
                $search_text = $dbh->query("SELECT * FROM humo_texts\r\n\t\t\t\t\tWHERE text_tree_id='" . $tree_id . "' AND text_gedcomnr='" . safe_text($text_check) . "'");
                $search_textDb = $search_text->fetch(PDO::FETCH_OBJ);
                if ($text_result) {
                    $text_result .= '<br>';
                }
                $text_result .= @$search_textDb->text_text;
            } else {
                if ($text_result) {
                    $text_result .= '<br>';
                }
                $text_result .= $text_pieces[$i];
            }
        }
        if ($text_result) {
            $text_process = $text_result;
        }
        // *** If needed strip worktext (used in Haza-Data) ***
        if ($user['group_work_text'] == 'n') {
            // *** Added a '!' sign to prevent '0' detection. The routine will stop then! ***
            $text_process = "!" . $text_process;
            while (strpos($text_process, '#') > 0) {
                $first = strpos($text_process, '#');
                $text1 = substr($text_process, 0, $first);
                $text_process = substr($text_process, $first + 1);
                $second = strpos($text_process, '#');
                $text2 = substr($text_process, $second + 1);
                $text_process = $text1 . $text2;
            }
            // *** Strip added '!' sign ***
            $text_process = substr($text_process, 1);
        }
        // *** Convert all url's in a text to clickable links ***
        $text_process = preg_replace("#(^|[ \n\r\t])www.([a-z\\-0-9]+).([a-z]{2,4})(\$|[ \n\r\t])#mi", "\\1<a href=\"http://www.\\2.\\3\" target=\"_blank\">www.\\2.\\3</a>\\4", $text_process);
        //$text_process = preg_replace("#(^|[ \n\r\t])(((ftp://)|(http://)|(https://))([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+))#mi", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $text_process);
        $text_process = preg_replace("#(^|[ \n\r\t])(((http://)|(https://))([a-z0-9\\-\\.,\\?!%\\*_\\#:;~\\&\$@\\/=\\+]+))#mi", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $text_process);
        if ($text_process) {
            $text_process = nl2br($text_process);
        }
        if ($text_process) {
            if ($screen_mode == 'RTF') {
                $text_process = '<i>' . $text_process . '</i>';
            } else {
                $text_process = '<span class="text">' . $text_process . '</span>';
            }
        }
        // *** Show tekst in popup screen ***
        if ($text_presentation == 'popup' and $screen_mode != 'PDF' and $screen_mode != 'RTF' and $text_process) {
            global $rtlmarker, $family_id, $main_person, $alignmarker, $text_nr;
            if (isset($text_nr)) {
                $text_nr++;
            } else {
                $text_nr = 1;
            }
            $text = '<div class="' . $rtlmarker . 'sddm" style="left:10px;top:10px;display:inline;">';
            $text .= '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . '"';
            $text .= ' style="display:inline" ';
            $text .= 'onmouseover="mopen(event,\'show_text' . $text_nr . '\',0,0)"';
            $text .= 'onmouseout="mclosetime()">';
            if ($text_sort == 'standard') {
                $text .= '[' . lcfirst(__('Text')) . ']';
            } else {
                $text .= '<b>[' . __('Text') . ']</b>';
            }
            $text .= '</a>';
            if (substr_count($text_process, '<br>') > 10 or substr_count($text_process, '<br />') > 10) {
                $text .= '<div class="sddm_fixed" style="z-index:10; padding:4px; text-align:' . $alignmarker . '; direction:' . $rtlmarker . '; height:300px; width:80%; overflow-y: scroll;" id="show_text' . $text_nr . '" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
            } else {
                $text .= '<div class="sddm_fixed" style="z-index:10; padding:4px; text-align:' . $alignmarker . '; direction:' . $rtlmarker . ';" id="show_text' . $text_nr . '" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
            }
            // *** Show a correct website link in text ***
            $text_process = str_ireplace('<a href', '<a style="display:inline" href', $text_process);
            $text .= $text_process;
            $text .= '</div>';
            $text .= '</div>';
            $text_process = $text;
        }
    } else {
        $text_process = '';
    }
    return $text_process;
}
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:99,代码来源:process_text.php

示例8: elseif

 $hide_tree = false;
 if (in_array(@$dataDb->tree_id, $hide_tree_array)) {
     $hide_tree = true;
 }
 $_SESSION['tree_id'] = '';
 $tree_id = '';
 if ($hide_tree) {
     $_SESSION['tree_prefix'] = '';
     $_SESSION['tree_id'] = '';
     $tree_id = '';
 } elseif (isset($dataDb->tree_id)) {
     $_SESSION['tree_id'] = $dataDb->tree_id;
     $tree_id = $dataDb->tree_id;
 }
 // *** Set variabele for queries ***
 $tree_prefix_quoted = safe_text($_SESSION['tree_prefix']);
 /*
 // *****************************************************************
 // Use these lines to show a background picture for EACH FAMILY TREE
 // *****************************************************************
 print '<style type="text/css">';
 $picture= "pictures/".$_SESSION['tree_prefix'].".jpg";
 print " body { background-image: url($picture);}";
 print "</style>";
 */
 //echo '<script type="text/javascript" src="'.CMS_ROOTPATH.'include/sliderbar/slider.js"></script>';
 if (strpos($_SERVER['REQUEST_URI'], "STAR") !== false or strpos($_SERVER['REQUEST_URI'], "maps") !== false or strpos($_SERVER['REQUEST_URI'], "HOUR") !== false or $user['group_pictures'] == 'j') {
     // if lightbox activated or descendant chart or hourglass chart or google maps is used --> load jquery
     echo '	<script src="' . CMS_ROOTPATH . 'include/jqueryui/js/jquery-1.8.0.min.js"></script> ';
 }
 if (strpos($_SERVER['REQUEST_URI'], "STAR") !== false or strpos($_SERVER['REQUEST_URI'], "HOUR") !== false or strpos($_SERVER['REQUEST_URI'], "maps") !== false) {
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:31,代码来源:header.php

示例9: thread_edit

/**
 * Used to update a thread informations
 * @global type $input
 * @return boolean
 */
function thread_edit()
{
    global $input;
    $thread_id = $input['thread_id'];
    $thread_message = surround_url($input['thread_message'] . edited_on());
    $thread_timecode = intval($input['thread_timecode']);
    $thread_title = htmlspecialchars($input['thread_title']);
    $album = $input['thread_album'];
    $asset = $input['thread_asset'];
    $_SESSION['current_thread '] = $thread_id;
    // remove php and javascript tags
    $thread_message = safe_text($thread_message);
    thread_update($thread_id, $thread_title, $thread_message, $thread_timecode, $album, $_SESSION['user_full_name']);
    cache_asset_threads_unset($album, $asset);
    cache_album_threads_unset($album);
    trace_append(array('3', 'thread_edit', $album, $asset, $thread_timecode, $thread_id));
    return thread_details_update();
}
开发者ID:jingyexu,项目名称:ezcast,代码行数:23,代码来源:web_index.php

示例10: safe_text

<?php

$user["user_name"] = "";
if (isset($_SESSION["user_name"])) {
    $user["user_name"] = $_SESSION["user_name"];
    $account = "SELECT * FROM humo_users WHERE user_id=" . safe_text($_SESSION["user_id"]);
} else {
    // *** For guest account ("gast" is only used for backward compatibility) ***
    $account = "SELECT * FROM humo_users WHERE user_name='gast' OR user_name='guest'";
}
$accountqry = $dbh->query($account);
try {
    @($accountDb = $accountqry->fetch(PDO::FETCH_OBJ));
} catch (PDOException $e) {
    echo "No valid user / Geen geldige gebruiker.";
}
$groupsql = $dbh->query("SELECT * FROM humo_groups WHERE group_id='" . $accountDb->user_group_id . "'");
try {
    @($groupDb = $groupsql->fetch(PDO::FETCH_OBJ));
} catch (PDOException $e) {
    echo "No valid usergroup / Geen geldige gebruikersgroup.";
}
if (!isset($groupDb->group_statistics)) {
    $user['group_statistics'] = 'j';
} else {
    $user['group_statistics'] = $groupDb->group_statistics;
}
if (!isset($groupDb->group_birthday_rss)) {
    $user['group_birthday_rss'] = 'j';
} else {
    $user['group_birthday_rss'] = $groupDb->group_birthday_rss;
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:31,代码来源:settings_user.php

示例11: exit

<?php

if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])) {
    exit(header('Location: index.php'));
}
if (isset($_POST['submit'])) {
    $conf = file_get_contents('../config.php');
    $host = safe_text($_POST['host']);
    $user = safe_text($_POST['user']);
    $pass = safe_text($_POST['pass']);
    $name = safe_text($_POST['name']);
    $pref = safe_text($_POST['prefix']);
    $conf = preg_replace("/define\\('DB_HOST', '(.+)?'\\);/", "define('DB_HOST', '" . $host . "');", $conf, 1);
    $conf = preg_replace("/define\\('DB_USER', '(.+)?'\\);/", "define('DB_USER', '" . $user . "');", $conf, 1);
    if (isset($_POST['change'])) {
        if ($_POST['pass'] != $_POST['pass2']) {
            echo "<p class=\"message\">You're passwords do not match!</p>";
        } else {
            $conf = preg_replace("/define\\('DB_PASS', '(.+)?'\\);/", "define('DB_PASS', '" . $_POST['pass'] . "');", $conf, 1);
        }
    }
    $conf = preg_replace("/define\\('DB_NAME', '(.+)?'\\);/", "define('DB_NAME', '" . $name . "');", $conf, 1);
    $conf = preg_replace("/define\\('DB_TABLE_PREFIX', '(.+)?'\\);/", "define('DB_NAME', '" . $pref . "');", $conf, 1);
    echo '<pre>', strtr($conf, array('<?php' => '&lt;php', '?>' => '?&gt;')), '</pre>';
}
?>

<h3>Setup Options</h3>
<form action="index.php?page=options&option=mysql" method="post" class="jNice">
<fieldset>
开发者ID:jclay06,项目名称:scms,代码行数:30,代码来源:options_mysql.php

示例12: unlink

                if (file_exists('update/temp_update_check.php')) {
                    unlink('update/temp_update_check.php');
                }
            } else {
                $update_text = '  ' . __('Online version check unavailable.');
                //$update_text.= ' <a href="'.$path_tmp.'page=install_update&update_check=1">'.__('Update options').'</a>';
                if (!function_exists('curl_exec')) {
                    $update_text .= ' Extension php_curl.dll is disabled.';
                } elseif (!is_writable('update')) {
                    $update_text .= ' Folder admin/update/ is read only.';
                }
                // *** Update settings, only check for update once a day ***
                $update_last_check = date("Y-m-d");
                $result = $dbh->query("UPDATE humo_settings\n\t\t\t\t\t\tSET setting_value='" . safe_text($update_last_check) . "'\n\t\t\t\t\t\tWHERE setting_variable='update_last_check'");
            }
            $result = $dbh->query("UPDATE humo_settings\n\t\t\t\t\tSET setting_value='" . safe_text($update_text) . "'\n\t\t\t\t\tWHERE setting_variable='update_text'");
            $update_text .= ' *';
        } else {
            // No online check now, use saved text...
            $update_text = $humo_option["update_text"];
        }
        echo $update_text;
    }
}
// ******************
// *** START MENU ***
// ******************
if ($page != 'login' and $page != 'update') {
    if (isset($_GET['page'])) {
        $page = $_GET['page'];
    }
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:31,代码来源:index.php

示例13: while

$page_qry = $dbh->query("SELECT * FROM humo_cms_pages WHERE page_menu_id='0' AND page_status!='' ORDER BY page_order");
while ($cms_pagesDb = $page_qry->fetch(PDO::FETCH_OBJ)) {
    echo '<a href="' . CMS_ROOTPATH . 'cms_pages.php?select_page=' . $cms_pagesDb->page_id . '">' . $cms_pagesDb->page_title . '</a><br>';
}
$qry = $dbh->query("SELECT * FROM humo_cms_menu ORDER BY menu_order");
while ($cmsDb = $qry->fetch(PDO::FETCH_OBJ)) {
    echo '<p><b>' . $cmsDb->menu_name . '</b><br>';
    $page_qry = $dbh->query("SELECT * FROM humo_cms_pages WHERE page_menu_id='" . $cmsDb->menu_id . "' AND page_status!='' ORDER BY page_order");
    while ($cms_pagesDb = $page_qry->fetch(PDO::FETCH_OBJ)) {
        echo '<a href="' . CMS_ROOTPATH . 'cms_pages.php?select_page=' . $cms_pagesDb->page_id . '">' . $cms_pagesDb->page_title . '</a><br>';
    }
}
echo '</div>';
echo '<div id="mainmenu_center_alt" style="text-align:left;">';
if (isset($_GET['select_page'])) {
    $select_page = safe_text($_GET['select_page']);
} else {
    $page_qry = $dbh->query("SELECT * FROM humo_cms_pages WHERE page_status!='' ORDER BY page_menu_id, page_order ASC LIMIT 0,1");
    $cms_pagesDb = $page_qry->fetch(PDO::FETCH_OBJ);
    $select_page = $cms_pagesDb->page_id;
}
// *** Show page ***
$page_qry = $dbh->query("SELECT * FROM humo_cms_pages WHERE page_id='" . $select_page . "' AND page_status!=''");
$cms_pagesDb = $page_qry->fetch(PDO::FETCH_OBJ);
echo $cms_pagesDb->page_text;
// *** Raise page counter ***
// Only count page once every session
$session_counter[] = '';
//@$itemteller=$cms_pagesDb->page_counter;
$visited = 0;
if (isset($_SESSION["opslag_sessieteller"])) {
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:31,代码来源:cms_pages.php

示例14: fams_add

function fams_add($personnr, $familynr)
{
    global $dbh, $tree_id, $tree_prefix, $gedcom_date, $gedcom_time;
    // *** Add marriage to person records ***
    $person_qry = "SELECT * FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='" . safe_text($personnr) . "'";
    $person_result = $dbh->query($person_qry);
    $person_db = $person_result->fetch(PDO::FETCH_OBJ);
    if (@$person_db->pers_gedcomnumber) {
        $fams = $person_db->pers_fams;
        if ($fams) {
            $fams1 = explode(";", $fams);
            $pers_indexnr = $fams1[0];
            $fams .= ';' . $familynr;
        } else {
            $pers_indexnr = $familynr;
            $fams = $familynr;
        }
        $sql = "UPDATE humo_persons SET\n\t\t\tpers_fams='" . $fams . "',\n\t\t\tpers_indexnr='" . $pers_indexnr . "',\n\t\t\tpers_changed_date='" . $gedcom_date . "',\n\t\t\tpers_changed_time='" . $gedcom_time . "'\n\t\t\tWHERE pers_id='" . $person_db->pers_id . "'";
        $result = $dbh->query($sql);
    }
}
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:21,代码来源:editor_inc.php

示例15: safe_text

     if ($page_nr != '1') {
         echo ' <a href="index.php?page=' . $page . '&amp;page_up=' . $previous_page . '&amp;select_page=' . $cms_pagesDb->page_id . '"><img src="' . CMS_ROOTPATH_ADMIN . 'images/arrow_up.gif" border="0" alt="up"></a>';
     }
     //if ($cms_pagesDb->page_order!=$count_pages){
     if ($page_nr != $count_pages) {
         echo ' <a href="index.php?page=' . $page . '&amp;page_down=' . $cms_pagesDb->page_order . '&amp;select_page=' . $cms_pagesDb->page_id . '&amp;menu_id=' . $cms_pagesDb->page_menu_id . '"><img src="' . CMS_ROOTPATH_ADMIN . 'images/arrow_down.gif" border="0" alt="down"></a>';
     }
     echo '</td><td>';
     echo ' <a href="index.php?page=' . $page . '&amp;select_page=' . $cms_pagesDb->page_id . '">' . $cms_pagesDb->page_title . '</a><br>';
     echo '</td></tr>';
     $previous_page = $cms_pagesDb->page_id;
 }
 echo '</table>';
 echo '</td><td valign="top">';
 if (isset($_GET["select_page"])) {
     $sql = "SELECT * FROM humo_cms_pages WHERE page_id=" . safe_text($_GET["select_page"]);
     $qry = $dbh->query($sql);
     $cms_pagesDb = $qry->fetch(PDO::FETCH_OBJ);
     //if ($memosoort2Db->website_id==$memosoortDb->menu_website_id){
     //	echo '<a href="index.php?page='.$page.'&amp;select_page='.$cms_pagesDb->page_id.'">'.$cms_pagesDb->page_title.'</a><br>';
     $page_id = $cms_pagesDb->page_id;
     $page_text = $cms_pagesDb->page_text;
     $page_status = $cms_pagesDb->page_status;
     $page_title = $cms_pagesDb->page_title;
     $page_menu_id = $cms_pagesDb->page_menu_id;
     $page_counter = $cms_pagesDb->page_counter;
     $page_edit = 'change';
 } else {
     // *** Add new page ***
     $page_id = '';
     $page_text = '';
开发者ID:kalinin-sanja,项目名称:FamilyTree,代码行数:31,代码来源:cms_pages.php


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