예제 #1
0
<?php

require_once "classes/Pager.class.php";
$where = isset($_GET['where']) && isValidLetter($_GET['where'], "%") ? $_GET['where'] : '';
$page = isset($_GET['page']) && isValidID($_GET['page']) ? $_GET['page'] : 1;
if (empty($where)) {
    $where = $alphabet[0];
    // Set the default on to 'a' so that we don't have everything listed (faster this way)
}
// Pull First Letters
$let = ":";
$sql = "SELECT DISTINCT LOWER(SUBSTRING(ingredient_name, 1, 1)) AS A FROM {$db_table_ingredients} WHERE ingredient_user = '******'";
$rc = $DB_LINK->Execute($sql);
DBUtils::checkResult($rc, NULL, NULL, $sql);
while (!$rc->EOF) {
    if (ord($rc->fields[0]) >= 192 and ord($rc->fields[0]) <= 222 and ord($rc->fields[0]) != 215) {
        // "Select lower"
        $rc->fields[0] = chr(ord($rc->fields[0]) + 32);
    }
    // above doesn't work with ascii > 192, this fixes it
    $let .= $rc->fields[0];
    // it could be "a" or "A", so just go with the only returned item
    $rc->MoveNext();
}
?>

<table cellspacing="0" cellpadding="1" border="0" width="100%">
<tr>
        <td align="left" class="title"><?php 
echo $LangUI->_('Ingredient Index');
?>
<?php

