Beispiel #1
0
include_once "modele/fonctionsdb.php";
//Inclusion api
include_once "apivariables.php";
//Test si maintenance
if (returnValueFromParam("maintenanceMode") == "true") {
    header("Location: maintenance.php");
}
//Ajouter un commentaire
if (isset($_SESSION["pseudo"]) and isset($_POST["id_billet"]) and isset($_POST["commentaire"])) {
    PostComment($_POST["id_billet"], $_SESSION["pseudo"], $_POST["commentaire"]);
    $published = true;
}
//PRINT COMMENT FORM
if (isset($_SESSION["pseudo"])) {
    //Ranking
    $usercomment = RankingComment($_SESSION["pseudo"]);
    if ($usercomment["write_comment"] == "1") {
        $form = true;
    } else {
        $form = false;
        $error = "<h4>Poster un commentaire :</h4><p><i class=\"fa fa-times\"></i> Vous n'avez pas les permissions requises pour poster un commentaire !</p><br />";
    }
} else {
    $form = false;
    $error = "<h4>Poster un commentaire :</h4><p><i class=\"fa fa-times\"></i> Merci de vous connecter pour pouvoir poster un commentaire !</p><br />";
}
//GESTION DES BILLETS
if (isset($_GET["id"])) {
    $billets = AffichageBillet($_GET["id"]);
    $comments = AffichageCommentaires($_GET["id"]);
    foreach ($comments as $cle => $comment) {
Beispiel #2
0
//Démarrage de la session
session_start();
//Inclusion des ID SQL
include_once "modele/connexionsql.php";
//Inclusion des fonctions relatives aux membres
include_once "modele/fonctionsdb.php";
include_once "apivariables.php";
//Session checker 3000
if (empty($_SESSION)) {
    header("Location: connexion.php");
} else {
    //Affichage "Bienvenue, pseudo" + déco
    $menu = true;
}
//Test permissions
$access = RankingComment($_SESSION["pseudo"]);
if ($access["miaounet_mod"] == "0") {
    header("Location: index.php");
}
//Test Imageshack
if (!isset($_SESSION["token"])) {
    header("Location: index.php");
}
//Test if file
if (isset($_FILES["file"]) and isset($_POST["title"])) {
    $file = curl_init();
    $url = "http://api.imageshack.com/v2/images/";
    $fileslt = new CurlFile($_FILES["file"]["tmp_name"]);
    $parameters = array("auth_token" => $_SESSION["token"], "file" => $fileslt, "title" => htmlspecialchars($_POST["title"]), "api_key" => $imageshack);
    curl_setopt($file, CURLOPT_URL, $url);
    curl_setopt($file, CURLOPT_POST, true);
Beispiel #3
0
?>
							        	</ul>
							        </li>
									<li class="dropdown">
									    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-user"></i> <?php 
if (isset($_SESSION["pseudo"])) {
    echo "Bonjour, " . $_SESSION["pseudo"];
} else {
    echo "Espace membres";
}
?>
 <span class="caret"></span></a>
									    <ul class="dropdown-menu">
									    	<?php 
if (!empty($_SESSION)) {
    $permissions = RankingComment($_SESSION["pseudo"]);
    if ($permissions["miaounet_admin"] == "1") {
        ?>
														<li><a href="admin.php"><i class="fa fa-cog"></i> Administration</a></li>
														<?php 
    }
    if ($permissions["miaounet_mod"] == "1") {
        ?>
														<li><a href="moderation.php"><i class="fa fa-commenting"></i> Modération</a></li>
														<?php 
    }
}
if ($menu == true) {
    ?>
													<li><a href="membre.php" ><i class="fa fa-user"></i><?php 
    echo " Mon profil";