<script type="text/javascript" src="/js/overlib.js"></script>print("<td class='ttable_col$x' nowrap='nowrap'>".(count($expandrows)?"<a href=\"javascript: klappe_torrent('t".$row['id']."')\"><img border=\"0\" src=\"".$site_config["SITEURL"]."/images/plus.gif\" id=\"pict".$row['id']."\" alt=\"Show/Hide\" class=\"showthecross\" /></a>":"")." <a title=\"".$row["name"]."\" href=\"torrents-details.php?id=$id&hit=1\">$dispname</a></td>");
break;
//////////BALLOON TOOLTIP MOD///////////////////////////
$bimg = @mysqli_fetch_array(@SQL_Query_exec("SELECT image1 FROM torrents WHERE id=$id"));
$balon =($bimg["image1"] ? "$site_config[SITEURL]/uploads/images/" . htmlspecialchars($bimg["image1"]) : "images/nocover.png");
$descr = "<table width=100% class=ttable_col1 cellspacing=0 cellpadding=5 align=center><tr><td class=ttable_head colspan=2 align=center>$smallname</td></tr><tr valign=top><td align=center><img border=0 width=220 src=$balon></td><td><div align=left><b>Date Added: </b>" . date("m-d-Y", utc_to_tz_time($row["added"])) . "<br /><b>Seeders: </b><font color=green>" . $row["seeders"] . "</font><br /><b>Leechers: </b><font color=red>" . $row["leechers"] . "</font><br /></div></td></tr></table>";
print("<td class=ttable_col$x nowrap>$reqname".(count($expandrows)?" <a href=\"javascript: klappe_torrent('t".$row['id']."')\"><img border=\"0\" src=\"".$site_config["SITEURL"]."/images/plus.gif\" id=\"pict".$row['id']."\" alt=\"Show/Hide\" class=\"showthecross\"></a>":"")." <a href=\"torrents-details.php?id=$id&hit=1\" onmouseover=\"return overlib('$descr')\"; onmouseout=\"return nd()\">$dispname</td>");
break;
////////END BALLOON MOD///////////////////////// //////////BALLOON TOOLTIP MOD
$preparing_descr=SQL_Query_exec("SELECT torrents.anon, torrents.views, torrents.hits, torrents.descr, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.last_action, torrents.numratings, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.external, torrents.image1, torrents.announce, torrents.numfiles, torrents.freeleech, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id");
$descr=mysqli_fetch_array($preparing_descr);
if (empty($descr["lang_name"]))
$descr["lang_name"] = "Unknown/NA";
$lang = "<b>" .T_("LANG"). " : </b>" . $descr["lang_name"] . "";
if (isset($descr["lang_image"]) && $descr["lang_image"] != "")
$flag = "<img src=$site_config[SITEURL]/images/languages/$descr[lang_image] border=0 alt=$descr[lang_name]>";
$bimg = @mysqli_fetch_array(@SQL_Query_exec("SELECT image1 FROM torrents WHERE id=$id"));
$balon =($bimg["image1"] ? "$site_config[SITEURL]/uploads/images/" . htmlspecialchars($bimg["image1"]) : "images/nocover.png");
$des = mysqli_real_escape_string($GLOBALS["DBconnector"], format_comment($descr['descr']));
$char5 = 500; //cut name length
if (($descr["anon"] == "yes" || $row["privacy"] == "strong") && $CURUSER["id"] != $descr["owner"] && $CURUSER["edit_torrents"] != "yes") {
$descr['username'] = "".T_("ANONYMOUS")."";
}else{
$descr['username'];
}
print("<td class='ttable_col$x' nowrap='nowrap'>".(count($expandrows)?"<a href=\"javascript: klappe_torrent('t".$row['id']."')\"><img border=\"0\" src=\"".$site_config["SITEURL"]."/images/plus.gif\" id=\"pict".$row['id']."\" alt=\"Show/Hide\" class=\"showthecross\" /></a>":"")." <a href=\"torrents-details.php?id=$id&hit=1\" onMouseover=\"return overlib('<table class=ballooncolor border=1 width=100% class=ttable_headinner cellspacing=0 cellpadding=5 align=center><tr><td class=balloonheadercolor colspan=2 align=center>$smallname</td></tr><tr valign=top><td class=table_col1 align=center><img border=0 width=120 src=$balon></td><td width=80% class=table_col1><div align=left><b>Uploaded on: </b>" . date("m-d-Y", utc_to_tz_time($row["added"])) . "<br /><b>Size: </b>". mksize($row["size"]) . "<br /><b>Completed: </b>" . $row["times_completed"] . "<br /></div><div align=left><b>Views: </b>" . $descr["views"] . "<br />".$lang." ".$flag."<br /><b>Hits: </b>" . $descr["hits"] . "<br /><b>Seeders: </b><font color=green>" . $row["seeders"] . "</font><br /><b>Leechers: </b><font color=red>" . $row["leechers"] . "</font><br /><b> Uploaded by: </b>" . $descr['username'] . "</div></td></tr><tr><td class=balloonheadercolor colspan=2 align=center>".T_("DESCRIPTION")."</td></tr><tr><td class=table_col1 colspan=2>" . CutName($des, $char5) . "</td></tr></table>', CENTER, HEIGHT, 150, WIDTH, 300)\"; onMouseout=\"return nd()\">".$dispname."</a></td>");
break;
////////END BALLOON MOD //DISPLAY NFO BLOCK
function my_nfo_translate($nfo){
$trans = array(
"\x80" => "Ç", "\x81" => "ü", "\x82" => "é", "\x83" => "â", "\x84" => "ä", "\x85" => "à", "\x86" => "å", "\x87" => "ç", "\x88" => "ê", "\x89" => "ë", "\x8a" => "è", "\x8b" => "ï", "\x8c" => "î", "\x8d" => "ì", "\x8e" => "Ä", "\x8f" => "Å", "\x90" => "É",
"\x91" => "æ", "\x92" => "Æ", "\x93" => "ô", "\x94" => "ö", "\x95" => "ò", "\x96" => "û", "\x97" => "ù", "\x98" => "ÿ", "\x99" => "Ö", "\x9a" => "Ü", "\x9b" => "¢", "\x9c" => "£", "\x9d" => "¥", "\x9e" => "₧", "\x9f" => "ƒ", "\xa0" => "á", "\xa1" => "í",
"\xa2" => "ó", "\xa3" => "ú", "\xa4" => "ñ", "\xa5" => "Ñ", "\xa6" => "ª", "\xa7" => "º", "\xa8" => "¿", "\xa9" => "⌐", "\xaa" => "¬", "\xab" => "½", "\xac" => "¼", "\xad" => "¡", "\xae" => "«", "\xaf" => "»", "\xb0" => "░", "\xb1" => "▒", "\xb2" => "▓",
"\xb3" => "│", "\xb4" => "┤", "\xb5" => "╡", "\xb6" => "╢", "\xb7" => "╖", "\xb8" => "╕", "\xb9" => "╣", "\xba" => "║", "\xbb" => "╗", "\xbc" => "╝", "\xbd" => "╜", "\xbe" => "╛", "\xbf" => "┐", "\xc0" => "└", "\xc1" => "┴", "\xc2" => "┬", "\xc3" => "├",
"\xc4" => "─", "\xc5" => "┼", "\xc6" => "╞", "\xc7" => "╟", "\xc8" => "╚", "\xc9" => "╔", "\xca" => "╩", "\xcb" => "╦", "\xcc" => "╠", "\xcd" => "═", "\xce" => "╬", "\xcf" => "╧", "\xd0" => "╨", "\xd1" => "╤", "\xd2" => "╥", "\xd3" => "╙", "\xd4" => "╘",
"\xd5" => "╒", "\xd6" => "╓", "\xd7" => "╫", "\xd8" => "╪", "\xd9" => "┘", "\xda" => "┌", "\xdb" => "█", "\xdc" => "▄", "\xdd" => "▌", "\xde" => "▐", "\xdf" => "▀", "\xe0" => "α", "\xe1" => "ß", "\xe2" => "Γ", "\xe3" => "π", "\xe4" => "Σ", "\xe5" => "σ",
"\xe6" => "µ", "\xe7" => "τ", "\xe8" => "Φ", "\xe9" => "Θ", "\xea" => "Ω", "\xeb" => "δ", "\xec" => "∞", "\xed" => "φ", "\xee" => "ε", "\xef" => "∩", "\xf0" => "≡", "\xf1" => "±", "\xf2" => "≥", "\xf3" => "≤", "\xf4" => "⌠", "\xf5" => "⌡", "\xf6" => "÷",
"\xf7" => "≈", "\xf8" => "°", "\xf9" => "∙", "\xfa" => "·", "\xfb" => "√", "\xfc" => "ⁿ", "\xfd" => "²", "\xfe" => "■", "\xff" => " ",
);
$trans2 = array("\xe4" => "ä", "\xF6" => "ö", "\xFC" => "ü", "\xC4" => "Ä", "\xD6" => "Ö", "\xDC" => "Ü", "\xDF" => "ß");
$all_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$last_was_ascii = False;
$tmp = "";
$nfo = $nfo . "\00";
for ($i = 0; $i < (strlen($nfo) - 1); $i++)
{
$char = $nfo[$i];
if (isset($trans2[$char]) and ($last_was_ascii or strpos($all_chars, ($nfo[$i + 1]))))
{
$tmp = $tmp . $trans2[$char];
$last_was_ascii = True;
}
else
{
if (isset($trans[$char]))
{
$tmp = $tmp . $trans[$char];
}
else
{
$tmp = $tmp . $char;
}
$last_was_ascii = strpos($all_chars, $char);
}
}
return $tmp;
}
//-----------------------------------------------
//DISPLAY NFO BLOCK
if($row["nfo"]== "yes"){
$nfofilelocation = "$nfo_dir/$row[id].nfo";
$filegetcontents = file_get_contents($nfofilelocation);
$nfo = htmlspecialchars($filegetcontents);
if ($nfo) {
$nfo = my_nfo_translate($nfo);
echo "<br /><br /><b>NFO:</b><br />";
print("<textarea class='nfo' style='width:98%;height:100%;' rows='20' cols='20' readonly='readonly'>".stripslashes($nfo)."</textarea>");
}else{
print(T_("ERROR")." reading .nfo file!");
}
}
//DISPLAY NFO BLOCK
begin_frame("NFO");
if ($row["nfo"] == "yes") {
echo('<img src="nfo-view.php?id=' . $id . '">');
}
else {
if ($nfo) {
$nfo = my_nfo_translate($nfo);
echo "<br /><br /><b>NFO:</b><br />";
print("<textarea class='nfo' style='width:98%;height:100%;' align='center' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea>");
} //$nfo
else {
$nfo = utf8_encode(str_replace("\x0d\x0d\x0a", "\x0d\x0a", @file_get_contents($nfofilelocation)));
if ($nfo) {
$nfo = my_nfo_translate($nfo);
echo "<br /><br /><b>NFO:</b><br />";
print("<textarea class='nfo' style='width:98%;height:100%;' align='center' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea>");
} //$nfo
else {
print(T_("NFO_NOT_FOUND"));
}
}
}
end_frame();
<?php
require_once("backend/functions.php");
dbconn();
loggedinonly();
$id = (int) $_REQUEST["id"];
if (!is_valid_id($id)) show_error_msg(T_("ERROR"), T_("INVALID_ID"), 1);
$action = $_REQUEST["action"];
$row = mysqli_fetch_assoc(SQL_Query_exec("SELECT `owner` FROM `torrents` WHERE id=$id"));
if($CURUSER["edit_torrents"]=="no" && $CURUSER['id'] != $row['owner'])
show_error_msg(T_("ERROR"), T_("NO_TORRENT_EDIT_PERMISSION"), 1);
function uploadimage($x, $imgname, $tid) {
global $site_config;
$imagesdir = $site_config["torrent_dir"]."/images";
$allowed_types = &$site_config["allowed_image_types"];
if ( !( $_FILES["image$x"]["name"] == "" ) ) {
if ($imgname != "") {
$img = "$imagesdir/$imgname";
$del = unlink($img);
}
$y = $x + 1;
$im = getimagesize($_FILES["image$x"]["tmp_name"]);
if (!$im[2])
show_error_msg(T_("ERROR"), "Invalid Image $y.", 1);
if (!array_key_exists($im['mime'], $allowed_types))
show_error_msg(T_("ERROR"), T_("INVALID_FILETYPE_IMAGE"), 1);
if ($_FILES["image$x"]["size"] > $site_config['image_max_filesize'])
show_error_msg(T_("ERROR"), sprintf(T_("INVAILD_FILE_SIZE_IMAGE"), $y), 1);
$uploaddir = "$imagesdir/";
$ifilename = $tid . $x . $allowed_types[$im['mime']];
$copy = copy($_FILES["image$x"]["tmp_name"], $uploaddir.$ifilename);
if (!$copy)
show_error_msg(T_("ERROR"), sprintf(T_("ERROR_UPLOADING_IMAGE"), $y), 1);
return $ifilename;
}
}//end func
//GET DATA FROM DB
$res = SQL_Query_exec("SELECT * FROM torrents WHERE id = $id");
$row = mysqli_fetch_array($res);
if (!$row){
show_error_msg(T_("ERROR"), T_("TORRENT_ID_GONE"), 1);
}
$torrent_dir = $site_config["torrent_dir"];
$nfo_dir = $site_config["nfo_dir"];
//DELETE TORRENT
if ($action=="deleteit"){
$torrentid = (int) $_POST["torrentid"];
$delreason = sqlesc($_POST["delreason"]);
$torrentname = $_POST["torrentname"];
if (!is_valid_id($torrentid))
show_error_msg(T_("FAILED"), T_("INVALID_TORRENT_ID"), 1);
if (!$delreason){
show_error_msg(T_("ERROR"), T_("MISSING_FORM_DATA"), 1);
}
deletetorrent($torrentid);
write_log($CURUSER['username']." has deleted torrent: ID:$torrentid - ".htmlspecialchars($torrentname)." - Reason: ".htmlspecialchars($delreason));
if ($CURUSER['id'] != $row['owner']) {
$delreason = $_POST["delreason"];
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, unread, location) VALUES(0, ".$row['owner'].", '".get_date_time()."', 'Your torrent \'$torrentname\' has been deleted by ".$CURUSER['username']."', ".sqlesc("'$torrentname' was deleted by ".$CURUSER['username']."\n\nReason: $delreason").", 'yes', 'in')");
}
show_error_msg(T_("COMPLETED"), htmlspecialchars($torrentname)." ".T_("HAS_BEEN_DEL_DB"),1);
die;
}
//DO THE SAVE TO DB HERE
if ($action=="doedit"){
$updateset = array();
$nfoaction = $_POST['nfoaction'];
if ($nfoaction == "update"){
$nfofile = $_FILES['nfofile'];
if (!$nfofile) die("No data " . var_dump($_FILES));
if ($nfofile['size'] > 65535)
show_error_msg("NFO is too big!", "Max 65,535 bytes.",1);
$nfofilename = $nfofile['tmp_name'];
if (@is_uploaded_file($nfofilename) && @filesize($nfofilename) > 0){
@move_uploaded_file($nfofilename, "$nfo_dir/$id.nfo");
$updateset[] = "nfo = 'yes'";
}//success
}
if (!empty($_POST["name"]))
$updateset[] = "name = " . sqlesc($_POST["name"]);
if ( $_POST['imdb'] != $row['imdb'] ){
$updateset[] = "imdb = " . sqlesc($_POST["imdb"]);
$TTCache->Delete("imdb/$id");
}
if (!empty($_POST["name"]))
$updateset[] = "name = " . sqlesc($_POST["name"]);
$updateset[] = "descr = " . sqlesc($_POST["descr"]);
$updateset[] = "category = " . (int) $_POST["type"];
$updateset[] = "torrentlang = " . (int) $_POST["language"];
if ($CURUSER["edit_torrents"] == "yes") {
if ($_POST["banned"]) {
$updateset[] = "banned = 'yes'";
$_POST["visible"] = 0;
} else {
$updateset[] = "banned = 'no'";
}
}
$updateset[] = "visible = '" . ($_POST["visible"] ? "yes" : "no") . "'";
if (!empty($_POST['tube']))
$tube = unesc($_POST['tube']);
$updateset[] = "tube = " . sqlesc($tube);
if ($CURUSER["edit_torrents"] == "yes")
$updateset[] = "freeleech = '".$_POST["freeleech"]."'";
$updateset[] = "anon = '" . ($_POST["anon"] ? "yes" : "no") . "'";
//update images
$img1action = $_POST['img1action'];
if ($img1action == "update")
$updateset[] = "image1 = " .sqlesc(uploadimage(0, $row["image1"], $id));
if ($img1action == "delete") {
if ($row[image1]) {
$del = unlink($site_config["torrent_dir"]."/images/$row[image1]");
$updateset[] = "image1 = ''";
}
}
$img2action = $_POST['img2action'];
if ($img2action == "update")
$updateset[] = "image2 = " .sqlesc(uploadimage(1, $row["image2"], $id));
if ($img2action == "delete") {
if ($row[image2]) {
$del = unlink($site_config["torrent_dir"]."/images/$row[image2]");
$updateset[] = "image2 = ''";
}
}
SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id");
$returl = "torrents-edit.php?id=$id&edited=1";
if (isset($_POST["returnto"])){
$returl = $_POST["returnto"];
}
write_log("Torrent $id (".htmlspecialchars($_POST["name"]).") was edited by $CURUSER[username]");
header("Location: $returl");
die();
}//END SAVE TO DB
//UPDATE CATEGORY DROPDOWN
$catdropdown = "<select name=\"type\">\n";
$cats = genrelist();
foreach ($cats as $catdropdownubrow) {
$catdropdown .= "<option value=\"" . $catdropdownubrow["id"] . "\"";
if ($catdropdownubrow["id"] == $row["category"])
$catdropdown .= " selected=\"selected\"";
$catdropdown .= ">" . htmlspecialchars($catdropdownubrow["parent_cat"]) . ": " . htmlspecialchars($catdropdownubrow["name"]) . "</option>\n";
}
$catdropdown .= "</select>\n";
//END CATDROPDOWN
//UPDATE TORRENTLANG DROPDOWN
$langdropdown = "<select name=\"language\"><option value='0'>Unknown</option>\n";
$lang = langlist();
foreach ($lang as $lang) {
$langdropdown .= "<option value=\"" . $lang["id"] . "\"";
if ($lang["id"] == $row["torrentlang"])
$langdropdown .= " selected=\"selected\"";
$langdropdown .= ">" . htmlspecialchars($lang["name"]) . "</option>\n";
}
$langdropdown .= "</select>\n";
//END TORRENTLANG
$char1 = 55;
$shortname = CutName(htmlspecialchars($row["name"]), $char1);
if ($_GET["edited"]){
show_error_msg("Edited OK", T_("TORRENT_EDITED_OK"), 1);
}
stdhead(T_("EDIT_TORRENT")." \"$shortname\"");
begin_frame(T_("EDIT_TORRENT")." \"$shortname\"");
print("<br /><br /><form method='post' name=\"bbform\" enctype=\"multipart/form-data\" action=\"torrents-edit.php?action=doedit\">\n");
print("<input type=\"hidden\" name=\"id\" value=\"$id\" />\n");
if (isset($_GET["returnto"]))
print("<input type=\"hidden\" name=\"returnto\" value=\"" . htmlspecialchars($_GET["returnto"]) . "\" />\n");
print("<table class='table_table' cellspacing='0' cellpadding='4' width='586' align='center'>\n");
echo "<tr><td class='table_col1' align='right' width='60'><b>".T_("NAME").": </b></td><td class='table_col2' ><input type=\"text\" name=\"name\" value=\"" . htmlspecialchars($row["name"]) . "\" size=\"60\" /></td></tr>";
echo "<tr><td class='table_col1' align='right'><b>".T_("IMAGE").": </b></td><td class='table_col2'><b>".T_("IMAGE")." 1:</b> <input type='radio' name='img1action' value='keep' checked='checked' />".T_("KEEP_IMAGE")." "."<input type='radio' name='img1action' value='delete' />".T_("DELETE_IMAGE")." "."<input type='radio' name='img1action' value='update' />".T_("UPDATE_IMAGE")."<br /><input type='file' name='image0' size='60' /> <br /><br /> <b>".T_("IMAGE")." 2:</b> <input type='radio' name='img2action' value='keep' checked='checked' />".T_("KEEP_IMAGE")." "."<input type='radio' name='img2action' value='delete' />".T_("DELETE_IMAGE")." "."<input type='radio' name='img2action' value='update' />".T_("UPDATE_IMAGE")."<br /><input type='file' name='image1' size='60' /></td></tr>";
echo "<tr><td class='table_col1' align='right'><b>".T_("NFO").": </b><br /></td><td class='table_col2' ><input type='radio' name='nfoaction' value='keep' checked='checked' />Keep NFO <input type='radio' name='nfoaction' value='update' />Update NFO:";
if ($row["nfo"] == "yes"){
echo " <a href='nfo-view.php?id=".$row["id"]."' target='_blank'>[".T_("VIEW_CURRENT_NFO")."]</a>";
} else{
echo " <font color='#ff0000'>".T_("NO_NFO_UPLOADED")."</font>";
}
echo "<br /><input type='file' name='nfofile' size='60' /></td></tr>";
echo "<tr><td align='right'><b>".T_("VIDEOTUBE").": <b></td><td class='table_col2' align='left'><input type='text' name='tube' value='" . htmlspecialchars($row["tube"]) . "' size='60' /> <a href='http://www.youtube.com' target='_blank'><img border='0' src='images/youtube.png' width='50' height='50' title='Click here to go to Youtube'></a><br/><i>".T_("FORMAT").": </i> <span style='color:#FF0000'><b>http://www.youtube.com/watch?v=Jc9KR3tOP</b></span></td></tr>";
echo "<tr><td class='table_col1' align='right'><b>".T_("CATEGORIES").": </b></td><td class='table_col2'>".$catdropdown."</td></tr>";
echo "<tr><td class='table_col1' align='right'><b>".T_("IMDB")."</b></td><td class='table_col2'><input type=\"text\" name=\"imdb\" value=\"" . htmlspecialchars($row["imdb"]) . "\" size=\"60\" /></td></tr>";
echo "<tr><td class='table_col1' align='right'><b>".T_("LANG").": </b></td><td class='table_col2'>".$langdropdown."</td></tr>";
if ($CURUSER["edit_torrents"] == "yes")
echo "<tr><td class='table_col1' align='right'><b>".T_("BANNED").": </b></td><td class='table_col2'><input type=\"checkbox\" name=\"banned\"" . (($row["banned"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> ".T_("BANNED")."?<br /></td></tr>";
echo "<tr><td class='table_col1' align='right'><b>".T_("VISIBLE").": </b></td><td class='table_col2'><input type=\"checkbox\" name=\"visible\"" . (($row["visible"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> " .T_("VISIBLEONMAIN"). "<br /></td></tr>";
if ($row["external"] != "yes" && $CURUSER["edit_torrents"] == "yes"){
echo "<tr><td class='table_col1' align='right'><b>".T_("FREE_LEECH").": </b></td><td class='table_col2'><input type=\"checkbox\" name=\"freeleech\"" . (($row["freeleech"] == "1") ? " checked=\"checked\"" : "" ) . " value=\"1\" />".T_("FREE_LEECH_MSG")."<br /></td></tr>";
}
if ($site_config['ANONYMOUSUPLOAD']) {
echo "<tr><td class='table_col1' align='right'><b>".T_("ANONYMOUS_UPLOAD").": </b></td><td class='table_col2'><input type=\"checkbox\" name=\"anon\"" . (($row["anon"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" />(".T_("ANONYMOUS_UPLOAD_MSG").")<br /></td></tr>";
}
print ("<tr><td class='table_head' align='center' colspan='2'><b>" .T_("DESCRIPTION"). ":</b></td></tr></table>");
require_once("backend/bbcode.php");
print textbbcode("bbform","descr", htmlspecialchars($row["descr"]));
print("<br /><center><input type=\"submit\" value='".T_("SUBMIT")."' /> <input type='reset' value='".T_("UNDO")."' /></center>\n");
print("</form>\n");
end_frame();
begin_frame(T_("DELETE_TORRENT"));
print("<center><form method='post' action='torrents-edit.php?action=deleteit&id=$id'>\n");
print("<input type='hidden' name='torrentid' value='$id' />\n");
print("<input type='hidden' name='torrentname' value='".htmlspecialchars($row["name"])."' />\n");
echo "<b>".T_("REASON_FOR_DELETE")."</b><input type='text' size='30' name='delreason' />";
echo " <input type='submit' value='".T_("DELETE_TORRENT")."' /></form></center>";
end_frame();
stdfoot();
?> ALTER TABLE `torrents` ADD `tube` varchar(100) DEFAULT NULL; case 'uploader':
echo "<th>".T_("UPLOADER")."</th>";
break; case 'tube':
echo "<th>".T_("YOUTUBE")."</th>";
break; case 'uploader':
echo "<td class='ttable_col$x' align='center'>"; case 'tube':
if ($row["tube"])
print("<td class='ttable_col$x' align='center'><a rel=\"prettyPhoto\" href=".$row['tube']." ><".htmlspecialchars($row['tube'])."><img src='" . $site_config['SITEURL'] . "/images/youtube1.png' border='0' width='50' height='50' alt=\"\" /></a></td>");
else
print("<td class='ttable_colx' align='center'>-</td>");
break;torrents.seeders,torrents.tube,echo "</table></fieldset><br /><br />";if (!empty($row["tube"]))
print ("<tr><td align='left'><b>" .T_("VIDEOTUBE"). ": </b></td><td align='left'><embed src='". str_replace("watch?v=", "v/", htmlspecialchars($row["tube"])) ."' type=\"application/x-shockwave-flash\" width=\"400\" height=\"310\"></embed></td></tr>");
else
print (""); if (!is_valid_id($catid))
$message = T_("UPLOAD_NO_CAT"); if (!is_valid_id($catid))
$message = T_("UPLOAD_NO_CAT");
if (!empty($_POST['tube']))
$tube = unesc($_POST['tube']);category,tube,'".$catid."','".$tube."',print ("<tr><td align='right'>" . T_("TORRENT_NAME") . ": </td><td align='left'><input type='text' name='name' size='60' value='" . $_POST['name'] . "' /><br />".T_("THIS_WILL_BE_TAKEN_TORRENT")." \n</td></tr>");print ("<TR><td align=right>".T_("VIDEOTUBE").": </td><td align=left><input type='text' name='tube' size='50' /> <a href=\"http://www.youtube.com\" target='_blank'><img border='0' src='images/youtube.png' width='50' height='50' title='Click here to go to Youtube'></a><br/><i>".T_("FORMAT").": </i> <span style='color:#FF0000'><b> http://www.youtube.com/watch?v=Jc9KR3tOP</b></SPAN></td></tr>"); $updateset[] = "visible = '" . ($_POST["visible"] ? "yes" : "no") . "'"; if (!empty($_POST['tube']))
$tube = unesc($_POST['tube']);
$updateset[] = "tube = " . sqlesc($tube);echo "<tr><td class='table_col1' align='right'><b>".T_("CATEGORIES").": </b></td><td class='table_col2'>".$catdropdown."</td></tr>";echo "<tr><td align='right'><b>".T_("VIDEOTUBE").": <b></td><td class='table_col2' align='left'><input type='text' name='tube' value='" . htmlspecialchars($row["tube"]) . "' size='60' /> <a href='http://www.youtube.com' target='_blank'><img border='0' src='images/youtube.png' width='50' height='50' title='Click here to go to Youtube'></a><br/><i>".T_("FORMAT").": </i> <span style='color:#FF0000'><b>http://www.youtube.com/watch?v=Jc9KR3tOP</b></span></td></tr>";torrents.tube,// Youtube mod
$LANG["VIDEOTUBE"] = "YouTube Trailer/Video";
$LANG["NOVIDEOTUBE"] = "No YouTube video for this Torrent.";
$LANG["FORMAT"] = "Accepted Format";
$LANG["YOUTUBE"] = "Trailer";
<td align="center"><a href="admincp.php?action=clearshout"><img src="images/admin/shoutclear.png" border="0" width="118" height="80" alt="" /><br /><?php echo T_("CLEAR_SHOUTBOX"); ?><br /></a></td>
///////////////// CLEAR STOCK SHOUTBOX /////////////////////////////
if ($action == "clearshout") {
stdhead(T_("CLEAR_SHOUTBOX"));
error_reporting(E_ALL);
begin_frame("".T_("CLEAR_SHOUTBOX")."");
?>
<br /><br />
<font size ='3'><center><?php echo T_("CLEAR_SHOUTBOX_TEXT"); ?></center></font>
<br /><br />
<form enctype="multipart/form-data" method="post" action="admincp.php">
<input type="hidden" name="action" value="clearshout" />
<input type="hidden" name="do" value="delete" />
<table class="f-border" cellspacing="0" cellpadding="5" width="100%" align="center">
<tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("CLEAR_SHOUTBOX");?>" /></td></tr>
</table></form>
<?php
end_frame();
if ($do == "delete"){
SQL_Query_exec("TRUNCATE TABLE `shoutbox`");
write_log("Shoutbox cleared by $CURUSER[username]");
$msg_shout = sqlesc("".T_("SHOUTBOX_CLEARED_MESSAGE")."");
SQL_Query_exec("INSERT INTO shoutbox (userid, date, user, message) VALUES(0,'".get_date_time()."', 'System' ,".$msg_shout.")");
autolink ("admincp.php", "<b><font color='#ff0000'>Shoutbox Cleared....</font></b>");
}
navmenu();
stdfoot();
}
///////////////END CLEAR STOCK SHOUTBOX //////////////////////////////////////////////
///////////////// CLEAR AJAX SHOUTBOX /////////////////////////////
if ($action == "clearshout" ) {
stdhead(T_("CLEAR_SHOUTBOX"));
error_reporting(E_ALL);
begin_frame("".T_("CLEAR_SHOUTBOX")."");
?>
<br /><br />
<font size ='3'><center><?php echo T_("CLEAR_SHOUTBOX_TEXT"); ?></center></font>
<br /><br />
<form enctype="multipart/form-data" method="post" action="admincp.php">
<input type="hidden" name="action" value="clearshout" />
<input type="hidden" name="do" value="delete" />
<table class="f-border" cellspacing="0" cellpadding="5" width="100%" align="center">
<tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("CLEAR_SHOUTBOX");?>" /></td></tr>
</table></form>
<?php
end_frame();
if ($do == "delete"){
SQL_Query_exec("TRUNCATE TABLE `ajshoutbox`");
write_log("AJAX Shoutbox cleared by $CURUSER[username]");
$msg_shout = sqlesc("".T_("SHOUTBOX_CLEARED_MESSAGE")."");
SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,'".get_date_time()."', 'System' ,".$msg_shout.")");
autolink ("admincp.php", "<b><font color='#ff0000'> AJAX Shoutbox Cleared....</font></b>");
}
navmenu();
stdfoot();
}
///////////////END CLEAR AJAX SHOUTBOX //////////////////////////////////////////////
$LANG["CLEAR_SHOUTBOX_TEXT"] = "Are you sure you want to clear the shoutbox? You can't undo this";
$LANG["SHOUTBOX_CLEARED_MESSAGE"] = "The shoutbox has been cleared";
$LANG["CLEAR_SHOUTBOX"] = "Clear Shoutbox";
<td align="center"><a href="admincp.php?action=torrentclients"><img src="images/admin/clients.png" border="0" width="118" height="80" alt="" /><br /><?php echo T_("CLIENTS"); ?><br /></a></td>/////TORRENT CLIENTS////////
if ($action == "torrentclients") {
if ($CURUSER["class"] < 6)
show_error_msg("Error", "Access denied.");
$res12 = SQL_Query_exec("SELECT client, peer_id FROM peers GROUP BY client");
stdhead("Torrent clients");
begin_frame("All Clients");
print("<br /><table class=tabla_table align=center border=0 cellspacing=0 cellpadding=5>\n");
print("<tr><th class=table_head>Client</th><th class=table_head>Peer ID</th><th class=table_head>To ban use</th></tr>\n");
while($arr12 = mysqli_fetch_assoc($res12)) {
$peer=$arr12['peer_id'];
$peer=substr($peer,0,8);
$peer2=$peer;
print("<tr><td class=table_col1> $arr12[client] </td><td class=table_col2> $arr12[peer_id] </td><td class=table_col2> $peer2 </td></tr>\n");
}
print("</table><br />\n");
end_frame();
navmenu();
stdfoot();
}
/////END TORRENT CLIENTS/////$LANG["CLIENTS"] = "Torrent Clients Used";
#chat {
overflow: auto;
width: 100%;
height: 450px;
padding: 0px;
}
#chatoutput ul {
list-style: none;
margin:0px;
padding:0px;
font-size: 10pt;
}
div.chatoutput {
/*background:#465151;#323232;*/
background:#A8A8A8;
padding:5px 0px 3px 10px;
margin:0px;
color:#000000;
line-height: 150%;
margin-bottom:2px;
border-radius: 5px;
}
div.loader {
background-image: url('images/ajshoutbox/random.php');
background-repeat: no-repeat;
background-position:center center;
width:199px;
height:137px;
}
#chatoutput ul li {
}
#chatoutput ul li span.name {
display: block;
background:url(images/ajshoutbox/bubble.png) no-repeat left;
padding-left:19px;
margin-bottom:1px;
font-weight: normal;
color:#000000;
}
#chatoutput ul li:hover span.name {
background:url(images/ajshoutbox/bubblehover.png) no-repeat left;
}
form {
padding:0px;
margin:0px;
}
#chatoutput {
text-align: left;
margin-right: 0px;
color: #999;
}
/* swaps edit and delete images on mouse over */
#EditSwap {
width:0px;
height:0px;
background:url(images/ajshoutbox/shout_edit_gray.gif) no-repeat bottom;
padding:10px;
}
#EditSwap:hover {
background:url(images/ajshoutbox/shout_edit.png) no-repeat bottom;
}
#DeleteSwap {
width:0px;
height:0px;
background:url(images/ajshoutbox/shout_delete_gray.gif) no-repeat bottom;
padding:10px;
}
#DeleteSwap:hover {
background:url(images/ajshoutbox/shout_delete.png) no-repeat bottom;
}
/* end of swaping */
img.form {
background:url(images/ajshoutbox/frame.png) no-repeat;
}
img.form:hover {
background:url(images/ajshoutbox/frame_hover.png) no-repeat;
}
#chatcornerup {
width:50%;
padding: 10px;
background-color: #E2E2E2;
border:1px solid #777;
border-bottom-style:none;
border-top-right-radius: 2em;
border-top-left-radius: 2em;
}
#chatcornerdown {
width:65%;
padding: 10px;
background-color: #E2E2E2;
border:1px solid #777;
border-bottom-style:none;
border-top-right-radius: 2em;
border-top-left-radius: 2em;
} switch(tag)
{ case '[hide]':
var start = document.forms[form].elements[text].selectionStart;
var end = document.forms[form].elements[text].selectionEnd;
if (start != end) {
var body = document.forms[form].elements[text].value;
var left = body.substring(0, start);
var middle = "[hide]" + body.substring(start, end) + "[/hide]";
var rightpos = start + body.substring(start, end).length;
var right = body.substring(rightpos, end);
document.forms[form].elements[text].value = left + middle + right;
} else {
document.forms[form].elements[text].value = document.forms[form].elements[text].value + "[hide][/hide]";
}
$s = preg_replace("/\[\*\]/", "<li>", $s); //[hide]Text[/hide] via Tiloup @support-tt-france.fr
while (preg_match("/\[hide\]\s*((\s|.)+?)\s*\[\/hide\]\s*/i", $s))
$s = preg_replace(
"/\[hide\]\s*((\s|.)+?)\s*\[\/hide\]\s*/i",
"<div style='margin:20px; margin-top:5px'><div><input type='button' value='View' style='text-align:center;width:100px;margin:0px;padding:0px;' onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Close'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'View'; }\" /></div><br/><div><div style='display: none;'>\\1</div></div></div>",$s);
print("<font color='#ff0000' size='3' class='blink'><b><center>You Got A New PM </font>[<a href='mailbox.php?inbox' target='_blank'>$unreadmail</a>]</center></b></a></font> ");@keyframes marquee {
0% { transform: translate(0, 0); }
100% { transform: translate(-100%, 0); }
}
.blink {
-webkit-animation: 2s linear infinite condemed_blink_effect; // for android
animation: 2s linear infinite condemed_blink_effect;
}
@-webkit-keyframes condemed_blink_effect { // for android
0% {
visibility: hidden;
}
50% {
visibility: hidden;
}
100% {
visibility: visible;
}
}
@keyframes condemed_blink_effect {
0% {
visibility: hidden;
}
50% {
visibility: hidden;
}
100% {
visibility: visible;
}
} <?php
/*
* TorrentTrader v2.xx
* http://www.torrenttrader.org/
* By Lee Howarth.
*/
class Facebook
{
private $_path = array(
'login' => 'https://www.facebook.com/dialog/oauth?',
'token' => 'https://graph.facebook.com/oauth/access_token?',
'graph' => 'https://graph.facebook.com/me?'
);
private $_info = array(
'apikey' => 'key_here',
'secret' => 'key_here'
);
public function getAuth()
{
$data = array
(
'client_id' => $this->_info['apikey'],
'redirect_uri' => 'http://site.com/account-signup.php?do=facebook',
'scope' => 'email,offline_access,publish_stream'
);
header('Location: ' . $this->_path['login'] . http_build_query($data));
}
public function getToken($code = null)
{
$data = array
(
'client_id' => $this->_info['apikey'],
'redirect_uri' => 'http://site.com/account-signup.php?do=facebook',
'client_secret' => $this->_info['secret'],
'code' => $code
);
$path = $this->_path['token'] . http_build_query($data);
if (($token = $this->_request($path)) && ($user = $this->_request($this->_path['graph'] . $token)))
{
return array('token' => $token, 'user' => json_decode($user));
}
return ( bool ) false;
}
private function _request($path)
{
if (extension_loaded('curl'))
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $path);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$data = curl_exec($ch);
curl_close($ch);
}
else
{
$data = file_get_contents($path);
}
return $data;
}
}
?>