116 lines
2.9 KiB
PHP
116 lines
2.9 KiB
PHP
|
<?
|
||
|
#############################################
|
||
|
# phpDirectory v1.0 #
|
||
|
# #
|
||
|
# Jean-Yves Fort - 21 avril 2001 #
|
||
|
# jean-yves@lozere-online.com #
|
||
|
# #
|
||
|
# Consulter les documents du repertoire #
|
||
|
# /doc pour plus d'informations sur #
|
||
|
# l'installation, l'auteur, les conditions #
|
||
|
# d'utilisation. #
|
||
|
#############################################
|
||
|
?>
|
||
|
<?
|
||
|
$link = mysql_connect($host,$user,$password);
|
||
|
|
||
|
// arborescence en ligne
|
||
|
|
||
|
echo "<table width=450><tr><td>";
|
||
|
$x=0;
|
||
|
$i=0;
|
||
|
$requete=mysql_db_query($base,"select * from ".$basecat." where id=".$c." ",$link);
|
||
|
|
||
|
$nomcat = mysql_result($requete,$i,"nomcat");
|
||
|
$nomcat=lire($nomcat);
|
||
|
$id = mysql_result($requete,$i,"id");
|
||
|
$idsubcat = mysql_result($requete,$i,"idsubcat");
|
||
|
|
||
|
$varid[$x]=$id;
|
||
|
$varnom[$x]=$nomcat;
|
||
|
|
||
|
echo "<a href=\"index.php\">Accueil</a>";
|
||
|
|
||
|
if($idsubcat!=0)
|
||
|
{
|
||
|
$x=1;
|
||
|
|
||
|
while($idsubcat!=0)
|
||
|
{
|
||
|
$requete2=mysql_db_query($base,"select nomcat, id, idsubcat from $basecat where id=".$idsubcat." ",$link);
|
||
|
|
||
|
$nomcat = mysql_result($requete2,$i,"nomcat");
|
||
|
$nomcat=lire($nomcat);
|
||
|
$id = mysql_result($requete2,$i,"id");
|
||
|
$idsubcat = mysql_result($requete2,$i,"idsubcat");
|
||
|
|
||
|
$varid[$x]=$id;
|
||
|
$varnom[$x]=$nomcat;
|
||
|
$x++;
|
||
|
}
|
||
|
|
||
|
$x=$x-1;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
while($x!=-1)
|
||
|
{
|
||
|
echo " > <a href=\"index.php?m=c&c=".$varid[$x]."\">".$varnom[$x]."</a>";
|
||
|
$x=$x-1;
|
||
|
}
|
||
|
|
||
|
echo "</td></tr></table><br>";
|
||
|
|
||
|
// affichage des sous-categories
|
||
|
|
||
|
$requete3=mysql_db_query($base,"select id, nomcat from ".$basecat." where idsubcat=".$c." order by prio",$link);
|
||
|
$num3=mysql_num_rows($requete3);
|
||
|
|
||
|
if($num3!=0)
|
||
|
{
|
||
|
echo "<table width=450>";
|
||
|
$i3=0;
|
||
|
$ligne3=0;
|
||
|
while ( $i3<$num3 )
|
||
|
{
|
||
|
if ($ligne3==0) { echo "<tr>"; }
|
||
|
$nomcat = mysql_result($requete3,$i3,"nomcat");
|
||
|
$nomcat=lire($nomcat);
|
||
|
$id = mysql_result($requete3,$i3,"id");
|
||
|
echo "<td valign=\"top\" align=\"left\" width=\"50%\"><li><a href=\"index.php?m=c&c=".$id."\">".$nomcat."</a></td>";
|
||
|
$ligne3++;
|
||
|
if ($ligne3==2) { echo "</tr>"; $ligne3=0; }
|
||
|
$i3++;
|
||
|
}
|
||
|
echo "</table><br>";
|
||
|
}
|
||
|
|
||
|
// affichage des sites
|
||
|
|
||
|
echo "<table width=450><tr><td>";
|
||
|
$requete4=mysql_db_query($base,"select nomsite, id, description, url from ".$basesites." where cat1=".$c." and valid=1 or cat2=".$c." and valid=1 or cat3=".$c." and valid=1 order by nomsite",$link);
|
||
|
$num4=mysql_num_rows($requete4);
|
||
|
|
||
|
if($num4!=0)
|
||
|
{
|
||
|
$n=0;
|
||
|
while ( $n<$num4 )
|
||
|
{
|
||
|
$id=mysql_result($requete4,$n,"id");
|
||
|
$sitenom=mysql_result($requete4,$n,"nomsite");
|
||
|
$nomsite=lire($nomsite);
|
||
|
$description=mysql_result($requete4,$n,"description");
|
||
|
$description=lire($description);
|
||
|
$url=mysql_result($requete4,$n,"url");
|
||
|
|
||
|
include("html/show.php");
|
||
|
|
||
|
$n++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
echo "</td></tr></table><br>";
|
||
|
include("html/zbox.php");
|
||
|
?>
|