<?php

    # Protection contre l'accès direct au fichier
	defined('INDEX_CHECK') or die;
	
	# Administration du thème
	require('themes/Absolut/config.php');

	$url = (isset($_GET['file']) ? '?file='.$_GET['file'] : '');
    
	function top(){
		global $nuked, $config, $theme, $user;
?>
<!DOCTYPE html>
	<html xml:lang="fr" lang="fr">
		<head>
			<meta charset="windows-1252">
            <meta http-equiv="X-UA-Compatible" content="IE=8" />
			<title><?php echo $nuked['name'] . ' - ' . $nuked['slogan']; ?></title>
			<meta name="robots" content="<?php echo $nuked['keywords']; ?>" />
			<meta name="googlebot" content="<?php echo $nuked['keywords']; ?>" />
			<meta name="Description" content="<?php echo $nuked['description']; ?>" />
			<meta name="keywords" content="<?php echo $nuked['keywords']; ?>" />
			<link rel="stylesheet" href="<?php echo $config['theme-url']; ?>style/css.css" type="text/css" />
			<script type="text/javascript" src="<?php echo $config['theme-url']; ?>js/modernizr.custom.28468.js"></script>
			<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
			<script type="text/javascript" src="<?php echo $config['theme-url']; ?>js/jquery.cslider.js"></script>
            <script type="text/javascript">
                $(function() {
                
                    $('#da-slider').cslider({
                        bgincrement	: 0
                    });
                
                });
            </script>	
            
 			
			<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
			
		</head>
	<body>
	
			
         
		<header>
		<div class="nav">
            <p id="titre"><?php echo stripslashes($config['titre']); ?></p>
                <ul>
                    <li><a href="<?php echo $config['lien1']; ?>"><?php echo $config['menu1']; ?></a></li>
                    <li><a href="<?php echo $config['lien2']; ?>"><?php echo $config['menu2']; ?></a></li>
                    <li><a href="<?php echo $config['lien3']; ?>"><?php echo $config['menu3']; ?></a></li>
                    <li><a href="<?php echo $config['lien4']; ?>"><?php echo $config['menu4']; ?></a></li>
                    <li><a href="<?php echo $config['lien5']; ?>"><?php echo $config['menu5']; ?></a></li>
                </ul>
        </div>
        	 <?php if($_REQUEST['file'] == 'News' && $_REQUEST['op'] != 'index_comment') { ?>  
                <div id="reseaux">
                    <a href="<?php echo $config['Facebook']; ?>" class="facebook">facebook</a>
                    <a href="<?php echo $config['Twitter']; ?>" class="twitter">twitter</a>
                    <a href="<?php echo $config['Rss']; ?>" class="rss">rss</a>
                </div>
  
		<?php if(!$user){ ?>
        
			<form method="POST" action="index.php?file=User&amp;nuked_nude=index&amp;op=login" id="login">
				<input type="text" name="pseudo" value="Pseudo" class="name" onClick="this.value=''" />
				<input type="password" name="pass" value="******" class="name" onClick="this.value=''" />
				<input type="submit" name="log" value="Envoyer" class="valider" />
			</form>
			
		<?php }else{ 
		
		
		$administration = ($user[1] == 9) ? '<a href="?file=Admin">Administration</a> | ' : '';

		?>	
		
		<div id="login">
			<p><? echo $administration; ?> <a href="?file=User&amp;nuked_nude=index&amp;op=logout" title="Au revoir">Deconnexion</a></p>
		</div>
		
		<?php } 
				 }?>

    </header>
         <div class="clear"></div>
          <?php $class = ($_REQUEST['file'] == 'News' && $_REQUEST['op'] != 'index_comment') ? 'news' : 'forum';?>
    <div id="<?php echo $class; ?>">
    	
       
        
			 <?php if($_REQUEST['file'] == 'News' && $_REQUEST['op'] != 'index_comment') { ?>  
         <!-- bloc news -->
          <article>      
			<!-- slider -->
			<div id="da-slider" class="da-slider">
				<div class="da-slide">
					<h2><?php echo stripslashes($config['titre_slider1']); ?></h2>
					<p><?php echo $config['contenue1']; ?></p>
				<!--<a href="#" class="da-link">Read more</a>-->
					<div class="da-img"><img src="<?php echo $config['theme-url']; ?><?php echo $config['image1']; ?>" alt="image01" /></div>
				</div>
				<div class="da-slide">
					<h2><?php echo stripslashes($config['titre_slider2']); ?></h2>
					<p><?php echo $config['contenue2']; ?></p>
					<!--<a href="#" class="da-link">Read more</a>-->
					<div class="da-img"><img src="<?php echo $config['theme-url']; ?><?php echo $config['image2']; ?>" alt="image02" /></div>
				</div>
				<div class="da-slide">
					<h2><?php echo stripslashes($config['titre_slider3']); ?></h2>
					<p><?php echo $config['contenue3']; ?></p>
					<!--<a href="#" class="da-link">Read more</a>-->
					<div class="da-img"><img src="<?php echo $config['theme-url']; ?><?php echo $config['image3']; ?>" alt="image03" /></div>
				</div>
				
				<div class="da-arrows">
					<span class="da-arrows-prev"></span>
					<span class="da-arrows-next"></span>
				</div>
			</div>

			<?php }
			
			} 

			function footer(){
			global $nuked, $theme, $user; 

			# Administration du thème
			 require('themes/Absolut/config.php');

			get_blok('bas'); get_blok('centre');

			?> 
			
		

		<!-- bloc droite -->
        
        <?php if($_REQUEST['file'] == 'News' && $_REQUEST['op'] != 'index_comment') { ?>  
        </article>
         <aside>
        	<!-- bloc 1-->
            <div class="separation"></div>
                <div class="webmaster">
                        <?php echo stripslashes($config['info']); ?></p>	
                </div>
            <div class="separation"></div>  

			<!-- bloc droite -->

			<?php get_blok('droite'); ?> 

		</aside>
        <?php } ?>
	</div>
       
        <!-- reset du flux -->
       <div class="clear"></div>
       
        <?php if($_REQUEST['file'] == 'News' && $_REQUEST['op'] != 'index_comment') { ?> <div id="bg_footer"></div> <?php }else{ ?> <div id="bg_footer_forum"></div><?php } ?>
       
		<footer>
       		<div id="contenu">
            	<div class="bloc_footer">
                	<h1>DERNIERS MEMBRES</h1>
						<?php
							$i = 0;
								$sql = mysql_query("SELECT * FROM ". USER_TABLE ." ORDER BY date DESC LIMIT 3");
									while($res = mysql_fetch_assoc($sql)){	?>
                                      <div class="saut_de_page"></div>
										<h2><?php echo $res['pseudo']; ?></h2>
											<?php $date = strftime('%d/%m/%y', $res['date']);?>
                                                <a href="?file=Members&amp;op=detail&amp;autor=<?php echo $res['pseudo'];?>">le <?php echo $date; ?> / Voir le Profil</a>
                                                    <?php
                                                        $i += 1;
                                                            } ?>
                </div>
                <div class="bloc_footer">
                	<h1>DERNIERS POSTS</h1>
							<?php 
								$i = 0;
								$sql = mysql_query("SELECT * FROM ". COMMENT_TABLE ." ORDER BY date DESC LIMIT 3");
									while($res = mysql_fetch_assoc($sql)){	
										$date = strftime('%d/%m/%y', $res['date']);
										 $commentaire = $res['comment'] ?>
										  <div class="saut_de_page"></div>
											<h2><?php echo $res['autor']; ?><span> le <?php echo $date; ?></span></h2>
												<?php echo $commentaire = (strlen($commentaire) > 120) ? substr($commentaire,0,120) . '...' : $commentaire; 
                                                        $i += 1;
                                                            } ?>                       	    
                </div>
                <div class="bloc_footer">
                	<h1>SUGGESTIONS</h1>
                    	<div class="saut_de_page"></div>
                        	<h2><?php echo $config['partenaire1']; ?></h2>
                            	<a href="<?php echo $config['link1']; ?>"><?php echo $config['texte1']; ?></a>
                                	<div class="saut_de_page"></div>
                            <h2><?php echo $config['partenaire2']; ?></h2>
                            	<a href="<?php echo $config['link2']; ?>"><?php echo $config['texte2']; ?></a>
                                	<div class="saut_de_page"></div>
                            <h2><?php echo $config['partenaire3']; ?></h2>
                            	<a href="<?php echo $config['link3']; ?>"><?php echo $config['texte3']; ?></a>              
                </div>
            </div>   
				   <div id="copyright">
						<div class="wrap">
							<p>Propulsé par <a href="http://www.nuked-klan.org/">Nuked Klan</a> - Codage & Design <a href="http://psd-html.fr/">by Djb - Gigoss [PSD-Html]</a></p>
						</div>    
				   </div>
        </footer>
    </body>
    </html>
    
    
   <?php
        exit();
    }
      function news($data){ 
	  $news_resume = $data['titre']; 
	  $jour = substr($data['date'], 0, 2);    // jour 
	  $mois = substr($data['date'], 3, 2);    // mois 
	  $annee = substr($data['date'], 6,4 );    // année 
	  $afficher = array(
					"01" => "Janv",
					"02" => "Févr",
					"03" => "Mars",
					"04" => "Avril",
					"05" => "Mai",
					"06" => "Juin",
					"07" => "Juil",
					"08" => "Aout",
					"09" => "Sept",
					"10" => "Oct",
					"11" => "Nov",
					"12" => "Déc"
				);
  
	  ?>
	 
	 
			<!-- debut des news -->
            <div class="news">
            
            	<div class="titre_news">
                	<div class="date"><?echo $afficher[$mois];?> <br /> <?echo $annee;?></div>
                    	<div class="jour"><?echo $jour;?></div>
                    		<h1 class="titre"><?php echo $news_resume = (strlen($news_resume) > 30) ? substr($news_resume,0,30) . '...' : $news_resume; ?></h1>
                            <span><a href="?file=News&amp;op=index_comment&amp;news_id=<?php echo $data['id']; ?>"><?php echo $data['nb_comment']; ?></a></span>
                </div>
                
                <!-- categorie -->
                <div class="categorie">
                  <?php echo $data['image']; ?>
                </div>
                
                <!-- news -->
                <div class="contenu_news">
                	 <?php echo $data['texte']; ?>
                </div>
                
            </div>  
 
		<?php
    }
    
       
    function block_droite($block){	
		
         ?>
         
		<div class="separation"></div>
                <div class="bloc"> 
                        <div class="titre"><?php echo $block['titre']; ?></div>
                            <?php echo $block['content']; ?>     
                </div> 
             <div class="separation"></div>  
		 
        	 
		 	
       <?php
    }
	
   function block_centre($block){
		?>
         <?php echo $data['titre']; ?>
		<?php echo $block['content'];?>
		<!-- fin des blocs ?? -->
		<?php
	}
	
	function block_bas($block){
	 echo $data['titre']; 
	 echo $block['content'];}
    
    function opentable(){?><div class="clear"></div><?php }
    function closetable(){}
    
?>