Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 KB | None | 0 0
  1. <?php
  2. #|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
  3. #| #|
  4. #| Développement de RetroPHP par Tyler #|
  5. #| #|
  6. #|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
  7.  
  8. include("../init.php");
  9. include("../includes/files/session.disconnect.php");
  10.  
  11. $pageid = 14;
  12.  
  13.  
  14. if($user['rank'] >= 7) {
  15. $deban = $_GET['value'];
  16. if(isset($deban)) {
  17. mysql_query("DELETE FROM bans WHERE value = '".$deban."'") or die(mysql_error());
  18. if(Settings('Emulator') == "Azure") {
  19. mysql_query("DELETE FROM users_bans WHERE value = '".$deban."'") or die(mysql_error());
  20. }
  21. mysql_query("INSERT INTO retrophp_stafflog (pseudo,action,date) VALUES ('".$user['username']."','Dé-bannissement (".$deban."). ','".time()."')");
  22. Redirect("".Settings('Url')."/admin/bans");
  23. }
  24. }
  25.  
  26. $modifiernews = Securise($_GET['modifiernews']);
  27. $modif = Securise($_GET['modif']);
  28.  
  29.  
  30. if ($modifiernews != "") {
  31. if(isset($_POST['titre']) || isset($_POST['desc']) || isset($_POST['image']) || isset($_POST['article'])) {
  32. $titre = Securise($_POST['titre']);
  33. $desc = Securise($_POST['desc']);
  34. $image = Securise($_POST['image']);
  35. $article = $_POST['article'];
  36. if($titre != "" && $desc != "" && $image != "" && $article != "") {
  37.  
  38. mysql_query("UPDATE retrophp_news SET topstory_image='".$image."',title='".($titre)."',snippet='".($desc)."',body='".addslashes($article)."' WHERE id = '".$modifiernews."'") or die(mysql_error());
  39. $affichage = "
  40. <div class=\"alert3 alert-dismissable alert-success\"> &nbsp; Article modifi&eacute;!</div>";
  41. } else {
  42. $affichage = "
  43. <div class=\"alert3 alert-dismissable alert-danger\"> &nbsp; Champs manquant!</div>";
  44. }
  45. }
  46. }
  47.  
  48. include("./templates/header.php");
  49. ?>
  50. <script src="./ckeditor/ckeditor.js"></script>
  51. <script type="text/javascript">
  52. bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
  53. </script>
  54. <div class="row">
  55.  
  56. <div class="col-md-12">
  57. <article class="widget">
  58. <header class="widget__header">
  59. <h3 class="widget__title">Modifier une news</h3>
  60. </header>
  61.  
  62.  
  63. <div class="panel-body" style="width:80%;">
  64. <center>
  65.  
  66. <?PHP
  67. $sql_modif = mysql_query("SELECT * FROM retrophp_news WHERE id = '".$modif."'");
  68. $modif_a = mysql_fetch_array($sql_modif);
  69.  
  70. ?>
  71.  
  72. <div class="form-group" style="margin-left:30%;">
  73. <form name='editor' method='post' action="?modifiernews=<?php echo $modif; ?>">
  74. <?php if(isset($affichage)) { ?><p class="error_admin"><?php echo $affichage; ?></p><?php } ?>
  75. <label class="control-label" for="inputDefault">Titre:</label>
  76. <input type="text" class="form-control" value='<?php echo ($modif_a['title']); ?>' name="titre" id="inputDefault">
  77. <label class="control-label" for="inputDefault">Description:</label>
  78. <input type="text" class="form-control" name="desc" value='<?php echo ($modif_a['snippet']); ?>' id="inputDefault">
  79. <label class="control-label" for="inputDefault">Image:</label>
  80. <input type="text" class="form-control" name="image" value="<?php echo $modif_a['topstory_image']; ?>" id="inputDefault">
  81. <label class="control-label" for="inputDefault">Contenu:</label>
  82. <textarea name="article" id="editor1" rows="10" cols="80"><?php echo ($modif_a['body']); ?></textarea>
  83. <script>
  84. CKEDITOR.replace( 'editor1' );
  85. </script>
  86. <input type='submit' name='submit' value='Modifier' style="margin-top:15px;clear:bold;" class='btn btn-success'>
  87. </form>
  88. </div>
  89.  
  90. </div>
  91.  
  92. </div>
  93. <?php include("./templates/footer.php"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement