defaite | Ok, pas de soucis, voila le code : (index.php)
Code :
- <?php
- /***************************************************************************
- * DEF-BLOG
- * -------------------
- * Version : 1.0.1 du 28/06/2006
- * Auteur : (C) 2006 Defaite
- * Mail :defaite78@hotmail.fr
- *
- *
- * Ce programme est libre et gratuit. Vous pouvez le distribuer ou modifier
- * autant de fois que vous le désirez.
- *
- * Site de mise à jour : http://blog.defaite.com
- ***************************************************************************/
- session_start();
- if(!file_exists("connexion.php" )) { echo '<script language="javascript"
- type="text/javascript">
- <!--
- window.location.replace(
- "install/index.html" );
- -->
- </script>'; }
- ?>
- <html><head>
- <?php
- if (isset($_GET['article'])) {
- $Page=$_GET['article'];
- }
- else {
- $Page=1;
- }
- $ConnexionON = 'true';
- include('connexion.php');
- require("fonctions.php" );
- $NomTemplate=Template($pre);
- $NomSite=NomSite($pre);
- Meta($NomSite,$NomTemplate,$pre);
- if(!empty($_SESSION)) {
- echo '<script type="text/javascript">
- go_visibility = new Array;
- function goblink()
- {
- if(document.getElementById && document.all)
- {
- blink_tab = document.getElementsByTagName(\'blink\');
- for(a=0;a<blink_tab.length;a++)
- {
- if(go_visibility[a] != "visible" )
- go_visibility[a] = "visible";
- else
- go_visibility[a] = "hidden";
- blink_tab[a].style.visibility=go_visibility[a];
- }
- }
- setTimeout("goblink()", 500);
- }
- window.onload = goblink;
- </script>';
- }
- ?>
- <script language="JavaScript" type="text/JavaScript">
- function MinimizeWin(name)
- {
- if (document.getElementById(name).style.display != "none" )
- {
- document.getElementById(name).style.display = "none";
- document.getElementById(name+'_sub').style.display = "block";
- }
- else
- {
- document.getElementById(name).style.display = "block";
- document.getElementById(name+'_sub').style.display = "none";
- }
- return false;
- }
- function FermerAll()
- {
- <?php
- $query = "SELECT numero, nom FROM ".$pre."template WHERE numero=3";
- $result = mysql_query($query);
- while($row = mysql_fetch_row($result)){
- $ParPage=$row[1];
- }
- $query = "SELECT numero FROM ".$pre."articles ORDER BY numero DESC";
- $result = mysql_query($query);
- $i=0;
- $RetiensCool='';
- while($row = mysql_fetch_row($result)){
- if($i==($Page*$ParPage)) { break; }
- if($i>=($Page*$ParPage)-$ParPage) {
- echo 'document.getElementById(\'Article'.$row[0].'\').style.display = "none";
- document.getElementById(\'Article'.$row[0].'_sub\').style.display = "block";',"\n";
- $RetiensCool .= 'document.getElementById(\'Article'.$row[0].'\').style.display = "block";
- document.getElementById(\'Article'.$row[0].'_sub\').style.display = "none";'."\n";
- }
- $i++;
- }
- ?>
- return false;
- }
- function AfficherAll()
- {
- <?php
- echo $RetiensCool;
- ?>
- return false;
- }
- </SCRIPT>
- <Title><?php echo $NomSite; ?> :: Articles</title></head><body>
- <?php include('header.php'); ?>
- <br>
- <table width="100%" align="top" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td valign="top" align="left" class="menu">
- <table valign="top" align="left" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <?php
- $menu=1;
- include('menu.php');
- ?>
- <td valign="top">
- <table class="cadre" width="100%" align="center" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td class="block"></td>
- <td class="bar1"> </td>
- <td class="block"></td>
- </tr>
- <tr>
- <td class="bar2"> </td>
- <td class="Fond2" valign="top">
- <table align="center" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td class="bar2"></td>
- <td class="titrepage"><center>
- <?php
- $NbArticles=0;
- $query = "SELECT numero FROM ".$pre."articles";
- $result = mysql_query($query);
- while($row = mysql_fetch_row($result)){
- $NbArticles++;
- }
- if ($NbArticles==0) {
- $JaiPages = 'Première page | <<< 1 >>> | Dernière page';
- }
- else {
- $retiens='';
- $NbPages = ceil($NbArticles / $ParPage);
- if ($Page==1) {
- $JaiPages = 'Première page | <<< ';
- }
- else {
- $LaHonte=$Page-1;
- $JaiPages = '<a href="index.php" class="lienstitrepage">Première page</a> | <a href="index.php?article='.$LaHonte.'" class="lienstitrepage"><<<</a> ';
- }
- $retiens='';
- for ($i=$Page ; $i>$Page-3 ; $i--) {
- if ($i!=$Page) {
- if ($i>0) {
- $retiens = '<a href="index.php?article='.$i.'" class="lienstitrepage">'.$i.'</a> '.$retiens;
- }
- }
- }
- $JaiPages = $JaiPages.$retiens.' '.$Page.' ';
- for ($i=$Page ; $i<$Page+3 ; $i++) {
- if ($i!=$Page) {
- if ($i<=$NbPages) {
- $JaiPages = $JaiPages.'<a href="index.php?article='.$i.'" class="lienstitrepage">'.$i.'</a> ';
- }
- }
- }
- if ($Page!=$NbPages) {
- $LaHonte=$Page+1;
- $JaiPages = $JaiPages.'<a href="index.php?article='.$LaHonte.'" class="lienstitrepage">>>></a> | <a href="index.php?article='.$NbPages.'" class="lienstitrepage">Dernière page</a>';
- }
- else {
- $JaiPages = $JaiPages.'>>> | Dernière page';
- }
- }
- echo $JaiPages;
- ?>
- <br><a href="#" onclick="javascript:FermerAll()" class="lienstitrepage">Minimisez tout</a> | <a href="#" onclick="javascript:AfficherAll()" class="lienstitrepage">Afficher tout</a></td>
- <td class="bar3"></td>
- </tr>
- <tr>
- <td class="block"></td>
- <td class="bar1"></td>
- <td class="block"></td>
- </tr>
- </table>
- <?php
- if($NbArticles==0) {
- echo '<table align="center" width="750" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td width="100%" height="20"></td>
- </tr>
- <tr>
- <td width="100%"><center><br><br><img src="templates/'.$NomTemplate.'/images/noarticle.png" border=0><br>Il n\'existe pas encore d\'article.</center></td>
- </tr>
- <tr>
- <td width="100%" height="20"></td>
- </tr>
- </table>';
- }
- else {
- $query2 = "SELECT * FROM ".$pre."template WHERE numero=9";
- $result2 = mysql_query($query2);
- while($row2 = mysql_fetch_row($result2)){
- if(($row2[1]=='DESC') || ($row2[1]=='ASC')) {
- $query = "SELECT numero, titre, postdate, image, imgdir, texte FROM ".$pre."articles ORDER BY numero ".$row2[1];
- } else {
- $query = "SELECT numero, titre, postdate, image, imgdir, texte FROM ".$pre."articles ORDER BY titre ASC";
- }
- break;
- }
- $result = mysql_query($query);
- $i=0;
- while($row = mysql_fetch_row($result)){
- if($i==($Page*$ParPage)) { break; }
- if($i>=($Page*$ParPage)-$ParPage) {
- $Direction=2;
- if($row[4]=='gauche') { $Direction=1; }
- echo '<table align="center" width="750" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td width="100%" height="20"></td>
- </tr>
- </table>
- <a name="#'.$row[0].'"></a>
- <div id="Article'.$row[0].'_sub" style="display: none;">
- <table align="center" width="750" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td width="10"></td>
- <td class="bar4HG"></td>
- <td class="bar4H"> </td>
- <td class="bar4HD"></td>
- <td width="10"></td>
- </tr>
- <tr>
- <td width="10"></td>
- <td class="bar4G"></td>
- <td class="Fond">
- <table align="center" width="100%" height="100%" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td align="left" class="blogtitre">'.$row[1].' - Posté le '.$row[2].'</td>
- <td align="right" class="Fond">';
- if(!empty($_SESSION)) {
- echo '<blink><a href="#"
- style="background-color: #ffffff;border: 1px solid red;color: #ff0000;border-collapse: collapse;text-decoration: none;"
- onclick="fenetre=window.open(\'modif.php?type=article&id='.$row[0].'\', \'\', \'resizable=no, location=no, width=600, height=500, scrollbars=yes, menubar=no, status=no, directories=no\')">
- Modifier </a></blink> ';
- }
- echo '<a href="#'.$row[0].'" onclick="javascript:MinimizeWin(\'Article'.$row[0].'\')" style="text-decoration: none;">[Ouvrir]</a></td>
- </tr>
- </table>
- </td>
- <td class="bar4D"></td>
- <td width="10"></td>
- </tr>
- <tr>
- <td width="10"></td>
- <td class="bar4BG"></td>
- <td class="bar4B"> </td>
- <td class="bar4BD"></td>
- <td width="10"></td>
- </tr>
- </table>
- </div>
- <div id="Article'.$row[0].'">
- <table align="center" width="750" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td width="10"></td>
- <td class="bar4HG"></td>
- <td class="bar4H"> </td>
- <td class="bar4HD"></td>
- <td width="10"></td>
- </tr>
- <tr>
- <td width="10"></td>
- <td class="bar4G"></td>
- <td class="Fond">
- <table align="center" width="100%" height="100%" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td align="left" class="blogtitre">'.$row[1].' - Posté le '.$row[2].'</td>
- <td align="right" class="Fond">';
- if(!empty($_SESSION)) {
- echo '<blink><a href="#"
- style="background-color: #ffffff;border: 1px solid red;color: #ff0000;border-collapse: collapse;text-decoration: none;"
- onclick="fenetre=window.open(\'modif.php?type=article&id='.$row[0].'\', \'\', \'resizable=no, location=no, width=600, height=500, scrollbars=yes, menubar=no, status=no, directories=no\')">
- Modifier </a></blink> ';
- }
- echo '<a href="#'.$row[0].'" onclick="MinimizeWin(\'Article'.$row[0].'\')" style="text-decoration: none;">[Minimiser]</a></td>
- </tr>
- </table>
- </td>
- <td class="bar4D"></td>
- <td width="10"></td>
- </tr>
- <tr>
- <td width="10"></td>
- <td class="bar4G"></td>
- <td class="blogligne"> </td>
- <td class="bar4D"></td>
- <td width="10"></td>
- </tr>
- <tr>
- <td width="10"></td>
- <td class="bar4G"></td>
- <td valign="center" class="Fond">';
- if($row[3]!='none') {
- echo '<table align="center" cellpadding="0" cellspacing="0" border=0 class="blogflottante'.$Direction.'">
- <tr>
- <td class="bar5HG"></td>
- <td class="bar5H"> </td>
- <td class="bar5HD"></td>
- </tr>
- <tr>
- <td class="bar5G"></td>
- <td>';
- $size = GetImageSize("img/articles/".$row[3]);
- $Ty='';
- if($size[0]>=350) { $Ty=' width="350"'; }
- echo '<a target="_blank" href="vue.php?id='.$row[0].'" ><img src="img/articles/'.$row[3].'" border=0 alt="Agrandir l\'image de '.$row[1].'" title="Agrandir l\'image de '.$row[1].'"'.$Ty.' onerror="this.onerror=null;this.src=\'img/avatars/none.gif\';">';
- echo '</a></td>
- <td class="bar5D"></td>
- </tr>
- <tr>
- <td class="bar5BG"></td>
- <td class="bar5B"> </td>
- <td class="bar5BD"></td>
- </tr>
- </table>
- <p align="left">';
- BBcode($row[5],'oui',$pre);
- echo '</p>';
- }
- else {
- echo '<p align="left"><br>'.BBcode($row[5],'oui',$pre).'<br><br></p>';
- }
- echo '</td>
- <td class="bar4D"></td>
- <td width="10"></td>
- </tr>
- <tr>
- <td width="10"></td>
- <td class="bar4G"></td>
- <td class="blogligne"> </td>
- <td class="bar4D"></td>
- <td width="10"></td>
- </tr>
- <tr>
- <td width="10"></td>
- <td class="bar4G"></td>
- <td class="Fond" align="right">';
- if(!empty($_SESSION)) {
- $t=0;
- $query2 = "SELECT numero, vu FROM ".$pre."commentaires";
- $result2 = mysql_query($query2);
- while($row2 = mysql_fetch_row($result2)){
- if($row2[0]==$row[0]) {
- if($row2[1]=='0') { $t++; }
- }
- }
- if($t!=0) {
- if($t==1) { echo '<span class="liencarte"> <sup>[ 1 nouveau commentaire]</span></sup>'; }
- else { echo '<span class="liencarte"> <sup>[ '.$t.' nouveaux commentaires]</span></sup>'; }
- }
- }
- echo '[ <a href="#'.$row[0].'" onclick="fenetre=window.open(\'comadd.php?article='.$row[0].'\', \'\', \'resizable=no, location=no, width=600, height=420, menubar=no, status=no, directories=no\')">
- Ajouter un commentaire</a> | ';
- $query2 = "SELECT numero FROM ".$pre."commentaires";
- $result2 = mysql_query($query2);
- $y=0;
- while($row2 = mysql_fetch_row($result2)){
- if($row2[0]==$row[0]) { $y++; }
- }
- if($y==0) {
- echo 'Aucun commentaire';
- }
- else {
- echo '<a href="#'.$row[0].'" onclick="fenetre=window.open(\'comlook.php?article='.$row[0].'\', \'\', \'resizable=no, location=no, width=550, height=400, scrollbars=yes, menubar=no, status=no, directories=no\')">';
- if ($y==1) {
- echo '1 commentaire</a>';
- }
- else {
- echo $y.' commentaires</a>';
- }
- }
- echo ' ]</td>
- <td class="bar4D"></td>
- <td width="10"></td>
- </tr>
- <tr>
- <td width="10"></td>
- <td class="bar4BG"></td>
- <td class="bar4B"> </td>
- <td class="bar4BD"></td>
- <td width="10"></td>
- </tr>
- </table>
- </div>';
- }
- $i++;
- }
- }
- ?>
- <table align="center" width="750" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td width="100%" height="20"></td>
- </tr>
- </table>
- </td>
- <td class="bar3"> </td>
- </tr>
- </table>
- <table width="100%" align="center" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td class="bar2"></td>
- <td class="Fond2" valign="top">
- <table align="center" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td class="block"></td>
- <td class="bar1"></td>
- <td class="block"></td>
- </tr>
- <tr>
- <td class="bar2"></td>
- <td class="titrepage"><center><?php echo $JaiPages ?></center></td>
- <td class="bar3"></td>
- </tr>
- </table>
- </td>
- <td class="bar3"></td>
- </tr>
- <tr>
- <td class="block"></td>
- <td class="bar1"> </td>
- <td class="block"></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <br>
- <table width="100%" align="top" cellpadding="0" cellspacing="0" border=0>
- <tr>
- <td valign="top">
- <?php Copyrith($pre); ?>
- </td></tr></table>
- </td></tr></table></body></html>
|
---------------
" Remember brothers... Everything is possible "
|