<?php 

require("config.php");

$afficher_themes = mysqli_query($mysqlLink, "SELECT * FROM `theme` WHERE `rewrite` = '".$_GET['theme']."' ");
while($afficher_theme = mysqli_fetch_array($afficher_themes))
{
        $afficher_theme_nom = $afficher_theme['nom'];
        $afficher_theme_titre = $afficher_theme['titre'];
        $afficher_theme_rewrite = $afficher_theme['rewrite'];
        $afficher_theme_menu = $afficher_theme['menu'];
        $afficher_theme_meta_title = $afficher_theme['meta_title'];
        $afficher_theme_meta_description = $afficher_theme['meta_description'];
        $afficher_theme_contenu = $afficher_theme['contenu'];
        $afficher_theme_vue = $afficher_theme['vue']+1;

        mysqli_query($mysqlLink, "UPDATE `theme` SET `vue` = '".$afficher_theme_vue."' WHERE rewrite = '".$afficher_theme_rewrite."' ");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> 
    <title><?php echo $afficher_theme_meta_title; ?> <?php echo $jour; ?></title>
    <meta name="description" content="<?php echo $afficher_theme_meta_description; ?>">
    <meta charset="utf-8">
    <link rel="icon" href="/images/favicon.ico" type="image/x-icon">    
    <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/css/style.css">
    <script src="/js/jquery.js"></script>
    <script src="/js/superfish.js"></script>
    <script src="/js/jquery.hoverIntent.minified.js"></script>
    <script src="/js/jquery.easing.1.3.js"></script>
    <script src="/js/jquery.mobilemenu.js"></script>
    <script src="/js/jquery.ui.totop.js"></script>  
    <script src="/js/script.js"></script>   
    <script>
        jQuery(function(){
            $().UItoTop({ easingType: 'easeOutQuart' });
        });
    </script>
<!--[if lt IE 8]>
   <div style=' clear: both; text-align:center; position: relative;'>
     <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
       <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
    </a>
  </div>
<![endif]-->
<!--[if lt IE 9]>
    <script src="js/html5.js"></script>
    <link rel="stylesheet" href="css/ie.css"> 
<![endif]-->
</head>
<body>
<div class="bg">
<!--==============================header=================================-->
    <header>
        <div class="head-box1">
        <div class="container_16">
            <article class="grid_16">
                <div class="inner-block">
                    
                    <?php include("menu.php"); ?>
                    
            </div>
            </article>
        </div>
        </div>  
        <div class="container_16">
            <article class="grid_16 p6">
                <div class="inner-block"><h1><a href="http://www.bestcakes.fr" title="Best Cakes <?php echo $afficher_theme_titre; ?>" class="logo">Best Cakes</a></h1></div>                
            </article>
            <div class="clear"></div>
        </div>        
    </header>
    
    <!--==============================content================================-->
    <section id="content">      
        <div class="container_16">

                <article class="grid_4 suffix_1">
                    <div class="inner-block">
                        <h3><?php echo $afficher_theme_menu; ?></h3>
                        <ul class="list1">

                            <?php include("nav.php"); ?>
                    
                        </ul>
                    </div>
                    
                </article>
                <article class="grid_12">
                    <div class="inner-block">
                        <h2 class="p12"></h2>

                        <?php
                        $voir_themes = mysqli_query($mysqlLink, "SELECT * FROM theme WHERE rewrite='".$afficher_theme_rewrite."' ");
                        while($voir_theme = mysqli_fetch_array($voir_themes))
                        {
                            $voir_theme_rewrite = $voir_theme{'rewrite'};

                            $voir_recettes = mysqli_query($mysqlLink, "SELECT * FROM rubrique WHERE theme='".$voir_theme_rewrite."' AND active='oui' ");
                            while($voir_recette = mysqli_fetch_array($voir_recettes))
                            {
                            ?>
                                <span class="text6">Idées <?php echo $voir_recette['nom'] ?></span>
                                <div class="inner-block">
                                    <?php
                                    $selection_articles = mysqli_query($mysqlLink, "SELECT * FROM articles WHERE theme = '".$afficher_theme_rewrite."' AND rubrique = '".$voir_recette['rubrique']."' AND statut = 'Publié' ORDER BY RAND() LIMIT 6");
                                    while($article = mysqli_fetch_assoc($selection_articles))
                                    {
                                    ?>
                                    <div class="grid_2" style="margin-left: 0px;">
                                        <a href="http://www.bestcakes.fr/<?php echo $afficher_theme_rewrite; ?>/<?php echo $voir_recette['rubrique']; ?>/<?php echo $article['id_article']; ?>_<?php echo $article['rewrite']; ?>/" title="<?php if($article['type'] != "") { echo stripslashes($article['type']); }else{ echo $voir_recette['nom']; }  ?> - <?php echo stripslashes($article['titre']); ?>"><img src="http://www.bestcakes.fr/photo/<?php echo $afficher_theme_rewrite; ?>/<?php echo $voir_recette['rubrique']; ?>/<?php echo $article['id_article']; ?>/thumb_<?php echo $article['rewrite']; ?>.jpg" alt="<?php if($article['type'] != "") { echo stripslashes($article['type']); }else{ echo $voir_recette['nom']; }  ?> - <?php echo stripslashes($article['titre']); ?>" style="width:100px; margin-left: 0px;" /></a>
                                    </div>
                                    <?php
                                    }
                                    ?>
                                </div>                                
                                <p style="clear:both;"><?php echo $voir_recette['meta_description'] ?></p>

                            <?php
                            }
                        }
                        ?>

                    </div>

                    <br /><?php include("adsense_theme.php"); ?><br />

                </article>
            <div class="clear"></div>
        </div>
    </section>

    <?php include("footer.php"); ?>

</div>
</body>
</html>