Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
- #| #|
- #| Développement de RetroPHP par Tyler #|
- #| #|
- #|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
- include("../init.php");
- include("../includes/files/session.disconnect.php");
- $pageid = 14;
- if($user['rank'] >= 7) {
- $deban = $_GET['value'];
- if(isset($deban)) {
- mysql_query("DELETE FROM bans WHERE value = '".$deban."'") or die(mysql_error());
- if(Settings('Emulator') == "Azure") {
- mysql_query("DELETE FROM users_bans WHERE value = '".$deban."'") or die(mysql_error());
- }
- mysql_query("INSERT INTO retrophp_stafflog (pseudo,action,date) VALUES ('".$user['username']."','Dé-bannissement (".$deban."). ','".time()."')");
- Redirect("".Settings('Url')."/admin/bans");
- }
- }
- $modifiernews = Securise($_GET['modifiernews']);
- $modif = Securise($_GET['modif']);
- if ($modifiernews != "") {
- if(isset($_POST['titre']) || isset($_POST['desc']) || isset($_POST['image']) || isset($_POST['article'])) {
- $titre = Securise($_POST['titre']);
- $desc = Securise($_POST['desc']);
- $image = Securise($_POST['image']);
- $article = $_POST['article'];
- if($titre != "" && $desc != "" && $image != "" && $article != "") {
- mysql_query("UPDATE retrophp_news SET topstory_image='".$image."',title='".($titre)."',snippet='".($desc)."',body='".addslashes($article)."' WHERE id = '".$modifiernews."'") or die(mysql_error());
- $affichage = "
- <div class=\"alert3 alert-dismissable alert-success\"> Article modifié!</div>";
- } else {
- $affichage = "
- <div class=\"alert3 alert-dismissable alert-danger\"> Champs manquant!</div>";
- }
- }
- }
- include("./templates/header.php");
- ?>
- <script src="./ckeditor/ckeditor.js"></script>
- <script type="text/javascript">
- bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
- </script>
- <div class="row">
- <div class="col-md-12">
- <article class="widget">
- <header class="widget__header">
- <h3 class="widget__title">Modifier une news</h3>
- </header>
- <div class="panel-body" style="width:80%;">
- <center>
- <?PHP
- $sql_modif = mysql_query("SELECT * FROM retrophp_news WHERE id = '".$modif."'");
- $modif_a = mysql_fetch_array($sql_modif);
- ?>
- <div class="form-group" style="margin-left:30%;">
- <form name='editor' method='post' action="?modifiernews=<?php echo $modif; ?>">
- <?php if(isset($affichage)) { ?><p class="error_admin"><?php echo $affichage; ?></p><?php } ?>
- <label class="control-label" for="inputDefault">Titre:</label>
- <input type="text" class="form-control" value='<?php echo ($modif_a['title']); ?>' name="titre" id="inputDefault">
- <label class="control-label" for="inputDefault">Description:</label>
- <input type="text" class="form-control" name="desc" value='<?php echo ($modif_a['snippet']); ?>' id="inputDefault">
- <label class="control-label" for="inputDefault">Image:</label>
- <input type="text" class="form-control" name="image" value="<?php echo $modif_a['topstory_image']; ?>" id="inputDefault">
- <label class="control-label" for="inputDefault">Contenu:</label>
- <textarea name="article" id="editor1" rows="10" cols="80"><?php echo ($modif_a['body']); ?></textarea>
- <script>
- CKEDITOR.replace( 'editor1' );
- </script>
- <input type='submit' name='submit' value='Modifier' style="margin-top:15px;clear:bold;" class='btn btn-success'>
- </form>
- </div>
- </div>
- </div>
- <?php include("./templates/footer.php"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement