Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Free Torrent Source > Mods & Themes
Reply
  #1  
Old 12th October 2009, 20:09
Edgein's Avatar
Edgein Edgein is offline
Senior Member
 
Join Date: Sep 2008
Netherlands
Posts: 154
Smile [FTS 1.1] Nice youtube mod
Hello
Here is a youtube mod what once made by a m8 of me
I've made it also for FTS

Click the image to open in full size.


Click the image to open in full size.


Click the image to open in full size.

Here we go

First the db tables

PHP Code:
CREATE TABLE `commentstube` (
  `
idint(10unsigned NOT NULL auto_increment,
  `
userint(10unsigned NOT NULL default '0',
  `
tubeint(10unsigned NOT NULL default '0',
  `
addeddatetime NOT NULL default '0000-00-00 00:00:00',
  `
texttext collate latin1_german1_ci NOT NULL,
  `
ori_texttext collate latin1_german1_ci NOT NULL,
  `
editedbyint(10unsigned NOT NULL default '0',
  `
editedatdatetime NOT NULL default '0000-00-00 00:00:00',
  `
requestint(11NOT NULL default '0',
  `
offerint(11NOT NULL default '0',
  
PRIMARY KEY  (`id`),
  
KEY `user` (`user`),
  
KEY `tube` (`tube`)
ENGINE=MyISAM AUTO_INCREMENT=DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci AUTO_INCREMENT=
PHP Code:
CREATE TABLE `tube` (
  `
idint(10unsigned NOT NULL auto_increment,
  `
namevarchar(255NOT NULL,
  `
tubesvarchar(255NOT NULL,
  `
addeddatetime NOT NULL default '0000-00-00 00:00:00',
  `
viewsint(10unsigned NOT NULL default '0',
  `
commentsint(10unsigned NOT NULL default '0',
  `
descrtext NOT NULL,
  `
ori_descrtext NOT NULL,
  `
ownerint(10unsigned NOT NULL default '0',
  `
last_actiondatetime NOT NULL default '0000-00-00 00:00:00',
  `
picssvarchar(255NOT NULL,
  
PRIMARY KEY  (`id`)
ENGINE=MyISAM AUTO_INCREMENT=DEFAULT CHARSET=latin1 AUTO_INCREMENT=
PHP Code:
CREATE TABLE `tubehits` (
  `
idint(10unsigned NOT NULL auto_increment,
  `
useridint(10unsigned NOT NULL default '0',
  `
hitidint(10unsigned NOT NULL default '0',
  `
numberint(10unsigned NOT NULL default '0',
  `
addeddatetime NOT NULL default '0000-00-00 00:00:00',
  
PRIMARY KEY  (`id`)
ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 
then include/globalfunctions.php

Find
PHP Code:
    $s preg_replace"/\[u\]((\s|.)+?)\[\/u\]/i""<u>\\1</u>"$s ) ; 
and place under this

PHP Code:
      $s preg_replace("/\[video2=[^\s'\"<>]*youtube.com.*v=([^\s'\"<>]+)\]/ims""<object width=\"554\" height=\"324\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\1\"></param><embed src=\"http://www.youtube.com/v/\\1\" type=\"application/x-shockwave-flash\" width=\"554\" height=\"324\"></embed></object>"$s);


      
$s preg_replace("/\[video=[^\s'\"<>]*youtube.com.*v=([^\s'\"<>]+)\]/ims""<object width=\"425\" height=\"250\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\1\"></param><embed src=\"http://www.youtube.com/v/\\1\" type=\"application/x-shockwave-flash\" width=\"300\" height=\"250\"></embed></object>"$s);
      
$s preg_replace("/\[video=[^\s'\"<>]*video.google.com.*docid=(-?[0-9]+).*\]/ims""<embed style=\"width:425px; height:250px;\" id=\"VideoPlayback\" align=\"middle\" type=\"application/x-shockwave-flash\" src=\"http://video.google.com/googleplayer.swf?docId=\\1\" allowScriptAccess=\"sameDomain\" quality=\"best\" bgcolor=\"#ffffff\" scale=\"noScale\" wmode=\"window\" salign=\"TL\"  FlashVars=\"playerMode=embedded\"> </embed>"$s); 
then include/functions.php

find

PHP Code:
function downloaderdata($res)
{
    
$rows = array();
    
$ids = array();
    
$peerdata = array();
    while (
$row mysql_fetch_assoc($res)) {
        
$rows[] = $row;
        
$id $row["id"];
        
$ids[] = $id;
        
$peerdata[$id] = array(downloaders => 0seeders => 0comments => 0);
    }
    if (
count($ids)) {
        
$allids implode(","$ids);
        
$res mysql_query("SELECT COUNT(*) AS c, torrent, seeder FROM peers WHERE torrent IN ($allids) GROUP BY torrent, seeder");
        while (
$row mysql_fetch_assoc($res)) {
            if (
$row["seeder"] == "yes")
                
$key "seeders";
            else
                
$key "downloaders";
            
$peerdata[$row["torrent"]][$key] = $row["c"];
        }
        
$res mysql_query("SELECT COUNT(*) AS c, torrent FROM comments WHERE torrent IN ($allids) GROUP BY torrent");
        while (
$row mysql_fetch_assoc($res)) {
            
$peerdata[$row["torrent"]]["comments"] = $row["c"];
        }
    }
    return array(
$rows$peerdata);

and place under this

PHP Code:
function get_tube($id)
    {
    
$id $id;
    
$res mysql_query("SELECT tubes FROM tube WHERE id = '$id'");
    
$row mysql_fetch_array($res);
    if (
$row)
        return 
$row['tubes'];
    }


/**
 * tubetable()
 *
 * @param mixed $rows
 * @return
 */
function tubetable($rows)
{
    global 
$CURUSER;
    
begin_main_frame('100%');
    
begin_frame(''false'10''100%');
    
$count 0;
    foreach (
$rows as $row) {
        print (
"<p class=sub>#" $row["id"] . " by ");
        if (isset(
$row["username"])) {
            
$a sql_query("SELECT class FROM users WHERE id = '$row[user]'");
            
$class mysql_fetch_assoc($a);
            
$title $row["title"];
            if (
$title == "")
                
$title get_user_class_name($row["class"]);
            else
                
$title htmlspecialchars(trim($title));
            print (
"<a name=comm" $row["id"] . " href=userdetails.php?id=" $row["user"] .
                
"><b>" get_style($class['class'], $row["username"]) . "</b></a>" . ($row["donor"] ==
                
"yes" "<img src=pic/star.gif alt='Donor'>" "") . ($row["warned"] == "yes" ?
                
"<img src=" "pic/warned.gif alt=\"Warned\">" "") . " ($title)\n");
        } else
            print (
"<a name=\"comm" $row["id"] . "\"><i>(orphaned)</i></a>\n");
        print (
" at " $row["added"] . " GMT" . ($row["user"] == $CURUSER["id"] ||
            
get_user_class() >= UC_MODERATOR "- [<a href=commenttube.php?action=edit&amp;cid=$row[id]>Edit</a>]" :
            
"") . (get_user_class() >= UC_MODERATOR ?
            
"- [<a href=deletecommenttube.php?id=$row[id]>Delete</a>]" "") . ($row["editedby"] &&
            
get_user_class() >= UC_MODERATOR ?
            
"- [<a href=commenttube.php?action=vieworiginal&cid=$row[id]>View original</a>]" :
            
"") . "</p>\n");
        
$avatar = ($CURUSER["avatars"] == "yes" htmlspecialchars(trim($row["avatar"])) :
            
"");
        if (!
$avatar)
            
$avatar "pic/default_avatar.gif";
        
$text format_comment($row["text"]);
        if (
$row["editedby"])
            
$text .= "<p><font size=1 class=small>Last edited by <a href=userdetails.php?id=$row[editedby]><b>$row[username]</b></a> at $row[editedat] GMT</font></p>\n";
            
$text apply_filters("comment_text",$text);
        
begin_table(true);
        
$dt gmtime() - 180;
        
$dt sqlesc(get_date_time($dt));
        print (
"<tr>\n");
        print (
"<td align=center width=100 height=100 style='padding: 0px'><img width=100 height=100 src=$avatar></td>\n");
        print (
"<td class=text valign=top>$text</td>\n");
        print (
"</tr>\n");
        print (
"<tr><td colspan=2> " . ("'" $row['last_access'] . "'" $dt ?
            
"<img src=pic/user_online.gif border=0 alt=\"Online\">" :
            
"<img src=pic/user_offline.gif border=0 alt=\"Offline\">") . "<a href=\"sendmessage.php?receiver=" .
            
htmlspecialchars(trim($row["user"])) . "\"><img src=\"pic/pm.gif\" border=\"0\" alt=\"Send message to " .
            
htmlspecialchars($row["username"]) . "\"></a> <a href=\"report.php?commentid=" .
            
htmlspecialchars(trim($row["id"])) . "\"><img src=\"pic/report.gif\" border=\"0\" alt=\"Report this comment\"></a></td>");
        
end_table();
    }
    
end_frame();
    
end_main_frame();

than create a file called youtube.php

PHP Code:
<?
require "include/bittorrent.php";
dbconn();
loggedinorreturn();

stdhead("youtube");

begin_main_frame('92%');
print(
"<table width=92% align=center class=bottom border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>");
print 
"<br>";
print(
"<center><a href=Upload_tube.php><img src=youtube/upload_movie.gif border=0></a>");
print 
"<br>";
print 
"<br>";
?>
<div align=center><h2>Youtube movies</h2>
<?
print("<table width=100% background=/youtube/bg.jpg border=0 cellspacing=0 cellpadding=10><tr><td class=embedded><br>");
print (
"<center><font color=black>$pagertop</center>");

$res mysql_query("SELECT count(tube.id) FROM tube") or die(mysql_error());
$arr mysql_fetch_array($res);
$count $arr[0];
$perpage 10;
$limit 99999999999999;
list(
$pagertop$pagerbottom$limit) = pager($perpage$count$_SERVER["PHP_SELF"] ."?" "&" );
$res mysql_query("SELECT * from tube ORDER BY added DESC $limit") or sqlerr(__FILE____LINE__);
 while (
$row mysql_fetch_assoc($res))
    {    
$id $row['id'];
$picss $row['picss'];
$descr $row['descr'];
$added $row['added'];
$views $row['views'];
$comments $row['comments'];
$name $row['name'];
$name str_replace('_'' ' $name);
$name str_replace('.'' ' $name);
$name substr($name0100);
print 
"<table class=mainouter width=99% border=1 cellspacing=0 cellpadding=0>\n";
print 
"<tr>\n";
print 
"<td bgcolor=white width=10%>\n";
print 
"<img src=".$picss.">";
print(
"</td>");
print(
"</td>");
print(
"<td background=/youtube/tube_table.gif width=99%>");
print(
"<table border=0 cellspacing=0 cellpadding=0 style='background: transparent'>");
print(
"<tr>");
print 
"<td class=embedded colspan=4 rowspan=2 width=800 align=center>
<font size=4 color=white>&nbsp;&nbsp;&nbsp;&nbsp;Movie:&nbsp;<a href=
$BASEURL/tubedetails.php?id=$id><font color=white>".$name."</font></size></a><br>";
print 
"<p>
<font size=1 color=white>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
.$descr.".</p><br>";
print 
"<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Views:</strong>&nbsp;".$views."&nbsp;| <strong>Date:</strong>&nbsp;".$added."&nbsp;| <strong>comments</strong>&nbsp;".$comments."&nbsp;</td></table></td></td><br>\n";
    }
print 
"</tr>\n";
print 
"</td></tr>\n";
print(
$pagerbottom);
end_main_frame();
stdfoot();
?>
Create a file called Upload_tube.php

PHP Code:
<?
require_once("include/bittorrent.php");
dbconn(false);
loggedinorreturn();


stdhead("youtube movie uploaden");
page_start(98);
?>
<div align=center><h2>Upload a movie here</h2>
<?

begin_main_frame
('92%');

print 
"</form><br>";
print 
"<div align=center>";
print 
"<form enctype='multipart/form-data' action='takentube.php' method=post>";
print 
"<table width=80% background='youtube/bg.jpg' border=1 cellspacing=0 cellpadding=5>";
print 
"<tr><td>";
print 
"&nbsp;&nbsp;<font size=2 color=white><b>Youtube url:<br>";
print 
"<input maxlength=55 type=text name=tubes size=82>";
print 
"<br><font size=2 color=white><b>(Example http://www.youtube.com/watch?v=yqq5fcPYrLs )";
print 
"</td></tr>";
print 
"<tr><td>";
print 
"&nbsp;&nbsp;<font size=2 color=white><b>Youtube pic:<br>";
print 
"<input maxlength=100 type=text name=picss size=82>";
print 
"<br><font size=2 color=white><b>Click on the picture properties and put.jpg behind.(Example http://i4.ytimg.com/vi/gYxhfFR35gA/default.jpg?e=thm_100.jpg )";
print 
"</td></tr>";
print 
"<tr><td>";
print 
"&nbsp;&nbsp;<font size=2 color=white><b>Name on the youtube site:<br>";
print 
"<input maxlength=55 type=text name=name size=82>";
print 
"<br><font size=2 color=white><b>(Maximum length is 55 characters text name.)";
print 
"</td></tr>";
print 
"<tr><td>";
print 
"&nbsp;&nbsp;<font size=2 color=white><b>Description of the Youtube Film:<br>";
print 
"<textarea maxlength=120 name=descr rows=18 cols=150></textarea>";
print 
"<br><font size=2 color=white><b>(<b>Description of the Youtube not to large</b> !.)";
print 
"</td></tr>";
print 
"<input type=submit style='height:30px;width:300;color:white;background:orange;font-weight:bold' value='Send details of the new Youtube Movie'>";
print 
"</table></form>";
print 
"<br>";

print 
"<br>";
end_main_frame();
stdfoot();
?>
Create a file called tubedetails.php

PHP Code:
<?
require "include/bittorrent.php";
dbconn();
loggedinorreturn();

if (!
mkglobal("id"))
    
stderr("Error""there is something wrong.");

$id = (int)$id;

if (!isset(
$id) || !$id)
    
stderr("Error""there is something wrong.");


$res mysql_query("SELECT COUNT(*) FROM tubehits WHERE hitid = $id") or sqlerr(); // *1
$row mysql_fetch_row($res); // *1
$tubeviews $row[0]; // *1

if (!$_GET["hit"] && $CURUSER["id"] <> $user["id"]) {
  
$res mysql_query("SELECT added FROM tubehits WHERE userid = $CURUSER[id] AND hitid = $id LIMIT 1") or sqlerr(); // *3
  
$row mysql_fetch_row($res); // *3
  
if ($row[0] > get_date_time(gmtime() - 3600)) { // *3
    
header("Location: $BASEURL$_SERVER[REQUEST_URI]&hit=1"); // *3
  
} else { // *3

    
$hitnumber $tube["views"] + 1// *2
    
mysql_query("UPDATE tube SET views = views + 1 WHERE id = $id") or sqlerr();
    
mysql_query("INSERT INTO tubehits (userid, hitid, number, added) VALUES($CURUSER[id]$id$hitnumber, '".get_date_time()."')") or sqlerr();
    
header("Location: $BASEURL$_SERVER[REQUEST_URI]&hit=1");
  } 
// *3
}


stdhead("Details Youtube");
print(
"<table width=45% align=center class=bottom border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>");
print 
"<br>";

$id $id;
$res mysql_query("SELECT * FROM tube WHERE id = '$id'");
$row mysql_fetch_array($res);


$picss $row['picss'];
$descr $row['descr'];
$added $row['added'];
$views $row['views'];
$comments $row['comments'];
$name $row['name'];
$name str_replace('_'' ' $name);
$name str_replace('.'' ' $name);
$name substr($name0100);
        print(
"<h2>Details of " $row["name"] . "</h2>\n");

print(
"<table width=100% border=0 cellspacing=0 cellpadding=10><tr><td class=embedded><br>"); 
$movie unesc($row["tubes"]);
$tubes "[video2=".$movie."]\n";
if (
get_tube($row['id']))
print 
"<div width=554 height=324 align=center><object width=10 height=10>".format_comment($tubes)."</object></center>";
else
print 
"<div width=554 height=324 align=center><object width=10 height=10>".format_comment($tubes)."</object></center>";

print 
"<br></div></center>";
print 
"<left><font size=4 color=#306A82>&nbsp;&nbsp;&nbsp;Description:<br>";
print 
"<left><font size=3 color=#306A82>&nbsp;&nbsp;&nbsp;&nbsp;".$descr."<br><br>";
print 
"<left><font size=4 color=#306A82>&nbsp;&nbsp;&nbsp;Stats:<br>";
print 
"<left><font size=3 color=#306A82>&nbsp;&nbsp;&nbsp;&nbsp;Date:&nbsp;<font size=2>".$added."<br>";
print 
"<left><font size=3 color=#306A82>&nbsp;&nbsp;&nbsp;&nbsp;Views:&nbsp;<font size=2>".$views."<br>";
print 
"<left><font size=3 color=#306A82>&nbsp;&nbsp;&nbsp;&nbsp;Comments:&nbsp;<font size=2>".$comments."<br>";
print 
"</td></tr></table>";


        




        
$alle_comment get_row_count("commentstube","WHERE tube=".$id);

        
        print 
"<center><p><a name=\"startcomments\"></a></p>\n";
        print 
"<table width=100% class=bottom cellspacing=0 cellpadding=0>";
        print 
"<tr><td class=colheadsite height=25><div align=center>";
collapsee();

    print(
"<p><a name=\"startcomments\"></a></p>\n");

    
$commentbar "<p align=center><a class=index href=commenttube.php?action=add&tid=$id>Add a comment</a></p>\n";
    
$subres sql_query("SELECT COUNT(*) FROM commentstube WHERE tube = $id");
    
$subrow mysql_fetch_array($subres);
    
$count $subrow[0];
?>

<div id="loading-layer" style="display:none;font-family: Verdana;font-size: 11px;width:200px;height:50px;background:#FFF;padding:10px;text-align:center;border:1px solid #000">
<div style="font-weight:bold" id="loading-layer-text">Loading. Please, wait...</div><br />
<img src="pic/loader.gif" border="0" />
</div>

<?php
    
if (!$count) {
        print(
"<h2>No comments yet</h2>\n");
    }
    else {
        echo 
"<span id=commentarea>";
        list(
$pagertop$pagerbottom$limit) = pager(20$count"tubedetails.php?id=$id&", array(lastpagedefault => 1));

        
$subres sql_query("SELECT commentstube.id, text, user, commentstube.added, editedby, editedat, avatar, warned, ".
                  
"username, title, class, last_access, donor FROM commentstube LEFT JOIN users ON commentstube.user = users.id WHERE tube = " .
                  
"$id ORDER BY commentstube.id $limit") or sqlerr(__FILE____LINE__);
        
$allrows = array();
        while (
$subrow mysql_fetch_array($subres))
            
$allrows[] = $subrow;
        
        print(
$commentbar);
        print(
$pagertop);

        
tubetable($allrows);

        print(
$pagerbottom);
        echo 
"</span>";
    }
    
?>
    <div id="ajax"></div>
    <script language=javascript>
function SmileIT(smile,form,text){
   document.forms[form].elements[text].value = document.forms[form].elements[text].value+" "+smile+" ";
   document.forms[form].elements[text].focus();
}
</script>
<?php
if($usergroups[canpc] == 'yes') {
    print(
"<BR>");
    
JsB::bbedit();
    
collapses('quickreply','<font color=white><b>Quick Comment</b></font>','100',0,'class=thead','class=tcat');
    print (
"<table style='border:1px solid #000000;' width=100%><tr>".
  
"<td style='padding:10px;text-align:center;'><p><br />".
  
"<form name=comment method=\"post\" action=\"commenttube.php\">".
"<input type=hidden name=action value=add />".
"<input type=hidden name=tid value=".$id." />".
  
"<center><textarea name=\"text\" rows=\"4\" cols=\"90\" class=\"markItUp\"></textarea></center>");

  
?>

  <center><a href="javascript: SmileIT(';-)','comment','text')"><img src=pic/smilies/wink.gif width="20" height="20" border=0></a><a href="javascript: SmileIT(':-P','comment','text')"><img src=pic/smilies/tongue.gif width="20" height="20" border=0></a><a href="javascript: SmileIT(':-)','comment','text')"><img border=0 src=pic/smilies/smile1.gif></a><a href="javascript: SmileIT(':w00t:','comment','text')"><img border=0 src=pic/smilies/w00t.gif></a><a href="javascript: SmileIT(':-D','comment','text')"><img border=0 src=pic/smilies/grin.gif></a><a href="javascript: SmileIT(':lol:','comment','text')"><img border=0 src=pic/smilies/laugh.gif></a><a href="javascript: SmileIT(':-/','comment','text')"><img border=0 src=pic/smilies/confused.gif></a><a href="javascript: SmileIT(':-(','comment','text')"><img border=0 src=pic/smilies/sad.gif></a><a href="javascript: SmileIT(':-O','comment','text')"><img src=pic/smilies/ohmy.gif border=0></a><a href="javascript: SmileIT('8-)','comment','text')"><img src=pic/smilies/cool1.gif width="18" height="18" border=0></a><a href="javascript: SmileIT(':sly:','comment','text')"><img src=pic/smilies/sly.gif width="18" height="18" border=0></a><a href="javascript: SmileIT(':greedy:','comment','text')"><img src=pic/smilies/greedy.gif width="18" height="18" border=0></a><a href="javascript: SmileIT(':weirdo:','comment','text')"><img src=pic/smilies/weirdo.gif width="18" height="18" border=0></a><a href="javascript: SmileIT(':sneaky:','comment','text')"><img src=pic/smilies/sneaky.gif width="18" height="18" border=0></a><a href="javascript: SmileIT(':shit:','comment','text')"><img src=pic/smilies/shit.gif width="18" height="18" border=0></a><a href="javascript: SmileIT(':?:','comment','text')"><img src=pic/smilies/question.gif width="18" height="18" border=0></a><a href="javascript: SmileIT(':!:','comment','text')"><img src=pic/smilies/excl.gif width="18" height="18" border=0></a></center>
  <?php
  
print("<input type=\"submit\" onClick=\"send(); return false;\" class=btn value=\"Submit\" name=\"submitb\" id=\"submitb\" />".
"</form></p></td></tr></table>");
collapsee();
    print(
$commentbar);}
    
    
stdfoot();
?>
create a file called takentube.php

PHP Code:
<?
require_once("include/benc.php");
require_once(
"include/bittorrent.php");
dbconn();
loggedinorreturn();

if (
get_user_class() < UC_USER)
    
site_error_message("Foutmelding""U heeft hier geen rechten.");

$tubes $_POST['tubes'];
$picss $_POST['picss'];
$name =  $_POST['name'];
$descr $_POST['descr'];
    



    if (!
$tubes)
        
site_error_message("Foutmelding""Geen Yourtube ontvangen om te verwerken.");

      if (!
$picss)
        
site_error_message("Foutmelding""Geen foto ontvangen om te verwerken.");

    if (!
$name)
        
site_error_message("Foutmelding""Geen Naam ontvangen om te verwerken.");


    if (!
$tubes)
        
site_error_message("Foutmelding""Geen Omschrijfing ontvangen om te verwerken.");
    

    
$tubes sqlesc($tubes);
      
$picss sqlesc($picss);
      
$name sqlesc($name);
      
$descr sqlesc($descr);
    
$added sqlesc(get_date_time());
    
$owner $CURUSER['id'];

    
mysql_query("INSERT INTO tube (tubes, name, picss, descr, added, owner) VALUES ($tubes$name$picss$descr$added$owner)") or sqlerr(__FILE____LINE__);
    
$extra_text "Gegevens van nieuw verzoekje zijn opgeslagen";
      

header("Location: $BASEURL/youtube.php");
    
    
?>
Create a file called commenttube.php

PHP Code:
<?

require_once("include/bittorrent.php");

if (!
mkglobal("action"))
    die();

if (
$id)
 
$id $id;
//$action = $_GET["action"];
//$action = $_POST["action"];

dbconn(false);

loggedinorreturn();

if (
$action == "add")
{
  if (
$_SERVER["REQUEST_METHOD"] == "POST")
  {
    
$tubeid $_POST["tid"];
      if (!
is_valid_id($tubeid))
            
stderr("Foutmelding""Fout ID $tubeid.");

        
$res mysql_query("SELECT name FROM tube WHERE id = $tubeid") or sqlerr(__FILE__,__LINE__);
        
$arr mysql_fetch_array($res);
        if (!
$arr)
          
stderr("Foutmelding""Geen torrent met ID $tubeid.");

      
$text trim($_POST["text"]);
      if (!
$text)
            
stderr("Foutmelding""Bericht mag niet leeg zijn!");

      
mysql_query("INSERT INTO commentstube (user, tube, added, text, ori_text) VALUES (" .
          
$CURUSER["id"] . ",$tubeid, '" get_date_time() . "', " sqlesc($text) .
           
"," sqlesc($text) . ")");

      
$newid mysql_insert_id();

      
mysql_query("UPDATE tube SET comments = comments + 1 WHERE id = $tubeid");

      
header("Refresh: 0; url=tubedetails.php?id=$tubeid&viewcomm=$newid#comm$newid");

    
      die;
    }

  
$tubeid $_GET["tid"];
  if (!
is_valid_id($tubeid))
        
stderr("Foutmelding""Foutief ID $tubeid.");

    
$res mysql_query("SELECT name FROM tube WHERE id = $tubeid") or sqlerr(__FILE__,__LINE__);
    
$arr mysql_fetch_array($res);
    if (!
$arr)
      
stderr("Foutmelding""Geen torrent gevonden met ID $tubeid.");

    
stdhead("Commentaar toeoegen \"" $arr["name"] . "\"");

    print(
"<h1>Commentaar toevoegen aan \"" htmlspecialchars($arr["name"]) . "\"</h1>\n");
    print(
"<p><form name=new_comment method=\"post\" action=\"commenttube.php?action=add\">\n");
    print(
"<input type=\"hidden\" name=\"tid\" value=\"$tubeid\"/>\n");
    print(
"<textarea name=\"text\" rows=\"12\" cols=\"90\"></textarea></p>\n");
    print(
"<p><input type=\"submit\" class=btn value=\"Opslaan\" /></p></form>\n");
?>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
document.new_comment.text.focus();
//-->
</script>
<?

    $res 
mysql_query("SELECT comments.id, text, comments.added, username, users.id as user, users.avatar FROM commentstube LEFT JOIN users ON comments.user = users.id WHERE tube = $tubeid ORDER BY comments.id DESC LIMIT 5");

    
$allrows = array();
    while (
$row mysql_fetch_array($res))
      
$allrows[] = $row;

    if (
count($allrows)) {
      print(
"<h2>Laatste commentaren, in omgekeerde volgorde</h2>\n");
      
commenttable($allrows);
    }

  print 
"<br>";
  
stdfoot();
  
    die;
}
elseif (
$action == "edit")
{
  
$commentid $_GET["cid"];
  if (!
is_valid_id($commentid))
        
stderr("Foutmelding""Foutief ID $commentid.");

  
$res mysql_query("SELECT c.*, t.name FROM commentstube AS c LEFT JOIN tube AS t ON c.tube = t.id WHERE c.id=$commentid") or sqlerr(__FILE__,__LINE__);
  
$arr mysql_fetch_array($res);
  if (!
$arr)
      
stderr("Foutmelding""Foutief ID $commentid.");

    if (
$arr["user"] != $CURUSER["id"] && get_user_class() < UC_MODERATOR)
        
stderr("Foutmelding""Toegang geweigerd.");

    if (
$_SERVER["REQUEST_METHOD"] == "POST")
    {
      
$text $_POST["text"];
    
$returnto $_POST["returnto"];

      if (
$text == "")
          
stderr("Foutmelding""Bericht mag niet leeg zijn!");

      
$text sqlesc($text);

      
$editedat sqlesc(get_date_time());

      
mysql_query("UPDATE commentstube SET text=$text, editedat=$editedat, editedby=$CURUSER[id] WHERE id=$commentid") or sqlerr(__FILE____LINE__);

        if (
$returnto)
          
header("Location: $returnto");
        else
          
header("Location: $BASEURL/");      // change later ----------------------

      
        
die;
    }

     
stdhead("Commentaar bewerken \"" $arr["name"] . "\"");

    print(
"<h1>Bewerk het commentaar van \"" htmlspecialchars($arr["name"]) . "\"</h1><p>\n");
    print(
"<form name=edit_comment method=\"post\" action=\"commenttube.php?action=edit&amp;cid=$commentid\">\n");
    print(
"<input type=\"hidden\" name=\"returnto\" value=\"" $_SERVER["HTTP_REFERER"] . "\" />\n");
    print(
"<input type=\"hidden\" name=\"cid\" value=\"$commentid\" />\n");
    print(
"<textarea name=\"text\" rows=\"12\" cols=\"90\">" stripslashes(htmlspecialchars($arr["text"])) . "</textarea></p>\n");
    print(
"<p><input type=\"submit\" class=btn value=\"Opslaan\" /></p></form>\n");
?>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
document.edit_comment.text.focus();
//-->
</script>
<?

    
print "<br>";
    
stdfoot();
  
    die;
}
elseif (
$action == "delete")
{
    if (
get_user_class() < UC_MODERATOR)
        
stderr("Foutmelding""Toegang geweigerd.");

  
$commentid $_GET["cid"];

  if (!
is_valid_id($commentid))
        
stderr("Foutmelding""Foutief ID $commentid.");

  
$sure $_GET["sure"];

  if (!
$sure)
  {
         
$referer $_SERVER["HTTP_REFERER"];
        
stderr("Delete comment""You are about to delete a comment. Click\n" .
            
"<a href=?action=delete&cid=$commentid&sure=1" .
            (
$referer "&returnto=" urlencode($referer) : "") .
            
">here</a> if you are sure.");
  }


    
$res mysql_query("SELECT commentstube FROM comments WHERE id=$commentid")  or sqlerr(__FILE__,__LINE__);
    
$arr mysql_fetch_array($res);
    if (
$arr)
        
$tubeid $arr["tube"];

    
mysql_query("DELETE FROM commentstube WHERE id=$commentid") or sqlerr(__FILE__,__LINE__);
    if (
$torrentid && mysql_affected_rows() > 0)
        
mysql_query("UPDATE tube SET comments = comments - 1 WHERE id = $tubeid");

    
$returnto $_GET["returnto"];

    if (
$returnto)
      
header("Location: $returnto");
    else
      
header("Location: $BASEURL/");      // change later ----------------------

  
    
die;
}
elseif (
$action == "vieworiginal")
{
    if (
get_user_class() < UC_MODERATOR)
        
stderr("Foutmelding""Toegang geweigerd.");

  
$commentid $_GET["cid"];

  if (!
is_valid_id($commentid))
        
stderr("Foutmelding""Foutief ID $commentid.");

  
$res mysql_query("SELECT c.*, t.name FROM commentstube AS c JOIN tube AS t ON c.tube = t.id WHERE c.id=$commentid") or sqlerr(__FILE__,__LINE__);
  
$arr mysql_fetch_array($res);
  if (!
$arr)
      
stderr("Foutmelding""Foutief ID $commentid.");

  
stdhead("Original comment");
  print(
"<h1>Original contents of comment #$commentid</h1><p>\n");
    print(
"<table width=500 border=1 cellspacing=0 cellpadding=5>");
  print(
"<tr><td class=comment>\n");
    echo 
htmlspecialchars($arr["ori_text"]);
  print(
"</td></tr></table>\n");

  
$returnto $_SERVER["HTTP_REFERER"];

//    $returnto = "crazydetails.php?id=$tubeid&amp;viewcomm=$commentid#$commentid";

    
if ($returnto)
         print(
"<p><font size=small>(<a href=$returnto>back</a>)</font></p>\n");

    print 
"<br>";
    
stdfoot();
  
    die;
}
else
    
stderr("error""unknown aktion $action");

die;
?>
upload al to the root folder
inclusif the Attach folder
Attached Files
File Type: rar youtube.rar (5.4 KB, 56 views)
Reply With Quote
The Following User Says Thank You to Edgein For This Useful Post:
Phogo (13th October 2009)
  #2  
Old 24th October 2009, 11:02
george11's Avatar
george11 george11 is offline
Member
 
Join Date: Aug 2008
P2P
Posts: 6
Default
Hi.

Tanks the hack.
I'm not work one thing .
The "collapsee" function where may he be?

Not .js file?

Sorry, my bad English.
Reply With Quote
  #3  
Old 24th October 2009, 13:17
Edgein's Avatar
Edgein Edgein is offline
Senior Member
 
Join Date: Sep 2008
Netherlands
Posts: 154
Smile
lol can it be some clearer understand what you mean here
Reply With Quote
  #4  
Old 2nd December 2009, 03:53
yoligim yoligim is offline
Senior Member
 
Join Date: Nov 2009
Spain
Posts: 43
Default
I,ve followed your instructions and when I click on upload a movie here, it goes to "Upload_tube.php" and nothing happen...any ideas?
by the way I would like to have a Shoutcast and some casino, blackjack, poker games...anybody knows if there is the code for that in FTS 1.1?
Also some Arcade for FTS 1.1...
Thanks in advance
Reply With Quote
  #5  
Old 2nd December 2009, 23:22
Edgein's Avatar
Edgein Edgein is offline
Senior Member
 
Join Date: Sep 2008
Netherlands
Posts: 154
Default
please send my youre url of the site by pm then i wil see wat the problem is
Reply With Quote
  #6  
Old 7th November 2011, 09:58
raptor666 raptor666 is offline
Member
 
Join Date: Nov 2011
Hungary
Posts: 6
Default
Someone put me up for a complete engine

PLS!
Please
Sorry google transfer....
Reply With Quote
Reply

Tags
11 , fts , mod , nice , youtube

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nice ofshore hosting wMan Seedbox & Hosting 5 29th June 2009 15:41
Hello all and Nice to meet you .. bravo.. ff290g Introduce Yourself 0 9th April 2009 05:22
Nice... and a problem (of course) bfsilas Torrent Strike 1 24th March 2009 20:26
nice to be here bocciaroccia Introduce Yourself 1 1st January 2009 19:46
nice shoutbox snakebite Community Cafe 0 29th May 2008 17:45



All times are GMT +2. The time now is 19:42. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.