<?
/////////////////////////////////////////////////
///////////Video Clip Hack Made by //////////////
/////////////////////////////////////////////////
/////////////Dark-Evil and Lodar/////////////////
/////////////////////////////////////////////////
require_once("include/bittorrent.php");
hit_start();
dbconn(false);
hit_count();
loggedinorreturn();
if ($_GET["id"] != ""){
$id = $_GET["id"];
if (get_user_class() >= UC_MODERATOR){
mysql_query("DELETE FROM youtubevideo WHERE id= $id") or sqlerr(__FILE__, __LINE__);
}
else{
stderr("Sorry", "Keine Berechtigung!");
}
} 
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if ($_POST["link"] == "" || $_POST["name"] == "")
        stderr("Fehler", "Formulardaten unvollständig.");
    $name = $_POST["name"];
    $user = $CURUSER["username"];
    $link = "http://youtube.com/v/".$_POST[link]."";
    mysql_query("INSERT INTO youtubevideo (link, name, addedby, addtime) VALUES('$link', '$name', '$user',NOW())") or sqlerr(__FILE__, __LINE__);
  }
stdhead("Video Clips");
print("<table border=1 cellspacing=0 cellpadding=0 align=center><tr>");
print("<td width=502 valign=top>");
print("<table width=502 border=1>");
?>
<style type="text/css">
</style>
<table cellpadding="4" cellspacing="1" border="0" style="width:100%" class="tableinborder">
<tr class="tabletitle" width="100%">
<td colspan="10" width="100%"><span class="normalfont"><center><b>Video Clips</b></center></span></td>
</tr><tr><td width="100%" class="tablea">
<center>
<p><br>
<span class="style3">Hier siehst du das video das du anschauen willst</span> </p>
</center>
<tr><td
<br>
<tr><td>
</form> <iframe src="" name="games" width="570" height="570" scrolling="no"></iframe></td></tr>
</table></td>
<?
print("<td width=250 valign=top><table border=1>");
$query = "SELECT * FROM youtubevideo ORDER BY name";
$sql = mysql_query($query);
while ($row = mysql_fetch_array($sql)) {
$link = $row['link'];
$name = $row['name'];
print("<tr><td align=left>&nbsp;&nbsp;<a href=".$link." target=games>".$name."</td></tr>");
}
print("</table>");
print("</td></tr></table>");
if (get_user_class() >= UC_MODERATOR){
print("<br><br>");
begin_frame("Neues Video einfügen", FALSE, "400px");
?>
<form method="post" action="video.php">
<? begin_table(TRUE); ?><br>
<div align=center>Bitte nur den Letzten Teil angeben!<br> <br>
ganze Url= "http://youtube.com/watch?v=qppuuQrklHg"<br>
bei Link eingeben= "qppuuQrklHg"<br>
<br> NUR VIDEOS VON youtube.com !!!!<br><br></div>
<tr><td class="tableb">Link:</td><td class="tablea"><input type="text" name="link" size="60"></td></tr>
<tr><td class="tableb">Name:</td><td class="tablea"><input type="text" name="name" size="60"></td></tr>
<tr><td class="tablea" colspan="2" style="text-align:center"><input type="submit" value="Okay" class="btn"></td></tr>
<? end_table(); ?>
</form>
<?
end_frame();
begin_frame('Videos verwalten', FALSE, "100%;");
begin_table(TRUE);
?>
<colgroup>
  <col width="10">
  <col width="15%">
  <col width="25%">
  <col width="20%">
  <col width="20%">
  <col width="10">
</colgroup>
<tr>
 <td class="tablecat"><div align="center"> ID</div></td>
 <td class="tablecat"><div align="center"> Name</div></td>
 <td class="tablecat"><div align="center"> Link</div></td>
 <td class="tablecat"><div align="center"> Hinzugefügt von</div></td>
 <td class="tablecat"><div align="center"> Hinzugefügt am</div></td>
 <td class="tablecat"><div align="center"> Löschen</div></td>
</tr>
<tr>
<?
$query = "SELECT * FROM youtubevideo ORDER BY id";
$sql = mysql_query($query);
	while ($row2 = mysql_fetch_array($sql)){
 	$link = $row2["link"];
 	$name = $row2["name"];
 	$id = $row2["id"];
 	$addedby = $row2["addedby"];
 	$addtime = $row2["addtime"];
?>
<tr>
 <td class="tablea"><div align="center"> <?=$id?></div></td>
 <td class="tablea"><div align="center"> <?=$name?></div></td>
 <td class="tablea"><div align="center"> <?=$link?></div></td>
 <td class="tablea"><div align="center"> <?=$addedby?></div></td>
 <td class="tablea"><div align="center"> <?=$addtime?></div></td>
 <td class="tablea"><div align="center"> <a href="video.php?id=<?=$id?>">Löschen</a> </div></td>
</tr>
<?
$nr = $nr+1;
}
end_table();
end_frame();
}
stdfoot();
?> 