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


PHP categories::listChilds方法代码示例

本文整理汇总了PHP中categories::listChilds方法的典型用法代码示例。如果您正苦于以下问题:PHP categories::listChilds方法的具体用法?PHP categories::listChilds怎么用?PHP categories::listChilds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在categories的用法示例。


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

示例1: creer_categ_xml

function creer_categ_xml($dom, $parent, $niveau, $num_noeud, $libelle_categorie, $note_application, $comment_public, $num_parent)
{
    global $dbh, $aff_langue;
    global $aff_note_application, $aff_commentaire, $aff_voir, $aff_voir_aussi, $aff_tg, $aff_ts;
    $noeud_categ = creer_noeud_xml($dom, $parent, "DE");
    //ID
    creer_noeud_xml($dom, $noeud_categ, "ID", $num_noeud);
    //Libellé
    creer_noeud_xml($dom, $noeud_categ, "LIB_DE", $libelle_categorie);
    //Note application
    if ($note_application && $aff_note_application) {
        creer_noeud_xml($dom, $noeud_categ, "NA", $note_application);
    }
    //Commentaire public
    if ($comment_public && $aff_commentaire) {
        creer_noeud_xml($dom, $noeud_categ, "NOTE", $comment_public);
    }
    //Voir aussi
    if ($aff_voir_aussi) {
        $requete = "SELECT libelle_categorie,num_noeud_dest FROM voir_aussi JOIN categories ON num_noeud_dest=num_noeud AND categories.langue='" . $aff_langue . "' WHERE num_noeud_orig='" . $num_noeud . "' AND voir_aussi.langue='" . $aff_langue . "' ORDER BY libelle_categorie";
        $res = pmb_mysql_query($requete);
        if ($res && pmb_mysql_num_rows($res)) {
            while ($va = pmb_mysql_fetch_object($res)) {
                if (trim($va->libelle_categorie)) {
                    creer_noeud_xml($dom, $noeud_categ, "TA", $va->libelle_categorie);
                }
            }
        }
    }
    //Employé pour
    if ($aff_voir) {
        $requete = "SELECT libelle_categorie,id_noeud FROM noeuds JOIN categories ON id_noeud=num_noeud AND categories.langue='" . $aff_langue . "' WHERE num_renvoi_voir='" . $num_noeud . "' ORDER BY libelle_categorie";
        $res = pmb_mysql_query($requete);
        if ($res && pmb_mysql_num_rows($res)) {
            while ($ep = pmb_mysql_fetch_object($res)) {
                if (trim($ep->libelle_categorie)) {
                    creer_noeud_xml($dom, $noeud_categ, "EP", $ep->libelle_categorie);
                }
            }
        }
    }
    //Terme générique
    if ($aff_tg && $num_parent) {
        $requete = "SELECT libelle_categorie FROM categories WHERE langue='" . $aff_langue . "' AND num_noeud='" . $num_parent . "'";
        $res = pmb_mysql_query($requete);
        if ($res && pmb_mysql_num_rows($res)) {
            while ($tg = pmb_mysql_fetch_object($res)) {
                if (trim($tg->libelle_categorie)) {
                    creer_noeud_xml($dom, $noeud_categ, "TG", $tg->libelle_categorie);
                }
            }
        }
    }
    //TS
    if ($aff_ts) {
        $res = categories::listChilds($num_noeud, $aff_langue, 0, "libelle_categorie");
        if ($res && pmb_mysql_num_rows($res)) {
            $noeud_ts = creer_noeud_xml($dom, $noeud_categ, "TS" . $niveau);
            while ($categ = pmb_mysql_fetch_object($res)) {
                if (trim($categ->libelle_categorie)) {
                    creer_categ_xml($dom, $noeud_ts, $niveau + 1, $categ->num_noeud, $categ->libelle_categorie, $categ->note_application, $categ->comment_public, $categ->num_parent);
                }
            }
        }
    }
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:66,代码来源:print_thesaurus.php

示例2: child_list

 function child_list($image = './images/folder.gif', $css)
 {
     global $css;
     global $dbh;
     global $opac_categories_nb_col_subcat, $opac_categories_sub_mode;
     global $main;
     global $lang;
     global $charset;
     global $base_path;
     $current_col = 0;
     // récupération des enfants
     if ($this->id == $this->thes->num_noeud_racine) {
         $result = categories::listChilds($this->id, $lang, 0, $opac_categories_sub_mode);
     } else {
         $result = categories::listChilds($this->id, $lang, 1, $opac_categories_sub_mode);
     }
     if (pmb_mysql_num_rows($result) < $opac_categories_nb_col_subcat) {
         // nombre de sous-catégories réduit
         while ($child = pmb_mysql_fetch_object($result)) {
             $libelle = $child->libelle_categorie;
             $note = $child->comment_public;
             $id = $child->num_noeud;
             //$c2_categ = new category($id);
             if ($child->num_renvoi_voir) {
                 $libelle = "<i>{$libelle}</i>@";
                 $id = $child->num_renvoi_voir;
             }
             // Si il y a présence d'un commentaire affichage du layer
             $result_com = self::zoom_categ($id, $note);
             $l .= "<a href='./index.php?lvl=categ_see&id={$id}&main={$main}' class='small'>";
             if (category::has_notices($id)) {
                 $l .= " <img src='{$base_path}/images/folder_search.gif' border=0 align='absmiddle' />";
             } else {
                 $l .= "<img src='{$image}' border='0' align='top' />";
             }
             $l .= "<a/>" . $result_com['zoom'];
             $l .= "<a href='./index.php?lvl=categ_see&id={$id}&main={$main}' class='small' " . $result_com['java_com'] . ">" . $libelle . "</a><br />";
         }
         $l = "<br /><div style='margin-left:48px'>{$l}</div>";
     } else {
         $l = "<table border='0' style='margin-left:48px' cellpadding='3'>";
         while ($child = pmb_mysql_fetch_object($result)) {
             $libelle = $child->libelle_categorie;
             $note = $child->comment_public;
             $id = $child->num_noeud;
             //$c_categ =  new category($id);
             if ($child->num_renvoi_voir) {
                 $libelle = "<i>{$libelle}</i>@";
                 $id = $child->num_renvoi_voir;
             }
             // Si il y a présence d'un commentaire affichage du layer
             $result_com = self::zoom_categ($id, $note);
             if ($current_col == 0) {
                 $l .= "\n<tr>";
             }
             $l .= "<td align='top'><a href='./index.php?lvl=categ_see&id={$id}&main={$main}' class='small'>";
             if (category::has_notices($id)) {
                 $l .= " <img src='{$base_path}/images/folder_search.gif' border=0 align='absmiddle' />";
             } else {
                 $l .= "<img src='{$image}' border='0' align='top' />";
             }
             $l .= "</a>" . $result_com['zoom'];
             $l .= "<a href='./index.php?lvl=categ_see&id={$id}&main={$main}' class='small' " . $result_com['java_com'] . ">" . $libelle . "</a></td>";
             if ($current_col == $opac_categories_nb_col_subcat - 1) {
                 $l .= '</tr>';
                 $current_col = 0;
             } else {
                 $current_col++;
             }
         }
         $l .= '</table>';
     }
     return $l;
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:74,代码来源:categorie.class.php


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