if (stristr($_SERVER['REQUEST_URI'], "session.php") || !defined('T3_ABSPATH')) {
    die("no access");
}
#   TemaTres : aplicación para la gestión de lenguajes documentales #       #
#                                                                        #
#   Copyright (C) 2004-2008 Diego Ferreyra tematres@r020.com.ar
#   Distribuido bajo Licencia GNU Public License, versión 2 (de junio de 1.991) Free Software Foundation
#
###############################################################################################################
# Include para seleccionar include o función de visualizaicon de listas de términos #
//Mostrar alfabeto
if ($_GET[letra]) {
    // sanitice $letra
    $letra = isValidLetter($_GET[letra]);
}
if (strlen($letra) > 0 && strlen($letra) < 5) {
    echo '<div class="container" id="bodyText">';
    echo '<div class="row">';
    echo HTMLlistaAlfabeticaUnica($letra);
    echo HTMLterminosLetra($letra);
    echo '</div>';
    echo '</div>';
} elseif (strlen($search_string) > 0) {
    //check again
    $search_string = XSSprevent($search_string);
    echo resultaBusca($search_string, $_GET["tipo"]);
} elseif (is_numeric($metadata["arraydata"]["tema_id"]) || $_GET["taskterm"] == 'addTerm' || $_GET["taskterm"] == 'addTermSuggested') {
    require_once T3_ABSPATH . 'common/include/inc.vistaTermino.php';
} elseif (is_numeric($_GET[estado_id])) {
function do_meta_tag($arrayTermino = "")
{
    global $CFG;
    //Si hay algún tema de proveniente de algún proceso
    global $tema;
    //Si hay cambio de idioma... para que no dé duplicado
    $labelChangeLang = $_GET[setLang] ? '. ' . ucfirst($_SESSION[$_SESSION["CFGURL"]][lang][0]) : '';
    $ARRAYfetchValues = ARRAYfetchValues('METADATA');
    $_SESSION["CFGContributor"] = $ARRAYfetchValues["dc:contributor"]["value"];
    $_SESSION["CFGRights"] = $ARRAYfetchValues["dc:rights"]["value"];
    $_SESSION["CFGPublisher"] = $ARRAYfetchValues["dc:publisher"]["value"];
    $_SESSION["CFGlastMod"] = fetchlastMod();
    if (secure_data($tema, "digit")) {
        //Si hay tema_id desde GET o POST
        $tema_id = $_POST[tema] ? secure_data($_POST[tema], "digit") : secure_data($_GET[tema], "digit");
        //Si hay tema_id desde algún proceso
        $tema_id = $tema ? $tema : $tema_id;
    }
    $letra = isValidLetter($_GET[letra]);
    if (secure_data($tema_id, "digit")) {
        $ARRAYdatosTermino = ARRAYverDatosTermino(secure_data($tema_id, "digit"));
        $sub_title = '; ' . xmlentities($ARRAYdatosTermino[titTema]);
        $ver_sub_title = xmlentities($ARRAYdatosTermino[titTema]) . ' - ';
        $relMeta = '<link rel="Dublin Core metadata" type="application/xml" href="xml.php?dcTema=' . $ARRAYdatosTermino[idTema] . '" title="Dublin Core ' . xmlentities($datosTermino[titTema]) . '" />';
        $relMeta .= '<link rel="MADS metadata" type="application/xml" href="xml.php?madsTema=' . $ARRAYdatosTermino[idTema] . '" title="MADS ' . xmlentities($datosTermino[titTema]) . '" />';
        $relMeta .= '<link rel="Zthes metadata" type="application/xml" href="xml.php?zthesTema=' . $ARRAYdatosTermino[idTema] . '" title="Zthes ' . xmlentities($datosTermino[titTema]) . '" />';
        $relMeta .= '<link rel="Skos metadata" type="application/rdf+xml" href="xml.php?skosTema=' . $ARRAYdatosTermino[idTema] . '" title="Skos Core ' . xmlentities($datosTermino[titTema]) . '" />';
        $relMeta .= '<link rel="TopicMap metadata" type="application/xml" href="xml.php?xtmTema=' . $ARRAYdatosTermino[idTema] . '" title="TopicMap ' . xmlentities($datosTermino[titTema]) . '" />';
    } elseif (strlen($letra) > 0) {
        $sub_title = '; ' . MSG_ResultLetra . ' ' . xmlentities($letra);
        $ver_sub_title = ' :: ' . MENU_ListaAbc . ': ' . xmlentities($letra);
    }
    $meta_tag = '<title>' . xmlentities($ver_sub_title . ' ' . $_SESSION[CFGTitulo] . $labelChangeLang) . '</title>';
    /*
    * Error en verificación
    $meta_tag.='<meta http-equiv="content-language" content="'.LANG.'" />';
    */
    $page_encode = in_array($CFG["_CHAR_ENCODE"], array('utf-8', 'iso-8859-1')) ? $CFG["_CHAR_ENCODE"] : 'utf-8';
    header('Content-type: text/html; charset=' . $page_encode . '');
    $meta_tag .= '<meta http-equiv="content-type" content="application/xhtml+xml; charset=' . $page_encode . '" />';
    $meta_tag .= '<meta name="generator" content="' . xmlentities($_SESSION[CFGVersion]) . '" />';
    $meta_tag .= '<meta name="description" content="' . html2txt($ver_sub_title . $_SESSION[CFGCobertura] . $labelChangeLang) . '" />';
    $meta_tag .= '<meta name="keywords" content="' . xmlentities($_SESSION[CFGKeywords] . $sub_title . $labelChangeLang) . '" />';
    $meta_tag .= '<meta name="author" content="' . xmlentities($_SESSION[CFGAutor]) . '" />';
    $meta_tag .= '<meta name="Creation_Date" content="' . $_SESSION[CFGCreacion] . '" />';
    $meta_tag .= '<meta http-equiv="last-modified" content="' . $_SESSION["CFGlastMod"] . '" />';
    $meta_tag .= '<meta name="robots" content="index, follow" />';
    $meta_tag .= '<meta name="revisit-after" content="15 days" />';
    //$meta_tag.='<!-- Dublin Core -->';
    $meta_tag .= '<meta name="DC.Title"        content="' . xmlentities($ver_sub_title . ' ' . $_SESSION[CFGTitulo]) . '" />';
    $meta_tag .= '<meta name="DC.Creator"      content="' . xmlentities($_SESSION[CFGAutor]) . '" />';
    $meta_tag .= '<meta name="DC.Subject"      content="' . xmlentities($_SESSION[CFGKeywords] . $sub_title) . '" />';
    $meta_tag .= '<meta name="DC.Description"  content="' . html2txt($ver_sub_title . $_SESSION[CFGCobertura], true) . '" />';
    $meta_tag .= '<meta name="DC.Publisher"    content="' . xmlentities($_SESSION[CFGPublisher]) . '" />';
    $meta_tag .= '<meta name="DC.Contributor"    content="' . xmlentities($_SESSION[CFGContributor]) . '" />';
    $meta_tag .= '<meta name="DC.Rights"    content="' . xmlentities($_SESSION[CFGRights]) . '" />';
    $meta_tag .= '<meta name="DC.Date"         content="' . $_SESSION[CFGCreacion] . '" />';
    $meta_tag .= '<meta name="DC.Language"     content="' . LANG . '" />';
    $meta_tag .= '<link rel="' . MENU_Inicio . '" href="' . $_SESSION[CFGURL] . 'index.php" title="' . MENU_Inicio . '" />';
    $meta_tag .= '<link rel="' . MENU_ListaSis . '" href="' . $_SESSION[CFGURL] . 'index.php" title="' . MENU_ListaSis . '" />';
    $meta_tag .= '<link rel="' . MENU_ListaAbc . '" href="' . $_SESSION[CFGURL] . 'index.php?letra=?" title="' . MENU_ListaAbc . '" />';
    $meta_tag .= '<link rel="' . MENU_Sobre . '" href="' . $_SESSION[CFGURL] . 'sobre.php" title="' . MENU_Sobre . '" />';
    $meta_tag .= '<link rel="help" href="' . $_SESSION[CFGURL] . 'sobre.php" title="' . MENU_Sobre . '" />';
    $meta_tag .= '<link rel="login" href="' . $_SESSION[CFGURL] . 'login.php" title="' . LABEL_login . '" />';
    $meta_tag .= '<link rel="service" href="' . $_SESSION[CFGURL] . 'services.php" title="terminogical web services" />';
    $meta_tag .= '<link rel="bookmark" href="' . $_SESSION[CFGURL] . '"/>';
    $meta_tag .= '<link rel="rss" type="application/rss+xml" href="xml.php?rss=true" title="RSS ' . xmlentities($_SESSION[CFGTitulo]) . '" />';
    $meta_tag .= '<link rel="alternate" type="application/rss+xml" href="xml.php?rss=true" title="RSS ' . xmlentities($_SESSION[CFGTitulo]) . '" />';
    $meta_tag .= $relMeta;
    return array("metadata" => $meta_tag, "arraydata" => $ARRAYdatosTermino);
}
function HTMLlistaAlfabeticaUnica($letra = "")
{
    $sqlMenuAlfabetico = SQLlistaABC($letra);
    if (SQLcount($sqlMenuAlfabetico) > 0) {
        $rows .= '<ul class="pagination pagination-sm">';
        while ($datosAlfabetico = $sqlMenuAlfabetico->FetchRow()) {
            $datosAlfabetico[0] = isValidLetter($datosAlfabetico[0]);
            //is a valid letter
            if (strlen($datosAlfabetico[0]) > 0) {
                $class = $datosAlfabetico[1] == 0 ? '' : 'active';
                if (!ctype_digit($datosAlfabetico[0])) {
                    $menuAlfabetico .= '<li class="' . $class . '">';
                    $menuAlfabetico .= '    <a title="' . LABEL_verTerminosLetra . ' ' . $datosAlfabetico[0] . '" href="index.php?letra=' . $datosAlfabetico[0] . '">' . $datosAlfabetico[0] . '</a>';
                    $menuAlfabetico .= '</li>';
                } else {
                    $menuNoAlfabetico = '<li class="' . $class . '">';
                    $menuNoAlfabetico .= '    <a title="' . LABEL_verTerminosLetra . ' ' . $datosAlfabetico[0] . '" href="index.php?letra=' . $datosAlfabetico[0] . '">0-9</a>';
                    $menuNoAlfabetico .= '</li>';
                }
            }
        }
        //fin del while
    }
    $menuAlfabetico = '<div class="text-center"><ul class="pagination pagination-sm">' . $menuNoAlfabetico . $menuAlfabetico . '</ul></div>';
    return $menuAlfabetico;
}