Exemplo n.º 1
0
 $month = $_POST["month"];
 $year = $_POST["year"];
 if ($day != "" and $month != "" and $year != "") {
     $dateb = strtotime($day . "-" . $month . "-" . $year);
 } else {
     $dateb = "";
 }
 $result55 = dbquery("SELECT * FROM bg_users WHERE user_id<>'" . $userinfo["user_id"] . "' AND user_email='" . $email . "'");
 $rows55e = dbrows($result55);
 if ($rows55e >= 1) {
     redirect("?vys=emailf#profilmes");
 }
 $info = mysql_real_escape_string(strip_tags($_POST["info"]));
 if ($_FILES["avatar"]["tmp_name"] != "") {
     if ($_FILES["avatar"]["type"] == "image/gif" || $_FILES["avatar"]["type"] == "image/jpeg" || $_FILES["avatar"]["type"] == "image/png") {
         $avatarurl = $userinfo["user_id"] . upload_koncovka($_FILES["avatar"]["type"]);
         if ($_FILES["avatar"]["size"] < 1048576) {
             list($width, $height, $type, $attr) = getimagesize($_FILES["avatar"]["tmp_name"]);
             if ($width == 100 and $height == 100) {
                 if (move_uploaded_file($_FILES["avatar"]["tmp_name"], "../../../data.desart.sk/avatars/" . $avatarurl)) {
                     dbquery("UPDATE bg_users SET user_avatar='" . $avatarurl . "', user_info='" . $info . "',user_email='" . $email . "',user_deviantart='" . $da . "', \nuser_web='" . $web . "',user_icq='" . $icq . "',user_skype='" . $skype . "',user_location='" . $location . "',user_emailhide='" . $emailhide . "',user_profiletype='" . $profiletype . "',user_birthday='" . $dateb . "' WHERE user_id='" . $userinfo["user_id"] . "'");
                     redirect("?vys=ok");
                 } else {
                     redirect("?vys=avatare#profilmes");
                 }
             } else {
                 redirect("?vys=size#profilmes");
             }
         } else {
             redirect("?vys=size#profilmes");
         }
Exemplo n.º 2
0
        </div>
      </div>
<?php 
if (isset($_POST["add"]) and $_POST["nazov"] != "" and $_POST["text"] != "") {
    $nazov = mysql_real_escape_string(htmlspecialchars($_POST["nazov"]));
    $kat = $_POST["kat"];
    $target = htmlspecialchars($_POST["target"]);
    $text = addslashes($_POST["text"]);
    $mtext = htmlspecialchars($_POST["minitext"]);
    $autor = $userinfo["user_id"];
    $navrh = 1;
    if (dbcount("(article_id)", "bg_articles", "article_author='" . $userinfo["user_id"] . "' AND article_date > " . strtotime("-12 minutes") . "")) {
        echo '<div class="tip-red border">Ďalší článok môžeš napísať až o 12 minút. (ochrana proti spamu)</div>';
    } else {
        if ($_FILES["articlefile"]["type"] == "image/jpeg" || $_FILES["articlefile"]["type"] == "image/png") {
            $saveurl = rand(1000, 9999) . rand(10, 99) . $userinfo["user_id"] . upload_koncovka($_FILES["articlefile"]["type"]);
            if ($_FILES["articlefile"]["size"] < 4194304) {
                $imgf = file_get_contents($weburl . "/inc/func/resize.php?i=" . $_FILES["articlefile"]["tmp_name"] . "&w=340&h=200");
                file_put_contents("../../data.desart.sk/articles/" . $saveurl, $imgf);
                dbquery("INSERT INTO bg_articles(article_minitxt, article_img,article_name, article_cat, article_author, article_txt, article_date, article_suggestion, article_target)\n     \t\t\tVALUES('" . $mtext . "','" . $saveurl . "','" . $nazov . "','" . $kat . "','" . $autor . "','" . $text . "','" . time() . "','" . $navrh . "','" . $target . "')");
                echo '<div class="alert alert-success">Článok <b>' . $nazov . '</b> bol pridaný na schválenie.</div>';
            } else {
                echo '<div class="alert alert-danger">Maximálna veľkosť obrázku 2MB..</div>';
            }
        } else {
            echo '<div class="alert alert-danger">Neplatný typ souboru. Povolené typy: .PNG, .JPG</div>';
        }
    }
}
echo '
<form method="post" action="" enctype="multipart/form-data" class="form-horizontal">