123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- <?php
-
- $index_check="1";
- require_once ('user/config.php');
-
-
- if(isset($root_path)){
- $page_name=$meta_description;
- include_once("user/top.php");
- include("files/navheader.php");
- }
-
-
- session_start();
-
-
-
- if(isset($_GET['error']))
- {
- echo'<span class="error">';
- $error=$_GET['error'];
- if($error=="username")
- {
- echo'Error : Your username is invalid';
- }
- if($error=="pass")
- {
- echo'error : Your password is invalid';
- }
- if($error=="connection")
- {
- echo"error : Your password don't match with your username";
- }
- echo'</span>';
- }
-
-
- if(isset($root_path))
- {
-
- mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
- mysql_select_db(DB_DB);
- $nombre_utilisateur=mysql_query("SELECT * FROM user") or die ('error : '.mysql_error());
- $count_user=mysql_num_rows($nombre_utilisateur);
- }
- if(isset($count_user) && $count_user == 0){
-
-
- echo("<br><br>Ce site n'a pas encore été paramétré, vous êtes priés de procéder à l'inscription, en cliquant <a href ='".$root_path."/user/register.php'><span style='text-decoration: underline;'>ICI</span></a>");
-
-
- } elseif(!isset($root_path)) {
- echo "<br><br>Attention ! Vous n'avez pas encore modifié le fichier config.php ! Ceci est nécessaire au fonctionnement du CMS Blog Artisanal. <br><br> Vérifiez aussi que vous avez bien retiré les deux // devant la ligne";?> $root_path='/';<?php echo"<br><br>N'oubliez pas de lire le fichier install.txt situé dans le dossier /install !";
- } else {
- ?>
-
-
-
-
- <style type="text/css">
- html
- {
- height:100%;
- width:100%;
- }
- #header
- {
- width:100%;
- height:20%;
- font-size:50px;
- text-align:center;
- border-style:solid;
- border-color:black;
- border-size:1px;
- }
- .corps
- {
- width:80%;
- height:5%;
- border-bottom-style:solid;
- border-bottom-color:black;
- border-bottom-size:1px;
- //float:left;
- z-index:2;
- }
- #widget
- {
- margin-left:80%;
- width:15%;
- z-index:1;
- position:absolute;
- border-left-style:solid;
- border-left-color:black;
- border-left-size:2px;
- }
- a
- {
- color:black;
- text-decoration:none;
- }
- a:hover
- {
- color:black;
- text-decoration:underline;
- }
- #contact
- {
- color:white;
- text-decoration:none;
- }
- #contact:hover
- {
- color:white;
- text-decoration:underline;
- }
- </style>
-
-
- <div id="header"><p style="margin-top:3%;"><?php echo $site_name; ?></p></div>
- <div style="width:100%; color:white;">
- <p style="height:5%; background-color:black;">
-
- <marquee onmouseout="this.start();" onmouseover="this.stop();" loop="infinite" scrolldelay="100" scrollamount="5" direction="left">
-
-
-
- <?php echo $bandeau ?>
-
-
- </marquee>
- </p>
- </div>
- <div id="widget">
- <b> Pages :</b>
- <ul>
- <?php
-
-
-
- $sql_page_menu="SELECT * FROM page ORDER BY priority";
- $req = mysql_query($sql_page_menu) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
- while($data_page_menu=mysql_fetch_assoc($req))
- {
-
-
-
- echo"<a href='?id_page=".$data_page_menu["id_page"]."'>{$data_page_menu["titre"]}</a><br><br>";
- }
-
-
-
-
-
- ?>
-
- </ul>
- </div>
-
- <div class="corps">
-
- <?php
-
- if(@!$_SESSION['session'])
- {
-
- $connected="0";
- }
- if(@$_SESSION['session'])
- {
- require_once(''.$MainDir.'user/verifications.php');
- $connected="1";
-
-
-
- $sql="SELECT user_rank FROM user WHERE id_user=$id_user";
- $req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
- $user_ranking = mysql_fetch_assoc($req);
- $user_rank="$user_ranking[user_rank]";
- if($user_rank==1){
-
- $admin_mode = "1";
-
- }
-
- }else{
-
- $admin_mode = "0";
- }
-
-
-
-
- ////Start check content
-
- if(isset($_GET['id_page']) || $static_homepage_status=="1" && $static_homepage_id!=NULL){
-
- if(isset($_GET['id_page'])){
-
- $sql_page="SELECT * FROM page WHERE id_page=".$_GET['id_page']."";
-
- }elseif($static_homepage_status=="1"){
-
- $sql_page="SELECT * FROM page WHERE id_page=".$static_homepage_id."";
-
- }
- $req_page = mysql_query($sql_page) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
- $data_page=mysql_fetch_assoc($req_page);
-
- if($data_page["id_page"]== null && $static_homepage_status!="1"){
-
- echo"<h1>QUATRE CENT QUATRE</h1><br>Non mais, cette page existe pas j'ai l'impression cher camarade !<br><br>";
-
-
- }elseif($data_page["id_page"]== null && $static_homepage_status=="1"){
-
- echo"La page que vous aviez défini en page d'accueil n'existe plus.<br><br>";
-
- }else{
- $page_name= $data_page["titre"];?>
- <title><?php echo $website_name.' : '.$page_name; ?></title>
- <?php
- $page_stripslash = stripslashes($data_page['page']);
- echo"<h2>{$data_page["titre"]}</h2>";
- echo"<b>".$page_date_display." :</b> {$data_page["date"]} par : {$data_page['user']}<br />";
- echo"<b>".$page_page_display." :</b><br />{$page_stripslash}<br><br>";
-
-
- if($connected==1){
-
- if(isset($admin_mode) && $admin_mode==1){
- echo"<br><br><b><a href='administration/edition_page.php?id={$data_page["id_page"]}'>Editer</a></b>";
-
- echo" - <b><a href='files/page_suppression.php?id={$data_page["id_page"]}'>Supprimer</a></b><br><br>";
- if($static_homepage_status=="1" && $static_homepage_id != $data_page["id_page"] && $data_page["id_page"]!= null){
-
- echo "<div style='text-align:right'><a href='files/submit_blog_config.php?static_homepage_id={$_GET['id_page']}'>Définir la page {$data_page['titre']} comme page d'accueil !</a></div><br>";
-
- }
-
- }
- }
-
- }
-
-
-
-
-
-
- }elseif(isset($_GET['id'])){
-
- $sql_article="SELECT * FROM article WHERE id_article=".$_GET['id']."";
- $req_article = mysql_query($sql_article) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
- $data_article=mysql_fetch_assoc($req_article);
-
- if($data_article["id_article"]== null){
-
- echo"<h1>QUATRE CENT QUATRE</h1><br>Non mais, cet article n'existe pas j'ai l'impression cher camarade !<br><br>";
-
-
- }else{
-
- $page_name= $data_article["titre"];?>
- <title><?php echo $website_name.' : '.$page_name; ?></title>
- <?php
- $article_stripslash = stripslashes($data_article['article']);
- echo"<h2>{$data_article["titre"]}</h2>";
- echo"<b>".$article_date_display." :</b> {$data_article["date"]} par : {$data_article['user']}<br />";
- echo"<b>".$article_article_display." :</b><br />{$article_stripslash}<br><br>";
-
- if($connected==1){
-
- if($admin_mode==1){
- echo"<br><br><b><a href='administration/edition_article.php?id={$data_article["id_article"]}'>Editer</a></b>";
-
- echo" - <b><a href='files/article_suppression.php?id={$data_article["id_article"]}'>Supprimer</a></b><br /><br>";
-
- }
- }
-
- }
-
-
-
- }else{
-
-
- ?>
- <?php
-
-
-
- if(empty($_GET['p'])) {
- $page='0,7'; }
- else if (!empty($_GET['p'])){
- $pg=$_GET['p'];
- $fin=$pg*7;
- $debut=$fin-7;
- $page=$debut.', 7';
- }
-
-
-
- $sql="SELECT * FROM article ORDER BY id_article DESC LIMIT ".$page."";
- $req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
- while($data=mysql_fetch_assoc($req))
- {
-
- $article_stripslash = stripslashes($data['article']);
-
- echo"<br><br><b>".$article_title_display." :</b> <a href='?id=".$data["id_article"]."'>{$data["titre"]}</a><br />";
- echo"<b>".$article_date_display." :</b> {$data["date"]}<br />";
- echo"<b>".$article_article_display." :</b><br />{$article_stripslash}";
-
- if($connected==1){
-
- if(isset($admin_mode) && $admin_mode==1){
- echo"<br><br><b><a href='administration/edition_article.php?id={$data["id_article"]}'>Editer</a></b>";
-
- echo" - <b><a href='files/article_suppression.php?id={$data["id_article"]}'>Supprimer</a></b><br />";
-
- }
- }
-
-
-
-
-
-
- }
-
-
-
-
-
- ?>
-
- <br><br>Page <?php
-
-
-
- $sqlm='SELECT COUNT(*) AS nb_id FROM article';
- $reqm = mysql_query($sqlm) or die('Erreur SQL !<br />'.$sqlm.'<br />'.mysql_error());
- $donnee = mysql_fetch_array($reqm);
- $nb_pg=((int)($donnee['nb_id']/7))+1;
- $nb_pg_r=0;
- while($nb_pg_r!=$nb_pg AND $nb_pg_r<10){
- if(empty($_GET['p'])){
- $_GET['p'] = "1";
- }
- $nb_pg_r=$nb_pg_r+1;
- ?>
- <a class="page" href="?p=<?php echo $nb_pg_r; ?>">
- <?php
- if($_GET['p']==$nb_pg_r){
- echo '<strong>'.$nb_pg_r.'</strong>';
- }else{
- echo $nb_pg_r;
- }
- ?>
-
- </a>
-
- <?php
- }
-
- mysql_close();
- ?>
- <br>
- <br>
- <?php
- }
- ////End check content
-
- ?>
- <title><?php echo $website_name.' : '.$page_name; ?></title>
- </div>
-
- </body>
-
-
-
-
- <div id="footer">
- <?php
- echo "(Copyleft) ".$site_name." | Ce site utilise le CMS <a href='http://www.blogartisanal.tk/'>Blog Artisanal</a>.";
- }
-
- ?></div>
- </html>
-
|