Skip to content

Instantly share code, notes, and snippets.

@valous
Created March 22, 2013 19:43
Show Gist options
  • Save valous/5224159 to your computer and use it in GitHub Desktop.
Save valous/5224159 to your computer and use it in GitHub Desktop.
<script>
$(document).ready(function() {
$('.telo1').hide()
});
</script>
<script>
$(document).ready(function() {
$('.telo2').hide()
});
</script>
<script>
$(document).ready(function() {
$('.telo3').hide()
});
</script>
<script>
$(document).ready(function() {
$('.telo4').hide()
});
</script>
<script>
$(document).ready(function() {
$('.telo5').hide()
});
</script>
<script>
$(document).ready(function() {
$('.telo6').hide()
});
</script>
<script>
$(document).ready(function() {
$('.telo7').hide()
});
</script>
<script>
$(document).ready(function() {
$('.telo8').hide()
});
</script>
<script>
$(document).ready(function() {
$('.telo9').hide()
});
</script>
<script>
$(document).ready(function() {
$('.telo10').hide()
});
</script>
<?php
include("connect.php");
echo("<br />\n");
echo("<center> ");
echo"<table>";
echo"<tr>";
echo"<td>";
echo"<form method='GET' action='index.php'>";
echo"<input type='hidden' name='id' value='news'>";
echo("<button type='button' onclick='this.form.submit();' class='css3button'>NEWS</button>");
echo"</form>";
echo"</td>";
echo(" ");
echo(" ");
echo(" ");
echo"<td>";
echo"<form method='GET' action='index.php'>";
echo"<input type='hidden' name='id' value='vypis'>";
echo"<input type='hidden' name='str' value='0'>";
echo("<button type='button' onclick='this.form.submit();' class='css3button'>SEZNAM MAP</button>");
echo"</form>\n";
echo"</td>";
echo"<td>";
echo(" ");
echo(" ");
echo(" ");
echo"</td>";
echo"<td>";
echo"<form method='GET' action='index.php'>";
echo"<input type='hidden' name='id' value='upload'>";
echo("<button type='button' onclick='this.form.submit();' class='css3button'>UPLOAD</button>");
echo"</form>";
echo"</td>";
echo"</tr>";
echo"<td>";
echo"</table>";
echo("</center> ");
echo("<center>");
echo"<table>";
echo"<tr>";
echo"<td>";
echo"<form method='GET' action='index.php'>";
echo"<input type='hidden' name='id' value='vypis'>";
echo"<input type='hidden' name='str' value='0'>";
echo"<input type='hidden' name='status' value='prijate'>";
echo("<button type='button' onclick='this.form.submit();' class='css3button'>Přijaté</button>");
echo"</form>\n";
echo"</td>";
echo"<td>";
echo(" ");
echo(" ");
echo(" ");
echo"</td>";
echo"<td>";
echo"<form method='GET' action='index.php'>";
echo"<input type='hidden' name='id' value='vypis'>";
echo"<input type='hidden' name='str' value='0'>";
echo"<input type='hidden' name='status' value='zamitnute'>";
echo("<button type='button' onclick='this.form.submit();' class='css3button'>Zamítnuté</button>");
echo"</form>";
echo"</td>";
echo"<td>";
echo(" ");
echo(" ");
echo(" ");
echo"</td>";
echo"<td>";
echo"<form method='GET' action='index.php'>";
echo"<input type='hidden' name='id' value='vypis'>";
echo"<input type='hidden' name='str' value='0'>";
echo"<input type='hidden' name='status' value='natocene'>";
echo("<button type='button' onclick='this.form.submit();' class='css3button'>Natočené</button>");
echo"</form>";
echo"</td>";
echo"<td>";
echo(" ");
echo(" ");
echo(" ");
echo"</td>";
echo"<td>";
echo"<form method='GET' action='index.php'>";
echo"<input type='hidden' name='id' value='vypis'>";
echo"<input type='hidden' name='str' value='0'>";
echo"<input type='hidden' name='status' value='cekajici'>";
echo("<button type='button' onclick='this.form.submit();' class='css3button'>Čekající</button>");
echo"</form>";
echo"</td>";
echo"<td>";
echo(" ");
echo(" ");
echo(" ");
echo"</td>";
echo"<td>";
echo"<form method='GET' action='index.php?id=vypis&str=0'>";
echo"<input type='hidden' name='id' value='vypis'>";
echo"<input type='hidden' name='str' value='0'>";
echo"<input type='hidden' name='status' value='vse'>";
echo("<button type='button' onclick='this.form.submit();' class='css3button'>Vše</button>");
echo"</form>";
echo"</td>";
echo"</tr>";
echo"</table>";
echo("</center>");
echo("<br />\n");
$d = $_GET["str"]*10;
$h = $_GET["str"]*10+10;
if($_GET["status"] == "cekajici")
{
$sql = mysql_query("SELECT * FROM mapy_nove WHERE status=0 AND aktivni='a' LIMIT $d,$h");
} elseif($_GET["status"] == "prijate")
{
$sql = mysql_query("SELECT * FROM mapy_nove WHERE status=1 AND aktivni='a' LIMIT $d,$h");
} elseif($_GET["status"] == "zamitnute")
{
$sql = mysql_query("SELECT * FROM mapy_nove WHERE status=2 AND aktivni='a' LIMIT $d,$h");
} elseif($_GET["status"] == "natocene")
{
$sql = mysql_query("SELECT * FROM mapy_nove WHERE status=3 AND aktivni='a' LIMIT $d,$h");
} else {
$sql = mysql_query("SELECT * FROM mapy_nove WHERE aktivni='a' LIMIT $d,$h");
}
while($vypis = mysql_fetch_array($sql))
{
$nazev_mapy = $vypis["nazev"];
$pocet_hracu = $vypis["hraci"];
$verze = $vypis["verze"];
$pvp = $vypis["pvp"];
$monstra = $vypis["monstra"];
$zvirata = $vypis["zvirata"];
$NPC = $vypis["NPC"];
$obtiznost = $vypis["obtiznost"];
$nether = $vypis["nether"];
$tp = $vypis["tp"];
$typ_mapy = $vypis["typ"];
$herni_doba = $vypis["cas"];
$autor = $vypis["autor"];
$cas = $vypis["cas"];
$status = $vypis["status"];
$poznamka = $vypis["poznamka"];
$kyber_hodnoceni = $vypis["kyber_hodnoceni"];
$hodnoceni_hracu = $vypis["hodnoceni_hracu"];
$spawn = $vypis["spawn"];
$videon = $vypis["video"];
$video = Str_Replace(Array("watch?v=") ,Array("embed/") , $videon);
$o++;
$R++;
//------------------------------------------------
echo("<left><div class='mapaopen" . $o . "'>");
if($status == 1)
{
echo("<div class='mapa02'>");
}
elseif($status == 2)
{
echo("<div class='mapa01'>");
}
elseif($status == 3)
{
echo("<div class='mapa03'>");
}
else
{
echo("<div class='mapa04'>");
}
echo("<h1>" . $nazev_mapy . "</h1>");
echo(" ");
echo(" ");
echo(" ");
echo(" <h5>" . $typ_mapy . "</h5> ");
echo(" <span class='right'> ");
echo(" <h5>Počet hráču: " . $pocet_hracu . "</h5><br />\n");
echo(" <h5>Herní doba: " . $herni_doba . "</h5> ");
echo(" </span>");
echo("</div>");
echo("</div>");
echo("<div class='telo" . $o . "'>");
if($status == 1)
{
echo("<div class='mapaopen02'>");
}
elseif($status == 2)
{
echo("<div class='mapaopen01'>");
}
elseif($status == 3)
{
echo("<div class='mapaopen03'>");
}
else
{
echo("<div class='mapaopen04'>");
}
echo("<center>");
echo(" <span class='left'> ");
echo("<span id='v" . $R . "' style='display: none;'>");
if($video == "")
{
echo" <img src='ERR1.gif' width='240px' height='160px' title='Video nebylo dodáno'>";
} else {
echo("<iframe width='240' height='160' src='" . $video . "' frameborder='0' allowfullscreen></iframe>");
}
echo("</span>");
echo("<span id='o" . $R . "' style='display: ;'>");
if(file_exists("./mapy/" . $nazev_mapy . "/obr/1.jpg"))
{
$cislo++;
?>
<script type="text/javascript">
$(function() {
$('#gallery<?php echo $cislo ?> a').lightBox();
});
</script>
<?php
echo("<div id='gallery" . $cislo . "'>");
echo("<ul>");
echo("<a href='./mapy/" . $nazev_mapy . "/obr/1.jpg' title='" . $nazev_mapy . "'><img src='./mapy/" . $nazev_mapy . "/obr/1.jpg' width='240px' height='160px' alt=''></a>");
echo("<span style='display: none;'>");
echo("<a href='./mapy/" . $nazev_mapy . "/obr/2.jpg' title='" . $nazev_mapy . "'><img src='./mapy/" . $nazev_mapy . "/obr/2.jpg' width='240px' height='160px' alt=''></a>");
echo("<a href='./mapy/" . $nazev_mapy . "/obr/3.jpg' title='" . $nazev_mapy . "'><img src='./mapy/" . $nazev_mapy . "/obr/3.jpg' width='240px' height='160px' alt=''></a>");
echo("</span>");
echo("</ul>");
echo("</div>");
} else {
echo("<img src='./obr/1.jpg' width='240px' height='160px' title='" . $nazev_mapy . "'>");
}
echo("</span>");
echo("<span id='cudliky'>");
echo"<table>";
echo"<tr>";
echo("<td>");
echo("<a onclick='obrazek(v" . $R . ",o" . $R . ")'><img src='img.png'></a>");
echo("</td>");
echo("<td>");
echo("<a onclick='video(v" . $R . ",o" . $R . ")'><img src='youtube.png'></a>");
echo("</td>");
echo("<td>");
echo("<a href='../mapy/" . $nazev_mapy . "/mapa/" . $nazev_mapy . ".zip'><img src='dw.png'></a>");
echo("</td>");
echo"</tr>";
echo"</table>";
echo("</span>");
echo("</center>");
echo(" </span> ");
echo(" <span class='left2'> ");
echo(" <p>Autoři: " . $autor . "</p> ");
echo(" <p>Verze MC: " . $verze ."</p> ");
echo(" <p>Nether: " . $nether . "</p> ");
echo(" <p>Obtížnost: " . $obtiznost . "</p> ");
echo(" <p>Monstra, zvířata, NPC: " . $monstra . ", " . $zvirata . ", " . $NPC . "</p> ");
echo(" <p>PVP: " . $pvp . "</p> ");
echo(" <p>Texture pack: " . $tp . "</p> ");
echo(" <p>Souřadnice startu: " . $spawn . "</p> ");
echo("<div id='hlasovani'><br />\n");
echo("<strong>Hodnocení:</strong><br />\n");
echo "Kybercraftu: " . $kyber_hodnoceni . "<br />\n";
echo("<span id='hodnoceni_hracu'>");
$IP = $_SERVER['REMOTE_ADDR'];
$kontrola = mysql_query("SELECT * FROM hodnoceni WHERE IP='$IP' && mapa='$nazev_mapy'");
while($kontroluj = mysql_fetch_array($kontrola))
{
$mapa = $kontroluj[mapa];
$mh = $kontroluj[mh];
}
if($mapa == $nazev_mapy && $mh =='1')
{
echo("Diváků: " . $hodnoceni_hracu);
}
else {
echo("<form action='index.php?id=hodnoceni' method='post'>");
echo("<input type='hidden' name='ID' value='" . $nazev_mapy . "'>");
echo("Tvé: <select name='hodnoceni'> ");
echo(" <option value='0' selected>0</option> ");
echo(" <option value='1' >1</option> ");
echo("<option value='2' >2</option> ");
echo(" <option value='3' >3</option> ");
echo(" <option value='4' >4</option> ");
echo(" <option value='5' >5</option> ");
echo(" <option value='6' >6</option> ");
echo(" <option value='7' >7</option> ");
echo("<option value='8' >8</option> ");
echo(" <option value='9' >9</option> ");
echo(" <option value='10' >10</option> ");
echo("<option value='--' disabled selected>--</option> ");
echo(" </select> ");
echo("<input type='submit' value='Ohodnoť'> ");
echo(" </form> ");
}
echo("</span> ");
echo("</span>");
echo("</span>");
echo("</div>");
echo("</div> ");
echo("</left></div>");
}
echo("<center>");
echo("<br />\n");
$co = $_GET["status"];
$cislo = $_GET["str"];
if($_GET["status"] == "cekajici")
{
$sqlll = mysql_query("SELECT * FROM mapy_nove WHERE status=0");
} elseif($_GET["status"] == "prijate")
{
$sqlll = mysql_query("SELECT * FROM mapy_nove WHERE status=1");
} elseif($_GET["status"] == "zamitnute")
{
$sqlll = mysql_query("SELECT * FROM mapy_nove WHERE status=2");
} elseif($_GET["status"] == "natocene")
{
$sqlll = mysql_query("SELECT * FROM mapy_nove WHERE status=3");
} else {
$sqlll = mysql_query("SELECT * FROM mapy_nove");
}
$pocet_radku = mysql_num_rows($sqlll);
$vypis_radku = 0;
while($pocet_radku>0)
{
if($pocet_radku>5)
{
$vypis_radku = $vypis_radku+1;
$pocet_radku = $pocet_radku-10;
} else {
$pocet_radku = 0;
$vypis_radku = $vypis_radku+1;
}
}
echo"<table>";
echo"<tr>";
$x = 0;
while($vypis_radku>0)
{
echo"<td>";
echo"<form method='GET' action='index.php'>";
echo"<input type='hidden' name='id' value='vypis'>";
echo"<input type='hidden' name='str' value='" . $x . "'>";
echo"<input type='hidden' name='status' value='" . $co . "'>";
echo(" <button type='button' onclick='this.form.submit();' class='css3button'>" . $x . "</button> ");
echo"</form>";
echo"</td>";
echo"<td>";
echo(" ");
echo"</td>";
$x = $x+1;
$vypis_radku = $vypis_radku-1;
}
echo"</tr>";
echo"</center></table>";
echo("<br />\n");
?>
<script>
$('.mapaopen1').click(function () {
$('.telo1').slideToggle("slow");
});
</script>
<script>
$('.mapaopen2').click(function () {
$('.telo2').slideToggle("slow");
});
</script>
<script>
$('.mapaopen3').click(function () {
$('.telo3').slideToggle("slow");
});
</script>
<script>
$('.mapaopen4').click(function () {
$('.telo4').slideToggle("slow");
});
</script>
<script>
$('.mapaopen5').click(function () {
$('.telo5').slideToggle("slow");
});
</script>
<script>
$('.mapaopen6').click(function () {
$('.telo6').slideToggle("slow");
});
</script>
<script>
$('.mapaopen7').click(function () {
$('.telo7').slideToggle("slow");
});
</script>
<script>
$('.mapaopen8').click(function () {
$('.telo8').slideToggle("slow");
});
</script>
<script>
$('.mapaopen9').click(function () {
$('.telo9').slideToggle("slow");
});
</script>
<script>
$('.mapaopen10').click(function () {
$('.telo10').slideToggle("slow");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment