Browse Source

pasek atencji ukonczony

pull/40/head
asiekierka 12 years ago
parent
commit
94e472438c
  1. 12
      atencja.php
  2. 6
      inc/config.php
  3. 8
      js/pasek_atencji.js
  4. 9
      templates/pasek_atencji.html

12
atencja.php

@ -1,10 +1,10 @@
<?php <?php
require_once 'inc/functions.php'; require_once 'inc/functions.php';
checkBan(); // Wazne! checkBan(); // Wazne!
// Zwroc stare dane atencji if(@strlen($_POST["tekst"])>0) {
print file_get_contents("atencja.txt"); file_put_contents("atencja.txt",$_POST["tekst"]);
// inb4 XSS if(strlen($_SERVER['HTTP_REFERER'])>0) { header('Location: ' . $_SERVER['HTTP_REFERER']); }
if(strlen($_POST["atencja"])>0) file_put_contents("atencja.txt",$_POST["atencja"]); else { header('Location: /'); }
if(strlen($_SERVER['HTTP_REFERER'])>0) { header('Location: ' . $_SERVER['HTTP_REFERER']); } } else print(file_get_contents("atencja.txt"));
else { header('Location: /'); } return;
?> ?>

6
inc/config.php

@ -499,7 +499,11 @@
// How many reports you can create in the same request. // How many reports you can create in the same request.
$config['report_limit'] = 3; $config['report_limit'] = 3;
// Pasek atencji
// REMEMBER TO CHMOD atencja.txt PROPERLY
// Oh, and add jQuery in additional_javascript.
$config['pasek_atencji'] = false;
/* /*
* ==================== * ====================
* Display settings * Display settings

8
js/pasek_atencji.js

@ -0,0 +1,8 @@
$(document).ready(function(){
$("#pasek_atencji").click(function(eO){ $("#pasek_atencji").css("display","none");
$("#pasek_atencji_forma").css("display","block"); });
$.get("/atencja.php", function(data) {
$("#pasek_atencji").text(data);
$("#pasek_atencji_input").val(data);
});
});

9
templates/pasek_atencji.html

@ -1,9 +1,12 @@
{% if config.pasek_atencji %} {% if config.pasek_atencji %}
<div id="pasek_atencji" style="height: 1.5em; width: 90%; text-align: center; display: block;"> <div id="pasek_atencji" style="height: 1.5em; width: 100%; padding: 0; margin: 0; text-align: center; display: block; onclick="pasekAtencjiKliku();">
</div> </div>
<form method="post" action="/atencja.php" id="pasek_atencji_forma" style="display: none;"> <form method="post" action="/atencja.php" id="pasek_atencji_forma" style="display: none; padding: 0; margin: 0;">
<input name="tekst" style="width: 90%; text-align: center;" value="" type="text"> <input id="pasek_atencji_input" name="tekst" style="width: 100%; padding: 0; margin: 0; text-align: center;" value="" type="text">
</form> </form>
<style>
#pasek_atencji:hover { background-color: #fff; opacity: 0.8; }
</style>
<script type="text/javascript" src="/js/pasek_atencji.js"></script> <script type="text/javascript" src="/js/pasek_atencji.js"></script>
{% endif %} {% endif %}

Loading…
Cancel
Save