par
pierre19 » 02 mars 2012, 16:40
Bonjour à tous,
J'ai un petit problème que vous pourriez sans doute m'aider à résoudre.
J'administre un petit site canin dans lequel il y a un forum (dont le créateur des scripts n'est plus joignable) utilisant de très vieux scripts php.
Sur Explorer, aucun problème.Mais sur Firefox ou Chrome, j'ai un souci.
Voici l'url de mon forum :
http://pierre.meneghetti.free.fr/fila/f ... umfila.htm
En face des messages, il y a une petite flèche bleue dirigée vers le bas. Elle est destinée à faire apparaître les réponses au message initial.
C'est cette fonction qui ne marche pas sur Firefox ou sur Chrome mais qui fonctionne sur Explorer.
Pour info, le fichier de la petite flèche bleue se nomme "rep.gif"
D'avance merci de votre analyse et de vos réponses
Voici le script concerné :
-------------------------------------------------------------------------
<?php
if (!ini_get("register-globals")){
foreach ($_REQUEST as $k=>$v){
if (!isset($GLOBALS[$k])){
${$k}=$v;
}
}
}
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified:" . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
if ($Forum) include("./Forum_Var_$Forum.php");
if ($Frame) {
$HList="list";
$HLire="lire";
$TList="list";
$TLire="lire";
}
else {
$HList="self";
$HLire="self";
$TList="_self";
$TLire="_self";
}
if ($MaBase=@mysql_connect($Serveur,$Login,$MDP)) {
$NomCook=$Forum."Lu";
$cc=$$NomCook;
$CookFD=$Forum.FD;
$FD=$$CookFD;
$ClassL[0]="class=\"lu\"";
$ClassL[1]="class=\"paslu\"";
// if (!isset($Seg)) $Seg=1;
$NSeg=($N_Seg0?$N_Seg0:10);
if (isset($Titre)) {
$InsertOk=1;
if ($Pseudo) {
$Req=mysql_query($Base,"SELECT Id, Nom, Url FROM $Forum WHERE Pere=-2 AND Nom='$Nom'",$MaBase);
if ($Enr=mysql_fetch_object($Req)) {
if ($Enr->Url==$MDPPseudo) $Req=mysql_query($Base,"UPDATE $Forum SET Titre=NOW(), Mail='$Mail' WHERE Id=$Enr->Id",$MaBase);
else { // MDP NOK
$InsertOk=0;
?>
<html><body><script>
alert("Le mot de passe saisie ne correspond pas a celui référencé.\nVeuillez le ressaisir ou contactez le WebMaster");
history.back();
</script></body></html>
<?
}
} else $Req=mysql_query($Base,"INSERT INTO $Forum VALUES (NULL, '-2', '$Nom', '$Mail', '$MDPPseudo', NOW(), NULL, NOW(), NULL, NULL)");
}
if ($InsertOk) {
if (eregi("http:/",$Texte)){
?>
<html><body><script>
alert("Pour cause de spam nous devons interdir l'insertions de liens complets dans les messages, veuillez nous en excuser.");
history.back();
</script></body></html>
<?
}else{
$Cook="F@auxRhum-".$Forum;
if ($CookOK) setcookie($Cook,$Nom.";;".$Mail.";;".($SauvMDP?$MDPPseudo:"").";;".$Url.";;".$Ville.";;".$Pays,time()+60*60*24*365);
$Texte=ereg_replace( " ", " ", $Texte );
$Titre=ereg_replace( " ", " ", $Titre );
$Req=mysql_query($Base,"INSERT INTO $Forum VALUES (NULL, '$Pere', '$Nom', '$Mail', '$Url', '$Titre', '$Texte', NOW(), '$Ville', '$Pays')");
}
}
}
function msglu($Id) {
$div=31;
global $cc;
$N=floor(($Id-1)/$div);
while (strlen($cc)<6*($N+1)) $cc="000000".$cc;
$nc=base_convert(substr($cc,-6*($N+1),6),36,10) | pow(2,($Id-1)%$div);
$Nouvcook=substr("00000".base_convert($nc,10,36),-6);
$cc=substr($cc,0,strlen($cc)-6*($N+1)).$Nouvcook.substr($cc,strlen($cc)-6*$N);
return $cc;
}
function LuON($Id) {
$div=31;
global $cc;
$b=floor($Id/$div);
$c=$Id%$div;
$d=pow(2,$c);
$bc=base_convert(substr($cc,-6*($b+1),6),36,10);
if ((($bc & $d)!=0) and (strlen($cc)>=6*($b+1))) return 0;
else return 1;
}
if (file_exists("./Smiley.php")) include("./Smiley.php");
function Extrait($Niv,$Decal) {
global $MaBase,$Forum,$Base,$MDP,$LuT,$NL_Url,$ClassL,$FD,$NF,$NFnl,$CTitMsg,$CookOK,$Seg,$TLire;
$Req=mysql_query($Base,"SELECT Id,Nom,Titre,DATE_FORMAT(Date,'%d/%m/%Y à %T') AS Da FROM $Forum WHERE Pere=$Niv ORDER BY Id DESC",$MaBase);
while ($Enr=mysql_fetch_object($Req)) {
echo "<img SRC='v.gif' align='middle' border=0 width='".(20*$Decal)."' height='15'> \n";
if ($CookOK) $FL=LuON($Enr->Id-1);
if ($FL and $NL_Url and $CookOK) echo "<img src='$NL_Url'>\n";
$Titre=$Enr->Titre;
/* $Titre=str_replace(":))","<img src='sm2.gif' border='0'>",$Titre);
$Titre=str_replace(":)","<img src='sm.gif' border='0'>",$Titre);
$Titre=str_replace(";)","<img src='sm1.gif' border='0'>",$Titre);
$Titre=str_replace(":(","<img src='sm3.gif' border='0'>",$Titre);
$Titre=str_replace(":<","<img src='sm4.gif' border='0'>",$Titre); */
$Titre=Smiley($Titre);
echo "<a id='m".$Enr->Id."' $ClassL[$FL] href='Forum_Lire.php?Forum=$Forum&Id=$Enr->Id&Seg=$Seg' target='$TLire' OnClick=\"Lu('m".$Enr->Id."');\">$Titre</a>\n";
echo " <small> ($Enr->Nom - le ".str_replace("%", "", $Enr->Da).") </small><br>\n";
Extrait($Enr->Id,$Decal+1);
}
}
function Compt($Niv) {
global $MaBase,$Forum,$Base,$MDP,$LuT,$NL_Url,$ClassL,$FD,$NF,$NFnl;
$Req=mysql_query($Base,"SELECT Id FROM $Forum WHERE Pere=$Niv",$MaBase);
while ($Enr=mysql_fetch_object($Req)) {
$NF++;
$NFnl+=LuON($Enr->Id-1);
Compt($Enr->Id);
}
}
// Tous a marquer en lu !!!!
if (isset($TousLu)) {
$Req=mysql_query($Base,"SELECT Id FROM $Forum",$MaBase);
while ($Enr=mysql_fetch_object($Req)) {
$cc=msglu($Enr->Id);
}
setcookie($NomCook,$cc,time()+60*60*24*365);
}
?>
<html>
<head>
<script>
function Lu(Nmsg) {
if (IE4) document.all[Nmsg].className = "lu";
}
var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4))?true:false;
ver4 = (NS4 || IE4) ? true : false;
function expandIt(){return}
function expandAll(){return}
isExpanded = false;
function getIndex(el) {
ind = null;
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id == el) {
ind = i;
break;
}
}
return ind;
}
function arrange() {
nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY = nextY;
nextY += whichEl.document.height;
}
}
}
function initIt(){
if (NS4) {
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
}
arrange();
}
else {
tempColl = document.all.tags("DIV");
for (i=0; i<tempColl.length; i++) {
if (tempColl(i).className == "child") tempColl(i).style.display = "none";
}
}
}
function expandIt(el,ff,f0) {
if (!ver4) return;
if (IE4) {expandIE(el,ff,f0)} else {expandNS(el,ff,f0)}
}
function expandIE(el,fff,f1) {
whichEl = eval(el + "Child");
Repel = eval("t"+el);
if (fff) whichIm = eval(el+"Img");
if (whichEl.style.display == "none") {
Repel.style.display = "none";
whichEl.style.display = "block";
if (fff) whichIm.src = "per.gif";
}
else {
if (f1) {
whichEl.style.display = "none";
Repel.style.display = "";
if (fff) whichIm.src = "rep.gif";
}
}
window.event.cancelBubble = true ;
}
function expandNS(el,fff,f1) {
whichEl = eval("document." + el + "Child");
// Repel = eval("document.t" + el);
if (fff) whichIm = eval("document." + el + "Parent.document.images['imEx']");
if (whichEl.visibility == "hide") {
// Repel.visibility = "hide";
whichEl.visibility = "show";
if (fff) whichIm.src = "per.gif";
}
else {
if (f1) {
// Repel.visibility = "show";
whichEl.visibility = "hide";
if (fff) whichIm.src = "rep.gif";
}
}
arrange();
}
function showAll() {
for (i=firstInd; i<document.layers.length; i++) {
whichEl = document.layers[i];
whichEl.visibility = "show";
}
}
function expandAll(isBot) {
newSrc = (isExpanded) ? "rep.gif" : "per.gif";
if (NS4) {
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Parent") != -1) {
// whichEl.document.images["imEx"].src = newSrc;
}
if (whichEl.id.indexOf("Child") != -1) {
whichEl.visibility = (isExpanded) ? "hide" : "show";
}
}
arrange();
// if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
}
else {
divColl = document.all.tags("DIV");
for (i=0; i<divColl.length; i++) {
if (divColl(i).className == "child") {
divColl(i).style.display = (isExpanded) ? "none" : "block";
}
}
imColl = document.images.item("imEx");
for (i=0; i<imColl.length; i++) {
imColl(i).src = newSrc;
}
}
isExpanded = !isExpanded;
}
with (document) {
write("<STYLE TYPE='text/css'>");
if (NS4)
{
write(".parent {text-decoration:none; position:absolute; visibility:hidden;}");
write(".child {position:absolute; visibility:hidden}");
write(".item {text-decoration:none;}");
write(".regular {position:absolute; visibility:hidden}");
}
else
{
write(".child {text-decoration:none; display:none}");
write(".parent {text-decoration:none;}");
write(".item { text-decoration:none; }");
}
write("</STYLE>");
}
onload = initIt;
</script>
<title>List des Msg</title>
<?
$fsnl=100;
if ($NL_B) $fsnl+=50;
if ($NL_BB) $fsnl+=100;
if ($NL_I) $fst="font-style: oblique";
if ($NL_G) $fw="font-weight: bold";
?>
<style type="text/css">
<!--
a {color: <? echo $CTitMsg;?>}
a:hover {text-decoration: none}
a.paslu {<? echo "color: $NL_CT; font-size: $fsnl%;$fst;$fw;"; ?>}
-->
</style>
</head>
<?
echo "<body topmargin='2' leftmargin='5' bgproperties='fixed' background='$UrlFond' text='$CT' link='$CTitMsg' vlink='$CTitMsg' bgColor='$CF' alink='$CTitMsg'>\n";
?>
<form name="FD">
<?
if (!$Frame) {
include("./Forum_Titre1.php");
echo "<hr width='90%'>";
}
?>
<DIV ID="toto" align="center"><center>
<a href="Forum_Saisie.php?Forum=<? echo $Forum; ?>" target="_self" OnMouseOver="window.status='Poster un nouveau message';return true" OnMouseOut="window.status='';return true">Poster un nouveau message</a><!-- -
<small><A HREF="javascript:expandAll(1)" target="_self" OnMouseOver="window.status='Tout Développer / Réduire';return true" OnMouseOut="window.status='';return true">Tout développer / Réduire</A></small> --><br>
<?
if ($CookOK) {
$NNlu=0;
$NM=0;
$Req=mysql_query($Base,"SELECT Id FROM $Forum WHERE Pere>=0",$MaBase);
while ($Enr=mysql_fetch_object($Req)) {
$NM++;
$NNlu+=LuON($Enr->Id-1);
}
$Req=mysql_query($Base,"SELECT COUNT(Id) AS NBPere FROM $Forum WHERE Pere=0",$MaBase);
$Enr=mysql_fetch_object($Req);
$NNPere=$Enr->NbPere;
echo "<font color='$CTitMsg'>$NNlu</font> message";
if ($NNlu>1) echo "s";
echo " non lu";
if ($NNlu>1) echo "s";
echo " sur <font color='$CTitMsg'>$NM</font><small>\n (<a class=new href='Forum_List.php?TousLu=1&Forum=$Forum&Seg=$Seg' target='_self'>Marquer tous les messages en lus</a>)</small>";
}
?>
</form></center></div>
<DIV ID="el1Parent" CLASS="parent" > </div>
<?
$Deb=$Seg*$NSeg;
$CM=0;
$DebA=$Deb+NSeg;
$Req=mysql_query($Base,"SELECT Id,Nom,Titre,DATE_FORMAT(Date,'%d/%m/%Y à %T') AS Da FROM $Forum WHERE Pere=0 ORDER BY Id DESC LIMIT $DebA,$NSeg",$MaBase);
$j=1;
while ($Enr=mysql_fetch_object($Req)) {
$j++;
echo "\n<div ID='el".$j."Parent' CLASS='parent'>\n";
// echo "\n<div ID='el".$Enr->Id."Parent' CLASS='parent'>\n";
if ($CookOK) $FL=LuON($Enr->Id-1);
$Titre=$Enr->Titre;
/* $Titre=str_replace(":))","<img src='sm2.gif' border='0'>",$Titre);
$Titre=str_replace(":)","<img src='sm.gif' border='0'>",$Titre);
$Titre=str_replace(";)","<img src='sm1.gif' border='0'>",$Titre);
$Titre=str_replace(":(","<img src='sm3.gif' border='0'>",$Titre);
$Titre=str_replace(":<","<img src='sm4.gif' border='0'>",$Titre); */
$Titre=Smiley($Titre);
$NF=0;
$NFnl=0;
Compt($Enr->Id);
if ($NF) {
?>
<a class="item" HREF="javascript:void(0);" onClick="expandIt('el<? echo $j;?>',1,1);" target="_self">
<img NAME="imEx" SRC="rep.gif" align="middle" BORDER="0" ID="el<? echo $j;?>Img" OnMouseOver="window.status='Développer / Réduire le fils de discussion';return true" OnMouseOut="window.status='';return true"></a> <!-- width="20" height="20" -->
<?
}
else echo "<img SRC='v.gif' align='middle' border=0 width='14' height='14'> ";
if ($FL and $NL_Url and $CookOK) echo "<img src='$NL_Url' align='middle'>\n";
echo "<a id='m".$Enr->Id."' $ClassL[$FL] name='li".$j."' href='Forum_Lire.php?Forum=$Forum&Id=$Enr->Id&Seg=$Seg' target='$TLire' OnClick=\"Lu('m".$Enr->Id."');";
if ($NF) echo "expandIt('el$j',1,0)";
echo "\">$Titre</a>\n";
echo " <small> ($Enr->Nom - le ".str_replace("%", "", $Enr->Da).") </small>\n";
if ($NF) {
echo "<span ID='tel$j'><SMALL>- <I><a ".$ClassL[($NFnl?1:0)]." href=\"#\" onClick=\"expandIt('el$j',1,1)\" target='_self'>$NF réponse";
if ($NF>1) echo "s";
echo "</a>\n";
if ($NFnl) {
if ($NL_Url) echo " <a href=\"#\" onClick=\"expandIt('el$j',1,0)\" target='_self'><img src='$NL_Url' border='0' align='middle'></a>\n";
else {
echo " (<a href=\"#\" onClick=\"expandIt('el$j',1,0)\" target='_self'>$NFnl nouveau";
if ($NFnl>1) echo "x";
echo "</a>)\n";
}
}
echo "</I></SMALL></font></span>\n";
}
echo "</div>\n<div ID='el".$j."Child' CLASS='child'>\n";
Extrait($Enr->Id,2);
echo "</div>";
$FinA=$Enr->Id;
}
?>
<DIV ID="el<? echo $j+1;?>Parent" CLASS="parent" align="center"><center><br>
<?
if ($Deb) {
$Req=mysql_query($Base,"SELECT Id FROM $Forum WHERE Pere=0 ORDER BY Id DESC LIMIT $Deb",$MaBase);
$NF=0;
$NFnl=0;
while ($Enr=mysql_fetch_object($Req)) {
$NF++;
$NFnl+=LuON($Enr->Id-1);
Compt($Enr->Id);
if (($CM % $NSeg)==($NSeg-1)) {
echo "\n<a href='Forum_List.php?Forum=$Forum&Seg=".floor($CM/$NSeg)."' target='_self'><img src='prec.gif' align='middle' border='";
if ($NFnl) {
echo "3' alt='$NFnl non-lu";
if ($NFnl>1) echo "s";
echo "'></a>";
}
else echo "0'></a>";
$NF=0;
$NFnl=0;
}
$CM++;
}
}
$Req=mysql_query($Base,"SELECT Id FROM $Forum WHERE Pere=0 and Id<$FinA ORDER BY Id DESC ",$MaBase);
if ($Req) {
$CM+=$NSeg;
$NFF=mysql_num_rows($Req);
$NF=0;
$NFnl=0;
while ($Enr=mysql_fetch_object($Req)) {
$NFF--;
$NF++;
$NFnl+=LuON($Enr->Id-1);
Compt($Enr->Id);
if (($CM % $NSeg)==($NSeg-1) or !$NFF) {
echo "\n<a href='Forum_List.php?Forum=$Forum&Seg=".floor($CM/$NSeg)."' target='_self'><img src='suiv.gif' align='middle' border='";
if ($NFnl) {
echo "3'";
echo " alt='$NFnl non-lu";
if ($NFnl>1) echo "s";
echo "'></a>";
}
else echo "0'></a>";
$NF=0;
$NFnl=0;
}
$CM++;
}
}
mysql_close($MaBase);
?>
<!-- <form method="post" action="Forum_Admin.php" name="Admin" target="_self">
<input type="hidden" name="Forum" value="<?php echo $Forum; ?>">
<b>Administration du Forum :</b><br>Mot de passe : <input type="password" name="MDPAdmin"> <input type="submit" name="OK" value="Ok">
</form> -->
<p><A HREF="Forum_Admin.php?Forum=<? echo $Forum; ?>&DebLogin=1" style="text-decoration: none" target="_self"> </A>
</center></div>
<script>
if (NS4) {
firstEl = "el1Parent";
firstInd = getIndex(firstEl);
showAll();
arrange();
}
</script></body>
</html>
<? }
else { ?>
<html>
<head>
<title>List des Msg</title>
</head>
<? echo "<body topmargin='2' leftmargin='2' bgproperties='fixed' background='$UrlFond' text='$CT' link='$CTitMsg' vlink='$CTitMsg' bgColor='$CF' alink='$CTitMsg'>\n"; ?>
<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0"><tr><td width="100%">
<p align="center"><big><strong>Attention : Problème de connexion...</strong></big></td></tr></table>
</body>
</html>
<? } ?>
-----------------------------------------------------------------------------------------
Bonjour à tous,
J'ai un petit problème que vous pourriez sans doute m'aider à résoudre.
J'administre un petit site canin dans lequel il y a un forum (dont le créateur des scripts n'est plus joignable) utilisant de très vieux scripts php.
Sur Explorer, aucun problème.Mais sur Firefox ou Chrome, j'ai un souci.
Voici l'url de mon forum :
http://pierre.meneghetti.free.fr/fila/forum2/forumfila.htm
En face des messages, il y a une petite flèche bleue dirigée vers le bas. Elle est destinée à faire apparaître les réponses au message initial.
C'est cette fonction qui ne marche pas sur Firefox ou sur Chrome mais qui fonctionne sur Explorer.
Pour info, le fichier de la petite flèche bleue se nomme "rep.gif"
D'avance merci de votre analyse et de vos réponses
Voici le script concerné :
-------------------------------------------------------------------------
[php]<?php
if (!ini_get("register-globals")){
foreach ($_REQUEST as $k=>$v){
if (!isset($GLOBALS[$k])){
${$k}=$v;
}
}
}
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified:" . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
if ($Forum) include("./Forum_Var_$Forum.php");
if ($Frame) {
$HList="list";
$HLire="lire";
$TList="list";
$TLire="lire";
}
else {
$HList="self";
$HLire="self";
$TList="_self";
$TLire="_self";
}
if ($MaBase=@mysql_connect($Serveur,$Login,$MDP)) {
$NomCook=$Forum."Lu";
$cc=$$NomCook;
$CookFD=$Forum.FD;
$FD=$$CookFD;
$ClassL[0]="class=\"lu\"";
$ClassL[1]="class=\"paslu\"";
// if (!isset($Seg)) $Seg=1;
$NSeg=($N_Seg0?$N_Seg0:10);
if (isset($Titre)) {
$InsertOk=1;
if ($Pseudo) {
$Req=mysql_query($Base,"SELECT Id, Nom, Url FROM $Forum WHERE Pere=-2 AND Nom='$Nom'",$MaBase);
if ($Enr=mysql_fetch_object($Req)) {
if ($Enr->Url==$MDPPseudo) $Req=mysql_query($Base,"UPDATE $Forum SET Titre=NOW(), Mail='$Mail' WHERE Id=$Enr->Id",$MaBase);
else { // MDP NOK
$InsertOk=0;
?>
<html><body><script>
alert("Le mot de passe saisie ne correspond pas a celui référencé.\nVeuillez le ressaisir ou contactez le WebMaster");
history.back();
</script></body></html>
<?
}
} else $Req=mysql_query($Base,"INSERT INTO $Forum VALUES (NULL, '-2', '$Nom', '$Mail', '$MDPPseudo', NOW(), NULL, NOW(), NULL, NULL)");
}
if ($InsertOk) {
if (eregi("http:/",$Texte)){
?>
<html><body><script>
alert("Pour cause de spam nous devons interdir l'insertions de liens complets dans les messages, veuillez nous en excuser.");
history.back();
</script></body></html>
<?
}else{
$Cook="F@auxRhum-".$Forum;
if ($CookOK) setcookie($Cook,$Nom.";;".$Mail.";;".($SauvMDP?$MDPPseudo:"").";;".$Url.";;".$Ville.";;".$Pays,time()+60*60*24*365);
$Texte=ereg_replace( " ", " ", $Texte );
$Titre=ereg_replace( " ", " ", $Titre );
$Req=mysql_query($Base,"INSERT INTO $Forum VALUES (NULL, '$Pere', '$Nom', '$Mail', '$Url', '$Titre', '$Texte', NOW(), '$Ville', '$Pays')");
}
}
}
function msglu($Id) {
$div=31;
global $cc;
$N=floor(($Id-1)/$div);
while (strlen($cc)<6*($N+1)) $cc="000000".$cc;
$nc=base_convert(substr($cc,-6*($N+1),6),36,10) | pow(2,($Id-1)%$div);
$Nouvcook=substr("00000".base_convert($nc,10,36),-6);
$cc=substr($cc,0,strlen($cc)-6*($N+1)).$Nouvcook.substr($cc,strlen($cc)-6*$N);
return $cc;
}
function LuON($Id) {
$div=31;
global $cc;
$b=floor($Id/$div);
$c=$Id%$div;
$d=pow(2,$c);
$bc=base_convert(substr($cc,-6*($b+1),6),36,10);
if ((($bc & $d)!=0) and (strlen($cc)>=6*($b+1))) return 0;
else return 1;
}
if (file_exists("./Smiley.php")) include("./Smiley.php");
function Extrait($Niv,$Decal) {
global $MaBase,$Forum,$Base,$MDP,$LuT,$NL_Url,$ClassL,$FD,$NF,$NFnl,$CTitMsg,$CookOK,$Seg,$TLire;
$Req=mysql_query($Base,"SELECT Id,Nom,Titre,DATE_FORMAT(Date,'%d/%m/%Y à %T') AS Da FROM $Forum WHERE Pere=$Niv ORDER BY Id DESC",$MaBase);
while ($Enr=mysql_fetch_object($Req)) {
echo "<img SRC='v.gif' align='middle' border=0 width='".(20*$Decal)."' height='15'> \n";
if ($CookOK) $FL=LuON($Enr->Id-1);
if ($FL and $NL_Url and $CookOK) echo "<img src='$NL_Url'>\n";
$Titre=$Enr->Titre;
/* $Titre=str_replace(":))","<img src='sm2.gif' border='0'>",$Titre);
$Titre=str_replace(":)","<img src='sm.gif' border='0'>",$Titre);
$Titre=str_replace(";)","<img src='sm1.gif' border='0'>",$Titre);
$Titre=str_replace(":(","<img src='sm3.gif' border='0'>",$Titre);
$Titre=str_replace(":<","<img src='sm4.gif' border='0'>",$Titre); */
$Titre=Smiley($Titre);
echo "<a id='m".$Enr->Id."' $ClassL[$FL] href='Forum_Lire.php?Forum=$Forum&Id=$Enr->Id&Seg=$Seg' target='$TLire' OnClick=\"Lu('m".$Enr->Id."');\">$Titre</a>\n";
echo " <small> ($Enr->Nom - le ".str_replace("%", "", $Enr->Da).") </small><br>\n";
Extrait($Enr->Id,$Decal+1);
}
}
function Compt($Niv) {
global $MaBase,$Forum,$Base,$MDP,$LuT,$NL_Url,$ClassL,$FD,$NF,$NFnl;
$Req=mysql_query($Base,"SELECT Id FROM $Forum WHERE Pere=$Niv",$MaBase);
while ($Enr=mysql_fetch_object($Req)) {
$NF++;
$NFnl+=LuON($Enr->Id-1);
Compt($Enr->Id);
}
}
// Tous a marquer en lu !!!!
if (isset($TousLu)) {
$Req=mysql_query($Base,"SELECT Id FROM $Forum",$MaBase);
while ($Enr=mysql_fetch_object($Req)) {
$cc=msglu($Enr->Id);
}
setcookie($NomCook,$cc,time()+60*60*24*365);
}
?>
<html>
<head>
<script>
function Lu(Nmsg) {
if (IE4) document.all[Nmsg].className = "lu";
}
var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4))?true:false;
ver4 = (NS4 || IE4) ? true : false;
function expandIt(){return}
function expandAll(){return}
isExpanded = false;
function getIndex(el) {
ind = null;
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id == el) {
ind = i;
break;
}
}
return ind;
}
function arrange() {
nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY = nextY;
nextY += whichEl.document.height;
}
}
}
function initIt(){
if (NS4) {
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
}
arrange();
}
else {
tempColl = document.all.tags("DIV");
for (i=0; i<tempColl.length; i++) {
if (tempColl(i).className == "child") tempColl(i).style.display = "none";
}
}
}
function expandIt(el,ff,f0) {
if (!ver4) return;
if (IE4) {expandIE(el,ff,f0)} else {expandNS(el,ff,f0)}
}
function expandIE(el,fff,f1) {
whichEl = eval(el + "Child");
Repel = eval("t"+el);
if (fff) whichIm = eval(el+"Img");
if (whichEl.style.display == "none") {
Repel.style.display = "none";
whichEl.style.display = "block";
if (fff) whichIm.src = "per.gif";
}
else {
if (f1) {
whichEl.style.display = "none";
Repel.style.display = "";
if (fff) whichIm.src = "rep.gif";
}
}
window.event.cancelBubble = true ;
}
function expandNS(el,fff,f1) {
whichEl = eval("document." + el + "Child");
// Repel = eval("document.t" + el);
if (fff) whichIm = eval("document." + el + "Parent.document.images['imEx']");
if (whichEl.visibility == "hide") {
// Repel.visibility = "hide";
whichEl.visibility = "show";
if (fff) whichIm.src = "per.gif";
}
else {
if (f1) {
// Repel.visibility = "show";
whichEl.visibility = "hide";
if (fff) whichIm.src = "rep.gif";
}
}
arrange();
}
function showAll() {
for (i=firstInd; i<document.layers.length; i++) {
whichEl = document.layers[i];
whichEl.visibility = "show";
}
}
function expandAll(isBot) {
newSrc = (isExpanded) ? "rep.gif" : "per.gif";
if (NS4) {
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Parent") != -1) {
// whichEl.document.images["imEx"].src = newSrc;
}
if (whichEl.id.indexOf("Child") != -1) {
whichEl.visibility = (isExpanded) ? "hide" : "show";
}
}
arrange();
// if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
}
else {
divColl = document.all.tags("DIV");
for (i=0; i<divColl.length; i++) {
if (divColl(i).className == "child") {
divColl(i).style.display = (isExpanded) ? "none" : "block";
}
}
imColl = document.images.item("imEx");
for (i=0; i<imColl.length; i++) {
imColl(i).src = newSrc;
}
}
isExpanded = !isExpanded;
}
with (document) {
write("<STYLE TYPE='text/css'>");
if (NS4)
{
write(".parent {text-decoration:none; position:absolute; visibility:hidden;}");
write(".child {position:absolute; visibility:hidden}");
write(".item {text-decoration:none;}");
write(".regular {position:absolute; visibility:hidden}");
}
else
{
write(".child {text-decoration:none; display:none}");
write(".parent {text-decoration:none;}");
write(".item { text-decoration:none; }");
}
write("</STYLE>");
}
onload = initIt;
</script>
<title>List des Msg</title>
<?
$fsnl=100;
if ($NL_B) $fsnl+=50;
if ($NL_BB) $fsnl+=100;
if ($NL_I) $fst="font-style: oblique";
if ($NL_G) $fw="font-weight: bold";
?>
<style type="text/css">
<!--
a {color: <? echo $CTitMsg;?>}
a:hover {text-decoration: none}
a.paslu {<? echo "color: $NL_CT; font-size: $fsnl%;$fst;$fw;"; ?>}
-->
</style>
</head>
<?
echo "<body topmargin='2' leftmargin='5' bgproperties='fixed' background='$UrlFond' text='$CT' link='$CTitMsg' vlink='$CTitMsg' bgColor='$CF' alink='$CTitMsg'>\n";
?>
<form name="FD">
<?
if (!$Frame) {
include("./Forum_Titre1.php");
echo "<hr width='90%'>";
}
?>
<DIV ID="toto" align="center"><center>
<a href="Forum_Saisie.php?Forum=<? echo $Forum; ?>" target="_self" OnMouseOver="window.status='Poster un nouveau message';return true" OnMouseOut="window.status='';return true">Poster un nouveau message</a><!-- -
<small><A HREF="javascript:expandAll(1)" target="_self" OnMouseOver="window.status='Tout Développer / Réduire';return true" OnMouseOut="window.status='';return true">Tout développer / Réduire</A></small> --><br>
<?
if ($CookOK) {
$NNlu=0;
$NM=0;
$Req=mysql_query($Base,"SELECT Id FROM $Forum WHERE Pere>=0",$MaBase);
while ($Enr=mysql_fetch_object($Req)) {
$NM++;
$NNlu+=LuON($Enr->Id-1);
}
$Req=mysql_query($Base,"SELECT COUNT(Id) AS NBPere FROM $Forum WHERE Pere=0",$MaBase);
$Enr=mysql_fetch_object($Req);
$NNPere=$Enr->NbPere;
echo "<font color='$CTitMsg'>$NNlu</font> message";
if ($NNlu>1) echo "s";
echo " non lu";
if ($NNlu>1) echo "s";
echo " sur <font color='$CTitMsg'>$NM</font><small>\n (<a class=new href='Forum_List.php?TousLu=1&Forum=$Forum&Seg=$Seg' target='_self'>Marquer tous les messages en lus</a>)</small>";
}
?>
</form></center></div>
<DIV ID="el1Parent" CLASS="parent" > </div>
<?
$Deb=$Seg*$NSeg;
$CM=0;
$DebA=$Deb+NSeg;
$Req=mysql_query($Base,"SELECT Id,Nom,Titre,DATE_FORMAT(Date,'%d/%m/%Y à %T') AS Da FROM $Forum WHERE Pere=0 ORDER BY Id DESC LIMIT $DebA,$NSeg",$MaBase);
$j=1;
while ($Enr=mysql_fetch_object($Req)) {
$j++;
echo "\n<div ID='el".$j."Parent' CLASS='parent'>\n";
// echo "\n<div ID='el".$Enr->Id."Parent' CLASS='parent'>\n";
if ($CookOK) $FL=LuON($Enr->Id-1);
$Titre=$Enr->Titre;
/* $Titre=str_replace(":))","<img src='sm2.gif' border='0'>",$Titre);
$Titre=str_replace(":)","<img src='sm.gif' border='0'>",$Titre);
$Titre=str_replace(";)","<img src='sm1.gif' border='0'>",$Titre);
$Titre=str_replace(":(","<img src='sm3.gif' border='0'>",$Titre);
$Titre=str_replace(":<","<img src='sm4.gif' border='0'>",$Titre); */
$Titre=Smiley($Titre);
$NF=0;
$NFnl=0;
Compt($Enr->Id);
if ($NF) {
?>
<a class="item" HREF="javascript:void(0);" onClick="expandIt('el<? echo $j;?>',1,1);" target="_self">
<img NAME="imEx" SRC="rep.gif" align="middle" BORDER="0" ID="el<? echo $j;?>Img" OnMouseOver="window.status='Développer / Réduire le fils de discussion';return true" OnMouseOut="window.status='';return true"></a> <!-- width="20" height="20" -->
<?
}
else echo "<img SRC='v.gif' align='middle' border=0 width='14' height='14'> ";
if ($FL and $NL_Url and $CookOK) echo "<img src='$NL_Url' align='middle'>\n";
echo "<a id='m".$Enr->Id."' $ClassL[$FL] name='li".$j."' href='Forum_Lire.php?Forum=$Forum&Id=$Enr->Id&Seg=$Seg' target='$TLire' OnClick=\"Lu('m".$Enr->Id."');";
if ($NF) echo "expandIt('el$j',1,0)";
echo "\">$Titre</a>\n";
echo " <small> ($Enr->Nom - le ".str_replace("%", "", $Enr->Da).") </small>\n";
if ($NF) {
echo "<span ID='tel$j'><SMALL>- <I><a ".$ClassL[($NFnl?1:0)]." href=\"#\" onClick=\"expandIt('el$j',1,1)\" target='_self'>$NF réponse";
if ($NF>1) echo "s";
echo "</a>\n";
if ($NFnl) {
if ($NL_Url) echo " <a href=\"#\" onClick=\"expandIt('el$j',1,0)\" target='_self'><img src='$NL_Url' border='0' align='middle'></a>\n";
else {
echo " (<a href=\"#\" onClick=\"expandIt('el$j',1,0)\" target='_self'>$NFnl nouveau";
if ($NFnl>1) echo "x";
echo "</a>)\n";
}
}
echo "</I></SMALL></font></span>\n";
}
echo "</div>\n<div ID='el".$j."Child' CLASS='child'>\n";
Extrait($Enr->Id,2);
echo "</div>";
$FinA=$Enr->Id;
}
?>
<DIV ID="el<? echo $j+1;?>Parent" CLASS="parent" align="center"><center><br>
<?
if ($Deb) {
$Req=mysql_query($Base,"SELECT Id FROM $Forum WHERE Pere=0 ORDER BY Id DESC LIMIT $Deb",$MaBase);
$NF=0;
$NFnl=0;
while ($Enr=mysql_fetch_object($Req)) {
$NF++;
$NFnl+=LuON($Enr->Id-1);
Compt($Enr->Id);
if (($CM % $NSeg)==($NSeg-1)) {
echo "\n<a href='Forum_List.php?Forum=$Forum&Seg=".floor($CM/$NSeg)."' target='_self'><img src='prec.gif' align='middle' border='";
if ($NFnl) {
echo "3' alt='$NFnl non-lu";
if ($NFnl>1) echo "s";
echo "'></a>";
}
else echo "0'></a>";
$NF=0;
$NFnl=0;
}
$CM++;
}
}
$Req=mysql_query($Base,"SELECT Id FROM $Forum WHERE Pere=0 and Id<$FinA ORDER BY Id DESC ",$MaBase);
if ($Req) {
$CM+=$NSeg;
$NFF=mysql_num_rows($Req);
$NF=0;
$NFnl=0;
while ($Enr=mysql_fetch_object($Req)) {
$NFF--;
$NF++;
$NFnl+=LuON($Enr->Id-1);
Compt($Enr->Id);
if (($CM % $NSeg)==($NSeg-1) or !$NFF) {
echo "\n<a href='Forum_List.php?Forum=$Forum&Seg=".floor($CM/$NSeg)."' target='_self'><img src='suiv.gif' align='middle' border='";
if ($NFnl) {
echo "3'";
echo " alt='$NFnl non-lu";
if ($NFnl>1) echo "s";
echo "'></a>";
}
else echo "0'></a>";
$NF=0;
$NFnl=0;
}
$CM++;
}
}
mysql_close($MaBase);
?>
<!-- <form method="post" action="Forum_Admin.php" name="Admin" target="_self">
<input type="hidden" name="Forum" value="<?php echo $Forum; ?>">
<b>Administration du Forum :</b><br>Mot de passe : <input type="password" name="MDPAdmin"> <input type="submit" name="OK" value="Ok">
</form> -->
<p><A HREF="Forum_Admin.php?Forum=<? echo $Forum; ?>&DebLogin=1" style="text-decoration: none" target="_self"> </A>
</center></div>
<script>
if (NS4) {
firstEl = "el1Parent";
firstInd = getIndex(firstEl);
showAll();
arrange();
}
</script></body>
</html>
<? }
else { ?>
<html>
<head>
<title>List des Msg</title>
</head>
<? echo "<body topmargin='2' leftmargin='2' bgproperties='fixed' background='$UrlFond' text='$CT' link='$CTitMsg' vlink='$CTitMsg' bgColor='$CF' alink='$CTitMsg'>\n"; ?>
<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0"><tr><td width="100%">
<p align="center"><big><strong>Attention : Problème de connexion...</strong></big></td></tr></table>
</body>
</html>
<? } ?>[/php]
-----------------------------------------------------------------------------------------